var aq=Object.defineProperty;var oT=e=>{throw TypeError(e)};var lq=(e,t,n)=>t in e?aq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var oc=(e,t,n)=>lq(e,typeof t!="symbol"?t+"":t,n),j_=(e,t,n)=>t.has(e)||oT("Cannot "+n);var Q=(e,t,n)=>(j_(e,t,"read from private field"),n?n.call(e):t.get(e)),Ne=(e,t,n)=>t.has(e)?oT("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ce=(e,t,n,r)=>(j_(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Qe=(e,t,n)=>(j_(e,t,"access private method"),n);var lm=(e,t,n,r)=>({set _(i){Ce(e,t,i,n)},get _(){return Q(e,t,r)}});/*!
 * %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 *                     _            _       _           _       
 *                    | |___  __   / \   __| |_ __ ___ (_)_ __  
 *                    | __\ \/ /  / _ \ / _` | '_ ` _ \| | '_ \ 
 *                    | |_ >  <  / ___ \ (_| | | | | | | | | | |
 *                     \__/_/\_\/_/   \_\__,_|_| |_| |_|_|_| |_|
 *                                                              
 * %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 * 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-2024 André Tabarra <maintainer@txadmin.gg>
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 * %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 * 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 cq(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 $o=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function bn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Q8={exports:{}},Wv={},J8={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 wp=Symbol.for("react.element"),uq=Symbol.for("react.portal"),dq=Symbol.for("react.fragment"),hq=Symbol.for("react.strict_mode"),fq=Symbol.for("react.profiler"),pq=Symbol.for("react.provider"),mq=Symbol.for("react.context"),gq=Symbol.for("react.forward_ref"),vq=Symbol.for("react.suspense"),yq=Symbol.for("react.memo"),_q=Symbol.for("react.lazy"),aT=Symbol.iterator;function xq(e){return e===null||typeof e!="object"?null:(e=aT&&e[aT]||e["@@iterator"],typeof e=="function"?e:null)}var Z8={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},e7=Object.assign,t7={};function rd(e,t,n){this.props=e,this.context=t,this.refs=t7,this.updater=n||Z8}rd.prototype.isReactComponent={};rd.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")};rd.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function n7(){}n7.prototype=rd.prototype;function nC(e,t,n){this.props=e,this.context=t,this.refs=t7,this.updater=n||Z8}var rC=nC.prototype=new n7;rC.constructor=nC;e7(rC,rd.prototype);rC.isPureReactComponent=!0;var lT=Array.isArray,r7=Object.prototype.hasOwnProperty,iC={current:null},i7={key:!0,ref:!0,__self:!0,__source:!0};function s7(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)r7.call(t,r)&&!i7.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),c=0;c<o;c++)l[c]=arguments[c+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:wp,type:e,key:s,ref:a,props:i,_owner:iC.current}}function bq(e,t){return{$$typeof:wp,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function sC(e){return typeof e=="object"&&e!==null&&e.$$typeof===wp}function wq(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var cT=/\/+/g;function P_(e,t){return typeof e=="object"&&e!==null&&e.key!=null?wq(""+e.key):t.toString(36)}function pg(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 wp:case uq:a=!0}}if(a)return a=e,i=i(a),e=r===""?"."+P_(a,0):r,lT(i)?(n="",e!=null&&(n=e.replace(cT,"$&/")+"/"),pg(i,t,n,"",function(c){return c})):i!=null&&(sC(i)&&(i=bq(i,n+(!i.key||a&&a.key===i.key?"":(""+i.key).replace(cT,"$&/")+"/")+e)),t.push(i)),1;if(a=0,r=r===""?".":r+":",lT(e))for(var o=0;o<e.length;o++){s=e[o];var l=r+P_(s,o);a+=pg(s,t,n,l,i)}else if(l=xq(e),typeof l=="function")for(e=l.call(e),o=0;!(s=e.next()).done;)s=s.value,l=r+P_(s,o++),a+=pg(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 cm(e,t,n){if(e==null)return e;var r=[],i=0;return pg(e,r,"","",function(s){return t.call(n,s,i++)}),r}function Sq(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},mg={transition:null},Cq={ReactCurrentDispatcher:or,ReactCurrentBatchConfig:mg,ReactCurrentOwner:iC};function o7(){throw Error("act(...) is not supported in production builds of React.")}tt.Children={map:cm,forEach:function(e,t,n){cm(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return cm(e,function(){t++}),t},toArray:function(e){return cm(e,function(t){return t})||[]},only:function(e){if(!sC(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};tt.Component=rd;tt.Fragment=dq;tt.Profiler=fq;tt.PureComponent=nC;tt.StrictMode=hq;tt.Suspense=vq;tt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Cq;tt.act=o7;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=e7({},e.props),i=e.key,s=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,a=iC.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(l in t)r7.call(t,l)&&!i7.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 c=0;c<l;c++)o[c]=arguments[c+2];r.children=o}return{$$typeof:wp,type:e.type,key:i,ref:s,props:r,_owner:a}};tt.createContext=function(e){return e={$$typeof:mq,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:pq,_context:e},e.Consumer=e};tt.createElement=s7;tt.createFactory=function(e){var t=s7.bind(null,e);return t.type=e,t};tt.createRef=function(){return{current:null}};tt.forwardRef=function(e){return{$$typeof:gq,render:e}};tt.isValidElement=sC;tt.lazy=function(e){return{$$typeof:_q,_payload:{_status:-1,_result:e},_init:Sq}};tt.memo=function(e,t){return{$$typeof:yq,type:e,compare:t===void 0?null:t}};tt.startTransition=function(e){var t=mg.transition;mg.transition={};try{e()}finally{mg.transition=t}};tt.unstable_act=o7;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";J8.exports=tt;var C=J8.exports;const rt=bn(C),a7=cq({__proto__:null,default:rt},[C]);/**
 * @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 kq=C,Eq=Symbol.for("react.element"),Tq=Symbol.for("react.fragment"),Mq=Object.prototype.hasOwnProperty,Rq=kq.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Aq={key:!0,ref:!0,__self:!0,__source:!0};function l7(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)Mq.call(t,r)&&!Aq.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:Eq,type:e,key:s,ref:a,props:i,_owner:Rq.current}}Wv.Fragment=Tq;Wv.jsx=l7;Wv.jsxs=l7;Q8.exports=Wv;var h=Q8.exports;const Dq=C.createContext(null),N_={didCatch:!1,error:null};class c7 extends C.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=N_}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(N_)}}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&&Lq(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(N_)}}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=C.createElement(r,l);else if(i===null||C.isValidElement(i))o=i;else throw a}return C.createElement(Dq.Provider,{value:{didCatch:s,error:a,resetErrorBoundary:this.resetErrorBoundary}},o)}}function Lq(){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 zb={},u7={exports:{}},zr={},d7={exports:{}},h7={};/**
 * @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(I,A){var D=I.length;I.push(A);e:for(;0<D;){var H=D-1>>>1,V=I[H];if(0<i(V,A))I[H]=A,I[D]=V,D=H;else break e}}function n(I){return I.length===0?null:I[0]}function r(I){if(I.length===0)return null;var A=I[0],D=I.pop();if(D!==A){I[0]=D;e:for(var H=0,V=I.length,U=V>>>1;H<U;){var G=2*(H+1)-1,ee=I[G],Z=G+1,q=I[Z];if(0>i(ee,D))Z<V&&0>i(q,ee)?(I[H]=q,I[Z]=D,H=Z):(I[H]=ee,I[G]=D,H=G);else if(Z<V&&0>i(q,D))I[H]=q,I[Z]=D,H=Z;else break e}}return A}function i(I,A){var D=I.sortIndex-A.sortIndex;return D!==0?D:I.id-A.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=[],c=[],d=1,u=null,f=3,g=!1,x=!1,_=!1,v=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,m=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(I){for(var A=n(c);A!==null;){if(A.callback===null)r(c);else if(A.startTime<=I)r(c),A.sortIndex=A.expirationTime,t(l,A);else break;A=n(c)}}function b(I){if(_=!1,y(I),!x)if(n(l)!==null)x=!0,F(S);else{var A=n(c);A!==null&&W(b,A.startTime-I)}}function S(I,A){x=!1,_&&(_=!1,p(k),k=-1),g=!0;var D=f;try{for(y(A),u=n(l);u!==null&&(!(u.expirationTime>A)||I&&!M());){var H=u.callback;if(typeof H=="function"){u.callback=null,f=u.priorityLevel;var V=H(u.expirationTime<=A);A=e.unstable_now(),typeof V=="function"?u.callback=V:u===n(l)&&r(l),y(A)}else r(l);u=n(l)}if(u!==null)var U=!0;else{var G=n(c);G!==null&&W(b,G.startTime-A),U=!1}return U}finally{u=null,f=D,g=!1}}var w=!1,E=null,k=-1,T=5,R=-1;function M(){return!(e.unstable_now()-R<T)}function L(){if(E!==null){var I=e.unstable_now();R=I;var A=!0;try{A=E(!0,I)}finally{A?j():(w=!1,E=null)}}else w=!1}var j;if(typeof m=="function")j=function(){m(L)};else if(typeof MessageChannel<"u"){var P=new MessageChannel,$=P.port2;P.port1.onmessage=L,j=function(){$.postMessage(null)}}else j=function(){v(L,0)};function F(I){E=I,w||(w=!0,j())}function W(I,A){k=v(function(){I(e.unstable_now())},A)}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(I){I.callback=null},e.unstable_continueExecution=function(){x||g||(x=!0,F(S))},e.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<I?Math.floor(1e3/I):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(I){switch(f){case 1:case 2:case 3:var A=3;break;default:A=f}var D=f;f=A;try{return I()}finally{f=D}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(I,A){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var D=f;f=I;try{return A()}finally{f=D}},e.unstable_scheduleCallback=function(I,A,D){var H=e.unstable_now();switch(typeof D=="object"&&D!==null?(D=D.delay,D=typeof D=="number"&&0<D?H+D:H):D=H,I){case 1:var V=-1;break;case 2:V=250;break;case 5:V=1073741823;break;case 4:V=1e4;break;default:V=5e3}return V=D+V,I={id:d++,callback:A,priorityLevel:I,startTime:D,expirationTime:V,sortIndex:-1},D>H?(I.sortIndex=D,t(c,I),n(l)===null&&I===n(c)&&(_?(p(k),k=-1):_=!0,W(b,D-H))):(I.sortIndex=V,t(l,I),x||g||(x=!0,F(S))),I},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(I){var A=f;return function(){var D=f;f=A;try{return I.apply(this,arguments)}finally{f=D}}}})(h7);d7.exports=h7;var jq=d7.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 Pq=C,Fr=jq;function fe(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 f7=new Set,xf={};function jl(e,t){Su(e,t),Su(e+"Capture",t)}function Su(e,t){for(xf[e]=t,e=0;e<t.length;e++)f7.add(t[e])}var Ys=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ub=Object.prototype.hasOwnProperty,Nq=/^[: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]*$/,uT={},dT={};function Oq(e){return Ub.call(dT,e)?!0:Ub.call(uT,e)?!1:Nq.test(e)?dT[e]=!0:(uT[e]=!0,!1)}function Iq(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 $q(e,t,n,r){if(t===null||typeof t>"u"||Iq(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 Fn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Fn[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];Fn[t]=new ar(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Fn[e]=new ar(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Fn[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){Fn[e]=new ar(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Fn[e]=new ar(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Fn[e]=new ar(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Fn[e]=new ar(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Fn[e]=new ar(e,5,!1,e.toLowerCase(),null,!1,!1)});var oC=/[\-:]([a-z])/g;function aC(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(oC,aC);Fn[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(oC,aC);Fn[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(oC,aC);Fn[t]=new ar(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Fn[e]=new ar(e,1,!1,e.toLowerCase(),null,!1,!1)});Fn.xlinkHref=new ar("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Fn[e]=new ar(e,1,!1,e.toLowerCase(),null,!0,!0)});function lC(e,t,n,r){var i=Fn.hasOwnProperty(t)?Fn[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&($q(t,n,i,r)&&(n=null),r||i===null?Oq(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 ao=Pq.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,um=Symbol.for("react.element"),Ec=Symbol.for("react.portal"),Tc=Symbol.for("react.fragment"),cC=Symbol.for("react.strict_mode"),Hb=Symbol.for("react.profiler"),p7=Symbol.for("react.provider"),m7=Symbol.for("react.context"),uC=Symbol.for("react.forward_ref"),Wb=Symbol.for("react.suspense"),Vb=Symbol.for("react.suspense_list"),dC=Symbol.for("react.memo"),wo=Symbol.for("react.lazy"),g7=Symbol.for("react.offscreen"),hT=Symbol.iterator;function qd(e){return e===null||typeof e!="object"?null:(e=hT&&e[hT]||e["@@iterator"],typeof e=="function"?e:null)}var en=Object.assign,O_;function Ph(e){if(O_===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);O_=t&&t[1]||""}return`
`+O_+e}var I_=!1;function $_(e,t){if(!e||I_)return"";I_=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var i=c.stack.split(`
`),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{I_=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ph(e):""}function Fq(e){switch(e.tag){case 5:return Ph(e.type);case 16:return Ph("Lazy");case 13:return Ph("Suspense");case 19:return Ph("SuspenseList");case 0:case 2:case 15:return e=$_(e.type,!1),e;case 11:return e=$_(e.type.render,!1),e;case 1:return e=$_(e.type,!0),e;default:return""}}function qb(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 Tc:return"Fragment";case Ec:return"Portal";case Hb:return"Profiler";case cC:return"StrictMode";case Wb:return"Suspense";case Vb:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case m7:return(e.displayName||"Context")+".Consumer";case p7:return(e._context.displayName||"Context")+".Provider";case uC:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case dC:return t=e.displayName||null,t!==null?t:qb(e.type)||"Memo";case wo:t=e._payload,e=e._init;try{return qb(e(t))}catch{}}return null}function Bq(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 qb(t);case 8:return t===cC?"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 aa(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function v7(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function zq(e){var t=v7(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 dm(e){e._valueTracker||(e._valueTracker=zq(e))}function y7(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=v7(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Qg(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 Yb(e,t){var n=t.checked;return en({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function fT(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=aa(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 _7(e,t){t=t.checked,t!=null&&lC(e,"checked",t,!1)}function Kb(e,t){_7(e,t);var n=aa(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")?Gb(e,t.type,n):t.hasOwnProperty("defaultValue")&&Gb(e,t.type,aa(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function pT(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 Gb(e,t,n){(t!=="number"||Qg(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Nh=Array.isArray;function Bc(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=""+aa(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 Xb(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(fe(91));return en({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function mT(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(fe(92));if(Nh(n)){if(1<n.length)throw Error(fe(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:aa(n)}}function x7(e,t){var n=aa(t.value),r=aa(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 gT(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function b7(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 Qb(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?b7(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var hm,w7=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(hm=hm||document.createElement("div"),hm.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=hm.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function bf(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Xh={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},Uq=["Webkit","ms","Moz","O"];Object.keys(Xh).forEach(function(e){Uq.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Xh[t]=Xh[e]})});function S7(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Xh.hasOwnProperty(e)&&Xh[e]?(""+t).trim():t+"px"}function C7(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=S7(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var Hq=en({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 Jb(e,t){if(t){if(Hq[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(fe(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(fe(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(fe(61))}if(t.style!=null&&typeof t.style!="object")throw Error(fe(62))}}function Zb(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 ew=null;function hC(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var tw=null,zc=null,Uc=null;function vT(e){if(e=kp(e)){if(typeof tw!="function")throw Error(fe(280));var t=e.stateNode;t&&(t=Gv(t),tw(e.stateNode,e.type,t))}}function k7(e){zc?Uc?Uc.push(e):Uc=[e]:zc=e}function E7(){if(zc){var e=zc,t=Uc;if(Uc=zc=null,vT(e),t)for(e=0;e<t.length;e++)vT(t[e])}}function T7(e,t){return e(t)}function M7(){}var F_=!1;function R7(e,t,n){if(F_)return e(t,n);F_=!0;try{return T7(e,t,n)}finally{F_=!1,(zc!==null||Uc!==null)&&(M7(),E7())}}function wf(e,t){var n=e.stateNode;if(n===null)return null;var r=Gv(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(fe(231,t,typeof n));return n}var nw=!1;if(Ys)try{var Yd={};Object.defineProperty(Yd,"passive",{get:function(){nw=!0}}),window.addEventListener("test",Yd,Yd),window.removeEventListener("test",Yd,Yd)}catch{nw=!1}function Wq(e,t,n,r,i,s,a,o,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(d){this.onError(d)}}var Qh=!1,Jg=null,Zg=!1,rw=null,Vq={onError:function(e){Qh=!0,Jg=e}};function qq(e,t,n,r,i,s,a,o,l){Qh=!1,Jg=null,Wq.apply(Vq,arguments)}function Yq(e,t,n,r,i,s,a,o,l){if(qq.apply(this,arguments),Qh){if(Qh){var c=Jg;Qh=!1,Jg=null}else throw Error(fe(198));Zg||(Zg=!0,rw=c)}}function Pl(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 A7(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 yT(e){if(Pl(e)!==e)throw Error(fe(188))}function Kq(e){var t=e.alternate;if(!t){if(t=Pl(e),t===null)throw Error(fe(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 yT(i),e;if(s===r)return yT(i),t;s=s.sibling}throw Error(fe(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(fe(189))}}if(n.alternate!==r)throw Error(fe(190))}if(n.tag!==3)throw Error(fe(188));return n.stateNode.current===n?e:t}function D7(e){return e=Kq(e),e!==null?L7(e):null}function L7(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=L7(e);if(t!==null)return t;e=e.sibling}return null}var j7=Fr.unstable_scheduleCallback,_T=Fr.unstable_cancelCallback,Gq=Fr.unstable_shouldYield,Xq=Fr.unstable_requestPaint,an=Fr.unstable_now,Qq=Fr.unstable_getCurrentPriorityLevel,fC=Fr.unstable_ImmediatePriority,P7=Fr.unstable_UserBlockingPriority,e0=Fr.unstable_NormalPriority,Jq=Fr.unstable_LowPriority,N7=Fr.unstable_IdlePriority,Vv=null,cs=null;function Zq(e){if(cs&&typeof cs.onCommitFiberRoot=="function")try{cs.onCommitFiberRoot(Vv,e,void 0,(e.current.flags&128)===128)}catch{}}var Ai=Math.clz32?Math.clz32:nY,eY=Math.log,tY=Math.LN2;function nY(e){return e>>>=0,e===0?32:31-(eY(e)/tY|0)|0}var fm=64,pm=4194304;function Oh(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 t0(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=Oh(o):(s&=a,s!==0&&(r=Oh(s)))}else a=n&~i,a!==0?r=Oh(a):s!==0&&(r=Oh(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-Ai(t),i=1<<n,r|=e[n],t&=~i;return r}function rY(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 iY(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var a=31-Ai(s),o=1<<a,l=i[a];l===-1?(!(o&n)||o&r)&&(i[a]=rY(o,t)):l<=t&&(e.expiredLanes|=o),s&=~o}}function iw(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function O7(){var e=fm;return fm<<=1,!(fm&4194240)&&(fm=64),e}function B_(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Sp(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ai(t),e[t]=n}function sY(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-Ai(n),s=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~s}}function pC(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ai(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var St=0;function I7(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var $7,mC,F7,B7,z7,sw=!1,mm=[],Xo=null,Qo=null,Jo=null,Sf=new Map,Cf=new Map,Eo=[],oY="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 xT(e,t){switch(e){case"focusin":case"focusout":Xo=null;break;case"dragenter":case"dragleave":Qo=null;break;case"mouseover":case"mouseout":Jo=null;break;case"pointerover":case"pointerout":Sf.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Cf.delete(t.pointerId)}}function Kd(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=kp(t),t!==null&&mC(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function aY(e,t,n,r,i){switch(t){case"focusin":return Xo=Kd(Xo,e,t,n,r,i),!0;case"dragenter":return Qo=Kd(Qo,e,t,n,r,i),!0;case"mouseover":return Jo=Kd(Jo,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return Sf.set(s,Kd(Sf.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,Cf.set(s,Kd(Cf.get(s)||null,e,t,n,r,i)),!0}return!1}function U7(e){var t=Ba(e.target);if(t!==null){var n=Pl(t);if(n!==null){if(t=n.tag,t===13){if(t=A7(n),t!==null){e.blockedOn=t,z7(e.priority,function(){F7(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 gg(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=ow(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);ew=r,n.target.dispatchEvent(r),ew=null}else return t=kp(n),t!==null&&mC(t),e.blockedOn=n,!1;t.shift()}return!0}function bT(e,t,n){gg(e)&&n.delete(t)}function lY(){sw=!1,Xo!==null&&gg(Xo)&&(Xo=null),Qo!==null&&gg(Qo)&&(Qo=null),Jo!==null&&gg(Jo)&&(Jo=null),Sf.forEach(bT),Cf.forEach(bT)}function Gd(e,t){e.blockedOn===t&&(e.blockedOn=null,sw||(sw=!0,Fr.unstable_scheduleCallback(Fr.unstable_NormalPriority,lY)))}function kf(e){function t(i){return Gd(i,e)}if(0<mm.length){Gd(mm[0],e);for(var n=1;n<mm.length;n++){var r=mm[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Xo!==null&&Gd(Xo,e),Qo!==null&&Gd(Qo,e),Jo!==null&&Gd(Jo,e),Sf.forEach(t),Cf.forEach(t),n=0;n<Eo.length;n++)r=Eo[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Eo.length&&(n=Eo[0],n.blockedOn===null);)U7(n),n.blockedOn===null&&Eo.shift()}var Hc=ao.ReactCurrentBatchConfig,n0=!0;function cY(e,t,n,r){var i=St,s=Hc.transition;Hc.transition=null;try{St=1,gC(e,t,n,r)}finally{St=i,Hc.transition=s}}function uY(e,t,n,r){var i=St,s=Hc.transition;Hc.transition=null;try{St=4,gC(e,t,n,r)}finally{St=i,Hc.transition=s}}function gC(e,t,n,r){if(n0){var i=ow(e,t,n,r);if(i===null)X_(e,t,r,r0,n),xT(e,r);else if(aY(i,e,t,n,r))r.stopPropagation();else if(xT(e,r),t&4&&-1<oY.indexOf(e)){for(;i!==null;){var s=kp(i);if(s!==null&&$7(s),s=ow(e,t,n,r),s===null&&X_(e,t,r,r0,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else X_(e,t,r,null,n)}}var r0=null;function ow(e,t,n,r){if(r0=null,e=hC(r),e=Ba(e),e!==null)if(t=Pl(e),t===null)e=null;else if(n=t.tag,n===13){if(e=A7(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 r0=e,null}function H7(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(Qq()){case fC:return 1;case P7:return 4;case e0:case Jq:return 16;case N7:return 536870912;default:return 16}default:return 16}}var Fo=null,vC=null,vg=null;function W7(){if(vg)return vg;var e,t=vC,n=t.length,r,i="value"in Fo?Fo.value:Fo.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 vg=i.slice(e,1<r?1-r:void 0)}function yg(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 gm(){return!0}function wT(){return!1}function Ur(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)?gm:wT,this.isPropagationStopped=wT,this}return en(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=gm)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=gm)},persist:function(){},isPersistent:gm}),t}var id={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},yC=Ur(id),Cp=en({},id,{view:0,detail:0}),dY=Ur(Cp),z_,U_,Xd,qv=en({},Cp,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:_C,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!==Xd&&(Xd&&e.type==="mousemove"?(z_=e.screenX-Xd.screenX,U_=e.screenY-Xd.screenY):U_=z_=0,Xd=e),z_)},movementY:function(e){return"movementY"in e?e.movementY:U_}}),ST=Ur(qv),hY=en({},qv,{dataTransfer:0}),fY=Ur(hY),pY=en({},Cp,{relatedTarget:0}),H_=Ur(pY),mY=en({},id,{animationName:0,elapsedTime:0,pseudoElement:0}),gY=Ur(mY),vY=en({},id,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),yY=Ur(vY),_Y=en({},id,{data:0}),CT=Ur(_Y),xY={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},bY={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"},wY={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function SY(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=wY[e])?!!t[e]:!1}function _C(){return SY}var CY=en({},Cp,{key:function(e){if(e.key){var t=xY[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=yg(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?bY[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:_C,charCode:function(e){return e.type==="keypress"?yg(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?yg(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),kY=Ur(CY),EY=en({},qv,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),kT=Ur(EY),TY=en({},Cp,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:_C}),MY=Ur(TY),RY=en({},id,{propertyName:0,elapsedTime:0,pseudoElement:0}),AY=Ur(RY),DY=en({},qv,{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}),LY=Ur(DY),jY=[9,13,27,32],xC=Ys&&"CompositionEvent"in window,Jh=null;Ys&&"documentMode"in document&&(Jh=document.documentMode);var PY=Ys&&"TextEvent"in window&&!Jh,V7=Ys&&(!xC||Jh&&8<Jh&&11>=Jh),ET=" ",TT=!1;function q7(e,t){switch(e){case"keyup":return jY.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Y7(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Mc=!1;function NY(e,t){switch(e){case"compositionend":return Y7(t);case"keypress":return t.which!==32?null:(TT=!0,ET);case"textInput":return e=t.data,e===ET&&TT?null:e;default:return null}}function OY(e,t){if(Mc)return e==="compositionend"||!xC&&q7(e,t)?(e=W7(),vg=vC=Fo=null,Mc=!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 V7&&t.locale!=="ko"?null:t.data;default:return null}}var IY={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 MT(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!IY[e.type]:t==="textarea"}function K7(e,t,n,r){k7(r),t=i0(t,"onChange"),0<t.length&&(n=new yC("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Zh=null,Ef=null;function $Y(e){sL(e,0)}function Yv(e){var t=Dc(e);if(y7(t))return e}function FY(e,t){if(e==="change")return t}var G7=!1;if(Ys){var W_;if(Ys){var V_="oninput"in document;if(!V_){var RT=document.createElement("div");RT.setAttribute("oninput","return;"),V_=typeof RT.oninput=="function"}W_=V_}else W_=!1;G7=W_&&(!document.documentMode||9<document.documentMode)}function AT(){Zh&&(Zh.detachEvent("onpropertychange",X7),Ef=Zh=null)}function X7(e){if(e.propertyName==="value"&&Yv(Ef)){var t=[];K7(t,Ef,e,hC(e)),R7($Y,t)}}function BY(e,t,n){e==="focusin"?(AT(),Zh=t,Ef=n,Zh.attachEvent("onpropertychange",X7)):e==="focusout"&&AT()}function zY(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Yv(Ef)}function UY(e,t){if(e==="click")return Yv(t)}function HY(e,t){if(e==="input"||e==="change")return Yv(t)}function WY(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ji=typeof Object.is=="function"?Object.is:WY;function Tf(e,t){if(ji(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(!Ub.call(t,i)||!ji(e[i],t[i]))return!1}return!0}function DT(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function LT(e,t){var n=DT(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=DT(n)}}function Q7(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Q7(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function J7(){for(var e=window,t=Qg();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Qg(e.document)}return t}function bC(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 VY(e){var t=J7(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Q7(n.ownerDocument.documentElement,n)){if(r!==null&&bC(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=LT(n,s);var a=LT(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 qY=Ys&&"documentMode"in document&&11>=document.documentMode,Rc=null,aw=null,ef=null,lw=!1;function jT(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;lw||Rc==null||Rc!==Qg(r)||(r=Rc,"selectionStart"in r&&bC(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}),ef&&Tf(ef,r)||(ef=r,r=i0(aw,"onSelect"),0<r.length&&(t=new yC("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Rc)))}function vm(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ac={animationend:vm("Animation","AnimationEnd"),animationiteration:vm("Animation","AnimationIteration"),animationstart:vm("Animation","AnimationStart"),transitionend:vm("Transition","TransitionEnd")},q_={},Z7={};Ys&&(Z7=document.createElement("div").style,"AnimationEvent"in window||(delete Ac.animationend.animation,delete Ac.animationiteration.animation,delete Ac.animationstart.animation),"TransitionEvent"in window||delete Ac.transitionend.transition);function Kv(e){if(q_[e])return q_[e];if(!Ac[e])return e;var t=Ac[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Z7)return q_[e]=t[n];return e}var eL=Kv("animationend"),tL=Kv("animationiteration"),nL=Kv("animationstart"),rL=Kv("transitionend"),iL=new Map,PT="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 _a(e,t){iL.set(e,t),jl(t,[e])}for(var Y_=0;Y_<PT.length;Y_++){var K_=PT[Y_],YY=K_.toLowerCase(),KY=K_[0].toUpperCase()+K_.slice(1);_a(YY,"on"+KY)}_a(eL,"onAnimationEnd");_a(tL,"onAnimationIteration");_a(nL,"onAnimationStart");_a("dblclick","onDoubleClick");_a("focusin","onFocus");_a("focusout","onBlur");_a(rL,"onTransitionEnd");Su("onMouseEnter",["mouseout","mouseover"]);Su("onMouseLeave",["mouseout","mouseover"]);Su("onPointerEnter",["pointerout","pointerover"]);Su("onPointerLeave",["pointerout","pointerover"]);jl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));jl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));jl("onBeforeInput",["compositionend","keypress","textInput","paste"]);jl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));jl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));jl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ih="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(" "),GY=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ih));function NT(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Yq(r,t,void 0,e),e.currentTarget=null}function sL(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,c=o.currentTarget;if(o=o.listener,l!==s&&i.isPropagationStopped())break e;NT(i,o,c),s=l}else for(a=0;a<r.length;a++){if(o=r[a],l=o.instance,c=o.currentTarget,o=o.listener,l!==s&&i.isPropagationStopped())break e;NT(i,o,c),s=l}}}if(Zg)throw e=rw,Zg=!1,rw=null,e}function Bt(e,t){var n=t[fw];n===void 0&&(n=t[fw]=new Set);var r=e+"__bubble";n.has(r)||(oL(t,e,2,!1),n.add(r))}function G_(e,t,n){var r=0;t&&(r|=4),oL(n,e,r,t)}var ym="_reactListening"+Math.random().toString(36).slice(2);function Mf(e){if(!e[ym]){e[ym]=!0,f7.forEach(function(n){n!=="selectionchange"&&(GY.has(n)||G_(n,!1,e),G_(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ym]||(t[ym]=!0,G_("selectionchange",!1,t))}}function oL(e,t,n,r){switch(H7(t)){case 1:var i=cY;break;case 4:i=uY;break;default:i=gC}n=i.bind(null,t,n,e),i=void 0,!nw||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 X_(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=Ba(o),a===null)return;if(l=a.tag,l===5||l===6){r=s=a;continue e}o=o.parentNode}}r=r.return}R7(function(){var c=s,d=hC(n),u=[];e:{var f=iL.get(e);if(f!==void 0){var g=yC,x=e;switch(e){case"keypress":if(yg(n)===0)break e;case"keydown":case"keyup":g=kY;break;case"focusin":x="focus",g=H_;break;case"focusout":x="blur",g=H_;break;case"beforeblur":case"afterblur":g=H_;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=ST;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=fY;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=MY;break;case eL:case tL:case nL:g=gY;break;case rL:g=AY;break;case"scroll":g=dY;break;case"wheel":g=LY;break;case"copy":case"cut":case"paste":g=yY;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=kT}var _=(t&4)!==0,v=!_&&e==="scroll",p=_?f!==null?f+"Capture":null:f;_=[];for(var m=c,y;m!==null;){y=m;var b=y.stateNode;if(y.tag===5&&b!==null&&(y=b,p!==null&&(b=wf(m,p),b!=null&&_.push(Rf(m,b,y)))),v)break;m=m.return}0<_.length&&(f=new g(f,x,null,n,d),u.push({event:f,listeners:_}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",g=e==="mouseout"||e==="pointerout",f&&n!==ew&&(x=n.relatedTarget||n.fromElement)&&(Ba(x)||x[Ks]))break e;if((g||f)&&(f=d.window===d?d:(f=d.ownerDocument)?f.defaultView||f.parentWindow:window,g?(x=n.relatedTarget||n.toElement,g=c,x=x?Ba(x):null,x!==null&&(v=Pl(x),x!==v||x.tag!==5&&x.tag!==6)&&(x=null)):(g=null,x=c),g!==x)){if(_=ST,b="onMouseLeave",p="onMouseEnter",m="mouse",(e==="pointerout"||e==="pointerover")&&(_=kT,b="onPointerLeave",p="onPointerEnter",m="pointer"),v=g==null?f:Dc(g),y=x==null?f:Dc(x),f=new _(b,m+"leave",g,n,d),f.target=v,f.relatedTarget=y,b=null,Ba(d)===c&&(_=new _(p,m+"enter",x,n,d),_.target=y,_.relatedTarget=v,b=_),v=b,g&&x)t:{for(_=g,p=x,m=0,y=_;y;y=ac(y))m++;for(y=0,b=p;b;b=ac(b))y++;for(;0<m-y;)_=ac(_),m--;for(;0<y-m;)p=ac(p),y--;for(;m--;){if(_===p||p!==null&&_===p.alternate)break t;_=ac(_),p=ac(p)}_=null}else _=null;g!==null&&OT(u,f,g,_,!1),x!==null&&v!==null&&OT(u,v,x,_,!0)}}e:{if(f=c?Dc(c):window,g=f.nodeName&&f.nodeName.toLowerCase(),g==="select"||g==="input"&&f.type==="file")var S=FY;else if(MT(f))if(G7)S=HY;else{S=zY;var w=BY}else(g=f.nodeName)&&g.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(S=UY);if(S&&(S=S(e,c))){K7(u,S,n,d);break e}w&&w(e,f,c),e==="focusout"&&(w=f._wrapperState)&&w.controlled&&f.type==="number"&&Gb(f,"number",f.value)}switch(w=c?Dc(c):window,e){case"focusin":(MT(w)||w.contentEditable==="true")&&(Rc=w,aw=c,ef=null);break;case"focusout":ef=aw=Rc=null;break;case"mousedown":lw=!0;break;case"contextmenu":case"mouseup":case"dragend":lw=!1,jT(u,n,d);break;case"selectionchange":if(qY)break;case"keydown":case"keyup":jT(u,n,d)}var E;if(xC)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 Mc?q7(e,n)&&(k="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(k="onCompositionStart");k&&(V7&&n.locale!=="ko"&&(Mc||k!=="onCompositionStart"?k==="onCompositionEnd"&&Mc&&(E=W7()):(Fo=d,vC="value"in Fo?Fo.value:Fo.textContent,Mc=!0)),w=i0(c,k),0<w.length&&(k=new CT(k,e,null,n,d),u.push({event:k,listeners:w}),E?k.data=E:(E=Y7(n),E!==null&&(k.data=E)))),(E=PY?NY(e,n):OY(e,n))&&(c=i0(c,"onBeforeInput"),0<c.length&&(d=new CT("onBeforeInput","beforeinput",null,n,d),u.push({event:d,listeners:c}),d.data=E))}sL(u,t)})}function Rf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function i0(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=wf(e,n),s!=null&&r.unshift(Rf(e,s,i)),s=wf(e,t),s!=null&&r.push(Rf(e,s,i))),e=e.return}return r}function ac(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function OT(e,t,n,r,i){for(var s=t._reactName,a=[];n!==null&&n!==r;){var o=n,l=o.alternate,c=o.stateNode;if(l!==null&&l===r)break;o.tag===5&&c!==null&&(o=c,i?(l=wf(n,s),l!=null&&a.unshift(Rf(n,l,o))):i||(l=wf(n,s),l!=null&&a.push(Rf(n,l,o)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var XY=/\r\n?/g,QY=/\u0000|\uFFFD/g;function IT(e){return(typeof e=="string"?e:""+e).replace(XY,`
`).replace(QY,"")}function _m(e,t,n){if(t=IT(t),IT(e)!==t&&n)throw Error(fe(425))}function s0(){}var cw=null,uw=null;function dw(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 hw=typeof setTimeout=="function"?setTimeout:void 0,JY=typeof clearTimeout=="function"?clearTimeout:void 0,$T=typeof Promise=="function"?Promise:void 0,ZY=typeof queueMicrotask=="function"?queueMicrotask:typeof $T<"u"?function(e){return $T.resolve(null).then(e).catch(eK)}:hw;function eK(e){setTimeout(function(){throw e})}function Q_(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),kf(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);kf(t)}function Zo(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 FT(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 sd=Math.random().toString(36).slice(2),rs="__reactFiber$"+sd,Af="__reactProps$"+sd,Ks="__reactContainer$"+sd,fw="__reactEvents$"+sd,tK="__reactListeners$"+sd,nK="__reactHandles$"+sd;function Ba(e){var t=e[rs];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ks]||n[rs]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=FT(e);e!==null;){if(n=e[rs])return n;e=FT(e)}return t}e=n,n=e.parentNode}return null}function kp(e){return e=e[rs]||e[Ks],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Dc(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(fe(33))}function Gv(e){return e[Af]||null}var pw=[],Lc=-1;function xa(e){return{current:e}}function Vt(e){0>Lc||(e.current=pw[Lc],pw[Lc]=null,Lc--)}function Nt(e,t){Lc++,pw[Lc]=e.current,e.current=t}var la={},Qn=xa(la),_r=xa(!1),ll=la;function Cu(e,t){var n=e.type.contextTypes;if(!n)return la;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 xr(e){return e=e.childContextTypes,e!=null}function o0(){Vt(_r),Vt(Qn)}function BT(e,t,n){if(Qn.current!==la)throw Error(fe(168));Nt(Qn,t),Nt(_r,n)}function aL(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(fe(108,Bq(e)||"Unknown",i));return en({},n,r)}function a0(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||la,ll=Qn.current,Nt(Qn,e),Nt(_r,_r.current),!0}function zT(e,t,n){var r=e.stateNode;if(!r)throw Error(fe(169));n?(e=aL(e,t,ll),r.__reactInternalMemoizedMergedChildContext=e,Vt(_r),Vt(Qn),Nt(Qn,e)):Vt(_r),Nt(_r,n)}var Ns=null,Xv=!1,J_=!1;function lL(e){Ns===null?Ns=[e]:Ns.push(e)}function rK(e){Xv=!0,lL(e)}function ba(){if(!J_&&Ns!==null){J_=!0;var e=0,t=St;try{var n=Ns;for(St=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Ns=null,Xv=!1}catch(i){throw Ns!==null&&(Ns=Ns.slice(e+1)),j7(fC,ba),i}finally{St=t,J_=!1}}return null}var jc=[],Pc=0,l0=null,c0=0,qr=[],Yr=0,cl=null,$s=1,Fs="";function La(e,t){jc[Pc++]=c0,jc[Pc++]=l0,l0=e,c0=t}function cL(e,t,n){qr[Yr++]=$s,qr[Yr++]=Fs,qr[Yr++]=cl,cl=e;var r=$s;e=Fs;var i=32-Ai(r)-1;r&=~(1<<i),n+=1;var s=32-Ai(t)+i;if(30<s){var a=i-i%5;s=(r&(1<<a)-1).toString(32),r>>=a,i-=a,$s=1<<32-Ai(t)+i|n<<i|r,Fs=s+e}else $s=1<<s|n<<i|r,Fs=e}function wC(e){e.return!==null&&(La(e,1),cL(e,1,0))}function SC(e){for(;e===l0;)l0=jc[--Pc],jc[Pc]=null,c0=jc[--Pc],jc[Pc]=null;for(;e===cl;)cl=qr[--Yr],qr[Yr]=null,Fs=qr[--Yr],qr[Yr]=null,$s=qr[--Yr],qr[Yr]=null}var Or=null,jr=null,Gt=!1,Si=null;function uL(e,t){var n=ei(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 UT(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,Or=e,jr=Zo(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Or=e,jr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=cl!==null?{id:$s,overflow:Fs}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=ei(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Or=e,jr=null,!0):!1;default:return!1}}function mw(e){return(e.mode&1)!==0&&(e.flags&128)===0}function gw(e){if(Gt){var t=jr;if(t){var n=t;if(!UT(e,t)){if(mw(e))throw Error(fe(418));t=Zo(n.nextSibling);var r=Or;t&&UT(e,t)?uL(r,n):(e.flags=e.flags&-4097|2,Gt=!1,Or=e)}}else{if(mw(e))throw Error(fe(418));e.flags=e.flags&-4097|2,Gt=!1,Or=e}}}function HT(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Or=e}function xm(e){if(e!==Or)return!1;if(!Gt)return HT(e),Gt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!dw(e.type,e.memoizedProps)),t&&(t=jr)){if(mw(e))throw dL(),Error(fe(418));for(;t;)uL(e,t),t=Zo(t.nextSibling)}if(HT(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(fe(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){jr=Zo(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}jr=null}}else jr=Or?Zo(e.stateNode.nextSibling):null;return!0}function dL(){for(var e=jr;e;)e=Zo(e.nextSibling)}function ku(){jr=Or=null,Gt=!1}function CC(e){Si===null?Si=[e]:Si.push(e)}var iK=ao.ReactCurrentBatchConfig;function Qd(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(fe(309));var r=n.stateNode}if(!r)throw Error(fe(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(fe(284));if(!n._owner)throw Error(fe(290,e))}return e}function bm(e,t){throw e=Object.prototype.toString.call(t),Error(fe(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function WT(e){var t=e._init;return t(e._payload)}function hL(e){function t(p,m){if(e){var y=p.deletions;y===null?(p.deletions=[m],p.flags|=16):y.push(m)}}function n(p,m){if(!e)return null;for(;m!==null;)t(p,m),m=m.sibling;return null}function r(p,m){for(p=new Map;m!==null;)m.key!==null?p.set(m.key,m):p.set(m.index,m),m=m.sibling;return p}function i(p,m){return p=ra(p,m),p.index=0,p.sibling=null,p}function s(p,m,y){return p.index=y,e?(y=p.alternate,y!==null?(y=y.index,y<m?(p.flags|=2,m):y):(p.flags|=2,m)):(p.flags|=1048576,m)}function a(p){return e&&p.alternate===null&&(p.flags|=2),p}function o(p,m,y,b){return m===null||m.tag!==6?(m=sx(y,p.mode,b),m.return=p,m):(m=i(m,y),m.return=p,m)}function l(p,m,y,b){var S=y.type;return S===Tc?d(p,m,y.props.children,b,y.key):m!==null&&(m.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===wo&&WT(S)===m.type)?(b=i(m,y.props),b.ref=Qd(p,m,y),b.return=p,b):(b=kg(y.type,y.key,y.props,null,p.mode,b),b.ref=Qd(p,m,y),b.return=p,b)}function c(p,m,y,b){return m===null||m.tag!==4||m.stateNode.containerInfo!==y.containerInfo||m.stateNode.implementation!==y.implementation?(m=ox(y,p.mode,b),m.return=p,m):(m=i(m,y.children||[]),m.return=p,m)}function d(p,m,y,b,S){return m===null||m.tag!==7?(m=nl(y,p.mode,b,S),m.return=p,m):(m=i(m,y),m.return=p,m)}function u(p,m,y){if(typeof m=="string"&&m!==""||typeof m=="number")return m=sx(""+m,p.mode,y),m.return=p,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case um:return y=kg(m.type,m.key,m.props,null,p.mode,y),y.ref=Qd(p,null,m),y.return=p,y;case Ec:return m=ox(m,p.mode,y),m.return=p,m;case wo:var b=m._init;return u(p,b(m._payload),y)}if(Nh(m)||qd(m))return m=nl(m,p.mode,y,null),m.return=p,m;bm(p,m)}return null}function f(p,m,y,b){var S=m!==null?m.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return S!==null?null:o(p,m,""+y,b);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case um:return y.key===S?l(p,m,y,b):null;case Ec:return y.key===S?c(p,m,y,b):null;case wo:return S=y._init,f(p,m,S(y._payload),b)}if(Nh(y)||qd(y))return S!==null?null:d(p,m,y,b,null);bm(p,y)}return null}function g(p,m,y,b,S){if(typeof b=="string"&&b!==""||typeof b=="number")return p=p.get(y)||null,o(m,p,""+b,S);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case um:return p=p.get(b.key===null?y:b.key)||null,l(m,p,b,S);case Ec:return p=p.get(b.key===null?y:b.key)||null,c(m,p,b,S);case wo:var w=b._init;return g(p,m,y,w(b._payload),S)}if(Nh(b)||qd(b))return p=p.get(y)||null,d(m,p,b,S,null);bm(m,b)}return null}function x(p,m,y,b){for(var S=null,w=null,E=m,k=m=0,T=null;E!==null&&k<y.length;k++){E.index>k?(T=E,E=null):T=E.sibling;var R=f(p,E,y[k],b);if(R===null){E===null&&(E=T);break}e&&E&&R.alternate===null&&t(p,E),m=s(R,m,k),w===null?S=R:w.sibling=R,w=R,E=T}if(k===y.length)return n(p,E),Gt&&La(p,k),S;if(E===null){for(;k<y.length;k++)E=u(p,y[k],b),E!==null&&(m=s(E,m,k),w===null?S=E:w.sibling=E,w=E);return Gt&&La(p,k),S}for(E=r(p,E);k<y.length;k++)T=g(E,p,k,y[k],b),T!==null&&(e&&T.alternate!==null&&E.delete(T.key===null?k:T.key),m=s(T,m,k),w===null?S=T:w.sibling=T,w=T);return e&&E.forEach(function(M){return t(p,M)}),Gt&&La(p,k),S}function _(p,m,y,b){var S=qd(y);if(typeof S!="function")throw Error(fe(150));if(y=S.call(y),y==null)throw Error(fe(151));for(var w=S=null,E=m,k=m=0,T=null,R=y.next();E!==null&&!R.done;k++,R=y.next()){E.index>k?(T=E,E=null):T=E.sibling;var M=f(p,E,R.value,b);if(M===null){E===null&&(E=T);break}e&&E&&M.alternate===null&&t(p,E),m=s(M,m,k),w===null?S=M:w.sibling=M,w=M,E=T}if(R.done)return n(p,E),Gt&&La(p,k),S;if(E===null){for(;!R.done;k++,R=y.next())R=u(p,R.value,b),R!==null&&(m=s(R,m,k),w===null?S=R:w.sibling=R,w=R);return Gt&&La(p,k),S}for(E=r(p,E);!R.done;k++,R=y.next())R=g(E,p,k,R.value,b),R!==null&&(e&&R.alternate!==null&&E.delete(R.key===null?k:R.key),m=s(R,m,k),w===null?S=R:w.sibling=R,w=R);return e&&E.forEach(function(L){return t(p,L)}),Gt&&La(p,k),S}function v(p,m,y,b){if(typeof y=="object"&&y!==null&&y.type===Tc&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case um:e:{for(var S=y.key,w=m;w!==null;){if(w.key===S){if(S=y.type,S===Tc){if(w.tag===7){n(p,w.sibling),m=i(w,y.props.children),m.return=p,p=m;break e}}else if(w.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===wo&&WT(S)===w.type){n(p,w.sibling),m=i(w,y.props),m.ref=Qd(p,w,y),m.return=p,p=m;break e}n(p,w);break}else t(p,w);w=w.sibling}y.type===Tc?(m=nl(y.props.children,p.mode,b,y.key),m.return=p,p=m):(b=kg(y.type,y.key,y.props,null,p.mode,b),b.ref=Qd(p,m,y),b.return=p,p=b)}return a(p);case Ec:e:{for(w=y.key;m!==null;){if(m.key===w)if(m.tag===4&&m.stateNode.containerInfo===y.containerInfo&&m.stateNode.implementation===y.implementation){n(p,m.sibling),m=i(m,y.children||[]),m.return=p,p=m;break e}else{n(p,m);break}else t(p,m);m=m.sibling}m=ox(y,p.mode,b),m.return=p,p=m}return a(p);case wo:return w=y._init,v(p,m,w(y._payload),b)}if(Nh(y))return x(p,m,y,b);if(qd(y))return _(p,m,y,b);bm(p,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,m!==null&&m.tag===6?(n(p,m.sibling),m=i(m,y),m.return=p,p=m):(n(p,m),m=sx(y,p.mode,b),m.return=p,p=m),a(p)):n(p,m)}return v}var Eu=hL(!0),fL=hL(!1),u0=xa(null),d0=null,Nc=null,kC=null;function EC(){kC=Nc=d0=null}function TC(e){var t=u0.current;Vt(u0),e._currentValue=t}function vw(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 Wc(e,t){d0=e,kC=Nc=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(yr=!0),e.firstContext=null)}function oi(e){var t=e._currentValue;if(kC!==e)if(e={context:e,memoizedValue:t,next:null},Nc===null){if(d0===null)throw Error(fe(308));Nc=e,d0.dependencies={lanes:0,firstContext:e}}else Nc=Nc.next=e;return t}var za=null;function MC(e){za===null?za=[e]:za.push(e)}function pL(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,MC(t)):(n.next=i.next,i.next=n),t.interleaved=n,Gs(e,r)}function Gs(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 RC(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function mL(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 Vs(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ea(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,dt&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Gs(e,n)}return i=r.interleaved,i===null?(t.next=t,MC(r)):(t.next=i.next,i.next=t),r.interleaved=t,Gs(e,n)}function _g(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,pC(e,n)}}function VT(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 h0(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,c=l.next;l.next=null,a===null?s=c:a.next=c,a=l;var d=e.alternate;d!==null&&(d=d.updateQueue,o=d.lastBaseUpdate,o!==a&&(o===null?d.firstBaseUpdate=c:o.next=c,d.lastBaseUpdate=l))}if(s!==null){var u=i.baseState;a=0,d=c=l=null,o=s;do{var f=o.lane,g=o.eventTime;if((r&f)===f){d!==null&&(d=d.next={eventTime:g,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var x=e,_=o;switch(f=t,g=n,_.tag){case 1:if(x=_.payload,typeof x=="function"){u=x.call(g,u,f);break e}u=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=_.payload,f=typeof x=="function"?x.call(g,u,f):x,f==null)break e;u=en({},u,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},d===null?(c=d=g,l=u):d=d.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(d===null&&(l=u),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=d,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);dl|=a,e.lanes=a,e.memoizedState=u}}function qT(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(fe(191,i));i.call(r)}}}var Ep={},us=xa(Ep),Df=xa(Ep),Lf=xa(Ep);function Ua(e){if(e===Ep)throw Error(fe(174));return e}function AC(e,t){switch(Nt(Lf,t),Nt(Df,e),Nt(us,Ep),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Qb(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Qb(t,e)}Vt(us),Nt(us,t)}function Tu(){Vt(us),Vt(Df),Vt(Lf)}function gL(e){Ua(Lf.current);var t=Ua(us.current),n=Qb(t,e.type);t!==n&&(Nt(Df,e),Nt(us,n))}function DC(e){Df.current===e&&(Vt(us),Vt(Df))}var Jt=xa(0);function f0(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 Z_=[];function LC(){for(var e=0;e<Z_.length;e++)Z_[e]._workInProgressVersionPrimary=null;Z_.length=0}var xg=ao.ReactCurrentDispatcher,ex=ao.ReactCurrentBatchConfig,ul=0,Zt=null,gn=null,En=null,p0=!1,tf=!1,jf=0,sK=0;function zn(){throw Error(fe(321))}function jC(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ji(e[n],t[n]))return!1;return!0}function PC(e,t,n,r,i,s){if(ul=s,Zt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,xg.current=e===null||e.memoizedState===null?cK:uK,e=n(r,i),tf){s=0;do{if(tf=!1,jf=0,25<=s)throw Error(fe(301));s+=1,En=gn=null,t.updateQueue=null,xg.current=dK,e=n(r,i)}while(tf)}if(xg.current=m0,t=gn!==null&&gn.next!==null,ul=0,En=gn=Zt=null,p0=!1,t)throw Error(fe(300));return e}function NC(){var e=jf!==0;return jf=0,e}function Gi(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return En===null?Zt.memoizedState=En=e:En=En.next=e,En}function ai(){if(gn===null){var e=Zt.alternate;e=e!==null?e.memoizedState:null}else e=gn.next;var t=En===null?Zt.memoizedState:En.next;if(t!==null)En=t,gn=e;else{if(e===null)throw Error(fe(310));gn=e,e={memoizedState:gn.memoizedState,baseState:gn.baseState,baseQueue:gn.baseQueue,queue:gn.queue,next:null},En===null?Zt.memoizedState=En=e:En=En.next=e}return En}function Pf(e,t){return typeof t=="function"?t(e):t}function tx(e){var t=ai(),n=t.queue;if(n===null)throw Error(fe(311));n.lastRenderedReducer=e;var r=gn,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,c=s;do{var d=c.lane;if((ul&d)===d)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var u={lane:d,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(o=l=u,a=r):l=l.next=u,Zt.lanes|=d,dl|=d}c=c.next}while(c!==null&&c!==s);l===null?a=r:l.next=o,ji(r,t.memoizedState)||(yr=!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,Zt.lanes|=s,dl|=s,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function nx(e){var t=ai(),n=t.queue;if(n===null)throw Error(fe(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);ji(s,t.memoizedState)||(yr=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function vL(){}function yL(e,t){var n=Zt,r=ai(),i=t(),s=!ji(r.memoizedState,i);if(s&&(r.memoizedState=i,yr=!0),r=r.queue,OC(bL.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||En!==null&&En.memoizedState.tag&1){if(n.flags|=2048,Nf(9,xL.bind(null,n,r,i,t),void 0,null),Rn===null)throw Error(fe(349));ul&30||_L(n,t,i)}return i}function _L(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Zt.updateQueue,t===null?(t={lastEffect:null,stores:null},Zt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function xL(e,t,n,r){t.value=n,t.getSnapshot=r,wL(t)&&SL(e)}function bL(e,t,n){return n(function(){wL(t)&&SL(e)})}function wL(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ji(e,n)}catch{return!0}}function SL(e){var t=Gs(e,1);t!==null&&Di(t,e,1,-1)}function YT(e){var t=Gi();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Pf,lastRenderedState:e},t.queue=e,e=e.dispatch=lK.bind(null,Zt,e),[t.memoizedState,e]}function Nf(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Zt.updateQueue,t===null?(t={lastEffect:null,stores:null},Zt.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 CL(){return ai().memoizedState}function bg(e,t,n,r){var i=Gi();Zt.flags|=e,i.memoizedState=Nf(1|t,n,void 0,r===void 0?null:r)}function Qv(e,t,n,r){var i=ai();r=r===void 0?null:r;var s=void 0;if(gn!==null){var a=gn.memoizedState;if(s=a.destroy,r!==null&&jC(r,a.deps)){i.memoizedState=Nf(t,n,s,r);return}}Zt.flags|=e,i.memoizedState=Nf(1|t,n,s,r)}function KT(e,t){return bg(8390656,8,e,t)}function OC(e,t){return Qv(2048,8,e,t)}function kL(e,t){return Qv(4,2,e,t)}function EL(e,t){return Qv(4,4,e,t)}function TL(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 ML(e,t,n){return n=n!=null?n.concat([e]):null,Qv(4,4,TL.bind(null,t,e),n)}function IC(){}function RL(e,t){var n=ai();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&jC(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function AL(e,t){var n=ai();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&jC(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function DL(e,t,n){return ul&21?(ji(n,t)||(n=O7(),Zt.lanes|=n,dl|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,yr=!0),e.memoizedState=n)}function oK(e,t){var n=St;St=n!==0&&4>n?n:4,e(!0);var r=ex.transition;ex.transition={};try{e(!1),t()}finally{St=n,ex.transition=r}}function LL(){return ai().memoizedState}function aK(e,t,n){var r=na(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},jL(e))PL(t,n);else if(n=pL(e,t,n,r),n!==null){var i=ir();Di(n,e,r,i),NL(n,t,r)}}function lK(e,t,n){var r=na(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(jL(e))PL(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,ji(o,a)){var l=t.interleaved;l===null?(i.next=i,MC(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=pL(e,t,i,r),n!==null&&(i=ir(),Di(n,e,r,i),NL(n,t,r))}}function jL(e){var t=e.alternate;return e===Zt||t!==null&&t===Zt}function PL(e,t){tf=p0=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function NL(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,pC(e,n)}}var m0={readContext:oi,useCallback:zn,useContext:zn,useEffect:zn,useImperativeHandle:zn,useInsertionEffect:zn,useLayoutEffect:zn,useMemo:zn,useReducer:zn,useRef:zn,useState:zn,useDebugValue:zn,useDeferredValue:zn,useTransition:zn,useMutableSource:zn,useSyncExternalStore:zn,useId:zn,unstable_isNewReconciler:!1},cK={readContext:oi,useCallback:function(e,t){return Gi().memoizedState=[e,t===void 0?null:t],e},useContext:oi,useEffect:KT,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,bg(4194308,4,TL.bind(null,t,e),n)},useLayoutEffect:function(e,t){return bg(4194308,4,e,t)},useInsertionEffect:function(e,t){return bg(4,2,e,t)},useMemo:function(e,t){var n=Gi();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Gi();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=aK.bind(null,Zt,e),[r.memoizedState,e]},useRef:function(e){var t=Gi();return e={current:e},t.memoizedState=e},useState:YT,useDebugValue:IC,useDeferredValue:function(e){return Gi().memoizedState=e},useTransition:function(){var e=YT(!1),t=e[0];return e=oK.bind(null,e[1]),Gi().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Zt,i=Gi();if(Gt){if(n===void 0)throw Error(fe(407));n=n()}else{if(n=t(),Rn===null)throw Error(fe(349));ul&30||_L(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,KT(bL.bind(null,r,s,e),[e]),r.flags|=2048,Nf(9,xL.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Gi(),t=Rn.identifierPrefix;if(Gt){var n=Fs,r=$s;n=(r&~(1<<32-Ai(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=jf++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=sK++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},uK={readContext:oi,useCallback:RL,useContext:oi,useEffect:OC,useImperativeHandle:ML,useInsertionEffect:kL,useLayoutEffect:EL,useMemo:AL,useReducer:tx,useRef:CL,useState:function(){return tx(Pf)},useDebugValue:IC,useDeferredValue:function(e){var t=ai();return DL(t,gn.memoizedState,e)},useTransition:function(){var e=tx(Pf)[0],t=ai().memoizedState;return[e,t]},useMutableSource:vL,useSyncExternalStore:yL,useId:LL,unstable_isNewReconciler:!1},dK={readContext:oi,useCallback:RL,useContext:oi,useEffect:OC,useImperativeHandle:ML,useInsertionEffect:kL,useLayoutEffect:EL,useMemo:AL,useReducer:nx,useRef:CL,useState:function(){return nx(Pf)},useDebugValue:IC,useDeferredValue:function(e){var t=ai();return gn===null?t.memoizedState=e:DL(t,gn.memoizedState,e)},useTransition:function(){var e=nx(Pf)[0],t=ai().memoizedState;return[e,t]},useMutableSource:vL,useSyncExternalStore:yL,useId:LL,unstable_isNewReconciler:!1};function vi(e,t){if(e&&e.defaultProps){t=en({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function yw(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:en({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Jv={isMounted:function(e){return(e=e._reactInternals)?Pl(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=ir(),i=na(e),s=Vs(r,i);s.payload=t,n!=null&&(s.callback=n),t=ea(e,s,i),t!==null&&(Di(t,e,i,r),_g(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=ir(),i=na(e),s=Vs(r,i);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=ea(e,s,i),t!==null&&(Di(t,e,i,r),_g(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ir(),r=na(e),i=Vs(n,r);i.tag=2,t!=null&&(i.callback=t),t=ea(e,i,r),t!==null&&(Di(t,e,r,n),_g(t,e,r))}};function GT(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?!Tf(n,r)||!Tf(i,s):!0}function OL(e,t,n){var r=!1,i=la,s=t.contextType;return typeof s=="object"&&s!==null?s=oi(s):(i=xr(t)?ll:Qn.current,r=t.contextTypes,s=(r=r!=null)?Cu(e,i):la),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Jv,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function XT(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&&Jv.enqueueReplaceState(t,t.state,null)}function _w(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},RC(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=oi(s):(s=xr(t)?ll:Qn.current,i.context=Cu(e,s)),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(yw(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&&Jv.enqueueReplaceState(i,i.state,null),h0(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function Mu(e,t){try{var n="",r=t;do n+=Fq(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 rx(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function xw(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var hK=typeof WeakMap=="function"?WeakMap:Map;function IL(e,t,n){n=Vs(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){v0||(v0=!0,Aw=r),xw(e,t)},n}function $L(e,t,n){n=Vs(-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(){xw(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){xw(e,t),typeof r!="function"&&(ta===null?ta=new Set([this]):ta.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function QT(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new hK;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=EK.bind(null,e,t,n),t.then(e,e))}function JT(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 ZT(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=Vs(-1,1),t.tag=2,ea(n,t,1))),n.lanes|=1),e)}var fK=ao.ReactCurrentOwner,yr=!1;function tr(e,t,n,r){t.child=e===null?fL(t,null,n,r):Eu(t,e.child,n,r)}function e4(e,t,n,r,i){n=n.render;var s=t.ref;return Wc(t,i),r=PC(e,t,n,r,s,i),n=NC(),e!==null&&!yr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Xs(e,t,i)):(Gt&&n&&wC(t),t.flags|=1,tr(e,t,r,i),t.child)}function t4(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!VC(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,FL(e,t,s,r,i)):(e=kg(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:Tf,n(a,r)&&e.ref===t.ref)return Xs(e,t,i)}return t.flags|=1,e=ra(s,r),e.ref=t.ref,e.return=t,t.child=e}function FL(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(Tf(s,r)&&e.ref===t.ref)if(yr=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(yr=!0);else return t.lanes=e.lanes,Xs(e,t,i)}return bw(e,t,n,r,i)}function BL(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},Nt(Ic,Dr),Dr|=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,Nt(Ic,Dr),Dr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,Nt(Ic,Dr),Dr|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,Nt(Ic,Dr),Dr|=r;return tr(e,t,i,n),t.child}function zL(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function bw(e,t,n,r,i){var s=xr(n)?ll:Qn.current;return s=Cu(t,s),Wc(t,i),n=PC(e,t,n,r,s,i),r=NC(),e!==null&&!yr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Xs(e,t,i)):(Gt&&r&&wC(t),t.flags|=1,tr(e,t,n,i),t.child)}function n4(e,t,n,r,i){if(xr(n)){var s=!0;a0(t)}else s=!1;if(Wc(t,i),t.stateNode===null)wg(e,t),OL(t,n,r),_w(t,n,r,i),r=!0;else if(e===null){var a=t.stateNode,o=t.memoizedProps;a.props=o;var l=a.context,c=n.contextType;typeof c=="object"&&c!==null?c=oi(c):(c=xr(n)?ll:Qn.current,c=Cu(t,c));var d=n.getDerivedStateFromProps,u=typeof d=="function"||typeof a.getSnapshotBeforeUpdate=="function";u||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==r||l!==c)&&XT(t,a,r,c),So=!1;var f=t.memoizedState;a.state=f,h0(t,r,a,i),l=t.memoizedState,o!==r||f!==l||_r.current||So?(typeof d=="function"&&(yw(t,n,d,r),l=t.memoizedState),(o=So||GT(t,n,o,r,f,l,c))?(u||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=c,r=o):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,mL(e,t),o=t.memoizedProps,c=t.type===t.elementType?o:vi(t.type,o),a.props=c,u=t.pendingProps,f=a.context,l=n.contextType,typeof l=="object"&&l!==null?l=oi(l):(l=xr(n)?ll:Qn.current,l=Cu(t,l));var g=n.getDerivedStateFromProps;(d=typeof g=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==u||f!==l)&&XT(t,a,r,l),So=!1,f=t.memoizedState,a.state=f,h0(t,r,a,i);var x=t.memoizedState;o!==u||f!==x||_r.current||So?(typeof g=="function"&&(yw(t,n,g,r),x=t.memoizedState),(c=So||GT(t,n,c,r,f,x,l)||!1)?(d||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,x,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,x,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=x),a.props=r,a.state=x,a.context=l,r=c):(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 ww(e,t,n,r,s,i)}function ww(e,t,n,r,i,s){zL(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return i&&zT(t,n,!1),Xs(e,t,s);r=t.stateNode,fK.current=t;var o=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=Eu(t,e.child,null,s),t.child=Eu(t,null,o,s)):tr(e,t,o,s),t.memoizedState=r.state,i&&zT(t,n,!0),t.child}function UL(e){var t=e.stateNode;t.pendingContext?BT(e,t.pendingContext,t.pendingContext!==t.context):t.context&&BT(e,t.context,!1),AC(e,t.containerInfo)}function r4(e,t,n,r,i){return ku(),CC(i),t.flags|=256,tr(e,t,n,r),t.child}var Sw={dehydrated:null,treeContext:null,retryLane:0};function Cw(e){return{baseLanes:e,cachePool:null,transitions:null}}function HL(e,t,n){var r=t.pendingProps,i=Jt.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),Nt(Jt,i&1),e===null)return gw(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=t1(a,r,0,null),e=nl(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Cw(n),t.memoizedState=Sw,e):$C(t,a));if(i=e.memoizedState,i!==null&&(o=i.dehydrated,o!==null))return pK(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=ra(i,l),r.subtreeFlags=i.subtreeFlags&14680064),o!==null?s=ra(o,s):(s=nl(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?Cw(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},s.memoizedState=a,s.childLanes=e.childLanes&~n,t.memoizedState=Sw,r}return s=e.child,e=s.sibling,r=ra(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 $C(e,t){return t=t1({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function wm(e,t,n,r){return r!==null&&CC(r),Eu(t,e.child,null,n),e=$C(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function pK(e,t,n,r,i,s,a){if(n)return t.flags&256?(t.flags&=-257,r=rx(Error(fe(422))),wm(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=t1({mode:"visible",children:r.children},i,0,null),s=nl(s,i,a,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&Eu(t,e.child,null,a),t.child.memoizedState=Cw(a),t.memoizedState=Sw,s);if(!(t.mode&1))return wm(e,t,a,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var o=r.dgst;return r=o,s=Error(fe(419)),r=rx(s,r,void 0),wm(e,t,a,r)}if(o=(a&e.childLanes)!==0,yr||o){if(r=Rn,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,Gs(e,i),Di(r,e,i,-1))}return WC(),r=rx(Error(fe(421))),wm(e,t,a,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=TK.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,jr=Zo(i.nextSibling),Or=t,Gt=!0,Si=null,e!==null&&(qr[Yr++]=$s,qr[Yr++]=Fs,qr[Yr++]=cl,$s=e.id,Fs=e.overflow,cl=t),t=$C(t,r.children),t.flags|=4096,t)}function i4(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),vw(e.return,t,n)}function ix(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 WL(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(tr(e,t,r.children,n),r=Jt.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&&i4(e,n,t);else if(e.tag===19)i4(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(Nt(Jt,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&&f0(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ix(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&&f0(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ix(t,!0,n,null,s);break;case"together":ix(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function wg(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Xs(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),dl|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(fe(153));if(t.child!==null){for(e=t.child,n=ra(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ra(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function mK(e,t,n){switch(t.tag){case 3:UL(t),ku();break;case 5:gL(t);break;case 1:xr(t.type)&&a0(t);break;case 4:AC(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Nt(u0,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Nt(Jt,Jt.current&1),t.flags|=128,null):n&t.child.childLanes?HL(e,t,n):(Nt(Jt,Jt.current&1),e=Xs(e,t,n),e!==null?e.sibling:null);Nt(Jt,Jt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return WL(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Nt(Jt,Jt.current),r)break;return null;case 22:case 23:return t.lanes=0,BL(e,t,n)}return Xs(e,t,n)}var VL,kw,qL,YL;VL=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}};kw=function(){};qL=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Ua(us.current);var s=null;switch(n){case"input":i=Yb(e,i),r=Yb(e,r),s=[];break;case"select":i=en({},i,{value:void 0}),r=en({},r,{value:void 0}),s=[];break;case"textarea":i=Xb(e,i),r=Xb(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=s0)}Jb(n,r);var a;n=null;for(c in i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var o=i[c];for(a in o)o.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(xf.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in r){var l=r[c];if(o=i!=null?i[c]:void 0,r.hasOwnProperty(c)&&l!==o&&(l!=null||o!=null))if(c==="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(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,o=o?o.__html:void 0,l!=null&&o!==l&&(s=s||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(xf.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Bt("scroll",e),s||o===l||(s=[])):(s=s||[]).push(c,l))}n&&(s=s||[]).push("style",n);var c=s;(t.updateQueue=c)&&(t.flags|=4)}};YL=function(e,t,n,r){n!==r&&(t.flags|=4)};function Jd(e,t){if(!Gt)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 Un(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 gK(e,t,n){var r=t.pendingProps;switch(SC(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Un(t),null;case 1:return xr(t.type)&&o0(),Un(t),null;case 3:return r=t.stateNode,Tu(),Vt(_r),Vt(Qn),LC(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(xm(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Si!==null&&(jw(Si),Si=null))),kw(e,t),Un(t),null;case 5:DC(t);var i=Ua(Lf.current);if(n=t.type,e!==null&&t.stateNode!=null)qL(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(fe(166));return Un(t),null}if(e=Ua(us.current),xm(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[rs]=t,r[Af]=s,e=(t.mode&1)!==0,n){case"dialog":Bt("cancel",r),Bt("close",r);break;case"iframe":case"object":case"embed":Bt("load",r);break;case"video":case"audio":for(i=0;i<Ih.length;i++)Bt(Ih[i],r);break;case"source":Bt("error",r);break;case"img":case"image":case"link":Bt("error",r),Bt("load",r);break;case"details":Bt("toggle",r);break;case"input":fT(r,s),Bt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Bt("invalid",r);break;case"textarea":mT(r,s),Bt("invalid",r)}Jb(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&&_m(r.textContent,o,e),i=["children",o]):typeof o=="number"&&r.textContent!==""+o&&(s.suppressHydrationWarning!==!0&&_m(r.textContent,o,e),i=["children",""+o]):xf.hasOwnProperty(a)&&o!=null&&a==="onScroll"&&Bt("scroll",r)}switch(n){case"input":dm(r),pT(r,s,!0);break;case"textarea":dm(r),gT(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=s0)}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=b7(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[rs]=t,e[Af]=r,VL(e,t,!1,!1),t.stateNode=e;e:{switch(a=Zb(n,r),n){case"dialog":Bt("cancel",e),Bt("close",e),i=r;break;case"iframe":case"object":case"embed":Bt("load",e),i=r;break;case"video":case"audio":for(i=0;i<Ih.length;i++)Bt(Ih[i],e);i=r;break;case"source":Bt("error",e),i=r;break;case"img":case"image":case"link":Bt("error",e),Bt("load",e),i=r;break;case"details":Bt("toggle",e),i=r;break;case"input":fT(e,r),i=Yb(e,r),Bt("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=en({},r,{value:void 0}),Bt("invalid",e);break;case"textarea":mT(e,r),i=Xb(e,r),Bt("invalid",e);break;default:i=r}Jb(n,i),o=i;for(s in o)if(o.hasOwnProperty(s)){var l=o[s];s==="style"?C7(e,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&w7(e,l)):s==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&bf(e,l):typeof l=="number"&&bf(e,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(xf.hasOwnProperty(s)?l!=null&&s==="onScroll"&&Bt("scroll",e):l!=null&&lC(e,s,l,a))}switch(n){case"input":dm(e),pT(e,r,!1);break;case"textarea":dm(e),gT(e);break;case"option":r.value!=null&&e.setAttribute("value",""+aa(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?Bc(e,!!r.multiple,s,!1):r.defaultValue!=null&&Bc(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=s0)}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 Un(t),null;case 6:if(e&&t.stateNode!=null)YL(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(fe(166));if(n=Ua(Lf.current),Ua(us.current),xm(t)){if(r=t.stateNode,n=t.memoizedProps,r[rs]=t,(s=r.nodeValue!==n)&&(e=Or,e!==null))switch(e.tag){case 3:_m(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&_m(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[rs]=t,t.stateNode=r}return Un(t),null;case 13:if(Vt(Jt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Gt&&jr!==null&&t.mode&1&&!(t.flags&128))dL(),ku(),t.flags|=98560,s=!1;else if(s=xm(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(fe(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(fe(317));s[rs]=t}else ku(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Un(t),s=!1}else Si!==null&&(jw(Si),Si=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||Jt.current&1?xn===0&&(xn=3):WC())),t.updateQueue!==null&&(t.flags|=4),Un(t),null);case 4:return Tu(),kw(e,t),e===null&&Mf(t.stateNode.containerInfo),Un(t),null;case 10:return TC(t.type._context),Un(t),null;case 17:return xr(t.type)&&o0(),Un(t),null;case 19:if(Vt(Jt),s=t.memoizedState,s===null)return Un(t),null;if(r=(t.flags&128)!==0,a=s.rendering,a===null)if(r)Jd(s,!1);else{if(xn!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=f0(e),a!==null){for(t.flags|=128,Jd(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 Nt(Jt,Jt.current&1|2),t.child}e=e.sibling}s.tail!==null&&an()>Ru&&(t.flags|=128,r=!0,Jd(s,!1),t.lanes=4194304)}else{if(!r)if(e=f0(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Jd(s,!0),s.tail===null&&s.tailMode==="hidden"&&!a.alternate&&!Gt)return Un(t),null}else 2*an()-s.renderingStartTime>Ru&&n!==1073741824&&(t.flags|=128,r=!0,Jd(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=an(),t.sibling=null,n=Jt.current,Nt(Jt,r?n&1|2:n&1),t):(Un(t),null);case 22:case 23:return HC(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Dr&1073741824&&(Un(t),t.subtreeFlags&6&&(t.flags|=8192)):Un(t),null;case 24:return null;case 25:return null}throw Error(fe(156,t.tag))}function vK(e,t){switch(SC(t),t.tag){case 1:return xr(t.type)&&o0(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Tu(),Vt(_r),Vt(Qn),LC(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return DC(t),null;case 13:if(Vt(Jt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(fe(340));ku()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Vt(Jt),null;case 4:return Tu(),null;case 10:return TC(t.type._context),null;case 22:case 23:return HC(),null;case 24:return null;default:return null}}var Sm=!1,Yn=!1,yK=typeof WeakSet=="function"?WeakSet:Set,ke=null;function Oc(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){rn(e,t,r)}else n.current=null}function Ew(e,t,n){try{n()}catch(r){rn(e,t,r)}}var s4=!1;function _K(e,t){if(cw=n0,e=J7(),bC(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,c=0,d=0,u=e,f=null;t:for(;;){for(var g;u!==n||i!==0&&u.nodeType!==3||(o=a+i),u!==s||r!==0&&u.nodeType!==3||(l=a+r),u.nodeType===3&&(a+=u.nodeValue.length),(g=u.firstChild)!==null;)f=u,u=g;for(;;){if(u===e)break t;if(f===n&&++c===i&&(o=a),f===s&&++d===r&&(l=a),(g=u.nextSibling)!==null)break;u=f,f=u.parentNode}u=g}n=o===-1||l===-1?null:{start:o,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(uw={focusedElem:e,selectionRange:n},n0=!1,ke=t;ke!==null;)if(t=ke,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ke=e;else for(;ke!==null;){t=ke;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var _=x.memoizedProps,v=x.memoizedState,p=t.stateNode,m=p.getSnapshotBeforeUpdate(t.elementType===t.type?_:vi(t.type,_),v);p.__reactInternalSnapshotBeforeUpdate=m}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(fe(163))}}catch(b){rn(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,ke=e;break}ke=t.return}return x=s4,s4=!1,x}function nf(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&&Ew(t,n,s)}i=i.next}while(i!==r)}}function Zv(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 Tw(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 KL(e){var t=e.alternate;t!==null&&(e.alternate=null,KL(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[rs],delete t[Af],delete t[fw],delete t[tK],delete t[nK])),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 GL(e){return e.tag===5||e.tag===3||e.tag===4}function o4(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||GL(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 Mw(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=s0));else if(r!==4&&(e=e.child,e!==null))for(Mw(e,t,n),e=e.sibling;e!==null;)Mw(e,t,n),e=e.sibling}function Rw(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(Rw(e,t,n),e=e.sibling;e!==null;)Rw(e,t,n),e=e.sibling}var In=null,_i=!1;function mo(e,t,n){for(n=n.child;n!==null;)XL(e,t,n),n=n.sibling}function XL(e,t,n){if(cs&&typeof cs.onCommitFiberUnmount=="function")try{cs.onCommitFiberUnmount(Vv,n)}catch{}switch(n.tag){case 5:Yn||Oc(n,t);case 6:var r=In,i=_i;In=null,mo(e,t,n),In=r,_i=i,In!==null&&(_i?(e=In,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):In.removeChild(n.stateNode));break;case 18:In!==null&&(_i?(e=In,n=n.stateNode,e.nodeType===8?Q_(e.parentNode,n):e.nodeType===1&&Q_(e,n),kf(e)):Q_(In,n.stateNode));break;case 4:r=In,i=_i,In=n.stateNode.containerInfo,_i=!0,mo(e,t,n),In=r,_i=i;break;case 0:case 11:case 14:case 15:if(!Yn&&(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)&&Ew(n,t,a),i=i.next}while(i!==r)}mo(e,t,n);break;case 1:if(!Yn&&(Oc(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){rn(n,t,o)}mo(e,t,n);break;case 21:mo(e,t,n);break;case 22:n.mode&1?(Yn=(r=Yn)||n.memoizedState!==null,mo(e,t,n),Yn=r):mo(e,t,n);break;default:mo(e,t,n)}}function a4(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new yK),t.forEach(function(r){var i=MK.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function pi(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:In=o.stateNode,_i=!1;break e;case 3:In=o.stateNode.containerInfo,_i=!0;break e;case 4:In=o.stateNode.containerInfo,_i=!0;break e}o=o.return}if(In===null)throw Error(fe(160));XL(s,a,i),In=null,_i=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(c){rn(i,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)QL(t,e),t=t.sibling}function QL(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(pi(t,e),Yi(e),r&4){try{nf(3,e,e.return),Zv(3,e)}catch(_){rn(e,e.return,_)}try{nf(5,e,e.return)}catch(_){rn(e,e.return,_)}}break;case 1:pi(t,e),Yi(e),r&512&&n!==null&&Oc(n,n.return);break;case 5:if(pi(t,e),Yi(e),r&512&&n!==null&&Oc(n,n.return),e.flags&32){var i=e.stateNode;try{bf(i,"")}catch(_){rn(e,e.return,_)}}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&&_7(i,s),Zb(o,a);var c=Zb(o,s);for(a=0;a<l.length;a+=2){var d=l[a],u=l[a+1];d==="style"?C7(i,u):d==="dangerouslySetInnerHTML"?w7(i,u):d==="children"?bf(i,u):lC(i,d,u,c)}switch(o){case"input":Kb(i,s);break;case"textarea":x7(i,s);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var g=s.value;g!=null?Bc(i,!!s.multiple,g,!1):f!==!!s.multiple&&(s.defaultValue!=null?Bc(i,!!s.multiple,s.defaultValue,!0):Bc(i,!!s.multiple,s.multiple?[]:"",!1))}i[Af]=s}catch(_){rn(e,e.return,_)}}break;case 6:if(pi(t,e),Yi(e),r&4){if(e.stateNode===null)throw Error(fe(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(_){rn(e,e.return,_)}}break;case 3:if(pi(t,e),Yi(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{kf(t.containerInfo)}catch(_){rn(e,e.return,_)}break;case 4:pi(t,e),Yi(e);break;case 13:pi(t,e),Yi(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(zC=an())),r&4&&a4(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(Yn=(c=Yn)||d,pi(t,e),Yn=c):pi(t,e),Yi(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!d&&e.mode&1)for(ke=e,d=e.child;d!==null;){for(u=ke=d;ke!==null;){switch(f=ke,g=f.child,f.tag){case 0:case 11:case 14:case 15:nf(4,f,f.return);break;case 1:Oc(f,f.return);var x=f.stateNode;if(typeof x.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(_){rn(r,n,_)}}break;case 5:Oc(f,f.return);break;case 22:if(f.memoizedState!==null){c4(u);continue}}g!==null?(g.return=f,ke=g):c4(u)}d=d.sibling}e:for(d=null,u=e;;){if(u.tag===5){if(d===null){d=u;try{i=u.stateNode,c?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(o=u.stateNode,l=u.memoizedProps.style,a=l!=null&&l.hasOwnProperty("display")?l.display:null,o.style.display=S7("display",a))}catch(_){rn(e,e.return,_)}}}else if(u.tag===6){if(d===null)try{u.stateNode.nodeValue=c?"":u.memoizedProps}catch(_){rn(e,e.return,_)}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===e)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===e)break e;for(;u.sibling===null;){if(u.return===null||u.return===e)break e;d===u&&(d=null),u=u.return}d===u&&(d=null),u.sibling.return=u.return,u=u.sibling}}break;case 19:pi(t,e),Yi(e),r&4&&a4(e);break;case 21:break;default:pi(t,e),Yi(e)}}function Yi(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(GL(n)){var r=n;break e}n=n.return}throw Error(fe(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(bf(i,""),r.flags&=-33);var s=o4(e);Rw(e,s,i);break;case 3:case 4:var a=r.stateNode.containerInfo,o=o4(e);Mw(e,o,a);break;default:throw Error(fe(161))}}catch(l){rn(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function xK(e,t,n){ke=e,JL(e)}function JL(e,t,n){for(var r=(e.mode&1)!==0;ke!==null;){var i=ke,s=i.child;if(i.tag===22&&r){var a=i.memoizedState!==null||Sm;if(!a){var o=i.alternate,l=o!==null&&o.memoizedState!==null||Yn;o=Sm;var c=Yn;if(Sm=a,(Yn=l)&&!c)for(ke=i;ke!==null;)a=ke,l=a.child,a.tag===22&&a.memoizedState!==null?u4(i):l!==null?(l.return=a,ke=l):u4(i);for(;s!==null;)ke=s,JL(s),s=s.sibling;ke=i,Sm=o,Yn=c}l4(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,ke=s):l4(e)}}function l4(e){for(;ke!==null;){var t=ke;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Yn||Zv(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Yn)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:vi(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&qT(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}qT(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 c=t.alternate;if(c!==null){var d=c.memoizedState;if(d!==null){var u=d.dehydrated;u!==null&&kf(u)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(fe(163))}Yn||t.flags&512&&Tw(t)}catch(f){rn(t,t.return,f)}}if(t===e){ke=null;break}if(n=t.sibling,n!==null){n.return=t.return,ke=n;break}ke=t.return}}function c4(e){for(;ke!==null;){var t=ke;if(t===e){ke=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ke=n;break}ke=t.return}}function u4(e){for(;ke!==null;){var t=ke;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Zv(4,t)}catch(l){rn(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){rn(t,i,l)}}var s=t.return;try{Tw(t)}catch(l){rn(t,s,l)}break;case 5:var a=t.return;try{Tw(t)}catch(l){rn(t,a,l)}}}catch(l){rn(t,t.return,l)}if(t===e){ke=null;break}var o=t.sibling;if(o!==null){o.return=t.return,ke=o;break}ke=t.return}}var bK=Math.ceil,g0=ao.ReactCurrentDispatcher,FC=ao.ReactCurrentOwner,ni=ao.ReactCurrentBatchConfig,dt=0,Rn=null,fn=null,$n=0,Dr=0,Ic=xa(0),xn=0,Of=null,dl=0,e1=0,BC=0,rf=null,mr=null,zC=0,Ru=1/0,js=null,v0=!1,Aw=null,ta=null,Cm=!1,Bo=null,y0=0,sf=0,Dw=null,Sg=-1,Cg=0;function ir(){return dt&6?an():Sg!==-1?Sg:Sg=an()}function na(e){return e.mode&1?dt&2&&$n!==0?$n&-$n:iK.transition!==null?(Cg===0&&(Cg=O7()),Cg):(e=St,e!==0||(e=window.event,e=e===void 0?16:H7(e.type)),e):1}function Di(e,t,n,r){if(50<sf)throw sf=0,Dw=null,Error(fe(185));Sp(e,n,r),(!(dt&2)||e!==Rn)&&(e===Rn&&(!(dt&2)&&(e1|=n),xn===4&&To(e,$n)),br(e,r),n===1&&dt===0&&!(t.mode&1)&&(Ru=an()+500,Xv&&ba()))}function br(e,t){var n=e.callbackNode;iY(e,t);var r=t0(e,e===Rn?$n:0);if(r===0)n!==null&&_T(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&_T(n),t===1)e.tag===0?rK(d4.bind(null,e)):lL(d4.bind(null,e)),ZY(function(){!(dt&6)&&ba()}),n=null;else{switch(I7(r)){case 1:n=fC;break;case 4:n=P7;break;case 16:n=e0;break;case 536870912:n=N7;break;default:n=e0}n=oj(n,ZL.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function ZL(e,t){if(Sg=-1,Cg=0,dt&6)throw Error(fe(327));var n=e.callbackNode;if(Vc()&&e.callbackNode!==n)return null;var r=t0(e,e===Rn?$n:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=_0(e,r);else{t=r;var i=dt;dt|=2;var s=tj();(Rn!==e||$n!==t)&&(js=null,Ru=an()+500,tl(e,t));do try{CK();break}catch(o){ej(e,o)}while(!0);EC(),g0.current=s,dt=i,fn!==null?t=0:(Rn=null,$n=0,t=xn)}if(t!==0){if(t===2&&(i=iw(e),i!==0&&(r=i,t=Lw(e,i))),t===1)throw n=Of,tl(e,0),To(e,r),br(e,an()),n;if(t===6)To(e,r);else{if(i=e.current.alternate,!(r&30)&&!wK(i)&&(t=_0(e,r),t===2&&(s=iw(e),s!==0&&(r=s,t=Lw(e,s))),t===1))throw n=Of,tl(e,0),To(e,r),br(e,an()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(fe(345));case 2:ja(e,mr,js);break;case 3:if(To(e,r),(r&130023424)===r&&(t=zC+500-an(),10<t)){if(t0(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){ir(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=hw(ja.bind(null,e,mr,js),t);break}ja(e,mr,js);break;case 4:if(To(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var a=31-Ai(r);s=1<<a,a=t[a],a>i&&(i=a),r&=~s}if(r=i,r=an()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*bK(r/1960))-r,10<r){e.timeoutHandle=hw(ja.bind(null,e,mr,js),r);break}ja(e,mr,js);break;case 5:ja(e,mr,js);break;default:throw Error(fe(329))}}}return br(e,an()),e.callbackNode===n?ZL.bind(null,e):null}function Lw(e,t){var n=rf;return e.current.memoizedState.isDehydrated&&(tl(e,t).flags|=256),e=_0(e,t),e!==2&&(t=mr,mr=n,t!==null&&jw(t)),e}function jw(e){mr===null?mr=e:mr.push.apply(mr,e)}function wK(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(!ji(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 To(e,t){for(t&=~BC,t&=~e1,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Ai(t),r=1<<n;e[n]=-1,t&=~r}}function d4(e){if(dt&6)throw Error(fe(327));Vc();var t=t0(e,0);if(!(t&1))return br(e,an()),null;var n=_0(e,t);if(e.tag!==0&&n===2){var r=iw(e);r!==0&&(t=r,n=Lw(e,r))}if(n===1)throw n=Of,tl(e,0),To(e,t),br(e,an()),n;if(n===6)throw Error(fe(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ja(e,mr,js),br(e,an()),null}function UC(e,t){var n=dt;dt|=1;try{return e(t)}finally{dt=n,dt===0&&(Ru=an()+500,Xv&&ba())}}function hl(e){Bo!==null&&Bo.tag===0&&!(dt&6)&&Vc();var t=dt;dt|=1;var n=ni.transition,r=St;try{if(ni.transition=null,St=1,e)return e()}finally{St=r,ni.transition=n,dt=t,!(dt&6)&&ba()}}function HC(){Dr=Ic.current,Vt(Ic)}function tl(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,JY(n)),fn!==null)for(n=fn.return;n!==null;){var r=n;switch(SC(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&o0();break;case 3:Tu(),Vt(_r),Vt(Qn),LC();break;case 5:DC(r);break;case 4:Tu();break;case 13:Vt(Jt);break;case 19:Vt(Jt);break;case 10:TC(r.type._context);break;case 22:case 23:HC()}n=n.return}if(Rn=e,fn=e=ra(e.current,null),$n=Dr=t,xn=0,Of=null,BC=e1=dl=0,mr=rf=null,za!==null){for(t=0;t<za.length;t++)if(n=za[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}za=null}return e}function ej(e,t){do{var n=fn;try{if(EC(),xg.current=m0,p0){for(var r=Zt.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}p0=!1}if(ul=0,En=gn=Zt=null,tf=!1,jf=0,FC.current=null,n===null||n.return===null){xn=1,Of=t,fn=null;break}e:{var s=e,a=n.return,o=n,l=t;if(t=$n,o.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,d=o,u=d.tag;if(!(d.mode&1)&&(u===0||u===11||u===15)){var f=d.alternate;f?(d.updateQueue=f.updateQueue,d.memoizedState=f.memoizedState,d.lanes=f.lanes):(d.updateQueue=null,d.memoizedState=null)}var g=JT(a);if(g!==null){g.flags&=-257,ZT(g,a,o,s,t),g.mode&1&&QT(s,c,t),t=g,l=c;var x=t.updateQueue;if(x===null){var _=new Set;_.add(l),t.updateQueue=_}else x.add(l);break e}else{if(!(t&1)){QT(s,c,t),WC();break e}l=Error(fe(426))}}else if(Gt&&o.mode&1){var v=JT(a);if(v!==null){!(v.flags&65536)&&(v.flags|=256),ZT(v,a,o,s,t),CC(Mu(l,o));break e}}s=l=Mu(l,o),xn!==4&&(xn=2),rf===null?rf=[s]:rf.push(s),s=a;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var p=IL(s,l,t);VT(s,p);break e;case 1:o=l;var m=s.type,y=s.stateNode;if(!(s.flags&128)&&(typeof m.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(ta===null||!ta.has(y)))){s.flags|=65536,t&=-t,s.lanes|=t;var b=$L(s,o,t);VT(s,b);break e}}s=s.return}while(s!==null)}rj(n)}catch(S){t=S,fn===n&&n!==null&&(fn=n=n.return);continue}break}while(!0)}function tj(){var e=g0.current;return g0.current=m0,e===null?m0:e}function WC(){(xn===0||xn===3||xn===2)&&(xn=4),Rn===null||!(dl&268435455)&&!(e1&268435455)||To(Rn,$n)}function _0(e,t){var n=dt;dt|=2;var r=tj();(Rn!==e||$n!==t)&&(js=null,tl(e,t));do try{SK();break}catch(i){ej(e,i)}while(!0);if(EC(),dt=n,g0.current=r,fn!==null)throw Error(fe(261));return Rn=null,$n=0,xn}function SK(){for(;fn!==null;)nj(fn)}function CK(){for(;fn!==null&&!Gq();)nj(fn)}function nj(e){var t=sj(e.alternate,e,Dr);e.memoizedProps=e.pendingProps,t===null?rj(e):fn=t,FC.current=null}function rj(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=vK(n,t),n!==null){n.flags&=32767,fn=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{xn=6,fn=null;return}}else if(n=gK(n,t,Dr),n!==null){fn=n;return}if(t=t.sibling,t!==null){fn=t;return}fn=t=e}while(t!==null);xn===0&&(xn=5)}function ja(e,t,n){var r=St,i=ni.transition;try{ni.transition=null,St=1,kK(e,t,n,r)}finally{ni.transition=i,St=r}return null}function kK(e,t,n,r){do Vc();while(Bo!==null);if(dt&6)throw Error(fe(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(fe(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(sY(e,s),e===Rn&&(fn=Rn=null,$n=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Cm||(Cm=!0,oj(e0,function(){return Vc(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=ni.transition,ni.transition=null;var a=St;St=1;var o=dt;dt|=4,FC.current=null,_K(e,n),QL(n,e),VY(uw),n0=!!cw,uw=cw=null,e.current=n,xK(n),Xq(),dt=o,St=a,ni.transition=s}else e.current=n;if(Cm&&(Cm=!1,Bo=e,y0=i),s=e.pendingLanes,s===0&&(ta=null),Zq(n.stateNode),br(e,an()),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(v0)throw v0=!1,e=Aw,Aw=null,e;return y0&1&&e.tag!==0&&Vc(),s=e.pendingLanes,s&1?e===Dw?sf++:(sf=0,Dw=e):sf=0,ba(),null}function Vc(){if(Bo!==null){var e=I7(y0),t=ni.transition,n=St;try{if(ni.transition=null,St=16>e?16:e,Bo===null)var r=!1;else{if(e=Bo,Bo=null,y0=0,dt&6)throw Error(fe(331));var i=dt;for(dt|=4,ke=e.current;ke!==null;){var s=ke,a=s.child;if(ke.flags&16){var o=s.deletions;if(o!==null){for(var l=0;l<o.length;l++){var c=o[l];for(ke=c;ke!==null;){var d=ke;switch(d.tag){case 0:case 11:case 15:nf(8,d,s)}var u=d.child;if(u!==null)u.return=d,ke=u;else for(;ke!==null;){d=ke;var f=d.sibling,g=d.return;if(KL(d),d===c){ke=null;break}if(f!==null){f.return=g,ke=f;break}ke=g}}}var x=s.alternate;if(x!==null){var _=x.child;if(_!==null){x.child=null;do{var v=_.sibling;_.sibling=null,_=v}while(_!==null)}}ke=s}}if(s.subtreeFlags&2064&&a!==null)a.return=s,ke=a;else e:for(;ke!==null;){if(s=ke,s.flags&2048)switch(s.tag){case 0:case 11:case 15:nf(9,s,s.return)}var p=s.sibling;if(p!==null){p.return=s.return,ke=p;break e}ke=s.return}}var m=e.current;for(ke=m;ke!==null;){a=ke;var y=a.child;if(a.subtreeFlags&2064&&y!==null)y.return=a,ke=y;else e:for(a=m;ke!==null;){if(o=ke,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:Zv(9,o)}}catch(S){rn(o,o.return,S)}if(o===a){ke=null;break e}var b=o.sibling;if(b!==null){b.return=o.return,ke=b;break e}ke=o.return}}if(dt=i,ba(),cs&&typeof cs.onPostCommitFiberRoot=="function")try{cs.onPostCommitFiberRoot(Vv,e)}catch{}r=!0}return r}finally{St=n,ni.transition=t}}return!1}function h4(e,t,n){t=Mu(n,t),t=IL(e,t,1),e=ea(e,t,1),t=ir(),e!==null&&(Sp(e,1,t),br(e,t))}function rn(e,t,n){if(e.tag===3)h4(e,e,n);else for(;t!==null;){if(t.tag===3){h4(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ta===null||!ta.has(r))){e=Mu(n,e),e=$L(t,e,1),t=ea(t,e,1),e=ir(),t!==null&&(Sp(t,1,e),br(t,e));break}}t=t.return}}function EK(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=ir(),e.pingedLanes|=e.suspendedLanes&n,Rn===e&&($n&n)===n&&(xn===4||xn===3&&($n&130023424)===$n&&500>an()-zC?tl(e,0):BC|=n),br(e,t)}function ij(e,t){t===0&&(e.mode&1?(t=pm,pm<<=1,!(pm&130023424)&&(pm=4194304)):t=1);var n=ir();e=Gs(e,t),e!==null&&(Sp(e,t,n),br(e,n))}function TK(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ij(e,n)}function MK(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(fe(314))}r!==null&&r.delete(t),ij(e,n)}var sj;sj=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||_r.current)yr=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return yr=!1,mK(e,t,n);yr=!!(e.flags&131072)}else yr=!1,Gt&&t.flags&1048576&&cL(t,c0,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;wg(e,t),e=t.pendingProps;var i=Cu(t,Qn.current);Wc(t,n),i=PC(null,t,r,e,i,n);var s=NC();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,xr(r)?(s=!0,a0(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,RC(t),i.updater=Jv,t.stateNode=i,i._reactInternals=t,_w(t,r,e,n),t=ww(null,t,r,!0,s,n)):(t.tag=0,Gt&&s&&wC(t),tr(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(wg(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=AK(r),e=vi(r,e),i){case 0:t=bw(null,t,r,e,n);break e;case 1:t=n4(null,t,r,e,n);break e;case 11:t=e4(null,t,r,e,n);break e;case 14:t=t4(null,t,r,vi(r.type,e),n);break e}throw Error(fe(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:vi(r,i),bw(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:vi(r,i),n4(e,t,r,i,n);case 3:e:{if(UL(t),e===null)throw Error(fe(387));r=t.pendingProps,s=t.memoizedState,i=s.element,mL(e,t),h0(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=Mu(Error(fe(423)),t),t=r4(e,t,r,n,i);break e}else if(r!==i){i=Mu(Error(fe(424)),t),t=r4(e,t,r,n,i);break e}else for(jr=Zo(t.stateNode.containerInfo.firstChild),Or=t,Gt=!0,Si=null,n=fL(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ku(),r===i){t=Xs(e,t,n);break e}tr(e,t,r,n)}t=t.child}return t;case 5:return gL(t),e===null&&gw(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,a=i.children,dw(r,i)?a=null:s!==null&&dw(r,s)&&(t.flags|=32),zL(e,t),tr(e,t,a,n),t.child;case 6:return e===null&&gw(t),null;case 13:return HL(e,t,n);case 4:return AC(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Eu(t,null,r,n):tr(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:vi(r,i),e4(e,t,r,i,n);case 7:return tr(e,t,t.pendingProps,n),t.child;case 8:return tr(e,t,t.pendingProps.children,n),t.child;case 12:return tr(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,Nt(u0,r._currentValue),r._currentValue=a,s!==null)if(ji(s.value,a)){if(s.children===i.children&&!_r.current){t=Xs(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=Vs(-1,n&-n),l.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?l.next=l:(l.next=d.next,d.next=l),c.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),vw(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(fe(341));a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),vw(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}tr(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Wc(t,n),i=oi(i),r=r(i),t.flags|=1,tr(e,t,r,n),t.child;case 14:return r=t.type,i=vi(r,t.pendingProps),i=vi(r.type,i),t4(e,t,r,i,n);case 15:return FL(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:vi(r,i),wg(e,t),t.tag=1,xr(r)?(e=!0,a0(t)):e=!1,Wc(t,n),OL(t,r,i),_w(t,r,i,n),ww(null,t,r,!0,e,n);case 19:return WL(e,t,n);case 22:return BL(e,t,n)}throw Error(fe(156,t.tag))};function oj(e,t){return j7(e,t)}function RK(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 ei(e,t,n,r){return new RK(e,t,n,r)}function VC(e){return e=e.prototype,!(!e||!e.isReactComponent)}function AK(e){if(typeof e=="function")return VC(e)?1:0;if(e!=null){if(e=e.$$typeof,e===uC)return 11;if(e===dC)return 14}return 2}function ra(e,t){var n=e.alternate;return n===null?(n=ei(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 kg(e,t,n,r,i,s){var a=2;if(r=e,typeof e=="function")VC(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Tc:return nl(n.children,i,s,t);case cC:a=8,i|=8;break;case Hb:return e=ei(12,n,t,i|2),e.elementType=Hb,e.lanes=s,e;case Wb:return e=ei(13,n,t,i),e.elementType=Wb,e.lanes=s,e;case Vb:return e=ei(19,n,t,i),e.elementType=Vb,e.lanes=s,e;case g7:return t1(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case p7:a=10;break e;case m7:a=9;break e;case uC:a=11;break e;case dC:a=14;break e;case wo:a=16,r=null;break e}throw Error(fe(130,e==null?e:typeof e,""))}return t=ei(a,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function nl(e,t,n,r){return e=ei(7,e,r,t),e.lanes=n,e}function t1(e,t,n,r){return e=ei(22,e,r,t),e.elementType=g7,e.lanes=n,e.stateNode={isHidden:!1},e}function sx(e,t,n){return e=ei(6,e,null,t),e.lanes=n,e}function ox(e,t,n){return t=ei(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function DK(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=B_(0),this.expirationTimes=B_(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=B_(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function qC(e,t,n,r,i,s,a,o,l){return e=new DK(e,t,n,o,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=ei(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},RC(s),e}function LK(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ec,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function aj(e){if(!e)return la;e=e._reactInternals;e:{if(Pl(e)!==e||e.tag!==1)throw Error(fe(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(xr(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(fe(171))}if(e.tag===1){var n=e.type;if(xr(n))return aL(e,n,t)}return t}function lj(e,t,n,r,i,s,a,o,l){return e=qC(n,r,!0,e,i,s,a,o,l),e.context=aj(null),n=e.current,r=ir(),i=na(n),s=Vs(r,i),s.callback=t??null,ea(n,s,i),e.current.lanes=i,Sp(e,i,r),br(e,r),e}function n1(e,t,n,r){var i=t.current,s=ir(),a=na(i);return n=aj(n),t.context===null?t.context=n:t.pendingContext=n,t=Vs(s,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=ea(i,t,a),e!==null&&(Di(e,i,a,s),_g(e,i,a)),a}function x0(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 f4(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function YC(e,t){f4(e,t),(e=e.alternate)&&f4(e,t)}function jK(){return null}var cj=typeof reportError=="function"?reportError:function(e){console.error(e)};function KC(e){this._internalRoot=e}r1.prototype.render=KC.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(fe(409));n1(e,t,null,null)};r1.prototype.unmount=KC.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;hl(function(){n1(null,e,null,null)}),t[Ks]=null}};function r1(e){this._internalRoot=e}r1.prototype.unstable_scheduleHydration=function(e){if(e){var t=B7();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Eo.length&&t!==0&&t<Eo[n].priority;n++);Eo.splice(n,0,e),n===0&&U7(e)}};function GC(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function i1(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function p4(){}function PK(e,t,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var c=x0(a);s.call(c)}}var a=lj(t,r,e,0,null,!1,!1,"",p4);return e._reactRootContainer=a,e[Ks]=a.current,Mf(e.nodeType===8?e.parentNode:e),hl(),a}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var o=r;r=function(){var c=x0(l);o.call(c)}}var l=qC(e,0,!1,null,null,!1,!1,"",p4);return e._reactRootContainer=l,e[Ks]=l.current,Mf(e.nodeType===8?e.parentNode:e),hl(function(){n1(t,l,n,r)}),l}function s1(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=x0(a);o.call(l)}}n1(t,a,e,i)}else a=PK(n,t,e,i,r);return x0(a)}$7=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Oh(t.pendingLanes);n!==0&&(pC(t,n|1),br(t,an()),!(dt&6)&&(Ru=an()+500,ba()))}break;case 13:hl(function(){var r=Gs(e,1);if(r!==null){var i=ir();Di(r,e,1,i)}}),YC(e,1)}};mC=function(e){if(e.tag===13){var t=Gs(e,134217728);if(t!==null){var n=ir();Di(t,e,134217728,n)}YC(e,134217728)}};F7=function(e){if(e.tag===13){var t=na(e),n=Gs(e,t);if(n!==null){var r=ir();Di(n,e,t,r)}YC(e,t)}};B7=function(){return St};z7=function(e,t){var n=St;try{return St=e,t()}finally{St=n}};tw=function(e,t,n){switch(t){case"input":if(Kb(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=Gv(r);if(!i)throw Error(fe(90));y7(r),Kb(r,i)}}}break;case"textarea":x7(e,n);break;case"select":t=n.value,t!=null&&Bc(e,!!n.multiple,t,!1)}};T7=UC;M7=hl;var NK={usingClientEntryPoint:!1,Events:[kp,Dc,Gv,k7,E7,UC]},Zd={findFiberByHostInstance:Ba,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},OK={bundleType:Zd.bundleType,version:Zd.version,rendererPackageName:Zd.rendererPackageName,rendererConfig:Zd.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ao.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=D7(e),e===null?null:e.stateNode},findFiberByHostInstance:Zd.findFiberByHostInstance||jK,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 km=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!km.isDisabled&&km.supportsFiber)try{Vv=km.inject(OK),cs=km}catch{}}zr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=NK;zr.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!GC(t))throw Error(fe(200));return LK(e,t,null,n)};zr.createRoot=function(e,t){if(!GC(e))throw Error(fe(299));var n=!1,r="",i=cj;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=qC(e,1,!1,null,null,n,!1,r,i),e[Ks]=t.current,Mf(e.nodeType===8?e.parentNode:e),new KC(t)};zr.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(fe(188)):(e=Object.keys(e).join(","),Error(fe(268,e)));return e=D7(t),e=e===null?null:e.stateNode,e};zr.flushSync=function(e){return hl(e)};zr.hydrate=function(e,t,n){if(!i1(t))throw Error(fe(200));return s1(null,e,t,!0,n)};zr.hydrateRoot=function(e,t,n){if(!GC(e))throw Error(fe(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",a=cj;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=lj(t,null,e,1,n??null,i,!1,s,a),e[Ks]=t.current,Mf(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 r1(t)};zr.render=function(e,t,n){if(!i1(t))throw Error(fe(200));return s1(null,e,t,!1,n)};zr.unmountComponentAtNode=function(e){if(!i1(e))throw Error(fe(40));return e._reactRootContainer?(hl(function(){s1(null,null,e,!1,function(){e._reactRootContainer=null,e[Ks]=null})}),!0):!1};zr.unstable_batchedUpdates=UC;zr.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!i1(n))throw Error(fe(200));if(e==null||e._reactInternals===void 0)throw Error(fe(38));return s1(e,t,n,!1,r)};zr.version="18.3.1-next-f1338f8080-20240426";function uj(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(uj)}catch(e){console.error(e)}}uj(),u7.exports=zr;var vr=u7.exports;const dj=bn(vr);var m4=vr;zb.createRoot=m4.createRoot,zb.hydrateRoot=m4.hydrateRoot;var IK=typeof $o=="object"&&$o&&$o.Object===Object&&$o,$K=typeof self=="object"&&self&&self.Object===Object&&self;IK||$K||Function("return this")();var FK=typeof window<"u"?C.useLayoutEffect:C.useEffect;function Pi(e,t,n,r){const i=C.useRef(t);FK(()=>{i.current=t},[t]),C.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 BK(e,t,n="mousedown",r={}){Pi(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 zK(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 hj={exports:{}},fj={};/**
 * @license React
 * use-sync-external-store-shim.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Au=C;function UK(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var HK=typeof Object.is=="function"?Object.is:UK,WK=Au.useState,VK=Au.useEffect,qK=Au.useLayoutEffect,YK=Au.useDebugValue;function KK(e,t){var n=t(),r=WK({inst:{value:n,getSnapshot:t}}),i=r[0].inst,s=r[1];return qK(function(){i.value=n,i.getSnapshot=t,ax(i)&&s({inst:i})},[e,n,t]),VK(function(){return ax(i)&&s({inst:i}),e(function(){ax(i)&&s({inst:i})})},[e]),YK(n),n}function ax(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!HK(e,n)}catch{return!0}}function GK(e,t){return t()}var XK=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?GK:KK;fj.useSyncExternalStore=Au.useSyncExternalStore!==void 0?Au.useSyncExternalStore:XK;hj.exports=fj;var XC=hj.exports;const QK=a7.useInsertionEffect,JK=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ZK=JK?C.useLayoutEffect:C.useEffect,eG=QK||ZK,pj=e=>{const t=C.useRef([e,(...n)=>t[0](...n)]).current;return eG(()=>{t[0]=e}),t[1]},tG="popstate",QC="pushState",JC="replaceState",nG="hashchange",g4=[tG,QC,JC,nG],rG=e=>{for(const t of g4)addEventListener(t,e);return()=>{for(const t of g4)removeEventListener(t,e)}},mj=(e,t)=>XC.useSyncExternalStore(rG,e,t),iG=()=>location.search,sG=({ssrSearch:e=""}={})=>mj(iG,()=>e),v4=()=>location.pathname,oG=({ssrPath:e}={})=>mj(v4,e?()=>e:v4),ZC=(e,{replace:t=!1,state:n=null}={})=>history[t?JC:QC](n,"",e),aG=(e={})=>[oG(e),ZC],y4=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[y4]>"u"){for(const e of[QC,JC]){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,y4,{value:!0})}const lG=(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())?"~"+t:t.slice(e.length)||"/",gj=(e="")=>e==="/"?"":e,cG=(e,t)=>e[0]==="~"?e.slice(1):gj(t)+e,uG=(e="",t)=>lG(_4(gj(e)),_4(t)),_4=e=>{try{return decodeURI(e)}catch{return e}},vj={hook:aG,searchHook:sG,parser:zK,base:"",ssrPath:void 0,ssrSearch:void 0,hrefs:e=>e},yj=C.createContext(vj),od=()=>C.useContext(yj),_j={},xj=C.createContext(_j),dG=()=>C.useContext(xj),o1=e=>{const[t,n]=e.hook(e);return[uG(e.base,t),pj((r,i)=>n(cG(r,e.base),i))]},wa=()=>o1(od()),e5=(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 c=s!==!1?Object.fromEntries(s.map((u,f)=>[u,l[f]])):a.groups;let d={...l};return c&&Object.assign(d,c),d})(),...r?[o]:[]]:[!1,null]},a1=e=>e5(od().parser,e,wa()[0]),hG=({children:e,...t})=>{var d,u;const n=od(),r=t.hook?vj:n;let i=r;const[s,a]=((d=t.ssrPath)==null?void 0:d.split("?"))??[];a&&(t.ssrSearch=a,t.ssrPath=s),t.hrefs=t.hrefs??((u=t.hook)==null?void 0:u.hrefs);let o=C.useRef({}),l=o.current,c=l;for(let f in r){const g=f==="base"?r[f]+(t[f]||""):t[f]||r[f];l===c&&g!==c[f]&&(o.current=c={...c}),c[f]=g,g!==r[f]&&(i=c)}return C.createElement(yj.Provider,{value:i,children:e})},x4=({children:e,component:t},n)=>t?C.createElement(t,{params:n}):typeof e=="function"?e(n):e,fG=e=>{let t=C.useRef(_j),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},$a=({path:e,nest:t,match:n,...r})=>{const i=od(),[s]=o1(i),[a,o,l]=n??e5(i.parser,e,s,t),c=fG({...dG(),...o});if(!a)return null;const d=l?C.createElement(hG,{base:l},x4(r,c)):x4(r,c);return C.createElement(xj.Provider,{value:c,children:d})},ca=C.forwardRef((e,t)=>{const n=od(),[r,i]=o1(n),{to:s="",href:a=s,onClick:o,asChild:l,children:c,className:d,replace:u,state:f,...g}=e,x=pj(v=>{v.ctrlKey||v.metaKey||v.altKey||v.shiftKey||v.button!==0||(o==null||o(v),v.defaultPrevented||(v.preventDefault(),i(a,e)))}),_=n.hrefs(a[0]==="~"?a.slice(1):n.base+a,n);return l&&C.isValidElement(c)?C.cloneElement(c,{onClick:x,href:_}):C.createElement("a",{...g,onClick:x,href:_,className:d!=null&&d.call?d(r===a):d,children:c,ref:t})}),bj=e=>Array.isArray(e)?e.flatMap(t=>bj(t&&t.type===C.Fragment?t.props.children:t)):[e],wj=({children:e,location:t})=>{const n=od(),[r]=o1(n);for(const i of bj(e)){let s=0;if(C.isValidElement(i)&&(s=e5(n.parser,i.props.path,t||r,i.props.nest))[0])return C.cloneElement(i,{match:s})}return null};function Sj(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=Sj(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function pG(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Sj(e))&&(r&&(r+=" "),r+=t);return r}const t5="-",mG=e=>{const t=vG(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const o=a.split(t5);return o[0]===""&&o.length!==1&&o.shift(),Cj(o,t)||gG(a)},getConflictingClassGroupIds:(a,o)=>{const l=n[a]||[];return o&&r[a]?[...l,...r[a]]:l}}},Cj=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?Cj(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const s=e.join(t5);return(a=t.validators.find(({validator:o})=>o(s)))==null?void 0:a.classGroupId},b4=/^\[(.+)\]$/,gG=e=>{if(b4.test(e)){const t=b4.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},vG=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return _G(Object.entries(e.classGroups),n).forEach(([s,a])=>{Pw(a,r,s,t)}),r},Pw=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const s=i===""?t:w4(t,i);s.classGroupId=n;return}if(typeof i=="function"){if(yG(i)){Pw(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,a])=>{Pw(a,w4(t,s),n,r)})})},w4=(e,t)=>{let n=e;return t.split(t5).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},yG=e=>e.isThemeGetter,_G=(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,xG=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)}}},kj="!",bG=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],s=t.length,a=o=>{const l=[];let c=0,d=0,u;for(let v=0;v<o.length;v++){let p=o[v];if(c===0){if(p===i&&(r||o.slice(v,v+s)===t)){l.push(o.slice(d,v)),d=v+s;continue}if(p==="/"){u=v;continue}}p==="["?c++:p==="]"&&c--}const f=l.length===0?o:o.substring(d),g=f.startsWith(kj),x=g?f.substring(1):f,_=u&&u>d?u-d:void 0;return{modifiers:l,hasImportantModifier:g,baseClassName:x,maybePostfixModifierPosition:_}};return n?o=>n({className:o,parseClassName:a}):a},wG=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},SG=e=>({cache:xG(e.cacheSize),parseClassName:bG(e),...mG(e)}),CG=/\s+/,kG=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,s=[],a=e.trim().split(CG);let o="";for(let l=a.length-1;l>=0;l-=1){const c=a[l],{modifiers:d,hasImportantModifier:u,baseClassName:f,maybePostfixModifierPosition:g}=n(c);let x=!!g,_=r(x?f.substring(0,g):f);if(!_){if(!x){o=c+(o.length>0?" "+o:o);continue}if(_=r(f),!_){o=c+(o.length>0?" "+o:o);continue}x=!1}const v=wG(d).join(":"),p=u?v+kj:v,m=p+_;if(s.includes(m))continue;s.push(m);const y=i(_,x);for(let b=0;b<y.length;++b){const S=y[b];s.push(p+S)}o=c+(o.length>0?" "+o:o)}return o};function EG(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Ej(t))&&(r&&(r+=" "),r+=n);return r}const Ej=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Ej(e[r]))&&(n&&(n+=" "),n+=t);return n};function TG(e,...t){let n,r,i,s=a;function a(l){const c=t.reduce((d,u)=>u(d),e());return n=SG(c),r=n.cache.get,i=n.cache.set,s=o,o(l)}function o(l){const c=r(l);if(c)return c;const d=kG(l,n);return i(l,d),d}return function(){return s(EG.apply(null,arguments))}}const Ft=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Tj=/^\[(?:([a-z-]+):)?(.+)\]$/i,MG=/^\d+\/\d+$/,RG=new Set(["px","full","screen"]),AG=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,DG=/\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$/,LG=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,jG=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,PG=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Rs=e=>qc(e)||RG.has(e)||MG.test(e),go=e=>ad(e,"length",UG),qc=e=>!!e&&!Number.isNaN(Number(e)),lx=e=>ad(e,"number",qc),eh=e=>!!e&&Number.isInteger(Number(e)),NG=e=>e.endsWith("%")&&qc(e.slice(0,-1)),qe=e=>Tj.test(e),vo=e=>AG.test(e),OG=new Set(["length","size","percentage"]),IG=e=>ad(e,OG,Mj),$G=e=>ad(e,"position",Mj),FG=new Set(["image","url"]),BG=e=>ad(e,FG,WG),zG=e=>ad(e,"",HG),th=()=>!0,ad=(e,t,n)=>{const r=Tj.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},UG=e=>DG.test(e)&&!LG.test(e),Mj=()=>!1,HG=e=>jG.test(e),WG=e=>PG.test(e),VG=()=>{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"),c=Ft("grayscale"),d=Ft("hueRotate"),u=Ft("invert"),f=Ft("gap"),g=Ft("gradientColorStops"),x=Ft("gradientColorStopPositions"),_=Ft("inset"),v=Ft("margin"),p=Ft("opacity"),m=Ft("padding"),y=Ft("saturate"),b=Ft("scale"),S=Ft("sepia"),w=Ft("skew"),E=Ft("space"),k=Ft("translate"),T=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto",qe,t],L=()=>[qe,t],j=()=>["",Rs,go],P=()=>["auto",qc,qe],$=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],F=()=>["solid","dashed","dotted","double","none"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],I=()=>["start","end","center","between","around","evenly","stretch"],A=()=>["","0",qe],D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>[qc,qe];return{cacheSize:500,separator:":",theme:{colors:[th],spacing:[Rs,go],blur:["none","",vo,qe],brightness:H(),borderColor:[e],borderRadius:["none","","full",vo,qe],borderSpacing:L(),borderWidth:j(),contrast:H(),grayscale:A(),hueRotate:H(),invert:A(),gap:L(),gradientColorStops:[e],gradientColorStopPositions:[NG,go],inset:M(),margin:M(),opacity:H(),padding:L(),saturate:H(),scale:H(),sepia:A(),skew:H(),space:L(),translate:L()},classGroups:{aspect:[{aspect:["auto","square","video",qe]}],container:["container"],columns:[{columns:[vo]}],"break-after":[{"break-after":D()}],"break-before":[{"break-before":D()}],"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:[...$(),qe]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[_]}],"inset-x":[{"inset-x":[_]}],"inset-y":[{"inset-y":[_]}],start:[{start:[_]}],end:[{end:[_]}],top:[{top:[_]}],right:[{right:[_]}],bottom:[{bottom:[_]}],left:[{left:[_]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",eh,qe]}],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",qe]}],grow:[{grow:A()}],shrink:[{shrink:A()}],order:[{order:["first","last","none",eh,qe]}],"grid-cols":[{"grid-cols":[th]}],"col-start-end":[{col:["auto",{span:["full",eh,qe]},qe]}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":[th]}],"row-start-end":[{row:["auto",{span:[eh,qe]},qe]}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",qe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",qe]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...I()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...I(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...I(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[m]}],px:[{px:[m]}],py:[{py:[m]}],ps:[{ps:[m]}],pe:[{pe:[m]}],pt:[{pt:[m]}],pr:[{pr:[m]}],pb:[{pb:[m]}],pl:[{pl:[m]}],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",qe,t]}],"min-w":[{"min-w":[qe,t,"min","max","fit"]}],"max-w":[{"max-w":[qe,t,"none","full","min","max","fit","prose",{screen:[vo]},vo]}],h:[{h:[qe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[qe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[qe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[qe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",vo,go]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",lx]}],"font-family":[{font:[th]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",qe]}],"line-clamp":[{"line-clamp":["none",qc,lx]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Rs,qe]}],"list-image":[{"list-image":["none",qe]}],"list-style-type":[{list:["none","disc","decimal",qe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[p]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[p]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...F(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Rs,go]}],"underline-offset":[{"underline-offset":["auto",Rs,qe]}],"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:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",qe]}],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",qe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[p]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...$(),$G]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",IG]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},BG]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"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":[p]}],"border-style":[{border:[...F(),"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":[p]}],"divide-style":[{divide:F()}],"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:["",...F()]}],"outline-offset":[{"outline-offset":[Rs,qe]}],"outline-w":[{outline:[Rs,go]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:j()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[p]}],"ring-offset-w":[{"ring-offset":[Rs,go]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",vo,zG]}],"shadow-color":[{shadow:[th]}],opacity:[{opacity:[p]}],"mix-blend":[{"mix-blend":[...W(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",vo,qe]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[u]}],saturate:[{saturate:[y]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[p]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"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",qe]}],duration:[{duration:H()}],ease:[{ease:["linear","in","out","in-out",qe]}],delay:[{delay:H()}],animate:[{animate:["none","spin","ping","pulse","bounce",qe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[eh,qe]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"skew-x":[{"skew-x":[w]}],"skew-y":[{"skew-y":[w]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",qe]}],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",qe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"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",qe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Rs,go,lx]}],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"]}}},qG=TG(VG);var b0={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 Rj(e){var t=function(r,i){var s=C4({},t,i||{});return KG(r,s)};return C4(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 l1=Rj({});function YG(e){var t=[e.language];if(ds(e,"fallbacks"))if(GG(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(ds(e.languages,r))return e.languages[r];if(ds(b0,r))return b0[r]}throw new Error("No language found.")}function KG(e,t){var n,r,i;e=Math.abs(e);var s=YG(t),a=[],o,l,c;for(n=0,r=t.units.length;n<r;n++){if(o=t.units[n],l=t.unitMeasures[o],n+1===r)if(ds(t,"maxDecimalPoints")){var d=Math.pow(10,t.maxDecimalPoints),u=e/l;c=parseFloat((Math.floor(d*u)/d).toFixed(t.maxDecimalPoints))}else c=e/l;else c=Math.floor(e/l);a.push({unitCount:c,unitName:o}),e-=c*l}var f=0;for(n=0;n<a.length;n++)if(a[n].unitCount){f=n;break}if(t.round){var g,x;for(n=a.length-1;n>=0&&(i=a[n],i.unitCount=Math.round(i.unitCount),n!==0);n--)x=a[n-1],g=t.unitMeasures[x.unitName]/t.unitMeasures[i.unitName],(i.unitCount%g===0||t.largest&&t.largest-1<n-f)&&(x.unitCount+=i.unitCount/g,i.unitCount=0)}var _=[];for(n=0,a.length;n<r&&(i=a[n],i.unitCount&&_.push(S4(i.unitCount,i.unitName,s,t)),_.length!==t.largest);n++);if(_.length){var v;if(ds(t,"delimiter")?v=t.delimiter:ds(s,"delimiter")?v=s.delimiter:v=", ",!t.conjunction||_.length===1)return _.join(v);if(_.length===2)return _.join(t.conjunction);if(_.length>2)return _.slice(0,-1).join(v)+(t.serialComma?",":"")+t.conjunction+_.slice(-1)}else return S4(0,t.units[t.units.length-1],s,t)}function S4(e,t,n,r){var i;ds(r,"decimal")?i=r.decimal:ds(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 C4(e){for(var t,n=1;n<arguments.length;n++){t=arguments[n];for(var r in t)ds(t,r)&&(e[r]=t[r])}return e}var GG=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};function ds(e,t){return Object.prototype.hasOwnProperty.call(e,t)}l1.getSupportedLanguages=function(){var t=[];for(var n in b0)ds(b0,n)&&n!=="gr"&&t.push(n);return t};l1.humanizer=Rj;const ps=Object.create(null);ps.open="0";ps.close="1";ps.ping="2";ps.pong="3";ps.message="4";ps.upgrade="5";ps.noop="6";const Eg=Object.create(null);Object.keys(ps).forEach(e=>{Eg[ps[e]]=e});const Nw={type:"error",data:"parser error"},Aj=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Dj=typeof ArrayBuffer=="function",Lj=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,n5=({type:e,data:t},n,r)=>Aj&&t instanceof Blob?n?r(t):k4(t,r):Dj&&(t instanceof ArrayBuffer||Lj(t))?n?r(t):k4(new Blob([t]),r):r(ps[e]+(t||"")),k4=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function E4(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let cx;function XG(e,t){if(Aj&&e.data instanceof Blob)return e.data.arrayBuffer().then(E4).then(t);if(Dj&&(e.data instanceof ArrayBuffer||Lj(e.data)))return t(E4(e.data));n5(e,!1,n=>{cx||(cx=new TextEncoder),t(cx.encode(n))})}const T4="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$h=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<T4.length;e++)$h[T4.charCodeAt(e)]=e;const QG=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 c=new ArrayBuffer(t),d=new Uint8Array(c);for(r=0;r<n;r+=4)s=$h[e.charCodeAt(r)],a=$h[e.charCodeAt(r+1)],o=$h[e.charCodeAt(r+2)],l=$h[e.charCodeAt(r+3)],d[i++]=s<<2|a>>4,d[i++]=(a&15)<<4|o>>2,d[i++]=(o&3)<<6|l&63;return c},JG=typeof ArrayBuffer=="function",r5=(e,t)=>{if(typeof e!="string")return{type:"message",data:jj(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:ZG(e.substring(1),t)}:Eg[n]?e.length>1?{type:Eg[n],data:e.substring(1)}:{type:Eg[n]}:Nw},ZG=(e,t)=>{if(JG){const n=QG(e);return jj(n,t)}else return{base64:!0,data:e}},jj=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Pj="",eX=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((s,a)=>{n5(s,!1,o=>{r[a]=o,++i===n&&t(r.join(Pj))})})},tX=(e,t)=>{const n=e.split(Pj),r=[];for(let i=0;i<n.length;i++){const s=r5(n[i],t);if(r.push(s),s.type==="error")break}return r};function nX(){return new TransformStream({transform(e,t){XG(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 ux;function Em(e){return e.reduce((t,n)=>t+n.length,0)}function Tm(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 rX(e,t){ux||(ux=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(Em(n)<1)break;const l=Tm(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(Em(n)<2)break;const l=Tm(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(Em(n)<8)break;const l=Tm(n,8),c=new DataView(l.buffer,l.byteOffset,l.length),d=c.getUint32(0);if(d>Math.pow(2,21)-1){o.enqueue(Nw);break}i=d*Math.pow(2,32)+c.getUint32(4),r=3}else{if(Em(n)<i)break;const l=Tm(n,i);o.enqueue(r5(s?l:ux.decode(l),t)),r=0}if(i===0||i>e){o.enqueue(Nw);break}}}})}const Nj=4;function pn(e){if(e)return iX(e)}function iX(e){for(var t in pn.prototype)e[t]=pn.prototype[t];return e}pn.prototype.on=pn.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};pn.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};pn.prototype.off=pn.prototype.removeListener=pn.prototype.removeAllListeners=pn.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};pn.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};pn.prototype.emitReserved=pn.prototype.emit;pn.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};pn.prototype.hasListeners=function(e){return!!this.listeners(e).length};const c1=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),Kr=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),sX="arraybuffer";function Oj(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const oX=Kr.setTimeout,aX=Kr.clearTimeout;function u1(e,t){t.useNativeTimers?(e.setTimeoutFn=oX.bind(Kr),e.clearTimeoutFn=aX.bind(Kr)):(e.setTimeoutFn=Kr.setTimeout.bind(Kr),e.clearTimeoutFn=Kr.clearTimeout.bind(Kr))}const lX=1.33;function cX(e){return typeof e=="string"?uX(e):Math.ceil((e.byteLength||e.size)*lX)}function uX(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 Ij(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function dX(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function hX(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 fX extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class i5 extends pn{constructor(t){super(),this.writable=!1,u1(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 fX(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=r5(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=dX(t);return n.length?"?"+n:""}}class pX extends i5{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)};tX(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,eX(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]=Ij()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let $j=!1;try{$j=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const mX=$j;function gX(){}class vX extends pX{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 hs extends pn{constructor(t,n,r){super(),this.createRequest=t,u1(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=Oj(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=hs.requestsCount++,hs.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=gX,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete hs.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()}}hs.requestsCount=0;hs.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",M4);else if(typeof addEventListener=="function"){const e="onpagehide"in Kr?"pagehide":"unload";addEventListener(e,M4,!1)}}function M4(){for(let e in hs.requests)hs.requests.hasOwnProperty(e)&&hs.requests[e].abort()}const yX=function(){const e=Fj({xdomain:!1});return e&&e.responseType!==null}();class _X extends vX{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=yX&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new hs(Fj,this.uri(),t)}}function Fj(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||mX))return new XMLHttpRequest}catch{}if(!t)try{return new Kr[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Bj=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class xX extends i5{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=Bj?{}:Oj(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;n5(r,this.supportsBinary,s=>{try{this.doWrite(r,s)}catch{}i&&c1(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=Ij()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const dx=Kr.WebSocket||Kr.MozWebSocket;class bX extends xX{createSocket(t,n,r){return Bj?new dx(t,n,r):n?new dx(t,n):new dx(t)}doWrite(t,n){this.ws.send(n)}}class wX extends i5{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=rX(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=nX();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&&c1(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const SX={websocket:bX,webtransport:wX,polling:_X},CX=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,kX=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Ow(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=CX.exec(e||""),s={},a=14;for(;a--;)s[kX[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=EX(s,s.path),s.queryKey=TX(s,s.query),s}function EX(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 TX(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,s){i&&(n[i]=s)}),n}const Iw=typeof addEventListener=="function"&&typeof removeEventListener=="function",Tg=[];Iw&&addEventListener("offline",()=>{Tg.forEach(e=>e())},!1);class ia extends pn{constructor(t,n){if(super(),this.binaryType=sX,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=Ow(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=Ow(n.host).host);u1(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=hX(this.opts.query)),Iw&&(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"})},Tg.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=Nj,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&&ia.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",ia.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+=cX(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,c1(()=>{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(ia.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(),Iw&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Tg.indexOf(this._offlineEventListener);r!==-1&&Tg.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}ia.protocol=Nj;class MX extends ia{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;ia.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",u=>{if(!r)if(u.type==="pong"&&u.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;ia.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),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,d(),n.close(),n=null)}const a=u=>{const f=new Error("probe error: "+u);f.transport=n.name,s(),this.emitReserved("upgradeError",f)};function o(){a("transport closed")}function l(){a("socket closed")}function c(u){n&&u.name!==n.name&&s()}const d=()=>{n.removeListener("open",i),n.removeListener("error",a),n.removeListener("close",o),this.off("close",l),this.off("upgrading",c)};n.once("open",i),n.once("error",a),n.once("close",o),this.once("close",l),this.once("upgrading",c),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 RX=class extends MX{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=>SX[i]).filter(i=>!!i)),super(t,r)}};function AX(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=Ow(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 DX=typeof ArrayBuffer=="function",LX=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,zj=Object.prototype.toString,jX=typeof Blob=="function"||typeof Blob<"u"&&zj.call(Blob)==="[object BlobConstructor]",PX=typeof File=="function"||typeof File<"u"&&zj.call(File)==="[object FileConstructor]";function s5(e){return DX&&(e instanceof ArrayBuffer||LX(e))||jX&&e instanceof Blob||PX&&e instanceof File}function Mg(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Mg(e[n]))return!0;return!1}if(s5(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Mg(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Mg(e[n]))return!0;return!1}function NX(e){const t=[],n=e.data,r=e;return r.data=$w(n,t),r.attachments=t.length,{packet:r,buffers:t}}function $w(e,t){if(!e)return e;if(s5(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]=$w(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]=$w(e[r],t));return n}return e}function OX(e,t){return e.data=Fw(e.data,t),delete e.attachments,e}function Fw(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]=Fw(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Fw(e[n],t));return e}const IX=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],$X=5;var at;(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"})(at||(at={}));class FX{constructor(t){this.replacer=t}encode(t){return(t.type===at.EVENT||t.type===at.ACK)&&Mg(t)?this.encodeAsBinary({type:t.type===at.EVENT?at.BINARY_EVENT:at.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===at.BINARY_EVENT||t.type===at.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=NX(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function R4(e){return Object.prototype.toString.call(e)==="[object Object]"}class o5 extends pn{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===at.BINARY_EVENT;r||n.type===at.BINARY_ACK?(n.type=r?at.EVENT:at.ACK,this.reconstructor=new BX(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(s5(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(at[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===at.BINARY_EVENT||r.type===at.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(o5.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 at.CONNECT:return R4(n);case at.DISCONNECT:return n===void 0;case at.CONNECT_ERROR:return typeof n=="string"||R4(n);case at.EVENT:case at.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&IX.indexOf(n[0])===-1);case at.ACK:case at.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class BX{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=OX(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const zX=Object.freeze(Object.defineProperty({__proto__:null,Decoder:o5,Encoder:FX,get PacketType(){return at},protocol:$X},Symbol.toStringTag,{value:"Module"}));function xi(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const UX=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Uj extends pn{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=[xi(t,"open",this.onopen.bind(this)),xi(t,"packet",this.onpacket.bind(this)),xi(t,"error",this.onerror.bind(this)),xi(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(UX.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:at.EVENT,data:n};if(a.options={},a.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const d=this.ids++,u=n.pop();this._registerAckCallback(d,u),a.id=d}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:at.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 at.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 at.EVENT:case at.BINARY_EVENT:this.onevent(t);break;case at.ACK:case at.BINARY_ACK:this.onack(t);break;case at.DISCONNECT:this.ondisconnect();break;case at.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:at.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:at.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 ld(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}ld.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};ld.prototype.reset=function(){this.attempts=0};ld.prototype.setMin=function(e){this.ms=e};ld.prototype.setMax=function(e){this.max=e};ld.prototype.setJitter=function(e){this.jitter=e};class Bw extends pn{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,u1(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 ld({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||zX;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 RX(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=xi(n,"open",function(){r.onopen(),t&&t()}),s=o=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",o),t?t(o):this.maybeReconnectOnOpen()},a=xi(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(xi(t,"ping",this.onping.bind(this)),xi(t,"data",this.ondata.bind(this)),xi(t,"error",this.onerror.bind(this)),xi(t,"close",this.onclose.bind(this)),xi(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){c1(()=>{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 Uj(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 nh={};function of(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=AX(e,t.path||"/socket.io"),r=n.source,i=n.id,s=n.path,a=nh[i]&&s in nh[i].nsps,o=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let l;return o?l=new Bw(r,t):(nh[i]||(nh[i]=new Bw(r,t)),l=nh[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(of,{Manager:Bw,Socket:Uj,io:of,connect:of});function HX(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Tp(...e){return t=>e.forEach(n=>HX(n,t))}function We(...e){return C.useCallback(Tp(...e),e)}var ua=C.forwardRef((e,t)=>{const{children:n,...r}=e,i=C.Children.toArray(n),s=i.find(WX);if(s){const a=s.props.children,o=i.map(l=>l===s?C.Children.count(a)>1?C.Children.only(null):C.isValidElement(a)?a.props.children:null:l);return h.jsx(zw,{...r,ref:t,children:C.isValidElement(a)?C.cloneElement(a,void 0,o):null})}return h.jsx(zw,{...r,ref:t,children:n})});ua.displayName="Slot";var zw=C.forwardRef((e,t)=>{const{children:n,...r}=e;if(C.isValidElement(n)){const i=qX(n);return C.cloneElement(n,{...VX(r,n.props),ref:t?Tp(t,i):i})}return C.Children.count(n)>1?C.Children.only(null):null});zw.displayName="SlotClone";var a5=({children:e})=>h.jsx(h.Fragment,{children:e});function WX(e){return C.isValidElement(e)&&e.type===a5}function VX(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 qX(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 Hj(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=Hj(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function YX(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=Hj(e))&&(r&&(r+=" "),r+=t);return r}const A4=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,D4=YX,Sa=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return D4(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:s}=t,a=Object.keys(i).map(c=>{const d=n==null?void 0:n[c],u=s==null?void 0:s[c];if(d===null)return null;const f=A4(d)||A4(u);return i[c][f]}),o=n&&Object.entries(n).reduce((c,d)=>{let[u,f]=d;return f===void 0||(c[u]=f),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,d)=>{let{class:u,className:f,...g}=d;return Object.entries(g).every(x=>{let[_,v]=x;return Array.isArray(v)?v.includes({...s,...o}[_]):{...s,...o}[_]===v})?[...c,u,f]:c},[]);return D4(e,a,l,n==null?void 0:n.class,n==null?void 0:n.className)},Mp=Sa("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/75",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/75",warning:"bg-warning text-warning-foreground hover:bg-warning/75",success:"bg-success text-success-foreground hover:bg-success/75",info:"bg-info text-info-foreground hover:bg-info/75",outline:"border border-foreground hover:bg-primary hover:text-primary-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/75",ghost:"hover:bg-primary hover:text-primary-foreground",link:"text-accent underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",inline:"h-5 px-1.5 rounded-sm text-xs tracking-wider",xs:"h-7 rounded-sm px-2 text-sm",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Ke=C.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},s)=>{const a=r?ua:"button";return h.jsx(a,{className:ie(Mp({variant:t,size:n,className:e})),ref:s,...i})});Ke.displayName="Button";const ln=C.forwardRef(({className:e,type:t,...n},r)=>h.jsx("input",{type:t,className:ie("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}));ln.displayName="Input";var KX=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Me=KX.reduce((e,t)=>{const n=C.forwardRef((r,i)=>{const{asChild:s,...a}=r,o=s?ua:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(o,{...a,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function w0(e,t){e&&vr.flushSync(()=>e.dispatchEvent(t))}var GX="Label",af=C.forwardRef((e,t)=>h.jsx(Me.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())}}));af.displayName=GX;var Wj=af;const XX=Sa("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),sr=C.forwardRef(({className:e,...t},n)=>h.jsx(Wj,{ref:n,className:ie(XX(),e),...t}));sr.displayName=Wj.displayName;var cd=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},fl=typeof window>"u"||"Deno"in globalThis;function Wr(){}function QX(e,t){return typeof e=="function"?e(t):e}function Uw(e){return typeof e=="number"&&e>=0&&e!==1/0}function Vj(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Yc(e,t){return typeof e=="function"?e(t):e}function Ci(e,t){return typeof e=="function"?e(t):e}function L4(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:a,stale:o}=e;if(a){if(r){if(t.queryHash!==l5(a,t.options))return!1}else if(!If(t.queryKey,a))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof o=="boolean"&&t.isStale()!==o||i&&i!==t.state.fetchStatus||s&&!s(t))}function j4(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(pl(t.options.mutationKey)!==pl(s))return!1}else if(!If(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function l5(e,t){return((t==null?void 0:t.queryKeyHashFn)||pl)(e)}function pl(e){return JSON.stringify(e,(t,n)=>Hw(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function If(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!If(e[n],t[n])):!1}function qj(e,t){if(e===t)return e;const n=P4(e)&&P4(t);if(n||Hw(e)&&Hw(t)){const r=n?e:Object.keys(e),i=r.length,s=n?t:Object.keys(t),a=s.length,o=n?[]:{};let l=0;for(let c=0;c<a;c++){const d=n?c:s[c];(!n&&r.includes(d)||n)&&e[d]===void 0&&t[d]===void 0?(o[d]=void 0,l++):(o[d]=qj(e[d],t[d]),o[d]===e[d]&&e[d]!==void 0&&l++)}return i===a&&l===i?e:o}return t}function S0(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function P4(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Hw(e){if(!N4(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!N4(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function N4(e){return Object.prototype.toString.call(e)==="[object Object]"}function JX(e){return new Promise(t=>{setTimeout(t,e)})}function Ww(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?qj(e,t):t}function ZX(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function eQ(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Yj=Symbol();function Kj(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Yj?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Ka,Ro,uu,z8,tQ=(z8=class extends cd{constructor(){super();Ne(this,Ka);Ne(this,Ro);Ne(this,uu);Ce(this,uu,t=>{if(!fl&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){Q(this,Ro)||this.setEventListener(Q(this,uu))}onUnsubscribe(){var t;this.hasListeners()||((t=Q(this,Ro))==null||t.call(this),Ce(this,Ro,void 0))}setEventListener(t){var n;Ce(this,uu,t),(n=Q(this,Ro))==null||n.call(this),Ce(this,Ro,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){Q(this,Ka)!==t&&(Ce(this,Ka,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof Q(this,Ka)=="boolean"?Q(this,Ka):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ka=new WeakMap,Ro=new WeakMap,uu=new WeakMap,z8),c5=new tQ,du,Ao,hu,U8,nQ=(U8=class extends cd{constructor(){super();Ne(this,du,!0);Ne(this,Ao);Ne(this,hu);Ce(this,hu,t=>{if(!fl&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){Q(this,Ao)||this.setEventListener(Q(this,hu))}onUnsubscribe(){var t;this.hasListeners()||((t=Q(this,Ao))==null||t.call(this),Ce(this,Ao,void 0))}setEventListener(t){var n;Ce(this,hu,t),(n=Q(this,Ao))==null||n.call(this),Ce(this,Ao,t(this.setOnline.bind(this)))}setOnline(t){Q(this,du)!==t&&(Ce(this,du,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return Q(this,du)}},du=new WeakMap,Ao=new WeakMap,hu=new WeakMap,U8),C0=new nQ;function Vw(){let e,t;const n=new Promise((i,s)=>{e=i,t=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}function rQ(e){return Math.min(1e3*2**e,3e4)}function Gj(e){return(e??"online")==="online"?C0.isOnline():!0}var Xj=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function hx(e){return e instanceof Xj}function Qj(e){let t=!1,n=0,r=!1,i;const s=Vw(),a=_=>{var v;r||(f(new Xj(_)),(v=e.abort)==null||v.call(e))},o=()=>{t=!0},l=()=>{t=!1},c=()=>c5.isFocused()&&(e.networkMode==="always"||C0.isOnline())&&e.canRun(),d=()=>Gj(e.networkMode)&&e.canRun(),u=_=>{var v;r||(r=!0,(v=e.onSuccess)==null||v.call(e,_),i==null||i(),s.resolve(_))},f=_=>{var v;r||(r=!0,(v=e.onError)==null||v.call(e,_),i==null||i(),s.reject(_))},g=()=>new Promise(_=>{var v;i=p=>{(r||c())&&_(p)},(v=e.onPause)==null||v.call(e)}).then(()=>{var _;i=void 0,r||(_=e.onContinue)==null||_.call(e)}),x=()=>{if(r)return;let _;const v=n===0?e.initialPromise:void 0;try{_=v??e.fn()}catch(p){_=Promise.reject(p)}Promise.resolve(_).then(u).catch(p=>{var w;if(r)return;const m=e.retry??(fl?0:3),y=e.retryDelay??rQ,b=typeof y=="function"?y(n,p):y,S=m===!0||typeof m=="number"&&n<m||typeof m=="function"&&m(n,p);if(t||!S){f(p);return}n++,(w=e.onFail)==null||w.call(e,n,p),JX(b).then(()=>c()?void 0:g()).then(()=>{t?f(p):x()})})};return{promise:s,cancel:a,continue:()=>(i==null||i(),s),cancelRetry:o,continueRetry:l,canStart:d,start:()=>(d()?x():g().then(x),s)}}function iQ(){let e=[],t=0,n=o=>{o()},r=o=>{o()},i=o=>setTimeout(o,0);const s=o=>{t?e.push(o):i(()=>{n(o)})},a=()=>{const o=e;e=[],o.length&&i(()=>{r(()=>{o.forEach(l=>{n(l)})})})};return{batch:o=>{let l;t++;try{l=o()}finally{t--,t||a()}return l},batchCalls:o=>(...l)=>{s(()=>{o(...l)})},schedule:s,setNotifyFunction:o=>{n=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{i=o}}}var yn=iQ(),Ga,H8,Jj=(H8=class{constructor(){Ne(this,Ga)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Uw(this.gcTime)&&Ce(this,Ga,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(fl?1/0:5*60*1e3))}clearGcTimeout(){Q(this,Ga)&&(clearTimeout(Q(this,Ga)),Ce(this,Ga,void 0))}},Ga=new WeakMap,H8),fu,pu,Hr,Vn,yp,Xa,yi,Ls,W8,sQ=(W8=class extends Jj{constructor(t){super();Ne(this,yi);Ne(this,fu);Ne(this,pu);Ne(this,Hr);Ne(this,Vn);Ne(this,yp);Ne(this,Xa);Ce(this,Xa,!1),Ce(this,yp,t.defaultOptions),this.setOptions(t.options),this.observers=[],Ce(this,Hr,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ce(this,fu,oQ(this.options)),this.state=t.state??Q(this,fu),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=Q(this,Vn))==null?void 0:t.promise}setOptions(t){this.options={...Q(this,yp),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Q(this,Hr).remove(this)}setData(t,n){const r=Ww(this.state.data,t,this.options);return Qe(this,yi,Ls).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Qe(this,yi,Ls).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=Q(this,Vn))==null?void 0:r.promise;return(i=Q(this,Vn))==null||i.cancel(t),n?n.then(Wr).catch(Wr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Q(this,fu))}isActive(){return this.observers.some(t=>Ci(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!Vj(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=Q(this,Vn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=Q(this,Vn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),Q(this,Hr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(Q(this,Vn)&&(Q(this,Xa)?Q(this,Vn).cancel({revert:!0}):Q(this,Vn).cancelRetry()),this.scheduleGc()),Q(this,Hr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Qe(this,yi,Ls).call(this,{type:"invalidate"})}fetch(t,n){var l,c,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(Q(this,Vn))return Q(this,Vn).continueRetry(),Q(this,Vn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const u=this.observers.find(f=>f.options.queryFn);u&&this.setOptions(u.options)}const r=new AbortController,i=u=>{Object.defineProperty(u,"signal",{enumerable:!0,get:()=>(Ce(this,Xa,!0),r.signal)})},s=()=>{const u=Kj(this.options,n),f={queryKey:this.queryKey,meta:this.meta};return i(f),Ce(this,Xa,!1),this.options.persister?this.options.persister(u,f,this):u(f)},a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(a),(l=this.options.behavior)==null||l.onFetch(a,this),Ce(this,pu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=a.fetchOptions)==null?void 0:c.meta))&&Qe(this,yi,Ls).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta});const o=u=>{var f,g,x,_;hx(u)&&u.silent||Qe(this,yi,Ls).call(this,{type:"error",error:u}),hx(u)||((g=(f=Q(this,Hr).config).onError)==null||g.call(f,u,this),(_=(x=Q(this,Hr).config).onSettled)==null||_.call(x,this.state.data,u,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Ce(this,Vn,Qj({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:u=>{var f,g,x,_;if(u===void 0){o(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(u)}catch(v){o(v);return}(g=(f=Q(this,Hr).config).onSuccess)==null||g.call(f,u,this),(_=(x=Q(this,Hr).config).onSettled)==null||_.call(x,u,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:o,onFail:(u,f)=>{Qe(this,yi,Ls).call(this,{type:"failed",failureCount:u,error:f})},onPause:()=>{Qe(this,yi,Ls).call(this,{type:"pause"})},onContinue:()=>{Qe(this,yi,Ls).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),Q(this,Vn).start()}},fu=new WeakMap,pu=new WeakMap,Hr=new WeakMap,Vn=new WeakMap,yp=new WeakMap,Xa=new WeakMap,yi=new WeakSet,Ls=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Zj(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return hx(i)&&i.revert&&Q(this,pu)?{...Q(this,pu),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),yn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),Q(this,Hr).notify({query:this,type:"updated",action:t})})},W8);function Zj(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Gj(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function oQ(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Zi,V8,aQ=(V8=class extends cd{constructor(t={}){super();Ne(this,Zi);this.config=t,Ce(this,Zi,new Map)}build(t,n,r){const i=n.queryKey,s=n.queryHash??l5(i,n);let a=this.get(s);return a||(a=new sQ({cache:this,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(a)),a}add(t){Q(this,Zi).has(t.queryHash)||(Q(this,Zi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=Q(this,Zi).get(t.queryHash);n&&(t.destroy(),n===t&&Q(this,Zi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){yn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return Q(this,Zi).get(t)}getAll(){return[...Q(this,Zi).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>L4(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>L4(t,r)):n}notify(t){yn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){yn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){yn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Zi=new WeakMap,V8),es,Zn,Qa,ts,xo,q8,lQ=(q8=class extends Jj{constructor(t){super();Ne(this,ts);Ne(this,es);Ne(this,Zn);Ne(this,Qa);this.mutationId=t.mutationId,Ce(this,Zn,t.mutationCache),Ce(this,es,[]),this.state=t.state||eP(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){Q(this,es).includes(t)||(Q(this,es).push(t),this.clearGcTimeout(),Q(this,Zn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ce(this,es,Q(this,es).filter(n=>n!==t)),this.scheduleGc(),Q(this,Zn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){Q(this,es).length||(this.state.status==="pending"?this.scheduleGc():Q(this,Zn).remove(this))}continue(){var t;return((t=Q(this,Qa))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,s,a,o,l,c,d,u,f,g,x,_,v,p,m,y,b,S,w,E;Ce(this,Qa,Qj({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(k,T)=>{Qe(this,ts,xo).call(this,{type:"failed",failureCount:k,error:T})},onPause:()=>{Qe(this,ts,xo).call(this,{type:"pause"})},onContinue:()=>{Qe(this,ts,xo).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Q(this,Zn).canRun(this)}));const n=this.state.status==="pending",r=!Q(this,Qa).canStart();try{if(!n){Qe(this,ts,xo).call(this,{type:"pending",variables:t,isPaused:r}),await((s=(i=Q(this,Zn).config).onMutate)==null?void 0:s.call(i,t,this));const T=await((o=(a=this.options).onMutate)==null?void 0:o.call(a,t));T!==this.state.context&&Qe(this,ts,xo).call(this,{type:"pending",context:T,variables:t,isPaused:r})}const k=await Q(this,Qa).start();return await((c=(l=Q(this,Zn).config).onSuccess)==null?void 0:c.call(l,k,t,this.state.context,this)),await((u=(d=this.options).onSuccess)==null?void 0:u.call(d,k,t,this.state.context)),await((g=(f=Q(this,Zn).config).onSettled)==null?void 0:g.call(f,k,null,this.state.variables,this.state.context,this)),await((_=(x=this.options).onSettled)==null?void 0:_.call(x,k,null,t,this.state.context)),Qe(this,ts,xo).call(this,{type:"success",data:k}),k}catch(k){try{throw await((p=(v=Q(this,Zn).config).onError)==null?void 0:p.call(v,k,t,this.state.context,this)),await((y=(m=this.options).onError)==null?void 0:y.call(m,k,t,this.state.context)),await((S=(b=Q(this,Zn).config).onSettled)==null?void 0:S.call(b,void 0,k,this.state.variables,this.state.context,this)),await((E=(w=this.options).onSettled)==null?void 0:E.call(w,void 0,k,t,this.state.context)),k}finally{Qe(this,ts,xo).call(this,{type:"error",error:k})}}finally{Q(this,Zn).runNext(this)}}},es=new WeakMap,Zn=new WeakMap,Qa=new WeakMap,ts=new WeakSet,xo=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),yn.batch(()=>{Q(this,es).forEach(r=>{r.onMutationUpdate(t)}),Q(this,Zn).notify({mutation:this,type:"updated",action:t})})},q8);function eP(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ar,_p,Y8,cQ=(Y8=class extends cd{constructor(t={}){super();Ne(this,Ar);Ne(this,_p);this.config=t,Ce(this,Ar,new Map),Ce(this,_p,Date.now())}build(t,n,r){const i=new lQ({mutationCache:this,mutationId:++lm(this,_p)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){const n=Mm(t),r=Q(this,Ar).get(n)??[];r.push(t),Q(this,Ar).set(n,r),this.notify({type:"added",mutation:t})}remove(t){var r;const n=Mm(t);if(Q(this,Ar).has(n)){const i=(r=Q(this,Ar).get(n))==null?void 0:r.filter(s=>s!==t);i&&(i.length===0?Q(this,Ar).delete(n):Q(this,Ar).set(n,i))}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=(r=Q(this,Ar).get(Mm(t)))==null?void 0:r.find(i=>i.state.status==="pending");return!n||n===t}runNext(t){var r;const n=(r=Q(this,Ar).get(Mm(t)))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){yn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...Q(this,Ar).values()].flat()}find(t){const n={exact:!0,...t};return this.getAll().find(r=>j4(n,r))}findAll(t={}){return this.getAll().filter(n=>j4(t,n))}notify(t){yn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return yn.batch(()=>Promise.all(t.map(n=>n.continue().catch(Wr))))}},Ar=new WeakMap,_p=new WeakMap,Y8);function Mm(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function O4(e){return{onFetch:(t,n)=>{var d,u,f,g,x;const r=t.options,i=(f=(u=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:u.fetchMore)==null?void 0:f.direction,s=((g=t.state.data)==null?void 0:g.pages)||[],a=((x=t.state.data)==null?void 0:x.pageParams)||[];let o={pages:[],pageParams:[]},l=0;const c=async()=>{let _=!1;const v=y=>{Object.defineProperty(y,"signal",{enumerable:!0,get:()=>(t.signal.aborted?_=!0:t.signal.addEventListener("abort",()=>{_=!0}),t.signal)})},p=Kj(t.options,t.fetchOptions),m=async(y,b,S)=>{if(_)return Promise.reject();if(b==null&&y.pages.length)return Promise.resolve(y);const w={queryKey:t.queryKey,pageParam:b,direction:S?"backward":"forward",meta:t.options.meta};v(w);const E=await p(w),{maxPages:k}=t.options,T=S?eQ:ZX;return{pages:T(y.pages,E,k),pageParams:T(y.pageParams,b,k)}};if(i&&s.length){const y=i==="backward",b=y?uQ:I4,S={pages:s,pageParams:a},w=b(r,S);o=await m(S,w,y)}else{const y=e??s.length;do{const b=l===0?a[0]??r.initialPageParam:I4(r,o);if(l>0&&b==null)break;o=await m(o,b),l++}while(l<y)}return o};t.options.persister?t.fetchFn=()=>{var _,v;return(v=(_=t.options).persister)==null?void 0:v.call(_,c,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function I4(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function uQ(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var nn,Do,Lo,mu,gu,jo,vu,yu,K8,dQ=(K8=class{constructor(e={}){Ne(this,nn);Ne(this,Do);Ne(this,Lo);Ne(this,mu);Ne(this,gu);Ne(this,jo);Ne(this,vu);Ne(this,yu);Ce(this,nn,e.queryCache||new aQ),Ce(this,Do,e.mutationCache||new cQ),Ce(this,Lo,e.defaultOptions||{}),Ce(this,mu,new Map),Ce(this,gu,new Map),Ce(this,jo,0)}mount(){lm(this,jo)._++,Q(this,jo)===1&&(Ce(this,vu,c5.subscribe(async e=>{e&&(await this.resumePausedMutations(),Q(this,nn).onFocus())})),Ce(this,yu,C0.subscribe(async e=>{e&&(await this.resumePausedMutations(),Q(this,nn).onOnline())})))}unmount(){var e,t;lm(this,jo)._--,Q(this,jo)===0&&((e=Q(this,vu))==null||e.call(this),Ce(this,vu,void 0),(t=Q(this,yu))==null||t.call(this),Ce(this,yu,void 0))}isFetching(e){return Q(this,nn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return Q(this,Do).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=Q(this,nn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);if(t===void 0)return this.fetchQuery(e);{const n=this.defaultQueryOptions(e),r=Q(this,nn).build(this,n);return e.revalidateIfStale&&r.isStaleByTime(Yc(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return Q(this,nn).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=Q(this,nn).get(r.queryHash),s=i==null?void 0:i.state.data,a=QX(t,s);if(a!==void 0)return Q(this,nn).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return yn.batch(()=>Q(this,nn).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=Q(this,nn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=Q(this,nn);yn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=Q(this,nn),r={type:"active",...e};return yn.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=yn.batch(()=>Q(this,nn).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Wr).catch(Wr)}invalidateQueries(e={},t={}){return yn.batch(()=>{if(Q(this,nn).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=yn.batch(()=>Q(this,nn).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(Wr)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Wr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=Q(this,nn).build(this,t);return n.isStaleByTime(Yc(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Wr).catch(Wr)}fetchInfiniteQuery(e){return e.behavior=O4(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Wr).catch(Wr)}ensureInfiniteQueryData(e){return e.behavior=O4(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return C0.isOnline()?Q(this,Do).resumePausedMutations():Promise.resolve()}getQueryCache(){return Q(this,nn)}getMutationCache(){return Q(this,Do)}getDefaultOptions(){return Q(this,Lo)}setDefaultOptions(e){Ce(this,Lo,e)}setQueryDefaults(e,t){Q(this,mu).set(pl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...Q(this,mu).values()];let n={};return t.forEach(r=>{If(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){Q(this,gu).set(pl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...Q(this,gu).values()];let n={};return t.forEach(r=>{If(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...Q(this,Lo).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=l5(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.enabled!==!0&&t.queryFn===Yj&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...Q(this,Lo).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){Q(this,nn).clear(),Q(this,Do).clear()}},nn=new WeakMap,Do=new WeakMap,Lo=new WeakMap,mu=new WeakMap,gu=new WeakMap,jo=new WeakMap,vu=new WeakMap,yu=new WeakMap,K8),dr,ot,xp,er,Ja,_u,Po,ns,bp,xu,bu,Za,el,No,wu,wt,Fh,qw,Yw,Kw,Gw,Xw,Qw,Jw,tP,G8,hQ=(G8=class extends cd{constructor(t,n){super();Ne(this,wt);Ne(this,dr);Ne(this,ot);Ne(this,xp);Ne(this,er);Ne(this,Ja);Ne(this,_u);Ne(this,Po);Ne(this,ns);Ne(this,bp);Ne(this,xu);Ne(this,bu);Ne(this,Za);Ne(this,el);Ne(this,No);Ne(this,wu,new Set);this.options=n,Ce(this,dr,t),Ce(this,ns,null),Ce(this,Po,Vw()),this.options.experimental_prefetchInRender||Q(this,Po).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Q(this,ot).addObserver(this),$4(Q(this,ot),this.options)?Qe(this,wt,Fh).call(this):this.updateResult(),Qe(this,wt,Gw).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Zw(Q(this,ot),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Zw(Q(this,ot),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Qe(this,wt,Xw).call(this),Qe(this,wt,Qw).call(this),Q(this,ot).removeObserver(this)}setOptions(t,n){const r=this.options,i=Q(this,ot);if(this.options=Q(this,dr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ci(this.options.enabled,Q(this,ot))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Qe(this,wt,Jw).call(this),Q(this,ot).setOptions(this.options),r._defaulted&&!S0(this.options,r)&&Q(this,dr).getQueryCache().notify({type:"observerOptionsUpdated",query:Q(this,ot),observer:this});const s=this.hasListeners();s&&F4(Q(this,ot),i,this.options,r)&&Qe(this,wt,Fh).call(this),this.updateResult(n),s&&(Q(this,ot)!==i||Ci(this.options.enabled,Q(this,ot))!==Ci(r.enabled,Q(this,ot))||Yc(this.options.staleTime,Q(this,ot))!==Yc(r.staleTime,Q(this,ot)))&&Qe(this,wt,qw).call(this);const a=Qe(this,wt,Yw).call(this);s&&(Q(this,ot)!==i||Ci(this.options.enabled,Q(this,ot))!==Ci(r.enabled,Q(this,ot))||a!==Q(this,No))&&Qe(this,wt,Kw).call(this,a)}getOptimisticResult(t){const n=Q(this,dr).getQueryCache().build(Q(this,dr),t),r=this.createResult(n,t);return pQ(this,r)&&(Ce(this,er,r),Ce(this,_u,this.options),Ce(this,Ja,Q(this,ot).state)),r}getCurrentResult(){return Q(this,er)}trackResult(t,n){const r={};return Object.keys(t).forEach(i=>{Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),n==null||n(i),t[i])})}),r}trackProp(t){Q(this,wu).add(t)}getCurrentQuery(){return Q(this,ot)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=Q(this,dr).defaultQueryOptions(t),r=Q(this,dr).getQueryCache().build(Q(this,dr),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Qe(this,wt,Fh).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),Q(this,er)))}createResult(t,n){var E;const r=Q(this,ot),i=this.options,s=Q(this,er),a=Q(this,Ja),o=Q(this,_u),c=t!==r?t.state:Q(this,xp),{state:d}=t;let u={...d},f=!1,g;if(n._optimisticResults){const k=this.hasListeners(),T=!k&&$4(t,n),R=k&&F4(t,r,n,i);(T||R)&&(u={...u,...Zj(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:x,errorUpdatedAt:_,status:v}=u;if(n.select&&u.data!==void 0)if(s&&u.data===(a==null?void 0:a.data)&&n.select===Q(this,bp))g=Q(this,xu);else try{Ce(this,bp,n.select),g=n.select(u.data),g=Ww(s==null?void 0:s.data,g,n),Ce(this,xu,g),Ce(this,ns,null)}catch(k){Ce(this,ns,k)}else g=u.data;if(n.placeholderData!==void 0&&g===void 0&&v==="pending"){let k;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(o==null?void 0:o.placeholderData))k=s.data;else if(k=typeof n.placeholderData=="function"?n.placeholderData((E=Q(this,bu))==null?void 0:E.state.data,Q(this,bu)):n.placeholderData,n.select&&k!==void 0)try{k=n.select(k),Ce(this,ns,null)}catch(T){Ce(this,ns,T)}k!==void 0&&(v="success",g=Ww(s==null?void 0:s.data,k,n),f=!0)}Q(this,ns)&&(x=Q(this,ns),g=Q(this,xu),_=Date.now(),v="error");const p=u.fetchStatus==="fetching",m=v==="pending",y=v==="error",b=m&&p,S=g!==void 0;return{status:v,fetchStatus:u.fetchStatus,isPending:m,isSuccess:v==="success",isError:y,isInitialLoading:b,isLoading:b,data:g,dataUpdatedAt:u.dataUpdatedAt,error:x,errorUpdatedAt:_,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:p,isRefetching:p&&!m,isLoadingError:y&&!S,isPaused:u.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:y&&S,isStale:u5(t,n),refetch:this.refetch,promise:Q(this,Po)}}updateResult(t){const n=Q(this,er),r=this.createResult(Q(this,ot),this.options);if(Ce(this,Ja,Q(this,ot).state),Ce(this,_u,this.options),Q(this,Ja).data!==void 0&&Ce(this,bu,Q(this,ot)),S0(r,n))return;if(this.options.experimental_prefetchInRender){const a=c=>{r.status==="error"?c.reject(r.error):r.data!==void 0&&c.resolve(r.data)},o=()=>{const c=Ce(this,Po,r.promise=Vw());a(c)},l=Q(this,Po);switch(l.status){case"pending":a(l);break;case"fulfilled":(r.status==="error"||r.data!==l.value)&&o();break;case"rejected":(r.status!=="error"||r.error!==l.reason)&&o();break}}Ce(this,er,r);const i={},s=()=>{if(!n)return!0;const{notifyOnChangeProps:a}=this.options,o=typeof a=="function"?a():a;if(o==="all"||!o&&!Q(this,wu).size)return!0;const l=new Set(o??Q(this,wu));return this.options.throwOnError&&l.add("error"),Object.keys(Q(this,er)).some(c=>{const d=c;return Q(this,er)[d]!==n[d]&&l.has(d)})};(t==null?void 0:t.listeners)!==!1&&s()&&(i.listeners=!0),Qe(this,wt,tP).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Qe(this,wt,Gw).call(this)}},dr=new WeakMap,ot=new WeakMap,xp=new WeakMap,er=new WeakMap,Ja=new WeakMap,_u=new WeakMap,Po=new WeakMap,ns=new WeakMap,bp=new WeakMap,xu=new WeakMap,bu=new WeakMap,Za=new WeakMap,el=new WeakMap,No=new WeakMap,wu=new WeakMap,wt=new WeakSet,Fh=function(t){Qe(this,wt,Jw).call(this);let n=Q(this,ot).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Wr)),n},qw=function(){Qe(this,wt,Xw).call(this);const t=Yc(this.options.staleTime,Q(this,ot));if(fl||Q(this,er).isStale||!Uw(t))return;const r=Vj(Q(this,er).dataUpdatedAt,t)+1;Ce(this,Za,setTimeout(()=>{Q(this,er).isStale||this.updateResult()},r))},Yw=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Q(this,ot)):this.options.refetchInterval)??!1},Kw=function(t){Qe(this,wt,Qw).call(this),Ce(this,No,t),!(fl||Ci(this.options.enabled,Q(this,ot))===!1||!Uw(Q(this,No))||Q(this,No)===0)&&Ce(this,el,setInterval(()=>{(this.options.refetchIntervalInBackground||c5.isFocused())&&Qe(this,wt,Fh).call(this)},Q(this,No)))},Gw=function(){Qe(this,wt,qw).call(this),Qe(this,wt,Kw).call(this,Qe(this,wt,Yw).call(this))},Xw=function(){Q(this,Za)&&(clearTimeout(Q(this,Za)),Ce(this,Za,void 0))},Qw=function(){Q(this,el)&&(clearInterval(Q(this,el)),Ce(this,el,void 0))},Jw=function(){const t=Q(this,dr).getQueryCache().build(Q(this,dr),this.options);if(t===Q(this,ot))return;const n=Q(this,ot);Ce(this,ot,t),Ce(this,xp,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},tP=function(t){yn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(Q(this,er))}),Q(this,dr).getQueryCache().notify({query:Q(this,ot),type:"observerResultsUpdated"})})},G8);function fQ(e,t){return Ci(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function $4(e,t){return fQ(e,t)||e.state.data!==void 0&&Zw(e,t,t.refetchOnMount)}function Zw(e,t,n){if(Ci(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&u5(e,t)}return!1}function F4(e,t,n,r){return(e!==t||Ci(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&u5(e,n)}function u5(e,t){return Ci(t.enabled,e)!==!1&&e.isStaleByTime(Yc(t.staleTime,e))}function pQ(e,t){return!S0(e.getCurrentResult(),t)}var Oo,Io,hr,Is,qs,Rg,e2,X8,mQ=(X8=class extends cd{constructor(n,r){super();Ne(this,qs);Ne(this,Oo);Ne(this,Io);Ne(this,hr);Ne(this,Is);Ce(this,Oo,n),this.setOptions(r),this.bindMethods(),Qe(this,qs,Rg).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=Q(this,Oo).defaultMutationOptions(n),S0(this.options,r)||Q(this,Oo).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Q(this,hr),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&pl(r.mutationKey)!==pl(this.options.mutationKey)?this.reset():((i=Q(this,hr))==null?void 0:i.state.status)==="pending"&&Q(this,hr).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=Q(this,hr))==null||n.removeObserver(this)}onMutationUpdate(n){Qe(this,qs,Rg).call(this),Qe(this,qs,e2).call(this,n)}getCurrentResult(){return Q(this,Io)}reset(){var n;(n=Q(this,hr))==null||n.removeObserver(this),Ce(this,hr,void 0),Qe(this,qs,Rg).call(this),Qe(this,qs,e2).call(this)}mutate(n,r){var i;return Ce(this,Is,r),(i=Q(this,hr))==null||i.removeObserver(this),Ce(this,hr,Q(this,Oo).getMutationCache().build(Q(this,Oo),this.options)),Q(this,hr).addObserver(this),Q(this,hr).execute(n)}},Oo=new WeakMap,Io=new WeakMap,hr=new WeakMap,Is=new WeakMap,qs=new WeakSet,Rg=function(){var r;const n=((r=Q(this,hr))==null?void 0:r.state)??eP();Ce(this,Io,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},e2=function(n){yn.batch(()=>{var r,i,s,a,o,l,c,d;if(Q(this,Is)&&this.hasListeners()){const u=Q(this,Io).variables,f=Q(this,Io).context;(n==null?void 0:n.type)==="success"?((i=(r=Q(this,Is)).onSuccess)==null||i.call(r,n.data,u,f),(a=(s=Q(this,Is)).onSettled)==null||a.call(s,n.data,null,u,f)):(n==null?void 0:n.type)==="error"&&((l=(o=Q(this,Is)).onError)==null||l.call(o,n.error,u,f),(d=(c=Q(this,Is)).onSettled)==null||d.call(c,void 0,n.error,u,f))}this.listeners.forEach(u=>{u(Q(this,Io))})})},X8),nP=C.createContext(void 0),rP=e=>{const t=C.useContext(nP);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},gQ=({client:e,children:t})=>(C.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),h.jsx(nP.Provider,{value:e,children:t})),iP=C.createContext(!1),vQ=()=>C.useContext(iP);iP.Provider;function yQ(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var _Q=C.createContext(yQ()),xQ=()=>C.useContext(_Q);function sP(e,t){return typeof e=="function"?e(...t):!!e}function oP(){}var bQ=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},wQ=e=>{C.useEffect(()=>{e.clearReset()},[e])},SQ=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&sP(n,[e.error,r]),CQ=e=>{e.suspense&&(typeof e.staleTime!="number"&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},kQ=(e,t)=>e.isLoading&&e.isFetching&&!t,EQ=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,B4=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function TQ(e,t,n){var d,u,f,g,x;const r=rP(),i=vQ(),s=xQ(),a=r.defaultQueryOptions(e);(u=(d=r.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||u.call(d,a),a._optimisticResults=i?"isRestoring":"optimistic",CQ(a),bQ(a,s),wQ(s);const o=!r.getQueryState(e.queryKey),[l]=C.useState(()=>new t(r,a)),c=l.getOptimisticResult(a);if(C.useSyncExternalStore(C.useCallback(_=>{const v=i?()=>{}:l.subscribe(yn.batchCalls(_));return l.updateResult(),v},[l,i]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),C.useEffect(()=>{l.setOptions(a,{listeners:!1})},[a,l]),EQ(a,c))throw B4(a,l,s);if(SQ({result:c,errorResetBoundary:s,throwOnError:a.throwOnError,query:r.getQueryCache().get(a.queryHash)}))throw c.error;if((g=(f=r.getDefaultOptions().queries)==null?void 0:f._experimental_afterQuery)==null||g.call(f,a,c),a.experimental_prefetchInRender&&!fl&&kQ(c,i)){const _=o?B4(a,l,s):(x=r.getQueryCache().get(a.queryHash))==null?void 0:x.promise;_==null||_.catch(oP).finally(()=>{l.hasListeners()||l.updateResult()})}return a.notifyOnChangeProps?c:l.trackResult(c)}function MQ(e,t){return TQ(e,hQ)}function ml(e,t){const n=rP(),[r]=C.useState(()=>new mQ(n,e));C.useEffect(()=>{r.setOptions(e)},[r,e]);const i=C.useSyncExternalStore(C.useCallback(a=>r.subscribe(yn.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=C.useCallback((a,o)=>{r.mutate(a,o).catch(oP)},[r]);if(i.error&&sP(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}/**
 * @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 RQ=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),aP=(...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 AQ={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 DQ=C.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:a,...o},l)=>C.createElement("svg",{ref:l,...AQ,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:aP("lucide",i),...o},[...a.map(([c,d])=>C.createElement(c,d)),...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 ye=(e,t)=>{const n=C.forwardRef(({className:r,...i},s)=>C.createElement(DQ,{ref:s,iconNode:t,className:aP(`lucide-${RQ(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 LQ=ye("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 jQ=ye("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 PQ=ye("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 NQ=ye("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 lP=ye("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 OQ=ye("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 IQ=ye("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 $Q=ye("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 FQ=ye("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 BQ=ye("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 d5=ye("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 ud=ye("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 zQ=ye("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 cP=ye("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 uP=ye("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 t2=ye("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 UQ=ye("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 HQ=ye("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 WQ=ye("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 VQ=ye("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 qQ=ye("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 YQ=ye("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 KQ=ye("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 GQ=ye("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 XQ=ye("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 z4=ye("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 QQ=ye("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 JQ=ye("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 k0=ye("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 da=ye("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 ZQ=ye("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 eJ=ye("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 tJ=ye("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 nJ=ye("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 rJ=ye("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 dP=ye("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 iJ=ye("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 E0=ye("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 sJ=ye("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 oJ=ye("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 hP=ye("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 h5=ye("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 aJ=ye("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 lJ=ye("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 T0=ye("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 cn=ye("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 cJ=ye("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 uJ=ye("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 dJ=ye("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 U4=ye("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 hJ=ye("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 fJ=ye("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 pJ=ye("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 mJ=ye("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 gJ=ye("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 vJ=ye("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 yJ=ye("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 fP=ye("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 _J=ye("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 xJ=ye("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 bJ=ye("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 wJ=ye("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 SJ=ye("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 CJ=ye("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 kJ=ye("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 EJ=ye("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 pP=ye("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 TJ=ye("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 mP=ye("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 gP=ye("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 MJ=ye("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 RJ=ye("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 AJ=ye("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 DJ=ye("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 LJ=ye("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 jJ=ye("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 PJ=ye("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 vP=ye("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 NJ=ye("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 OJ=ye("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 M0=ye("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 yP=ye("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 H4=ye("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 f5=ye("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 IJ=ye("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 bs=ye("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 $J=ye("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"}]]),ki={BASE_URL:"./",DEV:!1,MODE:"production",PROD:!0,SSR:!1};let FJ=0;function Je(e,t){const n=`atom${++FJ}`,r={toString(){return(ki?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof e=="function"?r.read=e:(r.init=e,r.read=BJ,r.write=zJ),t&&(r.write=t),r}function BJ(e){return e(this)}function zJ(e,t,n){return t(this,typeof n=="function"?n(e(this)):n)}const W4=(e,t)=>e.unstable_is?e.unstable_is(t):t===e,fx=e=>"init"in e,px=e=>!!e.write,R0=new WeakMap,n2=e=>{var t;return r2(e)&&!((t=R0.get(e))!=null&&t[1])},UJ=(e,t)=>{const n=R0.get(e);if(n)n[1]=!0,n[0].forEach(r=>r(t));else if((ki?"production":void 0)!=="production")throw new Error("[Bug] cancelable promise not found")},HJ=e=>{if(R0.has(e))return;const t=[new Set,!1];R0.set(e,t);const n=()=>{t[1]=!0};e.then(n,n),e.onCancel=r=>{t[0].add(r)}},r2=e=>typeof(e==null?void 0:e.then)=="function",V4=e=>"v"in e||"e"in e,Rm=e=>{if("e"in e)throw e.e;if((ki?"production":void 0)!=="production"&&!("v"in e))throw new Error("[Bug] atom state is not initialized");return e.v},_P=(e,t,n)=>{n.p.has(e)||(n.p.add(e),t.then(()=>{n.p.delete(e)},()=>{n.p.delete(e)}))},q4=(e,t,n,r,i)=>{var s;if((ki?"production":void 0)!=="production"&&r===t)throw new Error("[Bug] atom cannot depend on itself");n.d.set(r,i.n),n2(n.v)&&_P(t,n.v,i),(s=i.m)==null||s.t.add(t),e&&WJ(e,r,t)},lc=()=>[new Map,new Map,new Set],mx=(e,t,n)=>{e[0].has(t)||e[0].set(t,new Set),e[1].set(t,n)},WJ=(e,t,n)=>{const r=e[0].get(t);r&&r.add(n)},VJ=(e,t)=>e[0].get(t),Y4=(e,t)=>{e[2].add(t)},Aa=e=>{for(;e[1].size||e[2].size;){e[0].clear();const t=new Set(e[1].values());e[1].clear();const n=new Set(e[2]);e[2].clear(),t.forEach(r=>{var i;return(i=r.m)==null?void 0:i.l.forEach(s=>s())}),n.forEach(r=>r())}},xP=e=>{let t;(ki?"production":void 0)!=="production"&&(t=new Set);const n=(_,v,p)=>{const m="v"in v,y=v.v,b=n2(v.v)?v.v:null;if(r2(p)){HJ(p);for(const S of v.d.keys())_P(_,p,e(S,v));v.v=p,delete v.e}else v.v=p,delete v.e;(!m||!Object.is(y,v.v))&&(++v.n,b&&UJ(b,p))},r=(_,v,p,m)=>{var y;if(!(m!=null&&m(v))&&V4(p)&&(p.m||Array.from(p.d).every(([T,R])=>r(_,T,e(T,p),m).n===R)))return p;p.d.clear();let b=!0;const S=T=>{if(W4(v,T)){const M=e(T,p);if(!V4(M))if(fx(T))n(T,M,T.init);else throw new Error("no atom init");return Rm(M)}const R=r(_,T,e(T,p),m);if(b)q4(_,v,p,T,R);else{const M=lc();q4(M,v,p,T,R),c(M,v,p),Aa(M)}return Rm(R)};let w,E;const k={get signal(){return w||(w=new AbortController),w.signal},get setSelf(){return(ki?"production":void 0)!=="production"&&!px(v)&&console.warn("setSelf function cannot be used with read-only atom"),!E&&px(v)&&(E=(...T)=>{if((ki?"production":void 0)!=="production"&&b&&console.warn("setSelf function cannot be called in sync"),!b)return l(v,...T)}),E}};try{const T=v.read(S,k);if(n(v,p,T),r2(T)){(y=T.onCancel)==null||y.call(T,()=>w==null?void 0:w.abort());const R=()=>{if(p.m){const M=lc();c(M,v,p),Aa(M)}};T.then(R,R)}return p}catch(T){return delete p.v,p.e=T,++p.n,p}finally{b=!1}},i=_=>Rm(r(void 0,_,e(_))),s=(_,v,p)=>{var m,y;const b=new Map;for(const S of((m=p.m)==null?void 0:m.t)||[])b.set(S,e(S,p));for(const S of p.p)b.set(S,e(S,p));return(y=VJ(_,v))==null||y.forEach(S=>{b.set(S,e(S,p))}),b},a=(_,v,p)=>{const m=[],y=new Set,b=(E,k)=>{if(!y.has(E)){y.add(E);for(const[T,R]of s(_,E,k))E!==T&&b(T,R);m.push([E,k,k.n])}};b(v,p);const S=new Set([v]),w=E=>y.has(E);for(let E=m.length-1;E>=0;--E){const[k,T,R]=m[E];let M=!1;for(const L of T.d.keys())if(L!==k&&S.has(L)){M=!0;break}M&&(r(_,k,T,w),c(_,k,T),R!==T.n&&(mx(_,k,T),S.add(k))),y.delete(k)}},o=(_,v,p,...m)=>{const y=w=>Rm(r(_,w,e(w,p))),b=(w,...E)=>{const k=e(w,p);let T;if(W4(v,w)){if(!fx(w))throw new Error("atom not writable");const R="v"in k,M=k.v,L=E[0];n(w,k,L),c(_,w,k),(!R||!Object.is(M,k.v))&&(mx(_,w,k),a(_,w,k))}else T=o(_,w,k,...E);return Aa(_),T};return v.write(y,b,...m)},l=(_,...v)=>{const p=lc(),m=o(p,_,e(_),...v);return Aa(p),m},c=(_,v,p)=>{if(p.m&&!n2(p.v)){for(const m of p.d.keys())p.m.d.has(m)||(d(_,m,e(m,p)).t.add(v),p.m.d.add(m));for(const m of p.m.d||[])if(!p.d.has(m)){p.m.d.delete(m);const y=u(_,m,e(m,p));y==null||y.t.delete(v)}}},d=(_,v,p)=>{if(!p.m){r(_,v,p);for(const m of p.d.keys())d(_,m,e(m,p)).t.add(v);if(p.m={l:new Set,d:new Set(p.d.keys()),t:new Set},(ki?"production":void 0)!=="production"&&t.add(v),px(v)&&v.onMount){const m=p.m,{onMount:y}=v;Y4(_,()=>{const b=y((...S)=>o(_,v,p,...S));b&&(m.u=b)})}}return p.m},u=(_,v,p)=>{if(p.m&&!p.m.l.size&&!Array.from(p.m.t).some(m=>{var y;return(y=e(m,p).m)==null?void 0:y.d.has(v)})){const m=p.m.u;m&&Y4(_,m),delete p.m,(ki?"production":void 0)!=="production"&&t.delete(v);for(const y of p.d.keys()){const b=u(_,y,e(y,p));b==null||b.t.delete(v)}return}return p.m},x={get:i,set:l,sub:(_,v)=>{const p=lc(),m=e(_),y=d(p,_,m);Aa(p);const b=y.l;return b.add(v),()=>{b.delete(v);const S=lc();u(S,_,m),Aa(S)}},unstable_derive:_=>xP(..._(e))};return(ki?"production":void 0)!=="production"&&Object.assign(x,{dev4_get_internal_weak_map:()=>({get:v=>{const p=e(v);if(p.n!==0)return p}}),dev4_get_mounted_atoms:()=>t,dev4_restore_atoms:v=>{const p=lc();for(const[m,y]of v)if(fx(m)){const b=e(m),S="v"in b,w=b.v;n(m,b,y),c(p,m,b),(!S||!Object.is(w,b.v))&&(mx(p,m,b),a(p,m,b))}Aa(p)}}),x},qJ=()=>{const e=new WeakMap;return xP(n=>{let r=e.get(n);return r||(r={d:new Map,p:new Set,n:0},e.set(n,r)),r})};let rh;const YJ=()=>(rh||(rh=qJ(),(ki?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=rh),globalThis.__JOTAI_DEFAULT_STORE__!==rh&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),rh),bP={BASE_URL:"./",DEV:!1,MODE:"production",PROD:!0,SSR:!1},KJ=C.createContext(void 0),wP=e=>C.useContext(KJ)||YJ(),SP=e=>typeof(e==null?void 0:e.then)=="function",GJ=e=>{e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t})},XJ=rt.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(GJ(e),e)}),gx=new WeakMap,QJ=e=>{let t=gx.get(e);return t||(t=new Promise((n,r)=>{let i=e;const s=l=>c=>{i===l&&n(c)},a=l=>c=>{i===l&&r(c)},o=l=>{"onCancel"in l&&typeof l.onCancel=="function"&&l.onCancel(c=>{if((bP?"production":void 0)!=="production"&&c===l)throw new Error("[Bug] p is not updated even after cancelation");SP(c)?(gx.set(c,t),i=c,c.then(s(c),a(c)),o(c)):n(c)})};e.then(s(e),a(e)),o(e)}),gx.set(e,t)),t};function ut(e,t){const n=wP(),[[r,i,s],a]=C.useReducer(c=>{const d=n.get(e);return Object.is(c[0],d)&&c[1]===n&&c[2]===e?c:[d,n,e]},void 0,()=>[n.get(e),n,e]);let o=r;if((i!==n||s!==e)&&(a(),o=n.get(e)),C.useEffect(()=>{const c=n.sub(e,()=>{a()});return a(),c},[n,e,void 0]),C.useDebugValue(o),SP(o)){const c=QJ(o);return XJ(c)}return o}function it(e,t){const n=wP();return C.useCallback((...i)=>{if((bP?"production":void 0)!=="production"&&!("write"in e))throw new Error("not writable atom");return n.set(e,...i)},[n,e])}function wr(e,t){return[ut(e),it(e)]}function CP(e){const t=Je(()=>({mounted:!1,inProgress:0,promise:void 0,cleanup:void 0,fromCleanup:!1,recursing:!1,refresh:()=>{},refreshing:!1,get:()=>{},set:()=>{},pendingError:null})),n=Je(0),r=Je(null,(s,a)=>{const o=s(t);return o.mounted=!0,o.get=s,o.set=a,o.refresh=()=>{try{o.refreshing=!0,a(n,l=>l+1)}finally{o.refreshing=!1}},a(n,l=>l+1),()=>{o.mounted=!1,K4(o),o.cleanup==null||o.cleanup(),o.cleanup=void 0}});r.onMount=s=>s();const i=Je(s=>{s(n);const a=s(t);if(!a.mounted||a.recursing||a.inProgress&&!a.refreshing)return a.promise;K4(a);const o=new Map,l=u=>{const f=s(u);return o.set(u,f),f};l.peek=u=>a.get(u);const c=(...u)=>{try{return++a.inProgress,a.set(...u)}finally{Array.from(o.keys(),s),--a.inProgress}};c.recurse=(u,...f)=>{if(!a.fromCleanup)try{return a.recursing=!0,a.set(u,...f)}finally{a.recursing=!1,Array.from(o).some(([g,x])=>s(g)!==x)&&a.refresh()}},++a.inProgress;const d=()=>{try{if(a.refreshing=!1,!a.mounted)return;try{a.fromCleanup=!0,a.cleanup==null||a.cleanup()}finally{a.fromCleanup=!1}a.cleanup=e(l,c)}catch(u){a.pendingError=u,a.refresh()}finally{a.promise=void 0,--a.inProgress}};return a.refreshing?d():a.promise=Promise.resolve().then(d)});return Je(s=>{s(r),s(i)})}function K4(e){if(e.pendingError!==null){const t=e.pendingError;throw e.pendingError=null,t}}const p5={BASE_URL:"./",DEV:!1,MODE:"production",PROD:!0,SSR:!1},kP=Symbol((p5?"production":void 0)!=="production"?"RESET":"");function dd(e){const t=Je(e,(n,r,i)=>{const s=typeof i=="function"?i(n(t)):i;r(t,s===kP?e:s)});return t}const JJ=e=>typeof(e==null?void 0:e.then)=="function";function ZJ(e=()=>{try{return window.localStorage}catch(n){(p5?"production":void 0)!=="production"&&typeof window<"u"&&console.warn(n);return}},t){var n;let r,i;const s={getItem:(l,c)=>{var d,u;const f=x=>{if(x=x||"",r!==x){try{i=JSON.parse(x,t==null?void 0:t.reviver)}catch{return c}r=x}return i},g=(u=(d=e())==null?void 0:d.getItem(l))!=null?u:null;return JJ(g)?g.then(f):f(g)},setItem:(l,c)=>{var d;return(d=e())==null?void 0:d.setItem(l,JSON.stringify(c,void 0))},removeItem:l=>{var c;return(c=e())==null?void 0:c.removeItem(l)}},a=l=>(c,d,u)=>l(c,f=>{let g;try{g=JSON.parse(f||"")}catch{g=u}d(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,c)=>{if(!(e()instanceof window.Storage))return()=>{};const d=u=>{u.storageArea===e()&&u.key===l&&c(u.newValue)};return window.addEventListener("storage",d),()=>{window.removeEventListener("storage",d)}}),o&&(s.subscribe=a(o)),s}const eZ=ZJ();function EP(e,t,n=eZ,r){const i=Je(t);return(p5?"production":void 0)!=="production"&&(i.debugPrivate=!0),i.onMount=a=>{a(n.getItem(e,t));let o;return n.subscribe&&(o=n.subscribe(e,a,t)),o},Je(a=>a(i),(a,o,l)=>{const c=typeof l=="function"?l(a(i)):l;return c===kP?(o(i,t),n.removeItem(e)):c instanceof Promise?c.then(d=>(o(i,d),n.setItem(e,d))):(o(i,c),n.setItem(e,c))})}const d1=Je(!1),TP=Je(void 0),m5=()=>{const[e,t]=wr(d1),[n,r]=wr(TP);return{isAccountModalOpen:e,setAccountModalOpen:t,accountModalTab:n,setAccountModalTab:r}},tZ=()=>{const e=it(d1),t=it(TP);return n=>{e(!0),n&&t(n)}},MP=()=>{const e=it(d1);return()=>{e(!1)}},h1=Je(!1),RP=dd({title:"",onConfirm:()=>{}}),AP=()=>{const e=it(h1),t=it(RP);return n=>{t(n),e(!0)}},nZ=()=>{const e=it(h1);return()=>{e(!1)}},rZ=()=>{const e=ut(h1),t=ut(RP);return{isOpen:e,...t}},f1=Je(!1),DP=dd({title:"",onSubmit:()=>{}}),p1=()=>{const e=it(f1),t=it(DP);return n=>{t(n),e(!0)}},iZ=()=>{const e=it(f1);return()=>{e(!1)}},sZ=()=>{const e=ut(f1),t=ut(DP);return{isOpen:e,...t}},g5=Je(!1),v5=Je(!1),y5=Je(!1),LP=()=>{const[e,t]=wr(g5);return{isSheetOpen:e,setIsSheetOpen:t}},jP=()=>{const[e,t]=wr(v5);return{isSheetOpen:e,setIsSheetOpen:t}},PP=()=>{const[e,t]=wr(y5);return{isSheetOpen:e,setIsSheetOpen:t}},m1=()=>{const e=it(g5),t=it(v5),n=it(y5);return()=>{e(!1),t(!1),n(!1)}},g1=dd(!1),NP=dd(void 0),i2="playerModal",v1=e=>{$N(i2,e)},y1=()=>{const e=it(NP),t=it(g1);return n=>{const r="mutex"in n?`${n.mutex}#${n.netid}`:n.license;v1(r),e(n),t(!0)}},_5=()=>{const e=it(g1);return()=>{v1(void 0),e(!1)}},oZ=()=>{const e=ut(NP),[t,n]=wr(g1);return{isModalOpen:t,playerRef:e,closeModal:()=>{v1(void 0),n(!1)}}},Nl=Je(null),OP=Je(e=>{var t;return((t=e(Nl))==null?void 0:t.server.name)??"unconfigured"}),x5=Je(e=>{var t;return(t=e(Nl))==null?void 0:t.server.configPendingStep}),aZ=Je(e=>{var t;return((t=e(Nl))==null?void 0:t.server.instantiated)??!1}),lZ=()=>it(Nl),IP=()=>ut(Nl);function cZ(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const uZ=/[ \t\n\f\r]/g;function dZ(e){return typeof e=="object"?e.type==="text"?G4(e.value):!1:G4(e)}function G4(e){return e.replace(uZ,"")===""}class Rp{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}Rp.prototype.property={};Rp.prototype.normal={};Rp.prototype.space=null;function $P(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 Rp(n,r,t)}function s2(e){return e.toLowerCase()}class ui{constructor(t,n){this.property=t,this.attribute=n}}ui.prototype.space=null;ui.prototype.boolean=!1;ui.prototype.booleanish=!1;ui.prototype.overloadedBoolean=!1;ui.prototype.number=!1;ui.prototype.commaSeparated=!1;ui.prototype.spaceSeparated=!1;ui.prototype.commaOrSpaceSeparated=!1;ui.prototype.mustUseProperty=!1;ui.prototype.defined=!1;let hZ=0;const Ye=Ol(),hn=Ol(),FP=Ol(),pe=Ol(),jt=Ol(),Kc=Ol(),Rr=Ol();function Ol(){return 2**++hZ}const o2=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ye,booleanish:hn,commaOrSpaceSeparated:Rr,commaSeparated:Kc,number:pe,overloadedBoolean:FP,spaceSeparated:jt},Symbol.toStringTag,{value:"Module"})),vx=Object.keys(o2);class b5 extends ui{constructor(t,n,r,i){let s=-1;if(super(t,n),X4(this,"space",i),typeof r=="number")for(;++s<vx.length;){const a=vx[s];X4(this,vx[s],(r&o2[a])===o2[a])}}}b5.prototype.defined=!0;function X4(e,t,n){n&&(e[t]=n)}const fZ={}.hasOwnProperty;function hd(e){const t={},n={};let r;for(r in e.properties)if(fZ.call(e.properties,r)){const i=e.properties[r],s=new b5(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[s2(r)]=r,n[s2(s.attribute)]=r}return new Rp(t,n,e.space)}const BP=hd({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}}),zP=hd({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function UP(e,t){return t in e?e[t]:t}function HP(e,t){return UP(e,t.toLowerCase())}const WP=hd({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:HP,properties:{xmlns:null,xmlnsXLink:null}}),VP=hd({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:hn,ariaAutoComplete:null,ariaBusy:hn,ariaChecked:hn,ariaColCount:pe,ariaColIndex:pe,ariaColSpan:pe,ariaControls:jt,ariaCurrent:null,ariaDescribedBy:jt,ariaDetails:null,ariaDisabled:hn,ariaDropEffect:jt,ariaErrorMessage:null,ariaExpanded:hn,ariaFlowTo:jt,ariaGrabbed:hn,ariaHasPopup:null,ariaHidden:hn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:jt,ariaLevel:pe,ariaLive:null,ariaModal:hn,ariaMultiLine:hn,ariaMultiSelectable:hn,ariaOrientation:null,ariaOwns:jt,ariaPlaceholder:null,ariaPosInSet:pe,ariaPressed:hn,ariaReadOnly:hn,ariaRelevant:null,ariaRequired:hn,ariaRoleDescription:jt,ariaRowCount:pe,ariaRowIndex:pe,ariaRowSpan:pe,ariaSelected:hn,ariaSetSize:pe,ariaSort:null,ariaValueMax:pe,ariaValueMin:pe,ariaValueNow:pe,ariaValueText:null,role:null}}),pZ=hd({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:HP,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Kc,acceptCharset:jt,accessKey:jt,action:null,allow:null,allowFullScreen:Ye,allowPaymentRequest:Ye,allowUserMedia:Ye,alt:null,as:null,async:Ye,autoCapitalize:null,autoComplete:jt,autoFocus:Ye,autoPlay:Ye,blocking:jt,capture:Ye,charSet:null,checked:Ye,cite:null,className:jt,cols:pe,colSpan:null,content:null,contentEditable:hn,controls:Ye,controlsList:jt,coords:pe|Kc,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ye,defer:Ye,dir:null,dirName:null,disabled:Ye,download:FP,draggable:hn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ye,formTarget:null,headers:jt,height:pe,hidden:Ye,high:pe,href:null,hrefLang:null,htmlFor:jt,httpEquiv:jt,id:null,imageSizes:null,imageSrcSet:null,inert:Ye,inputMode:null,integrity:null,is:null,isMap:Ye,itemId:null,itemProp:jt,itemRef:jt,itemScope:Ye,itemType:jt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ye,low:pe,manifest:null,max:null,maxLength:pe,media:null,method:null,min:null,minLength:pe,multiple:Ye,muted:Ye,name:null,nonce:null,noModule:Ye,noValidate:Ye,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ye,optimum:pe,pattern:null,ping:jt,placeholder:null,playsInline:Ye,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ye,referrerPolicy:null,rel:jt,required:Ye,reversed:Ye,rows:pe,rowSpan:pe,sandbox:jt,scope:null,scoped:Ye,seamless:Ye,selected:Ye,shape:null,size:pe,sizes:null,slot:null,span:pe,spellCheck:hn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:pe,step:null,style:null,tabIndex:pe,target:null,title:null,translate:null,type:null,typeMustMatch:Ye,useMap:null,value:hn,width:pe,wrap:null,align:null,aLink:null,archive:jt,axis:null,background:null,bgColor:null,border:pe,borderColor:null,bottomMargin:pe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ye,declare:Ye,event:null,face:null,frame:null,frameBorder:null,hSpace:pe,leftMargin:pe,link:null,longDesc:null,lowSrc:null,marginHeight:pe,marginWidth:pe,noResize:Ye,noHref:Ye,noShade:Ye,noWrap:Ye,object:null,profile:null,prompt:null,rev:null,rightMargin:pe,rules:null,scheme:null,scrolling:hn,standby:null,summary:null,text:null,topMargin:pe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:pe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ye,disableRemotePlayback:Ye,prefix:null,property:null,results:pe,security:null,unselectable:null}}),mZ=hd({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:UP,properties:{about:Rr,accentHeight:pe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:pe,amplitude:pe,arabicForm:null,ascent:pe,attributeName:null,attributeType:null,azimuth:pe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:pe,by:null,calcMode:null,capHeight:pe,className:jt,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:pe,diffuseConstant:pe,direction:null,display:null,dur:null,divisor:pe,dominantBaseline:null,download:Ye,dx:null,dy:null,edgeMode:null,editable:null,elevation:pe,enableBackground:null,end:null,event:null,exponent:pe,externalResourcesRequired:null,fill:null,fillOpacity:pe,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:Kc,g2:Kc,glyphName:Kc,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:pe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:pe,horizOriginX:pe,horizOriginY:pe,id:null,ideographic:pe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:pe,k:pe,k1:pe,k2:pe,k3:pe,k4:pe,kernelMatrix:Rr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:pe,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:pe,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:pe,overlineThickness:pe,paintOrder:null,panose1:null,path:null,pathLength:pe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:jt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:pe,pointsAtY:pe,pointsAtZ:pe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Rr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Rr,rev:Rr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Rr,requiredFeatures:Rr,requiredFonts:Rr,requiredFormats:Rr,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:pe,specularExponent:pe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:pe,strikethroughThickness:pe,string:null,stroke:null,strokeDashArray:Rr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:pe,strokeOpacity:pe,strokeWidth:null,style:null,surfaceScale:pe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Rr,tabIndex:pe,tableValues:null,target:null,targetX:pe,targetY:pe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Rr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:pe,underlineThickness:pe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:pe,values:null,vAlphabetic:pe,vMathematical:pe,vectorEffect:null,vHanging:pe,vIdeographic:pe,version:null,vertAdvY:pe,vertOriginX:pe,vertOriginY:pe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:pe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),gZ=/^data[-\w.:]+$/i,Q4=/-[a-z]/g,vZ=/[A-Z]/g;function yZ(e,t){const n=s2(t);let r=t,i=ui;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&gZ.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(Q4,xZ);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!Q4.test(s)){let a=s.replace(vZ,_Z);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=b5}return new i(r,t)}function _Z(e){return"-"+e.toLowerCase()}function xZ(e){return e.charAt(1).toUpperCase()}const bZ={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},wZ=$P([zP,BP,WP,VP,pZ],"html"),qP=$P([zP,BP,WP,VP,mZ],"svg");function SZ(e){return e.join(" ").trim()}var w5={exports:{}},J4=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,CZ=/\n/g,kZ=/^\s*/,EZ=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,TZ=/^:\s*/,MZ=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,RZ=/^[;\s]*/,AZ=/^\s+|\s+$/g,DZ=`
`,Z4="/",eM="*",Fa="",LZ="comment",jZ="declaration",PZ=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(x){var _=x.match(CZ);_&&(n+=_.length);var v=x.lastIndexOf(DZ);r=~v?x.length-v:r+x.length}function s(){var x={line:n,column:r};return function(_){return _.position=new a(x),c(),_}}function a(x){this.start=x,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function o(x){var _=new Error(t.source+":"+n+":"+r+": "+x);if(_.reason=x,_.filename=t.source,_.line=n,_.column=r,_.source=e,!t.silent)throw _}function l(x){var _=x.exec(e);if(_){var v=_[0];return i(v),e=e.slice(v.length),_}}function c(){l(kZ)}function d(x){var _;for(x=x||[];_=u();)_!==!1&&x.push(_);return x}function u(){var x=s();if(!(Z4!=e.charAt(0)||eM!=e.charAt(1))){for(var _=2;Fa!=e.charAt(_)&&(eM!=e.charAt(_)||Z4!=e.charAt(_+1));)++_;if(_+=2,Fa===e.charAt(_-1))return o("End of comment missing");var v=e.slice(2,_-2);return r+=2,i(v),e=e.slice(_),r+=2,x({type:LZ,comment:v})}}function f(){var x=s(),_=l(EZ);if(_){if(u(),!l(TZ))return o("property missing ':'");var v=l(MZ),p=x({type:jZ,property:tM(_[0].replace(J4,Fa)),value:v?tM(v[0].replace(J4,Fa)):Fa});return l(RZ),p}}function g(){var x=[];d(x);for(var _;_=f();)_!==!1&&(x.push(_),d(x));return x}return c(),g()};function tM(e){return e?e.replace(AZ,Fa):Fa}var NZ=PZ;function YP(e,t){var n=null;if(!e||typeof e!="string")return n;for(var r,i=NZ(e),s=typeof t=="function",a,o,l=0,c=i.length;l<c;l++)r=i[l],a=r.property,o=r.value,s?t(a,o,r):o&&(n||(n={}),n[a]=o);return n}w5.exports=YP;w5.exports.default=YP;var OZ=w5.exports;const IZ=bn(OZ),KP=GP("end"),S5=GP("start");function GP(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 $Z(e){const t=S5(e),n=KP(e);if(t&&n)return{start:t,end:n}}function lf(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?nM(e.position):"start"in e||"end"in e?nM(e):"line"in e||"column"in e?a2(e):""}function a2(e){return rM(e&&e.line)+":"+rM(e&&e.column)}function nM(e){return a2(e&&e.start)+"-"+a2(e&&e.end)}function rM(e){return e&&typeof e=="number"?e:1}class lr 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=lf(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}}lr.prototype.file="";lr.prototype.name="";lr.prototype.reason="";lr.prototype.message="";lr.prototype.stack="";lr.prototype.column=void 0;lr.prototype.line=void 0;lr.prototype.ancestors=void 0;lr.prototype.cause=void 0;lr.prototype.fatal=void 0;lr.prototype.place=void 0;lr.prototype.ruleId=void 0;lr.prototype.source=void 0;const C5={}.hasOwnProperty,FZ=new Map,BZ=/[A-Z]/g,zZ=/-([a-z])/g,UZ=new Set(["table","tbody","thead","tfoot","tr"]),HZ=new Set(["td","th"]);function WZ(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=qZ(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=VZ(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?qP:wZ,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=XP(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function XP(e,t,n){if(t.type==="element"||t.type==="root"){const r=e.schema;let i=r;t.type==="element"&&t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=qP,e.schema=i),e.ancestors.push(t);let s=YZ(e,t);const a=KZ(e,e.ancestors);let o=e.Fragment;if(e.ancestors.pop(),t.type==="element")if(s&&UZ.has(t.tagName)&&(s=s.filter(function(l){return typeof l=="string"?!dZ(l):!0})),C5.call(e.components,t.tagName)){const l=t.tagName;o=e.components[l],typeof o!="string"&&o!==e.Fragment&&e.passNode&&(a.node=t)}else o=t.tagName;if(s.length>0){const l=s.length>1?s:s[0];l&&(a.children=l)}return e.schema=r,e.create(t,o,a,n)}if(t.type==="text")return t.value}function VZ(e,t,n){return r;function r(i,s,a,o){const c=Array.isArray(a.children)?n:t;return o?c(s,a,o):c(s,a)}}function qZ(e,t){return n;function n(r,i,s,a){const o=Array.isArray(s.children),l=S5(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 YZ(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:FZ;for(;++r<t.children.length;){const s=t.children[r];let a;if(e.passKeys&&s.type==="element"){const l=i.get(s.tagName)||0;a=s.tagName+"-"+l,i.set(s.tagName,l+1)}const o=XP(e,s,a);o!==void 0&&n.push(o)}return n}function KZ(e,t){const n=t[t.length-1],r={};let i;if("properties"in n&&n.properties){let s;for(i in n.properties)if(i!=="children"&&C5.call(n.properties,i)){const a=GZ(e,t,i,n.properties[i]);if(a){const[o,l]=a;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&HZ.has(n.tagName)?s=l:r[o]=l}}if(s){const a=r.style||(r.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}}return r}function GZ(e,t,n,r){const i=yZ(e.schema,n);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=i.commaSeparated?cZ(r):SZ(r)),i.property==="style"){let s=typeof r=="object"?r:XZ(e,t,String(r));return e.stylePropertyNameCase==="css"&&(s=QZ(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&i.space?bZ[i.property]||i.property:i.attribute,r]}}function XZ(e,t,n){const r={};try{IZ(n,i)}catch(s){if(!e.ignoreInvalidStyle){const a=s,o=new lr("Cannot parse `style` attribute",{ancestors:t,cause:a,source:"hast-util-to-jsx-runtime",ruleId:"style"});throw o.file=e.filePath||void 0,o.url="https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-parse-style-attribute",o}}return r;function i(s,a){let o=s;o.slice(0,2)!=="--"&&(o.slice(0,4)==="-ms-"&&(o="ms-"+o.slice(4)),o=o.replace(zZ,ZZ)),r[o]=a}}function QZ(e){const t={};let n;for(n in e)C5.call(e,n)&&(t[JZ(n)]=e[n]);return t}function JZ(e){let t=e.replace(BZ,eee);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function ZZ(e,t){return t.toUpperCase()}function eee(e){return"-"+e.toLowerCase()}const yx={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"]},tee={};function nee(e,t){const n=tee,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return QP(e,r,i)}function QP(e,t,n){if(ree(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 iM(e.children,t,n)}return Array.isArray(e)?iM(e,t,n):""}function iM(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=QP(e[i],t,n);return r.join("")}function ree(e){return!!(e&&typeof e=="object")}const sM=document.createElement("i");function k5(e){const t="&"+e+";";sM.innerHTML=t;const n=sM.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ms(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 Gr(e,t){return e.length>0?(ms(e,e.length,0,t),e):t}const oM={}.hasOwnProperty;function iee(e){const t={};let n=-1;for(;++n<e.length;)see(t,e[n]);return t}function see(e,t){let n;for(n in t){const i=(oM.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let a;if(s)for(a in s){oM.call(i,a)||(i[a]=[]);const o=s[a];oee(i[a],Array.isArray(o)?o:o?[o]:[])}}}function oee(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ms(e,0,0,r)}function JP(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 Gc(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const aee=Ca(new RegExp("\\p{P}","u")),is=Ca(/[A-Za-z]/),Pr=Ca(/[\dA-Za-z]/),lee=Ca(/[#-'*+\--9=?A-Z^-~]/);function l2(e){return e!==null&&(e<32||e===127)}const c2=Ca(/\d/),cee=Ca(/[\dA-Fa-f]/),ZP=Ca(/[!-/:-@[-`{-~]/);function $e(e){return e!==null&&e<-2}function Sr(e){return e!==null&&(e<0||e===32)}function bt(e){return e===-2||e===-1||e===32}function uee(e){return ZP(e)||aee(e)}const dee=Ca(/\s/);function Ca(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function fd(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let a="";if(s===37&&Pr(e.charCodeAt(n+1))&&Pr(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 Ot(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(l){return bt(l)?(e.enter(n),o(l)):t(l)}function o(l){return bt(l)&&s++<i?(e.consume(l),o):(e.exit(n),t(l))}}const hee={tokenize:fee};function fee(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"),Ot(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 $e(o)?(e.consume(o),e.exit("chunkText"),s):(e.consume(o),a)}}const pee={tokenize:mee},aM={tokenize:gee};function mee(e){const t=this,n=[];let r=0,i,s,a;return o;function o(y){if(r<n.length){const b=n[r];return t.containerState=b[1],e.attempt(b[0].continuation,l,c)(y)}return c(y)}function l(y){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&m();const b=t.events.length;let S=b,w;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){w=t.events[S][1].end;break}p(r);let E=b;for(;E<t.events.length;)t.events[E][1].end=Object.assign({},w),E++;return ms(t.events,S+1,0,t.events.slice(b)),t.events.length=E,c(y)}return o(y)}function c(y){if(r===n.length){if(!i)return f(y);if(i.currentConstruct&&i.currentConstruct.concrete)return x(y);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(aM,d,u)(y)}function d(y){return i&&m(),p(r),f(y)}function u(y){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,x(y)}function f(y){return t.containerState={},e.attempt(aM,g,x)(y)}function g(y){return r++,n.push([t.currentConstruct,t.containerState]),f(y)}function x(y){if(y===null){i&&m(),p(0),e.consume(y);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:s,_tokenizer:i}),_(y)}function _(y){if(y===null){v(e.exit("chunkFlow"),!0),p(0),e.consume(y);return}return $e(y)?(e.consume(y),v(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(y),_)}function v(y,b){const S=t.sliceStream(y);if(b&&S.push(null),y.previous=s,s&&(s.next=y),s=y,i.defineSkip(y.start),i.write(S),t.parser.lazy[y.start.line]){let w=i.events.length;for(;w--;)if(i.events[w][1].start.offset<a&&(!i.events[w][1].end||i.events[w][1].end.offset>a))return;const E=t.events.length;let k=E,T,R;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){if(T){R=t.events[k][1].end;break}T=!0}for(p(r),w=E;w<t.events.length;)t.events[w][1].end=Object.assign({},R),w++;ms(t.events,k+1,0,t.events.slice(E)),t.events.length=w}}function p(y){let b=n.length;for(;b-- >y;){const S=n[b];t.containerState=S[1],S[0].exit.call(t,e)}n.length=y}function m(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function gee(e,t,n){return Ot(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function lM(e){if(e===null||Sr(e)||dee(e))return 1;if(uee(e))return 2}function E5(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 u2={name:"attention",tokenize:yee,resolveAll:vee};function vee(e,t){let n=-1,r,i,s,a,o,l,c,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const u=Object.assign({},e[r][1].end),f=Object.assign({},e[n][1].start);cM(u,-l),cM(f,l),a={type:l>1?"strongSequence":"emphasisSequence",start:u,end:Object.assign({},e[r][1].end)},o={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:f},s={type:l>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},i={type:l>1?"strong":"emphasis",start:Object.assign({},a.start),end:Object.assign({},o.end)},e[r][1].end=Object.assign({},a.start),e[n][1].start=Object.assign({},o.end),c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Gr(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Gr(c,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",s,t]]),c=Gr(c,E5(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Gr(c,[["exit",s,t],["enter",o,t],["exit",o,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,c=Gr(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,ms(e,r-1,n-r+3,c),n=r+c.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function yee(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=lM(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 c=e.exit("attentionSequence"),d=lM(l),u=!d||d===2&&i||n.includes(l),f=!i||i===2&&d||n.includes(r);return c._open=!!(s===42?u:u&&(i||!f)),c._close=!!(s===42?f:f&&(d||!u)),t(l)}}function cM(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const _ee={name:"autolink",tokenize:xee};function xee(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 is(g)?(e.consume(g),a):c(g)}function a(g){return g===43||g===45||g===46||Pr(g)?(r=1,o(g)):c(g)}function o(g){return g===58?(e.consume(g),r=0,l):(g===43||g===45||g===46||Pr(g))&&r++<32?(e.consume(g),o):(r=0,c(g))}function l(g){return g===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):g===null||g===32||g===60||l2(g)?n(g):(e.consume(g),l)}function c(g){return g===64?(e.consume(g),d):lee(g)?(e.consume(g),c):n(g)}function d(g){return Pr(g)?u(g):n(g)}function u(g){return g===46?(e.consume(g),r=0,d):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||Pr(g))&&r++<63){const x=g===45?f:u;return e.consume(g),x}return n(g)}}const _1={tokenize:bee,partial:!0};function bee(e,t,n){return r;function r(s){return bt(s)?Ot(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||$e(s)?t(s):n(s)}}const eN={name:"blockQuote",tokenize:wee,continuation:{tokenize:See},exit:Cee};function wee(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 bt(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function See(e,t,n){const r=this;return i;function i(a){return bt(a)?Ot(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):s(a)}function s(a){return e.attempt(eN,t,n)(a)}}function Cee(e){e.exit("blockQuote")}const tN={name:"characterEscape",tokenize:kee};function kee(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 ZP(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const nN={name:"characterReference",tokenize:Eee};function Eee(e,t,n){const r=this;let i=0,s,a;return o;function o(u){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(u),e.exit("characterReferenceMarker"),l}function l(u){return u===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(u),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),s=31,a=Pr,d(u))}function c(u){return u===88||u===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(u),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,a=cee,d):(e.enter("characterReferenceValue"),s=7,a=c2,d(u))}function d(u){if(u===59&&i){const f=e.exit("characterReferenceValue");return a===Pr&&!k5(r.sliceSerialize(f))?n(u):(e.enter("characterReferenceMarker"),e.consume(u),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(u)&&i++<s?(e.consume(u),d):n(u)}}const uM={tokenize:Mee,partial:!0},dM={name:"codeFenced",tokenize:Tee,concrete:!0};function Tee(e,t,n){const r=this,i={tokenize:S,partial:!0};let s=0,a=0,o;return l;function l(w){return c(w)}function c(w){const E=r.events[r.events.length-1];return s=E&&E[1].type==="linePrefix"?E[2].sliceSerialize(E[1],!0).length:0,o=w,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(w)}function d(w){return w===o?(a++,e.consume(w),d):a<3?n(w):(e.exit("codeFencedFenceSequence"),bt(w)?Ot(e,u,"whitespace")(w):u(w))}function u(w){return w===null||$e(w)?(e.exit("codeFencedFence"),r.interrupt?t(w):e.check(uM,_,b)(w)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(w))}function f(w){return w===null||$e(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),u(w)):bt(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ot(e,g,"whitespace")(w)):w===96&&w===o?n(w):(e.consume(w),f)}function g(w){return w===null||$e(w)?u(w):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(w))}function x(w){return w===null||$e(w)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),u(w)):w===96&&w===o?n(w):(e.consume(w),x)}function _(w){return e.attempt(i,b,v)(w)}function v(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),p}function p(w){return s>0&&bt(w)?Ot(e,m,"linePrefix",s+1)(w):m(w)}function m(w){return w===null||$e(w)?e.check(uM,_,b)(w):(e.enter("codeFlowValue"),y(w))}function y(w){return w===null||$e(w)?(e.exit("codeFlowValue"),m(w)):(e.consume(w),y)}function b(w){return e.exit("codeFenced"),t(w)}function S(w,E,k){let T=0;return R;function R($){return w.enter("lineEnding"),w.consume($),w.exit("lineEnding"),M}function M($){return w.enter("codeFencedFence"),bt($)?Ot(w,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):L($)}function L($){return $===o?(w.enter("codeFencedFenceSequence"),j($)):k($)}function j($){return $===o?(T++,w.consume($),j):T>=a?(w.exit("codeFencedFenceSequence"),bt($)?Ot(w,P,"whitespace")($):P($)):k($)}function P($){return $===null||$e($)?(w.exit("codeFencedFence"),E($)):k($)}}}function Mee(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:Aee},Ree={tokenize:Dee,partial:!0};function Aee(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),Ot(e,s,"linePrefix",5)(c)}function s(c){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?a(c):n(c)}function a(c){return c===null?l(c):$e(c)?e.attempt(Ree,a,l)(c):(e.enter("codeFlowValue"),o(c))}function o(c){return c===null||$e(c)?(e.exit("codeFlowValue"),a(c)):(e.consume(c),o)}function l(c){return e.exit("codeIndented"),t(c)}}function Dee(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):$e(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):Ot(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):$e(a)?i(a):n(a)}}const Lee={name:"codeText",tokenize:Nee,resolve:jee,previous:Pee};function jee(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 Pee(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Nee(e,t,n){let r=0,i,s;return a;function a(u){return e.enter("codeText"),e.enter("codeTextSequence"),o(u)}function o(u){return u===96?(e.consume(u),r++,o):(e.exit("codeTextSequence"),l(u))}function l(u){return u===null?n(u):u===32?(e.enter("space"),e.consume(u),e.exit("space"),l):u===96?(s=e.enter("codeTextSequence"),i=0,d(u)):$e(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(u))}function c(u){return u===null||u===32||u===96||$e(u)?(e.exit("codeTextData"),l(u)):(e.consume(u),c)}function d(u){return u===96?(e.consume(u),i++,d):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(u)):(s.type="codeTextData",c(u))}}function rN(e){const t={};let n=-1,r,i,s,a,o,l,c;for(;++n<e.length;){for(;n in t;)n=t[n];if(r=e[n],n&&r[1].type==="chunkFlow"&&e[n-1][1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,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,Oee(e,n)),n=t[n],c=!0);else if(r[1]._container){for(s=n,i=void 0;s--&&(a=e[s],a[1].type==="lineEnding"||a[1].type==="lineEndingBlank");)a[0]==="enter"&&(i&&(e[i][1].type="lineEndingBlank"),a[1].type="lineEnding",i=s);i&&(r[1].end=Object.assign({},e[i][1].start),o=e.slice(i,n),o.unshift(r),ms(e,i,n-i+1,o))}}return!c}function Oee(e,t){const n=e[t][1],r=e[t][2];let i=t-1;const s=[],a=n._tokenizer||r.parser[n.contentType](n.start),o=a.events,l=[],c={};let d,u,f=-1,g=n,x=0,_=0;const v=[_];for(;g;){for(;e[++i][1]!==g;);s.push(i),g._tokenizer||(d=r.sliceStream(g),g.next||d.push(null),u&&a.defineSkip(g.start),g._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(d),g._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),u=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&&(_=f+1,v.push(_),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 p=o.slice(v[f],v[f+1]),m=s.pop();l.unshift([m,m+p.length-1]),ms(e,m,2,p)}for(f=-1;++f<l.length;)c[x+l[f][0]]=x+l[f][1],x+=l[f][1]-l[f][0]-1;return c}const Iee={tokenize:Bee,resolve:Fee},$ee={tokenize:zee,partial:!0};function Fee(e){return rN(e),e}function Bee(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):$e(o)?e.check($ee,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 zee(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Ot(e,s,"linePrefix")}function s(a){if(a===null||$e(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 iN(e,t,n,r,i,s,a,o,l){const c=l||Number.POSITIVE_INFINITY;let d=0;return u;function u(p){return p===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(p),e.exit(s),f):p===null||p===32||p===41||l2(p)?n(p):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),_(p))}function f(p){return p===62?(e.enter(s),e.consume(p),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),g(p))}function g(p){return p===62?(e.exit("chunkString"),e.exit(o),f(p)):p===null||p===60||$e(p)?n(p):(e.consume(p),p===92?x:g)}function x(p){return p===60||p===62||p===92?(e.consume(p),g):g(p)}function _(p){return!d&&(p===null||p===41||Sr(p))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),t(p)):d<c&&p===40?(e.consume(p),d++,_):p===41?(e.consume(p),d--,_):p===null||p===32||p===40||l2(p)?n(p):(e.consume(p),p===92?v:_)}function v(p){return p===40||p===41||p===92?(e.consume(p),_):_(p)}}function sN(e,t,n,r,i,s){const a=this;let o=0,l;return c;function c(g){return e.enter(r),e.enter(i),e.consume(g),e.exit(i),e.enter(s),d}function d(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):$e(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),u(g))}function u(g){return g===null||g===91||g===93||$e(g)||o++>999?(e.exit("chunkString"),d(g)):(e.consume(g),l||(l=!bt(g)),g===92?f:u)}function f(g){return g===91||g===92||g===93?(e.consume(g),o++,u):u(g)}}function oN(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),c(f))}function c(f){return f===a?(e.exit(s),l(a)):f===null?n(f):$e(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Ot(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===a||f===null||$e(f)?(e.exit("chunkString"),c(f)):(e.consume(f),f===92?u:d)}function u(f){return f===a||f===92?(e.consume(f),d):d(f)}}function cf(e,t){let n;return r;function r(i){return $e(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):bt(i)?Ot(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Uee={name:"definition",tokenize:Wee},Hee={tokenize:Vee,partial:!0};function Wee(e,t,n){const r=this;let i;return s;function s(g){return e.enter("definition"),a(g)}function a(g){return sN.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function o(g){return i=Gc(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 Sr(g)?cf(e,c)(g):c(g)}function c(g){return iN(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function d(g){return e.attempt(Hee,u,u)(g)}function u(g){return bt(g)?Ot(e,f,"whitespace")(g):f(g)}function f(g){return g===null||$e(g)?(e.exit("definition"),r.parser.defined.push(i),t(g)):n(g)}}function Vee(e,t,n){return r;function r(o){return Sr(o)?cf(e,i)(o):n(o)}function i(o){return oN(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function s(o){return bt(o)?Ot(e,a,"whitespace")(o):a(o)}function a(o){return o===null||$e(o)?t(o):n(o)}}const qee={name:"hardBreakEscape",tokenize:Yee};function Yee(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return $e(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const Kee={name:"headingAtx",tokenize:Xee,resolve:Gee};function Gee(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"},ms(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function Xee(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),s(d)}function s(d){return e.enter("atxHeadingSequence"),a(d)}function a(d){return d===35&&r++<6?(e.consume(d),a):d===null||Sr(d)?(e.exit("atxHeadingSequence"),o(d)):n(d)}function o(d){return d===35?(e.enter("atxHeadingSequence"),l(d)):d===null||$e(d)?(e.exit("atxHeading"),t(d)):bt(d)?Ot(e,o,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function l(d){return d===35?(e.consume(d),l):(e.exit("atxHeadingSequence"),o(d))}function c(d){return d===null||d===35||Sr(d)?(e.exit("atxHeadingText"),o(d)):(e.consume(d),c)}}const Qee=["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"],hM=["pre","script","style","textarea"],Jee={name:"htmlFlow",tokenize:nte,resolveTo:tte,concrete:!0},Zee={tokenize:ite,partial:!0},ete={tokenize:rte,partial:!0};function tte(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 nte(e,t,n){const r=this;let i,s,a,o,l;return c;function c(U){return d(U)}function d(U){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(U),u}function u(U){return U===33?(e.consume(U),f):U===47?(e.consume(U),s=!0,_):U===63?(e.consume(U),i=3,r.interrupt?t:D):is(U)?(e.consume(U),a=String.fromCharCode(U),v):n(U)}function f(U){return U===45?(e.consume(U),i=2,g):U===91?(e.consume(U),i=5,o=0,x):is(U)?(e.consume(U),i=4,r.interrupt?t:D):n(U)}function g(U){return U===45?(e.consume(U),r.interrupt?t:D):n(U)}function x(U){const G="CDATA[";return U===G.charCodeAt(o++)?(e.consume(U),o===G.length?r.interrupt?t:L:x):n(U)}function _(U){return is(U)?(e.consume(U),a=String.fromCharCode(U),v):n(U)}function v(U){if(U===null||U===47||U===62||Sr(U)){const G=U===47,ee=a.toLowerCase();return!G&&!s&&hM.includes(ee)?(i=1,r.interrupt?t(U):L(U)):Qee.includes(a.toLowerCase())?(i=6,G?(e.consume(U),p):r.interrupt?t(U):L(U)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(U):s?m(U):y(U))}return U===45||Pr(U)?(e.consume(U),a+=String.fromCharCode(U),v):n(U)}function p(U){return U===62?(e.consume(U),r.interrupt?t:L):n(U)}function m(U){return bt(U)?(e.consume(U),m):R(U)}function y(U){return U===47?(e.consume(U),R):U===58||U===95||is(U)?(e.consume(U),b):bt(U)?(e.consume(U),y):R(U)}function b(U){return U===45||U===46||U===58||U===95||Pr(U)?(e.consume(U),b):S(U)}function S(U){return U===61?(e.consume(U),w):bt(U)?(e.consume(U),S):y(U)}function w(U){return U===null||U===60||U===61||U===62||U===96?n(U):U===34||U===39?(e.consume(U),l=U,E):bt(U)?(e.consume(U),w):k(U)}function E(U){return U===l?(e.consume(U),l=null,T):U===null||$e(U)?n(U):(e.consume(U),E)}function k(U){return U===null||U===34||U===39||U===47||U===60||U===61||U===62||U===96||Sr(U)?S(U):(e.consume(U),k)}function T(U){return U===47||U===62||bt(U)?y(U):n(U)}function R(U){return U===62?(e.consume(U),M):n(U)}function M(U){return U===null||$e(U)?L(U):bt(U)?(e.consume(U),M):n(U)}function L(U){return U===45&&i===2?(e.consume(U),F):U===60&&i===1?(e.consume(U),W):U===62&&i===4?(e.consume(U),H):U===63&&i===3?(e.consume(U),D):U===93&&i===5?(e.consume(U),A):$e(U)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Zee,V,j)(U)):U===null||$e(U)?(e.exit("htmlFlowData"),j(U)):(e.consume(U),L)}function j(U){return e.check(ete,P,V)(U)}function P(U){return e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),$}function $(U){return U===null||$e(U)?j(U):(e.enter("htmlFlowData"),L(U))}function F(U){return U===45?(e.consume(U),D):L(U)}function W(U){return U===47?(e.consume(U),a="",I):L(U)}function I(U){if(U===62){const G=a.toLowerCase();return hM.includes(G)?(e.consume(U),H):L(U)}return is(U)&&a.length<8?(e.consume(U),a+=String.fromCharCode(U),I):L(U)}function A(U){return U===93?(e.consume(U),D):L(U)}function D(U){return U===62?(e.consume(U),H):U===45&&i===2?(e.consume(U),D):L(U)}function H(U){return U===null||$e(U)?(e.exit("htmlFlowData"),V(U)):(e.consume(U),H)}function V(U){return e.exit("htmlFlow"),t(U)}}function rte(e,t,n){const r=this;return i;function i(a){return $e(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 ite(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(_1,t,n)}}const ste={name:"htmlText",tokenize:ote};function ote(e,t,n){const r=this;let i,s,a;return o;function o(D){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(D),l}function l(D){return D===33?(e.consume(D),c):D===47?(e.consume(D),S):D===63?(e.consume(D),y):is(D)?(e.consume(D),k):n(D)}function c(D){return D===45?(e.consume(D),d):D===91?(e.consume(D),s=0,x):is(D)?(e.consume(D),m):n(D)}function d(D){return D===45?(e.consume(D),g):n(D)}function u(D){return D===null?n(D):D===45?(e.consume(D),f):$e(D)?(a=u,W(D)):(e.consume(D),u)}function f(D){return D===45?(e.consume(D),g):u(D)}function g(D){return D===62?F(D):D===45?f(D):u(D)}function x(D){const H="CDATA[";return D===H.charCodeAt(s++)?(e.consume(D),s===H.length?_:x):n(D)}function _(D){return D===null?n(D):D===93?(e.consume(D),v):$e(D)?(a=_,W(D)):(e.consume(D),_)}function v(D){return D===93?(e.consume(D),p):_(D)}function p(D){return D===62?F(D):D===93?(e.consume(D),p):_(D)}function m(D){return D===null||D===62?F(D):$e(D)?(a=m,W(D)):(e.consume(D),m)}function y(D){return D===null?n(D):D===63?(e.consume(D),b):$e(D)?(a=y,W(D)):(e.consume(D),y)}function b(D){return D===62?F(D):y(D)}function S(D){return is(D)?(e.consume(D),w):n(D)}function w(D){return D===45||Pr(D)?(e.consume(D),w):E(D)}function E(D){return $e(D)?(a=E,W(D)):bt(D)?(e.consume(D),E):F(D)}function k(D){return D===45||Pr(D)?(e.consume(D),k):D===47||D===62||Sr(D)?T(D):n(D)}function T(D){return D===47?(e.consume(D),F):D===58||D===95||is(D)?(e.consume(D),R):$e(D)?(a=T,W(D)):bt(D)?(e.consume(D),T):F(D)}function R(D){return D===45||D===46||D===58||D===95||Pr(D)?(e.consume(D),R):M(D)}function M(D){return D===61?(e.consume(D),L):$e(D)?(a=M,W(D)):bt(D)?(e.consume(D),M):T(D)}function L(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),i=D,j):$e(D)?(a=L,W(D)):bt(D)?(e.consume(D),L):(e.consume(D),P)}function j(D){return D===i?(e.consume(D),i=void 0,$):D===null?n(D):$e(D)?(a=j,W(D)):(e.consume(D),j)}function P(D){return D===null||D===34||D===39||D===60||D===61||D===96?n(D):D===47||D===62||Sr(D)?T(D):(e.consume(D),P)}function $(D){return D===47||D===62||Sr(D)?T(D):n(D)}function F(D){return D===62?(e.consume(D),e.exit("htmlTextData"),e.exit("htmlText"),t):n(D)}function W(D){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),I}function I(D){return bt(D)?Ot(e,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):A(D)}function A(D){return e.enter("htmlTextData"),a(D)}}const T5={name:"labelEnd",tokenize:hte,resolveTo:dte,resolveAll:ute},ate={tokenize:fte},lte={tokenize:pte},cte={tokenize:mte};function ute(e){let t=-1;for(;++t<e.length;){const n=e[t][1];(n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd")&&(e.splice(t+1,n.type==="labelImage"?4:2),n.type="data",t++)}return e}function dte(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:Object.assign({},e[s][1].start),end:Object.assign({},e[e.length-1][1].end)},c={type:"label",start:Object.assign({},e[s][1].start),end:Object.assign({},e[a][1].end)},d={type:"labelText",start:Object.assign({},e[s+r+2][1].end),end:Object.assign({},e[a-2][1].start)};return o=[["enter",l,t],["enter",c,t]],o=Gr(o,e.slice(s+1,s+r+3)),o=Gr(o,[["enter",d,t]]),o=Gr(o,E5(t.parser.constructs.insideSpan.null,e.slice(s+r+4,a-3),t)),o=Gr(o,[["exit",d,t],e[a-2],e[a-1],["exit",c,t]]),o=Gr(o,e.slice(a+1)),o=Gr(o,[["exit",l,t]]),ms(e,s,e.length,o),e}function hte(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?u(f):(a=r.parser.defined.includes(Gc(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(ate,d,a?d:u)(f):f===91?e.attempt(lte,d,a?c:u)(f):a?d(f):u(f)}function c(f){return e.attempt(cte,d,u)(f)}function d(f){return t(f)}function u(f){return s._balanced=!0,n(f)}}function fte(e,t,n){return r;function r(u){return e.enter("resource"),e.enter("resourceMarker"),e.consume(u),e.exit("resourceMarker"),i}function i(u){return Sr(u)?cf(e,s)(u):s(u)}function s(u){return u===41?d(u):iN(e,a,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(u)}function a(u){return Sr(u)?cf(e,l)(u):d(u)}function o(u){return n(u)}function l(u){return u===34||u===39||u===40?oN(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(u):d(u)}function c(u){return Sr(u)?cf(e,d)(u):d(u)}function d(u){return u===41?(e.enter("resourceMarker"),e.consume(u),e.exit("resourceMarker"),e.exit("resource"),t):n(u)}}function pte(e,t,n){const r=this;return i;function i(o){return sN.call(r,e,s,a,"reference","referenceMarker","referenceString")(o)}function s(o){return r.parser.defined.includes(Gc(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function a(o){return n(o)}}function mte(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 gte={name:"labelStartImage",tokenize:vte,resolveAll:T5.resolveAll};function vte(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 yte={name:"labelStartLink",tokenize:_te,resolveAll:T5.resolveAll};function _te(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 xx={name:"lineEnding",tokenize:xte};function xte(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ot(e,t,"linePrefix")}}const Ag={name:"thematicBreak",tokenize:bte};function bte(e,t,n){let r=0,i;return s;function s(c){return e.enter("thematicBreak"),a(c)}function a(c){return i=c,o(c)}function o(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||$e(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),bt(c)?Ot(e,o,"whitespace")(c):o(c))}}const ur={name:"list",tokenize:Cte,continuation:{tokenize:kte},exit:Tte},wte={tokenize:Mte,partial:!0},Ste={tokenize:Ete,partial:!0};function Cte(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 x=r.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||g===r.containerState.marker:c2(g)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(Ag,n,c)(g):c(g);if(!r.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(g)}return n(g)}function l(g){return c2(g)&&++a<10?(e.consume(g),l):(!r.interrupt||a<2)&&(r.containerState.marker?g===r.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),c(g)):n(g)}function c(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||g,e.check(_1,r.interrupt?n:d,e.attempt(wte,f,u))}function d(g){return r.containerState.initialBlankLine=!0,s++,f(g)}function u(g){return bt(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 kte(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(_1,i,s);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ot(e,t,"listItemIndent",r.containerState.size+1)(o)}function s(o){return r.containerState.furtherBlankLines||!bt(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(Ste,t,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ot(e,e.attempt(ur,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function Ete(e,t,n){const r=this;return Ot(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 Tte(e){e.exit(this.containerState.type)}function Mte(e,t,n){const r=this;return Ot(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!bt(s)&&a&&a[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const fM={name:"setextUnderline",tokenize:Ate,resolveTo:Rte};function Rte(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:Object.assign({},e[i][1].start),end:Object.assign({},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=Object.assign({},e[s][1].end)):e[r][1]=a,e.push(["exit",a,t]),e}function Ate(e,t,n){const r=this;let i;return s;function s(c){let d=r.events.length,u;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){u=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||u)?(e.enter("setextHeadingLine"),i=c,a(c)):n(c)}function a(c){return e.enter("setextHeadingLineSequence"),o(c)}function o(c){return c===i?(e.consume(c),o):(e.exit("setextHeadingLineSequence"),bt(c)?Ot(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||$e(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const Dte={tokenize:Lte};function Lte(e){const t=this,n=e.attempt(_1,r,e.attempt(this.parser.constructs.flowInitial,i,Ot(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Iee,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 jte={resolveAll:lN()},Pte=aN("string"),Nte=aN("text");function aN(e){return{tokenize:t,resolveAll:lN(e==="text"?Ote:void 0)};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,a,o);return a;function a(d){return c(d)?s(d):o(d)}function o(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),l}function l(d){return c(d)?(n.exit("data"),s(d)):(n.consume(d),l)}function c(d){if(d===null)return!0;const u=i[d];let f=-1;if(u)for(;++f<u.length;){const g=u[f];if(!g.previous||g.previous.call(r,r.previous))return!0}return!1}}}function lN(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 Ote(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 c=i[s];if(typeof c=="string"){for(a=c.length;c.charCodeAt(a-1)===32;)o++,a--;if(a)break;a=-1}else if(c===-2)l=!0,o++;else if(c!==-1){s++;break}}if(o){const c={type:n===e.length||l||o<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-o,offset:r.end.offset-o,_index:r.start._index+s,_bufferIndex:s?a:r.start._bufferIndex+a},end:Object.assign({},r.end)};r.end=Object.assign({},c.start),r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}function Ite(e,t,n){let r=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const i={},s=[];let a=[],o=[];const l={consume:m,enter:y,exit:b,attempt:E(S),check:E(w),interrupt:E(w,{interrupt:!0})},c={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:g,sliceSerialize:f,now:x,defineSkip:_,write:u};let d=t.tokenize.call(c,l);return t.resolveAll&&s.push(t),c;function u(M){return a=Gr(a,M),v(),a[a.length-1]!==null?[]:(k(t,0),c.events=E5(s,c.events,c),c.events)}function f(M,L){return Fte(g(M),L)}function g(M){return $te(a,M)}function x(){const{line:M,column:L,offset:j,_index:P,_bufferIndex:$}=r;return{line:M,column:L,offset:j,_index:P,_bufferIndex:$}}function _(M){i[M.line]=M.column,R()}function v(){let M;for(;r._index<a.length;){const L=a[r._index];if(typeof L=="string")for(M=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===M&&r._bufferIndex<L.length;)p(L.charCodeAt(r._bufferIndex));else p(L)}}function p(M){d=d(M)}function m(M){$e(M)?(r.line++,r.column=1,r.offset+=M===-3?2:1,R()):M!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=M}function y(M,L){const j=L||{};return j.type=M,j.start=x(),c.events.push(["enter",j,c]),o.push(j),j}function b(M){const L=o.pop();return L.end=x(),c.events.push(["exit",L,c]),L}function S(M,L){k(M,L.from)}function w(M,L){L.restore()}function E(M,L){return j;function j(P,$,F){let W,I,A,D;return Array.isArray(P)?V(P):"tokenize"in P?V([P]):H(P);function H(Z){return q;function q(B){const O=B!==null&&Z[B],z=B!==null&&Z.null,Y=[...Array.isArray(O)?O:O?[O]:[],...Array.isArray(z)?z:z?[z]:[]];return V(Y)(B)}}function V(Z){return W=Z,I=0,Z.length===0?F:U(Z[I])}function U(Z){return q;function q(B){return D=T(),A=Z,Z.partial||(c.currentConstruct=Z),Z.name&&c.parser.constructs.disable.null.includes(Z.name)?ee():Z.tokenize.call(L?Object.assign(Object.create(c),L):c,l,G,ee)(B)}}function G(Z){return M(A,D),$}function ee(Z){return D.restore(),++I<W.length?U(W[I]):F}}}function k(M,L){M.resolveAll&&!s.includes(M)&&s.push(M),M.resolve&&ms(c.events,L,c.events.length-L,M.resolve(c.events.slice(L),c)),M.resolveTo&&(c.events=M.resolveTo(c.events,c))}function T(){const M=x(),L=c.previous,j=c.currentConstruct,P=c.events.length,$=Array.from(o);return{restore:F,from:P};function F(){r=M,c.previous=L,c.currentConstruct=j,c.events.length=P,o=$,R()}}function R(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function $te(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 Fte(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("")}const Bte={42:ur,43:ur,45:ur,48:ur,49:ur,50:ur,51:ur,52:ur,53:ur,54:ur,55:ur,56:ur,57:ur,62:eN},zte={91:Uee},Ute={[-2]:_x,[-1]:_x,32:_x},Hte={35:Kee,42:Ag,45:[fM,Ag],60:Jee,61:fM,95:Ag,96:dM,126:dM},Wte={38:nN,92:tN},Vte={[-5]:xx,[-4]:xx,[-3]:xx,33:gte,38:nN,42:u2,60:[_ee,ste],91:yte,92:[qee,tN],93:T5,95:u2,96:Lee},qte={null:[u2,jte]},Yte={null:[42,95]},Kte={null:[]},Gte=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Yte,contentInitial:zte,disable:Kte,document:Bte,flow:Hte,flowInitial:Ute,insideSpan:qte,string:Wte,text:Vte},Symbol.toStringTag,{value:"Module"}));function Xte(e){const n=iee([Gte,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:i(hee),document:i(pee),flow:i(Dte),string:i(Pte),text:i(Nte)};return r;function i(s){return a;function a(o){return Ite(r,s,o)}}}function Qte(e){for(;!rN(e););return e}const pM=/[\0\t\n\r]/g;function Jte(){let e=1,t="",n=!0,r;return i;function i(s,a,o){const l=[];let c,d,u,f,g;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(a||void 0).decode(s)),u=0,t="",n&&(s.charCodeAt(0)===65279&&u++,n=void 0);u<s.length;){if(pM.lastIndex=u,c=pM.exec(s),f=c&&c.index!==void 0?c.index:s.length,g=s.charCodeAt(f),!c){t=s.slice(u);break}if(g===10&&u===f&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),u<f&&(l.push(s.slice(u,f)),e+=f-u),g){case 0:{l.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,l.push(-2);e++<d;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}u=f+1}return o&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const Zte=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ene(e){return e.replace(Zte,tne)}function tne(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return JP(n.slice(s?2:1),s?16:10)}return k5(n)||e}const cN={}.hasOwnProperty;function nne(e,t,n){return typeof t!="string"&&(n=t,t=void 0),rne(n)(Qte(Xte(n).document().write(Jte()(e,t,!0))))}function rne(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(_e),autolinkProtocol:T,autolinkEmail:T,atxHeading:s(K),blockQuote:s(O),characterEscape:T,characterReference:T,codeFenced:s(z),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:s(z,a),codeText:s(Y,a),codeTextData:T,data:T,codeFlowValue:T,definition:s(N),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:s(J),hardBreakEscape:s(te),hardBreakTrailing:s(te),htmlFlow:s(oe,a),htmlFlowData:T,htmlText:s(oe,a),htmlTextData:T,image:s(ae),label:a,link:s(_e),listItem:s(ge),listItemValue:f,listOrdered:s(Se,u),listUnordered:s(Se),paragraph:s(we),reference:U,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:s(K),strong:s(ce),thematicBreak:s(le)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:B,autolinkProtocol:q,blockQuote:l(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:ee,characterReferenceMarkerNumeric:ee,characterReferenceValue:Z,codeFenced:l(v),codeFencedFence:_,codeFencedFenceInfo:g,codeFencedFenceMeta:x,codeFlowValue:R,codeIndented:l(p),codeText:l($),codeTextData:R,data:R,definition:l(),definitionDestinationString:b,definitionLabelString:m,definitionTitleString:y,emphasis:l(),hardBreakEscape:l(L),hardBreakTrailing:l(L),htmlFlow:l(j),htmlFlowData:R,htmlText:l(P),htmlTextData:R,image:l(W),label:A,labelText:I,lineEnding:M,link:l(F),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:G,resourceDestinationString:D,resourceTitleString:H,resource:V,setextHeading:l(k),setextHeadingLineSequence:E,setextHeadingText:w,strong:l(),thematicBreak:l()}};uN(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(X){let ne={type:"root",children:[]};const ue={stack:[ne],tokenStack:[],config:t,enter:o,exit:c,buffer:a,resume:d,data:n},de=[];let ve=-1;for(;++ve<X.length;)if(X[ve][1].type==="listOrdered"||X[ve][1].type==="listUnordered")if(X[ve][0]==="enter")de.push(ve);else{const Te=de.pop();ve=i(X,Te,ve)}for(ve=-1;++ve<X.length;){const Te=t[X[ve][0]];cN.call(Te,X[ve][1].type)&&Te[X[ve][1].type].call(Object.assign({sliceSerialize:X[ve][2].sliceSerialize},ue),X[ve][1])}if(ue.tokenStack.length>0){const Te=ue.tokenStack[ue.tokenStack.length-1];(Te[1]||mM).call(ue,void 0,Te[0])}for(ne.position={start:yo(X.length>0?X[0][1].start:{line:1,column:1,offset:0}),end:yo(X.length>0?X[X.length-2][1].end:{line:1,column:1,offset:0})},ve=-1;++ve<t.transforms.length;)ne=t.transforms[ve](ne)||ne;return ne}function i(X,ne,ue){let de=ne-1,ve=-1,Te=!1,be,xe,Xe,Oe;for(;++de<=ue;){const Re=X[de];switch(Re[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Re[0]==="enter"?ve++:ve--,Oe=void 0;break}case"lineEndingBlank":{Re[0]==="enter"&&(be&&!Oe&&!ve&&!Xe&&(Xe=de),Oe=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Oe=void 0}if(!ve&&Re[0]==="enter"&&Re[1].type==="listItemPrefix"||ve===-1&&Re[0]==="exit"&&(Re[1].type==="listUnordered"||Re[1].type==="listOrdered")){if(be){let ze=de;for(xe=void 0;ze--;){const st=X[ze];if(st[1].type==="lineEnding"||st[1].type==="lineEndingBlank"){if(st[0]==="exit")continue;xe&&(X[xe][1].type="lineEndingBlank",Te=!0),st[1].type="lineEnding",xe=ze}else if(!(st[1].type==="linePrefix"||st[1].type==="blockQuotePrefix"||st[1].type==="blockQuotePrefixWhitespace"||st[1].type==="blockQuoteMarker"||st[1].type==="listItemIndent"))break}Xe&&(!xe||Xe<xe)&&(be._spread=!0),be.end=Object.assign({},xe?X[xe][1].start:Re[1].end),X.splice(xe||de,0,["exit",be,Re[2]]),de++,ue++}if(Re[1].type==="listItemPrefix"){const ze={type:"listItem",_spread:!1,start:Object.assign({},Re[1].start),end:void 0};be=ze,X.splice(de,0,["enter",ze,Re[2]]),de++,ue++,Xe=void 0,Oe=!0}}}return X[ne][1]._spread=Te,ue}function s(X,ne){return ue;function ue(de){o.call(this,X(de),de),ne&&ne.call(this,de)}}function a(){this.stack.push({type:"fragment",children:[]})}function o(X,ne,ue){this.stack[this.stack.length-1].children.push(X),this.stack.push(X),this.tokenStack.push([ne,ue]),X.position={start:yo(ne.start),end:void 0}}function l(X){return ne;function ne(ue){X&&X.call(this,ue),c.call(this,ue)}}function c(X,ne){const ue=this.stack.pop(),de=this.tokenStack.pop();if(de)de[0].type!==X.type&&(ne?ne.call(this,X,de[0]):(de[1]||mM).call(this,X,de[0]));else throw new Error("Cannot close `"+X.type+"` ("+lf({start:X.start,end:X.end})+"): it’s not open");ue.position.end=yo(X.end)}function d(){return nee(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function f(X){if(this.data.expectingFirstListItemValue){const ne=this.stack[this.stack.length-2];ne.start=Number.parseInt(this.sliceSerialize(X),10),this.data.expectingFirstListItemValue=void 0}}function g(){const X=this.resume(),ne=this.stack[this.stack.length-1];ne.lang=X}function x(){const X=this.resume(),ne=this.stack[this.stack.length-1];ne.meta=X}function _(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const X=this.resume(),ne=this.stack[this.stack.length-1];ne.value=X.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function p(){const X=this.resume(),ne=this.stack[this.stack.length-1];ne.value=X.replace(/(\r?\n|\r)$/g,"")}function m(X){const ne=this.resume(),ue=this.stack[this.stack.length-1];ue.label=ne,ue.identifier=Gc(this.sliceSerialize(X)).toLowerCase()}function y(){const X=this.resume(),ne=this.stack[this.stack.length-1];ne.title=X}function b(){const X=this.resume(),ne=this.stack[this.stack.length-1];ne.url=X}function S(X){const ne=this.stack[this.stack.length-1];if(!ne.depth){const ue=this.sliceSerialize(X).length;ne.depth=ue}}function w(){this.data.setextHeadingSlurpLineEnding=!0}function E(X){const ne=this.stack[this.stack.length-1];ne.depth=this.sliceSerialize(X).codePointAt(0)===61?1:2}function k(){this.data.setextHeadingSlurpLineEnding=void 0}function T(X){const ue=this.stack[this.stack.length-1].children;let de=ue[ue.length-1];(!de||de.type!=="text")&&(de=re(),de.position={start:yo(X.start),end:void 0},ue.push(de)),this.stack.push(de)}function R(X){const ne=this.stack.pop();ne.value+=this.sliceSerialize(X),ne.position.end=yo(X.end)}function M(X){const ne=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ue=ne.children[ne.children.length-1];ue.position.end=yo(X.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ne.type)&&(T.call(this,X),R.call(this,X))}function L(){this.data.atHardBreak=!0}function j(){const X=this.resume(),ne=this.stack[this.stack.length-1];ne.value=X}function P(){const X=this.resume(),ne=this.stack[this.stack.length-1];ne.value=X}function $(){const X=this.resume(),ne=this.stack[this.stack.length-1];ne.value=X}function F(){const X=this.stack[this.stack.length-1];if(this.data.inReference){const ne=this.data.referenceType||"shortcut";X.type+="Reference",X.referenceType=ne,delete X.url,delete X.title}else delete X.identifier,delete X.label;this.data.referenceType=void 0}function W(){const X=this.stack[this.stack.length-1];if(this.data.inReference){const ne=this.data.referenceType||"shortcut";X.type+="Reference",X.referenceType=ne,delete X.url,delete X.title}else delete X.identifier,delete X.label;this.data.referenceType=void 0}function I(X){const ne=this.sliceSerialize(X),ue=this.stack[this.stack.length-2];ue.label=ene(ne),ue.identifier=Gc(ne).toLowerCase()}function A(){const X=this.stack[this.stack.length-1],ne=this.resume(),ue=this.stack[this.stack.length-1];if(this.data.inReference=!0,ue.type==="link"){const de=X.children;ue.children=de}else ue.alt=ne}function D(){const X=this.resume(),ne=this.stack[this.stack.length-1];ne.url=X}function H(){const X=this.resume(),ne=this.stack[this.stack.length-1];ne.title=X}function V(){this.data.inReference=void 0}function U(){this.data.referenceType="collapsed"}function G(X){const ne=this.resume(),ue=this.stack[this.stack.length-1];ue.label=ne,ue.identifier=Gc(this.sliceSerialize(X)).toLowerCase(),this.data.referenceType="full"}function ee(X){this.data.characterReferenceType=X.type}function Z(X){const ne=this.sliceSerialize(X),ue=this.data.characterReferenceType;let de;ue?(de=JP(ne,ue==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):de=k5(ne);const ve=this.stack.pop();ve.value+=de,ve.position.end=yo(X.end)}function q(X){R.call(this,X);const ne=this.stack[this.stack.length-1];ne.url=this.sliceSerialize(X)}function B(X){R.call(this,X);const ne=this.stack[this.stack.length-1];ne.url="mailto:"+this.sliceSerialize(X)}function O(){return{type:"blockquote",children:[]}}function z(){return{type:"code",lang:null,meta:null,value:""}}function Y(){return{type:"inlineCode",value:""}}function N(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function J(){return{type:"emphasis",children:[]}}function K(){return{type:"heading",depth:0,children:[]}}function te(){return{type:"break"}}function oe(){return{type:"html",value:""}}function ae(){return{type:"image",title:null,url:"",alt:null}}function _e(){return{type:"link",title:null,url:"",children:[]}}function Se(X){return{type:"list",ordered:X.type==="listOrdered",start:null,spread:X._spread,children:[]}}function ge(X){return{type:"listItem",spread:X._spread,checked:null,children:[]}}function we(){return{type:"paragraph",children:[]}}function ce(){return{type:"strong",children:[]}}function re(){return{type:"text",value:""}}function le(){return{type:"thematicBreak"}}}function yo(e){return{line:e.line,column:e.column,offset:e.offset}}function uN(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?uN(e,r):ine(e,r)}}function ine(e,t){let n;for(n in t)if(cN.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 mM(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+lf({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+lf({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+lf({start:t.start,end:t.end})+") is still open")}function sne(e){const t=this;t.parser=n;function n(r){return nne(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function one(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 ane(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
`}]}function lne(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 cne(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function une(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function dne(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=fd(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 c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function hne(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 fne(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function dN(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 pne(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return dN(e,t);const i={src:fd(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 mne(e,t){const n={src:fd(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 gne(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 vne(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return dN(e,t);const i={href:fd(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 yne(e,t){const n={href:fd(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 _ne(e,t,n){const r=e.all(t),i=n?xne(n):hN(t),s={},a=[];if(typeof t.checked=="boolean"){const d=r[0];let u;d&&d.type==="element"&&d.tagName==="p"?u=d:(u={type:"element",tagName:"p",properties:{},children:[]},r.unshift(u)),u.children.length>0&&u.children.unshift({type:"text",value:" "}),u.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const d=r[o];(i||o!==0||d.type!=="element"||d.tagName!=="p")&&a.push({type:"text",value:`
`}),d.type==="element"&&d.tagName==="p"&&!i?a.push(...d.children):a.push(d)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&a.push({type:"text",value:`
`});const c={type:"element",tagName:"li",properties:s,children:a};return e.patch(t,c),e.applyData(t,c)}function xne(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=hN(n[r])}return t}function hN(e){const t=e.spread;return t??e.children.length>1}function bne(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 wne(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Sne(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Cne(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function kne(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=S5(t.children[1]),l=KP(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 Ene(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 c=[];for(;++l<o;){const u=t.children[l],f={},g=a?a[l]:void 0;g&&(f.align=g);let x={type:"element",tagName:s,properties:f,children:[]};u&&(x.children=e.all(u),e.patch(u,x),x=e.applyData(u,x)),c.push(x)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,d),e.applyData(t,d)}function Tne(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const gM=9,vM=32;function Mne(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(yM(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(yM(t.slice(i),i>0,!1)),s.join("")}function yM(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===gM||s===vM;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===gM||s===vM;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Rne(e,t){const n={type:"text",value:Mne(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Ane(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Dne={blockquote:one,break:ane,code:lne,delete:cne,emphasis:une,footnoteReference:dne,heading:hne,html:fne,imageReference:pne,image:mne,inlineCode:gne,linkReference:vne,link:yne,listItem:_ne,list:bne,paragraph:wne,root:Sne,strong:Cne,table:kne,tableCell:Tne,tableRow:Ene,text:Rne,thematicBreak:Ane,toml:Am,yaml:Am,definition:Am,footnoteDefinition:Am};function Am(){}const fN=-1,x1=0,A0=1,D0=2,M5=3,R5=4,A5=5,D5=6,pN=7,mN=8,_M=typeof self=="object"?self:globalThis,Lne=(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 x1:case fN:return n(a,i);case A0:{const o=n([],i);for(const l of a)o.push(r(l));return o}case D0:{const o=n({},i);for(const[l,c]of a)o[r(l)]=r(c);return o}case M5:return n(new Date(a),i);case R5:{const{source:o,flags:l}=a;return n(new RegExp(o,l),i)}case A5:{const o=n(new Map,i);for(const[l,c]of a)o.set(r(l),r(c));return o}case D5:{const o=n(new Set,i);for(const l of a)o.add(r(l));return o}case pN:{const{name:o,message:l}=a;return n(new _M[o](l),i)}case mN:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i)}return n(new _M[s](a),i)};return r},xM=e=>Lne(new Map,e)(0),cc="",{toString:jne}={},{keys:Pne}=Object,ih=e=>{const t=typeof e;if(t!=="object"||!e)return[x1,t];const n=jne.call(e).slice(8,-1);switch(n){case"Array":return[A0,cc];case"Object":return[D0,cc];case"Date":return[M5,cc];case"RegExp":return[R5,cc];case"Map":return[A5,cc];case"Set":return[D5,cc]}return n.includes("Array")?[A0,n]:n.includes("Error")?[pN,n]:[D0,n]},Dm=([e,t])=>e===x1&&(t==="function"||t==="symbol"),Nne=(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]=ih(a);switch(o){case x1:{let d=a;switch(l){case"bigint":o=mN,d=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);d=null;break;case"undefined":return i([fN],a)}return i([o,d],a)}case A0:{if(l)return i([l,[...a]],a);const d=[],u=i([o,d],a);for(const f of a)d.push(s(f));return u}case D0:{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 d=[],u=i([o,d],a);for(const f of Pne(a))(e||!Dm(ih(a[f])))&&d.push([s(f),s(a[f])]);return u}case M5:return i([o,a.toISOString()],a);case R5:{const{source:d,flags:u}=a;return i([o,{source:d,flags:u}],a)}case A5:{const d=[],u=i([o,d],a);for(const[f,g]of a)(e||!(Dm(ih(f))||Dm(ih(g))))&&d.push([s(f),s(g)]);return u}case D5:{const d=[],u=i([o,d],a);for(const f of a)(e||!Dm(ih(f)))&&d.push(s(f));return u}}const{message:c}=a;return i([o,{name:l,message:c}],a)};return s},bM=(e,{json:t,lossy:n}={})=>{const r=[];return Nne(!(t||n),!!t,new Map,r)(e),r},L0=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?xM(bM(e,t)):structuredClone(e):(e,t)=>xM(bM(e,t));function One(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 Ine(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function $ne(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||One,r=e.options.footnoteBackLabel||Ine,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 c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const d=e.all(c),u=String(c.identifier).toUpperCase(),f=fd(u.toLowerCase());let g=0;const x=[],_=e.footnoteCounts.get(u);for(;_!==void 0&&++g<=_;){x.length>0&&x.push({type:"text",value:" "});let m=typeof n=="string"?n:n(l,g);typeof m=="string"&&(m={type:"text",value:m}),x.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(m)?m:[m]})}const v=d[d.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const m=v.children[v.children.length-1];m&&m.type==="text"?m.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...x)}else d.push(...x);const p={type:"element",tagName:"li",properties:{id:t+"fn-"+f},children:e.wrap(d,!0)};e.patch(c,p),o.push(p)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...L0(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 gN=function(e){if(e==null)return Une;if(typeof e=="function")return b1(e);if(typeof e=="object")return Array.isArray(e)?Fne(e):Bne(e);if(typeof e=="string")return zne(e);throw new Error("Expected function, string, or object as test")};function Fne(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=gN(e[n]);return b1(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function Bne(e){const t=e;return b1(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function zne(e){return b1(t);function t(n){return n&&n.type===e}}function b1(e){return t;function t(n,r,i){return!!(Hne(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Une(){return!0}function Hne(e){return e!==null&&typeof e=="object"&&"type"in e}const vN=[],Wne=!0,wM=!1,Vne="skip";function qne(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=gN(i),a=r?-1:1;o(e,void 0,[])();function o(l,c,d){const u=l&&typeof l=="object"?l:{};if(typeof u.type=="string"){const g=typeof u.tagName=="string"?u.tagName:typeof u.name=="string"?u.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(l.type+(g?"<"+g+">":""))+")"})}return f;function f(){let g=vN,x,_,v;if((!t||s(l,c,d[d.length-1]||void 0))&&(g=Yne(n(l,d)),g[0]===wM))return g;if("children"in l&&l.children){const p=l;if(p.children&&g[0]!==Vne)for(_=(r?p.children.length:-1)+a,v=d.concat(p);_>-1&&_<p.children.length;){const m=p.children[_];if(x=o(m,_,v)(),x[0]===wM)return x;_=typeof x[1]=="number"?x[1]:_+a}}return g}}}function Yne(e){return Array.isArray(e)?e:typeof e=="number"?[Wne,e]:e==null?vN:[e]}function yN(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),qne(e,s,o,i);function o(l,c){const d=c[c.length-1],u=d?d.children.indexOf(l):void 0;return a(l,u,d)}}const d2={}.hasOwnProperty,Kne={};function Gne(e,t){const n=t||Kne,r=new Map,i=new Map,s=new Map,a={...Dne,...n.handlers},o={all:c,applyData:Qne,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:a,one:l,options:n,patch:Xne,wrap:Zne};return yN(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const u=d.type==="definition"?r:i,f=String(d.identifier).toUpperCase();u.has(f)||u.set(f,d)}}),o;function l(d,u){const f=d.type,g=o.handlers[f];if(d2.call(o.handlers,f)&&g)return g(o,d,u);if(o.options.passThrough&&o.options.passThrough.includes(f)){if("children"in d){const{children:_,...v}=d,p=L0(v);return p.children=o.all(d),p}return L0(d)}return(o.options.unknownHandler||Jne)(o,d,u)}function c(d){const u=[];if("children"in d){const f=d.children;let g=-1;for(;++g<f.length;){const x=o.one(f[g],d);if(x){if(g&&f[g-1].type==="break"&&(!Array.isArray(x)&&x.type==="text"&&(x.value=SM(x.value)),!Array.isArray(x)&&x.type==="element")){const _=x.children[0];_&&_.type==="text"&&(_.value=SM(_.value))}Array.isArray(x)?u.push(...x):u.push(x)}}}return u}}function Xne(e,t){e.position&&(t.position=$Z(e))}function Qne(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,L0(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Jne(e,t){const n=t.data||{},r="value"in t&&!(d2.call(n,"hProperties")||d2.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 Zne(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 SM(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function CM(e,t){const n=Gne(e,t),r=n.one(e,void 0),i=$ne(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
`},i),s}function ere(e,t){return e&&"run"in e?async function(n,r){const i=CM(n,t);await e.run(i,r)}:function(n){return CM(n,t||e)}}function kM(e){if(e)throw e}var Dg=Object.prototype.hasOwnProperty,_N=Object.prototype.toString,EM=Object.defineProperty,TM=Object.getOwnPropertyDescriptor,MM=function(t){return typeof Array.isArray=="function"?Array.isArray(t):_N.call(t)==="[object Array]"},RM=function(t){if(!t||_N.call(t)!=="[object Object]")return!1;var n=Dg.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Dg.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Dg.call(t,i)},AM=function(t,n){EM&&n.name==="__proto__"?EM(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},DM=function(t,n){if(n==="__proto__")if(Dg.call(t,n)){if(TM)return TM(t,n).value}else return;return t[n]},tre=function e(){var t,n,r,i,s,a,o=arguments[0],l=1,c=arguments.length,d=!1;for(typeof o=="boolean"&&(d=o,o=arguments[1]||{},l=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=DM(o,n),i=DM(t,n),o!==i&&(d&&i&&(RM(i)||(s=MM(i)))?(s?(s=!1,a=r&&MM(r)?r:[]):a=r&&RM(r)?r:{},AM(o,{name:n,newValue:e(d,a,i)})):typeof i<"u"&&AM(o,{name:n,newValue:i}));return o};const bx=bn(tre);function h2(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 nre(){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,...c){const d=e[++s];let u=-1;if(l){a(l);return}for(;++u<i.length;)(c[u]===null||c[u]===void 0)&&(c[u]=i[u]);i=c,d?rre(d,o)(...c):a(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function rre(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(c){const d=c;if(o&&n)throw d;return i(d)}o||(l instanceof Promise?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 Xi={basename:ire,dirname:sre,extname:ore,join:are,sep:"/"};function ire(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Ap(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 sre(e){if(Ap(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 ore(e){Ap(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 are(...e){let t=-1,n;for(;++t<e.length;)Ap(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":lre(n)}function lre(e){Ap(e);const t=e.codePointAt(0)===47;let n=cre(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function cre(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 Ap(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const ure={cwd:dre};function dre(){return"/"}function f2(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function hre(e){if(typeof e=="string")e=new URL(e);else if(!f2(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 fre(e)}function fre(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 wx=["history","path","basename","stem","extname","dirname"];class xN{constructor(t){let n;t?f2(t)?n={path:t}:typeof t=="string"||pre(t)?n={value:t}:n=t:n={},this.cwd=ure.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<wx.length;){const s=wx[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)wx.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Xi.basename(this.path):void 0}set basename(t){Cx(t,"basename"),Sx(t,"basename"),this.path=Xi.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Xi.dirname(this.path):void 0}set dirname(t){LM(this.basename,"dirname"),this.path=Xi.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Xi.extname(this.path):void 0}set extname(t){if(Sx(t,"extname"),LM(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=Xi.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){f2(t)&&(t=hre(t)),Cx(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Xi.basename(this.path,this.extname):void 0}set stem(t){Cx(t,"stem"),Sx(t,"stem"),this.path=Xi.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 lr(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 Sx(e,t){if(e&&e.includes(Xi.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Xi.sep+"`")}function Cx(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function LM(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function pre(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const mre=function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};Object.setPrototypeOf(s,r);const a=Object.getOwnPropertyNames(i);for(const o of a){const l=Object.getOwnPropertyDescriptor(i,o);l&&Object.defineProperty(s,o,l)}return s},gre={}.hasOwnProperty;class L5 extends mre{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=nre()}copy(){const t=new L5;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(bx(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Tx("data",this.frozen),this.namespace[t]=n,this):gre.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Tx("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=Lm(t),r=this.parser||this.Parser;return kx("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),kx("process",this.parser||this.Parser),Ex("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,a){const o=Lm(t),l=r.parse(o);r.run(l,o,function(d,u,f){if(d||!u||!f)return c(d);const g=u,x=r.stringify(g,f);_re(x)?f.value=x:f.result=x,c(d,f)});function c(d,u){d||!u?a(d):s?s(u):n(void 0,u)}}}processSync(t){let n=!1,r;return this.freeze(),kx("processSync",this.parser||this.Parser),Ex("processSync",this.compiler||this.Compiler),this.process(t,i),PM("processSync","process",n),r;function i(s,a){n=!0,kM(s),r=a}}run(t,n,r){jM(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=Lm(n);i.run(t,l,c);function c(d,u,f){const g=u||t;d?o(d):a?a(g):r(void 0,g,f)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),PM("runSync","run",r),i;function s(a,o){kM(a),i=o,r=!0}}stringify(t,n){this.freeze();const r=Lm(n),i=this.compiler||this.Compiler;return Ex("stringify",i),jM(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Tx("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(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[d,...u]=c;l(d,u)}else a(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function a(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(c.plugins),c.settings&&(i.settings=bx(!0,i.settings,c.settings))}function o(c){let d=-1;if(c!=null)if(Array.isArray(c))for(;++d<c.length;){const u=c[d];s(u)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,d){let u=-1,f=-1;for(;++u<r.length;)if(r[u][0]===c){f=u;break}if(f===-1)r.push([c,...d]);else if(d.length>0){let[g,...x]=d;const _=r[f][1];h2(_)&&h2(g)&&(g=bx(!0,_,g)),r[f]=[c,g,...x]}}}}const vre=new L5().freeze();function kx(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ex(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Tx(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 jM(e){if(!h2(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function PM(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Lm(e){return yre(e)?e:new xN(e)}function yre(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function _re(e){return typeof e=="string"||xre(e)}function xre(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const bre="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",NM=[],OM={allowDangerousHtml:!0},wre=/^(https?|ircs?|mailto|xmpp)$/i,Sre=[{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 Cre(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,s=e.components,a=e.disallowedElements,o=e.rehypePlugins||NM,l=e.remarkPlugins||NM,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...OM}:OM,d=e.skipHtml,u=e.unwrapDisallowed,f=e.urlTransform||kre,g=vre().use(sne).use(l).use(ere,c).use(o),x=new xN;typeof r=="string"&&(x.value=r);for(const m of Sre)Object.hasOwn(e,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+bre+m.id,void 0);const _=g.parse(x);let v=g.runSync(_,x);return i&&(v={type:"element",tagName:"div",properties:{className:i},children:v.type==="root"?v.children:[v]}),yN(v,p),WZ(v,{Fragment:h.Fragment,components:s,ignoreInvalidStyle:!0,jsx:h.jsx,jsxs:h.jsxs,passKeys:!0,passNode:!0});function p(m,y,b){if(m.type==="raw"&&b&&typeof y=="number")return d?b.children.splice(y,1):b.children[y]={type:"text",value:m.value},y;if(m.type==="element"){let S;for(S in yx)if(Object.hasOwn(yx,S)&&Object.hasOwn(m.properties,S)){const w=m.properties[S],E=yx[S];(E===null||E.includes(m.tagName))&&(m.properties[S]=f(String(w||""),S,m))}}if(m.type==="element"){let S=t?!t.includes(m.tagName):a?a.includes(m.tagName):!1;if(!S&&n&&typeof y=="number"&&(S=!n(m,y,b)),S&&b&&typeof y=="number")return u&&m.children?b.children.splice(y,1,...m.children):b.children.splice(y,1),y}}}function kre(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||wre.test(e.slice(0,t))?e:""}function Mn({children:e,className:t,...n}){return h.jsx("code",{className:ie("rounded-sm font-mono text-muted-foreground bg-muted px-[0.25rem]",t),...n,children:e})}function Ere({href:e,children:t}){const n=wa()[1],r=e==null?void 0:e.startsWith("http"),i=()=>{e&&(r?Fl(e):n(e??"/"))};return h.jsxs("button",{onClick:i,className:"text-accent no-underline hover:underline m-0",children:[t,r&&h.jsx(da,{className:"inline ml-1 mb-1 h-5 [.prose-sm_&]:h-4 [.prose-sm_&]:ml-0"})]})}const Tre={code:({children:e})=>h.jsx(Mn,{className:"not-prose",children:e}),pre:({children:e})=>h.jsx("pre",{className:"not-prose bg-muted p-2 rounded",children:e}),a:({children:e,href:t})=>h.jsx(Ere,{href:t,children:e})};function IM({md:e,isSmall:t,isTitle:n}){return h.jsx(Cre,{components:Tre,className:ie("prose prose-zinc dark:prose-invert",t&&"prose-sm",n&&"tracking-wide"),children:cse(e.replace(/\n/g,`  
`))})}let Mre={data:""},Rre=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||Mre,Are=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Dre=/\/\*[^]*?\*\/|  +/g,$M=/\n+/g,Mo=(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"?Mo(a,s):s+"{"+Mo(a,s[1]=="k"?"":t)+"}":typeof a=="object"?r+=Mo(a,t?t.replace(/([^,])+/g,o=>s.replace(/(^:.*)|([^,])+/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+=Mo.p?Mo.p(s,a):s+":"+a+";")}return n+(t&&i?t+"{"+i+"}":i)+r},As={},bN=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+bN(e[n]);return t}return e},Lre=(e,t,n,r,i)=>{let s=bN(e),a=As[s]||(As[s]=(l=>{let c=0,d=11;for(;c<l.length;)d=101*d+l.charCodeAt(c++)>>>0;return"go"+d})(s));if(!As[a]){let l=s!==e?e:(c=>{let d,u,f=[{}];for(;d=Are.exec(c.replace(Dre,""));)d[4]?f.shift():d[3]?(u=d[3].replace($M," ").trim(),f.unshift(f[0][u]=f[0][u]||{})):f[0][d[1]]=d[2].replace($M," ").trim();return f[0]})(e);As[a]=Mo(i?{["@keyframes "+a]:l}:l,n?"":"."+a)}let o=n&&As.g?As.g:null;return n&&(As.g=As[a]),((l,c,d,u)=>{u?c.data=c.data.replace(u,l):c.data.indexOf(l)===-1&&(c.data=d?l+c.data:c.data+l)})(As[a],t,r,o),a},jre=(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?"":Mo(o,""):o===!1?"":o}return r+i+(a??"")},"");function w1(e){let t=this||{},n=e.call?e(t.p):e;return Lre(n.unshift?n.raw?jre(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,Rre(t.target),t.g,t.o,t.k)}let wN,p2,m2;w1.bind({g:1});let Qs=w1.bind({k:1});function Pre(e,t,n,r){Mo.p=t,wN=e,p2=n,m2=r}function ka(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:p2&&p2()},o),n.o=/ *go\d+/.test(l),o.className=w1.apply(n,r)+(l?" "+l:"");let c=e;return e[0]&&(c=o.as||e,delete o.as),m2&&c[0]&&m2(o),wN(c,o)}return i}}var Nre=e=>typeof e=="function",j0=(e,t)=>Nre(e)?e(t):e,Ore=(()=>{let e=0;return()=>(++e).toString()})(),SN=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),Ire=20,Lg=new Map,$re=1e3,FM=e=>{if(Lg.has(e))return;let t=setTimeout(()=>{Lg.delete(e),Il({type:4,toastId:e})},$re);Lg.set(e,t)},Fre=e=>{let t=Lg.get(e);t&&clearTimeout(t)},g2=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,Ire)};case 1:return t.toast.id&&Fre(t.toast.id),{...e,toasts:e.toasts.map(s=>s.id===t.toast.id?{...s,...t.toast}:s)};case 2:let{toast:n}=t;return e.toasts.find(s=>s.id===n.id)?g2(e,{type:1,toast:n}):g2(e,{type:0,toast:n});case 3:let{toastId:r}=t;return r?FM(r):e.toasts.forEach(s=>{FM(s.id)}),{...e,toasts:e.toasts.map(s=>s.id===r||r===void 0?{...s,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}))}}},jg=[],Pg={toasts:[],pausedAt:void 0},Il=e=>{Pg=g2(Pg,e),jg.forEach(t=>{t(Pg)})},Bre={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},zre=(e={})=>{let[t,n]=C.useState(Pg);C.useEffect(()=>(jg.push(n),()=>{let i=jg.indexOf(n);i>-1&&jg.splice(i,1)}),[t]);let r=t.toasts.map(i=>{var s,a;return{...e,...e[i.type],...i,duration:i.duration||((s=e[i.type])==null?void 0:s.duration)||(e==null?void 0:e.duration)||Bre[i.type],style:{...e.style,...(a=e[i.type])==null?void 0:a.style,...i.style}}});return{...t,toasts:r}},Ure=(e,t="blank",n)=>({createdAt:Date.now(),visible:!0,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:(n==null?void 0:n.id)||Ore()}),Dp=e=>(t,n)=>{let r=Ure(t,e,n);return Il({type:2,toast:r}),r.id},Nr=(e,t)=>Dp("blank")(e,t);Nr.error=Dp("error");Nr.success=Dp("success");Nr.loading=Dp("loading");Nr.custom=Dp("custom");Nr.dismiss=e=>{Il({type:3,toastId:e})};Nr.remove=e=>Il({type:4,toastId:e});Nr.promise=(e,t,n)=>{let r=Nr.loading(t.loading,{...n,...n==null?void 0:n.loading});return e.then(i=>(Nr.success(j0(t.success,i),{id:r,...n,...n==null?void 0:n.success}),i)).catch(i=>{Nr.error(j0(t.error,i),{id:r,...n,...n==null?void 0:n.error})}),e};var Hre=(e,t)=>{Il({type:1,toast:{id:e,height:t}})},Wre=()=>{Il({type:5,time:Date.now()})},Vre=e=>{let{toasts:t,pausedAt:n}=zre(e);C.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&&Nr.dismiss(o.id);return}return setTimeout(()=>Nr.dismiss(o.id),l)});return()=>{a.forEach(o=>o&&clearTimeout(o))}},[t,n]);let r=C.useCallback(()=>{n&&Il({type:6,time:Date.now()})},[n]),i=C.useCallback((s,a)=>{let{reverseOrder:o=!1,gutter:l=8,defaultPosition:c}=a||{},d=t.filter(g=>(g.position||c)===(s.position||c)&&g.height),u=d.findIndex(g=>g.id===s.id),f=d.filter((g,x)=>x<u&&g.visible).length;return d.filter(g=>g.visible).slice(...o?[f+1]:[0,f]).reduce((g,x)=>g+(x.height||0)+l,0)},[t]);return{toasts:t,handlers:{updateHeight:Hre,startPause:Wre,endPause:r,calculateOffset:i}}},qre=Qs`
from {
  transform: scale(0) rotate(45deg);
	opacity: 0;
}
to {
 transform: scale(1) rotate(45deg);
  opacity: 1;
}`,Yre=Qs`
from {
  transform: scale(0);
  opacity: 0;
}
to {
  transform: scale(1);
  opacity: 1;
}`,Kre=Qs`
from {
  transform: scale(0) rotate(90deg);
	opacity: 0;
}
to {
  transform: scale(1) rotate(90deg);
	opacity: 1;
}`,Gre=ka("div")`
  width: 20px;
  opacity: 0;
  height: 20px;
  border-radius: 10px;
  background: ${e=>e.primary||"#ff4b4b"};
  position: relative;
  transform: rotate(45deg);

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

  &:after,
  &:before {
    content: '';
    animation: ${Yre} 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: ${Kre} 0.15s ease-out forwards;
    animation-delay: 180ms;
    transform: rotate(90deg);
  }
`,Xre=Qs`
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
`,Qre=ka("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: ${Xre} 1s linear infinite;
`,Jre=Qs`
from {
  transform: scale(0) rotate(45deg);
	opacity: 0;
}
to {
  transform: scale(1) rotate(45deg);
	opacity: 1;
}`,Zre=Qs`
0% {
	height: 0;
	width: 0;
	opacity: 0;
}
40% {
  height: 0;
	width: 6px;
	opacity: 1;
}
100% {
  opacity: 1;
  height: 10px;
}`,eie=ka("div")`
  width: 20px;
  opacity: 0;
  height: 20px;
  border-radius: 10px;
  background: ${e=>e.primary||"#61d345"};
  position: relative;
  transform: rotate(45deg);

  animation: ${Jre} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
  animation-delay: 100ms;
  &:after {
    content: '';
    box-sizing: border-box;
    animation: ${Zre} 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;
  }
`,tie=ka("div")`
  position: absolute;
`,nie=ka("div")`
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 20px;
  min-height: 20px;
`,rie=Qs`
from {
  transform: scale(0.6);
  opacity: 0.4;
}
to {
  transform: scale(1);
  opacity: 1;
}`,iie=ka("div")`
  position: relative;
  transform: scale(0.6);
  opacity: 0.4;
  min-width: 20px;
  animation: ${rie} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
`,sie=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t!==void 0?typeof t=="string"?C.createElement(iie,null,t):t:n==="blank"?null:C.createElement(nie,null,C.createElement(Qre,{...r}),n!=="loading"&&C.createElement(tie,null,n==="error"?C.createElement(Gre,{...r}):C.createElement(eie,{...r})))},oie=e=>`
0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
`,aie=e=>`
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
`,lie="0%{opacity:0;} 100%{opacity:1;}",cie="0%{opacity:1;} 100%{opacity:0;}",uie=ka("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;
`,die=ka("div")`
  display: flex;
  justify-content: center;
  margin: 4px 10px;
  color: inherit;
  flex: 1 1 auto;
  white-space: pre-line;
`,hie=(e,t)=>{let n=e.includes("top")?1:-1,[r,i]=SN()?[lie,cie]:[oie(n),aie(n)];return{animation:t?`${Qs(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${Qs(i)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},fie=C.memo(({toast:e,position:t,style:n,children:r})=>{let i=e.height?hie(e.position||t||"top-center",e.visible):{opacity:0},s=C.createElement(sie,{toast:e}),a=C.createElement(die,{...e.ariaProps},j0(e.message,e));return C.createElement(uie,{className:e.className,style:{...i,...n,...e.style}},typeof r=="function"?r({icon:s,message:a}):C.createElement(C.Fragment,null,s,a))});Pre(C.createElement);var pie=({id:e,className:t,style:n,onHeightUpdate:r,children:i})=>{let s=C.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 C.createElement("div",{ref:s,className:t,style:n},i)},mie=(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:SN()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...i}},gie=w1`
  z-index: 9999;
  > * {
    pointer-events: auto;
  }
`,jm=16,vie=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:i,containerStyle:s,containerClassName:a})=>{let{toasts:o,handlers:l}=Vre(n);return C.createElement("div",{style:{position:"fixed",zIndex:9999,top:jm,left:jm,right:jm,bottom:jm,pointerEvents:"none",...s},className:a,onMouseEnter:l.startPause,onMouseLeave:l.endPause},o.map(c=>{let d=c.position||t,u=l.calculateOffset(c,{reverseOrder:e,gutter:r,defaultPosition:t}),f=mie(d,u);return C.createElement(pie,{id:c.id,key:c.id,onHeightUpdate:l.updateHeight,className:c.visible?gie:"",style:f},c.type==="custom"?j0(c.message,c):i?i(c):C.createElement(fie,{toast:c,position:d}))}))},P0=Nr;const yie=["default","loading","info","success","warning","error"],_ie=Sa(`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"}}),xie={default:h.jsx(WQ,{className:"stroke-muted-foreground animate-toastbar-icon"}),loading:h.jsx(cn,{className:"animate-spin"}),info:h.jsx(h5,{className:"stroke-info animate-toastbar-icon"}),success:h.jsx(HQ,{className:"stroke-success animate-toastbar-icon"}),warning:h.jsx(UQ,{className:"stroke-warning animate-toastbar-icon"}),error:h.jsx(mJ,{className:"stroke-destructive animate-toastbar-icon"})},bie=({t:e,type:t,data:n})=>{const[r,i]=C.useState(0);return C.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]),h.jsxs("div",{className:ie(_ie({type:t}),e.visible?"animate-toastbar-enter":"animate-toastbar-leave"),children:[h.jsx("div",{className:"flex-shrink-0 flex flex-col gap-2 items-center",children:t==="loading"&&r>5?h.jsx("div",{className:"min-w-[2.65rem] text-center bg-muted/75 rounded-full",children:h.jsxs("span",{className:"text-xs text-secondary-foreground",children:[r,"s"]})}):xie[t]}),h.jsxs("div",{className:"flex-grow",children:[typeof n=="string"?h.jsx("span",{className:"block whitespace-pre-line",children:n}):n.md?h.jsxs(h.Fragment,{children:[n.title?h.jsx(IM,{md:`**${n.title}**`,isSmall:!0,isTitle:!0}):null,h.jsx(IM,{md:n.msg,isSmall:!0})]}):h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"font-semibold mb-1",children:n.title}),h.jsx("span",{className:"block whitespace-pre-line",children:n.msg})]}),t==="error"&&h.jsxs("small",{className:"block text-xs tracking-wide text-muted-foreground",children:["For support, visit ",h.jsx("a",{href:"http://discord.gg/txAdmin",target:"_blank",onClick:zf,className:"font-semibold no-underline hover:underline m-0",children:"discord.gg/txAdmin"}),"."]})]}),h.jsxs("button",{onClick:()=>P0.dismiss(e.id),className:"absolute right-4 top-4 opacity-70",children:[h.jsx(bs,{className:"h-6 sm:w-6 md:h-5 md:w-5"}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})};function wie(){return h.jsx(vie,{reverseOrder:!0,containerStyle:{top:"calc(4.5rem + 1px)",zIndex:60}})}const Pa=(e,t,n={})=>(n.duration??(n.duration=e==="loading"?1/0:5e3),P0.custom(r=>h.jsx(bie,{t:r,type:e,data:t}),n)),Sie=(e,t)=>Pa(e.type,e,t),sn=Object.assign(Sie,{default:(e,t)=>Pa("default",e,t),loading:(e,t)=>Pa("loading",e,t),info:(e,t)=>Pa("info",e,t),success:(e,t)=>Pa("success",e,t),warning:(e,t)=>Pa("warning",e,t),error:(e,t)=>Pa("error",e,t),dismiss:P0.dismiss,remove:P0.remove}),j5=dd(!1),CN=dd(void 0),v2="actionModal",kN=e=>{$N(v2,e)},P5=()=>{const e=it(CN),t=it(j5);return n=>{kN(n),e(n),t(!0)}},Cie=()=>{const e=ut(CN),[t,n]=wr(j5);return{isModalOpen:t,actionRef:e,closeModal:()=>{kN(void 0),n(!1)}}};function Gn(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,c=l===void 0?void 0:l,d,u=!1,f=0;function g(){d&&clearTimeout(d)}function x(v){var p=v||{},m=p.upcomingOnly,y=m===void 0?!1:m;g(),u=!y}function _(){for(var v=arguments.length,p=new Array(v),m=0;m<v;m++)p[m]=arguments[m];var y=this,b=Date.now()-f;if(u)return;function S(){f=Date.now(),t.apply(y,p)}function w(){d=void 0}!o&&c&&!d&&S(),g(),c===void 0&&b>e?o?(f=Date.now(),s||(d=setTimeout(c?w:S,e))):S():s!==!0&&(d=setTimeout(c?w:S,c===void 0?e-b:e))}return _.cancel=x,_}function N5(e,t,n){var r=n||{},i=r.atBegin,s=i===void 0?!1:i;return Gn(e,t,{debounceMode:s!==!1})}const S1=Je(void 0),O5=Je(void 0),C1=Je(void 0),k1=Je(void 0),I5=Je(0),kie=2.5*60*1e3,Eie=()=>{const e=it(S1),t=it(C1),n=it(I5);return r=>{e(r.playerDrop),t(r.svRuntime),n(Date.now())}},Tie=()=>{const e=it(k1);return C.useCallback(Gn(150,e,{noLeading:!1,noTrailing:!1}),[e])},Mie=()=>{const e=it(S1);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}})}},$5=()=>{const e=ut(I5);return()=>{const t=Date.now();return{isExpired:t-e>kie,isStale:t-e>60*1e3,age:t-e}}},zo=()=>{},Kn=zo(),Mx=Object,De=e=>e===Kn,Qr=e=>typeof e=="function",Js=(e,t)=>({...e,...t}),Rie=e=>Qr(e.then),Pm=new WeakMap;let Aie=0;const $f=e=>{const t=typeof e,n=e&&e.constructor,r=n==Date;let i,s;if(Mx(e)===e&&!r&&n!=RegExp){if(i=Pm.get(e),i)return i;if(i=++Aie+"~",Pm.set(e,i),n==Array){for(i="@",s=0;s<e.length;s++)i+=$f(e[s])+",";Pm.set(e,i)}if(n==Mx){i="#";const a=Mx.keys(e).sort();for(;!De(s=a.pop());)De(e[s])||(i+=s+":"+$f(e[s])+",");Pm.set(e,i)}}else i=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return i},ss=new WeakMap,Rx={},Nm={},F5="undefined",E1=typeof window!=F5,y2=typeof document!=F5,Die=()=>E1&&typeof window.requestAnimationFrame!=F5,B5=(e,t)=>{const n=ss.get(e);return[()=>!De(t)&&e.get(t)||Rx,r=>{if(!De(t)){const i=e.get(t);t in Nm||(Nm[t]=i),n[5](t,Js(i,r),i||Rx)}},n[6],()=>!De(t)&&t in Nm?Nm[t]:!De(t)&&e.get(t)||Rx]};let _2=!0;const Lie=()=>_2,[x2,b2]=E1&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[zo,zo],jie=()=>{const e=y2&&document.visibilityState;return De(e)||e!=="hidden"},Pie=e=>(y2&&document.addEventListener("visibilitychange",e),x2("focus",e),()=>{y2&&document.removeEventListener("visibilitychange",e),b2("focus",e)}),Nie=e=>{const t=()=>{_2=!0,e()},n=()=>{_2=!1};return x2("online",t),x2("offline",n),()=>{b2("online",t),b2("offline",n)}},Oie={isOnline:Lie,isVisible:jie},Iie={initFocus:Pie,initReconnect:Nie},N0=!rt.useId,gl=!E1||"Deno"in window,EN=e=>Die()?window.requestAnimationFrame(e):setTimeout(e,1),Xc=gl?C.useEffect:C.useLayoutEffect,Ax=typeof navigator<"u"&&navigator.connection,BM=!gl&&Ax&&(["slow-2g","2g"].includes(Ax.effectiveType)||Ax.saveData),T1=e=>{if(Qr(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?$f(e):"",[e,t]};let $ie=0;const O0=()=>++$ie,TN=0,MN=1,RN=2,Fie=3;var os={__proto__:null,ERROR_REVALIDATE_EVENT:Fie,FOCUS_EVENT:TN,MUTATE_EVENT:RN,RECONNECT_EVENT:MN};async function z5(...e){const[t,n,r,i]=e,s=Js({populateCache:!0,throwOnError:!0},typeof i=="boolean"?{revalidate:i}:i||{});let a=s.populateCache;const o=s.rollbackOnError;let l=s.optimisticData;const c=f=>typeof o=="function"?o(f):o!==!1,d=s.throwOnError;if(Qr(n)){const f=n,g=[],x=t.keys();for(const _ of x)!/^\$(inf|sub)\$/.test(_)&&f(t.get(_)._k)&&g.push(_);return Promise.all(g.map(u))}return u(n);async function u(f){const[g]=T1(f);if(!g)return;const[x,_]=B5(t,g),[v,p,m,y]=ss.get(t),b=()=>{const j=v[g];return(Qr(s.revalidate)?s.revalidate(x().data,f):s.revalidate!==!1)&&(delete m[g],delete y[g],j&&j[0])?j[0](RN).then(()=>x().data):x().data};if(e.length<3)return b();let S=r,w;const E=O0();p[g]=[E,0];const k=!De(l),T=x(),R=T.data,M=T._c,L=De(M)?R:M;if(k&&(l=Qr(l)?l(L,R):l,_({data:l,_c:L})),Qr(S))try{S=S(L)}catch(j){w=j}if(S&&Rie(S))if(S=await S.catch(j=>{w=j}),E!==p[g][0]){if(w)throw w;return S}else w&&k&&c(w)&&(a=!0,_({data:L,_c:Kn}));if(a&&!w)if(Qr(a)){const j=a(S,L);_({data:j,error:Kn,_c:Kn})}else _({data:S,error:Kn,_c:Kn});if(p[g][1]=O0(),Promise.resolve(b()).then(()=>{_({_c:Kn})}),w){if(d)throw w;return}return S}}const zM=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},Bie=(e,t)=>{if(!ss.has(e)){const n=Js(Iie,t),r={},i=z5.bind(Kn,e);let s=zo;const a={},o=(d,u)=>{const f=a[d]||[];return a[d]=f,f.push(u),()=>f.splice(f.indexOf(u),1)},l=(d,u,f)=>{e.set(d,u);const g=a[d];if(g)for(const x of g)x(u,f)},c=()=>{if(!ss.has(e)&&(ss.set(e,[r,{},{},{},i,l,o]),!gl)){const d=n.initFocus(setTimeout.bind(Kn,zM.bind(Kn,r,TN))),u=n.initReconnect(setTimeout.bind(Kn,zM.bind(Kn,r,MN)));s=()=>{d&&d(),u&&u(),ss.delete(e)}}};return c(),[e,i,c,s]}return[e,ss.get(e)[4]]},zie=(e,t,n,r,i)=>{const s=n.errorRetryCount,a=i.retryCount,o=~~((Math.random()+.5)*(1<<(a<8?a:8)))*n.errorRetryInterval;!De(s)&&a>s||setTimeout(r,o,i)},Uie=(e,t)=>$f(e)==$f(t),[AN,DN]=Bie(new Map),Hie=Js({onLoadingSlow:zo,onSuccess:zo,onError:zo,onErrorRetry:zie,onDiscarded:zo,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:BM?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:BM?5e3:3e3,compare:Uie,isPaused:()=>!1,cache:AN,mutate:DN,fallback:{}},Oie),Wie=(e,t)=>{const n=Js(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=Js(i,a))}return n},Vie=C.createContext({}),qie="$inf$",LN=E1&&window.__SWR_DEVTOOLS_USE__,Yie=LN?window.__SWR_DEVTOOLS_USE__:[],Kie=()=>{LN&&(window.__SWR_DEVTOOLS_REACT__=rt)},jN=e=>Qr(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],Gie=()=>Js(Hie,C.useContext(Vie)),Xie=e=>(t,n,r)=>e(t,n&&((...s)=>{const[a]=T1(t),[,,,o]=ss.get(AN);if(a.startsWith(qie))return n(...s);const l=o[a];return De(l)?n(...s):(delete o[a],l)}),r),Qie=Yie.concat(Xie),PN=e=>function(...n){const r=Gie(),[i,s,a]=jN(n),o=Wie(r,a);let l=e;const{use:c}=o,d=(c||[]).concat(Qie);for(let u=d.length;u--;)l=d[u](l);return l(i,s||o.fetcher||null,o)},NN=(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())}},Jie=(e,t)=>(...n)=>{const[r,i,s]=jN(n),a=(s.use||[]).concat(t);return e(r,i,{...s,use:a})};Kie();const UM=rt.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e)}),Dx={dedupe:!0},Zie=(e,t,n)=>{const{cache:r,compare:i,suspense:s,fallbackData:a,revalidateOnMount:o,revalidateIfStale:l,refreshInterval:c,refreshWhenHidden:d,refreshWhenOffline:u,keepPreviousData:f}=n,[g,x,_,v]=ss.get(r),[p,m]=T1(e),y=C.useRef(!1),b=C.useRef(!1),S=C.useRef(p),w=C.useRef(t),E=C.useRef(n),k=()=>E.current,T=()=>k().isVisible()&&k().isOnline(),[R,M,L,j]=B5(r,p),P=C.useRef({}).current,$=De(a)?n.fallback[p]:a,F=(N,J)=>{for(const K in P){const te=K;if(te==="data"){if(!i(N[te],J[te])&&(!De(N[te])||!i(ee,J[te])))return!1}else if(J[te]!==N[te])return!1}return!0},W=C.useMemo(()=>{const N=!p||!t?!1:De(o)?k().isPaused()||s?!1:De(l)?!0:l:o,J=Se=>{const ge=Js(Se);return delete ge._k,N?{isValidating:!0,isLoading:!0,...ge}:ge},K=R(),te=j(),oe=J(K),ae=K===te?oe:J(te);let _e=oe;return[()=>{const Se=J(R());return F(Se,_e)?(_e.data=Se.data,_e.isLoading=Se.isLoading,_e.isValidating=Se.isValidating,_e.error=Se.error,_e):(_e=Se,Se)},()=>ae]},[r,p]),I=XC.useSyncExternalStore(C.useCallback(N=>L(p,(J,K)=>{F(K,J)||N()}),[r,p]),W[0],W[1]),A=!y.current,D=g[p]&&g[p].length>0,H=I.data,V=De(H)?$:H,U=I.error,G=C.useRef(V),ee=f?De(H)?G.current:H:V,Z=D&&!De(U)?!1:A&&!De(o)?o:k().isPaused()?!1:s?De(V)?!1:l:De(V)||l,q=!!(p&&t&&A&&Z),B=De(I.isValidating)?q:I.isValidating,O=De(I.isLoading)?q:I.isLoading,z=C.useCallback(async N=>{const J=w.current;if(!p||!J||b.current||k().isPaused())return!1;let K,te,oe=!0;const ae=N||{},_e=!_[p]||!ae.dedupe,Se=()=>N0?!b.current&&p===S.current&&y.current:p===S.current,ge={isValidating:!1,isLoading:!1},we=()=>{M(ge)},ce=()=>{const le=_[p];le&&le[1]===te&&delete _[p]},re={isValidating:!0};De(R().data)&&(re.isLoading=!0);try{if(_e&&(M(re),n.loadingTimeout&&De(R().data)&&setTimeout(()=>{oe&&Se()&&k().onLoadingSlow(p,n)},n.loadingTimeout),_[p]=[J(m),O0()]),[K,te]=_[p],K=await K,_e&&setTimeout(ce,n.dedupingInterval),!_[p]||_[p][1]!==te)return _e&&Se()&&k().onDiscarded(p),!1;ge.error=Kn;const le=x[p];if(!De(le)&&(te<=le[0]||te<=le[1]||le[1]===0))return we(),_e&&Se()&&k().onDiscarded(p),!1;const X=R().data;ge.data=i(X,K)?X:K,_e&&Se()&&k().onSuccess(K,p,n)}catch(le){ce();const X=k(),{shouldRetryOnError:ne}=X;X.isPaused()||(ge.error=le,_e&&Se()&&(X.onError(le,p,X),(ne===!0||Qr(ne)&&ne(le))&&(!k().revalidateOnFocus||!k().revalidateOnReconnect||T())&&X.onErrorRetry(le,p,X,ue=>{const de=g[p];de&&de[0]&&de[0](os.ERROR_REVALIDATE_EVENT,ue)},{retryCount:(ae.retryCount||0)+1,dedupe:!0})))}return oe=!1,we(),!0},[p,r]),Y=C.useCallback((...N)=>z5(r,S.current,...N),[]);if(Xc(()=>{w.current=t,E.current=n,De(H)||(G.current=H)}),Xc(()=>{if(!p)return;const N=z.bind(Kn,Dx);let J=0;const te=NN(p,g,(oe,ae={})=>{if(oe==os.FOCUS_EVENT){const _e=Date.now();k().revalidateOnFocus&&_e>J&&T()&&(J=_e+k().focusThrottleInterval,N())}else if(oe==os.RECONNECT_EVENT)k().revalidateOnReconnect&&T()&&N();else{if(oe==os.MUTATE_EVENT)return z();if(oe==os.ERROR_REVALIDATE_EVENT)return z(ae)}});return b.current=!1,S.current=p,y.current=!0,M({_k:m}),Z&&(De(V)||gl?N():EN(N)),()=>{b.current=!0,te()}},[p]),Xc(()=>{let N;function J(){const te=Qr(c)?c(R().data):c;te&&N!==-1&&(N=setTimeout(K,te))}function K(){!R().error&&(d||k().isVisible())&&(u||k().isOnline())?z(Dx).then(J):J()}return J(),()=>{N&&(clearTimeout(N),N=-1)}},[c,d,u,p]),C.useDebugValue(ee),s&&De(V)&&p){if(!N0&&gl)throw new Error("Fallback data is required when using suspense in SSR.");w.current=t,E.current=n,b.current=!1;const N=v[p];if(!De(N)){const J=Y(N);UM(J)}if(De(U)){const J=z(Dx);De(ee)||(J.status="fulfilled",J.value=!0),UM(J)}else throw U}return{mutate:Y,get data(){return P.data=!0,ee},get error(){return P.error=!0,U},get isValidating(){return P.isValidating=!0,B},get isLoading(){return P.isLoading=!0,O}}},U5=PN(Zie),pd=Je(window.txConsts.preAuth),ON=Je(e=>!!e(pd)),ese=Je(e=>{const t=e(pd);return t?t.csrfToken:void 0}),tse=Je(e=>{const t=e(pd);if(t)return{permissions:t.permissions,isMaster:t.isMaster}}),nse=()=>ut(ON),rse=()=>ut(ese),ise=()=>it(pd),di=()=>{const e=ut(tse);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}},H5=()=>{const e=it(pd);return(t="unknown",n="unknown",r=md.EXPIRED)=>{console.log("[useExpireAuthData] Logout notice received:",{src:t,reason:n,reasonHash:r}),e(!1),W5(r)}},$l=()=>{const[e,t]=wr(pd),n=ml({mutationKey:["auth"],mutationFn:()=>fetch("/auth/logout",{method:"POST"}).then(r=>r.json()),onSuccess:r=>{r.logout&&(console.log("[useAuth] Manually triggered logout."),t(!1),W5(md.LOGOUT))}});return{authData:e,setAuthData:t,logout:{mutate:n.mutate,isLoading:n.isPending}}},sse=CP((e,t)=>{e(ON)||(console.info("[logoutWatcher] Logout Detected, closing all dialogs and modals."),t(d1,!1),t(h1,!1),t(f1,!1),t(g5,!1),t(v5,!1),t(y5,!1),t(g1,!1),t(j5,!1),t(Nl,null),t(S1,void 0),t(O5,void 0),t(C1,void 0),t(k1,void 0),t(I5,0),sn.dismiss(),DN(()=>!0,void 0,{revalidate:!1}))});var md=(e=>(e.NONE="",e.LOGOUT="#logout",e.EXPIRED="#expired",e.UPDATED="#updated",e.MASTER_ALREADY_SET="#master_already_set",e))(md||{});function ose(){const{setAuthData:e}=$l(),t=C.useRef(null),n=C.useRef(null),[r,i]=C.useState(),s=wa()[1],a=g=>{g.message.startsWith("NetworkError")?i("Network error. If you closed txAdmin, please restart it and try again."):i(g.message)},o=g=>{g==="no_admins_setup"?(i("No admins set up. Redirecting..."),s("/addMaster/pin")):i(g)},l=ml({mutationKey:["oauthRedirect"],mutationFn:()=>{const g=`/auth/cfxre/redirect?origin=${encodeURIComponent(window.location.origin)}`;return fetch(g).then(x=>x.json())},onError:a,onSuccess:g=>{"error"in g?o(g.error):(console.log("Redirecting to",g.authUrl),window.location.href=g.authUrl)}}),c=ml({mutationKey:["auth"],mutationFn:({username:g,password:x})=>fetch(`/auth/password?uiVersion=${encodeURIComponent(window.txConsts.txaVersion)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:g,password:x})}).then(_=>_.json()),onError:a,onSuccess:g=>{"error"in g?g.error==="refreshToUpdate"?(window.location.href="/login#updated",window.location.reload()):o(g.error):e(g)}}),d=g=>{var x,_;g==null||g.preventDefault(),c.mutate({username:((x=t.current)==null?void 0:x.value)||"",password:((_=n.current)==null?void 0:_.value)||""})};let u;window.location.hash==="#logout"?u="Logged Out.":window.location.hash==="#expired"?u="Session Expired.":window.location.hash==="#updated"?u="txAdmin updated, please login again.":window.location.hash==="#master_already_set"&&(u="Master account already configured. Please login instead.");const f=r??u;return C.useEffect(()=>{try{const g=localStorage.getItem("authCredsAutofill");if(g){const[x,_]=JSON.parse(g);t.current.value=x??"",n.current.value=_??""}}catch(g){console.error("Username/Pass autofill failed",g)}},[]),h.jsxs("form",{onSubmit:d,className:"w-full",children:[h.jsx(R1,{className:"space-y-1",children:h.jsx(K5,{className:"text-3xl",children:"Login"})}),h.jsxs(Lp,{className:"grid gap-4",children:[h.jsx("div",{children:h.jsx("button",{type:"button",className:"cfxrebtn",onClick:()=>{l.mutate()},disabled:l.isPending,children:l.isPending?h.jsx("div",{className:"w-[6rem]",children:h.jsx(cn,{className:"mx-auto h-5 w-5 animate-spin"})}):h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"51.12 12.29 1070.38 231.43",className:"w-[6rem] h-5",children:h.jsx("path",{fill:"#fff",d:"M555.37 202.281c-12.725 2.072-36.4 4.44-51.493 4.44-39.952 0-47.35-19.533-47.35-75.17 0-57.412 9.174-75.464 46.462-75.464 14.501 0 39.064 2.367 52.382 4.735l1.183-26.635c-12.725-2.96-36.992-7.398-58.004-7.398-60.668 0-76.057 31.665-76.057 104.763 0 69.25 14.205 104.467 76.057 104.467 18.94 0 43.8-3.552 57.708-6.511l-.887-27.227zm69.547-89.966h39.064V84.793h-39.064v-9.174c0-20.42 4.143-26.93 17.756-26.93 9.174 0 23.675.591 23.675.591l.296-26.043c0-.296-21.9-3.255-31.961-3.255-30.778 0-41.728 12.725-41.728 55.34v9.471H575.79v27.522h17.165v120.448h31.962V112.315zm49.422-27.522 42.911 73.69-42.911 74.28h34.33l29.001-50.606 29.298 50.606h34.33l-44.096-75.169 44.096-72.801h-34.33l-29.298 51.198-29.002-51.198h-34.33zM824.38 190.148h34.625v42.615H824.38zm72.21 42.615h32.257V129.48s23.084-10.358 50.014-15.685V81.538c-25.155 4.735-50.31 21.011-50.31 21.011V84.793h-31.961v147.97zm164.839-24.859c-24.563 0-33.441-11.837-33.737-35.513h91.741l2.072-23.083c0-46.167-20.716-67.77-62.148-67.77-40.84 0-64.219 24.563-64.219 78.72 0 52.085 17.165 75.76 61.556 75.76 26.043 0 59.78-6.806 59.78-6.806l-.592-23.971s-31.074 2.663-54.453 2.663zm-34.033-60.372c.296-28.41 10.062-39.36 31.961-39.36 21.604 0 30.482 9.766 30.482 39.36h-62.443zM242.957 146.08v-.723l-4.34-57.857c-.12-1.567-.783-2.923-1.989-4.068s-2.59-1.718-4.158-1.718h-33.63c-1.567 0-2.953.573-4.158 1.718-1.206 1.145-1.868 2.5-1.989 4.068l-4.34 57.857v.723c-.12 1.447.362 2.653 1.447 3.616 1.085.964 2.35 1.447 3.797 1.447h44.116c1.447 0 2.712-.483 3.797-1.447 1.085-.963 1.568-2.17 1.447-3.616zm137.23 84.436c0 8.8-2.772 13.199-8.317 13.199H244.584c1.567 0 2.893-.574 3.977-1.718 1.085-1.145 1.568-2.5 1.447-4.068l-3.616-46.286c-.121-1.568-.783-2.924-1.99-4.068s-2.59-1.718-4.158-1.718h-49.178c-1.567 0-2.953.573-4.159 1.718-1.205 1.144-1.868 2.5-1.989 4.068l-3.616 46.286c-.12 1.567.362 2.923 1.447 4.068s2.41 1.718 3.977 1.718H59.44c-5.544 0-8.317-4.4-8.317-13.2 0-6.508 1.567-13.5 4.701-20.972l75.396-188.76c.964-2.29 2.53-4.279 4.7-5.966 2.17-1.688 4.46-2.532 6.871-2.532h61.293c-1.567 0-2.953.573-4.159 1.718-1.205 1.145-1.868 2.501-1.989 4.068l-2.712 34.715c-.12 1.687.362 3.073 1.447 4.158 1.085 1.085 2.41 1.627 3.977 1.627h30.014c1.567 0 2.893-.542 3.978-1.627 1.084-1.085 1.567-2.471 1.446-4.158l-2.712-34.715c-.121-1.567-.783-2.923-1.989-4.068s-2.59-1.718-4.158-1.718h61.292c2.41 0 4.701.844 6.87 2.532 2.17 1.687 3.738 3.676 4.702 5.966l75.395 188.76c3.133 7.472 4.7 14.464 4.7 20.973z"})})})}),h.jsxs("div",{className:"relative",children:[h.jsx("div",{className:"absolute inset-0 flex items-center",children:h.jsx("span",{className:"w-full border-t"})}),h.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:h.jsx("span",{className:"bg-card px-2 text-muted-foreground",children:"OR"})})]}),h.jsxs("div",{className:"flex flex-col gap-4",children:[h.jsxs("div",{className:"grid gap-2",children:[h.jsx(sr,{htmlFor:"frm-login",children:"Login"}),h.jsx(ln,{id:"frm-login",type:"text",ref:t,placeholder:"username",autoCapitalize:"off",autoComplete:"off",required:!0})]}),h.jsxs("div",{className:"grid gap-2",children:[h.jsx(sr,{htmlFor:"frm-password",children:"Password"}),h.jsx(ln,{id:"frm-password",type:"password",ref:n,placeholder:"password",autoCapitalize:"off",autoComplete:"off",required:!0})]})]})]}),h.jsxs(gd,{className:"flex-col pb-0",children:[h.jsxs(Ke,{className:"w-full",disabled:c.isPending,children:[c.isPending&&h.jsx(cn,{className:"mr-2 h-4 w-4 animate-spin"}),"Login"]}),h.jsx("div",{className:"text-destructive mt-2",children:f??h.jsx(h.Fragment,{children:" "})})]})]})}const ase=new Date().getFullYear();function ie(...e){return qG(pG(e))}function lse(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 W5(e=md.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 cse=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,"")},I0=l1.humanizer({round:!0}),V5=l1.humanizer({round:!0,spacer:"",language:"shortEn"}),M1=e=>new Date(e<1e10?e*1e3:e),Ff=(e,t="2-digit",n="2-digit",r,i)=>e.toLocaleTimeString(window.txBrowserLocale,{hour:t,minute:n,second:r,hour12:i}),use=(e,t="2-digit",n="2-digit",r,i)=>Ff(M1(e),t,n,r,i),Bf=(e,t="long")=>e.toLocaleDateString(window.txBrowserLocale,{dateStyle:t}),IN=(e,t="long")=>Bf(M1(e),t),dse=(e,t="long",n="medium")=>e.toLocaleString(window.txBrowserLocale,{dateStyle:t,timeStyle:n}),Uo=(e,t="long",n="medium")=>dse(M1(e),t,n),$0=e=>{const t=new Date;return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()},gr=(e,t=0)=>e.toLocaleString(window.txBrowserLocale,{maximumFractionDigits:t}),w2=e=>{const t=M1(e),n=t.getFullYear()!==ase;return t.toLocaleString(window.txBrowserLocale,{year:n?"numeric":void 0,month:n?"numeric":"short",day:"2-digit",hour:"2-digit",minute:"2-digit"})},q5=e=>{const t={transports:["polling"],upgrade:!1,query:{rooms:e,uiVersion:window.txConsts.txaVersion}};return window.txConsts.isWebInterface?of({...t,path:"/socket.io"}):of("monitor",{...t,path:"/WebPipe/socket.io"})},Fl=e=>{e&&(window.invokeNative?window.invokeNative("openUrl",e):window.open(e,"_blank"))},zf=e=>{if(window.txConsts.isWebInterface)return;const n=e.target.closest("a");if(!n)return;const r=n.getAttribute("href");r&&(e.preventDefault(),Fl(r))},F0=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}`},hse=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}`},$N=(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)},Y5=C.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ie("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Y5.displayName="Card";const R1=C.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ie("flex flex-col space-y-1.5 p-6",e),...t}));R1.displayName="CardHeader";const K5=C.forwardRef(({className:e,...t},n)=>h.jsx("h3",{ref:n,className:ie("text-2xl font-semibold leading-none tracking-tight",e),...t}));K5.displayName="CardTitle";const FN=C.forwardRef(({className:e,...t},n)=>h.jsx("p",{ref:n,className:ie("text-sm text-muted-foreground",e),...t}));FN.displayName="CardDescription";const Lp=C.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ie("p-6 pt-0",e),...t}));Lp.displayName="CardContent";const gd=C.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ie("flex items-center p-6 pt-0",e),...t}));gd.displayName="CardFooter";var BN={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},HM=rt.createContext&&rt.createContext(BN),fse=["attr","size","title"];function pse(e,t){if(e==null)return{};var n=mse(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 mse(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 B0(){return B0=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},B0.apply(this,arguments)}function WM(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 z0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?WM(Object(n),!0).forEach(function(r){gse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gse(e,t,n){return t=vse(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vse(e){var t=yse(e,"string");return typeof t=="symbol"?t:t+""}function yse(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 zN(e){return e&&e.map((t,n)=>rt.createElement(t.tag,z0({key:n},t.attr),zN(t.child)))}function UN(e){return t=>rt.createElement(_se,B0({attr:z0({},e.attr)},t),zN(e.child))}function _se(e){var t=n=>{var{attr:r,size:i,title:s}=e,a=pse(e,fse),o=i||n.size||"1em",l;return n.className&&(l=n.className),e.className&&(l=(l?l+" ":"")+e.className),rt.createElement("svg",B0({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,a,{className:l,style:z0(z0({color:e.color||n.color},n.style),e.style),height:o,width:o,xmlns:"http://www.w3.org/2000/svg"}),s&&rt.createElement("title",null,s),e.children)};return HM!==void 0?rt.createElement(HM.Consumer,null,n=>t(n)):t(BN)}function xse(e){return UN({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)}var un=globalThis!=null&&globalThis.document?C.useLayoutEffect:()=>{};function bse(e,t){return C.useReducer((n,r)=>t[n][r]??n,e)}var wn=e=>{const{present:t,children:n}=e,r=wse(t),i=typeof n=="function"?n({present:r.isPresent}):C.Children.only(n),s=We(r.ref,Sse(i));return typeof n=="function"||r.isPresent?C.cloneElement(i,{ref:s}):null};wn.displayName="Presence";function wse(e){const[t,n]=C.useState(),r=C.useRef({}),i=C.useRef(e),s=C.useRef("none"),a=e?"mounted":"unmounted",[o,l]=bse(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{const c=Om(r.current);s.current=o==="mounted"?c:"none"},[o]),un(()=>{const c=r.current,d=i.current;if(d!==e){const f=s.current,g=Om(c);e?l("MOUNT"):g==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(d&&f!==g?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),un(()=>{if(t){let c;const d=t.ownerDocument.defaultView??window,u=g=>{const _=Om(r.current).includes(g.animationName);if(g.target===t&&_&&(l("ANIMATION_END"),!i.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",c=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},f=g=>{g.target===t&&(s.current=Om(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{d.clearTimeout(c),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:C.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Om(e){return(e==null?void 0:e.animationName)||"none"}function Sse(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 Cse(e,t){const n=C.createContext(t),r=s=>{const{children:a,...o}=s,l=C.useMemo(()=>o,Object.values(o));return h.jsx(n.Provider,{value:l,children:a})};r.displayName=e+"Provider";function i(s){const a=C.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 Hi(e,t=[]){let n=[];function r(s,a){const o=C.createContext(a),l=n.length;n=[...n,a];const c=u=>{var p;const{scope:f,children:g,...x}=u,_=((p=f==null?void 0:f[e])==null?void 0:p[l])||o,v=C.useMemo(()=>x,Object.values(x));return h.jsx(_.Provider,{value:v,children:g})};c.displayName=s+"Provider";function d(u,f){var _;const g=((_=f==null?void 0:f[e])==null?void 0:_[l])||o,x=C.useContext(g);if(x)return x;if(a!==void 0)return a;throw new Error(`\`${u}\` must be used within \`${s}\``)}return[c,d]}const i=()=>{const s=n.map(a=>C.createContext(a));return function(o){const l=(o==null?void 0:o[e])||s;return C.useMemo(()=>({[`__scope${e}`]:{...o,[e]:l}}),[o,l])}};return i.scopeName=e,[r,kse(i,...t)]}function kse(...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:c})=>{const u=l(s)[`__scope${c}`];return{...o,...u}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Mt(e){const t=C.useRef(e);return C.useEffect(()=>{t.current=e}),C.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var Ese=C.createContext(void 0);function vd(e){const t=C.useContext(Ese);return e||t||"ltr"}function S2(e,[t,n]){return Math.min(n,Math.max(t,e))}function me(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 Tse(e,t){return C.useReducer((n,r)=>t[n][r]??n,e)}var G5="ScrollArea",[HN,sUe]=Hi(G5),[Mse,hi]=HN(G5),WN=C.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:s=600,...a}=e,[o,l]=C.useState(null),[c,d]=C.useState(null),[u,f]=C.useState(null),[g,x]=C.useState(null),[_,v]=C.useState(null),[p,m]=C.useState(0),[y,b]=C.useState(0),[S,w]=C.useState(!1),[E,k]=C.useState(!1),T=We(t,M=>l(M)),R=vd(i);return h.jsx(Mse,{scope:n,type:r,dir:R,scrollHideDelay:s,scrollArea:o,viewport:c,onViewportChange:d,content:u,onContentChange:f,scrollbarX:g,onScrollbarXChange:x,scrollbarXEnabled:S,onScrollbarXEnabledChange:w,scrollbarY:_,onScrollbarYChange:v,scrollbarYEnabled:E,onScrollbarYEnabledChange:k,onCornerWidthChange:m,onCornerHeightChange:b,children:h.jsx(Me.div,{dir:R,...a,ref:T,style:{position:"relative","--radix-scroll-area-corner-width":p+"px","--radix-scroll-area-corner-height":y+"px",...e.style}})})});WN.displayName=G5;var VN="ScrollAreaViewport",qN=C.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,asChild:i,nonce:s,...a}=e,o=hi(VN,n),l=C.useRef(null),c=We(t,l,o.onViewportChange);return h.jsxs(h.Fragment,{children:[h.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;
}
:where([data-radix-scroll-area-viewport]) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
:where([data-radix-scroll-area-content]) {
  flex-grow: 1;
}
`},nonce:s}),h.jsx(Me.div,{"data-radix-scroll-area-viewport":"",...a,asChild:i,ref:c,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style},children:$se({asChild:i,children:r},d=>h.jsx("div",{"data-radix-scroll-area-content":"",ref:o.onContentChange,style:{minWidth:o.scrollbarXEnabled?"fit-content":void 0},children:d}))})]})});qN.displayName=VN;var ws="ScrollAreaScrollbar",X5=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=hi(ws,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:a}=i,o=e.orientation==="horizontal";return C.useEffect(()=>(o?s(!0):a(!0),()=>{o?s(!1):a(!1)}),[o,s,a]),i.type==="hover"?h.jsx(Rse,{...r,ref:t,forceMount:n}):i.type==="scroll"?h.jsx(Ase,{...r,ref:t,forceMount:n}):i.type==="auto"?h.jsx(YN,{...r,ref:t,forceMount:n}):i.type==="always"?h.jsx(Q5,{...r,ref:t}):null});X5.displayName=ws;var Rse=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=hi(ws,e.__scopeScrollArea),[s,a]=C.useState(!1);return C.useEffect(()=>{const o=i.scrollArea;let l=0;if(o){const c=()=>{window.clearTimeout(l),a(!0)},d=()=>{l=window.setTimeout(()=>a(!1),i.scrollHideDelay)};return o.addEventListener("pointerenter",c),o.addEventListener("pointerleave",d),()=>{window.clearTimeout(l),o.removeEventListener("pointerenter",c),o.removeEventListener("pointerleave",d)}}},[i.scrollArea,i.scrollHideDelay]),h.jsx(wn,{present:n||s,children:h.jsx(YN,{"data-state":s?"visible":"hidden",...r,ref:t})})}),Ase=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=hi(ws,e.__scopeScrollArea),s=e.orientation==="horizontal",a=D1(()=>l("SCROLL_END"),100),[o,l]=Tse("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 C.useEffect(()=>{if(o==="idle"){const c=window.setTimeout(()=>l("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(c)}},[o,i.scrollHideDelay,l]),C.useEffect(()=>{const c=i.viewport,d=s?"scrollLeft":"scrollTop";if(c){let u=c[d];const f=()=>{const g=c[d];u!==g&&(l("SCROLL"),a()),u=g};return c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)}},[i.viewport,s,l,a]),h.jsx(wn,{present:n||o!=="hidden",children:h.jsx(Q5,{"data-state":o==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:me(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:me(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),YN=C.forwardRef((e,t)=>{const n=hi(ws,e.__scopeScrollArea),{forceMount:r,...i}=e,[s,a]=C.useState(!1),o=e.orientation==="horizontal",l=D1(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;a(o?c:d)}},10);return Du(n.viewport,l),Du(n.content,l),h.jsx(wn,{present:r||s,children:h.jsx(Q5,{"data-state":s?"visible":"hidden",...i,ref:t})})}),Q5=C.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,i=hi(ws,e.__scopeScrollArea),s=C.useRef(null),a=C.useRef(0),[o,l]=C.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=JN(o.viewport,o.content),d={...r,sizes:o,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:f=>s.current=f,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:f=>a.current=f};function u(f,g){return Ose(f,a.current,o,g)}return n==="horizontal"?h.jsx(Dse,{...d,ref:t,onThumbPositionChange:()=>{if(i.viewport&&s.current){const f=i.viewport.scrollLeft,g=VM(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=u(f,i.dir))}}):n==="vertical"?h.jsx(Lse,{...d,ref:t,onThumbPositionChange:()=>{if(i.viewport&&s.current){const f=i.viewport.scrollTop,g=VM(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=u(f))}}):null}),Dse=C.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,s=hi(ws,e.__scopeScrollArea),[a,o]=C.useState(),l=C.useRef(null),c=We(t,l,s.onScrollbarXChange);return C.useEffect(()=>{l.current&&o(getComputedStyle(l.current))},[l]),h.jsx(GN,{"data-orientation":"horizontal",...i,ref:c,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":A1(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,u)=>{if(s.viewport){const f=s.viewport.scrollLeft+d.deltaX;e.onWheelScroll(f),eO(f,u)&&d.preventDefault()}},onResize:()=>{l.current&&s.viewport&&a&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:H0(a.paddingLeft),paddingEnd:H0(a.paddingRight)}})}})}),Lse=C.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,s=hi(ws,e.__scopeScrollArea),[a,o]=C.useState(),l=C.useRef(null),c=We(t,l,s.onScrollbarYChange);return C.useEffect(()=>{l.current&&o(getComputedStyle(l.current))},[l]),h.jsx(GN,{"data-orientation":"vertical",...i,ref:c,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":A1(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,u)=>{if(s.viewport){const f=s.viewport.scrollTop+d.deltaY;e.onWheelScroll(f),eO(f,u)&&d.preventDefault()}},onResize:()=>{l.current&&s.viewport&&a&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:H0(a.paddingTop),paddingEnd:H0(a.paddingBottom)}})}})}),[jse,KN]=HN(ws),GN=C.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:s,onThumbPointerUp:a,onThumbPointerDown:o,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:d,onResize:u,...f}=e,g=hi(ws,n),[x,_]=C.useState(null),v=We(t,T=>_(T)),p=C.useRef(null),m=C.useRef(""),y=g.viewport,b=r.content-r.viewport,S=Mt(d),w=Mt(l),E=D1(u,10);function k(T){if(p.current){const R=T.clientX-p.current.left,M=T.clientY-p.current.top;c({x:R,y:M})}}return C.useEffect(()=>{const T=R=>{const M=R.target;(x==null?void 0:x.contains(M))&&S(R,b)};return document.addEventListener("wheel",T,{passive:!1}),()=>document.removeEventListener("wheel",T,{passive:!1})},[y,x,b,S]),C.useEffect(w,[r,w]),Du(x,E),Du(g.content,E),h.jsx(jse,{scope:n,scrollbar:x,hasThumb:i,onThumbChange:Mt(s),onThumbPointerUp:Mt(a),onThumbPositionChange:w,onThumbPointerDown:Mt(o),children:h.jsx(Me.div,{...f,ref:v,style:{position:"absolute",...f.style},onPointerDown:me(e.onPointerDown,T=>{T.button===0&&(T.target.setPointerCapture(T.pointerId),p.current=x.getBoundingClientRect(),m.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),k(T))}),onPointerMove:me(e.onPointerMove,k),onPointerUp:me(e.onPointerUp,T=>{const R=T.target;R.hasPointerCapture(T.pointerId)&&R.releasePointerCapture(T.pointerId),document.body.style.webkitUserSelect=m.current,g.viewport&&(g.viewport.style.scrollBehavior=""),p.current=null})})})}),U0="ScrollAreaThumb",XN=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=KN(U0,e.__scopeScrollArea);return h.jsx(wn,{present:n||i.hasThumb,children:h.jsx(Pse,{ref:t,...r})})}),Pse=C.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,s=hi(U0,n),a=KN(U0,n),{onThumbPositionChange:o}=a,l=We(t,u=>a.onThumbChange(u)),c=C.useRef(),d=D1(()=>{c.current&&(c.current(),c.current=void 0)},100);return C.useEffect(()=>{const u=s.viewport;if(u){const f=()=>{if(d(),!c.current){const g=Ise(u,o);c.current=g,o()}};return o(),u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[s.viewport,d,o]),h.jsx(Me.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:me(e.onPointerDownCapture,u=>{const g=u.target.getBoundingClientRect(),x=u.clientX-g.left,_=u.clientY-g.top;a.onThumbPointerDown({x,y:_})}),onPointerUp:me(e.onPointerUp,a.onThumbPointerUp)})});XN.displayName=U0;var J5="ScrollAreaCorner",QN=C.forwardRef((e,t)=>{const n=hi(J5,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?h.jsx(Nse,{...e,ref:t}):null});QN.displayName=J5;var Nse=C.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=hi(J5,n),[s,a]=C.useState(0),[o,l]=C.useState(0),c=!!(s&&o);return Du(i.scrollbarX,()=>{var u;const d=((u=i.scrollbarX)==null?void 0:u.offsetHeight)||0;i.onCornerHeightChange(d),l(d)}),Du(i.scrollbarY,()=>{var u;const d=((u=i.scrollbarY)==null?void 0:u.offsetWidth)||0;i.onCornerWidthChange(d),a(d)}),c?h.jsx(Me.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 H0(e){return e?parseInt(e,10):0}function JN(e,t){const n=e/t;return isNaN(n)?0:n}function A1(e){const t=JN(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Ose(e,t,n,r="ltr"){const i=A1(n),s=i/2,a=t||s,o=i-a,l=n.scrollbar.paddingStart+a,c=n.scrollbar.size-n.scrollbar.paddingEnd-o,d=n.content-n.viewport,u=r==="ltr"?[0,d]:[d*-1,0];return ZN([l,c],u)(e)}function VM(e,t,n="ltr"){const r=A1(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],c=S2(e,l);return ZN([0,a],[0,o])(c)}function ZN(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 eO(e,t){return e>0&&e<t}var Ise=(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 D1(e,t){const n=Mt(e),r=C.useRef(0);return C.useEffect(()=>()=>window.clearTimeout(r.current),[]),C.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Du(e,t){const n=Mt(t);un(()=>{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 $se(e,t){const{asChild:n,children:r}=e;if(!n)return typeof t=="function"?t(r):t;const i=C.Children.only(r);return C.cloneElement(i,{children:typeof t=="function"?t(i.props.children):t})}var tO=WN,Fse=qN,Bse=QN;const Ni=C.forwardRef(({className:e,children:t,...n},r)=>h.jsxs(tO,{ref:r,className:ie("relative overflow-hidden",e),...n,children:[h.jsx(Fse,{className:"h-full w-full rounded-[inherit]",children:t}),h.jsx(nO,{}),h.jsx(Bse,{})]}));Ni.displayName=tO.displayName;const nO=C.forwardRef(({className:e,orientation:t="vertical",...n},r)=>h.jsx(X5,{ref:r,orientation:t,className:ie("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:h.jsx(XN,{className:"relative flex-1 rounded-full bg-border"})}));nO.displayName=X5.displayName;function zse({error:e}){const t=()=>{window.location.reload()};return h.jsx("div",{className:"w-screen h-screen flex flex-col items-center justify-center",children:h.jsx(rO,{title:"App Error:",description:"Due to an unexpected error, the panel has crashed.",error:e,resetButton:h.jsx(Ke,{variant:"outline",onClick:t,children:"Refresh"})})})}function Use({error:e,resetErrorBoundary:t}){return h.jsx("div",{className:"w-full flex flex-col items-center justify-center",children:h.jsx(rO,{title:"Page Error:",description:"There was an error rendering this page.",error:e,resetButton:h.jsx(Ke,{variant:"outline",onClick:t,children:"Go Back"})})})}function rO(e){return h.jsxs(Y5,{className:"max-w-xl",children:[h.jsxs(R1,{children:[h.jsxs("h1",{className:"text-3xl text-red-500 pb-0 flex flex-row justify-start items-center",children:[h.jsx(xse,{className:"inline-block mr-2"}),e.title]}),h.jsx("span",{className:"text-sm text-muted-foreground pt-0",children:e.description})]}),h.jsxs(Lp,{children:[h.jsxs("p",{className:"truncate",children:["Page: ",h.jsxs("code",{className:"text-muted-foreground ",children:[window.location.pathname??"unknown",window.location.search??""]})]}),h.jsxs("p",{children:["Versions: ",h.jsxs("code",{className:"text-muted-foreground",children:["txAdmin v",window.txConsts.txaVersion," atop FXServer b",window.txConsts.fxsVersion]})]}),h.jsxs("p",{children:["Message: ",h.jsx("code",{className:"text-muted-foreground",children:e.error.message??"unknown"})]}),h.jsx("p",{children:"Stack:"}),h.jsx("pre",{className:"mt-1",children:h.jsx(Ni,{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})})]}),h.jsxs(gd,{className:"flex flex-row justify-between",children:[e.resetButton,h.jsx(Ke,{asChild:!0,variant:"outline",className:"bg-discord hover:bg-discord-active animate-pulse hover:animate-none",children:h.jsx("a",{href:"http://discord.gg/txAdmin",target:"_blank",rel:"noopener noreferrer",children:"Support Discord"})})]})]})}const iO=""+new URL("favicon_default.svg",import.meta.url).href,Hse=""+new URL("favicon_online.svg",import.meta.url).href,Wse=""+new URL("favicon_partial.svg",import.meta.url).href,Vse=""+new URL("favicon_offline.svg",import.meta.url).href,Z5=Je([]),L1=Je(e=>e(Z5).length),sO=Je(null),qse=()=>{const e=Mie(),t=it(Z5),n=it(sO);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)}},oO=Je(0),j1=()=>{const e=it(oO);return()=>e(Math.random())},aO=Je(!1),W0="txAdmin",Bh=document.getElementById("favicon"),lO=Je(W0),cO=()=>{const e=it(lO);return t=>{t?e(t):(e(W0),document.title=W0,Bh.href=iO)}},Yse=CP((e,t)=>{if(!window.txConsts.isWebInterface)return;const n=e(lO),r=e(Nl),i=e(L1);r?(r.server.status==="ONLINE"?Bh.href=Hse:r.server.status==="PARTIAL"?Bh.href=Wse:Bh.href=Vse,document.title=`(${i}) ${r.server.name} · ${n}`):(Bh.href=iO,document.title=W0)}),Kse=150,qM=Gn(Kse,e=>{console.log("sending hotkey event",e),window.postMessage({type:"globalHotkey",action:e})},{noTrailing:!0});function ek(e){return e.code==="KeyK"&&e.ctrlKey?(qM("focusPlayerlistFilter"),!0):e.code==="KeyL"&&e.ctrlKey&&e.shiftKey&&window.txConsts.showAdvanced?(qM("toggleLightMode"),!0):!1}function uO(e){ek(e)&&e.preventDefault()}function mi({legacyUrl:e}){const t=C.useRef(null),n=location.search??"",r=location.hash??"";return C.useEffect(()=>{var i;t.current&&((i=t.current.contentWindow)==null||i.addEventListener("keydown",uO))},[]),h.jsx("iframe",{ref:t,id:"legacyPageIframe",src:`./legacy/${e}${n}${r}`,className:"w-full"})}function Gse({params:e}){return cO()("Not Found"),h.jsx("div",{className:"w-full flex items-center justify-center",children:h.jsxs("div",{className:"text-center",children:[h.jsx("h1",{className:"bg-fuchsia-600 text-4xl w-fit mx-auto",children:"404 | Not Found"}),h.jsxs("p",{className:"mt-2",children:["The page ",h.jsxs(Mn,{children:["/",e["*"]]})," does not seem to be correct."]}),h.jsx(ca,{href:"/",className:"text-accent hover:underline",children:"Return to Dashboard?"})]})})}var dO={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(globalThis,()=>(()=>{var n={4567:function(a,o,l){var c=this&&this.__decorate||function(m,y,b,S){var w,E=arguments.length,k=E<3?y:S===null?S=Object.getOwnPropertyDescriptor(y,b):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(m,y,b,S);else for(var T=m.length-1;T>=0;T--)(w=m[T])&&(k=(E<3?w(k):E>3?w(y,b,k):w(y,b))||k);return E>3&&k&&Object.defineProperty(y,b,k),k},d=this&&this.__param||function(m,y){return function(b,S){y(b,S,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const u=l(9042),f=l(9924),g=l(844),x=l(4725),_=l(2585),v=l(3656);let p=o.AccessibilityManager=class extends g.Disposable{constructor(m,y,b,S){super(),this._terminal=m,this._coreBrowserService=b,this._renderService=S,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 w=0;w<this._terminal.rows;w++)this._rowElements[w]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[w]);if(this._topBoundaryFocusListener=w=>this._handleBoundaryFocus(w,0),this._bottomBoundaryFocusListener=w=>this._handleBoundaryFocus(w,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(w=>this._handleResize(w.rows))),this.register(this._terminal.onRender(w=>this._refreshRows(w.start,w.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(w=>this._handleChar(w))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
`))),this.register(this._terminal.onA11yTab(w=>this._handleTab(w))),this.register(this._terminal.onKey(w=>this._handleKey(w.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(m){for(let y=0;y<m;y++)this._handleChar(" ")}_handleChar(m){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==m&&(this._charsToAnnounce+=m):this._charsToAnnounce+=m,m===`
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=u.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(m){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(m)||this._charsToConsume.push(m)}_refreshRows(m,y){this._liveRegionDebouncer.refresh(m,y,this._terminal.rows)}_renderRows(m,y){const b=this._terminal.buffer,S=b.lines.length.toString();for(let w=m;w<=y;w++){const E=b.lines.get(b.ydisp+w),k=[],T=(E==null?void 0:E.translateToString(!0,void 0,void 0,k))||"",R=(b.ydisp+w+1).toString(),M=this._rowElements[w];M&&(T.length===0?(M.innerText=" ",this._rowColumns.set(M,[0,1])):(M.textContent=T,this._rowColumns.set(M,k)),M.setAttribute("aria-posinset",R),M.setAttribute("aria-setsize",S))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(m,y){const b=m.target,S=this._rowElements[y===0?1:this._rowElements.length-2];if(b.getAttribute("aria-posinset")===(y===0?"1":`${this._terminal.buffer.lines.length}`)||m.relatedTarget!==S)return;let w,E;if(y===0?(w=b,E=this._rowElements.pop(),this._rowContainer.removeChild(E)):(w=this._rowElements.shift(),E=b,this._rowContainer.removeChild(w)),w.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(),m.preventDefault(),m.stopImmediatePropagation()}_handleSelectionChange(){var T;if(this._rowElements.length===0)return;const m=document.getSelection();if(!m)return;if(m.isCollapsed)return void(this._rowContainer.contains(m.anchorNode)&&this._terminal.clearSelection());if(!m.anchorNode||!m.focusNode)return void console.error("anchorNode and/or focusNode are null");let y={node:m.anchorNode,offset:m.anchorOffset},b={node:m.focusNode,offset:m.focusOffset};if((y.node.compareDocumentPosition(b.node)&Node.DOCUMENT_POSITION_PRECEDING||y.node===b.node&&y.offset>b.offset)&&([y,b]=[b,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 S=this._rowElements.slice(-1)[0];if(b.node.compareDocumentPosition(S)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(b={node:S,offset:((T=S.textContent)==null?void 0:T.length)??0}),!this._rowContainer.contains(b.node))return;const w=({node:R,offset:M})=>{const L=R instanceof Text?R.parentNode:R;let j=parseInt(L==null?void 0:L.getAttribute("aria-posinset"),10)-1;if(isNaN(j))return console.warn("row is invalid. Race condition?"),null;const P=this._rowColumns.get(L);if(!P)return console.warn("columns is null. Race condition?"),null;let $=M<P.length?P[M]:P.slice(-1)[0]+1;return $>=this._terminal.cols&&(++j,$=0),{row:j,column:$}},E=w(y),k=w(b);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(m){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>m;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const m=this._coreBrowserService.mainDocument.createElement("div");return m.setAttribute("role","listitem"),m.tabIndex=-1,this._refreshRowDimensions(m),m}_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 m=0;m<this._terminal.rows;m++)this._refreshRowDimensions(this._rowElements[m])}}_refreshRowDimensions(m){m.style.height=`${this._renderService.dimensions.css.cell.height}px`}};o.AccessibilityManager=p=c([d(1,_.IInstantiationService),d(2,x.ICoreBrowserService),d(3,x.IRenderService)],p)},3614:(a,o)=>{function l(f){return f.replace(/\r?\n/g,"\r")}function c(f,g){return g?"\x1B[200~"+f+"\x1B[201~":f}function d(f,g,x,_){f=c(f=l(f),x.decPrivateModes.bracketedPasteMode&&_.rawOptions.ignoreBracketedPasteMode!==!0),x.triggerDataEvent(f,!0),g.value=""}function u(f,g,x){const _=x.getBoundingClientRect(),v=f.clientX-_.left-10,p=f.clientY-_.top-10;g.style.width="20px",g.style.height="20px",g.style.left=`${v}px`,g.style.top=`${p}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=c,o.copyHandler=function(f,g){f.clipboardData&&f.clipboardData.setData("text/plain",g.selectionText),f.preventDefault()},o.handlePasteEvent=function(f,g,x,_){f.stopPropagation(),f.clipboardData&&d(f.clipboardData.getData("text/plain"),g,x,_)},o.paste=d,o.moveTextAreaUnderMouseCursor=u,o.rightClickHandler=function(f,g,x,_,v){u(f,g,x),v&&_.rightClickSelect(f),g.value=_.selectionText,g.select()}},7239:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const c=l(1505);o.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(d,u,f){this._css.set(d,u,f)}getCss(d,u){return this._css.get(d,u)}setColor(d,u,f){this._color.set(d,u,f)}getColor(d,u){return this._color.get(d,u)}clear(){this._color.clear(),this._css.clear()}}},3656:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(l,c,d,u){l.addEventListener(c,d,u);let f=!1;return{dispose:()=>{f||(f=!0,l.removeEventListener(c,d,u))}}}},3551:function(a,o,l){var c=this&&this.__decorate||function(p,m,y,b){var S,w=arguments.length,E=w<3?m:b===null?b=Object.getOwnPropertyDescriptor(m,y):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(p,m,y,b);else for(var k=p.length-1;k>=0;k--)(S=p[k])&&(E=(w<3?S(E):w>3?S(m,y,E):S(m,y))||E);return w>3&&E&&Object.defineProperty(m,y,E),E},d=this&&this.__param||function(p,m){return function(y,b){m(y,b,p)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const u=l(3656),f=l(8460),g=l(844),x=l(2585),_=l(4725);let v=o.Linkifier=class extends g.Disposable{get currentLink(){return this._currentLink}constructor(p,m,y,b,S){super(),this._element=p,this._mouseService=m,this._renderService=y,this._bufferService=b,this._linkProviderService=S,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 w;this._lastMouseEvent=void 0,(w=this._activeProviderReplies)==null||w.clear()})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this.register((0,u.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,u.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(p){this._lastMouseEvent=p;const m=this._positionFromMouseEvent(p,this._element,this._mouseService);if(!m)return;this._isMouseOut=!1;const y=p.composedPath();for(let b=0;b<y.length;b++){const S=y[b];if(S.classList.contains("xterm"))break;if(S.classList.contains("xterm-hover"))return}this._lastBufferCell&&m.x===this._lastBufferCell.x&&m.y===this._lastBufferCell.y||(this._handleHover(m),this._lastBufferCell=m)}_handleHover(p){if(this._activeLine!==p.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(p,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,p)||(this._clearCurrentLink(),this._askForLink(p,!0))}_askForLink(p,m){var b,S;this._activeProviderReplies&&m||((b=this._activeProviderReplies)==null||b.forEach(w=>{w==null||w.forEach(E=>{E.link.dispose&&E.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=p.y);let y=!1;for(const[w,E]of this._linkProviderService.linkProviders.entries())m?(S=this._activeProviderReplies)!=null&&S.get(w)&&(y=this._checkLinkProviderResult(w,p,y)):E.provideLinks(p.y,k=>{var R,M;if(this._isMouseOut)return;const T=k==null?void 0:k.map(L=>({link:L}));(R=this._activeProviderReplies)==null||R.set(w,T),y=this._checkLinkProviderResult(w,p,y),((M=this._activeProviderReplies)==null?void 0:M.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(p.y,this._activeProviderReplies)})}_removeIntersectingLinks(p,m){const y=new Set;for(let b=0;b<m.size;b++){const S=m.get(b);if(S)for(let w=0;w<S.length;w++){const E=S[w],k=E.link.range.start.y<p?0:E.link.range.start.x,T=E.link.range.end.y>p?this._bufferService.cols:E.link.range.end.x;for(let R=k;R<=T;R++){if(y.has(R)){S.splice(w--,1);break}y.add(R)}}}}_checkLinkProviderResult(p,m,y){var w;if(!this._activeProviderReplies)return y;const b=this._activeProviderReplies.get(p);let S=!1;for(let E=0;E<p;E++)this._activeProviderReplies.has(E)&&!this._activeProviderReplies.get(E)||(S=!0);if(!S&&b){const E=b.find(k=>this._linkAtPosition(k.link,m));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=(w=this._activeProviderReplies.get(E))==null?void 0:w.find(T=>this._linkAtPosition(T.link,m));if(k){y=!0,this._handleNewLink(k);break}}return y}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(p){if(!this._currentLink)return;const m=this._positionFromMouseEvent(p,this._element,this._mouseService);m&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,m)&&this._currentLink.link.activate(p,this._currentLink.link.text)}_clearCurrentLink(p,m){this._currentLink&&this._lastMouseEvent&&(!p||!m||this._currentLink.link.range.start.y>=p&&this._currentLink.link.range.end.y<=m)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,g.disposeArray)(this._linkCacheDisposables))}_handleNewLink(p){if(!this._lastMouseEvent)return;const m=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);m&&this._linkAtPosition(p.link,m)&&(this._currentLink=p,this._currentLink.state={decorations:{underline:p.link.decorations===void 0||p.link.decorations.underline,pointerCursor:p.link.decorations===void 0||p.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,p.link,this._lastMouseEvent),p.link.decorations={},Object.defineProperties(p.link.decorations,{pointerCursor:{get:()=>{var y,b;return(b=(y=this._currentLink)==null?void 0:y.state)==null?void 0:b.decorations.pointerCursor},set:y=>{var b;(b=this._currentLink)!=null&&b.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,b;return(b=(y=this._currentLink)==null?void 0:y.state)==null?void 0:b.decorations.underline},set:y=>{var b,S,w;(b=this._currentLink)!=null&&b.state&&((w=(S=this._currentLink)==null?void 0:S.state)==null?void 0:w.decorations.underline)!==y&&(this._currentLink.state.decorations.underline=y,this._currentLink.state.isHovered&&this._fireUnderlineEvent(p.link,y))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(y=>{if(!this._currentLink)return;const b=y.start===0?0:y.start+1+this._bufferService.buffer.ydisp,S=this._bufferService.buffer.ydisp+1+y.end;if(this._currentLink.link.range.start.y>=b&&this._currentLink.link.range.end.y<=S&&(this._clearCurrentLink(b,S),this._lastMouseEvent)){const w=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);w&&this._askForLink(w,!1)}})))}_linkHover(p,m,y){var b;(b=this._currentLink)!=null&&b.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(m,!0),this._currentLink.state.decorations.pointerCursor&&p.classList.add("xterm-cursor-pointer")),m.hover&&m.hover(y,m.text)}_fireUnderlineEvent(p,m){const y=p.range,b=this._bufferService.buffer.ydisp,S=this._createLinkUnderlineEvent(y.start.x-1,y.start.y-b-1,y.end.x,y.end.y-b-1,void 0);(m?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(S)}_linkLeave(p,m,y){var b;(b=this._currentLink)!=null&&b.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(m,!1),this._currentLink.state.decorations.pointerCursor&&p.classList.remove("xterm-cursor-pointer")),m.leave&&m.leave(y,m.text)}_linkAtPosition(p,m){const y=p.range.start.y*this._bufferService.cols+p.range.start.x,b=p.range.end.y*this._bufferService.cols+p.range.end.x,S=m.y*this._bufferService.cols+m.x;return y<=S&&S<=b}_positionFromMouseEvent(p,m,y){const b=y.getCoords(p,m,this._bufferService.cols,this._bufferService.rows);if(b)return{x:b[0],y:b[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(p,m,y,b,S){return{x1:p,y1:m,x2:y,y2:b,cols:this._bufferService.cols,fg:S}}};o.Linkifier=v=c([d(1,_.IMouseService),d(2,_.IRenderService),d(3,x.IBufferService),d(4,_.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 c=this&&this.__decorate||function(_,v,p,m){var y,b=arguments.length,S=b<3?v:m===null?m=Object.getOwnPropertyDescriptor(v,p):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(_,v,p,m);else for(var w=_.length-1;w>=0;w--)(y=_[w])&&(S=(b<3?y(S):b>3?y(v,p,S):y(v,p))||S);return b>3&&S&&Object.defineProperty(v,p,S),S},d=this&&this.__param||function(_,v){return function(p,m){v(p,m,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const u=l(511),f=l(2585);let g=o.OscLinkProvider=class{constructor(_,v,p){this._bufferService=_,this._optionsService=v,this._oscLinkService=p}provideLinks(_,v){var T;const p=this._bufferService.buffer.lines.get(_-1);if(!p)return void v(void 0);const m=[],y=this._optionsService.rawOptions.linkHandler,b=new u.CellData,S=p.getTrimmedLength();let w=-1,E=-1,k=!1;for(let R=0;R<S;R++)if(E!==-1||p.hasContent(R)){if(p.loadCell(R,b),b.hasExtendedAttrs()&&b.extended.urlId){if(E===-1){E=R,w=b.extended.urlId;continue}k=b.extended.urlId!==w}else E!==-1&&(k=!0);if(k||E!==-1&&R===S-1){const M=(T=this._oscLinkService.getLinkData(w))==null?void 0:T.uri;if(M){const L={start:{x:E+1,y:_},end:{x:R+(k||R!==S-1?0:1),y:_}};let j=!1;if(!(y!=null&&y.allowNonHttpProtocols))try{const P=new URL(M);["http:","https:"].includes(P.protocol)||(j=!0)}catch{j=!0}j||m.push({text:M,range:L,activate:(P,$)=>y?y.activate(P,$,L):x(0,$),hover:(P,$)=>{var F;return(F=y==null?void 0:y.hover)==null?void 0:F.call(y,P,$,L)},leave:(P,$)=>{var F;return(F=y==null?void 0:y.leave)==null?void 0:F.call(y,P,$,L)}})}k=!1,b.hasExtendedAttrs()&&b.extended.urlId?(E=R,w=b.extended.urlId):(E=-1,w=-1)}}v(m)}};function x(_,v){if(confirm(`Do you want to navigate to ${v}?

WARNING: This link could potentially be dangerous`)){const p=window.open();if(p){try{p.opener=null}catch{}p.location.href=v}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=g=c([d(0,f.IBufferService),d(1,f.IOptionsService),d(2,f.IOscLinkService)],g)},6193:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(l,c){this._renderCallback=l,this._coreBrowserService=c,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(l){return this._refreshCallbacks.push(l),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(l,c,d){this._rowCount=d,l=l!==void 0?l:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,l):l,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const l=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,c),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const l of this._refreshCallbacks)l(0);this._refreshCallbacks=[]}}},3236:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const c=l(3614),d=l(3656),u=l(3551),f=l(9042),g=l(3730),x=l(1680),_=l(3107),v=l(5744),p=l(2950),m=l(1296),y=l(428),b=l(4269),S=l(5114),w=l(8934),E=l(3230),k=l(9312),T=l(4725),R=l(6731),M=l(8055),L=l(8969),j=l(8460),P=l(844),$=l(6114),F=l(8437),W=l(2584),I=l(7399),A=l(5941),D=l(9074),H=l(2585),V=l(5435),U=l(4567),G=l(779);class ee extends L.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(q={}){super(q),this.browser=$,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new P.MutableDisposable),this._onCursorMove=this.register(new j.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new j.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new j.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new j.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new j.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new j.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new j.EventEmitter),this._onBlur=this.register(new j.EventEmitter),this._onA11yCharEmitter=this.register(new j.EventEmitter),this._onA11yTabEmitter=this.register(new j.EventEmitter),this._onWillOpen=this.register(new j.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(D.DecorationService),this._instantiationService.setService(H.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((B,O)=>this.refresh(B,O))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(B=>this._reportWindowsOptions(B))),this.register(this._inputHandler.onColor(B=>this._handleColorEvent(B))),this.register((0,j.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,j.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,j.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,j.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(B=>this._afterResize(B.cols,B.rows))),this.register((0,P.toDisposable)(()=>{var B,O;this._customKeyEventHandler=void 0,(O=(B=this.element)==null?void 0:B.parentNode)==null||O.removeChild(this.element)}))}_handleColorEvent(q){if(this._themeService)for(const B of q){let O,z="";switch(B.index){case 256:O="foreground",z="10";break;case 257:O="background",z="11";break;case 258:O="cursor",z="12";break;default:O="ansi",z="4;"+B.index}switch(B.type){case 0:const Y=M.color.toColorRGB(O==="ansi"?this._themeService.colors.ansi[B.index]:this._themeService.colors[O]);this.coreService.triggerDataEvent(`${W.C0.ESC}]${z};${(0,A.toRgbString)(Y)}${W.C1_ESCAPED.ST}`);break;case 1:if(O==="ansi")this._themeService.modifyColors(N=>N.ansi[B.index]=M.channels.toColor(...B.color));else{const N=O;this._themeService.modifyColors(J=>J[N]=M.channels.toColor(...B.color))}break;case 2:this._themeService.restoreColor(B.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(q){q?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(U.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(q){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(W.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var q;return(q=this.textarea)==null?void 0:q.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(W.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 q=this.buffer.ybase+this.buffer.y,B=this.buffer.lines.get(q);if(!B)return;const O=Math.min(this.buffer.x,this.cols-1),z=this._renderService.dimensions.css.cell.height,Y=B.getWidth(O),N=this._renderService.dimensions.css.cell.width*Y,J=this.buffer.y*this._renderService.dimensions.css.cell.height,K=O*this._renderService.dimensions.css.cell.width;this.textarea.style.left=K+"px",this.textarea.style.top=J+"px",this.textarea.style.width=N+"px",this.textarea.style.height=z+"px",this.textarea.style.lineHeight=z+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,d.addDisposableDomListener)(this.element,"copy",B=>{this.hasSelection()&&(0,c.copyHandler)(B,this._selectionService)}));const q=B=>(0,c.handlePasteEvent)(B,this.textarea,this.coreService,this.optionsService);this.register((0,d.addDisposableDomListener)(this.textarea,"paste",q)),this.register((0,d.addDisposableDomListener)(this.element,"paste",q)),$.isFirefox?this.register((0,d.addDisposableDomListener)(this.element,"mousedown",B=>{B.button===2&&(0,c.rightClickHandler)(B,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,d.addDisposableDomListener)(this.element,"contextmenu",B=>{(0,c.rightClickHandler)(B,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),$.isLinux&&this.register((0,d.addDisposableDomListener)(this.element,"auxclick",B=>{B.button===1&&(0,c.moveTextAreaUnderMouseCursor)(B,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,d.addDisposableDomListener)(this.textarea,"keyup",q=>this._keyUp(q),!0)),this.register((0,d.addDisposableDomListener)(this.textarea,"keydown",q=>this._keyDown(q),!0)),this.register((0,d.addDisposableDomListener)(this.textarea,"keypress",q=>this._keyPress(q),!0)),this.register((0,d.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,d.addDisposableDomListener)(this.textarea,"compositionupdate",q=>this._compositionHelper.compositionupdate(q))),this.register((0,d.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,d.addDisposableDomListener)(this.textarea,"input",q=>this._inputEvent(q),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(q){var O;if(!q)throw new Error("Terminal requires a parent element.");if(q.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((O=this.element)==null?void 0:O.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=q.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"),q.appendChild(this.element);const B=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),B.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,d.addDisposableDomListener)(this.screenElement,"mousemove",z=>this.updateCursorStyle(z))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),B.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",f.promptLabel),$.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(S.CoreBrowserService,this.textarea,q.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(T.ICoreBrowserService,this._coreBrowserService),this.register((0,d.addDisposableDomListener)(this.textarea,"focus",z=>this._handleTextAreaFocus(z))),this.register((0,d.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(R.ThemeService),this._instantiationService.setService(T.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(b.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(z=>this._onRender.fire(z))),this.onResize(z=>this._renderService.resize(z.cols,z.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(p.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(w.MouseService),this._instantiationService.setService(T.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(u.Linkifier,this.screenElement)),this.element.appendChild(B);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(x.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(z=>this.scrollLines(z.amount,z.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(z=>this.scrollLines(z.amount,z.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(z=>this._renderService.handleSelectionChanged(z.start,z.end,z.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(z=>{this.textarea.value=z,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(z=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,d.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.register(this._instantiationService.createInstance(_.BufferDecorationRenderer,this.screenElement)),this.register((0,d.addDisposableDomListener)(this.element,"mousedown",z=>this._selectionService.handleMouseDown(z))),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(U.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",z=>this._handleScreenReaderModeOptionChange(z))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",z=>{!this._overviewRulerRenderer&&z&&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(m.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const q=this,B=this.element;function O(N){const J=q._mouseService.getMouseReportCoords(N,q.screenElement);if(!J)return!1;let K,te;switch(N.overrideType||N.type){case"mousemove":te=32,N.buttons===void 0?(K=3,N.button!==void 0&&(K=N.button<3?N.button:3)):K=1&N.buttons?0:4&N.buttons?1:2&N.buttons?2:3;break;case"mouseup":te=0,K=N.button<3?N.button:3;break;case"mousedown":te=1,K=N.button<3?N.button:3;break;case"wheel":if(q._customWheelEventHandler&&q._customWheelEventHandler(N)===!1||q.viewport.getLinesScrolled(N)===0)return!1;te=N.deltaY<0?0:1,K=4;break;default:return!1}return!(te===void 0||K===void 0||K>4)&&q.coreMouseService.triggerMouseEvent({col:J.col,row:J.row,x:J.x,y:J.y,button:K,action:te,ctrl:N.ctrlKey,alt:N.altKey,shift:N.shiftKey})}const z={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Y={mouseup:N=>(O(N),N.buttons||(this._document.removeEventListener("mouseup",z.mouseup),z.mousedrag&&this._document.removeEventListener("mousemove",z.mousedrag)),this.cancel(N)),wheel:N=>(O(N),this.cancel(N,!0)),mousedrag:N=>{N.buttons&&O(N)},mousemove:N=>{N.buttons||O(N)}};this.register(this.coreMouseService.onProtocolChange(N=>{N?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(N)),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&N?z.mousemove||(B.addEventListener("mousemove",Y.mousemove),z.mousemove=Y.mousemove):(B.removeEventListener("mousemove",z.mousemove),z.mousemove=null),16&N?z.wheel||(B.addEventListener("wheel",Y.wheel,{passive:!1}),z.wheel=Y.wheel):(B.removeEventListener("wheel",z.wheel),z.wheel=null),2&N?z.mouseup||(z.mouseup=Y.mouseup):(this._document.removeEventListener("mouseup",z.mouseup),z.mouseup=null),4&N?z.mousedrag||(z.mousedrag=Y.mousedrag):(this._document.removeEventListener("mousemove",z.mousedrag),z.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,d.addDisposableDomListener)(B,"mousedown",N=>{if(N.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(N))return O(N),z.mouseup&&this._document.addEventListener("mouseup",z.mouseup),z.mousedrag&&this._document.addEventListener("mousemove",z.mousedrag),this.cancel(N)})),this.register((0,d.addDisposableDomListener)(B,"wheel",N=>{if(!z.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(N)===!1)return!1;if(!this.buffer.hasScrollback){const J=this.viewport.getLinesScrolled(N);if(J===0)return;const K=W.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(N.deltaY<0?"A":"B");let te="";for(let oe=0;oe<Math.abs(J);oe++)te+=K;return this.coreService.triggerDataEvent(te,!0),this.cancel(N,!0)}return this.viewport.handleWheel(N)?this.cancel(N):void 0}},{passive:!1})),this.register((0,d.addDisposableDomListener)(B,"touchstart",N=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(N),this.cancel(N)},{passive:!0})),this.register((0,d.addDisposableDomListener)(B,"touchmove",N=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(N)?void 0:this.cancel(N)},{passive:!1}))}refresh(q,B){var O;(O=this._renderService)==null||O.refreshRows(q,B)}updateCursorStyle(q){var B;(B=this._selectionService)!=null&&B.shouldColumnSelect(q)?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(q,B,O=0){var z;O===1?(super.scrollLines(q,B,O),this.refresh(0,this.rows-1)):(z=this.viewport)==null||z.scrollLines(q)}paste(q){(0,c.paste)(q,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(q){this._customKeyEventHandler=q}attachCustomWheelEventHandler(q){this._customWheelEventHandler=q}registerLinkProvider(q){return this._linkProviderService.registerLinkProvider(q)}registerCharacterJoiner(q){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const B=this._characterJoinerService.register(q);return this.refresh(0,this.rows-1),B}deregisterCharacterJoiner(q){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(q)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(q){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+q)}registerDecoration(q){return this._decorationService.registerDecoration(q)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(q,B,O){this._selectionService.setSelection(q,B,O)}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 q;(q=this._selectionService)==null||q.clearSelection()}selectAll(){var q;(q=this._selectionService)==null||q.selectAll()}selectLines(q,B){var O;(O=this._selectionService)==null||O.selectLines(q,B)}_keyDown(q){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(q)===!1)return!1;const B=this.browser.isMac&&this.options.macOptionIsMeta&&q.altKey;if(!B&&!this._compositionHelper.keydown(q))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;B||q.key!=="Dead"&&q.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const O=(0,I.evaluateKeyboardEvent)(q,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(q),O.type===3||O.type===2){const z=this.rows-1;return this.scrollLines(O.type===2?-z:z),this.cancel(q,!0)}return O.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,q)||(O.cancel&&this.cancel(q,!0),!O.key||!!(q.key&&!q.ctrlKey&&!q.altKey&&!q.metaKey&&q.key.length===1&&q.key.charCodeAt(0)>=65&&q.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(O.key!==W.C0.ETX&&O.key!==W.C0.CR||(this.textarea.value=""),this._onKey.fire({key:O.key,domEvent:q}),this._showCursor(),this.coreService.triggerDataEvent(O.key,!0),!this.optionsService.rawOptions.screenReaderMode||q.altKey||q.ctrlKey?this.cancel(q,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(q,B){const O=q.isMac&&!this.options.macOptionIsMeta&&B.altKey&&!B.ctrlKey&&!B.metaKey||q.isWindows&&B.altKey&&B.ctrlKey&&!B.metaKey||q.isWindows&&B.getModifierState("AltGraph");return B.type==="keypress"?O:O&&(!B.keyCode||B.keyCode>47)}_keyUp(q){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(q)===!1||(function(B){return B.keyCode===16||B.keyCode===17||B.keyCode===18}(q)||this.focus(),this.updateCursorStyle(q),this._keyPressHandled=!1)}_keyPress(q){let B;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(q)===!1)return!1;if(this.cancel(q),q.charCode)B=q.charCode;else if(q.which===null||q.which===void 0)B=q.keyCode;else{if(q.which===0||q.charCode===0)return!1;B=q.which}return!(!B||(q.altKey||q.ctrlKey||q.metaKey)&&!this._isThirdLevelShift(this.browser,q)||(B=String.fromCharCode(B),this._onKey.fire({key:B,domEvent:q}),this._showCursor(),this.coreService.triggerDataEvent(B,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(q){if(q.data&&q.inputType==="insertText"&&(!q.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const B=q.data;return this.coreService.triggerDataEvent(B,!0),this.cancel(q),!0}return!1}resize(q,B){q!==this.cols||B!==this.rows?super.resize(q,B):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(q,B){var O,z;(O=this._charSizeService)==null||O.measure(),(z=this.viewport)==null||z.syncScrollArea(!0)}clear(){var q;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 B=1;B<this.rows;B++)this.buffer.lines.push(this.buffer.getBlankLine(F.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(q=this.viewport)==null||q.reset(),this.refresh(0,this.rows-1)}}reset(){var B,O;this.options.rows=this.rows,this.options.cols=this.cols;const q=this._customKeyEventHandler;this._setup(),super.reset(),(B=this._selectionService)==null||B.reset(),this._decorationService.reset(),(O=this.viewport)==null||O.reset(),this._customKeyEventHandler=q,this.refresh(0,this.rows-1)}clearTextureAtlas(){var q;(q=this._renderService)==null||q.clearTextureAtlas()}_reportFocus(){var q;(q=this.element)!=null&&q.classList.contains("focus")?this.coreService.triggerDataEvent(W.C0.ESC+"[I"):this.coreService.triggerDataEvent(W.C0.ESC+"[O")}_reportWindowsOptions(q){if(this._renderService)switch(q){case V.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const B=this._renderService.dimensions.css.canvas.width.toFixed(0),O=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${W.C0.ESC}[4;${O};${B}t`);break;case V.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const z=this._renderService.dimensions.css.cell.width.toFixed(0),Y=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${W.C0.ESC}[6;${Y};${z}t`)}}cancel(q,B){if(this.options.cancelEvents||B)return q.preventDefault(),q.stopPropagation(),!1}}o.Terminal=ee},9924:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(l,c=1e3){this._renderCallback=l,this._debounceThresholdMS=c,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(l,c,d){this._rowCount=d,l=l!==void 0?l:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,l):l,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c;const u=Date.now();if(u-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=u,this._innerRefresh();else if(!this._additionalRefreshRequested){const f=u-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),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,c)}}},1680:function(a,o,l){var c=this&&this.__decorate||function(p,m,y,b){var S,w=arguments.length,E=w<3?m:b===null?b=Object.getOwnPropertyDescriptor(m,y):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(p,m,y,b);else for(var k=p.length-1;k>=0;k--)(S=p[k])&&(E=(w<3?S(E):w>3?S(m,y,E):S(m,y))||E);return w>3&&E&&Object.defineProperty(m,y,E),E},d=this&&this.__param||function(p,m){return function(y,b){m(y,b,p)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const u=l(3656),f=l(4725),g=l(8460),x=l(844),_=l(2585);let v=o.Viewport=class extends x.Disposable{constructor(p,m,y,b,S,w,E,k){super(),this._viewportElement=p,this._scrollArea=m,this._bufferService=y,this._optionsService=b,this._charSizeService=S,this._renderService=w,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,u.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(p){this._viewportElement.style.backgroundColor=p.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(p){if(p)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 m=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==m&&(this._lastRecordedBufferHeight=m,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const p=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==p&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=p),this._refreshAnimationFrame=null}syncScrollArea(p=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(p);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(p)}_handleScroll(p){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 m=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:m,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const p=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(p*(this._smoothScrollState.target-this._smoothScrollState.origin)),p<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(p,m){const y=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(m<0&&this._viewportElement.scrollTop!==0||m>0&&y<this._lastRecordedBufferHeight)||(p.cancelable&&p.preventDefault(),!1)}handleWheel(p){const m=this._getPixelsScrolled(p);return m!==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+m:this._smoothScrollState.target+=m,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=m,this._bubbleScroll(p,m))}scrollLines(p){if(p!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const m=p*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+m,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:p,suppressScrollEvent:!1})}_getPixelsScrolled(p){if(p.deltaY===0||p.shiftKey)return 0;let m=this._applyScrollModifier(p.deltaY,p);return p.deltaMode===WheelEvent.DOM_DELTA_LINE?m*=this._currentRowHeight:p.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(m*=this._currentRowHeight*this._bufferService.rows),m}getBufferElements(p,m){var k;let y,b="";const S=[],w=m??this._bufferService.buffer.lines.length,E=this._bufferService.buffer.lines;for(let T=p;T<w;T++){const R=E.get(T);if(!R)continue;const M=(k=E.get(T+1))==null?void 0:k.isWrapped;if(b+=R.translateToString(!M),!M||T===E.length-1){const L=document.createElement("div");L.textContent=b,S.push(L),b.length>0&&(y=L),b=""}}return{bufferElements:S,cursorElement:y}}getLinesScrolled(p){if(p.deltaY===0||p.shiftKey)return 0;let m=this._applyScrollModifier(p.deltaY,p);return p.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(m/=this._currentRowHeight+0,this._wheelPartialScroll+=m,m=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):p.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(m*=this._bufferService.rows),m}_applyScrollModifier(p,m){const y=this._optionsService.rawOptions.fastScrollModifier;return y==="alt"&&m.altKey||y==="ctrl"&&m.ctrlKey||y==="shift"&&m.shiftKey?p*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:p*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(p){this._lastTouchY=p.touches[0].pageY}handleTouchMove(p){const m=this._lastTouchY-p.touches[0].pageY;return this._lastTouchY=p.touches[0].pageY,m!==0&&(this._viewportElement.scrollTop+=m,this._bubbleScroll(p,m))}};o.Viewport=v=c([d(2,_.IBufferService),d(3,_.IOptionsService),d(4,f.ICharSizeService),d(5,f.IRenderService),d(6,f.ICoreBrowserService),d(7,f.IThemeService)],v)},3107:function(a,o,l){var c=this&&this.__decorate||function(_,v,p,m){var y,b=arguments.length,S=b<3?v:m===null?m=Object.getOwnPropertyDescriptor(v,p):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(_,v,p,m);else for(var w=_.length-1;w>=0;w--)(y=_[w])&&(S=(b<3?y(S):b>3?y(v,p,S):y(v,p))||S);return b>3&&S&&Object.defineProperty(v,p,S),S},d=this&&this.__param||function(_,v){return function(p,m){v(p,m,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const u=l(4725),f=l(844),g=l(2585);let x=o.BufferDecorationRenderer=class extends f.Disposable{constructor(_,v,p,m,y){super(),this._screenElement=_,this._bufferService=v,this._coreBrowserService=p,this._decorationService=m,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(b=>this._removeDecoration(b))),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 _ of this._decorationService.decorations)this._renderDecoration(_);this._dimensionsChanged=!1}_renderDecoration(_){this._refreshStyle(_),this._dimensionsChanged&&this._refreshXPosition(_)}_createElement(_){var m;const v=this._coreBrowserService.mainDocument.createElement("div");v.classList.add("xterm-decoration"),v.classList.toggle("xterm-decoration-top-layer",((m=_==null?void 0:_.options)==null?void 0:m.layer)==="top"),v.style.width=`${Math.round((_.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,v.style.height=(_.options.height||1)*this._renderService.dimensions.css.cell.height+"px",v.style.top=(_.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 p=_.options.x??0;return p&&p>this._bufferService.cols&&(v.style.display="none"),this._refreshXPosition(_,v),v}_refreshStyle(_){const v=_.marker.line-this._bufferService.buffers.active.ydisp;if(v<0||v>=this._bufferService.rows)_.element&&(_.element.style.display="none",_.onRenderEmitter.fire(_.element));else{let p=this._decorationElements.get(_);p||(p=this._createElement(_),_.element=p,this._decorationElements.set(_,p),this._container.appendChild(p),_.onDispose(()=>{this._decorationElements.delete(_),p.remove()})),p.style.top=v*this._renderService.dimensions.css.cell.height+"px",p.style.display=this._altBufferIsActive?"none":"block",_.onRenderEmitter.fire(p)}}_refreshXPosition(_,v=_.element){if(!v)return;const p=_.options.x??0;(_.options.anchor||"left")==="right"?v.style.right=p?p*this._renderService.dimensions.css.cell.width+"px":"":v.style.left=p?p*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(_){var v;(v=this._decorationElements.get(_))==null||v.remove(),this._decorationElements.delete(_),_.dispose()}};o.BufferDecorationRenderer=x=c([d(1,g.IBufferService),d(2,u.ICoreBrowserService),d(3,g.IDecorationService),d(4,u.IRenderService)],x)},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 c of this._zones)if(c.color===l.options.overviewRulerOptions.color&&c.position===l.options.overviewRulerOptions.position){if(this._lineIntersectsZone(c,l.marker.line))return;if(this._lineAdjacentToZone(c,l.marker.line,l.options.overviewRulerOptions.position))return void this._addLineToZone(c,l.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=l.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=l.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=l.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=l.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:l.options.overviewRulerOptions.color,position:l.options.overviewRulerOptions.position,startBufferLine:l.marker.line,endBufferLine:l.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(l){this._linePadding=l}_lineIntersectsZone(l,c){return c>=l.startBufferLine&&c<=l.endBufferLine}_lineAdjacentToZone(l,c,d){return c>=l.startBufferLine-this._linePadding[d||"full"]&&c<=l.endBufferLine+this._linePadding[d||"full"]}_addLineToZone(l,c){l.startBufferLine=Math.min(l.startBufferLine,c),l.endBufferLine=Math.max(l.endBufferLine,c)}}},5744:function(a,o,l){var c=this&&this.__decorate||function(y,b,S,w){var E,k=arguments.length,T=k<3?b:w===null?w=Object.getOwnPropertyDescriptor(b,S):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(y,b,S,w);else for(var R=y.length-1;R>=0;R--)(E=y[R])&&(T=(k<3?E(T):k>3?E(b,S,T):E(b,S))||T);return k>3&&T&&Object.defineProperty(b,S,T),T},d=this&&this.__param||function(y,b){return function(S,w){b(S,w,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const u=l(5871),f=l(4725),g=l(844),x=l(2585),_={full:0,left:0,center:0,right:0},v={full:0,left:0,center:0,right:0},p={full:0,left:0,center:0,right:0};let m=o.OverviewRulerRenderer=class extends g.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(y,b,S,w,E,k,T){var M;super(),this._viewportElement=y,this._screenElement=b,this._bufferService=S,this._decorationService=w,this._renderService=E,this._optionsService=k,this._coreBrowserService=T,this._colorZoneStore=new u.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(M=this._viewportElement.parentElement)==null||M.insertBefore(this._canvas,this._viewportElement);const R=this._canvas.getContext("2d");if(!R)throw new Error("Ctx cannot be null");this._ctx=R,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,g.toDisposable)(()=>{var L;(L=this._canvas)==null||L.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),b=Math.ceil(this._canvas.width/3);v.full=this._canvas.width,v.left=y,v.center=b,v.right=y,this._refreshDrawHeightConstants(),p.full=0,p.left=0,p.center=v.left,p.right=v.left+v.center}_refreshDrawHeightConstants(){_.full=Math.round(2*this._coreBrowserService.dpr);const y=this._canvas.height/this._bufferService.buffer.lines.length,b=Math.round(Math.max(Math.min(y,12),6)*this._coreBrowserService.dpr);_.left=b,_.center=b,_.right=b}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const b of this._decorationService.decorations)this._colorZoneStore.addDecoration(b);this._ctx.lineWidth=1;const y=this._colorZoneStore.zones;for(const b of y)b.position!=="full"&&this._renderColorZone(b);for(const b of y)b.position==="full"&&this._renderColorZone(b);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(y){this._ctx.fillStyle=y.color,this._ctx.fillRect(p[y.position||"full"],Math.round((this._canvas.height-1)*(y.startBufferLine/this._bufferService.buffers.active.lines.length)-_[y.position||"full"]/2),v[y.position||"full"],Math.round((this._canvas.height-1)*((y.endBufferLine-y.startBufferLine)/this._bufferService.buffers.active.lines.length)+_[y.position||"full"]))}_queueRefresh(y,b){this._shouldUpdateDimensions=y||this._shouldUpdateDimensions,this._shouldUpdateAnchor=b||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};o.OverviewRulerRenderer=m=c([d(2,x.IBufferService),d(3,x.IDecorationService),d(4,f.IRenderService),d(5,x.IOptionsService),d(6,f.ICoreBrowserService)],m)},2950:function(a,o,l){var c=this&&this.__decorate||function(_,v,p,m){var y,b=arguments.length,S=b<3?v:m===null?m=Object.getOwnPropertyDescriptor(v,p):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(_,v,p,m);else for(var w=_.length-1;w>=0;w--)(y=_[w])&&(S=(b<3?y(S):b>3?y(v,p,S):y(v,p))||S);return b>3&&S&&Object.defineProperty(v,p,S),S},d=this&&this.__param||function(_,v){return function(p,m){v(p,m,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const u=l(4725),f=l(2585),g=l(2584);let x=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(_,v,p,m,y,b){this._textarea=_,this._compositionView=v,this._bufferService=p,this._optionsService=m,this._coreService=y,this._renderService=b,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(_){this._compositionView.textContent=_.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(_){if(this._isComposing||this._isSendingComposition){if(_.keyCode===229||_.keyCode===16||_.keyCode===17||_.keyCode===18)return!1;this._finalizeComposition(!1)}return _.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(_){if(this._compositionView.classList.remove("active"),this._isComposing=!1,_){const v={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let p;this._isSendingComposition=!1,v.start+=this._dataAlreadySent.length,p=this._isComposing?this._textarea.value.substring(v.start,v.end):this._textarea.value.substring(v.start),p.length>0&&this._coreService.triggerDataEvent(p,!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 _=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const v=this._textarea.value,p=v.replace(_,"");this._dataAlreadySent=p,v.length>_.length?this._coreService.triggerDataEvent(p,!0):v.length<_.length?this._coreService.triggerDataEvent(`${g.C0.DEL}`,!0):v.length===_.length&&v!==_&&this._coreService.triggerDataEvent(v,!0)}},0)}updateCompositionElements(_){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const v=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),p=this._renderService.dimensions.css.cell.height,m=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=m+"px",this._compositionView.style.height=p+"px",this._compositionView.style.lineHeight=p+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const b=this._compositionView.getBoundingClientRect();this._textarea.style.left=y+"px",this._textarea.style.top=m+"px",this._textarea.style.width=Math.max(b.width,1)+"px",this._textarea.style.height=Math.max(b.height,1)+"px",this._textarea.style.lineHeight=b.height+"px"}_||setTimeout(()=>this.updateCompositionElements(!0),0)}}};o.CompositionHelper=x=c([d(2,f.IBufferService),d(3,f.IOptionsService),d(4,f.ICoreService),d(5,u.IRenderService)],x)},9806:(a,o)=>{function l(c,d,u){const f=u.getBoundingClientRect(),g=c.getComputedStyle(u),x=parseInt(g.getPropertyValue("padding-left")),_=parseInt(g.getPropertyValue("padding-top"));return[d.clientX-f.left-x,d.clientY-f.top-_]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=l,o.getCoords=function(c,d,u,f,g,x,_,v,p){if(!x)return;const m=l(c,d,u);return m?(m[0]=Math.ceil((m[0]+(p?_/2:0))/_),m[1]=Math.ceil(m[1]/v),m[0]=Math.min(Math.max(m[0],1),f+(p?1:0)),m[1]=Math.min(Math.max(m[1],1),g),m):void 0}},9504:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const c=l(2584);function d(v,p,m,y){const b=v-u(v,m),S=p-u(p,m),w=Math.abs(b-S)-function(E,k,T){let R=0;const M=E-u(E,T),L=k-u(k,T);for(let j=0;j<Math.abs(M-L);j++){const P=f(E,k)==="A"?-1:1,$=T.buffer.lines.get(M+P*j);$!=null&&$.isWrapped&&R++}return R}(v,p,m);return _(w,x(f(v,p),y))}function u(v,p){let m=0,y=p.buffer.lines.get(v),b=y==null?void 0:y.isWrapped;for(;b&&v>=0&&v<p.rows;)m++,y=p.buffer.lines.get(--v),b=y==null?void 0:y.isWrapped;return m}function f(v,p){return v>p?"A":"B"}function g(v,p,m,y,b,S){let w=v,E=p,k="";for(;w!==m||E!==y;)w+=b?1:-1,b&&w>S.cols-1?(k+=S.buffer.translateBufferLineToString(E,!1,v,w),w=0,v=0,E++):!b&&w<0&&(k+=S.buffer.translateBufferLineToString(E,!1,0,v+1),w=S.cols-1,v=w,E--);return k+S.buffer.translateBufferLineToString(E,!1,v,w)}function x(v,p){const m=p?"O":"[";return c.C0.ESC+m+v}function _(v,p){v=Math.floor(v);let m="";for(let y=0;y<v;y++)m+=p;return m}o.moveToCellSequence=function(v,p,m,y){const b=m.buffer.x,S=m.buffer.y;if(!m.buffer.hasScrollback)return function(k,T,R,M,L,j){return d(T,M,L,j).length===0?"":_(g(k,T,k,T-u(T,L),!1,L).length,x("D",j))}(b,S,0,p,m,y)+d(S,p,m,y)+function(k,T,R,M,L,j){let P;P=d(T,M,L,j).length>0?M-u(M,L):T;const $=M,F=function(W,I,A,D,H,V){let U;return U=d(A,D,H,V).length>0?D-u(D,H):I,W<A&&U<=D||W>=A&&U<D?"C":"D"}(k,T,R,M,L,j);return _(g(k,P,R,$,F==="C",L).length,x(F,j))}(b,S,v,p,m,y);let w;if(S===p)return w=b>v?"D":"C",_(Math.abs(b-v),x(w,y));w=S>p?"D":"C";const E=Math.abs(S-p);return _(function(k,T){return T.cols-k}(S>p?v:b,m)+(E-1)*m.cols+1+((S>p?b:v)-1),x(w,y))}},1296:function(a,o,l){var c=this&&this.__decorate||function(j,P,$,F){var W,I=arguments.length,A=I<3?P:F===null?F=Object.getOwnPropertyDescriptor(P,$):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(j,P,$,F);else for(var D=j.length-1;D>=0;D--)(W=j[D])&&(A=(I<3?W(A):I>3?W(P,$,A):W(P,$))||A);return I>3&&A&&Object.defineProperty(P,$,A),A},d=this&&this.__param||function(j,P){return function($,F){P($,F,j)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const u=l(3787),f=l(2550),g=l(2223),x=l(6171),_=l(6052),v=l(4725),p=l(8055),m=l(8460),y=l(844),b=l(2585),S="xterm-dom-renderer-owner-",w="xterm-rows",E="xterm-fg-",k="xterm-bg-",T="xterm-focus",R="xterm-selection";let M=1,L=o.DomRenderer=class extends y.Disposable{constructor(j,P,$,F,W,I,A,D,H,V,U,G,ee){super(),this._terminal=j,this._document=P,this._element=$,this._screenElement=F,this._viewportElement=W,this._helperContainer=I,this._linkifier2=A,this._charSizeService=H,this._optionsService=V,this._bufferService=U,this._coreBrowserService=G,this._themeService=ee,this._terminalClass=M++,this._rowElements=[],this._selectionRenderModel=(0,_.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new m.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(w),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(R),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,x.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(Z=>this._injectCss(Z))),this._injectCss(this._themeService.colors),this._rowFactory=D.createInstance(u.DomRendererRowFactory,document),this._element.classList.add(S+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(Z=>this._handleLinkHover(Z))),this.register(this._linkifier2.onHideLinkUnderline(Z=>this._handleLinkLeave(Z))),this.register((0,y.toDisposable)(()=>{this._element.classList.remove(S+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 j=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*j,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*j),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/j),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/j),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 $ of this._rowElements)$.style.width=`${this.dimensions.css.canvas.width}px`,$.style.height=`${this.dimensions.css.cell.height}px`,$.style.lineHeight=`${this.dimensions.css.cell.height}px`,$.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const P=`${this._terminalSelector} .${w} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=P,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(j){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let P=`${this._terminalSelector} .${w} { color: ${j.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;P+=`${this._terminalSelector} .${w} .xterm-dim { color: ${p.color.multiplyOpacity(j.foreground,.5).css};}`,P+=`${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 $=`blink_underline_${this._terminalClass}`,F=`blink_bar_${this._terminalClass}`,W=`blink_block_${this._terminalClass}`;P+=`@keyframes ${$} { 50% {  border-bottom-style: hidden; }}`,P+=`@keyframes ${F} { 50% {  box-shadow: none; }}`,P+=`@keyframes ${W} { 0% {  background-color: ${j.cursor.css};  color: ${j.cursorAccent.css}; } 50% {  background-color: inherit;  color: ${j.cursor.css}; }}`,P+=`${this._terminalSelector} .${w}.${T} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${$} 1s step-end infinite;}${this._terminalSelector} .${w}.${T} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${F} 1s step-end infinite;}${this._terminalSelector} .${w}.${T} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${W} 1s step-end infinite;}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-block { background-color: ${j.cursor.css}; color: ${j.cursorAccent.css};}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${j.cursor.css} !important; color: ${j.cursorAccent.css} !important;}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${j.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${j.cursor.css} inset;}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${j.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,P+=`${this._terminalSelector} .${R} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${R} div { position: absolute; background-color: ${j.selectionBackgroundOpaque.css};}${this._terminalSelector} .${R} div { position: absolute; background-color: ${j.selectionInactiveBackgroundOpaque.css};}`;for(const[I,A]of j.ansi.entries())P+=`${this._terminalSelector} .${E}${I} { color: ${A.css}; }${this._terminalSelector} .${E}${I}.xterm-dim { color: ${p.color.multiplyOpacity(A,.5).css}; }${this._terminalSelector} .${k}${I} { background-color: ${A.css}; }`;P+=`${this._terminalSelector} .${E}${g.INVERTED_DEFAULT_COLOR} { color: ${p.color.opaque(j.background).css}; }${this._terminalSelector} .${E}${g.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${p.color.multiplyOpacity(p.color.opaque(j.background),.5).css}; }${this._terminalSelector} .${k}${g.INVERTED_DEFAULT_COLOR} { background-color: ${j.foreground.css}; }`,this._themeStyleElement.textContent=P}_setDefaultSpacing(){const j=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${j}px`,this._rowFactory.defaultSpacing=j}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(j,P){for(let $=this._rowElements.length;$<=P;$++){const F=this._document.createElement("div");this._rowContainer.appendChild(F),this._rowElements.push(F)}for(;this._rowElements.length>P;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(j,P){this._refreshRowElements(j,P),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(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(j,P,$){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(j,P,$),this.renderRows(0,this._bufferService.rows-1),!j||!P)return;this._selectionRenderModel.update(this._terminal,j,P,$);const F=this._selectionRenderModel.viewportStartRow,W=this._selectionRenderModel.viewportEndRow,I=this._selectionRenderModel.viewportCappedStartRow,A=this._selectionRenderModel.viewportCappedEndRow;if(I>=this._bufferService.rows||A<0)return;const D=this._document.createDocumentFragment();if($){const H=j[0]>P[0];D.appendChild(this._createSelectionElement(I,H?P[0]:j[0],H?j[0]:P[0],A-I+1))}else{const H=F===I?j[0]:0,V=I===W?P[0]:this._bufferService.cols;D.appendChild(this._createSelectionElement(I,H,V));const U=A-I-1;if(D.appendChild(this._createSelectionElement(I+1,0,this._bufferService.cols,U)),I!==A){const G=W===A?P[0]:this._bufferService.cols;D.appendChild(this._createSelectionElement(A,0,G))}}this._selectionContainer.appendChild(D)}_createSelectionElement(j,P,$,F=1){const W=this._document.createElement("div"),I=P*this.dimensions.css.cell.width;let A=this.dimensions.css.cell.width*($-P);return I+A>this.dimensions.css.canvas.width&&(A=this.dimensions.css.canvas.width-I),W.style.height=F*this.dimensions.css.cell.height+"px",W.style.top=j*this.dimensions.css.cell.height+"px",W.style.left=`${I}px`,W.style.width=`${A}px`,W}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 j of this._rowElements)j.replaceChildren()}renderRows(j,P){const $=this._bufferService.buffer,F=$.ybase+$.y,W=Math.min($.x,this._bufferService.cols-1),I=this._optionsService.rawOptions.cursorBlink,A=this._optionsService.rawOptions.cursorStyle,D=this._optionsService.rawOptions.cursorInactiveStyle;for(let H=j;H<=P;H++){const V=H+$.ydisp,U=this._rowElements[H],G=$.lines.get(V);if(!U||!G)break;U.replaceChildren(...this._rowFactory.createRow(G,V,V===F,A,D,W,I,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${S}${this._terminalClass}`}_handleLinkHover(j){this._setCellUnderline(j.x1,j.x2,j.y1,j.y2,j.cols,!0)}_handleLinkLeave(j){this._setCellUnderline(j.x1,j.x2,j.y1,j.y2,j.cols,!1)}_setCellUnderline(j,P,$,F,W,I){$<0&&(j=0),F<0&&(P=0);const A=this._bufferService.rows-1;$=Math.max(Math.min($,A),0),F=Math.max(Math.min(F,A),0),W=Math.min(W,this._bufferService.cols);const D=this._bufferService.buffer,H=D.ybase+D.y,V=Math.min(D.x,W-1),U=this._optionsService.rawOptions.cursorBlink,G=this._optionsService.rawOptions.cursorStyle,ee=this._optionsService.rawOptions.cursorInactiveStyle;for(let Z=$;Z<=F;++Z){const q=Z+D.ydisp,B=this._rowElements[Z],O=D.lines.get(q);if(!B||!O)break;B.replaceChildren(...this._rowFactory.createRow(O,q,q===H,G,ee,V,U,this.dimensions.css.cell.width,this._widthCache,I?Z===$?j:0:-1,I?(Z===F?P:W)-1:-1))}}};o.DomRenderer=L=c([d(7,b.IInstantiationService),d(8,v.ICharSizeService),d(9,b.IOptionsService),d(10,b.IBufferService),d(11,v.ICoreBrowserService),d(12,v.IThemeService)],L)},3787:function(a,o,l){var c=this&&this.__decorate||function(w,E,k,T){var R,M=arguments.length,L=M<3?E:T===null?T=Object.getOwnPropertyDescriptor(E,k):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(w,E,k,T);else for(var j=w.length-1;j>=0;j--)(R=w[j])&&(L=(M<3?R(L):M>3?R(E,k,L):R(E,k))||L);return M>3&&L&&Object.defineProperty(E,k,L),L},d=this&&this.__param||function(w,E){return function(k,T){E(k,T,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const u=l(2223),f=l(643),g=l(511),x=l(2585),_=l(8055),v=l(4725),p=l(4269),m=l(6171),y=l(3734);let b=o.DomRendererRowFactory=class{constructor(w,E,k,T,R,M,L){this._document=w,this._characterJoinerService=E,this._optionsService=k,this._coreBrowserService=T,this._coreService=R,this._decorationService=M,this._themeService=L,this._workCell=new g.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(w,E,k){this._selectionStart=w,this._selectionEnd=E,this._columnSelectMode=k}createRow(w,E,k,T,R,M,L,j,P,$,F){const W=[],I=this._characterJoinerService.getJoinedCharacters(E),A=this._themeService.colors;let D,H=w.getNoBgTrimmedLength();k&&H<M+1&&(H=M+1);let V=0,U="",G=0,ee=0,Z=0,q=!1,B=0,O=!1,z=0;const Y=[],N=$!==-1&&F!==-1;for(let J=0;J<H;J++){w.loadCell(J,this._workCell);let K=this._workCell.getWidth();if(K===0)continue;let te=!1,oe=J,ae=this._workCell;if(I.length>0&&J===I[0][0]){te=!0;const xe=I.shift();ae=new p.JoinedCellData(this._workCell,w.translateToString(!0,xe[0],xe[1]),xe[1]-xe[0]),oe=xe[1]-1,K=ae.getWidth()}const _e=this._isCellInSelection(J,E),Se=k&&J===M,ge=N&&J>=$&&J<=F;let we=!1;this._decorationService.forEachDecorationAtCell(J,E,void 0,xe=>{we=!0});let ce=ae.getChars()||f.WHITESPACE_CELL_CHAR;if(ce===" "&&(ae.isUnderline()||ae.isOverline())&&(ce=" "),z=K*j-P.get(ce,ae.isBold(),ae.isItalic()),D){if(V&&(_e&&O||!_e&&!O&&ae.bg===G)&&(_e&&O&&A.selectionForeground||ae.fg===ee)&&ae.extended.ext===Z&&ge===q&&z===B&&!Se&&!te&&!we){ae.isInvisible()?U+=f.WHITESPACE_CELL_CHAR:U+=ce,V++;continue}V&&(D.textContent=U),D=this._document.createElement("span"),V=0,U=""}else D=this._document.createElement("span");if(G=ae.bg,ee=ae.fg,Z=ae.extended.ext,q=ge,B=z,O=_e,te&&M>=J&&M<=oe&&(M=J),!this._coreService.isCursorHidden&&Se&&this._coreService.isCursorInitialized){if(Y.push("xterm-cursor"),this._coreBrowserService.isFocused)L&&Y.push("xterm-cursor-blink"),Y.push(T==="bar"?"xterm-cursor-bar":T==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(R)switch(R){case"outline":Y.push("xterm-cursor-outline");break;case"block":Y.push("xterm-cursor-block");break;case"bar":Y.push("xterm-cursor-bar");break;case"underline":Y.push("xterm-cursor-underline")}}if(ae.isBold()&&Y.push("xterm-bold"),ae.isItalic()&&Y.push("xterm-italic"),ae.isDim()&&Y.push("xterm-dim"),U=ae.isInvisible()?f.WHITESPACE_CELL_CHAR:ae.getChars()||f.WHITESPACE_CELL_CHAR,ae.isUnderline()&&(Y.push(`xterm-underline-${ae.extended.underlineStyle}`),U===" "&&(U=" "),!ae.isUnderlineColorDefault()))if(ae.isUnderlineColorRGB())D.style.textDecorationColor=`rgb(${y.AttributeData.toColorRGB(ae.getUnderlineColor()).join(",")})`;else{let xe=ae.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ae.isBold()&&xe<8&&(xe+=8),D.style.textDecorationColor=A.ansi[xe].css}ae.isOverline()&&(Y.push("xterm-overline"),U===" "&&(U=" ")),ae.isStrikethrough()&&Y.push("xterm-strikethrough"),ge&&(D.style.textDecoration="underline");let re=ae.getFgColor(),le=ae.getFgColorMode(),X=ae.getBgColor(),ne=ae.getBgColorMode();const ue=!!ae.isInverse();if(ue){const xe=re;re=X,X=xe;const Xe=le;le=ne,ne=Xe}let de,ve,Te,be=!1;switch(this._decorationService.forEachDecorationAtCell(J,E,void 0,xe=>{xe.options.layer!=="top"&&be||(xe.backgroundColorRGB&&(ne=50331648,X=xe.backgroundColorRGB.rgba>>8&16777215,de=xe.backgroundColorRGB),xe.foregroundColorRGB&&(le=50331648,re=xe.foregroundColorRGB.rgba>>8&16777215,ve=xe.foregroundColorRGB),be=xe.options.layer==="top")}),!be&&_e&&(de=this._coreBrowserService.isFocused?A.selectionBackgroundOpaque:A.selectionInactiveBackgroundOpaque,X=de.rgba>>8&16777215,ne=50331648,be=!0,A.selectionForeground&&(le=50331648,re=A.selectionForeground.rgba>>8&16777215,ve=A.selectionForeground)),be&&Y.push("xterm-decoration-top"),ne){case 16777216:case 33554432:Te=A.ansi[X],Y.push(`xterm-bg-${X}`);break;case 50331648:Te=_.channels.toColor(X>>16,X>>8&255,255&X),this._addStyle(D,`background-color:#${S((X>>>0).toString(16),"0",6)}`);break;default:ue?(Te=A.foreground,Y.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):Te=A.background}switch(de||ae.isDim()&&(de=_.color.multiplyOpacity(Te,.5)),le){case 16777216:case 33554432:ae.isBold()&&re<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(re+=8),this._applyMinimumContrast(D,Te,A.ansi[re],ae,de,void 0)||Y.push(`xterm-fg-${re}`);break;case 50331648:const xe=_.channels.toColor(re>>16&255,re>>8&255,255&re);this._applyMinimumContrast(D,Te,xe,ae,de,ve)||this._addStyle(D,`color:#${S(re.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(D,Te,A.foreground,ae,de,ve)||ue&&Y.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}Y.length&&(D.className=Y.join(" "),Y.length=0),Se||te||we?D.textContent=U:V++,z!==this.defaultSpacing&&(D.style.letterSpacing=`${z}px`),W.push(D),J=oe}return D&&V&&(D.textContent=U),W}_applyMinimumContrast(w,E,k,T,R,M){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,m.treatGlyphAsBackgroundColor)(T.getCode()))return!1;const L=this._getContrastCache(T);let j;if(R||M||(j=L.getColor(E.rgba,k.rgba)),j===void 0){const P=this._optionsService.rawOptions.minimumContrastRatio/(T.isDim()?2:1);j=_.color.ensureContrastRatio(R||E,M||k,P),L.setColor((R||E).rgba,(M||k).rgba,j??null)}return!!j&&(this._addStyle(w,`color:${j.css}`),!0)}_getContrastCache(w){return w.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(w,E){w.setAttribute("style",`${w.getAttribute("style")||""}${E};`)}_isCellInSelection(w,E){const k=this._selectionStart,T=this._selectionEnd;return!(!k||!T)&&(this._columnSelectMode?k[0]<=T[0]?w>=k[0]&&E>=k[1]&&w<T[0]&&E<=T[1]:w<k[0]&&E>=k[1]&&w>=T[0]&&E<=T[1]:E>k[1]&&E<T[1]||k[1]===T[1]&&E===k[1]&&w>=k[0]&&w<T[0]||k[1]<T[1]&&E===T[1]&&w<T[0]||k[1]<T[1]&&E===k[1]&&w>=k[0])}};function S(w,E,k){for(;w.length<k;)w=E+w;return w}o.DomRendererRowFactory=b=c([d(1,v.ICharacterJoinerService),d(2,x.IOptionsService),d(3,v.ICoreBrowserService),d(4,x.ICoreService),d(5,x.IDecorationService),d(6,v.IThemeService)],b)},2550:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(l,c){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=l.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const d=l.createElement("span");d.classList.add("xterm-char-measure-element");const u=l.createElement("span");u.classList.add("xterm-char-measure-element"),u.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=[d,u,f,g],this._container.appendChild(d),this._container.appendChild(u),this._container.appendChild(f),this._container.appendChild(g),c.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(l,c,d,u){l===this._font&&c===this._fontSize&&d===this._weight&&u===this._weightBold||(this._font=l,this._fontSize=c,this._weight=d,this._weightBold=u,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${d}`,this._measureElements[1].style.fontWeight=`${u}`,this._measureElements[2].style.fontWeight=`${d}`,this._measureElements[3].style.fontWeight=`${u}`,this.clear())}get(l,c,d){let u=0;if(!c&&!d&&l.length===1&&(u=l.charCodeAt(0))<256){if(this._flat[u]!==-9999)return this._flat[u];const x=this._measure(l,0);return x>0&&(this._flat[u]=x),x}let f=l;c&&(f+="B"),d&&(f+="I");let g=this._holey.get(f);if(g===void 0){let x=0;c&&(x|=1),d&&(x|=2),g=this._measure(l,x),g>0&&this._holey.set(f,g)}return g}_measure(l,c){const d=this._measureElements[c];return d.textContent=l.repeat(32),d.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 c=l(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},6171:(a,o)=>{function l(d){return 57508<=d&&d<=57558}function c(d){return d>=128512&&d<=128591||d>=127744&&d<=128511||d>=128640&&d<=128767||d>=9728&&d<=9983||d>=9984&&d<=10175||d>=65024&&d<=65039||d>=129280&&d<=129535||d>=127462&&d<=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(d){if(!d)throw new Error("value must not be falsy");return d},o.isPowerlineGlyph=l,o.isRestrictedPowerlineGlyph=function(d){return 57520<=d&&d<=57527},o.isEmoji=c,o.allowRescaling=function(d,u,f,g){return u===1&&f>Math.ceil(1.5*g)&&d!==void 0&&d>255&&!c(d)&&!l(d)&&!function(x){return 57344<=x&&x<=63743}(d)},o.treatGlyphAsBackgroundColor=function(d){return l(d)||function(u){return 9472<=u&&u<=9631}(d)},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(d,u,f=0){return(d-(2*Math.round(u)-f))%(2*Math.round(u))}},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(d,u,f,g=!1){if(this.selectionStart=u,this.selectionEnd=f,!u||!f||u[0]===f[0]&&u[1]===f[1])return void this.clear();const x=d.buffers.active.ydisp,_=u[1]-x,v=f[1]-x,p=Math.max(_,0),m=Math.min(v,d.rows-1);p>=d.rows||m<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=g,this.viewportStartRow=_,this.viewportEndRow=v,this.viewportCappedStartRow=p,this.viewportCappedEndRow=m,this.startCol=u[0],this.endCol=f[0])}isCellSelected(d,u,f){return!!this.hasSelection&&(f-=d.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&f>=this.viewportCappedStartRow&&u<this.endCol&&f<=this.viewportCappedEndRow:u<this.startCol&&f>=this.viewportCappedStartRow&&u>=this.endCol&&f<=this.viewportCappedEndRow:f>this.viewportStartRow&&f<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&f===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&f===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&f===this.viewportStartRow&&u>=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,c=this.selectionEnd;return!(!l||!c)&&(l[1]>c[1]||l[1]===c[1]&&l[0]>c[0])}handleTrim(l){return this.selectionStart&&(this.selectionStart[1]-=l),this.selectionEnd&&(this.selectionEnd[1]-=l),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(a,o,l){var c=this&&this.__decorate||function(m,y,b,S){var w,E=arguments.length,k=E<3?y:S===null?S=Object.getOwnPropertyDescriptor(y,b):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(m,y,b,S);else for(var T=m.length-1;T>=0;T--)(w=m[T])&&(k=(E<3?w(k):E>3?w(y,b,k):w(y,b))||k);return E>3&&k&&Object.defineProperty(y,b,k),k},d=this&&this.__param||function(m,y){return function(b,S){y(b,S,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const u=l(2585),f=l(8460),g=l(844);let x=o.CharSizeService=class extends g.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(m,y,b){super(),this._optionsService=b,this.width=0,this.height=0,this._onCharSizeChange=this.register(new f.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new p(this._optionsService))}catch{this._measureStrategy=this.register(new v(m,y,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const m=this._measureStrategy.measure();m.width===this.width&&m.height===this.height||(this.width=m.width,this.height=m.height,this._onCharSizeChange.fire())}};o.CharSizeService=x=c([d(2,u.IOptionsService)],x);class _ extends g.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(y,b){y!==void 0&&y>0&&b!==void 0&&b>0&&(this._result.width=y,this._result.height=b)}}class v extends _{constructor(y,b,S){super(),this._document=y,this._parentElement=b,this._optionsService=S,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 p extends _{constructor(y){super(),this._optionsService=y,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const b=this._ctx.measureText("W");if(!("width"in b&&"fontBoundingBoxAscent"in b&&"fontBoundingBoxDescent"in b))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 c=this&&this.__decorate||function(p,m,y,b){var S,w=arguments.length,E=w<3?m:b===null?b=Object.getOwnPropertyDescriptor(m,y):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(p,m,y,b);else for(var k=p.length-1;k>=0;k--)(S=p[k])&&(E=(w<3?S(E):w>3?S(m,y,E):S(m,y))||E);return w>3&&E&&Object.defineProperty(m,y,E),E},d=this&&this.__param||function(p,m){return function(y,b){m(y,b,p)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const u=l(3734),f=l(643),g=l(511),x=l(2585);class _ extends u.AttributeData{constructor(m,y,b){super(),this.content=0,this.combinedData="",this.fg=m.fg,this.bg=m.bg,this.combinedData=y,this._width=b}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(m){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=_;let v=o.CharacterJoinerService=class hO{constructor(m){this._bufferService=m,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new g.CellData}register(m){const y={id:this._nextCharacterJoinerId++,handler:m};return this._characterJoiners.push(y),y.id}deregister(m){for(let y=0;y<this._characterJoiners.length;y++)if(this._characterJoiners[y].id===m)return this._characterJoiners.splice(y,1),!0;return!1}getJoinedCharacters(m){if(this._characterJoiners.length===0)return[];const y=this._bufferService.buffer.lines.get(m);if(!y||y.length===0)return[];const b=[],S=y.translateToString(!0);let w=0,E=0,k=0,T=y.getFg(0),R=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!==R){if(M-w>1){const L=this._getJoinedRanges(S,k,E,y,w);for(let j=0;j<L.length;j++)b.push(L[j])}w=M,k=E,T=this._workCell.fg,R=this._workCell.bg}E+=this._workCell.getChars().length||f.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-w>1){const M=this._getJoinedRanges(S,k,E,y,w);for(let L=0;L<M.length;L++)b.push(M[L])}return b}_getJoinedRanges(m,y,b,S,w){const E=m.substring(y,b);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 R=this._characterJoiners[T].handler(E);for(let M=0;M<R.length;M++)hO._mergeRanges(k,R[M])}catch(R){console.error(R)}return this._stringRangesToCellRanges(k,S,w),k}_stringRangesToCellRanges(m,y,b){let S=0,w=!1,E=0,k=m[S];if(k){for(let T=b;T<this._bufferService.cols;T++){const R=y.getWidth(T),M=y.getString(T).length||f.WHITESPACE_CELL_CHAR.length;if(R!==0){if(!w&&k[0]<=E&&(k[0]=T,w=!0),k[1]<=E){if(k[1]=T,k=m[++S],!k)break;k[0]<=E?(k[0]=T,w=!0):w=!1}E+=M}}k&&(k[1]=this._bufferService.cols)}}static _mergeRanges(m,y){let b=!1;for(let S=0;S<m.length;S++){const w=m[S];if(b){if(y[1]<=w[0])return m[S-1][1]=y[1],m;if(y[1]<=w[1])return m[S-1][1]=Math.max(y[1],w[1]),m.splice(S,1),m;m.splice(S,1),S--}else{if(y[1]<=w[0])return m.splice(S,0,y),m;if(y[1]<=w[1])return w[0]=Math.min(y[0],w[0]),m;y[0]<w[1]&&(w[0]=Math.min(y[0],w[0]),b=!0)}}return b?m[m.length-1][1]=y[1]:m.push(y),m}};o.CharacterJoinerService=v=c([d(0,x.IBufferService)],v)},5114:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const c=l(844),d=l(8460),u=l(3656);class f extends c.Disposable{constructor(_,v,p){super(),this._textarea=_,this._window=v,this.mainDocument=p,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new g(this._window),this._onDprChange=this.register(new d.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new d.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange(m=>this._screenDprMonitor.setWindow(m))),this.register((0,d.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",()=>this._isFocused=!0),this._textarea.addEventListener("blur",()=>this._isFocused=!1)}get window(){return this._window}set window(_){this._window!==_&&(this._window=_,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}}o.CoreBrowserService=f;class g extends c.Disposable{constructor(_){super(),this._parentWindow=_,this._windowResizeListener=this.register(new c.MutableDisposable),this._onDprChange=this.register(new d.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,c.toDisposable)(()=>this.clearListener()))}setWindow(_){this._parentWindow=_,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,u.addDisposableDomListener)(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var _;this._outerListener&&((_=this._resolutionMediaMatchList)==null||_.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const c=l(844);class d extends c.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,c.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=d},8934:function(a,o,l){var c=this&&this.__decorate||function(x,_,v,p){var m,y=arguments.length,b=y<3?_:p===null?p=Object.getOwnPropertyDescriptor(_,v):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(x,_,v,p);else for(var S=x.length-1;S>=0;S--)(m=x[S])&&(b=(y<3?m(b):y>3?m(_,v,b):m(_,v))||b);return y>3&&b&&Object.defineProperty(_,v,b),b},d=this&&this.__param||function(x,_){return function(v,p){_(v,p,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const u=l(4725),f=l(9806);let g=o.MouseService=class{constructor(x,_){this._renderService=x,this._charSizeService=_}getCoords(x,_,v,p,m){return(0,f.getCoords)(window,x,_,v,p,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,m)}getMouseReportCoords(x,_){const v=(0,f.getCoordsRelativeToElement)(window,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=c([d(0,u.IRenderService),d(1,u.ICharSizeService)],g)},3230:function(a,o,l){var c=this&&this.__decorate||function(m,y,b,S){var w,E=arguments.length,k=E<3?y:S===null?S=Object.getOwnPropertyDescriptor(y,b):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(m,y,b,S);else for(var T=m.length-1;T>=0;T--)(w=m[T])&&(k=(E<3?w(k):E>3?w(y,b,k):w(y,b))||k);return E>3&&k&&Object.defineProperty(y,b,k),k},d=this&&this.__param||function(m,y){return function(b,S){y(b,S,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const u=l(6193),f=l(4725),g=l(8460),x=l(844),_=l(7226),v=l(2585);let p=o.RenderService=class extends x.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(m,y,b,S,w,E,k,T){super(),this._rowCount=m,this._charSizeService=S,this._renderer=this.register(new x.MutableDisposable),this._pausedResizeTask=new _.DebouncedIdleTask,this._observerDisposable=this.register(new x.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new g.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new g.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new g.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new g.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new u.RenderDebouncer((R,M)=>this._renderRows(R,M),k),this.register(this._renderDebouncer),this.register(k.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(E.onResize(()=>this._fullRefresh())),this.register(E.buffers.onBufferActivate(()=>{var R;return(R=this._renderer.value)==null?void 0:R.clear()})),this.register(b.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(w.onDecorationRegistered(()=>this._fullRefresh())),this.register(w.onDecorationRemoved(()=>this._fullRefresh())),this.register(b.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(E.cols,E.rows),this._fullRefresh()})),this.register(b.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(R=>this._registerIntersectionObserver(R,y)))}_registerIntersectionObserver(m,y){if("IntersectionObserver"in m){const b=new m.IntersectionObserver(S=>this._handleIntersectionChange(S[S.length-1]),{threshold:0});b.observe(y),this._observerDisposable.value=(0,x.toDisposable)(()=>b.disconnect())}}_handleIntersectionChange(m){this._isPaused=m.isIntersecting===void 0?m.intersectionRatio===0:!m.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(m,y,b=!1){this._isPaused?this._needsFullRefresh=!0:(b||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(m,y,this._rowCount))}_renderRows(m,y){this._renderer.value&&(m=Math.min(m,this._rowCount-1),y=Math.min(y,this._rowCount-1),this._renderer.value.renderRows(m,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:m,end:y}),this._onRender.fire({start:m,end:y}),this._isNextRenderRedrawOnly=!0)}resize(m,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(m){this._renderer.value=m,this._renderer.value&&(this._renderer.value.onRequestRedraw(y=>this.refreshRows(y.start,y.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(m){return this._renderDebouncer.addRefreshCallback(m)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var m,y;this._renderer.value&&((y=(m=this._renderer.value).clearTextureAtlas)==null||y.call(m),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(m,y){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var b;return(b=this._renderer.value)==null?void 0:b.handleResize(m,y)}):this._renderer.value.handleResize(m,y),this._fullRefresh())}handleCharSizeChanged(){var m;(m=this._renderer.value)==null||m.handleCharSizeChanged()}handleBlur(){var m;(m=this._renderer.value)==null||m.handleBlur()}handleFocus(){var m;(m=this._renderer.value)==null||m.handleFocus()}handleSelectionChanged(m,y,b){var S;this._selectionState.start=m,this._selectionState.end=y,this._selectionState.columnSelectMode=b,(S=this._renderer.value)==null||S.handleSelectionChanged(m,y,b)}handleCursorMove(){var m;(m=this._renderer.value)==null||m.handleCursorMove()}clear(){var m;(m=this._renderer.value)==null||m.clear()}};o.RenderService=p=c([d(2,v.IOptionsService),d(3,f.ICharSizeService),d(4,v.IDecorationService),d(5,v.IBufferService),d(6,f.ICoreBrowserService),d(7,f.IThemeService)],p)},9312:function(a,o,l){var c=this&&this.__decorate||function(k,T,R,M){var L,j=arguments.length,P=j<3?T:M===null?M=Object.getOwnPropertyDescriptor(T,R):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(k,T,R,M);else for(var $=k.length-1;$>=0;$--)(L=k[$])&&(P=(j<3?L(P):j>3?L(T,R,P):L(T,R))||P);return j>3&&P&&Object.defineProperty(T,R,P),P},d=this&&this.__param||function(k,T){return function(R,M){T(R,M,k)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const u=l(9806),f=l(9504),g=l(456),x=l(4725),_=l(8460),v=l(844),p=l(6114),m=l(4841),y=l(511),b=l(2585),S=" ",w=new RegExp(S,"g");let E=o.SelectionService=class extends v.Disposable{constructor(k,T,R,M,L,j,P,$,F){super(),this._element=k,this._screenElement=T,this._linkifier=R,this._bufferService=M,this._coreService=L,this._mouseService=j,this._optionsService=P,this._renderService=$,this._coreBrowserService=F,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 _.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new _.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new _.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new _.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=W=>this._handleMouseMove(W),this._mouseUpListener=W=>this._handleMouseUp(W),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(W=>this._handleTrim(W)),this.register(this._bufferService.buffers.onBufferActivate(W=>this._handleBufferActivate(W))),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 R=this._bufferService.buffer,M=[];if(this._activeSelectionMode===3){if(k[0]===T[0])return"";const L=k[0]<T[0]?k[0]:T[0],j=k[0]<T[0]?T[0]:k[0];for(let P=k[1];P<=T[1];P++){const $=R.translateBufferLineToString(P,!0,L,j);M.push($)}}else{const L=k[1]===T[1]?T[0]:void 0;M.push(R.translateBufferLineToString(k[1],!0,k[0],L));for(let j=k[1]+1;j<=T[1]-1;j++){const P=R.lines.get(j),$=R.translateBufferLineToString(j,!0);P!=null&&P.isWrapped?M[M.length-1]+=$:M.push($)}if(k[1]!==T[1]){const j=R.lines.get(T[1]),P=R.translateBufferLineToString(T[1],!0,0,T[0]);j&&j.isWrapped?M[M.length-1]+=P:M.push(P)}}return M.map(L=>L.replace(w," ")).join(p.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())),p.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),R=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!!(R&&M&&T)&&this._areCoordsInSelection(T,R,M)}isCellInSelection(k,T){const R=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!(!R||!M)&&this._areCoordsInSelection([k,T],R,M)}_areCoordsInSelection(k,T,R){return k[1]>T[1]&&k[1]<R[1]||T[1]===R[1]&&k[1]===T[1]&&k[0]>=T[0]&&k[0]<R[0]||T[1]<R[1]&&k[1]===R[1]&&k[0]<R[0]||T[1]<R[1]&&k[1]===T[1]&&k[0]>=T[0]}_selectWordAtCursor(k,T){var L,j;const R=(j=(L=this._linkifier.currentLink)==null?void 0:L.link)==null?void 0:j.range;if(R)return this._model.selectionStart=[R.start.x-1,R.start.y-1],this._model.selectionStartLength=(0,m.getRangeLength)(R,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,u.getCoordsRelativeToElement)(this._coreBrowserService.window,k,this._screenElement)[1];const R=this._renderService.dimensions.css.canvas.height;return T>=0&&T<=R?0:(T>R&&(T-=R),T=Math.min(Math.max(T,-50),50),T/=50,T/Math.abs(T)+Math.round(14*T))}shouldForceSelection(k){return p.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&&!(p.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 R=this._bufferService.buffer;if(this._model.selectionEnd[1]<R.lines.length){const M=R.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 R=this._mouseService.getCoords(k,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(R&&R[0]!==void 0&&R[1]!==void 0){const M=(0,f.moveToCellSequence)(R[0]-1,R[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,R=!(!k||!T||k[0]===T[0]&&k[1]===T[1]);R?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,R)):this._oldHasSelection&&this._fireOnSelectionChange(k,T,R)}_fireOnSelectionChange(k,T,R){this._oldSelectionStart=k,this._oldSelectionEnd=T,this._oldHasSelection=R,this._onSelectionChange.fire()}_handleBufferActivate(k){this.clearSelection(),this._trimListener.dispose(),this._trimListener=k.activeBuffer.lines.onTrim(T=>this._handleTrim(T))}_convertViewportColToCharacterIndex(k,T){let R=T;for(let M=0;T>=M;M++){const L=k.loadCell(M,this._workCell).getChars().length;this._workCell.getWidth()===0?R--:L>1&&T!==M&&(R+=L-1)}return R}setSelection(k,T,R){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[k,T],this._model.selectionStartLength=R,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(k){this._isClickInSelection(k)||(this._selectWordAtCursor(k,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(k,T,R=!0,M=!0){if(k[0]>=this._bufferService.cols)return;const L=this._bufferService.buffer,j=L.lines.get(k[1]);if(!j)return;const P=L.translateBufferLineToString(k[1],!1);let $=this._convertViewportColToCharacterIndex(j,k[0]),F=$;const W=k[0]-$;let I=0,A=0,D=0,H=0;if(P.charAt($)===" "){for(;$>0&&P.charAt($-1)===" ";)$--;for(;F<P.length&&P.charAt(F+1)===" ";)F++}else{let G=k[0],ee=k[0];j.getWidth(G)===0&&(I++,G--),j.getWidth(ee)===2&&(A++,ee++);const Z=j.getString(ee).length;for(Z>1&&(H+=Z-1,F+=Z-1);G>0&&$>0&&!this._isCharWordSeparator(j.loadCell(G-1,this._workCell));){j.loadCell(G-1,this._workCell);const q=this._workCell.getChars().length;this._workCell.getWidth()===0?(I++,G--):q>1&&(D+=q-1,$-=q-1),$--,G--}for(;ee<j.length&&F+1<P.length&&!this._isCharWordSeparator(j.loadCell(ee+1,this._workCell));){j.loadCell(ee+1,this._workCell);const q=this._workCell.getChars().length;this._workCell.getWidth()===2?(A++,ee++):q>1&&(H+=q-1,F+=q-1),F++,ee++}}F++;let V=$+W-I+D,U=Math.min(this._bufferService.cols,F-$+I+A-D-H);if(T||P.slice($,F).trim()!==""){if(R&&V===0&&j.getCodePoint(0)!==32){const G=L.lines.get(k[1]-1);if(G&&j.isWrapped&&G.getCodePoint(this._bufferService.cols-1)!==32){const ee=this._getWordAt([this._bufferService.cols-1,k[1]-1],!1,!0,!1);if(ee){const Z=this._bufferService.cols-ee.start;V-=Z,U+=Z}}}if(M&&V+U===this._bufferService.cols&&j.getCodePoint(this._bufferService.cols-1)!==32){const G=L.lines.get(k[1]+1);if(G!=null&&G.isWrapped&&G.getCodePoint(0)!==32){const ee=this._getWordAt([0,k[1]+1],!1,!1,!0);ee&&(U+=ee.length)}}return{start:V,length:U}}}_selectWordAt(k,T){const R=this._getWordAt(k,T);if(R){for(;R.start<0;)R.start+=this._bufferService.cols,k[1]--;this._model.selectionStart=[R.start,k[1]],this._model.selectionStartLength=R.length}}_selectToWordAt(k){const T=this._getWordAt(k,!0);if(T){let R=k[1];for(;T.start<0;)T.start+=this._bufferService.cols,R--;if(!this._model.areSelectionValuesReversed())for(;T.start+T.length>this._bufferService.cols;)T.length-=this._bufferService.cols,R++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?T.start:T.start+T.length,R]}}_isCharWordSeparator(k){return k.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(k.getChars())>=0}_selectLineAt(k){const T=this._bufferService.buffer.getWrappedRangeForLine(k),R={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,m.getRangeLength)(R,this._bufferService.cols)}};o.SelectionService=E=c([d(3,b.IBufferService),d(4,b.ICoreService),d(5,x.IMouseService),d(6,b.IOptionsService),d(7,x.IRenderService),d(8,x.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 c=l(8343);o.ICharSizeService=(0,c.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,c.createDecorator)("CoreBrowserService"),o.IMouseService=(0,c.createDecorator)("MouseService"),o.IRenderService=(0,c.createDecorator)("RenderService"),o.ISelectionService=(0,c.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,c.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,c.createDecorator)("ThemeService"),o.ILinkProviderService=(0,c.createDecorator)("LinkProviderService")},6731:function(a,o,l){var c=this&&this.__decorate||function(E,k,T,R){var M,L=arguments.length,j=L<3?k:R===null?R=Object.getOwnPropertyDescriptor(k,T):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(E,k,T,R);else for(var P=E.length-1;P>=0;P--)(M=E[P])&&(j=(L<3?M(j):L>3?M(k,T,j):M(k,T))||j);return L>3&&j&&Object.defineProperty(k,T,j),j},d=this&&this.__param||function(E,k){return function(T,R){k(T,R,E)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const u=l(7239),f=l(8055),g=l(8460),x=l(844),_=l(2585),v=f.css.toColor("#ffffff"),p=f.css.toColor("#000000"),m=f.css.toColor("#ffffff"),y=f.css.toColor("#000000"),b={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 R=k[T/36%6|0],M=k[T/6%6|0],L=k[T%6];E.push({css:f.channels.toCss(R,M,L),rgba:f.channels.toRgba(R,M,L)})}for(let T=0;T<24;T++){const R=8+10*T;E.push({css:f.channels.toCss(R,R,R),rgba:f.channels.toRgba(R,R,R)})}return E})());let S=o.ThemeService=class extends x.Disposable{get colors(){return this._colors}constructor(E){super(),this._optionsService=E,this._contrastCache=new u.ColorContrastCache,this._halfContrastCache=new u.ColorContrastCache,this._onChangeColors=this.register(new g.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:v,background:p,cursor:m,cursorAccent:y,selectionForeground:void 0,selectionBackgroundTransparent:b,selectionBackgroundOpaque:f.color.blend(p,b),selectionInactiveBackgroundTransparent:b,selectionInactiveBackgroundOpaque:f.color.blend(p,b),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=w(E.foreground,v),k.background=w(E.background,p),k.cursor=w(E.cursor,m),k.cursorAccent=w(E.cursorAccent,y),k.selectionBackgroundTransparent=w(E.selectionBackground,b),k.selectionBackgroundOpaque=f.color.blend(k.background,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundTransparent=w(E.selectionInactiveBackground,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundOpaque=f.color.blend(k.background,k.selectionInactiveBackgroundTransparent),k.selectionForeground=E.selectionForeground?w(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]=w(E.black,o.DEFAULT_ANSI_COLORS[0]),k.ansi[1]=w(E.red,o.DEFAULT_ANSI_COLORS[1]),k.ansi[2]=w(E.green,o.DEFAULT_ANSI_COLORS[2]),k.ansi[3]=w(E.yellow,o.DEFAULT_ANSI_COLORS[3]),k.ansi[4]=w(E.blue,o.DEFAULT_ANSI_COLORS[4]),k.ansi[5]=w(E.magenta,o.DEFAULT_ANSI_COLORS[5]),k.ansi[6]=w(E.cyan,o.DEFAULT_ANSI_COLORS[6]),k.ansi[7]=w(E.white,o.DEFAULT_ANSI_COLORS[7]),k.ansi[8]=w(E.brightBlack,o.DEFAULT_ANSI_COLORS[8]),k.ansi[9]=w(E.brightRed,o.DEFAULT_ANSI_COLORS[9]),k.ansi[10]=w(E.brightGreen,o.DEFAULT_ANSI_COLORS[10]),k.ansi[11]=w(E.brightYellow,o.DEFAULT_ANSI_COLORS[11]),k.ansi[12]=w(E.brightBlue,o.DEFAULT_ANSI_COLORS[12]),k.ansi[13]=w(E.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),k.ansi[14]=w(E.brightCyan,o.DEFAULT_ANSI_COLORS[14]),k.ansi[15]=w(E.brightWhite,o.DEFAULT_ANSI_COLORS[15]),E.extendedAnsi){const T=Math.min(k.ansi.length-16,E.extendedAnsi.length);for(let R=0;R<T;R++)k.ansi[R+16]=w(E.extendedAnsi[R],o.DEFAULT_ANSI_COLORS[R+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(E){this._restoreColor(E),this._onChangeColors.fire(this.colors)}_restoreColor(E){if(E!==void 0)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 w(E,k){if(E!==void 0)try{return f.css.toColor(E)}catch{}return k}o.ThemeService=S=c([d(0,_.IOptionsService)],S)},6349:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const c=l(8460),d=l(844);class u extends d.Disposable{constructor(g){super(),this._maxLength=g,this.onDeleteEmitter=this.register(new c.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new c.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new c.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(g){if(this._maxLength===g)return;const x=new Array(g);for(let _=0;_<Math.min(g,this.length);_++)x[_]=this._array[this._getCyclicIndex(_)];this._array=x,this._maxLength=g,this._startIndex=0}get length(){return this._length}set length(g){if(g>this._length)for(let x=this._length;x<g;x++)this._array[x]=void 0;this._length=g}get(g){return this._array[this._getCyclicIndex(g)]}set(g,x){this._array[this._getCyclicIndex(g)]=x}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,x,..._){if(x){for(let v=g;v<this._length-x;v++)this._array[this._getCyclicIndex(v)]=this._array[this._getCyclicIndex(v+x)];this._length-=x,this.onDeleteEmitter.fire({index:g,amount:x})}for(let v=this._length-1;v>=g;v--)this._array[this._getCyclicIndex(v+_.length)]=this._array[this._getCyclicIndex(v)];for(let v=0;v<_.length;v++)this._array[this._getCyclicIndex(g+v)]=_[v];if(_.length&&this.onInsertEmitter.fire({index:g,amount:_.length}),this._length+_.length>this._maxLength){const v=this._length+_.length-this._maxLength;this._startIndex+=v,this._length=this._maxLength,this.onTrimEmitter.fire(v)}else this._length+=_.length}trimStart(g){g>this._length&&(g=this._length),this._startIndex+=g,this._length-=g,this.onTrimEmitter.fire(g)}shiftElements(g,x,_){if(!(x<=0)){if(g<0||g>=this._length)throw new Error("start argument out of range");if(g+_<0)throw new Error("Cannot shift elements in list beyond index 0");if(_>0){for(let p=x-1;p>=0;p--)this.set(g+p+_,this.get(g+p));const v=g+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<x;v++)this.set(g+v+_,this.get(g+v))}}_getCyclicIndex(g){return(this._startIndex+g)%this._maxLength}}o.CircularList=u},1439:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function l(c,d=5){if(typeof c!="object")return c;const u=Array.isArray(c)?[]:{};for(const f in c)u[f]=d<=1?c[f]:c[f]&&l(c[f],d-1);return u}},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,c=0,d=0,u=0;var f,g,x,_,v;function p(y){const b=y.toString(16);return b.length<2?"0"+b:b}function m(y,b){return y<b?(b+.05)/(y+.05):(y+.05)/(b+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},function(y){y.toCss=function(b,S,w,E){return E!==void 0?`#${p(b)}${p(S)}${p(w)}${p(E)}`:`#${p(b)}${p(S)}${p(w)}`},y.toRgba=function(b,S,w,E=255){return(b<<24|S<<16|w<<8|E)>>>0},y.toColor=function(b,S,w,E){return{css:y.toCss(b,S,w,E),rgba:y.toRgba(b,S,w,E)}}}(f||(o.channels=f={})),function(y){function b(S,w){return u=Math.round(255*w),[l,c,d]=v.toChannels(S.rgba),{css:f.toCss(l,c,d,u),rgba:f.toRgba(l,c,d,u)}}y.blend=function(S,w){if(u=(255&w.rgba)/255,u===1)return{css:w.css,rgba:w.rgba};const E=w.rgba>>24&255,k=w.rgba>>16&255,T=w.rgba>>8&255,R=S.rgba>>24&255,M=S.rgba>>16&255,L=S.rgba>>8&255;return l=R+Math.round((E-R)*u),c=M+Math.round((k-M)*u),d=L+Math.round((T-L)*u),{css:f.toCss(l,c,d),rgba:f.toRgba(l,c,d)}},y.isOpaque=function(S){return(255&S.rgba)==255},y.ensureContrastRatio=function(S,w,E){const k=v.ensureContrastRatio(S.rgba,w.rgba,E);if(k)return f.toColor(k>>24&255,k>>16&255,k>>8&255)},y.opaque=function(S){const w=(255|S.rgba)>>>0;return[l,c,d]=v.toChannels(w),{css:f.toCss(l,c,d),rgba:w}},y.opacity=b,y.multiplyOpacity=function(S,w){return u=255&S.rgba,b(S,u*w/255)},y.toColorRGB=function(S){return[S.rgba>>24&255,S.rgba>>16&255,S.rgba>>8&255]}}(g||(o.color=g={})),function(y){let b,S;try{const w=document.createElement("canvas");w.width=1,w.height=1;const E=w.getContext("2d",{willReadFrequently:!0});E&&(b=E,b.globalCompositeOperation="copy",S=b.createLinearGradient(0,0,1,1))}catch{}y.toColor=function(w){if(w.match(/#[\da-f]{3,8}/i))switch(w.length){case 4:return l=parseInt(w.slice(1,2).repeat(2),16),c=parseInt(w.slice(2,3).repeat(2),16),d=parseInt(w.slice(3,4).repeat(2),16),f.toColor(l,c,d);case 5:return l=parseInt(w.slice(1,2).repeat(2),16),c=parseInt(w.slice(2,3).repeat(2),16),d=parseInt(w.slice(3,4).repeat(2),16),u=parseInt(w.slice(4,5).repeat(2),16),f.toColor(l,c,d,u);case 7:return{css:w,rgba:(parseInt(w.slice(1),16)<<8|255)>>>0};case 9:return{css:w,rgba:parseInt(w.slice(1),16)>>>0}}const E=w.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(E)return l=parseInt(E[1]),c=parseInt(E[2]),d=parseInt(E[3]),u=Math.round(255*(E[5]===void 0?1:parseFloat(E[5]))),f.toColor(l,c,d,u);if(!b||!S)throw new Error("css.toColor: Unsupported css format");if(b.fillStyle=S,b.fillStyle=w,typeof b.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(b.fillRect(0,0,1,1),[l,c,d,u]=b.getImageData(0,0,1,1).data,u!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:f.toRgba(l,c,d,u),css:w}}}(x||(o.css=x={})),function(y){function b(S,w,E){const k=S/255,T=w/255,R=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*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))}y.relativeLuminance=function(S){return b(S>>16&255,S>>8&255,255&S)},y.relativeLuminance2=b}(_||(o.rgb=_={})),function(y){function b(w,E,k){const T=w>>24&255,R=w>>16&255,M=w>>8&255;let L=E>>24&255,j=E>>16&255,P=E>>8&255,$=m(_.relativeLuminance2(L,j,P),_.relativeLuminance2(T,R,M));for(;$<k&&(L>0||j>0||P>0);)L-=Math.max(0,Math.ceil(.1*L)),j-=Math.max(0,Math.ceil(.1*j)),P-=Math.max(0,Math.ceil(.1*P)),$=m(_.relativeLuminance2(L,j,P),_.relativeLuminance2(T,R,M));return(L<<24|j<<16|P<<8|255)>>>0}function S(w,E,k){const T=w>>24&255,R=w>>16&255,M=w>>8&255;let L=E>>24&255,j=E>>16&255,P=E>>8&255,$=m(_.relativeLuminance2(L,j,P),_.relativeLuminance2(T,R,M));for(;$<k&&(L<255||j<255||P<255);)L=Math.min(255,L+Math.ceil(.1*(255-L))),j=Math.min(255,j+Math.ceil(.1*(255-j))),P=Math.min(255,P+Math.ceil(.1*(255-P))),$=m(_.relativeLuminance2(L,j,P),_.relativeLuminance2(T,R,M));return(L<<24|j<<16|P<<8|255)>>>0}y.blend=function(w,E){if(u=(255&E)/255,u===1)return E;const k=E>>24&255,T=E>>16&255,R=E>>8&255,M=w>>24&255,L=w>>16&255,j=w>>8&255;return l=M+Math.round((k-M)*u),c=L+Math.round((T-L)*u),d=j+Math.round((R-j)*u),f.toRgba(l,c,d)},y.ensureContrastRatio=function(w,E,k){const T=_.relativeLuminance(w>>8),R=_.relativeLuminance(E>>8);if(m(T,R)<k){if(R<T){const j=b(w,E,k),P=m(T,_.relativeLuminance(j>>8));if(P<k){const $=S(w,E,k);return P>m(T,_.relativeLuminance($>>8))?j:$}return j}const M=S(w,E,k),L=m(T,_.relativeLuminance(M>>8));if(L<k){const j=b(w,E,k);return L>m(T,_.relativeLuminance(j>>8))?M:j}return M}},y.reduceLuminance=b,y.increaseLuminance=S,y.toChannels=function(w){return[w>>24&255,w>>16&255,w>>8&255,255&w]}}(v||(o.rgba=v={})),o.toPaddedHex=p,o.contrastRatio=m},8969:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const c=l(844),d=l(2585),u=l(4348),f=l(7866),g=l(744),x=l(7302),_=l(6975),v=l(8460),p=l(1753),m=l(1480),y=l(7994),b=l(9282),S=l(5435),w=l(5981),E=l(2660);let k=!1;class T extends c.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new v.EventEmitter),this._onScroll.event(M=>{var L;(L=this._onScrollApi)==null||L.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 L in M)this.optionsService.options[L]=M[L]}constructor(M){super(),this._windowsWrappingHeuristics=this.register(new c.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 u.InstantiationService,this.optionsService=this.register(new x.OptionsService(M)),this._instantiationService.setService(d.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(g.BufferService)),this._instantiationService.setService(d.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(f.LogService)),this._instantiationService.setService(d.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(_.CoreService)),this._instantiationService.setService(d.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(p.CoreMouseService)),this._instantiationService.setService(d.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(m.UnicodeService)),this._instantiationService.setService(d.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(y.CharsetService),this._instantiationService.setService(d.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(E.OscLinkService),this._instantiationService.setService(d.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new S.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(L=>{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(L=>{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 w.WriteBuffer((L,j)=>this._inputHandler.parse(L,j))),this.register((0,v.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(M,L){this._writeBuffer.write(M,L)}writeSync(M,L){this._logService.logLevel<=d.LogLevelEnum.WARN&&!k&&(this._logService.warn("writeSync is unreliable and will be removed soon."),k=!0),this._writeBuffer.writeSync(M,L)}input(M,L=!0){this.coreService.triggerDataEvent(M,L)}resize(M,L){isNaN(M)||isNaN(L)||(M=Math.max(M,g.MINIMUM_COLS),L=Math.max(L,g.MINIMUM_ROWS),this._bufferService.resize(M,L))}scroll(M,L=!1){this._bufferService.scroll(M,L)}scrollLines(M,L,j){this._bufferService.scrollLines(M,L,j)}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 L=M-this._bufferService.buffer.ydisp;L!==0&&this.scrollLines(L)}registerEscHandler(M,L){return this._inputHandler.registerEscHandler(M,L)}registerDcsHandler(M,L){return this._inputHandler.registerDcsHandler(M,L)}registerCsiHandler(M,L){return this._inputHandler.registerCsiHandler(M,L)}registerOscHandler(M,L){return this._inputHandler.registerOscHandler(M,L)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let M=!1;const L=this.optionsService.rawOptions.windowsPty;L&&L.buildNumber!==void 0&&L.buildNumber!==void 0?M=L.backend==="conpty"&&L.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(b.updateWindowsModeWrappedState.bind(null,this._bufferService))),M.push(this.registerCsiHandler({final:"H"},()=>((0,b.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,c.toDisposable)(()=>{for(const L of M)L.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 c=0;c<this._listeners.length;c++)if(this._listeners[c]===l)return void this._listeners.splice(c,1)}}})),this._event}fire(l,c){const d=[];for(let u=0;u<this._listeners.length;u++)d.push(this._listeners[u]);for(let u=0;u<d.length;u++)d[u].call(void 0,l,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(l,c){return l(d=>c.fire(d))},o.runAndSubscribe=function(l,c){return c(void 0),l(d=>c(d))}},5435:function(a,o,l){var c=this&&this.__decorate||function(I,A,D,H){var V,U=arguments.length,G=U<3?A:H===null?H=Object.getOwnPropertyDescriptor(A,D):H;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")G=Reflect.decorate(I,A,D,H);else for(var ee=I.length-1;ee>=0;ee--)(V=I[ee])&&(G=(U<3?V(G):U>3?V(A,D,G):V(A,D))||G);return U>3&&G&&Object.defineProperty(A,D,G),G},d=this&&this.__param||function(I,A){return function(D,H){A(D,H,I)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const u=l(2584),f=l(7116),g=l(2015),x=l(844),_=l(482),v=l(8437),p=l(8460),m=l(643),y=l(511),b=l(3734),S=l(2585),w=l(1480),E=l(6242),k=l(6351),T=l(5941),R={"(":0,")":1,"*":2,"+":3,"-":1,".":2},M=131072;function L(I,A){if(I>24)return A.setWinLines||!1;switch(I){case 1:return!!A.restoreWin;case 2:return!!A.minimizeWin;case 3:return!!A.setWinPosition;case 4:return!!A.setWinSizePixels;case 5:return!!A.raiseWin;case 6:return!!A.lowerWin;case 7:return!!A.refreshWin;case 8:return!!A.setWinSizeChars;case 9:return!!A.maximizeWin;case 10:return!!A.fullscreenWin;case 11:return!!A.getWinState;case 13:return!!A.getWinPosition;case 14:return!!A.getWinSizePixels;case 15:return!!A.getScreenSizePixels;case 16:return!!A.getCellSizePixels;case 18:return!!A.getWinSizeChars;case 19:return!!A.getScreenSizeChars;case 20:return!!A.getIconTitle;case 21:return!!A.getWinTitle;case 22:return!!A.pushTitle;case 23:return!!A.popTitle;case 24:return!!A.setWinLines}return!1}var j;(function(I){I[I.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",I[I.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(j||(o.WindowsOptionsReportType=j={}));let P=0;class $ extends x.Disposable{getAttrData(){return this._curAttrData}constructor(A,D,H,V,U,G,ee,Z,q=new g.EscapeSequenceParser){super(),this._bufferService=A,this._charsetService=D,this._coreService=H,this._logService=V,this._optionsService=U,this._oscLinkService=G,this._coreMouseService=ee,this._unicodeService=Z,this._parser=q,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new _.StringToUtf32,this._utf8Decoder=new _.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 p.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new p.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new p.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new p.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new p.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new p.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new p.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new p.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new p.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new p.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new p.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new p.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new p.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new F(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(B=>this._activeBuffer=B.activeBuffer)),this._parser.setCsiHandlerFallback((B,O)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(B),params:O.toArray()})}),this._parser.setEscHandlerFallback(B=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(B)})}),this._parser.setExecuteHandlerFallback(B=>{this._logService.debug("Unknown EXECUTE code: ",{code:B})}),this._parser.setOscHandlerFallback((B,O,z)=>{this._logService.debug("Unknown OSC code: ",{identifier:B,action:O,data:z})}),this._parser.setDcsHandlerFallback((B,O,z)=>{O==="HOOK"&&(z=z.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(B),action:O,payload:z})}),this._parser.setPrintHandler((B,O,z)=>this.print(B,O,z)),this._parser.registerCsiHandler({final:"@"},B=>this.insertChars(B)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},B=>this.scrollLeft(B)),this._parser.registerCsiHandler({final:"A"},B=>this.cursorUp(B)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},B=>this.scrollRight(B)),this._parser.registerCsiHandler({final:"B"},B=>this.cursorDown(B)),this._parser.registerCsiHandler({final:"C"},B=>this.cursorForward(B)),this._parser.registerCsiHandler({final:"D"},B=>this.cursorBackward(B)),this._parser.registerCsiHandler({final:"E"},B=>this.cursorNextLine(B)),this._parser.registerCsiHandler({final:"F"},B=>this.cursorPrecedingLine(B)),this._parser.registerCsiHandler({final:"G"},B=>this.cursorCharAbsolute(B)),this._parser.registerCsiHandler({final:"H"},B=>this.cursorPosition(B)),this._parser.registerCsiHandler({final:"I"},B=>this.cursorForwardTab(B)),this._parser.registerCsiHandler({final:"J"},B=>this.eraseInDisplay(B,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},B=>this.eraseInDisplay(B,!0)),this._parser.registerCsiHandler({final:"K"},B=>this.eraseInLine(B,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},B=>this.eraseInLine(B,!0)),this._parser.registerCsiHandler({final:"L"},B=>this.insertLines(B)),this._parser.registerCsiHandler({final:"M"},B=>this.deleteLines(B)),this._parser.registerCsiHandler({final:"P"},B=>this.deleteChars(B)),this._parser.registerCsiHandler({final:"S"},B=>this.scrollUp(B)),this._parser.registerCsiHandler({final:"T"},B=>this.scrollDown(B)),this._parser.registerCsiHandler({final:"X"},B=>this.eraseChars(B)),this._parser.registerCsiHandler({final:"Z"},B=>this.cursorBackwardTab(B)),this._parser.registerCsiHandler({final:"`"},B=>this.charPosAbsolute(B)),this._parser.registerCsiHandler({final:"a"},B=>this.hPositionRelative(B)),this._parser.registerCsiHandler({final:"b"},B=>this.repeatPrecedingCharacter(B)),this._parser.registerCsiHandler({final:"c"},B=>this.sendDeviceAttributesPrimary(B)),this._parser.registerCsiHandler({prefix:">",final:"c"},B=>this.sendDeviceAttributesSecondary(B)),this._parser.registerCsiHandler({final:"d"},B=>this.linePosAbsolute(B)),this._parser.registerCsiHandler({final:"e"},B=>this.vPositionRelative(B)),this._parser.registerCsiHandler({final:"f"},B=>this.hVPosition(B)),this._parser.registerCsiHandler({final:"g"},B=>this.tabClear(B)),this._parser.registerCsiHandler({final:"h"},B=>this.setMode(B)),this._parser.registerCsiHandler({prefix:"?",final:"h"},B=>this.setModePrivate(B)),this._parser.registerCsiHandler({final:"l"},B=>this.resetMode(B)),this._parser.registerCsiHandler({prefix:"?",final:"l"},B=>this.resetModePrivate(B)),this._parser.registerCsiHandler({final:"m"},B=>this.charAttributes(B)),this._parser.registerCsiHandler({final:"n"},B=>this.deviceStatus(B)),this._parser.registerCsiHandler({prefix:"?",final:"n"},B=>this.deviceStatusPrivate(B)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},B=>this.softReset(B)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},B=>this.setCursorStyle(B)),this._parser.registerCsiHandler({final:"r"},B=>this.setScrollRegion(B)),this._parser.registerCsiHandler({final:"s"},B=>this.saveCursor(B)),this._parser.registerCsiHandler({final:"t"},B=>this.windowOptions(B)),this._parser.registerCsiHandler({final:"u"},B=>this.restoreCursor(B)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},B=>this.insertColumns(B)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},B=>this.deleteColumns(B)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},B=>this.selectProtected(B)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},B=>this.requestMode(B,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},B=>this.requestMode(B,!1)),this._parser.setExecuteHandler(u.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(u.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(u.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(u.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(u.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(u.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(u.C1.IND,()=>this.index()),this._parser.setExecuteHandler(u.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(u.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new E.OscHandler(B=>(this.setTitle(B),this.setIconName(B),!0))),this._parser.registerOscHandler(1,new E.OscHandler(B=>this.setIconName(B))),this._parser.registerOscHandler(2,new E.OscHandler(B=>this.setTitle(B))),this._parser.registerOscHandler(4,new E.OscHandler(B=>this.setOrReportIndexedColor(B))),this._parser.registerOscHandler(8,new E.OscHandler(B=>this.setHyperlink(B))),this._parser.registerOscHandler(10,new E.OscHandler(B=>this.setOrReportFgColor(B))),this._parser.registerOscHandler(11,new E.OscHandler(B=>this.setOrReportBgColor(B))),this._parser.registerOscHandler(12,new E.OscHandler(B=>this.setOrReportCursorColor(B))),this._parser.registerOscHandler(104,new E.OscHandler(B=>this.restoreIndexedColor(B))),this._parser.registerOscHandler(110,new E.OscHandler(B=>this.restoreFgColor(B))),this._parser.registerOscHandler(111,new E.OscHandler(B=>this.restoreBgColor(B))),this._parser.registerOscHandler(112,new E.OscHandler(B=>this.restoreCursorColor(B))),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 B in f.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:B},()=>this.selectCharset("("+B)),this._parser.registerEscHandler({intermediates:")",final:B},()=>this.selectCharset(")"+B)),this._parser.registerEscHandler({intermediates:"*",final:B},()=>this.selectCharset("*"+B)),this._parser.registerEscHandler({intermediates:"+",final:B},()=>this.selectCharset("+"+B)),this._parser.registerEscHandler({intermediates:"-",final:B},()=>this.selectCharset("-"+B)),this._parser.registerEscHandler({intermediates:".",final:B},()=>this.selectCharset("."+B)),this._parser.registerEscHandler({intermediates:"/",final:B},()=>this.selectCharset("/"+B));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(B=>(this._logService.error("Parsing error: ",B),B)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new k.DcsHandler((B,O)=>this.requestStatusString(B,O)))}_preserveStack(A,D,H,V){this._parseStack.paused=!0,this._parseStack.cursorStartX=A,this._parseStack.cursorStartY=D,this._parseStack.decodedLength=H,this._parseStack.position=V}_logSlowResolvingAsync(A){this._logService.logLevel<=S.LogLevelEnum.WARN&&Promise.race([A,new Promise((D,H)=>setTimeout(()=>H("#SLOW_TIMEOUT"),5e3))]).catch(D=>{if(D!=="#SLOW_TIMEOUT")throw D;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(A,D){let H,V=this._activeBuffer.x,U=this._activeBuffer.y,G=0;const ee=this._parseStack.paused;if(ee){if(H=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,D))return this._logSlowResolvingAsync(H),H;V=this._parseStack.cursorStartX,U=this._parseStack.cursorStartY,this._parseStack.paused=!1,A.length>M&&(G=this._parseStack.position+M)}if(this._logService.logLevel<=S.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof A=="string"?` "${A}"`:` "${Array.prototype.map.call(A,B=>String.fromCharCode(B)).join("")}"`),typeof A=="string"?A.split("").map(B=>B.charCodeAt(0)):A),this._parseBuffer.length<A.length&&this._parseBuffer.length<M&&(this._parseBuffer=new Uint32Array(Math.min(A.length,M))),ee||this._dirtyRowTracker.clearRange(),A.length>M)for(let B=G;B<A.length;B+=M){const O=B+M<A.length?B+M:A.length,z=typeof A=="string"?this._stringDecoder.decode(A.substring(B,O),this._parseBuffer):this._utf8Decoder.decode(A.subarray(B,O),this._parseBuffer);if(H=this._parser.parse(this._parseBuffer,z))return this._preserveStack(V,U,z,B),this._logSlowResolvingAsync(H),H}else if(!ee){const B=typeof A=="string"?this._stringDecoder.decode(A,this._parseBuffer):this._utf8Decoder.decode(A,this._parseBuffer);if(H=this._parser.parse(this._parseBuffer,B))return this._preserveStack(V,U,B,0),this._logSlowResolvingAsync(H),H}this._activeBuffer.x===V&&this._activeBuffer.y===U||this._onCursorMove.fire();const Z=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),q=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);q<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(q,this._bufferService.rows-1),Math.min(Z,this._bufferService.rows-1))}print(A,D,H){let V,U;const G=this._charsetService.charset,ee=this._optionsService.rawOptions.screenReaderMode,Z=this._bufferService.cols,q=this._coreService.decPrivateModes.wraparound,B=this._coreService.modes.insertMode,O=this._curAttrData;let z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&H-D>0&&z.getWidth(this._activeBuffer.x-1)===2&&z.setCellFromCodepoint(this._activeBuffer.x-1,0,1,O);let Y=this._parser.precedingJoinState;for(let N=D;N<H;++N){if(V=A[N],V<127&&G){const oe=G[String.fromCharCode(V)];oe&&(V=oe.charCodeAt(0))}const J=this._unicodeService.charProperties(V,Y);U=w.UnicodeService.extractWidth(J);const K=w.UnicodeService.extractShouldJoin(J),te=K?w.UnicodeService.extractWidth(Y):0;if(Y=J,ee&&this._onA11yChar.fire((0,_.stringFromCodePoint)(V)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+U-te>Z){if(q){const oe=z;let ae=this._activeBuffer.x-te;for(this._activeBuffer.x=te,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),z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),te>0&&z instanceof v.BufferLine&&z.copyCellsFrom(oe,ae,0,te,!1);ae<Z;)oe.setCellFromCodepoint(ae++,0,1,O)}else if(this._activeBuffer.x=Z-1,U===2)continue}if(K&&this._activeBuffer.x){const oe=z.getWidth(this._activeBuffer.x-1)?1:2;z.addCodepointToCell(this._activeBuffer.x-oe,V,U);for(let ae=U-te;--ae>=0;)z.setCellFromCodepoint(this._activeBuffer.x++,0,0,O)}else if(B&&(z.insertCells(this._activeBuffer.x,U-te,this._activeBuffer.getNullCell(O)),z.getWidth(Z-1)===2&&z.setCellFromCodepoint(Z-1,m.NULL_CELL_CODE,m.NULL_CELL_WIDTH,O)),z.setCellFromCodepoint(this._activeBuffer.x++,V,U,O),U>0)for(;--U;)z.setCellFromCodepoint(this._activeBuffer.x++,0,0,O)}this._parser.precedingJoinState=Y,this._activeBuffer.x<Z&&H-D>0&&z.getWidth(this._activeBuffer.x)===0&&!z.hasContent(this._activeBuffer.x)&&z.setCellFromCodepoint(this._activeBuffer.x,0,1,O),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(A,D){return A.final!=="t"||A.prefix||A.intermediates?this._parser.registerCsiHandler(A,D):this._parser.registerCsiHandler(A,H=>!L(H.params[0],this._optionsService.rawOptions.windowOptions)||D(H))}registerDcsHandler(A,D){return this._parser.registerDcsHandler(A,new k.DcsHandler(D))}registerEscHandler(A,D){return this._parser.registerEscHandler(A,D)}registerOscHandler(A,D){return this._parser.registerOscHandler(A,new E.OscHandler(D))}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 A;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&&((A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&A.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);D.hasWidth(this._activeBuffer.x)&&!D.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const A=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-A),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(A=this._bufferService.cols-1){this._activeBuffer.x=Math.min(A,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(A,D){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=A,this._activeBuffer.y=this._activeBuffer.scrollTop+D):(this._activeBuffer.x=A,this._activeBuffer.y=D),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(A,D){this._restrictCursor(),this._setCursor(this._activeBuffer.x+A,this._activeBuffer.y+D)}cursorUp(A){const D=this._activeBuffer.y-this._activeBuffer.scrollTop;return D>=0?this._moveCursor(0,-Math.min(D,A.params[0]||1)):this._moveCursor(0,-(A.params[0]||1)),!0}cursorDown(A){const D=this._activeBuffer.scrollBottom-this._activeBuffer.y;return D>=0?this._moveCursor(0,Math.min(D,A.params[0]||1)):this._moveCursor(0,A.params[0]||1),!0}cursorForward(A){return this._moveCursor(A.params[0]||1,0),!0}cursorBackward(A){return this._moveCursor(-(A.params[0]||1),0),!0}cursorNextLine(A){return this.cursorDown(A),this._activeBuffer.x=0,!0}cursorPrecedingLine(A){return this.cursorUp(A),this._activeBuffer.x=0,!0}cursorCharAbsolute(A){return this._setCursor((A.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(A){return this._setCursor(A.length>=2?(A.params[1]||1)-1:0,(A.params[0]||1)-1),!0}charPosAbsolute(A){return this._setCursor((A.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(A){return this._moveCursor(A.params[0]||1,0),!0}linePosAbsolute(A){return this._setCursor(this._activeBuffer.x,(A.params[0]||1)-1),!0}vPositionRelative(A){return this._moveCursor(0,A.params[0]||1),!0}hVPosition(A){return this.cursorPosition(A),!0}tabClear(A){const D=A.params[0];return D===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:D===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(A){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let D=A.params[0]||1;for(;D--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(A){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let D=A.params[0]||1;for(;D--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(A){const D=A.params[0];return D===1&&(this._curAttrData.bg|=536870912),D!==2&&D!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(A,D,H,V=!1,U=!1){const G=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);G.replaceCells(D,H,this._activeBuffer.getNullCell(this._eraseAttrData()),U),V&&(G.isWrapped=!1)}_resetBufferLine(A,D=!1){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);H&&(H.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),D),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+A),H.isWrapped=!1)}eraseInDisplay(A,D=!1){let H;switch(this._restrictCursor(this._bufferService.cols),A.params[0]){case 0:for(H=this._activeBuffer.y,this._dirtyRowTracker.markDirty(H),this._eraseInBufferLine(H++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,D);H<this._bufferService.rows;H++)this._resetBufferLine(H,D);this._dirtyRowTracker.markDirty(H);break;case 1:for(H=this._activeBuffer.y,this._dirtyRowTracker.markDirty(H),this._eraseInBufferLine(H,0,this._activeBuffer.x+1,!0,D),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(H+1).isWrapped=!1);H--;)this._resetBufferLine(H,D);this._dirtyRowTracker.markDirty(0);break;case 2:for(H=this._bufferService.rows,this._dirtyRowTracker.markDirty(H-1);H--;)this._resetBufferLine(H,D);this._dirtyRowTracker.markDirty(0);break;case 3:const V=this._activeBuffer.lines.length-this._bufferService.rows;V>0&&(this._activeBuffer.lines.trimStart(V),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-V,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-V,0),this._onScroll.fire(0))}return!0}eraseInLine(A,D=!1){switch(this._restrictCursor(this._bufferService.cols),A.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,D);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,D);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,D)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(A){this._restrictCursor();let D=A.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const H=this._activeBuffer.ybase+this._activeBuffer.y,V=this._bufferService.rows-1-this._activeBuffer.scrollBottom,U=this._bufferService.rows-1+this._activeBuffer.ybase-V+1;for(;D--;)this._activeBuffer.lines.splice(U-1,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}deleteLines(A){this._restrictCursor();let D=A.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const H=this._activeBuffer.ybase+this._activeBuffer.y;let V;for(V=this._bufferService.rows-1-this._activeBuffer.scrollBottom,V=this._bufferService.rows-1+this._activeBuffer.ybase-V;D--;)this._activeBuffer.lines.splice(H,1),this._activeBuffer.lines.splice(V,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(A){this._restrictCursor();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.insertCells(this._activeBuffer.x,A.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(A){this._restrictCursor();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.deleteCells(this._activeBuffer.x,A.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(A){let D=A.params[0]||1;for(;D--;)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(A){let D=A.params[0]||1;for(;D--;)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(A){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=A.params[0]||1;for(let H=this._activeBuffer.scrollTop;H<=this._activeBuffer.scrollBottom;++H){const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+H);V.deleteCells(0,D,this._activeBuffer.getNullCell(this._eraseAttrData())),V.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(A){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=A.params[0]||1;for(let H=this._activeBuffer.scrollTop;H<=this._activeBuffer.scrollBottom;++H){const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+H);V.insertCells(0,D,this._activeBuffer.getNullCell(this._eraseAttrData())),V.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(A){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=A.params[0]||1;for(let H=this._activeBuffer.scrollTop;H<=this._activeBuffer.scrollBottom;++H){const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+H);V.insertCells(this._activeBuffer.x,D,this._activeBuffer.getNullCell(this._eraseAttrData())),V.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(A){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=A.params[0]||1;for(let H=this._activeBuffer.scrollTop;H<=this._activeBuffer.scrollBottom;++H){const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+H);V.deleteCells(this._activeBuffer.x,D,this._activeBuffer.getNullCell(this._eraseAttrData())),V.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(A){this._restrictCursor();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(A.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(A){const D=this._parser.precedingJoinState;if(!D)return!0;const H=A.params[0]||1,V=w.UnicodeService.extractWidth(D),U=this._activeBuffer.x-V,G=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(U),ee=new Uint32Array(G.length*H);let Z=0;for(let B=0;B<G.length;){const O=G.codePointAt(B)||0;ee[Z++]=O,B+=O>65535?2:1}let q=Z;for(let B=1;B<H;++B)ee.copyWithin(q,0,Z),q+=Z;return this.print(ee,0,q),!0}sendDeviceAttributesPrimary(A){return A.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(u.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(u.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(A){return A.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(u.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(u.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(A.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(u.C0.ESC+"[>83;40003;0c")),!0}_is(A){return(this._optionsService.rawOptions.termName+"").indexOf(A)===0}setMode(A){for(let D=0;D<A.length;D++)switch(A.params[D]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(A){for(let D=0;D<A.length;D++)switch(A.params[D]){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(A){for(let D=0;D<A.length;D++)switch(A.params[D]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(A){for(let D=0;D<A.length;D++)switch(A.params[D]){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(),A.params[D]===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(A,D){const H=this._coreService.decPrivateModes,{activeProtocol:V,activeEncoding:U}=this._coreMouseService,G=this._coreService,{buffers:ee,cols:Z}=this._bufferService,{active:q,alt:B}=ee,O=this._optionsService.rawOptions,z=K=>K?1:2,Y=A.params[0];return N=Y,J=D?Y===2?4:Y===4?z(G.modes.insertMode):Y===12?3:Y===20?z(O.convertEol):0:Y===1?z(H.applicationCursorKeys):Y===3?O.windowOptions.setWinLines?Z===80?2:Z===132?1:0:0:Y===6?z(H.origin):Y===7?z(H.wraparound):Y===8?3:Y===9?z(V==="X10"):Y===12?z(O.cursorBlink):Y===25?z(!G.isCursorHidden):Y===45?z(H.reverseWraparound):Y===66?z(H.applicationKeypad):Y===67?4:Y===1e3?z(V==="VT200"):Y===1002?z(V==="DRAG"):Y===1003?z(V==="ANY"):Y===1004?z(H.sendFocus):Y===1005?4:Y===1006?z(U==="SGR"):Y===1015?4:Y===1016?z(U==="SGR_PIXELS"):Y===1048?1:Y===47||Y===1047||Y===1049?z(q===B):Y===2004?z(H.bracketedPasteMode):0,G.triggerDataEvent(`${u.C0.ESC}[${D?"":"?"}${N};${J}$y`),!0;var N,J}_updateAttrColor(A,D,H,V,U){return D===2?(A|=50331648,A&=-16777216,A|=b.AttributeData.fromColorRGB([H,V,U])):D===5&&(A&=-50331904,A|=33554432|255&H),A}_extractColor(A,D,H){const V=[0,0,-1,0,0,0];let U=0,G=0;do{if(V[G+U]=A.params[D+G],A.hasSubParams(D+G)){const ee=A.getSubParams(D+G);let Z=0;do V[1]===5&&(U=1),V[G+Z+1+U]=ee[Z];while(++Z<ee.length&&Z+G+1+U<V.length);break}if(V[1]===5&&G+U>=2||V[1]===2&&G+U>=5)break;V[1]&&(U=1)}while(++G+D<A.length&&G+U<V.length);for(let ee=2;ee<V.length;++ee)V[ee]===-1&&(V[ee]=0);switch(V[0]){case 38:H.fg=this._updateAttrColor(H.fg,V[1],V[3],V[4],V[5]);break;case 48:H.bg=this._updateAttrColor(H.bg,V[1],V[3],V[4],V[5]);break;case 58:H.extended=H.extended.clone(),H.extended.underlineColor=this._updateAttrColor(H.extended.underlineColor,V[1],V[3],V[4],V[5])}return G}_processUnderline(A,D){D.extended=D.extended.clone(),(!~A||A>5)&&(A=1),D.extended.underlineStyle=A,D.fg|=268435456,A===0&&(D.fg&=-268435457),D.updateExtended()}_processSGR0(A){A.fg=v.DEFAULT_ATTR_DATA.fg,A.bg=v.DEFAULT_ATTR_DATA.bg,A.extended=A.extended.clone(),A.extended.underlineStyle=0,A.extended.underlineColor&=-67108864,A.updateExtended()}charAttributes(A){if(A.length===1&&A.params[0]===0)return this._processSGR0(this._curAttrData),!0;const D=A.length;let H;const V=this._curAttrData;for(let U=0;U<D;U++)H=A.params[U],H>=30&&H<=37?(V.fg&=-50331904,V.fg|=16777216|H-30):H>=40&&H<=47?(V.bg&=-50331904,V.bg|=16777216|H-40):H>=90&&H<=97?(V.fg&=-50331904,V.fg|=16777224|H-90):H>=100&&H<=107?(V.bg&=-50331904,V.bg|=16777224|H-100):H===0?this._processSGR0(V):H===1?V.fg|=134217728:H===3?V.bg|=67108864:H===4?(V.fg|=268435456,this._processUnderline(A.hasSubParams(U)?A.getSubParams(U)[0]:1,V)):H===5?V.fg|=536870912:H===7?V.fg|=67108864:H===8?V.fg|=1073741824:H===9?V.fg|=2147483648:H===2?V.bg|=134217728:H===21?this._processUnderline(2,V):H===22?(V.fg&=-134217729,V.bg&=-134217729):H===23?V.bg&=-67108865:H===24?(V.fg&=-268435457,this._processUnderline(0,V)):H===25?V.fg&=-536870913:H===27?V.fg&=-67108865:H===28?V.fg&=-1073741825:H===29?V.fg&=2147483647:H===39?(V.fg&=-67108864,V.fg|=16777215&v.DEFAULT_ATTR_DATA.fg):H===49?(V.bg&=-67108864,V.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):H===38||H===48||H===58?U+=this._extractColor(A,U,V):H===53?V.bg|=1073741824:H===55?V.bg&=-1073741825:H===59?(V.extended=V.extended.clone(),V.extended.underlineColor=-1,V.updateExtended()):H===100?(V.fg&=-67108864,V.fg|=16777215&v.DEFAULT_ATTR_DATA.fg,V.bg&=-67108864,V.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",H);return!0}deviceStatus(A){switch(A.params[0]){case 5:this._coreService.triggerDataEvent(`${u.C0.ESC}[0n`);break;case 6:const D=this._activeBuffer.y+1,H=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[${D};${H}R`)}return!0}deviceStatusPrivate(A){if(A.params[0]===6){const D=this._activeBuffer.y+1,H=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[?${D};${H}R`)}return!0}softReset(A){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(A){const D=A.params[0]||1;switch(D){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 H=D%2==1;return this._optionsService.options.cursorBlink=H,!0}setScrollRegion(A){const D=A.params[0]||1;let H;return(A.length<2||(H=A.params[1])>this._bufferService.rows||H===0)&&(H=this._bufferService.rows),H>D&&(this._activeBuffer.scrollTop=D-1,this._activeBuffer.scrollBottom=H-1,this._setCursor(0,0)),!0}windowOptions(A){if(!L(A.params[0],this._optionsService.rawOptions.windowOptions))return!0;const D=A.length>1?A.params[1]:0;switch(A.params[0]){case 14:D!==2&&this._onRequestWindowsOptionsReport.fire(j.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(j.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${u.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:D!==0&&D!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),D!==0&&D!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:D!==0&&D!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),D!==0&&D!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(A){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(A){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(A){return this._windowTitle=A,this._onTitleChange.fire(A),!0}setIconName(A){return this._iconName=A,!0}setOrReportIndexedColor(A){const D=[],H=A.split(";");for(;H.length>1;){const V=H.shift(),U=H.shift();if(/^\d+$/.exec(V)){const G=parseInt(V);if(W(G))if(U==="?")D.push({type:0,index:G});else{const ee=(0,T.parseColor)(U);ee&&D.push({type:1,index:G,color:ee})}}}return D.length&&this._onColor.fire(D),!0}setHyperlink(A){const D=A.split(";");return!(D.length<2)&&(D[1]?this._createHyperlink(D[0],D[1]):!D[0]&&this._finishHyperlink())}_createHyperlink(A,D){this._getCurrentLinkId()&&this._finishHyperlink();const H=A.split(":");let V;const U=H.findIndex(G=>G.startsWith("id="));return U!==-1&&(V=H[U].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:V,uri:D}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(A,D){const H=A.split(";");for(let V=0;V<H.length&&!(D>=this._specialColors.length);++V,++D)if(H[V]==="?")this._onColor.fire([{type:0,index:this._specialColors[D]}]);else{const U=(0,T.parseColor)(H[V]);U&&this._onColor.fire([{type:1,index:this._specialColors[D],color:U}])}return!0}setOrReportFgColor(A){return this._setOrReportSpecialColor(A,0)}setOrReportBgColor(A){return this._setOrReportSpecialColor(A,1)}setOrReportCursorColor(A){return this._setOrReportSpecialColor(A,2)}restoreIndexedColor(A){if(!A)return this._onColor.fire([{type:2}]),!0;const D=[],H=A.split(";");for(let V=0;V<H.length;++V)if(/^\d+$/.exec(H[V])){const U=parseInt(H[V]);W(U)&&D.push({type:2,index:U})}return D.length&&this._onColor.fire(D),!0}restoreFgColor(A){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(A){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(A){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(A){return A.length!==2?(this.selectDefaultCharset(),!0):(A[0]==="/"||this._charsetService.setgCharset(R[A[0]],f.CHARSETS[A[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 A=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,A,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(A){return this._charsetService.setgLevel(A),!0}screenAlignmentPattern(){const A=new y.CellData;A.content=4194373,A.fg=this._curAttrData.fg,A.bg=this._curAttrData.bg,this._setCursor(0,0);for(let D=0;D<this._bufferService.rows;++D){const H=this._activeBuffer.ybase+this._activeBuffer.y+D,V=this._activeBuffer.lines.get(H);V&&(V.fill(A),V.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(A,D){const H=this._bufferService.buffer,V=this._optionsService.rawOptions;return(U=>(this._coreService.triggerDataEvent(`${u.C0.ESC}${U}${u.C0.ESC}\\`),!0))(A==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:A==='"p'?'P1$r61;1"p':A==="r"?`P1$r${H.scrollTop+1};${H.scrollBottom+1}r`:A==="m"?"P1$r0m":A===" q"?`P1$r${{block:2,underline:4,bar:6}[V.cursorStyle]-(V.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(A,D){this._dirtyRowTracker.markRangeDirty(A,D)}}o.InputHandler=$;let F=class{constructor(I){this._bufferService=I,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(I){I<this.start?this.start=I:I>this.end&&(this.end=I)}markRangeDirty(I,A){I>A&&(P=I,I=A,A=P),I<this.start&&(this.start=I),A>this.end&&(this.end=A)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function W(I){return 0<=I&&I<256}F=c([d(0,S.IBufferService)],F)},844:(a,o)=>{function l(c){for(const d of c)d.dispose();c.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 c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const d=this._disposables.indexOf(c);d!==-1&&this._disposables.splice(d,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var d;this._isDisposed||c===this._value||((d=this._value)==null||d.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)==null||c.dispose(),this._value=void 0}},o.toDisposable=function(c){return{dispose:c}},o.disposeArray=l,o.getDisposeArrayDisposable=function(c){return{dispose:()=>l(c)}}},1505:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class l{constructor(){this._data={}}set(d,u,f){this._data[d]||(this._data[d]={}),this._data[d][u]=f}get(d,u){return this._data[d]?this._data[d][u]:void 0}clear(){this._data={}}}o.TwoKeyMap=l,o.FourKeyMap=class{constructor(){this._data=new l}set(c,d,u,f,g){this._data.get(c,d)||this._data.set(c,d,new l),this._data.get(c,d).set(u,f,g)}get(c,d,u,f){var g;return(g=this._data.get(c,d))==null?void 0:g.get(u,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,c=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 d=l.match(/Version\/(\d+)/);return d===null||d.length<2?0:parseInt(d[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),o.isIpad=c==="iPad",o.isIphone=c==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),o.isLinux=c.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(c){this._getKey=c,this._array=[]}clear(){this._array.length=0}insert(c){this._array.length!==0?(l=this._search(this._getKey(c)),this._array.splice(l,0,c)):this._array.push(c)}delete(c){if(this._array.length===0)return!1;const d=this._getKey(c);if(d===void 0||(l=this._search(d),l===-1)||this._getKey(this._array[l])!==d)return!1;do if(this._array[l]===c)return this._array.splice(l,1),!0;while(++l<this._array.length&&this._getKey(this._array[l])===d);return!1}*getKeyIterator(c){if(this._array.length!==0&&(l=this._search(c),!(l<0||l>=this._array.length)&&this._getKey(this._array[l])===c))do yield this._array[l];while(++l<this._array.length&&this._getKey(this._array[l])===c)}forEachByKey(c,d){if(this._array.length!==0&&(l=this._search(c),!(l<0||l>=this._array.length)&&this._getKey(this._array[l])===c))do d(this._array[l]);while(++l<this._array.length&&this._getKey(this._array[l])===c)}values(){return[...this._array].values()}_search(c){let d=0,u=this._array.length-1;for(;u>=d;){let f=d+u>>1;const g=this._getKey(this._array[f]);if(g>c)u=f-1;else{if(!(g<c)){for(;f>0&&this._getKey(this._array[f-1])===c;)f--;return f}d=f+1}}return d}}},7226:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const c=l(6114);class d{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 x=0,_=0,v=g.timeRemaining(),p=0;for(;this._i<this._tasks.length;){if(x=Date.now(),this._tasks[this._i]()||this._i++,x=Math.max(1,Date.now()-x),_=Math.max(x,_),p=g.timeRemaining(),1.5*_>p)return v-x<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(v-x))}ms`),void this._start();v=p}this.clear()}}class u extends d{_requestCallback(g){return setTimeout(()=>g(this._createDeadline(16)))}_cancelCallback(g){clearTimeout(g)}_createDeadline(g){const x=Date.now()+g;return{timeRemaining:()=>Math.max(0,x-Date.now())}}}o.PriorityTaskQueue=u,o.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends d{_requestCallback(f){return requestIdleCallback(f)}_cancelCallback(f){cancelIdleCallback(f)}}:u,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 c=l(643);o.updateWindowsModeWrappedState=function(d){const u=d.buffer.lines.get(d.buffer.ybase+d.buffer.y-1),f=u==null?void 0:u.get(d.cols-1),g=d.buffer.lines.get(d.buffer.ybase+d.buffer.y);g&&f&&(g.isWrapped=f[c.CHAR_DATA_CODE_INDEX]!==c.NULL_CELL_CODE&&f[c.CHAR_DATA_CODE_INDEX]!==c.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 c}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new l;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}o.AttributeData=l;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}get underlineVariantOffset(){const u=(3758096384&this._ext)>>29;return u<0?4294967288^u:u}set underlineVariantOffset(u){this._ext&=536870911,this._ext|=u<<29&3758096384}constructor(u=0,f=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=f}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=c},9092:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const c=l(6349),d=l(7226),u=l(3734),f=l(8437),g=l(4634),x=l(511),_=l(643),v=l(4863),p=l(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(m,y,b){this._hasScrollback=m,this._optionsService=y,this._bufferService=b,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=f.DEFAULT_ATTR_DATA.clone(),this.savedCharset=p.DEFAULT_CHARSET,this.markers=[],this._nullCell=x.CellData.fromCharData([0,_.NULL_CELL_CHAR,_.NULL_CELL_WIDTH,_.NULL_CELL_CODE]),this._whitespaceCell=x.CellData.fromCharData([0,_.WHITESPACE_CELL_CHAR,_.WHITESPACE_CELL_WIDTH,_.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new d.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(m){return m?(this._nullCell.fg=m.fg,this._nullCell.bg=m.bg,this._nullCell.extended=m.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell}getWhitespaceCell(m){return m?(this._whitespaceCell.fg=m.fg,this._whitespaceCell.bg=m.bg,this._whitespaceCell.extended=m.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell}getBlankLine(m,y){return new f.BufferLine(this._bufferService.cols,this.getNullCell(m),y)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const m=this.ybase+this.y-this.ydisp;return m>=0&&m<this._rows}_getCorrectBufferLength(m){if(!this._hasScrollback)return m;const y=m+this._optionsService.rawOptions.scrollback;return y>o.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:y}fillViewportRows(m){if(this.lines.length===0){m===void 0&&(m=f.DEFAULT_ATTR_DATA);let y=this._rows;for(;y--;)this.lines.push(this.getBlankLine(m))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(m,y){const b=this.getNullCell(f.DEFAULT_ATTR_DATA);let S=0;const w=this._getCorrectBufferLength(y);if(w>this.lines.maxLength&&(this.lines.maxLength=w),this.lines.length>0){if(this._cols<m)for(let k=0;k<this.lines.length;k++)S+=+this.lines.get(k).resize(m,b);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(m,b)):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(m,b)));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(w<this.lines.maxLength){const k=this.lines.length-w;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=w}this.x=Math.min(this.x,m-1),this.y=Math.min(this.y,y-1),E&&(this.y+=E),this.savedX=Math.min(this.savedX,m-1),this.scrollTop=0}if(this.scrollBottom=y-1,this._isReflowEnabled&&(this._reflow(m,y),this._cols>m))for(let E=0;E<this.lines.length;E++)S+=+this.lines.get(E).resize(m,b);this._cols=m,this._rows=y,this._memoryCleanupQueue.clear(),S>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let m=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,m=!1);let y=0;for(;this._memoryCleanupPosition<this.lines.length;)if(y+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),y>100)return!0;return m}get _isReflowEnabled(){const m=this._optionsService.rawOptions.windowsPty;return m&&m.buildNumber?this._hasScrollback&&m.backend==="conpty"&&m.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(m,y){this._cols!==m&&(m>this._cols?this._reflowLarger(m,y):this._reflowSmaller(m,y))}_reflowLarger(m,y){const b=(0,g.reflowLargerGetLinesToRemove)(this.lines,this._cols,m,this.ybase+this.y,this.getNullCell(f.DEFAULT_ATTR_DATA));if(b.length>0){const S=(0,g.reflowLargerCreateNewLayout)(this.lines,b);(0,g.reflowLargerApplyNewLayout)(this.lines,S.layout),this._reflowLargerAdjustViewport(m,y,S.countRemoved)}}_reflowLargerAdjustViewport(m,y,b){const S=this.getNullCell(f.DEFAULT_ATTR_DATA);let w=b;for(;w-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<y&&this.lines.push(new f.BufferLine(m,S))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-b,0)}_reflowSmaller(m,y){const b=this.getNullCell(f.DEFAULT_ATTR_DATA),S=[];let w=0;for(let E=this.lines.length-1;E>=0;E--){let k=this.lines.get(E);if(!k||!k.isWrapped&&k.getTrimmedLength()<=m)continue;const T=[k];for(;k.isWrapped&&E>0;)k=this.lines.get(--E),T.unshift(k);const R=this.ybase+this.y;if(R>=E&&R<E+T.length)continue;const M=T[T.length-1].getTrimmedLength(),L=(0,g.reflowSmallerGetNewLineLengths)(T,this._cols,m),j=L.length-T.length;let P;P=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+j):Math.max(0,this.lines.length-this.lines.maxLength+j);const $=[];for(let H=0;H<j;H++){const V=this.getBlankLine(f.DEFAULT_ATTR_DATA,!0);$.push(V)}$.length>0&&(S.push({start:E+T.length+w,newLines:$}),w+=$.length),T.push(...$);let F=L.length-1,W=L[F];W===0&&(F--,W=L[F]);let I=T.length-j-1,A=M;for(;I>=0;){const H=Math.min(A,W);if(T[F]===void 0)break;if(T[F].copyCellsFrom(T[I],A-H,W-H,H,!0),W-=H,W===0&&(F--,W=L[F]),A-=H,A===0){I--;const V=Math.max(I,0);A=(0,g.getWrappedLineTrimmedLength)(T,V,this._cols)}}for(let H=0;H<T.length;H++)L[H]<m&&T[H].setCell(L[H],b);let D=j-P;for(;D-- >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+w)-y&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+j,this.ybase+y-1)}if(S.length>0){const E=[],k=[];for(let F=0;F<this.lines.length;F++)k.push(this.lines.get(F));const T=this.lines.length;let R=T-1,M=0,L=S[M];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+w);let j=0;for(let F=Math.min(this.lines.maxLength-1,T+w-1);F>=0;F--)if(L&&L.start>R+j){for(let W=L.newLines.length-1;W>=0;W--)this.lines.set(F--,L.newLines[W]);F++,E.push({index:R+1,amount:L.newLines.length}),j+=L.newLines.length,L=S[++M]}else this.lines.set(F,k[R--]);let P=0;for(let F=E.length-1;F>=0;F--)E[F].index+=P,this.lines.onInsertEmitter.fire(E[F]),P+=E[F].amount;const $=Math.max(0,T+w-this.lines.maxLength);$>0&&this.lines.onTrimEmitter.fire($)}}translateBufferLineToString(m,y,b=0,S){const w=this.lines.get(m);return w?w.translateToString(y,b,S):""}getWrappedRangeForLine(m){let y=m,b=m;for(;y>0&&this.lines.get(y).isWrapped;)y--;for(;b+1<this.lines.length&&this.lines.get(b+1).isWrapped;)b++;return{first:y,last:b}}setupTabStops(m){for(m!=null?this.tabs[m]||(m=this.prevStop(m)):(this.tabs={},m=0);m<this._cols;m+=this._optionsService.rawOptions.tabStopWidth)this.tabs[m]=!0}prevStop(m){for(m==null&&(m=this.x);!this.tabs[--m]&&m>0;);return m>=this._cols?this._cols-1:m<0?0:m}nextStop(m){for(m==null&&(m=this.x);!this.tabs[++m]&&m<this._cols;);return m>=this._cols?this._cols-1:m<0?0:m}clearMarkers(m){this._isClearing=!0;for(let y=0;y<this.markers.length;y++)this.markers[y].line===m&&(this.markers[y].dispose(),this.markers.splice(y--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let m=0;m<this.markers.length;m++)this.markers[m].dispose(),this.markers.splice(m--,1);this._isClearing=!1}addMarker(m){const y=new v.Marker(m);return this.markers.push(y),y.register(this.lines.onTrim(b=>{y.line-=b,y.line<0&&y.dispose()})),y.register(this.lines.onInsert(b=>{y.line>=b.index&&(y.line+=b.amount)})),y.register(this.lines.onDelete(b=>{y.line>=b.index&&y.line<b.index+b.amount&&y.dispose(),y.line>b.index&&(y.line-=b.amount)})),y.register(y.onDispose(()=>this._removeMarker(y))),y}_removeMarker(m){this._isClearing||this.markers.splice(this.markers.indexOf(m),1)}}},8437:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const c=l(3734),d=l(511),u=l(643),f=l(482);o.DEFAULT_ATTR_DATA=Object.freeze(new c.AttributeData);let g=0;class x{constructor(v,p,m=!1){this.isWrapped=m,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*v);const y=p||d.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]);for(let b=0;b<v;++b)this.setCell(b,y);this.length=v}get(v){const p=this._data[3*v+0],m=2097151&p;return[this._data[3*v+1],2097152&p?this._combined[v]:m?(0,f.stringFromCodePoint)(m):"",p>>22,2097152&p?this._combined[v].charCodeAt(this._combined[v].length-1):m]}set(v,p){this._data[3*v+1]=p[u.CHAR_DATA_ATTR_INDEX],p[u.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[v]=p[1],this._data[3*v+0]=2097152|v|p[u.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*v+0]=p[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|p[u.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 p=this._data[3*v+0];return 2097152&p?this._combined[v].charCodeAt(this._combined[v].length-1):2097151&p}isCombined(v){return 2097152&this._data[3*v+0]}getString(v){const p=this._data[3*v+0];return 2097152&p?this._combined[v]:2097151&p?(0,f.stringFromCodePoint)(2097151&p):""}isProtected(v){return 536870912&this._data[3*v+2]}loadCell(v,p){return g=3*v,p.content=this._data[g+0],p.fg=this._data[g+1],p.bg=this._data[g+2],2097152&p.content&&(p.combinedData=this._combined[v]),268435456&p.bg&&(p.extended=this._extendedAttrs[v]),p}setCell(v,p){2097152&p.content&&(this._combined[v]=p.combinedData),268435456&p.bg&&(this._extendedAttrs[v]=p.extended),this._data[3*v+0]=p.content,this._data[3*v+1]=p.fg,this._data[3*v+2]=p.bg}setCellFromCodepoint(v,p,m,y){268435456&y.bg&&(this._extendedAttrs[v]=y.extended),this._data[3*v+0]=p|m<<22,this._data[3*v+1]=y.fg,this._data[3*v+2]=y.bg}addCodepointToCell(v,p,m){let y=this._data[3*v+0];2097152&y?this._combined[v]+=(0,f.stringFromCodePoint)(p):2097151&y?(this._combined[v]=(0,f.stringFromCodePoint)(2097151&y)+(0,f.stringFromCodePoint)(p),y&=-2097152,y|=2097152):y=p|4194304,m&&(y&=-12582913,y|=m<<22),this._data[3*v+0]=y}insertCells(v,p,m){if((v%=this.length)&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,m),p<this.length-v){const y=new d.CellData;for(let b=this.length-v-p-1;b>=0;--b)this.setCell(v+p+b,this.loadCell(v+b,y));for(let b=0;b<p;++b)this.setCell(v+b,m)}else for(let y=v;y<this.length;++y)this.setCell(y,m);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,m)}deleteCells(v,p,m){if(v%=this.length,p<this.length-v){const y=new d.CellData;for(let b=0;b<this.length-v-p;++b)this.setCell(v+b,this.loadCell(v+p+b,y));for(let b=this.length-p;b<this.length;++b)this.setCell(b,m)}else for(let y=v;y<this.length;++y)this.setCell(y,m);v&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,m),this.getWidth(v)!==0||this.hasContent(v)||this.setCellFromCodepoint(v,0,1,m)}replaceCells(v,p,m,y=!1){if(y)for(v&&this.getWidth(v-1)===2&&!this.isProtected(v-1)&&this.setCellFromCodepoint(v-1,0,1,m),p<this.length&&this.getWidth(p-1)===2&&!this.isProtected(p)&&this.setCellFromCodepoint(p,0,1,m);v<p&&v<this.length;)this.isProtected(v)||this.setCell(v,m),v++;else for(v&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,m),p<this.length&&this.getWidth(p-1)===2&&this.setCellFromCodepoint(p,0,1,m);v<p&&v<this.length;)this.setCell(v++,m)}resize(v,p){if(v===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const m=3*v;if(v>this.length){if(this._data.buffer.byteLength>=4*m)this._data=new Uint32Array(this._data.buffer,0,m);else{const y=new Uint32Array(m);y.set(this._data),this._data=y}for(let y=this.length;y<v;++y)this.setCell(y,p)}else{this._data=this._data.subarray(0,m);const y=Object.keys(this._combined);for(let S=0;S<y.length;S++){const w=parseInt(y[S],10);w>=v&&delete this._combined[w]}const b=Object.keys(this._extendedAttrs);for(let S=0;S<b.length;S++){const w=parseInt(b[S],10);w>=v&&delete this._extendedAttrs[w]}}return this.length=v,4*m*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,p=!1){if(p)for(let m=0;m<this.length;++m)this.isProtected(m)||this.setCell(m,v);else{this._combined={},this._extendedAttrs={};for(let m=0;m<this.length;++m)this.setCell(m,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 p in v._combined)this._combined[p]=v._combined[p];this._extendedAttrs={};for(const p in v._extendedAttrs)this._extendedAttrs[p]=v._extendedAttrs[p];this.isWrapped=v.isWrapped}clone(){const v=new x(0);v._data=new Uint32Array(this._data),v.length=this.length;for(const p in this._combined)v._combined[p]=this._combined[p];for(const p in this._extendedAttrs)v._extendedAttrs[p]=this._extendedAttrs[p];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,p,m,y,b){const S=v._data;if(b)for(let E=y-1;E>=0;E--){for(let k=0;k<3;k++)this._data[3*(m+E)+k]=S[3*(p+E)+k];268435456&S[3*(p+E)+2]&&(this._extendedAttrs[m+E]=v._extendedAttrs[p+E])}else for(let E=0;E<y;E++){for(let k=0;k<3;k++)this._data[3*(m+E)+k]=S[3*(p+E)+k];268435456&S[3*(p+E)+2]&&(this._extendedAttrs[m+E]=v._extendedAttrs[p+E])}const w=Object.keys(v._combined);for(let E=0;E<w.length;E++){const k=parseInt(w[E],10);k>=p&&(this._combined[k-p+m]=v._combined[k])}}translateToString(v,p,m,y){p=p??0,m=m??this.length,v&&(m=Math.min(m,this.getTrimmedLength())),y&&(y.length=0);let b="";for(;p<m;){const S=this._data[3*p+0],w=2097151&S,E=2097152&S?this._combined[p]:w?(0,f.stringFromCodePoint)(w):u.WHITESPACE_CELL_CHAR;if(b+=E,y)for(let k=0;k<E.length;++k)y.push(p);p+=S>>22||1}return y&&y.push(p),b}}o.BufferLine=x},4841:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(l,c){if(l.start.y>l.end.y)throw new Error(`Buffer range end (${l.end.x}, ${l.end.y}) cannot be before start (${l.start.x}, ${l.start.y})`);return c*(l.end.y-l.start.y)+(l.end.x-l.start.x+1)}},4634:(a,o)=>{function l(c,d,u){if(d===c.length-1)return c[d].getTrimmedLength();const f=!c[d].hasContent(u-1)&&c[d].getWidth(u-1)===1,g=c[d+1].getWidth(0)===2;return f&&g?u-1:u}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(c,d,u,f,g){const x=[];for(let _=0;_<c.length-1;_++){let v=_,p=c.get(++v);if(!p.isWrapped)continue;const m=[c.get(_)];for(;v<c.length&&p.isWrapped;)m.push(p),p=c.get(++v);if(f>=_&&f<v){_+=m.length-1;continue}let y=0,b=l(m,y,d),S=1,w=0;for(;S<m.length;){const k=l(m,S,d),T=k-w,R=u-b,M=Math.min(T,R);m[y].copyCellsFrom(m[S],w,b,M,!1),b+=M,b===u&&(y++,b=0),w+=M,w===k&&(S++,w=0),b===0&&y!==0&&m[y-1].getWidth(u-1)===2&&(m[y].copyCellsFrom(m[y-1],u-1,b++,1,!1),m[y-1].setCell(u-1,g))}m[y].replaceCells(b,u,g);let E=0;for(let k=m.length-1;k>0&&(k>y||m[k].getTrimmedLength()===0);k--)E++;E>0&&(x.push(_+m.length-E),x.push(E)),_+=m.length-1}return x},o.reflowLargerCreateNewLayout=function(c,d){const u=[];let f=0,g=d[f],x=0;for(let _=0;_<c.length;_++)if(g===_){const v=d[++f];c.onDeleteEmitter.fire({index:_-x,amount:v}),_+=v-1,x+=v,g=d[++f]}else u.push(_);return{layout:u,countRemoved:x}},o.reflowLargerApplyNewLayout=function(c,d){const u=[];for(let f=0;f<d.length;f++)u.push(c.get(d[f]));for(let f=0;f<u.length;f++)c.set(f,u[f]);c.length=d.length},o.reflowSmallerGetNewLineLengths=function(c,d,u){const f=[],g=c.map((p,m)=>l(c,m,d)).reduce((p,m)=>p+m);let x=0,_=0,v=0;for(;v<g;){if(g-v<u){f.push(g-v);break}x+=u;const p=l(c,_,d);x>p&&(x-=p,_++);const m=c[_].getWidth(x-1)===2;m&&x--;const y=m?u-1:u;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 c=l(8460),d=l(844),u=l(9092);class f extends d.Disposable{constructor(x,_){super(),this._optionsService=x,this._bufferService=_,this._onBufferActivate=this.register(new c.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new u.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new u.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(x){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(x),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(x,_){this._normal.resize(x,_),this._alt.resize(x,_),this.setupTabStops(x)}setupTabStops(x){this._normal.setupTabStops(x),this._alt.setupTabStops(x)}}o.BufferSet=f},511:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const c=l(482),d=l(643),u=l(3734);class f extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(x){const _=new f;return _.setFromCharData(x),_}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,c.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(x){this.fg=x[d.CHAR_DATA_ATTR_INDEX],this.bg=0;let _=!1;if(x[d.CHAR_DATA_CHAR_INDEX].length>2)_=!0;else if(x[d.CHAR_DATA_CHAR_INDEX].length===2){const v=x[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=v&&v<=56319){const p=x[d.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=p&&p<=57343?this.content=1024*(v-55296)+p-56320+65536|x[d.CHAR_DATA_WIDTH_INDEX]<<22:_=!0}else _=!0}else this.content=x[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|x[d.CHAR_DATA_WIDTH_INDEX]<<22;_&&(this.combinedData=x[d.CHAR_DATA_CHAR_INDEX],this.content=2097152|x[d.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 c=l(8460),d=l(844);class u{get id(){return this._id}constructor(g){this.line=g,this.isDisposed=!1,this._disposables=[],this._id=u._nextId++,this._onDispose=this.register(new c.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,d.disposeArray)(this._disposables),this._disposables.length=0)}register(g){return this._disposables.push(g),g}}o.Marker=u,u._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,c,d;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,function(u){u.NUL="\0",u.SOH="",u.STX="",u.ETX="",u.EOT="",u.ENQ="",u.ACK="",u.BEL="\x07",u.BS="\b",u.HT="	",u.LF=`
`,u.VT="\v",u.FF="\f",u.CR="\r",u.SO="",u.SI="",u.DLE="",u.DC1="",u.DC2="",u.DC3="",u.DC4="",u.NAK="",u.SYN="",u.ETB="",u.CAN="",u.EM="",u.SUB="",u.ESC="\x1B",u.FS="",u.GS="",u.RS="",u.US="",u.SP=" ",u.DEL=""}(l||(o.C0=l={})),function(u){u.PAD="",u.HOP="",u.BPH="",u.NBH="",u.IND="",u.NEL="",u.SSA="",u.ESA="",u.HTS="",u.HTJ="",u.VTS="",u.PLD="",u.PLU="",u.RI="",u.SS2="",u.SS3="",u.DCS="",u.PU1="",u.PU2="",u.STS="",u.CCH="",u.MW="",u.SPA="",u.EPA="",u.SOS="",u.SGCI="",u.SCI="",u.CSI="",u.ST="",u.OSC="",u.PM="",u.APC=""}(c||(o.C1=c={})),function(u){u.ST=`${l.ESC}\\`}(d||(o.C1_ESCAPED=d={}))},7399:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const c=l(2584),d={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(u,f,g,x){const _={type:0,cancel:!1,key:void 0},v=(u.shiftKey?1:0)|(u.altKey?2:0)|(u.ctrlKey?4:0)|(u.metaKey?8:0);switch(u.keyCode){case 0:u.key==="UIKeyInputUpArrow"?_.key=f?c.C0.ESC+"OA":c.C0.ESC+"[A":u.key==="UIKeyInputLeftArrow"?_.key=f?c.C0.ESC+"OD":c.C0.ESC+"[D":u.key==="UIKeyInputRightArrow"?_.key=f?c.C0.ESC+"OC":c.C0.ESC+"[C":u.key==="UIKeyInputDownArrow"&&(_.key=f?c.C0.ESC+"OB":c.C0.ESC+"[B");break;case 8:_.key=u.ctrlKey?"\b":c.C0.DEL,u.altKey&&(_.key=c.C0.ESC+_.key);break;case 9:if(u.shiftKey){_.key=c.C0.ESC+"[Z";break}_.key=c.C0.HT,_.cancel=!0;break;case 13:_.key=u.altKey?c.C0.ESC+c.C0.CR:c.C0.CR,_.cancel=!0;break;case 27:_.key=c.C0.ESC,u.altKey&&(_.key=c.C0.ESC+c.C0.ESC),_.cancel=!0;break;case 37:if(u.metaKey)break;v?(_.key=c.C0.ESC+"[1;"+(v+1)+"D",_.key===c.C0.ESC+"[1;3D"&&(_.key=c.C0.ESC+(g?"b":"[1;5D"))):_.key=f?c.C0.ESC+"OD":c.C0.ESC+"[D";break;case 39:if(u.metaKey)break;v?(_.key=c.C0.ESC+"[1;"+(v+1)+"C",_.key===c.C0.ESC+"[1;3C"&&(_.key=c.C0.ESC+(g?"f":"[1;5C"))):_.key=f?c.C0.ESC+"OC":c.C0.ESC+"[C";break;case 38:if(u.metaKey)break;v?(_.key=c.C0.ESC+"[1;"+(v+1)+"A",g||_.key!==c.C0.ESC+"[1;3A"||(_.key=c.C0.ESC+"[1;5A")):_.key=f?c.C0.ESC+"OA":c.C0.ESC+"[A";break;case 40:if(u.metaKey)break;v?(_.key=c.C0.ESC+"[1;"+(v+1)+"B",g||_.key!==c.C0.ESC+"[1;3B"||(_.key=c.C0.ESC+"[1;5B")):_.key=f?c.C0.ESC+"OB":c.C0.ESC+"[B";break;case 45:u.shiftKey||u.ctrlKey||(_.key=c.C0.ESC+"[2~");break;case 46:_.key=v?c.C0.ESC+"[3;"+(v+1)+"~":c.C0.ESC+"[3~";break;case 36:_.key=v?c.C0.ESC+"[1;"+(v+1)+"H":f?c.C0.ESC+"OH":c.C0.ESC+"[H";break;case 35:_.key=v?c.C0.ESC+"[1;"+(v+1)+"F":f?c.C0.ESC+"OF":c.C0.ESC+"[F";break;case 33:u.shiftKey?_.type=2:u.ctrlKey?_.key=c.C0.ESC+"[5;"+(v+1)+"~":_.key=c.C0.ESC+"[5~";break;case 34:u.shiftKey?_.type=3:u.ctrlKey?_.key=c.C0.ESC+"[6;"+(v+1)+"~":_.key=c.C0.ESC+"[6~";break;case 112:_.key=v?c.C0.ESC+"[1;"+(v+1)+"P":c.C0.ESC+"OP";break;case 113:_.key=v?c.C0.ESC+"[1;"+(v+1)+"Q":c.C0.ESC+"OQ";break;case 114:_.key=v?c.C0.ESC+"[1;"+(v+1)+"R":c.C0.ESC+"OR";break;case 115:_.key=v?c.C0.ESC+"[1;"+(v+1)+"S":c.C0.ESC+"OS";break;case 116:_.key=v?c.C0.ESC+"[15;"+(v+1)+"~":c.C0.ESC+"[15~";break;case 117:_.key=v?c.C0.ESC+"[17;"+(v+1)+"~":c.C0.ESC+"[17~";break;case 118:_.key=v?c.C0.ESC+"[18;"+(v+1)+"~":c.C0.ESC+"[18~";break;case 119:_.key=v?c.C0.ESC+"[19;"+(v+1)+"~":c.C0.ESC+"[19~";break;case 120:_.key=v?c.C0.ESC+"[20;"+(v+1)+"~":c.C0.ESC+"[20~";break;case 121:_.key=v?c.C0.ESC+"[21;"+(v+1)+"~":c.C0.ESC+"[21~";break;case 122:_.key=v?c.C0.ESC+"[23;"+(v+1)+"~":c.C0.ESC+"[23~";break;case 123:_.key=v?c.C0.ESC+"[24;"+(v+1)+"~":c.C0.ESC+"[24~";break;default:if(!u.ctrlKey||u.shiftKey||u.altKey||u.metaKey)if(g&&!x||!u.altKey||u.metaKey)!g||u.altKey||u.ctrlKey||u.shiftKey||!u.metaKey?u.key&&!u.ctrlKey&&!u.altKey&&!u.metaKey&&u.keyCode>=48&&u.key.length===1?_.key=u.key:u.key&&u.ctrlKey&&(u.key==="_"&&(_.key=c.C0.US),u.key==="@"&&(_.key=c.C0.NUL)):u.keyCode===65&&(_.type=1);else{const p=d[u.keyCode],m=p==null?void 0:p[u.shiftKey?1:0];if(m)_.key=c.C0.ESC+m;else if(u.keyCode>=65&&u.keyCode<=90){const y=u.ctrlKey?u.keyCode-64:u.keyCode+32;let b=String.fromCharCode(y);u.shiftKey&&(b=b.toUpperCase()),_.key=c.C0.ESC+b}else if(u.keyCode===32)_.key=c.C0.ESC+(u.ctrlKey?c.C0.NUL:" ");else if(u.key==="Dead"&&u.code.startsWith("Key")){let y=u.code.slice(3,4);u.shiftKey||(y=y.toLowerCase()),_.key=c.C0.ESC+y,_.cancel=!0}}else u.keyCode>=65&&u.keyCode<=90?_.key=String.fromCharCode(u.keyCode-64):u.keyCode===32?_.key=c.C0.NUL:u.keyCode>=51&&u.keyCode<=55?_.key=String.fromCharCode(u.keyCode-51+27):u.keyCode===56?_.key=c.C0.DEL:u.keyCode===219?_.key=c.C0.ESC:u.keyCode===220?_.key=c.C0.FS:u.keyCode===221&&(_.key=c.C0.GS)}return _}},482:(a,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,c=0,d=l.length){let u="";for(let f=c;f<d;++f){let g=l[f];g>65535?(g-=65536,u+=String.fromCharCode(55296+(g>>10))+String.fromCharCode(g%1024+56320)):u+=String.fromCharCode(g)}return u},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(l,c){const d=l.length;if(!d)return 0;let u=0,f=0;if(this._interim){const g=l.charCodeAt(f++);56320<=g&&g<=57343?c[u++]=1024*(this._interim-55296)+g-56320+65536:(c[u++]=this._interim,c[u++]=g),this._interim=0}for(let g=f;g<d;++g){const x=l.charCodeAt(g);if(55296<=x&&x<=56319){if(++g>=d)return this._interim=x,u;const _=l.charCodeAt(g);56320<=_&&_<=57343?c[u++]=1024*(x-55296)+_-56320+65536:(c[u++]=x,c[u++]=_)}else x!==65279&&(c[u++]=x)}return u}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(l,c){const d=l.length;if(!d)return 0;let u,f,g,x,_=0,v=0,p=0;if(this.interim[0]){let b=!1,S=this.interim[0];S&=(224&S)==192?31:(240&S)==224?15:7;let w,E=0;for(;(w=63&this.interim[++E])&&E<4;)S<<=6,S|=w;const k=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,T=k-E;for(;p<T;){if(p>=d)return 0;if(w=l[p++],(192&w)!=128){p--,b=!0;break}this.interim[E++]=w,S<<=6,S|=63&w}b||(k===2?S<128?p--:c[_++]=S:k===3?S<2048||S>=55296&&S<=57343||S===65279||(c[_++]=S):S<65536||S>1114111||(c[_++]=S)),this.interim.fill(0)}const m=d-4;let y=p;for(;y<d;){for(;!(!(y<m)||128&(u=l[y])||128&(f=l[y+1])||128&(g=l[y+2])||128&(x=l[y+3]));)c[_++]=u,c[_++]=f,c[_++]=g,c[_++]=x,y+=4;if(u=l[y++],u<128)c[_++]=u;else if((224&u)==192){if(y>=d)return this.interim[0]=u,_;if(f=l[y++],(192&f)!=128){y--;continue}if(v=(31&u)<<6|63&f,v<128){y--;continue}c[_++]=v}else if((240&u)==224){if(y>=d)return this.interim[0]=u,_;if(f=l[y++],(192&f)!=128){y--;continue}if(y>=d)return this.interim[0]=u,this.interim[1]=f,_;if(g=l[y++],(192&g)!=128){y--;continue}if(v=(15&u)<<12|(63&f)<<6|63&g,v<2048||v>=55296&&v<=57343||v===65279)continue;c[_++]=v}else if((248&u)==240){if(y>=d)return this.interim[0]=u,_;if(f=l[y++],(192&f)!=128){y--;continue}if(y>=d)return this.interim[0]=u,this.interim[1]=f,_;if(g=l[y++],(192&g)!=128){y--;continue}if(y>=d)return this.interim[0]=u,this.interim[1]=f,this.interim[2]=g,_;if(x=l[y++],(192&x)!=128){y--;continue}if(v=(7&u)<<18|(63&f)<<12|(63&g)<<6|63&x,v<65536||v>1114111)continue;c[_++]=v}}return _}}},225:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const c=l(1480),d=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],u=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let 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<d.length;++g)f.fill(0,d[g][0],d[g][1]+1)}}wcwidth(g){return g<32?0:g<127?1:g<65536?f[g]:function(x,_){let v,p=0,m=_.length-1;if(x<_[0][0]||x>_[m][1])return!1;for(;m>=p;)if(v=p+m>>1,x>_[v][1])p=v+1;else{if(!(x<_[v][0]))return!0;m=v-1}return!1}(g,u)?0:g>=131072&&g<=196605||g>=196608&&g<=262141?2:1}charProperties(g,x){let _=this.wcwidth(g),v=_===0&&x!==0;if(v){const p=c.UnicodeService.extractWidth(x);p===0?v=!1:p>_&&(_=p)}return c.UnicodeService.createPropertyValue(0,_,v)}}},5981:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const c=l(8460),d=l(844);class u extends d.Disposable{constructor(g){super(),this._action=g,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new c.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(g,x){if(x!==void 0&&this._syncCalls>x)return void(this._syncCalls=0);if(this._pendingData+=g.length,this._writeBuffer.push(g),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let _;for(this._isSyncWriting=!0;_=this._writeBuffer.shift();){this._action(_);const v=this._callbacks.shift();v&&v()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(g,x){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(x),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=g.length,this._writeBuffer.push(g),this._callbacks.push(x)}_innerWrite(g=0,x=!0){const _=g||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const v=this._writeBuffer[this._bufferOffset],p=this._action(v,x);if(p){const y=b=>Date.now()-_>=12?setTimeout(()=>this._innerWrite(0,b)):this._innerWrite(_,b);return void p.catch(b=>(queueMicrotask(()=>{throw b}),Promise.resolve(!1))).then(y)}const m=this._callbacks[this._bufferOffset];if(m&&m(),this._bufferOffset++,this._pendingData-=v.length,Date.now()-_>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}o.WriteBuffer=u},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})$/,c=/^[\da-f]+$/;function d(u,f){const g=u.toString(16),x=g.length<2?"0"+g:g;switch(f){case 4:return g[0];case 8:return x;case 12:return(x+x).slice(0,3);default:return x+x}}o.parseColor=function(u){if(!u)return;let f=u.toLowerCase();if(f.indexOf("rgb:")===0){f=f.slice(4);const g=l.exec(f);if(g){const x=g[1]?15:g[4]?255:g[7]?4095:65535;return[Math.round(parseInt(g[1]||g[4]||g[7]||g[10],16)/x*255),Math.round(parseInt(g[2]||g[5]||g[8]||g[11],16)/x*255),Math.round(parseInt(g[3]||g[6]||g[9]||g[12],16)/x*255)]}}else if(f.indexOf("#")===0&&(f=f.slice(1),c.exec(f)&&[3,6,9,12].includes(f.length))){const g=f.length/3,x=[0,0,0];for(let _=0;_<3;++_){const v=parseInt(f.slice(g*_,g*_+g),16);x[_]=g===1?v<<4:g===2?v:g===3?v>>4:v>>8}return x}},o.toRgbString=function(u,f=16){const[g,x,_]=u;return`rgb:${d(g,f)}/${d(x,f)}/${d(_,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 c=l(482),d=l(8742),u=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(x,_){this._handlers[x]===void 0&&(this._handlers[x]=[]);const v=this._handlers[x];return v.push(_),{dispose:()=>{const p=v.indexOf(_);p!==-1&&v.splice(p,1)}}}clearHandler(x){this._handlers[x]&&delete this._handlers[x]}setHandlerFallback(x){this._handlerFb=x}reset(){if(this._active.length)for(let x=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;x>=0;--x)this._active[x].unhook(!1);this._stack.paused=!1,this._active=f,this._ident=0}hook(x,_){if(this.reset(),this._ident=x,this._active=this._handlers[x]||f,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].hook(_);else this._handlerFb(this._ident,"HOOK",_)}put(x,_,v){if(this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].put(x,_,v);else this._handlerFb(this._ident,"PUT",(0,c.utf32ToString)(x,_,v))}unhook(x,_=!0){if(this._active.length){let v=!1,p=this._active.length-1,m=!1;if(this._stack.paused&&(p=this._stack.loopPosition-1,v=_,m=this._stack.fallThrough,this._stack.paused=!1),!m&&v===!1){for(;p>=0&&(v=this._active[p].unhook(x),v!==!0);p--)if(v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!1,v;p--}for(;p>=0;p--)if(v=this._active[p].unhook(!1),v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!0,v}else this._handlerFb(this._ident,"UNHOOK",x);this._active=f,this._ident=0}};const g=new d.Params;g.addParam(0),o.DcsHandler=class{constructor(x){this._handler=x,this._data="",this._params=g,this._hitLimit=!1}hook(x){this._params=x.length>1||x.params[0]?x.clone():g,this._data="",this._hitLimit=!1}put(x,_,v){this._hitLimit||(this._data+=(0,c.utf32ToString)(x,_,v),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(x){let _=!1;if(this._hitLimit)_=!1;else if(x&&(_=this._handler(this._data,this._params),_ instanceof Promise))return _.then(v=>(this._params=g,this._data="",this._hitLimit=!1,v));return this._params=g,this._data="",this._hitLimit=!1,_}}},2015:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const c=l(844),d=l(8742),u=l(6242),f=l(6351);class g{constructor(p){this.table=new Uint8Array(p)}setDefault(p,m){this.table.fill(p<<4|m)}add(p,m,y,b){this.table[m<<8|p]=y<<4|b}addMany(p,m,y,b){for(let S=0;S<p.length;S++)this.table[m<<8|p[S]]=y<<4|b}}o.TransitionTable=g;const x=160;o.VT500_TRANSITION_TABLE=function(){const v=new g(4095),p=Array.apply(null,Array(256)).map((E,k)=>k),m=(E,k)=>p.slice(E,k),y=m(32,127),b=m(0,24);b.push(25),b.push.apply(b,m(28,32));const S=m(0,14);let w;for(w in v.setDefault(1,0),v.addMany(y,0,2,0),S)v.addMany([24,26,153,154],w,3,0),v.addMany(m(128,144),w,3,0),v.addMany(m(144,152),w,3,0),v.add(156,w,0,0),v.add(27,w,11,1),v.add(157,w,4,8),v.addMany([152,158,159],w,0,7),v.add(155,w,11,3),v.add(144,w,11,9);return v.addMany(b,0,3,0),v.addMany(b,1,3,1),v.add(127,1,0,1),v.addMany(b,8,0,8),v.addMany(b,3,3,3),v.add(127,3,0,3),v.addMany(b,4,3,4),v.add(127,4,0,4),v.addMany(b,6,3,6),v.addMany(b,5,3,5),v.add(127,5,0,5),v.addMany(b,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(m(28,32),8,0,8),v.addMany([88,94,95],1,0,7),v.addMany(y,7,0,7),v.addMany(b,7,0,7),v.add(156,7,0,0),v.add(127,7,0,7),v.add(91,1,11,3),v.addMany(m(64,127),3,7,0),v.addMany(m(48,60),3,8,4),v.addMany([60,61,62,63],3,9,4),v.addMany(m(48,60),4,8,4),v.addMany(m(64,127),4,7,0),v.addMany([60,61,62,63],4,0,6),v.addMany(m(32,64),6,0,6),v.add(127,6,0,6),v.addMany(m(64,127),6,0,0),v.addMany(m(32,48),3,9,5),v.addMany(m(32,48),5,9,5),v.addMany(m(48,64),5,0,6),v.addMany(m(64,127),5,7,0),v.addMany(m(32,48),4,9,5),v.addMany(m(32,48),1,9,2),v.addMany(m(32,48),2,9,2),v.addMany(m(48,127),2,10,0),v.addMany(m(48,80),1,10,0),v.addMany(m(81,88),1,10,0),v.addMany([89,90,92],1,10,0),v.addMany(m(96,127),1,10,0),v.add(80,1,11,9),v.addMany(b,9,0,9),v.add(127,9,0,9),v.addMany(m(28,32),9,0,9),v.addMany(m(32,48),9,9,12),v.addMany(m(48,60),9,8,10),v.addMany([60,61,62,63],9,9,10),v.addMany(b,11,0,11),v.addMany(m(32,128),11,0,11),v.addMany(m(28,32),11,0,11),v.addMany(b,10,0,10),v.add(127,10,0,10),v.addMany(m(28,32),10,0,10),v.addMany(m(48,60),10,8,10),v.addMany([60,61,62,63],10,0,11),v.addMany(m(32,48),10,9,12),v.addMany(b,12,0,12),v.add(127,12,0,12),v.addMany(m(28,32),12,0,12),v.addMany(m(32,48),12,9,12),v.addMany(m(48,64),12,0,11),v.addMany(m(64,127),12,12,13),v.addMany(m(64,127),10,12,13),v.addMany(m(64,127),9,12,13),v.addMany(b,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(x,0,2,0),v.add(x,8,5,8),v.add(x,6,0,6),v.add(x,11,0,11),v.add(x,13,13,13),v}();class _ extends c.Disposable{constructor(p=o.VT500_TRANSITION_TABLE){super(),this._transitions=p,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new d.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(m,y,b)=>{},this._executeHandlerFb=m=>{},this._csiHandlerFb=(m,y)=>{},this._escHandlerFb=m=>{},this._errorHandlerFb=m=>m,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,c.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new u.OscParser),this._dcsParser=this.register(new f.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(p,m=[64,126]){let y=0;if(p.prefix){if(p.prefix.length>1)throw new Error("only one byte as prefix supported");if(y=p.prefix.charCodeAt(0),y&&60>y||y>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(p.intermediates){if(p.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let S=0;S<p.intermediates.length;++S){const w=p.intermediates.charCodeAt(S);if(32>w||w>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");y<<=8,y|=w}}if(p.final.length!==1)throw new Error("final must be a single byte");const b=p.final.charCodeAt(0);if(m[0]>b||b>m[1])throw new Error(`final must be in range ${m[0]} .. ${m[1]}`);return y<<=8,y|=b,y}identToString(p){const m=[];for(;p;)m.push(String.fromCharCode(255&p)),p>>=8;return m.reverse().join("")}setPrintHandler(p){this._printHandler=p}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(p,m){const y=this._identifier(p,[48,126]);this._escHandlers[y]===void 0&&(this._escHandlers[y]=[]);const b=this._escHandlers[y];return b.push(m),{dispose:()=>{const S=b.indexOf(m);S!==-1&&b.splice(S,1)}}}clearEscHandler(p){this._escHandlers[this._identifier(p,[48,126])]&&delete this._escHandlers[this._identifier(p,[48,126])]}setEscHandlerFallback(p){this._escHandlerFb=p}setExecuteHandler(p,m){this._executeHandlers[p.charCodeAt(0)]=m}clearExecuteHandler(p){this._executeHandlers[p.charCodeAt(0)]&&delete this._executeHandlers[p.charCodeAt(0)]}setExecuteHandlerFallback(p){this._executeHandlerFb=p}registerCsiHandler(p,m){const y=this._identifier(p);this._csiHandlers[y]===void 0&&(this._csiHandlers[y]=[]);const b=this._csiHandlers[y];return b.push(m),{dispose:()=>{const S=b.indexOf(m);S!==-1&&b.splice(S,1)}}}clearCsiHandler(p){this._csiHandlers[this._identifier(p)]&&delete this._csiHandlers[this._identifier(p)]}setCsiHandlerFallback(p){this._csiHandlerFb=p}registerDcsHandler(p,m){return this._dcsParser.registerHandler(this._identifier(p),m)}clearDcsHandler(p){this._dcsParser.clearHandler(this._identifier(p))}setDcsHandlerFallback(p){this._dcsParser.setHandlerFallback(p)}registerOscHandler(p,m){return this._oscParser.registerHandler(p,m)}clearOscHandler(p){this._oscParser.clearHandler(p)}setOscHandlerFallback(p){this._oscParser.setHandlerFallback(p)}setErrorHandler(p){this._errorHandler=p}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(p,m,y,b,S){this._parseStack.state=p,this._parseStack.handlers=m,this._parseStack.handlerPos=y,this._parseStack.transition=b,this._parseStack.chunkPos=S}parse(p,m,y){let b,S=0,w=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&&(b=k[T](this._params),b!==!0);T--)if(b instanceof Promise)return this._parseStack.handlerPos=T,b}this._parseStack.handlers=[];break;case 4:if(y===!1&&T>-1){for(;T>=0&&(b=k[T](),b!==!0);T--)if(b instanceof Promise)return this._parseStack.handlerPos=T,b}this._parseStack.handlers=[];break;case 6:if(S=p[this._parseStack.chunkPos],b=this._dcsParser.unhook(S!==24&&S!==26,y),b)return b;S===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(S=p[this._parseStack.chunkPos],b=this._oscParser.end(S!==24&&S!==26,y),b)return b;S===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<m;++k){switch(S=p[k],w=this._transitions.table[this.currentState<<8|(S<160?S:x)],w>>4){case 2:for(let j=k+1;;++j){if(j>=m||(S=p[j])<32||S>126&&S<x){this._printHandler(p,k,j),k=j-1;break}if(++j>=m||(S=p[j])<32||S>126&&S<x){this._printHandler(p,k,j),k=j-1;break}if(++j>=m||(S=p[j])<32||S>126&&S<x){this._printHandler(p,k,j),k=j-1;break}if(++j>=m||(S=p[j])<32||S>126&&S<x){this._printHandler(p,k,j),k=j-1;break}}break;case 3:this._executeHandlers[S]?this._executeHandlers[S]():this._executeHandlerFb(S),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:k,code:S,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const T=this._csiHandlers[this._collect<<8|S];let R=T?T.length-1:-1;for(;R>=0&&(b=T[R](this._params),b!==!0);R--)if(b instanceof Promise)return this._preserveStack(3,T,R,w,k),b;R<0&&this._csiHandlerFb(this._collect<<8|S,this._params),this.precedingJoinState=0;break;case 8:do switch(S){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(S-48)}while(++k<m&&(S=p[k])>47&&S<60);k--;break;case 9:this._collect<<=8,this._collect|=S;break;case 10:const M=this._escHandlers[this._collect<<8|S];let L=M?M.length-1:-1;for(;L>=0&&(b=M[L](),b!==!0);L--)if(b instanceof Promise)return this._preserveStack(4,M,L,w,k),b;L<0&&this._escHandlerFb(this._collect<<8|S),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|S,this._params);break;case 13:for(let j=k+1;;++j)if(j>=m||(S=p[j])===24||S===26||S===27||S>127&&S<x){this._dcsParser.put(p,k,j),k=j-1;break}break;case 14:if(b=this._dcsParser.unhook(S!==24&&S!==26),b)return this._preserveStack(6,[],0,w,k),b;S===27&&(w|=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 j=k+1;;j++)if(j>=m||(S=p[j])<32||S>127&&S<x){this._oscParser.put(p,k,j),k=j-1;break}break;case 6:if(b=this._oscParser.end(S!==24&&S!==26),b)return this._preserveStack(5,[],0,w,k),b;S===27&&(w|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&w}}}o.EscapeSequenceParser=_},6242:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const c=l(5770),d=l(482),u=[];o.OscParser=class{constructor(){this._state=0,this._active=u,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(f,g){this._handlers[f]===void 0&&(this._handlers[f]=[]);const x=this._handlers[f];return x.push(g),{dispose:()=>{const _=x.indexOf(g);_!==-1&&x.splice(_,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=u}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=u,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||u,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,x){if(this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].put(f,g,x);else this._handlerFb(this._id,"PUT",(0,d.utf32ToString)(f,g,x))}start(){this.reset(),this._state=1}put(f,g,x){if(this._state!==3){if(this._state===1)for(;g<x;){const _=f[g++];if(_===59){this._state=2,this._start();break}if(_<48||57<_)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+_-48}this._state===2&&x-g>0&&this._put(f,g,x)}}end(f,g=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let x=!1,_=this._active.length-1,v=!1;if(this._stack.paused&&(_=this._stack.loopPosition-1,x=g,v=this._stack.fallThrough,this._stack.paused=!1),!v&&x===!1){for(;_>=0&&(x=this._active[_].end(f),x!==!0);_--)if(x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!1,x;_--}for(;_>=0;_--)if(x=this._active[_].end(!1),x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!0,x}else this._handlerFb(this._id,"END",f);this._active=u,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,x){this._hitLimit||(this._data+=(0,d.utf32ToString)(f,g,x),this._data.length>c.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(x=>(this._data="",this._hitLimit=!1,x));return this._data="",this._hitLimit=!1,g}}},8742:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const l=2147483647;class c{static fromArray(u){const f=new c;if(!u.length)return f;for(let g=Array.isArray(u[0])?1:0;g<u.length;++g){const x=u[g];if(Array.isArray(x))for(let _=0;_<x.length;++_)f.addSubParam(x[_]);else f.addParam(x)}return f}constructor(u=32,f=32){if(this.maxLength=u,this.maxSubParamsLength=f,f>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(u),this.length=0,this._subParams=new Int32Array(f),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(u),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const u=new c(this.maxLength,this.maxSubParamsLength);return u.params.set(this.params),u.length=this.length,u._subParams.set(this._subParams),u._subParamsLength=this._subParamsLength,u._subParamsIdx.set(this._subParamsIdx),u._rejectDigits=this._rejectDigits,u._rejectSubDigits=this._rejectSubDigits,u._digitIsSub=this._digitIsSub,u}toArray(){const u=[];for(let f=0;f<this.length;++f){u.push(this.params[f]);const g=this._subParamsIdx[f]>>8,x=255&this._subParamsIdx[f];x-g>0&&u.push(Array.prototype.slice.call(this._subParams,g,x))}return u}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(u){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=u>l?l:u}}addSubParam(u){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=u>l?l:u,this._subParamsIdx[this.length-1]++}}hasSubParams(u){return(255&this._subParamsIdx[u])-(this._subParamsIdx[u]>>8)>0}getSubParams(u){const f=this._subParamsIdx[u]>>8,g=255&this._subParamsIdx[u];return g-f>0?this._subParams.subarray(f,g):null}getSubParamsAll(){const u={};for(let f=0;f<this.length;++f){const g=this._subParamsIdx[f]>>8,x=255&this._subParamsIdx[f];x-g>0&&(u[f]=this._subParams.slice(g,x))}return u}addDigit(u){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,x=g[f-1];g[f-1]=~x?Math.min(10*x+u,l):u}}o.Params=c},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,c){const d={instance:c,dispose:c.dispose,isDisposed:!1};this._addons.push(d),c.dispose=()=>this._wrappedAddonDispose(d),c.activate(l)}_wrappedAddonDispose(l){if(l.isDisposed)return;let c=-1;for(let d=0;d<this._addons.length;d++)if(this._addons[d]===l){c=d;break}if(c===-1)throw new Error("Could not dispose an addon that has not been loaded");l.isDisposed=!0,l.dispose.apply(l.instance),this._addons.splice(c,1)}}},8771:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const c=l(3785),d=l(511);o.BufferApiView=class{constructor(u,f){this._buffer=u,this.type=f}init(u){return this._buffer=u,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(u){const f=this._buffer.lines.get(u);if(f)return new c.BufferLineApiView(f)}getNullCell(){return new d.CellData}}},3785:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const c=l(511);o.BufferLineApiView=class{constructor(d){this._line=d}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(d,u){if(!(d<0||d>=this._line.length))return u?(this._line.loadCell(d,u),u):this._line.loadCell(d,new c.CellData)}translateToString(d,u,f){return this._line.translateToString(d,u,f)}}},8285:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const c=l(8771),d=l(8460),u=l(844);class f extends u.Disposable{constructor(x){super(),this._core=x,this._onBufferChange=this.register(new d.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new c.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new c.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}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,c){return this._core.registerCsiHandler(l,d=>c(d.toArray()))}addCsiHandler(l,c){return this.registerCsiHandler(l,c)}registerDcsHandler(l,c){return this._core.registerDcsHandler(l,(d,u)=>c(d,u.toArray()))}addDcsHandler(l,c){return this.registerDcsHandler(l,c)}registerEscHandler(l,c){return this._core.registerEscHandler(l,c)}addEscHandler(l,c){return this.registerEscHandler(l,c)}registerOscHandler(l,c){return this._core.registerOscHandler(l,c)}addOscHandler(l,c){return this.registerOscHandler(l,c)}}},7090:(a,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 c=this&&this.__decorate||function(v,p,m,y){var b,S=arguments.length,w=S<3?p:y===null?y=Object.getOwnPropertyDescriptor(p,m):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(v,p,m,y);else for(var E=v.length-1;E>=0;E--)(b=v[E])&&(w=(S<3?b(w):S>3?b(p,m,w):b(p,m))||w);return S>3&&w&&Object.defineProperty(p,m,w),w},d=this&&this.__param||function(v,p){return function(m,y){p(m,y,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const u=l(8460),f=l(844),g=l(5295),x=l(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let _=o.BufferService=class extends f.Disposable{get buffer(){return this.buffers.active}constructor(v){super(),this.isUserScrolling=!1,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new u.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(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,p){this.cols=v,this.rows=p,this.buffers.resize(v,p),this._onResize.fire({cols:v,rows:p})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(v,p=!1){const m=this.buffer;let y;y=this._cachedBlankLine,y&&y.length===this.cols&&y.getFg(0)===v.fg&&y.getBg(0)===v.bg||(y=m.getBlankLine(v,p),this._cachedBlankLine=y),y.isWrapped=p;const b=m.ybase+m.scrollTop,S=m.ybase+m.scrollBottom;if(m.scrollTop===0){const w=m.lines.isFull;S===m.lines.length-1?w?m.lines.recycle().copyFrom(y):m.lines.push(y.clone()):m.lines.splice(S+1,0,y.clone()),w?this.isUserScrolling&&(m.ydisp=Math.max(m.ydisp-1,0)):(m.ybase++,this.isUserScrolling||m.ydisp++)}else{const w=S-b+1;m.lines.shiftElements(b+1,w-1,-1),m.lines.set(S,y.clone())}this.isUserScrolling||(m.ydisp=m.ybase),this._onScroll.fire(m.ydisp)}scrollLines(v,p,m){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 b=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+v,y.ybase),0),b!==y.ydisp&&(p||this._onScroll.fire(y.ydisp))}};o.BufferService=_=c([d(0,x.IOptionsService)],_)},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,c){this._charsets[l]=c,this.glevel===l&&(this.charset=c)}}},1753:function(a,o,l){var c=this&&this.__decorate||function(y,b,S,w){var E,k=arguments.length,T=k<3?b:w===null?w=Object.getOwnPropertyDescriptor(b,S):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(y,b,S,w);else for(var R=y.length-1;R>=0;R--)(E=y[R])&&(T=(k<3?E(T):k>3?E(b,S,T):E(b,S))||T);return k>3&&T&&Object.defineProperty(b,S,T),T},d=this&&this.__param||function(y,b){return function(S,w){b(S,w,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const u=l(2585),f=l(8460),g=l(844),x={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 _(y,b){let S=(y.ctrl?16:0)|(y.shift?4:0)|(y.alt?8:0);return y.button===4?(S|=64,S|=y.action):(S|=3&y.button,4&y.button&&(S|=64),8&y.button&&(S|=128),y.action===32?S|=32:y.action!==0||b||(S|=3)),S}const v=String.fromCharCode,p={DEFAULT:y=>{const b=[_(y,!1)+32,y.col+32,y.row+32];return b[0]>255||b[1]>255||b[2]>255?"":`\x1B[M${v(b[0])}${v(b[1])}${v(b[2])}`},SGR:y=>{const b=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${_(y,!0)};${y.col};${y.row}${b}`},SGR_PIXELS:y=>{const b=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${_(y,!0)};${y.x};${y.y}${b}`}};let m=o.CoreMouseService=class extends g.Disposable{constructor(y,b){super(),this._bufferService=y,this._coreService=b,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 S of Object.keys(x))this.addProtocol(S,x[S]);for(const S of Object.keys(p))this.addEncoding(S,p[S]);this.reset()}addProtocol(y,b){this._protocols[y]=b}addEncoding(y,b){this._encodings[y]=b}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 b=this._encodings[this._activeEncoding](y);return b&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(b):this._coreService.triggerDataEvent(b,!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,b,S){if(S){if(y.x!==b.x||y.y!==b.y)return!1}else if(y.col!==b.col||y.row!==b.row)return!1;return y.button===b.button&&y.action===b.action&&y.ctrl===b.ctrl&&y.alt===b.alt&&y.shift===b.shift}};o.CoreMouseService=m=c([d(0,u.IBufferService),d(1,u.ICoreService)],m)},6975:function(a,o,l){var c=this&&this.__decorate||function(m,y,b,S){var w,E=arguments.length,k=E<3?y:S===null?S=Object.getOwnPropertyDescriptor(y,b):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(m,y,b,S);else for(var T=m.length-1;T>=0;T--)(w=m[T])&&(k=(E<3?w(k):E>3?w(y,b,k):w(y,b))||k);return E>3&&k&&Object.defineProperty(y,b,k),k},d=this&&this.__param||function(m,y){return function(b,S){y(b,S,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const u=l(1439),f=l(8460),g=l(844),x=l(2585),_=Object.freeze({insertMode:!1}),v=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let p=o.CoreService=class extends g.Disposable{constructor(m,y,b){super(),this._bufferService=m,this._logService=y,this._optionsService=b,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,u.clone)(_),this.decPrivateModes=(0,u.clone)(v)}reset(){this.modes=(0,u.clone)(_),this.decPrivateModes=(0,u.clone)(v)}triggerDataEvent(m,y=!1){if(this._optionsService.rawOptions.disableStdin)return;const b=this._bufferService.buffer;y&&this._optionsService.rawOptions.scrollOnUserInput&&b.ybase!==b.ydisp&&this._onRequestScrollToBottom.fire(),y&&this._onUserInput.fire(),this._logService.debug(`sending data "${m}"`,()=>m.split("").map(S=>S.charCodeAt(0))),this._onData.fire(m)}triggerBinaryEvent(m){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${m}"`,()=>m.split("").map(y=>y.charCodeAt(0))),this._onBinary.fire(m))}};o.CoreService=p=c([d(0,x.IBufferService),d(1,x.ILogService),d(2,x.IOptionsService)],p)},9074:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const c=l(8055),d=l(8460),u=l(844),f=l(6106);let g=0,x=0;class _ extends u.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new f.SortedList(m=>m==null?void 0:m.marker.line),this._onDecorationRegistered=this.register(new d.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new d.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,u.toDisposable)(()=>this.reset()))}registerDecoration(m){if(m.marker.isDisposed)return;const y=new v(m);if(y){const b=y.marker.onDispose(()=>y.dispose());y.onDispose(()=>{y&&(this._decorations.delete(y)&&this._onDecorationRemoved.fire(y),b.dispose())}),this._decorations.insert(y),this._onDecorationRegistered.fire(y)}return y}reset(){for(const m of this._decorations.values())m.dispose();this._decorations.clear()}*getDecorationsAtCell(m,y,b){let S=0,w=0;for(const E of this._decorations.getKeyIterator(y))S=E.options.x??0,w=S+(E.options.width??1),m>=S&&m<w&&(!b||(E.options.layer??"bottom")===b)&&(yield E)}forEachDecorationAtCell(m,y,b,S){this._decorations.forEachByKey(y,w=>{g=w.options.x??0,x=g+(w.options.width??1),m>=g&&m<x&&(!b||(w.options.layer??"bottom")===b)&&S(w)})}}o.DecorationService=_;class v extends u.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=c.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=c.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(m){super(),this.options=m,this.onRenderEmitter=this.register(new d.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=m.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 c=l(2585),d=l(8343);class u{constructor(...g){this._entries=new Map;for(const[x,_]of g)this.set(x,_)}set(g,x){const _=this._entries.get(g);return this._entries.set(g,x),_}forEach(g){for(const[x,_]of this._entries.entries())g(x,_)}has(g){return this._entries.has(g)}get(g){return this._entries.get(g)}}o.ServiceCollection=u,o.InstantiationService=class{constructor(){this._services=new u,this._services.set(c.IInstantiationService,this)}setService(f,g){this._services.set(f,g)}getService(f){return this._services.get(f)}createInstance(f,...g){const x=(0,d.getServiceDependencies)(f).sort((p,m)=>p.index-m.index),_=[];for(const p of x){const m=this._services.get(p.id);if(!m)throw new Error(`[createInstance] ${f.name} depends on UNKNOWN service ${p.id}.`);_.push(m)}const v=x.length>0?x[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,..._)}}},7866:function(a,o,l){var c=this&&this.__decorate||function(v,p,m,y){var b,S=arguments.length,w=S<3?p:y===null?y=Object.getOwnPropertyDescriptor(p,m):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(v,p,m,y);else for(var E=v.length-1;E>=0;E--)(b=v[E])&&(w=(S<3?b(w):S>3?b(p,m,w):b(p,m))||w);return S>3&&w&&Object.defineProperty(p,m,w),w},d=this&&this.__param||function(v,p){return function(m,y){p(m,y,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const u=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 x,_=o.LogService=class extends u.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())),x=this}_updateLogLevel(){this._logLevel=g[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(v){for(let p=0;p<v.length;p++)typeof v[p]=="function"&&(v[p]=v[p]())}_log(v,p,m){this._evalLazyOptionalParams(m),v.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+p,...m)}trace(v,...p){var m;this._logLevel<=f.LogLevelEnum.TRACE&&this._log(((m=this._optionsService.options.logger)==null?void 0:m.trace.bind(this._optionsService.options.logger))??console.log,v,p)}debug(v,...p){var m;this._logLevel<=f.LogLevelEnum.DEBUG&&this._log(((m=this._optionsService.options.logger)==null?void 0:m.debug.bind(this._optionsService.options.logger))??console.log,v,p)}info(v,...p){var m;this._logLevel<=f.LogLevelEnum.INFO&&this._log(((m=this._optionsService.options.logger)==null?void 0:m.info.bind(this._optionsService.options.logger))??console.info,v,p)}warn(v,...p){var m;this._logLevel<=f.LogLevelEnum.WARN&&this._log(((m=this._optionsService.options.logger)==null?void 0:m.warn.bind(this._optionsService.options.logger))??console.warn,v,p)}error(v,...p){var m;this._logLevel<=f.LogLevelEnum.ERROR&&this._log(((m=this._optionsService.options.logger)==null?void 0:m.error.bind(this._optionsService.options.logger))??console.error,v,p)}};o.LogService=_=c([d(0,f.IOptionsService)],_),o.setTraceLogger=function(v){x=v},o.traceCall=function(v,p,m){if(typeof m.value!="function")throw new Error("not supported");const y=m.value;m.value=function(...b){if(x.logLevel!==f.LogLevelEnum.TRACE)return y.apply(this,b);x.trace(`GlyphRenderer#${y.name}(${b.map(w=>JSON.stringify(w)).join(", ")})`);const S=y.apply(this,b);return x.trace(`GlyphRenderer#${y.name} return`,S),S}}},7302:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const c=l(8460),d=l(844),u=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:u.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 d.Disposable{constructor(_){super(),this._onOptionChange=this.register(new c.EventEmitter),this.onOptionChange=this._onOptionChange.event;const v={...o.DEFAULT_OPTIONS};for(const p in _)if(p in v)try{const m=_[p];v[p]=this._sanitizeAndValidateOption(p,m)}catch(m){console.error(m)}this.rawOptions=v,this.options={...v},this._setupOptions(),this.register((0,d.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(_,v){return this.onOptionChange(p=>{p===_&&v(this.rawOptions[_])})}onMultipleOptionChange(_,v){return this.onOptionChange(p=>{_.indexOf(p)!==-1&&v()})}_setupOptions(){const _=p=>{if(!(p in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${p}"`);return this.rawOptions[p]},v=(p,m)=>{if(!(p in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${p}"`);m=this._sanitizeAndValidateOption(p,m),this.rawOptions[p]!==m&&(this.rawOptions[p]=m,this._onOptionChange.fire(p))};for(const p in this.rawOptions){const m={get:_.bind(this,p),set:v.bind(this,p)};Object.defineProperty(this.options,p,m)}}_sanitizeAndValidateOption(_,v){switch(_){case"cursorStyle":if(v||(v=o.DEFAULT_OPTIONS[_]),!function(p){return p==="block"||p==="underline"||p==="bar"}(v))throw new Error(`"${v}" is not a valid value for ${_}`);break;case"wordSeparator":v||(v=o.DEFAULT_OPTIONS[_]);break;case"fontWeight":case"fontWeightBold":if(typeof v=="number"&&1<=v&&v<=1e3)break;v=f.includes(v)?v:o.DEFAULT_OPTIONS[_];break;case"cursorWidth":v=Math.floor(v);case"lineHeight":case"tabStopWidth":if(v<1)throw new Error(`${_} 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(`${_} cannot be less than 0, value: ${v}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(v<=0)throw new Error(`${_} cannot be less than or equal to 0, value: ${v}`);break;case"rows":case"cols":if(!v&&v!==0)throw new Error(`${_} must be numeric, value: ${v}`);break;case"windowsPty":v=v??{}}return v}}o.OptionsService=g},2660:function(a,o,l){var c=this&&this.__decorate||function(g,x,_,v){var p,m=arguments.length,y=m<3?x:v===null?v=Object.getOwnPropertyDescriptor(x,_):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(g,x,_,v);else for(var b=g.length-1;b>=0;b--)(p=g[b])&&(y=(m<3?p(y):m>3?p(x,_,y):p(x,_))||y);return m>3&&y&&Object.defineProperty(x,_,y),y},d=this&&this.__param||function(g,x){return function(_,v){x(_,v,g)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const u=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 x=this._bufferService.buffer;if(g.id===void 0){const b=x.addMarker(x.ybase+x.y),S={data:g,id:this._nextId++,lines:[b]};return b.onDispose(()=>this._removeMarkerFromLink(S,b)),this._dataByLinkId.set(S.id,S),S.id}const _=g,v=this._getEntryIdKey(_),p=this._entriesWithId.get(v);if(p)return this.addLineToLink(p.id,x.ybase+x.y),p.id;const m=x.addMarker(x.ybase+x.y),y={id:this._nextId++,key:this._getEntryIdKey(_),data:_,lines:[m]};return m.onDispose(()=>this._removeMarkerFromLink(y,m)),this._entriesWithId.set(y.key,y),this._dataByLinkId.set(y.id,y),y.id}addLineToLink(g,x){const _=this._dataByLinkId.get(g);if(_&&_.lines.every(v=>v.line!==x)){const v=this._bufferService.buffer.addMarker(x);_.lines.push(v),v.onDispose(()=>this._removeMarkerFromLink(_,v))}}getLinkData(g){var x;return(x=this._dataByLinkId.get(g))==null?void 0:x.data}_getEntryIdKey(g){return`${g.id};;${g.uri}`}_removeMarkerFromLink(g,x){const _=g.lines.indexOf(x);_!==-1&&(g.lines.splice(_,1),g.lines.length===0&&(g.data.id!==void 0&&this._entriesWithId.delete(g.key),this._dataByLinkId.delete(g.id)))}};o.OscLinkService=f=c([d(0,u.IBufferService)],f)},8343:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const l="di$target",c="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(d){return d[c]||[]},o.createDecorator=function(d){if(o.serviceRegistry.has(d))return o.serviceRegistry.get(d);const u=function(f,g,x){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(_,v,p){v[l]===v?v[c].push({id:_,index:p}):(v[c]=[{id:_,index:p}],v[l]=v)})(u,f,x)};return u.toString=()=>d,o.serviceRegistry.set(d,u),u}},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 c=l(8343);var d;o.IBufferService=(0,c.createDecorator)("BufferService"),o.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),o.ICoreService=(0,c.createDecorator)("CoreService"),o.ICharsetService=(0,c.createDecorator)("CharsetService"),o.IInstantiationService=(0,c.createDecorator)("InstantiationService"),function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"}(d||(o.LogLevelEnum=d={})),o.ILogService=(0,c.createDecorator)("LogService"),o.IOptionsService=(0,c.createDecorator)("OptionsService"),o.IOscLinkService=(0,c.createDecorator)("OscLinkService"),o.IUnicodeService=(0,c.createDecorator)("UnicodeService"),o.IDecorationService=(0,c.createDecorator)("DecorationService")},1480:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const c=l(8460),d=l(225);class u{static extractShouldJoin(g){return(1&g)!=0}static extractWidth(g){return g>>1&3}static extractCharKind(g){return g>>3}static createPropertyValue(g,x,_=!1){return(16777215&g)<<3|(3&x)<<1|(_?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new c.EventEmitter,this.onChange=this._onChange.event;const g=new d.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 x=0,_=0;const v=g.length;for(let p=0;p<v;++p){let m=g.charCodeAt(p);if(55296<=m&&m<=56319){if(++p>=v)return x+this.wcwidth(m);const S=g.charCodeAt(p);56320<=S&&S<=57343?m=1024*(m-55296)+S-56320+65536:x+=this.wcwidth(S)}const y=this.charProperties(m,_);let b=u.extractWidth(y);u.extractShouldJoin(y)&&(b-=u.extractWidth(_)),x+=b,_=y}return x}charProperties(g,x){return this._activeProvider.charProperties(g,x)}}o.UnicodeService=u}},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),c=i(844),d=i(5741),u=i(8285),f=i(7975),g=i(7090),x=["cols","rows"];class _ extends c.Disposable{constructor(p){super(),this._core=this.register(new l.Terminal(p)),this._addonManager=this.register(new d.AddonManager),this._publicOptions={...this._core.options};const m=b=>this._core.options[b],y=(b,S)=>{this._checkReadonlyOptions(b),this._core.options[b]=S};for(const b in this._core.options){const S={get:m.bind(this,b),set:y.bind(this,b)};Object.defineProperty(this._publicOptions,b,S)}}_checkReadonlyOptions(p){if(x.includes(p))throw new Error(`Option "${p}" 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 u.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const p=this._core.coreService.decPrivateModes;let m="none";switch(this._core.coreMouseService.activeProtocol){case"X10":m="x10";break;case"VT200":m="vt200";break;case"DRAG":m="drag";break;case"ANY":m="any"}return{applicationCursorKeysMode:p.applicationCursorKeys,applicationKeypadMode:p.applicationKeypad,bracketedPasteMode:p.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:m,originMode:p.origin,reverseWraparoundMode:p.reverseWraparound,sendFocusMode:p.sendFocus,wraparoundMode:p.wraparound}}get options(){return this._publicOptions}set options(p){for(const m in p)this._publicOptions[m]=p[m]}blur(){this._core.blur()}focus(){this._core.focus()}input(p,m=!0){this._core.input(p,m)}resize(p,m){this._verifyIntegers(p,m),this._core.resize(p,m)}open(p){this._core.open(p)}attachCustomKeyEventHandler(p){this._core.attachCustomKeyEventHandler(p)}attachCustomWheelEventHandler(p){this._core.attachCustomWheelEventHandler(p)}registerLinkProvider(p){return this._core.registerLinkProvider(p)}registerCharacterJoiner(p){return this._checkProposedApi(),this._core.registerCharacterJoiner(p)}deregisterCharacterJoiner(p){this._checkProposedApi(),this._core.deregisterCharacterJoiner(p)}registerMarker(p=0){return this._verifyIntegers(p),this._core.registerMarker(p)}registerDecoration(p){return this._checkProposedApi(),this._verifyPositiveIntegers(p.x??0,p.width??0,p.height??0),this._core.registerDecoration(p)}hasSelection(){return this._core.hasSelection()}select(p,m,y){this._verifyIntegers(p,m,y),this._core.select(p,m,y)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(p,m){this._verifyIntegers(p,m),this._core.selectLines(p,m)}dispose(){super.dispose()}scrollLines(p){this._verifyIntegers(p),this._core.scrollLines(p)}scrollPages(p){this._verifyIntegers(p),this._core.scrollPages(p)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(p){this._verifyIntegers(p),this._core.scrollToLine(p)}clear(){this._core.clear()}write(p,m){this._core.write(p,m)}writeln(p,m){this._core.write(p),this._core.write(`\r
`,m)}paste(p){this._core.paste(p)}refresh(p,m){this._verifyIntegers(p,m),this._core.refresh(p,m)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(p){this._addonManager.loadAddon(this,p)}static get strings(){return o}_verifyIntegers(...p){for(const m of p)if(m===1/0||isNaN(m)||m%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...p){for(const m of p)if(m&&(m===1/0||isNaN(m)||m%1!=0||m<0))throw new Error("This API only accepts positive integers")}}a.Terminal=_})(),s})())})(dO);var fO=dO.exports,pO={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 c=l(274),d=l(627),u=l(237),f=l(860),g=l(374),x=l(296),_=l(345),v=l(859),p=l(399),m=l(855);class y extends v.Disposable{get canvas(){return this._canvas}get cacheCanvas(){var w;return(w=this._charAtlas)==null?void 0:w.pages[0].canvas}constructor(w,E,k,T,R,M,L,j,P,$){super(),this._terminal=w,this._container=E,this._alpha=R,this._themeService=M,this._bufferService=L,this._optionsService=j,this._decorationService=P,this._coreBrowserService=$,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._selectionModel=(0,x.createSelectionRenderModel)(),this._bitmapGenerator=[],this._charAtlasDisposable=this.register(new v.MutableDisposable),this._onAddTextureAtlasCanvas=this.register(new _.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._cellColorResolver=new c.CellColorResolver(this._terminal,this._optionsService,this._selectionModel,this._decorationService,this._coreBrowserService,this._themeService),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${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(F=>{this._refreshCharAtlas(F),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(w,E){}handleSelectionChanged(w,E,k=!1){this._selectionModel.update(this._terminal._core,w,E,k)}_setTransparency(w){if(w===this._alpha)return;const E=this._canvas;this._alpha=w,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(w){if(!(this._deviceCharWidth<=0&&this._deviceCharHeight<=0)){this._charAtlas=(0,d.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,w,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlasDisposable.value=(0,_.forwardEvent)(this._charAtlas.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),this._charAtlas.warmUp();for(let E=0;E<this._charAtlas.pages.length;E++)this._bitmapGenerator[E]=new b(this._charAtlas.pages[E].canvas)}}resize(w){this._deviceCellWidth=w.device.cell.width,this._deviceCellHeight=w.device.cell.height,this._deviceCharWidth=w.device.char.width,this._deviceCharHeight=w.device.char.height,this._deviceCharLeft=w.device.char.left,this._deviceCharTop=w.device.char.top,this._canvas.width=w.device.canvas.width,this._canvas.height=w.device.canvas.height,this._canvas.style.width=`${w.css.canvas.width}px`,this._canvas.style.height=`${w.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(this._themeService.colors)}clearTextureAtlas(){var w;(w=this._charAtlas)==null||w.clearTexture()}_fillCells(w,E,k,T){this._ctx.fillRect(w*this._deviceCellWidth,E*this._deviceCellHeight,k*this._deviceCellWidth,T*this._deviceCellHeight)}_fillMiddleLineAtCells(w,E,k=1){const T=Math.ceil(.5*this._deviceCellHeight);this._ctx.fillRect(w*this._deviceCellWidth,(E+1)*this._deviceCellHeight-T-this._coreBrowserService.dpr,k*this._deviceCellWidth,this._coreBrowserService.dpr)}_fillBottomLineAtCells(w,E,k=1,T=0){this._ctx.fillRect(w*this._deviceCellWidth,(E+1)*this._deviceCellHeight+T-this._coreBrowserService.dpr-1,k*this._deviceCellWidth,this._coreBrowserService.dpr)}_curlyUnderlineAtCell(w,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 R=0;R<k;R++){const M=(w+R)*this._deviceCellWidth,L=(w+R+.5)*this._deviceCellWidth,j=(w+R+1)*this._deviceCellWidth,P=(E+1)*this._deviceCellHeight-T-1,$=P-T,F=P+T;this._ctx.moveTo(M,P),this._ctx.bezierCurveTo(M,$,L,$,L,P),this._ctx.bezierCurveTo(L,F,j,F,j,P)}this._ctx.stroke(),this._ctx.restore()}_dottedUnderlineAtCell(w,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 R=w*this._deviceCellWidth,M=(E+1)*this._deviceCellHeight-T-1;this._ctx.moveTo(R,M);for(let L=0;L<k;L++){const j=(w+k+L)*this._deviceCellWidth;this._ctx.lineTo(j,M)}this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_dashedUnderlineAtCell(w,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 R=w*this._deviceCellWidth,M=(w+k)*this._deviceCellWidth,L=(E+1)*this._deviceCellHeight-T-1;this._ctx.moveTo(R,L),this._ctx.lineTo(M,L),this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_fillLeftLineAtCell(w,E,k){this._ctx.fillRect(w*this._deviceCellWidth,E*this._deviceCellHeight,this._coreBrowserService.dpr*k,this._deviceCellHeight)}_strokeRectAtCell(w,E,k,T){const R=this._coreBrowserService.dpr;this._ctx.lineWidth=R,this._ctx.strokeRect(w*this._deviceCellWidth+R/2,E*this._deviceCellHeight+R/2,k*this._deviceCellWidth-R,T*this._deviceCellHeight-R)}_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(w,E,k,T){this._alpha?this._ctx.clearRect(w*this._deviceCellWidth,E*this._deviceCellHeight,k*this._deviceCellWidth,T*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(w*this._deviceCellWidth,E*this._deviceCellHeight,k*this._deviceCellWidth,T*this._deviceCellHeight))}_fillCharTrueColor(w,E,k){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline=u.TEXT_BASELINE,this._clipRow(k);let T=!1;this._optionsService.rawOptions.customGlyphs!==!1&&(T=(0,f.tryDrawCustomChar)(this._ctx,w.getChars(),E*this._deviceCellWidth,k*this._deviceCellHeight,this._deviceCellWidth,this._deviceCellHeight,this._optionsService.rawOptions.fontSize,this._coreBrowserService.dpr)),T||this._ctx.fillText(w.getChars(),E*this._deviceCellWidth+this._deviceCharLeft,k*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_drawChars(w,E,k){var P,$,F,W;const T=w.getChars(),R=w.getCode(),M=w.getWidth();if(this._cellColorResolver.resolve(w,E,this._bufferService.buffer.ydisp+k,this._deviceCellWidth),!this._charAtlas)return;let L;if(L=T&&T.length>1?this._charAtlas.getRasterizedGlyphCombinedChar(T,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0):this._charAtlas.getRasterizedGlyph(w.getCode()||m.WHITESPACE_CELL_CODE,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0),!L.size.x||!L.size.y)return;this._ctx.save(),this._clipRow(k),this._bitmapGenerator[L.texturePage]&&this._charAtlas.pages[L.texturePage].canvas!==this._bitmapGenerator[L.texturePage].canvas&&(($=(P=this._bitmapGenerator[L.texturePage])==null?void 0:P.bitmap)==null||$.close(),delete this._bitmapGenerator[L.texturePage]),this._charAtlas.pages[L.texturePage].version!==((F=this._bitmapGenerator[L.texturePage])==null?void 0:F.version)&&(this._bitmapGenerator[L.texturePage]||(this._bitmapGenerator[L.texturePage]=new b(this._charAtlas.pages[L.texturePage].canvas)),this._bitmapGenerator[L.texturePage].refresh(),this._bitmapGenerator[L.texturePage].version=this._charAtlas.pages[L.texturePage].version);let j=L.size.x;this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,g.allowRescaling)(R,M,L.size.x,this._deviceCellWidth)&&(j=this._deviceCellWidth-1),this._ctx.drawImage(((W=this._bitmapGenerator[L.texturePage])==null?void 0:W.bitmap)||this._charAtlas.pages[L.texturePage].canvas,L.texturePosition.x,L.texturePosition.y,L.size.x,L.size.y,E*this._deviceCellWidth+this._deviceCharLeft-L.offset.x,k*this._deviceCellHeight+this._deviceCharTop-L.offset.y,j,L.size.y),this._ctx.restore()}_clipRow(w){this._ctx.beginPath(),this._ctx.rect(0,w*this._deviceCellHeight,this._bufferService.cols*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(w,E){return`${E?"italic":""} ${w?this._optionsService.rawOptions.fontWeightBold:this._optionsService.rawOptions.fontWeight} ${this._optionsService.rawOptions.fontSize*this._coreBrowserService.dpr}px ${this._optionsService.rawOptions.fontFamily}`}}o.BaseRenderLayer=y;class b{get bitmap(){return this._bitmap}constructor(w){this.canvas=w,this._state=0,this._commitTimeout=void 0,this._bitmap=void 0,this.version=-1}refresh(){var w;(w=this._bitmap)==null||w.close(),this._bitmap=void 0,p.isSafari||(this._commitTimeout===void 0&&(this._commitTimeout=window.setTimeout(()=>this._generate(),100)),this._state===1&&(this._state=2))}_generate(){var w;this._state===0&&((w=this._bitmap)==null||w.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 c=l(627),d=l(56),u=l(374),f=l(345),g=l(859),x=l(873),_=l(43),v=l(630),p=l(744);class m extends g.Disposable{constructor(b,S,w,E,k,T,R,M,L,j,P){super(),this._terminal=b,this._screenElement=S,this._bufferService=E,this._charSizeService=k,this._optionsService=T,this._coreBrowserService=L,this._themeService=P,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 $=this._optionsService.rawOptions.allowTransparency;this._renderLayers=[new p.TextRenderLayer(this._terminal,this._screenElement,0,$,this._bufferService,this._optionsService,R,j,this._coreBrowserService,P),new v.SelectionRenderLayer(this._terminal,this._screenElement,1,this._bufferService,this._coreBrowserService,j,this._optionsService,P),new _.LinkRenderLayer(this._terminal,this._screenElement,2,w,this._bufferService,this._optionsService,j,this._coreBrowserService,P),new x.CursorRenderLayer(this._terminal,this._screenElement,3,this._onRequestRedraw,this._bufferService,this._optionsService,M,this._coreBrowserService,j,P)];for(const F of this._renderLayers)(0,f.forwardEvent)(F.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas);this.dimensions=(0,u.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._observerDisposable.value=(0,d.observeDevicePixelDimensions)(this._renderLayers[0].canvas,this._coreBrowserService.window,(F,W)=>this._setCanvasDevicePixelDimensions(F,W)),this.register(this._coreBrowserService.onWindowChange(F=>{this._observerDisposable.value=(0,d.observeDevicePixelDimensions)(this._renderLayers[0].canvas,F,(W,I)=>this._setCanvasDevicePixelDimensions(W,I))})),this.register((0,g.toDisposable)(()=>{for(const F of this._renderLayers)F.dispose();(0,c.removeTerminalFromCache)(this._terminal)}))}get textureAtlas(){return this._renderLayers[0].cacheCanvas}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._bufferService.cols,this._bufferService.rows))}handleResize(b,S){this._updateDimensions();for(const w of this._renderLayers)w.resize(this.dimensions);this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}handleCharSizeChanged(){this.handleResize(this._bufferService.cols,this._bufferService.rows)}handleBlur(){this._runOperation(b=>b.handleBlur())}handleFocus(){this._runOperation(b=>b.handleFocus())}handleSelectionChanged(b,S,w=!1){this._runOperation(E=>E.handleSelectionChanged(b,S,w)),this._themeService.colors.selectionForeground&&this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}handleCursorMove(){this._runOperation(b=>b.handleCursorMove())}clear(){this._runOperation(b=>b.reset())}_runOperation(b){for(const S of this._renderLayers)b(S)}renderRows(b,S){for(const w of this._renderLayers)w.handleGridChanged(b,S)}clearTextureAtlas(){for(const b of this._renderLayers)b.clearTextureAtlas()}_updateDimensions(){if(!this._charSizeService.hasValidSize)return;const b=this._coreBrowserService.dpr;this.dimensions.device.char.width=Math.floor(this._charSizeService.width*b),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*b),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._bufferService.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._bufferService.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/b),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/b),this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows,this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols}_setCanvasDevicePixelDimensions(b,S){this.dimensions.device.canvas.height=S,this.dimensions.device.canvas.width=b;for(const w of this._renderLayers)w.resize(this.dimensions);this._requestRedrawViewport()}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}}o.CanvasRenderer=m},873:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CursorRenderLayer=void 0;const c=l(457),d=l(859),u=l(399),f=l(782),g=l(903);class x extends g.BaseRenderLayer{constructor(v,p,m,y,b,S,w,E,k,T){super(v,p,"cursor",m,!0,T,b,S,k,E),this._onRequestRedraw=y,this._coreService=w,this._cursorBlinkStateManager=this.register(new d.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(S.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 c.CursorBlinkStateManager(()=>this._render(!0),this._coreBrowserService)):this._cursorBlinkStateManager.clear(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleCursorMove(){var v;(v=this._cursorBlinkStateManager.value)==null||v.restartBlinkAnimation()}handleGridChanged(v,p){!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 p=this._bufferService.buffer.ybase+this._bufferService.buffer.y,m=p-this._bufferService.buffer.ydisp;if(m<0||m>=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(p).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 b=this._optionsService.rawOptions.cursorStyle,S=this._optionsService.rawOptions.cursorInactiveStyle;return S&&S!=="none"&&this._cursorRenderers[S](y,m,this._cell),this._ctx.restore(),this._state.x=y,this._state.y=m,this._state.isFocused=!1,this._state.style=b,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible){if(this._state){if(this._state.x===y&&this._state.y===m&&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,m,this._cell),this._ctx.restore(),this._state.x=y,this._state.y=m,this._state.isFocused=!1,this._state.style=this._optionsService.rawOptions.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}_clearCursor(){this._state&&(u.isFirefox||this._coreBrowserService.dpr<1?this._clearAll():this._clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:0,y:0,isFocused:!1,style:"",width:0})}_renderBarCursor(v,p,m){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillLeftLineAtCell(v,p,this._optionsService.rawOptions.cursorWidth),this._ctx.restore()}_renderBlockCursor(v,p,m){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillCells(v,p,m.getWidth(),1),this._ctx.fillStyle=this._themeService.colors.cursorAccent.css,this._fillCharTrueColor(m,v,p),this._ctx.restore()}_renderUnderlineCursor(v,p,m){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillBottomLineAtCells(v,p),this._ctx.restore()}_renderOutlineCursor(v,p,m){this._ctx.save(),this._ctx.strokeStyle=this._themeService.colors.cursor.css,this._strokeRectAtCell(v,p,m.getWidth(),1),this._ctx.restore()}}o.CursorRenderLayer=x},574:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.GridCache=void 0,o.GridCache=class{constructor(){this.cache=[]}resize(l,c){for(let d=0;d<l;d++){this.cache.length<=d&&this.cache.push([]);for(let u=this.cache[d].length;u<c;u++)this.cache[d].push(void 0);this.cache[d].length=c}this.cache.length=l}clear(){for(let l=0;l<this.cache.length;l++)for(let c=0;c<this.cache[l].length;c++)this.cache[l][c]=void 0}}},43:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkRenderLayer=void 0;const c=l(197),d=l(237),u=l(903);class f extends u.BaseRenderLayer{constructor(x,_,v,p,m,y,b,S,w){super(x,_,"link",v,!0,w,m,y,b,S),this.register(p.onShowLinkUnderline(E=>this._handleShowLinkUnderline(E))),this.register(p.onHideLinkUnderline(E=>this._handleHideLinkUnderline(E)))}resize(x){super.resize(x),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 x=this._state.y2-this._state.y1-1;x>0&&this._clearCells(0,this._state.y1+1,this._state.cols,x),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(x){if(x.fg===d.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:x.fg&&(0,c.is256Color)(x.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[x.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,x.y1===x.y2)this._fillBottomLineAtCells(x.x1,x.y1,x.x2-x.x1);else{this._fillBottomLineAtCells(x.x1,x.y1,x.cols-x.x1);for(let _=x.y1+1;_<x.y2;_++)this._fillBottomLineAtCells(0,_,x.cols);this._fillBottomLineAtCells(0,x.y2,x.x2)}this._state=x}_handleHideLinkUnderline(x){this._clearCurrentLink()}}o.LinkRenderLayer=f},630:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionRenderLayer=void 0;const c=l(903);class d extends c.BaseRenderLayer{constructor(f,g,x,_,v,p,m,y){super(f,g,"selection",x,!0,y,_,m,p,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,x){super.handleSelectionChanged(f,g,x),this._redrawSelection(f,g,x)}_redrawSelection(f,g,x){if(!this._didStateChange(f,g,x,this._bufferService.buffer.ydisp))return;if(this._clearAll(),!f||!g)return void this._clearState();const _=f[1]-this._bufferService.buffer.ydisp,v=g[1]-this._bufferService.buffer.ydisp,p=Math.max(_,0),m=Math.min(v,this._bufferService.rows-1);if(p>=this._bufferService.rows||m<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,x){const y=f[0],b=g[0]-y,S=m-p+1;this._fillCells(y,p,b,S)}else{const y=_===p?f[0]:0,b=p===v?g[0]:this._bufferService.cols;this._fillCells(y,p,b-y,1);const S=Math.max(m-p-1,0);if(this._fillCells(0,p+1,this._bufferService.cols,S),p!==m){const w=v===m?g[0]:this._bufferService.cols;this._fillCells(0,m,w,1)}}this._state.start=[f[0],f[1]],this._state.end=[g[0],g[1]],this._state.columnSelectMode=x,this._state.ydisp=this._bufferService.buffer.ydisp}}_didStateChange(f,g,x,_){return!this._areCoordinatesEqual(f,this._state.start)||!this._areCoordinatesEqual(g,this._state.end)||x!==this._state.columnSelectMode||_!==this._state.ydisp}_areCoordinatesEqual(f,g){return!(!f||!g)&&f[0]===g[0]&&f[1]===g[1]}}o.SelectionRenderLayer=d},744:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TextRenderLayer=void 0;const c=l(577),d=l(147),u=l(782),f=l(855),g=l(903),x=l(574);class _ extends g.BaseRenderLayer{constructor(p,m,y,b,S,w,E,k,T,R){super(p,m,"text",y,b,R,S,w,k,T),this._characterJoinerService=E,this._characterWidth=0,this._characterFont="",this._characterOverlapCache={},this._workCell=new u.CellData,this._state=new x.GridCache,this.register(w.onSpecificOptionChange("allowTransparency",M=>this._setTransparency(M)))}resize(p){super.resize(p);const m=this._getFont(!1,!1);this._characterWidth===p.device.char.width&&this._characterFont===m||(this._characterWidth=p.device.char.width,this._characterFont=m,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)}reset(){this._state.clear(),this._clearAll()}_forEachCell(p,m,y){for(let b=p;b<=m;b++){const S=b+this._bufferService.buffer.ydisp,w=this._bufferService.buffer.lines.get(S),E=this._characterJoinerService.getJoinedCharacters(S);for(let k=0;k<this._bufferService.cols;k++){w.loadCell(k,this._workCell);let T=this._workCell,R=!1,M=k;if(T.getWidth()!==0){if(E.length>0&&k===E[0][0]){R=!0;const L=E.shift();T=new c.JoinedCellData(this._workCell,w.translateToString(!0,L[0],L[1]),L[1]-L[0]),M=L[1]-1}!R&&this._isOverlapping(T)&&M<w.length-1&&w.getCodePoint(M+1)===f.NULL_CELL_CODE&&(T.content&=-12582913,T.content|=8388608),y(T,k,b),k=M}}}}_drawBackground(p,m){const y=this._ctx,b=this._bufferService.cols;let S=0,w=0,E=null;y.save(),this._forEachCell(p,m,(k,T,R)=>{let M=null;k.isInverse()?M=k.isFgDefault()?this._themeService.colors.foreground.css:k.isFgRGB()?`rgb(${d.AttributeData.toColorRGB(k.getFgColor()).join(",")})`:this._themeService.colors.ansi[k.getFgColor()].css:k.isBgRGB()?M=`rgb(${d.AttributeData.toColorRGB(k.getBgColor()).join(",")})`:k.isBgPalette()&&(M=this._themeService.colors.ansi[k.getBgColor()].css);let L=!1;this._decorationService.forEachDecorationAtCell(T,this._bufferService.buffer.ydisp+R,void 0,j=>{j.options.layer!=="top"&&L||(j.backgroundColorRGB&&(M=j.backgroundColorRGB.css),L=j.options.layer==="top")}),E===null&&(S=T,w=R),R!==w?(y.fillStyle=E||"",this._fillCells(S,w,b-S,1),S=T,w=R):E!==M&&(y.fillStyle=E||"",this._fillCells(S,w,T-S,1),S=T,w=R),E=M}),E!==null&&(y.fillStyle=E,this._fillCells(S,w,b-S,1)),y.restore()}_drawForeground(p,m){this._forEachCell(p,m,(y,b,S)=>this._drawChars(y,b,S))}handleGridChanged(p,m){this._state.cache.length!==0&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,p,this._bufferService.cols,m-p+1),this._drawBackground(p,m),this._drawForeground(p,m))}_isOverlapping(p){if(p.getWidth()!==1||p.getCode()<256)return!1;const m=p.getChars();if(this._characterOverlapCache.hasOwnProperty(m))return this._characterOverlapCache[m];this._ctx.save(),this._ctx.font=this._characterFont;const y=Math.floor(this._ctx.measureText(m).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[m]=y,y}}o.TextRenderLayer=_},274:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellColorResolver=void 0;const c=l(855),d=l(160),u=l(374);let f,g=0,x=0,_=!1,v=!1,p=!1,m=0;o.CellColorResolver=class{constructor(y,b,S,w,E,k){this._terminal=y,this._optionService=b,this._selectionRenderModel=S,this._decorationService=w,this._coreBrowserService=E,this._themeService=k,this.result={fg:0,bg:0,ext:0}}resolve(y,b,S,w){if(this.result.bg=y.bg,this.result.fg=y.fg,this.result.ext=268435456&y.bg?y.extended.ext:0,x=0,g=0,v=!1,_=!1,p=!1,f=this._themeService.colors,m=0,y.getCode()!==c.NULL_CELL_CODE&&y.extended.underlineStyle===4){const E=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));m=b*w%(2*Math.round(E))}if(this._decorationService.forEachDecorationAtCell(b,S,"bottom",E=>{E.backgroundColorRGB&&(x=E.backgroundColorRGB.rgba>>8&16777215,v=!0),E.foregroundColorRGB&&(g=E.foregroundColorRGB.rgba>>8&16777215,_=!0)}),p=this._selectionRenderModel.isCellSelected(this._terminal,b,S),p){if(67108864&this.result.fg||50331648&this.result.bg){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:x=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:x=(16777215&this.result.fg)<<8|255;break;default:x=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:x=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:x=(16777215&this.result.bg)<<8|255}x=d.rgba.blend(x,4294967040&(this._coreBrowserService.isFocused?f.selectionBackgroundOpaque:f.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else x=(this._coreBrowserService.isFocused?f.selectionBackgroundOpaque:f.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(v=!0,f.selectionForeground&&(g=f.selectionForeground.rgba>>8&16777215,_=!0),(0,u.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=d.rgba.blend(g,4294967040&(this._coreBrowserService.isFocused?f.selectionBackgroundOpaque:f.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}_=!0}}this._decorationService.forEachDecorationAtCell(b,S,"top",E=>{E.backgroundColorRGB&&(x=E.backgroundColorRGB.rgba>>8&16777215,v=!0),E.foregroundColorRGB&&(g=E.foregroundColorRGB.rgba>>8&16777215,_=!0)}),v&&(x=p?-16777216&y.bg&-134217729|x|50331648:-16777216&y.bg|x|50331648),_&&(g=-16777216&y.fg&-67108865|g|50331648),67108864&this.result.fg&&(v&&!_&&(g=50331648&this.result.bg?-134217728&this.result.fg|67108863&this.result.bg:-134217728&this.result.fg|16777215&f.background.rgba>>8|50331648,_=!0),!v&&_&&(x=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?x:this.result.bg,this.result.fg=_?g:this.result.fg,this.result.ext&=536870911,this.result.ext|=m<<29&3758096384}}},627:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.removeTerminalFromCache=o.acquireTextureAtlas=void 0;const c=l(509),d=l(197),u=[];o.acquireTextureAtlas=function(f,g,x,_,v,p,m,y){const b=(0,d.generateConfig)(_,v,p,m,g,x,y);for(let E=0;E<u.length;E++){const k=u[E],T=k.ownedBy.indexOf(f);if(T>=0){if((0,d.configEquals)(k.config,b))return k.atlas;k.ownedBy.length===1?(k.atlas.dispose(),u.splice(E,1)):k.ownedBy.splice(T,1);break}}for(let E=0;E<u.length;E++){const k=u[E];if((0,d.configEquals)(k.config,b))return k.ownedBy.push(f),k.atlas}const S=f._core,w={atlas:new c.TextureAtlas(document,b,S.unicodeService),config:b,ownedBy:[f]};return u.push(w),w.atlas},o.removeTerminalFromCache=function(f){for(let g=0;g<u.length;g++){const x=u[g].ownedBy.indexOf(f);if(x!==-1){u[g].ownedBy.length===1?(u[g].atlas.dispose(),u.splice(g,1)):u[g].ownedBy.splice(x,1);break}}}},197:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.is256Color=o.configEquals=o.generateConfig=void 0;const c=l(160);o.generateConfig=function(d,u,f,g,x,_,v){const p={foreground:_.foreground,background:_.background,cursor:c.NULL_COLOR,cursorAccent:c.NULL_COLOR,selectionForeground:c.NULL_COLOR,selectionBackgroundTransparent:c.NULL_COLOR,selectionBackgroundOpaque:c.NULL_COLOR,selectionInactiveBackgroundTransparent:c.NULL_COLOR,selectionInactiveBackgroundOpaque:c.NULL_COLOR,ansi:_.ansi.slice(),contrastCache:_.contrastCache,halfContrastCache:_.halfContrastCache};return{customGlyphs:x.customGlyphs,devicePixelRatio:v,letterSpacing:x.letterSpacing,lineHeight:x.lineHeight,deviceCellWidth:d,deviceCellHeight:u,deviceCharWidth:f,deviceCharHeight:g,fontFamily:x.fontFamily,fontSize:x.fontSize,fontWeight:x.fontWeight,fontWeightBold:x.fontWeightBold,allowTransparency:x.allowTransparency,drawBoldTextInBrightColors:x.drawBoldTextInBrightColors,minimumContrastRatio:x.minimumContrastRatio,colors:p}},o.configEquals=function(d,u){for(let f=0;f<d.colors.ansi.length;f++)if(d.colors.ansi[f].rgba!==u.colors.ansi[f].rgba)return!1;return d.devicePixelRatio===u.devicePixelRatio&&d.customGlyphs===u.customGlyphs&&d.lineHeight===u.lineHeight&&d.letterSpacing===u.letterSpacing&&d.fontFamily===u.fontFamily&&d.fontSize===u.fontSize&&d.fontWeight===u.fontWeight&&d.fontWeightBold===u.fontWeightBold&&d.allowTransparency===u.allowTransparency&&d.deviceCharWidth===u.deviceCharWidth&&d.deviceCharHeight===u.deviceCharHeight&&d.drawBoldTextInBrightColors===u.drawBoldTextInBrightColors&&d.minimumContrastRatio===u.minimumContrastRatio&&d.colors.foreground.rgba===u.colors.foreground.rgba&&d.colors.background.rgba===u.colors.background.rgba},o.is256Color=function(d){return(50331648&d)==16777216||(50331648&d)==33554432}},237:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const c=l(399);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},457:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CursorBlinkStateManager=void 0,o.CursorBlinkStateManager=class{constructor(l,c){this._renderCallback=l,this._coreBrowserService=c,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(l=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){const c=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,c>0)return void this._restartInterval(c)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){const c=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(c)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},600)},l)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tryDrawCustomChar=o.powerlineDefinitions=o.boxDrawingDefinitions=o.blockElementDefinitions=void 0;const c=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 d={"░":[[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:(_,v)=>`M0,${.5-v} L1,${.5-v} M0,${.5+v} L1,${.5+v}`},"║":{1:(_,v)=>`M${.5-_},0 L${.5-_},1 M${.5+_},0 L${.5+_},1`},"╒":{1:(_,v)=>`M.5,1 L.5,${.5-v} L1,${.5-v} M.5,${.5+v} L1,${.5+v}`},"╓":{1:(_,v)=>`M${.5-_},1 L${.5-_},.5 L1,.5 M${.5+_},.5 L${.5+_},1`},"╔":{1:(_,v)=>`M1,${.5-v} L${.5-_},${.5-v} L${.5-_},1 M1,${.5+v} L${.5+_},${.5+v} L${.5+_},1`},"╕":{1:(_,v)=>`M0,${.5-v} L.5,${.5-v} L.5,1 M0,${.5+v} L.5,${.5+v}`},"╖":{1:(_,v)=>`M${.5+_},1 L${.5+_},.5 L0,.5 M${.5-_},.5 L${.5-_},1`},"╗":{1:(_,v)=>`M0,${.5+v} L${.5-_},${.5+v} L${.5-_},1 M0,${.5-v} L${.5+_},${.5-v} L${.5+_},1`},"╘":{1:(_,v)=>`M.5,0 L.5,${.5+v} L1,${.5+v} M.5,${.5-v} L1,${.5-v}`},"╙":{1:(_,v)=>`M1,.5 L${.5-_},.5 L${.5-_},0 M${.5+_},.5 L${.5+_},0`},"╚":{1:(_,v)=>`M1,${.5-v} L${.5+_},${.5-v} L${.5+_},0 M1,${.5+v} L${.5-_},${.5+v} L${.5-_},0`},"╛":{1:(_,v)=>`M0,${.5+v} L.5,${.5+v} L.5,0 M0,${.5-v} L.5,${.5-v}`},"╜":{1:(_,v)=>`M0,.5 L${.5+_},.5 L${.5+_},0 M${.5-_},.5 L${.5-_},0`},"╝":{1:(_,v)=>`M0,${.5-v} L${.5-_},${.5-v} L${.5-_},0 M0,${.5+v} L${.5+_},${.5+v} L${.5+_},0`},"╞":{1:(_,v)=>`M.5,0 L.5,1 M.5,${.5-v} L1,${.5-v} M.5,${.5+v} L1,${.5+v}`},"╟":{1:(_,v)=>`M${.5-_},0 L${.5-_},1 M${.5+_},0 L${.5+_},1 M${.5+_},.5 L1,.5`},"╠":{1:(_,v)=>`M${.5-_},0 L${.5-_},1 M1,${.5+v} L${.5+_},${.5+v} L${.5+_},1 M1,${.5-v} L${.5+_},${.5-v} L${.5+_},0`},"╡":{1:(_,v)=>`M.5,0 L.5,1 M0,${.5-v} L.5,${.5-v} M0,${.5+v} L.5,${.5+v}`},"╢":{1:(_,v)=>`M0,.5 L${.5-_},.5 M${.5-_},0 L${.5-_},1 M${.5+_},0 L${.5+_},1`},"╣":{1:(_,v)=>`M${.5+_},0 L${.5+_},1 M0,${.5+v} L${.5-_},${.5+v} L${.5-_},1 M0,${.5-v} L${.5-_},${.5-v} L${.5-_},0`},"╤":{1:(_,v)=>`M0,${.5-v} L1,${.5-v} M0,${.5+v} L1,${.5+v} M.5,${.5+v} L.5,1`},"╥":{1:(_,v)=>`M0,.5 L1,.5 M${.5-_},.5 L${.5-_},1 M${.5+_},.5 L${.5+_},1`},"╦":{1:(_,v)=>`M0,${.5-v} L1,${.5-v} M0,${.5+v} L${.5-_},${.5+v} L${.5-_},1 M1,${.5+v} L${.5+_},${.5+v} L${.5+_},1`},"╧":{1:(_,v)=>`M.5,0 L.5,${.5-v} M0,${.5-v} L1,${.5-v} M0,${.5+v} L1,${.5+v}`},"╨":{1:(_,v)=>`M0,.5 L1,.5 M${.5-_},.5 L${.5-_},0 M${.5+_},.5 L${.5+_},0`},"╩":{1:(_,v)=>`M0,${.5+v} L1,${.5+v} M0,${.5-v} L${.5-_},${.5-v} L${.5-_},0 M1,${.5-v} L${.5+_},${.5-v} L${.5+_},0`},"╪":{1:(_,v)=>`M.5,0 L.5,1 M0,${.5-v} L1,${.5-v} M0,${.5+v} L1,${.5+v}`},"╫":{1:(_,v)=>`M0,.5 L1,.5 M${.5-_},0 L${.5-_},1 M${.5+_},0 L${.5+_},1`},"╬":{1:(_,v)=>`M0,${.5+v} L${.5-_},${.5+v} L${.5-_},1 M1,${.5+v} L${.5+_},${.5+v} L${.5+_},1 M0,${.5-v} L${.5-_},${.5-v} L${.5-_},0 M1,${.5-v} L${.5+_},${.5-v} L${.5+_},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(_,v)=>`M.5,1 L.5,${.5+v/.15*.5} C.5,${.5+v/.15*.5},.5,.5,1,.5`},"╮":{1:(_,v)=>`M.5,1 L.5,${.5+v/.15*.5} C.5,${.5+v/.15*.5},.5,.5,0,.5`},"╯":{1:(_,v)=>`M.5,0 L.5,${.5-v/.15*.5} C.5,${.5-v/.15*.5},.5,.5,0,.5`},"╰":{1:(_,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(_,v,p,m,y,b,S,w){const E=o.blockElementDefinitions[v];if(E)return function(M,L,j,P,$,F){for(let W=0;W<L.length;W++){const I=L[W],A=$/8,D=F/8;M.fillRect(j+I.x*A,P+I.y*D,I.w*A,I.h*D)}}(_,E,p,m,y,b),!0;const k=d[v];if(k)return function(M,L,j,P,$,F){let W=u.get(L);W||(W=new Map,u.set(L,W));const I=M.fillStyle;if(typeof I!="string")throw new Error(`Unexpected fillStyle type "${I}"`);let A=W.get(I);if(!A){const D=L[0].length,H=L.length,V=M.canvas.ownerDocument.createElement("canvas");V.width=D,V.height=H;const U=(0,c.throwIfFalsy)(V.getContext("2d")),G=new ImageData(D,H);let ee,Z,q,B;if(I.startsWith("#"))ee=parseInt(I.slice(1,3),16),Z=parseInt(I.slice(3,5),16),q=parseInt(I.slice(5,7),16),B=I.length>7&&parseInt(I.slice(7,9),16)||1;else{if(!I.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${I}" when drawing pattern glyph`);[ee,Z,q,B]=I.substring(5,I.length-1).split(",").map(O=>parseFloat(O))}for(let O=0;O<H;O++)for(let z=0;z<D;z++)G.data[4*(O*D+z)]=ee,G.data[4*(O*D+z)+1]=Z,G.data[4*(O*D+z)+2]=q,G.data[4*(O*D+z)+3]=L[O][z]*(255*B);U.putImageData(G,0,0),A=(0,c.throwIfFalsy)(M.createPattern(V,null)),W.set(I,A)}M.fillStyle=A,M.fillRect(j,P,$,F)}(_,k,p,m,y,b),!0;const T=o.boxDrawingDefinitions[v];if(T)return function(M,L,j,P,$,F,W){M.strokeStyle=M.fillStyle;for(const[I,A]of Object.entries(L)){let D;M.beginPath(),M.lineWidth=W*Number.parseInt(I),D=typeof A=="function"?A(.15,.15/F*$):A;for(const H of D.split(" ")){const V=H[0],U=g[V];if(!U){console.error(`Could not find drawing instructions for "${V}"`);continue}const G=H.substring(1).split(",");G[0]&&G[1]&&U(M,x(G,$,F,j,P,!0,W))}M.stroke(),M.closePath()}}(_,T,p,m,y,b,w),!0;const R=o.powerlineDefinitions[v];return!!R&&(function(M,L,j,P,$,F,W,I){const A=new Path2D;A.rect(j,P,$,F),M.clip(A),M.beginPath();const D=W/12;M.lineWidth=I*D;for(const H of L.d.split(" ")){const V=H[0],U=g[V];if(!U){console.error(`Could not find drawing instructions for "${V}"`);continue}const G=H.substring(1).split(",");G[0]&&G[1]&&U(M,x(G,$,F,j,P,!1,I,(L.leftPadding??0)*(D/2),(L.rightPadding??0)*(D/2)))}L.type===1?(M.strokeStyle=M.fillStyle,M.stroke()):M.fill(),M.closePath()}(_,R,p,m,y,b,S,w),!0)};const u=new Map;function f(_,v,p=0){return Math.max(Math.min(_,v),p)}const g={C:(_,v)=>_.bezierCurveTo(v[0],v[1],v[2],v[3],v[4],v[5]),L:(_,v)=>_.lineTo(v[0],v[1]),M:(_,v)=>_.moveTo(v[0],v[1])};function x(_,v,p,m,y,b,S,w=0,E=0){const k=_.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-w*S-E*S,b&&k[T]!==0&&(k[T]=f(Math.round(k[T]+.5)-.5,v,0)),k[T]+=m+w*S;for(let T=1;T<k.length;T+=2)k[T]*=p,b&&k[T]!==0&&(k[T]=f(Math.round(k[T]+.5)-.5,p,0)),k[T]+=y;return k}},56:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.observeDevicePixelDimensions=void 0;const c=l(859);o.observeDevicePixelDimensions=function(d,u,f){let g=new u.ResizeObserver(x=>{const _=x.find(m=>m.target===d);if(!_)return;if(!("devicePixelContentBoxSize"in _))return g==null||g.disconnect(),void(g=void 0);const v=_.devicePixelContentBoxSize[0].inlineSize,p=_.devicePixelContentBoxSize[0].blockSize;v>0&&p>0&&f(v,p)});try{g.observe(d,{box:["device-pixel-content-box"]})}catch{g.disconnect(),g=void 0}return(0,c.toDisposable)(()=>g==null?void 0:g.disconnect())}},374:(a,o)=>{function l(d){return 57508<=d&&d<=57558}function c(d){return d>=128512&&d<=128591||d>=127744&&d<=128511||d>=128640&&d<=128767||d>=9728&&d<=9983||d>=9984&&d<=10175||d>=65024&&d<=65039||d>=129280&&d<=129535||d>=127462&&d<=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(d){if(!d)throw new Error("value must not be falsy");return d},o.isPowerlineGlyph=l,o.isRestrictedPowerlineGlyph=function(d){return 57520<=d&&d<=57527},o.isEmoji=c,o.allowRescaling=function(d,u,f,g){return u===1&&f>Math.ceil(1.5*g)&&d!==void 0&&d>255&&!c(d)&&!l(d)&&!function(x){return 57344<=x&&x<=63743}(d)},o.treatGlyphAsBackgroundColor=function(d){return l(d)||function(u){return 9472<=u&&u<=9631}(d)},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(d,u,f=0){return(d-(2*Math.round(u)-f))%(2*Math.round(u))}},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(d,u,f,g=!1){if(this.selectionStart=u,this.selectionEnd=f,!u||!f||u[0]===f[0]&&u[1]===f[1])return void this.clear();const x=d.buffers.active.ydisp,_=u[1]-x,v=f[1]-x,p=Math.max(_,0),m=Math.min(v,d.rows-1);p>=d.rows||m<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=g,this.viewportStartRow=_,this.viewportEndRow=v,this.viewportCappedStartRow=p,this.viewportCappedEndRow=m,this.startCol=u[0],this.endCol=f[0])}isCellSelected(d,u,f){return!!this.hasSelection&&(f-=d.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&f>=this.viewportCappedStartRow&&u<this.endCol&&f<=this.viewportCappedEndRow:u<this.startCol&&f>=this.viewportCappedStartRow&&u>=this.endCol&&f<=this.viewportCappedEndRow:f>this.viewportStartRow&&f<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&f===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&f===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&f===this.viewportStartRow&&u>=this.startCol)}}o.createSelectionRenderModel=function(){return new l}},509:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TextureAtlas=void 0;const c=l(237),d=l(860),u=l(374),f=l(160),g=l(345),x=l(485),_=l(385),v=l(147),p=l(855),m={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 b{get pages(){return this._pages}constructor(T,R,M){this._document=T,this._config=R,this._unicodeService=M,this._didWarmUp=!1,this._cacheMap=new x.FourKeyMap,this._cacheMapCombined=new x.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,u.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 _.IdleTaskQueue;for(let R=33;R<126;R++)T.enqueue(()=>{if(!this._cacheMap.get(R,p.DEFAULT_COLOR,p.DEFAULT_COLOR,p.DEFAULT_EXT)){const M=this._drawToCache(R,p.DEFAULT_COLOR,p.DEFAULT_COLOR,p.DEFAULT_EXT);this._cacheMap.set(R,p.DEFAULT_COLOR,p.DEFAULT_COLOR,p.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(b.maxAtlasPages&&this._pages.length>=Math.max(4,b.maxAtlasPages)){const R=this._pages.filter(W=>2*W.canvas.width<=(b.maxTextureSize||4096)).sort((W,I)=>I.canvas.width!==W.canvas.width?I.canvas.width-W.canvas.width:I.percentageUsed-W.percentageUsed);let M=-1,L=0;for(let W=0;W<R.length;W++)if(R[W].canvas.width!==L)M=W,L=R[W].canvas.width;else if(W-M==3)break;const j=R.slice(M,M+4),P=j.map(W=>W.glyphs[0].texturePage).sort((W,I)=>W>I?1:-1),$=this.pages.length-j.length,F=this._mergePages(j,$);F.version++;for(let W=P.length-1;W>=0;W--)this._deletePage(P[W]);this.pages.push(F),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(F.canvas)}const T=new S(this._document,this._textureSize);return this._pages.push(T),this._activePages.push(T),this._onAddTextureAtlasCanvas.fire(T.canvas),T}_mergePages(T,R){const M=2*T[0].canvas.width,L=new S(this._document,M,T);for(const[j,P]of T.entries()){const $=j*P.canvas.width%M,F=Math.floor(j/2)*P.canvas.height;L.ctx.drawImage(P.canvas,$,F);for(const I of P.glyphs)I.texturePage=R,I.sizeClipSpace.x=I.size.x/M,I.sizeClipSpace.y=I.size.y/M,I.texturePosition.x+=$,I.texturePosition.y+=F,I.texturePositionClipSpace.x=I.texturePosition.x/M,I.texturePositionClipSpace.y=I.texturePosition.y/M;this._onRemoveTextureAtlasCanvas.fire(P.canvas);const W=this._activePages.indexOf(P);W!==-1&&this._activePages.splice(W,1)}return L}_deletePage(T){this._pages.splice(T,1);for(let R=T;R<this._pages.length;R++){const M=this._pages[R];for(const L of M.glyphs)L.texturePage--;M.version++}}getRasterizedGlyphCombinedChar(T,R,M,L,j){return this._getFromCacheMap(this._cacheMapCombined,T,R,M,L,j)}getRasterizedGlyph(T,R,M,L,j){return this._getFromCacheMap(this._cacheMap,T,R,M,L,j)}_getFromCacheMap(T,R,M,L,j,P=!1){return y=T.get(R,M,L,j),y||(y=this._drawToCache(R,M,L,j,P),T.set(R,M,L,j,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,R,M,L){if(this._config.allowTransparency)return f.NULL_COLOR;let j;switch(T){case 16777216:case 33554432:j=this._getColorFromAnsiIndex(R);break;case 50331648:const P=v.AttributeData.toColorRGB(R);j=f.channels.toColor(P[0],P[1],P[2]);break;default:j=M?f.color.opaque(this._config.colors.foreground):this._config.colors.background}return j}_getForegroundColor(T,R,M,L,j,P,$,F,W,I){const A=this._getMinimumContrastColor(T,R,M,L,j,P,$,W,F,I);if(A)return A;let D;switch(j){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&W&&P<8&&(P+=8),D=this._getColorFromAnsiIndex(P);break;case 50331648:const H=v.AttributeData.toColorRGB(P);D=f.channels.toColor(H[0],H[1],H[2]);break;default:D=$?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(D=f.color.opaque(D)),F&&(D=f.color.multiplyOpacity(D,c.DIM_OPACITY)),D}_resolveBackgroundRgba(T,R,M){switch(T){case 16777216:case 33554432:return this._getColorFromAnsiIndex(R).rgba;case 50331648:return R<<8;default:return M?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(T,R,M,L){switch(T){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&L&&R<8&&(R+=8),this._getColorFromAnsiIndex(R).rgba;case 50331648:return R<<8;default:return M?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(T,R,M,L,j,P,$,F,W,I){if(this._config.minimumContrastRatio===1||I)return;const A=this._getContrastCache(W),D=A.getColor(T,L);if(D!==void 0)return D||void 0;const H=this._resolveBackgroundRgba(R,M,$),V=this._resolveForegroundRgba(j,P,$,F),U=f.rgba.ensureContrastRatio(H,V,this._config.minimumContrastRatio/(W?2:1));if(!U)return void A.setColor(T,L,null);const G=f.channels.toColor(U>>24&255,U>>16&255,U>>8&255);return A.setColor(T,L,G),G}_getContrastCache(T){return T?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(T,R,M,L,j=!1){const P=typeof T=="number"?String.fromCharCode(T):T,$=Math.min(this._config.deviceCellWidth*Math.max(P.length,2)+4,this._textureSize);this._tmpCanvas.width<$&&(this._tmpCanvas.width=$);const F=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<F&&(this._tmpCanvas.height=F),this._tmpCtx.save(),this._workAttributeData.fg=M,this._workAttributeData.bg=R,this._workAttributeData.extended.ext=L,this._workAttributeData.isInvisible())return m;const W=!!this._workAttributeData.isBold(),I=!!this._workAttributeData.isInverse(),A=!!this._workAttributeData.isDim(),D=!!this._workAttributeData.isItalic(),H=!!this._workAttributeData.isUnderline(),V=!!this._workAttributeData.isStrikethrough(),U=!!this._workAttributeData.isOverline();let G=this._workAttributeData.getFgColor(),ee=this._workAttributeData.getFgColorMode(),Z=this._workAttributeData.getBgColor(),q=this._workAttributeData.getBgColorMode();if(I){const re=G;G=Z,Z=re;const le=ee;ee=q,q=le}const B=this._getBackgroundColor(q,Z,I,A);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=B.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const O=W?this._config.fontWeightBold:this._config.fontWeight,z=D?"italic":"";this._tmpCtx.font=`${z} ${O} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=c.TEXT_BASELINE;const Y=P.length===1&&(0,u.isPowerlineGlyph)(P.charCodeAt(0)),N=P.length===1&&(0,u.isRestrictedPowerlineGlyph)(P.charCodeAt(0)),J=this._getForegroundColor(R,q,Z,M,ee,G,I,A,W,(0,u.treatGlyphAsBackgroundColor)(P.charCodeAt(0)));this._tmpCtx.fillStyle=J.css;const K=N?0:4;let te=!1;this._config.customGlyphs!==!1&&(te=(0,d.tryDrawCustomChar)(this._tmpCtx,P,K,K,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let oe,ae=!Y;if(oe=typeof T=="number"?this._unicodeService.wcwidth(T):this._unicodeService.getStringCellWidth(T),H){this._tmpCtx.save();const re=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),le=re%2==1?.5:0;if(this._tmpCtx.lineWidth=re,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())ae=!1,this._tmpCtx.strokeStyle=`rgb(${v.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{ae=!1;let Te=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&Te<8&&(Te+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(Te).css}this._tmpCtx.beginPath();const X=K,ne=Math.ceil(K+this._config.deviceCharHeight)-le-(j?2*re:0),ue=ne+re,de=ne+2*re;let ve=this._workAttributeData.getUnderlineVariantOffset();for(let Te=0;Te<oe;Te++){this._tmpCtx.save();const be=X+Te*this._config.deviceCellWidth,xe=X+(Te+1)*this._config.deviceCellWidth,Xe=be+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(be,ne),this._tmpCtx.lineTo(xe,ne),this._tmpCtx.moveTo(be,de),this._tmpCtx.lineTo(xe,de);break;case 3:const Oe=re<=1?de:Math.ceil(K+this._config.deviceCharHeight-re/2)-le,Re=re<=1?ne:Math.ceil(K+this._config.deviceCharHeight+re/2)-le,ze=new Path2D;ze.rect(be,ne,this._config.deviceCellWidth,de-ne),this._tmpCtx.clip(ze),this._tmpCtx.moveTo(be-this._config.deviceCellWidth/2,ue),this._tmpCtx.bezierCurveTo(be-this._config.deviceCellWidth/2,Re,be,Re,be,ue),this._tmpCtx.bezierCurveTo(be,Oe,Xe,Oe,Xe,ue),this._tmpCtx.bezierCurveTo(Xe,Re,xe,Re,xe,ue),this._tmpCtx.bezierCurveTo(xe,Oe,xe+this._config.deviceCellWidth/2,Oe,xe+this._config.deviceCellWidth/2,ue);break;case 4:const st=ve===0?0:ve>=re?2*re-ve:re-ve;ve>=re||st===0?(this._tmpCtx.setLineDash([Math.round(re),Math.round(re)]),this._tmpCtx.moveTo(be+st,ne),this._tmpCtx.lineTo(xe,ne)):(this._tmpCtx.setLineDash([Math.round(re),Math.round(re)]),this._tmpCtx.moveTo(be,ne),this._tmpCtx.lineTo(be+st,ne),this._tmpCtx.moveTo(be+st+re,ne),this._tmpCtx.lineTo(xe,ne)),ve=(0,u.computeNextVariantOffset)(xe-be,re,ve);break;case 5:const Fe=.6,Ie=.3,Ze=xe-be,et=Math.floor(Fe*Ze),ht=Math.floor(Ie*Ze),_t=Ze-et-ht;this._tmpCtx.setLineDash([et,ht,_t]),this._tmpCtx.moveTo(be,ne),this._tmpCtx.lineTo(xe,ne);break;default:this._tmpCtx.moveTo(be,ne),this._tmpCtx.lineTo(xe,ne)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!te&&this._config.fontSize>=12&&!this._config.allowTransparency&&P!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const Te=this._tmpCtx.measureText(P);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in Te&&Te.actualBoundingBoxDescent>0){this._tmpCtx.save();const be=new Path2D;be.rect(X,ne-Math.ceil(re/2),this._config.deviceCellWidth*oe,de-ne+Math.ceil(re/2)),this._tmpCtx.clip(be),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=B.css,this._tmpCtx.strokeText(P,K,K+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(U){const re=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),le=re%2==1?.5:0;this._tmpCtx.lineWidth=re,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(K,K+le),this._tmpCtx.lineTo(K+this._config.deviceCharWidth*oe,K+le),this._tmpCtx.stroke()}if(te||this._tmpCtx.fillText(P,K,K+this._config.deviceCharHeight),P==="_"&&!this._config.allowTransparency){let re=w(this._tmpCtx.getImageData(K,K,this._config.deviceCellWidth,this._config.deviceCellHeight),B,J,ae);if(re)for(let le=1;le<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=B.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(P,K,K+this._config.deviceCharHeight-le),re=w(this._tmpCtx.getImageData(K,K,this._config.deviceCellWidth,this._config.deviceCellHeight),B,J,ae),re);le++);}if(V){const re=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),le=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=re,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(K,K+Math.floor(this._config.deviceCharHeight/2)-le),this._tmpCtx.lineTo(K+this._config.deviceCharWidth*oe,K+Math.floor(this._config.deviceCharHeight/2)-le),this._tmpCtx.stroke()}this._tmpCtx.restore();const _e=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let Se;if(Se=this._config.allowTransparency?function(re){for(let le=0;le<re.data.length;le+=4)if(re.data[le+3]>0)return!1;return!0}(_e):w(_e,B,J,ae),Se)return m;const ge=this._findGlyphBoundingBox(_e,this._workBoundingBox,$,N,te,K);let we,ce;for(;;){if(this._activePages.length===0){const re=this._createNewPage();we=re,ce=re.currentRow,ce.height=ge.size.y;break}we=this._activePages[this._activePages.length-1],ce=we.currentRow;for(const re of this._activePages)ge.size.y<=re.currentRow.height&&(we=re,ce=re.currentRow);for(let re=this._activePages.length-1;re>=0;re--)for(const le of this._activePages[re].fixedRows)le.height<=ce.height&&ge.size.y<=le.height&&(we=this._activePages[re],ce=le);if(ce.y+ge.size.y>=we.canvas.height||ce.height>ge.size.y+2){let re=!1;if(we.currentRow.y+we.currentRow.height+ge.size.y>=we.canvas.height){let le;for(const X of this._activePages)if(X.currentRow.y+X.currentRow.height+ge.size.y<X.canvas.height){le=X;break}if(le)we=le;else if(b.maxAtlasPages&&this._pages.length>=b.maxAtlasPages&&ce.y+ge.size.y<=we.canvas.height&&ce.height>=ge.size.y&&ce.x+ge.size.x<=we.canvas.width)re=!0;else{const X=this._createNewPage();we=X,ce=X.currentRow,ce.height=ge.size.y,re=!0}}re||(we.currentRow.height>0&&we.fixedRows.push(we.currentRow),ce={x:0,y:we.currentRow.y+we.currentRow.height,height:ge.size.y},we.fixedRows.push(ce),we.currentRow={x:0,y:ce.y+ce.height,height:0})}if(ce.x+ge.size.x<=we.canvas.width)break;ce===we.currentRow?(ce.x=0,ce.y+=ce.height,ce.height=0):we.fixedRows.splice(we.fixedRows.indexOf(ce),1)}return ge.texturePage=this._pages.indexOf(we),ge.texturePosition.x=ce.x,ge.texturePosition.y=ce.y,ge.texturePositionClipSpace.x=ce.x/we.canvas.width,ge.texturePositionClipSpace.y=ce.y/we.canvas.height,ge.sizeClipSpace.x/=we.canvas.width,ge.sizeClipSpace.y/=we.canvas.height,ce.height=Math.max(ce.height,ge.size.y),ce.x+=ge.size.x,we.ctx.putImageData(_e,ge.texturePosition.x-this._workBoundingBox.left,ge.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,ge.size.x,ge.size.y),we.addGlyph(ge),we.version++,ge}_findGlyphBoundingBox(T,R,M,L,j,P){R.top=0;const $=L?this._config.deviceCellHeight:this._tmpCanvas.height,F=L?this._config.deviceCellWidth:M;let W=!1;for(let I=0;I<$;I++){for(let A=0;A<F;A++){const D=I*this._tmpCanvas.width*4+4*A+3;if(T.data[D]!==0){R.top=I,W=!0;break}}if(W)break}R.left=0,W=!1;for(let I=0;I<P+F;I++){for(let A=0;A<$;A++){const D=A*this._tmpCanvas.width*4+4*I+3;if(T.data[D]!==0){R.left=I,W=!0;break}}if(W)break}R.right=F,W=!1;for(let I=P+F-1;I>=P;I--){for(let A=0;A<$;A++){const D=A*this._tmpCanvas.width*4+4*I+3;if(T.data[D]!==0){R.right=I,W=!0;break}}if(W)break}R.bottom=$,W=!1;for(let I=$-1;I>=0;I--){for(let A=0;A<F;A++){const D=I*this._tmpCanvas.width*4+4*A+3;if(T.data[D]!==0){R.bottom=I,W=!0;break}}if(W)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:R.right-R.left+1,y:R.bottom-R.top+1},sizeClipSpace:{x:R.right-R.left+1,y:R.bottom-R.top+1},offset:{x:-R.left+P+(L||j?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-R.top+P+(L||j?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}o.TextureAtlas=b;class S{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,R,M){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],M)for(const L of M)this._glyphs.push(...L.glyphs),this._usedPixels+=L._usedPixels;this.canvas=E(T,R,R),this.ctx=(0,u.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function w(k,T,R,M){const L=T.rgba>>>24,j=T.rgba>>>16&255,P=T.rgba>>>8&255,$=R.rgba>>>24,F=R.rgba>>>16&255,W=R.rgba>>>8&255,I=Math.floor((Math.abs(L-$)+Math.abs(j-F)+Math.abs(P-W))/12);let A=!0;for(let D=0;D<k.data.length;D+=4)k.data[D]===L&&k.data[D+1]===j&&k.data[D+2]===P||M&&Math.abs(k.data[D]-L)+Math.abs(k.data[D+1]-j)+Math.abs(k.data[D+2]-P)<I?k.data[D+3]=0:A=!1;return A}function E(k,T,R){const M=k.createElement("canvas");return M.width=T,M.height=R,M}},577:function(a,o,l){var c=this&&this.__decorate||function(p,m,y,b){var S,w=arguments.length,E=w<3?m:b===null?b=Object.getOwnPropertyDescriptor(m,y):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(p,m,y,b);else for(var k=p.length-1;k>=0;k--)(S=p[k])&&(E=(w<3?S(E):w>3?S(m,y,E):S(m,y))||E);return w>3&&E&&Object.defineProperty(m,y,E),E},d=this&&this.__param||function(p,m){return function(y,b){m(y,b,p)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const u=l(147),f=l(855),g=l(782),x=l(97);class _ extends u.AttributeData{constructor(m,y,b){super(),this.content=0,this.combinedData="",this.fg=m.fg,this.bg=m.bg,this.combinedData=y,this._width=b}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(m){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=_;let v=o.CharacterJoinerService=class mO{constructor(m){this._bufferService=m,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new g.CellData}register(m){const y={id:this._nextCharacterJoinerId++,handler:m};return this._characterJoiners.push(y),y.id}deregister(m){for(let y=0;y<this._characterJoiners.length;y++)if(this._characterJoiners[y].id===m)return this._characterJoiners.splice(y,1),!0;return!1}getJoinedCharacters(m){if(this._characterJoiners.length===0)return[];const y=this._bufferService.buffer.lines.get(m);if(!y||y.length===0)return[];const b=[],S=y.translateToString(!0);let w=0,E=0,k=0,T=y.getFg(0),R=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!==R){if(M-w>1){const L=this._getJoinedRanges(S,k,E,y,w);for(let j=0;j<L.length;j++)b.push(L[j])}w=M,k=E,T=this._workCell.fg,R=this._workCell.bg}E+=this._workCell.getChars().length||f.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-w>1){const M=this._getJoinedRanges(S,k,E,y,w);for(let L=0;L<M.length;L++)b.push(M[L])}return b}_getJoinedRanges(m,y,b,S,w){const E=m.substring(y,b);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 R=this._characterJoiners[T].handler(E);for(let M=0;M<R.length;M++)mO._mergeRanges(k,R[M])}catch(R){console.error(R)}return this._stringRangesToCellRanges(k,S,w),k}_stringRangesToCellRanges(m,y,b){let S=0,w=!1,E=0,k=m[S];if(k){for(let T=b;T<this._bufferService.cols;T++){const R=y.getWidth(T),M=y.getString(T).length||f.WHITESPACE_CELL_CHAR.length;if(R!==0){if(!w&&k[0]<=E&&(k[0]=T,w=!0),k[1]<=E){if(k[1]=T,k=m[++S],!k)break;k[0]<=E?(k[0]=T,w=!0):w=!1}E+=M}}k&&(k[1]=this._bufferService.cols)}}static _mergeRanges(m,y){let b=!1;for(let S=0;S<m.length;S++){const w=m[S];if(b){if(y[1]<=w[0])return m[S-1][1]=y[1],m;if(y[1]<=w[1])return m[S-1][1]=Math.max(y[1],w[1]),m.splice(S,1),m;m.splice(S,1),S--}else{if(y[1]<=w[0])return m.splice(S,0,y),m;if(y[1]<=w[1])return w[0]=Math.min(y[0],w[0]),m;y[0]<w[1]&&(w[0]=Math.min(y[0],w[0]),b=!0)}}return b?m[m.length-1][1]=y[1]:m.push(y),m}};o.CharacterJoinerService=v=c([d(0,x.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,c=0,d=0,u=0;var f,g,x,_,v;function p(y){const b=y.toString(16);return b.length<2?"0"+b:b}function m(y,b){return y<b?(b+.05)/(y+.05):(y+.05)/(b+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},function(y){y.toCss=function(b,S,w,E){return E!==void 0?`#${p(b)}${p(S)}${p(w)}${p(E)}`:`#${p(b)}${p(S)}${p(w)}`},y.toRgba=function(b,S,w,E=255){return(b<<24|S<<16|w<<8|E)>>>0},y.toColor=function(b,S,w,E){return{css:y.toCss(b,S,w,E),rgba:y.toRgba(b,S,w,E)}}}(f||(o.channels=f={})),function(y){function b(S,w){return u=Math.round(255*w),[l,c,d]=v.toChannels(S.rgba),{css:f.toCss(l,c,d,u),rgba:f.toRgba(l,c,d,u)}}y.blend=function(S,w){if(u=(255&w.rgba)/255,u===1)return{css:w.css,rgba:w.rgba};const E=w.rgba>>24&255,k=w.rgba>>16&255,T=w.rgba>>8&255,R=S.rgba>>24&255,M=S.rgba>>16&255,L=S.rgba>>8&255;return l=R+Math.round((E-R)*u),c=M+Math.round((k-M)*u),d=L+Math.round((T-L)*u),{css:f.toCss(l,c,d),rgba:f.toRgba(l,c,d)}},y.isOpaque=function(S){return(255&S.rgba)==255},y.ensureContrastRatio=function(S,w,E){const k=v.ensureContrastRatio(S.rgba,w.rgba,E);if(k)return f.toColor(k>>24&255,k>>16&255,k>>8&255)},y.opaque=function(S){const w=(255|S.rgba)>>>0;return[l,c,d]=v.toChannels(w),{css:f.toCss(l,c,d),rgba:w}},y.opacity=b,y.multiplyOpacity=function(S,w){return u=255&S.rgba,b(S,u*w/255)},y.toColorRGB=function(S){return[S.rgba>>24&255,S.rgba>>16&255,S.rgba>>8&255]}}(g||(o.color=g={})),function(y){let b,S;try{const w=document.createElement("canvas");w.width=1,w.height=1;const E=w.getContext("2d",{willReadFrequently:!0});E&&(b=E,b.globalCompositeOperation="copy",S=b.createLinearGradient(0,0,1,1))}catch{}y.toColor=function(w){if(w.match(/#[\da-f]{3,8}/i))switch(w.length){case 4:return l=parseInt(w.slice(1,2).repeat(2),16),c=parseInt(w.slice(2,3).repeat(2),16),d=parseInt(w.slice(3,4).repeat(2),16),f.toColor(l,c,d);case 5:return l=parseInt(w.slice(1,2).repeat(2),16),c=parseInt(w.slice(2,3).repeat(2),16),d=parseInt(w.slice(3,4).repeat(2),16),u=parseInt(w.slice(4,5).repeat(2),16),f.toColor(l,c,d,u);case 7:return{css:w,rgba:(parseInt(w.slice(1),16)<<8|255)>>>0};case 9:return{css:w,rgba:parseInt(w.slice(1),16)>>>0}}const E=w.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(E)return l=parseInt(E[1]),c=parseInt(E[2]),d=parseInt(E[3]),u=Math.round(255*(E[5]===void 0?1:parseFloat(E[5]))),f.toColor(l,c,d,u);if(!b||!S)throw new Error("css.toColor: Unsupported css format");if(b.fillStyle=S,b.fillStyle=w,typeof b.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(b.fillRect(0,0,1,1),[l,c,d,u]=b.getImageData(0,0,1,1).data,u!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:f.toRgba(l,c,d,u),css:w}}}(x||(o.css=x={})),function(y){function b(S,w,E){const k=S/255,T=w/255,R=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*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))}y.relativeLuminance=function(S){return b(S>>16&255,S>>8&255,255&S)},y.relativeLuminance2=b}(_||(o.rgb=_={})),function(y){function b(w,E,k){const T=w>>24&255,R=w>>16&255,M=w>>8&255;let L=E>>24&255,j=E>>16&255,P=E>>8&255,$=m(_.relativeLuminance2(L,j,P),_.relativeLuminance2(T,R,M));for(;$<k&&(L>0||j>0||P>0);)L-=Math.max(0,Math.ceil(.1*L)),j-=Math.max(0,Math.ceil(.1*j)),P-=Math.max(0,Math.ceil(.1*P)),$=m(_.relativeLuminance2(L,j,P),_.relativeLuminance2(T,R,M));return(L<<24|j<<16|P<<8|255)>>>0}function S(w,E,k){const T=w>>24&255,R=w>>16&255,M=w>>8&255;let L=E>>24&255,j=E>>16&255,P=E>>8&255,$=m(_.relativeLuminance2(L,j,P),_.relativeLuminance2(T,R,M));for(;$<k&&(L<255||j<255||P<255);)L=Math.min(255,L+Math.ceil(.1*(255-L))),j=Math.min(255,j+Math.ceil(.1*(255-j))),P=Math.min(255,P+Math.ceil(.1*(255-P))),$=m(_.relativeLuminance2(L,j,P),_.relativeLuminance2(T,R,M));return(L<<24|j<<16|P<<8|255)>>>0}y.blend=function(w,E){if(u=(255&E)/255,u===1)return E;const k=E>>24&255,T=E>>16&255,R=E>>8&255,M=w>>24&255,L=w>>16&255,j=w>>8&255;return l=M+Math.round((k-M)*u),c=L+Math.round((T-L)*u),d=j+Math.round((R-j)*u),f.toRgba(l,c,d)},y.ensureContrastRatio=function(w,E,k){const T=_.relativeLuminance(w>>8),R=_.relativeLuminance(E>>8);if(m(T,R)<k){if(R<T){const j=b(w,E,k),P=m(T,_.relativeLuminance(j>>8));if(P<k){const $=S(w,E,k);return P>m(T,_.relativeLuminance($>>8))?j:$}return j}const M=S(w,E,k),L=m(T,_.relativeLuminance(M>>8));if(L<k){const j=b(w,E,k);return L>m(T,_.relativeLuminance(j>>8))?M:j}return M}},y.reduceLuminance=b,y.increaseLuminance=S,y.toChannels=function(w){return[w>>24&255,w>>16&255,w>>8&255,255&w]}}(v||(o.rgba=v={})),o.toPaddedHex=p,o.contrastRatio=m},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 c=0;c<this._listeners.length;c++)if(this._listeners[c]===l)return void this._listeners.splice(c,1)}}})),this._event}fire(l,c){const d=[];for(let u=0;u<this._listeners.length;u++)d.push(this._listeners[u]);for(let u=0;u<d.length;u++)d[u].call(void 0,l,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(l,c){return l(d=>c.fire(d))},o.runAndSubscribe=function(l,c){return c(void 0),l(d=>c(d))}},859:(a,o)=>{function l(c){for(const d of c)d.dispose();c.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 c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const d=this._disposables.indexOf(c);d!==-1&&this._disposables.splice(d,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var d;this._isDisposed||c===this._value||((d=this._value)==null||d.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)==null||c.dispose(),this._value=void 0}},o.toDisposable=function(c){return{dispose:c}},o.disposeArray=l,o.getDisposeArrayDisposable=function(c){return{dispose:()=>l(c)}}},485:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class l{constructor(){this._data={}}set(d,u,f){this._data[d]||(this._data[d]={}),this._data[d][u]=f}get(d,u){return this._data[d]?this._data[d][u]:void 0}clear(){this._data={}}}o.TwoKeyMap=l,o.FourKeyMap=class{constructor(){this._data=new l}set(c,d,u,f,g){this._data.get(c,d)||this._data.set(c,d,new l),this._data.get(c,d).set(u,f,g)}get(c,d,u,f){var g;return(g=this._data.get(c,d))==null?void 0:g.get(u,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,c=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 d=l.match(/Version\/(\d+)/);return d===null||d.length<2?0:parseInt(d[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),o.isIpad=c==="iPad",o.isIphone=c==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),o.isLinux=c.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 c=l(399);class d{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 x=0,_=0,v=g.timeRemaining(),p=0;for(;this._i<this._tasks.length;){if(x=Date.now(),this._tasks[this._i]()||this._i++,x=Math.max(1,Date.now()-x),_=Math.max(x,_),p=g.timeRemaining(),1.5*_>p)return v-x<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(v-x))}ms`),void this._start();v=p}this.clear()}}class u extends d{_requestCallback(g){return setTimeout(()=>g(this._createDeadline(16)))}_cancelCallback(g){clearTimeout(g)}_createDeadline(g){const x=Date.now()+g;return{timeRemaining:()=>Math.max(0,x-Date.now())}}}o.PriorityTaskQueue=u,o.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends d{_requestCallback(f){return requestIdleCallback(f)}_cancelCallback(f){cancelIdleCallback(f)}}:u,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 c}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new l;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}o.AttributeData=l;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}get underlineVariantOffset(){const u=(3758096384&this._ext)>>29;return u<0?4294967288^u:u}set underlineVariantOffset(u){this._ext&=536870911,this._ext|=u<<29&3758096384}constructor(u=0,f=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=f}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=c},782:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const c=l(133),d=l(855),u=l(147);class f extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(x){const _=new f;return _.setFromCharData(x),_}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,c.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(x){this.fg=x[d.CHAR_DATA_ATTR_INDEX],this.bg=0;let _=!1;if(x[d.CHAR_DATA_CHAR_INDEX].length>2)_=!0;else if(x[d.CHAR_DATA_CHAR_INDEX].length===2){const v=x[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=v&&v<=56319){const p=x[d.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=p&&p<=57343?this.content=1024*(v-55296)+p-56320+65536|x[d.CHAR_DATA_WIDTH_INDEX]<<22:_=!0}else _=!0}else this.content=x[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|x[d.CHAR_DATA_WIDTH_INDEX]<<22;_&&(this.combinedData=x[d.CHAR_DATA_CHAR_INDEX],this.content=2097152|x[d.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,c=0,d=l.length){let u="";for(let f=c;f<d;++f){let g=l[f];g>65535?(g-=65536,u+=String.fromCharCode(55296+(g>>10))+String.fromCharCode(g%1024+56320)):u+=String.fromCharCode(g)}return u},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(l,c){const d=l.length;if(!d)return 0;let u=0,f=0;if(this._interim){const g=l.charCodeAt(f++);56320<=g&&g<=57343?c[u++]=1024*(this._interim-55296)+g-56320+65536:(c[u++]=this._interim,c[u++]=g),this._interim=0}for(let g=f;g<d;++g){const x=l.charCodeAt(g);if(55296<=x&&x<=56319){if(++g>=d)return this._interim=x,u;const _=l.charCodeAt(g);56320<=_&&_<=57343?c[u++]=1024*(x-55296)+_-56320+65536:(c[u++]=x,c[u++]=_)}else x!==65279&&(c[u++]=x)}return u}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(l,c){const d=l.length;if(!d)return 0;let u,f,g,x,_=0,v=0,p=0;if(this.interim[0]){let b=!1,S=this.interim[0];S&=(224&S)==192?31:(240&S)==224?15:7;let w,E=0;for(;(w=63&this.interim[++E])&&E<4;)S<<=6,S|=w;const k=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,T=k-E;for(;p<T;){if(p>=d)return 0;if(w=l[p++],(192&w)!=128){p--,b=!0;break}this.interim[E++]=w,S<<=6,S|=63&w}b||(k===2?S<128?p--:c[_++]=S:k===3?S<2048||S>=55296&&S<=57343||S===65279||(c[_++]=S):S<65536||S>1114111||(c[_++]=S)),this.interim.fill(0)}const m=d-4;let y=p;for(;y<d;){for(;!(!(y<m)||128&(u=l[y])||128&(f=l[y+1])||128&(g=l[y+2])||128&(x=l[y+3]));)c[_++]=u,c[_++]=f,c[_++]=g,c[_++]=x,y+=4;if(u=l[y++],u<128)c[_++]=u;else if((224&u)==192){if(y>=d)return this.interim[0]=u,_;if(f=l[y++],(192&f)!=128){y--;continue}if(v=(31&u)<<6|63&f,v<128){y--;continue}c[_++]=v}else if((240&u)==224){if(y>=d)return this.interim[0]=u,_;if(f=l[y++],(192&f)!=128){y--;continue}if(y>=d)return this.interim[0]=u,this.interim[1]=f,_;if(g=l[y++],(192&g)!=128){y--;continue}if(v=(15&u)<<12|(63&f)<<6|63&g,v<2048||v>=55296&&v<=57343||v===65279)continue;c[_++]=v}else if((248&u)==240){if(y>=d)return this.interim[0]=u,_;if(f=l[y++],(192&f)!=128){y--;continue}if(y>=d)return this.interim[0]=u,this.interim[1]=f,_;if(g=l[y++],(192&g)!=128){y--;continue}if(y>=d)return this.interim[0]=u,this.interim[1]=f,this.interim[2]=g,_;if(x=l[y++],(192&x)!=128){y--;continue}if(v=(7&u)<<18|(63&f)<<12|(63&g)<<6|63&x,v<65536||v>1114111)continue;c[_++]=v}}return _}}},776:function(a,o,l){var c=this&&this.__decorate||function(v,p,m,y){var b,S=arguments.length,w=S<3?p:y===null?y=Object.getOwnPropertyDescriptor(p,m):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(v,p,m,y);else for(var E=v.length-1;E>=0;E--)(b=v[E])&&(w=(S<3?b(w):S>3?b(p,m,w):b(p,m))||w);return S>3&&w&&Object.defineProperty(p,m,w),w},d=this&&this.__param||function(v,p){return function(m,y){p(m,y,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const u=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 x,_=o.LogService=class extends u.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())),x=this}_updateLogLevel(){this._logLevel=g[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(v){for(let p=0;p<v.length;p++)typeof v[p]=="function"&&(v[p]=v[p]())}_log(v,p,m){this._evalLazyOptionalParams(m),v.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+p,...m)}trace(v,...p){var m;this._logLevel<=f.LogLevelEnum.TRACE&&this._log(((m=this._optionsService.options.logger)==null?void 0:m.trace.bind(this._optionsService.options.logger))??console.log,v,p)}debug(v,...p){var m;this._logLevel<=f.LogLevelEnum.DEBUG&&this._log(((m=this._optionsService.options.logger)==null?void 0:m.debug.bind(this._optionsService.options.logger))??console.log,v,p)}info(v,...p){var m;this._logLevel<=f.LogLevelEnum.INFO&&this._log(((m=this._optionsService.options.logger)==null?void 0:m.info.bind(this._optionsService.options.logger))??console.info,v,p)}warn(v,...p){var m;this._logLevel<=f.LogLevelEnum.WARN&&this._log(((m=this._optionsService.options.logger)==null?void 0:m.warn.bind(this._optionsService.options.logger))??console.warn,v,p)}error(v,...p){var m;this._logLevel<=f.LogLevelEnum.ERROR&&this._log(((m=this._optionsService.options.logger)==null?void 0:m.error.bind(this._optionsService.options.logger))??console.error,v,p)}};o.LogService=_=c([d(0,f.IOptionsService)],_),o.setTraceLogger=function(v){x=v},o.traceCall=function(v,p,m){if(typeof m.value!="function")throw new Error("not supported");const y=m.value;m.value=function(...b){if(x.logLevel!==f.LogLevelEnum.TRACE)return y.apply(this,b);x.trace(`GlyphRenderer#${y.name}(${b.map(w=>JSON.stringify(w)).join(", ")})`);const S=y.apply(this,b);return x.trace(`GlyphRenderer#${y.name} return`,S),S}}},726:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const l="di$target",c="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(d){return d[c]||[]},o.createDecorator=function(d){if(o.serviceRegistry.has(d))return o.serviceRegistry.get(d);const u=function(f,g,x){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(_,v,p){v[l]===v?v[c].push({id:_,index:p}):(v[c]=[{id:_,index:p}],v[l]=v)})(u,f,x)};return u.toString=()=>d,o.serviceRegistry.set(d,u),u}},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 c=l(726);var d;o.IBufferService=(0,c.createDecorator)("BufferService"),o.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),o.ICoreService=(0,c.createDecorator)("CoreService"),o.ICharsetService=(0,c.createDecorator)("CharsetService"),o.IInstantiationService=(0,c.createDecorator)("InstantiationService"),function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"}(d||(o.LogLevelEnum=d={})),o.ILogService=(0,c.createDecorator)("LogService"),o.IOptionsService=(0,c.createDecorator)("OptionsService"),o.IOscLinkService=(0,c.createDecorator)("OscLinkService"),o.IUnicodeService=(0,c.createDecorator)("UnicodeService"),o.IDecorationService=(0,c.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),c=i(776),d=i(949);class u 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 x=g._core;if(!g.element)return void this.register(x.onWillOpen(()=>this.activate(g)));this._terminal=g;const _=x.coreService,v=x.optionsService,p=x.screenElement,m=x.linkifier,y=x,b=y._bufferService,S=y._renderService,w=y._characterJoinerService,E=y._charSizeService,k=y._coreBrowserService,T=y._decorationService,R=y._logService,M=y._themeService;(0,c.setTraceLogger)(R),this._renderer=new d.CanvasRenderer(g,p,m,b,E,v,w,_,k,T,M),this.register((0,o.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,o.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),S.setRenderer(this._renderer),S.handleResize(b.cols,b.rows),this.register((0,l.toDisposable)(()=>{var L;S.setRenderer(this._terminal._core._createRenderer()),S.handleResize(g.cols,g.rows),(L=this._renderer)==null||L.dispose(),this._renderer=void 0}))}clearTextureAtlas(){var g;(g=this._renderer)==null||g.clearTextureAtlas()}}a.CanvasAddon=u})(),s})())})(pO);var gO=pO.exports,vO={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")),c=Math.max(0,parseInt(o.getPropertyValue("width"))),d=window.getComputedStyle(this._terminal.element),u=l-(parseInt(d.getPropertyValue("padding-top"))+parseInt(d.getPropertyValue("padding-bottom"))),f=c-(parseInt(d.getPropertyValue("padding-right"))+parseInt(d.getPropertyValue("padding-left")))-a;return{cols:Math.max(2,Math.floor(f/s.css.cell.width)),rows:Math.max(1,Math.floor(u/s.css.cell.height))}}}})(),n})())})(vO);var yO=vO.exports,_O={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 c=0;c<this._listeners.length;c++)if(this._listeners[c]===l)return void this._listeners.splice(c,1)}}})),this._event}fire(l,c){const d=[];for(let u=0;u<this._listeners.length;u++)d.push(this._listeners[u]);for(let u=0;u<d.length;u++)d[u].call(void 0,l,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(l,c){return l(d=>c.fire(d))},o.runAndSubscribe=function(l,c){return c(void 0),l(d=>c(d))}},859:(a,o)=>{function l(c){for(const d of c)d.dispose();c.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 c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const d=this._disposables.indexOf(c);d!==-1&&this._disposables.splice(d,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var d;this._isDisposed||c===this._value||((d=this._value)==null||d.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)==null||c.dispose(),this._value=void 0}},o.toDisposable=function(c){return{dispose:c}},o.disposeArray=l,o.getDisposeArrayDisposable=function(c){return{dispose:()=>l(c)}}}},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),c=" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?";class d 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 x=!this._lastSearchOptions||this._didOptionsChange(this._lastSearchOptions,g);this._lastSearchOptions=g,g!=null&&g.decorations&&(this._cachedSearchTerm===void 0||f!==this._cachedSearchTerm||x)&&this._highlightAllMatches(f,g);const _=this._findNextAndSelect(f,g);return this._fireResults(g),this._cachedSearchTerm=f,_}_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 x=[];let _,v=this._find(f,0,0,g);for(;v&&((_==null?void 0:_.row)!==v.row||(_==null?void 0:_.col)!==v.col)&&!(x.length>=this._highlightLimit);)_=v,x.push(_),v=this._find(f,_.col+_.term.length>=this._terminal.cols?_.row+1:_.row,_.col+_.term.length>=this._terminal.cols?0:_.col+1,g);for(const p of x){const m=this._createResultDecoration(p,g.decorations);m&&(this._highlightedLines.add(m.marker.line),this._highlightDecorations.push({decoration:m,match:p,dispose(){m.dispose()}}))}}_find(f,g,x,_){var m;if(!this._terminal||!f||f.length===0)return(m=this._terminal)==null||m.clearSelection(),void this.clearDecorations();if(x>this._terminal.cols)throw new Error(`Invalid col: ${x} to search in terminal of ${this._terminal.cols} cols`);let v;this._initLinesCache();const p={startRow:g,startCol:x};if(v=this._findInLine(f,p,_),!v)for(let y=g+1;y<this._terminal.buffer.active.baseY+this._terminal.rows&&(p.startRow=y,p.startCol=0,v=this._findInLine(f,p,_),!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 x=this._terminal.getSelectionPosition();this._terminal.clearSelection();let _=0,v=0;x&&(this._cachedSearchTerm===f?(_=x.end.x,v=x.end.y):(_=x.start.x,v=x.start.y)),this._initLinesCache();const p={startRow:v,startCol:_};let m=this._findInLine(f,p,g);if(!m)for(let b=v+1;b<this._terminal.buffer.active.baseY+this._terminal.rows&&(p.startRow=b,p.startCol=0,m=this._findInLine(f,p,g),!m);b++);if(!m&&v!==0)for(let b=0;b<v&&(p.startRow=b,p.startCol=0,m=this._findInLine(f,p,g),!m);b++);return!m&&x&&(p.startRow=x.start.y,p.startCol=0,m=this._findInLine(f,p,g)),this._selectResult(m,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 x=!this._lastSearchOptions||this._didOptionsChange(this._lastSearchOptions,g);this._lastSearchOptions=g,g!=null&&g.decorations&&(this._cachedSearchTerm===void 0||f!==this._cachedSearchTerm||x)&&this._highlightAllMatches(f,g);const _=this._findPreviousAndSelect(f,g);return this._fireResults(g),this._cachedSearchTerm=f,_}_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 x=this._selectedDecoration.value.match;for(let _=0;_<this._highlightDecorations.length;_++){const v=this._highlightDecorations[_].match;if(v.row===x.row&&v.col===x.col&&v.size===x.size){g=_;break}}}this._onDidChangeResults.fire({resultIndex:g,resultCount:this._highlightDecorations.length})}}_findPreviousAndSelect(f,g){var b;if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");if(!this._terminal||!f||f.length===0)return(b=this._terminal)==null||b.clearSelection(),this.clearDecorations(),!1;const x=this._terminal.getSelectionPosition();this._terminal.clearSelection();let _=this._terminal.buffer.active.baseY+this._terminal.rows-1,v=this._terminal.cols;const p=!0;this._initLinesCache();const m={startRow:_,startCol:v};let y;if(x&&(m.startRow=_=x.start.y,m.startCol=v=x.start.x,this._cachedSearchTerm!==f&&(y=this._findInLine(f,m,g,!1),y||(m.startRow=_=x.end.y,m.startCol=v=x.end.x))),y||(y=this._findInLine(f,m,g,p)),!y){m.startCol=Math.max(m.startCol,this._terminal.cols);for(let S=_-1;S>=0&&(m.startRow=S,y=this._findInLine(f,m,g,p),!y);S--);}if(!y&&_!==this._terminal.buffer.active.baseY+this._terminal.rows-1)for(let S=this._terminal.buffer.active.baseY+this._terminal.rows-1;S>=_&&(m.startRow=S,y=this._findInLine(f,m,g,p),!y);S--);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,x){return(f===0||c.includes(g[f-1]))&&(f+x.length===g.length||c.includes(g[f+x.length]))}_findInLine(f,g,x={},_=!1){var M;const v=this._terminal,p=g.startRow,m=g.startCol,y=v.buffer.active.getLine(p);if(y!=null&&y.isWrapped)return _?void(g.startCol+=v.cols):(g.startRow--,g.startCol+=v.cols,this._findInLine(f,g,x));let b=(M=this._linesCache)==null?void 0:M[p];b||(b=this._translateBufferLineToStringWithWrap(p,!0),this._linesCache&&(this._linesCache[p]=b));const[S,w]=b,E=this._bufferColsToStringOffset(p,m),k=x.caseSensitive?f:f.toLowerCase(),T=x.caseSensitive?S:S.toLowerCase();let R=-1;if(x.regex){const L=RegExp(k,"g");let j;if(_)for(;j=L.exec(T.slice(0,E));)R=L.lastIndex-j[0].length,f=j[0],L.lastIndex-=f.length-1;else j=L.exec(T.slice(E)),j&&j[0].length>0&&(R=E+(L.lastIndex-j[0].length),f=j[0])}else _?E-k.length>=0&&(R=T.lastIndexOf(k,E-k.length)):R=T.indexOf(k,E);if(R>=0){if(x.wholeWord&&!this._isWholeWord(R,T,f))return;let L=0;for(;L<w.length-1&&R>=w[L+1];)L++;let j=L;for(;j<w.length-1&&R+f.length>=w[j+1];)j++;const P=R-w[L],$=R+f.length-w[j],F=this._stringLengthToBufferSize(p+L,P);return{term:f,col:F,row:p+L,size:this._stringLengthToBufferSize(p+j,$)-F+v.cols*(j-L)}}}_stringLengthToBufferSize(f,g){const x=this._terminal.buffer.active.getLine(f);if(!x)return 0;for(let _=0;_<g;_++){const v=x.getCell(_);if(!v)break;const p=v.getChars();p.length>1&&(g-=p.length-1);const m=x.getCell(_+1);m&&m.getWidth()===0&&g++}return g}_bufferColsToStringOffset(f,g){const x=this._terminal;let _=f,v=0,p=x.buffer.active.getLine(_);for(;g>0&&p;){for(let m=0;m<g&&m<x.cols;m++){const y=p.getCell(m);if(!y)break;y.getWidth()&&(v+=y.getCode()===0?1:y.getChars().length)}if(_++,p=x.buffer.active.getLine(_),p&&!p.isWrapped)break;g-=x.cols}return v}_translateBufferLineToStringWithWrap(f,g){var m;const x=this._terminal,_=[],v=[0];let p=x.buffer.active.getLine(f);for(;p;){const y=x.buffer.active.getLine(f+1),b=!!y&&y.isWrapped;let S=p.translateToString(!b&&g);if(b&&y){const w=p.getCell(p.length-1);w&&w.getCode()===0&&w.getWidth()===1&&((m=y.getCell(0))==null?void 0:m.getWidth())===2&&(S=S.slice(0,-1))}if(_.push(S),!b)break;v.push(v[v.length-1]+S.length),f++,p=y}return[_.join(""),v]}_selectResult(f,g,x){const _=this._terminal;if(this._selectedDecoration.clear(),!f)return _.clearSelection(),!1;if(_.select(f.col,f.row,f.size),g){const v=_.registerMarker(-_.buffer.active.baseY-_.buffer.active.cursorY+f.row);if(v){const p=_.registerDecoration({marker:v,x:f.col,width:f.size,backgroundColor:g.activeMatchBackground,layer:"top",overviewRulerOptions:{color:g.activeMatchColorOverviewRuler}});if(p){const m=[];m.push(v),m.push(p.onRender(y=>this._applyStyles(y,g.activeMatchBorder,!0))),m.push(p.onDispose(()=>(0,l.disposeArray)(m))),this._selectedDecoration.value={decoration:p,match:f,dispose(){p.dispose()}}}}}if(!x&&(f.row>=_.buffer.active.viewportY+_.rows||f.row<_.buffer.active.viewportY)){let v=f.row-_.buffer.active.viewportY;v-=Math.floor(_.rows/2),_.scrollLines(v)}return!0}_applyStyles(f,g,x){f.classList.contains("xterm-find-result-decoration")||(f.classList.add("xterm-find-result-decoration"),g&&(f.style.outline=`1px solid ${g}`)),x&&f.classList.add("xterm-find-active-result-decoration")}_createResultDecoration(f,g){const x=this._terminal,_=x.registerMarker(-x.buffer.active.baseY-x.buffer.active.cursorY+f.row);if(!_)return;const v=x.registerDecoration({marker:_,x:f.col,width:f.size,backgroundColor:g.matchBackground,overviewRulerOptions:this._highlightedLines.has(_.line)?void 0:{color:g.matchOverviewRuler,position:"center"}});if(v){const p=[];p.push(_),p.push(v.onRender(m=>this._applyStyles(m,g.matchBorder,!1))),p.push(v.onDispose(()=>(0,l.disposeArray)(p)))}return v}}a.SearchAddon=d})(),s})())})(_O);var xO=_O.exports,bO={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(self,()=>(()=>{var n={6:(a,o)=>{function l(d){try{const u=new URL(d),f=u.password&&u.username?`${u.protocol}//${u.username}:${u.password}@${u.host}`:u.username?`${u.protocol}//${u.username}@${u.host}`:`${u.protocol}//${u.host}`;return d.toLocaleLowerCase().startsWith(f.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(d,u,f,g={}){this._terminal=d,this._regex=u,this._handler=f,this._options=g}provideLinks(d,u){const f=c.computeLink(d,this._regex,this._terminal,this._handler);u(this._addCallbacks(f))}_addCallbacks(d){return d.map(u=>(u.leave=this._options.leave,u.hover=(f,g)=>{if(this._options.hover){const{range:x}=u;this._options.hover(f,g,x)}},u))}};class c{static computeLink(u,f,g,x){const _=new RegExp(f.source,(f.flags||"")+"g"),[v,p]=c._getWindowedLineStrings(u-1,g),m=v.join("");let y;const b=[];for(;y=_.exec(m);){const S=y[0];if(!l(S))continue;const[w,E]=c._mapStrIdx(g,p,0,y.index),[k,T]=c._mapStrIdx(g,w,E,S.length);if(w===-1||E===-1||k===-1||T===-1)continue;const R={start:{x:E+1,y:w+1},end:{x:T,y:k+1}};b.push({range:R,text:S,activate:x})}return b}static _getWindowedLineStrings(u,f){let g,x=u,_=u,v=0,p="";const m=[];if(g=f.buffer.active.getLine(u)){const y=g.translateToString(!0);if(g.isWrapped&&y[0]!==" "){for(v=0;(g=f.buffer.active.getLine(--x))&&v<2048&&(p=g.translateToString(!0),v+=p.length,m.push(p),g.isWrapped&&p.indexOf(" ")===-1););m.reverse()}for(m.push(y),v=0;(g=f.buffer.active.getLine(++_))&&g.isWrapped&&v<2048&&(p=g.translateToString(!0),v+=p.length,m.push(p),p.indexOf(" ")===-1););}return[m,x]}static _mapStrIdx(u,f,g,x){const _=u.buffer.active,v=_.getNullCell();let p=g;for(;x;){const m=_.getLine(f);if(!m)return[-1,-1];for(let y=p;y<m.length;++y){m.getCell(y,v);const b=v.getChars();if(v.getWidth()&&(x-=b.length||1,y===m.length-1&&b==="")){const S=_.getLine(f+1);S&&S.isWrapped&&(S.getCell(0,v),v.getWidth()===2&&(x+=1))}if(x<0)return[f,y]}f++,p=0}return[f,p]}}o.LinkComputer=c}},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 c(d,u){const f=window.open();if(f){try{f.opener=null}catch{}f.location.href=u}else console.warn("Opening link blocked as opener could not be cleared")}a.WebLinksAddon=class{constructor(d=c,u={}){this._handler=d,this._options=u}activate(d){this._terminal=d;const u=this._options,f=u.urlRegex||l;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,f,this._handler,u))}dispose(){var d;(d=this._linkProvider)==null||d.dispose()}}})(),s})())})(bO);var wO=bO.exports;const Xse=EP("liveConsoleCommandHistory",[]),Qse=EP("liveConsoleCommandBookmarks",[]),Jse=50,SO=()=>{const[e,t]=wr(Xse);return{history:e,setHistory:t,appendHistory:n=>{const r=e.filter(i=>i!==n);r.unshift(n)>Jse&&r.pop(),t(r)},wipeHistory:()=>{t([])}}},Zse=()=>{const[e,t]=wr(Qse);return{bookmarks:e,addBookmark:n=>{e.includes(n)||t([n,...e])},removeBookmark:n=>{t(e.filter(r=>r!==n))}}};function Im({icon:e,title:t,disabled:n,onClick:r}){return h.jsxs("div",{tabIndex:0,className:ie(`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:[h.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"}),h.jsx("span",{className:"hidden 2xl:inline ml-1 align-middle",children:t})]})}function eoe(e){const{history:t,appendHistory:n}=SO(),[r,i]=C.useState(-1),s=C.useRef(""),a=e.termInputRef,{hasPerm:o}=di(),l=o("console.write");C.useEffect(()=>{e.isConnected&&a.current&&a.current.focus()},[e.isConnected,a]);const c=()=>{if(!a.current)return;r===-1&&(s.current=a.current.value??"");const g=r+1;t[g]&&(a.current.value=t[g],i(g))},d=()=>{if(!a.current)return;const g=r-1;g===-1?(a.current.value=s.current,i(g)):t[g]&&(a.current.value=t[g],i(g))},u=()=>{if(!a.current)return;const g=a.current.value.trim();i(-1),a.current.value="",s.current="",g&&(n(g),e.consoleWrite(g))},f=g=>{e.isConnected&&(g.key==="ArrowUp"?(c(),g.preventDefault()):g.key==="ArrowDown"?(d(),g.preventDefault()):g.key==="Enter"&&(u(),g.preventDefault()))};return h.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:[h.jsxs("div",{className:"flex items-center grow",children:[h.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:h.jsx("path",{d:"m9 18 6-6-6-6"})}),h.jsx(ln,{ref:a,className:"w-full",placeholder:"Type a command...",type:"text",disabled:!e.isConnected||!l,onKeyDown:f,autoCapitalize:"none",autoComplete:"off",autoCorrect:"off"})]}),h.jsxs("div",{className:"flex flex-row justify-evenly gap-3 2xl:gap-1 select-none",children:[h.jsx(Im,{icon:NQ,title:"Saved",onClick:e.toggleSaveSheet}),h.jsx(Im,{icon:CJ,title:"Search",disabled:!e.isConnected,onClick:e.toggleSearchBar}),h.jsx(Im,{icon:NJ,title:"Clear",disabled:!e.isConnected,onClick:e.consoleClear}),h.jsx(Im,{icon:eJ,title:"Download",disabled:!e.isConnected,onClick:()=>{Fl("/fxserver/downloadLog")}})]})]})}function toe(){return h.jsx("div",{className:"flex flex-col flex-shrink px-1 sm:px-4 py-2 space-y-4 border-b",children:h.jsxs("div",{className:"flex items-center space-x-2",children:[h.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:[h.jsx("polyline",{points:"4 17 10 11 4 5"}),h.jsx("line",{x1:"12",x2:"20",y1:"19",y2:"19"})]}),h.jsx("p",{className:"font-mono text-sm",children:"Live Console"})]})})}function uc({title:e,onClick:t,isActive:n,children:r}){return h.jsx("button",{title:e,className:ie("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 Lx="No results",noe={activeMatchBackground:"#FF00DC",activeMatchColorOverviewRuler:"#FF00DC",matchBackground:"#732268",matchOverviewRuler:"#732268"};function CO({show:e,setShow:t,searchAddon:n}){const[r,i]=C.useState(!1),[s,a]=C.useState(!1),[o,l]=C.useState(!1),c=C.useRef(null),[d,u]=C.useState(Lx),f=S=>{n.clearDecorations(),S&&u(S)},g=S=>({decorations:noe,caseSensitive:r,wholeWord:s,regex:o,...S});C.useEffect(()=>{var S;e?(S=c.current)==null||S.focus():f(Lx)},[e]),C.useEffect(()=>{if(!n)return;const S=n.onDidChangeResults(({resultIndex:w,resultCount:E})=>{u(w===-1?Lx:`${w+1}/${E}`)});return()=>{S.dispose()}},[]);const x=()=>{!c.current||!c.current.value||(console.log("backward search for",c.current.value),n.findPrevious(c.current.value,g()))},_=()=>{!c.current||!c.current.value||(console.log("forward search for",c.current.value),n.findNext(c.current.value,g()))},v=S=>{c.current&&(console.log("search input keydown",S.code),S.code==="Enter"&&(S.shiftKey?x():_(),S.preventDefault()))},p=S=>{c.current&&_()},m=()=>{c.current&&(i(!r),f(),n.findNext(c.current.value,g({caseSensitive:!r})))},y=()=>{c.current&&(a(!s),f(),n.findNext(c.current.value,g({wholeWord:!s})))},b=()=>{c.current&&(l(!o),f(),n.findNext(c.current.value,g({regex:!o})))};return Pi("message",S=>{var w;S.data.type==="liveConsoleSearchHotkey"&&(S.data.action==="previous"?x():S.data.action==="next"?_():S.data.action==="focus"&&((w=c.current)==null||w.focus()))}),e?h.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:[h.jsxs("div",{className:"relative",children:[h.jsx(ln,{ref:c,className:"h-8",placeholder:"Search string",onKeyDown:v,onChange:p,onBlur:()=>{n.clearActiveDecoration()}}),h.jsxs("div",{className:"absolute top-1/2 right-1 transform -translate-y-1/2 flex text-muted-foreground gap-2",children:[h.jsx(uc,{title:"Case Sensitive",isActive:r,onClick:m,children:h.jsx(IQ,{className:"h-5 w-5"})}),h.jsx(uc,{title:"Whole Word",isActive:s,onClick:y,children:h.jsx(IJ,{className:"h-5 w-5"})}),h.jsx(uc,{title:"Regex",isActive:o,onClick:b,children:h.jsx(bJ,{className:"h-4 w-5"})})]})]}),h.jsx("div",{className:"flex grow text-sm text-muted-foreground whitespace-nowrap min-w-[8ch]",children:d}),h.jsxs("div",{className:"flex gap-2 text-muted-foreground",children:[h.jsx(uc,{title:"Previous",onClick:x,children:h.jsx(jQ,{className:"h-5 w-5"})}),h.jsx(uc,{title:"Next",onClick:_,children:h.jsx(LQ,{className:"h-5 w-5"})}),h.jsx(uc,{title:"Close",onClick:()=>{t(!1)},children:h.jsx(bs,{className:"h-5 w-5"})})]})]}):null}function roe({isOpen:e,closeSheet:t}){return h.jsx("div",{className:ie("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 ioe({closeSheet:e}){return h.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:h.jsx(bs,{className:"h-8 w-8"})})}function YM({cmd:e,type:t,onClick:n,onFavAction:r}){const i=s=>{s.stopPropagation(),r()};return h.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:[h.jsx("span",{className:"py-1 line-clamp-4 font-mono group-hover:text-primary",children:e}),h.jsx("div",{className:"min-w-max",children:h.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"?h.jsxs(h.Fragment,{children:[h.jsx(LJ,{className:"size-5"}),h.jsx("span",{className:"sr-only",children:"Save"})]}):h.jsxs(h.Fragment,{children:[h.jsx(DJ,{className:"size-5"}),h.jsx("span",{className:"sr-only",children:"Remove"})]})})})]})}function soe({toTermInput:e}){const{history:t,wipeHistory:n}=SO(),{bookmarks:r,addBookmark:i,removeBookmark:s}=Zse(),a=p1(),o=()=>{sn.success("History cleared"),n()},l=()=>{a({title:"Save Command",message:"Enter the command to save:",submitLabel:"Save",onSubmit:c=>{c&&i(c)}})};return h.jsxs("div",{className:"flex flex-row gap-4 max-h-full",children:[h.jsxs("div",{className:"flex flex-col flex-grow gap-2 w-1/2",children:[h.jsx("h2",{className:"text-xl font-bold",children:"History"}),h.jsxs(Ni,{className:"max-h-full w-full pr-3 text-sm text-muted-foreground",style:{wordBreak:"break-word"},children:[h.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:h.jsxs("div",{className:"flex items-center justify-center gap-2",children:[h.jsx(bs,{className:"w-4 h-4 inline"}),"Clear History"]})}),h.jsx("div",{className:"space-y-2 line-clamp-1 text-sm font-mono tracking-wide  pb-4",children:t.map((c,d)=>h.jsx(YM,{cmd:c,type:"history",onClick:()=>e(c),onFavAction:()=>i(c)},d))}),t.length===0&&h.jsx("div",{className:"w-full h-auto text-center italic tracking-wider",children:"The command history is empty."})]})]}),h.jsxs("div",{className:"flex flex-col flex-grow gap-2 w-1/2",children:[h.jsx("h2",{className:"text-xl font-bold",children:"Saved"}),h.jsxs(Ni,{className:"max-h-full w-full pr-3 text-sm text-muted-foreground",style:{wordBreak:"break-word"},children:[h.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:h.jsxs("div",{className:"flex items-center justify-center gap-2",children:[h.jsx(fP,{className:"w-4 h-4 inline"}),"Add New"]})}),h.jsx("div",{className:"space-y-2 line-clamp-1 text-sm font-mono tracking-wide  pb-4",children:r.map((c,d)=>h.jsx(YM,{cmd:c,type:"saved",onClick:()=>e(c),onFavAction:()=>s(c)},d))}),r.length===0&&h.jsxs("div",{className:"w-full h-auto text-center italic tracking-wider",children:["There are no saved commands. ",h.jsx("br",{}),"To save a command, click the star icon next to it."]})]})]})]})}function ooe({isOpen:e,closeSheet:t,toTermInput:n}){return h.jsxs(h.Fragment,{children:[h.jsx(roe,{isOpen:e,closeSheet:t}),h.jsxs("div",{"data-state":e?"open":"closed",className:ie("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:[h.jsx(ioe,{closeSheet:t}),h.jsx(soe,{toTermInput:n})]})]})}class kO{constructor(t,n){oc(this,"btnRef");oc(this,"containerElement");oc(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 aoe={background:"#222326",foreground:"#F8F8F8",black:"#000000",brightBlack:"#555555",red:"#D62341",brightRed:"#FF5370",green:"#9ECE58",brightGreen:"#C3E88D",yellow:"#FAED70",brightYellow:"#FFCB6B",blue:"#396FE2",brightBlue:"#82AAFF",magenta:"#BB80B3",brightMagenta:"#C792EA",cyan:"#2DDAFD",brightCyan:"#89DDFF",white:"#D0D0D0",brightWhite:"#FFFFFF"},EO={theme:aoe,convertEol:!0,cursorBlink:!0,cursorStyle:"bar",disableStdin:!0,drawBoldTextInBrightColors:!1,fontFamily:"JetBrains Mono Variable, monospace",fontSize:14,lineHeight:1.1,fontWeight:"300",fontWeightBold:"600",letterSpacing:.8,scrollback:5e3,allowProposedApi:!0,allowTransparency:!0,overviewRulerWidth:15},sh=150,loe=/[\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC]{3,}/,coe=/[\x00-\x08\x0B-\x1A\x1C-\x1F\x7F]|(?:\x1B\[|\x9B)[\d;]+[@-K]/g,uoe=/\x1B[^m]*?m/g,doe=e=>e.replace(coe,"").replace(uoe,""),hoe=/^{§[0-9a-f]{8}}/,foe="\x1B[0;37m",poe="\x1B[1;90m",moe="\x1B[0m";let TO=!1,C2;try{const e=localStorage.getItem("liveConsoleTimestamp");e==="24h"?C2=!1:e==="12h"?C2=!0:e==="off"&&(TO=!0)}catch{}const MO=e=>TO?"":new Date(e*1e3).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:C2??window.txBrowserHour12})+moe+" ",KM=MO(Date.now()).replace(/\w/g,"-");function goe(){const[e,t]=C.useState(!1),[n,r]=C.useState(!1),[i,s]=C.useState(!1),a=C.useRef(null),o=C.useRef({ts:0,lastEol:!0,prefix:KM}),l=j1(),c=C.useRef(null),d=C.useRef(null),u=C.useMemo(()=>new fO.Terminal(EO),[]),f=C.useMemo(()=>new yO.FitAddon,[]),g=C.useMemo(()=>new xO.SearchAddon,[]),x=(M,L)=>{Fl(L)},_=C.useMemo(()=>new wO.WebLinksAddon(x),[]),v=Gn(sh,M=>{window.postMessage({type:"liveConsoleSearchHotkey",action:M})},{noTrailing:!0}),p=()=>{if(!d.current||!u.element||!f){console.log("refitTerminal: no containerRef.current or term.element or fitAddon");return}const M=f.proposeDimensions();M?u.resize(M.cols,M.rows):console.log("refitTerminal: no proposed dimensions")};Pi("resize",N5(100,p)),C.useEffect(()=>{if(d.current&&c.current&&!u.element){console.log("live console xterm init"),d.current.innerHTML="",u.loadAddon(f),u.loadAddon(g),u.loadAddon(_),u.loadAddon(new gO.CanvasAddon),u.loadAddon(new kO(c.current,d.current)),u.open(d.current),u.write("\x1B[?25l"),p();const M=Gn(sh,()=>{u.scrollLines(Math.min(1,2-u.rows))},{noTrailing:!0}),L=Gn(sh,()=>{u.scrollLines(Math.max(1,u.rows-2))},{noTrailing:!0}),j=Gn(sh,()=>{u.scrollToTop()},{noTrailing:!0}),P=Gn(sh,()=>{u.scrollToBottom()},{noTrailing:!0});u.attachCustomKeyEventHandler($=>$.code==="F5"||$.code==="Escape"||$.code==="KeyF"&&($.ctrlKey||$.metaKey)||$.code==="F3"?!1:$.code==="KeyC"&&($.ctrlKey||$.metaKey)?(document.execCommand("copy"),u.clearSelection(),!1):$.code==="PageUp"?(M(),!1):$.code==="PageDown"?(L(),!1):$.code==="Home"?(j(),!1):$.code==="End"?(P(),!1):!ek($))}},[u]),Pi("keydown",M=>{M.code==="F5"?n&&(l(),M.preventDefault()):M.code==="Escape"?(g.clearDecorations(),s(!1)):M.code==="KeyF"&&(M.ctrlKey||M.metaKey)?(i?v("focus"):s(!0),M.preventDefault()):M.code==="F3"&&(v(M.shiftKey?"previous":"next"),M.preventDefault())});const m=M=>{const L=u.registerMarker(0),j=u.registerDecoration({marker:L});j&&j.onRender(P=>{P.classList.add("cursor-pointer"),P.innerText="🔠",P.onclick=()=>{sn.info({title:"Bidirectional Text Detected:",msg:M})}})},y=M=>{const L=M.split(/\r?\n/);let j=!1;L.length&&!L[L.length-1]&&(L.pop(),j=!0);let P=!1;for(let $=0;$<L.length;$++){P=!1;let F=L[$];if(hoe.test(F)){P=!0;try{const A=parseInt(F.slice(2,10),16);F=F.slice(11),o.current.ts=A,o.current.prefix=MO(A)}catch(A){o.current.prefix=KM,console.warn("Failed to parse timestamp from:",F,A.message)}}loe.test(F)&&m(doe(F));const W=P?foe:poe,I=o.current.lastEol?W+o.current.prefix:"";$<L.length-1||j?(u.writeln(I+F),o.current.lastEol=!0):(u.write(I+F),o.current.lastEol=!1)}},b=C.useRef(0),S=C.useRef(null);C.useEffect(()=>(S.current=q5(["liveconsole"]),S.current.on("connect",()=>{console.log("LiveConsole Socket.IO Connected."),r(!0)}),S.current.on("disconnect",M=>{console.log("LiveConsole Socket.IO Disonnected:",M);const L=b.current+1;b.current=L,setTimeout(()=>{b.current===L&&r(!1)},500)}),S.current.on("error",M=>{console.log("LiveConsole Socket.IO",M)}),S.current.on("consoleData",function(M){y(M)}),()=>{var M,L;(M=S.current)==null||M.removeAllListeners(),(L=S.current)==null||L.disconnect()}),[]);const w=M=>{!n||!S.current||S.current.emit("consoleCommand",M)},E=()=>{u.clear()},k=()=>{s(!i)},T=()=>{t(!e)},R=M=>{a.current&&(a.current.value=M,a.current.focus()),t(!1)};return h.jsxs("div",{className:"dark text-primary flex flex-col h-full w-full bg-card border md:rounded-xl overflow-clip",children:[h.jsx(toe,{}),h.jsxs("div",{className:"flex flex-col relative grow overflow-hidden",children:[n?null:h.jsx("div",{className:"absolute inset-0 z-20 bg-black/60 flex items-center justify-center",children:h.jsxs("div",{className:"flex flex-col gap-6 items-center justify-center text-muted-foreground select-none",children:[h.jsx(cn,{className:"w-16 h-16 animate-spin"}),h.jsx("h2",{className:"text-3xl tracking-wider font-light animate-pulse",children:"   Connecting..."})]})}),h.jsx(ooe,{isOpen:e,closeSheet:()=>t(!1),toTermInput:M=>R(M)}),h.jsx("div",{ref:d,className:"absolute top-1 left-2 right-0 bottom-0"}),h.jsx(CO,{show:i,setShow:s,searchAddon:g}),h.jsx("button",{ref:c,className:"absolute bottom-0 right-2 z-10 hidden opacity-75",onClick:()=>{u.scrollToBottom()},children:h.jsx(uP,{className:"w-20 h-20 animate-pulse hover:animate-none hover:scale-110"})})]}),h.jsx(eoe,{termInputRef:a,isConnected:n,consoleWrite:w,consoleClear:E,toggleSaveSheet:T,toggleSearchBar:k})]})}const voe=e=>1- --e*e*e*e,GM=1e3/60,$m=({countTo:e,duration:t=1250})=>{const[n,r]=C.useState(0);return C.useEffect(()=>{let i=0;const s=Math.round(t/GM),a=setInterval(()=>{i++;const o=voe(i/s);r(e*o),i===s&&clearInterval(a)},GM)},[]),Math.floor(n).toLocaleString("en-US")};function Fm(){return h.jsx("div",{className:"h-7 w-28 animate-pulse rounded-md bg-muted"})}function RO({callouts:e}){return e.length!==4?null:h.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:[h.jsxs("div",{className:"py-2 px-4 rounded-lg border shadow-sm",children:[h.jsxs("div",{className:"flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[h.jsx("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:e[0].label}),h.jsx("div",{className:"hidden xs:block",children:e[0].icon})]}),e[0].value===!1?h.jsx(Fm,{}):h.jsxs("div",{className:"text-xl xs:text-2xl font-bold",children:[e[0].prefix,h.jsx($m,{countTo:e[0].value})]})]}),h.jsxs("div",{className:"py-2 px-4 rounded-lg border shadow-sm",children:[h.jsxs("div",{className:"flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[h.jsx("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:e[1].label}),h.jsx("div",{className:"hidden xs:block",children:e[1].icon})]}),e[1].value===!1?h.jsx(Fm,{}):h.jsxs("div",{className:"text-xl xs:text-2xl font-bold",children:[e[1].prefix,h.jsx($m,{countTo:e[1].value})]})]}),h.jsxs("div",{className:"py-2 px-4 rounded-lg border shadow-sm",children:[h.jsxs("div",{className:"flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[h.jsx("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:e[2].label}),h.jsx("div",{className:"hidden xs:block",children:e[2].icon})]}),e[2].value===!1?h.jsx(Fm,{}):h.jsxs("div",{className:"text-xl xs:text-2xl font-bold",children:[e[2].prefix,h.jsx($m,{countTo:e[2].value})]})]}),h.jsxs("div",{className:"py-2 px-4 rounded-lg border shadow-sm",children:[h.jsxs("div",{className:"flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[h.jsx("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:e[3].label}),h.jsx("div",{className:"hidden xs:block",children:e[3].icon})]}),e[3].value===!1?h.jsx(Fm,{}):h.jsxs("div",{className:"text-xl xs:text-2xl font-bold",children:[e[3].prefix,h.jsx($m,{countTo:e[3].value})]})]})]})}function gs({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=yoe({defaultProp:t,onChange:n}),s=e!==void 0,a=s?e:r,o=Mt(n),l=C.useCallback(c=>{if(s){const u=typeof c=="function"?c(e):c;u!==e&&o(u)}else i(c)},[s,e,i,o]);return[a,l]}function yoe({defaultProp:e,onChange:t}){const n=C.useState(e),[r]=n,i=C.useRef(r),s=Mt(t);return C.useEffect(()=>{i.current!==r&&(s(r),i.current=r)},[r,i,s]),n}function _oe(e,t=[]){let n=[];function r(s,a){const o=C.createContext(a),l=n.length;n=[...n,a];function c(u){const{scope:f,children:g,...x}=u,_=(f==null?void 0:f[e][l])||o,v=C.useMemo(()=>x,Object.values(x));return h.jsx(_.Provider,{value:v,children:g})}function d(u,f){const g=(f==null?void 0:f[e][l])||o,x=C.useContext(g);if(x)return x;if(a!==void 0)return a;throw new Error(`\`${u}\` must be used within \`${s}\``)}return c.displayName=s+"Provider",[c,d]}const i=()=>{const s=n.map(a=>C.createContext(a));return function(o){const l=(o==null?void 0:o[e])||s;return C.useMemo(()=>({[`__scope${e}`]:{...o,[e]:l}}),[o,l])}};return i.scopeName=e,[r,xoe(i,...t)]}function xoe(...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:c})=>{const u=l(s)[`__scope${c}`];return{...o,...u}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function jp(e){const t=e+"CollectionProvider",[n,r]=_oe(t),[i,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=g=>{const{scope:x,children:_}=g,v=rt.useRef(null),p=rt.useRef(new Map).current;return h.jsx(i,{scope:x,itemMap:p,collectionRef:v,children:_})};a.displayName=t;const o=e+"CollectionSlot",l=rt.forwardRef((g,x)=>{const{scope:_,children:v}=g,p=s(o,_),m=We(x,p.collectionRef);return h.jsx(ua,{ref:m,children:v})});l.displayName=o;const c=e+"CollectionItemSlot",d="data-radix-collection-item",u=rt.forwardRef((g,x)=>{const{scope:_,children:v,...p}=g,m=rt.useRef(null),y=We(x,m),b=s(c,_);return rt.useEffect(()=>(b.itemMap.set(m,{ref:m,...p}),()=>void b.itemMap.delete(m))),h.jsx(ua,{[d]:"",ref:y,children:v})});u.displayName=c;function f(g){const x=s(e+"CollectionConsumer",g);return rt.useCallback(()=>{const v=x.collectionRef.current;if(!v)return[];const p=Array.from(v.querySelectorAll(`[${d}]`));return Array.from(x.itemMap.values()).sort((b,S)=>p.indexOf(b.ref.current)-p.indexOf(S.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:a,Slot:l,ItemSlot:u},f,r]}function boe(e,t=globalThis==null?void 0:globalThis.document){const n=Mt(e);C.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 woe="DismissableLayer",k2="dismissableLayer.update",Soe="dismissableLayer.pointerDownOutside",Coe="dismissableLayer.focusOutside",XM,AO=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),yd=C.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:o,...l}=e,c=C.useContext(AO),[d,u]=C.useState(null),f=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=C.useState({}),x=We(t,E=>u(E)),_=Array.from(c.layers),[v]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),p=_.indexOf(v),m=d?_.indexOf(d):-1,y=c.layersWithOutsidePointerEventsDisabled.size>0,b=m>=p,S=Toe(E=>{const k=E.target,T=[...c.branches].some(R=>R.contains(k));!b||T||(i==null||i(E),a==null||a(E),E.defaultPrevented||o==null||o())},f),w=Moe(E=>{const k=E.target;[...c.branches].some(R=>R.contains(k))||(s==null||s(E),a==null||a(E),E.defaultPrevented||o==null||o())},f);return boe(E=>{m===c.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&o&&(E.preventDefault(),o()))},f),C.useEffect(()=>{if(d)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(XM=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),QM(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=XM)}},[d,f,n,c]),C.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),QM())},[d,c]),C.useEffect(()=>{const E=()=>g({});return document.addEventListener(k2,E),()=>document.removeEventListener(k2,E)},[]),h.jsx(Me.div,{...l,ref:x,style:{pointerEvents:y?b?"auto":"none":void 0,...e.style},onFocusCapture:me(e.onFocusCapture,w.onFocusCapture),onBlurCapture:me(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:me(e.onPointerDownCapture,S.onPointerDownCapture)})});yd.displayName=woe;var koe="DismissableLayerBranch",Eoe=C.forwardRef((e,t)=>{const n=C.useContext(AO),r=C.useRef(null),i=We(t,r);return C.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),h.jsx(Me.div,{...e,ref:i})});Eoe.displayName=koe;function Toe(e,t=globalThis==null?void 0:globalThis.document){const n=Mt(e),r=C.useRef(!1),i=C.useRef(()=>{});return C.useEffect(()=>{const s=o=>{if(o.target&&!r.current){let l=function(){DO(Soe,n,c,{discrete:!0})};const c={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 Moe(e,t=globalThis==null?void 0:globalThis.document){const n=Mt(e),r=C.useRef(!1);return C.useEffect(()=>{const i=s=>{s.target&&!r.current&&DO(Coe,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 QM(){const e=new CustomEvent(k2);document.dispatchEvent(e)}function DO(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?w0(i,s):i.dispatchEvent(s)}var jx=0;function tk(){C.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??JM()),document.body.insertAdjacentElement("beforeend",e[1]??JM()),jx++,()=>{jx===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),jx--}},[])}function JM(){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 Px="focusScope.autoFocusOnMount",Nx="focusScope.autoFocusOnUnmount",ZM={bubbles:!1,cancelable:!0},Roe="FocusScope",P1=C.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...a}=e,[o,l]=C.useState(null),c=Mt(i),d=Mt(s),u=C.useRef(null),f=We(t,_=>l(_)),g=C.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.useEffect(()=>{if(r){let _=function(y){if(g.paused||!o)return;const b=y.target;o.contains(b)?u.current=b:bo(u.current,{select:!0})},v=function(y){if(g.paused||!o)return;const b=y.relatedTarget;b!==null&&(o.contains(b)||bo(u.current,{select:!0}))},p=function(y){if(document.activeElement===document.body)for(const S of y)S.removedNodes.length>0&&bo(o)};document.addEventListener("focusin",_),document.addEventListener("focusout",v);const m=new MutationObserver(p);return o&&m.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",_),document.removeEventListener("focusout",v),m.disconnect()}}},[r,o,g.paused]),C.useEffect(()=>{if(o){tR.add(g);const _=document.activeElement;if(!o.contains(_)){const p=new CustomEvent(Px,ZM);o.addEventListener(Px,c),o.dispatchEvent(p),p.defaultPrevented||(Aoe(Noe(LO(o)),{select:!0}),document.activeElement===_&&bo(o))}return()=>{o.removeEventListener(Px,c),setTimeout(()=>{const p=new CustomEvent(Nx,ZM);o.addEventListener(Nx,d),o.dispatchEvent(p),p.defaultPrevented||bo(_??document.body,{select:!0}),o.removeEventListener(Nx,d),tR.remove(g)},0)}}},[o,c,d,g]);const x=C.useCallback(_=>{if(!n&&!r||g.paused)return;const v=_.key==="Tab"&&!_.altKey&&!_.ctrlKey&&!_.metaKey,p=document.activeElement;if(v&&p){const m=_.currentTarget,[y,b]=Doe(m);y&&b?!_.shiftKey&&p===b?(_.preventDefault(),n&&bo(y,{select:!0})):_.shiftKey&&p===y&&(_.preventDefault(),n&&bo(b,{select:!0})):p===m&&_.preventDefault()}},[n,r,g.paused]);return h.jsx(Me.div,{tabIndex:-1,...a,ref:f,onKeyDown:x})});P1.displayName=Roe;function Aoe(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(bo(r,{select:t}),document.activeElement!==n)return}function Doe(e){const t=LO(e),n=eR(t,e),r=eR(t.reverse(),e);return[n,r]}function LO(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 eR(e,t){for(const n of e)if(!Loe(n,{upTo:t}))return n}function Loe(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 joe(e){return e instanceof HTMLInputElement&&"select"in e}function bo(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&joe(e)&&t&&e.select()}}var tR=Poe();function Poe(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=nR(e,t),e.unshift(t)},remove(t){var n;e=nR(e,t),(n=e[0])==null||n.resume()}}}function nR(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Noe(e){return e.filter(t=>t.tagName!=="A")}var Ooe=a7.useId||(()=>{}),Ioe=0;function Ir(e){const[t,n]=C.useState(Ooe());return un(()=>{n(r=>r??String(Ioe++))},[e]),t?`radix-${t}`:""}const $oe=["top","right","bottom","left"],ha=Math.min,Lr=Math.max,V0=Math.round,Bm=Math.floor,fa=e=>({x:e,y:e}),Foe={left:"right",right:"left",bottom:"top",top:"bottom"},Boe={start:"end",end:"start"};function E2(e,t,n){return Lr(e,ha(t,n))}function Zs(e,t){return typeof e=="function"?e(t):e}function eo(e){return e.split("-")[0]}function _d(e){return e.split("-")[1]}function nk(e){return e==="x"?"y":"x"}function rk(e){return e==="y"?"height":"width"}function pa(e){return["top","bottom"].includes(eo(e))?"y":"x"}function ik(e){return nk(pa(e))}function zoe(e,t,n){n===void 0&&(n=!1);const r=_d(e),i=ik(e),s=rk(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=q0(a)),[a,q0(a)]}function Uoe(e){const t=q0(e);return[T2(e),t,T2(t)]}function T2(e){return e.replace(/start|end/g,t=>Boe[t])}function Hoe(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 Woe(e,t,n,r){const i=_d(e);let s=Hoe(eo(e),n==="start",r);return i&&(s=s.map(a=>a+"-"+i),t&&(s=s.concat(s.map(T2)))),s}function q0(e){return e.replace(/left|right|bottom|top/g,t=>Foe[t])}function Voe(e){return{top:0,right:0,bottom:0,left:0,...e}}function jO(e){return typeof e!="number"?Voe(e):{top:e,right:e,bottom:e,left:e}}function Y0(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 rR(e,t,n){let{reference:r,floating:i}=e;const s=pa(t),a=ik(t),o=rk(a),l=eo(t),c=s==="y",d=r.x+r.width/2-i.width/2,u=r.y+r.height/2-i.height/2,f=r[o]/2-i[o]/2;let g;switch(l){case"top":g={x:d,y:r.y-i.height};break;case"bottom":g={x:d,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:u};break;case"left":g={x:r.x-i.width,y:u};break;default:g={x:r.x,y:r.y}}switch(_d(t)){case"start":g[a]-=f*(n&&c?-1:1);break;case"end":g[a]+=f*(n&&c?-1:1);break}return g}const qoe=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 c=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:u}=rR(c,r,l),f=r,g={},x=0;for(let _=0;_<o.length;_++){const{name:v,fn:p}=o[_],{x:m,y,data:b,reset:S}=await p({x:d,y:u,initialPlacement:r,placement:f,strategy:i,middlewareData:g,rects:c,platform:a,elements:{reference:e,floating:t}});d=m??d,u=y??u,g={...g,[v]:{...g[v],...b}},S&&x<=50&&(x++,typeof S=="object"&&(S.placement&&(f=S.placement),S.rects&&(c=S.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):S.rects),{x:d,y:u}=rR(c,f,l)),_=-1)}return{x:d,y:u,placement:f,strategy:i,middlewareData:g}};async function Uf(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:a,elements:o,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:f=!1,padding:g=0}=Zs(t,e),x=jO(g),v=o[f?u==="floating"?"reference":"floating":u],p=Y0(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:c,rootBoundary:d,strategy:l})),m=u==="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)),b=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},S=Y0(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:m,offsetParent:y,strategy:l}):m);return{top:(p.top-S.top+x.top)/b.y,bottom:(S.bottom-p.bottom+x.bottom)/b.y,left:(p.left-S.left+x.left)/b.x,right:(S.right-p.right+x.right)/b.x}}const Yoe=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:c,padding:d=0}=Zs(e,t)||{};if(c==null)return{};const u=jO(d),f={x:n,y:r},g=ik(i),x=rk(g),_=await a.getDimensions(c),v=g==="y",p=v?"top":"left",m=v?"bottom":"right",y=v?"clientHeight":"clientWidth",b=s.reference[x]+s.reference[g]-f[g]-s.floating[x],S=f[g]-s.reference[g],w=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let E=w?w[y]:0;(!E||!await(a.isElement==null?void 0:a.isElement(w)))&&(E=o.floating[y]||s.floating[x]);const k=b/2-S/2,T=E/2-_[x]/2-1,R=ha(u[p],T),M=ha(u[m],T),L=R,j=E-_[x]-M,P=E/2-_[x]/2+k,$=E2(L,P,j),F=!l.arrow&&_d(i)!=null&&P!==$&&s.reference[x]/2-(P<L?R:M)-_[x]/2<0,W=F?P<L?P-L:P-j:0;return{[g]:f[g]+W,data:{[g]:$,centerOffset:P-$-W,...F&&{alignmentOffset:W}},reset:F}}}),Koe=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:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:_=!0,...v}=Zs(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const p=eo(i),m=pa(o),y=eo(o)===o,b=await(l.isRTL==null?void 0:l.isRTL(c.floating)),S=f||(y||!_?[q0(o)]:Uoe(o)),w=x!=="none";!f&&w&&S.push(...Woe(o,_,x,b));const E=[o,...S],k=await Uf(t,v),T=[];let R=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&T.push(k[p]),u){const P=zoe(i,a,b);T.push(k[P[0]],k[P[1]])}if(R=[...R,{placement:i,overflows:T}],!T.every(P=>P<=0)){var M,L;const P=(((M=s.flip)==null?void 0:M.index)||0)+1,$=E[P];if($)return{data:{index:P,overflows:R},reset:{placement:$}};let F=(L=R.filter(W=>W.overflows[0]<=0).sort((W,I)=>W.overflows[1]-I.overflows[1])[0])==null?void 0:L.placement;if(!F)switch(g){case"bestFit":{var j;const W=(j=R.filter(I=>{if(w){const A=pa(I.placement);return A===m||A==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(A=>A>0).reduce((A,D)=>A+D,0)]).sort((I,A)=>I[1]-A[1])[0])==null?void 0:j[0];W&&(F=W);break}case"initialPlacement":F=o;break}if(i!==F)return{reset:{placement:F}}}return{}}}};function iR(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function sR(e){return $oe.some(t=>e[t]>=0)}const Goe=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=Zs(e,t);switch(r){case"referenceHidden":{const s=await Uf(t,{...i,elementContext:"reference"}),a=iR(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:sR(a)}}}case"escaped":{const s=await Uf(t,{...i,altBoundary:!0}),a=iR(s,n.floating);return{data:{escapedOffsets:a,escaped:sR(a)}}}default:return{}}}}};async function Xoe(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=eo(n),o=_d(n),l=pa(n)==="y",c=["left","top"].includes(a)?-1:1,d=s&&l?-1:1,u=Zs(t,e);let{mainAxis:f,crossAxis:g,alignmentAxis:x}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return o&&typeof x=="number"&&(g=o==="end"?x*-1:x),l?{x:g*d,y:f*c}:{x:f*c,y:g*d}}const Qoe=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 Xoe(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}}}}},Joe=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:p,y:m}=v;return{x:p,y:m}}},...l}=Zs(e,t),c={x:n,y:r},d=await Uf(t,l),u=pa(eo(i)),f=nk(u);let g=c[f],x=c[u];if(s){const v=f==="y"?"top":"left",p=f==="y"?"bottom":"right",m=g+d[v],y=g-d[p];g=E2(m,g,y)}if(a){const v=u==="y"?"top":"left",p=u==="y"?"bottom":"right",m=x+d[v],y=x-d[p];x=E2(m,x,y)}const _=o.fn({...t,[f]:g,[u]:x});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[f]:s,[u]:a}}}}}},Zoe=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:c=!0}=Zs(e,t),d={x:n,y:r},u=pa(i),f=nk(u);let g=d[f],x=d[u];const _=Zs(o,t),v=typeof _=="number"?{mainAxis:_,crossAxis:0}:{mainAxis:0,crossAxis:0,..._};if(l){const y=f==="y"?"height":"width",b=s.reference[f]-s.floating[y]+v.mainAxis,S=s.reference[f]+s.reference[y]-v.mainAxis;g<b?g=b:g>S&&(g=S)}if(c){var p,m;const y=f==="y"?"width":"height",b=["top","left"].includes(eo(i)),S=s.reference[u]-s.floating[y]+(b&&((p=a.offset)==null?void 0:p[u])||0)+(b?0:v.crossAxis),w=s.reference[u]+s.reference[y]+(b?0:((m=a.offset)==null?void 0:m[u])||0)-(b?v.crossAxis:0);x<S?x=S:x>w&&(x=w)}return{[f]:g,[u]:x}}}},eae=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=()=>{},...c}=Zs(e,t),d=await Uf(t,c),u=eo(i),f=_d(i),g=pa(i)==="y",{width:x,height:_}=s.floating;let v,p;u==="top"||u==="bottom"?(v=u,p=f===(await(a.isRTL==null?void 0:a.isRTL(o.floating))?"start":"end")?"left":"right"):(p=u,v=f==="end"?"top":"bottom");const m=_-d.top-d.bottom,y=x-d.left-d.right,b=ha(_-d[v],m),S=ha(x-d[p],y),w=!t.middlewareData.shift;let E=b,k=S;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(k=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=m),w&&!f){const R=Lr(d.left,0),M=Lr(d.right,0),L=Lr(d.top,0),j=Lr(d.bottom,0);g?k=x-2*(R!==0||M!==0?R+M:Lr(d.left,d.right)):E=_-2*(L!==0||j!==0?L+j:Lr(d.top,d.bottom))}await l({...t,availableWidth:k,availableHeight:E});const T=await a.getDimensions(o.floating);return x!==T.width||_!==T.height?{reset:{rects:!0}}:{}}}};function N1(){return typeof window<"u"}function xd(e){return PO(e)?(e.nodeName||"").toLowerCase():"#document"}function $r(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ss(e){var t;return(t=(PO(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function PO(e){return N1()?e instanceof Node||e instanceof $r(e).Node:!1}function Oi(e){return N1()?e instanceof Element||e instanceof $r(e).Element:!1}function vs(e){return N1()?e instanceof HTMLElement||e instanceof $r(e).HTMLElement:!1}function oR(e){return!N1()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof $r(e).ShadowRoot}function Pp(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Ii(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function tae(e){return["table","td","th"].includes(xd(e))}function O1(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function sk(e){const t=ok(),n=Oi(e)?Ii(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 nae(e){let t=ma(e);for(;vs(t)&&!Lu(t);){if(sk(t))return t;if(O1(t))return null;t=ma(t)}return null}function ok(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Lu(e){return["html","body","#document"].includes(xd(e))}function Ii(e){return $r(e).getComputedStyle(e)}function I1(e){return Oi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ma(e){if(xd(e)==="html")return e;const t=e.assignedSlot||e.parentNode||oR(e)&&e.host||Ss(e);return oR(t)?t.host:t}function NO(e){const t=ma(e);return Lu(t)?e.ownerDocument?e.ownerDocument.body:e.body:vs(t)&&Pp(t)?t:NO(t)}function Hf(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=NO(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),a=$r(i);if(s){const o=M2(a);return t.concat(a,a.visualViewport||[],Pp(i)?i:[],o&&n?Hf(o):[])}return t.concat(i,Hf(i,[],n))}function M2(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function OO(e){const t=Ii(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=vs(e),s=i?e.offsetWidth:n,a=i?e.offsetHeight:r,o=V0(n)!==s||V0(r)!==a;return o&&(n=s,r=a),{width:n,height:r,$:o}}function ak(e){return Oi(e)?e:e.contextElement}function Qc(e){const t=ak(e);if(!vs(t))return fa(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=OO(t);let a=(s?V0(n.width):n.width)/r,o=(s?V0(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!o||!Number.isFinite(o))&&(o=1),{x:a,y:o}}const rae=fa(0);function IO(e){const t=$r(e);return!ok()||!t.visualViewport?rae:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function iae(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==$r(e)?!1:t}function vl(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=ak(e);let a=fa(1);t&&(r?Oi(r)&&(a=Qc(r)):a=Qc(e));const o=iae(s,n,r)?IO(s):fa(0);let l=(i.left+o.x)/a.x,c=(i.top+o.y)/a.y,d=i.width/a.x,u=i.height/a.y;if(s){const f=$r(s),g=r&&Oi(r)?$r(r):r;let x=f,_=M2(x);for(;_&&r&&g!==x;){const v=Qc(_),p=_.getBoundingClientRect(),m=Ii(_),y=p.left+(_.clientLeft+parseFloat(m.paddingLeft))*v.x,b=p.top+(_.clientTop+parseFloat(m.paddingTop))*v.y;l*=v.x,c*=v.y,d*=v.x,u*=v.y,l+=y,c+=b,x=$r(_),_=M2(x)}}return Y0({width:d,height:u,x:l,y:c})}function sae(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",a=Ss(r),o=t?O1(t.floating):!1;if(r===a||o&&s)return n;let l={scrollLeft:0,scrollTop:0},c=fa(1);const d=fa(0),u=vs(r);if((u||!u&&!s)&&((xd(r)!=="body"||Pp(a))&&(l=I1(r)),vs(r))){const f=vl(r);c=Qc(r),d.x=f.x+r.clientLeft,d.y=f.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x,y:n.y*c.y-l.scrollTop*c.y+d.y}}function oae(e){return Array.from(e.getClientRects())}function R2(e,t){const n=I1(e).scrollLeft;return t?t.left+n:vl(Ss(e)).left+n}function aae(e){const t=Ss(e),n=I1(e),r=e.ownerDocument.body,i=Lr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Lr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+R2(e);const o=-n.scrollTop;return Ii(r).direction==="rtl"&&(a+=Lr(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:a,y:o}}function lae(e,t){const n=$r(e),r=Ss(e),i=n.visualViewport;let s=r.clientWidth,a=r.clientHeight,o=0,l=0;if(i){s=i.width,a=i.height;const c=ok();(!c||c&&t==="fixed")&&(o=i.offsetLeft,l=i.offsetTop)}return{width:s,height:a,x:o,y:l}}function cae(e,t){const n=vl(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=vs(e)?Qc(e):fa(1),a=e.clientWidth*s.x,o=e.clientHeight*s.y,l=i*s.x,c=r*s.y;return{width:a,height:o,x:l,y:c}}function aR(e,t,n){let r;if(t==="viewport")r=lae(e,n);else if(t==="document")r=aae(Ss(e));else if(Oi(t))r=cae(t,n);else{const i=IO(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return Y0(r)}function $O(e,t){const n=ma(e);return n===t||!Oi(n)||Lu(n)?!1:Ii(n).position==="fixed"||$O(n,t)}function uae(e,t){const n=t.get(e);if(n)return n;let r=Hf(e,[],!1).filter(o=>Oi(o)&&xd(o)!=="body"),i=null;const s=Ii(e).position==="fixed";let a=s?ma(e):e;for(;Oi(a)&&!Lu(a);){const o=Ii(a),l=sk(a);!l&&o.position==="fixed"&&(i=null),(s?!l&&!i:!l&&o.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Pp(a)&&!l&&$O(e,a))?r=r.filter(d=>d!==a):i=o,a=ma(a)}return t.set(e,r),r}function dae(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?O1(t)?[]:uae(t,this._c):[].concat(n),r],o=a[0],l=a.reduce((c,d)=>{const u=aR(t,d,i);return c.top=Lr(u.top,c.top),c.right=ha(u.right,c.right),c.bottom=ha(u.bottom,c.bottom),c.left=Lr(u.left,c.left),c},aR(t,o,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function hae(e){const{width:t,height:n}=OO(e);return{width:t,height:n}}function fae(e,t,n){const r=vs(t),i=Ss(t),s=n==="fixed",a=vl(e,!0,s,t);let o={scrollLeft:0,scrollTop:0};const l=fa(0);if(r||!r&&!s)if((xd(t)!=="body"||Pp(i))&&(o=I1(t)),r){const g=vl(t,!0,s,t);l.x=g.x+t.clientLeft,l.y=g.y+t.clientTop}else i&&(l.x=R2(i));let c=0,d=0;if(i&&!r&&!s){const g=i.getBoundingClientRect();d=g.top+o.scrollTop,c=g.left+o.scrollLeft-R2(i,g)}const u=a.left+o.scrollLeft-l.x-c,f=a.top+o.scrollTop-l.y-d;return{x:u,y:f,width:a.width,height:a.height}}function Ox(e){return Ii(e).position==="static"}function lR(e,t){if(!vs(e)||Ii(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ss(e)===n&&(n=n.ownerDocument.body),n}function FO(e,t){const n=$r(e);if(O1(e))return n;if(!vs(e)){let i=ma(e);for(;i&&!Lu(i);){if(Oi(i)&&!Ox(i))return i;i=ma(i)}return n}let r=lR(e,t);for(;r&&tae(r)&&Ox(r);)r=lR(r,t);return r&&Lu(r)&&Ox(r)&&!sk(r)?n:r||nae(e)||n}const pae=async function(e){const t=this.getOffsetParent||FO,n=this.getDimensions,r=await n(e.floating);return{reference:fae(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function mae(e){return Ii(e).direction==="rtl"}const gae={convertOffsetParentRelativeRectToViewportRelativeRect:sae,getDocumentElement:Ss,getClippingRect:dae,getOffsetParent:FO,getElementRects:pae,getClientRects:oae,getDimensions:hae,getScale:Qc,isElement:Oi,isRTL:mae};function vae(e,t){let n=null,r;const i=Ss(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:c,top:d,width:u,height:f}=e.getBoundingClientRect();if(o||t(),!u||!f)return;const g=Bm(d),x=Bm(i.clientWidth-(c+u)),_=Bm(i.clientHeight-(d+f)),v=Bm(c),m={rootMargin:-g+"px "+-x+"px "+-_+"px "+-v+"px",threshold:Lr(0,ha(1,l))||1};let y=!0;function b(S){const w=S[0].intersectionRatio;if(w!==l){if(!y)return a();w?a(!1,w):r=setTimeout(()=>{a(!1,1e-7)},1e3)}y=!1}try{n=new IntersectionObserver(b,{...m,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,m)}n.observe(e)}return a(!0),s}function yae(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,c=ak(e),d=i||s?[...c?Hf(c):[],...Hf(t)]:[];d.forEach(p=>{i&&p.addEventListener("scroll",n,{passive:!0}),s&&p.addEventListener("resize",n)});const u=c&&o?vae(c,n):null;let f=-1,g=null;a&&(g=new ResizeObserver(p=>{let[m]=p;m&&m.target===c&&g&&(g.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var y;(y=g)==null||y.observe(t)})),n()}),c&&!l&&g.observe(c),g.observe(t));let x,_=l?vl(e):null;l&&v();function v(){const p=vl(e);_&&(p.x!==_.x||p.y!==_.y||p.width!==_.width||p.height!==_.height)&&n(),_=p,x=requestAnimationFrame(v)}return n(),()=>{var p;d.forEach(m=>{i&&m.removeEventListener("scroll",n),s&&m.removeEventListener("resize",n)}),u==null||u(),(p=g)==null||p.disconnect(),g=null,l&&cancelAnimationFrame(x)}}const _ae=Qoe,xae=Joe,bae=Koe,wae=eae,Sae=Goe,cR=Yoe,Cae=Zoe,kae=(e,t,n)=>{const r=new Map,i={platform:gae,...n},s={...i.platform,_c:r};return qoe(e,t,{...i,platform:s})};var Ng=typeof document<"u"?C.useLayoutEffect:C.useEffect;function K0(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(!K0(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)&&!K0(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function BO(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function uR(e,t){const n=BO(e);return Math.round(t*n)/n}function Ix(e){const t=C.useRef(e);return Ng(()=>{t.current=e}),t}function Eae(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:c}=e,[d,u]=C.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,g]=C.useState(r);K0(f,r)||g(r);const[x,_]=C.useState(null),[v,p]=C.useState(null),m=C.useCallback(I=>{I!==w.current&&(w.current=I,_(I))},[]),y=C.useCallback(I=>{I!==E.current&&(E.current=I,p(I))},[]),b=s||x,S=a||v,w=C.useRef(null),E=C.useRef(null),k=C.useRef(d),T=l!=null,R=Ix(l),M=Ix(i),L=Ix(c),j=C.useCallback(()=>{if(!w.current||!E.current)return;const I={placement:t,strategy:n,middleware:f};M.current&&(I.platform=M.current),kae(w.current,E.current,I).then(A=>{const D={...A,isPositioned:L.current!==!1};P.current&&!K0(k.current,D)&&(k.current=D,vr.flushSync(()=>{u(D)}))})},[f,t,n,M,L]);Ng(()=>{c===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,u(I=>({...I,isPositioned:!1})))},[c]);const P=C.useRef(!1);Ng(()=>(P.current=!0,()=>{P.current=!1}),[]),Ng(()=>{if(b&&(w.current=b),S&&(E.current=S),b&&S){if(R.current)return R.current(b,S,j);j()}},[b,S,j,R,T]);const $=C.useMemo(()=>({reference:w,floating:E,setReference:m,setFloating:y}),[m,y]),F=C.useMemo(()=>({reference:b,floating:S}),[b,S]),W=C.useMemo(()=>{const I={position:n,left:0,top:0};if(!F.floating)return I;const A=uR(F.floating,d.x),D=uR(F.floating,d.y);return o?{...I,transform:"translate("+A+"px, "+D+"px)",...BO(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:A,top:D}},[n,o,F.floating,d.x,d.y]);return C.useMemo(()=>({...d,update:j,refs:$,elements:F,floatingStyles:W}),[d,j,$,F,W])}const Tae=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?cR({element:r.current,padding:i}).fn(n):{}:r?cR({element:r,padding:i}).fn(n):{}}}},Mae=(e,t)=>({..._ae(e),options:[e,t]}),Rae=(e,t)=>({...xae(e),options:[e,t]}),Aae=(e,t)=>({...Cae(e),options:[e,t]}),Dae=(e,t)=>({...bae(e),options:[e,t]}),Lae=(e,t)=>({...wae(e),options:[e,t]}),jae=(e,t)=>({...Sae(e),options:[e,t]}),Pae=(e,t)=>({...Tae(e),options:[e,t]});var Nae="Arrow",zO=C.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...s}=e;return h.jsx(Me.svg,{...s,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});zO.displayName=Nae;var Oae=zO;function Iae(e,t=[]){let n=[];function r(s,a){const o=C.createContext(a),l=n.length;n=[...n,a];function c(u){const{scope:f,children:g,...x}=u,_=(f==null?void 0:f[e][l])||o,v=C.useMemo(()=>x,Object.values(x));return h.jsx(_.Provider,{value:v,children:g})}function d(u,f){const g=(f==null?void 0:f[e][l])||o,x=C.useContext(g);if(x)return x;if(a!==void 0)return a;throw new Error(`\`${u}\` must be used within \`${s}\``)}return c.displayName=s+"Provider",[c,d]}const i=()=>{const s=n.map(a=>C.createContext(a));return function(o){const l=(o==null?void 0:o[e])||s;return C.useMemo(()=>({[`__scope${e}`]:{...o,[e]:l}}),[o,l])}};return i.scopeName=e,[r,$ae(i,...t)]}function $ae(...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:c})=>{const u=l(s)[`__scope${c}`];return{...o,...u}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function UO(e){const[t,n]=C.useState(void 0);return un(()=>{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,c=Array.isArray(l)?l[0]:l;a=c.inlineSize,o=c.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 lk="Popper",[HO,bd]=Iae(lk),[Fae,WO]=HO(lk),VO=e=>{const{__scopePopper:t,children:n}=e,[r,i]=C.useState(null);return h.jsx(Fae,{scope:t,anchor:r,onAnchorChange:i,children:n})};VO.displayName=lk;var qO="PopperAnchor",YO=C.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,s=WO(qO,n),a=C.useRef(null),o=We(t,a);return C.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:h.jsx(Me.div,{...i,ref:o})});YO.displayName=qO;var ck="PopperContent",[Bae,zae]=HO(ck),KO=C.forwardRef((e,t)=>{var q,B,O,z,Y,N;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:a=0,arrowPadding:o=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:u="partial",hideWhenDetached:f=!1,updatePositionStrategy:g="optimized",onPlaced:x,..._}=e,v=WO(ck,n),[p,m]=C.useState(null),y=We(t,J=>m(J)),[b,S]=C.useState(null),w=UO(b),E=(w==null?void 0:w.width)??0,k=(w==null?void 0:w.height)??0,T=r+(s!=="center"?"-"+s:""),R=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},M=Array.isArray(c)?c:[c],L=M.length>0,j={padding:R,boundary:M.filter(Hae),altBoundary:L},{refs:P,floatingStyles:$,placement:F,isPositioned:W,middlewareData:I}=Eae({strategy:"fixed",placement:T,whileElementsMounted:(...J)=>yae(...J,{animationFrame:g==="always"}),elements:{reference:v.anchor},middleware:[Mae({mainAxis:i+k,alignmentAxis:a}),l&&Rae({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?Aae():void 0,...j}),l&&Dae({...j}),Lae({...j,apply:({elements:J,rects:K,availableWidth:te,availableHeight:oe})=>{const{width:ae,height:_e}=K.reference,Se=J.floating.style;Se.setProperty("--radix-popper-available-width",`${te}px`),Se.setProperty("--radix-popper-available-height",`${oe}px`),Se.setProperty("--radix-popper-anchor-width",`${ae}px`),Se.setProperty("--radix-popper-anchor-height",`${_e}px`)}}),b&&Pae({element:b,padding:o}),Wae({arrowWidth:E,arrowHeight:k}),f&&jae({strategy:"referenceHidden",...j})]}),[A,D]=QO(F),H=Mt(x);un(()=>{W&&(H==null||H())},[W,H]);const V=(q=I.arrow)==null?void 0:q.x,U=(B=I.arrow)==null?void 0:B.y,G=((O=I.arrow)==null?void 0:O.centerOffset)!==0,[ee,Z]=C.useState();return un(()=>{p&&Z(window.getComputedStyle(p).zIndex)},[p]),h.jsx("div",{ref:P.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:W?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ee,"--radix-popper-transform-origin":[(z=I.transformOrigin)==null?void 0:z.x,(Y=I.transformOrigin)==null?void 0:Y.y].join(" "),...((N=I.hide)==null?void 0:N.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:h.jsx(Bae,{scope:n,placedSide:A,onArrowChange:S,arrowX:V,arrowY:U,shouldHideArrow:G,children:h.jsx(Me.div,{"data-side":A,"data-align":D,..._,ref:y,style:{..._.style,animation:W?void 0:"none"}})})})});KO.displayName=ck;var GO="PopperArrow",Uae={top:"bottom",right:"left",bottom:"top",left:"right"},XO=C.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,s=zae(GO,r),a=Uae[s.placedSide];return h.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:h.jsx(Oae,{...i,ref:n,style:{...i.style,display:"block"}})})});XO.displayName=GO;function Hae(e){return e!==null}var Wae=e=>({name:"transformOrigin",options:e,fn(t){var v,p,m;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,[c,d]=QO(n),u={start:"0%",center:"50%",end:"100%"}[d],f=(((p=i.arrow)==null?void 0:p.x)??0)+o/2,g=(((m=i.arrow)==null?void 0:m.y)??0)+l/2;let x="",_="";return c==="bottom"?(x=a?u:`${f}px`,_=`${-l}px`):c==="top"?(x=a?u:`${f}px`,_=`${r.floating.height+l}px`):c==="right"?(x=`${-l}px`,_=a?u:`${g}px`):c==="left"&&(x=`${r.floating.width+l}px`,_=a?u:`${g}px`),{data:{x,y:_}}}});function QO(e){const[t,n="center"]=e.split("-");return[t,n]}var uk=VO,dk=YO,hk=KO,fk=XO,Vae="Portal",$1=C.forwardRef((e,t)=>{var o;const{container:n,...r}=e,[i,s]=C.useState(!1);un(()=>s(!0),[]);const a=n||i&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return a?dj.createPortal(h.jsx(Me.div,{...r,ref:t}),a):null});$1.displayName=Vae;function qae(e,t=[]){let n=[];function r(s,a){const o=C.createContext(a),l=n.length;n=[...n,a];function c(u){const{scope:f,children:g,...x}=u,_=(f==null?void 0:f[e][l])||o,v=C.useMemo(()=>x,Object.values(x));return h.jsx(_.Provider,{value:v,children:g})}function d(u,f){const g=(f==null?void 0:f[e][l])||o,x=C.useContext(g);if(x)return x;if(a!==void 0)return a;throw new Error(`\`${u}\` must be used within \`${s}\``)}return c.displayName=s+"Provider",[c,d]}const i=()=>{const s=n.map(a=>C.createContext(a));return function(o){const l=(o==null?void 0:o[e])||s;return C.useMemo(()=>({[`__scope${e}`]:{...o,[e]:l}}),[o,l])}};return i.scopeName=e,[r,Yae(i,...t)]}function Yae(...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:c})=>{const u=l(s)[`__scope${c}`];return{...o,...u}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var $x="rovingFocusGroup.onEntryFocus",Kae={bubbles:!1,cancelable:!0},F1="RovingFocusGroup",[A2,JO,Gae]=jp(F1),[Xae,B1]=qae(F1,[Gae]),[Qae,Jae]=Xae(F1),ZO=C.forwardRef((e,t)=>h.jsx(A2.Provider,{scope:e.__scopeRovingFocusGroup,children:h.jsx(A2.Slot,{scope:e.__scopeRovingFocusGroup,children:h.jsx(Zae,{...e,ref:t})})}));ZO.displayName=F1;var Zae=C.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:d=!1,...u}=e,f=C.useRef(null),g=We(t,f),x=vd(s),[_=null,v]=gs({prop:a,defaultProp:o,onChange:l}),[p,m]=C.useState(!1),y=Mt(c),b=JO(n),S=C.useRef(!1),[w,E]=C.useState(0);return C.useEffect(()=>{const k=f.current;if(k)return k.addEventListener($x,y),()=>k.removeEventListener($x,y)},[y]),h.jsx(Qae,{scope:n,orientation:r,dir:x,loop:i,currentTabStopId:_,onItemFocus:C.useCallback(k=>v(k),[v]),onItemShiftTab:C.useCallback(()=>m(!0),[]),onFocusableItemAdd:C.useCallback(()=>E(k=>k+1),[]),onFocusableItemRemove:C.useCallback(()=>E(k=>k-1),[]),children:h.jsx(Me.div,{tabIndex:p||w===0?-1:0,"data-orientation":r,...u,ref:g,style:{outline:"none",...e.style},onMouseDown:me(e.onMouseDown,()=>{S.current=!0}),onFocus:me(e.onFocus,k=>{const T=!S.current;if(k.target===k.currentTarget&&T&&!p){const R=new CustomEvent($x,Kae);if(k.currentTarget.dispatchEvent(R),!R.defaultPrevented){const M=b().filter(F=>F.focusable),L=M.find(F=>F.active),j=M.find(F=>F.id===_),$=[L,j,...M].filter(Boolean).map(F=>F.ref.current);n9($,d)}}S.current=!1}),onBlur:me(e.onBlur,()=>m(!1))})})}),e9="RovingFocusGroupItem",t9=C.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:s,...a}=e,o=Ir(),l=s||o,c=Jae(e9,n),d=c.currentTabStopId===l,u=JO(n),{onFocusableItemAdd:f,onFocusableItemRemove:g}=c;return C.useEffect(()=>{if(r)return f(),()=>g()},[r,f,g]),h.jsx(A2.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:h.jsx(Me.span,{tabIndex:d?0:-1,"data-orientation":c.orientation,...a,ref:t,onMouseDown:me(e.onMouseDown,x=>{r?c.onItemFocus(l):x.preventDefault()}),onFocus:me(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:me(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){c.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const _=nle(x,c.orientation,c.dir);if(_!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let p=u().filter(m=>m.focusable).map(m=>m.ref.current);if(_==="last")p.reverse();else if(_==="prev"||_==="next"){_==="prev"&&p.reverse();const m=p.indexOf(x.currentTarget);p=c.loop?rle(p,m+1):p.slice(m+1)}setTimeout(()=>n9(p))}})})})});t9.displayName=e9;var ele={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function tle(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function nle(e,t,n){const r=tle(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return ele[r]}function n9(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function rle(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var r9=ZO,i9=t9,ile=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},dc=new WeakMap,zm=new WeakMap,Um={},Fx=0,s9=function(e){return e&&(e.host||s9(e.parentNode))},sle=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=s9(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})},ole=function(e,t,n,r){var i=sle(t,Array.isArray(e)?e:[e]);Um[n]||(Um[n]=new WeakMap);var s=Um[n],a=[],o=new Set,l=new Set(i),c=function(u){!u||o.has(u)||(o.add(u),c(u.parentNode))};i.forEach(c);var d=function(u){!u||l.has(u)||Array.prototype.forEach.call(u.children,function(f){if(o.has(f))d(f);else{var g=f.getAttribute(r),x=g!==null&&g!=="false",_=(dc.get(f)||0)+1,v=(s.get(f)||0)+1;dc.set(f,_),s.set(f,v),a.push(f),_===1&&x&&zm.set(f,!0),v===1&&f.setAttribute(n,"true"),x||f.setAttribute(r,"true")}})};return d(t),o.clear(),Fx++,function(){a.forEach(function(u){var f=dc.get(u)-1,g=s.get(u)-1;dc.set(u,f),s.set(u,g),f||(zm.has(u)||u.removeAttribute(r),zm.delete(u)),g||u.removeAttribute(n)}),Fx--,Fx||(dc=new WeakMap,dc=new WeakMap,zm=new WeakMap,Um={})}},pk=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=ile(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),ole(r,i,n,"aria-hidden")):function(){return null}},as=function(){return as=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},as.apply(this,arguments)};function o9(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 ale(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 Og="right-scroll-bar-position",Ig="width-before-scroll-bar",lle="with-scroll-bars-hidden",cle="--removed-body-scroll-bar-size";function Bx(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function ule(e,t){var n=C.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 dle=typeof window<"u"?C.useLayoutEffect:C.useEffect,dR=new WeakMap;function hle(e,t){var n=ule(null,function(r){return e.forEach(function(i){return Bx(i,r)})});return dle(function(){var r=dR.get(n);if(r){var i=new Set(r),s=new Set(e),a=n.current;i.forEach(function(o){s.has(o)||Bx(o,null)}),s.forEach(function(o){i.has(o)||Bx(o,a)})}dR.set(n,e)},[e]),n}function fle(e){return e}function ple(e,t){t===void 0&&(t=fle);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 d=a;a=[],d.forEach(s)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(d){a.push(d),c()},filter:function(d){return a=a.filter(d),n}}}};return i}function mle(e){e===void 0&&(e={});var t=ple(null);return t.options=as({async:!0,ssr:!1},e),t}var a9=function(e){var t=e.sideCar,n=o9(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 C.createElement(r,as({},n))};a9.isSideCarExport=!0;function gle(e,t){return e.useMedium(t),a9}var l9=mle(),zx=function(){},z1=C.forwardRef(function(e,t){var n=C.useRef(null),r=C.useState({onScrollCapture:zx,onWheelCapture:zx,onTouchMoveCapture:zx}),i=r[0],s=r[1],a=e.forwardProps,o=e.children,l=e.className,c=e.removeScrollBar,d=e.enabled,u=e.shards,f=e.sideCar,g=e.noIsolation,x=e.inert,_=e.allowPinchZoom,v=e.as,p=v===void 0?"div":v,m=e.gapMode,y=o9(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),b=f,S=hle([n,t]),w=as(as({},y),i);return C.createElement(C.Fragment,null,d&&C.createElement(b,{sideCar:l9,removeScrollBar:c,shards:u,noIsolation:g,inert:x,setCallbacks:s,allowPinchZoom:!!_,lockRef:n,gapMode:m}),a?C.cloneElement(C.Children.only(o),as(as({},w),{ref:S})):C.createElement(p,as({},w,{className:l,ref:S}),o))});z1.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};z1.classNames={fullWidth:Ig,zeroRight:Og};var vle=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function yle(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=vle();return t&&e.setAttribute("nonce",t),e}function _le(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function xle(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var ble=function(){var e=0,t=null;return{add:function(n){e==0&&(t=yle())&&(_le(t,n),xle(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},wle=function(){var e=ble();return function(t,n){C.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},c9=function(){var e=wle(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},Sle={left:0,top:0,right:0,gap:0},Ux=function(e){return parseInt(e||"",10)||0},Cle=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[Ux(n),Ux(r),Ux(i)]},kle=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Sle;var t=Cle(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])}},Ele=c9(),Jc="data-scroll-locked",Tle=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(lle,` {
   overflow: hidden `).concat(r,`;
   padding-right: `).concat(o,"px ").concat(r,`;
  }
  body[`).concat(Jc,`] {
    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(Og,` {
    right: `).concat(o,"px ").concat(r,`;
  }
  
  .`).concat(Ig,` {
    margin-right: `).concat(o,"px ").concat(r,`;
  }
  
  .`).concat(Og," .").concat(Og,` {
    right: 0 `).concat(r,`;
  }
  
  .`).concat(Ig," .").concat(Ig,` {
    margin-right: 0 `).concat(r,`;
  }
  
  body[`).concat(Jc,`] {
    `).concat(cle,": ").concat(o,`px;
  }
`)},hR=function(){var e=parseInt(document.body.getAttribute(Jc)||"0",10);return isFinite(e)?e:0},Mle=function(){C.useEffect(function(){return document.body.setAttribute(Jc,(hR()+1).toString()),function(){var e=hR()-1;e<=0?document.body.removeAttribute(Jc):document.body.setAttribute(Jc,e.toString())}},[])},Rle=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;Mle();var s=C.useMemo(function(){return kle(i)},[i]);return C.createElement(Ele,{styles:Tle(s,!t,i,n?"":"!important")})},D2=!1;if(typeof window<"u")try{var Hm=Object.defineProperty({},"passive",{get:function(){return D2=!0,!0}});window.addEventListener("test",Hm,Hm),window.removeEventListener("test",Hm,Hm)}catch{D2=!1}var hc=D2?{passive:!1}:!1,Ale=function(e){return e.tagName==="TEXTAREA"},u9=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Ale(e)&&n[t]==="visible")},Dle=function(e){return u9(e,"overflowY")},Lle=function(e){return u9(e,"overflowX")},fR=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=d9(e,r);if(i){var s=h9(e,r),a=s[1],o=s[2];if(a>o)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},jle=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Ple=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},d9=function(e,t){return e==="v"?Dle(t):Lle(t)},h9=function(e,t){return e==="v"?jle(t):Ple(t)},Nle=function(e,t){return e==="h"&&t==="rtl"?-1:1},Ole=function(e,t,n,r,i){var s=Nle(e,window.getComputedStyle(t).direction),a=s*r,o=n.target,l=t.contains(o),c=!1,d=a>0,u=0,f=0;do{var g=h9(e,o),x=g[0],_=g[1],v=g[2],p=_-v-s*x;(x||p)&&d9(e,o)&&(u+=p,f+=x),o instanceof ShadowRoot?o=o.host:o=o.parentNode}while(!l&&o!==document.body||l&&(t.contains(o)||t===o));return(d&&(Math.abs(u)<1||!i)||!d&&(Math.abs(f)<1||!i))&&(c=!0),c},Wm=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},pR=function(e){return[e.deltaX,e.deltaY]},mR=function(e){return e&&"current"in e?e.current:e},Ile=function(e,t){return e[0]===t[0]&&e[1]===t[1]},$le=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},Fle=0,fc=[];function Ble(e){var t=C.useRef([]),n=C.useRef([0,0]),r=C.useRef(),i=C.useState(Fle++)[0],s=C.useState(c9)[0],a=C.useRef(e);C.useEffect(function(){a.current=e},[e]),C.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var _=ale([e.lockRef.current],(e.shards||[]).map(mR),!0).filter(Boolean);return _.forEach(function(v){return v.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),_.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var o=C.useCallback(function(_,v){if("touches"in _&&_.touches.length===2||_.type==="wheel"&&_.ctrlKey)return!a.current.allowPinchZoom;var p=Wm(_),m=n.current,y="deltaX"in _?_.deltaX:m[0]-p[0],b="deltaY"in _?_.deltaY:m[1]-p[1],S,w=_.target,E=Math.abs(y)>Math.abs(b)?"h":"v";if("touches"in _&&E==="h"&&w.type==="range")return!1;var k=fR(E,w);if(!k)return!0;if(k?S=E:(S=E==="v"?"h":"v",k=fR(E,w)),!k)return!1;if(!r.current&&"changedTouches"in _&&(y||b)&&(r.current=S),!S)return!0;var T=r.current||S;return Ole(T,v,_,T==="h"?y:b,!0)},[]),l=C.useCallback(function(_){var v=_;if(!(!fc.length||fc[fc.length-1]!==s)){var p="deltaY"in v?pR(v):Wm(v),m=t.current.filter(function(S){return S.name===v.type&&(S.target===v.target||v.target===S.shadowParent)&&Ile(S.delta,p)})[0];if(m&&m.should){v.cancelable&&v.preventDefault();return}if(!m){var y=(a.current.shards||[]).map(mR).filter(Boolean).filter(function(S){return S.contains(v.target)}),b=y.length>0?o(v,y[0]):!a.current.noIsolation;b&&v.cancelable&&v.preventDefault()}}},[]),c=C.useCallback(function(_,v,p,m){var y={name:_,delta:v,target:p,should:m,shadowParent:zle(p)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(b){return b!==y})},1)},[]),d=C.useCallback(function(_){n.current=Wm(_),r.current=void 0},[]),u=C.useCallback(function(_){c(_.type,pR(_),_.target,o(_,e.lockRef.current))},[]),f=C.useCallback(function(_){c(_.type,Wm(_),_.target,o(_,e.lockRef.current))},[]);C.useEffect(function(){return fc.push(s),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:f}),document.addEventListener("wheel",l,hc),document.addEventListener("touchmove",l,hc),document.addEventListener("touchstart",d,hc),function(){fc=fc.filter(function(_){return _!==s}),document.removeEventListener("wheel",l,hc),document.removeEventListener("touchmove",l,hc),document.removeEventListener("touchstart",d,hc)}},[]);var g=e.removeScrollBar,x=e.inert;return C.createElement(C.Fragment,null,x?C.createElement(s,{styles:$le(i)}):null,g?C.createElement(Rle,{gapMode:e.gapMode}):null)}function zle(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Ule=gle(l9,Ble);var U1=C.forwardRef(function(e,t){return C.createElement(z1,as({},e,{ref:t,sideCar:Ule}))});U1.classNames=z1.classNames;var L2=["Enter"," "],Hle=["ArrowDown","PageUp","Home"],f9=["ArrowUp","PageDown","End"],Wle=[...Hle,...f9],Vle={ltr:[...L2,"ArrowRight"],rtl:[...L2,"ArrowLeft"]},qle={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Np="Menu",[Wf,Yle,Kle]=jp(Np),[Bl,p9]=Hi(Np,[Kle,bd,B1]),H1=bd(),m9=B1(),[Gle,zl]=Bl(Np),[Xle,Op]=Bl(Np),g9=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:s,modal:a=!0}=e,o=H1(t),[l,c]=C.useState(null),d=C.useRef(!1),u=Mt(s),f=vd(i);return C.useEffect(()=>{const g=()=>{d.current=!0,document.addEventListener("pointerdown",x,{capture:!0,once:!0}),document.addEventListener("pointermove",x,{capture:!0,once:!0})},x=()=>d.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",x,{capture:!0}),document.removeEventListener("pointermove",x,{capture:!0})}},[]),h.jsx(uk,{...o,children:h.jsx(Gle,{scope:t,open:n,onOpenChange:u,content:l,onContentChange:c,children:h.jsx(Xle,{scope:t,onClose:C.useCallback(()=>u(!1),[u]),isUsingKeyboardRef:d,dir:f,modal:a,children:r})})})};g9.displayName=Np;var Qle="MenuAnchor",mk=C.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=H1(n);return h.jsx(dk,{...i,...r,ref:t})});mk.displayName=Qle;var gk="MenuPortal",[Jle,v9]=Bl(gk,{forceMount:void 0}),y9=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,s=zl(gk,t);return h.jsx(Jle,{scope:t,forceMount:n,children:h.jsx(wn,{present:n||s.open,children:h.jsx($1,{asChild:!0,container:i,children:r})})})};y9.displayName=gk;var ri="MenuContent",[Zle,vk]=Bl(ri),_9=C.forwardRef((e,t)=>{const n=v9(ri,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,s=zl(ri,e.__scopeMenu),a=Op(ri,e.__scopeMenu);return h.jsx(Wf.Provider,{scope:e.__scopeMenu,children:h.jsx(wn,{present:r||s.open,children:h.jsx(Wf.Slot,{scope:e.__scopeMenu,children:a.modal?h.jsx(ece,{...i,ref:t}):h.jsx(tce,{...i,ref:t})})})})}),ece=C.forwardRef((e,t)=>{const n=zl(ri,e.__scopeMenu),r=C.useRef(null),i=We(t,r);return C.useEffect(()=>{const s=r.current;if(s)return pk(s)},[]),h.jsx(yk,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:me(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),tce=C.forwardRef((e,t)=>{const n=zl(ri,e.__scopeMenu);return h.jsx(yk,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),yk=C.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:f,onDismiss:g,disableOutsideScroll:x,..._}=e,v=zl(ri,n),p=Op(ri,n),m=H1(n),y=m9(n),b=Yle(n),[S,w]=C.useState(null),E=C.useRef(null),k=We(t,E,v.onContentChange),T=C.useRef(0),R=C.useRef(""),M=C.useRef(0),L=C.useRef(null),j=C.useRef("right"),P=C.useRef(0),$=x?U1:C.Fragment,F=x?{as:ua,allowPinchZoom:!0}:void 0,W=A=>{var q,B;const D=R.current+A,H=b().filter(O=>!O.disabled),V=document.activeElement,U=(q=H.find(O=>O.ref.current===V))==null?void 0:q.textValue,G=H.map(O=>O.textValue),ee=fce(G,D,U),Z=(B=H.find(O=>O.textValue===ee))==null?void 0:B.ref.current;(function O(z){R.current=z,window.clearTimeout(T.current),z!==""&&(T.current=window.setTimeout(()=>O(""),1e3))})(D),Z&&setTimeout(()=>Z.focus())};C.useEffect(()=>()=>window.clearTimeout(T.current),[]),tk();const I=C.useCallback(A=>{var H,V;return j.current===((H=L.current)==null?void 0:H.side)&&mce(A,(V=L.current)==null?void 0:V.area)},[]);return h.jsx(Zle,{scope:n,searchRef:R,onItemEnter:C.useCallback(A=>{I(A)&&A.preventDefault()},[I]),onItemLeave:C.useCallback(A=>{var D;I(A)||((D=E.current)==null||D.focus(),w(null))},[I]),onTriggerLeave:C.useCallback(A=>{I(A)&&A.preventDefault()},[I]),pointerGraceTimerRef:M,onPointerGraceIntentChange:C.useCallback(A=>{L.current=A},[]),children:h.jsx($,{...F,children:h.jsx(P1,{asChild:!0,trapped:i,onMountAutoFocus:me(s,A=>{var D;A.preventDefault(),(D=E.current)==null||D.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:h.jsx(yd,{asChild:!0,disableOutsidePointerEvents:o,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:f,onDismiss:g,children:h.jsx(r9,{asChild:!0,...y,dir:p.dir,orientation:"vertical",loop:r,currentTabStopId:S,onCurrentTabStopIdChange:w,onEntryFocus:me(l,A=>{p.isUsingKeyboardRef.current||A.preventDefault()}),preventScrollOnEntryFocus:!0,children:h.jsx(hk,{role:"menu","aria-orientation":"vertical","data-state":N9(v.open),"data-radix-menu-content":"",dir:p.dir,...m,..._,ref:k,style:{outline:"none",..._.style},onKeyDown:me(_.onKeyDown,A=>{const H=A.target.closest("[data-radix-menu-content]")===A.currentTarget,V=A.ctrlKey||A.altKey||A.metaKey,U=A.key.length===1;H&&(A.key==="Tab"&&A.preventDefault(),!V&&U&&W(A.key));const G=E.current;if(A.target!==G||!Wle.includes(A.key))return;A.preventDefault();const Z=b().filter(q=>!q.disabled).map(q=>q.ref.current);f9.includes(A.key)&&Z.reverse(),dce(Z)}),onBlur:me(e.onBlur,A=>{A.currentTarget.contains(A.target)||(window.clearTimeout(T.current),R.current="")}),onPointerMove:me(e.onPointerMove,Vf(A=>{const D=A.target,H=P.current!==A.clientX;if(A.currentTarget.contains(D)&&H){const V=A.clientX>P.current?"right":"left";j.current=V,P.current=A.clientX}}))})})})})})})});_9.displayName=ri;var nce="MenuGroup",_k=C.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(Me.div,{role:"group",...r,ref:t})});_k.displayName=nce;var rce="MenuLabel",x9=C.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(Me.div,{...r,ref:t})});x9.displayName=rce;var G0="MenuItem",gR="menu.itemSelect",W1=C.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,s=C.useRef(null),a=Op(G0,e.__scopeMenu),o=vk(G0,e.__scopeMenu),l=We(t,s),c=C.useRef(!1),d=()=>{const u=s.current;if(!n&&u){const f=new CustomEvent(gR,{bubbles:!0,cancelable:!0});u.addEventListener(gR,g=>r==null?void 0:r(g),{once:!0}),w0(u,f),f.defaultPrevented?c.current=!1:a.onClose()}};return h.jsx(b9,{...i,ref:l,disabled:n,onClick:me(e.onClick,d),onPointerDown:u=>{var f;(f=e.onPointerDown)==null||f.call(e,u),c.current=!0},onPointerUp:me(e.onPointerUp,u=>{var f;c.current||(f=u.currentTarget)==null||f.click()}),onKeyDown:me(e.onKeyDown,u=>{const f=o.searchRef.current!=="";n||f&&u.key===" "||L2.includes(u.key)&&(u.currentTarget.click(),u.preventDefault())})})});W1.displayName=G0;var b9=C.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...s}=e,a=vk(G0,n),o=m9(n),l=C.useRef(null),c=We(t,l),[d,u]=C.useState(!1),[f,g]=C.useState("");return C.useEffect(()=>{const x=l.current;x&&g((x.textContent??"").trim())},[s.children]),h.jsx(Wf.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:h.jsx(i9,{asChild:!0,...o,focusable:!r,children:h.jsx(Me.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:c,onPointerMove:me(e.onPointerMove,Vf(x=>{r?a.onItemLeave(x):(a.onItemEnter(x),x.defaultPrevented||x.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:me(e.onPointerLeave,Vf(x=>a.onItemLeave(x))),onFocus:me(e.onFocus,()=>u(!0)),onBlur:me(e.onBlur,()=>u(!1))})})})}),ice="MenuCheckboxItem",w9=C.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return h.jsx(T9,{scope:e.__scopeMenu,checked:n,children:h.jsx(W1,{role:"menuitemcheckbox","aria-checked":X0(n)?"mixed":n,...i,ref:t,"data-state":bk(n),onSelect:me(i.onSelect,()=>r==null?void 0:r(X0(n)?!0:!n),{checkForDefaultPrevented:!1})})})});w9.displayName=ice;var S9="MenuRadioGroup",[sce,oce]=Bl(S9,{value:void 0,onValueChange:()=>{}}),C9=C.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,s=Mt(r);return h.jsx(sce,{scope:e.__scopeMenu,value:n,onValueChange:s,children:h.jsx(_k,{...i,ref:t})})});C9.displayName=S9;var k9="MenuRadioItem",E9=C.forwardRef((e,t)=>{const{value:n,...r}=e,i=oce(k9,e.__scopeMenu),s=n===i.value;return h.jsx(T9,{scope:e.__scopeMenu,checked:s,children:h.jsx(W1,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":bk(s),onSelect:me(r.onSelect,()=>{var a;return(a=i.onValueChange)==null?void 0:a.call(i,n)},{checkForDefaultPrevented:!1})})})});E9.displayName=k9;var xk="MenuItemIndicator",[T9,ace]=Bl(xk,{checked:!1}),M9=C.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,s=ace(xk,n);return h.jsx(wn,{present:r||X0(s.checked)||s.checked===!0,children:h.jsx(Me.span,{...i,ref:t,"data-state":bk(s.checked)})})});M9.displayName=xk;var lce="MenuSeparator",R9=C.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(Me.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});R9.displayName=lce;var cce="MenuArrow",A9=C.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=H1(n);return h.jsx(fk,{...i,...r,ref:t})});A9.displayName=cce;var uce="MenuSub",[oUe,D9]=Bl(uce),zh="MenuSubTrigger",L9=C.forwardRef((e,t)=>{const n=zl(zh,e.__scopeMenu),r=Op(zh,e.__scopeMenu),i=D9(zh,e.__scopeMenu),s=vk(zh,e.__scopeMenu),a=C.useRef(null),{pointerGraceTimerRef:o,onPointerGraceIntentChange:l}=s,c={__scopeMenu:e.__scopeMenu},d=C.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return C.useEffect(()=>d,[d]),C.useEffect(()=>{const u=o.current;return()=>{window.clearTimeout(u),l(null)}},[o,l]),h.jsx(mk,{asChild:!0,...c,children:h.jsx(b9,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":N9(n.open),...e,ref:Tp(t,i.onTriggerChange),onClick:u=>{var f;(f=e.onClick)==null||f.call(e,u),!(e.disabled||u.defaultPrevented)&&(u.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:me(e.onPointerMove,Vf(u=>{s.onItemEnter(u),!u.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(s.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:me(e.onPointerLeave,Vf(u=>{var g,x;d();const f=(g=n.content)==null?void 0:g.getBoundingClientRect();if(f){const _=(x=n.content)==null?void 0:x.dataset.side,v=_==="right",p=v?-5:5,m=f[v?"left":"right"],y=f[v?"right":"left"];s.onPointerGraceIntentChange({area:[{x:u.clientX+p,y:u.clientY},{x:m,y:f.top},{x:y,y:f.top},{x:y,y:f.bottom},{x:m,y:f.bottom}],side:_}),window.clearTimeout(o.current),o.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(u),u.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:me(e.onKeyDown,u=>{var g;const f=s.searchRef.current!=="";e.disabled||f&&u.key===" "||Vle[r.dir].includes(u.key)&&(n.onOpenChange(!0),(g=n.content)==null||g.focus(),u.preventDefault())})})})});L9.displayName=zh;var j9="MenuSubContent",P9=C.forwardRef((e,t)=>{const n=v9(ri,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,s=zl(ri,e.__scopeMenu),a=Op(ri,e.__scopeMenu),o=D9(j9,e.__scopeMenu),l=C.useRef(null),c=We(t,l);return h.jsx(Wf.Provider,{scope:e.__scopeMenu,children:h.jsx(wn,{present:r||s.open,children:h.jsx(Wf.Slot,{scope:e.__scopeMenu,children:h.jsx(yk,{id:o.contentId,"aria-labelledby":o.triggerId,...i,ref:c,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var u;a.isUsingKeyboardRef.current&&((u=l.current)==null||u.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:me(e.onFocusOutside,d=>{d.target!==o.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:me(e.onEscapeKeyDown,d=>{a.onClose(),d.preventDefault()}),onKeyDown:me(e.onKeyDown,d=>{var g;const u=d.currentTarget.contains(d.target),f=qle[a.dir].includes(d.key);u&&f&&(s.onOpenChange(!1),(g=o.trigger)==null||g.focus(),d.preventDefault())})})})})})});P9.displayName=j9;function N9(e){return e?"open":"closed"}function X0(e){return e==="indeterminate"}function bk(e){return X0(e)?"indeterminate":e?"checked":"unchecked"}function dce(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function hce(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function fce(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=hce(e,Math.max(s,0));i.length===1&&(a=a.filter(c=>c!==n));const l=a.find(c=>c.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function pce(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,c=t[a].x,d=t[a].y;l>r!=d>r&&n<(c-o)*(r-l)/(d-l)+o&&(i=!i)}return i}function mce(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return pce(n,t)}function Vf(e){return t=>t.pointerType==="mouse"?e(t):void 0}var gce=g9,vce=mk,yce=y9,_ce=_9,xce=_k,bce=x9,wce=W1,Sce=w9,Cce=C9,kce=E9,Ece=M9,Tce=R9,Mce=A9,Rce=L9,Ace=P9,wk="DropdownMenu",[Dce,aUe]=Hi(wk,[p9]),cr=p9(),[Lce,O9]=Dce(wk),I9=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:s,onOpenChange:a,modal:o=!0}=e,l=cr(t),c=C.useRef(null),[d=!1,u]=gs({prop:i,defaultProp:s,onChange:a});return h.jsx(Lce,{scope:t,triggerId:Ir(),triggerRef:c,contentId:Ir(),open:d,onOpenChange:u,onOpenToggle:C.useCallback(()=>u(f=>!f),[u]),modal:o,children:h.jsx(gce,{...l,open:d,onOpenChange:u,dir:r,modal:o,children:n})})};I9.displayName=wk;var $9="DropdownMenuTrigger",F9=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,s=O9($9,n),a=cr(n);return h.jsx(vce,{asChild:!0,...a,children:h.jsx(Me.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:Tp(t,s.triggerRef),onPointerDown:me(e.onPointerDown,o=>{!r&&o.button===0&&o.ctrlKey===!1&&(s.onOpenToggle(),s.open||o.preventDefault())}),onKeyDown:me(e.onKeyDown,o=>{r||(["Enter"," "].includes(o.key)&&s.onOpenToggle(),o.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(o.key)&&o.preventDefault())})})})});F9.displayName=$9;var jce="DropdownMenuPortal",B9=e=>{const{__scopeDropdownMenu:t,...n}=e,r=cr(t);return h.jsx(yce,{...r,...n})};B9.displayName=jce;var z9="DropdownMenuContent",U9=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=O9(z9,n),s=cr(n),a=C.useRef(!1);return h.jsx(_ce,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...r,ref:t,onCloseAutoFocus:me(e.onCloseAutoFocus,o=>{var l;a.current||(l=i.triggerRef.current)==null||l.focus(),a.current=!1,o.preventDefault()}),onInteractOutside:me(e.onInteractOutside,o=>{const l=o.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;(!i.modal||d)&&(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)"}})});U9.displayName=z9;var Pce="DropdownMenuGroup",Nce=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=cr(n);return h.jsx(xce,{...i,...r,ref:t})});Nce.displayName=Pce;var Oce="DropdownMenuLabel",H9=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=cr(n);return h.jsx(bce,{...i,...r,ref:t})});H9.displayName=Oce;var Ice="DropdownMenuItem",W9=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=cr(n);return h.jsx(wce,{...i,...r,ref:t})});W9.displayName=Ice;var $ce="DropdownMenuCheckboxItem",V9=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=cr(n);return h.jsx(Sce,{...i,...r,ref:t})});V9.displayName=$ce;var Fce="DropdownMenuRadioGroup",q9=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=cr(n);return h.jsx(Cce,{...i,...r,ref:t})});q9.displayName=Fce;var Bce="DropdownMenuRadioItem",Y9=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=cr(n);return h.jsx(kce,{...i,...r,ref:t})});Y9.displayName=Bce;var zce="DropdownMenuItemIndicator",K9=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=cr(n);return h.jsx(Ece,{...i,...r,ref:t})});K9.displayName=zce;var Uce="DropdownMenuSeparator",G9=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=cr(n);return h.jsx(Tce,{...i,...r,ref:t})});G9.displayName=Uce;var Hce="DropdownMenuArrow",Wce=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=cr(n);return h.jsx(Mce,{...i,...r,ref:t})});Wce.displayName=Hce;var Vce="DropdownMenuSubTrigger",X9=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=cr(n);return h.jsx(Rce,{...i,...r,ref:t})});X9.displayName=Vce;var qce="DropdownMenuSubContent",Q9=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=cr(n);return h.jsx(Ace,{...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)"}})});Q9.displayName=qce;var Yce=I9,Kce=F9,Gce=B9,J9=U9,Z9=H9,eI=W9,tI=V9,Xce=q9,nI=Y9,rI=K9,iI=G9,sI=X9,oI=Q9;const Zc=Yce,eu=Kce,aI=Xce,Qce=C.forwardRef(({className:e,inset:t,children:n,...r},i)=>h.jsxs(sI,{ref:i,className:ie("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,h.jsx(zQ,{className:"ml-auto h-4 w-4"})]}));Qce.displayName=sI.displayName;const Jce=C.forwardRef(({className:e,...t},n)=>h.jsx(oI,{ref:n,className:ie("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}));Jce.displayName=oI.displayName;const rl=C.forwardRef(({className:e,sideOffset:t=4,...n},r)=>h.jsx(Gce,{children:h.jsx(J9,{ref:r,sideOffset:t,className:ie("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})}));rl.displayName=J9.displayName;const ls=C.forwardRef(({className:e,inset:t,...n},r)=>h.jsx(eI,{ref:r,className:ie("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));ls.displayName=eI.displayName;const lI=C.forwardRef(({className:e,children:t,checked:n,...r},i)=>h.jsxs(tI,{ref:i,className:ie("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:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(rI,{children:h.jsx(d5,{className:"h-4 w-4"})})}),t]}));lI.displayName=tI.displayName;const Sk=C.forwardRef(({className:e,children:t,...n},r)=>h.jsxs(nI,{ref:r,className:ie("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:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(rI,{children:h.jsx(KQ,{className:"h-2 w-2 fill-current"})})}),t]}));Sk.displayName=nI.displayName;const Q0=C.forwardRef(({className:e,inset:t,...n},r)=>h.jsx(Z9,{ref:r,className:ie("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Q0.displayName=Z9.displayName;const tu=C.forwardRef(({className:e,...t},n)=>h.jsx(iI,{ref:n,className:ie("-mx-1 my-1 h-px bg-muted",e),...t}));tu.displayName=iI.displayName;const J0=[{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."}],cI=[{label:"Is Admin",value:"isAdmin"},{label:"Is Online",value:"isOnline"},{label:"Has Whitelisted ID",value:"isWhitelisted"},{label:"Has Profile Notes",value:"hasNote"}],Vm=Gn(1250,e=>{e()},{noLeading:!0});function Zce({doSearch:e,initialState:t}){const n=C.useRef(null),[r,i]=C.useState(!1),[s,a]=C.useState(!1),[o,l]=C.useState(t.search.type),[c,d]=C.useState(t.filters),[u,f]=C.useState(!!t.search.value),g=()=>{if(!n.current)return;const y=n.current.value.trim();e({value:y,type:o},c)};C.useEffect(()=>{g()},[o,c]);const x=y=>{y.key==="Enter"?(Vm.cancel({upcomingOnly:!0}),g()):y.key==="Escape"?(n.current.value="",Vm(g),f(!1)):(Vm(g),f(!0))},_=()=>{n.current.value="",Vm.cancel({upcomingOnly:!0}),g(),f(!1)},v=(y,b)=>{d(b?S=>[...S,y]:S=>S.filter(w=>w!==y))};Pi("keydown",y=>{var b;y.code==="KeyF"&&(y.ctrlKey||y.metaKey)&&((b=n.current)==null||b.focus(),y.preventDefault())});const p=J0.find(y=>y.value===o);if(!p)throw new Error(`Invalid search type: ${o}`);const m=c.length?`${c.length} Filter${c.length>1?"s":""}`:"No filters";return h.jsxs("div",{className:"p-4 mb-2 md:mb-4 md:rounded-xl border border-border bg-card text-card-foreground shadow-sm",children:[h.jsxs("div",{className:"flex flex-wrap-reverse gap-2",children:[h.jsxs("div",{className:"relative min-w-44 grow",children:[h.jsx(ln,{type:"text",autoFocus:!0,autoCapitalize:"off",autoCorrect:"off",ref:n,placeholder:p.placeholder,defaultValue:t.search.value,onKeyDown:x}),u?h.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:_,children:h.jsx(bs,{})}):h.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:h.jsx(Mn,{className:"text-xs tracking-wide",children:"ctrl+f"})})]}),h.jsxs("div",{className:"grow flex content-start gap-2 flex-wrap",children:[h.jsxs(Zc,{children:[h.jsx(eu,{asChild:!0,children:h.jsxs(Ke,{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 ",p.label,h.jsx(t2,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),h.jsxs(rl,{className:"w-48",children:[h.jsx(Q0,{children:"Search Type"}),h.jsx(tu,{}),h.jsx(aI,{value:o,onValueChange:l,children:J0.map(y=>h.jsx(Sk,{value:y.value,className:"cursor-pointer",children:y.label},y.value))})]})]}),h.jsxs(Zc,{children:[h.jsx(eu,{asChild:!0,children:h.jsxs(Ke,{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:[m,h.jsx(t2,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),h.jsxs(rl,{className:"w-44",children:[h.jsx(Q0,{children:"Search Filters"}),h.jsx(tu,{}),cI.map(y=>h.jsx(lI,{checked:c.includes(y.value),className:"cursor-pointer",onCheckedChange:b=>{v(y.value,b)},children:y.label},y.value)),h.jsx(tu,{}),h.jsxs(ls,{className:"cursor-pointer",onClick:()=>d([]),children:[h.jsx(rJ,{className:"mr-2 h-4 w-4"}),"Clear Filters"]})]})]}),h.jsx("div",{className:"flex justify-end flex-grow",children:h.jsxs(Zc,{children:[h.jsx(eu,{className:"",children:h.jsxs(Ke,{variant:"outline",className:"grow md:grow-0",children:["More",h.jsx(ud,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),h.jsxs(rl,{children:[h.jsx(ls,{className:"h-10 pl-1 pr-2 py-2",asChild:!0,children:h.jsxs(ca,{href:"/ban-identifiers",className:"cursor-pointer",children:[h.jsx(da,{className:"inline mr-1 h-4"}),"Ban Identifiers"]})}),h.jsx(ls,{className:"h-10 pl-1 pr-2 py-2",asChild:!0,children:h.jsxs(ca,{href:"/system/master-actions#cleandb",className:"cursor-pointer",children:[h.jsx(da,{className:"inline mr-1 h-4"}),"Prune Players/HWIDs"]})})]})]})})]})]}),h.jsx("div",{className:"text-xs text-muted-foreground mt-1 px-1",children:p.description})]})}function pc(e,t,n){let r=n.initialDeps??[],i;return()=>{var s,a,o,l;let c;n.key&&((s=n.debug)!=null&&s.call(n))&&(c=Date.now());const d=e();if(!(d.length!==r.length||d.some((g,x)=>r[x]!==g)))return i;r=d;let f;if(n.key&&((a=n.debug)!=null&&a.call(n))&&(f=Date.now()),i=t(...d),n.key&&((o=n.debug)!=null&&o.call(n))){const g=Math.round((Date.now()-c)*100)/100,x=Math.round((Date.now()-f)*100)/100,_=x/16,v=(p,m)=>{for(p=String(p);p.length<m;)p=" "+p;return p};console.info(`%c⏱ ${v(x,5)} /${v(g,5)} ms`,`
            font-size: .6rem;
            font-weight: bold;
            color: hsl(${Math.max(0,Math.min(120-120*_,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 Hx(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const eue=(e,t)=>Math.abs(e-t)<1,tue=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},nue=e=>e,rue=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},iue=(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)}},vR={passive:!0},sue=typeof window>"u"?!0:"onscrollend"in window,oue=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let i=0;const s=sue?()=>{}:tue(r,()=>{t(i,!1)},e.options.isScrollingResetDelay),a=c=>()=>{const{horizontal:d,isRtl:u}=e.options;i=d?n.scrollLeft*(u&&-1||1):n.scrollTop,s(),t(i,c)},o=a(!0),l=a(!1);return l(),n.addEventListener("scroll",o,vR),n.addEventListener("scrollend",l,vR),()=>{n.removeEventListener("scroll",o),n.removeEventListener("scrollend",l)}},aue=(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"])},lue=(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 cue{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:nue,rangeExtractor:rue,onChange:()=>{},measureElement:aue,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,...n}},this.notify=n=>{var r,i;(i=(r=this.options).onChange)==null||i.call(r,this,n)},this.maybeNotify=pc(()=>(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=pc(()=>[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=pc(()=>[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(d=>{this.itemSizeCache.set(d.key,d.size)}));const l=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const c=this.measurementsCache.slice(0,l);for(let d=l;d<n;d++){const u=s(d),f=this.options.lanes===1?c[d-1]:this.getFurthestMeasurement(c,d),g=f?f.end+this.options.gap:r+i,x=o.get(u),_=typeof x=="number"?x:this.options.estimateSize(d),v=g+_,p=f?f.lane:d%this.options.lanes;c[d]={index:d,start:g,size:_,end:v,key:u,lane:p}}return this.measurementsCache=c,c},{key:!1,debug:()=>this.options.debug}),this.calculateRange=pc(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()],(n,r,i)=>this.range=n.length>0&&r>0?uue({measurements:n,outerSize:r,scrollOffset:i}):null,{key:!1,debug:()=>this.options.debug}),this.getIndexes=pc(()=>[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=pc(()=>[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 Hx(r[uI(0,r.length-1,i=>Hx(r[i]).start,n)])},this.getOffsetForAlignment=(n,r)=>{const i=this.getSize(),s=this.getScrollOffset();r==="auto"&&(n<=s?r="start":n>=s+i?r="end":r="start"),r==="start"?n=n:r==="end"?n=n-i:r==="center"&&(n=n-i/2);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=r==="end"?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(o,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[c]=Hx(this.getOffsetForIndex(n,o));eue(c,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 uI=(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 uue({measurements:e,outerSize:t,scrollOffset:n}){const r=e.length-1,s=uI(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 due=typeof document<"u"?C.useLayoutEffect:C.useEffect;function hue(e){const t=C.useReducer(()=>({}),{})[1],n={...e,onChange:(i,s)=>{var a;s?vr.flushSync(t):t(),(a=e.onChange)==null||a.call(e,i,s)}},[r]=C.useState(()=>new cue(n));return r.setOptions(n),C.useEffect(()=>r._didMount(),[]),due(()=>r._willUpdate()),r}function Ck(e){return hue({observeElementRect:iue,observeElementOffset:oue,scrollToFn:lue,...e})}function ju({children:e,href:t,className:n,rel:r,...i}){const s=wa()[1],a=t==null?void 0:t.startsWith("http"),o=l=>{t&&(l.preventDefault(),a?Fl(t):s(t??"/"))};return h.jsxs("a",{...i,rel:r??"noopener noreferrer",href:t,className:ie("text-accent no-underline hover:underline ml-1 mr-0 cursor-pointer",n),onClick:o,children:[e,a&&h.jsx(da,{className:"inline ml-1 mb-1 h-5 [.text-sm_&]:h-4 [.text-sm_&]:ml-0"})]})}const fue=C.forwardRef(({className:e,...t},n)=>h.jsx("div",{className:"relative w-full overflow-auto",children:h.jsx("table",{ref:n,className:ie("w-full caption-bottom text-sm",e),...t})}));fue.displayName="Table";const kk=C.forwardRef(({className:e,...t},n)=>h.jsx("thead",{ref:n,className:ie("[&_tr]:border-b",e),...t}));kk.displayName="TableHeader";const Ek=C.forwardRef(({className:e,...t},n)=>h.jsx("tbody",{ref:n,className:ie("[&_tr:last-child]:border-0",e),...t}));Ek.displayName="TableBody";const pue=C.forwardRef(({className:e,...t},n)=>h.jsx("tfoot",{ref:n,className:ie("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));pue.displayName="TableFooter";const Ip=C.forwardRef(({className:e,...t},n)=>h.jsx("tr",{ref:n,className:ie("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Ip.displayName="TableRow";const mue=C.forwardRef(({className:e,...t},n)=>h.jsx("th",{ref:n,className:ie("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));mue.displayName="TableHead";const Jr=C.forwardRef(({className:e,...t},n)=>h.jsx("td",{ref:n,className:ie("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Jr.displayName="TableCell";const gue=C.forwardRef(({className:e,...t},n)=>h.jsx("caption",{ref:n,className:ie("mt-4 text-sm text-muted-foreground",e),...t}));gue.displayName="TableCaption";const vue="https://monitor/WebPipe",yue=`txAdminPanel/v${window.txConsts.txaVersion} (atop FXServer/b${window.txConsts.fxsVersion})`,dI={"Content-Type":"application/json; charset=UTF-8",Accept:"application/json"};class j2 extends Error{constructor(n,r){super();oc(this,"title");oc(this,"message");this.title=n,this.message=r}}const hI=()=>{const e=rse(),t=H5();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=vue+n),r.method??(r.method="GET");const a=await(await fetch(n,{method:r.method,headers:{...dI,"User-Agent":yue,"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}},_ue=async(e,t={})=>{const n=new AbortController,r=setTimeout(()=>{n.abort("timeout")},t.timeout??7500);try{const i=await fetch(e,{headers:dI,method:"GET",signal:n.signal,...t});return clearTimeout(r),await i.json()}catch(i){throw clearTimeout(r),i}},qt=e=>{const t=C.useRef(void 0),n=C.useRef(void 0),r=hI();return e.abortOnUnmount??(e.abortOnUnmount=!1),C.useEffect(()=>()=>{var i;e.abortOnUnmount&&((i=t.current)==null||i.abort("unmount"),n.current&&sn.dismiss(n.current))},[]),async i=>{var c,d;n.current&&(sn.dismiss(n.current),n.current=void 0),t.current=new AbortController;let s=e.path;if(i.pathParams)for(const[u,f]of Object.entries(i.pathParams))s=s.replace(`/:${u}/`,`/${f.toString()}/`);if(i.queryParams){const u=new URLSearchParams;for(const[f,g]of Object.entries(i.queryParams))(typeof g=="string"||typeof g=="number"||typeof g=="boolean")&&u.append(f,g.toString());s+=`?${u.toString()}`}const a=`${e.method} ${e.path}`,o=(u,f)=>{if(n.current&&sn.error({title:u,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 j2(u,f)};if(i.toastId&&i.toastLoadingMessage)throw new Error("[useBackendApi] toastId and toastLoadingMessage are mutually exclusive.");i.toastLoadingMessage?n.current=sn.loading(i.toastLoadingMessage):i.toastId&&(n.current=i.toastId);const l=setTimeout(()=>{var u,f;(u=t.current)!=null&&u.signal.aborted||(console.log("[TIMEOUT]",a),(f=t.current)==null||f.abort("timeout"),o("Request Timeout","If you closed txAdmin, please restart it and try again."))},i.timeout??7500);try{console.log("[>>]",a);const u=await r(s,{method:e.method,body:i.data},t.current);if(clearTimeout(l),(c=t.current)!=null&&c.signal.aborted)return;if(e.throwGenericErrors&&"error"in u)throw new j2("API Error",u.error);if(i.genericHandler&&n.current&&("error"in u?sn.error({title:i.genericHandler.errorTitle,msg:u.error},{id:n.current}):sn.success(i.genericHandler.successMsg,{id:n.current})),n.current&&typeof(u==null?void 0:u.type)=="string"&&typeof(u==null?void 0:u.msg)=="string"&&yie.includes(u==null?void 0:u.type)&&typeof sn[u.type]=="function"&&sn[u.type](u,{id:n.current}),i.success)try{i.success(u,n.current)}catch(f){console.log("[SUCCESS CB ERROR]",a,f)}return u}catch(u){if((d=t.current)!=null&&d.signal.aborted)return;clearTimeout(l);let f="unknown error";const g=u;typeof g.message!="string"?f=JSON.stringify(g):g.message.startsWith("NetworkError")?f=`Network error.
If you closed txAdmin, please restart it and try again.`:g.message.startsWith("JSON.parse:")?f="Invalid JSON response from server.":f=g.message,f.includes("unmount")?console.warn("[UNMOUNTED]",a):(console.error("[ERROR]",a,f),o("Request Error",f))}}};function xue({rowData:e,modalOpener:t}){const n=()=>{t({license:e.license})};return h.jsxs(Ip,{onClick:n,className:"cursor-pointer",children:[h.jsxs(Jr,{className:"px-4 py-2 flex justify-between border-r",children:[h.jsx("span",{className:"text-ellipsis overflow-hidden line-clamp-1 break-all",children:e.displayName}),h.jsxs("div",{className:"hidden md:inline-flex items-center gap-1",children:[h.jsx(MJ,{className:ie("h-5",e.isOnline?"text-success-inline animate-pulse":"text-muted")}),h.jsx(mP,{className:ie("h-5",e.isAdmin?"text-warning-inline":"text-muted")}),h.jsx(nJ,{className:ie("h-5",e.notes?"text-secondary-foreground":"text-muted")})]})]}),h.jsx(Jr,{className:"min-w-[8rem] px-4 py-2 border-r",children:V5(e.playTime*6e4)}),h.jsx(Jr,{className:"min-w-[10rem] px-4 py-2 border-r",children:w2(e.tsJoined)}),h.jsx(Jr,{className:"min-w-[10rem] px-4 py-2",children:w2(e.tsLastConnection)})]})}function bue({playersCount:e,hasReachedEnd:t,isFetching:n,loadError:r,retryFetch:i}){let s;return n?s=h.jsx(cn,{className:"mx-auto animate-spin"}):r?s=h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:"text-destructive-inline",children:["Error: ",r]}),h.jsx("br",{}),h.jsx("button",{className:"underline",onClick:()=>i(),children:"Try again?"})]}):t?s=h.jsx("span",{className:"font-bold text-muted-foreground",children:e?"You have reached the end of the list.":"No players found."}):s=h.jsxs("span",{children:["You've found the end of the rainbow, but there's no pot of gold here. ",h.jsx("br",{}),h.jsxs("i",{children:["(this is a bug, please report it in ",h.jsx(ju,{href:"https://discord.gg/txAdmin",target:"_blank",rel:"noopener noreferrer",children:"discord.gg/txAdmin"}),")"]})]}),h.jsx(Ip,{children:h.jsx(Jr,{colSpan:4,className:"px-4 py-2 text-center",children:s})})}function Wx({label:e,sortKey:t,sortingState:n,setSorting:r,className:i}){const s=n.key===t,a=n.desc,o=s?a?"▼":"▲":h.jsx(h.Fragment,{}),l=c=>{c.preventDefault(),r({key:t,desc:s?!a:!0})};return h.jsxs("th",{onClick:l,className:ie("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,h.jsx("div",{className:"ml-1 min-w-[2ch] inline-block",children:o})]})}function wue({search:e,filters:t}){const n=C.useRef(null),[r,i]=C.useState([]),[s,a]=C.useState(!1),[o,l]=C.useState(!0),[c,d]=C.useState(null),[u,f]=C.useState({key:"tsJoined",desc:!0}),[g,x]=C.useState(!1),_=y1(),v=qt({method:"GET",path:"/player/search",abortOnUnmount:!0}),p=async E=>{l(!0),d(null),E&&x(!0);const k=T=>{d(T),E&&i([])};try{const T={sortingKey:u.key,sortingDesc:u.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][u.key],T.offsetLicense=r[r.length-1].license);const R=await v({queryParams:T});if(R===void 0)return k("Request failed.");if("error"in R)return k(`Request failed: ${R.error}`);d(null),a(R.hasReachedEnd),x(!1),R.players.length?i(M=>E?R.players:[...M,...R.players]):i([])}catch(T){k(`Failed to fetch more data: ${T.message}`)}finally{l(!1),x(!1)}},m=Ck({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=m.getVirtualItems(),b=m.getTotalSize();let S=null,w=null;if(y.length>0){const E=y[0].start-m.options.scrollMargin;E>0&&(S=h.jsx("tr",{children:h.jsx("td",{colSpan:3,style:{height:E}})}));const k=b-y[y.length-1].end;k>0&&(w=h.jsx("tr",{children:h.jsx("td",{colSpan:3,style:{height:k}})}))}return C.useEffect(()=>{if(!r.length||!y.length)return;const E=y[y.length-1].index;r.length<=E&&!s&&!o&&p()},[r,y,s,o]),C.useEffect(()=>{m.scrollToIndex(0),p(!0)},[e,t,u]),h.jsx("div",{className:"w-full max-h-full min-h-96 overflow-auto border md:rounded-lg",style:{overflowAnchor:"none"},children:h.jsx(Ni,{className:"h-full",ref:n,children:h.jsxs("table",{className:"w-full caption-bottom text-sm select-none",children:[h.jsx(kk,{children:h.jsxs("tr",{className:"sticky top-0 z-10 bg-zinc-200 dark:bg-muted text-secondary-foreground text-base shadow-md transition-colors",children:[h.jsx("th",{className:"py-2 px-4 font-light tracking-wider text-left text-muted-foreground",children:"Display Name"}),h.jsx(Wx,{label:"Play Time",sortKey:"playTime",sortingState:u,setSorting:f}),h.jsx(Wx,{label:"First Joined",sortKey:"tsJoined",sortingState:u,setSorting:f}),h.jsx(Wx,{label:"Last Connection",sortKey:"tsLastConnection",sortingState:u,setSorting:f})]})}),h.jsxs(Ek,{className:ie(g&&"opacity-25"),children:[S,y.map(E=>E.index>r.length-1?h.jsx(bue,{playersCount:r.length,hasReachedEnd:s,loadError:c,isFetching:o,retryFetch:p},E.key):h.jsx(xue,{rowData:r[E.index],modalOpener:_},E.key)),w]})]})})})}const Sue=C.memo(Zce),Cue=C.memo(wue),kue=C.memo(RO),Eue=(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)},Tue=()=>{var a;const e=new URLSearchParams(window.location.search),t=J0.map(o=>o.value),n=e.get("searchType"),r=e.get("searchQuery"),i=cI.map(o=>o.value),s=(a=e.get("filters"))==null?void 0:a.split(",").filter(o=>i.includes(o));return{search:r&&n&&t.includes(n)?{type:n,value:r}:{type:J0[0].value,value:""},filters:s??[]}};function Mue(){const[e,t]=C.useState(void 0),[n,r]=C.useState(void 0),i=qt({method:"GET",path:"/player/stats",abortOnUnmount:!0});C.useEffect(()=>{i({success(l,c){t(l)}})},[]);const s=C.useCallback((l,c)=>{r({search:l,filters:c}),Eue(l,c)},[]),a=C.useMemo(Tue,[]),o=C.useMemo(()=>{const l=e&&!("error"in e);return[{label:"Total Players",value:l?e.total:!1,icon:h.jsx(f5,{})},{label:"Players Last 24h",value:l?e.playedLast24h:!1,icon:h.jsx(OQ,{})},{label:"New Players Last 24h",value:l?e.joinedLast24h:!1,icon:h.jsx(H4,{}),prefix:"+"},{label:"New Players Last 7d",value:l?e.joinedLast7d:!1,icon:h.jsx(H4,{}),prefix:"+"}]},[e]);return h.jsxs("div",{className:"flex flex-col min-w-96 w-full",style:{height:"calc(100vh - 3.5rem - 1px - 2rem)"},children:[h.jsx(kue,{callouts:o}),h.jsx(Sue,{doSearch:s,initialState:a}),n?h.jsx(Cue,{search:n.search,filters:n.filters}):null]})}function Tk(e){const t=C.useRef({value:e,previous:e});return C.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Rue="VisuallyHidden",Mk=C.forwardRef((e,t)=>h.jsx(Me.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}}));Mk.displayName=Rue;var fI=Mk,Aue=[" ","Enter","ArrowUp","ArrowDown"],Due=[" ","Enter"],$p="Select",[V1,q1,Lue]=jp($p),[wd,lUe]=Hi($p,[Lue,bd]),Y1=bd(),[jue,Ea]=wd($p),[Pue,Nue]=wd($p),pI=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:s,value:a,defaultValue:o,onValueChange:l,dir:c,name:d,autoComplete:u,disabled:f,required:g,form:x}=e,_=Y1(t),[v,p]=C.useState(null),[m,y]=C.useState(null),[b,S]=C.useState(!1),w=vd(c),[E=!1,k]=gs({prop:r,defaultProp:i,onChange:s}),[T,R]=gs({prop:a,defaultProp:o,onChange:l}),M=C.useRef(null),L=v?x||!!v.closest("form"):!0,[j,P]=C.useState(new Set),$=Array.from(j).map(F=>F.props.value).join(";");return h.jsx(uk,{..._,children:h.jsxs(jue,{required:g,scope:t,trigger:v,onTriggerChange:p,valueNode:m,onValueNodeChange:y,valueNodeHasChildren:b,onValueNodeHasChildrenChange:S,contentId:Ir(),value:T,onValueChange:R,open:E,onOpenChange:k,dir:w,triggerPointerDownPosRef:M,disabled:f,children:[h.jsx(V1.Provider,{scope:t,children:h.jsx(Pue,{scope:e.__scopeSelect,onNativeOptionAdd:C.useCallback(F=>{P(W=>new Set(W).add(F))},[]),onNativeOptionRemove:C.useCallback(F=>{P(W=>{const I=new Set(W);return I.delete(F),I})},[]),children:n})}),L?h.jsxs(FI,{"aria-hidden":!0,required:g,tabIndex:-1,name:d,autoComplete:u,value:T,onChange:F=>R(F.target.value),disabled:f,form:x,children:[T===void 0?h.jsx("option",{value:""}):null,Array.from(j)]},$):null]})})};pI.displayName=$p;var mI="SelectTrigger",gI=C.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,s=Y1(n),a=Ea(mI,n),o=a.disabled||r,l=We(t,a.onTriggerChange),c=q1(n),d=C.useRef("touch"),[u,f,g]=BI(_=>{const v=c().filter(y=>!y.disabled),p=v.find(y=>y.value===a.value),m=zI(v,_,p);m!==void 0&&a.onValueChange(m.value)}),x=_=>{o||(a.onOpenChange(!0),g()),_&&(a.triggerPointerDownPosRef.current={x:Math.round(_.pageX),y:Math.round(_.pageY)})};return h.jsx(dk,{asChild:!0,...s,children:h.jsx(Me.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":$I(a.value)?"":void 0,...i,ref:l,onClick:me(i.onClick,_=>{_.currentTarget.focus(),d.current!=="mouse"&&x(_)}),onPointerDown:me(i.onPointerDown,_=>{d.current=_.pointerType;const v=_.target;v.hasPointerCapture(_.pointerId)&&v.releasePointerCapture(_.pointerId),_.button===0&&_.ctrlKey===!1&&_.pointerType==="mouse"&&(x(_),_.preventDefault())}),onKeyDown:me(i.onKeyDown,_=>{const v=u.current!=="";!(_.ctrlKey||_.altKey||_.metaKey)&&_.key.length===1&&f(_.key),!(v&&_.key===" ")&&Aue.includes(_.key)&&(x(),_.preventDefault())})})})});gI.displayName=mI;var vI="SelectValue",yI=C.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:s,placeholder:a="",...o}=e,l=Ea(vI,n),{onValueNodeHasChildrenChange:c}=l,d=s!==void 0,u=We(t,l.onValueNodeChange);return un(()=>{c(d)},[c,d]),h.jsx(Me.span,{...o,ref:u,style:{pointerEvents:"none"},children:$I(l.value)?h.jsx(h.Fragment,{children:a}):s})});yI.displayName=vI;var Oue="SelectIcon",_I=C.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return h.jsx(Me.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});_I.displayName=Oue;var Iue="SelectPortal",xI=e=>h.jsx($1,{asChild:!0,...e});xI.displayName=Iue;var yl="SelectContent",bI=C.forwardRef((e,t)=>{const n=Ea(yl,e.__scopeSelect),[r,i]=C.useState();if(un(()=>{i(new DocumentFragment)},[]),!n.open){const s=r;return s?vr.createPortal(h.jsx(wI,{scope:e.__scopeSelect,children:h.jsx(V1.Slot,{scope:e.__scopeSelect,children:h.jsx("div",{children:e.children})})}),s):null}return h.jsx(SI,{...e,ref:t})});bI.displayName=yl;var gi=10,[wI,Ta]=wd(yl),$ue="SelectContentImpl",SI=C.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:a,side:o,sideOffset:l,align:c,alignOffset:d,arrowPadding:u,collisionBoundary:f,collisionPadding:g,sticky:x,hideWhenDetached:_,avoidCollisions:v,...p}=e,m=Ea(yl,n),[y,b]=C.useState(null),[S,w]=C.useState(null),E=We(t,q=>b(q)),[k,T]=C.useState(null),[R,M]=C.useState(null),L=q1(n),[j,P]=C.useState(!1),$=C.useRef(!1);C.useEffect(()=>{if(y)return pk(y)},[y]),tk();const F=C.useCallback(q=>{const[B,...O]=L().map(N=>N.ref.current),[z]=O.slice(-1),Y=document.activeElement;for(const N of q)if(N===Y||(N==null||N.scrollIntoView({block:"nearest"}),N===B&&S&&(S.scrollTop=0),N===z&&S&&(S.scrollTop=S.scrollHeight),N==null||N.focus(),document.activeElement!==Y))return},[L,S]),W=C.useCallback(()=>F([k,y]),[F,k,y]);C.useEffect(()=>{j&&W()},[j,W]);const{onOpenChange:I,triggerPointerDownPosRef:A}=m;C.useEffect(()=>{if(y){let q={x:0,y:0};const B=z=>{var Y,N;q={x:Math.abs(Math.round(z.pageX)-(((Y=A.current)==null?void 0:Y.x)??0)),y:Math.abs(Math.round(z.pageY)-(((N=A.current)==null?void 0:N.y)??0))}},O=z=>{q.x<=10&&q.y<=10?z.preventDefault():y.contains(z.target)||I(!1),document.removeEventListener("pointermove",B),A.current=null};return A.current!==null&&(document.addEventListener("pointermove",B),document.addEventListener("pointerup",O,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",B),document.removeEventListener("pointerup",O,{capture:!0})}}},[y,I,A]),C.useEffect(()=>{const q=()=>I(!1);return window.addEventListener("blur",q),window.addEventListener("resize",q),()=>{window.removeEventListener("blur",q),window.removeEventListener("resize",q)}},[I]);const[D,H]=BI(q=>{const B=L().filter(Y=>!Y.disabled),O=B.find(Y=>Y.ref.current===document.activeElement),z=zI(B,q,O);z&&setTimeout(()=>z.ref.current.focus())}),V=C.useCallback((q,B,O)=>{const z=!$.current&&!O;(m.value!==void 0&&m.value===B||z)&&(T(q),z&&($.current=!0))},[m.value]),U=C.useCallback(()=>y==null?void 0:y.focus(),[y]),G=C.useCallback((q,B,O)=>{const z=!$.current&&!O;(m.value!==void 0&&m.value===B||z)&&M(q)},[m.value]),ee=r==="popper"?P2:CI,Z=ee===P2?{side:o,sideOffset:l,align:c,alignOffset:d,arrowPadding:u,collisionBoundary:f,collisionPadding:g,sticky:x,hideWhenDetached:_,avoidCollisions:v}:{};return h.jsx(wI,{scope:n,content:y,viewport:S,onViewportChange:w,itemRefCallback:V,selectedItem:k,onItemLeave:U,itemTextRefCallback:G,focusSelectedItem:W,selectedItemText:R,position:r,isPositioned:j,searchRef:D,children:h.jsx(U1,{as:ua,allowPinchZoom:!0,children:h.jsx(P1,{asChild:!0,trapped:m.open,onMountAutoFocus:q=>{q.preventDefault()},onUnmountAutoFocus:me(i,q=>{var B;(B=m.trigger)==null||B.focus({preventScroll:!0}),q.preventDefault()}),children:h.jsx(yd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:q=>q.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:h.jsx(ee,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:q=>q.preventDefault(),...p,...Z,onPlaced:()=>P(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...p.style},onKeyDown:me(p.onKeyDown,q=>{const B=q.ctrlKey||q.altKey||q.metaKey;if(q.key==="Tab"&&q.preventDefault(),!B&&q.key.length===1&&H(q.key),["ArrowUp","ArrowDown","Home","End"].includes(q.key)){let z=L().filter(Y=>!Y.disabled).map(Y=>Y.ref.current);if(["ArrowUp","End"].includes(q.key)&&(z=z.slice().reverse()),["ArrowUp","ArrowDown"].includes(q.key)){const Y=q.target,N=z.indexOf(Y);z=z.slice(N+1)}setTimeout(()=>F(z)),q.preventDefault()}})})})})})})});SI.displayName=$ue;var Fue="SelectItemAlignedPosition",CI=C.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,s=Ea(yl,n),a=Ta(yl,n),[o,l]=C.useState(null),[c,d]=C.useState(null),u=We(t,E=>d(E)),f=q1(n),g=C.useRef(!1),x=C.useRef(!0),{viewport:_,selectedItem:v,selectedItemText:p,focusSelectedItem:m}=a,y=C.useCallback(()=>{if(s.trigger&&s.valueNode&&o&&c&&_&&v&&p){const E=s.trigger.getBoundingClientRect(),k=c.getBoundingClientRect(),T=s.valueNode.getBoundingClientRect(),R=p.getBoundingClientRect();if(s.dir!=="rtl"){const Y=R.left-k.left,N=T.left-Y,J=E.left-N,K=E.width+J,te=Math.max(K,k.width),oe=window.innerWidth-gi,ae=S2(N,[gi,Math.max(gi,oe-te)]);o.style.minWidth=K+"px",o.style.left=ae+"px"}else{const Y=k.right-R.right,N=window.innerWidth-T.right-Y,J=window.innerWidth-E.right-N,K=E.width+J,te=Math.max(K,k.width),oe=window.innerWidth-gi,ae=S2(N,[gi,Math.max(gi,oe-te)]);o.style.minWidth=K+"px",o.style.right=ae+"px"}const M=f(),L=window.innerHeight-gi*2,j=_.scrollHeight,P=window.getComputedStyle(c),$=parseInt(P.borderTopWidth,10),F=parseInt(P.paddingTop,10),W=parseInt(P.borderBottomWidth,10),I=parseInt(P.paddingBottom,10),A=$+F+j+I+W,D=Math.min(v.offsetHeight*5,A),H=window.getComputedStyle(_),V=parseInt(H.paddingTop,10),U=parseInt(H.paddingBottom,10),G=E.top+E.height/2-gi,ee=L-G,Z=v.offsetHeight/2,q=v.offsetTop+Z,B=$+F+q,O=A-B;if(B<=G){const Y=M.length>0&&v===M[M.length-1].ref.current;o.style.bottom="0px";const N=c.clientHeight-_.offsetTop-_.offsetHeight,J=Math.max(ee,Z+(Y?U:0)+N+W),K=B+J;o.style.height=K+"px"}else{const Y=M.length>0&&v===M[0].ref.current;o.style.top="0px";const J=Math.max(G,$+_.offsetTop+(Y?V:0)+Z)+O;o.style.height=J+"px",_.scrollTop=B-G+_.offsetTop}o.style.margin=`${gi}px 0`,o.style.minHeight=D+"px",o.style.maxHeight=L+"px",r==null||r(),requestAnimationFrame(()=>g.current=!0)}},[f,s.trigger,s.valueNode,o,c,_,v,p,s.dir,r]);un(()=>y(),[y]);const[b,S]=C.useState();un(()=>{c&&S(window.getComputedStyle(c).zIndex)},[c]);const w=C.useCallback(E=>{E&&x.current===!0&&(y(),m==null||m(),x.current=!1)},[y,m]);return h.jsx(zue,{scope:n,contentWrapper:o,shouldExpandOnScrollRef:g,onScrollButtonChange:w,children:h.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:b},children:h.jsx(Me.div,{...i,ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});CI.displayName=Fue;var Bue="SelectPopperPosition",P2=C.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=gi,...s}=e,a=Y1(n);return h.jsx(hk,{...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)"}})});P2.displayName=Bue;var[zue,Rk]=wd(yl,{}),N2="SelectViewport",kI=C.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,s=Ta(N2,n),a=Rk(N2,n),o=We(t,s.onViewportChange),l=C.useRef(0);return h.jsxs(h.Fragment,{children:[h.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}),h.jsx(V1.Slot,{scope:n,children:h.jsx(Me.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:o,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:me(i.onScroll,c=>{const d=c.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:f}=a;if(f!=null&&f.current&&u){const g=Math.abs(l.current-d.scrollTop);if(g>0){const x=window.innerHeight-gi*2,_=parseFloat(u.style.minHeight),v=parseFloat(u.style.height),p=Math.max(_,v);if(p<x){const m=p+g,y=Math.min(x,m),b=m-y;u.style.height=y+"px",u.style.bottom==="0px"&&(d.scrollTop=b>0?b:0,u.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});kI.displayName=N2;var EI="SelectGroup",[Uue,Hue]=wd(EI),Wue=C.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Ir();return h.jsx(Uue,{scope:n,id:i,children:h.jsx(Me.div,{role:"group","aria-labelledby":i,...r,ref:t})})});Wue.displayName=EI;var TI="SelectLabel",MI=C.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Hue(TI,n);return h.jsx(Me.div,{id:i.id,...r,ref:t})});MI.displayName=TI;var Z0="SelectItem",[Vue,RI]=wd(Z0),AI=C.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:s,...a}=e,o=Ea(Z0,n),l=Ta(Z0,n),c=o.value===r,[d,u]=C.useState(s??""),[f,g]=C.useState(!1),x=We(t,m=>{var y;return(y=l.itemRefCallback)==null?void 0:y.call(l,m,r,i)}),_=Ir(),v=C.useRef("touch"),p=()=>{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 h.jsx(Vue,{scope:n,value:r,disabled:i,textId:_,isSelected:c,onItemTextChange:C.useCallback(m=>{u(y=>y||((m==null?void 0:m.textContent)??"").trim())},[]),children:h.jsx(V1.ItemSlot,{scope:n,value:r,disabled:i,textValue:d,children:h.jsx(Me.div,{role:"option","aria-labelledby":_,"data-highlighted":f?"":void 0,"aria-selected":c&&f,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...a,ref:x,onFocus:me(a.onFocus,()=>g(!0)),onBlur:me(a.onBlur,()=>g(!1)),onClick:me(a.onClick,()=>{v.current!=="mouse"&&p()}),onPointerUp:me(a.onPointerUp,()=>{v.current==="mouse"&&p()}),onPointerDown:me(a.onPointerDown,m=>{v.current=m.pointerType}),onPointerMove:me(a.onPointerMove,m=>{var y;v.current=m.pointerType,i?(y=l.onItemLeave)==null||y.call(l):v.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:me(a.onPointerLeave,m=>{var y;m.currentTarget===document.activeElement&&((y=l.onItemLeave)==null||y.call(l))}),onKeyDown:me(a.onKeyDown,m=>{var b;((b=l.searchRef)==null?void 0:b.current)!==""&&m.key===" "||(Due.includes(m.key)&&p(),m.key===" "&&m.preventDefault())})})})})});AI.displayName=Z0;var Uh="SelectItemText",DI=C.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...s}=e,a=Ea(Uh,n),o=Ta(Uh,n),l=RI(Uh,n),c=Nue(Uh,n),[d,u]=C.useState(null),f=We(t,p=>u(p),l.onItemTextChange,p=>{var m;return(m=o.itemTextRefCallback)==null?void 0:m.call(o,p,l.value,l.disabled)}),g=d==null?void 0:d.textContent,x=C.useMemo(()=>h.jsx("option",{value:l.value,disabled:l.disabled,children:g},l.value),[l.disabled,l.value,g]),{onNativeOptionAdd:_,onNativeOptionRemove:v}=c;return un(()=>(_(x),()=>v(x)),[_,v,x]),h.jsxs(h.Fragment,{children:[h.jsx(Me.span,{id:l.textId,...s,ref:f}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?vr.createPortal(s.children,a.valueNode):null]})});DI.displayName=Uh;var LI="SelectItemIndicator",jI=C.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return RI(LI,n).isSelected?h.jsx(Me.span,{"aria-hidden":!0,...r,ref:t}):null});jI.displayName=LI;var O2="SelectScrollUpButton",PI=C.forwardRef((e,t)=>{const n=Ta(O2,e.__scopeSelect),r=Rk(O2,e.__scopeSelect),[i,s]=C.useState(!1),a=We(t,r.onScrollButtonChange);return un(()=>{if(n.viewport&&n.isPositioned){let o=function(){const c=l.scrollTop>0;s(c)};const l=n.viewport;return o(),l.addEventListener("scroll",o),()=>l.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),i?h.jsx(OI,{...e,ref:a,onAutoScroll:()=>{const{viewport:o,selectedItem:l}=n;o&&l&&(o.scrollTop=o.scrollTop-l.offsetHeight)}}):null});PI.displayName=O2;var I2="SelectScrollDownButton",NI=C.forwardRef((e,t)=>{const n=Ta(I2,e.__scopeSelect),r=Rk(I2,e.__scopeSelect),[i,s]=C.useState(!1),a=We(t,r.onScrollButtonChange);return un(()=>{if(n.viewport&&n.isPositioned){let o=function(){const c=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)<c;s(d)};const l=n.viewport;return o(),l.addEventListener("scroll",o),()=>l.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),i?h.jsx(OI,{...e,ref:a,onAutoScroll:()=>{const{viewport:o,selectedItem:l}=n;o&&l&&(o.scrollTop=o.scrollTop+l.offsetHeight)}}):null});NI.displayName=I2;var OI=C.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,s=Ta("SelectScrollButton",n),a=C.useRef(null),o=q1(n),l=C.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return C.useEffect(()=>()=>l(),[l]),un(()=>{var d;const c=o().find(u=>u.ref.current===document.activeElement);(d=c==null?void 0:c.ref.current)==null||d.scrollIntoView({block:"nearest"})},[o]),h.jsx(Me.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:me(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:me(i.onPointerMove,()=>{var c;(c=s.onItemLeave)==null||c.call(s),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:me(i.onPointerLeave,()=>{l()})})}),que="SelectSeparator",II=C.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return h.jsx(Me.div,{"aria-hidden":!0,...r,ref:t})});II.displayName=que;var $2="SelectArrow",Yue=C.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Y1(n),s=Ea($2,n),a=Ta($2,n);return s.open&&a.position==="popper"?h.jsx(fk,{...i,...r,ref:t}):null});Yue.displayName=$2;function $I(e){return e===""||e===void 0}var FI=C.forwardRef((e,t)=>{const{value:n,...r}=e,i=C.useRef(null),s=We(t,i),a=Tk(n);return C.useEffect(()=>{const o=i.current,l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==n&&d){const u=new Event("change",{bubbles:!0});d.call(o,n),o.dispatchEvent(u)}},[a,n]),h.jsx(Mk,{asChild:!0,children:h.jsx("select",{...r,ref:s,defaultValue:n})})});FI.displayName="BubbleSelect";function BI(e){const t=Mt(e),n=C.useRef(""),r=C.useRef(0),i=C.useCallback(a=>{const o=n.current+a;t(o),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(o)},[t]),s=C.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return C.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,s]}function zI(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=Kue(e,Math.max(s,0));i.length===1&&(a=a.filter(c=>c!==n));const l=a.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function Kue(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var UI=pI,K1=gI,Gue=yI,Xue=_I,HI=xI,G1=bI,WI=kI,VI=MI,X1=AI,qI=DI,Que=jI,Q1=PI,J1=NI,YI=II;const $i=UI,Fi=Gue,li=C.forwardRef(({className:e,children:t,...n},r)=>h.jsxs(K1,{ref:r,className:ie("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,h.jsx(Xue,{asChild:!0,children:h.jsx(ud,{className:"h-4 w-4 opacity-50"})})]}));li.displayName=K1.displayName;const KI=C.forwardRef(({className:e,...t},n)=>h.jsx(Q1,{ref:n,className:ie("flex cursor-default items-center justify-center py-1",e),...t,children:h.jsx(cP,{className:"h-4 w-4"})}));KI.displayName=Q1.displayName;const GI=C.forwardRef(({className:e,...t},n)=>h.jsx(J1,{ref:n,className:ie("flex cursor-default items-center justify-center py-1",e),...t,children:h.jsx(ud,{className:"h-4 w-4"})}));GI.displayName=J1.displayName;const ci=C.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>h.jsx(HI,{children:h.jsxs(G1,{ref:i,className:ie("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:[h.jsx(KI,{}),h.jsx(WI,{className:ie("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),h.jsx(GI,{})]})}));ci.displayName=G1.displayName;const Jue=C.forwardRef(({className:e,...t},n)=>h.jsx(VI,{ref:n,className:ie("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Jue.displayName=VI.displayName;const Ue=C.forwardRef(({className:e,children:t,...n},r)=>h.jsxs(X1,{ref:r,className:ie("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:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(Que,{children:h.jsx(d5,{className:"h-4 w-4"})})}),h.jsx(qI,{children:t})]}));Ue.displayName=X1.displayName;const F2=C.forwardRef(({className:e,...t},n)=>h.jsx(YI,{ref:n,className:ie("-mx-1 my-1 h-px bg-muted",e),...t}));F2.displayName=YI.displayName;const ev=[{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."}],Ho="!any",qm=Gn(1250,e=>{e()},{noLeading:!0});function Zue({doSearch:e,initialState:t,adminStats:n}){const{authData:r}=$l(),i=C.useRef(null),[s,a]=C.useState(!1),[o,l]=C.useState(t.search.type),[c,d]=C.useState(!!t.search.value),[u,f]=C.useState(t.filterbyType),[g,x]=C.useState(t.filterbyAdmin),_=()=>{if(!i.current)return;const S=i.current.value.trim();e({value:S,type:o},u!==Ho?u:void 0,g!==Ho?g:void 0)};C.useEffect(()=>{_()},[o,u,g]);const v=S=>{S.key==="Enter"?(qm.cancel({upcomingOnly:!0}),_()):S.key==="Escape"?(i.current.value="",qm(_),d(!1)):(qm(_),d(!0))},p=()=>{i.current.value="",qm.cancel({upcomingOnly:!0}),_(),d(!1)};Pi("keydown",S=>{var w;S.code==="KeyF"&&(S.ctrlKey||S.metaKey)&&((w=i.current)==null||w.focus(),S.preventDefault())});const m=ev.find(S=>S.value===o);if(!m)throw new Error(`Invalid search type: ${o}`);if(!r)throw new Error("authData is not available");const y=C.useMemo(()=>n.filter(S=>S.name!==r.name),[n,r.name]),b=C.useMemo(()=>{var S;return((S=n.find(w=>w.name===r.name))==null?void 0:S.actions)||0},[n,r.name]);return h.jsxs("div",{className:"p-4 mb-2 md:mb-4 md:rounded-xl border border-border bg-card text-card-foreground shadow-sm",children:[h.jsxs("div",{className:"flex flex-wrap-reverse gap-2",children:[h.jsxs("div",{className:"relative min-w-44 grow",children:[h.jsx(ln,{type:"text",autoFocus:!0,autoCapitalize:"off",autoCorrect:"off",ref:i,placeholder:m.placeholder,defaultValue:t.search.value,onKeyDown:v}),c?h.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:p,children:h.jsx(bs,{})}):h.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:h.jsx(Mn,{className:"text-xs tracking-wide",children:"ctrl+f"})})]}),h.jsxs("div",{className:"grow flex content-start gap-2 flex-wrap",children:[h.jsxs(Zc,{children:[h.jsx(eu,{asChild:!0,children:h.jsxs(Ke,{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 ",m.label,h.jsx(t2,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),h.jsxs(rl,{className:"w-48",children:[h.jsx(Q0,{children:"Search Type"}),h.jsx(tu,{}),h.jsx(aI,{value:o,onValueChange:l,children:ev.map(S=>h.jsx(Sk,{value:S.value,className:"cursor-pointer",children:S.label},S.value))})]})]}),h.jsxs($i,{defaultValue:u,onValueChange:f,children:[h.jsx(li,{className:"w-36 grow md:grow-0",children:h.jsx(Fi,{placeholder:"Filter by admin"})}),h.jsxs(ci,{className:"px-0",children:[h.jsx(Ue,{value:Ho,className:"cursor-pointer",children:"Any type"}),h.jsx(F2,{}),h.jsx(Ue,{value:"ban",className:"cursor-pointer",children:"Bans"}),h.jsx(Ue,{value:"warn",className:"cursor-pointer",children:"Warns"})]})]}),h.jsxs($i,{defaultValue:g,onValueChange:x,children:[h.jsx(li,{className:"w-36 grow md:grow-0",children:h.jsx(Fi,{placeholder:"Filter by admin"})}),h.jsxs(ci,{className:"px-0",children:[h.jsx(Ue,{value:Ho,className:"cursor-pointer",children:"By any admin"}),h.jsxs(Ue,{value:r.name,className:"cursor-pointer",children:[r.name," ",h.jsxs("span",{className:"opacity-50",children:["(",b,")"]})]}),h.jsx(F2,{}),y.map(S=>h.jsxs(Ue,{className:"cursor-pointer",value:S.name,children:[S.name," ",h.jsxs("span",{className:"opacity-50",children:["(",S.actions,")"]})]},S.name))]})]}),h.jsx("div",{className:"flex justify-end flex-grow",children:h.jsxs(Zc,{children:[h.jsx(eu,{asChild:!0,children:h.jsxs(Ke,{variant:"outline",className:"grow md:grow-0",children:["More",h.jsx(ud,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),h.jsxs(rl,{children:[h.jsx(ls,{className:"h-10 pl-1 pr-2 py-2",asChild:!0,children:h.jsxs(ca,{href:"/system/master-actions#cleandb",className:"cursor-pointer",children:[h.jsx(da,{className:"inline mr-1 h-4"}),"Bulk Remove"]})}),h.jsx(ls,{className:"h-10 pl-1 pr-2 py-2",asChild:!0,children:h.jsxs(ca,{href:"/settings/ban-templates",className:"cursor-pointer",children:[h.jsx(da,{className:"inline mr-1 h-4"}),"Ban Templates"]})})]})]})})]})]}),h.jsx("div",{className:"text-xs text-muted-foreground mt-1 px-1",children:m.description})]})}function ede({action:e,modalOpener:t}){const n=()=>{t(e.id)};let r,i;if(e.type==="warn")r=h.jsx("div",{className:"flex items-center px-1 bg-warning-hint text-warning",children:h.jsx(M0,{className:"size-5"})}),i=h.jsx("span",{className:"tracking-wider text-warning",children:e.id});else if(e.type==="ban")r=h.jsx("div",{className:"flex items-center px-1 bg-destructive-hint text-destructive",children:h.jsx(E0,{className:"size-5"})}),i=h.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=h.jsx(yP,{className:"size-4"}):e.banExpiration?e.banExpiration==="permanent"?s=h.jsx(PJ,{className:"size-4"}):e.banExpiration==="active"&&(s=h.jsx(vP,{className:"size-4"})):e.type==="warn"&&!e.warnAcked&&(s=h.jsx(hP,{className:"size-4"})),h.jsxs(Ip,{onClick:n,className:"cursor-pointer",children:[h.jsx(Jr,{className:ie("w-[10.4rem] border-r p-0",e.isRevoked&&"opacity-40"),children:h.jsxs("div",{className:"flex justify-start gap-2",children:[r,h.jsx("div",{className:"p-2 font-mono",children:i}),h.jsx("div",{className:"flex-grow flex justify-end items-center my-auto pr-2 text-muted-foreground",children:s})]})}),h.jsx(Jr,{className:"px-4 py-2 border-r",children:h.jsx("span",{className:"text-ellipsis overflow-hidden line-clamp-1 break-all",children:e.playerName?e.playerName:h.jsx("span",{className:"text-muted-foreground italic",children:"unknown"})})}),h.jsx(Jr,{className:"px-4 py-2 border-r",children:h.jsx("span",{className:"text-ellipsis overflow-hidden line-clamp-1 break-all",children:e.reason})}),h.jsx(Jr,{className:"px-4 py-2 border-r",children:h.jsx("span",{className:"text-ellipsis overflow-hidden line-clamp-1 break-all",children:e.author})}),h.jsx(Jr,{className:"min-w-[10rem] px-4 py-2",children:h.jsx("span",{className:"text-ellipsis overflow-hidden line-clamp-1 break-all",children:w2(e.timestamp)})})]})}function tde({playersCount:e,hasReachedEnd:t,isFetching:n,loadError:r,retryFetch:i}){let s;return n?s=h.jsx(cn,{className:"mx-auto animate-spin"}):r?s=h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:"text-destructive-inline",children:["Error: ",r]}),h.jsx("br",{}),h.jsx("button",{className:"underline",onClick:()=>i(),children:"Try again?"})]}):t?s=h.jsx("span",{className:"font-bold text-muted-foreground",children:e?"You have reached the end of the list.":"No actions found."}):s=h.jsxs("span",{children:["You've found the end of the rainbow, but there's no pot of gold here. ",h.jsx("br",{}),h.jsxs("i",{children:["(this is a bug, please report it in ",h.jsx(ju,{href:"https://discord.gg/txAdmin",target:"_blank",rel:"noopener noreferrer",children:"discord.gg/txAdmin"}),")"]})]}),h.jsx(Ip,{children:h.jsx(Jr,{colSpan:5,className:"px-4 py-2 text-center",children:s})})}function nde({label:e,sortKey:t,sortingState:n,setSorting:r,className:i}){const s=n.key===t,a=n.desc,o=s?a?"▼":"▲":h.jsx(h.Fragment,{}),l=c=>{c.preventDefault(),r({key:t,desc:s?!a:!0})};return h.jsxs("th",{onClick:l,className:ie("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,h.jsx("div",{className:"ml-1 min-w-[2ch] inline-block",children:o})]})}function Ym({label:e,className:t}){return h.jsx("th",{className:ie("py-2 px-4 font-light tracking-wider text-left text-muted-foreground",t),children:e})}function rde({search:e,filterbyType:t,filterbyAdmin:n}){const r=C.useRef(null),[i,s]=C.useState([]),[a,o]=C.useState(!1),[l,c]=C.useState(!1),[d,u]=C.useState(null),[f,g]=C.useState({key:"timestamp",desc:!0}),[x,_]=C.useState(!1),v=P5(),p=qt({method:"GET",path:"/history/search",abortOnUnmount:!0}),m=async k=>{c(!0),u(null),k&&_(!0);const T=R=>{u(R),k&&s([])};try{const R={sortingKey:f.key,sortingDesc:f.desc};e.value&&(R.searchValue=e.value,R.searchType=e.type),t&&t!==Ho&&(R.filterbyType=t),n&&n!==Ho&&(R.filterbyAdmin=n),!k&&i.length&&(R.offsetParam=i[i.length-1][f.key],R.offsetActionId=i[i.length-1].id);const M=await p({queryParams:R});if(M===void 0)return T("Request failed.");if("error"in M)return T(`Request failed: ${M.error}`);u(null),o(M.hasReachedEnd),_(!1),M.history.length?s(L=>k?M.history:[...L,...M.history]):s([])}catch(R){T(`Failed to fetch more data: ${R.message}`)}finally{c(!1),_(!1)}},y=Ck({isScrollingResetDelay:0,count:i.length+1,getScrollElement:()=>{var k;return(k=r.current)==null?void 0:k.getElementsByTagName("div")[0]},estimateSize:()=>38,overscan:25}),b=y.getVirtualItems(),S=y.getTotalSize();let w=null,E=null;if(b.length>0){const k=b[0].start-y.options.scrollMargin;k>0&&(w=h.jsx("tr",{children:h.jsx("td",{colSpan:3,style:{height:k}})}));const T=S-b[b.length-1].end;T>0&&(E=h.jsx("tr",{children:h.jsx("td",{colSpan:3,style:{height:T}})}))}return C.useEffect(()=>{if(!i.length||!b.length)return;const k=b[b.length-1].index;i.length<=k&&!a&&!l&&m()},[i,b,a,l]),C.useEffect(()=>{y.scrollToIndex(0),m(!0)},[e,t,n,f]),h.jsx("div",{className:"w-full max-h-full min-h-96 overflow-auto border md:rounded-lg",style:{overflowAnchor:"none"},children:h.jsx(Ni,{className:"h-full",ref:r,children:h.jsxs("table",{className:"w-full caption-bottom text-sm select-none",children:[h.jsx(kk,{children:h.jsxs("tr",{className:"sticky top-0 z-10 bg-zinc-200 dark:bg-muted text-secondary-foreground text-base shadow-md transition-colors",children:[h.jsx(Ym,{label:"Action"}),h.jsx(Ym,{label:"Player"}),h.jsx(Ym,{label:"Reason"}),h.jsx(Ym,{label:"Author"}),h.jsx(nde,{label:"Date Time",sortKey:"timestamp",sortingState:f,setSorting:g})]})}),h.jsxs(Ek,{className:ie(x&&"opacity-25"),children:[w,b.map(k=>k.index>i.length-1?h.jsx(tde,{playersCount:i.length,hasReachedEnd:a,loadError:d,isFetching:l,retryFetch:m},k.key):h.jsx(ede,{action:i[k.index],modalOpener:v},k.key)),E]})]})})})}const ide=C.memo(Zue),sde=C.memo(rde),ode=C.memo(RO),ade=(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)},lde=()=>{const e=new URLSearchParams(window.location.search),t=ev.map(i=>i.value),n=e.get("searchType"),r=e.get("searchQuery");return{search:r&&n&&t.includes(n)?{type:n,value:r}:{type:ev[0].value,value:""},filterbyType:e.get("filterbyType")??Ho,filterbyAdmin:e.get("filterbyAdmin")??Ho}};function cde(){const[e,t]=C.useState(void 0),[n,r]=C.useState(void 0),i=qt({method:"GET",path:"/history/stats",abortOnUnmount:!0});C.useEffect(()=>{i({success(l,c){t(l)}})},[]);const s=C.useCallback((l,c,d)=>{r({search:l,filterbyType:c,filterbyAdmin:d}),ade(l,c,d)},[]),a=C.useMemo(lde,[]),o=C.useMemo(()=>{const l=e&&!("error"in e);return[{label:"Total Warns",value:l?e.totalWarns:!1,icon:h.jsx(M0,{})},{label:"New Warns Last 7d",value:l?e.warnsLast7d:!1,icon:h.jsx(M0,{}),prefix:"+"},{label:"Total Bans",value:l?e.totalBans:!1,icon:h.jsx(E0,{})},{label:"New Bans Last 7d",value:l?e.bansLast7d:!1,icon:h.jsx(E0,{}),prefix:"+"}]},[e]);return h.jsxs("div",{className:"flex flex-col min-w-96 w-full",style:{height:"calc(100vh - 3.5rem - 1px - 2rem)"},children:[h.jsx(ode,{callouts:o}),e&&!("error"in e)?h.jsx(ide,{doSearch:s,initialState:a,adminStats:e.groupedByAdmins}):null,n?h.jsx(sde,{search:n.search,filterbyType:n.filterbyType,filterbyAdmin:n.filterbyAdmin}):null]})}var Ak="Dialog",[XI,QI]=Hi(Ak),[ude,Wi]=XI(Ak),JI=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,o=C.useRef(null),l=C.useRef(null),[c=!1,d]=gs({prop:r,defaultProp:i,onChange:s});return h.jsx(ude,{scope:t,triggerRef:o,contentRef:l,contentId:Ir(),titleId:Ir(),descriptionId:Ir(),open:c,onOpenChange:d,onOpenToggle:C.useCallback(()=>d(u=>!u),[d]),modal:a,children:n})};JI.displayName=Ak;var ZI="DialogTrigger",e$=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wi(ZI,n),s=We(t,i.triggerRef);return h.jsx(Me.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":jk(i.open),...r,ref:s,onClick:me(e.onClick,i.onOpenToggle)})});e$.displayName=ZI;var Dk="DialogPortal",[dde,t$]=XI(Dk,{forceMount:void 0}),n$=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,s=Wi(Dk,t);return h.jsx(dde,{scope:t,forceMount:n,children:C.Children.map(r,a=>h.jsx(wn,{present:n||s.open,children:h.jsx($1,{asChild:!0,container:i,children:a})}))})};n$.displayName=Dk;var tv="DialogOverlay",r$=C.forwardRef((e,t)=>{const n=t$(tv,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=Wi(tv,e.__scopeDialog);return s.modal?h.jsx(wn,{present:r||s.open,children:h.jsx(hde,{...i,ref:t})}):null});r$.displayName=tv;var hde=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wi(tv,n);return h.jsx(U1,{as:ua,allowPinchZoom:!0,shards:[i.contentRef],children:h.jsx(Me.div,{"data-state":jk(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),_l="DialogContent",i$=C.forwardRef((e,t)=>{const n=t$(_l,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=Wi(_l,e.__scopeDialog);return h.jsx(wn,{present:r||s.open,children:s.modal?h.jsx(fde,{...i,ref:t}):h.jsx(pde,{...i,ref:t})})});i$.displayName=_l;var fde=C.forwardRef((e,t)=>{const n=Wi(_l,e.__scopeDialog),r=C.useRef(null),i=We(t,n.contentRef,r);return C.useEffect(()=>{const s=r.current;if(s)return pk(s)},[]),h.jsx(s$,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:me(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:me(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,o=a.button===0&&a.ctrlKey===!0;(a.button===2||o)&&s.preventDefault()}),onFocusOutside:me(e.onFocusOutside,s=>s.preventDefault())})}),pde=C.forwardRef((e,t)=>{const n=Wi(_l,e.__scopeDialog),r=C.useRef(!1),i=C.useRef(!1);return h.jsx(s$,{...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,c;(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;((c=n.triggerRef.current)==null?void 0:c.contains(a))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),s$=C.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...a}=e,o=Wi(_l,n),l=C.useRef(null),c=We(t,l);return tk(),h.jsxs(h.Fragment,{children:[h.jsx(P1,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:h.jsx(yd,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":jk(o.open),...a,ref:c,onDismiss:()=>o.onOpenChange(!1)})}),h.jsxs(h.Fragment,{children:[h.jsx(gde,{titleId:o.titleId}),h.jsx(yde,{contentRef:l,descriptionId:o.descriptionId})]})]})}),Lk="DialogTitle",o$=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wi(Lk,n);return h.jsx(Me.h2,{id:i.titleId,...r,ref:t})});o$.displayName=Lk;var a$="DialogDescription",l$=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wi(a$,n);return h.jsx(Me.p,{id:i.descriptionId,...r,ref:t})});l$.displayName=a$;var c$="DialogClose",u$=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wi(c$,n);return h.jsx(Me.button,{type:"button",...r,ref:t,onClick:me(e.onClick,()=>i.onOpenChange(!1))})});u$.displayName=c$;function jk(e){return e?"open":"closed"}var d$="DialogTitleWarning",[mde,h$]=Cse(d$,{contentName:_l,titleName:Lk,docsSlug:"dialog"}),gde=({titleId:e})=>{const t=h$(d$),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 C.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},vde="DialogDescriptionWarning",yde=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${h$(vde).contentName}}.`;return C.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},Pk=JI,_de=e$,Nk=n$,Fp=r$,Bp=i$,zp=o$,Up=l$,Z1=u$;const Hp=Pk,xde=Nk,f$=C.forwardRef(({className:e,...t},n)=>h.jsx(Fp,{ref:n,className:ie("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}));f$.displayName=Fp.displayName;const Sd=C.forwardRef(({className:e,children:t,...n},r)=>h.jsxs(xde,{children:[h.jsx(f$,{}),h.jsxs(Bp,{ref:r,className:ie("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,h.jsxs(Z1,{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:[h.jsx(bs,{className:"h-6 w-6"}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Sd.displayName=Bp.displayName;const Cd=({className:e,...t})=>h.jsx("div",{className:ie("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Cd.displayName="DialogHeader";const ey=({className:e,...t})=>h.jsx("div",{className:ie("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});ey.displayName="DialogFooter";const kd=C.forwardRef(({className:e,...t},n)=>h.jsx(zp,{ref:n,className:ie("text-lg font-semibold leading-none tracking-tight",e),...t}));kd.displayName=zp.displayName;const p$=C.forwardRef(({className:e,...t},n)=>h.jsx(Up,{ref:n,className:ie("text-sm text-muted-foreground",e),...t}));p$.displayName=Up.displayName;const bde=({textAreaRef:e,triggerAutoSize:t,maxHeight:n=Number.MAX_SAFE_INTEGER,minHeight:r=0})=>{const[i,s]=C.useState(!0);C.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])},m$=C.forwardRef(({maxHeight:e=Number.MAX_SAFE_INTEGER,minHeight:t=52,className:n,onChange:r,value:i,...s},a)=>{const o=C.useRef(null),[l,c]=C.useState("");return bde({textAreaRef:o.current,triggerAutoSize:l,maxHeight:e,minHeight:t}),C.useImperativeHandle(a,()=>({textArea:o.current,maxHeight:e,minHeight:t})),C.useEffect(()=>{(i||s!=null&&s.defaultValue)&&c(i)},[i,s==null?void 0:s.defaultValue]),h.jsx("textarea",{...s,value:i,ref:o,className:ie("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",n),onChange:d=>{c(d.target.value),r==null||r(d)}})});m$.displayName="AutosizeTextarea";const wde=["2 hours","8 hours","1 days","2 days","1 weeks","2 weeks","permanent"];function Sde({reasonData:e,onSave:t,isDialogOpen:n,setIsDialogOpen:r}){let i="",s="2 days",a,o="days";e&&(i=e.reason,wde.includes(F0(e.duration))||e.duration==="permanent"?s=F0(e.duration):(s="custom",a=e.duration.value,o=e.duration.unit));const l=C.useRef(null),c=C.useRef(null),[d,u]=C.useState(s),[f,g]=C.useState(o);C.useEffect(()=>{const _=setTimeout(()=>{n||(u(s),g(o),l.current&&(l.current.textArea.value=""),c.current&&(c.current.value=""))},500);return()=>clearTimeout(_)},[n]);const x=_=>{_.preventDefault();const v=_.currentTarget,p=(e==null?void 0:e.id)||null,m=v.reason.value.trim();if(v.reason.value=m,m.length<3)return v.reason.focus(),sn.warning("Reason must be at least 3 characters long");let y;if(d==="permanent")y="permanent";else if(d==="custom"){if(v.durationMultiplier.value<=0)return v.durationMultiplier.focus(),sn.warning("Custom duration must be a positive number");y={value:parseInt(v.durationMultiplier.value),unit:f}}else{const[b,S]=d.split(" ");y={value:parseInt(b),unit:S}}t({id:p,reason:m,duration:y})};return h.jsx(Hp,{open:n,onOpenChange:r,children:h.jsx(Sd,{className:"md:max-w-xl",children:h.jsx("form",{onSubmit:x,children:h.jsxs("div",{className:"space-y-4",children:[h.jsx(Cd,{children:h.jsxs(kd,{children:[e?"Edit":"Add"," Template"]})}),h.jsxs("div",{className:"grid grid-cols-6 items-center gap-4",children:[h.jsx(sr,{htmlFor:"banReason",className:"col-span-6 sm:col-auto",children:"Reason"}),h.jsx(m$,{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:_=>{const v=_.target;v.value.includes(`
`)&&(v.value=v.value.replace(/\s*\r*\n+\s*/g," "))}})]}),h.jsxs("div",{className:"grid grid-cols-6 items-center gap-4",children:[h.jsx(sr,{htmlFor:"durationSelect",className:"col-span-6 sm:col-auto",children:"Duration"}),h.jsxs("div",{className:"col-span-full sm:col-span-5 space-y-1",children:[h.jsxs($i,{onValueChange:u,defaultValue:d,children:[h.jsx(li,{id:"durationSelect",className:"tracking-wide",children:h.jsx(Fi,{placeholder:"Select Duration"})}),h.jsxs(ci,{className:"tracking-wide",children:[h.jsx(Ue,{value:"custom",className:"font-bold",children:"Custom (set below)"}),h.jsx(Ue,{value:"2 hours",children:"2 HOURS"}),h.jsx(Ue,{value:"8 hours",children:"8 HOURS"}),h.jsx(Ue,{value:"1 days",children:"1 DAY"}),h.jsx(Ue,{value:"2 days",children:"2 DAYS"}),h.jsx(Ue,{value:"1 weeks",children:"1 WEEK"}),h.jsx(Ue,{value:"2 weeks",children:"2 WEEKS"}),h.jsx(Ue,{value:"permanent",className:"font-bold",children:"Permanent"})]})]}),h.jsxs("div",{className:"flex flex-row gap-2",children:[h.jsx(ln,{id:"durationMultiplier",type:"number",placeholder:"123",defaultValue:a,disabled:d!=="custom",ref:c,min:1,max:99,required:!0}),h.jsxs($i,{onValueChange:g,defaultValue:f,children:[h.jsx(li,{id:"durationUnits",className:"tracking-wide",disabled:d!=="custom",children:h.jsx(Fi,{})}),h.jsxs(ci,{className:"tracking-wide",children:[h.jsx(Ue,{value:"hours",children:"HOURS"}),h.jsx(Ue,{value:"days",children:"DAYS"}),h.jsx(Ue,{value:"weeks",children:"WEEKS"}),h.jsx(Ue,{value:"months",children:"MONTHS"})]})]})]})]})]}),h.jsx(ey,{children:h.jsx(Ke,{type:"submit",children:"Save changes"})})]})})})})}function Cde({id:e,reason:t,duration:n,onEdit:r,onRemove:i,disabled:s}){return h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"grow sm:flex items-center justify-items-start gap-2",children:[h.jsx("span",{className:"line-clamp-5 md:line-clamp-3",children:t}),h.jsx("div",{className:ie("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:F0(n)})]}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx("button",{className:ie("text-muted-foreground",s?"opacity-50 cursor-not-allowed":"hover:text-primary hover:scale-110"),onClick:()=>r(e),disabled:s,children:h.jsx(kJ,{className:"size-6"})}),h.jsx("button",{className:ie("text-muted-foreground",s?"opacity-50 cursor-not-allowed":"hover:text-destructive hover:scale-110"),onClick:()=>i(e),disabled:s,children:h.jsx(bs,{className:"size-6"})})]})]})}function kde({onClick:e,disabled:t}){return h.jsxs("li",{onClick:e,className:ie("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:[h.jsx(fP,{className:"size-6"}),h.jsx("span",{children:"Add New Reason"})]})}function Ede(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return C.useMemo(()=>r=>{t.forEach(i=>i(r))},t)}const ty=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ed(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Ok(e){return"nodeType"in e}function kr(e){var t,n;return e?Ed(e)?e:Ok(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Ik(e){const{Document:t}=kr(e);return e instanceof t}function Wp(e){return Ed(e)?!1:e instanceof kr(e).HTMLElement}function g$(e){return e instanceof kr(e).SVGElement}function Td(e){return e?Ed(e)?e.document:Ok(e)?Ik(e)?e:Wp(e)||g$(e)?e.ownerDocument:document:document:document}const Bi=ty?C.useLayoutEffect:C.useEffect;function $k(e){const t=C.useRef(e);return Bi(()=>{t.current=e}),C.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 Tde(){const e=C.useRef(null),t=C.useCallback((r,i)=>{e.current=setInterval(r,i)},[]),n=C.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function qf(e,t){t===void 0&&(t=[e]);const n=C.useRef(e);return Bi(()=>{n.current!==e&&(n.current=e)},t),n}function Vp(e,t){const n=C.useRef();return C.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function nv(e){const t=$k(e),n=C.useRef(null),r=C.useCallback(i=>{i!==n.current&&(t==null||t(i,n.current)),n.current=i},[]);return[n,r]}function B2(e){const t=C.useRef();return C.useEffect(()=>{t.current=e},[e]),t.current}let Vx={};function qp(e,t){return C.useMemo(()=>{if(t)return t;const n=Vx[e]==null?0:Vx[e]+1;return Vx[e]=n,e+"-"+n},[e,t])}function v$(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,c]of o){const d=s[l];d!=null&&(s[l]=d+e*c)}return s},{...t})}}const nu=v$(1),Yf=v$(-1);function Mde(e){return"clientX"in e&&"clientY"in e}function Fk(e){if(!e)return!1;const{KeyboardEvent:t}=kr(e.target);return t&&e instanceof t}function Rde(e){if(!e)return!1;const{TouchEvent:t}=kr(e.target);return t&&e instanceof t}function z2(e){if(Rde(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 Mde(e)?{x:e.clientX,y:e.clientY}:null}const Kf=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[Kf.Translate.toString(e),Kf.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),yR="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Ade(e){return e.matches(yR)?e:e.querySelector(yR)}const Dde={display:"none"};function Lde(e){let{id:t,value:n}=e;return rt.createElement("div",{id:t,style:Dde},n)}function jde(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const i={position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return rt.createElement("div",{id:t,style:i,role:"status","aria-live":r,"aria-atomic":!0},n)}function Pde(){const[e,t]=C.useState("");return{announce:C.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const y$=C.createContext(null);function Nde(e){const t=C.useContext(y$);C.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Ode(){const[e]=C.useState(()=>new Set),t=C.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[C.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 Ide={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.
  `},$de={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 Fde(e){let{announcements:t=$de,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=Ide}=e;const{announce:s,announcement:a}=Pde(),o=qp("DndLiveRegion"),[l,c]=C.useState(!1);if(C.useEffect(()=>{c(!0)},[]),Nde(C.useMemo(()=>({onDragStart(u){let{active:f}=u;s(t.onDragStart({active:f}))},onDragMove(u){let{active:f,over:g}=u;t.onDragMove&&s(t.onDragMove({active:f,over:g}))},onDragOver(u){let{active:f,over:g}=u;s(t.onDragOver({active:f,over:g}))},onDragEnd(u){let{active:f,over:g}=u;s(t.onDragEnd({active:f,over:g}))},onDragCancel(u){let{active:f,over:g}=u;s(t.onDragCancel({active:f,over:g}))}}),[s,t])),!l)return null;const d=rt.createElement(rt.Fragment,null,rt.createElement(Lde,{id:r,value:i.draggable}),rt.createElement(jde,{id:o,announcement:a}));return n?vr.createPortal(d,n):d}var vn;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(vn||(vn={}));function rv(){}function _R(e,t){return C.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Bde(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return C.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const zi=Object.freeze({x:0,y:0});function _$(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function x$(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function zde(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function xR(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 b$(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function bR(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 Ude=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=bR(t,t.left,t.top),s=[];for(const a of r){const{id:o}=a,l=n.get(o);if(l){const c=_$(bR(l),i);s.push({id:o,data:{droppableContainer:a,value:c}})}}return s.sort(x$)},Hde=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=xR(t),s=[];for(const a of r){const{id:o}=a,l=n.get(o);if(l){const c=xR(l),d=i.reduce((f,g,x)=>f+_$(c[x],g),0),u=Number((d/4).toFixed(4));s.push({id:o,data:{droppableContainer:a,value:u}})}}return s.sort(x$)};function Wde(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,c=e.width*e.height,d=a*o,u=d/(l+c-d);return Number(u.toFixed(4))}return 0}const Vde=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=Wde(o,t);l>0&&i.push({id:a,data:{droppableContainer:s,value:l}})}}return i.sort(zde)};function qde(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function w$(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:zi}function Yde(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 Kde=Yde(1);function Gde(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 Xde(e,t,n){const r=Gde(t);if(!r)return e;const{scaleX:i,scaleY:s,x:a,y:o}=r,l=e.left-a-(1-i)*parseFloat(n),c=e.top-o-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),d=i?e.width/i:e.width,u=s?e.height/s:e.height;return{width:d,height:u,top:c,right:l+d,bottom:c+u,left:l}}const Qde={ignoreTransform:!1};function Md(e,t){t===void 0&&(t=Qde);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:d}=kr(e).getComputedStyle(e);c&&(n=Xde(n,c,d))}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 wR(e){return Md(e,{ignoreTransform:!0})}function Jde(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Zde(e,t){return t===void 0&&(t=kr(e).getComputedStyle(e)),t.position==="fixed"}function ehe(e,t){t===void 0&&(t=kr(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 ny(e,t){const n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(Ik(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!Wp(i)||g$(i)||n.includes(i))return n;const s=kr(e).getComputedStyle(i);return i!==e&&ehe(i,s)&&n.push(i),Zde(i,s)?n:r(i.parentNode)}return e?r(e):n}function S$(e){const[t]=ny(e,1);return t??null}function qx(e){return!ty||!e?null:Ed(e)?e:Ok(e)?Ik(e)||e===Td(e).scrollingElement?window:Wp(e)?e:null:null}function C$(e){return Ed(e)?e.scrollX:e.scrollLeft}function k$(e){return Ed(e)?e.scrollY:e.scrollTop}function U2(e){return{x:C$(e),y:k$(e)}}var Tn;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Tn||(Tn={}));function E$(e){return!ty||!e?!1:e===document.scrollingElement}function T$(e){const t={x:0,y:0},n=E$(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 the={x:.2,y:.2};function nhe(e,t,n,r,i){let{top:s,left:a,right:o,bottom:l}=n;r===void 0&&(r=10),i===void 0&&(i=the);const{isTop:c,isBottom:d,isLeft:u,isRight:f}=T$(e),g={x:0,y:0},x={x:0,y:0},_={height:t.height*i.y,width:t.width*i.x};return!c&&s<=t.top+_.height?(g.y=Tn.Backward,x.y=r*Math.abs((t.top+_.height-s)/_.height)):!d&&l>=t.bottom-_.height&&(g.y=Tn.Forward,x.y=r*Math.abs((t.bottom-_.height-l)/_.height)),!f&&o>=t.right-_.width?(g.x=Tn.Forward,x.x=r*Math.abs((t.right-_.width-o)/_.width)):!u&&a<=t.left+_.width&&(g.x=Tn.Backward,x.x=r*Math.abs((t.left+_.width-a)/_.width)),{direction:g,speed:x}}function rhe(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 M$(e){return e.reduce((t,n)=>nu(t,U2(n)),zi)}function ihe(e){return e.reduce((t,n)=>t+C$(n),0)}function she(e){return e.reduce((t,n)=>t+k$(n),0)}function ohe(e,t){if(t===void 0&&(t=Md),!e)return;const{top:n,left:r,bottom:i,right:s}=t(e);S$(e)&&(i<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const ahe=[["x",["left","right"],ihe],["y",["top","bottom"],she]];class Bk{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=ny(n),i=M$(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,a,o]of ahe)for(const l of a)Object.defineProperty(this,l,{get:()=>{const c=o(r),d=i[s]-c;return this.rect[l]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class uf{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 lhe(e){const{EventTarget:t}=kr(e);return e instanceof t?e:Td(e)}function Yx(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 Vr;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Vr||(Vr={}));function SR(e){e.preventDefault()}function che(e){e.stopPropagation()}var ct;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"})(ct||(ct={}));const R$={start:[ct.Space,ct.Enter],cancel:[ct.Esc],end:[ct.Space,ct.Enter]},uhe=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case ct.Right:return{...n,x:n.x+25};case ct.Left:return{...n,x:n.x-25};case ct.Down:return{...n,y:n.y+25};case ct.Up:return{...n,y:n.y-25}}};class zk{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 uf(Td(n)),this.windowListeners=new uf(kr(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Vr.Resize,this.handleCancel),this.windowListeners.add(Vr.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Vr.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&ohe(r),n(zi)}handleKeyDown(t){if(Fk(t)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:s=R$,coordinateGetter:a=uhe,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:c}=r.current,d=c?{x:c.left,y:c.top}:zi;this.referenceCoordinates||(this.referenceCoordinates=d);const u=a(t,{active:n,context:r.current,currentCoordinates:d});if(u){const f=Yf(u,d),g={x:0,y:0},{scrollableAncestors:x}=r.current;for(const _ of x){const v=t.code,{isTop:p,isRight:m,isLeft:y,isBottom:b,maxScroll:S,minScroll:w}=T$(_),E=rhe(_),k={x:Math.min(v===ct.Right?E.right-E.width/2:E.right,Math.max(v===ct.Right?E.left:E.left+E.width/2,u.x)),y:Math.min(v===ct.Down?E.bottom-E.height/2:E.bottom,Math.max(v===ct.Down?E.top:E.top+E.height/2,u.y))},T=v===ct.Right&&!m||v===ct.Left&&!y,R=v===ct.Down&&!b||v===ct.Up&&!p;if(T&&k.x!==u.x){const M=_.scrollLeft+f.x,L=v===ct.Right&&M<=S.x||v===ct.Left&&M>=w.x;if(L&&!f.y){_.scrollTo({left:M,behavior:o});return}L?g.x=_.scrollLeft-M:g.x=v===ct.Right?_.scrollLeft-S.x:_.scrollLeft-w.x,g.x&&_.scrollBy({left:-g.x,behavior:o});break}else if(R&&k.y!==u.y){const M=_.scrollTop+f.y,L=v===ct.Down&&M<=S.y||v===ct.Up&&M>=w.y;if(L&&!f.x){_.scrollTo({top:M,behavior:o});return}L?g.y=_.scrollTop-M:g.y=v===ct.Down?_.scrollTop-S.y:_.scrollTop-w.y,g.y&&_.scrollBy({top:-g.y,behavior:o});break}}this.handleMove(t,nu(Yf(u,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()}}zk.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=R$,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 CR(e){return!!(e&&"distance"in e)}function kR(e){return!!(e&&"delay"in e)}class Uk{constructor(t,n,r){var i;r===void 0&&(r=lhe(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=Td(a),this.documentListeners=new uf(this.document),this.listeners=new uf(r),this.windowListeners=new uf(kr(a)),this.initialCoordinates=(i=z2(s))!=null?i:zi,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),this.windowListeners.add(Vr.Resize,this.handleCancel),this.windowListeners.add(Vr.DragStart,SR),this.windowListeners.add(Vr.VisibilityChange,this.handleCancel),this.windowListeners.add(Vr.ContextMenu,SR),this.documentListeners.add(Vr.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(kR(n)){this.timeoutId=setTimeout(this.handleStart,n.delay);return}if(CR(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)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Vr.Click,che,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Vr.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=z2(t))!=null?n:zi,c=Yf(i,l);if(!r&&o){if(CR(o)){if(o.tolerance!=null&&Yx(c,o.tolerance))return this.handleCancel();if(Yx(c,o.distance))return this.handleStart()}return kR(o)&&Yx(c,o.tolerance)?this.handleCancel():void 0}t.cancelable&&t.preventDefault(),a(l)}handleEnd(){const{onEnd:t}=this.props;this.detach(),t()}handleCancel(){const{onCancel:t}=this.props;this.detach(),t()}handleKeydown(t){t.code===ct.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const dhe={move:{name:"pointermove"},end:{name:"pointerup"}};class Hk extends Uk{constructor(t){const{event:n}=t,r=Td(n.target);super(t,dhe,r)}}Hk.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 hhe={move:{name:"mousemove"},end:{name:"mouseup"}};var H2;(function(e){e[e.RightClick=2]="RightClick"})(H2||(H2={}));class fhe extends Uk{constructor(t){super(t,hhe,Td(t.event.target))}}fhe.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===H2.RightClick?!1:(r==null||r({event:n}),!0)}}];const Kx={move:{name:"touchmove"},end:{name:"touchend"}};class phe extends Uk{constructor(t){super(t,Kx)}static setup(){return window.addEventListener(Kx.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Kx.move.name,t)};function t(){}}}phe.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 df;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(df||(df={}));var iv;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(iv||(iv={}));function mhe(e){let{acceleration:t,activator:n=df.Pointer,canScroll:r,draggingRect:i,enabled:s,interval:a=5,order:o=iv.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:d,delta:u,threshold:f}=e;const g=vhe({delta:u,disabled:!s}),[x,_]=Tde(),v=C.useRef({x:0,y:0}),p=C.useRef({x:0,y:0}),m=C.useMemo(()=>{switch(n){case df.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case df.DraggableRect:return i}},[n,i,l]),y=C.useRef(null),b=C.useCallback(()=>{const w=y.current;if(!w)return;const E=v.current.x*p.current.x,k=v.current.y*p.current.y;w.scrollBy(E,k)},[]),S=C.useMemo(()=>o===iv.TreeOrder?[...c].reverse():c,[o,c]);C.useEffect(()=>{if(!s||!c.length||!m){_();return}for(const w of S){if((r==null?void 0:r(w))===!1)continue;const E=c.indexOf(w),k=d[E];if(!k)continue;const{direction:T,speed:R}=nhe(w,k,m,t,f);for(const M of["x","y"])g[M][T[M]]||(R[M]=0,T[M]=0);if(R.x>0||R.y>0){_(),y.current=w,x(b,a),v.current=R,p.current=T;return}}v.current={x:0,y:0},p.current={x:0,y:0},_()},[t,b,r,_,s,a,JSON.stringify(m),JSON.stringify(g),x,c,S,d,JSON.stringify(f)])}const ghe={x:{[Tn.Backward]:!1,[Tn.Forward]:!1},y:{[Tn.Backward]:!1,[Tn.Forward]:!1}};function vhe(e){let{delta:t,disabled:n}=e;const r=B2(t);return Vp(i=>{if(n||!r||!i)return ghe;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 yhe(e,t){const n=t!==null?e.get(t):void 0,r=n?n.node.current:null;return Vp(i=>{var s;return t===null?null:(s=r??i)!=null?s:null},[r,t])}function _he(e,t){return C.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 Gf;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Gf||(Gf={}));var W2;(function(e){e.Optimized="optimized"})(W2||(W2={}));const ER=new Map;function xhe(e,t){let{dragging:n,dependencies:r,config:i}=t;const[s,a]=C.useState(null),{frequency:o,measure:l,strategy:c}=i,d=C.useRef(e),u=v(),f=qf(u),g=C.useCallback(function(p){p===void 0&&(p=[]),!f.current&&a(m=>m===null?p:m.concat(p.filter(y=>!m.includes(y))))},[f]),x=C.useRef(null),_=Vp(p=>{if(u&&!n)return ER;if(!p||p===ER||d.current!==e||s!=null){const m=new Map;for(let y of e){if(!y)continue;if(s&&s.length>0&&!s.includes(y.id)&&y.rect.current){m.set(y.id,y.rect.current);continue}const b=y.node.current,S=b?new Bk(l(b),b):null;y.rect.current=S,S&&m.set(y.id,S)}return m}return p},[e,s,n,u,l]);return C.useEffect(()=>{d.current=e},[e]),C.useEffect(()=>{u||g()},[n,u]),C.useEffect(()=>{s&&s.length>0&&a(null)},[JSON.stringify(s)]),C.useEffect(()=>{u||typeof o!="number"||x.current!==null||(x.current=setTimeout(()=>{g(),x.current=null},o))},[o,u,g,...r]),{droppableRects:_,measureDroppableContainers:g,measuringScheduled:s!=null};function v(){switch(c){case Gf.Always:return!1;case Gf.BeforeDragging:return n;default:return!n}}}function A$(e,t){return Vp(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function bhe(e,t){return A$(e,t)}function whe(e){let{callback:t,disabled:n}=e;const r=$k(t),i=C.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return C.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function ry(e){let{callback:t,disabled:n}=e;const r=$k(t),i=C.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return C.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function She(e){return new Bk(Md(e),e)}function TR(e,t,n){t===void 0&&(t=She);const[r,i]=C.useReducer(o,null),s=whe({callback(l){if(e)for(const c of l){const{type:d,target:u}=c;if(d==="childList"&&u instanceof HTMLElement&&u.contains(e)){i();break}}}}),a=ry({callback:i});return Bi(()=>{i(),e?(a==null||a.observe(e),s==null||s.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),s==null||s.disconnect())},[e]),r;function o(l){if(!e)return null;if(e.isConnected===!1){var c;return(c=l??n)!=null?c:null}const d=t(e);return JSON.stringify(l)===JSON.stringify(d)?l:d}}function Che(e){const t=A$(e);return w$(e,t)}const MR=[];function khe(e){const t=C.useRef(e),n=Vp(r=>e?r&&r!==MR&&e&&t.current&&e.parentNode===t.current.parentNode?r:ny(e):MR,[e]);return C.useEffect(()=>{t.current=e},[e]),n}function Ehe(e){const[t,n]=C.useState(null),r=C.useRef(e),i=C.useCallback(s=>{const a=qx(s.target);a&&n(o=>o?(o.set(a,U2(a)),new Map(o)):null)},[]);return C.useEffect(()=>{const s=r.current;if(e!==s){a(s);const o=e.map(l=>{const c=qx(l);return c?(c.addEventListener("scroll",i,{passive:!0}),[c,U2(c)]):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 c=qx(l);c==null||c.removeEventListener("scroll",i)})}},[i,e]),C.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,a)=>nu(s,a),zi):M$(e):zi,[e,t])}function RR(e,t){t===void 0&&(t=[]);const n=C.useRef(null);return C.useEffect(()=>{n.current=null},t),C.useEffect(()=>{const r=e!==zi;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Yf(e,n.current):zi}function The(e){C.useEffect(()=>{if(!ty)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 Mhe(e,t){return C.useMemo(()=>e.reduce((n,r)=>{let{eventName:i,handler:s}=r;return n[i]=a=>{s(a,t)},n},{}),[e,t])}function D$(e){return C.useMemo(()=>e?Jde(e):null,[e])}const Gx=[];function Rhe(e,t){t===void 0&&(t=Md);const[n]=e,r=D$(n?kr(n):null),[i,s]=C.useReducer(o,Gx),a=ry({callback:s});return e.length>0&&i===Gx&&s(),Bi(()=>{e.length?e.forEach(l=>a==null?void 0:a.observe(l)):(a==null||a.disconnect(),s())},[e]),i;function o(){return e.length?e.map(l=>E$(l)?r:new Bk(t(l),l)):Gx}}function Ahe(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Wp(t)?t:e}function Dhe(e){let{measure:t}=e;const[n,r]=C.useState(null),i=C.useCallback(c=>{for(const{target:d}of c)if(Wp(d)){r(u=>{const f=t(d);return u?{...u,width:f.width,height:f.height}:f});break}},[t]),s=ry({callback:i}),a=C.useCallback(c=>{const d=Ahe(c);s==null||s.disconnect(),d&&(s==null||s.observe(d)),r(d?t(d):null)},[t,s]),[o,l]=nv(a);return C.useMemo(()=>({nodeRef:o,rect:n,setRef:l}),[n,o,l])}const Lhe=[{sensor:Hk,options:{}},{sensor:zk,options:{}}],jhe={current:{}},$g={draggable:{measure:wR},droppable:{measure:wR,strategy:Gf.WhileDragging,frequency:W2.Optimized},dragOverlay:{measure:Md}};class hf 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 Phe={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new hf,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:rv},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:$g,measureDroppableContainers:rv,windowRect:null,measuringScheduled:!1},Nhe={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:rv,draggableNodes:new Map,over:null,measureDroppableContainers:rv},iy=C.createContext(Nhe),L$=C.createContext(Phe);function Ohe(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new hf}}}function Ihe(e,t){switch(t.type){case vn.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case vn.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case vn.DragEnd:case vn.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case vn.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new hf(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case vn.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 hf(e.droppable.containers);return a.set(n,{...s,disabled:i}),{...e,droppable:{...e.droppable,containers:a}}}case vn.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const s=new hf(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function $he(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=C.useContext(iy),s=B2(r),a=B2(n==null?void 0:n.id);return C.useEffect(()=>{if(!t&&!r&&s&&a!=null){if(!Fk(s)||document.activeElement===s.target)return;const o=i.get(a);if(!o)return;const{activatorNode:l,node:c}=o;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(const d of[l.current,c.current]){if(!d)continue;const u=Ade(d);if(u){u.focus();break}}})}},[r,t,i,a,s]),null}function Fhe(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((i,s)=>s({transform:i,...r}),n):n}function Bhe(e){return C.useMemo(()=>({draggable:{...$g.draggable,...e==null?void 0:e.draggable},droppable:{...$g.droppable,...e==null?void 0:e.droppable},dragOverlay:{...$g.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 zhe(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e;const s=C.useRef(!1),{x:a,y:o}=typeof i=="boolean"?{x:i,y:i}:i;Bi(()=>{if(!a&&!o||!t){s.current=!1;return}if(s.current||!r)return;const c=t==null?void 0:t.node.current;if(!c||c.isConnected===!1)return;const d=n(c),u=w$(d,r);if(a||(u.x=0),o||(u.y=0),s.current=!0,Math.abs(u.x)>0||Math.abs(u.y)>0){const f=S$(c);f&&f.scrollBy({top:u.y,left:u.x})}},[t,a,o,r,n])}const j$=C.createContext({...zi,scaleX:1,scaleY:1});var Co;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Co||(Co={}));const Uhe=C.memo(function(t){var n,r,i,s;let{id:a,accessibility:o,autoScroll:l=!0,children:c,sensors:d=Lhe,collisionDetection:u=Vde,measuring:f,modifiers:g,...x}=t;const _=C.useReducer(Ihe,void 0,Ohe),[v,p]=_,[m,y]=Ode(),[b,S]=C.useState(Co.Uninitialized),w=b===Co.Initialized,{draggable:{active:E,nodes:k,translate:T},droppable:{containers:R}}=v,M=E?k.get(E):null,L=C.useRef({initial:null,translated:null}),j=C.useMemo(()=>{var et;return E!=null?{id:E,data:(et=M==null?void 0:M.data)!=null?et:jhe,rect:L}:null},[E,M]),P=C.useRef(null),[$,F]=C.useState(null),[W,I]=C.useState(null),A=qf(x,Object.values(x)),D=qp("DndDescribedBy",a),H=C.useMemo(()=>R.getEnabled(),[R]),V=Bhe(f),{droppableRects:U,measureDroppableContainers:G,measuringScheduled:ee}=xhe(H,{dragging:w,dependencies:[T.x,T.y],config:V.droppable}),Z=yhe(k,E),q=C.useMemo(()=>W?z2(W):null,[W]),B=Ze(),O=bhe(Z,V.draggable.measure);zhe({activeNode:E?k.get(E):null,config:B.layoutShiftCompensation,initialRect:O,measure:V.draggable.measure});const z=TR(Z,V.draggable.measure,O),Y=TR(Z?Z.parentElement:null),N=C.useRef({activatorEvent:null,active:null,activeNode:Z,collisionRect:null,collisions:null,droppableRects:U,draggableNodes:k,draggingNode:null,draggingNodeRect:null,droppableContainers:R,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),J=R.getNodeFor((n=N.current.over)==null?void 0:n.id),K=Dhe({measure:V.dragOverlay.measure}),te=(r=K.nodeRef.current)!=null?r:Z,oe=w?(i=K.rect)!=null?i:z:null,ae=!!(K.nodeRef.current&&K.rect),_e=Che(ae?null:z),Se=D$(te?kr(te):null),ge=khe(w?J??Z:null),we=Rhe(ge),ce=Fhe(g,{transform:{x:T.x-_e.x,y:T.y-_e.y,scaleX:1,scaleY:1},activatorEvent:W,active:j,activeNodeRect:z,containerNodeRect:Y,draggingNodeRect:oe,over:N.current.over,overlayNodeRect:K.rect,scrollableAncestors:ge,scrollableAncestorRects:we,windowRect:Se}),re=q?nu(q,T):null,le=Ehe(ge),X=RR(le),ne=RR(le,[z]),ue=nu(ce,X),de=oe?Kde(oe,ce):null,ve=j&&de?u({active:j,collisionRect:de,droppableRects:U,droppableContainers:H,pointerCoordinates:re}):null,Te=b$(ve,"id"),[be,xe]=C.useState(null),Xe=ae?ce:nu(ce,ne),Oe=qde(Xe,(s=be==null?void 0:be.rect)!=null?s:null,z),Re=C.useCallback((et,ht)=>{let{sensor:_t,options:Cn}=ht;if(P.current==null)return;const It=k.get(P.current);if(!It)return;const $t=et.nativeEvent,tn=new _t({active:P.current,activeNode:It,event:$t,options:Cn,context:N,onStart(Kt){const Bn=P.current;if(Bn==null)return;const kn=k.get(Bn);if(!kn)return;const{onDragStart:ft}=A.current,nt={active:{id:Bn,data:kn.data,rect:L}};vr.unstable_batchedUpdates(()=>{ft==null||ft(nt),S(Co.Initializing),p({type:vn.DragStart,initialCoordinates:Kt,active:Bn}),m({type:"onDragStart",event:nt})})},onMove(Kt){p({type:vn.DragMove,coordinates:Kt})},onEnd:on(vn.DragEnd),onCancel:on(vn.DragCancel)});vr.unstable_batchedUpdates(()=>{F(tn),I(et.nativeEvent)});function on(Kt){return async function(){const{active:kn,collisions:ft,over:nt,scrollAdjustedTranslate:Ve}=N.current;let xt=null;if(kn&&Ve){const{cancelDrop:mn}=A.current;xt={activatorEvent:$t,active:kn,collisions:ft,delta:Ve,over:nt},Kt===vn.DragEnd&&typeof mn=="function"&&await Promise.resolve(mn(xt))&&(Kt=vn.DragCancel)}P.current=null,vr.unstable_batchedUpdates(()=>{p({type:Kt}),S(Co.Uninitialized),xe(null),F(null),I(null);const mn=Kt===vn.DragEnd?"onDragEnd":"onDragCancel";if(xt){const dn=A.current[mn];dn==null||dn(xt),m({type:mn,event:xt})}})}}},[k]),ze=C.useCallback((et,ht)=>(_t,Cn)=>{const It=_t.nativeEvent,$t=k.get(Cn);if(P.current!==null||!$t||It.dndKit||It.defaultPrevented)return;const tn={active:$t};et(_t,ht.options,tn)===!0&&(It.dndKit={capturedBy:ht.sensor},P.current=Cn,Re(_t,ht))},[k,Re]),st=_he(d,ze);The(d),Bi(()=>{z&&b===Co.Initializing&&S(Co.Initialized)},[z,b]),C.useEffect(()=>{const{onDragMove:et}=A.current,{active:ht,activatorEvent:_t,collisions:Cn,over:It}=N.current;if(!ht||!_t)return;const $t={active:ht,activatorEvent:_t,collisions:Cn,delta:{x:ue.x,y:ue.y},over:It};vr.unstable_batchedUpdates(()=>{et==null||et($t),m({type:"onDragMove",event:$t})})},[ue.x,ue.y]),C.useEffect(()=>{const{active:et,activatorEvent:ht,collisions:_t,droppableContainers:Cn,scrollAdjustedTranslate:It}=N.current;if(!et||P.current==null||!ht||!It)return;const{onDragOver:$t}=A.current,tn=Cn.get(Te),on=tn&&tn.rect.current?{id:tn.id,rect:tn.rect.current,data:tn.data,disabled:tn.disabled}:null,Kt={active:et,activatorEvent:ht,collisions:_t,delta:{x:It.x,y:It.y},over:on};vr.unstable_batchedUpdates(()=>{xe(on),$t==null||$t(Kt),m({type:"onDragOver",event:Kt})})},[Te]),Bi(()=>{N.current={activatorEvent:W,active:j,activeNode:Z,collisionRect:de,collisions:ve,droppableRects:U,draggableNodes:k,draggingNode:te,draggingNodeRect:oe,droppableContainers:R,over:be,scrollableAncestors:ge,scrollAdjustedTranslate:ue},L.current={initial:oe,translated:de}},[j,Z,ve,de,k,te,oe,U,R,be,ge,ue]),mhe({...B,delta:T,draggingRect:de,pointerCoordinates:re,scrollableAncestors:ge,scrollableAncestorRects:we});const Fe=C.useMemo(()=>({active:j,activeNode:Z,activeNodeRect:z,activatorEvent:W,collisions:ve,containerNodeRect:Y,dragOverlay:K,draggableNodes:k,droppableContainers:R,droppableRects:U,over:be,measureDroppableContainers:G,scrollableAncestors:ge,scrollableAncestorRects:we,measuringConfiguration:V,measuringScheduled:ee,windowRect:Se}),[j,Z,z,W,ve,Y,K,k,R,U,be,G,ge,we,V,ee,Se]),Ie=C.useMemo(()=>({activatorEvent:W,activators:st,active:j,activeNodeRect:z,ariaDescribedById:{draggable:D},dispatch:p,draggableNodes:k,over:be,measureDroppableContainers:G}),[W,st,j,z,p,D,k,be,G]);return rt.createElement(y$.Provider,{value:y},rt.createElement(iy.Provider,{value:Ie},rt.createElement(L$.Provider,{value:Fe},rt.createElement(j$.Provider,{value:Oe},c)),rt.createElement($he,{disabled:(o==null?void 0:o.restoreFocus)===!1})),rt.createElement(Fde,{...o,hiddenTextDescribedById:D}));function Ze(){const et=($==null?void 0:$.autoScrollEnabled)===!1,ht=typeof l=="object"?l.enabled===!1:l===!1,_t=w&&!et&&!ht;return typeof l=="object"?{...l,enabled:_t}:{enabled:_t}}}),Hhe=C.createContext(null),AR="button",Whe="Droppable";function Vhe(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const s=qp(Whe),{activators:a,activatorEvent:o,active:l,activeNodeRect:c,ariaDescribedById:d,draggableNodes:u,over:f}=C.useContext(iy),{role:g=AR,roleDescription:x="draggable",tabIndex:_=0}=i??{},v=(l==null?void 0:l.id)===t,p=C.useContext(v?j$:Hhe),[m,y]=nv(),[b,S]=nv(),w=Mhe(a,t),E=qf(n);Bi(()=>(u.set(t,{id:t,key:s,node:m,activatorNode:b,data:E}),()=>{const T=u.get(t);T&&T.key===s&&u.delete(t)}),[u,t]);const k=C.useMemo(()=>({role:g,tabIndex:_,"aria-disabled":r,"aria-pressed":v&&g===AR?!0:void 0,"aria-roledescription":x,"aria-describedby":d.draggable}),[r,g,_,v,x,d.draggable]);return{active:l,activatorEvent:o,activeNodeRect:c,attributes:k,isDragging:v,listeners:r?void 0:w,node:m,over:f,setNodeRef:y,setActivatorNodeRef:S,transform:p}}function qhe(){return C.useContext(L$)}const Yhe="Droppable",Khe={timeout:25};function Ghe(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const s=qp(Yhe),{active:a,dispatch:o,over:l,measureDroppableContainers:c}=C.useContext(iy),d=C.useRef({disabled:n}),u=C.useRef(!1),f=C.useRef(null),g=C.useRef(null),{disabled:x,updateMeasurementsFor:_,timeout:v}={...Khe,...i},p=qf(_??r),m=C.useCallback(()=>{if(!u.current){u.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{c(Array.isArray(p.current)?p.current:[p.current]),g.current=null},v)},[v]),y=ry({callback:m,disabled:x||!a}),b=C.useCallback((k,T)=>{y&&(T&&(y.unobserve(T),u.current=!1),k&&y.observe(k))},[y]),[S,w]=nv(b),E=qf(t);return C.useEffect(()=>{!y||!S.current||(y.disconnect(),u.current=!1,y.observe(S.current))},[S,y]),Bi(()=>(o({type:vn.RegisterDroppable,element:{id:r,key:s,disabled:n,node:S,rect:f,data:E}}),()=>o({type:vn.UnregisterDroppable,key:s,id:r})),[r]),C.useEffect(()=>{n!==d.current.disabled&&(o({type:vn.SetDroppableDisabled,id:r,key:s,disabled:n}),d.current.disabled=n)},[r,s,n,o]),{active:a,rect:f,isOver:(l==null?void 0:l.id)===r,node:S,over:l,setNodeRef:w}}function Wk(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Xhe(e,t){return e.reduce((n,r,i)=>{const s=t.get(r);return s&&(n[i]=s),n},Array(e.length))}function Km(e){return e!==null&&e>=0}function Qhe(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 Jhe(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const P$=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e;const s=Wk(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}},Gm={scaleX:1,scaleY:1},Zhe=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 c=s[a];return c?{x:0,y:n<a?c.top+c.height-(o.top+o.height):c.top-o.top,...Gm}:null}const l=efe(s,i,n);return i>n&&i<=a?{x:0,y:-o.height-l,...Gm}:i<n&&i>=a?{x:0,y:o.height+l,...Gm}:{x:0,y:0,...Gm}};function efe(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 N$="Sortable",O$=rt.createContext({activeIndex:-1,containerId:N$,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:P$,disabled:{draggable:!1,droppable:!1}});function tfe(e){let{children:t,id:n,items:r,strategy:i=P$,disabled:s=!1}=e;const{active:a,dragOverlay:o,droppableRects:l,over:c,measureDroppableContainers:d}=qhe(),u=qp(N$,n),f=o.rect!==null,g=C.useMemo(()=>r.map(w=>typeof w=="object"&&"id"in w?w.id:w),[r]),x=a!=null,_=a?g.indexOf(a.id):-1,v=c?g.indexOf(c.id):-1,p=C.useRef(g),m=!Qhe(g,p.current),y=v!==-1&&_===-1||m,b=Jhe(s);Bi(()=>{m&&x&&d(g)},[m,g,x,d]),C.useEffect(()=>{p.current=g},[g]);const S=C.useMemo(()=>({activeIndex:_,containerId:u,disabled:b,disableTransforms:y,items:g,overIndex:v,useDragOverlay:f,sortedRects:Xhe(g,l),strategy:i}),[_,u,b.draggable,b.droppable,y,g,v,l,f,i]);return rt.createElement(O$.Provider,{value:S},t)}const nfe=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return Wk(n,r,i).indexOf(t)},rfe=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:s,newIndex:a,previousItems:o,previousContainerId:l,transition:c}=e;return!c||!r||o!==s&&i===a?!1:n?!0:a!==i&&t===l},ife={duration:200,easing:"ease"},I$="transform",sfe=Kf.Transition.toString({property:I$,duration:0,easing:"linear"}),ofe={roleDescription:"sortable"};function afe(e){let{disabled:t,index:n,node:r,rect:i}=e;const[s,a]=C.useState(null),o=C.useRef(n);return Bi(()=>{if(!t&&n!==o.current&&r.current){const l=i.current;if(l){const c=Md(r.current,{ignoreTransform:!0}),d={x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height};(d.x||d.y)&&a(d)}}n!==o.current&&(o.current=n)},[t,n,r,i]),C.useEffect(()=>{s&&a(null)},[s]),s}function lfe(e){let{animateLayoutChanges:t=rfe,attributes:n,disabled:r,data:i,getNewIndex:s=nfe,id:a,strategy:o,resizeObserverConfig:l,transition:c=ife}=e;const{items:d,containerId:u,activeIndex:f,disabled:g,disableTransforms:x,sortedRects:_,overIndex:v,useDragOverlay:p,strategy:m}=C.useContext(O$),y=cfe(r,g),b=d.indexOf(a),S=C.useMemo(()=>({sortable:{containerId:u,index:b,items:d},...i}),[u,i,b,d]),w=C.useMemo(()=>d.slice(d.indexOf(a)),[d,a]),{rect:E,node:k,isOver:T,setNodeRef:R}=Ghe({id:a,data:S,disabled:y.droppable,resizeObserverConfig:{updateMeasurementsFor:w,...l}}),{active:M,activatorEvent:L,activeNodeRect:j,attributes:P,setNodeRef:$,listeners:F,isDragging:W,over:I,setActivatorNodeRef:A,transform:D}=Vhe({id:a,data:S,attributes:{...ofe,...n},disabled:y.draggable}),H=Ede(R,$),V=!!M,U=V&&!x&&Km(f)&&Km(v),G=!p&&W,ee=G&&U?D:null,q=U?ee??(o??m)({rects:_,activeNodeRect:j,activeIndex:f,overIndex:v,index:b}):null,B=Km(f)&&Km(v)?s({id:a,items:d,activeIndex:f,overIndex:v}):b,O=M==null?void 0:M.id,z=C.useRef({activeId:O,items:d,newIndex:B,containerId:u}),Y=d!==z.current.items,N=t({active:M,containerId:u,isDragging:W,isSorting:V,id:a,index:b,items:d,newIndex:z.current.newIndex,previousItems:z.current.items,previousContainerId:z.current.containerId,transition:c,wasDragging:z.current.activeId!=null}),J=afe({disabled:!N,index:b,node:k,rect:E});return C.useEffect(()=>{V&&z.current.newIndex!==B&&(z.current.newIndex=B),u!==z.current.containerId&&(z.current.containerId=u),d!==z.current.items&&(z.current.items=d)},[V,B,u,d]),C.useEffect(()=>{if(O===z.current.activeId)return;if(O&&!z.current.activeId){z.current.activeId=O;return}const te=setTimeout(()=>{z.current.activeId=O},50);return()=>clearTimeout(te)},[O]),{active:M,activeIndex:f,attributes:P,data:S,rect:E,index:b,newIndex:B,items:d,isOver:T,isSorting:V,isDragging:W,listeners:F,node:k,overIndex:v,over:I,setNodeRef:H,setActivatorNodeRef:A,setDroppableNodeRef:R,setDraggableNodeRef:$,transform:J??q,transition:K()};function K(){if(J||Y&&z.current.newIndex===b)return sfe;if(!(G&&!Fk(L)||!c)&&(V||N))return Kf.Transition.toString({...c,property:I$})}}function cfe(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 sv(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 ufe=[ct.Down,ct.Right,ct.Up,ct.Left],dfe=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:s,over:a,scrollableAncestors:o}}=t;if(ufe.includes(e.code)){if(e.preventDefault(),!n||!r)return;const l=[];s.getEnabled().forEach(u=>{if(!u||u!=null&&u.disabled)return;const f=i.get(u.id);if(f)switch(e.code){case ct.Down:r.top<f.top&&l.push(u);break;case ct.Up:r.top>f.top&&l.push(u);break;case ct.Left:r.left>f.left&&l.push(u);break;case ct.Right:r.left<f.left&&l.push(u);break}});const c=Hde({active:n,collisionRect:r,droppableRects:i,droppableContainers:l,pointerCoordinates:null});let d=b$(c,"id");if(d===(a==null?void 0:a.id)&&c.length>1&&(d=c[1].id),d!=null){const u=s.get(n.id),f=s.get(d),g=f?i.get(f.id):null,x=f==null?void 0:f.node.current;if(x&&g&&u&&f){const v=ny(x).some((w,E)=>o[E]!==w),p=$$(u,f),m=hfe(u,f),y=v||!p?{x:0,y:0}:{x:m?r.width-g.width:0,y:m?r.height-g.height:0},b={x:g.left,y:g.top};return y.x&&y.y?b:Yf(b,y)}}}};function $$(e,t){return!sv(e)||!sv(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function hfe(e,t){return!sv(e)||!sv(t)||!$$(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const F$=new Set,Cr=new WeakMap,Pu=new WeakMap,xl=new WeakMap,V2=new WeakMap,ffe=new WeakMap,Nu=new WeakMap,ov=new WeakMap,Hh=new WeakSet;let ga,Vk=0,qk=0;const Bs="__aa_tgt",Xf="__aa_del",av="__aa_new",pfe=e=>{const t=xfe(e);t&&t.forEach(n=>bfe(n))},mfe=e=>{e.forEach(t=>{t.target===ga&&vfe(),Cr.has(t.target)&&Ul(t.target)})};function gfe(e){const t=V2.get(e);t==null||t.disconnect();let n=Cr.get(e),r=0;const i=5;n||(n=Ou(e),Cr.set(e,n));const{offsetWidth:s,offsetHeight:a}=ga,l=[n.top-i,s-(n.left+i+n.width),a-(n.top+i+n.height),n.left-i].map(d=>`${-1*Math.floor(d)}px`).join(" "),c=new IntersectionObserver(()=>{++r>1&&Ul(e)},{root:ga,threshold:1,rootMargin:l});c.observe(e),V2.set(e,c)}function Ul(e){clearTimeout(ov.get(e));const t=sy(e),n=Qf(t)?500:t.duration;ov.set(e,setTimeout(async()=>{const r=xl.get(e);try{await(r==null?void 0:r.finished),Cr.set(e,Ou(e)),gfe(e)}catch{}},n))}function vfe(){clearTimeout(ov.get(ga)),ov.set(ga,setTimeout(()=>{F$.forEach(e=>H$(e,t=>B$(()=>Ul(t))))},100))}function yfe(e){setTimeout(()=>{ffe.set(e,setInterval(()=>B$(Ul.bind(null,e)),2e3))},Math.round(2e3*Math.random()))}function B$(e){typeof requestIdleCallback=="function"?requestIdleCallback(()=>e()):requestAnimationFrame(()=>e())}let q2,$c;const _fe=typeof window<"u"&&"ResizeObserver"in window;_fe&&(ga=document.documentElement,q2=new MutationObserver(pfe),$c=new ResizeObserver(mfe),window.addEventListener("scroll",()=>{qk=window.scrollY,Vk=window.scrollX}),$c.observe(ga));function xfe(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(Xx(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(Xf in a)return!1;Xx(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(Xf in a)return!1;a instanceof Element&&(r.add(a),Xx(i.target,a),Pu.set(a,[i.previousSibling,i.nextSibling]))}}return r},new Set)}function Xx(e,t){!t&&!(Bs in e)?Object.defineProperty(e,Bs,{value:e}):t&&!(Bs in t)&&Object.defineProperty(t,Bs,{value:e})}function bfe(e){var t;const n=e.isConnected,r=Cr.has(e);n&&Pu.has(e)&&Pu.delete(e),xl.has(e)&&((t=xl.get(e))===null||t===void 0||t.cancel()),av in e?DR(e):r&&n?Sfe(e):r&&!n?Cfe(e):DR(e)}function Qi(e){return Number(e.replace(/[^0-9.\-]/g,""))}function wfe(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 Ou(e){const t=e.getBoundingClientRect(),{x:n,y:r}=wfe(e);return{top:t.top+r,left:t.left+n,width:t.width,height:t.height}}function z$(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 c=Qi(o.paddingTop)+Qi(o.paddingBottom)+Qi(o.borderTopWidth)+Qi(o.borderBottomWidth),d=Qi(o.paddingLeft)+Qi(o.paddingRight)+Qi(o.borderRightWidth)+Qi(o.borderLeftWidth);r-=d,s-=d,i-=c,a-=c}return[r,s,i,a].map(Math.round)}function sy(e){return Bs in e&&Nu.has(e[Bs])?Nu.get(e[Bs]):{duration:250,easing:"ease-in-out"}}function U$(e){if(Bs in e)return e[Bs]}function Yk(e){const t=U$(e);return t?Hh.has(t):!1}function H$(e,...t){t.forEach(n=>n(e,Nu.has(e)));for(let n=0;n<e.children.length;n++){const r=e.children.item(n);r&&t.forEach(i=>i(r,Nu.has(r)))}}function Kk(e){return Array.isArray(e)?e:[e]}function Qf(e){return typeof e=="function"}function Sfe(e){const t=Cr.get(e),n=Ou(e);if(!Yk(e))return Cr.set(e,n);let r;if(!t)return;const i=sy(e);if(typeof i!="function"){const s=t.left-n.left,a=t.top-n.top,[o,l,c,d]=z$(e,t,n),u={transform:`translate(${s}px, ${a}px)`},f={transform:"translate(0, 0)"};o!==l&&(u.width=`${o}px`,f.width=`${l}px`),c!==d&&(u.height=`${c}px`,f.height=`${d}px`),r=e.animate([u,f],{duration:i.duration,easing:i.easing})}else{const[s]=Kk(i(e,"remain",t,n));r=new Animation(s),r.play()}xl.set(e,r),Cr.set(e,n),r.addEventListener("finish",Ul.bind(null,e))}function DR(e){av in e&&delete e[av];const t=Ou(e);Cr.set(e,t);const n=sy(e);if(!Yk(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]=Kk(n(e,"add",t));r=new Animation(i),r.play()}xl.set(e,r),r.addEventListener("finish",Ul.bind(null,e))}function LR(e,t){var n;e.remove(),Cr.delete(e),Pu.delete(e),xl.delete(e),(n=V2.get(e))===null||n===void 0||n.disconnect(),setTimeout(()=>{if(Xf in e&&delete e[Xf],Object.defineProperty(e,av,{value:!0,configurable:!0}),t&&e instanceof HTMLElement)for(const r in t)e.style[r]=""},0)}function Cfe(e){var t;if(!Pu.has(e)||!Cr.has(e))return;const[n,r]=Pu.get(e);Object.defineProperty(e,Xf,{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=U$(e))===null||t===void 0||t.appendChild(e),!Yk(e))return LR(e);const[a,o,l,c]=Efe(e),d=sy(e),u=Cr.get(e);(i!==Vk||s!==qk)&&kfe(e,i,s,d);let f,g={position:"absolute",top:`${a}px`,left:`${o}px`,width:`${l}px`,height:`${c}px`,margin:"0",pointerEvents:"none",transformOrigin:"center",zIndex:"100"};if(!Qf(d))Object.assign(e.style,g),f=e.animate([{transform:"scale(1)",opacity:1},{transform:"scale(.98)",opacity:0}],{duration:d.duration,easing:"ease-out"});else{const[x,_]=Kk(d(e,"remove",u));(_==null?void 0:_.styleReset)!==!1&&(g=(_==null?void 0:_.styleReset)||g,Object.assign(e.style,g)),f=new Animation(x),f.play()}xl.set(e,f),f.addEventListener("finish",LR.bind(null,e,g))}function kfe(e,t,n,r){const i=Vk-t,s=qk-n,a=document.documentElement.style.scrollBehavior;if(getComputedStyle(ga).scrollBehavior==="smooth"&&(document.documentElement.style.scrollBehavior="auto"),window.scrollTo(window.scrollX+i,window.scrollY+s),!e.parentElement)return;const l=e.parentElement;let c=l.clientHeight,d=l.clientWidth;const u=performance.now();function f(){requestAnimationFrame(()=>{if(!Qf(r)){const g=c-l.clientHeight,x=d-l.clientWidth;u+r.duration>performance.now()?(window.scrollTo({left:window.scrollX-x,top:window.scrollY-g}),c=l.clientHeight,d=l.clientWidth,f()):document.documentElement.style.scrollBehavior=a}})}f()}function Efe(e){const t=Cr.get(e),[n,,r]=z$(e,t,Ou(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=Cr.get(i)||Ou(i),o=Math.round(t.top-a.top)-Qi(s.borderTopWidth),l=Math.round(t.left-a.left)-Qi(s.borderLeftWidth);return[o,l,n,r]}function Tfe(e,t={}){return q2&&$c&&(window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!Qf(t)&&!t.disrespectUserMotionPreference||(Hh.add(e),getComputedStyle(e).position==="static"&&Object.assign(e.style,{position:"relative"}),H$(e,Ul,yfe,i=>$c==null?void 0:$c.observe(i)),Qf(t)?Nu.set(e,t):Nu.set(e,{duration:250,easing:"ease-in-out",...t}),q2.observe(e,{childList:!0}),F$.add(e))),Object.freeze({parent:e,enable:()=>{Hh.add(e)},disable:()=>{Hh.delete(e)},isEnabled:()=>Hh.has(e)})}function Mfe(e){const[t,n]=C.useState(),r=C.useMemo(()=>e,[]),i=C.useCallback(a=>{a instanceof HTMLElement?n(Tfe(a,r)):n(void 0)},[r]),s=C.useCallback(a=>{t&&(a?t.enable():t.disable())},[t]);return[i,s]}function Rfe({id:e,disabled:t,className:n,children:r}){const{attributes:i,listeners:s,setNodeRef:a,transform:o,transition:l}=lfe({id:e,disabled:t});i.role="listitem";const c={transform:Kf.Transform.toString(o&&{...o,scaleY:1}),transition:l};return h.jsxs("li",{ref:a,style:c,...i,className:ie("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:[h.jsx("div",{...s,title:"Drag to reorder",className:ie("text-muted-foreground my-auto",t?"cursor-not-allowed opacity-50":"cursor-grab hover:text-primary hover:scale-110"),children:h.jsx(sJ,{className:"size-6"})}),r]})}function Afe({onDragEnd:e,className:t,children:n,ids:r}){const[i,s]=Mfe(),a=Bde(_R(Hk),_R(zk,{coordinateGetter:dfe})),o=l=>{e(l),setTimeout(()=>{s(!0)},1)};return h.jsx(Uhe,{sensors:a,collisionDetection:Ude,onDragStart:()=>s(!1),onDragCancel:()=>s(!0),onDragEnd:o,children:h.jsx(tfe,{items:r,strategy:Zhe,children:h.jsx("ol",{ref:i,className:t,children:n})})})}const Dfe="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Lfe=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;)t+=Dfe[n[e]&63];return t};function jfe(){var E,k;const[e,t]=C.useState(!1),[n,r]=C.useState(),i=AP(),{hasPerm:s}=di(),[a,o]=C.useState(!1),[l,c]=C.useState(null),[d,u]=C.useState(!1),f=qt({method:"GET",path:"/settings/banTemplates",throwGenericErrors:!0}),g=qt({method:"POST",path:"/settings/banTemplates",throwGenericErrors:!0}),x=U5("/settings/banTemplates",async()=>{const T=await f({});if(!T)throw new Error("No data returned");return T},{isPaused:()=>a||!!l||e}),_=async T=>{o(!0),c(null),u(!1);try{const R=await x.mutate(T,!1);if(!await g({data:R}))throw new Error("No data returned");u(!0)}catch(R){R instanceof j2||R instanceof Error?c(R.message):c(JSON.stringify(R))}finally{o(!1)}};C.useEffect(()=>{if(!d)return;const T=setTimeout(()=>{u(!1)},5e3);return()=>clearTimeout(T)},[d]);const v=T=>{const{active:R,over:M}=T;M&&R.id!==M.id&&_(L=>{const j=L.findIndex($=>$.id===R.id),P=L.findIndex($=>$.id===M.id);return Wk(L,j,P)})},p=({id:T,reason:R,duration:M})=>{console.log("Save item",T,R,M),_(T?L=>L.map(j=>j.id===T?{id:T,reason:R,duration:M}:j):L=>[...L,{id:Lfe(21),reason:R,duration:M}]),t(!1),r(void 0)},m=T=>{if(!T||!x.data)return;const R=x.data.find(M=>M.id===T);R&&i({title:"Remove Template",actionLabel:"Remove",confirmBtnVariant:"destructive",message:h.jsxs(h.Fragment,{children:["Are you sure you want to remove this ban template? ",h.jsx("br",{}),h.jsx("blockquote",{className:"opacity-70 italic border-l-4 pl-2",children:R.reason})]}),onConfirm:()=>{console.log("Remove confirmed",T),_(M=>M.filter(L=>L.id!==T))}})},y=T=>{!T||!x.data||(console.log("Edit item",T),r(x.data.find(R=>R.id===T)),t(!0))},b=()=>{r(void 0),t(!0)};let S;if(x.error){const T=()=>x.mutate(),R=((E=x==null?void 0:x.error)==null?void 0:E.message)??"unknown error";S=h.jsxs("div",{className:"inline-flex flex-wrap gap-1",children:[h.jsxs("span",{className:"text-destructive-inline",children:["Error loading: ",R]}),h.jsx("br",{}),h.jsx("button",{className:"underline hover:text-accent",onClick:T,children:"Try again?"})]})}else if(a)S=h.jsx("span",{className:"text-success-inlinex animate-pulse",children:"Saving..."});else if(l){const T=()=>{x.data&&_(()=>x.data)},R=l??"unknown error";S=h.jsxs("div",{className:"inline-flex flex-wrap gap-1",children:[h.jsxs("span",{className:"text-destructive-inline",children:["Error saving: ",R]}),h.jsx("br",{}),h.jsx("button",{className:"underline hover:text-accent",onClick:T,children:"Try again?"})]})}else d?S=h.jsx("span",{className:"text-success-inline",children:"Saved."}):(x.isLoading||x.isValidating)&&(S=h.jsx("span",{className:"text-muted-foreground",children:"Loading..."}));const w=s("settings.write");return h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"space-y-4 w-full max-w-screen-lg mx-auto",children:[h.jsxs("div",{className:"px-2 md:px-0",children:[h.jsx("h1",{className:"text-3xl mb-2",children:"Ban Templates"}),h.jsxs("p",{children:["Here you can configure ban reasons and durations that will appear as dropdown options when banning a player. ",h.jsx("br",{}),"This is useful for common reasons that happen frequently, like violation of your server rules. ",h.jsx("br",{}),w?h.jsxs("span",{className:"text-muted-foreground italic",children:["TIP: You can also drag and drop to reorder the list. ",h.jsx("br",{})]}):h.jsxs("span",{className:"text-warning-inline",children:["You need the ",h.jsx(Mn,{className:"text-warning-inline",children:"Settings: Change"})," permission to edit these reasons."]})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"flex flex-wrap justify-between text-muted-foreground px-2 md:px-0",children:[h.jsxs("span",{className:"shrink-0",children:["Configured reasons: ",((k=x.data)==null?void 0:k.length)??0]}),S]}),!x.data&&!l&&h.jsxs("div",{className:"text-muted-foreground text-lg md:text-2xl text-center my-4 px-2 md:px-0",children:[h.jsx(cn,{className:"inline animate-spin h-8"}),"Loading..."]}),x.data&&h.jsxs(Afe,{className:"space-y-2 border p-2 rounded-lg",ids:x.data.map(T=>T.id),onDragEnd:v,children:[x.data.length?x.data.map(T=>h.jsx(Rfe,{id:T.id,disabled:!w,children:h.jsx(Cde,{onEdit:y,onRemove:m,disabled:!w,...T})},T.id)):h.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."}),h.jsx(kde,{onClick:b,disabled:!w})]})]})]}),h.jsx(Sde,{reasonData:n,onSave:p,isDialogOpen:e,setIsDialogOpen:t},n==null?void 0:n.id)]})}const oh=150;function jR({pageName:e}){const[t,n]=C.useState(!0),[r,i]=C.useState(""),[s,a]=C.useState(!1),o=j1(),l=qt({method:"GET",path:`/systemLog/${e}`,throwGenericErrors:!0}),c=C.useRef(null),d=C.useRef(null),u=C.useMemo(()=>new fO.Terminal(EO),[]),f=C.useMemo(()=>new yO.FitAddon,[]),g=C.useMemo(()=>new xO.SearchAddon,[]),x=(S,w)=>{Fl(w)},_=C.useMemo(()=>new wO.WebLinksAddon(x),[]),v=Gn(oh,S=>{window.postMessage({type:"liveConsoleSearchHotkey",action:S})},{noTrailing:!0}),p=()=>{if(!d.current||!u.element||!f){console.log("refitTerminal: no containerRef.current or term.element or fitAddon");return}const S=f.proposeDimensions();S?u.resize(S.cols,S.rows):console.log("refitTerminal: no proposed dimensions")};Pi("resize",N5(100,p)),C.useEffect(()=>{if(d.current&&c.current&&!u.element){console.log("xterm init"),d.current.innerHTML="",u.loadAddon(f),u.loadAddon(g),u.loadAddon(_),u.loadAddon(new gO.CanvasAddon),u.loadAddon(new kO(c.current,d.current)),u.open(d.current),u.write("\x1B[?25l"),p();const S=Gn(oh,()=>{u.scrollLines(Math.min(1,2-u.rows))},{noTrailing:!0}),w=Gn(oh,()=>{u.scrollLines(Math.max(1,u.rows-2))},{noTrailing:!0}),E=Gn(oh,()=>{u.scrollToTop()},{noTrailing:!0}),k=Gn(oh,()=>{u.scrollToBottom()},{noTrailing:!0});u.attachCustomKeyEventHandler(T=>T.code==="F5"||T.code==="Escape"||T.code==="KeyF"&&(T.ctrlKey||T.metaKey)||T.code==="F3"?!1:T.code==="KeyC"&&(T.ctrlKey||T.metaKey)?(document.execCommand("copy"),u.clearSelection(),!1):T.code==="PageUp"?(S(),!1):T.code==="PageDown"?(w(),!1):T.code==="Home"?(E(),!1):T.code==="End"?(k(),!1):!ek(T)),l({success:(T,R)=>{n(!1),m(T.data),u.writeln(""),u.writeln("\x1B[33m[END OF LOG - REFRESH THE PAGE TO LOAD MORE]\x1B")},error:(T,R)=>{n(!1),i(T)}})}},[u]),Pi("keydown",S=>{S.code==="F5"?t&&(o(),S.preventDefault()):S.code==="Escape"?(g.clearDecorations(),a(!1)):S.code==="KeyF"&&(S.ctrlKey||S.metaKey)?(s?v("focus"):a(!0),S.preventDefault()):S.code==="F3"&&(v(S.shiftKey?"previous":"next"),S.preventDefault())});const m=S=>{const w=S.split(/\r?\n/);w.length&&!w[w.length-1]&&w.pop();for(const E of w)u.writeln(E)};let y="Console Log",b="Output of txAdmin to it's parent terminal, including usually hidden debug messages.";return e==="action"&&(y="Action Log",b="Log of all actions taken by txAdmin or any admin."),h.jsxs("div",{className:"dark text-primary flex flex-col h-full w-full bg-card border md:rounded-xl overflow-clip",children:[h.jsx("div",{className:"flex flex-col flex-shrink px-1 sm:px-4 py-2 space-y-4 border-b",children:h.jsxs("div",{className:"flex items-center space-x-2",children:[h.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:[h.jsx("polyline",{points:"4 17 10 11 4 5"}),h.jsx("line",{x1:"12",x2:"20",y1:"19",y2:"19"})]}),h.jsxs("p",{className:"font-mono text-sm",children:[y," - ",h.jsx("span",{className:"text-muted-foreground",children:b})]})]})}),h.jsxs("div",{className:"flex flex-col relative grow overflow-hidden",children:[t&&!r?h.jsx("div",{className:"absolute inset-0 z-20 bg-black/60 flex items-center justify-center",children:h.jsxs("div",{className:"flex flex-col gap-6 items-center justify-center text-muted-foreground select-none",children:[h.jsx(cn,{className:"w-16 h-16 animate-spin"}),h.jsx("h2",{className:"text-3xl tracking-wider font-light animate-pulse",children:"   Loading..."})]})}):null,r&&h.jsxs("div",{className:"absolute inset-0 z-20 bg-black/60 flex flex-col gap-4 items-center justify-center",children:[h.jsxs("h2",{className:"text-2xl tracking-wider font-light text-muted-foreground select-none",children:["Error fetching ",y,":"]}),h.jsx("p",{className:"mx-8 max-w-screen-md text-destructive-inline font-mono",children:r})]}),h.jsx("div",{ref:d,className:"absolute top-1 left-2 right-0 bottom-0"}),h.jsx(CO,{show:s,setShow:a,searchAddon:g}),h.jsx("button",{ref:c,className:"absolute bottom-0 right-2 z-10 hidden opacity-75",onClick:()=>{u.scrollToBottom()},children:h.jsx(uP,{className:"w-20 h-20 animate-pulse hover:animate-none hover:scale-110"})})]})]})}const oy=C.forwardRef(({className:e,...t},n)=>h.jsx("textarea",{className:ie("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50","bg-black/5 dark:bg-black/30",e),ref:n,...t}));oy.displayName="Textarea";const Pfe=UI,W$=C.forwardRef(({children:e},t)=>h.jsx(K1,{ref:t,asChild:!0,children:e}));W$.displayName=K1.displayName;const V$=C.forwardRef(({className:e,...t},n)=>h.jsx(Q1,{ref:n,className:ie("flex cursor-default items-center justify-center py-1",e),...t,children:h.jsx(cP,{className:"h-4 w-4"})}));V$.displayName=Q1.displayName;const q$=C.forwardRef(({className:e,...t},n)=>h.jsx(J1,{ref:n,className:ie("flex cursor-default items-center justify-center py-1",e),...t,children:h.jsx(ud,{className:"h-4 w-4"})}));q$.displayName=J1.displayName;const Y$=C.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>h.jsx(HI,{children:h.jsxs(G1,{ref:i,className:ie("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:[h.jsx(V$,{}),h.jsx(WI,{className:ie("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),h.jsx(q$,{})]})}));Y$.displayName=G1.displayName;const Y2=C.forwardRef(({className:e,children:t,...n},r)=>h.jsx(X1,{ref:r,className:ie("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:h.jsx(qI,{children:t})}));Y2.displayName=X1.displayName;const PR=150,NR="!add-new",Nfe=["permanent","2 hours","8 hours","1 day","2 days","1 week","2 weeks"],K$=C.forwardRef(function({banTemplates:t,disabled:n,onNavigateAway:r},i){const s=C.useRef(null),a=C.useRef(null),o=wa()[1],[l,c]=C.useState("2 days"),[d,u]=C.useState("days"),f=_5();C.useImperativeHandle(i,()=>({getData:()=>{var v,p;return{reason:(v=s.current)==null?void 0:v.value.trim(),duration:l==="custom"?`${(p=a.current)==null?void 0:p.value} ${d}`:l}},clearData:()=>{!s.current||!a.current||(s.current.value="",a.current.value="",c("2 days"),u("days"))},focusReason:()=>{var v;(v=s.current)==null||v.focus()}}),[s,a,l,d]);const g=v=>{if(v===NR)o("/settings/ban-templates"),r==null||r();else{if(!t)return;const p=t.find(y=>y.id===v);if(!p)return;const m=F0(p.duration);Nfe.includes(m)?c(m):typeof p.duration=="object"&&(c("custom"),a.current.value=p.duration.value.toString(),u(p.duration.unit)),s.current.value=p.reason,setTimeout(()=>{s.current.focus()},50)}},x=C.useMemo(()=>{if(t)return t.map((v,p)=>{const m=hse(v.duration),y=v.reason.length>PR?v.reason.slice(0,PR-3)+"...":v.reason;return h.jsxs(Y2,{value:v.id,className:"focus:bg-secondary focus:text-secondary-foreground",children:[h.jsx("span",{className:"inline-block pr-1 font-mono opacity-75 min-w-[4ch]",children:m})," ",y]},p)})},[t]);let _;return Array.isArray(t)?t.length?_=h.jsxs(h.Fragment,{children:[x,h.jsxs(Y2,{value:NR,className:"font-bold text-warning-inline",children:["Add Ban Template",h.jsx(da,{className:"inline mr-1 h-4"})]})]}):_=h.jsxs("div",{className:"text-warning-inline text-center p-4",children:["You do not have any template configured. ",h.jsx("br",{}),h.jsxs(ca,{href:"/settings/ban-templates",className:"cursor-pointer underline hover:text-accent",onClick:()=>{f()},children:["Add Ban Template",h.jsx(da,{className:"inline mr-1 h-4"})]})]}):_=h.jsx("div",{className:"text-secondary-foreground text-center p-4",children:h.jsx(cn,{className:"inline animate-spin size-6"})}),h.jsxs("div",{className:"flex flex-col gap-4",children:[h.jsxs("div",{className:"flex flex-col gap-3",children:[h.jsx(sr,{htmlFor:"banReason",children:"Reason"}),h.jsxs("div",{className:"flex gap-1",children:[h.jsx(ln,{id:"banReason",ref:s,placeholder:"The reason for the ban, rule violated, etc.",className:"w-full",disabled:n,autoFocus:!0}),h.jsxs(Pfe,{onValueChange:g,disabled:n,children:[h.jsx(W$,{className:"tracking-wide",children:h.jsx("button",{className:ie("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:h.jsx(XQ,{className:"size-5"})})}),h.jsx(Y$,{className:"tracking-wide w-[calc(100vw-1rem)] sm:max-w-screen-sm",align:"end",children:_})]})]})]}),h.jsxs("div",{className:"flex flex-col gap-3",children:[h.jsx(sr,{htmlFor:"durationSelect",children:"Duration"}),h.jsxs("div",{className:"space-y-1",children:[h.jsxs($i,{onValueChange:c,value:l,disabled:n,children:[h.jsx(li,{id:"durationSelect",className:"tracking-wide",children:h.jsx(Fi,{placeholder:"Select Duration"})}),h.jsxs(ci,{className:"tracking-wide",children:[h.jsx(Ue,{value:"custom",className:"font-bold",children:"Custom (set below)"}),h.jsx(Ue,{value:"2 hours",children:"2 HOURS"}),h.jsx(Ue,{value:"8 hours",children:"8 HOURS"}),h.jsx(Ue,{value:"1 day",children:"1 DAY"}),h.jsx(Ue,{value:"2 days",children:"2 DAYS"}),h.jsx(Ue,{value:"1 week",children:"1 WEEK"}),h.jsx(Ue,{value:"2 weeks",children:"2 WEEKS"}),h.jsx(Ue,{value:"permanent",className:"font-bold",children:"Permanent"})]})]}),h.jsxs("div",{className:"flex flex-row gap-2",children:[h.jsx(ln,{id:"durationMultiplier",type:"number",placeholder:"123",required:!0,disabled:l!=="custom"||n,ref:a}),h.jsxs($i,{onValueChange:u,value:d,children:[h.jsx(li,{className:"tracking-wide",id:"durationUnits",disabled:l!=="custom"||n,children:h.jsx(Fi,{})}),h.jsxs(ci,{className:"tracking-wide",children:[h.jsx(Ue,{value:"hours",children:"HOURS"}),h.jsx(Ue,{value:"days",children:"DAYS"}),h.jsx(Ue,{value:"weeks",children:"WEEKS"}),h.jsx(Ue,{value:"months",children:"MONTHS"})]})]})]})]})]})]})});function Ofe(){const e=C.useRef(null),t=C.useRef(null),[n,r]=C.useState(!1),{hasPerm:i}=di(),s=qt({method:"GET",path:"/settings/banTemplates",throwGenericErrors:!0}),a=qt({method:"POST",path:"/history/addLegacyBan",throwGenericErrors:!0}),o=()=>{if(!e.current||!t.current)return;const{reason:d,duration:u}=t.current.getData();if(!d||d.length<3){sn.warning("The reason must be at least 3 characters long."),t.current.focusReason();return}const f=e.current.value;if(!f){sn.warning("You must enter at least one identifier."),e.current.focus();return}const g=f.toLowerCase().split(/[,;\s\n]+/g).map(x=>x.trim()).filter(Boolean);if(!g.length){sn.warning("You must enter at least one valid identifier."),e.current.focus();return}r(!0),a({data:{identifiers:g,reason:d,duration:u},toastLoadingMessage:"Banning identifiers...",genericHandler:{successMsg:"Identifiers banned."},success:x=>{r(!1),e.current.value="",e.current.focus()},error:x=>{r(!1),e.current.focus()}})},l=U5("/settings/banTemplates",async()=>{const d=await s({});if(!d)throw new Error("No data returned");return d}),c=i("players.ban");return h.jsxs("div",{className:"space-y-4 w-full max-w-screen-lg mx-auto px-2 md:px-0",children:[h.jsxs("div",{className:"px-2 md:px-0",children:[h.jsx("h1",{className:"text-3xl mb-2",children:"Ban Identifiers"}),h.jsxs("p",{children:["Here you can ban specific player identifiers (like ",h.jsx(Mn,{children:"license"})," and ",h.jsx(Mn,{children:"discord"}),") without having to search for a registered player.",h.jsx("br",{}),"Bans without a single ",h.jsx(Mn,{children:"license"})," identifier are considered ",h.jsx("em",{children:"Legacy Bans"})," and should be avoided if possible. ",h.jsx("br",{}),c?null:h.jsxs("span",{className:"text-warning-inline",children:["You need the ",h.jsx(Mn,{className:"text-warning-inline",children:"Player: Ban"})," permission to use this feature."]})]})]}),h.jsxs("div",{className:"grid lg:grid-cols-2 gap-4 border bg-card p-4 rounded-lg",children:[h.jsxs("div",{className:"flex flex-col gap-3",children:[h.jsx(sr,{htmlFor:"banIdentifiers",children:"Identifiers"}),h.jsx(oy,{ref:e,className:"h-full",disabled:n||!c,placeholder:"discord:xxxx, fivem:xxxx, license:xxxx, steam:xxxx, etc..."})]}),h.jsx(K$,{ref:t,banTemplates:l.data,disabled:n||!c})]}),h.jsxs("div",{className:"flex place-content-center gap-4",children:[h.jsx(Ke,{size:"sm",variant:"outline",disabled:n||!c,onClick:()=>{var d;(d=t.current)==null||d.clearData()},children:"Clear"}),h.jsx(Ke,{size:"sm",variant:"destructive",disabled:n||!c,onClick:o,children:n?h.jsxs("span",{className:"flex items-center leading-relaxed",children:[h.jsx(cn,{className:"inline animate-spin h-4"})," Banning..."]}):"Apply Ban"})]})]})}var G$={exports:{}},Ife="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",$fe=Ife,Ffe=$fe;function X$(){}function Q$(){}Q$.resetWarningCache=X$;var Bfe=function(){function e(r,i,s,a,o,l){if(l!==Ffe){var c=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 c.name="Invariant Violation",c}}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:Q$,resetWarningCache:X$};return n.PropTypes=n,n};G$.exports=Bfe();var zfe=G$.exports;const se=bn(zfe);var Ufe=Object.defineProperty,Hfe=(e,t)=>{for(var n in t)Ufe(e,n,{get:t[n],enumerable:!0})},Ui={};Hfe(Ui,{assign:()=>qfe,colors:()=>sa,createStringInterpolator:()=>t3,skipAnimation:()=>iF,to:()=>rF,willAdvance:()=>n3});var Gk=Kp(),He=e=>Yp(e,Gk),Xk=Kp();He.write=e=>Yp(e,Xk);var ay=Kp();He.onStart=e=>Yp(e,ay);var Qk=Kp();He.onFrame=e=>Yp(e,Qk);var Jk=Kp();He.onFinish=e=>Yp(e,Jk);var ru=[];He.setTimeout=(e,t)=>{const n=He.now()+t,r=()=>{const s=ru.findIndex(a=>a.cancel==r);~s&&ru.splice(s,1),Vo-=~s?1:0},i={time:n,handler:e,cancel:r};return ru.splice(J$(n),0,i),Vo+=1,Z$(),i};var J$=e=>~(~ru.findIndex(t=>t.time>e)||~ru.length);He.cancel=e=>{ay.delete(e),Qk.delete(e),Jk.delete(e),Gk.delete(e),Xk.delete(e)};He.sync=e=>{K2=!0,He.batchedUpdates(e),K2=!1};He.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function r(...i){t=i,He.onStart(n)}return r.handler=e,r.cancel=()=>{ay.delete(n),t=null},r};var Zk=typeof window<"u"?window.requestAnimationFrame:()=>{};He.use=e=>Zk=e;He.now=typeof performance<"u"?()=>performance.now():Date.now;He.batchedUpdates=e=>e();He.catch=console.error;He.frameLoop="always";He.advance=()=>{He.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):tF()};var Wo=-1,Vo=0,K2=!1;function Yp(e,t){K2?(t.delete(e),e(0)):(t.add(e),Z$())}function Z$(){Wo<0&&(Wo=0,He.frameLoop!=="demand"&&Zk(eF))}function Wfe(){Wo=-1}function eF(){~Wo&&(Zk(eF),He.batchedUpdates(tF))}function tF(){const e=Wo;Wo=He.now();const t=J$(Wo);if(t&&(nF(ru.splice(0,t),n=>n.handler()),Vo-=t),!Vo){Wfe();return}ay.flush(),Gk.flush(e?Math.min(64,Wo-e):16.667),Qk.flush(),Xk.flush(),Jk.flush()}function Kp(){let e=new Set,t=e;return{add(n){Vo+=t==e&&!e.has(n)?1:0,e.add(n)},delete(n){return Vo-=t==e&&e.has(n)?1:0,e.delete(n)},flush(n){t.size&&(e=new Set,Vo-=t.size,nF(t,r=>r(n)&&e.add(r)),Vo+=e.size,t=e)}}}function nF(e,t){e.forEach(n=>{try{t(n)}catch(r){He.catch(r)}})}function G2(){}var Vfe=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),he={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 Ps(e,t){if(he.arr(e)){if(!he.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 Be=(e,t)=>e.forEach(t);function ys(e,t,n){if(he.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=>he.und(e)?[]:he.arr(e)?e:[e];function ff(e,t){if(e.size){const n=Array.from(e);e.clear(),Be(n,t)}}var Wh=(e,...t)=>ff(e,n=>n(...t)),e3=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),t3,rF,sa=null,iF=!1,n3=G2,qfe=e=>{e.to&&(rF=e.to),e.now&&(He.now=e.now),e.colors!==void 0&&(sa=e.colors),e.skipAnimation!=null&&(iF=e.skipAnimation),e.createStringInterpolator&&(t3=e.createStringInterpolator),e.requestAnimationFrame&&He.use(e.requestAnimationFrame),e.batchedUpdates&&(He.batchedUpdates=e.batchedUpdates),e.willAdvance&&(n3=e.willAdvance),e.frameLoop&&(He.frameLoop=e.frameLoop)},pf=new Set,Zr=[],Qx=[],lv=0,ly={get idle(){return!pf.size&&!Zr.length},start(e){lv>e.priority?(pf.add(e),He.onStart(Yfe)):(sF(e),He(X2))},advance:X2,sort(e){if(lv)He.onFrame(()=>ly.sort(e));else{const t=Zr.indexOf(e);~t&&(Zr.splice(t,1),oF(e))}},clear(){Zr=[],pf.clear()}};function Yfe(){pf.forEach(sF),pf.clear(),He(X2)}function sF(e){Zr.includes(e)||oF(e)}function oF(e){Zr.splice(Kfe(Zr,t=>t.priority>e.priority),0,e)}function X2(e){const t=Qx;for(let n=0;n<Zr.length;n++){const r=Zr[n];lv=r.priority,r.idle||(n3(r),r.advance(e),r.idle||t.push(r))}return lv=0,Qx=Zr,Qx.length=0,Zr=t,Zr.length>0}function Kfe(e,t){const n=e.findIndex(t);return n<0?e.length:n}var Gfe=(e,t,n)=>Math.min(Math.max(n,e),t),Xfe={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},Ri="[-+]?\\d*\\.?\\d+",cv=Ri+"%";function cy(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var Qfe=new RegExp("rgb"+cy(Ri,Ri,Ri)),Jfe=new RegExp("rgba"+cy(Ri,Ri,Ri,Ri)),Zfe=new RegExp("hsl"+cy(Ri,cv,cv)),epe=new RegExp("hsla"+cy(Ri,cv,cv,Ri)),tpe=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,npe=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,rpe=/^#([0-9a-fA-F]{6})$/,ipe=/^#([0-9a-fA-F]{8})$/;function spe(e){let t;return typeof e=="number"?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=rpe.exec(e))?parseInt(t[1]+"ff",16)>>>0:sa&&sa[e]!==void 0?sa[e]:(t=Qfe.exec(e))?(mc(t[1])<<24|mc(t[2])<<16|mc(t[3])<<8|255)>>>0:(t=Jfe.exec(e))?(mc(t[1])<<24|mc(t[2])<<16|mc(t[3])<<8|$R(t[4]))>>>0:(t=tpe.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=ipe.exec(e))?parseInt(t[1],16)>>>0:(t=npe.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Zfe.exec(e))?(OR(IR(t[1]),Xm(t[2]),Xm(t[3]))|255)>>>0:(t=epe.exec(e))?(OR(IR(t[1]),Xm(t[2]),Xm(t[3]))|$R(t[4]))>>>0:null}function Jx(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 OR(e,t,n){const r=n<.5?n*(1+t):n+t-n*t,i=2*n-r,s=Jx(i,r,e+1/3),a=Jx(i,r,e),o=Jx(i,r,e-1/3);return Math.round(s*255)<<24|Math.round(a*255)<<16|Math.round(o*255)<<8}function mc(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function IR(e){return(parseFloat(e)%360+360)%360/360}function $R(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(t*255)}function Xm(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function FR(e){let t=spe(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 Jf=(e,t,n)=>{if(he.fun(e))return e;if(he.arr(e))return Jf({range:e,output:t,extrapolate:n});if(he.str(e.output[0]))return t3(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||(c=>c);return c=>{const d=ape(c,s);return ope(c,s[d],s[d+1],i[d],i[d+1],l,a,o,r.map)}};function ope(e,t,n,r,i,s,a,o,l){let c=l?l(e):e;if(c<t){if(a==="identity")return c;a==="clamp"&&(c=t)}if(c>n){if(o==="identity")return c;o==="clamp"&&(c=n)}return r===i?r:t===n?e<=t?r:i:(t===-1/0?c=-c:n===1/0?c=c-t:c=(c-t)/(n-t),c=s(c),r===-1/0?c=-c:i===1/0?c=c+r:c=c*(i-r)+r,c)}function ape(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}var lpe=(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 Gfe(0,1,i/e)},uv=1.70158,Qm=uv*1.525,BR=uv+1,zR=2*Math.PI/3,UR=2*Math.PI/4.5,Jm=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,cpe={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=>BR*e*e*e-uv*e*e,easeOutBack:e=>1+BR*Math.pow(e-1,3)+uv*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*((Qm+1)*2*e-Qm)/2:(Math.pow(2*e-2,2)*((Qm+1)*(e*2-2)+Qm)+2)/2,easeInElastic:e=>e===0?0:e===1?1:-Math.pow(2,10*e-10)*Math.sin((e*10-10.75)*zR),easeOutElastic:e=>e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e*10-.75)*zR)+1,easeInOutElastic:e=>e===0?0:e===1?1:e<.5?-(Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*UR))/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*UR)/2+1,easeInBounce:e=>1-Jm(1-e),easeOutBounce:Jm,easeInOutBounce:e=>e<.5?(1-Jm(1-2*e))/2:(1+Jm(2*e-1))/2,steps:lpe},Zf=Symbol.for("FluidValue.get"),Iu=Symbol.for("FluidValue.observers"),Xr=e=>!!(e&&e[Zf]),fr=e=>e&&e[Zf]?e[Zf]():e,HR=e=>e[Iu]||null;function upe(e,t){e.eventObserved?e.eventObserved(t):e(t)}function ep(e,t){const n=e[Iu];n&&n.forEach(r=>{upe(r,t)})}var aF=class{constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");dpe(this,e)}},dpe=(e,t)=>lF(e,Zf,t);function Rd(e,t){if(e[Zf]){let n=e[Iu];n||lF(e,Iu,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function tp(e,t){const n=e[Iu];if(n&&n.has(t)){const r=n.size-1;r?n.delete(t):e[Iu]=null,e.observerRemoved&&e.observerRemoved(r,t)}}var lF=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Fg=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,hpe=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,WR=new RegExp(`(${Fg.source})(%|[a-z]+)`,"i"),fpe=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,uy=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,cF=e=>{const[t,n]=ppe(e);if(!t||e3())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&&uy.test(n))return cF(n);if(n)return n}return e},ppe=e=>{const t=uy.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]},Zx,mpe=(e,t,n,r,i)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(r)}, ${i})`,uF=e=>{Zx||(Zx=sa?new RegExp(`(${Object.keys(sa).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map(s=>fr(s).replace(uy,cF).replace(hpe,FR).replace(Zx,FR)),n=t.map(s=>s.match(Fg).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=>Jf({...e,output:s}));return s=>{var l;const a=!WR.test(t[0])&&((l=t.find(c=>WR.test(c)))==null?void 0:l.replace(Fg,""));let o=0;return t[0].replace(Fg,()=>`${i[o++](s)}${a||""}`).replace(fpe,mpe)}},r3="react-spring: ",dF=e=>{const t=e;let n=!1;if(typeof t!="function")throw new TypeError(`${r3}once requires a function parameter`);return(...r)=>{n||(t(...r),n=!0)}},gpe=dF(console.warn);function vpe(){gpe(`${r3}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var ype=dF(console.warn);function _pe(){ype(`${r3}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 dy(e){return he.str(e)&&(e[0]=="#"||/\d/.test(e)||!e3()&&uy.test(e)||e in(sa||{}))}var Ha=e3()?C.useEffect:C.useLayoutEffect,xpe=()=>{const e=C.useRef(!1);return Ha(()=>(e.current=!0,()=>{e.current=!1}),[]),e};function i3(){const e=C.useState()[1],t=xpe();return()=>{t.current&&e(Math.random())}}function bpe(e,t){const[n]=C.useState(()=>({inputs:t,result:e()})),r=C.useRef(),i=r.current;let s=i;return s?t&&s.inputs&&wpe(t,s.inputs)||(s={inputs:t,result:e()}):s=n,C.useEffect(()=>{r.current=s,i==n&&(n.inputs=n.result=void 0)},[s]),s.result}function wpe(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 s3=e=>C.useEffect(e,Spe),Spe=[];function Q2(e){const t=C.useRef();return C.useEffect(()=>{t.current=e}),t.current}var np=Symbol.for("Animated:node"),Cpe=e=>!!e&&e[np]===e,Ji=e=>e&&e[np],o3=(e,t)=>Vfe(e,np,t),hy=e=>e&&e[np]&&e[np].getPayload(),hF=class{constructor(){o3(this,this)}getPayload(){return this.payload||[]}},Gp=class extends hF{constructor(e){super(),this._value=e,this.done=!0,this.durationProgress=0,he.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new Gp(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return he.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,he.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},rp=class extends Gp{constructor(e){super(0),this._string=null,this._toString=Jf({output:[e,e]})}static create(e){return new rp(e)}getValue(){const e=this._string;return e??(this._string=this._toString(this._value))}setValue(e){if(he.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=Jf({output:[this.getValue(),e]})),this._value=0,super.reset()}},dv={dependencies:null},fy=class extends hF{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return ys(this.source,(n,r)=>{Cpe(n)?t[r]=n.getValue(e):Xr(n)?t[r]=fr(n):e||(t[r]=n)}),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Be(this.payload,e=>e.reset())}_makePayload(e){if(e){const t=new Set;return ys(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){dv.dependencies&&Xr(e)&&dv.dependencies.add(e);const t=hy(e);t&&Be(t,n=>this.add(n))}},fF=class extends fy{constructor(e){super(e)}static create(e){return new fF(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(kpe)),!0)}};function kpe(e){return(dy(e)?rp:Gp).create(e)}function J2(e){const t=Ji(e);return t?t.constructor:he.arr(e)?fF:dy(e)?rp:Gp}var VR=(e,t)=>{const n=!he.fun(e)||e.prototype&&e.prototype.isReactComponent;return C.forwardRef((r,i)=>{const s=C.useRef(null),a=n&&C.useCallback(x=>{s.current=Mpe(i,x)},[i]),[o,l]=Tpe(r,t),c=i3(),d=()=>{const x=s.current;if(n&&!x)return;(x?t.applyAnimatedValues(x,o.getValue(!0)):!1)===!1&&c()},u=new Epe(d,l),f=C.useRef();Ha(()=>(f.current=u,Be(l,x=>Rd(x,u)),()=>{f.current&&(Be(f.current.deps,x=>tp(x,f.current)),He.cancel(f.current.update))})),C.useEffect(d,[]),s3(()=>()=>{const x=f.current;Be(x.deps,_=>tp(_,x))});const g=t.getComponentProps(o.getValue());return C.createElement(e,{...g,ref:a})})},Epe=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){e.type=="change"&&He.write(this.update)}};function Tpe(e,t){const n=new Set;return dv.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new fy(e),dv.dependencies=null,[e,n]}function Mpe(e,t){return e&&(he.fun(e)?e(t):e.current=t),t}var qR=Symbol.for("AnimatedComponent"),Rpe=(e,{applyAnimatedValues:t=()=>!1,createAnimatedStyle:n=i=>new fy(i),getComponentProps:r=i=>i}={})=>{const i={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:r},s=a=>{const o=YR(a)||"Anonymous";return he.str(a)?a=s[a]||(s[a]=VR(a,i)):a=a[qR]||(a[qR]=VR(a,i)),a.displayName=`Animated(${o})`,a};return ys(e,(a,o)=>{he.arr(e)&&(o=YR(a)),s[o]=s(a)}),{animated:s}},YR=e=>he.str(e)?e:e&&he.str(e.displayName)?e.displayName:he.fun(e)&&e.name||null;function pr(e,...t){return he.fun(e)?e(...t):e}var mf=(e,t)=>e===!0||!!(t&&e&&(he.fun(e)?e(t):rr(e).includes(t))),pF=(e,t)=>he.obj(e)?t&&e[t]:e,mF=(e,t)=>e.default===!0?e[t]:e.default?e.default[t]:void 0,Ape=e=>e,py=(e,t=Ape)=>{let n=Dpe;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);he.und(s)||(r[i]=s)}return r},Dpe=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Lpe={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 jpe(e){const t={};let n=0;if(ys(e,(r,i)=>{Lpe[i]||(t[i]=r,n++)}),n)return t}function a3(e){const t=jpe(e);if(t){const n={to:t};return ys(e,(r,i)=>i in t||(n[i]=r)),n}return{...e}}function ip(e){return e=fr(e),he.arr(e)?e.map(ip):dy(e)?Ui.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function gF(e){for(const t in e)return!0;return!1}function Z2(e){return he.fun(e)||he.arr(e)&&he.obj(e[0])}function eS(e,t){var n;(n=e.ref)==null||n.delete(e),t==null||t.delete(e)}function vF(e,t){var n;t&&e.ref!==t&&((n=e.ref)==null||n.delete(e),t.add(e),e.ref=t)}var l3={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}},tS={...l3.default,mass:1,damping:1,easing:cpe.linear,clamp:!1},Ppe=class{constructor(){this.velocity=0,Object.assign(this,tS)}};function Npe(e,t,n){n&&(n={...n},KR(n,t),t={...n,...t}),KR(e,t),Object.assign(e,t);for(const a in tS)e[a]==null&&(e[a]=tS[a]);let{frequency:r,damping:i}=e;const{mass:s}=e;return he.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 KR(e,t){if(!he.und(t.decay))e.duration=void 0;else{const n=!he.und(t.tension)||!he.und(t.friction);(n||!he.und(t.frequency)||!he.und(t.damping)||!he.und(t.mass))&&(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}}var GR=[],Ope=class{constructor(){this.changed=!1,this.values=GR,this.toValues=null,this.fromValues=GR,this.config=new Ppe,this.immediate=!1}};function yF(e,{key:t,props:n,defaultProps:r,state:i,actions:s}){return new Promise((a,o)=>{let l,c,d=mf(n.cancel??(r==null?void 0:r.cancel),t);if(d)g();else{he.und(n.pause)||(i.paused=mf(n.pause,t));let x=r==null?void 0:r.pause;x!==!0&&(x=i.paused||mf(x,t)),l=pr(n.delay||0,t),x?(i.resumeQueue.add(f),s.pause()):(s.resume(),f())}function u(){i.resumeQueue.add(f),i.timeouts.delete(c),c.cancel(),l=c.time-He.now()}function f(){l>0&&!Ui.skipAnimation?(i.delayed=!0,c=He.setTimeout(g,l),i.pauseQueue.add(u),i.timeouts.add(c)):g()}function g(){i.delayed&&(i.delayed=!1),i.pauseQueue.delete(u),i.timeouts.delete(c),e<=(i.cancelId||0)&&(d=!0);try{s.start({...n,callId:e,cancel:d},a)}catch(x){o(x)}}})}var c3=(e,t)=>t.length==1?t[0]:t.some(n=>n.cancelled)?iu(e.get()):t.every(n=>n.noop)?_F(e.get()):Ei(e.get(),t.every(n=>n.finished)),_F=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),Ei=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),iu=e=>({value:e,cancelled:!0,finished:!1});function xF(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 c=py(t,(v,p)=>p==="onRest"?void 0:v);let d,u;const f=new Promise((v,p)=>(d=v,u=p)),g=v=>{const p=i<=(n.cancelId||0)&&iu(r)||i!==n.asyncId&&Ei(r,!1);if(p)throw v.result=p,u(v),v},x=(v,p)=>{const m=new XR,y=new QR;return(async()=>{if(Ui.skipAnimation)throw sp(n),y.result=Ei(r,!1),u(y),y;g(m);const b=he.obj(v)?{...v}:{...p,to:v};b.parentId=i,ys(c,(w,E)=>{he.und(b[E])&&(b[E]=w)});const S=await r.start(b);return g(m),n.paused&&await new Promise(w=>{n.resumeQueue.add(w)}),S})()};let _;if(Ui.skipAnimation)return sp(n),Ei(r,!1);try{let v;he.arr(e)?v=(async p=>{for(const m of p)await x(m)})(e):v=Promise.resolve(e(x,r.stop.bind(r))),await Promise.all([v.then(d),f]),_=Ei(r.get(),!0,!1)}catch(v){if(v instanceof XR)_=v.result;else if(v instanceof QR)_=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 he.fun(a)&&He.batchedUpdates(()=>{a(_,r,r.item)}),_})()}function sp(e,t){ff(e.timeouts,n=>n.cancel()),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var XR=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.")}},QR=class extends Error{constructor(){super("SkipAnimationSignal")}},nS=e=>e instanceof u3,Ipe=1,u3=class extends aF{constructor(){super(...arguments),this.id=Ipe++,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){const e=Ji(this);return e&&e.getValue()}to(...e){return Ui.to(this,e)}interpolate(...e){return vpe(),Ui.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){ep(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||ly.sort(this),ep(this,{type:"priority",parent:this,priority:e})}},bl=Symbol.for("SpringPhase"),bF=1,rS=2,iS=4,eb=e=>(e[bl]&bF)>0,_o=e=>(e[bl]&rS)>0,ah=e=>(e[bl]&iS)>0,JR=(e,t)=>t?e[bl]|=rS|bF:e[bl]&=~rS,ZR=(e,t)=>t?e[bl]|=iS:e[bl]&=~iS,$pe=class extends u3{constructor(e,t){if(super(),this.animation=new Ope,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,!he.und(e)||!he.und(t)){const n=he.obj(e)?{...e}:{...t,from:e};he.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(_o(this)||this._state.asyncTo)||ah(this)}get goal(){return fr(this.animation.to)}get velocity(){const e=Ji(this);return e instanceof Gp?e.lastVelocity||0:e.getPayload().map(t=>t.lastVelocity||0)}get hasAnimated(){return eb(this)}get isAnimating(){return _o(this)}get isPaused(){return ah(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=hy(r.to);!a&&Xr(r.to)&&(i=rr(fr(r.to))),r.values.forEach((c,d)=>{if(c.done)return;const u=c.constructor==rp?1:a?a[d].lastPosition:i[d];let f=r.immediate,g=u;if(!f){if(g=c.lastPosition,s.tension<=0){c.done=!0;return}let x=c.elapsedTime+=e;const _=r.fromValues[d],v=c.v0!=null?c.v0:c.v0=he.arr(s.velocity)?s.velocity[d]:s.velocity;let p;const m=s.precision||(_==u?.005:Math.min(1,Math.abs(u-_)*.001));if(he.und(s.duration))if(s.decay){const y=s.decay===!0?.998:s.decay,b=Math.exp(-(1-y)*x);g=_+v/(1-y)*(1-b),f=Math.abs(c.lastPosition-g)<=m,p=v*b}else{p=c.lastVelocity==null?v:c.lastVelocity;const y=s.restVelocity||m/10,b=s.clamp?0:s.bounce,S=!he.und(b),w=_==u?c.v0>0:_<u;let E,k=!1;const T=1,R=Math.ceil(e/T);for(let M=0;M<R&&(E=Math.abs(p)>y,!(!E&&(f=Math.abs(u-g)<=m,f)));++M){S&&(k=g==u||g>u==w,k&&(p=-p*b,g=u));const L=-s.tension*1e-6*(g-u),j=-s.friction*.001*p,P=(L+j)/s.mass;p=p+P*T,g=g+p*T}}else{let y=1;s.duration>0&&(this._memoizedDuration!==s.duration&&(this._memoizedDuration=s.duration,c.durationProgress>0&&(c.elapsedTime=s.duration*c.durationProgress,x=c.elapsedTime+=e)),y=(s.progress||0)+x/this._memoizedDuration,y=y>1?1:y<0?0:y,c.durationProgress=y),g=_+s.easing(y)*(u-_),p=(g-c.lastPosition)/e,f=y==1}c.lastVelocity=p,Number.isNaN(g)&&(console.warn("Got NaN while animating:",this),f=!0)}a&&!a[d].done&&(f=!1),f?c.done=!0:t=!1,c.setValue(g,s.round)&&(n=!0)});const o=Ji(this),l=o.getValue();if(t){const c=fr(r.to);(l!==c||n)&&!s.decay?(o.setValue(c),this._onChange(c)):n&&s.decay&&this._onChange(l),this._stop()}else n&&this._onChange(l)}set(e){return He.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(_o(this)){const{to:e,config:t}=this.animation;He.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 he.und(e)?(n=this.queue||[],this.queue=[]):n=[he.obj(e)?e:{...t,to:e}],Promise.all(n.map(r=>this._update(r))).then(r=>c3(this,r))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),sp(this._state,e&&this._lastCallId),He.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=he.obj(n)?n[t]:n,(n==null||Z2(n))&&(n=void 0),r=he.obj(r)?r[t]:r,r==null&&(r=void 0);const i={to:n,from:r};return eb(this)||(e.reverse&&([n,r]=[r,n]),r=fr(r),he.und(r)?Ji(this)||this._set(n):this._set(r)),i}_update({...e},t){const{key:n,defaultProps:r}=this;e.default&&Object.assign(r,py(e,(a,o)=>/^on/.test(o)?pF(a,n):a)),tA(this,e,"onProps"),ch(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 yF(++this._lastCallId,{key:n,props:e,defaultProps:r,state:s,actions:{pause:()=>{ah(this)||(ZR(this,!0),Wh(s.pauseQueue),ch(this,"onPause",Ei(this,lh(this,this.animation.to)),this))},resume:()=>{ah(this)&&(ZR(this,!1),_o(this)&&this._resume(),Wh(s.resumeQueue),ch(this,"onResume",Ei(this,lh(this,this.animation.to)),this))},start:this._merge.bind(this,i)}}).then(a=>{if(e.loop&&a.finished&&!(t&&a.noop)){const o=wF(e);if(o)return this._update(o,!0)}return a})}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(iu(this));const r=!he.und(e.to),i=!he.und(e.from);if(r||i)if(t.callId>this._lastToId)this._lastToId=t.callId;else return n(iu(this));const{key:s,defaultProps:a,animation:o}=this,{to:l,from:c}=o;let{to:d=l,from:u=c}=e;i&&!r&&(!t.default||he.und(d))&&(d=u),t.reverse&&([d,u]=[u,d]);const f=!Ps(u,c);f&&(o.from=u),u=fr(u);const g=!Ps(d,l);g&&this._focus(d);const x=Z2(t.to),{config:_}=o,{decay:v,velocity:p}=_;(r||i)&&(_.velocity=0),t.config&&!x&&Npe(_,pr(t.config,s),t.config!==a.config?pr(a.config,s):void 0);let m=Ji(this);if(!m||he.und(d))return n(Ei(this,!0));const y=he.und(t.reset)?i&&!t.default:!he.und(u)&&mf(t.reset,s),b=y?u:this.get(),S=ip(d),w=he.num(S)||he.arr(S)||dy(S),E=!x&&(!w||mf(a.immediate||t.immediate,s));if(g){const M=J2(d);if(M!==m.constructor)if(E)m=this._set(S);else throw Error(`Cannot animate between ${m.constructor.name} and ${M.name}, as the "to" prop suggests`)}const k=m.constructor;let T=Xr(d),R=!1;if(!T){const M=y||!eb(this)&&f;(g||M)&&(R=Ps(ip(b),S),T=!R),(!Ps(o.immediate,E)&&!E||!Ps(_.decay,v)||!Ps(_.velocity,p))&&(T=!0)}if(R&&_o(this)&&(o.changed&&!y?T=!0:T||this._stop(l)),!x&&((T||Xr(l))&&(o.values=m.getPayload(),o.toValues=Xr(d)?null:k==rp?[1]:rr(S)),o.immediate!=E&&(o.immediate=E,!E&&!y&&this._set(l)),T)){const{onRest:M}=o;Be(Bpe,j=>tA(this,t,j));const L=Ei(this,lh(this,l));Wh(this._pendingCalls,L),this._pendingCalls.add(n),o.changed&&He.batchedUpdates(()=>{var j;o.changed=!y,M==null||M(L,this),y?pr(a.onRest,L):(j=o.onStart)==null||j.call(o,L,this)})}y&&this._set(b),x?n(xF(t.to,t,this._state,this)):T?this._start():_o(this)&&!g?this._pendingCalls.add(n):n(_F(b))}_focus(e){const t=this.animation;e!==t.to&&(HR(this)&&this._detach(),t.to=e,HR(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;Xr(t)&&(Rd(t,this),nS(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;Xr(e)&&tp(e,this)}_set(e,t=!0){const n=fr(e);if(!he.und(n)){const r=Ji(this);if(!r||!Ps(n,r.getValue())){const i=J2(n);!r||r.constructor!=i?o3(this,i.create(n)):r.setValue(n),r&&He.batchedUpdates(()=>{this._onChange(n,t)})}}return Ji(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,ch(this,"onStart",Ei(this,lh(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),pr(this.animation.onChange,e,this)),pr(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;Ji(this).reset(fr(e.to)),e.immediate||(e.fromValues=e.values.map(t=>t.lastPosition)),_o(this)||(JR(this,!0),ah(this)||this._resume())}_resume(){Ui.skipAnimation?this.finish():ly.start(this)}_stop(e,t){if(_o(this)){JR(this,!1);const n=this.animation;Be(n.values,i=>{i.done=!0}),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),ep(this,{type:"idle",parent:this});const r=t?iu(this.get()):Ei(this.get(),lh(this,e??n.to));Wh(this._pendingCalls,r),n.changed&&(n.changed=!1,ch(this,"onRest",r,this))}}};function lh(e,t){const n=ip(t),r=ip(e.get());return Ps(r,n)}function wF(e,t=e.loop,n=e.to){const r=pr(t);if(r){const i=r!==!0&&a3(r),s=(i||e).reverse,a=!i||i.reset;return op({...e,loop:t,default:!1,pause:void 0,to:!s||Z2(n)?n:void 0,from:a?e.from:void 0,reset:a,...i})}}function op(e){const{to:t,from:n}=e=a3(e),r=new Set;return he.obj(t)&&eA(t,r),he.obj(n)&&eA(n,r),e.keys=r.size?Array.from(r):null,e}function Fpe(e){const t=op(e);return he.und(t.default)&&(t.default=py(t)),t}function eA(e,t){ys(e,(n,r)=>n!=null&&t.add(r))}var Bpe=["onStart","onRest","onChange","onPause","onResume"];function tA(e,t,n){e.animation[n]=t[n]!==mF(t,n)?pF(t[n],e.key):void 0}function ch(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 zpe=["onStart","onChange","onRest"],Upe=1,SF=class{constructor(e,t){this.id=Upe++,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];he.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(op(e)),this}start(e){let{queue:t}=this;return e?t=rr(e).map(op):this.queue=[],this._flush?this._flush(this,t):(MF(this,t),sS(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;Be(rr(t),r=>n[r].stop(!!e))}else sp(this._state,this._lastAsyncId),this.each(n=>n.stop(!!e));return this}pause(e){if(he.und(e))this.start({pause:!0});else{const t=this.springs;Be(rr(e),n=>t[n].pause())}return this}resume(e){if(he.und(e))this.start({pause:!1});else{const t=this.springs;Be(rr(e),n=>t[n].resume())}return this}each(e){ys(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,ff(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&&ff(t,([o,l])=>{l.value=a,o(l,this,this._item)}),s&&(this._started=!1,ff(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;He.onFrame(this._onFrame)}};function sS(e,t){return Promise.all(t.map(n=>CF(e,n))).then(n=>c3(e,n))}async function CF(e,t,n){const{keys:r,to:i,from:s,loop:a,onRest:o,onResolve:l}=t,c=he.obj(t.default)&&t.default;a&&(t.loop=!1),i===!1&&(t.to=null),s===!1&&(t.from=null);const d=he.arr(i)||he.fun(i)?i:void 0;d?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):Be(zpe,_=>{const v=t[_];if(he.fun(v)){const p=e._events[_];t[_]=({finished:m,cancelled:y})=>{const b=p.get(v);b?(m||(b.finished=!1),y&&(b.cancelled=!0)):p.set(v,{value:null,finished:m||!1,cancelled:y||!1})},c&&(c[_]=t[_])}});const u=e._state;t.pause===!u.paused?(u.paused=t.pause,Wh(t.pause?u.pauseQueue:u.resumeQueue)):u.paused&&(t.pause=!0);const f=(r||Object.keys(e.springs)).map(_=>e.springs[_].start(t)),g=t.cancel===!0||mF(t,"cancel")===!0;(d||g&&u.asyncId)&&f.push(yF(++e._lastAsyncId,{props:t,state:u,actions:{pause:G2,resume:G2,start(_,v){g?(sp(u,e._lastAsyncId),v(iu(e))):(_.onRest=o,v(xF(d,_,u,e)))}}})),u.paused&&await new Promise(_=>{u.resumeQueue.add(_)});const x=c3(e,await Promise.all(f));if(a&&x.finished&&!(n&&x.noop)){const _=wF(t,a,i);if(_)return MF(e,[_]),CF(e,_,!0)}return l&&He.batchedUpdates(()=>l(x,e,e.item)),x}function oS(e,t){const n={...e.springs};return t&&Be(rr(t),r=>{he.und(r.keys)&&(r=op(r)),he.obj(r.to)||(r={...r,to:void 0}),TF(n,r,i=>EF(i))}),kF(e,n),n}function kF(e,t){ys(t,(n,r)=>{e.springs[r]||(e.springs[r]=n,Rd(n,e))})}function EF(e,t){const n=new $pe;return n.key=e,t&&Rd(n,t),n}function TF(e,t,n){t.keys&&Be(t.keys,r=>{(e[r]||(e[r]=n(r)))._prepareNode(t)})}function MF(e,t){Be(t,n=>{TF(e.springs,n,r=>EF(r,e))})}var Xp=({children:e,...t})=>{const n=C.useContext(hv),r=t.pause||!!n.pause,i=t.immediate||!!n.immediate;t=bpe(()=>({pause:r,immediate:i}),[r,i]);const{Provider:s}=hv;return C.createElement(s,{value:t},e)},hv=Hpe(Xp,{});Xp.Provider=hv.Provider;Xp.Consumer=hv.Consumer;function Hpe(e,t){return Object.assign(e,C.createContext(t)),e.Provider._context=e,e.Consumer._context=e,e}var RF=()=>{const e=[],t=function(r){_pe();const i=[];return Be(e,(s,a)=>{if(he.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 Be(e,r=>r.pause(...arguments)),this},t.resume=function(){return Be(e,r=>r.resume(...arguments)),this},t.set=function(r){Be(e,(i,s)=>{const a=he.fun(r)?r(s,i):r;a&&i.set(a)})},t.start=function(r){const i=[];return Be(e,(s,a)=>{if(he.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 Be(e,r=>r.stop(...arguments)),this},t.update=function(r){return Be(e,(i,s)=>i.update(this._getProps(r,i,s))),this};const n=function(r,i,s){return he.fun(r)?r(s,i):r};return t._getProps=n,t};function Wpe(e,t,n){const r=he.fun(t)&&t;r&&!n&&(n=[]);const i=C.useMemo(()=>r||arguments.length==3?RF():void 0,[]),s=C.useRef(0),a=i3(),o=C.useMemo(()=>({ctrls:[],queue:[],flush(p,m){const y=oS(p,m);return s.current>0&&!o.queue.length&&!Object.keys(y).some(S=>!p.springs[S])?sS(p,m):new Promise(S=>{kF(p,y),o.queue.push(()=>{S(sS(p,m))}),a()})}}),[]),l=C.useRef([...o.ctrls]),c=[],d=Q2(e)||0;C.useMemo(()=>{Be(l.current.slice(e,d),p=>{eS(p,i),p.stop(!0)}),l.current.length=e,u(d,e)},[e]),C.useMemo(()=>{u(0,Math.min(d,e))},n);function u(p,m){for(let y=p;y<m;y++){const b=l.current[y]||(l.current[y]=new SF(null,o.flush)),S=r?r(y,b):t[y];S&&(c[y]=Fpe(S))}}const f=l.current.map((p,m)=>oS(p,c[m])),g=C.useContext(Xp),x=Q2(g),_=g!==x&&gF(g);Ha(()=>{s.current++,o.ctrls=l.current;const{queue:p}=o;p.length&&(o.queue=[],Be(p,m=>m())),Be(l.current,(m,y)=>{i==null||i.add(m),_&&m.start({default:g});const b=c[y];b&&(vF(m,b.ref),m.ref?m.queue.push(b):m.start(b))})}),s3(()=>()=>{Be(o.ctrls,p=>p.stop(!0))});const v=f.map(p=>({...p}));return i?[v,i]:v}function lo(e,t){const n=he.fun(e),[[r],i]=Wpe(1,n?e:[e],n?[]:t);return n||arguments.length==2?[r,i]:r}function Hl(e,t,n){const r=he.fun(t)&&t,{reset:i,sort:s,trail:a=0,expires:o=!0,exitBeforeEnter:l=!1,onDestroyed:c,ref:d,config:u}=r?r():t,f=C.useMemo(()=>r||arguments.length==3?RF():void 0,[]),g=rr(e),x=[],_=C.useRef(null),v=i?null:_.current;Ha(()=>{_.current=x}),s3(()=>(Be(x,P=>{f==null||f.add(P.ctrl),P.ctrl.ref=f}),()=>{Be(_.current,P=>{P.expired&&clearTimeout(P.expirationId),eS(P.ctrl,f),P.ctrl.stop(!0)})}));const p=qpe(g,r?r():t,v),m=i&&_.current||[];Ha(()=>Be(m,({ctrl:P,item:$,key:F})=>{eS(P,f),pr(c,$,F)}));const y=[];if(v&&Be(v,(P,$)=>{P.expired?(clearTimeout(P.expirationId),m.push(P)):($=y[$]=p.indexOf(P.key),~$&&(x[$]=P))}),Be(g,(P,$)=>{x[$]||(x[$]={key:p[$],item:P,phase:"mount",ctrl:new SF},x[$].ctrl.item=P)}),y.length){let P=-1;const{leave:$}=r?r():t;Be(y,(F,W)=>{const I=v[W];~F?(P=x.indexOf(I),x[P]={...I,item:g[F]}):$&&x.splice(++P,0,I)})}he.fun(s)&&x.sort((P,$)=>s(P.item,$.item));let b=-a;const S=i3(),w=py(t),E=new Map,k=C.useRef(new Map),T=C.useRef(!1);Be(x,(P,$)=>{const F=P.key,W=P.phase,I=r?r():t;let A,D;const H=pr(I.delay||0,F);if(W=="mount")A=I.enter,D="enter";else{const ee=p.indexOf(F)<0;if(W!="leave")if(ee)A=I.leave,D="leave";else if(A=I.update)D="update";else return;else if(!ee)A=I.enter,D="enter";else return}if(A=pr(A,P.item,$),A=he.obj(A)?a3(A):{to:A},!A.config){const ee=u||w.config;A.config=pr(ee,P.item,$,D)}b+=a;const V={...w,delay:H+b,ref:d,immediate:I.immediate,reset:!1,...A};if(D=="enter"&&he.und(V.from)){const ee=r?r():t,Z=he.und(ee.initial)||v?ee.from:ee.initial;V.from=pr(Z,P.item,$)}const{onResolve:U}=V;V.onResolve=ee=>{pr(U,ee);const Z=_.current,q=Z.find(B=>B.key===F);if(q&&!(ee.cancelled&&q.phase!="update")&&q.ctrl.idle){const B=Z.every(O=>O.ctrl.idle);if(q.phase=="leave"){const O=pr(o,q.item);if(O!==!1){const z=O===!0?0:O;if(q.expired=!0,!B&&z>0){z<=2147483647&&(q.expirationId=setTimeout(S,z));return}}}B&&Z.some(O=>O.expired)&&(k.current.delete(q),l&&(T.current=!0),S())}};const G=oS(P.ctrl,V);D==="leave"&&l?k.current.set(P,{phase:D,springs:G,payload:V}):E.set(P,{phase:D,springs:G,payload:V})});const R=C.useContext(Xp),M=Q2(R),L=R!==M&&gF(R);Ha(()=>{L&&Be(x,P=>{P.ctrl.start({default:R})})},[R]),Be(E,(P,$)=>{if(k.current.size){const F=x.findIndex(W=>W.key===$.key);x.splice(F,1)}}),Ha(()=>{Be(k.current.size?k.current:E,({phase:P,payload:$},F)=>{const{ctrl:W}=F;F.phase=P,f==null||f.add(W),L&&P=="enter"&&W.start({default:R}),$&&(vF(W,$.ref),(W.ref||f)&&!T.current?W.update($):(W.start($),T.current&&(T.current=!1)))})},i?void 0:n);const j=P=>C.createElement(C.Fragment,null,x.map(($,F)=>{const{springs:W}=E.get($)||$.ctrl,I=P({...W},$.item,$,F);return I&&I.type?C.createElement(I.type,{...I.props,key:he.str($.key)||he.num($.key)?$.key:$.ctrl.id,ref:I.ref}):I}));return f?[j,f]:j}var Vpe=1;function qpe(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):Vpe++})}return he.und(n)?e:he.fun(n)?e.map(n):rr(n)}var AF=class extends u3{constructor(e,t){super(),this.source=e,this.idle=!0,this._active=new Set,this.calc=Jf(...t);const n=this._get(),r=J2(n);o3(this,r.create(n))}advance(e){const t=this._get(),n=this.get();Ps(t,n)||(Ji(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&nA(this._active)&&tb(this)}_get(){const e=he.arr(this.source)?this.source.map(fr):rr(fr(this.source));return this.calc(...e)}_start(){this.idle&&!nA(this._active)&&(this.idle=!1,Be(hy(this),e=>{e.done=!1}),Ui.skipAnimation?(He.batchedUpdates(()=>this.advance()),tb(this)):ly.start(this))}_attach(){let e=1;Be(rr(this.source),t=>{Xr(t)&&Rd(t,this),nS(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))}),this.priority=e,this._start()}_detach(){Be(rr(this.source),e=>{Xr(e)&&tp(e,this)}),this._active.clear(),tb(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,(nS(n)?n.priority:0)+1),0))}};function Ype(e){return e.idle!==!1}function nA(e){return!e.size||Array.from(e).every(Ype)}function tb(e){e.idle||(e.idle=!0,Be(hy(e),t=>{t.done=!0}),ep(e,{type:"idle",parent:e}))}var va=(e,...t)=>new AF(e,t);Ui.assign({createStringInterpolator:uF,to:(e,t)=>new AF(e,t)});var DF=/^--/;function Kpe(e,t){return t==null||typeof t=="boolean"||t===""?"":typeof t=="number"&&t!==0&&!DF.test(e)&&!(gf.hasOwnProperty(e)&&gf[e])?t+"px":(""+t).trim()}var rA={};function Gpe(e,t){if(!e.nodeType||!e.setAttribute)return!1;const n=e.nodeName==="filter"||e.parentNode&&e.parentNode.nodeName==="filter",{style:r,children:i,scrollTop:s,scrollLeft:a,viewBox:o,...l}=t,c=Object.values(l),d=Object.keys(l).map(u=>n||e.hasAttribute(u)?u:rA[u]||(rA[u]=u.replace(/([A-Z])/g,f=>"-"+f.toLowerCase())));i!==void 0&&(e.textContent=i);for(const u in r)if(r.hasOwnProperty(u)){const f=Kpe(u,r[u]);DF.test(u)?e.style.setProperty(u,f):e.style[u]=f}d.forEach((u,f)=>{e.setAttribute(u,c[f])}),s!==void 0&&(e.scrollTop=s),a!==void 0&&(e.scrollLeft=a),o!==void 0&&e.setAttribute("viewBox",o)}var gf={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},Xpe=(e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1),Qpe=["Webkit","Ms","Moz","O"];gf=Object.keys(gf).reduce((e,t)=>(Qpe.forEach(n=>e[Xpe(n,t)]=e[t]),e),gf);var Jpe=/^(matrix|translate|scale|rotate|skew)/,Zpe=/^(translate)/,eme=/^(rotate|skew)/,nb=(e,t)=>he.num(e)&&e!==0?e+t:e,Bg=(e,t)=>he.arr(e)?e.every(n=>Bg(n,t)):he.num(e)?e===t:parseFloat(e)===t,tme=class extends fy{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=>nb(o,"px")).join(",")})`,Bg(a,0)])),ys(r,(a,o)=>{if(o==="transform")i.push([a||""]),s.push(l=>[l,l===""]);else if(Jpe.test(o)){if(delete r[o],he.und(a))return;const l=Zpe.test(o)?"px":eme.test(o)?"deg":"";i.push(rr(a)),s.push(o==="rotate3d"?([c,d,u,f])=>[`rotate3d(${c},${d},${u},${nb(f,l)})`,Bg(f,0)]:c=>[`${o}(${c.map(d=>nb(d,l)).join(",")})`,Bg(c,o.startsWith("scale")?1:0)])}}),i.length&&(r.transform=new nme(i,s)),super(r)}},nme=class extends aF{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 Be(this.inputs,(n,r)=>{const i=fr(n[0]),[s,a]=this.transforms[r](he.arr(i)?i:n.map(fr));e+=" "+s,t=t&&a}),t?"none":e}observerAdded(e){e==1&&Be(this.inputs,t=>Be(t,n=>Xr(n)&&Rd(n,this)))}observerRemoved(e){e==0&&Be(this.inputs,t=>Be(t,n=>Xr(n)&&tp(n,this)))}eventObserved(e){e.type=="change"&&(this._value=null),ep(this,e)}},rme=["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"];Ui.assign({batchedUpdates:vr.unstable_batchedUpdates,createStringInterpolator:uF,colors:Xfe});var ime=Rpe(rme,{applyAnimatedValues:Gpe,createAnimatedStyle:e=>new tme(e),getComponentProps:({scrollTop:e,scrollLeft:t,...n})=>n}),kt=ime.animated;function wl(){return wl=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},wl.apply(this,arguments)}var sme={pointerEvents:"none",position:"absolute",zIndex:10,top:0,left:0},iA=function(e,t){return"translate("+e+"px, "+t+"px)"},LF=C.memo(function(e){var t,n=e.position,r=e.anchor,i=e.children,s=Yt(),a=Tr(),o=a.animate,l=a.config,c=Iz(),d=c[0],u=c[1],f=C.useRef(!1),g=void 0,x=!1,_=u.width>0&&u.height>0,v=Math.round(n[0]),p=Math.round(n[1]);_&&(r==="top"?(v-=u.width/2,p-=u.height+14):r==="right"?(v+=14,p-=u.height/2):r==="bottom"?(v-=u.width/2,p+=14):r==="left"?(v-=u.width+14,p-=u.height/2):r==="center"&&(v-=u.width/2,p-=u.height/2),g={transform:iA(v,p)},f.current||(x=!0),f.current=[v,p]);var m=lo({to:g,config:l,immediate:!o||x}),y=wl({},sme,s.tooltip.wrapper,{transform:(t=m.transform)!=null?t:iA(v,p),opacity:m.transform?1:0});return h.jsx(kt.div,{ref:d,style:y,children:i})});LF.displayName="TooltipWrapper";var ome=C.memo(function(e){var t=e.size,n=t===void 0?12:t,r=e.color,i=e.style;return h.jsx("span",{style:wl({display:"block",width:n,height:n,background:r},i===void 0?{}:i)})}),jF=C.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,c=Yt(),d=p_(i);if(typeof l=="function")t=l();else{var u=r;d!==void 0&&u!==void 0&&(u=d(u)),t=h.jsxs("div",{style:c.tooltip.basic,children:[a&&h.jsx(ome,{color:o,style:c.tooltip.chip}),u!==void 0?h.jsxs("span",{children:[n,": ",h.jsx("strong",{children:""+u})]}):n]})}return h.jsx("div",{style:c.tooltip.container,children:t})}),ame={width:"100%",borderCollapse:"collapse"},lme=C.memo(function(e){var t,n=e.title,r=e.rows,i=r===void 0?[]:r,s=e.renderContent,a=Yt();return i.length?(t=typeof s=="function"?s():h.jsxs("div",{children:[n&&n,h.jsx("table",{style:wl({},ame,a.tooltip.table),children:h.jsx("tbody",{children:i.map(function(o,l){return h.jsx("tr",{children:o.map(function(c,d){return h.jsx("td",{style:a.tooltip.tableCell,children:c},d)})},l)})})})]}),h.jsx("div",{style:a.tooltip.container,children:t})):null});lme.displayName="TableTooltip";var aS=C.memo(function(e){var t=e.x0,n=e.x1,r=e.y0,i=e.y1,s=Yt(),a=Tr(),o=a.animate,l=a.config,c=C.useMemo(function(){return wl({},s.crosshair.line,{pointerEvents:"none"})},[s.crosshair.line]),d=lo({x1:t,x2:n,y1:r,y2:i,config:l,immediate:!o});return h.jsx(kt.line,wl({},d,{fill:"none",style:c}))});aS.displayName="CrosshairLine";var cme=C.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}),h.jsxs(h.Fragment,{children:[t&&h.jsx(aS,{x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1}),n&&h.jsx(aS,{x0:n.x0,x1:n.x1,y0:n.y0,y1:n.y1})]})});cme.displayName="Crosshair";var PF=C.createContext({showTooltipAt:function(){},showTooltipFromEvent:function(){},hideTooltip:function(){}}),lS={isVisible:!1,position:[null,null],content:null,anchor:null},NF=C.createContext(lS),ume=function(e){var t=C.useState(lS),n=t[0],r=t[1],i=C.useCallback(function(o,l,c){var d=l[0],u=l[1];c===void 0&&(c="top"),r({isVisible:!0,position:[d,u],anchor:c,content:o})},[r]),s=C.useCallback(function(o,l,c){c===void 0&&(c="top");var d=e.current.getBoundingClientRect(),u=e.current.offsetWidth,f=u===d.width?1:u/d.width,g="touches"in l?l.touches[0]:l,x=g.clientX,_=g.clientY,v=(x-d.left)*f,p=(_-d.top)*f;c!=="left"&&c!=="right"||(c=v<d.width/2?"right":"left"),r({isVisible:!0,position:[v,p],anchor:c,content:o})},[e,r]),a=C.useCallback(function(){r(lS)},[r]);return{actions:C.useMemo(function(){return{showTooltipAt:i,showTooltipFromEvent:s,hideTooltip:a}},[i,s,a]),state:n}},d3=function(){var e=C.useContext(PF);if(e===void 0)throw new Error("useTooltip must be used within a TooltipProvider");return e},dme=function(){var e=C.useContext(NF);if(e===void 0)throw new Error("useTooltipState must be used within a TooltipProvider");return e},hme=function(e){return e.isVisible},fme=function(){var e=dme();return hme(e)?h.jsx(LF,{position:e.position,anchor:e.anchor,children:e.content}):null},pme=function(e){var t=e.container,n=e.children,r=ume(t),i=r.actions,s=r.state;return h.jsx(PF.Provider,{value:i,children:h.jsx(NF.Provider,{value:s,children:n})})};function mme(){this.__data__=[],this.size=0}var gme=mme;function vme(e,t){return e===t||e!==e&&t!==t}var Qp=vme,yme=Qp;function _me(e,t){for(var n=e.length;n--;)if(yme(e[n][0],t))return n;return-1}var my=_me,xme=my,bme=Array.prototype,wme=bme.splice;function Sme(e){var t=this.__data__,n=xme(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():wme.call(t,n,1),--this.size,!0}var Cme=Sme,kme=my;function Eme(e){var t=this.__data__,n=kme(t,e);return n<0?void 0:t[n][1]}var Tme=Eme,Mme=my;function Rme(e){return Mme(this.__data__,e)>-1}var Ame=Rme,Dme=my;function Lme(e,t){var n=this.__data__,r=Dme(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var jme=Lme,Pme=gme,Nme=Cme,Ome=Tme,Ime=Ame,$me=jme;function Ad(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])}}Ad.prototype.clear=Pme;Ad.prototype.delete=Nme;Ad.prototype.get=Ome;Ad.prototype.has=Ime;Ad.prototype.set=$me;var gy=Ad,Fme=gy;function Bme(){this.__data__=new Fme,this.size=0}var zme=Bme;function Ume(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var Hme=Ume;function Wme(e){return this.__data__.get(e)}var Vme=Wme;function qme(e){return this.__data__.has(e)}var Yme=qme,Kme=typeof $o=="object"&&$o&&$o.Object===Object&&$o,OF=Kme,Gme=OF,Xme=typeof self=="object"&&self&&self.Object===Object&&self,Qme=Gme||Xme||Function("return this")(),Cs=Qme,Jme=Cs,Zme=Jme.Symbol,Dd=Zme,sA=Dd,IF=Object.prototype,ege=IF.hasOwnProperty,tge=IF.toString,uh=sA?sA.toStringTag:void 0;function nge(e){var t=ege.call(e,uh),n=e[uh];try{e[uh]=void 0;var r=!0}catch{}var i=tge.call(e);return r&&(t?e[uh]=n:delete e[uh]),i}var rge=nge,ige=Object.prototype,sge=ige.toString;function oge(e){return sge.call(e)}var age=oge,oA=Dd,lge=rge,cge=age,uge="[object Null]",dge="[object Undefined]",aA=oA?oA.toStringTag:void 0;function hge(e){return e==null?e===void 0?dge:uge:aA&&aA in Object(e)?lge(e):cge(e)}var Ma=hge;function fge(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ks=fge,pge=Ma,mge=ks,gge="[object AsyncFunction]",vge="[object Function]",yge="[object GeneratorFunction]",_ge="[object Proxy]";function xge(e){if(!mge(e))return!1;var t=pge(e);return t==vge||t==yge||t==gge||t==_ge}var vy=xge;const $F=bn(vy);var bge=Cs,wge=bge["__core-js_shared__"],Sge=wge,rb=Sge,lA=function(){var e=/[^.]+$/.exec(rb&&rb.keys&&rb.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Cge(e){return!!lA&&lA in e}var kge=Cge,Ege=Function.prototype,Tge=Ege.toString;function Mge(e){if(e!=null){try{return Tge.call(e)}catch{}try{return e+""}catch{}}return""}var FF=Mge,Rge=vy,Age=kge,Dge=ks,Lge=FF,jge=/[\\^$.*+?()[\]{}|]/g,Pge=/^\[object .+?Constructor\]$/,Nge=Function.prototype,Oge=Object.prototype,Ige=Nge.toString,$ge=Oge.hasOwnProperty,Fge=RegExp("^"+Ige.call($ge).replace(jge,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Bge(e){if(!Dge(e)||Age(e))return!1;var t=Rge(e)?Fge:Pge;return t.test(Lge(e))}var zge=Bge;function Uge(e,t){return e==null?void 0:e[t]}var Hge=Uge,Wge=zge,Vge=Hge;function qge(e,t){var n=Vge(e,t);return Wge(n)?n:void 0}var Wl=qge,Yge=Wl,Kge=Cs,Gge=Yge(Kge,"Map"),h3=Gge,Xge=Wl,Qge=Xge(Object,"create"),yy=Qge,cA=yy;function Jge(){this.__data__=cA?cA(null):{},this.size=0}var Zge=Jge;function e0e(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var t0e=e0e,n0e=yy,r0e="__lodash_hash_undefined__",i0e=Object.prototype,s0e=i0e.hasOwnProperty;function o0e(e){var t=this.__data__;if(n0e){var n=t[e];return n===r0e?void 0:n}return s0e.call(t,e)?t[e]:void 0}var a0e=o0e,l0e=yy,c0e=Object.prototype,u0e=c0e.hasOwnProperty;function d0e(e){var t=this.__data__;return l0e?t[e]!==void 0:u0e.call(t,e)}var h0e=d0e,f0e=yy,p0e="__lodash_hash_undefined__";function m0e(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=f0e&&t===void 0?p0e:t,this}var g0e=m0e,v0e=Zge,y0e=t0e,_0e=a0e,x0e=h0e,b0e=g0e;function Ld(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])}}Ld.prototype.clear=v0e;Ld.prototype.delete=y0e;Ld.prototype.get=_0e;Ld.prototype.has=x0e;Ld.prototype.set=b0e;var w0e=Ld,uA=w0e,S0e=gy,C0e=h3;function k0e(){this.size=0,this.__data__={hash:new uA,map:new(C0e||S0e),string:new uA}}var E0e=k0e;function T0e(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var M0e=T0e,R0e=M0e;function A0e(e,t){var n=e.__data__;return R0e(t)?n[typeof t=="string"?"string":"hash"]:n.map}var _y=A0e,D0e=_y;function L0e(e){var t=D0e(this,e).delete(e);return this.size-=t?1:0,t}var j0e=L0e,P0e=_y;function N0e(e){return P0e(this,e).get(e)}var O0e=N0e,I0e=_y;function $0e(e){return I0e(this,e).has(e)}var F0e=$0e,B0e=_y;function z0e(e,t){var n=B0e(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var U0e=z0e,H0e=E0e,W0e=j0e,V0e=O0e,q0e=F0e,Y0e=U0e;function jd(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])}}jd.prototype.clear=H0e;jd.prototype.delete=W0e;jd.prototype.get=V0e;jd.prototype.has=q0e;jd.prototype.set=Y0e;var f3=jd,K0e=gy,G0e=h3,X0e=f3,Q0e=200;function J0e(e,t){var n=this.__data__;if(n instanceof K0e){var r=n.__data__;if(!G0e||r.length<Q0e-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new X0e(r)}return n.set(e,t),this.size=n.size,this}var Z0e=J0e,eve=gy,tve=zme,nve=Hme,rve=Vme,ive=Yme,sve=Z0e;function Pd(e){var t=this.__data__=new eve(e);this.size=t.size}Pd.prototype.clear=tve;Pd.prototype.delete=nve;Pd.prototype.get=rve;Pd.prototype.has=ive;Pd.prototype.set=sve;var xy=Pd,ove=Wl,ave=function(){try{var e=ove(Object,"defineProperty");return e({},"",{}),e}catch{}}(),BF=ave,dA=BF;function lve(e,t,n){t=="__proto__"&&dA?dA(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var p3=lve,cve=p3,uve=Qp;function dve(e,t,n){(n!==void 0&&!uve(e[t],n)||n===void 0&&!(t in e))&&cve(e,t,n)}var zF=dve;function hve(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 fve=hve,pve=fve,mve=pve(),UF=mve,fv={exports:{}};fv.exports;(function(e,t){var n=Cs,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(c,d){if(d)return c.slice();var u=c.length,f=o?o(u):new c.constructor(u);return c.copy(f),f}e.exports=l})(fv,fv.exports);var HF=fv.exports,gve=Cs,vve=gve.Uint8Array,WF=vve,hA=WF;function yve(e){var t=new e.constructor(e.byteLength);return new hA(t).set(new hA(e)),t}var m3=yve,_ve=m3;function xve(e,t){var n=t?_ve(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var VF=xve;function bve(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var qF=bve,wve=ks,fA=Object.create,Sve=function(){function e(){}return function(t){if(!wve(t))return{};if(fA)return fA(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),Cve=Sve;function kve(e,t){return function(n){return e(t(n))}}var YF=kve,Eve=YF,Tve=Eve(Object.getPrototypeOf,Object),g3=Tve,Mve=Object.prototype;function Rve(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Mve;return e===n}var v3=Rve,Ave=Cve,Dve=g3,Lve=v3;function jve(e){return typeof e.constructor=="function"&&!Lve(e)?Ave(Dve(e)):{}}var KF=jve;function Pve(e){return e!=null&&typeof e=="object"}var Vi=Pve,Nve=Ma,Ove=Vi,Ive="[object Arguments]";function $ve(e){return Ove(e)&&Nve(e)==Ive}var Fve=$ve,pA=Fve,Bve=Vi,GF=Object.prototype,zve=GF.hasOwnProperty,Uve=GF.propertyIsEnumerable,Hve=pA(function(){return arguments}())?pA:function(e){return Bve(e)&&zve.call(e,"callee")&&!Uve.call(e,"callee")},by=Hve,Wve=Array.isArray,Er=Wve,Vve=9007199254740991;function qve(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Vve}var y3=qve,Yve=vy,Kve=y3;function Gve(e){return e!=null&&Kve(e.length)&&!Yve(e)}var Nd=Gve,Xve=Nd,Qve=Vi;function Jve(e){return Qve(e)&&Xve(e)}var XF=Jve,pv={exports:{}};function Zve(){return!1}var e1e=Zve;pv.exports;(function(e,t){var n=Cs,r=e1e,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,c=l||r;e.exports=c})(pv,pv.exports);var wy=pv.exports,t1e=Ma,n1e=g3,r1e=Vi,i1e="[object Object]",s1e=Function.prototype,o1e=Object.prototype,QF=s1e.toString,a1e=o1e.hasOwnProperty,l1e=QF.call(Object);function c1e(e){if(!r1e(e)||t1e(e)!=i1e)return!1;var t=n1e(e);if(t===null)return!0;var n=a1e.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&QF.call(n)==l1e}var _3=c1e;const x3=bn(_3);var u1e=Ma,d1e=y3,h1e=Vi,f1e="[object Arguments]",p1e="[object Array]",m1e="[object Boolean]",g1e="[object Date]",v1e="[object Error]",y1e="[object Function]",_1e="[object Map]",x1e="[object Number]",b1e="[object Object]",w1e="[object RegExp]",S1e="[object Set]",C1e="[object String]",k1e="[object WeakMap]",E1e="[object ArrayBuffer]",T1e="[object DataView]",M1e="[object Float32Array]",R1e="[object Float64Array]",A1e="[object Int8Array]",D1e="[object Int16Array]",L1e="[object Int32Array]",j1e="[object Uint8Array]",P1e="[object Uint8ClampedArray]",N1e="[object Uint16Array]",O1e="[object Uint32Array]",Ut={};Ut[M1e]=Ut[R1e]=Ut[A1e]=Ut[D1e]=Ut[L1e]=Ut[j1e]=Ut[P1e]=Ut[N1e]=Ut[O1e]=!0;Ut[f1e]=Ut[p1e]=Ut[E1e]=Ut[m1e]=Ut[T1e]=Ut[g1e]=Ut[v1e]=Ut[y1e]=Ut[_1e]=Ut[x1e]=Ut[b1e]=Ut[w1e]=Ut[S1e]=Ut[C1e]=Ut[k1e]=!1;function I1e(e){return h1e(e)&&d1e(e.length)&&!!Ut[u1e(e)]}var $1e=I1e;function F1e(e){return function(t){return e(t)}}var Jp=F1e,mv={exports:{}};mv.exports;(function(e,t){var n=OF,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})(mv,mv.exports);var Sy=mv.exports,B1e=$1e,z1e=Jp,mA=Sy,gA=mA&&mA.isTypedArray,U1e=gA?z1e(gA):B1e,b3=U1e;function H1e(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var JF=H1e,W1e=p3,V1e=Qp,q1e=Object.prototype,Y1e=q1e.hasOwnProperty;function K1e(e,t,n){var r=e[t];(!(Y1e.call(e,t)&&V1e(r,n))||n===void 0&&!(t in e))&&W1e(e,t,n)}var w3=K1e,G1e=w3,X1e=p3;function Q1e(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?X1e(n,o,l):G1e(n,o,l)}return n}var Od=Q1e;function J1e(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Z1e=J1e,eye=9007199254740991,tye=/^(?:0|[1-9]\d*)$/;function nye(e,t){var n=typeof e;return t=t??eye,!!t&&(n=="number"||n!="symbol"&&tye.test(e))&&e>-1&&e%1==0&&e<t}var Cy=nye,rye=Z1e,iye=by,sye=Er,oye=wy,aye=Cy,lye=b3,cye=Object.prototype,uye=cye.hasOwnProperty;function dye(e,t){var n=sye(e),r=!n&&iye(e),i=!n&&!r&&oye(e),s=!n&&!r&&!i&&lye(e),a=n||r||i||s,o=a?rye(e.length,String):[],l=o.length;for(var c in e)(t||uye.call(e,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||aye(c,l)))&&o.push(c);return o}var ZF=dye;function hye(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var fye=hye,pye=ks,mye=v3,gye=fye,vye=Object.prototype,yye=vye.hasOwnProperty;function _ye(e){if(!pye(e))return gye(e);var t=mye(e),n=[];for(var r in e)r=="constructor"&&(t||!yye.call(e,r))||n.push(r);return n}var xye=_ye,bye=ZF,wye=xye,Sye=Nd;function Cye(e){return Sye(e)?bye(e,!0):wye(e)}var Zp=Cye,kye=Od,Eye=Zp;function Tye(e){return kye(e,Eye(e))}var Mye=Tye,vA=zF,Rye=HF,Aye=VF,Dye=qF,Lye=KF,yA=by,_A=Er,jye=XF,Pye=wy,Nye=vy,Oye=ks,Iye=_3,$ye=b3,xA=JF,Fye=Mye;function Bye(e,t,n,r,i,s,a){var o=xA(e,n),l=xA(t,n),c=a.get(l);if(c){vA(e,n,c);return}var d=s?s(o,l,n+"",e,t,a):void 0,u=d===void 0;if(u){var f=_A(l),g=!f&&Pye(l),x=!f&&!g&&$ye(l);d=l,f||g||x?_A(o)?d=o:jye(o)?d=Dye(o):g?(u=!1,d=Rye(l,!0)):x?(u=!1,d=Aye(l,!0)):d=[]:Iye(l)||yA(l)?(d=o,yA(o)?d=Fye(o):(!Oye(o)||Nye(o))&&(d=Lye(l))):u=!1}u&&(a.set(l,d),i(d,l,r,s,a),a.delete(l)),vA(e,n,d)}var zye=Bye,Uye=xy,Hye=zF,Wye=UF,Vye=zye,qye=ks,Yye=Zp,Kye=JF;function eB(e,t,n,r,i){e!==t&&Wye(t,function(s,a){if(i||(i=new Uye),qye(s))Vye(e,t,a,n,eB,r,i);else{var o=r?r(Kye(e,a),s,a+"",e,t,i):void 0;o===void 0&&(o=s),Hye(e,a,o)}},Yye)}var Gye=eB;function Xye(e){return e}var ky=Xye;function Qye(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 Jye=Qye,Zye=Jye,bA=Math.max;function e_e(e,t,n){return t=bA(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=bA(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),Zye(e,this,o)}}var tB=e_e;function t_e(e){return function(){return e}}var n_e=t_e,r_e=n_e,wA=BF,i_e=ky,s_e=wA?function(e,t){return wA(e,"toString",{configurable:!0,enumerable:!1,value:r_e(t),writable:!0})}:i_e,o_e=s_e,a_e=800,l_e=16,c_e=Date.now;function u_e(e){var t=0,n=0;return function(){var r=c_e(),i=l_e-(r-n);if(n=r,i>0){if(++t>=a_e)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var d_e=u_e,h_e=o_e,f_e=d_e,p_e=f_e(h_e),nB=p_e,m_e=ky,g_e=tB,v_e=nB;function y_e(e,t){return v_e(g_e(e,t,m_e),e+"")}var S3=y_e,__e=Qp,x_e=Nd,b_e=Cy,w_e=ks;function S_e(e,t,n){if(!w_e(n))return!1;var r=typeof t;return(r=="number"?x_e(n)&&b_e(t,n.length):r=="string"&&t in n)?__e(n[t],e):!1}var rB=S_e,C_e=S3,k_e=rB;function E_e(e){return C_e(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&&k_e(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 T_e=E_e,M_e=Gye,R_e=T_e,A_e=R_e(function(e,t,n){M_e(e,t,n)}),D_e=A_e;const L_e=bn(D_e);var j_e=Ma,P_e=Vi,N_e="[object Symbol]";function O_e(e){return typeof e=="symbol"||P_e(e)&&j_e(e)==N_e}var Ey=O_e,I_e=Er,$_e=Ey,F_e=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,B_e=/^\w*$/;function z_e(e,t){if(I_e(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||$_e(e)?!0:B_e.test(e)||!F_e.test(e)||t!=null&&e in Object(t)}var C3=z_e,iB=f3,U_e="Expected a function";function k3(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(U_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(k3.Cache||iB),n}k3.Cache=iB;var H_e=k3,W_e=H_e,V_e=500;function q_e(e){var t=W_e(e,function(r){return n.size===V_e&&n.clear(),r}),n=t.cache;return t}var Y_e=q_e,K_e=Y_e,G_e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,X_e=/\\(\\)?/g,Q_e=K_e(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(G_e,function(n,r,i,s){t.push(i?s.replace(X_e,"$1"):r||n)}),t}),J_e=Q_e;function Z_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 Ty=Z_e,SA=Dd,exe=Ty,txe=Er,nxe=Ey,rxe=1/0,CA=SA?SA.prototype:void 0,kA=CA?CA.toString:void 0;function sB(e){if(typeof e=="string")return e;if(txe(e))return exe(e,sB)+"";if(nxe(e))return kA?kA.call(e):"";var t=e+"";return t=="0"&&1/e==-rxe?"-0":t}var ixe=sB,sxe=ixe;function oxe(e){return e==null?"":sxe(e)}var axe=oxe,lxe=Er,cxe=C3,uxe=J_e,dxe=axe;function hxe(e,t){return lxe(e)?e:cxe(e,t)?[e]:uxe(dxe(e))}var Id=hxe,fxe=Ey,pxe=1/0;function mxe(e){if(typeof e=="string"||fxe(e))return e;var t=e+"";return t=="0"&&1/e==-pxe?"-0":t}var $d=mxe,gxe=Id,vxe=$d;function yxe(e,t){t=gxe(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[vxe(t[n++])];return n&&n==r?e:void 0}var em=yxe,_xe=em;function xxe(e,t,n){var r=e==null?void 0:_xe(e,t);return r===void 0?n:r}var oB=xxe;const to=bn(oB);var bxe=w3,wxe=Id,Sxe=Cy,EA=ks,Cxe=$d;function kxe(e,t,n,r){if(!EA(e))return e;t=wxe(t,e);for(var i=-1,s=t.length,a=s-1,o=e;o!=null&&++i<s;){var l=Cxe(t[i]),c=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return e;if(i!=a){var d=o[l];c=r?r(d,l,o):void 0,c===void 0&&(c=EA(d)?d:Sxe(t[i+1])?[]:{})}bxe(o,l,c),o=o[l]}return e}var aB=kxe,Exe=aB;function Txe(e,t,n){return e==null?e:Exe(e,t,n)}var Mxe=Txe;const Vh=bn(Mxe);function My(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function E3(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Fd(){}var Sl=.7,$u=1/Sl,su="\\s*([+-]?\\d+)\\s*",ap="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",fs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Rxe=/^#([0-9a-f]{3,8})$/,Axe=new RegExp(`^rgb\\(${su},${su},${su}\\)$`),Dxe=new RegExp(`^rgb\\(${fs},${fs},${fs}\\)$`),Lxe=new RegExp(`^rgba\\(${su},${su},${su},${ap}\\)$`),jxe=new RegExp(`^rgba\\(${fs},${fs},${fs},${ap}\\)$`),Pxe=new RegExp(`^hsl\\(${ap},${fs},${fs}\\)$`),Nxe=new RegExp(`^hsla\\(${ap},${fs},${fs},${ap}\\)$`),TA={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};My(Fd,no,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:MA,formatHex:MA,formatHex8:Oxe,formatHsl:Ixe,formatRgb:RA,toString:RA});function MA(){return this.rgb().formatHex()}function Oxe(){return this.rgb().formatHex8()}function Ixe(){return cB(this).formatHsl()}function RA(){return this.rgb().formatRgb()}function no(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Rxe.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?AA(t):n===3?new Xn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Zm(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Zm(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=Axe.exec(e))?new Xn(t[1],t[2],t[3],1):(t=Dxe.exec(e))?new Xn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Lxe.exec(e))?Zm(t[1],t[2],t[3],t[4]):(t=jxe.exec(e))?Zm(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Pxe.exec(e))?jA(t[1],t[2]/100,t[3]/100,1):(t=Nxe.exec(e))?jA(t[1],t[2]/100,t[3]/100,t[4]):TA.hasOwnProperty(e)?AA(TA[e]):e==="transparent"?new Xn(NaN,NaN,NaN,0):null}function AA(e){return new Xn(e>>16&255,e>>8&255,e&255,1)}function Zm(e,t,n,r){return r<=0&&(e=t=n=NaN),new Xn(e,t,n,r)}function lB(e){return e instanceof Fd||(e=no(e)),e?(e=e.rgb(),new Xn(e.r,e.g,e.b,e.opacity)):new Xn}function Fu(e,t,n,r){return arguments.length===1?lB(e):new Xn(e,t,n,r??1)}function Xn(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}My(Xn,Fu,E3(Fd,{brighter(e){return e=e==null?$u:Math.pow($u,e),new Xn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Sl:Math.pow(Sl,e),new Xn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Xn(il(this.r),il(this.g),il(this.b),gv(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:DA,formatHex:DA,formatHex8:$xe,formatRgb:LA,toString:LA}));function DA(){return`#${Wa(this.r)}${Wa(this.g)}${Wa(this.b)}`}function $xe(){return`#${Wa(this.r)}${Wa(this.g)}${Wa(this.b)}${Wa((isNaN(this.opacity)?1:this.opacity)*255)}`}function LA(){const e=gv(this.opacity);return`${e===1?"rgb(":"rgba("}${il(this.r)}, ${il(this.g)}, ${il(this.b)}${e===1?")":`, ${e})`}`}function gv(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function il(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Wa(e){return e=il(e),(e<16?"0":"")+e.toString(16)}function jA(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Mi(e,t,n,r)}function cB(e){if(e instanceof Mi)return new Mi(e.h,e.s,e.l,e.opacity);if(e instanceof Fd||(e=no(e)),!e)return new Mi;if(e instanceof Mi)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 Mi(a,o,l,e.opacity)}function Fxe(e,t,n,r){return arguments.length===1?cB(e):new Mi(e,t,n,r??1)}function Mi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}My(Mi,Fxe,E3(Fd,{brighter(e){return e=e==null?$u:Math.pow($u,e),new Mi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Sl:Math.pow(Sl,e),new Mi(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 Xn(ib(e>=240?e-240:e+120,i,r),ib(e,i,r),ib(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Mi(PA(this.h),eg(this.s),eg(this.l),gv(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=gv(this.opacity);return`${e===1?"hsl(":"hsla("}${PA(this.h)}, ${eg(this.s)*100}%, ${eg(this.l)*100}%${e===1?")":`, ${e})`}`}}));function PA(e){return e=(e||0)%360,e<0?e+360:e}function eg(e){return Math.max(0,Math.min(1,e||0))}function ib(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 Bxe=Math.PI/180,zxe=180/Math.PI;var uB=-.14861,T3=1.78277,M3=-.29227,Ry=-.90649,lp=1.97294,NA=lp*Ry,OA=lp*T3,IA=T3*M3-Ry*uB;function Uxe(e){if(e instanceof sl)return new sl(e.h,e.s,e.l,e.opacity);e instanceof Xn||(e=lB(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(IA*r+NA*t-OA*n)/(IA+NA-OA),s=r-i,a=(lp*(n-i)-M3*s)/Ry,o=Math.sqrt(a*a+s*s)/(lp*i*(1-i)),l=o?Math.atan2(a,s)*zxe-120:NaN;return new sl(l<0?l+360:l,o,i,e.opacity)}function _s(e,t,n,r){return arguments.length===1?Uxe(e):new sl(e,t,n,r??1)}function sl(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}My(sl,_s,E3(Fd,{brighter(e){return e=e==null?$u:Math.pow($u,e),new sl(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Sl:Math.pow(Sl,e),new sl(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*Bxe,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new Xn(255*(t+n*(uB*r+T3*i)),255*(t+n*(M3*r+Ry*i)),255*(t+n*(lp*r)),this.opacity)}}));function Hxe(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 Wxe(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 Hxe((n-r/t)*t,a,i,s,o)}}const Ay=e=>()=>e;function dB(e,t){return function(n){return e+n*t}}function Vxe(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 qxe(e,t){var n=t-e;return n?dB(e,n>180||n<-180?n-360*Math.round(n/360):n):Ay(isNaN(e)?t:e)}function Yxe(e){return(e=+e)==1?ou:function(t,n){return n-t?Vxe(t,n,e):Ay(isNaN(t)?n:t)}}function ou(e,t){var n=t-e;return n?dB(e,n):Ay(isNaN(e)?t:e)}const vv=function e(t){var n=Yxe(t);function r(i,s){var a=n((i=Fu(i)).r,(s=Fu(s)).r),o=n(i.g,s.g),l=n(i.b,s.b),c=ou(i.opacity,s.opacity);return function(d){return i.r=a(d),i.g=o(d),i.b=l(d),i.opacity=c(d),i+""}}return r.gamma=e,r}(1);function Kxe(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=Fu(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 Gxe=Kxe(Wxe);function Xxe(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 Qxe(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Jxe(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]=Dy(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 Zxe(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Ti(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function ebe(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]=Dy(e[i],t[i]):r[i]=t[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var cS=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,sb=new RegExp(cS.source,"g");function tbe(e){return function(){return e}}function nbe(e){return function(t){return e(t)+""}}function R3(e,t){var n=cS.lastIndex=sb.lastIndex=0,r,i,s,a=-1,o=[],l=[];for(e=e+"",t=t+"";(r=cS.exec(e))&&(i=sb.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:Ti(r,i)})),n=sb.lastIndex;return n<t.length&&(s=t.slice(n),o[a]?o[a]+=s:o[++a]=s),o.length<2?l[0]?nbe(l[0].x):tbe(t):(t=l.length,function(c){for(var d=0,u;d<t;++d)o[(u=l[d]).i]=u.x(c);return o.join("")})}function Dy(e,t){var n=typeof t,r;return t==null||n==="boolean"?Ay(t):(n==="number"?Ti:n==="string"?(r=no(t))?(t=r,vv):R3:t instanceof no?vv:t instanceof Date?Zxe:Qxe(t)?Xxe:Array.isArray(t)?Jxe:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?ebe:Ti)(e,t)}function hB(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var $A=180/Math.PI,uS={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function fB(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)*$A,skewX:Math.atan(l)*$A,scaleX:a,scaleY:o}}var tg;function rbe(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?uS:fB(t.a,t.b,t.c,t.d,t.e,t.f)}function ibe(e){return e==null||(tg||(tg=document.createElementNS("http://www.w3.org/2000/svg","g")),tg.setAttribute("transform",e),!(e=tg.transform.baseVal.consolidate()))?uS:(e=e.matrix,fB(e.a,e.b,e.c,e.d,e.e,e.f))}function pB(e,t,n,r){function i(c){return c.length?c.pop()+" ":""}function s(c,d,u,f,g,x){if(c!==u||d!==f){var _=g.push("translate(",null,t,null,n);x.push({i:_-4,x:Ti(c,u)},{i:_-2,x:Ti(d,f)})}else(u||f)&&g.push("translate("+u+t+f+n)}function a(c,d,u,f){c!==d?(c-d>180?d+=360:d-c>180&&(c+=360),f.push({i:u.push(i(u)+"rotate(",null,r)-2,x:Ti(c,d)})):d&&u.push(i(u)+"rotate("+d+r)}function o(c,d,u,f){c!==d?f.push({i:u.push(i(u)+"skewX(",null,r)-2,x:Ti(c,d)}):d&&u.push(i(u)+"skewX("+d+r)}function l(c,d,u,f,g,x){if(c!==u||d!==f){var _=g.push(i(g)+"scale(",null,",",null,")");x.push({i:_-4,x:Ti(c,u)},{i:_-2,x:Ti(d,f)})}else(u!==1||f!==1)&&g.push(i(g)+"scale("+u+","+f+")")}return function(c,d){var u=[],f=[];return c=e(c),d=e(d),s(c.translateX,c.translateY,d.translateX,d.translateY,u,f),a(c.rotate,d.rotate,u,f),o(c.skewX,d.skewX,u,f),l(c.scaleX,c.scaleY,d.scaleX,d.scaleY,u,f),c=d=null,function(g){for(var x=-1,_=f.length,v;++x<_;)u[(v=f[x]).i]=v.x(g);return u.join("")}}}var sbe=pB(rbe,"px, ","px)","deg)"),obe=pB(ibe,", ",")",")"),abe=1e-12;function FA(e){return((e=Math.exp(e))+1/e)/2}function lbe(e){return((e=Math.exp(e))-1/e)/2}function cbe(e){return((e=Math.exp(2*e))-1)/(e+1)}const ube=function e(t,n,r){function i(s,a){var o=s[0],l=s[1],c=s[2],d=a[0],u=a[1],f=a[2],g=d-o,x=u-l,_=g*g+x*x,v,p;if(_<abe)p=Math.log(f/c)/t,v=function(E){return[o+E*g,l+E*x,c*Math.exp(t*E*p)]};else{var m=Math.sqrt(_),y=(f*f-c*c+r*_)/(2*c*n*m),b=(f*f-c*c-r*_)/(2*f*n*m),S=Math.log(Math.sqrt(y*y+1)-y),w=Math.log(Math.sqrt(b*b+1)-b);p=(w-S)/t,v=function(E){var k=E*p,T=FA(S),R=c/(n*m)*(T*cbe(t*k+S)-lbe(S));return[o+R*g,l+R*x,c*T/FA(t*k+S)]}}return v.duration=p*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 mB(e){return function t(n){n=+n;function r(i,s){var a=e((i=_s(i)).h,(s=_s(s)).h),o=ou(i.s,s.s),l=ou(i.l,s.l),c=ou(i.opacity,s.opacity);return function(d){return i.h=a(d),i.s=o(d),i.l=l(Math.pow(d,n)),i.opacity=c(d),i+""}}return r.gamma=t,r}(1)}mB(qxe);var A3=mB(ou),dbe=Ma,hbe=Er,fbe=Vi,pbe="[object String]";function mbe(e){return typeof e=="string"||!hbe(e)&&fbe(e)&&dbe(e)==pbe}var gbe=mbe;const vbe=bn(gbe);function ybe(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var gB=ybe;const Ae=bn(gB);function au(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function _be(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function tm(e){let t,n,r;e.length!==2?(t=au,n=(o,l)=>au(e(o),l),r=(o,l)=>e(o)-l):(t=e===au||e===_be?e:xbe,n=e,r=e);function i(o,l,c=0,d=o.length){if(c<d){if(t(l,l)!==0)return d;do{const u=c+d>>>1;n(o[u],l)<0?c=u+1:d=u}while(c<d)}return c}function s(o,l,c=0,d=o.length){if(c<d){if(t(l,l)!==0)return d;do{const u=c+d>>>1;n(o[u],l)<=0?c=u+1:d=u}while(c<d)}return c}function a(o,l,c=0,d=o.length){const u=i(o,l,c,d-1);return u>c&&r(o[u-1],l)>-r(o[u],l)?u-1:u}return{left:i,center:a,right:s}}function xbe(){return 0}function bbe(e){return e===null?NaN:+e}function*wbe(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const Sbe=tm(au),Cbe=Sbe.right;tm(bbe).center;class BA extends Map{constructor(t,n=Tbe){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(zA(this,t))}has(t){return super.has(zA(this,t))}set(t,n){return super.set(kbe(this,t),n)}delete(t){return super.delete(Ebe(this,t))}}function zA({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function kbe({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Ebe({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Tbe(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Mbe(e=au){if(e===au)return vB;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 vB(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const Rbe=Math.sqrt(50),Abe=Math.sqrt(10),Dbe=Math.sqrt(2);function yv(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>=Rbe?10:s>=Abe?5:s>=Dbe?2:1;let o,l,c;return i<0?(c=Math.pow(10,-i)/a,o=Math.round(e*c),l=Math.round(t*c),o/c<e&&++o,l/c>t&&--l,c=-c):(c=Math.pow(10,i)*a,o=Math.round(e/c),l=Math.round(t/c),o*c<e&&++o,l*c>t&&--l),l<o&&.5<=n&&n<2?yv(e,t,n*2):[o,l,c]}function dS(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?yv(t,e,n):yv(e,t,n);if(!(s>=i))return[];const o=s-i+1,l=new Array(o);if(r)if(a<0)for(let c=0;c<o;++c)l[c]=(s-c)/-a;else for(let c=0;c<o;++c)l[c]=(s-c)*a;else if(a<0)for(let c=0;c<o;++c)l[c]=(i+c)/-a;else for(let c=0;c<o;++c)l[c]=(i+c)*a;return l}function hS(e,t,n){return t=+t,e=+e,n=+n,yv(e,t,n)[2]}function fS(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?hS(t,e,n):hS(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function ko(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 UA(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function yB(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?vB:Mbe(i);r>n;){if(r-n>600){const l=r-n+1,c=t-n+1,d=Math.log(l),u=.5*Math.exp(2*d/3),f=.5*Math.sqrt(d*u*(l-u)/l)*(c-l/2<0?-1:1),g=Math.max(n,Math.floor(t-c*u/l+f)),x=Math.min(r,Math.floor(t+(l-c)*u/l+f));yB(e,t,g,x,i)}const s=e[t];let a=n,o=r;for(dh(e,n,t),i(e[r],s)>0&&dh(e,n,r);a<o;){for(dh(e,a,o),++a,--o;i(e[a],s)<0;)++a;for(;i(e[o],s)>0;)--o}i(e[n],s)===0?dh(e,n,o):(++o,dh(e,o,r)),o<=t&&(n=o+1),t<=o&&(r=o-1)}return e}function dh(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Lbe(e,t,n){if(e=Float64Array.from(wbe(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return UA(e);if(t>=1)return ko(e);var r,i=(r-1)*t,s=Math.floor(i),a=ko(yB(e,s).subarray(0,s+1)),o=UA(e.subarray(s+1));return a+(o-a)*(i-s)}}function D3(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 Vl(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function jbe(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 HA=Symbol("implicit");function Va(){var e=new BA,t=[],n=[],r=HA;function i(s){let a=e.get(s);if(a===void 0){if(r!==HA)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 BA;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 Va(t,n).unknown(r)},Vl.apply(i,arguments),i}function Ly(){var e=Va().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,s,a,o=!1,l=0,c=0,d=.5;delete e.unknown;function u(){var f=t().length,g=i<r,x=g?i:r,_=g?r:i;s=(_-x)/Math.max(1,f-l+c*2),o&&(s=Math.floor(s)),x+=(_-x-s*(f-l))*d,a=s*(1-l),o&&(x=Math.round(x),a=Math.round(a));var v=D3(f).map(function(p){return x+s*p});return n(g?v.reverse():v)}return e.domain=function(f){return arguments.length?(t(f),u()):t()},e.range=function(f){return arguments.length?([r,i]=f,r=+r,i=+i,u()):[r,i]},e.rangeRound=function(f){return[r,i]=f,r=+r,i=+i,o=!0,u()},e.bandwidth=function(){return a},e.step=function(){return s},e.round=function(f){return arguments.length?(o=!!f,u()):o},e.padding=function(f){return arguments.length?(l=Math.min(1,c=+f),u()):l},e.paddingInner=function(f){return arguments.length?(l=Math.min(1,f),u()):l},e.paddingOuter=function(f){return arguments.length?(c=+f,u()):c},e.align=function(f){return arguments.length?(d=Math.max(0,Math.min(1,f)),u()):d},e.copy=function(){return Ly(t(),[r,i]).round(o).paddingInner(l).paddingOuter(c).align(d)},Vl.apply(u(),arguments)}function _B(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return _B(t())},e}function Pbe(){return _B(Ly.apply(null,arguments).paddingInner(1))}function Nbe(e){return function(){return e}}function Obe(e){return+e}var WA=[0,1];function qo(e){return e}function pS(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Nbe(isNaN(t)?NaN:.5)}function Ibe(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function $be(e,t,n){var r=e[0],i=e[1],s=t[0],a=t[1];return i<r?(r=pS(i,r),s=n(a,s)):(r=pS(r,i),s=n(s,a)),function(o){return s(r(o))}}function Fbe(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]=pS(e[a],e[a+1]),s[a]=n(t[a],t[a+1]);return function(o){var l=Cbe(e,o,1,r)-1;return s[l](i[l](o))}}function jy(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function L3(){var e=WA,t=WA,n=Dy,r,i,s,a=qo,o,l,c;function d(){var f=Math.min(e.length,t.length);return a!==qo&&(a=Ibe(e[0],e[f-1])),o=f>2?Fbe:$be,l=c=null,u}function u(f){return f==null||isNaN(f=+f)?s:(l||(l=o(e.map(r),t,n)))(r(a(f)))}return u.invert=function(f){return a(i((c||(c=o(t,e.map(r),Ti)))(f)))},u.domain=function(f){return arguments.length?(e=Array.from(f,Obe),d()):e.slice()},u.range=function(f){return arguments.length?(t=Array.from(f),d()):t.slice()},u.rangeRound=function(f){return t=Array.from(f),n=hB,d()},u.clamp=function(f){return arguments.length?(a=f?!0:qo,d()):a!==qo},u.interpolate=function(f){return arguments.length?(n=f,d()):n},u.unknown=function(f){return arguments.length?(s=f,u):s},function(f,g){return r=f,i=g,d()}}function xB(){return L3()(qo,qo)}function Bbe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function _v(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 Bu(e){return e=_v(Math.abs(e)),e?e[1]:NaN}function zbe(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 Ube(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Hbe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function cp(e){if(!(t=Hbe.exec(e)))throw new Error("invalid format: "+e);var t;return new j3({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]})}cp.prototype=j3.prototype;function j3(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+""}j3.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 Wbe(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 bB;function Vbe(e,t){var n=_v(e,t);if(!n)return e+"";var r=n[0],i=n[1],s=i-(bB=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")+_v(e,Math.max(0,t+s-1))[0]}function VA(e,t){var n=_v(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 qA={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Bbe,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>VA(e*100,t),r:VA,s:Vbe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function YA(e){return e}var KA=Array.prototype.map,GA=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function qbe(e){var t=e.grouping===void 0||e.thousands===void 0?YA:zbe(KA.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?YA:Ube(KA.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 c(u){u=cp(u);var f=u.fill,g=u.align,x=u.sign,_=u.symbol,v=u.zero,p=u.width,m=u.comma,y=u.precision,b=u.trim,S=u.type;S==="n"?(m=!0,S="g"):qA[S]||(y===void 0&&(y=12),b=!0,S="g"),(v||f==="0"&&g==="=")&&(v=!0,f="0",g="=");var w=_==="$"?n:_==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",E=_==="$"?r:/[%p]/.test(S)?a:"",k=qA[S],T=/[defgprs%]/.test(S);y=y===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y));function R(M){var L=w,j=E,P,$,F;if(S==="c")j=k(M)+j,M="";else{M=+M;var W=M<0||1/M<0;if(M=isNaN(M)?l:k(Math.abs(M),y),b&&(M=Wbe(M)),W&&+M==0&&x!=="+"&&(W=!1),L=(W?x==="("?x:o:x==="-"||x==="("?"":x)+L,j=(S==="s"?GA[8+bB/3]:"")+j+(W&&x==="("?")":""),T){for(P=-1,$=M.length;++P<$;)if(F=M.charCodeAt(P),48>F||F>57){j=(F===46?i+M.slice(P+1):M.slice(P))+j,M=M.slice(0,P);break}}}m&&!v&&(M=t(M,1/0));var I=L.length+M.length+j.length,A=I<p?new Array(p-I+1).join(f):"";switch(m&&v&&(M=t(A+M,A.length?p-j.length:1/0),A=""),g){case"<":M=L+M+j+A;break;case"=":M=L+A+M+j;break;case"^":M=A.slice(0,I=A.length>>1)+L+M+j+A.slice(I);break;default:M=A+L+M+j;break}return s(M)}return R.toString=function(){return u+""},R}function d(u,f){var g=c((u=cp(u),u.type="f",u)),x=Math.max(-8,Math.min(8,Math.floor(Bu(f)/3)))*3,_=Math.pow(10,-x),v=GA[8+x/3];return function(p){return g(_*p)+v}}return{format:c,formatPrefix:d}}var ng,P3,wB;Ybe({thousands:",",grouping:[3],currency:["$",""]});function Ybe(e){return ng=qbe(e),P3=ng.format,wB=ng.formatPrefix,ng}function Kbe(e){return Math.max(0,-Bu(Math.abs(e)))}function Gbe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Bu(t)/3)))*3-Bu(Math.abs(e)))}function Xbe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Bu(t)-Bu(e))+1}function Qbe(e,t,n,r){var i=fS(e,t,n),s;switch(r=cp(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=Gbe(i,a))&&(r.precision=s),wB(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=Xbe(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=Kbe(i))&&(r.precision=s-(r.type==="%")*2);break}}return P3(r)}function N3(e){var t=e.domain;return e.ticks=function(n){var r=t();return dS(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return Qbe(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,c,d=10;for(o<a&&(c=a,a=o,o=c,c=i,i=s,s=c);d-- >0;){if(c=hS(a,o,n),c===l)return r[i]=a,r[s]=o,t(r);if(c>0)a=Math.floor(a/c)*c,o=Math.ceil(o/c)*c;else if(c<0)a=Math.ceil(a*c)/c,o=Math.floor(o*c)/c;else break;l=c}return e},e}function Yo(){var e=xB();return e.copy=function(){return jy(e,Yo())},Vl.apply(e,arguments),N3(e)}function SB(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 XA(e){return Math.log(e)}function QA(e){return Math.exp(e)}function Jbe(e){return-Math.log(-e)}function Zbe(e){return-Math.exp(-e)}function ewe(e){return isFinite(e)?+("1e"+e):e<0?0:e}function twe(e){return e===10?ewe:e===Math.E?Math.exp:t=>Math.pow(e,t)}function nwe(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 JA(e){return(t,n)=>-e(-t,n)}function rwe(e){const t=e(XA,QA),n=t.domain;let r=10,i,s;function a(){return i=nwe(r),s=twe(r),n()[0]<0?(i=JA(i),s=JA(s),e(Jbe,Zbe)):e(XA,QA),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 c=l[0],d=l[l.length-1];const u=d<c;u&&([c,d]=[d,c]);let f=i(c),g=i(d),x,_;const v=o==null?10:+o;let p=[];if(!(r%1)&&g-f<v){if(f=Math.floor(f),g=Math.ceil(g),c>0){for(;f<=g;++f)for(x=1;x<r;++x)if(_=f<0?x/s(-f):x*s(f),!(_<c)){if(_>d)break;p.push(_)}}else for(;f<=g;++f)for(x=r-1;x>=1;--x)if(_=f>0?x/s(-f):x*s(f),!(_<c)){if(_>d)break;p.push(_)}p.length*2<v&&(p=dS(c,d,v))}else p=dS(f,g,Math.min(g-f,v)).map(s);return u?p.reverse():p},t.tickFormat=(o,l)=>{if(o==null&&(o=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=cp(l)).precision==null&&(l.trim=!0),l=P3(l)),o===1/0)return l;const c=Math.max(1,r*o/t.ticks().length);return d=>{let u=d/s(Math.round(i(d)));return u*r<r-.5&&(u*=r),u<=c?l(d):""}},t.nice=()=>n(SB(n(),{floor:o=>s(Math.floor(i(o))),ceil:o=>s(Math.ceil(i(o)))})),t}function CB(){const e=rwe(L3()).domain([1,10]);return e.copy=()=>jy(e,CB()).base(e.base()),Vl.apply(e,arguments),e}function ZA(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function e6(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function iwe(e){var t=1,n=e(ZA(t),e6(t));return n.constant=function(r){return arguments.length?e(ZA(t=+r),e6(t)):t},N3(n)}function kB(){var e=iwe(L3());return e.copy=function(){return jy(e,kB()).constant(e.constant())},Vl.apply(e,arguments)}const ob=new Date,ab=new Date;function Sn(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 c;do l.push(c=new Date(+s)),t(s,o),e(s);while(c<s&&s<a);return l},i.filter=s=>Sn(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)=>(ob.setTime(+s),ab.setTime(+a),e(ob),e(ab),Math.floor(n(ob,ab))),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 xv=Sn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);xv.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Sn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):xv);xv.range;const zs=1e3,ti=zs*60,Us=ti*60,ro=Us*24,O3=ro*7,t6=ro*30,lb=ro*365,qa=Sn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*zs)},(e,t)=>(t-e)/zs,e=>e.getUTCSeconds());qa.range;const I3=Sn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*zs)},(e,t)=>{e.setTime(+e+t*ti)},(e,t)=>(t-e)/ti,e=>e.getMinutes());I3.range;const $3=Sn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*ti)},(e,t)=>(t-e)/ti,e=>e.getUTCMinutes());$3.range;const F3=Sn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*zs-e.getMinutes()*ti)},(e,t)=>{e.setTime(+e+t*Us)},(e,t)=>(t-e)/Us,e=>e.getHours());F3.range;const B3=Sn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Us)},(e,t)=>(t-e)/Us,e=>e.getUTCHours());B3.range;const nm=Sn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ti)/ro,e=>e.getDate()-1);nm.range;const Py=Sn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ro,e=>e.getUTCDate()-1);Py.range;const EB=Sn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ro,e=>Math.floor(e/ro));EB.range;function ql(e){return Sn(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())*ti)/O3)}const Ny=ql(0),bv=ql(1),swe=ql(2),owe=ql(3),zu=ql(4),awe=ql(5),lwe=ql(6);Ny.range;bv.range;swe.range;owe.range;zu.range;awe.range;lwe.range;function Yl(e){return Sn(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)/O3)}const Oy=Yl(0),wv=Yl(1),cwe=Yl(2),uwe=Yl(3),Uu=Yl(4),dwe=Yl(5),hwe=Yl(6);Oy.range;wv.range;cwe.range;uwe.range;Uu.range;dwe.range;hwe.range;const z3=Sn(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());z3.range;const U3=Sn(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());U3.range;const io=Sn(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());io.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Sn(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)});io.range;const so=Sn(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());so.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Sn(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)});so.range;function TB(e,t,n,r,i,s){const a=[[qa,1,zs],[qa,5,5*zs],[qa,15,15*zs],[qa,30,30*zs],[s,1,ti],[s,5,5*ti],[s,15,15*ti],[s,30,30*ti],[i,1,Us],[i,3,3*Us],[i,6,6*Us],[i,12,12*Us],[r,1,ro],[r,2,2*ro],[n,1,O3],[t,1,t6],[t,3,3*t6],[e,1,lb]];function o(c,d,u){const f=d<c;f&&([c,d]=[d,c]);const g=u&&typeof u.range=="function"?u:l(c,d,u),x=g?g.range(c,+d+1):[];return f?x.reverse():x}function l(c,d,u){const f=Math.abs(d-c)/u,g=tm(([,,v])=>v).right(a,f);if(g===a.length)return e.every(fS(c/lb,d/lb,u));if(g===0)return xv.every(Math.max(fS(c,d,u),1));const[x,_]=a[f/a[g-1][2]<a[g][2]/f?g-1:g];return x.every(_)}return[o,l]}const[fwe,pwe]=TB(so,U3,Oy,EB,B3,$3),[mwe,gwe]=TB(io,z3,Ny,nm,F3,I3);function cb(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 ub(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 hh(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function vwe(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,c=fh(i),d=ph(i),u=fh(s),f=ph(s),g=fh(a),x=ph(a),_=fh(o),v=ph(o),p=fh(l),m=ph(l),y={a:W,A:I,b:A,B:D,c:null,d:a6,e:a6,f:Bwe,g:Xwe,G:Jwe,H:Iwe,I:$we,j:Fwe,L:MB,m:zwe,M:Uwe,p:H,q:V,Q:u6,s:d6,S:Hwe,u:Wwe,U:Vwe,V:qwe,w:Ywe,W:Kwe,x:null,X:null,y:Gwe,Y:Qwe,Z:Zwe,"%":c6},b={a:U,A:G,b:ee,B:Z,c:null,d:l6,e:l6,f:r2e,g:f2e,G:m2e,H:e2e,I:t2e,j:n2e,L:AB,m:i2e,M:s2e,p:q,q:B,Q:u6,s:d6,S:o2e,u:a2e,U:l2e,V:c2e,w:u2e,W:d2e,x:null,X:null,y:h2e,Y:p2e,Z:g2e,"%":c6},S={a:R,A:M,b:L,B:j,c:P,d:s6,e:s6,f:jwe,g:i6,G:r6,H:o6,I:o6,j:Rwe,L:Lwe,m:Mwe,M:Awe,p:T,q:Twe,Q:Nwe,s:Owe,S:Dwe,u:wwe,U:Swe,V:Cwe,w:bwe,W:kwe,x:$,X:F,y:i6,Y:r6,Z:Ewe,"%":Pwe};y.x=w(n,y),y.X=w(r,y),y.c=w(t,y),b.x=w(n,b),b.X=w(r,b),b.c=w(t,b);function w(O,z){return function(Y){var N=[],J=-1,K=0,te=O.length,oe,ae,_e;for(Y instanceof Date||(Y=new Date(+Y));++J<te;)O.charCodeAt(J)===37&&(N.push(O.slice(K,J)),(ae=n6[oe=O.charAt(++J)])!=null?oe=O.charAt(++J):ae=oe==="e"?" ":"0",(_e=z[oe])&&(oe=_e(Y,ae)),N.push(oe),K=J+1);return N.push(O.slice(K,J)),N.join("")}}function E(O,z){return function(Y){var N=hh(1900,void 0,1),J=k(N,O,Y+="",0),K,te;if(J!=Y.length)return null;if("Q"in N)return new Date(N.Q);if("s"in N)return new Date(N.s*1e3+("L"in N?N.L:0));if(z&&!("Z"in N)&&(N.Z=0),"p"in N&&(N.H=N.H%12+N.p*12),N.m===void 0&&(N.m="q"in N?N.q:0),"V"in N){if(N.V<1||N.V>53)return null;"w"in N||(N.w=1),"Z"in N?(K=ub(hh(N.y,0,1)),te=K.getUTCDay(),K=te>4||te===0?wv.ceil(K):wv(K),K=Py.offset(K,(N.V-1)*7),N.y=K.getUTCFullYear(),N.m=K.getUTCMonth(),N.d=K.getUTCDate()+(N.w+6)%7):(K=cb(hh(N.y,0,1)),te=K.getDay(),K=te>4||te===0?bv.ceil(K):bv(K),K=nm.offset(K,(N.V-1)*7),N.y=K.getFullYear(),N.m=K.getMonth(),N.d=K.getDate()+(N.w+6)%7)}else("W"in N||"U"in N)&&("w"in N||(N.w="u"in N?N.u%7:"W"in N?1:0),te="Z"in N?ub(hh(N.y,0,1)).getUTCDay():cb(hh(N.y,0,1)).getDay(),N.m=0,N.d="W"in N?(N.w+6)%7+N.W*7-(te+5)%7:N.w+N.U*7-(te+6)%7);return"Z"in N?(N.H+=N.Z/100|0,N.M+=N.Z%100,ub(N)):cb(N)}}function k(O,z,Y,N){for(var J=0,K=z.length,te=Y.length,oe,ae;J<K;){if(N>=te)return-1;if(oe=z.charCodeAt(J++),oe===37){if(oe=z.charAt(J++),ae=S[oe in n6?z.charAt(J++):oe],!ae||(N=ae(O,Y,N))<0)return-1}else if(oe!=Y.charCodeAt(N++))return-1}return N}function T(O,z,Y){var N=c.exec(z.slice(Y));return N?(O.p=d.get(N[0].toLowerCase()),Y+N[0].length):-1}function R(O,z,Y){var N=g.exec(z.slice(Y));return N?(O.w=x.get(N[0].toLowerCase()),Y+N[0].length):-1}function M(O,z,Y){var N=u.exec(z.slice(Y));return N?(O.w=f.get(N[0].toLowerCase()),Y+N[0].length):-1}function L(O,z,Y){var N=p.exec(z.slice(Y));return N?(O.m=m.get(N[0].toLowerCase()),Y+N[0].length):-1}function j(O,z,Y){var N=_.exec(z.slice(Y));return N?(O.m=v.get(N[0].toLowerCase()),Y+N[0].length):-1}function P(O,z,Y){return k(O,t,z,Y)}function $(O,z,Y){return k(O,n,z,Y)}function F(O,z,Y){return k(O,r,z,Y)}function W(O){return a[O.getDay()]}function I(O){return s[O.getDay()]}function A(O){return l[O.getMonth()]}function D(O){return o[O.getMonth()]}function H(O){return i[+(O.getHours()>=12)]}function V(O){return 1+~~(O.getMonth()/3)}function U(O){return a[O.getUTCDay()]}function G(O){return s[O.getUTCDay()]}function ee(O){return l[O.getUTCMonth()]}function Z(O){return o[O.getUTCMonth()]}function q(O){return i[+(O.getUTCHours()>=12)]}function B(O){return 1+~~(O.getUTCMonth()/3)}return{format:function(O){var z=w(O+="",y);return z.toString=function(){return O},z},parse:function(O){var z=E(O+="",!1);return z.toString=function(){return O},z},utcFormat:function(O){var z=w(O+="",b);return z.toString=function(){return O},z},utcParse:function(O){var z=E(O+="",!0);return z.toString=function(){return O},z}}}var n6={"-":"",_:" ",0:"0"},Dn=/^\s*\d+/,ywe=/^%/,_we=/[\\^$*+?|[\]().{}]/g;function mt(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 xwe(e){return e.replace(_we,"\\$&")}function fh(e){return new RegExp("^(?:"+e.map(xwe).join("|")+")","i")}function ph(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function bwe(e,t,n){var r=Dn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function wwe(e,t,n){var r=Dn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Swe(e,t,n){var r=Dn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Cwe(e,t,n){var r=Dn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function kwe(e,t,n){var r=Dn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function r6(e,t,n){var r=Dn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function i6(e,t,n){var r=Dn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Ewe(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 Twe(e,t,n){var r=Dn.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Mwe(e,t,n){var r=Dn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function s6(e,t,n){var r=Dn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Rwe(e,t,n){var r=Dn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function o6(e,t,n){var r=Dn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Awe(e,t,n){var r=Dn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Dwe(e,t,n){var r=Dn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Lwe(e,t,n){var r=Dn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function jwe(e,t,n){var r=Dn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Pwe(e,t,n){var r=ywe.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Nwe(e,t,n){var r=Dn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Owe(e,t,n){var r=Dn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function a6(e,t){return mt(e.getDate(),t,2)}function Iwe(e,t){return mt(e.getHours(),t,2)}function $we(e,t){return mt(e.getHours()%12||12,t,2)}function Fwe(e,t){return mt(1+nm.count(io(e),e),t,3)}function MB(e,t){return mt(e.getMilliseconds(),t,3)}function Bwe(e,t){return MB(e,t)+"000"}function zwe(e,t){return mt(e.getMonth()+1,t,2)}function Uwe(e,t){return mt(e.getMinutes(),t,2)}function Hwe(e,t){return mt(e.getSeconds(),t,2)}function Wwe(e){var t=e.getDay();return t===0?7:t}function Vwe(e,t){return mt(Ny.count(io(e)-1,e),t,2)}function RB(e){var t=e.getDay();return t>=4||t===0?zu(e):zu.ceil(e)}function qwe(e,t){return e=RB(e),mt(zu.count(io(e),e)+(io(e).getDay()===4),t,2)}function Ywe(e){return e.getDay()}function Kwe(e,t){return mt(bv.count(io(e)-1,e),t,2)}function Gwe(e,t){return mt(e.getFullYear()%100,t,2)}function Xwe(e,t){return e=RB(e),mt(e.getFullYear()%100,t,2)}function Qwe(e,t){return mt(e.getFullYear()%1e4,t,4)}function Jwe(e,t){var n=e.getDay();return e=n>=4||n===0?zu(e):zu.ceil(e),mt(e.getFullYear()%1e4,t,4)}function Zwe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+mt(t/60|0,"0",2)+mt(t%60,"0",2)}function l6(e,t){return mt(e.getUTCDate(),t,2)}function e2e(e,t){return mt(e.getUTCHours(),t,2)}function t2e(e,t){return mt(e.getUTCHours()%12||12,t,2)}function n2e(e,t){return mt(1+Py.count(so(e),e),t,3)}function AB(e,t){return mt(e.getUTCMilliseconds(),t,3)}function r2e(e,t){return AB(e,t)+"000"}function i2e(e,t){return mt(e.getUTCMonth()+1,t,2)}function s2e(e,t){return mt(e.getUTCMinutes(),t,2)}function o2e(e,t){return mt(e.getUTCSeconds(),t,2)}function a2e(e){var t=e.getUTCDay();return t===0?7:t}function l2e(e,t){return mt(Oy.count(so(e)-1,e),t,2)}function DB(e){var t=e.getUTCDay();return t>=4||t===0?Uu(e):Uu.ceil(e)}function c2e(e,t){return e=DB(e),mt(Uu.count(so(e),e)+(so(e).getUTCDay()===4),t,2)}function u2e(e){return e.getUTCDay()}function d2e(e,t){return mt(wv.count(so(e)-1,e),t,2)}function h2e(e,t){return mt(e.getUTCFullYear()%100,t,2)}function f2e(e,t){return e=DB(e),mt(e.getUTCFullYear()%100,t,2)}function p2e(e,t){return mt(e.getUTCFullYear()%1e4,t,4)}function m2e(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Uu(e):Uu.ceil(e),mt(e.getUTCFullYear()%1e4,t,4)}function g2e(){return"+0000"}function c6(){return"%"}function u6(e){return+e}function d6(e){return Math.floor(+e/1e3)}var gc,LB,jB;v2e({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 v2e(e){return gc=vwe(e),LB=gc.format,gc.parse,jB=gc.utcFormat,gc.utcParse,gc}function y2e(e){return new Date(e)}function _2e(e){return e instanceof Date?+e:+new Date(+e)}function H3(e,t,n,r,i,s,a,o,l,c){var d=xB(),u=d.invert,f=d.domain,g=c(".%L"),x=c(":%S"),_=c("%I:%M"),v=c("%I %p"),p=c("%a %d"),m=c("%b %d"),y=c("%B"),b=c("%Y");function S(w){return(l(w)<w?g:o(w)<w?x:a(w)<w?_:s(w)<w?v:r(w)<w?i(w)<w?p:m:n(w)<w?y:b)(w)}return d.invert=function(w){return new Date(u(w))},d.domain=function(w){return arguments.length?f(Array.from(w,_2e)):f().map(y2e)},d.ticks=function(w){var E=f();return e(E[0],E[E.length-1],w??10)},d.tickFormat=function(w,E){return E==null?S:c(E)},d.nice=function(w){var E=f();return(!w||typeof w.range!="function")&&(w=t(E[0],E[E.length-1],w??10)),w?f(SB(E,w)):d},d.copy=function(){return jy(d,H3(e,t,n,r,i,s,a,o,l,c))},d}function W3(){return Vl.apply(H3(mwe,gwe,io,z3,Ny,nm,F3,I3,qa,LB).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function x2e(){return Vl.apply(H3(fwe,pwe,so,U3,Oy,Py,B3,$3,qa,jB).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function b2e(){var e=0,t=1,n,r,i,s,a=qo,o=!1,l;function c(u){return u==null||isNaN(u=+u)?l:a(i===0?.5:(u=(s(u)-n)*i,o?Math.max(0,Math.min(1,u)):u))}c.domain=function(u){return arguments.length?([e,t]=u,n=s(e=+e),r=s(t=+t),i=n===r?0:1/(r-n),c):[e,t]},c.clamp=function(u){return arguments.length?(o=!!u,c):o},c.interpolator=function(u){return arguments.length?(a=u,c):a};function d(u){return function(f){var g,x;return arguments.length?([g,x]=f,a=u(g,x),c):[a(0),a(1)]}}return c.range=d(Dy),c.rangeRound=d(hB),c.unknown=function(u){return arguments.length?(l=u,c):l},function(u){return s=u,n=u(e),r=u(t),i=n===r?0:1/(r-n),c}}function w2e(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function PB(){var e=N3(b2e()(qo));return e.copy=function(){return w2e(e,PB())},jbe.apply(e,arguments)}function Ge(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 NB=Ge("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),OB=Ge("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),IB=Ge("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),$B=Ge("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),FB=Ge("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),BB=Ge("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),zB=Ge("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),UB=Ge("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),V3=Ge("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),S2e=Ge("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab"),Rt=e=>Gxe(e[e.length-1]);var Iy=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(Ge);const C2e=Rt(Iy);var $y=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(Ge);const k2e=Rt($y);var Fy=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(Ge);const E2e=Rt(Fy);var By=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(Ge);const T2e=Rt(By);var zy=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(Ge);const M2e=Rt(zy);var Uy=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(Ge);const R2e=Rt(Uy);var Hy=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(Ge);const A2e=Rt(Hy);var Wy=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(Ge);const HB=Rt(Wy);var Vy=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(Ge);const D2e=Rt(Vy);var qy=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(Ge);const L2e=Rt(qy);var Yy=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(Ge);const j2e=Rt(Yy);var Ky=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(Ge);const P2e=Rt(Ky);var Gy=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(Ge);const N2e=Rt(Gy);var Xy=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(Ge);const O2e=Rt(Xy);var Qy=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(Ge);const I2e=Rt(Qy);var Jy=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(Ge);const $2e=Rt(Jy);var Zy=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(Ge);const F2e=Rt(Zy);var e_=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(Ge);const B2e=Rt(e_);var t_=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(Ge);const WB=Rt(t_);var n_=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(Ge);const z2e=Rt(n_);var r_=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(Ge);const VB=Rt(r_);var i_=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(Ge);const U2e=Rt(i_);var s_=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(Ge);const H2e=Rt(s_);var o_=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(Ge);const W2e=Rt(o_);var a_=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(Ge);const V2e=Rt(a_);var l_=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(Ge);const q2e=Rt(l_);var c_=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(Ge);const Y2e=Rt(c_);function K2e(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 G2e=A3(_s(300,.5,0),_s(-240,.5,1));var X2e=A3(_s(-100,.75,.35),_s(80,1.5,.8)),qB=A3(_s(260,.75,.35),_s(80,1.5,.8)),rg=_s();function Q2e(e){(e<0||e>1)&&(e-=Math.floor(e));var t=Math.abs(e-.5);return rg.h=360*e-100,rg.s=1.5-1.5*t,rg.l=.8-.9*t,rg+""}var ig=Fu(),J2e=Math.PI/3,Z2e=Math.PI*2/3;function eSe(e){var t;return e=(.5-e)*Math.PI,ig.r=255*(t=Math.sin(e))*t,ig.g=255*(t=Math.sin(e+J2e))*t,ig.b=255*(t=Math.sin(e+Z2e))*t,ig+""}function tSe(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 u_(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}const YB=u_(Ge("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var nSe=u_(Ge("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),rSe=u_(Ge("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),iSe=u_(Ge("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),sSe="__lodash_hash_undefined__";function oSe(e){return this.__data__.set(e,sSe),this}var aSe=oSe;function lSe(e){return this.__data__.has(e)}var cSe=lSe,uSe=f3,dSe=aSe,hSe=cSe;function Sv(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new uSe;++t<n;)this.add(e[t])}Sv.prototype.add=Sv.prototype.push=dSe;Sv.prototype.has=hSe;var q3=Sv;function fSe(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 pSe=fSe;function mSe(e){return e!==e}var gSe=mSe;function vSe(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}var ySe=vSe,_Se=pSe,xSe=gSe,bSe=ySe;function wSe(e,t,n){return t===t?bSe(e,t,n):_Se(e,xSe,n)}var SSe=wSe,CSe=SSe;function kSe(e,t){var n=e==null?0:e.length;return!!n&&CSe(e,t,0)>-1}var KB=kSe;function ESe(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 GB=ESe;function TSe(e,t){return e.has(t)}var Y3=TSe,MSe=q3,RSe=KB,ASe=GB,DSe=Ty,LSe=Jp,jSe=Y3,PSe=200;function NSe(e,t,n,r){var i=-1,s=RSe,a=!0,o=e.length,l=[],c=t.length;if(!o)return l;n&&(t=DSe(t,LSe(n))),r?(s=ASe,a=!1):t.length>=PSe&&(s=jSe,a=!1,t=new MSe(t));e:for(;++i<o;){var d=e[i],u=n==null?d:n(d);if(d=r||d!==0?d:0,a&&u===u){for(var f=c;f--;)if(t[f]===u)continue e;l.push(d)}else s(t,u,r)||l.push(d)}return l}var OSe=NSe,ISe=OSe,$Se=S3,FSe=XF,BSe=$Se(function(e,t){return FSe(e)?ISe(e,t):[]}),zSe=BSe;const XB=bn(zSe);function Wt(e){return function(){return e}}const h6=Math.abs,Hn=Math.atan2,Da=Math.cos,USe=Math.max,db=Math.min,Ki=Math.sin,Fc=Math.sqrt,Wn=1e-12,up=Math.PI,Cv=up/2,zg=2*up;function HSe(e){return e>1?0:e<-1?up:Math.acos(e)}function f6(e){return e>=1?Cv:e<=-1?-Cv:Math.asin(e)}const mS=Math.PI,gS=2*mS,Na=1e-6,WSe=gS-Na;function QB(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function VSe(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 qSe{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?QB:VSe(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,c=i-n,d=a-t,u=o-n,f=d*d+u*u;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(f>Na)if(!(Math.abs(u*l-c*d)>Na)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let g=r-a,x=i-o,_=l*l+c*c,v=g*g+x*x,p=Math.sqrt(_),m=Math.sqrt(f),y=s*Math.tan((mS-Math.acos((_+f-v)/(2*p*m)))/2),b=y/m,S=y/p;Math.abs(b-1)>Na&&this._append`L${t+b*d},${n+b*u}`,this._append`A${s},${s},0,0,${+(u*g>d*x)},${this._x1=t+S*l},${this._y1=n+S*c}`}}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),c=t+o,d=n+l,u=1^a,f=a?i-s:s-i;this._x1===null?this._append`M${c},${d}`:(Math.abs(this._x1-c)>Na||Math.abs(this._y1-d)>Na)&&this._append`L${c},${d}`,r&&(f<0&&(f=f%gS+gS),f>WSe?this._append`A${r},${r},0,1,${u},${t-o},${n-l}A${r},${r},0,1,${u},${this._x1=c},${this._y1=d}`:f>Na&&this._append`A${r},${r},0,${+(f>=mS)},${u},${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 JB(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 qSe(t)}function YSe(e){return e.innerRadius}function KSe(e){return e.outerRadius}function GSe(e){return e.startAngle}function XSe(e){return e.endAngle}function QSe(e){return e&&e.padAngle}function JSe(e,t,n,r,i,s,a,o){var l=n-e,c=r-t,d=a-i,u=o-s,f=u*l-d*c;if(!(f*f<Wn))return f=(d*(t-s)-u*(e-i))/f,[e+f*l,t+f*c]}function sg(e,t,n,r,i,s,a){var o=e-n,l=t-r,c=(a?s:-s)/Fc(o*o+l*l),d=c*l,u=-c*o,f=e+d,g=t+u,x=n+d,_=r+u,v=(f+x)/2,p=(g+_)/2,m=x-f,y=_-g,b=m*m+y*y,S=i-s,w=f*_-x*g,E=(y<0?-1:1)*Fc(USe(0,S*S*b-w*w)),k=(w*y-m*E)/b,T=(-w*m-y*E)/b,R=(w*y+m*E)/b,M=(-w*m+y*E)/b,L=k-v,j=T-p,P=R-v,$=M-p;return L*L+j*j>P*P+$*$&&(k=R,T=M),{cx:k,cy:T,x01:-d,y01:-u,x11:k*(i/S-1),y11:T*(i/S-1)}}function ZSe(){var e=YSe,t=KSe,n=Wt(0),r=null,i=GSe,s=XSe,a=QSe,o=null,l=JB(c);function c(){var d,u,f=+e.apply(this,arguments),g=+t.apply(this,arguments),x=i.apply(this,arguments)-Cv,_=s.apply(this,arguments)-Cv,v=h6(_-x),p=_>x;if(o||(o=d=l()),g<f&&(u=g,g=f,f=u),!(g>Wn))o.moveTo(0,0);else if(v>zg-Wn)o.moveTo(g*Da(x),g*Ki(x)),o.arc(0,0,g,x,_,!p),f>Wn&&(o.moveTo(f*Da(_),f*Ki(_)),o.arc(0,0,f,_,x,p));else{var m=x,y=_,b=x,S=_,w=v,E=v,k=a.apply(this,arguments)/2,T=k>Wn&&(r?+r.apply(this,arguments):Fc(f*f+g*g)),R=db(h6(g-f)/2,+n.apply(this,arguments)),M=R,L=R,j,P;if(T>Wn){var $=f6(T/f*Ki(k)),F=f6(T/g*Ki(k));(w-=$*2)>Wn?($*=p?1:-1,b+=$,S-=$):(w=0,b=S=(x+_)/2),(E-=F*2)>Wn?(F*=p?1:-1,m+=F,y-=F):(E=0,m=y=(x+_)/2)}var W=g*Da(m),I=g*Ki(m),A=f*Da(S),D=f*Ki(S);if(R>Wn){var H=g*Da(y),V=g*Ki(y),U=f*Da(b),G=f*Ki(b),ee;if(v<up)if(ee=JSe(W,I,U,G,H,V,A,D)){var Z=W-ee[0],q=I-ee[1],B=H-ee[0],O=V-ee[1],z=1/Ki(HSe((Z*B+q*O)/(Fc(Z*Z+q*q)*Fc(B*B+O*O)))/2),Y=Fc(ee[0]*ee[0]+ee[1]*ee[1]);M=db(R,(f-Y)/(z-1)),L=db(R,(g-Y)/(z+1))}else M=L=0}E>Wn?L>Wn?(j=sg(U,G,W,I,g,L,p),P=sg(H,V,A,D,g,L,p),o.moveTo(j.cx+j.x01,j.cy+j.y01),L<R?o.arc(j.cx,j.cy,L,Hn(j.y01,j.x01),Hn(P.y01,P.x01),!p):(o.arc(j.cx,j.cy,L,Hn(j.y01,j.x01),Hn(j.y11,j.x11),!p),o.arc(0,0,g,Hn(j.cy+j.y11,j.cx+j.x11),Hn(P.cy+P.y11,P.cx+P.x11),!p),o.arc(P.cx,P.cy,L,Hn(P.y11,P.x11),Hn(P.y01,P.x01),!p))):(o.moveTo(W,I),o.arc(0,0,g,m,y,!p)):o.moveTo(W,I),!(f>Wn)||!(w>Wn)?o.lineTo(A,D):M>Wn?(j=sg(A,D,H,V,f,-M,p),P=sg(W,I,U,G,f,-M,p),o.lineTo(j.cx+j.x01,j.cy+j.y01),M<R?o.arc(j.cx,j.cy,M,Hn(j.y01,j.x01),Hn(P.y01,P.x01),!p):(o.arc(j.cx,j.cy,M,Hn(j.y01,j.x01),Hn(j.y11,j.x11),!p),o.arc(0,0,f,Hn(j.cy+j.y11,j.cx+j.x11),Hn(P.cy+P.y11,P.cx+P.x11),p),o.arc(P.cx,P.cy,M,Hn(P.y11,P.x11),Hn(P.y01,P.x01),!p))):o.arc(0,0,f,S,b,p)}if(o.closePath(),d)return o=null,d+""||null}return c.centroid=function(){var d=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,u=(+i.apply(this,arguments)+ +s.apply(this,arguments))/2-up/2;return[Da(u)*d,Ki(u)*d]},c.innerRadius=function(d){return arguments.length?(e=typeof d=="function"?d:Wt(+d),c):e},c.outerRadius=function(d){return arguments.length?(t=typeof d=="function"?d:Wt(+d),c):t},c.cornerRadius=function(d){return arguments.length?(n=typeof d=="function"?d:Wt(+d),c):n},c.padRadius=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:Wt(+d),c):r},c.startAngle=function(d){return arguments.length?(i=typeof d=="function"?d:Wt(+d),c):i},c.endAngle=function(d){return arguments.length?(s=typeof d=="function"?d:Wt(+d),c):s},c.padAngle=function(d){return arguments.length?(a=typeof d=="function"?d:Wt(+d),c):a},c.context=function(d){return arguments.length?(o=d??null,c):o},c}function K3(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ZB(e){this._context=e}ZB.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 ez(e){return new ZB(e)}function eCe(e){return e[0]}function tCe(e){return e[1]}function tz(e,t){var n=Wt(!0),r=null,i=ez,s=null,a=JB(o);e=typeof e=="function"?e:e===void 0?eCe:Wt(e),t=typeof t=="function"?t:t===void 0?tCe:Wt(t);function o(l){var c,d=(l=K3(l)).length,u,f=!1,g;for(r==null&&(s=i(g=a())),c=0;c<=d;++c)!(c<d&&n(u=l[c],c,l))===f&&((f=!f)?s.lineStart():s.lineEnd()),f&&s.point(+e(u,c,l),+t(u,c,l));if(g)return s=null,g+""||null}return o.x=function(l){return arguments.length?(e=typeof l=="function"?l:Wt(+l),o):e},o.y=function(l){return arguments.length?(t=typeof l=="function"?l:Wt(+l),o):t},o.defined=function(l){return arguments.length?(n=typeof l=="function"?l:Wt(!!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 nCe(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function rCe(e){return e}function iCe(){var e=rCe,t=nCe,n=null,r=Wt(0),i=Wt(zg),s=Wt(0);function a(o){var l,c=(o=K3(o)).length,d,u,f=0,g=new Array(c),x=new Array(c),_=+r.apply(this,arguments),v=Math.min(zg,Math.max(-zg,i.apply(this,arguments)-_)),p,m=Math.min(Math.abs(v)/c,s.apply(this,arguments)),y=m*(v<0?-1:1),b;for(l=0;l<c;++l)(b=x[g[l]=l]=+e(o[l],l,o))>0&&(f+=b);for(t!=null?g.sort(function(S,w){return t(x[S],x[w])}):n!=null&&g.sort(function(S,w){return n(o[S],o[w])}),l=0,u=f?(v-c*y)/f:0;l<c;++l,_=p)d=g[l],b=x[d],p=_+(b>0?b*u:0)+y,x[d]={data:o[d],index:l,value:b,startAngle:_,endAngle:p,padAngle:m};return x}return a.value=function(o){return arguments.length?(e=typeof o=="function"?o:Wt(+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:Wt(+o),a):r},a.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:Wt(+o),a):i},a.padAngle=function(o){return arguments.length?(s=typeof o=="function"?o:Wt(+o),a):s},a}function ya(){}function kv(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 d_(e){this._context=e}d_.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:kv(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:kv(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function sCe(e){return new d_(e)}function nz(e){this._context=e}nz.prototype={areaStart:ya,areaEnd:ya,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:kv(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function oCe(e){return new nz(e)}function rz(e){this._context=e}rz.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:kv(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function aCe(e){return new rz(e)}function iz(e,t){this._basis=new d_(e),this._beta=t}iz.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 lCe=function e(t){function n(r){return t===1?new d_(r):new iz(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function Ev(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 G3(e,t){this._context=e,this._k=(1-t)/6}G3.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:Ev(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:Ev(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 cCe=function e(t){function n(r){return new G3(r,t)}return n.tension=function(r){return e(+r)},n}(0);function X3(e,t){this._context=e,this._k=(1-t)/6}X3.prototype={areaStart:ya,areaEnd:ya,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:Ev(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 uCe=function e(t){function n(r){return new X3(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Q3(e,t){this._context=e,this._k=(1-t)/6}Q3.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:Ev(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 dCe=function e(t){function n(r){return new Q3(r,t)}return n.tension=function(r){return e(+r)},n}(0);function J3(e,t,n){var r=e._x1,i=e._y1,s=e._x2,a=e._y2;if(e._l01_a>Wn){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>Wn){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,d=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*c+e._x1*e._l23_2a-t*e._l12_2a)/d,a=(a*c+e._y1*e._l23_2a-n*e._l12_2a)/d}e._context.bezierCurveTo(r,i,s,a,e._x2,e._y2)}function sz(e,t){this._context=e,this._alpha=t}sz.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:J3(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 hCe=function e(t){function n(r){return t?new sz(r,t):new G3(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function oz(e,t){this._context=e,this._alpha=t}oz.prototype={areaStart:ya,areaEnd:ya,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:J3(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 fCe=function e(t){function n(r){return t?new oz(r,t):new X3(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function az(e,t){this._context=e,this._alpha=t}az.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:J3(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 pCe=function e(t){function n(r){return t?new az(r,t):new Q3(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function lz(e){this._context=e}lz.prototype={areaStart:ya,areaEnd:ya,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 mCe(e){return new lz(e)}function p6(e){return e<0?-1:1}function m6(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(p6(s)+p6(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function g6(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function hb(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 Tv(e){this._context=e}Tv.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:hb(this,this._t0,g6(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,hb(this,g6(this,n=m6(this,e,t)),n);break;default:hb(this,this._t0,n=m6(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function cz(e){this._context=new uz(e)}(cz.prototype=Object.create(Tv.prototype)).point=function(e,t){Tv.prototype.point.call(this,t,e)};function uz(e){this._context=e}uz.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 gCe(e){return new Tv(e)}function vCe(e){return new cz(e)}function dz(e){this._context=e}dz.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=v6(e),i=v6(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 v6(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 hz(e){return new dz(e)}function h_(e,t){this._context=e,this._t=t}h_.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 yCe(e){return new h_(e,.5)}function _Ce(e){return new h_(e,0)}function xCe(e){return new h_(e,1)}function y6(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 _6(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function bCe(e,t){return e[t]}function wCe(e){const t=[];return t.key=e,t}function SCe(){var e=Wt([]),t=_6,n=y6,r=bCe;function i(s){var a=Array.from(e.apply(this,arguments),wCe),o,l=a.length,c=-1,d;for(const u of s)for(o=0,++c;o<l;++o)(a[o][c]=[0,+r(u,a[o].key,c,s)]).data=u;for(o=0,d=K3(t(a));o<l;++o)a[d[o]].index=o;return n(a,d),a}return i.keys=function(s){return arguments.length?(e=typeof s=="function"?s:Wt(Array.from(s)),i):e},i.value=function(s){return arguments.length?(r=typeof s=="function"?s:Wt(+s),i):r},i.order=function(s){return arguments.length?(t=s==null?_6:typeof s=="function"?s:Wt(Array.from(s)),i):t},i.offset=function(s){return arguments.length?(n=s??y6,i):n},i}function CCe(e,t){if((l=e.length)>0)for(var n,r=0,i,s,a,o,l,c=e[t[0]].length;r<c;++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)}function kCe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Mv(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 ECe(e){return e=Mv(Math.abs(e)),e?e[1]:NaN}function TCe(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 MCe(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var RCe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function vS(e){if(!(t=RCe.exec(e)))throw new Error("invalid format: "+e);var t;return new Z3({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]})}vS.prototype=Z3.prototype;function Z3(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+""}Z3.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 ACe(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 fz;function DCe(e,t){var n=Mv(e,t);if(!n)return e+"";var r=n[0],i=n[1],s=i-(fz=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")+Mv(e,Math.max(0,t+s-1))[0]}function x6(e,t){var n=Mv(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 b6={"%":function(e,t){return(e*100).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:kCe,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 x6(e*100,t)},r:x6,s:DCe,X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function w6(e){return e}var S6=Array.prototype.map,C6=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function LCe(e){var t=e.grouping===void 0||e.thousands===void 0?w6:TCe(S6.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?w6:MCe(S6.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 c(u){u=vS(u);var f=u.fill,g=u.align,x=u.sign,_=u.symbol,v=u.zero,p=u.width,m=u.comma,y=u.precision,b=u.trim,S=u.type;S==="n"?(m=!0,S="g"):b6[S]||(y===void 0&&(y=12),b=!0,S="g"),(v||f==="0"&&g==="=")&&(v=!0,f="0",g="=");var w=_==="$"?n:_==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",E=_==="$"?r:/[%p]/.test(S)?a:"",k=b6[S],T=/[defgprs%]/.test(S);y=y===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y));function R(M){var L=w,j=E,P,$,F;if(S==="c")j=k(M)+j,M="";else{M=+M;var W=M<0||1/M<0;if(M=isNaN(M)?l:k(Math.abs(M),y),b&&(M=ACe(M)),W&&+M==0&&x!=="+"&&(W=!1),L=(W?x==="("?x:o:x==="-"||x==="("?"":x)+L,j=(S==="s"?C6[8+fz/3]:"")+j+(W&&x==="("?")":""),T){for(P=-1,$=M.length;++P<$;)if(F=M.charCodeAt(P),48>F||F>57){j=(F===46?i+M.slice(P+1):M.slice(P))+j,M=M.slice(0,P);break}}}m&&!v&&(M=t(M,1/0));var I=L.length+M.length+j.length,A=I<p?new Array(p-I+1).join(f):"";switch(m&&v&&(M=t(A+M,A.length?p-j.length:1/0),A=""),g){case"<":M=L+M+j+A;break;case"=":M=L+A+M+j;break;case"^":M=A.slice(0,I=A.length>>1)+L+M+j+A.slice(I);break;default:M=A+L+M+j;break}return s(M)}return R.toString=function(){return u+""},R}function d(u,f){var g=c((u=vS(u),u.type="f",u)),x=Math.max(-8,Math.min(8,Math.floor(ECe(f)/3)))*3,_=Math.pow(10,-x),v=C6[8+x/3];return function(p){return g(_*p)+v}}return{format:c,formatPrefix:d}}var og,pz;jCe({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function jCe(e){return og=LCe(e),pz=og.format,og.formatPrefix,og}var fb=new Date,pb=new Date;function co(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=[],c;if(s=i.ceil(s),o=o==null?1:Math.floor(o),!(s<a)||!(o>0))return l;do l.push(c=new Date(+s)),t(s,o),e(s);while(c<s&&s<a);return l},i.filter=function(s){return co(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 fb.setTime(+s),pb.setTime(+a),e(fb),e(pb),Math.floor(n(fb,pb))},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}const PCe=1e3,eE=PCe*60,NCe=eE*60,tE=NCe*24,mz=tE*7;var nE=co(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*eE)/tE,e=>e.getDate()-1);nE.range;function Kl(e){return co(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())*eE)/mz})}var gz=Kl(0),Rv=Kl(1),OCe=Kl(2),ICe=Kl(3),Hu=Kl(4),$Ce=Kl(5),FCe=Kl(6);gz.range;Rv.range;OCe.range;ICe.range;Hu.range;$Ce.range;FCe.range;var Cl=co(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()});Cl.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:co(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)})};Cl.range;var rE=co(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/tE},function(e){return e.getUTCDate()-1});rE.range;function Gl(e){return co(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)/mz})}var vz=Gl(0),Av=Gl(1),BCe=Gl(2),zCe=Gl(3),Wu=Gl(4),UCe=Gl(5),HCe=Gl(6);vz.range;Av.range;BCe.range;zCe.range;Wu.range;UCe.range;HCe.range;var kl=co(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()});kl.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:co(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)})};kl.range;function mb(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 gb(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 mh(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function WCe(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,c=gh(i),d=vh(i),u=gh(s),f=vh(s),g=gh(a),x=vh(a),_=gh(o),v=vh(o),p=gh(l),m=vh(l),y={a:W,A:I,b:A,B:D,c:null,d:A6,e:A6,f:f5e,g:S5e,G:k5e,H:u5e,I:d5e,j:h5e,L:yz,m:p5e,M:m5e,p:H,q:V,Q:j6,s:P6,S:g5e,u:v5e,U:y5e,V:_5e,w:x5e,W:b5e,x:null,X:null,y:w5e,Y:C5e,Z:E5e,"%":L6},b={a:U,A:G,b:ee,B:Z,c:null,d:D6,e:D6,f:A5e,g:B5e,G:U5e,H:T5e,I:M5e,j:R5e,L:xz,m:D5e,M:L5e,p:q,q:B,Q:j6,s:P6,S:j5e,u:P5e,U:N5e,V:O5e,w:I5e,W:$5e,x:null,X:null,y:F5e,Y:z5e,Z:H5e,"%":L6},S={a:R,A:M,b:L,B:j,c:P,d:M6,e:M6,f:o5e,g:T6,G:E6,H:R6,I:R6,j:n5e,L:s5e,m:t5e,M:r5e,p:T,q:e5e,Q:l5e,s:c5e,S:i5e,u:GCe,U:XCe,V:QCe,w:KCe,W:JCe,x:$,X:F,y:T6,Y:E6,Z:ZCe,"%":a5e};y.x=w(n,y),y.X=w(r,y),y.c=w(t,y),b.x=w(n,b),b.X=w(r,b),b.c=w(t,b);function w(O,z){return function(Y){var N=[],J=-1,K=0,te=O.length,oe,ae,_e;for(Y instanceof Date||(Y=new Date(+Y));++J<te;)O.charCodeAt(J)===37&&(N.push(O.slice(K,J)),(ae=k6[oe=O.charAt(++J)])!=null?oe=O.charAt(++J):ae=oe==="e"?" ":"0",(_e=z[oe])&&(oe=_e(Y,ae)),N.push(oe),K=J+1);return N.push(O.slice(K,J)),N.join("")}}function E(O,z){return function(Y){var N=mh(1900,void 0,1),J=k(N,O,Y+="",0),K,te;if(J!=Y.length)return null;if("Q"in N)return new Date(N.Q);if("s"in N)return new Date(N.s*1e3+("L"in N?N.L:0));if(z&&!("Z"in N)&&(N.Z=0),"p"in N&&(N.H=N.H%12+N.p*12),N.m===void 0&&(N.m="q"in N?N.q:0),"V"in N){if(N.V<1||N.V>53)return null;"w"in N||(N.w=1),"Z"in N?(K=gb(mh(N.y,0,1)),te=K.getUTCDay(),K=te>4||te===0?Av.ceil(K):Av(K),K=rE.offset(K,(N.V-1)*7),N.y=K.getUTCFullYear(),N.m=K.getUTCMonth(),N.d=K.getUTCDate()+(N.w+6)%7):(K=mb(mh(N.y,0,1)),te=K.getDay(),K=te>4||te===0?Rv.ceil(K):Rv(K),K=nE.offset(K,(N.V-1)*7),N.y=K.getFullYear(),N.m=K.getMonth(),N.d=K.getDate()+(N.w+6)%7)}else("W"in N||"U"in N)&&("w"in N||(N.w="u"in N?N.u%7:"W"in N?1:0),te="Z"in N?gb(mh(N.y,0,1)).getUTCDay():mb(mh(N.y,0,1)).getDay(),N.m=0,N.d="W"in N?(N.w+6)%7+N.W*7-(te+5)%7:N.w+N.U*7-(te+6)%7);return"Z"in N?(N.H+=N.Z/100|0,N.M+=N.Z%100,gb(N)):mb(N)}}function k(O,z,Y,N){for(var J=0,K=z.length,te=Y.length,oe,ae;J<K;){if(N>=te)return-1;if(oe=z.charCodeAt(J++),oe===37){if(oe=z.charAt(J++),ae=S[oe in k6?z.charAt(J++):oe],!ae||(N=ae(O,Y,N))<0)return-1}else if(oe!=Y.charCodeAt(N++))return-1}return N}function T(O,z,Y){var N=c.exec(z.slice(Y));return N?(O.p=d.get(N[0].toLowerCase()),Y+N[0].length):-1}function R(O,z,Y){var N=g.exec(z.slice(Y));return N?(O.w=x.get(N[0].toLowerCase()),Y+N[0].length):-1}function M(O,z,Y){var N=u.exec(z.slice(Y));return N?(O.w=f.get(N[0].toLowerCase()),Y+N[0].length):-1}function L(O,z,Y){var N=p.exec(z.slice(Y));return N?(O.m=m.get(N[0].toLowerCase()),Y+N[0].length):-1}function j(O,z,Y){var N=_.exec(z.slice(Y));return N?(O.m=v.get(N[0].toLowerCase()),Y+N[0].length):-1}function P(O,z,Y){return k(O,t,z,Y)}function $(O,z,Y){return k(O,n,z,Y)}function F(O,z,Y){return k(O,r,z,Y)}function W(O){return a[O.getDay()]}function I(O){return s[O.getDay()]}function A(O){return l[O.getMonth()]}function D(O){return o[O.getMonth()]}function H(O){return i[+(O.getHours()>=12)]}function V(O){return 1+~~(O.getMonth()/3)}function U(O){return a[O.getUTCDay()]}function G(O){return s[O.getUTCDay()]}function ee(O){return l[O.getUTCMonth()]}function Z(O){return o[O.getUTCMonth()]}function q(O){return i[+(O.getUTCHours()>=12)]}function B(O){return 1+~~(O.getUTCMonth()/3)}return{format:function(O){var z=w(O+="",y);return z.toString=function(){return O},z},parse:function(O){var z=E(O+="",!1);return z.toString=function(){return O},z},utcFormat:function(O){var z=w(O+="",b);return z.toString=function(){return O},z},utcParse:function(O){var z=E(O+="",!0);return z.toString=function(){return O},z}}}var k6={"-":"",_:" ",0:"0"},Ln=/^\s*\d+/,VCe=/^%/,qCe=/[\\^$*+?|[\]().{}]/g;function gt(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 YCe(e){return e.replace(qCe,"\\$&")}function gh(e){return new RegExp("^(?:"+e.map(YCe).join("|")+")","i")}function vh(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function KCe(e,t,n){var r=Ln.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function GCe(e,t,n){var r=Ln.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function XCe(e,t,n){var r=Ln.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function QCe(e,t,n){var r=Ln.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function JCe(e,t,n){var r=Ln.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function E6(e,t,n){var r=Ln.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function T6(e,t,n){var r=Ln.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function ZCe(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 e5e(e,t,n){var r=Ln.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function t5e(e,t,n){var r=Ln.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function M6(e,t,n){var r=Ln.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function n5e(e,t,n){var r=Ln.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function R6(e,t,n){var r=Ln.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function r5e(e,t,n){var r=Ln.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function i5e(e,t,n){var r=Ln.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function s5e(e,t,n){var r=Ln.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function o5e(e,t,n){var r=Ln.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function a5e(e,t,n){var r=VCe.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function l5e(e,t,n){var r=Ln.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function c5e(e,t,n){var r=Ln.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function A6(e,t){return gt(e.getDate(),t,2)}function u5e(e,t){return gt(e.getHours(),t,2)}function d5e(e,t){return gt(e.getHours()%12||12,t,2)}function h5e(e,t){return gt(1+nE.count(Cl(e),e),t,3)}function yz(e,t){return gt(e.getMilliseconds(),t,3)}function f5e(e,t){return yz(e,t)+"000"}function p5e(e,t){return gt(e.getMonth()+1,t,2)}function m5e(e,t){return gt(e.getMinutes(),t,2)}function g5e(e,t){return gt(e.getSeconds(),t,2)}function v5e(e){var t=e.getDay();return t===0?7:t}function y5e(e,t){return gt(gz.count(Cl(e)-1,e),t,2)}function _z(e){var t=e.getDay();return t>=4||t===0?Hu(e):Hu.ceil(e)}function _5e(e,t){return e=_z(e),gt(Hu.count(Cl(e),e)+(Cl(e).getDay()===4),t,2)}function x5e(e){return e.getDay()}function b5e(e,t){return gt(Rv.count(Cl(e)-1,e),t,2)}function w5e(e,t){return gt(e.getFullYear()%100,t,2)}function S5e(e,t){return e=_z(e),gt(e.getFullYear()%100,t,2)}function C5e(e,t){return gt(e.getFullYear()%1e4,t,4)}function k5e(e,t){var n=e.getDay();return e=n>=4||n===0?Hu(e):Hu.ceil(e),gt(e.getFullYear()%1e4,t,4)}function E5e(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+gt(t/60|0,"0",2)+gt(t%60,"0",2)}function D6(e,t){return gt(e.getUTCDate(),t,2)}function T5e(e,t){return gt(e.getUTCHours(),t,2)}function M5e(e,t){return gt(e.getUTCHours()%12||12,t,2)}function R5e(e,t){return gt(1+rE.count(kl(e),e),t,3)}function xz(e,t){return gt(e.getUTCMilliseconds(),t,3)}function A5e(e,t){return xz(e,t)+"000"}function D5e(e,t){return gt(e.getUTCMonth()+1,t,2)}function L5e(e,t){return gt(e.getUTCMinutes(),t,2)}function j5e(e,t){return gt(e.getUTCSeconds(),t,2)}function P5e(e){var t=e.getUTCDay();return t===0?7:t}function N5e(e,t){return gt(vz.count(kl(e)-1,e),t,2)}function bz(e){var t=e.getUTCDay();return t>=4||t===0?Wu(e):Wu.ceil(e)}function O5e(e,t){return e=bz(e),gt(Wu.count(kl(e),e)+(kl(e).getUTCDay()===4),t,2)}function I5e(e){return e.getUTCDay()}function $5e(e,t){return gt(Av.count(kl(e)-1,e),t,2)}function F5e(e,t){return gt(e.getUTCFullYear()%100,t,2)}function B5e(e,t){return e=bz(e),gt(e.getUTCFullYear()%100,t,2)}function z5e(e,t){return gt(e.getUTCFullYear()%1e4,t,4)}function U5e(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Wu(e):Wu.ceil(e),gt(e.getUTCFullYear()%1e4,t,4)}function H5e(){return"+0000"}function L6(){return"%"}function j6(e){return+e}function P6(e){return Math.floor(+e/1e3)}var vc,wz;W5e({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 W5e(e){return vc=WCe(e),wz=vc.format,vc.parse,vc.utcFormat,vc.utcParse,vc}var V5e=em,q5e=aB,Y5e=Id;function K5e(e,t,n){for(var r=-1,i=t.length,s={};++r<i;){var a=t[r],o=V5e(e,a);n(o,a)&&q5e(s,Y5e(a,e),o)}return s}var G5e=K5e;function X5e(e,t){return e!=null&&t in Object(e)}var Q5e=X5e,J5e=Id,Z5e=by,eke=Er,tke=Cy,nke=y3,rke=$d;function ike(e,t,n){t=J5e(t,e);for(var r=-1,i=t.length,s=!1;++r<i;){var a=rke(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&&nke(i)&&tke(a,i)&&(eke(e)||Z5e(e)))}var ske=ike,oke=Q5e,ake=ske;function lke(e,t){return e!=null&&ake(e,t,oke)}var Sz=lke,cke=G5e,uke=Sz;function dke(e,t){return cke(e,t,function(n,r){return uke(e,r)})}var hke=dke;function fke(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var iE=fke,N6=Dd,pke=by,mke=Er,O6=N6?N6.isConcatSpreadable:void 0;function gke(e){return mke(e)||pke(e)||!!(O6&&e&&e[O6])}var vke=gke,yke=iE,_ke=vke;function Cz(e,t,n,r,i){var s=-1,a=e.length;for(n||(n=_ke),i||(i=[]);++s<a;){var o=e[s];t>0&&n(o)?t>1?Cz(o,t-1,n,r,i):yke(i,o):r||(i[i.length]=o)}return i}var kz=Cz,xke=kz;function bke(e){var t=e==null?0:e.length;return t?xke(e,1):[]}var wke=bke,Ske=wke,Cke=tB,kke=nB;function Eke(e){return kke(Cke(e,void 0,Ske),e+"")}var Ez=Eke,Tke=hke,Mke=Ez,Rke=Mke(function(e,t){return e==null?{}:Tke(e,t)}),Ake=Rke;const Dke=bn(Ake);function Lke(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 jke=Lke,Pke=q3,Nke=jke,Oke=Y3,Ike=1,$ke=2;function Fke(e,t,n,r,i,s){var a=n&Ike,o=e.length,l=t.length;if(o!=l&&!(a&&l>o))return!1;var c=s.get(e),d=s.get(t);if(c&&d)return c==t&&d==e;var u=-1,f=!0,g=n&$ke?new Pke:void 0;for(s.set(e,t),s.set(t,e);++u<o;){var x=e[u],_=t[u];if(r)var v=a?r(_,x,u,t,e,s):r(x,_,u,e,t,s);if(v!==void 0){if(v)continue;f=!1;break}if(g){if(!Nke(t,function(p,m){if(!Oke(g,m)&&(x===p||i(x,p,n,r,s)))return g.push(m)})){f=!1;break}}else if(!(x===_||i(x,_,n,r,s))){f=!1;break}}return s.delete(e),s.delete(t),f}var Tz=Fke;function Bke(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}var zke=Bke;function Uke(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var sE=Uke,I6=Dd,$6=WF,Hke=Qp,Wke=Tz,Vke=zke,qke=sE,Yke=1,Kke=2,Gke="[object Boolean]",Xke="[object Date]",Qke="[object Error]",Jke="[object Map]",Zke="[object Number]",e3e="[object RegExp]",t3e="[object Set]",n3e="[object String]",r3e="[object Symbol]",i3e="[object ArrayBuffer]",s3e="[object DataView]",F6=I6?I6.prototype:void 0,vb=F6?F6.valueOf:void 0;function o3e(e,t,n,r,i,s,a){switch(n){case s3e:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case i3e:return!(e.byteLength!=t.byteLength||!s(new $6(e),new $6(t)));case Gke:case Xke:case Zke:return Hke(+e,+t);case Qke:return e.name==t.name&&e.message==t.message;case e3e:case n3e:return e==t+"";case Jke:var o=Vke;case t3e:var l=r&Yke;if(o||(o=qke),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=Kke,a.set(e,t);var d=Wke(o(e),o(t),r,i,s,a);return a.delete(e),d;case r3e:if(vb)return vb.call(e)==vb.call(t)}return!1}var a3e=o3e,l3e=iE,c3e=Er;function u3e(e,t,n){var r=t(e);return c3e(e)?r:l3e(r,n(e))}var Mz=u3e;function d3e(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 Rz=d3e;function h3e(){return[]}var Az=h3e,f3e=Rz,p3e=Az,m3e=Object.prototype,g3e=m3e.propertyIsEnumerable,B6=Object.getOwnPropertySymbols,v3e=B6?function(e){return e==null?[]:(e=Object(e),f3e(B6(e),function(t){return g3e.call(e,t)}))}:p3e,oE=v3e,y3e=YF,_3e=y3e(Object.keys,Object),x3e=_3e,b3e=v3,w3e=x3e,S3e=Object.prototype,C3e=S3e.hasOwnProperty;function k3e(e){if(!b3e(e))return w3e(e);var t=[];for(var n in Object(e))C3e.call(e,n)&&n!="constructor"&&t.push(n);return t}var E3e=k3e,T3e=ZF,M3e=E3e,R3e=Nd;function A3e(e){return R3e(e)?T3e(e):M3e(e)}var rm=A3e,D3e=Mz,L3e=oE,j3e=rm;function P3e(e){return D3e(e,j3e,L3e)}var Dz=P3e,z6=Dz,N3e=1,O3e=Object.prototype,I3e=O3e.hasOwnProperty;function $3e(e,t,n,r,i,s){var a=n&N3e,o=z6(e),l=o.length,c=z6(t),d=c.length;if(l!=d&&!a)return!1;for(var u=l;u--;){var f=o[u];if(!(a?f in t:I3e.call(t,f)))return!1}var g=s.get(e),x=s.get(t);if(g&&x)return g==t&&x==e;var _=!0;s.set(e,t),s.set(t,e);for(var v=a;++u<l;){f=o[u];var p=e[f],m=t[f];if(r)var y=a?r(m,p,f,t,e,s):r(p,m,f,e,t,s);if(!(y===void 0?p===m||i(p,m,n,r,s):y)){_=!1;break}v||(v=f=="constructor")}if(_&&!v){var b=e.constructor,S=t.constructor;b!=S&&"constructor"in e&&"constructor"in t&&!(typeof b=="function"&&b instanceof b&&typeof S=="function"&&S instanceof S)&&(_=!1)}return s.delete(e),s.delete(t),_}var F3e=$3e,B3e=Wl,z3e=Cs,U3e=B3e(z3e,"DataView"),H3e=U3e,W3e=Wl,V3e=Cs,q3e=W3e(V3e,"Promise"),Y3e=q3e,K3e=Wl,G3e=Cs,X3e=K3e(G3e,"Set"),Lz=X3e,Q3e=Wl,J3e=Cs,Z3e=Q3e(J3e,"WeakMap"),eEe=Z3e,yS=H3e,_S=h3,xS=Y3e,bS=Lz,wS=eEe,jz=Ma,Bd=FF,U6="[object Map]",tEe="[object Object]",H6="[object Promise]",W6="[object Set]",V6="[object WeakMap]",q6="[object DataView]",nEe=Bd(yS),rEe=Bd(_S),iEe=Bd(xS),sEe=Bd(bS),oEe=Bd(wS),Oa=jz;(yS&&Oa(new yS(new ArrayBuffer(1)))!=q6||_S&&Oa(new _S)!=U6||xS&&Oa(xS.resolve())!=H6||bS&&Oa(new bS)!=W6||wS&&Oa(new wS)!=V6)&&(Oa=function(e){var t=jz(e),n=t==tEe?e.constructor:void 0,r=n?Bd(n):"";if(r)switch(r){case nEe:return q6;case rEe:return U6;case iEe:return H6;case sEe:return W6;case oEe:return V6}return t});var f_=Oa,yb=xy,aEe=Tz,lEe=a3e,cEe=F3e,Y6=f_,K6=Er,G6=wy,uEe=b3,dEe=1,X6="[object Arguments]",Q6="[object Array]",ag="[object Object]",hEe=Object.prototype,J6=hEe.hasOwnProperty;function fEe(e,t,n,r,i,s){var a=K6(e),o=K6(t),l=a?Q6:Y6(e),c=o?Q6:Y6(t);l=l==X6?ag:l,c=c==X6?ag:c;var d=l==ag,u=c==ag,f=l==c;if(f&&G6(e)){if(!G6(t))return!1;a=!0,d=!1}if(f&&!d)return s||(s=new yb),a||uEe(e)?aEe(e,t,n,r,i,s):lEe(e,t,l,n,r,i,s);if(!(n&dEe)){var g=d&&J6.call(e,"__wrapped__"),x=u&&J6.call(t,"__wrapped__");if(g||x){var _=g?e.value():e,v=x?t.value():t;return s||(s=new yb),i(_,v,n,r,s)}}return f?(s||(s=new yb),cEe(e,t,n,r,i,s)):!1}var pEe=fEe,mEe=pEe,Z6=Vi;function Pz(e,t,n,r,i){return e===t?!0:e==null||t==null||!Z6(e)&&!Z6(t)?e!==e&&t!==t:mEe(e,t,n,r,Pz,i)}var aE=Pz,gEe=aE;function vEe(e,t){return gEe(e,t)}var yEe=vEe;const _Ee=bn(yEe);var xEe={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 Li(){return Li=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},Li.apply(this,arguments)}function lE(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 bEe=["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"],wEe=function(e,t){return Li({},t,e)},SEe=function(e,t){var n=L_e({},e,t);return bEe.forEach(function(r){Vh(n,r,wEe(to(n,r),n.text))}),n},Nz=C.createContext(),Oz=function(e){var t=e.children,n=e.animate,r=n===void 0||n,i=e.config,s=i===void 0?"default":i,a=C.useMemo(function(){var o=vbe(s)?l3[s]:s;return{animate:r,config:o}},[r,s]);return h.jsx(Nz.Provider,{value:a,children:t})},eD={animate:se.bool,motionConfig:se.oneOfType([se.oneOf(Object.keys(l3)),se.shape({mass:se.number,tension:se.number,friction:se.number,clamp:se.bool,precision:se.number,velocity:se.number,duration:se.number,easing:se.func})])};Oz.propTypes={children:se.node.isRequired,animate:eD.animate,config:eD.motionConfig};var Tr=function(){return C.useContext(Nz)},CEe=function(e){var t=Tr(),n=t.animate,r=t.config,i=function(o){var l=C.useRef();return C.useEffect(function(){l.current=o},[o]),l.current}(e),s=C.useMemo(function(){return R3(i,e)},[i,e]),a=lo({from:{value:0},to:{value:1},reset:!0,config:r,immediate:!n}).value;return va(a,s)},kEe={nivo:["#d76445","#f47560","#e8c1a0","#97e3d5","#61cdbb","#00b0a7"],BrBG:Ae(Iy),PRGn:Ae($y),PiYG:Ae(Fy),PuOr:Ae(By),RdBu:Ae(zy),RdGy:Ae(Uy),RdYlBu:Ae(Hy),RdYlGn:Ae(Wy),spectral:Ae(Vy),blues:Ae(i_),greens:Ae(s_),greys:Ae(o_),oranges:Ae(c_),purples:Ae(a_),reds:Ae(l_),BuGn:Ae(qy),BuPu:Ae(Yy),GnBu:Ae(Ky),OrRd:Ae(Gy),PuBuGn:Ae(Xy),PuBu:Ae(Qy),PuRd:Ae(Jy),RdPu:Ae(Zy),YlGnBu:Ae(e_),YlGn:Ae(t_),YlOrBr:Ae(n_),YlOrRd:Ae(r_)},EEe=Object.keys(kEe);Ae(Iy),Ae($y),Ae(Fy),Ae(By),Ae(zy),Ae(Uy),Ae(Hy),Ae(Wy),Ae(Vy),Ae(i_),Ae(s_),Ae(o_),Ae(c_),Ae(a_),Ae(l_),Ae(qy),Ae(Yy),Ae(Ky),Ae(Gy),Ae(Xy),Ae(Qy),Ae(Jy),Ae(Zy),Ae(e_),Ae(t_),Ae(n_),Ae(r_);se.oneOfType([se.oneOf(EEe),se.func,se.arrayOf(se.string)]);var TEe={basis:sCe,basisClosed:oCe,basisOpen:aCe,bundle:lCe,cardinal:cCe,cardinalClosed:uCe,cardinalOpen:dCe,catmullRom:hCe,catmullRomClosed:fCe,catmullRomOpen:pCe,linear:ez,linearClosed:mCe,monotoneX:gCe,monotoneY:vCe,natural:hz,step:yCe,stepAfter:xCe,stepBefore:_Ce},cE=Object.keys(TEe);cE.filter(function(e){return e.endsWith("Closed")});XB(cE,"bundle","basisClosed","basisOpen","cardinalClosed","cardinalOpen","catmullRomClosed","catmullRomOpen","linearClosed");XB(cE,"bundle","basisClosed","basisOpen","cardinalClosed","cardinalOpen","catmullRomClosed","catmullRomOpen","linearClosed");se.shape({top:se.number,right:se.number,bottom:se.number,left:se.number}).isRequired;var MEe=["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"];se.oneOf(MEe);Va(V3);var REe={top:0,right:0,bottom:0,left:0},uE=function(e,t,n){return n===void 0&&(n={}),C.useMemo(function(){var r=Li({},REe,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])},Iz=function(){var e=C.useRef(null),t=C.useState({left:0,top:0,width:0,height:0}),n=t[0],r=t[1],i=C.useState(function(){return typeof ResizeObserver>"u"?null:new ResizeObserver(function(s){var a=s[0];return r(a.contentRect)})})[0];return C.useEffect(function(){return e.current&&i!==null&&i.observe(e.current),function(){i!==null&&i.disconnect()}},[]),[e,n]},AEe=function(e){return C.useMemo(function(){return SEe(xEe,e)},[e])},DEe=function(e){return typeof e=="function"?e:typeof e=="string"?e.indexOf("time:")===0?wz(e.slice("5")):pz(e):function(t){return""+t}},p_=function(e){return C.useMemo(function(){return DEe(e)},[e])},$z=C.createContext(),LEe={},Fz=function(e){var t=e.theme,n=t===void 0?LEe:t,r=e.children,i=AEe(n);return h.jsx($z.Provider,{value:i,children:r})};Fz.propTypes={children:se.node.isRequired,theme:se.object};var Yt=function(){return C.useContext($z)},jEe=["outlineWidth","outlineColor","outlineOpacity"],dE=function(e){return e.outlineWidth,e.outlineColor,e.outlineOpacity,lE(e,jEe)},Bz=function(e){var t=e.children,n=e.condition,r=e.wrapper;return n?C.cloneElement(r,{},t):t};Bz.propTypes={children:se.node.isRequired,condition:se.bool.isRequired,wrapper:se.element.isRequired};var PEe={position:"relative"},m_=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,c=C.useRef(null);return h.jsx(Fz,{theme:n,children:h.jsx(Oz,{animate:o,config:l,children:h.jsx(pme,{container:c,children:h.jsxs(Bz,{condition:i,wrapper:h.jsx("div",{style:PEe,ref:c}),children:[t,a&&h.jsx(fme,{})]})})})})};m_.propTypes={children:se.element.isRequired,isInteractive:se.bool,renderWrapper:se.bool,theme:se.object,animate:se.bool,motionConfig:se.string};se.func.isRequired,se.bool,se.bool,se.object.isRequired,se.bool.isRequired,se.string;var zz=function(e){var t=e.children,n=Iz(),r=n[0],i=n[1],s=i.width>0&&i.height>0;return h.jsx("div",{ref:r,style:{width:"100%",height:"100%"},children:s&&t({width:i.width,height:i.height})})};zz.propTypes={children:se.func.isRequired};var NEe=["id","colors"],Uz=function(e){var t=e.id,n=e.colors,r=lE(e,NEe);return h.jsx("linearGradient",Li({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 h.jsx("stop",{offset:s+"%",stopColor:a,stopOpacity:o!==void 0?o:1},s)})}))};Uz.propTypes={id:se.string.isRequired,colors:se.arrayOf(se.shape({offset:se.number.isRequired,color:se.string.isRequired,opacity:se.number})).isRequired,gradientTransform:se.string};var Hz={linearGradient:Uz},yh={color:"#000000",background:"#ffffff",size:4,padding:4,stagger:!1},SS=C.memo(function(e){var t=e.id,n=e.background,r=n===void 0?yh.background:n,i=e.color,s=i===void 0?yh.color:i,a=e.size,o=a===void 0?yh.size:a,l=e.padding,c=l===void 0?yh.padding:l,d=e.stagger,u=d===void 0?yh.stagger:d,f=o+c,g=o/2,x=c/2;return u===!0&&(f=2*o+2*c),h.jsxs("pattern",{id:t,width:f,height:f,patternUnits:"userSpaceOnUse",children:[h.jsx("rect",{width:f,height:f,fill:r}),h.jsx("circle",{cx:x+g,cy:x+g,r:g,fill:s}),u&&h.jsx("circle",{cx:1.5*c+o+g,cy:1.5*c+o+g,r:g,fill:s})]})});SS.displayName="PatternDots",SS.propTypes={id:se.string.isRequired,color:se.string.isRequired,background:se.string.isRequired,size:se.number.isRequired,padding:se.number.isRequired,stagger:se.bool.isRequired};var ii=function(e){return e*Math.PI/180},g_=function(e){return 180*e/Math.PI},OEe=function(e){return e.startAngle+(e.endAngle-e.startAngle)/2},ol=function(e,t){return{x:Math.cos(e)*t,y:Math.sin(e)*t}},IEe=function(e){var t=e%360;return t<0&&(t+=360),t},$Ee={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"}}},_h={spacing:5,rotation:0,background:"#000000",color:"#ffffff",lineWidth:2},CS=C.memo(function(e){var t=e.id,n=e.spacing,r=n===void 0?_h.spacing:n,i=e.rotation,s=i===void 0?_h.rotation:i,a=e.background,o=a===void 0?_h.background:a,l=e.color,c=l===void 0?_h.color:l,d=e.lineWidth,u=d===void 0?_h.lineWidth:d,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 x,_=g,v=g;return f===0?x=`
                M 0 0 L `+_+` 0
                M 0 `+v+" L "+_+" "+v+`
            `:f===90?x=`
                M 0 0 L 0 `+v+`
                M `+_+" 0 L "+_+" "+v+`
            `:(_=Math.abs(g/Math.sin(ii(f))),v=g/Math.sin(ii(90-f)),x=f>0?`
                    M 0 `+-v+" L "+2*_+" "+v+`
                    M `+-_+" "+-v+" L "+_+" "+v+`
                    M `+-_+" 0 L "+_+" "+2*v+`
                `:`
                    M `+-_+" "+v+" L "+_+" "+-v+`
                    M `+-_+" "+2*v+" L "+2*_+" "+-v+`
                    M 0 `+2*v+" L "+2*_+` 0
                `),h.jsxs("pattern",{id:t,width:_,height:v,patternUnits:"userSpaceOnUse",children:[h.jsx("rect",{width:_,height:v,fill:o,stroke:"rgba(255, 0, 0, 0.1)",strokeWidth:0}),h.jsx("path",{d:x,strokeWidth:u,stroke:c,strokeLinecap:"square"})]})});CS.displayName="PatternLines",CS.propTypes={id:se.string.isRequired,spacing:se.number.isRequired,rotation:se.number.isRequired,background:se.string.isRequired,color:se.string.isRequired,lineWidth:se.number.isRequired};var xh={color:"#000000",background:"#ffffff",size:4,padding:4,stagger:!1},kS=C.memo(function(e){var t=e.id,n=e.color,r=n===void 0?xh.color:n,i=e.background,s=i===void 0?xh.background:i,a=e.size,o=a===void 0?xh.size:a,l=e.padding,c=l===void 0?xh.padding:l,d=e.stagger,u=d===void 0?xh.stagger:d,f=o+c,g=c/2;return u===!0&&(f=2*o+2*c),h.jsxs("pattern",{id:t,width:f,height:f,patternUnits:"userSpaceOnUse",children:[h.jsx("rect",{width:f,height:f,fill:s}),h.jsx("rect",{x:g,y:g,width:o,height:o,fill:r}),u&&h.jsx("rect",{x:1.5*c+o,y:1.5*c+o,width:o,height:o,fill:r})]})});kS.displayName="PatternSquares",kS.propTypes={id:se.string.isRequired,color:se.string.isRequired,background:se.string.isRequired,size:se.number.isRequired,padding:se.number.isRequired,stagger:se.bool.isRequired};var Wz={patternDots:SS,patternLines:CS,patternSquares:kS},FEe=["type"],ES=Li({},Hz,Wz),Vz=function(e){var t=e.defs;return!t||t.length<1?null:h.jsx("defs",{"aria-hidden":!0,children:t.map(function(n){var r=n.type,i=lE(n,FEe);return ES[r]?C.createElement(ES[r],Li({key:i.id},i)):null})})};Vz.propTypes={defs:se.arrayOf(se.shape({type:se.oneOf(Object.keys(ES)).isRequired,id:se.string.isRequired}))};var BEe=C.memo(Vz),hE=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,c=e.ariaDescribedBy,d=e.isFocusable,u=Yt();return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:n,role:a,"aria-label":o,"aria-labelledby":l,"aria-describedby":c,focusable:d,tabIndex:d?0:void 0,children:[h.jsx(BEe,{defs:i}),h.jsx("rect",{width:t,height:n,fill:u.background}),h.jsx("g",{transform:"translate("+r.left+","+r.top+")",children:s})]})};hE.propTypes={width:se.number.isRequired,height:se.number.isRequired,margin:se.shape({top:se.number.isRequired,left:se.number.isRequired}).isRequired,defs:se.array,children:se.oneOfType([se.arrayOf(se.node),se.node]).isRequired,role:se.string,isFocusable:se.bool,ariaLabel:se.string,ariaLabelledBy:se.string,ariaDescribedBy:se.string};var qz=function(e){var t=e.size,n=e.color,r=e.borderWidth,i=e.borderColor;return h.jsx("circle",{r:t/2,fill:n,stroke:i,strokeWidth:r,style:{pointerEvents:"none"}})};qz.propTypes={size:se.number.isRequired,color:se.string.isRequired,borderWidth:se.number.isRequired,borderColor:se.string.isRequired};var zEe=C.memo(qz),Yz=function(e){var t=e.x,n=e.y,r=e.symbol,i=r===void 0?zEe:r,s=e.size,a=e.datum,o=e.color,l=e.borderWidth,c=e.borderColor,d=e.label,u=e.labelTextAnchor,f=u===void 0?"middle":u,g=e.labelYOffset,x=g===void 0?-12:g,_=Yt(),v=Tr(),p=v.animate,m=v.config,y=lo({transform:"translate("+t+", "+n+")",config:m,immediate:!p});return h.jsxs(kt.g,{transform:y.transform,style:{pointerEvents:"none"},children:[C.createElement(i,{size:s,color:o,datum:a,borderWidth:l,borderColor:c}),d&&h.jsx("text",{textAnchor:f,y:x,style:dE(_.dots.text),children:d})]})};Yz.propTypes={x:se.number.isRequired,y:se.number.isRequired,datum:se.object.isRequired,size:se.number.isRequired,color:se.string.isRequired,borderWidth:se.number.isRequired,borderColor:se.string.isRequired,symbol:se.oneOfType([se.func,se.object]),label:se.oneOfType([se.string,se.number]),labelTextAnchor:se.oneOf(["start","middle","end"]),labelYOffset:se.number};C.memo(Yz);var Kz=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,c=e.legendPosition,d=c===void 0?"top-right":c,u=e.legendOffsetX,f=u===void 0?14:u,g=e.legendOffsetY,x=g===void 0?14:g,_=e.legendOrientation,v=_===void 0?"horizontal":_,p=Yt(),m=0,y=0,b=0,S=0;r==="y"?(b=i(s),y=t):(m=i(s),S=n);var w=null;if(l){var E=function(k){var T=k.axis,R=k.width,M=k.height,L=k.position,j=k.offsetX,P=k.offsetY,$=k.orientation,F=0,W=0,I=$==="vertical"?-90:0,A="start";if(T==="x")switch(L){case"top-left":F=-j,W=P,A="end";break;case"top":W=-P,A=$==="horizontal"?"middle":"start";break;case"top-right":F=j,W=P,A=$==="horizontal"?"start":"end";break;case"right":F=j,W=M/2,A=$==="horizontal"?"start":"middle";break;case"bottom-right":F=j,W=M-P,A="start";break;case"bottom":W=M+P,A=$==="horizontal"?"middle":"end";break;case"bottom-left":W=M-P,F=-j,A=$==="horizontal"?"end":"start";break;case"left":F=-j,W=M/2,A=$==="horizontal"?"end":"middle"}else switch(L){case"top-left":F=j,W=-P,A="start";break;case"top":F=R/2,W=-P,A=$==="horizontal"?"middle":"start";break;case"top-right":F=R-j,W=-P,A=$==="horizontal"?"end":"start";break;case"right":F=R+j,A=$==="horizontal"?"start":"middle";break;case"bottom-right":F=R-j,W=P,A="end";break;case"bottom":F=R/2,W=P,A=$==="horizontal"?"middle":"end";break;case"bottom-left":F=j,W=P,A=$==="horizontal"?"start":"end";break;case"left":F=-j,A=$==="horizontal"?"end":"middle"}return{x:F,y:W,rotation:I,textAnchor:A}}({axis:r,width:t,height:n,position:d,offsetX:f,offsetY:x,orientation:v});w=h.jsx("text",{transform:"translate("+E.x+", "+E.y+") rotate("+E.rotation+")",textAnchor:E.textAnchor,dominantBaseline:"central",style:o,children:l})}return h.jsxs("g",{transform:"translate("+m+", "+b+")",children:[h.jsx("line",{x1:0,x2:y,y1:0,y2:S,stroke:p.markers.lineColor,strokeWidth:p.markers.lineStrokeWidth,style:a}),w]})};Kz.propTypes={width:se.number.isRequired,height:se.number.isRequired,axis:se.oneOf(["x","y"]).isRequired,scale:se.func.isRequired,value:se.oneOfType([se.number,se.string,se.instanceOf(Date)]).isRequired,lineStyle:se.object,textStyle:se.object,legend:se.string,legendPosition:se.oneOf(["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"]),legendOffsetX:se.number.isRequired,legendOffsetY:se.number.isRequired,legendOrientation:se.oneOf(["horizontal","vertical"]).isRequired};var UEe=C.memo(Kz),Gz=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 h.jsx(UEe,Li({},a,{width:n,height:r,scale:a.axis==="y"?s:i}),o)}):null};Gz.propTypes={width:se.number.isRequired,height:se.number.isRequired,xScale:se.func.isRequired,yScale:se.func.isRequired,markers:se.arrayOf(se.shape({axis:se.oneOf(["x","y"]).isRequired,value:se.oneOfType([se.number,se.string,se.instanceOf(Date)]).isRequired,lineStyle:se.object,textStyle:se.object}))};var HEe=C.memo(Gz),Xz=function(e){return $F(e)?e:function(t){return to(t,e)}},al=function(e){return C.useMemo(function(){return Xz(e)},[e])},WEe=function(e,t,n,r,i,s){return e<=i&&i<=e+n&&t<=s&&s<=t+r},_b=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]},VEe=Object.keys(Hz),qEe=Object.keys(Wz),YEe=function(e,t,n){if(e==="*")return!0;if($F(e))return e(t);if(x3(e)){var r=n?to(t,n):t;return _Ee(Dke(r,Object.keys(e)),e)}return!1},Qz=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,c=l===void 0?"fill":l,d=[],u={};return e.length&&t.length&&(d=[].concat(e),t.forEach(function(f){for(var g=function(){var _=n[x],v=_.id,p=_.match;if(YEe(p,f,s)){var m=e.find(function(R){return R.id===v});if(m){if(qEe.includes(m.type))if(m.background==="inherit"||m.color==="inherit"){var y=to(f,o),b=m.background,S=m.color,w=v;m.background==="inherit"&&(w=w+".bg."+y,b=y),m.color==="inherit"&&(w=w+".fg."+y,S=y),Vh(f,c,"url(#"+w+")"),u[w]||(d.push(Li({},m,{id:w,background:b,color:S})),u[w]=1)}else Vh(f,c,"url(#"+v+")");else if(VEe.includes(m.type))if(m.colors.map(function(R){return R.color}).includes("inherit")){var E=to(f,o),k=v,T=Li({},m,{colors:m.colors.map(function(R,M){return R.color!=="inherit"?R:(k=k+"."+M+"."+E,Li({},R,{color:R.color==="inherit"?E:R.color}))})});T.id=k,Vh(f,c,"url(#"+k+")"),u[k]||(d.push(T),u[k]=1)}else Vh(f,c,"url(#"+v+")")}return"break"}},x=0;x<n.length&&g()!=="break";x++);})),d},xb=new Date,bb=new Date;function uo(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=[],c;if(s=i.ceil(s),o=o==null?1:Math.floor(o),!(s<a)||!(o>0))return l;do l.push(c=new Date(+s)),t(s,o),e(s);while(c<s&&s<a);return l},i.filter=function(s){return uo(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 xb.setTime(+s),bb.setTime(+a),e(xb),e(bb),Math.floor(n(xb,bb))},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}const KEe=1e3,fE=KEe*60,GEe=fE*60,pE=GEe*24,Jz=pE*7;var mE=uo(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*fE)/pE,e=>e.getDate()-1);mE.range;function Xl(e){return uo(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())*fE)/Jz})}var Zz=Xl(0),Dv=Xl(1),XEe=Xl(2),QEe=Xl(3),Vu=Xl(4),JEe=Xl(5),ZEe=Xl(6);Zz.range;Dv.range;XEe.range;QEe.range;Vu.range;JEe.range;ZEe.range;var El=uo(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()});El.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:uo(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)})};El.range;var gE=uo(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/pE},function(e){return e.getUTCDate()-1});gE.range;function Ql(e){return uo(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)/Jz})}var eU=Ql(0),Lv=Ql(1),eTe=Ql(2),tTe=Ql(3),qu=Ql(4),nTe=Ql(5),rTe=Ql(6);eU.range;Lv.range;eTe.range;tTe.range;qu.range;nTe.range;rTe.range;var Tl=uo(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()});Tl.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:uo(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)})};Tl.range;function wb(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 Sb(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 bh(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function iTe(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,c=wh(i),d=Sh(i),u=wh(s),f=Sh(s),g=wh(a),x=Sh(a),_=wh(o),v=Sh(o),p=wh(l),m=Sh(l),y={a:W,A:I,b:A,B:D,c:null,d:oD,e:oD,f:TTe,g:ITe,G:FTe,H:CTe,I:kTe,j:ETe,L:tU,m:MTe,M:RTe,p:H,q:V,Q:cD,s:uD,S:ATe,u:DTe,U:LTe,V:jTe,w:PTe,W:NTe,x:null,X:null,y:OTe,Y:$Te,Z:BTe,"%":lD},b={a:U,A:G,b:ee,B:Z,c:null,d:aD,e:aD,f:WTe,g:e4e,G:n4e,H:zTe,I:UTe,j:HTe,L:rU,m:VTe,M:qTe,p:q,q:B,Q:cD,s:uD,S:YTe,u:KTe,U:GTe,V:XTe,w:QTe,W:JTe,x:null,X:null,y:ZTe,Y:t4e,Z:r4e,"%":lD},S={a:R,A:M,b:L,B:j,c:P,d:iD,e:iD,f:xTe,g:rD,G:nD,H:sD,I:sD,j:gTe,L:_Te,m:mTe,M:vTe,p:T,q:pTe,Q:wTe,s:STe,S:yTe,u:cTe,U:uTe,V:dTe,w:lTe,W:hTe,x:$,X:F,y:rD,Y:nD,Z:fTe,"%":bTe};y.x=w(n,y),y.X=w(r,y),y.c=w(t,y),b.x=w(n,b),b.X=w(r,b),b.c=w(t,b);function w(O,z){return function(Y){var N=[],J=-1,K=0,te=O.length,oe,ae,_e;for(Y instanceof Date||(Y=new Date(+Y));++J<te;)O.charCodeAt(J)===37&&(N.push(O.slice(K,J)),(ae=tD[oe=O.charAt(++J)])!=null?oe=O.charAt(++J):ae=oe==="e"?" ":"0",(_e=z[oe])&&(oe=_e(Y,ae)),N.push(oe),K=J+1);return N.push(O.slice(K,J)),N.join("")}}function E(O,z){return function(Y){var N=bh(1900,void 0,1),J=k(N,O,Y+="",0),K,te;if(J!=Y.length)return null;if("Q"in N)return new Date(N.Q);if("s"in N)return new Date(N.s*1e3+("L"in N?N.L:0));if(z&&!("Z"in N)&&(N.Z=0),"p"in N&&(N.H=N.H%12+N.p*12),N.m===void 0&&(N.m="q"in N?N.q:0),"V"in N){if(N.V<1||N.V>53)return null;"w"in N||(N.w=1),"Z"in N?(K=Sb(bh(N.y,0,1)),te=K.getUTCDay(),K=te>4||te===0?Lv.ceil(K):Lv(K),K=gE.offset(K,(N.V-1)*7),N.y=K.getUTCFullYear(),N.m=K.getUTCMonth(),N.d=K.getUTCDate()+(N.w+6)%7):(K=wb(bh(N.y,0,1)),te=K.getDay(),K=te>4||te===0?Dv.ceil(K):Dv(K),K=mE.offset(K,(N.V-1)*7),N.y=K.getFullYear(),N.m=K.getMonth(),N.d=K.getDate()+(N.w+6)%7)}else("W"in N||"U"in N)&&("w"in N||(N.w="u"in N?N.u%7:"W"in N?1:0),te="Z"in N?Sb(bh(N.y,0,1)).getUTCDay():wb(bh(N.y,0,1)).getDay(),N.m=0,N.d="W"in N?(N.w+6)%7+N.W*7-(te+5)%7:N.w+N.U*7-(te+6)%7);return"Z"in N?(N.H+=N.Z/100|0,N.M+=N.Z%100,Sb(N)):wb(N)}}function k(O,z,Y,N){for(var J=0,K=z.length,te=Y.length,oe,ae;J<K;){if(N>=te)return-1;if(oe=z.charCodeAt(J++),oe===37){if(oe=z.charAt(J++),ae=S[oe in tD?z.charAt(J++):oe],!ae||(N=ae(O,Y,N))<0)return-1}else if(oe!=Y.charCodeAt(N++))return-1}return N}function T(O,z,Y){var N=c.exec(z.slice(Y));return N?(O.p=d.get(N[0].toLowerCase()),Y+N[0].length):-1}function R(O,z,Y){var N=g.exec(z.slice(Y));return N?(O.w=x.get(N[0].toLowerCase()),Y+N[0].length):-1}function M(O,z,Y){var N=u.exec(z.slice(Y));return N?(O.w=f.get(N[0].toLowerCase()),Y+N[0].length):-1}function L(O,z,Y){var N=p.exec(z.slice(Y));return N?(O.m=m.get(N[0].toLowerCase()),Y+N[0].length):-1}function j(O,z,Y){var N=_.exec(z.slice(Y));return N?(O.m=v.get(N[0].toLowerCase()),Y+N[0].length):-1}function P(O,z,Y){return k(O,t,z,Y)}function $(O,z,Y){return k(O,n,z,Y)}function F(O,z,Y){return k(O,r,z,Y)}function W(O){return a[O.getDay()]}function I(O){return s[O.getDay()]}function A(O){return l[O.getMonth()]}function D(O){return o[O.getMonth()]}function H(O){return i[+(O.getHours()>=12)]}function V(O){return 1+~~(O.getMonth()/3)}function U(O){return a[O.getUTCDay()]}function G(O){return s[O.getUTCDay()]}function ee(O){return l[O.getUTCMonth()]}function Z(O){return o[O.getUTCMonth()]}function q(O){return i[+(O.getUTCHours()>=12)]}function B(O){return 1+~~(O.getUTCMonth()/3)}return{format:function(O){var z=w(O+="",y);return z.toString=function(){return O},z},parse:function(O){var z=E(O+="",!1);return z.toString=function(){return O},z},utcFormat:function(O){var z=w(O+="",b);return z.toString=function(){return O},z},utcParse:function(O){var z=E(O+="",!0);return z.toString=function(){return O},z}}}var tD={"-":"",_:" ",0:"0"},jn=/^\s*\d+/,sTe=/^%/,oTe=/[\\^$*+?|[\]().{}]/g;function vt(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 aTe(e){return e.replace(oTe,"\\$&")}function wh(e){return new RegExp("^(?:"+e.map(aTe).join("|")+")","i")}function Sh(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function lTe(e,t,n){var r=jn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function cTe(e,t,n){var r=jn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function uTe(e,t,n){var r=jn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function dTe(e,t,n){var r=jn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function hTe(e,t,n){var r=jn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function nD(e,t,n){var r=jn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function rD(e,t,n){var r=jn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function fTe(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 pTe(e,t,n){var r=jn.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function mTe(e,t,n){var r=jn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function iD(e,t,n){var r=jn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function gTe(e,t,n){var r=jn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function sD(e,t,n){var r=jn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function vTe(e,t,n){var r=jn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function yTe(e,t,n){var r=jn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function _Te(e,t,n){var r=jn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function xTe(e,t,n){var r=jn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function bTe(e,t,n){var r=sTe.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function wTe(e,t,n){var r=jn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function STe(e,t,n){var r=jn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function oD(e,t){return vt(e.getDate(),t,2)}function CTe(e,t){return vt(e.getHours(),t,2)}function kTe(e,t){return vt(e.getHours()%12||12,t,2)}function ETe(e,t){return vt(1+mE.count(El(e),e),t,3)}function tU(e,t){return vt(e.getMilliseconds(),t,3)}function TTe(e,t){return tU(e,t)+"000"}function MTe(e,t){return vt(e.getMonth()+1,t,2)}function RTe(e,t){return vt(e.getMinutes(),t,2)}function ATe(e,t){return vt(e.getSeconds(),t,2)}function DTe(e){var t=e.getDay();return t===0?7:t}function LTe(e,t){return vt(Zz.count(El(e)-1,e),t,2)}function nU(e){var t=e.getDay();return t>=4||t===0?Vu(e):Vu.ceil(e)}function jTe(e,t){return e=nU(e),vt(Vu.count(El(e),e)+(El(e).getDay()===4),t,2)}function PTe(e){return e.getDay()}function NTe(e,t){return vt(Dv.count(El(e)-1,e),t,2)}function OTe(e,t){return vt(e.getFullYear()%100,t,2)}function ITe(e,t){return e=nU(e),vt(e.getFullYear()%100,t,2)}function $Te(e,t){return vt(e.getFullYear()%1e4,t,4)}function FTe(e,t){var n=e.getDay();return e=n>=4||n===0?Vu(e):Vu.ceil(e),vt(e.getFullYear()%1e4,t,4)}function BTe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+vt(t/60|0,"0",2)+vt(t%60,"0",2)}function aD(e,t){return vt(e.getUTCDate(),t,2)}function zTe(e,t){return vt(e.getUTCHours(),t,2)}function UTe(e,t){return vt(e.getUTCHours()%12||12,t,2)}function HTe(e,t){return vt(1+gE.count(Tl(e),e),t,3)}function rU(e,t){return vt(e.getUTCMilliseconds(),t,3)}function WTe(e,t){return rU(e,t)+"000"}function VTe(e,t){return vt(e.getUTCMonth()+1,t,2)}function qTe(e,t){return vt(e.getUTCMinutes(),t,2)}function YTe(e,t){return vt(e.getUTCSeconds(),t,2)}function KTe(e){var t=e.getUTCDay();return t===0?7:t}function GTe(e,t){return vt(eU.count(Tl(e)-1,e),t,2)}function iU(e){var t=e.getUTCDay();return t>=4||t===0?qu(e):qu.ceil(e)}function XTe(e,t){return e=iU(e),vt(qu.count(Tl(e),e)+(Tl(e).getUTCDay()===4),t,2)}function QTe(e){return e.getUTCDay()}function JTe(e,t){return vt(Lv.count(Tl(e)-1,e),t,2)}function ZTe(e,t){return vt(e.getUTCFullYear()%100,t,2)}function e4e(e,t){return e=iU(e),vt(e.getUTCFullYear()%100,t,2)}function t4e(e,t){return vt(e.getUTCFullYear()%1e4,t,4)}function n4e(e,t){var n=e.getUTCDay();return e=n>=4||n===0?qu(e):qu.ceil(e),vt(e.getUTCFullYear()%1e4,t,4)}function r4e(){return"+0000"}function lD(){return"%"}function cD(e){return+e}function uD(e){return Math.floor(+e/1e3)}var yc,sU;i4e({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 i4e(e){return yc=iTe(e),sU=yc.format,yc.parse,yc.utcFormat,yc.utcParse,yc}function s4e(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function jv(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 o4e(e){return e=jv(Math.abs(e)),e?e[1]:NaN}function a4e(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 l4e(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var c4e=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function TS(e){if(!(t=c4e.exec(e)))throw new Error("invalid format: "+e);var t;return new vE({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]})}TS.prototype=vE.prototype;function vE(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+""}vE.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 u4e(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 oU;function d4e(e,t){var n=jv(e,t);if(!n)return e+"";var r=n[0],i=n[1],s=i-(oU=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")+jv(e,Math.max(0,t+s-1))[0]}function dD(e,t){var n=jv(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 hD={"%":function(e,t){return(e*100).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:s4e,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 dD(e*100,t)},r:dD,s:d4e,X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function fD(e){return e}var pD=Array.prototype.map,mD=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function h4e(e){var t=e.grouping===void 0||e.thousands===void 0?fD:a4e(pD.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?fD:l4e(pD.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 c(u){u=TS(u);var f=u.fill,g=u.align,x=u.sign,_=u.symbol,v=u.zero,p=u.width,m=u.comma,y=u.precision,b=u.trim,S=u.type;S==="n"?(m=!0,S="g"):hD[S]||(y===void 0&&(y=12),b=!0,S="g"),(v||f==="0"&&g==="=")&&(v=!0,f="0",g="=");var w=_==="$"?n:_==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",E=_==="$"?r:/[%p]/.test(S)?a:"",k=hD[S],T=/[defgprs%]/.test(S);y=y===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y));function R(M){var L=w,j=E,P,$,F;if(S==="c")j=k(M)+j,M="";else{M=+M;var W=M<0||1/M<0;if(M=isNaN(M)?l:k(Math.abs(M),y),b&&(M=u4e(M)),W&&+M==0&&x!=="+"&&(W=!1),L=(W?x==="("?x:o:x==="-"||x==="("?"":x)+L,j=(S==="s"?mD[8+oU/3]:"")+j+(W&&x==="("?")":""),T){for(P=-1,$=M.length;++P<$;)if(F=M.charCodeAt(P),48>F||F>57){j=(F===46?i+M.slice(P+1):M.slice(P))+j,M=M.slice(0,P);break}}}m&&!v&&(M=t(M,1/0));var I=L.length+M.length+j.length,A=I<p?new Array(p-I+1).join(f):"";switch(m&&v&&(M=t(A+M,A.length?p-j.length:1/0),A=""),g){case"<":M=L+M+j+A;break;case"=":M=L+A+M+j;break;case"^":M=A.slice(0,I=A.length>>1)+L+M+j+A.slice(I);break;default:M=A+L+M+j;break}return s(M)}return R.toString=function(){return u+""},R}function d(u,f){var g=c((u=TS(u),u.type="f",u)),x=Math.max(-8,Math.min(8,Math.floor(o4e(f)/3)))*3,_=Math.pow(10,-x),v=mD[8+x/3];return function(p){return g(_*p)+v}}return{format:c,formatPrefix:d}}var lg,aU;f4e({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function f4e(e){return lg=h4e(e),aU=lg.format,lg.formatPrefix,lg}function p4e(){}var m4e=p4e,Cb=Lz,g4e=m4e,v4e=sE,y4e=1/0,_4e=Cb&&1/v4e(new Cb([,-0]))[1]==y4e?function(e){return new Cb(e)}:g4e,x4e=_4e,b4e=q3,w4e=KB,S4e=GB,C4e=Y3,k4e=x4e,E4e=sE,T4e=200;function M4e(e,t,n){var r=-1,i=w4e,s=e.length,a=!0,o=[],l=o;if(n)a=!1,i=S4e;else if(s>=T4e){var c=t?null:k4e(e);if(c)return E4e(c);a=!1,i=C4e,l=new b4e}else l=t?[]:o;e:for(;++r<s;){var d=e[r],u=t?t(d):d;if(d=n||d!==0?d:0,a&&u===u){for(var f=l.length;f--;)if(l[f]===u)continue e;t&&l.push(u),o.push(d)}else i(l,u,n)||(l!==o&&l.push(u),o.push(d))}return o}var R4e=M4e,A4e=xy,D4e=aE,L4e=1,j4e=2;function P4e(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],c=e[l],d=o[1];if(a&&o[2]){if(c===void 0&&!(l in e))return!1}else{var u=new A4e;if(r)var f=r(c,d,l,e,t,u);if(!(f===void 0?D4e(d,c,L4e|j4e,r,u):f))return!1}}return!0}var N4e=P4e,O4e=ks;function I4e(e){return e===e&&!O4e(e)}var lU=I4e,$4e=lU,F4e=rm;function B4e(e){for(var t=F4e(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,$4e(i)]}return t}var z4e=B4e;function U4e(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var cU=U4e,H4e=N4e,W4e=z4e,V4e=cU;function q4e(e){var t=W4e(e);return t.length==1&&t[0][2]?V4e(t[0][0],t[0][1]):function(n){return n===e||H4e(n,e,t)}}var Y4e=q4e,K4e=aE,G4e=oB,X4e=Sz,Q4e=C3,J4e=lU,Z4e=cU,eMe=$d,tMe=1,nMe=2;function rMe(e,t){return Q4e(e)&&J4e(t)?Z4e(eMe(e),t):function(n){var r=G4e(n,e);return r===void 0&&r===t?X4e(n,e):K4e(t,r,tMe|nMe)}}var iMe=rMe;function sMe(e){return function(t){return t==null?void 0:t[e]}}var oMe=sMe,aMe=em;function lMe(e){return function(t){return aMe(t,e)}}var cMe=lMe,uMe=oMe,dMe=cMe,hMe=C3,fMe=$d;function pMe(e){return hMe(e)?uMe(fMe(e)):dMe(e)}var mMe=pMe,gMe=Y4e,vMe=iMe,yMe=ky,_Me=Er,xMe=mMe;function bMe(e){return typeof e=="function"?e:e==null?yMe:typeof e=="object"?_Me(e)?vMe(e[0],e[1]):gMe(e):xMe(e)}var yE=bMe,wMe=yE,SMe=R4e;function CMe(e,t){return e&&e.length?SMe(e,wMe(t)):[]}var kMe=CMe;const gD=bn(kMe);var EMe=UF,TMe=rm;function MMe(e,t){return e&&EMe(e,t,TMe)}var RMe=MMe,AMe=Nd;function DMe(e,t){return function(n,r){if(n==null)return n;if(!AMe(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 LMe=DMe,jMe=RMe,PMe=LMe,NMe=PMe(jMe),uU=NMe,OMe=uU,IMe=Nd;function $Me(e,t){var n=-1,r=IMe(e)?Array(e.length):[];return OMe(e,function(i,s,a){r[++n]=t(i,s,a)}),r}var FMe=$Me;function BMe(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}var zMe=BMe,vD=Ey;function UMe(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,s=vD(e),a=t!==void 0,o=t===null,l=t===t,c=vD(t);if(!o&&!c&&!s&&e>t||s&&a&&l&&!o&&!c||r&&a&&l||!n&&l||!i)return 1;if(!r&&!s&&!c&&e<t||c&&n&&i&&!r&&!s||o&&n&&i||!a&&i||!l)return-1}return 0}var HMe=UMe,WMe=HMe;function VMe(e,t,n){for(var r=-1,i=e.criteria,s=t.criteria,a=i.length,o=n.length;++r<a;){var l=WMe(i[r],s[r]);if(l){if(r>=o)return l;var c=n[r];return l*(c=="desc"?-1:1)}}return e.index-t.index}var qMe=VMe,kb=Ty,YMe=em,KMe=yE,GMe=FMe,XMe=zMe,QMe=Jp,JMe=qMe,ZMe=ky,eRe=Er;function tRe(e,t,n){t.length?t=kb(t,function(s){return eRe(s)?function(a){return YMe(a,s.length===1?s[0]:s)}:s}):t=[ZMe];var r=-1;t=kb(t,QMe(KMe));var i=GMe(e,function(s,a,o){var l=kb(t,function(c){return c(s)});return{criteria:l,index:++r,value:s}});return XMe(i,function(s,a){return JMe(s,a,n)})}var nRe=tRe,rRe=kz,iRe=nRe,sRe=S3,yD=rB;sRe(function(e,t){if(e==null)return[];var n=t.length;return n>1&&yD(e,t[0],t[1])?t=[]:n>2&&yD(t[0],t[1],t[2])&&(t=[t[0]]),iRe(e,rRe(t,1),[])});var _D=Sy;_D&&_D.isDate;var Eb=new Date,Tb=new Date;function ho(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=[],c;if(s=i.ceil(s),o=o==null?1:Math.floor(o),!(s<a)||!(o>0))return l;do l.push(c=new Date(+s)),t(s,o),e(s);while(c<s&&s<a);return l},i.filter=function(s){return ho(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 Eb.setTime(+s),Tb.setTime(+a),e(Eb),e(Tb),Math.floor(n(Eb,Tb))},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}const oRe=1e3,_E=oRe*60,aRe=_E*60,xE=aRe*24,dU=xE*7;var bE=ho(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*_E)/xE,e=>e.getDate()-1);bE.range;function Jl(e){return ho(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())*_E)/dU})}var hU=Jl(0),Pv=Jl(1),lRe=Jl(2),cRe=Jl(3),Yu=Jl(4),uRe=Jl(5),dRe=Jl(6);hU.range;Pv.range;lRe.range;cRe.range;Yu.range;uRe.range;dRe.range;var Ml=ho(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()});Ml.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:ho(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)})};Ml.range;var wE=ho(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/xE},function(e){return e.getUTCDate()-1});wE.range;function Zl(e){return ho(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)/dU})}var fU=Zl(0),Nv=Zl(1),hRe=Zl(2),fRe=Zl(3),Ku=Zl(4),pRe=Zl(5),mRe=Zl(6);fU.range;Nv.range;hRe.range;fRe.range;Ku.range;pRe.range;mRe.range;var Rl=ho(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()});Rl.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:ho(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)})};Rl.range;function Mb(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 Rb(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 Ch(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function gRe(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,c=kh(i),d=Eh(i),u=kh(s),f=Eh(s),g=kh(a),x=Eh(a),_=kh(o),v=Eh(o),p=kh(l),m=Eh(l),y={a:W,A:I,b:A,B:D,c:null,d:kD,e:kD,f:FRe,g:GRe,G:QRe,H:ORe,I:IRe,j:$Re,L:pU,m:BRe,M:zRe,p:H,q:V,Q:MD,s:RD,S:URe,u:HRe,U:WRe,V:VRe,w:qRe,W:YRe,x:null,X:null,y:KRe,Y:XRe,Z:JRe,"%":TD},b={a:U,A:G,b:ee,B:Z,c:null,d:ED,e:ED,f:nAe,g:hAe,G:pAe,H:ZRe,I:eAe,j:tAe,L:gU,m:rAe,M:iAe,p:q,q:B,Q:MD,s:RD,S:sAe,u:oAe,U:aAe,V:lAe,w:cAe,W:uAe,x:null,X:null,y:dAe,Y:fAe,Z:mAe,"%":TD},S={a:R,A:M,b:L,B:j,c:P,d:SD,e:SD,f:LRe,g:wD,G:bD,H:CD,I:CD,j:MRe,L:DRe,m:TRe,M:RRe,p:T,q:ERe,Q:PRe,s:NRe,S:ARe,u:bRe,U:wRe,V:SRe,w:xRe,W:CRe,x:$,X:F,y:wD,Y:bD,Z:kRe,"%":jRe};y.x=w(n,y),y.X=w(r,y),y.c=w(t,y),b.x=w(n,b),b.X=w(r,b),b.c=w(t,b);function w(O,z){return function(Y){var N=[],J=-1,K=0,te=O.length,oe,ae,_e;for(Y instanceof Date||(Y=new Date(+Y));++J<te;)O.charCodeAt(J)===37&&(N.push(O.slice(K,J)),(ae=xD[oe=O.charAt(++J)])!=null?oe=O.charAt(++J):ae=oe==="e"?" ":"0",(_e=z[oe])&&(oe=_e(Y,ae)),N.push(oe),K=J+1);return N.push(O.slice(K,J)),N.join("")}}function E(O,z){return function(Y){var N=Ch(1900,void 0,1),J=k(N,O,Y+="",0),K,te;if(J!=Y.length)return null;if("Q"in N)return new Date(N.Q);if("s"in N)return new Date(N.s*1e3+("L"in N?N.L:0));if(z&&!("Z"in N)&&(N.Z=0),"p"in N&&(N.H=N.H%12+N.p*12),N.m===void 0&&(N.m="q"in N?N.q:0),"V"in N){if(N.V<1||N.V>53)return null;"w"in N||(N.w=1),"Z"in N?(K=Rb(Ch(N.y,0,1)),te=K.getUTCDay(),K=te>4||te===0?Nv.ceil(K):Nv(K),K=wE.offset(K,(N.V-1)*7),N.y=K.getUTCFullYear(),N.m=K.getUTCMonth(),N.d=K.getUTCDate()+(N.w+6)%7):(K=Mb(Ch(N.y,0,1)),te=K.getDay(),K=te>4||te===0?Pv.ceil(K):Pv(K),K=bE.offset(K,(N.V-1)*7),N.y=K.getFullYear(),N.m=K.getMonth(),N.d=K.getDate()+(N.w+6)%7)}else("W"in N||"U"in N)&&("w"in N||(N.w="u"in N?N.u%7:"W"in N?1:0),te="Z"in N?Rb(Ch(N.y,0,1)).getUTCDay():Mb(Ch(N.y,0,1)).getDay(),N.m=0,N.d="W"in N?(N.w+6)%7+N.W*7-(te+5)%7:N.w+N.U*7-(te+6)%7);return"Z"in N?(N.H+=N.Z/100|0,N.M+=N.Z%100,Rb(N)):Mb(N)}}function k(O,z,Y,N){for(var J=0,K=z.length,te=Y.length,oe,ae;J<K;){if(N>=te)return-1;if(oe=z.charCodeAt(J++),oe===37){if(oe=z.charAt(J++),ae=S[oe in xD?z.charAt(J++):oe],!ae||(N=ae(O,Y,N))<0)return-1}else if(oe!=Y.charCodeAt(N++))return-1}return N}function T(O,z,Y){var N=c.exec(z.slice(Y));return N?(O.p=d.get(N[0].toLowerCase()),Y+N[0].length):-1}function R(O,z,Y){var N=g.exec(z.slice(Y));return N?(O.w=x.get(N[0].toLowerCase()),Y+N[0].length):-1}function M(O,z,Y){var N=u.exec(z.slice(Y));return N?(O.w=f.get(N[0].toLowerCase()),Y+N[0].length):-1}function L(O,z,Y){var N=p.exec(z.slice(Y));return N?(O.m=m.get(N[0].toLowerCase()),Y+N[0].length):-1}function j(O,z,Y){var N=_.exec(z.slice(Y));return N?(O.m=v.get(N[0].toLowerCase()),Y+N[0].length):-1}function P(O,z,Y){return k(O,t,z,Y)}function $(O,z,Y){return k(O,n,z,Y)}function F(O,z,Y){return k(O,r,z,Y)}function W(O){return a[O.getDay()]}function I(O){return s[O.getDay()]}function A(O){return l[O.getMonth()]}function D(O){return o[O.getMonth()]}function H(O){return i[+(O.getHours()>=12)]}function V(O){return 1+~~(O.getMonth()/3)}function U(O){return a[O.getUTCDay()]}function G(O){return s[O.getUTCDay()]}function ee(O){return l[O.getUTCMonth()]}function Z(O){return o[O.getUTCMonth()]}function q(O){return i[+(O.getUTCHours()>=12)]}function B(O){return 1+~~(O.getUTCMonth()/3)}return{format:function(O){var z=w(O+="",y);return z.toString=function(){return O},z},parse:function(O){var z=E(O+="",!1);return z.toString=function(){return O},z},utcFormat:function(O){var z=w(O+="",b);return z.toString=function(){return O},z},utcParse:function(O){var z=E(O+="",!0);return z.toString=function(){return O},z}}}var xD={"-":"",_:" ",0:"0"},Pn=/^\s*\d+/,vRe=/^%/,yRe=/[\\^$*+?|[\]().{}]/g;function yt(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 _Re(e){return e.replace(yRe,"\\$&")}function kh(e){return new RegExp("^(?:"+e.map(_Re).join("|")+")","i")}function Eh(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function xRe(e,t,n){var r=Pn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function bRe(e,t,n){var r=Pn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function wRe(e,t,n){var r=Pn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function SRe(e,t,n){var r=Pn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function CRe(e,t,n){var r=Pn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function bD(e,t,n){var r=Pn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function wD(e,t,n){var r=Pn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function kRe(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 ERe(e,t,n){var r=Pn.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function TRe(e,t,n){var r=Pn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function SD(e,t,n){var r=Pn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function MRe(e,t,n){var r=Pn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function CD(e,t,n){var r=Pn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function RRe(e,t,n){var r=Pn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function ARe(e,t,n){var r=Pn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function DRe(e,t,n){var r=Pn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function LRe(e,t,n){var r=Pn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function jRe(e,t,n){var r=vRe.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function PRe(e,t,n){var r=Pn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function NRe(e,t,n){var r=Pn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function kD(e,t){return yt(e.getDate(),t,2)}function ORe(e,t){return yt(e.getHours(),t,2)}function IRe(e,t){return yt(e.getHours()%12||12,t,2)}function $Re(e,t){return yt(1+bE.count(Ml(e),e),t,3)}function pU(e,t){return yt(e.getMilliseconds(),t,3)}function FRe(e,t){return pU(e,t)+"000"}function BRe(e,t){return yt(e.getMonth()+1,t,2)}function zRe(e,t){return yt(e.getMinutes(),t,2)}function URe(e,t){return yt(e.getSeconds(),t,2)}function HRe(e){var t=e.getDay();return t===0?7:t}function WRe(e,t){return yt(hU.count(Ml(e)-1,e),t,2)}function mU(e){var t=e.getDay();return t>=4||t===0?Yu(e):Yu.ceil(e)}function VRe(e,t){return e=mU(e),yt(Yu.count(Ml(e),e)+(Ml(e).getDay()===4),t,2)}function qRe(e){return e.getDay()}function YRe(e,t){return yt(Pv.count(Ml(e)-1,e),t,2)}function KRe(e,t){return yt(e.getFullYear()%100,t,2)}function GRe(e,t){return e=mU(e),yt(e.getFullYear()%100,t,2)}function XRe(e,t){return yt(e.getFullYear()%1e4,t,4)}function QRe(e,t){var n=e.getDay();return e=n>=4||n===0?Yu(e):Yu.ceil(e),yt(e.getFullYear()%1e4,t,4)}function JRe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+yt(t/60|0,"0",2)+yt(t%60,"0",2)}function ED(e,t){return yt(e.getUTCDate(),t,2)}function ZRe(e,t){return yt(e.getUTCHours(),t,2)}function eAe(e,t){return yt(e.getUTCHours()%12||12,t,2)}function tAe(e,t){return yt(1+wE.count(Rl(e),e),t,3)}function gU(e,t){return yt(e.getUTCMilliseconds(),t,3)}function nAe(e,t){return gU(e,t)+"000"}function rAe(e,t){return yt(e.getUTCMonth()+1,t,2)}function iAe(e,t){return yt(e.getUTCMinutes(),t,2)}function sAe(e,t){return yt(e.getUTCSeconds(),t,2)}function oAe(e){var t=e.getUTCDay();return t===0?7:t}function aAe(e,t){return yt(fU.count(Rl(e)-1,e),t,2)}function vU(e){var t=e.getUTCDay();return t>=4||t===0?Ku(e):Ku.ceil(e)}function lAe(e,t){return e=vU(e),yt(Ku.count(Rl(e),e)+(Rl(e).getUTCDay()===4),t,2)}function cAe(e){return e.getUTCDay()}function uAe(e,t){return yt(Nv.count(Rl(e)-1,e),t,2)}function dAe(e,t){return yt(e.getUTCFullYear()%100,t,2)}function hAe(e,t){return e=vU(e),yt(e.getUTCFullYear()%100,t,2)}function fAe(e,t){return yt(e.getUTCFullYear()%1e4,t,4)}function pAe(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Ku(e):Ku.ceil(e),yt(e.getUTCFullYear()%1e4,t,4)}function mAe(){return"+0000"}function TD(){return"%"}function MD(e){return+e}function RD(e){return Math.floor(+e/1e3)}var _c,yU,_U;gAe({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 gAe(e){return _c=gRe(e),_c.format,yU=_c.parse,_c.utcFormat,_U=_c.utcParse,_c}var Ab=new Date,Db=new Date;function An(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=[],c;if(s=i.ceil(s),o=o==null?1:Math.floor(o),!(s<a)||!(o>0))return l;do l.push(c=new Date(+s)),t(s,o),e(s);while(c<s&&s<a);return l},i.filter=function(s){return An(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 Ab.setTime(+s),Db.setTime(+a),e(Ab),e(Db),Math.floor(n(Ab,Db))},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 dp=An(function(){},function(e,t){e.setTime(+e+t)},function(e,t){return t-e});dp.every=function(e){return e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?An(function(t){t.setTime(Math.floor(t/e)*e)},function(t,n){t.setTime(+t+n*e)},function(t,n){return(n-t)/e}):dp};dp.range;var Ov=1e3,Gu=6e4,Iv=36e5,xU=6048e5,MS=An(function(e){e.setTime(e-e.getMilliseconds())},function(e,t){e.setTime(+e+t*Ov)},function(e,t){return(t-e)/Ov},function(e){return e.getUTCSeconds()});MS.range;var bU=An(function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ov)},function(e,t){e.setTime(+e+t*Gu)},function(e,t){return(t-e)/Gu},function(e){return e.getMinutes()});bU.range;var wU=An(function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ov-e.getMinutes()*Gu)},function(e,t){e.setTime(+e+t*Iv)},function(e,t){return(t-e)/Iv},function(e){return e.getHours()});wU.range;function ec(e){return An(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())*Gu)/xU})}var RS=ec(0),SU=ec(1),CU=ec(2),kU=ec(3),EU=ec(4),TU=ec(5),MU=ec(6);RS.range;SU.range;CU.range;kU.range;EU.range;TU.range;MU.range;var RU=An(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()});RU.range;var SE=An(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()});SE.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:An(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)})};SE.range;var AU=An(function(e){e.setUTCSeconds(0,0)},function(e,t){e.setTime(+e+t*Gu)},function(e,t){return(t-e)/Gu},function(e){return e.getUTCMinutes()});AU.range;var DU=An(function(e){e.setUTCMinutes(0,0,0)},function(e,t){e.setTime(+e+t*Iv)},function(e,t){return(t-e)/Iv},function(e){return e.getUTCHours()});DU.range;function tc(e){return An(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)/xU})}var AS=tc(0),LU=tc(1),jU=tc(2),PU=tc(3),NU=tc(4),OU=tc(5),IU=tc(6);AS.range;LU.range;jU.range;PU.range;NU.range;OU.range;IU.range;var $U=An(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()});$U.range;var CE=An(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()});CE.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:An(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)})};CE.range;var xc=[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)}],vAe={millisecond:[],second:xc.slice(0,1),minute:xc.slice(0,2),hour:xc.slice(0,3),day:xc.slice(0,4),month:xc.slice(0,5),year:xc.slice(0,6)},yAe=function(e){return function(t){return vAe[e].forEach(function(n){n(t)}),t}},_Ae=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=yAe(i);return function(l){if(l===void 0)return l;if(n==="native"||l instanceof Date)return o(l);var c=a?_U(n):yU(n);return o(c(l))}},xAe=function(e,t,n,r){var i,s,a,o,l=e.min,c=l===void 0?0:l,d=e.max,u=d===void 0?"auto":d,f=e.stacked,g=f!==void 0&&f,x=e.reverse,_=x!==void 0&&x,v=e.clamp,p=v!==void 0&&v,m=e.nice,y=m!==void 0&&m;c==="auto"?i=g===!0?(s=t.minStacked)!=null?s:0:t.min:i=c,u==="auto"?a=g===!0?(o=t.maxStacked)!=null?o:0:t.max:a=u;var b=Yo().rangeRound(r==="x"?[0,n]:[n,0]).domain(_?[a,i]:[i,a]).clamp(p);return y===!0?b.nice():typeof y=="number"&&b.nice(y),bAe(b,g)},bAe=function(e,t){t===void 0&&(t=!1);var n=e;return n.type="linear",n.stacked=t,n},wAe=function(e,t,n){var r=Pbe().range([0,n]).domain(t.all);return r.type="point",r},SAe=function(e,t,n,r){var i=e.round,s=i===void 0||i,a=Ly().range(r==="x"?[0,n]:[n,0]).domain(t.all).round(s);return CAe(a)},CAe=function(e){var t=e;return t.type="band",t},kAe=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,c=e.min,d=c===void 0?"auto":c,u=e.max,f=u===void 0?"auto":u,g=e.useUTC,x=g===void 0||g,_=e.nice,v=_!==void 0&&_,p=_Ae({format:a,precision:l,useUTC:x});r=d==="auto"?p(t.min):a!=="native"?p(d):d,i=f==="auto"?p(t.max):a!=="native"?p(f):f;var m=x?x2e():W3();m.range([0,n]),r&&i&&m.domain([r,i]),v===!0?m.nice():typeof v!="object"&&typeof v!="number"||m.nice(v);var y=m;return y.type="time",y.useUTC=x,y},EAe=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,c=e.max,d=c===void 0?"auto":c;if(t.all.some(function(_){return _===0}))throw new Error("a log scale domain must not include or cross zero");var u,f,g=!1;if(t.all.filter(function(_){return _!=null}).forEach(function(_){g||(i===void 0?i=Math.sign(_):Math.sign(_)!==i&&(g=!0))}),g)throw new Error("a log scale domain must be strictly-positive or strictly-negative");u=l==="auto"?t.min:l,f=d==="auto"?t.max:d;var x=CB().domain([u,f]).rangeRound(r==="x"?[0,n]:[n,0]).base(a).nice();return x.type="log",x},TAe=function(e,t,n,r){var i,s,a=e.constant,o=a===void 0?1:a,l=e.min,c=l===void 0?"auto":l,d=e.max,u=d===void 0?"auto":d,f=e.reverse,g=f!==void 0&&f;i=c==="auto"?t.min:c,s=u==="auto"?t.max:u;var x=kB().constant(o).rangeRound(r==="x"?[0,n]:[n,0]).nice();g===!0?x.domain([s,i]):x.domain([i,s]);var _=x;return _.type="symlog",_};function kE(e,t,n,r){switch(e.type){case"linear":return xAe(e,t,n,r);case"point":return wAe(e,t,n);case"band":return SAe(e,t,n,r);case"time":return kAe(e,t,n);case"log":return EAe(e,t,n,r);case"symlog":return TAe(e,t,n,r);default:throw new Error("invalid scale spec")}}var FU=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}},BU={millisecond:[dp,dp],second:[MS,MS],minute:[bU,AU],hour:[wU,DU],day:[An(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)}),An(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:[RS,AS],sunday:[RS,AS],monday:[SU,LU],tuesday:[CU,jU],wednesday:[kU,PU],thursday:[EU,NU],friday:[TU,OU],saturday:[MU,IU],month:[RU,$U],year:[SE,CE]},MAe=Object.keys(BU),RAe=new RegExp("^every\\s*(\\d+)?\\s*("+MAe.join("|")+")s?$","i"),zU=function(e,t){if(Array.isArray(t))return t;if(typeof t=="string"&&"useUTC"in e){var n=t.match(RAe);if(n){var r=n[1],i=n[2],s=BU[i][e.useUTC?1:0];if(i==="day"){var a,o,l=e.domain(),c=l[0],d=l[1],u=new Date(d);return u.setDate(u.getDate()+1),(a=(o=s.every(Number(r??1)))==null?void 0:o.range(c,u))!=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 si(){return si=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},si.apply(this,arguments)}var UU=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,c=e.truncateTickAt,d=e.engine,u=d===void 0?"svg":d,f=zU(r,s),g=$Ee[u],x="bandwidth"in r?FU(r):r,_={lineX:0,lineY:0},v={textX:0,textY:0},p=typeof document=="object"&&document.dir==="rtl",m=g.align.center,y=g.baseline.center;return n==="x"?(t=function(b){var S;return{x:(S=x(b))!=null?S:0,y:0}},_.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?m=g.align.center:i==="after"&&l<0||i==="before"&&l>0?(m=g.align[p?"left":"right"],y=g.baseline.center):(i==="after"&&l>0||i==="before"&&l<0)&&(m=g.align[p?"right":"left"],y=g.baseline.center)):(t=function(b){var S;return{x:0,y:(S=x(b))!=null?S:0}},_.lineX=a*(i==="after"?1:-1),v.textX=(a+o)*(i==="after"?1:-1),m=i==="after"?g.align.left:g.align.right),{ticks:f.map(function(b){var S=typeof b=="string"?function(w){var E=String(w).length;return c&&c>0&&E>c?""+String(w).slice(0,c).concat("..."):""+w}(b):b;return si({key:b instanceof Date?""+b.valueOf():""+b,value:S},t(b),_,v)}),textAlign:m,textBaseline:y}},HU=function(e,t){if(e===void 0||typeof e=="function")return e;if(t.type==="time"){var n=sU(e);return function(r){return n(r instanceof Date?r:new Date(r))}}return aU(e)},DS=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)||zU(i,a)),l="bandwidth"in i?FU(i):i,c=s==="x"?o.map(function(d){var u,f;return{key:d instanceof Date?""+d.valueOf():""+d,x1:(u=l(d))!=null?u:0,x2:(f=l(d))!=null?f:0,y1:0,y2:r}}):o.map(function(d){var u,f;return{key:d instanceof Date?""+d.valueOf():""+d,x1:0,x2:n,y1:(u=l(d))!=null?u:0,y2:(f=l(d))!=null?f:0}});return c},AAe=C.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,c=e.animatedProps,d=Yt(),u=d.axis.ticks.line,f=d.axis.ticks.text,g=(t=r==null?void 0:r(n))!=null?t:n,x=C.useMemo(function(){var _={opacity:c.opacity};return a?{style:si({},_,{cursor:"pointer"}),onClick:function(v){return a(v,g)}}:{style:_}},[c.opacity,a,g]);return h.jsxs(kt.g,si({transform:c.transform},x,{children:[h.jsx("line",{x1:0,x2:i,y1:0,y2:s,style:u}),f.outlineWidth>0&&h.jsx(kt.text,{dominantBaseline:o,textAnchor:l,transform:c.textTransform,style:f,strokeWidth:2*f.outlineWidth,stroke:f.outlineColor,strokeLinejoin:"round",children:""+g}),h.jsx(kt.text,{dominantBaseline:o,textAnchor:l,transform:c.textTransform,style:dE(f),children:""+g})]}))}),DAe=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,c=e.tickValues,d=e.tickSize,u=d===void 0?5:d,f=e.tickPadding,g=f===void 0?5:f,x=e.tickRotation,_=x===void 0?0:x,v=e.format,p=e.renderTick,m=p===void 0?AAe:p,y=e.truncateTickAt,b=e.legend,S=e.legendPosition,w=S===void 0?"end":S,E=e.legendOffset,k=E===void 0?0:E,T=e.onClick,R=e.ariaHidden,M=Yt(),L=M.axis.legend.text,j=C.useMemo(function(){return HU(v,n)},[v,n]),P=UU({axis:t,scale:n,ticksPosition:l,tickValues:c,tickSize:u,tickPadding:g,tickRotation:_,truncateTickAt:y}),$=P.ticks,F=P.textAlign,W=P.textBaseline,I=null;if(b!==void 0){var A,D=0,H=0,V=0;t==="y"?(V=-90,D=k,w==="start"?(A="start",H=o):w==="middle"?(A="middle",H=o/2):w==="end"&&(A="end")):(H=k,w==="start"?A="start":w==="middle"?(A="middle",D=o/2):w==="end"&&(A="end",D=o)),I=h.jsxs(h.Fragment,{children:[L.outlineWidth>0&&h.jsx("text",{transform:"translate("+D+", "+H+") rotate("+V+")",textAnchor:A,style:si({dominantBaseline:"central"},L),strokeWidth:2*L.outlineWidth,stroke:L.outlineColor,strokeLinejoin:"round",children:b}),h.jsx("text",{transform:"translate("+D+", "+H+") rotate("+V+")",textAnchor:A,style:si({dominantBaseline:"central"},L),children:b})]})}var U=Tr(),G=U.animate,ee=U.config,Z=lo({transform:"translate("+i+","+a+")",lineX2:t==="x"?o:0,lineY2:t==="x"?0:o,config:ee,immediate:!G}),q=C.useCallback(function(z){return{opacity:1,transform:"translate("+z.x+","+z.y+")",textTransform:"translate("+z.textX+","+z.textY+") rotate("+_+")"}},[_]),B=C.useCallback(function(z){return{opacity:0,transform:"translate("+z.x+","+z.y+")",textTransform:"translate("+z.textX+","+z.textY+") rotate("+_+")"}},[_]),O=Hl($,{keys:function(z){return z.key},initial:q,from:B,enter:q,update:q,leave:{opacity:0},config:ee,immediate:!G});return h.jsxs(kt.g,{transform:Z.transform,"aria-hidden":R,children:[O(function(z,Y,N,J){return C.createElement(m,si({tickIndex:J,format:j,rotate:_,textBaseline:W,textAnchor:F,truncateTickAt:y,animatedProps:z},Y,T?{onClick:T}:{}))}),h.jsx(kt.line,{style:M.axis.domain.line,x1:0,x2:Z.lineX2,y1:0,y2:Z.lineY2}),I]})},LAe=C.memo(DAe),WU=["top","right","bottom","left"],jAe=C.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 h.jsx(h.Fragment,{children:WU.map(function(a){var o=s[a];if(!o)return null;var l=a==="top"||a==="bottom";return h.jsx(LAe,si({},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)})})}),PAe=C.memo(function(e){var t=e.animatedProps,n=Yt();return h.jsx(kt.line,si({},t,n.grid.line))}),AD=C.memo(function(e){var t=e.lines,n=Tr(),r=n.animate,i=n.config,s=Hl(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 h.jsx("g",{children:s(function(a,o){return C.createElement(PAe,si({},o,{key:o.key,animatedProps:a}))})})}),NAe=C.memo(function(e){var t=e.width,n=e.height,r=e.xScale,i=e.yScale,s=e.xValues,a=e.yValues,o=C.useMemo(function(){return!!r&&DS({width:t,height:n,scale:r,axis:"x",values:s})},[r,s,t,n]),l=C.useMemo(function(){return!!i&&DS({width:t,height:n,scale:i,axis:"y",values:a})},[n,t,i,a]);return h.jsxs(h.Fragment,{children:[o&&h.jsx(AD,{lines:o}),l&&h.jsx(AD,{lines:l})]})}),OAe=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,c=t.length,d=t.ticksPosition,u=t.tickValues,f=t.tickSize,g=f===void 0?5:f,x=t.tickPadding,_=x===void 0?5:x,v=t.tickRotation,p=v===void 0?0:v,m=t.format,y=t.legend,b=t.legendPosition,S=b===void 0?"end":b,w=t.legendOffset,E=w===void 0?0:w,k=t.theme,T=UU({axis:r,scale:i,ticksPosition:d,tickValues:u,tickSize:g,tickPadding:_,tickRotation:p,engine:"canvas"}),R=T.ticks,M=T.textAlign,L=T.textBaseline;e.save(),e.translate(a,l),e.textAlign=M,e.textBaseline=L;var j=k.axis.ticks.text;e.font=(j.fontWeight?j.fontWeight+" ":"")+j.fontSize+"px "+j.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"?c:0,r==="x"?0:c),e.stroke());var P=typeof m=="function"?m:function(A){return""+A};if(R.forEach(function(A){var D;((D=k.axis.ticks.line.strokeWidth)!=null?D: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(A.x,A.y),e.lineTo(A.x+A.lineX,A.y+A.lineY),e.stroke());var H=P(A.value);e.save(),e.translate(A.x+A.textX,A.y+A.textY),e.rotate(ii(p)),j.outlineWidth>0&&(e.strokeStyle=j.outlineColor,e.lineWidth=2*j.outlineWidth,e.lineJoin="round",e.strokeText(""+H,0,0)),k.axis.ticks.text.fill&&(e.fillStyle=j.fill),e.fillText(""+H,0,0),e.restore()}),y!==void 0){var $=0,F=0,W=0,I="center";r==="y"?(W=-90,$=E,S==="start"?(I="start",F=c):S==="middle"?(I="center",F=c/2):S==="end"&&(I="end")):(F=E,S==="start"?I="start":S==="middle"?(I="center",$=c/2):S==="end"&&(I="end",$=c)),e.translate($,F),e.rotate(ii(W)),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=I,e.textBaseline="middle",e.fillText(y,0,0)}e.restore()},IAe=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,c=t.left,d=t.theme,u={top:a,right:o,bottom:l,left:c};WU.forEach(function(f){var g=u[f];if(!g)return null;var x=f==="top"||f==="bottom",_=f==="top"||f==="left"?"before":"after",v=x?n:r,p=HU(g.format,v);OAe(e,si({},g,{axis:x?"x":"y",x:f==="right"?i:0,y:f==="bottom"?s:0,scale:v,format:p,length:x?i:s,ticksPosition:_,theme:d}))})},DD=function(e,t){var n=t.width,r=t.height,i=t.scale,s=t.axis,a=t.values;DS({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()})},$Ae=uU;function FAe(e,t){var n=[];return $Ae(e,function(r,i,s){t(r,i,s)&&n.push(r)}),n}var BAe=FAe,zAe=Rz,UAe=BAe,HAe=yE,WAe=Er;function VAe(e,t){var n=WAe(e)?zAe:UAe;return n(e,HAe(t))}var qAe=VAe;const YAe=bn(qAe);var KAe=Ma,GAe=Vi,XAe="[object Number]";function QAe(e){return typeof e=="number"||GAe(e)&&KAe(e)==XAe}var JAe=QAe;const LD=bn(JAe);function ZAe(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var e6e=ZAe,t6e=Od,n6e=rm;function r6e(e,t){return e&&t6e(t,n6e(t),e)}var i6e=r6e,s6e=Od,o6e=Zp;function a6e(e,t){return e&&s6e(t,o6e(t),e)}var l6e=a6e,c6e=Od,u6e=oE;function d6e(e,t){return c6e(e,u6e(e),t)}var h6e=d6e,f6e=iE,p6e=g3,m6e=oE,g6e=Az,v6e=Object.getOwnPropertySymbols,y6e=v6e?function(e){for(var t=[];e;)f6e(t,m6e(e)),e=p6e(e);return t}:g6e,VU=y6e,_6e=Od,x6e=VU;function b6e(e,t){return _6e(e,x6e(e),t)}var w6e=b6e,S6e=Mz,C6e=VU,k6e=Zp;function E6e(e){return S6e(e,k6e,C6e)}var qU=E6e,T6e=Object.prototype,M6e=T6e.hasOwnProperty;function R6e(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&M6e.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var A6e=R6e,D6e=m3;function L6e(e,t){var n=t?D6e(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var j6e=L6e,P6e=/\w*$/;function N6e(e){var t=new e.constructor(e.source,P6e.exec(e));return t.lastIndex=e.lastIndex,t}var O6e=N6e,jD=Dd,PD=jD?jD.prototype:void 0,ND=PD?PD.valueOf:void 0;function I6e(e){return ND?Object(ND.call(e)):{}}var $6e=I6e,F6e=m3,B6e=j6e,z6e=O6e,U6e=$6e,H6e=VF,W6e="[object Boolean]",V6e="[object Date]",q6e="[object Map]",Y6e="[object Number]",K6e="[object RegExp]",G6e="[object Set]",X6e="[object String]",Q6e="[object Symbol]",J6e="[object ArrayBuffer]",Z6e="[object DataView]",eDe="[object Float32Array]",tDe="[object Float64Array]",nDe="[object Int8Array]",rDe="[object Int16Array]",iDe="[object Int32Array]",sDe="[object Uint8Array]",oDe="[object Uint8ClampedArray]",aDe="[object Uint16Array]",lDe="[object Uint32Array]";function cDe(e,t,n){var r=e.constructor;switch(t){case J6e:return F6e(e);case W6e:case V6e:return new r(+e);case Z6e:return B6e(e,n);case eDe:case tDe:case nDe:case rDe:case iDe:case sDe:case oDe:case aDe:case lDe:return H6e(e,n);case q6e:return new r;case Y6e:case X6e:return new r(e);case K6e:return z6e(e);case G6e:return new r;case Q6e:return U6e(e)}}var uDe=cDe,dDe=f_,hDe=Vi,fDe="[object Map]";function pDe(e){return hDe(e)&&dDe(e)==fDe}var mDe=pDe,gDe=mDe,vDe=Jp,OD=Sy,ID=OD&&OD.isMap,yDe=ID?vDe(ID):gDe,_De=yDe,xDe=f_,bDe=Vi,wDe="[object Set]";function SDe(e){return bDe(e)&&xDe(e)==wDe}var CDe=SDe,kDe=CDe,EDe=Jp,$D=Sy,FD=$D&&$D.isSet,TDe=FD?EDe(FD):kDe,MDe=TDe,RDe=xy,ADe=e6e,DDe=w3,LDe=i6e,jDe=l6e,PDe=HF,NDe=qF,ODe=h6e,IDe=w6e,$De=Dz,FDe=qU,BDe=f_,zDe=A6e,UDe=uDe,HDe=KF,WDe=Er,VDe=wy,qDe=_De,YDe=ks,KDe=MDe,GDe=rm,XDe=Zp,QDe=1,JDe=2,ZDe=4,YU="[object Arguments]",e8e="[object Array]",t8e="[object Boolean]",n8e="[object Date]",r8e="[object Error]",KU="[object Function]",i8e="[object GeneratorFunction]",s8e="[object Map]",o8e="[object Number]",GU="[object Object]",a8e="[object RegExp]",l8e="[object Set]",c8e="[object String]",u8e="[object Symbol]",d8e="[object WeakMap]",h8e="[object ArrayBuffer]",f8e="[object DataView]",p8e="[object Float32Array]",m8e="[object Float64Array]",g8e="[object Int8Array]",v8e="[object Int16Array]",y8e="[object Int32Array]",_8e="[object Uint8Array]",x8e="[object Uint8ClampedArray]",b8e="[object Uint16Array]",w8e="[object Uint32Array]",Dt={};Dt[YU]=Dt[e8e]=Dt[h8e]=Dt[f8e]=Dt[t8e]=Dt[n8e]=Dt[p8e]=Dt[m8e]=Dt[g8e]=Dt[v8e]=Dt[y8e]=Dt[s8e]=Dt[o8e]=Dt[GU]=Dt[a8e]=Dt[l8e]=Dt[c8e]=Dt[u8e]=Dt[_8e]=Dt[x8e]=Dt[b8e]=Dt[w8e]=!0;Dt[r8e]=Dt[KU]=Dt[d8e]=!1;function Ug(e,t,n,r,i,s){var a,o=t&QDe,l=t&JDe,c=t&ZDe;if(n&&(a=i?n(e,r,i,s):n(e)),a!==void 0)return a;if(!YDe(e))return e;var d=WDe(e);if(d){if(a=zDe(e),!o)return NDe(e,a)}else{var u=BDe(e),f=u==KU||u==i8e;if(VDe(e))return PDe(e,o);if(u==GU||u==YU||f&&!i){if(a=l||f?{}:HDe(e),!o)return l?IDe(e,jDe(a,e)):ODe(e,LDe(a,e))}else{if(!Dt[u])return i?e:{};a=UDe(e,u,o)}}s||(s=new RDe);var g=s.get(e);if(g)return g;s.set(e,a),KDe(e)?e.forEach(function(v){a.add(Ug(v,t,n,v,e,s))}):qDe(e)&&e.forEach(function(v,p){a.set(p,Ug(v,t,n,p,e,s))});var x=c?l?FDe:$De:l?XDe:GDe,_=d?void 0:x(e);return ADe(_||e,function(v,p){_&&(p=v,v=e[p]),DDe(a,p,Ug(v,t,n,p,e,s))}),a}var S8e=Ug;function C8e(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 k8e=C8e,E8e=em,T8e=k8e;function M8e(e,t){return t.length<2?e:E8e(e,T8e(t,0,-1))}var R8e=M8e,A8e=Id,D8e=gB,L8e=R8e,j8e=$d;function P8e(e,t){return t=A8e(t,e),e=L8e(e,t),e==null||delete e[j8e(D8e(t))]}var N8e=P8e,O8e=_3;function I8e(e){return O8e(e)?void 0:e}var $8e=I8e,F8e=Ty,B8e=S8e,z8e=N8e,U8e=Id,H8e=Od,W8e=$8e,V8e=Ez,q8e=qU,Y8e=1,K8e=2,G8e=4,X8e=V8e(function(e,t){var n={};if(e==null)return n;var r=!1;t=F8e(t,function(s){return s=U8e(s,e),r||(r=s.length>1),s}),H8e(e,q8e(e),n),r&&(n=B8e(n,Y8e|K8e|G8e,W8e));for(var i=t.length;i--;)z8e(n,t[i]);return n}),Q8e=X8e;const XU=bn(Q8e);function xs(){return xs=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},xs.apply(this,arguments)}var LS={dotSize:4,noteWidth:120,noteTextOffset:8,animate:!0},J8e=function(e){var t=typeof e;return C.isValidElement(e)||t==="string"||t==="function"||t==="object"},Z8e=function(e){var t=typeof e;return t==="string"||t==="function"},hp=function(e){return e.type==="circle"},jS=function(e){return e.type==="dot"},fp=function(e){return e.type==="rect"},e7e=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,YAe(t,a.match).map(function(l){var c=r(l),d=i(l);return(hp(a)||fp(a))&&(d.size=d.size+2*o,d.width=d.width+2*o,d.height=d.height+2*o),xs({},XU(a,["match","offset"]),c,d,{size:a.size||d.size,datum:l})}))},[])},t7e=function(e,t,n,r){var i=Math.atan2(r-t,n-e);return IEe(g_(i))},QU=function(e){var t,n,r=e.x,i=e.y,s=e.noteX,a=e.noteY,o=e.noteWidth,l=o===void 0?LS.noteWidth:o,c=e.noteTextOffset,d=c===void 0?LS.noteTextOffset:c;if(LD(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(LD(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 u=r,f=i,g=t7e(r,i,t,n);if(hp(e)){var x=ol(ii(g),e.size/2);u+=x.x,f+=x.y}if(fp(e)){var _=Math.round((g+90)/45)%8;_===0&&(f-=e.height/2),_===1&&(u+=e.width/2,f-=e.height/2),_===2&&(u+=e.width/2),_===3&&(u+=e.width/2,f+=e.height/2),_===4&&(f+=e.height/2),_===5&&(u-=e.width/2,f+=e.height/2),_===6&&(u-=e.width/2),_===7&&(u-=e.width/2,f-=e.height/2)}var v=t,p=t;return(g+90)%360>180?(v-=l,p-=l):p+=l,{points:[[u,f],[t,n],[p,n]],text:[v,n-d],angle:g+90}},JU=function(e){var t=e.data,n=e.annotations,r=e.getPosition,i=e.getDimensions;return C.useMemo(function(){return e7e({data:t,annotations:n,getPosition:r,getDimensions:i})},[t,n,r,i])},n7e=function(e){var t=e.annotations;return C.useMemo(function(){return t.map(function(n){return xs({},n,{computed:QU(xs({},n))})})},[t])},r7e=function(e){return C.useMemo(function(){return QU(e)},[e])},i7e=function(e){var t=e.datum,n=e.x,r=e.y,i=e.note,s=Yt(),a=Tr(),o=a.animate,l=a.config,c=lo({x:n,y:r,config:l,immediate:!o});return typeof i=="function"?C.createElement(i,{x:n,y:r,datum:t}):h.jsxs(h.Fragment,{children:[s.annotations.text.outlineWidth>0&&h.jsx(kt.text,{x:c.x,y:c.y,style:xs({},s.annotations.text,{strokeLinejoin:"round",strokeWidth:2*s.annotations.text.outlineWidth,stroke:s.annotations.text.outlineColor}),children:i}),h.jsx(kt.text,{x:c.x,y:c.y,style:XU(s.annotations.text,["outlineWidth","outlineColor"]),children:i})]})},BD=function(e){var t=e.points,n=e.isOutline,r=n!==void 0&&n,i=Yt(),s=C.useMemo(function(){var l=t[0];return t.slice(1).reduce(function(c,d){return c+" L"+d[0]+","+d[1]},"M"+l[0]+","+l[1])},[t]),a=CEe(s);if(r&&i.annotations.link.outlineWidth<=0)return null;var o=xs({},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),h.jsx(kt.path,{fill:"none",d:a,style:o})},s7e=function(e){var t=e.x,n=e.y,r=e.size,i=Yt(),s=Tr(),a=s.animate,o=s.config,l=lo({x:t,y:n,radius:r/2,config:o,immediate:!a});return h.jsxs(h.Fragment,{children:[i.annotations.outline.outlineWidth>0&&h.jsx(kt.circle,{cx:l.x,cy:l.y,r:l.radius,style:xs({},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})}),h.jsx(kt.circle,{cx:l.x,cy:l.y,r:l.radius,style:i.annotations.outline})]})},o7e=function(e){var t=e.x,n=e.y,r=e.size,i=r===void 0?LS.dotSize:r,s=Yt(),a=Tr(),o=a.animate,l=a.config,c=lo({x:t,y:n,radius:i/2,config:l,immediate:!o});return h.jsxs(h.Fragment,{children:[s.annotations.outline.outlineWidth>0&&h.jsx(kt.circle,{cx:c.x,cy:c.y,r:c.radius,style:xs({},s.annotations.outline,{fill:"none",strokeWidth:2*s.annotations.outline.outlineWidth,stroke:s.annotations.outline.outlineColor,opacity:s.annotations.outline.outlineOpacity})}),h.jsx(kt.circle,{cx:c.x,cy:c.y,r:c.radius,style:s.annotations.symbol})]})},a7e=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=Yt(),l=Tr(),c=l.animate,d=l.config,u=lo({x:t-r/2,y:n-i/2,width:r,height:i,config:d,immediate:!c});return h.jsxs(h.Fragment,{children:[o.annotations.outline.outlineWidth>0&&h.jsx(kt.rect,{x:u.x,y:u.y,rx:a,ry:a,width:u.width,height:u.height,style:xs({},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})}),h.jsx(kt.rect,{x:u.x,y:u.y,rx:a,ry:a,width:u.width,height:u.height,style:o.annotations.outline})]})},l7e=function(e){var t=e.datum,n=e.x,r=e.y,i=e.note,s=r7e(e);if(!J8e(i))throw new Error("note should be a valid react element");return h.jsxs(h.Fragment,{children:[h.jsx(BD,{points:s.points,isOutline:!0}),hp(e)&&h.jsx(s7e,{x:n,y:r,size:e.size}),jS(e)&&h.jsx(o7e,{x:n,y:r,size:e.size}),fp(e)&&h.jsx(a7e,{x:n,y:r,width:e.width,height:e.height,borderRadius:e.borderRadius}),h.jsx(BD,{points:s.points}),h.jsx(i7e,{datum:t,x:s.text[0],y:s.text[1],note:i})]})},zD=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)})},c7e=function(e,t){var n=t.annotations,r=t.theme;n.length!==0&&(e.save(),n.forEach(function(i){if(!Z8e(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(),zD(e,i.computed.points),e.stroke(),e.lineCap="butt"),hp(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()),jS(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()),fp(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(),zD(e,i.computed.points),e.stroke(),hp(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()),jS(i)&&(e.fillStyle=r.annotations.symbol.fill,e.beginPath(),e.arc(i.x,i.y,i.size/2,0,2*Math.PI),e.fill()),fp(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 $v(){return $v=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},$v.apply(this,arguments)}function UD(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 u7e(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 UD(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)?UD(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 ZU={nivo:["#e8c1a0","#f47560","#f1e15b","#e8a838","#61cdbb","#97e3d5"],category10:NB,accent:OB,dark2:IB,paired:$B,pastel1:FB,pastel2:BB,set1:zB,set2:UB,set3:V3,tableau10:S2e},d7e=Object.keys(ZU),eH={brown_blueGreen:Iy,purpleRed_green:$y,pink_yellowGreen:Fy,purple_orange:By,red_blue:zy,red_grey:Uy,red_yellow_blue:Hy,red_yellow_green:Wy,spectral:Vy},h7e=Object.keys(eH),f7e={brown_blueGreen:C2e,purpleRed_green:k2e,pink_yellowGreen:E2e,purple_orange:T2e,red_blue:M2e,red_grey:R2e,red_yellow_blue:A2e,red_yellow_green:HB,spectral:D2e},tH={blues:i_,greens:s_,greys:o_,oranges:c_,purples:a_,reds:l_,blue_green:qy,blue_purple:Yy,green_blue:Ky,orange_red:Gy,purple_blue_green:Xy,purple_blue:Qy,purple_red:Jy,red_purple:Zy,yellow_green_blue:e_,yellow_green:t_,yellow_orange_brown:n_,yellow_orange_red:r_},p7e=Object.keys(tH),m7e={blues:U2e,greens:H2e,greys:W2e,oranges:Y2e,purples:V2e,reds:q2e,turbo:tSe,viridis:YB,inferno:rSe,magma:nSe,plasma:iSe,cividis:K2e,warm:X2e,cool:qB,cubehelixDefault:G2e,blue_green:L2e,blue_purple:j2e,green_blue:P2e,orange_red:N2e,purple_blue_green:O2e,purple_blue:I2e,purple_red:$2e,red_purple:F2e,yellow_green_blue:B2e,yellow_green:WB,yellow_orange_brown:z2e,yellow_orange_red:VB},Lb=$v({},ZU,eH,tH),g7e=function(e){return d7e.includes(e)},v7e=function(e){return h7e.includes(e)},y7e=function(e){return p7e.includes(e)},_7e={rainbow:Q2e,sinebow:eSe};$v({},f7e,m7e,_7e);var x7e=function(e,t){if(typeof e=="function")return e;if(x3(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=to(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 to(l,e.from)};if(Array.isArray(e.modifiers)){for(var i,s=[],a=function(){var l=i.value,c=l[0],d=l[1];if(c==="brighter")s.push(function(u){return u.brighter(d)});else if(c==="darker")s.push(function(u){return u.darker(d)});else{if(c!=="opacity")throw new Error("Invalid color modifier: '"+c+"', must be one of: 'brighter', 'darker', 'opacity'");s.push(function(u){return u.opacity=d,u})}},o=u7e(e.modifiers);!(i=o()).done;)a();return s.length===0?r:function(l){return s.reduce(function(c,d){return d(c)},Fu(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}},Xu=function(e,t){return C.useMemo(function(){return x7e(e,t)},[e,t])};se.oneOfType([se.string,se.func,se.shape({theme:se.string.isRequired}),se.shape({from:se.string.isRequired,modifiers:se.arrayOf(se.array)})]);var b7e=function(e,t){if(typeof e=="function")return e;var n=typeof t=="function"?t:function(u){return to(u,t)};if(Array.isArray(e)){var r=Va(e),i=function(u){return r(n(u))};return i.scale=r,i}if(x3(e)){if(function(u){return u.datum!==void 0}(e))return function(u){return to(u,e.datum)};if(function(u){return u.scheme!==void 0}(e)){if(g7e(e.scheme)){var s=Va(Lb[e.scheme]),a=function(u){return s(n(u))};return a.scale=s,a}if(v7e(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=Va(Lb[e.scheme][e.size||11]),l=function(u){return o(n(u))};return l.scale=o,l}if(y7e(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 c=Va(Lb[e.scheme][e.size||9]),d=function(u){return c(n(u))};return d.scale=c,d}}throw new Error("Invalid colors, when using an object, you should either pass a 'datum' or a 'scheme' property")}return function(){return e}},nH=function(e,t){return C.useMemo(function(){return b7e(e,t)},[e,t])},w7e=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,c=e.borderColor;return h.jsx("circle",{r:r/2,cx:t+r/2,cy:n+r/2,fill:i,opacity:a,strokeWidth:l,stroke:c===void 0?"transparent":c,style:{pointerEvents:"none"}})},S7e=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,c=e.borderColor;return h.jsx("g",{transform:"translate("+t+","+n+")",children:h.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:c===void 0?"transparent":c,style:{pointerEvents:"none"}})})},C7e=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,c=e.borderColor;return h.jsx("rect",{x:t,y:n,fill:i,opacity:a,strokeWidth:l,stroke:c===void 0?"transparent":c,width:r,height:r,style:{pointerEvents:"none"}})},k7e=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,c=e.borderColor;return h.jsx("g",{transform:"translate("+t+","+n+")",children:h.jsx("path",{d:`
                M`+r/2+` 0
                L`+r+" "+r+`
                L0 `+r+`
                L`+r/2+` 0
            `,fill:i,opacity:a,strokeWidth:l,stroke:c===void 0?"transparent":c,style:{pointerEvents:"none"}})})};function Ya(){return Ya=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},Ya.apply(this,arguments)}var E7e={top:0,right:0,bottom:0,left:0},EE=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}:Ya({},E7e,i),c=l.left+l.right,d=l.top+l.bottom,u=a+c,f=o+d,g=(s-1)*r;return n==="row"?u=a*s+g+c:n==="column"&&(f=o*s+g+d),{width:u,height:f,padding:l}},rH=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,c=r;switch(t){case"top":l+=(i-a)/2;break;case"top-right":l+=i-a;break;case"right":l+=i-a,c+=(s-o)/2;break;case"bottom-right":l+=i-a,c+=s-o;break;case"bottom":l+=(i-a)/2,c+=s-o;break;case"bottom-left":c+=s-o;break;case"left":c+=(s-o)/2;break;case"center":l+=(i-a)/2,c+=(s-o)/2}return{x:l,y:c}},iH=function(e){var t,n,r,i,s,a,o=e.direction,l=e.justify,c=e.symbolSize,d=e.symbolSpacing,u=e.width,f=e.height;switch(o){case"left-to-right":t=0,n=(f-c)/2,i=f/2,a="central",l?(r=u,s="end"):(r=c+d,s="start");break;case"right-to-left":t=u-c,n=(f-c)/2,i=f/2,a="central",l?(r=0,s="start"):(r=u-c-d,s="end");break;case"top-to-bottom":t=(u-c)/2,n=0,r=u/2,s="middle",l?(i=f,a="alphabetic"):(i=c+d,a="text-before-edge");break;case"bottom-to-top":t=(u-c)/2,n=f-c,r=u/2,s="middle",l?(i=0,a="text-before-edge"):(i=f-c-d,a="alphabetic")}return{symbolX:t,symbolY:n,labelX:r,labelY:i,labelAnchor:s,labelAlignment:a}},T7e={circle:w7e,diamond:S7e,square:C7e,triangle:k7e},M7e=function(e){var t,n,r,i,s,a,o,l,c,d,u,f=e.x,g=e.y,x=e.width,_=e.height,v=e.data,p=e.direction,m=p===void 0?"left-to-right":p,y=e.justify,b=y!==void 0&&y,S=e.textColor,w=e.background,E=w===void 0?"transparent":w,k=e.opacity,T=k===void 0?1:k,R=e.symbolShape,M=R===void 0?"square":R,L=e.symbolSize,j=L===void 0?16:L,P=e.symbolSpacing,$=P===void 0?8:P,F=e.symbolBorderWidth,W=F===void 0?0:F,I=e.symbolBorderColor,A=I===void 0?"transparent":I,D=e.onClick,H=e.onMouseEnter,V=e.onMouseLeave,U=e.toggleSerie,G=e.effects,ee=C.useState({}),Z=ee[0],q=ee[1],B=Yt(),O=C.useCallback(function(ge){if(G){var we=G.filter(function(ce){return ce.on==="hover"}).reduce(function(ce,re){return Ya({},ce,re.style)},{});q(we)}H==null||H(v,ge)},[H,v,G]),z=C.useCallback(function(ge){if(G){var we=G.filter(function(ce){return ce.on!=="hover"}).reduce(function(ce,re){return Ya({},ce,re.style)},{});q(we)}V==null||V(v,ge)},[V,v,G]),Y=iH({direction:m,justify:b,symbolSize:(t=Z.symbolSize)!=null?t:j,symbolSpacing:$,width:x,height:_}),N=Y.symbolX,J=Y.symbolY,K=Y.labelX,te=Y.labelY,oe=Y.labelAnchor,ae=Y.labelAlignment,_e=[D,H,V,U].some(function(ge){return ge!==void 0}),Se=typeof M=="function"?M:T7e[M];return h.jsxs("g",{transform:"translate("+f+","+g+")",style:{opacity:(n=Z.itemOpacity)!=null?n:T},children:[h.jsx("rect",{width:x,height:_,fill:(r=Z.itemBackground)!=null?r:E,style:{cursor:_e?"pointer":"auto"},onClick:function(ge){D==null||D(v,ge),U==null||U(v.id)},onMouseEnter:O,onMouseLeave:z}),C.createElement(Se,Ya({id:v.id,x:N,y:J,size:(i=Z.symbolSize)!=null?i:j,fill:(s=(a=v.fill)!=null?a:v.color)!=null?s:"black",borderWidth:(o=Z.symbolBorderWidth)!=null?o:W,borderColor:(l=Z.symbolBorderColor)!=null?l:A},v.hidden?B.legends.hidden.symbol:void 0)),h.jsx("text",{textAnchor:oe,style:Ya({},dE(B.legends.text),{fill:(c=(d=(u=Z.itemTextColor)!=null?u:S)!=null?d:B.legends.text.fill)!=null?c:"black",dominantBaseline:ae,pointerEvents:"none",userSelect:"none"},v.hidden?B.legends.hidden.text:void 0),x:K,y:te,children:v.label})]})},R7e=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,c=e.itemWidth,d=e.itemHeight,u=e.itemDirection,f=u===void 0?"left-to-right":u,g=e.itemsSpacing,x=g===void 0?0:g,_=e.itemTextColor,v=e.itemBackground,p=v===void 0?"transparent":v,m=e.itemOpacity,y=m===void 0?1:m,b=e.symbolShape,S=e.symbolSize,w=e.symbolSpacing,E=e.symbolBorderWidth,k=e.symbolBorderColor,T=e.onClick,R=e.onMouseEnter,M=e.onMouseLeave,L=e.toggleSerie,j=EE({itemCount:t.length,itemWidth:c,itemHeight:d,itemsSpacing:x,direction:i,padding:a}).padding,P=i==="row"?c+x:0,$=i==="column"?d+x:0;return h.jsx("g",{transform:"translate("+n+","+r+")",children:t.map(function(F,W){return h.jsx(M7e,{data:F,x:W*P+j.left,y:W*$+j.top,width:c,height:d,direction:f,justify:o,effects:l,textColor:_,background:p,opacity:y,symbolShape:b,symbolSize:S,symbolSpacing:w,symbolBorderWidth:E,symbolBorderColor:k,onClick:T,onMouseEnter:R,onMouseLeave:M,toggleSerie:L},W)})})},sH=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,c=e.direction,d=e.padding,u=d===void 0?0:d,f=e.justify,g=e.itemsSpacing,x=g===void 0?0:g,_=e.itemWidth,v=e.itemHeight,p=e.itemDirection,m=e.itemTextColor,y=e.itemBackground,b=e.itemOpacity,S=e.symbolShape,w=e.symbolSize,E=e.symbolSpacing,k=e.symbolBorderWidth,T=e.symbolBorderColor,R=e.onClick,M=e.onMouseEnter,L=e.onMouseLeave,j=e.toggleSerie,P=e.effects,$=EE({itemCount:t.length,itemsSpacing:x,itemWidth:_,itemHeight:v,direction:c,padding:u}),F=$.width,W=$.height,I=rH({anchor:l,translateX:s,translateY:o,containerWidth:n,containerHeight:r,width:F,height:W}),A=I.x,D=I.y;return h.jsx(R7e,{data:t,x:A,y:D,direction:c,padding:u,justify:f,effects:P,itemsSpacing:x,itemWidth:_,itemHeight:v,itemDirection:p,itemTextColor:m,itemBackground:y,itemOpacity:b,symbolShape:S,symbolSize:w,symbolSpacing:E,symbolBorderWidth:k,symbolBorderColor:T,onClick:R,onMouseEnter:M,onMouseLeave:L,toggleSerie:typeof j=="boolean"?void 0:j})},A7e={start:"left",middle:"center",end:"right"},D7e=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,c=t.anchor,d=t.direction,u=t.padding,f=u===void 0?0:u,g=t.justify,x=g!==void 0&&g,_=t.itemsSpacing,v=_===void 0?0:_,p=t.itemWidth,m=t.itemHeight,y=t.itemDirection,b=y===void 0?"left-to-right":y,S=t.itemTextColor,w=t.symbolSize,E=w===void 0?16:w,k=t.symbolSpacing,T=k===void 0?8:k,R=t.theme,M=EE({itemCount:n.length,itemWidth:p,itemHeight:m,itemsSpacing:v,direction:d,padding:f}),L=M.width,j=M.height,P=M.padding,$=rH({anchor:c,translateX:a,translateY:l,containerWidth:r,containerHeight:i,width:L,height:j}),F=$.x,W=$.y,I=d==="row"?p+v:0,A=d==="column"?m+v:0;e.save(),e.translate(F,W),e.font=R.legends.text.fontSize+"px "+(R.legends.text.fontFamily||"sans-serif"),n.forEach(function(D,H){var V,U,G=H*I+P.left,ee=H*A+P.top,Z=iH({direction:b,justify:x,symbolSize:E,symbolSpacing:T,width:p,height:m}),q=Z.symbolX,B=Z.symbolY,O=Z.labelX,z=Z.labelY,Y=Z.labelAnchor,N=Z.labelAlignment;e.fillStyle=(V=D.color)!=null?V:"black",e.fillRect(G+q,ee+B,E,E),e.textAlign=A7e[Y],N==="central"&&(e.textBaseline="middle"),e.fillStyle=(U=S??R.legends.text.fill)!=null?U:"black",e.fillText(String(D.label),G+O,ee+z)}),e.restore()};function Ct(){return Ct=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},Ct.apply(this,arguments)}function zd(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 HD,L7e=function(e){var t=e.bars,n=e.annotations,r=JU({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 h.jsx(h.Fragment,{children:r.map(function(i,s){return h.jsx(l7e,Ct({},i),s)})})},j7e=function(e){var t=e.width,n=e.height,r=e.legends,i=e.toggleSerie;return h.jsx(h.Fragment,{children:r.map(function(s,a){var o,l=s[0],c=s[1];return h.jsx(sH,Ct({},l,{containerWidth:t,containerHeight:n,data:(o=l.data)!=null?o:c,toggleSerie:l.toggleSerie&&l.dataFrom==="keys"?i:void 0}),a)})})},P7e=["data"],N7e=function(e){var t,n=e.bar,r=n.data,i=zd(n,P7e),s=e.style,a=s.borderColor,o=s.color,l=s.height,c=s.labelColor,d=s.labelOpacity,u=s.labelX,f=s.labelY,g=s.transform,x=s.width,_=e.borderRadius,v=e.borderWidth,p=e.label,m=e.shouldRenderLabel,y=e.isInteractive,b=e.onClick,S=e.onMouseEnter,w=e.onMouseLeave,E=e.tooltip,k=e.isFocusable,T=e.ariaLabel,R=e.ariaLabelledBy,M=e.ariaDescribedBy,L=Yt(),j=d3(),P=j.showTooltipFromEvent,$=j.showTooltipAt,F=j.hideTooltip,W=C.useMemo(function(){return function(){return C.createElement(E,Ct({},i,r))}},[E,i,r]),I=C.useCallback(function(G){b==null||b(Ct({color:i.color},r),G)},[i,r,b]),A=C.useCallback(function(G){return P(W(),G)},[P,W]),D=C.useCallback(function(G){S==null||S(r,G),P(W(),G)},[r,S,P,W]),H=C.useCallback(function(G){w==null||w(r,G),F()},[r,F,w]),V=C.useCallback(function(){$(W(),[i.absX+i.width/2,i.absY])},[$,W,i]),U=C.useCallback(function(){F()},[F]);return h.jsxs(kt.g,{transform:g,children:[h.jsx(kt.rect,{width:va(x,function(G){return Math.max(G,0)}),height:va(l,function(G){return Math.max(G,0)}),rx:_,ry:_,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":R?R(r):void 0,"aria-describedby":M?M(r):void 0,onMouseEnter:y?D:void 0,onMouseMove:y?A:void 0,onMouseLeave:y?H:void 0,onClick:y?I:void 0,onFocus:y&&k?V:void 0,onBlur:y&&k?U:void 0}),m&&h.jsx(kt.text,{x:u,y:f,textAnchor:"middle",dominantBaseline:"central",fillOpacity:d,style:Ct({},L.labels.text,{pointerEvents:"none",fill:c}),children:p})]})},O7e=["color","label"],I7e=function(e){var t=e.color,n=e.label,r=zd(e,O7e);return h.jsx(jF,{id:n,value:r.formattedValue,enableChip:!0,color:t})},Tt={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:I7e,tooltipLabel:function(e){return e.id+" - "+e.indexValue},legends:[],initialHiddenIds:[],annotations:[],markers:[],enableTotals:!1,totalsOffset:10},zt=Ct({},Tt,{layers:["grid","axes","bars","totals","markers","legends","annotations"],barComponent:N7e,defs:[],fill:[],animate:!0,motionConfig:"default",role:"img",isFocusable:!1}),On=Ct({},Tt,{layers:["grid","axes","bars","totals","legends","annotations"],pixelRatio:typeof window<"u"&&(HD=window.devicePixelRatio)!=null?HD:1}),oH=function(e,t,n,r,i,s){return kE(r,{all:e.map(t),min:0,max:0},i,s).padding(n)},aH=function(e,t){return e.map(function(n){return Ct({},t.reduce(function(r,i){return r[i]=null,r},{}),n)})},v_=function(e){return Object.keys(e).reduce(function(t,n){return e[n]&&(t[n]=e[n]),t},{})},y_=function(e){return[e,Number(e)]},$7e=["layout","minValue","maxValue","reverse","width","height","padding","innerPadding","valueScale","indexScale","hiddenIds"],TE=function(e,t){return e>t},lH=function(e,t){return e<t},cH=function(e,t){return Array.from(" ".repeat(t-e),function(n,r){return e+r})},F7e=function(e){return TE(e,0)?0:e},B7e=function(e,t,n,r){var i=e.data,s=e.formatValue,a=e.getColor,o=e.getIndex,l=e.getTooltipLabel,c=e.innerPadding,d=c===void 0?0:c,u=e.keys,f=e.xScale,g=e.yScale,x=e.margin,_=n?lH:TE,v=i.map(v_),p=[];return u.forEach(function(m,y){return cH(0,f.domain().length).forEach(function(b){var S,w,E,k=y_(i[b][m]),T=k[0],R=k[1],M=o(i[b]),L=((S=f(M))!=null?S:0)+t*y+d*y,j=_(w=R,0)?(E=g(w))!=null?E:0:r,P=function(F,W){var I;return _(F,0)?r-W:((I=g(F))!=null?I:0)-r}(R,j),$={id:m,value:T===null?T:R,formattedValue:s(R),hidden:!1,index:b,indexValue:M,data:v[b]};p.push({key:m+"."+$.indexValue,index:p.length,data:$,x:L,y:j,absX:x.left+L,absY:x.top+j,width:t,height:P,color:a($),label:l($)})})}),p},z7e=function(e,t,n,r){var i=e.data,s=e.formatValue,a=e.getIndex,o=e.getColor,l=e.getTooltipLabel,c=e.keys,d=e.innerPadding,u=d===void 0?0:d,f=e.xScale,g=e.yScale,x=e.margin,_=n?lH:TE,v=i.map(v_),p=[];return c.forEach(function(m,y){return cH(0,g.domain().length).forEach(function(b){var S,w,E,k=y_(i[b][m]),T=k[0],R=k[1],M=a(i[b]),L=_(w=R,0)?r:(E=f(w))!=null?E:0,j=((S=g(M))!=null?S:0)+t*y+u*y,P=function(F,W){var I;return _(F,0)?((I=f(F))!=null?I:0)-r:r-W}(R,L),$={id:m,value:T===null?T:R,formattedValue:s(R),hidden:!1,index:b,indexValue:M,data:v[b]};p.push({key:m+"."+$.indexValue,index:p.length,data:$,x:L,y:j,absX:x.left+L,absY:x.top+j,width:P,height:t,color:o($),label:l($)})})}),p},U7e=function(e){var t,n,r=e.layout,i=e.minValue,s=e.maxValue,a=e.reverse,o=e.width,l=e.height,c=e.padding,d=c===void 0?0:c,u=e.innerPadding,f=u===void 0?0:u,g=e.valueScale,x=e.indexScale,_=e.hiddenIds,v=_===void 0?[]:_,p=zd(e,$7e),m=p.keys.filter(function(D){return!v.includes(D)}),y=aH(p.data,m),b=r==="vertical"?["y","x",o]:["x","y",l],S=b[0],w=b[1],E=b[2],k=oH(y,p.getIndex,d,x,E,w),T=Ct({max:s,min:i,reverse:a},g),R=T.min==="auto"?F7e:function(D){return D},M=y.reduce(function(D,H){return[].concat(D,m.map(function(V){return H[V]}))},[]).filter(Boolean),L=R(Math.min.apply(Math,M)),j=(n=Math.max.apply(Math,M),isFinite(n)?n:0),P=kE(T,{all:M,min:L,max:j},S==="x"?o:l,S),$=r==="vertical"?[k,P]:[P,k],F=$[0],W=$[1],I=(k.bandwidth()-f*(m.length-1))/m.length,A=[Ct({},p,{data:y,keys:m,innerPadding:f,xScale:F,yScale:W}),I,T.reverse,(t=P(0))!=null?t:0];return{xScale:F,yScale:W,bars:I>0?r==="vertical"?B7e.apply(void 0,A):z7e.apply(void 0,A):[]}},H7e=["data","layout","minValue","maxValue","reverse","width","height","padding","valueScale","indexScale","hiddenIds"],W7e=function e(t){var n;return t.some(Array.isArray)?e((n=[]).concat.apply(n,t)):t},V7e=function(e,t,n){var r=e.formatValue,i=e.getColor,s=e.getIndex,a=e.getTooltipLabel,o=e.innerPadding,l=e.stackedData,c=e.xScale,d=e.yScale,u=e.margin,f=[];return l.forEach(function(g){return c.domain().forEach(function(x,_){var v,p,m=g[_],y=(v=c(s(m.data)))!=null?v:0,b=((p=function(R){return d(R[n?0:1])}(m))!=null?p:0)+.5*o,S=function(R,M){var L;return((L=d(R[n?1:0]))!=null?L:0)-M}(m,b)-o,w=y_(m.data[g.key]),E=w[0],k=w[1],T={id:g.key,value:E===null?E:k,formattedValue:r(k),hidden:!1,index:_,indexValue:x,data:v_(m.data)};f.push({key:g.key+"."+x,index:f.length,data:T,x:y,y:b,absX:u.left+y,absY:u.top+b,width:t,height:S,color:i(T),label:a(T)})})}),f},q7e=function(e,t,n){var r=e.formatValue,i=e.getColor,s=e.getIndex,a=e.getTooltipLabel,o=e.innerPadding,l=e.stackedData,c=e.xScale,d=e.yScale,u=e.margin,f=[];return l.forEach(function(g){return d.domain().forEach(function(x,_){var v,p,m=g[_],y=(v=d(s(m.data)))!=null?v:0,b=((p=function(R){return c(R[n?1:0])}(m))!=null?p:0)+.5*o,S=function(R,M){var L;return((L=c(R[n?0:1]))!=null?L:0)-M}(m,b)-o,w=y_(m.data[g.key]),E=w[0],k=w[1],T={id:g.key,value:E===null?E:k,formattedValue:r(k),hidden:!1,index:_,indexValue:x,data:v_(m.data)};f.push({key:g.key+"."+x,index:f.length,data:T,x:b,y,absX:u.left+b,absY:u.top+y,width:S,height:t,color:i(T),label:a(T)})})}),f},Y7e=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,c=e.padding,d=c===void 0?0:c,u=e.valueScale,f=e.indexScale,g=e.hiddenIds,x=g===void 0?[]:g,_=zd(e,H7e),v=_.keys.filter(function(I){return!x.includes(I)}),p=SCe().keys(v).offset(CCe)(aH(n,v)),m=r==="vertical"?["y","x",o]:["x","y",l],y=m[0],b=m[1],S=m[2],w=oH(n,_.getIndex,d,f,S,b),E=Ct({max:s,min:i,reverse:a},u),k=(t=W7e(p),u.type==="log"?t.filter(function(I){return I!==0}):t),T=Math.min.apply(Math,k),R=Math.max.apply(Math,k),M=kE(E,{all:k,min:T,max:R},y==="x"?o:l,y),L=r==="vertical"?[w,M]:[M,w],j=L[0],P=L[1],$=_.innerPadding>0?_.innerPadding:0,F=w.bandwidth(),W=[Ct({},_,{innerPadding:$,stackedData:p,xScale:j,yScale:P}),F,E.reverse];return{xScale:j,yScale:P,bars:F>0?r==="vertical"?V7e.apply(void 0,W):q7e.apply(void 0,W):[]}},K7e=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=Xz(a??(r==="indexes"?"indexValue":"id"));return r==="indexes"?function(c,d,u){var f=gD(c.map(function(g){var x,_;return{id:(x=g.data.indexValue)!=null?x:"",label:u(g.data),hidden:g.data.hidden,color:(_=g.color)!=null?_:"#000"}}),function(g){return g.id});return d==="horizontal"&&f.reverse(),f}(t,s,l):function(c,d,u,f,g,x){var _=gD(c.map(function(v){var p;return{id:v.data.id,label:x(v.data),hidden:v.data.hidden,color:(p=v.color)!=null?p:"#000"}}),function(v){return v.id});return(d==="vertical"&&f==="stacked"&&u==="column"&&g!==!0||d==="horizontal"&&f==="stacked"&&g===!0)&&_.reverse(),_}(t,s,n,i,o,l)},WD=function(e,t,n){var r=e.get(t)||0;e.set(t,r+n)},G7e=function(e,t,n){var r=e.get(t)||0;e.set(t,r+(n>0?n:0))},X7e=function(e,t,n){var r=e.get(t)||0;e.set(t,Math.max(r,Number(n)))},Q7e=function(e,t){var n=e.get(t)||0;e.set(t,n+1)},uH=function(e){var t=e.indexBy,n=t===void 0?Tt.indexBy:t,r=e.keys,i=r===void 0?Tt.keys:r,s=e.label,a=s===void 0?Tt.label:s,o=e.tooltipLabel,l=o===void 0?Tt.tooltipLabel:o,c=e.valueFormat,d=e.colors,u=d===void 0?Tt.colors:d,f=e.colorBy,g=f===void 0?Tt.colorBy:f,x=e.borderColor,_=x===void 0?Tt.borderColor:x,v=e.labelTextColor,p=v===void 0?Tt.labelTextColor:v,m=e.groupMode,y=m===void 0?Tt.groupMode:m,b=e.layout,S=b===void 0?Tt.layout:b,w=e.reverse,E=w===void 0?Tt.reverse:w,k=e.data,T=e.minValue,R=T===void 0?Tt.minValue:T,M=e.maxValue,L=M===void 0?Tt.maxValue:M,j=e.margin,P=e.width,$=e.height,F=e.padding,W=F===void 0?Tt.padding:F,I=e.innerPadding,A=I===void 0?Tt.innerPadding:I,D=e.valueScale,H=D===void 0?Tt.valueScale:D,V=e.indexScale,U=V===void 0?Tt.indexScale:V,G=e.initialHiddenIds,ee=G===void 0?Tt.initialHiddenIds:G,Z=e.enableLabel,q=Z===void 0?Tt.enableLabel:Z,B=e.labelSkipWidth,O=B===void 0?Tt.labelSkipWidth:B,z=e.labelSkipHeight,Y=z===void 0?Tt.labelSkipHeight:z,N=e.legends,J=N===void 0?Tt.legends:N,K=e.legendLabel,te=e.totalsOffset,oe=te===void 0?Tt.totalsOffset:te,ae=C.useState(ee??[]),_e=ae[0],Se=ae[1],ge=C.useCallback(function(Fe){Se(function(Ie){return Ie.indexOf(Fe)>-1?Ie.filter(function(Ze){return Ze!==Fe}):[].concat(Ie,[Fe])})},[]),we=al(n),ce=al(a),re=al(l),le=p_(c),X=Yt(),ne=nH(u,g),ue=Xu(_,X),de=Xu(p,X),ve=(y==="grouped"?U7e:Y7e)({layout:S,reverse:E,data:k,getIndex:we,keys:i,minValue:R,maxValue:L,width:P,height:$,getColor:ne,padding:W,innerPadding:A,valueScale:H,indexScale:U,hiddenIds:_e,formatValue:le,getTooltipLabel:re,margin:j}),Te=ve.bars,be=ve.xScale,xe=ve.yScale,Xe=C.useMemo(function(){return Te.filter(function(Fe){return Fe.data.value!==null}).map(function(Fe,Ie){return Ct({},Fe,{index:Ie})})},[Te]),Oe=C.useCallback(function(Fe){var Ie=Fe.width,Ze=Fe.height;return!!q&&!(O>0&&Ie<O)&&!(Y>0&&Ze<Y)},[q,O,Y]),Re=C.useMemo(function(){return i.map(function(Fe){var Ie=Te.find(function(Ze){return Ze.data.id===Fe});return Ct({},Ie,{data:Ct({id:Fe},Ie==null?void 0:Ie.data,{hidden:_e.includes(Fe)})})})},[_e,i,Te]),ze=C.useMemo(function(){return J.map(function(Fe){return[Fe,K7e({bars:Fe.dataFrom==="keys"?Re:Te,direction:Fe.direction,from:Fe.dataFrom,groupMode:y,layout:S,legendLabel:K,reverse:E})]})},[J,Re,Te,y,S,K,E]),st=C.useMemo(function(){return function(Fe,Ie,Ze,et,ht,_t,Cn){et===void 0&&(et=Tt.layout),ht===void 0&&(ht=Tt.groupMode);var It=[];if(Fe.length===0)return It;var $t=new Map,tn=Fe[0].width,on=Fe[0].height;if(ht==="stacked"){var Kt=new Map;Fe.forEach(function(ft){var nt=ft.data,Ve=nt.indexValue,xt=nt.value;WD($t,Ve,Number(xt)),G7e(Kt,Ve,Number(xt))}),Kt.forEach(function(ft,nt){var Ve,xt,mn,dn=$t.get(nt)||0;et==="vertical"?(Ve=Ie(nt),xt=Ze(ft),mn=Ze(ft/2)):(Ve=Ie(ft),xt=Ze(nt),mn=Ie(ft/2)),Ve+=et==="vertical"?tn/2:_t,xt+=et==="vertical"?-_t:on/2,It.push({key:"total_"+nt,x:Ve,y:xt,value:dn,formattedValue:Cn(dn),animationOffset:mn})})}else if(ht==="grouped"){var Bn=new Map,kn=new Map;Fe.forEach(function(ft){var nt=ft.data,Ve=nt.indexValue,xt=nt.value;WD($t,Ve,Number(xt)),X7e(Bn,Ve,Number(xt)),Q7e(kn,Ve)}),Bn.forEach(function(ft,nt){var Ve,xt,mn,dn=$t.get(nt)||0,Mr=kn.get(nt);et==="vertical"?(Ve=Ie(nt),xt=Ze(ft),mn=Ze(ft/2)):(Ve=Ie(ft),xt=Ze(nt),mn=Ie(ft/2)),Ve+=et==="vertical"?Mr*tn/2:_t,xt+=et==="vertical"?-_t:Mr*on/2,It.push({key:"total_"+nt,x:Ve,y:xt,value:dn,formattedValue:Cn(dn),animationOffset:mn})})}return It}(Te,be,xe,S,y,oe,le)},[Te,be,xe,S,y,oe,le]);return{bars:Te,barsWithValue:Xe,xScale:be,yScale:xe,getIndex:we,getLabel:ce,getTooltipLabel:re,formatValue:le,getColor:ne,getBorderColor:ue,getLabelColor:de,shouldRenderBarLabel:Oe,hiddenIds:_e,toggleSerie:ge,legendsWithData:ze,barTotals:st}},J7e=function(e){var t=e.data,n=e.springConfig,r=e.animate,i=e.layout,s=i===void 0?zt.layout:i,a=Yt();return Hl(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 h.jsx(kt.text,{x:o.x,y:o.y,fillOpacity:o.labelOpacity,style:Ct({},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)})},Z7e=["isInteractive","animate","motionConfig","theme","renderWrapper"],eLe=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,c=e.reverse,d=e.minValue,u=e.maxValue,f=e.valueScale,g=e.indexScale,x=e.padding,_=e.innerPadding,v=e.axisTop,p=e.axisRight,m=e.axisBottom,y=m===void 0?zt.axisBottom:m,b=e.axisLeft,S=b===void 0?zt.axisLeft:b,w=e.enableGridX,E=w===void 0?zt.enableGridX:w,k=e.enableGridY,T=k===void 0?zt.enableGridY:k,R=e.gridXValues,M=e.gridYValues,L=e.layers,j=L===void 0?zt.layers:L,P=e.barComponent,$=P===void 0?zt.barComponent:P,F=e.enableLabel,W=F===void 0?zt.enableLabel:F,I=e.label,A=e.labelSkipWidth,D=A===void 0?zt.labelSkipWidth:A,H=e.labelSkipHeight,V=H===void 0?zt.labelSkipHeight:H,U=e.labelTextColor,G=e.markers,ee=G===void 0?zt.markers:G,Z=e.colorBy,q=e.colors,B=e.defs,O=B===void 0?zt.defs:B,z=e.fill,Y=z===void 0?zt.fill:z,N=e.borderRadius,J=N===void 0?zt.borderRadius:N,K=e.borderWidth,te=K===void 0?zt.borderWidth:K,oe=e.borderColor,ae=e.annotations,_e=ae===void 0?zt.annotations:ae,Se=e.legendLabel,ge=e.tooltipLabel,we=e.valueFormat,ce=e.isInteractive,re=ce===void 0?zt.isInteractive:ce,le=e.tooltip,X=le===void 0?zt.tooltip:le,ne=e.onClick,ue=e.onMouseEnter,de=e.onMouseLeave,ve=e.legends,Te=e.role,be=Te===void 0?zt.role:Te,xe=e.ariaLabel,Xe=e.ariaLabelledBy,Oe=e.ariaDescribedBy,Re=e.isFocusable,ze=Re===void 0?zt.isFocusable:Re,st=e.barAriaLabel,Fe=e.barAriaLabelledBy,Ie=e.barAriaDescribedBy,Ze=e.initialHiddenIds,et=e.enableTotals,ht=et===void 0?zt.enableTotals:et,_t=e.totalsOffset,Cn=_t===void 0?zt.totalsOffset:_t,It=Tr(),$t=It.animate,tn=It.config,on=uE(s,a,i),Kt=on.outerWidth,Bn=on.outerHeight,kn=on.margin,ft=on.innerWidth,nt=on.innerHeight,Ve=uH({indexBy:n,label:I,tooltipLabel:ge,valueFormat:we,colors:q,colorBy:Z,borderColor:oe,labelTextColor:U,groupMode:o,layout:l,reverse:c,data:t,keys:r,minValue:d,maxValue:u,margin:kn,width:ft,height:nt,padding:x,innerPadding:_,valueScale:f,indexScale:g,enableLabel:W,labelSkipWidth:D,labelSkipHeight:V,legends:ve,legendLabel:Se,initialHiddenIds:Ze,totalsOffset:Cn}),xt=Ve.bars,mn=Ve.barsWithValue,dn=Ve.xScale,Mr=Ve.yScale,ic=Ve.getLabel,je=Ve.getTooltipLabel,Pe=Ve.getBorderColor,lt=Ve.getLabelColor,At=Ve.shouldRenderBarLabel,pt=Ve.toggleSerie,Xt=Ve.legendsWithData,Et=Ve.barTotals,Qt=Hl(mn,{keys:function(Ee){return Ee.key},from:function(Ee){return Ct({borderColor:Pe(Ee),color:Ee.color,height:0,labelColor:lt(Ee),labelOpacity:0,labelX:Ee.width/2,labelY:Ee.height/2,transform:"translate("+Ee.x+", "+(Ee.y+Ee.height)+")",width:Ee.width},l==="vertical"?{}:{height:Ee.height,transform:"translate("+Ee.x+", "+Ee.y+")",width:0})},enter:function(Ee){return{borderColor:Pe(Ee),color:Ee.color,height:Ee.height,labelColor:lt(Ee),labelOpacity:1,labelX:Ee.width/2,labelY:Ee.height/2,transform:"translate("+Ee.x+", "+Ee.y+")",width:Ee.width}},update:function(Ee){return{borderColor:Pe(Ee),color:Ee.color,height:Ee.height,labelColor:lt(Ee),labelOpacity:1,labelX:Ee.width/2,labelY:Ee.height/2,transform:"translate("+Ee.x+", "+Ee.y+")",width:Ee.width}},leave:function(Ee){return Ct({borderColor:Pe(Ee),color:Ee.color,height:0,labelColor:lt(Ee),labelOpacity:0,labelX:Ee.width/2,labelY:0,transform:"translate("+Ee.x+", "+(Ee.y+Ee.height)+")",width:Ee.width},l==="vertical"?{}:{labelX:0,labelY:Ee.height/2,height:Ee.height,transform:"translate("+Ee.x+", "+Ee.y+")",width:0})},config:tn,immediate:!$t,initial:$t?void 0:null}),Ra=C.useMemo(function(){return{borderRadius:J,borderWidth:te,enableLabel:W,isInteractive:re,labelSkipWidth:D,labelSkipHeight:V,onClick:ne,onMouseEnter:ue,onMouseLeave:de,getTooltipLabel:je,tooltip:X,isFocusable:ze,ariaLabel:st,ariaLabelledBy:Fe,ariaDescribedBy:Ie}},[J,te,W,je,re,V,D,ne,ue,de,X,ze,st,Fe,Ie]),sc=Qz(O,xt,Y,{dataKey:"data",targetKey:"data.fill"}),Jn={annotations:null,axes:null,bars:null,grid:null,legends:null,markers:null,totals:null};j.includes("annotations")&&(Jn.annotations=h.jsx(L7e,{bars:xt,annotations:_e},"annotations")),j.includes("axes")&&(Jn.axes=h.jsx(jAe,{xScale:dn,yScale:Mr,width:ft,height:nt,top:v,right:p,bottom:y,left:S},"axes")),j.includes("bars")&&(Jn.bars=h.jsx(C.Fragment,{children:Qt(function(Ee,Ms){return C.createElement($,Ct({},Ra,{bar:Ms,style:Ee,shouldRenderLabel:At(Ms),label:ic(Ms.data)}))})},"bars")),j.includes("grid")&&(Jn.grid=h.jsx(NAe,{width:ft,height:nt,xScale:E?dn:null,yScale:T?Mr:null,xValues:R,yValues:M},"grid")),j.includes("legends")&&(Jn.legends=h.jsx(j7e,{width:ft,height:nt,legends:Xt,toggleSerie:pt},"legends")),j.includes("markers")&&(Jn.markers=h.jsx(HEe,{markers:ee,width:ft,height:nt,xScale:dn,yScale:Mr},"markers")),j.includes("totals")&&ht&&(Jn.totals=h.jsx(J7e,{data:Et,springConfig:tn,animate:$t,layout:l},"totals"));var Vd=C.useMemo(function(){return Ct({},Ra,{margin:kn,width:s,height:a,innerWidth:ft,innerHeight:nt,bars:xt,legendData:Xt,enableLabel:W,xScale:dn,yScale:Mr,tooltip:X,getTooltipLabel:je,onClick:ne,onMouseEnter:ue,onMouseLeave:de})},[Ra,kn,s,a,ft,nt,xt,Xt,W,dn,Mr,X,je,ne,ue,de]);return h.jsx(hE,{width:Kt,height:Bn,margin:kn,defs:sc,role:be,ariaLabel:xe,ariaLabelledBy:Xe,ariaDescribedBy:Oe,isFocusable:ze,children:j.map(function(Ee,Ms){var Nn;return typeof Ee=="function"?h.jsx(C.Fragment,{children:C.createElement(Ee,Vd)},Ms):(Nn=Jn==null?void 0:Jn[Ee])!=null?Nn:null})})},tLe=function(e){var t=e.isInteractive,n=t===void 0?zt.isInteractive:t,r=e.animate,i=r===void 0?zt.animate:r,s=e.motionConfig,a=s===void 0?zt.motionConfig:s,o=e.theme,l=e.renderWrapper,c=zd(e,Z7e);return h.jsx(m_,{animate:i,isInteractive:n,motionConfig:a,renderWrapper:l,theme:o,children:h.jsx(eLe,Ct({isInteractive:n},c))})},nLe=["isInteractive","renderWrapper","theme"],jb=function(e,t,n,r){return e.find(function(i){return WEe(i.x+t.left,i.y+t.top,i.width,i.height,n,r)})},rLe=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,c=e.reverse,d=e.minValue,u=e.maxValue,f=e.valueScale,g=e.indexScale,x=e.padding,_=e.innerPadding,v=e.axisTop,p=e.axisRight,m=e.axisBottom,y=m===void 0?On.axisBottom:m,b=e.axisLeft,S=b===void 0?On.axisLeft:b,w=e.enableGridX,E=w===void 0?On.enableGridX:w,k=e.enableGridY,T=k===void 0?On.enableGridY:k,R=e.gridXValues,M=e.gridYValues,L=e.layers,j=L===void 0?On.layers:L,P=e.renderBar,$=P===void 0?function(je,Pe){var lt=Pe.bar,At=lt.color,pt=lt.height,Xt=lt.width,Et=lt.x,Qt=lt.y,Ra=Pe.borderColor,sc=Pe.borderRadius,Jn=Pe.borderWidth,Vd=Pe.label,Ee=Pe.labelColor,Ms=Pe.shouldRenderLabel;if(je.fillStyle=At,Jn>0&&(je.strokeStyle=Ra,je.lineWidth=Jn),je.beginPath(),sc>0){var Nn=Math.min(sc,pt);je.moveTo(Et+Nn,Qt),je.lineTo(Et+Xt-Nn,Qt),je.quadraticCurveTo(Et+Xt,Qt,Et+Xt,Qt+Nn),je.lineTo(Et+Xt,Qt+pt-Nn),je.quadraticCurveTo(Et+Xt,Qt+pt,Et+Xt-Nn,Qt+pt),je.lineTo(Et+Nn,Qt+pt),je.quadraticCurveTo(Et,Qt+pt,Et,Qt+pt-Nn),je.lineTo(Et,Qt+Nn),je.quadraticCurveTo(Et,Qt,Et+Nn,Qt),je.closePath()}else je.rect(Et,Qt,Xt,pt);je.fill(),Jn>0&&je.stroke(),Ms&&(je.textBaseline="middle",je.textAlign="center",je.fillStyle=Ee,je.fillText(Vd,Et+Xt/2,Qt+pt/2))}:P,F=e.enableLabel,W=F===void 0?On.enableLabel:F,I=e.label,A=e.labelSkipWidth,D=A===void 0?On.labelSkipWidth:A,H=e.labelSkipHeight,V=H===void 0?On.labelSkipHeight:H,U=e.labelTextColor,G=e.colorBy,ee=e.colors,Z=e.borderRadius,q=Z===void 0?On.borderRadius:Z,B=e.borderWidth,O=B===void 0?On.borderWidth:B,z=e.borderColor,Y=e.annotations,N=Y===void 0?On.annotations:Y,J=e.legendLabel,K=e.tooltipLabel,te=e.valueFormat,oe=e.isInteractive,ae=oe===void 0?On.isInteractive:oe,_e=e.tooltip,Se=_e===void 0?On.tooltip:_e,ge=e.onClick,we=e.onMouseEnter,ce=e.onMouseLeave,re=e.legends,le=e.pixelRatio,X=le===void 0?On.pixelRatio:le,ne=e.canvasRef,ue=e.enableTotals,de=ue===void 0?On.enableTotals:ue,ve=e.totalsOffset,Te=ve===void 0?On.totalsOffset:ve,be=C.useRef(null),xe=Yt(),Xe=uE(s,a,i),Oe=Xe.margin,Re=Xe.innerWidth,ze=Xe.innerHeight,st=Xe.outerWidth,Fe=Xe.outerHeight,Ie=uH({indexBy:n,label:I,tooltipLabel:K,valueFormat:te,colors:ee,colorBy:G,borderColor:z,labelTextColor:U,groupMode:o,layout:l,reverse:c,data:t,keys:r,minValue:d,maxValue:u,margin:Oe,width:Re,height:ze,padding:x,innerPadding:_,valueScale:f,indexScale:g,enableLabel:W,labelSkipWidth:D,labelSkipHeight:V,legends:re,legendLabel:J,totalsOffset:Te}),Ze=Ie.bars,et=Ie.barsWithValue,ht=Ie.xScale,_t=Ie.yScale,Cn=Ie.getLabel,It=Ie.getTooltipLabel,$t=Ie.getBorderColor,tn=Ie.getLabelColor,on=Ie.shouldRenderBarLabel,Kt=Ie.legendsWithData,Bn=Ie.barTotals,kn=d3(),ft=kn.showTooltipFromEvent,nt=kn.hideTooltip,Ve=n7e({annotations:JU({data:Ze,annotations:N,getPosition:function(je){return{x:je.x,y:je.y}},getDimensions:function(je){var Pe=je.width,lt=je.height;return{width:Pe,height:lt,size:Math.max(Pe,lt)}}})}),xt=C.useMemo(function(){return{borderRadius:q,borderWidth:O,isInteractive:ae,isFocusable:!1,labelSkipWidth:D,labelSkipHeight:V,margin:Oe,width:s,height:a,innerWidth:Re,innerHeight:ze,bars:Ze,legendData:Kt,enableLabel:W,xScale:ht,yScale:_t,tooltip:Se,getTooltipLabel:It,onClick:ge,onMouseEnter:we,onMouseLeave:ce}},[q,O,ae,D,V,Oe,s,a,Re,ze,Ze,Kt,W,ht,_t,Se,It,ge,we,ce]),mn=p_(te);C.useEffect(function(){var je,Pe=(je=be.current)==null?void 0:je.getContext("2d");be.current&&Pe&&(be.current.width=st*X,be.current.height=Fe*X,Pe.scale(X,X),Pe.fillStyle=xe.background,Pe.fillRect(0,0,st,Fe),Pe.translate(Oe.left,Oe.top),j.forEach(function(lt){lt==="grid"?typeof xe.grid.line.strokeWidth=="number"&&xe.grid.line.strokeWidth>0&&(Pe.lineWidth=xe.grid.line.strokeWidth,Pe.strokeStyle=xe.grid.line.stroke,E&&DD(Pe,{width:Re,height:ze,scale:ht,axis:"x",values:R}),T&&DD(Pe,{width:Re,height:ze,scale:_t,axis:"y",values:M})):lt==="axes"?IAe(Pe,{xScale:ht,yScale:_t,width:Re,height:ze,top:v,right:p,bottom:y,left:S,theme:xe}):lt==="bars"?et.forEach(function(At){$(Pe,{bar:At,borderColor:$t(At),borderRadius:q,borderWidth:O,label:Cn(At.data),labelColor:tn(At),shouldRenderLabel:on(At)})}):lt==="legends"?Kt.forEach(function(At){var pt=At[0],Xt=At[1];D7e(Pe,Ct({},pt,{data:Xt,containerWidth:Re,containerHeight:ze,theme:xe}))}):lt==="annotations"?c7e(Pe,{annotations:Ve,theme:xe}):lt==="totals"&&de?function(At,pt,Xt,Et){Et===void 0&&(Et=On.layout),At.fillStyle=Xt.text.fill,At.font="bold "+Xt.labels.text.fontSize+"px "+Xt.labels.text.fontFamily,At.textBaseline=Et==="vertical"?"alphabetic":"middle",At.textAlign=Et==="vertical"?"center":"start",pt.forEach(function(Qt){At.fillText(Qt.formattedValue,Qt.x,Qt.y)})}(Pe,Bn,xe,l):typeof lt=="function"&&lt(Pe,xt)}),Pe.save())},[y,S,p,v,et,q,O,Ve,E,T,$t,Cn,tn,R,M,o,a,ze,Re,xt,j,l,Kt,Oe.left,Oe.top,Fe,st,X,$,ht,_t,c,on,xe,s,Bn,de,mn]);var dn=C.useCallback(function(je){if(Ze&&be.current){var Pe=_b(be.current,je),lt=Pe[0],At=Pe[1],pt=jb(Ze,Oe,lt,At);pt!==void 0?(ft(C.createElement(Se,Ct({},pt.data,{color:pt.color,label:pt.label,value:Number(pt.data.value)})),je),je.type==="mouseenter"&&(we==null||we(pt.data,je))):nt()}},[nt,Oe,we,Ze,ft,Se]),Mr=C.useCallback(function(je){if(Ze&&be.current){nt();var Pe=_b(be.current,je),lt=Pe[0],At=Pe[1],pt=jb(Ze,Oe,lt,At);pt&&(ce==null||ce(pt.data,je))}},[nt,Oe,ce,Ze]),ic=C.useCallback(function(je){if(Ze&&be.current){var Pe=_b(be.current,je),lt=Pe[0],At=Pe[1],pt=jb(Ze,Oe,lt,At);pt!==void 0&&(ge==null||ge(Ct({},pt.data,{color:pt.color}),je))}},[Oe,ge,Ze]);return h.jsx("canvas",{ref:function(je){be.current=je,ne&&"current"in ne&&(ne.current=je)},width:st*X,height:Fe*X,style:{width:st,height:Fe,cursor:ae?"auto":"normal"},onMouseEnter:ae?dn:void 0,onMouseMove:ae?dn:void 0,onMouseLeave:ae?Mr:void 0,onClick:ae?ic:void 0})},iLe=C.forwardRef(function(e,t){var n=e.isInteractive,r=e.renderWrapper,i=e.theme,s=zd(e,nLe);return h.jsx(m_,{isInteractive:n,renderWrapper:r,theme:i,animate:!1,children:h.jsx(rLe,Ct({},s,{canvasRef:t}))})});C.forwardRef(function(e,t){return h.jsx(zz,{children:function(n){var r=n.width,i=n.height;return h.jsx(iLe,Ct({width:r,height:i},e,{ref:t}))}})});const vf=window.document.documentElement,dH=window.txConsts.customThemes.map(e=>e.name),sLe=window.txConsts.customThemes.map(e=>`theme-${e.name}`),ME=["dark","light"],hH=dH.find(e=>vf.classList.contains(`theme-${e}`))??ME.find(e=>vf.classList.contains(e))??window.txConsts.defaultTheme,fH=e=>{document.cookie=`txAdmin-theme=${e};path=/;SameSite=Lax;max-age=31536000;`},pH=e=>{if(ME.includes(e))return{isInvalid:!1,isDefault:!0,isDarkScheme:e==="dark",lightDarkClass:e,customClass:void 0};if(dH.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}},RE=Je(hH),oLe=Je(e=>{const t=e(RE);return pH(t).isDarkScheme});fH(hH);const PS=(e,t)=>{var l,c;const{isInvalid:n,isDefault:r,isDarkScheme:i,lightDarkClass:s,customClass:a}=pH(t);if(n)throw new Error(`invalid theme ${t}`);vf.classList.remove(...ME,...sLe),vf.classList.add(s),a&&vf.classList.add(a);const o=(c=(l=document.getElementById("legacyPageIframe"))==null?void 0:l.contentDocument)==null?void 0:c.body;o&&(i?o.classList.add("theme--dark"):o.classList.remove("theme--dark")),fH(t),console.log(`Changed theme from '${e}' to '${t}'.`)},mH=()=>{const[e,t]=wr(RE);return{theme:e,setTheme:r=>{r!==e&&(PS(e,r),t(r))}}},aLe=()=>{const e=it(RE);return()=>e(t=>t==="dark"?(PS(t,"light"),"light"):t==="light"?(PS(t,"dark"),"dark"):(console.log("invalid theme",t),t))},__=()=>ut(oLe);var gH=typeof global=="object"&&global&&global.Object===Object&&global,lLe=typeof self=="object"&&self&&self.Object===Object&&self,Es=gH||lLe||Function("return this")(),Qu=Es.Symbol,vH=Object.prototype,cLe=vH.hasOwnProperty,uLe=vH.toString,Th=Qu?Qu.toStringTag:void 0;function dLe(e){var t=cLe.call(e,Th),n=e[Th];try{e[Th]=void 0;var r=!0}catch{}var i=uLe.call(e);return r&&(t?e[Th]=n:delete e[Th]),i}var hLe=Object.prototype,fLe=hLe.toString;function pLe(e){return fLe.call(e)}var mLe="[object Null]",gLe="[object Undefined]",VD=Qu?Qu.toStringTag:void 0;function im(e){return e==null?e===void 0?gLe:mLe:VD&&VD in Object(e)?dLe(e):pLe(e)}function sm(e){return e!=null&&typeof e=="object"}var AE=Array.isArray;function x_(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var vLe="[object AsyncFunction]",yLe="[object Function]",_Le="[object GeneratorFunction]",xLe="[object Proxy]";function yH(e){if(!x_(e))return!1;var t=im(e);return t==yLe||t==_Le||t==vLe||t==xLe}var Pb=Es["__core-js_shared__"],qD=function(){var e=/[^.]+$/.exec(Pb&&Pb.keys&&Pb.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function bLe(e){return!!qD&&qD in e}var wLe=Function.prototype,SLe=wLe.toString;function nc(e){if(e!=null){try{return SLe.call(e)}catch{}try{return e+""}catch{}}return""}var CLe=/[\\^$.*+?()[\]{}|]/g,kLe=/^\[object .+?Constructor\]$/,ELe=Function.prototype,TLe=Object.prototype,MLe=ELe.toString,RLe=TLe.hasOwnProperty,ALe=RegExp("^"+MLe.call(RLe).replace(CLe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function DLe(e){if(!x_(e)||bLe(e))return!1;var t=yH(e)?ALe:kLe;return t.test(nc(e))}function LLe(e,t){return e==null?void 0:e[t]}function rc(e,t){var n=LLe(e,t);return DLe(n)?n:void 0}var NS=rc(Es,"WeakMap"),YD=Object.create,jLe=function(){function e(){}return function(t){if(!x_(t))return{};if(YD)return YD(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),KD=function(){try{var e=rc(Object,"defineProperty");return e({},"",{}),e}catch{}}();function PLe(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var NLe=9007199254740991,OLe=/^(?:0|[1-9]\d*)$/;function ILe(e,t){var n=typeof e;return t=t??NLe,!!t&&(n=="number"||n!="symbol"&&OLe.test(e))&&e>-1&&e%1==0&&e<t}function $Le(e,t,n){t=="__proto__"&&KD?KD(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function _H(e,t){return e===t||e!==e&&t!==t}var FLe=Object.prototype,BLe=FLe.hasOwnProperty;function zLe(e,t,n){var r=e[t];(!(BLe.call(e,t)&&_H(r,n))||n===void 0&&!(t in e))&&$Le(e,t,n)}var ULe=9007199254740991;function xH(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ULe}function HLe(e){return e!=null&&xH(e.length)&&!yH(e)}var WLe=Object.prototype;function bH(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||WLe;return e===n}function VLe(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var qLe="[object Arguments]";function GD(e){return sm(e)&&im(e)==qLe}var wH=Object.prototype,YLe=wH.hasOwnProperty,KLe=wH.propertyIsEnumerable,GLe=GD(function(){return arguments}())?GD:function(e){return sm(e)&&YLe.call(e,"callee")&&!KLe.call(e,"callee")};function XLe(){return!1}var SH=typeof exports=="object"&&exports&&!exports.nodeType&&exports,XD=SH&&typeof module=="object"&&module&&!module.nodeType&&module,QLe=XD&&XD.exports===SH,QD=QLe?Es.Buffer:void 0,JLe=QD?QD.isBuffer:void 0,CH=JLe||XLe,ZLe="[object Arguments]",eje="[object Array]",tje="[object Boolean]",nje="[object Date]",rje="[object Error]",ije="[object Function]",sje="[object Map]",oje="[object Number]",aje="[object Object]",lje="[object RegExp]",cje="[object Set]",uje="[object String]",dje="[object WeakMap]",hje="[object ArrayBuffer]",fje="[object DataView]",pje="[object Float32Array]",mje="[object Float64Array]",gje="[object Int8Array]",vje="[object Int16Array]",yje="[object Int32Array]",_je="[object Uint8Array]",xje="[object Uint8ClampedArray]",bje="[object Uint16Array]",wje="[object Uint32Array]",Ht={};Ht[pje]=Ht[mje]=Ht[gje]=Ht[vje]=Ht[yje]=Ht[_je]=Ht[xje]=Ht[bje]=Ht[wje]=!0;Ht[ZLe]=Ht[eje]=Ht[hje]=Ht[tje]=Ht[fje]=Ht[nje]=Ht[rje]=Ht[ije]=Ht[sje]=Ht[oje]=Ht[aje]=Ht[lje]=Ht[cje]=Ht[uje]=Ht[dje]=!1;function Sje(e){return sm(e)&&xH(e.length)&&!!Ht[im(e)]}function DE(e){return function(t){return e(t)}}var kH=typeof exports=="object"&&exports&&!exports.nodeType&&exports,yf=kH&&typeof module=="object"&&module&&!module.nodeType&&module,Cje=yf&&yf.exports===kH,Nb=Cje&&gH.process,Ju=function(){try{var e=yf&&yf.require&&yf.require("util").types;return e||Nb&&Nb.binding&&Nb.binding("util")}catch{}}(),JD=Ju&&Ju.isTypedArray,kje=JD?DE(JD):Sje,Eje=Object.prototype,Tje=Eje.hasOwnProperty;function Mje(e,t){var n=AE(e),r=!n&&GLe(e),i=!n&&!r&&CH(e),s=!n&&!r&&!i&&kje(e),a=n||r||i||s,o=a?VLe(e.length,String):[],l=o.length;for(var c in e)Tje.call(e,c)&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||ILe(c,l)))&&o.push(c);return o}function EH(e,t){return function(n){return e(t(n))}}var Rje=EH(Object.keys,Object),Aje=Object.prototype,Dje=Aje.hasOwnProperty;function Lje(e){if(!bH(e))return Rje(e);var t=[];for(var n in Object(e))Dje.call(e,n)&&n!="constructor"&&t.push(n);return t}function jje(e){return HLe(e)?Mje(e):Lje(e)}var pp=rc(Object,"create");function Pje(){this.__data__=pp?pp(null):{},this.size=0}function Nje(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Oje="__lodash_hash_undefined__",Ije=Object.prototype,$je=Ije.hasOwnProperty;function Fje(e){var t=this.__data__;if(pp){var n=t[e];return n===Oje?void 0:n}return $je.call(t,e)?t[e]:void 0}var Bje=Object.prototype,zje=Bje.hasOwnProperty;function Uje(e){var t=this.__data__;return pp?t[e]!==void 0:zje.call(t,e)}var Hje="__lodash_hash_undefined__";function Wje(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=pp&&t===void 0?Hje:t,this}function Al(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])}}Al.prototype.clear=Pje;Al.prototype.delete=Nje;Al.prototype.get=Fje;Al.prototype.has=Uje;Al.prototype.set=Wje;function Vje(){this.__data__=[],this.size=0}function b_(e,t){for(var n=e.length;n--;)if(_H(e[n][0],t))return n;return-1}var qje=Array.prototype,Yje=qje.splice;function Kje(e){var t=this.__data__,n=b_(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Yje.call(t,n,1),--this.size,!0}function Gje(e){var t=this.__data__,n=b_(t,e);return n<0?void 0:t[n][1]}function Xje(e){return b_(this.__data__,e)>-1}function Qje(e,t){var n=this.__data__,r=b_(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function fo(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])}}fo.prototype.clear=Vje;fo.prototype.delete=Kje;fo.prototype.get=Gje;fo.prototype.has=Xje;fo.prototype.set=Qje;var mp=rc(Es,"Map");function Jje(){this.size=0,this.__data__={hash:new Al,map:new(mp||fo),string:new Al}}function Zje(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function w_(e,t){var n=e.__data__;return Zje(t)?n[typeof t=="string"?"string":"hash"]:n.map}function ePe(e){var t=w_(this,e).delete(e);return this.size-=t?1:0,t}function tPe(e){return w_(this,e).get(e)}function nPe(e){return w_(this,e).has(e)}function rPe(e,t){var n=w_(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Ud(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])}}Ud.prototype.clear=Jje;Ud.prototype.delete=ePe;Ud.prototype.get=tPe;Ud.prototype.has=nPe;Ud.prototype.set=rPe;function iPe(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var sPe=EH(Object.getPrototypeOf,Object);function oPe(){this.__data__=new fo,this.size=0}function aPe(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function lPe(e){return this.__data__.get(e)}function cPe(e){return this.__data__.has(e)}var uPe=200;function dPe(e,t){var n=this.__data__;if(n instanceof fo){var r=n.__data__;if(!mp||r.length<uPe-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ud(r)}return n.set(e,t),this.size=n.size,this}function Hd(e){var t=this.__data__=new fo(e);this.size=t.size}Hd.prototype.clear=oPe;Hd.prototype.delete=aPe;Hd.prototype.get=lPe;Hd.prototype.has=cPe;Hd.prototype.set=dPe;var TH=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ZD=TH&&typeof module=="object"&&module&&!module.nodeType&&module,hPe=ZD&&ZD.exports===TH,e8=hPe?Es.Buffer:void 0;e8&&e8.allocUnsafe;function fPe(e,t){return e.slice()}function pPe(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}function mPe(){return[]}var gPe=Object.prototype,vPe=gPe.propertyIsEnumerable,t8=Object.getOwnPropertySymbols,yPe=t8?function(e){return e==null?[]:(e=Object(e),pPe(t8(e),function(t){return vPe.call(e,t)}))}:mPe;function _Pe(e,t,n){var r=t(e);return AE(e)?r:iPe(r,n(e))}function xPe(e){return _Pe(e,jje,yPe)}var OS=rc(Es,"DataView"),IS=rc(Es,"Promise"),$S=rc(Es,"Set"),n8="[object Map]",bPe="[object Object]",r8="[object Promise]",i8="[object Set]",s8="[object WeakMap]",o8="[object DataView]",wPe=nc(OS),SPe=nc(mp),CPe=nc(IS),kPe=nc($S),EPe=nc(NS),Os=im;(OS&&Os(new OS(new ArrayBuffer(1)))!=o8||mp&&Os(new mp)!=n8||IS&&Os(IS.resolve())!=r8||$S&&Os(new $S)!=i8||NS&&Os(new NS)!=s8)&&(Os=function(e){var t=im(e),n=t==bPe?e.constructor:void 0,r=n?nc(n):"";if(r)switch(r){case wPe:return o8;case SPe:return n8;case CPe:return r8;case kPe:return i8;case EPe:return s8}return t});var TPe=Object.prototype,MPe=TPe.hasOwnProperty;function RPe(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&MPe.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var a8=Es.Uint8Array;function LE(e){var t=new e.constructor(e.byteLength);return new a8(t).set(new a8(e)),t}function APe(e,t){var n=LE(e.buffer);return new e.constructor(n,e.byteOffset,e.byteLength)}var DPe=/\w*$/;function LPe(e){var t=new e.constructor(e.source,DPe.exec(e));return t.lastIndex=e.lastIndex,t}var l8=Qu?Qu.prototype:void 0,c8=l8?l8.valueOf:void 0;function jPe(e){return c8?Object(c8.call(e)):{}}function PPe(e,t){var n=LE(e.buffer);return new e.constructor(n,e.byteOffset,e.length)}var NPe="[object Boolean]",OPe="[object Date]",IPe="[object Map]",$Pe="[object Number]",FPe="[object RegExp]",BPe="[object Set]",zPe="[object String]",UPe="[object Symbol]",HPe="[object ArrayBuffer]",WPe="[object DataView]",VPe="[object Float32Array]",qPe="[object Float64Array]",YPe="[object Int8Array]",KPe="[object Int16Array]",GPe="[object Int32Array]",XPe="[object Uint8Array]",QPe="[object Uint8ClampedArray]",JPe="[object Uint16Array]",ZPe="[object Uint32Array]";function eNe(e,t,n){var r=e.constructor;switch(t){case HPe:return LE(e);case NPe:case OPe:return new r(+e);case WPe:return APe(e);case VPe:case qPe:case YPe:case KPe:case GPe:case XPe:case QPe:case JPe:case ZPe:return PPe(e);case IPe:return new r;case $Pe:case zPe:return new r(e);case FPe:return LPe(e);case BPe:return new r;case UPe:return jPe(e)}}function tNe(e){return typeof e.constructor=="function"&&!bH(e)?jLe(sPe(e)):{}}var nNe="[object Map]";function rNe(e){return sm(e)&&Os(e)==nNe}var u8=Ju&&Ju.isMap,iNe=u8?DE(u8):rNe,sNe="[object Set]";function oNe(e){return sm(e)&&Os(e)==sNe}var d8=Ju&&Ju.isSet,aNe=d8?DE(d8):oNe,MH="[object Arguments]",lNe="[object Array]",cNe="[object Boolean]",uNe="[object Date]",dNe="[object Error]",RH="[object Function]",hNe="[object GeneratorFunction]",fNe="[object Map]",pNe="[object Number]",AH="[object Object]",mNe="[object RegExp]",gNe="[object Set]",vNe="[object String]",yNe="[object Symbol]",_Ne="[object WeakMap]",xNe="[object ArrayBuffer]",bNe="[object DataView]",wNe="[object Float32Array]",SNe="[object Float64Array]",CNe="[object Int8Array]",kNe="[object Int16Array]",ENe="[object Int32Array]",TNe="[object Uint8Array]",MNe="[object Uint8ClampedArray]",RNe="[object Uint16Array]",ANe="[object Uint32Array]",Lt={};Lt[MH]=Lt[lNe]=Lt[xNe]=Lt[bNe]=Lt[cNe]=Lt[uNe]=Lt[wNe]=Lt[SNe]=Lt[CNe]=Lt[kNe]=Lt[ENe]=Lt[fNe]=Lt[pNe]=Lt[AH]=Lt[mNe]=Lt[gNe]=Lt[vNe]=Lt[yNe]=Lt[TNe]=Lt[MNe]=Lt[RNe]=Lt[ANe]=!0;Lt[dNe]=Lt[RH]=Lt[_Ne]=!1;function Hg(e,t,n,r,i,s){var a;if(a!==void 0)return a;if(!x_(e))return e;var o=AE(e);if(o)a=RPe(e);else{var l=Os(e),c=l==RH||l==hNe;if(CH(e))return fPe(e);if(l==AH||l==MH||c&&!i)a=c?{}:tNe(e);else{if(!Lt[l])return i?e:{};a=eNe(e,l)}}s||(s=new Hd);var d=s.get(e);if(d)return d;s.set(e,a),aNe(e)?e.forEach(function(g){a.add(Hg(g,t,n,g,e,s))}):iNe(e)&&e.forEach(function(g,x){a.set(x,Hg(g,t,n,x,e,s))});var u=xPe,f=o?void 0:u(e);return PLe(f||e,function(g,x){f&&(x=g,g=e[x]),zLe(a,x,Hg(g,t,n,x,e,s))}),a}var DNe=1,LNe=4;function Ia(e){return Hg(e,DNe|LNe)}function jNe(e){return e}var Ob=1,Wg=2,FS=3,qh=4,h8=1e-6;function PNe(e){return"translate("+e+",0)"}function NNe(e){return"translate(0,"+e+")"}function ONe(e){return t=>+e(t)}function INe(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function $Ne(){return!this.__axis}function jE(e,t){var n=[],r=null,i=null,s=6,a=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,c=e===Ob||e===qh?-1:1,d=e===qh||e===Wg?"x":"y",u=e===Ob||e===FS?PNe:NNe;function f(g){var x=r??(t.ticks?t.ticks.apply(t,n):t.domain()),_=i??(t.tickFormat?t.tickFormat.apply(t,n):jNe),v=Math.max(s,0)+o,p=t.range(),m=+p[0]+l,y=+p[p.length-1]+l,b=(t.bandwidth?INe:ONe)(t.copy(),l),S=g.selection?g.selection():g,w=S.selectAll(".domain").data([null]),E=S.selectAll(".tick").data(x,t).order(),k=E.exit(),T=E.enter().append("g").attr("class","tick"),R=E.select("line"),M=E.select("text");w=w.merge(w.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),E=E.merge(T),R=R.merge(T.append("line").attr("stroke","currentColor").attr(d+"2",c*s)),M=M.merge(T.append("text").attr("fill","currentColor").attr(d,c*v).attr("dy",e===Ob?"0em":e===FS?"0.71em":"0.32em")),g!==S&&(w=w.transition(g),E=E.transition(g),R=R.transition(g),M=M.transition(g),k=k.transition(g).attr("opacity",h8).attr("transform",function(L){return isFinite(L=b(L))?u(L+l):this.getAttribute("transform")}),T.attr("opacity",h8).attr("transform",function(L){var j=this.parentNode.__axis;return u((j&&isFinite(j=j(L))?j:b(L))+l)})),k.remove(),w.attr("d",e===qh||e===Wg?a?"M"+c*a+","+m+"H"+l+"V"+y+"H"+c*a:"M"+l+","+m+"V"+y:a?"M"+m+","+c*a+"V"+l+"H"+y+"V"+c*a:"M"+m+","+l+"H"+y),E.attr("opacity",1).attr("transform",function(L){return u(b(L)+l)}),R.attr(d+"2",c*s),M.attr(d,c*v).text(_),S.filter($Ne).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===Wg?"start":e===qh?"end":"middle"),S.each(function(){this.__axis=b})}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 FNe(e){return jE(Wg,e)}function DH(e){return jE(FS,e)}function LH(e){return jE(qh,e)}var BNe={value:()=>{}};function PE(){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 Vg(n)}function Vg(e){this._=e}function zNe(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}})}Vg.prototype=PE.prototype={constructor:Vg,on:function(e,t){var n=this._,r=zNe(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=UNe(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]=f8(n[i],e.name,t);else if(t==null)for(i in n)n[i]=f8(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 Vg(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 UNe(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function f8(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=BNe,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var BS="http://www.w3.org/1999/xhtml";const p8={svg:"http://www.w3.org/2000/svg",xhtml:BS,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function S_(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),p8.hasOwnProperty(t)?{space:p8[t],local:e}:e}function HNe(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===BS&&t.documentElement.namespaceURI===BS?t.createElement(e):t.createElementNS(n,e)}}function WNe(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function jH(e){var t=S_(e);return(t.local?WNe:HNe)(t)}function VNe(){}function NE(e){return e==null?VNe:function(){return this.querySelector(e)}}function qNe(e){typeof e!="function"&&(e=NE(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,c,d=0;d<a;++d)(l=s[d])&&(c=e.call(l,l.__data__,d,s))&&("__data__"in l&&(c.__data__=l.__data__),o[d]=c);return new Br(r,this._parents)}function YNe(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function KNe(){return[]}function PH(e){return e==null?KNe:function(){return this.querySelectorAll(e)}}function GNe(e){return function(){return YNe(e.apply(this,arguments))}}function XNe(e){typeof e=="function"?e=GNe(e):e=PH(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,c=0;c<o;++c)(l=a[c])&&(r.push(e.call(l,l.__data__,c,a)),i.push(l));return new Br(r,i)}function NH(e){return function(){return this.matches(e)}}function OH(e){return function(t){return t.matches(e)}}var QNe=Array.prototype.find;function JNe(e){return function(){return QNe.call(this.children,e)}}function ZNe(){return this.firstElementChild}function eOe(e){return this.select(e==null?ZNe:JNe(typeof e=="function"?e:OH(e)))}var tOe=Array.prototype.filter;function nOe(){return Array.from(this.children)}function rOe(e){return function(){return tOe.call(this.children,e)}}function iOe(e){return this.selectAll(e==null?nOe:rOe(typeof e=="function"?e:OH(e)))}function sOe(e){typeof e!="function"&&(e=NH(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,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&o.push(l);return new Br(r,this._parents)}function IH(e){return new Array(e.length)}function oOe(){return new Br(this._enter||this._groups.map(IH),this._parents)}function Fv(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Fv.prototype={constructor:Fv,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 aOe(e){return function(){return e}}function lOe(e,t,n,r,i,s){for(var a=0,o,l=t.length,c=s.length;a<c;++a)(o=t[a])?(o.__data__=s[a],r[a]=o):n[a]=new Fv(e,s[a]);for(;a<l;++a)(o=t[a])&&(i[a]=o)}function cOe(e,t,n,r,i,s,a){var o,l,c=new Map,d=t.length,u=s.length,f=new Array(d),g;for(o=0;o<d;++o)(l=t[o])&&(f[o]=g=a.call(l,l.__data__,o,t)+"",c.has(g)?i[o]=l:c.set(g,l));for(o=0;o<u;++o)g=a.call(e,s[o],o,s)+"",(l=c.get(g))?(r[o]=l,l.__data__=s[o],c.delete(g)):n[o]=new Fv(e,s[o]);for(o=0;o<d;++o)(l=t[o])&&c.get(f[o])===l&&(i[o]=l)}function uOe(e){return e.__data__}function dOe(e,t){if(!arguments.length)return Array.from(this,uOe);var n=t?cOe:lOe,r=this._parents,i=this._groups;typeof e!="function"&&(e=aOe(e));for(var s=i.length,a=new Array(s),o=new Array(s),l=new Array(s),c=0;c<s;++c){var d=r[c],u=i[c],f=u.length,g=hOe(e.call(d,d&&d.__data__,c,r)),x=g.length,_=o[c]=new Array(x),v=a[c]=new Array(x),p=l[c]=new Array(f);n(d,u,_,v,p,g,t);for(var m=0,y=0,b,S;m<x;++m)if(b=_[m]){for(m>=y&&(y=m+1);!(S=v[y])&&++y<x;);b._next=S||null}}return a=new Br(a,r),a._enter=o,a._exit=l,a}function hOe(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function fOe(){return new Br(this._exit||this._groups.map(IH),this._parents)}function pOe(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 mOe(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 c=n[l],d=r[l],u=c.length,f=o[l]=new Array(u),g,x=0;x<u;++x)(g=c[x]||d[x])&&(f[x]=g);for(;l<i;++l)o[l]=n[l];return new Br(o,this._parents)}function gOe(){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 vOe(e){e||(e=yOe);function t(u,f){return u&&f?e(u.__data__,f.__data__):!u-!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),c,d=0;d<o;++d)(c=a[d])&&(l[d]=c);l.sort(t)}return new Br(i,this._parents).order()}function yOe(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function _Oe(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function xOe(){return Array.from(this)}function bOe(){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 wOe(){let e=0;for(const t of this)++e;return e}function SOe(){return!this.node()}function COe(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 kOe(e){return function(){this.removeAttribute(e)}}function EOe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function TOe(e,t){return function(){this.setAttribute(e,t)}}function MOe(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function ROe(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function AOe(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 DOe(e,t){var n=S_(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?EOe:kOe:typeof t=="function"?n.local?AOe:ROe:n.local?MOe:TOe)(n,t))}function $H(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function LOe(e){return function(){this.style.removeProperty(e)}}function jOe(e,t,n){return function(){this.style.setProperty(e,t,n)}}function POe(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function NOe(e,t,n){return arguments.length>1?this.each((t==null?LOe:typeof t=="function"?POe:jOe)(e,t,n??"")):Zu(this.node(),e)}function Zu(e,t){return e.style.getPropertyValue(t)||$H(e).getComputedStyle(e,null).getPropertyValue(t)}function OOe(e){return function(){delete this[e]}}function IOe(e,t){return function(){this[e]=t}}function $Oe(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function FOe(e,t){return arguments.length>1?this.each((t==null?OOe:typeof t=="function"?$Oe:IOe)(e,t)):this.node()[e]}function FH(e){return e.trim().split(/^|\s+/)}function OE(e){return e.classList||new BH(e)}function BH(e){this._node=e,this._names=FH(e.getAttribute("class")||"")}BH.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 zH(e,t){for(var n=OE(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function UH(e,t){for(var n=OE(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function BOe(e){return function(){zH(this,e)}}function zOe(e){return function(){UH(this,e)}}function UOe(e,t){return function(){(t.apply(this,arguments)?zH:UH)(this,e)}}function HOe(e,t){var n=FH(e+"");if(arguments.length<2){for(var r=OE(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?UOe:t?BOe:zOe)(n,t))}function WOe(){this.textContent=""}function VOe(e){return function(){this.textContent=e}}function qOe(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function YOe(e){return arguments.length?this.each(e==null?WOe:(typeof e=="function"?qOe:VOe)(e)):this.node().textContent}function KOe(){this.innerHTML=""}function GOe(e){return function(){this.innerHTML=e}}function XOe(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function QOe(e){return arguments.length?this.each(e==null?KOe:(typeof e=="function"?XOe:GOe)(e)):this.node().innerHTML}function JOe(){this.nextSibling&&this.parentNode.appendChild(this)}function ZOe(){return this.each(JOe)}function e9e(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function t9e(){return this.each(e9e)}function n9e(e){var t=typeof e=="function"?e:jH(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function r9e(){return null}function i9e(e,t){var n=typeof e=="function"?e:jH(e),r=t==null?r9e:typeof t=="function"?t:NE(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function s9e(){var e=this.parentNode;e&&e.removeChild(this)}function o9e(){return this.each(s9e)}function a9e(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function l9e(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function c9e(e){return this.select(e?l9e:a9e)}function u9e(e){return arguments.length?this.property("__data__",e):this.node().__data__}function d9e(e){return function(t){e.call(this,t,this.__data__)}}function h9e(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 f9e(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 p9e(e,t,n){return function(){var r=this.__on,i,s=d9e(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 m9e(e,t,n){var r=h9e(e+""),i,s=r.length,a;if(arguments.length<2){var o=this.node().__on;if(o){for(var l=0,c=o.length,d;l<c;++l)for(i=0,d=o[l];i<s;++i)if((a=r[i]).type===d.type&&a.name===d.name)return d.value}return}for(o=t?p9e:f9e,i=0;i<s;++i)this.each(o(r[i],t,n));return this}function HH(e,t,n){var r=$H(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 g9e(e,t){return function(){return HH(this,e,t)}}function v9e(e,t){return function(){return HH(this,e,t.apply(this,arguments))}}function y9e(e,t){return this.each((typeof t=="function"?v9e:g9e)(e,t))}function*_9e(){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 WH=[null];function Br(e,t){this._groups=e,this._parents=t}function om(){return new Br([[document.documentElement]],WH)}function x9e(){return this}Br.prototype=om.prototype={constructor:Br,select:qNe,selectAll:XNe,selectChild:eOe,selectChildren:iOe,filter:sOe,data:dOe,enter:oOe,exit:fOe,join:pOe,merge:mOe,selection:x9e,order:gOe,sort:vOe,call:_Oe,nodes:xOe,node:bOe,size:wOe,empty:SOe,each:COe,attr:DOe,style:NOe,property:FOe,classed:HOe,text:YOe,html:QOe,raise:ZOe,lower:t9e,append:n9e,insert:i9e,remove:o9e,clone:c9e,datum:u9e,on:m9e,dispatch:y9e,[Symbol.iterator]:_9e};function nr(e){return typeof e=="string"?new Br([[document.querySelector(e)]],[document.documentElement]):new Br([[e]],WH)}function b9e(e){let t;for(;t=e.sourceEvent;)e=t;return e}function bi(e,t){if(e=b9e(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 zS={capture:!0,passive:!1};function US(e){e.preventDefault(),e.stopImmediatePropagation()}function w9e(e){var t=e.document.documentElement,n=nr(e).on("dragstart.drag",US,zS);"onselectstart"in t?n.on("selectstart.drag",US,zS):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function S9e(e,t){var n=e.document.documentElement,r=nr(e).on("dragstart.drag",null);t&&(r.on("click.drag",US,zS),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 ed=0,Yh=0,Mh=0,VH=1e3,Bv,Kh,zv=0,Dl=0,C_=0,gp=typeof performance=="object"&&performance.now?performance:Date,qH=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function IE(){return Dl||(qH(C9e),Dl=gp.now()+C_)}function C9e(){Dl=0}function Uv(){this._call=this._time=this._next=null}Uv.prototype=YH.prototype={constructor:Uv,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?IE():+n)+(t==null?0:+t),!this._next&&Kh!==this&&(Kh?Kh._next=this:Bv=this,Kh=this),this._call=e,this._time=n,HS()},stop:function(){this._call&&(this._call=null,this._time=1/0,HS())}};function YH(e,t,n){var r=new Uv;return r.restart(e,t,n),r}function k9e(){IE(),++ed;for(var e=Bv,t;e;)(t=Dl-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ed}function m8(){Dl=(zv=gp.now())+C_,ed=Yh=0;try{k9e()}finally{ed=0,T9e(),Dl=0}}function E9e(){var e=gp.now(),t=e-zv;t>VH&&(C_-=t,zv=e)}function T9e(){for(var e,t=Bv,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:Bv=n);Kh=e,HS(r)}function HS(e){if(!ed){Yh&&(Yh=clearTimeout(Yh));var t=e-Dl;t>24?(e<1/0&&(Yh=setTimeout(m8,e-gp.now()-C_)),Mh&&(Mh=clearInterval(Mh))):(Mh||(zv=gp.now(),Mh=setInterval(E9e,VH)),ed=1,qH(m8))}}function g8(e,t,n){var r=new Uv;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var M9e=PE("start","end","cancel","interrupt"),R9e=[],KH=0,v8=1,WS=2,qg=3,y8=4,VS=5,Yg=6;function k_(e,t,n,r,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;A9e(e,n,{name:t,index:r,group:i,on:M9e,tween:R9e,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:KH})}function $E(e,t){var n=qi(e,t);if(n.state>KH)throw new Error("too late; already scheduled");return n}function Ts(e,t){var n=qi(e,t);if(n.state>qg)throw new Error("too late; already running");return n}function qi(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function A9e(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=YH(s,0,n.time);function s(c){n.state=v8,n.timer.restart(a,n.delay,n.time),n.delay<=c&&a(c-n.delay)}function a(c){var d,u,f,g;if(n.state!==v8)return l();for(d in r)if(g=r[d],g.name===n.name){if(g.state===qg)return g8(a);g.state===y8?(g.state=Yg,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete r[d]):+d<t&&(g.state=Yg,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete r[d])}if(g8(function(){n.state===qg&&(n.state=y8,n.timer.restart(o,n.delay,n.time),o(c))}),n.state=WS,n.on.call("start",e,e.__data__,n.index,n.group),n.state===WS){for(n.state=qg,i=new Array(f=n.tween.length),d=0,u=-1;d<f;++d)(g=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=g);i.length=u+1}}function o(c){for(var d=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=VS,1),u=-1,f=i.length;++u<f;)i[u].call(e,d);n.state===VS&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Yg,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function Kg(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>WS&&r.state<VS,r.state=Yg,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}s&&delete e.__transition}}function D9e(e){return this.each(function(){Kg(this,e)})}function L9e(e,t){var n,r;return function(){var i=Ts(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 j9e(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=Ts(this,e),a=s.tween;if(a!==r){i=(r=a).slice();for(var o={name:t,value:n},l=0,c=i.length;l<c;++l)if(i[l].name===t){i[l]=o;break}l===c&&i.push(o)}s.tween=i}}function P9e(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=qi(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?L9e:j9e)(n,e,t))}function FE(e,t,n){var r=e._id;return e.each(function(){var i=Ts(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return qi(i,r).value[t]}}function GH(e,t){var n;return(typeof t=="number"?Ti:t instanceof no?vv:(n=no(t))?(t=n,vv):R3)(e,t)}function N9e(e){return function(){this.removeAttribute(e)}}function O9e(e){return function(){this.removeAttributeNS(e.space,e.local)}}function I9e(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 $9e(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 F9e(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 B9e(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 z9e(e,t){var n=S_(e),r=n==="transform"?obe:GH;return this.attrTween(e,typeof t=="function"?(n.local?B9e:F9e)(n,r,FE(this,"attr."+e,t)):t==null?(n.local?O9e:N9e)(n):(n.local?$9e:I9e)(n,r,t))}function U9e(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function H9e(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function W9e(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&H9e(e,s)),n}return i._value=t,i}function V9e(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&U9e(e,s)),n}return i._value=t,i}function q9e(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=S_(e);return this.tween(n,(r.local?W9e:V9e)(r,t))}function Y9e(e,t){return function(){$E(this,e).delay=+t.apply(this,arguments)}}function K9e(e,t){return t=+t,function(){$E(this,e).delay=t}}function G9e(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Y9e:K9e)(t,e)):qi(this.node(),t).delay}function X9e(e,t){return function(){Ts(this,e).duration=+t.apply(this,arguments)}}function Q9e(e,t){return t=+t,function(){Ts(this,e).duration=t}}function J9e(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?X9e:Q9e)(t,e)):qi(this.node(),t).duration}function Z9e(e,t){if(typeof t!="function")throw new Error;return function(){Ts(this,e).ease=t}}function eIe(e){var t=this._id;return arguments.length?this.each(Z9e(t,e)):qi(this.node(),t).ease}function tIe(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Ts(this,e).ease=n}}function nIe(e){if(typeof e!="function")throw new Error;return this.each(tIe(this._id,e))}function rIe(e){typeof e!="function"&&(e=NH(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,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&o.push(l);return new oo(r,this._parents,this._name,this._id)}function iIe(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],c=n[o],d=l.length,u=a[o]=new Array(d),f,g=0;g<d;++g)(f=l[g]||c[g])&&(u[g]=f);for(;o<r;++o)a[o]=t[o];return new oo(a,this._parents,this._name,this._id)}function sIe(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 oIe(e,t,n){var r,i,s=sIe(t)?$E:Ts;return function(){var a=s(this,e),o=a.on;o!==r&&(i=(r=o).copy()).on(t,n),a.on=i}}function aIe(e,t){var n=this._id;return arguments.length<2?qi(this.node(),n).on.on(e):this.each(oIe(n,e,t))}function lIe(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function cIe(){return this.on("end.remove",lIe(this._id))}function uIe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=NE(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,c=s[a]=new Array(l),d,u,f=0;f<l;++f)(d=o[f])&&(u=e.call(d,d.__data__,f,o))&&("__data__"in d&&(u.__data__=d.__data__),c[f]=u,k_(c[f],t,n,f,c,qi(d,n)));return new oo(s,this._parents,t,n)}function dIe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=PH(e));for(var r=this._groups,i=r.length,s=[],a=[],o=0;o<i;++o)for(var l=r[o],c=l.length,d,u=0;u<c;++u)if(d=l[u]){for(var f=e.call(d,d.__data__,u,l),g,x=qi(d,n),_=0,v=f.length;_<v;++_)(g=f[_])&&k_(g,t,n,_,f,x);s.push(f),a.push(d)}return new oo(s,a,t,n)}var hIe=om.prototype.constructor;function fIe(){return new hIe(this._groups,this._parents)}function pIe(e,t){var n,r,i;return function(){var s=Zu(this,e),a=(this.style.removeProperty(e),Zu(this,e));return s===a?null:s===n&&a===r?i:i=t(n=s,r=a)}}function XH(e){return function(){this.style.removeProperty(e)}}function mIe(e,t,n){var r,i=n+"",s;return function(){var a=Zu(this,e);return a===i?null:a===r?s:s=t(r=a,n)}}function gIe(e,t,n){var r,i,s;return function(){var a=Zu(this,e),o=n(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),Zu(this,e))),a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o))}}function vIe(e,t){var n,r,i,s="style."+t,a="end."+s,o;return function(){var l=Ts(this,e),c=l.on,d=l.value[s]==null?o||(o=XH(t)):void 0;(c!==n||i!==d)&&(r=(n=c).copy()).on(a,i=d),l.on=r}}function yIe(e,t,n){var r=(e+="")=="transform"?sbe:GH;return t==null?this.styleTween(e,pIe(e,r)).on("end.style."+e,XH(e)):typeof t=="function"?this.styleTween(e,gIe(e,r,FE(this,"style."+e,t))).each(vIe(this._id,e)):this.styleTween(e,mIe(e,r,t),n).on("end.style."+e,null)}function _Ie(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function xIe(e,t,n){var r,i;function s(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&_Ie(e,a,n)),r}return s._value=t,s}function bIe(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,xIe(e,t,n??""))}function wIe(e){return function(){this.textContent=e}}function SIe(e){return function(){var t=e(this);this.textContent=t??""}}function CIe(e){return this.tween("text",typeof e=="function"?SIe(FE(this,"text",e)):wIe(e==null?"":e+""))}function kIe(e){return function(t){this.textContent=e.call(this,t)}}function EIe(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&kIe(i)),t}return r._value=e,r}function TIe(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,EIe(e))}function MIe(){for(var e=this._name,t=this._id,n=QH(),r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],o=a.length,l,c=0;c<o;++c)if(l=a[c]){var d=qi(l,t);k_(l,e,n,c,a,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new oo(r,this._parents,e,n)}function RIe(){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 c=Ts(this,r),d=c.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(o),t._.interrupt.push(o),t._.end.push(l)),c.on=t}),i===0&&s()})}var AIe=0;function oo(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function QH(){return++AIe}var Ds=om.prototype;oo.prototype={constructor:oo,select:uIe,selectAll:dIe,selectChild:Ds.selectChild,selectChildren:Ds.selectChildren,filter:rIe,merge:iIe,selection:fIe,transition:MIe,call:Ds.call,nodes:Ds.nodes,node:Ds.node,size:Ds.size,empty:Ds.empty,each:Ds.each,on:aIe,attr:z9e,attrTween:q9e,style:yIe,styleTween:bIe,text:CIe,textTween:TIe,remove:cIe,tween:P9e,delay:G9e,duration:J9e,ease:eIe,easeVarying:nIe,end:RIe,[Symbol.iterator]:Ds[Symbol.iterator]};function DIe(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var LIe={time:null,delay:0,duration:250,ease:DIe};function jIe(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 PIe(e){var t,n;e instanceof oo?(t=e._id,e=e._name):(t=QH(),(n=LIe).time=IE(),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,c=0;c<o;++c)(l=a[c])&&k_(l,e,t,c,a,n||jIe(l,t));return new oo(r,this._parents,e,t)}om.prototype.interrupt=D9e;om.prototype.transition=PIe;const cg=e=>()=>e;function NIe(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 Hs(e,t,n){this.k=e,this.x=t,this.y=n}Hs.prototype={constructor:Hs,scale:function(e){return e===1?this:new Hs(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Hs(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 JH=new Hs(1,0,0);Hs.prototype;function Ib(e){e.stopImmediatePropagation()}function Rh(e){e.preventDefault(),e.stopImmediatePropagation()}function OIe(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function IIe(){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 _8(){return this.__zoom||JH}function $Ie(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function FIe(){return navigator.maxTouchPoints||"ontouchstart"in this}function BIe(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 zIe(){var e=OIe,t=IIe,n=BIe,r=$Ie,i=FIe,s=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],o=250,l=ube,c=PE("start","zoom","end"),d,u,f,g=500,x=150,_=0,v=10;function p(P){P.property("__zoom",_8).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",T).on("dblclick.zoom",R).filter(i).on("touchstart.zoom",M).on("touchmove.zoom",L).on("touchend.zoom touchcancel.zoom",j).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}p.transform=function(P,$,F,W){var I=P.selection?P.selection():P;I.property("__zoom",_8),P!==I?S(P,$,F,W):I.interrupt().each(function(){w(this,arguments).event(W).start().zoom(null,typeof $=="function"?$.apply(this,arguments):$).end()})},p.scaleBy=function(P,$,F,W){p.scaleTo(P,function(){var I=this.__zoom.k,A=typeof $=="function"?$.apply(this,arguments):$;return I*A},F,W)},p.scaleTo=function(P,$,F,W){p.transform(P,function(){var I=t.apply(this,arguments),A=this.__zoom,D=F==null?b(I):typeof F=="function"?F.apply(this,arguments):F,H=A.invert(D),V=typeof $=="function"?$.apply(this,arguments):$;return n(y(m(A,V),D,H),I,a)},F,W)},p.translateBy=function(P,$,F,W){p.transform(P,function(){return n(this.__zoom.translate(typeof $=="function"?$.apply(this,arguments):$,typeof F=="function"?F.apply(this,arguments):F),t.apply(this,arguments),a)},null,W)},p.translateTo=function(P,$,F,W,I){p.transform(P,function(){var A=t.apply(this,arguments),D=this.__zoom,H=W==null?b(A):typeof W=="function"?W.apply(this,arguments):W;return n(JH.translate(H[0],H[1]).scale(D.k).translate(typeof $=="function"?-$.apply(this,arguments):-$,typeof F=="function"?-F.apply(this,arguments):-F),A,a)},W,I)};function m(P,$){return $=Math.max(s[0],Math.min(s[1],$)),$===P.k?P:new Hs($,P.x,P.y)}function y(P,$,F){var W=$[0]-F[0]*P.k,I=$[1]-F[1]*P.k;return W===P.x&&I===P.y?P:new Hs(P.k,W,I)}function b(P){return[(+P[0][0]+ +P[1][0])/2,(+P[0][1]+ +P[1][1])/2]}function S(P,$,F,W){P.on("start.zoom",function(){w(this,arguments).event(W).start()}).on("interrupt.zoom end.zoom",function(){w(this,arguments).event(W).end()}).tween("zoom",function(){var I=this,A=arguments,D=w(I,A).event(W),H=t.apply(I,A),V=F==null?b(H):typeof F=="function"?F.apply(I,A):F,U=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),G=I.__zoom,ee=typeof $=="function"?$.apply(I,A):$,Z=l(G.invert(V).concat(U/G.k),ee.invert(V).concat(U/ee.k));return function(q){if(q===1)q=ee;else{var B=Z(q),O=U/B[2];q=new Hs(O,V[0]-B[0]*O,V[1]-B[1]*O)}D.zoom(null,q)}})}function w(P,$,F){return!F&&P.__zooming||new E(P,$)}function E(P,$){this.that=P,this.args=$,this.active=0,this.sourceEvent=null,this.extent=t.apply(P,$),this.taps=0}E.prototype={event:function(P){return P&&(this.sourceEvent=P),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(P,$){return this.mouse&&P!=="mouse"&&(this.mouse[1]=$.invert(this.mouse[0])),this.touch0&&P!=="touch"&&(this.touch0[1]=$.invert(this.touch0[0])),this.touch1&&P!=="touch"&&(this.touch1[1]=$.invert(this.touch1[0])),this.that.__zoom=$,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(P){var $=nr(this.that).datum();c.call(P,this.that,new NIe(P,{sourceEvent:this.sourceEvent,target:p,type:P,transform:this.that.__zoom,dispatch:c}),$)}};function k(P,...$){if(!e.apply(this,arguments))return;var F=w(this,$).event(P),W=this.__zoom,I=Math.max(s[0],Math.min(s[1],W.k*Math.pow(2,r.apply(this,arguments)))),A=bi(P);if(F.wheel)(F.mouse[0][0]!==A[0]||F.mouse[0][1]!==A[1])&&(F.mouse[1]=W.invert(F.mouse[0]=A)),clearTimeout(F.wheel);else{if(W.k===I)return;F.mouse=[A,W.invert(A)],Kg(this),F.start()}Rh(P),F.wheel=setTimeout(D,x),F.zoom("mouse",n(y(m(W,I),F.mouse[0],F.mouse[1]),F.extent,a));function D(){F.wheel=null,F.end()}}function T(P,...$){if(f||!e.apply(this,arguments))return;var F=P.currentTarget,W=w(this,$,!0).event(P),I=nr(P.view).on("mousemove.zoom",V,!0).on("mouseup.zoom",U,!0),A=bi(P,F),D=P.clientX,H=P.clientY;w9e(P.view),Ib(P),W.mouse=[A,this.__zoom.invert(A)],Kg(this),W.start();function V(G){if(Rh(G),!W.moved){var ee=G.clientX-D,Z=G.clientY-H;W.moved=ee*ee+Z*Z>_}W.event(G).zoom("mouse",n(y(W.that.__zoom,W.mouse[0]=bi(G,F),W.mouse[1]),W.extent,a))}function U(G){I.on("mousemove.zoom mouseup.zoom",null),S9e(G.view,W.moved),Rh(G),W.event(G).end()}}function R(P,...$){if(e.apply(this,arguments)){var F=this.__zoom,W=bi(P.changedTouches?P.changedTouches[0]:P,this),I=F.invert(W),A=F.k*(P.shiftKey?.5:2),D=n(y(m(F,A),W,I),t.apply(this,$),a);Rh(P),o>0?nr(this).transition().duration(o).call(S,D,W,P):nr(this).call(p.transform,D,W,P)}}function M(P,...$){if(e.apply(this,arguments)){var F=P.touches,W=F.length,I=w(this,$,P.changedTouches.length===W).event(P),A,D,H,V;for(Ib(P),D=0;D<W;++D)H=F[D],V=bi(H,this),V=[V,this.__zoom.invert(V),H.identifier],I.touch0?!I.touch1&&I.touch0[2]!==V[2]&&(I.touch1=V,I.taps=0):(I.touch0=V,A=!0,I.taps=1+!!d);d&&(d=clearTimeout(d)),A&&(I.taps<2&&(u=V[0],d=setTimeout(function(){d=null},g)),Kg(this),I.start())}}function L(P,...$){if(this.__zooming){var F=w(this,$).event(P),W=P.changedTouches,I=W.length,A,D,H,V;for(Rh(P),A=0;A<I;++A)D=W[A],H=bi(D,this),F.touch0&&F.touch0[2]===D.identifier?F.touch0[0]=H:F.touch1&&F.touch1[2]===D.identifier&&(F.touch1[0]=H);if(D=F.that.__zoom,F.touch1){var U=F.touch0[0],G=F.touch0[1],ee=F.touch1[0],Z=F.touch1[1],q=(q=ee[0]-U[0])*q+(q=ee[1]-U[1])*q,B=(B=Z[0]-G[0])*B+(B=Z[1]-G[1])*B;D=m(D,Math.sqrt(q/B)),H=[(U[0]+ee[0])/2,(U[1]+ee[1])/2],V=[(G[0]+Z[0])/2,(G[1]+Z[1])/2]}else if(F.touch0)H=F.touch0[0],V=F.touch0[1];else return;F.zoom("touch",n(y(D,H,V),F.extent,a))}}function j(P,...$){if(this.__zooming){var F=w(this,$).event(P),W=P.changedTouches,I=W.length,A,D;for(Ib(P),f&&clearTimeout(f),f=setTimeout(function(){f=null},g),A=0;A<I;++A)D=W[A],F.touch0&&F.touch0[2]===D.identifier?delete F.touch0:F.touch1&&F.touch1[2]===D.identifier&&delete F.touch1;if(F.touch1&&!F.touch0&&(F.touch0=F.touch1,delete F.touch1),F.touch0)F.touch0[1]=this.__zoom.invert(F.touch0[0]);else if(F.end(),F.taps===2&&(D=bi(D,this),Math.hypot(u[0]-D[0],u[1]-D[1])<v)){var H=nr(this).on("dblclick.zoom");H&&H.apply(this,arguments)}}}return p.wheelDelta=function(P){return arguments.length?(r=typeof P=="function"?P:cg(+P),p):r},p.filter=function(P){return arguments.length?(e=typeof P=="function"?P:cg(!!P),p):e},p.touchable=function(P){return arguments.length?(i=typeof P=="function"?P:cg(!!P),p):i},p.extent=function(P){return arguments.length?(t=typeof P=="function"?P:cg([[+P[0][0],+P[0][1]],[+P[1][0],+P[1][1]]]),p):t},p.scaleExtent=function(P){return arguments.length?(s[0]=+P[0],s[1]=+P[1],p):[s[0],s[1]]},p.translateExtent=function(P){return arguments.length?(a[0][0]=+P[0][0],a[1][0]=+P[1][0],a[0][1]=+P[0][1],a[1][1]=+P[1][1],p):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},p.constrain=function(P){return arguments.length?(n=P,p):n},p.duration=function(P){return arguments.length?(o=+P,p):o},p.interpolate=function(P){return arguments.length?(l=P,p):l},p.on=function(){var P=c.on.apply(c,arguments);return P===c?p:P},p.clickDistance=function(P){return arguments.length?(_=(P=+P)*P,p):Math.sqrt(_)},p.tapDistance=function(P){return arguments.length?(v=+P,p):v},p}const UIe=(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},Gg=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`,ZH=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},eW=(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)},HIe=60*1e3,WIe=15*60*1e3,bc={bootDuration:void 0,closeReason:void 0,log:[]},VIe=(e,t)=>{var a,o;let n,r,i=[],s=Ia(bc);for(const l of e){s===void 0&&(s=Ia(bc));const c=(a=s==null?void 0:s.log)==null?void 0:a.length;if(l.type==="svBoot")c&&(i.push(s),s=Ia(bc)),s.bootTime=new Date(l.ts),s.bootDuration=l.duration;else if(l.type==="svClose")c&&(s.closeTime=new Date(l.ts),s.closeReason=l.reason,i.push(s),s=Ia(bc));else if(l.type==="data"){const d=l.ts-WIe,u=c?s.log.at(-1):void 0;let f=l.ts-HIe;if(u){const _=u.end.getTime();_>=d?f=_:(i.push(s),s=Ia(bc))}else if(s.bootTime){const _=s.bootTime.getTime();_>=d?f=_:s=Ia(bc)}const g=new Date(f),x=new Date(l.ts);n||(n=g),r=x,s.log.push({start:g,end:x,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},qIe=(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 c of o.log)a.push(c.players),!(c.end.getTime()<i)&&(c.start.getTime()<i?s+=c.end.getTime()-i:s+=c.end.getTime()-c.start.getTime());return{uptimePct:n?Math.min(100,s/r*100):void 0,medianPlayerCount:Lbe(a,.5)??0}};function YIe({delay:e,onDebouncedResize:t,children:n}){const r=C.useRef(null),i=C.useRef(null),s=C.useRef(null),a=C.useRef({width:0,height:0});e===void 0&&(e=250);const o=()=>{if(!r.current||!r.current.parentNode)return;const c={width:r.current.clientWidth,height:r.current.clientHeight};a.current=c,t(c),s.current.style.visibility="visible",i.current.style.visibility="hidden"},l=C.useCallback(N5(e,o,{atBegin:!1}),[r]);return C.useEffect(()=>{if(!r.current)return;const c=new ResizeObserver(()=>{const d=r.current.clientHeight,u=r.current.clientWidth;d===0||u===0||a.current.width===u&&a.current.height===d||(a.current.width===0||a.current.height===0?o():(l(),s.current.style.visibility="hidden",i.current.style.visibility="visible"))});return c.observe(r.current),o(),()=>c.disconnect()},[r]),h.jsxs("div",{ref:r,style:{height:"100%",width:"100%",position:"relative"},children:[h.jsx("div",{ref:i,className:"absolute inset-0 flex items-center justify-center",children:h.jsx(cn,{className:"animate-spin size-16 text-muted-foreground"})}),h.jsx("div",{className:"absolute inset-0",ref:s,children:n})]})}const vp=C.memo(YIe),KIe=C.memo(({data:e,minTickIntervalMarker:t,width:n,height:r})=>{const i=__(),s=a=>{var d;const o=((d=e.find((u,f)=>f===a.index-1))==null?void 0:d.bucket)??0,l=a.data.bucket,c=(a.value*100).toFixed()+"%";return h.jsxs("div",{className:"p-3 text-gray-900 bg-white rounded-md shadow-md",children:[h.jsxs("div",{children:["Tick duration: ",h.jsx("strong",{children:Gg(o)})," ~ ",h.jsx("strong",{children:Gg(l)})]}),h.jsxs("div",{children:["Time spent: ",h.jsxs("strong",{children:["~",c]})]}),h.jsxs("div",{children:["Tick count: ",a.data.count]})]})};return t=void 0,!n||!r?null:h.jsx(tLe,{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:Gg},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 GIe(){const[e,t]=C.useState({width:0,height:0}),[n,r]=C.useState("svMain"),i=ut(C1),s=ut(k1),a=$5(),o=C.useMemo(()=>{if(!i||a().isExpired)return null;if(!i.perfBoundaries||!i.perfBucketCounts||!i.perfMinTickTime)return"incomplete";const u=s?s.threadName:n??"svMain",{perfBoundaries:f,perfBucketCounts:g,perfMinTickTime:x}=i,_=x[u],v=UIe(f,_),p=f.findIndex(w=>w===v);let m;p?m=w=>{const E=p+1;return w<=p?WB(1.1-w/E):VB(.25+(w-E)/(f.length-E))}:m=w=>HB(1-(w+1)/f.length);const y=g[u];let b;if(s)b=s.snap.weightedPerf;else{const w=ZH(f);b=eW(y,w)}const S=[];for(let w=0;w<f.length;w++)S.push({bucket:f[w],count:s?0:y[w],value:b[w],color:m(w+1)});return{threadName:u,data:S,minTickIntervalMarker:v,perfBoundaries:f}},[i,s,n]),l=C.useMemo(()=>{const u=a();if(!i||u.isExpired||!i.perfBoundaries||!i.perfBucketCounts||!i.perfMinTickTime)return null;if(s){const f=Ff(s.snap.end,"2-digit","2-digit"),g=Bf(s.snap.end,"short"),x=$0(s.snap.end)?f:`${f} - ${g}`;return h.jsxs(h.Fragment,{children:["(",h.jsx("span",{className:"text-xs text-warning-inline font-mono",children:x}),")"]})}else return u.isStale?"(minutes ago)":"(last minute)"},[i,s]);let c,d=null;return typeof o=="object"&&o!==null?(c=o.threadName,d=h.jsx(KIe,{...o,width:e.width,height:e.height})):typeof o=="string"?d=h.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground text-center",children:h.jsxs("p",{className:"max-w-80",children:["Data not yet available. ",h.jsx("br",{}),"The thread performance chart will appear soon after the server is online."]})}):d=h.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:h.jsx(cn,{className:"animate-spin size-16 text-muted-foreground"})}),h.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:[h.jsxs("div",{className:"px-4 flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[h.jsxs("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:[c??n," performance ",l]}),h.jsxs("div",{className:"flex gap-4",children:[h.jsxs($i,{defaultValue:n,onValueChange:r,disabled:!!s,children:[h.jsx(li,{className:ie("w-32 grow md:grow-0 h-6 px-3 py-1 text-sm",!!s&&"hidden"),children:h.jsx(Fi,{placeholder:"Filter by admin"})}),h.jsxs(ci,{className:"px-0",children:[h.jsx(Ue,{value:"svMain",className:"cursor-pointer",children:"svMain"}),h.jsx(Ue,{value:"svSync",className:"cursor-pointer",children:"svSync"}),h.jsx(Ue,{value:"svNetwork",className:"cursor-pointer",children:"svNetwork"})]})]}),h.jsx("div",{className:"hidden xs:block",children:h.jsx($Q,{})})]})]}),h.jsx(vp,{onDebouncedResize:t,children:d})]})}function Pt(){return Pt=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},Pt.apply(this,arguments)}var XIe={pointerEvents:"none"},QIe=function(e){var t=e.label,n=e.style,r=Yt();return h.jsx(kt.g,{transform:n.transform,opacity:n.progress,style:XIe,children:h.jsx(kt.text,{textAnchor:"middle",dominantBaseline:"central",style:Pt({},r.labels.text,{fill:n.textColor}),children:t})})},tW=function(e){var t=e%(2*Math.PI);return t<0&&(t+=2*Math.PI),t},JIe=function(e,t){return e.filter(function(n){return Math.abs(g_(n.arc.endAngle-n.arc.startAngle))>=t})},ZIe={startAngle:{enter:function(e){return Pt({},e,{endAngle:e.startAngle})},update:function(e){return e},leave:function(e){return Pt({},e,{startAngle:e.endAngle})}},middleAngle:{enter:function(e){var t=e.startAngle+(e.endAngle-e.startAngle)/2;return Pt({},e,{startAngle:t,endAngle:t})},update:function(e){return e},leave:function(e){var t=e.startAngle+(e.endAngle-e.startAngle)/2;return Pt({},e,{startAngle:t,endAngle:t})}},endAngle:{enter:function(e){return Pt({},e,{startAngle:e.endAngle})},update:function(e){return e},leave:function(e){return Pt({},e,{endAngle:e.startAngle})}},innerRadius:{enter:function(e){return Pt({},e,{outerRadius:e.innerRadius})},update:function(e){return e},leave:function(e){return Pt({},e,{innerRadius:e.outerRadius})}},centerRadius:{enter:function(e){var t=e.innerRadius+(e.outerRadius-e.innerRadius)/2;return Pt({},e,{innerRadius:t,outerRadius:t})},update:function(e){return e},leave:function(e){var t=e.innerRadius+(e.outerRadius-e.innerRadius)/2;return Pt({},e,{innerRadius:t,outerRadius:t})}},outerRadius:{enter:function(e){return Pt({},e,{innerRadius:e.outerRadius})},update:function(e){return e},leave:function(e){return Pt({},e,{outerRadius:e.innerRadius})}},pushIn:{enter:function(e){return Pt({},e,{innerRadius:e.innerRadius-e.outerRadius+e.innerRadius,outerRadius:e.innerRadius})},update:function(e){return e},leave:function(e){return Pt({},e,{innerRadius:e.outerRadius,outerRadius:e.outerRadius+e.outerRadius-e.innerRadius})}},pushOut:{enter:function(e){return Pt({},e,{innerRadius:e.outerRadius,outerRadius:e.outerRadius+e.outerRadius-e.innerRadius})},update:function(e){return e},leave:function(e){return Pt({},e,{innerRadius:e.innerRadius-e.outerRadius+e.innerRadius,outerRadius:e.innerRadius})}}},nW=function(e,t){return C.useMemo(function(){var n=ZIe[e];return{enter:function(r){return Pt({progress:0},n.enter(r.arc),t?t.enter(r):{})},update:function(r){return Pt({progress:1},n.update(r.arc),t?t.update(r):{})},leave:function(r){return Pt({progress:0},n.leave(r.arc),t?t.leave(r):{})}}},[e,t])},e$e=function(e,t){var n=OEe(e)-Math.PI/2,r=e.innerRadius+(e.outerRadius-e.innerRadius)*t;return ol(n,r)},t$e=function(e){return function(t,n,r,i){return va([t,n,r,i],function(s,a,o,l){var c=e$e({startAngle:s,endAngle:a,innerRadius:o,outerRadius:l},e);return"translate("+c.x+","+c.y+")"})}},n$e=function(e,t,n,r){t===void 0&&(t=.5),n===void 0&&(n="innerRadius");var i=Tr(),s=i.animate,a=i.config,o=nW(n,r);return{transition:Hl(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:t$e(t)}},r$e=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,c=l===void 0?QIe:l,d=al(i),u=Yt(),f=Xu(o,u),g=C.useMemo(function(){return n.filter(function(m){return Math.abs(g_(m.arc.endAngle-m.arc.startAngle))>=a})},[n,a]),x=n$e(g,s,r),_=x.transition,v=x.interpolate,p=c;return h.jsx("g",{transform:"translate("+t[0]+","+t[1]+")",children:_(function(m,y){return C.createElement(p,{key:y.id,datum:y,label:d(y),style:Pt({},m,{transform:v(m.startAngle,m.endAngle,m.innerRadius,m.outerRadius),textColor:f(y)})})})})},i$e=function(e){var t=e.label,n=e.style,r=Yt();return h.jsxs(kt.g,{opacity:n.opacity,children:[h.jsx(kt.path,{fill:"none",stroke:n.linkColor,strokeWidth:n.thickness,d:n.path}),h.jsx(kt.text,{transform:n.textPosition,textAnchor:n.textAnchor,dominantBaseline:"central",style:Pt({},r.labels.text,{fill:n.textColor}),children:t})]})},s$e=function(e){var t=tW(e.startAngle+(e.endAngle-e.startAngle)/2-Math.PI/2);return t<Math.PI/2||t>1.5*Math.PI?"start":"end"},rW=function(e,t,n,r){var i,s,a=tW(e.startAngle+(e.endAngle-e.startAngle)/2-Math.PI/2),o=ol(a,e.outerRadius+t),l=ol(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]}},o$e=tz().x(function(e){return e.x}).y(function(e){return e.y}),a$e=function(e,t,n,r,i,s,a){return va([e,t,n,r,i,s,a],function(o,l,c,d,u,f,g){var x=rW({startAngle:o,endAngle:l,innerRadius:c,outerRadius:d},u,f,g).points;return o$e(x)})},l$e=function(e,t,n,r){return va([e,t,n,r],function(i,s,a,o){return s$e({startAngle:i,endAngle:s,innerRadius:a,outerRadius:o})})},c$e=function(e,t,n,r,i,s,a,o){return va([e,t,n,r,i,s,a,o],function(l,c,d,u,f,g,x,_){var v=rW({startAngle:l,endAngle:c,innerRadius:d,outerRadius:u},f,g,x),p=v.points,m=v.side,y=p[2];return m==="before"?y.x-=_:y.x+=_,"translate("+y.x+","+y.y+")"})},u$e=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,c=e.linkColor,d=e.textColor,u=Tr(),f=u.animate,g=u.config,x=Yt(),_=Xu(c,x),v=Xu(d,x),p=function(y,b){return C.useMemo(function(){return JIe(y,b)},[y,b])}(t,o),m=function(y){var b=y.offset,S=y.diagonalLength,w=y.straightLength,E=y.textOffset,k=y.getLinkColor,T=y.getTextColor;return C.useMemo(function(){return{enter:function(R){return{startAngle:R.arc.startAngle,endAngle:R.arc.endAngle,innerRadius:R.arc.innerRadius,outerRadius:R.arc.outerRadius,offset:b,diagonalLength:0,straightLength:0,textOffset:E,linkColor:k(R),textColor:T(R),opacity:0}},update:function(R){return{startAngle:R.arc.startAngle,endAngle:R.arc.endAngle,innerRadius:R.arc.innerRadius,outerRadius:R.arc.outerRadius,offset:b,diagonalLength:S,straightLength:w,textOffset:E,linkColor:k(R),textColor:T(R),opacity:1}},leave:function(R){return{startAngle:R.arc.startAngle,endAngle:R.arc.endAngle,innerRadius:R.arc.innerRadius,outerRadius:R.arc.outerRadius,offset:b,diagonalLength:0,straightLength:0,textOffset:E,linkColor:k(R),textColor:T(R),opacity:0}}}},[S,w,E,k,T,b])}({offset:r,diagonalLength:i,straightLength:s,textOffset:l,getLinkColor:_,getTextColor:v});return{transition:Hl(p,{keys:function(y){return y.id},initial:m.update,from:m.enter,enter:m.update,update:m.update,leave:m.leave,config:g,immediate:!f}),interpolateLink:a$e,interpolateTextAnchor:l$e,interpolateTextPosition:c$e}},d$e=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,c=e.textOffset,d=e.textColor,u=e.linkColor,f=e.component,g=f===void 0?i$e:f,x=al(r),_=u$e({data:n,skipAngle:i,offset:s,diagonalLength:a,straightLength:o,textOffset:c,linkColor:u,textColor:d}),v=_.transition,p=_.interpolateLink,m=_.interpolateTextAnchor,y=_.interpolateTextPosition,b=g;return h.jsx("g",{transform:"translate("+t[0]+","+t[1]+")",children:v(function(S,w){return C.createElement(b,{key:w.id,datum:w,label:x(w),style:Pt({},S,{thickness:l,path:p(S.startAngle,S.endAngle,S.innerRadius,S.outerRadius,S.offset,S.diagonalLength,S.straightLength),textAnchor:m(S.startAngle,S.endAngle,S.innerRadius,S.outerRadius),textPosition:y(S.startAngle,S.endAngle,S.innerRadius,S.outerRadius,S.offset,S.diagonalLength,S.straightLength,S.textOffset)})})})})},h$e=function(e){var t=e.datum,n=e.style,r=e.onClick,i=e.onMouseEnter,s=e.onMouseMove,a=e.onMouseLeave,o=C.useCallback(function(u){return r==null?void 0:r(t,u)},[r,t]),l=C.useCallback(function(u){return i==null?void 0:i(t,u)},[i,t]),c=C.useCallback(function(u){return s==null?void 0:s(t,u)},[s,t]),d=C.useCallback(function(u){return a==null?void 0:a(t,u)},[a,t]);return h.jsx(kt.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?c:void 0,onMouseLeave:a?d:void 0})},f$e=function(e,t,n,r,i){return va([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)})})},p$e=function(e,t,n){t===void 0&&(t="innerRadius");var r=Tr(),i=r.animate,s=r.config,a=nW(t,n);return{transition:Hl(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:f$e}},m$e=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,c=e.onMouseLeave,d=e.transitionMode,u=e.component,f=u===void 0?h$e:u,g=Yt(),x=Xu(s,g),_=p$e(n,d,{enter:function(y){return{opacity:0,color:y.color,borderColor:x(y)}},update:function(y){return{opacity:1,color:y.color,borderColor:x(y)}},leave:function(y){return{opacity:0,color:y.color,borderColor:x(y)}}}),v=_.transition,p=_.interpolate,m=f;return h.jsx("g",{transform:"translate("+t[0]+","+t[1]+")",children:v(function(y,b){return C.createElement(m,{key:b.id,datum:b,style:Pt({},y,{borderWidth:i,path:p(y.startAngle,y.endAngle,y.innerRadius,y.outerRadius,r)}),onClick:a,onMouseEnter:o,onMouseMove:l,onMouseLeave:c})})})},g$e=function(e,t,n,r,i,s){s===void 0&&(s=!0);var a=[],o=ol(ii(r),n);a.push([o.x,o.y]);var l=ol(ii(i),n);a.push([l.x,l.y]);for(var c=Math.round(Math.min(r,i));c<=Math.round(Math.max(r,i));c++)if(c%90==0){var d=ol(ii(c),n);a.push([d.x,d.y])}a=a.map(function(v){var p=v[0],m=v[1];return[e+p,t+m]}),s&&a.push([e,t]);var u=a.map(function(v){return v[0]}),f=a.map(function(v){return v[1]}),g=Math.min.apply(Math,u),x=Math.max.apply(Math,u),_=Math.min.apply(Math,f);return{points:a,x:g,y:_,width:x-g,height:Math.max.apply(Math,f)-_}},v$e=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 C.useMemo(function(){return ZSe().innerRadius(function(a){return a.innerRadius}).outerRadius(function(a){return a.outerRadius}).cornerRadius(r).padAngle(s)},[r,s])};function Ll(){return Ll=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},Ll.apply(this,arguments)}function iW(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 x8,y$e=function(e){var t=e.width,n=e.height,r=e.legends,i=e.data,s=e.toggleSerie;return h.jsx(h.Fragment,{children:r.map(function(a,o){var l;return h.jsx(sH,Ll({},a,{containerWidth:t,containerHeight:n,data:(l=a.data)!=null?l:i,toggleSerie:a.toggleSerie?s:void 0}),o)})})},Le={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 h.jsx(jF,{id:t.id,value:t.formattedValue,enableChip:!0,color:t.color})},legends:[],role:"img",pixelRatio:typeof window<"u"&&(x8=window.devicePixelRatio)!=null?x8:1},_$e=["points"],x$e=function(e){var t=e.data,n=e.id,r=n===void 0?Le.id:n,i=e.value,s=i===void 0?Le.value:i,a=e.valueFormat,o=e.colors,l=o===void 0?Le.colors:o,c=al(r),d=al(s),u=p_(a),f=nH(l,"id");return C.useMemo(function(){return t.map(function(g){var x,_=c(g),v=d(g),p={id:_,label:(x=g.label)!=null?x:_,hidden:!1,value:v,formattedValue:u(v),data:g};return Ll({},p,{color:f(p)})})},[t,c,d,u,f])},b$e=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,c=e.activeInnerRadiusOffset,d=e.activeOuterRadiusOffset,u=e.hiddenIds,f=e.forwardLegendData,g=C.useMemo(function(){var p=iCe().value(function(m){return m.value}).startAngle(ii(n)).endAngle(ii(r)).padAngle(ii(a));return o||p.sortValues(null),p},[n,r,a,o]),x=C.useMemo(function(){var p=t.filter(function(m){return!u.includes(m.id)});return{dataWithArc:g(p).map(function(m){var y=Math.abs(m.endAngle-m.startAngle);return Ll({},m.data,{arc:{index:m.index,startAngle:m.startAngle,endAngle:m.endAngle,innerRadius:l===m.data.id?i-c:i,outerRadius:l===m.data.id?s+d:s,thickness:s-i,padAngle:m.padAngle,angle:y,angleDeg:g_(y)}})}),legendData:t.map(function(m){return{id:m.id,label:m.label,color:m.color,hidden:u.includes(m.id),data:m}})}},[g,t,u,l,i,c,s,d]),_=x.legendData,v=C.useRef(f);return C.useEffect(function(){typeof v.current=="function"&&v.current(_)},[v,_]),x},w$e=function(e){var t=e.activeId,n=e.onActiveIdChange,r=e.defaultActiveId,i=t!==void 0,s=C.useState(i||r===void 0?null:r),a=s[0],o=s[1];return{activeId:i?t:a,setActiveId:C.useCallback(function(l){n&&n(l),i||o(l)},[i,n,o])}},S$e=function(e){var t=e.data,n=e.width,r=e.height,i=e.innerRadius,s=i===void 0?Le.innerRadius:i,a=e.startAngle,o=a===void 0?Le.startAngle:a,l=e.endAngle,c=l===void 0?Le.endAngle:l,d=e.padAngle,u=d===void 0?Le.padAngle:d,f=e.sortByValue,g=f===void 0?Le.sortByValue:f,x=e.cornerRadius,_=x===void 0?Le.cornerRadius:x,v=e.fit,p=v===void 0?Le.fit:v,m=e.activeInnerRadiusOffset,y=m===void 0?Le.activeInnerRadiusOffset:m,b=e.activeOuterRadiusOffset,S=b===void 0?Le.activeOuterRadiusOffset:b,w=e.activeId,E=e.onActiveIdChange,k=e.defaultActiveId,T=e.forwardLegendData,R=w$e({activeId:w,onActiveIdChange:E,defaultActiveId:k}),M=R.activeId,L=R.setActiveId,j=C.useState([]),P=j[0],$=j[1],F=C.useMemo(function(){var A,D=Math.min(n,r)/2,H=D*Math.min(s,1),V=n/2,U=r/2;if(p){var G=g$e(V,U,D,o-90,c-90),ee=G.points,Z=iW(G,_$e),q=Math.min(n/Z.width,r/Z.height),B={width:Z.width*q,height:Z.height*q};B.x=(n-B.width)/2,B.y=(r-B.height)/2,V=(V-Z.x)/Z.width*Z.width*q+B.x,U=(U-Z.y)/Z.height*Z.height*q+B.y,A={box:Z,ratio:q,points:ee},D*=q,H*=q}return{centerX:V,centerY:U,radius:D,innerRadius:H,debug:A}},[n,r,s,o,c,p]),W=b$e({data:t,startAngle:o,endAngle:c,innerRadius:F.innerRadius,outerRadius:F.radius,padAngle:u,sortByValue:g,activeId:M,activeInnerRadiusOffset:y,activeOuterRadiusOffset:S,hiddenIds:P,forwardLegendData:T}),I=C.useCallback(function(A){$(function(D){return D.indexOf(A)>-1?D.filter(function(H){return H!==A}):[].concat(D,[A])})},[]);return Ll({arcGenerator:v$e({cornerRadius:_,padAngle:ii(u)}),activeId:M,setActiveId:L,toggleSerie:I},W,F)},C$e=function(e){var t=e.dataWithArc,n=e.arcGenerator,r=e.centerX,i=e.centerY,s=e.radius,a=e.innerRadius;return C.useMemo(function(){return{dataWithArc:t,arcGenerator:n,centerX:r,centerY:i,radius:s,innerRadius:a}},[t,n,r,i,s,a])},k$e=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,c=e.onMouseMove,d=e.onMouseLeave,u=e.setActiveId,f=e.tooltip,g=e.transitionMode,x=d3(),_=x.showTooltipFromEvent,v=x.hideTooltip,p=C.useMemo(function(){if(a)return function(S,w){o==null||o(S,w)}},[a,o]),m=C.useMemo(function(){if(a)return function(S,w){_(C.createElement(f,{datum:S}),w),u(S.id),l==null||l(S,w)}},[a,_,u,l,f]),y=C.useMemo(function(){if(a)return function(S,w){_(C.createElement(f,{datum:S}),w),c==null||c(S,w)}},[a,_,c,f]),b=C.useMemo(function(){if(a)return function(S,w){v(),u(null),d==null||d(S,w)}},[a,v,u,d]);return h.jsx(m$e,{center:t,data:n,arcGenerator:r,borderWidth:i,borderColor:s,transitionMode:g,onClick:p,onMouseEnter:m,onMouseMove:y,onMouseLeave:b})},E$e=["isInteractive","animate","motionConfig","theme","renderWrapper"],T$e=function(e){var t=e.data,n=e.id,r=n===void 0?Le.id:n,i=e.value,s=i===void 0?Le.value:i,a=e.valueFormat,o=e.sortByValue,l=o===void 0?Le.sortByValue:o,c=e.layers,d=c===void 0?Le.layers:c,u=e.startAngle,f=u===void 0?Le.startAngle:u,g=e.endAngle,x=g===void 0?Le.endAngle:g,_=e.padAngle,v=_===void 0?Le.padAngle:_,p=e.fit,m=p===void 0?Le.fit:p,y=e.innerRadius,b=y===void 0?Le.innerRadius:y,S=e.cornerRadius,w=S===void 0?Le.cornerRadius:S,E=e.activeInnerRadiusOffset,k=E===void 0?Le.activeInnerRadiusOffset:E,T=e.activeOuterRadiusOffset,R=T===void 0?Le.activeOuterRadiusOffset:T,M=e.width,L=e.height,j=e.margin,P=e.colors,$=P===void 0?Le.colors:P,F=e.borderWidth,W=F===void 0?Le.borderWidth:F,I=e.borderColor,A=I===void 0?Le.borderColor:I,D=e.enableArcLabels,H=D===void 0?Le.enableArcLabels:D,V=e.arcLabel,U=V===void 0?Le.arcLabel:V,G=e.arcLabelsSkipAngle,ee=G===void 0?Le.arcLabelsSkipAngle:G,Z=e.arcLabelsTextColor,q=Z===void 0?Le.arcLabelsTextColor:Z,B=e.arcLabelsRadiusOffset,O=B===void 0?Le.arcLabelsRadiusOffset:B,z=e.arcLabelsComponent,Y=e.enableArcLinkLabels,N=Y===void 0?Le.enableArcLinkLabels:Y,J=e.arcLinkLabel,K=J===void 0?Le.arcLinkLabel:J,te=e.arcLinkLabelsSkipAngle,oe=te===void 0?Le.arcLinkLabelsSkipAngle:te,ae=e.arcLinkLabelsOffset,_e=ae===void 0?Le.arcLinkLabelsOffset:ae,Se=e.arcLinkLabelsDiagonalLength,ge=Se===void 0?Le.arcLinkLabelsDiagonalLength:Se,we=e.arcLinkLabelsStraightLength,ce=we===void 0?Le.arcLinkLabelsStraightLength:we,re=e.arcLinkLabelsThickness,le=re===void 0?Le.arcLinkLabelsThickness:re,X=e.arcLinkLabelsTextOffset,ne=X===void 0?Le.arcLinkLabelsTextOffset:X,ue=e.arcLinkLabelsTextColor,de=ue===void 0?Le.arcLinkLabelsTextColor:ue,ve=e.arcLinkLabelsColor,Te=ve===void 0?Le.arcLinkLabelsColor:ve,be=e.arcLinkLabelComponent,xe=e.defs,Xe=xe===void 0?Le.defs:xe,Oe=e.fill,Re=Oe===void 0?Le.fill:Oe,ze=e.isInteractive,st=ze===void 0?Le.isInteractive:ze,Fe=e.onClick,Ie=e.onMouseEnter,Ze=e.onMouseMove,et=e.onMouseLeave,ht=e.tooltip,_t=ht===void 0?Le.tooltip:ht,Cn=e.activeId,It=e.onActiveIdChange,$t=e.defaultActiveId,tn=e.transitionMode,on=tn===void 0?Le.transitionMode:tn,Kt=e.legends,Bn=Kt===void 0?Le.legends:Kt,kn=e.forwardLegendData,ft=e.role,nt=ft===void 0?Le.role:ft,Ve=uE(M,L,j),xt=Ve.outerWidth,mn=Ve.outerHeight,dn=Ve.margin,Mr=Ve.innerWidth,ic=Ve.innerHeight,je=x$e({data:t,id:r,value:s,valueFormat:a,colors:$}),Pe=S$e({data:je,width:Mr,height:ic,fit:m,innerRadius:b,startAngle:f,endAngle:x,padAngle:v,sortByValue:l,cornerRadius:w,activeInnerRadiusOffset:k,activeOuterRadiusOffset:R,activeId:Cn,onActiveIdChange:It,defaultActiveId:$t,forwardLegendData:kn}),lt=Pe.dataWithArc,At=Pe.legendData,pt=Pe.arcGenerator,Xt=Pe.centerX,Et=Pe.centerY,Qt=Pe.radius,Ra=Pe.innerRadius,sc=Pe.setActiveId,Jn=Pe.toggleSerie,Vd=Qz(Xe,lt,Re),Ee={arcs:null,arcLinkLabels:null,arcLabels:null,legends:null};d.includes("arcs")&&(Ee.arcs=h.jsx(k$e,{center:[Xt,Et],data:lt,arcGenerator:pt,borderWidth:W,borderColor:A,isInteractive:st,onClick:Fe,onMouseEnter:Ie,onMouseMove:Ze,onMouseLeave:et,setActiveId:sc,tooltip:_t,transitionMode:on},"arcs")),N&&d.includes("arcLinkLabels")&&(Ee.arcLinkLabels=h.jsx(d$e,{center:[Xt,Et],data:lt,label:K,skipAngle:oe,offset:_e,diagonalLength:ge,straightLength:ce,strokeWidth:le,textOffset:ne,textColor:de,linkColor:Te,component:be},"arcLinkLabels")),H&&d.includes("arcLabels")&&(Ee.arcLabels=h.jsx(r$e,{center:[Xt,Et],data:lt,label:U,radiusOffset:O,skipAngle:ee,textColor:q,transitionMode:on,component:z},"arcLabels")),Bn.length>0&&d.includes("legends")&&(Ee.legends=h.jsx(y$e,{width:Mr,height:ic,data:At,legends:Bn,toggleSerie:Jn},"legends"));var Ms=C$e({dataWithArc:lt,arcGenerator:pt,centerX:Xt,centerY:Et,radius:Qt,innerRadius:Ra});return h.jsx(hE,{width:xt,height:mn,margin:dn,defs:Vd,role:nt,children:d.map(function(Nn,oq){return Ee[Nn]!==void 0?Ee[Nn]:typeof Nn=="function"?h.jsx(C.Fragment,{children:C.createElement(Nn,Ms)},oq):null})})},M$e=function(e){var t=e.isInteractive,n=t===void 0?Le.isInteractive:t,r=e.animate,i=r===void 0?Le.animate:r,s=e.motionConfig,a=s===void 0?Le.motionConfig:s,o=e.theme,l=e.renderWrapper,c=iW(e,E$e);return h.jsx(m_,{animate:i,isInteractive:n,motionConfig:a,renderWrapper:l,theme:o,children:h.jsx(T$e,Ll({isInteractive:n},c))})};const R$e=1.4,wc=e=>no(e).darker(R$e).toString(),ug="#A97CD2",_n={player:{label:"Player",description:"Player left by quitting the game, leaving the server or other normal means.",color:"#39E673",border:wc("#39E673"),expected:!0},resource:{label:"Resource",description:"Player kicked out of the server by a resource.",color:"#406FE6",border:wc("#406FE6"),expected:!0},timeout:{label:"Timeout",description:"Player connection timed out due to networking issues or client crash.",color:"#F0E38B",border:wc("#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:wc("#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:wc("#FF3E26"),expected:!1},unknown:{label:"Unknown",description:"Player left the server for an unknown reason.",color:"#F13BF7",border:wc("#F13BF7"),expected:!1}},b8=Object.keys(_n).filter(e=>_n[e].expected),A$e=Object.keys(_n).filter(e=>!_n[e].expected),w8=({centerX:e,centerY:t,dataWithArc:n,innerRadius:r,active:i})=>{if(i)return h.jsxs(h.Fragment,{children:[h.jsx("circle",{cx:e,cy:t,r:r*.95,fill:i.color}),h.jsxs("text",{x:e,y:t-15,textAnchor:"middle",dominantBaseline:"central",className:"text-xl font-bold",opacity:.75,children:[i.label,":"]}),h.jsx("text",{x:e,y:t+15,textAnchor:"middle",dominantBaseline:"central",className:"text-xl font-bold",opacity:.75,children:gr(i.data.count)})]});{const s=C.useMemo(()=>n.reduce((a,o)=>a+o.data.count,0),[n]);return h.jsxs(h.Fragment,{children:[h.jsx("text",{x:e,y:t-15,textAnchor:"middle",dominantBaseline:"central",className:"text-2xl font-bold fill-muted-foreground",children:"Total:"}),h.jsx("text",{x:e,y:t+15,textAnchor:"middle",dominantBaseline:"central",className:"text-2xl font-bold fill-muted-foreground",children:gr(s)})]})}},D$e=C.memo(({data:e,activeId:t,setActiveId:n,width:r,height:i})=>{const s=__(),[a,o]=C.useState(!1),l=C.useCallback(c=>{if(!t)return w8(c);const d=c.dataWithArc.find(u=>u.id===t);return w8({...c,active:d})},[t]);return!r||!i?null:h.jsx(M$e,{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:(c,d)=>o(u=>!u),onMouseEnter:(c,d)=>o(!1),onMouseLeave:(c,d)=>{a&&n(c.id),d.preventDefault()},colors:{datum:"data.color"},tooltip:()=>null,sortByValue:!0})});function L$e(){const[e,t]=C.useState(null),[n,r]=C.useState({width:0,height:0}),i=ut(S1),s=$5(),a=C.useMemo(()=>{if(!(i!=null&&i.summaryLast6h)||s().isExpired)return null;if(!i.summaryLast6h.length)return"not_enough_data";const d=i.summaryLast6h.reduce((u,f)=>u+f[1],0);return i.summaryLast6h.map(([u,f])=>{var g,x,_;return{id:u,label:((g=_n[u])==null?void 0:g.label)??u,count:f,value:f/d,color:((x=_n[u])==null?void 0:x.color)??ug,border:((_=_n[u])==null?void 0:_.border)??ug}})},[i==null?void 0:i.summaryLast6h]),o=C.useMemo(()=>!(i!=null&&i.summaryLast6h)||s().isExpired||!i.summaryLast6h.length?null:i.summaryLast6h.map(([d,u])=>{var f,g,x;return{id:d,label:((f=_n[d])==null?void 0:f.label)??d,color:((g=_n[d])==null?void 0:g.color)??ug,border:((x=_n[d])==null?void 0:x.border)??ug}}),[i==null?void 0:i.summaryLast6h]);let l=null;return typeof a=="object"&&a!==null?l=h.jsx(D$e,{data:a,activeId:e,setActiveId:t,width:n.width,height:n.height}):typeof a=="string"?l=h.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground text-center",children:h.jsx("p",{className:"max-w-80",children:"No players have disconnected from the server in the last 6 hours."})}):l=h.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:h.jsx(cn,{className:"animate-spin size-16 text-muted-foreground"})}),h.jsxs("div",{className:"col-span-3 sm:col-span-2 2xl: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:[h.jsxs("div",{className:"px-4 flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[h.jsx("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:"Player drop cause (last 6h)"}),h.jsx("div",{className:"hidden sm:block",children:h.jsx(k0,{})})]}),h.jsx(vp,{onDebouncedResize:r,children:l}),o&&h.jsx("div",{className:"px-4 mx-auto flex flex-wrap justify-center gap-2",children:o.map(c=>h.jsxs("div",{"data-active":e===c.id,className:"flex items-center cursor-pointer hover:underline data-[active=true]:underline",onClick:()=>t(e===c.id?null:c.id),children:[h.jsx("div",{className:"size-4 mr-1 rounded-full border dark:border-0",style:{backgroundColor:c.color,borderColor:c.border}}),h.jsx("span",{className:"text-sm",children:c.label})]},c.id))})]})}const dg=(e,t)=>`translate(${e}, ${t})`;function j$e({svgRef:e,canvasRef:t,setRenderError:n,size:{width:r,height:i},margins:s,isDarkMode:a,bucketLabels:o,dataStart:l,dataEnd:c,lifespans:d,cursorSetter:u}){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 x=!0;console.log("From:",l.toISOString()),console.log("To:",c.toISOString()),console.log("Window:",V5(c.getTime()-l.getTime())),console.log("Number of lifespans:",d.length);const _=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 p=f.append("g").attr("clip-path","url(#fullPerfChartClipPath)").attr("transform",dg(s.left,0)),m=W3().domain([l,c]).range([0,v]),y=Ly().domain(o).range([i-s.bottom,0]),b=PB(a?YB:qB).domain([0,1]),S=ko(d,le=>ko(le.log,X=>X.players)),w=ko(d,le=>ko(le.log,X=>X.fxsMemory)),E=ko(d,le=>ko(le.log,X=>X.nodeMemory)),k=Math.ceil((S+1)/5)*5,T=[i-s.bottom,s.top],R=Yo([0,k],T);Yo([0,w],T),Yo([0,E],T);const M=Yo([382,1350],[7,16]),L=DH(m).ticks(M(r)),j=f.append("g").attr("transform",dg(s.left,i-s.bottom)).attr("class","time-axis").call(L),P=FNe(y);f.append("g").attr("class","buckets-axis").attr("transform",dg(r-s.right+s.axis,s.top)).call(P);const $=S<=7?D3(S+1):null,F=LH(R).tickFormat(le=>le.toString()).tickValues($);f.append("g").attr("class","players-axis").attr("transform",dg(s.left-s.axis,0)).call(F);let W=[];const I=o.map(le=>Math.floor(y(le))),A=Math.ceil(y.bandwidth()),D=no(b(0)).darker(1.15).formatHsl(),H=()=>{const le=g.node();if(!le)return n("Canvas node not found.");const X=le.getContext("2d");if(!X)return n("Canvas 2d context not found.");x&&console.time("drawing canvas heatmap"),X.clearRect(0,0,v,_),X.fillStyle=a?"#281C2B":"#E4D4FA",X.fillRect(0,0,v,_),W=[];let ne=0,ue=0;for(const de of d){const{bootTime:ve,closeTime:Te,log:be}=de,xe=m(ve||be[0].start),Xe=m(Te||be.at(-1).end),Oe=Xe-xe;if(!(Xe<0||xe>v)&&!(Oe<5)){ne++;for(const Re of de.log){const ze=Math.floor(m(Re.start)),Fe=Math.floor(m(Re.end))-ze;if(Fe){W.push(Re);for(let Ie=0;Ie<Re.weightedPerf.length;Ie++){const Ze=Re.weightedPerf[Ie];X.fillStyle=Ze>.001?b(Ze):D,X.fillRect(ze,I[Ie],Fe,A),ue++}}}}}x&&(console.log("Canvas heatmap finished drawing:",{lifespanCount:ne,snapCount:W.length,rectCount:ue}),console.timeEnd("drawing canvas heatmap"))};H();const V=le=>{const X=le.bootTime?m(le.bootTime):m(le.log[0].start),ne=le.closeTime?m(le.closeTime):m(le.log.at(-1).end),ue=ne-X;return ue<5||ne<0+s.left||X>v+s.left?[]:[{...le,lifespanStartX:X,lifespanEndX:ne,lifespanWidth:ue}]},U=le=>{const X=tz(ne=>m(ne.end),ne=>R(ne.players)).curve(hz);le.selectAll("path.players-line-bg").data(V).join("path").attr("class","players-line-bg").each((ne,ue,de)=>{nr(de[ue]).attr("fill","none").attr("stroke-linejoin","round").attr("stroke-linecap","round").attr("stroke","black").attr("stroke-width",6).attr("d",X(ne.log))}),le.selectAll("path.players-line").data(V).join("path").attr("class","players-line").each((ne,ue,de)=>{nr(de[ue]).attr("fill","none").attr("stroke-linejoin","round").attr("stroke-linecap","round").attr("stroke","rgb(204, 203, 203)").attr("stroke-width",2).attr("d",X(ne.log))})};p.selectAll("g.lifespan").data(d).join("g").attr("class","lifespan").call(U);const G=p.append("line").attr("class","cursorLineHorz").attr("stroke","rgba(216, 245, 19, 0.75)").attr("stroke-width",1).attr("stroke-dasharray","3 3"),ee=p.append("line").attr("class","cursorLineHorz").attr("stroke","rgba(216, 245, 19, 0.75)").attr("stroke-width",1).attr("stroke-dasharray","3 3"),Z=p.append("circle").attr("class","cursorDot").attr("fill","red").attr("r",4),q=p.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),B=p.append("text").attr("class","cursorText font-mono").attr("fill","rgba(216, 245, 19)").attr("font-size",16),O=B.node(),z=()=>{G.attr("x1",0).attr("y1",0).attr("x2",0).attr("y2",0),Z.attr("cx",-99).attr("cy",-99),ee.attr("x1",0).attr("y1",0).attr("x2",0).attr("y2",0),B.attr("x",-99).attr("y",-99),q.attr("x",-99).attr("y",-99),u(void 0)};z();const Y=20*60*1e3,N=tm(le=>le.end).center,J=le=>{if(!W.length)return;const X=m.invert(le),ne=N(W,X);if(ne===-1)return;const ue=W[ne];if(Math.abs(ue.end.getTime()-X.getTime())<Y)return{snapIndex:ne,snapData:ue}};let K=null;const te=(le,X)=>{const ne=J(le);if(!ne)return K=null,z();const{snapIndex:ue,snapData:de}=ne;if(ue===K)return;K=ue,u(de);const ve={x:Math.round(m(de.end))+.5,y:Math.round(R(de.players))+.5,val:de.players};G.attr("x1",ve.x).attr("y1",0).attr("x2",ve.x).attr("y2",_),ee.attr("x1",0).attr("y1",ve.y).attr("x2",v).attr("y2",ve.y),Z.attr("cx",ve.x).attr("cy",ve.y);const Te=ve.val.toString(),be=ve.x<50,xe=ve.y<50;if(B.text(Te).attr("x",be?ve.x+20:ve.x-15).attr("y",xe?ve.y+15:ve.y-15).attr("text-anchor",be?"start":"end").attr("dominant-baseline",xe?"hanging":"baseline"),!O)return;const Xe=O.getBBox(),Oe=6,Re=2;q.attr("x",Math.round(Xe.x)-Oe-.5).attr("y",Math.round(Xe.y)-Re-.5).attr("width",Math.round(Xe.width)+Oe*2).attr("height",Math.round(Xe.height)+Re*2)};let oe=!1,ae;const _e=20;p.append("rect").attr("x",0).attr("y",0).attr("width",v).attr("height",_).attr("fill","transparent").on("mousemove",function(le){const[X,ne]=bi(le);oe?(clearTimeout(ae),ae=setTimeout(()=>{te(X)},_e)):(oe=!0,te(X),setTimeout(()=>{oe=!1},_e))}),f.on("mouseleave",function(){setTimeout(()=>{z()},150)});let Se=!1;const we=Gn(20,({transform:le})=>{if(le.k===1&&le.x===0){if(!Se)return;Se=!1}else Se=!0;m.range([parseFloat(le.applyX(0).toFixed(6)),parseFloat(le.applyX(v).toFixed(6))]),L.scale(le.rescaleX(m).range([0,v])),j.call(L),p.selectAll("g.lifespan").call(U),z(),H()},{noLeading:!1,noTrailing:!1}),ce=[[0,s.top],[v,i-s.top]],re=zIe().scaleExtent([1,12]).translateExtent(ce).extent(ce).on("zoom",we);f.call(re),x=!1}const P$e=C.memo(({threadName:e,apiData:t,apiDataAge:n,width:r,height:i,isDarkMode:s})=>{const a=it(O5),o=C.useRef(null),l=C.useRef(null),[c,d]=C.useState(""),[u,f]=C.useState(0),g=Tie(),x={top:8,right:50,bottom:30,left:40,axis:1},_=C.useMemo(()=>{if(!t)return null;const v=VIe(t.threadPerfLog,p=>{const m=ZH(t.boundaries);return eW(p.buckets,m)});return v?{...v,bucketLabels:t.boundaries.map(Gg),cursorSetter:p=>{if(!p)return g(void 0);g({threadName:e,snap:p})}}:null},[t,n,e,s,c]);return C.useEffect(()=>{if(!_)a(void 0);else{const v=qIe(_.lifespans,24,n);a(v)}},[_,n]),C.useEffect(()=>{if(!(!_||!o.current||!l.current||!r||!i)&&_.lifespans.length)try{console.groupCollapsed("Drawing full performance chart:"),console.time("drawFullPerfChart"),j$e({svgRef:o.current,canvasRef:l.current,setRenderError:d,size:{width:r,height:i},margins:x,isDarkMode:s,..._}),f(0),d(""),console.timeEnd("drawFullPerfChart")}catch(v){d(v.message??"Unknown error.")}finally{console.groupEnd()}},[_,r,i,o,l,c]),!r||!i?null:c?h.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: ",c,h.jsx("br",{}),h.jsxs(Ke,{size:"sm",variant:"outline",className:"text-primary",onClick:()=>{f(v=>v+1),d("")},children:["Retry",u?` (${u})`:""]})]}):h.jsxs(h.Fragment,{children:[h.jsx("svg",{ref:o,width:r,height:i,style:{zIndex:1,position:"absolute",top:"0px",left:"0px"}}),h.jsx("canvas",{ref:l,width:r-x.left-x.right,height:i-x.top-x.bottom,style:{zIndex:0,position:"absolute",top:`${x.top}px`,left:`${x.left}px`}})]})});function N$e({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:h.jsxs("p",{className:"text-center",children:[h.jsx("strong",{children:"There is not enough data to display the chart just yet."}),h.jsx("br",{}),h.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"?h.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-2xl text-muted-foreground",children:t[e]??"Unknown BackendApiError"}):h.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 O$e(){const[e,t]=C.useState({width:0,height:0}),[n,r]=C.useState("svMain"),[i,s]=C.useState(""),[a,o]=C.useState(0),l=__(),c=qt({method:"GET",path:"/perfChartData/:thread/"}),d=U5(`/perfChartData/${n}`,async()=>{s("");const f=await c({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 u=null;return d.data?u=h.jsx(P$e,{threadName:n,apiData:d.data,apiDataAge:a,width:e.width,height:e.height,isDarkMode:l}):d.isLoading?u=h.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:h.jsx(cn,{className:"animate-spin size-16 text-muted-foreground"})}):(i||d.error)&&(u=h.jsx(N$e,{error:i||d.error})),h.jsxs("div",{className:"w-full h-[28rem] pt-2 md:rounded-xl border bg-card shadow-sm flex flex-col fill-primary",children:[h.jsxs("div",{className:"px-4 flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[h.jsx("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:"Server performance"}),h.jsxs("div",{className:"flex gap-4",children:[h.jsxs($i,{defaultValue:n,onValueChange:r,children:[h.jsx(li,{className:"w-32 grow md:grow-0 h-6 px-3 py-1 text-sm",children:h.jsx(Fi,{placeholder:"Filter by admin"})}),h.jsxs(ci,{className:"px-0",children:[h.jsx(Ue,{value:"svMain",className:"cursor-pointer",children:"svMain"}),h.jsx(Ue,{value:"svSync",className:"cursor-pointer",children:"svSync"}),h.jsx(Ue,{value:"svNetwork",className:"cursor-pointer",children:"svNetwork"})]})]}),h.jsx("div",{className:"hidden xs:block",children:h.jsx(FQ,{})})]})]}),h.jsx(vp,{onDebouncedResize:t,children:u})]})}const I$e=C.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 c=Math.ceil(r.used/r.limit*100);l=r.used.toFixed(2)+"MB ("+c+"%)",c>85?o="text-destructive":c>70&&(o="text-warning")}return h.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-1 gap-4 h-full pb-2 text-muted-foreground",children:[h.jsxs("div",{className:"flex items-center",children:[h.jsx(vP,{className:"hidden sm:block sm:size-6 md:size-12 mr-2 opacity-75"}),h.jsxs("div",{className:"flex flex-col mr-auto ml-auto sm:mr-0 sm:ml-auto",children:[h.jsx("span",{className:"text-center sm:text-right text-xl text-primary",children:i}),h.jsx("span",{className:"text-center sm:text-right text-sm",children:"Uptime 24h"})]})]}),h.jsxs("div",{className:"flex items-center",children:[h.jsx(OJ,{className:"hidden sm:block sm:size-6 md:size-12 mr-2 opacity-75"}),h.jsxs("div",{className:"flex flex-col mr-auto ml-auto sm:mr-0 sm:ml-auto",children:[h.jsx("span",{className:"text-center sm:text-right text-xl text-primary",children:s}),h.jsx("span",{className:"text-center sm:text-right text-sm",children:"Median Players 24h"})]})]}),h.jsxs("div",{className:"flex items-center",children:[h.jsx(U4,{className:"hidden sm:block sm:size-6 md:size-12 mr-2 opacity-75"}),h.jsxs("div",{className:"flex flex-col mr-auto ml-auto sm:mr-0 sm:ml-auto",children:[h.jsx("span",{className:"text-center sm:text-right text-xl text-primary",children:a}),h.jsx("span",{className:"text-center sm:text-right text-sm",children:"FXServer Memory"})]})]}),h.jsxs("div",{className:ie("flex items-center",o??"text-muted-foreground"),title:r?`${r.used.toFixed(2)}MB / ${r.limit}MB`:"",children:[h.jsx(U4,{className:"hidden sm:block sm:size-6 md:size-12 mr-2 opacity-75"}),h.jsxs("div",{className:"flex flex-col mr-auto ml-auto sm:mr-0 sm:ml-auto",children:[h.jsx("span",{className:ie("text-center sm:text-right text-xl",o??"text-primary"),children:l}),h.jsx("span",{className:"text-center sm:text-right text-sm",children:"Node.js Memory"})]})]})]})});function $$e(){const e=ut(O5),t=ut(C1),n=ut(k1),r=$5(),i=C.useMemo(()=>{const o=r();if(!t||o.isExpired)return null;if(n&&n.snap){const l=Ff(n.snap.end,"2-digit","2-digit"),c=Bf(n.snap.end,"short"),d=$0(n.snap.end)?l:`${l} - ${c}`;return{fxsMemory:n.snap.fxsMemory,nodeMemory:t.nodeMemory&&n.snap.nodeMemory?{used:n.snap.nodeMemory,limit:t.nodeMemory.limit}:null,titleTimeIndicator:h.jsxs(h.Fragment,{children:["(",h.jsx("span",{className:"text-xs text-warning-inline font-mono",children:d}),")"]})}}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=h.jsx(I$e,{fxsMemory:i.fxsMemory,medianPlayerCount:e==null?void 0:e.medianPlayerCount,uptimePct:e==null?void 0:e.uptimePct,nodeMemory:i.nodeMemory})):a=h.jsx("div",{className:"size-full flex flex-col items-center justify-center",children:h.jsx(cn,{className:"animate-spin size-16 text-muted-foreground"})}),h.jsxs("div",{className:"col-span-3 sm:col-span-1 2xl:col-span-2 min-w-52 py-2 px-4 flex flex-col md:rounded-xl border shadow-sm bg-card",children:[h.jsxs("div",{className:"flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[h.jsxs("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:["Server stats ",s]}),h.jsx("div",{className:"hidden xs:block",children:h.jsx(iJ,{})})]}),a]})}function F$e(){const e=C.useRef(null),t=Eie();return C.useEffect(()=>(e.current=q5(["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()}),[]),h.jsxs("div",{className:"w-full min-w-96 flex flex-col gap-4",children:[h.jsxs("div",{className:"w-full grid grid-cols-3 2xl:grid-cols-8 gap-4",children:[h.jsx(L$e,{}),h.jsx($$e,{}),h.jsx(GIe,{})]}),h.jsx(O$e,{})]})}function B$e(){const e=ut(x5),t=wa()[1];return e==="setup"?(t("/server/setup"),null):e==="deployer"?(t("/server/deployer"),null):h.jsx(F$e,{})}const S8=rt.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e)}),$b={dedupe:!0},z$e=(e,t,n)=>{const{cache:r,compare:i,suspense:s,fallbackData:a,revalidateOnMount:o,revalidateIfStale:l,refreshInterval:c,refreshWhenHidden:d,refreshWhenOffline:u,keepPreviousData:f}=n,[g,x,_,v]=ss.get(r),[p,m]=T1(e),y=C.useRef(!1),b=C.useRef(!1),S=C.useRef(p),w=C.useRef(t),E=C.useRef(n),k=()=>E.current,T=()=>k().isVisible()&&k().isOnline(),[R,M,L,j]=B5(r,p),P=C.useRef({}).current,$=De(a)?n.fallback[p]:a,F=(N,J)=>{for(const K in P){const te=K;if(te==="data"){if(!i(N[te],J[te])&&(!De(N[te])||!i(ee,J[te])))return!1}else if(J[te]!==N[te])return!1}return!0},W=C.useMemo(()=>{const N=!p||!t?!1:De(o)?k().isPaused()||s?!1:De(l)?!0:l:o,J=Se=>{const ge=Js(Se);return delete ge._k,N?{isValidating:!0,isLoading:!0,...ge}:ge},K=R(),te=j(),oe=J(K),ae=K===te?oe:J(te);let _e=oe;return[()=>{const Se=J(R());return F(Se,_e)?(_e.data=Se.data,_e.isLoading=Se.isLoading,_e.isValidating=Se.isValidating,_e.error=Se.error,_e):(_e=Se,Se)},()=>ae]},[r,p]),I=XC.useSyncExternalStore(C.useCallback(N=>L(p,(J,K)=>{F(K,J)||N()}),[r,p]),W[0],W[1]),A=!y.current,D=g[p]&&g[p].length>0,H=I.data,V=De(H)?$:H,U=I.error,G=C.useRef(V),ee=f?De(H)?G.current:H:V,Z=D&&!De(U)?!1:A&&!De(o)?o:k().isPaused()?!1:s?De(V)?!1:l:De(V)||l,q=!!(p&&t&&A&&Z),B=De(I.isValidating)?q:I.isValidating,O=De(I.isLoading)?q:I.isLoading,z=C.useCallback(async N=>{const J=w.current;if(!p||!J||b.current||k().isPaused())return!1;let K,te,oe=!0;const ae=N||{},_e=!_[p]||!ae.dedupe,Se=()=>N0?!b.current&&p===S.current&&y.current:p===S.current,ge={isValidating:!1,isLoading:!1},we=()=>{M(ge)},ce=()=>{const le=_[p];le&&le[1]===te&&delete _[p]},re={isValidating:!0};De(R().data)&&(re.isLoading=!0);try{if(_e&&(M(re),n.loadingTimeout&&De(R().data)&&setTimeout(()=>{oe&&Se()&&k().onLoadingSlow(p,n)},n.loadingTimeout),_[p]=[J(m),O0()]),[K,te]=_[p],K=await K,_e&&setTimeout(ce,n.dedupingInterval),!_[p]||_[p][1]!==te)return _e&&Se()&&k().onDiscarded(p),!1;ge.error=Kn;const le=x[p];if(!De(le)&&(te<=le[0]||te<=le[1]||le[1]===0))return we(),_e&&Se()&&k().onDiscarded(p),!1;const X=R().data;ge.data=i(X,K)?X:K,_e&&Se()&&k().onSuccess(K,p,n)}catch(le){ce();const X=k(),{shouldRetryOnError:ne}=X;X.isPaused()||(ge.error=le,_e&&Se()&&(X.onError(le,p,X),(ne===!0||Qr(ne)&&ne(le))&&(!k().revalidateOnFocus||!k().revalidateOnReconnect||T())&&X.onErrorRetry(le,p,X,ue=>{const de=g[p];de&&de[0]&&de[0](os.ERROR_REVALIDATE_EVENT,ue)},{retryCount:(ae.retryCount||0)+1,dedupe:!0})))}return oe=!1,we(),!0},[p,r]),Y=C.useCallback((...N)=>z5(r,S.current,...N),[]);if(Xc(()=>{w.current=t,E.current=n,De(H)||(G.current=H)}),Xc(()=>{if(!p)return;const N=z.bind(Kn,$b);let J=0;const te=NN(p,g,(oe,ae={})=>{if(oe==os.FOCUS_EVENT){const _e=Date.now();k().revalidateOnFocus&&_e>J&&T()&&(J=_e+k().focusThrottleInterval,N())}else if(oe==os.RECONNECT_EVENT)k().revalidateOnReconnect&&T()&&N();else{if(oe==os.MUTATE_EVENT)return z();if(oe==os.ERROR_REVALIDATE_EVENT)return z(ae)}});return b.current=!1,S.current=p,y.current=!0,M({_k:m}),Z&&(De(V)||gl?N():EN(N)),()=>{b.current=!0,te()}},[p]),Xc(()=>{let N;function J(){const te=Qr(c)?c(R().data):c;te&&N!==-1&&(N=setTimeout(K,te))}function K(){!R().error&&(d||k().isVisible())&&(u||k().isOnline())?z($b).then(J):J()}return J(),()=>{N&&(clearTimeout(N),N=-1)}},[c,d,u,p]),C.useDebugValue(ee),s&&De(V)&&p){if(!N0&&gl)throw new Error("Fallback data is required when using suspense in SSR.");w.current=t,E.current=n,b.current=!1;const N=v[p];if(!De(N)){const J=Y(N);S8(J)}if(De(U)){const J=z($b);De(ee)||(J.status="fulfilled",J.value=!0),S8(J)}else throw U}return{mutate:Y,get data(){return P.data=!0,ee},get error(){return P.error=!0,U},get isValidating(){return P.isValidating=!0,B},get isLoading(){return P.isLoading=!0,O}}},U$e=PN(z$e),H$e=e=>(t,n,r)=>(r.revalidateOnFocus=!1,r.revalidateIfStale=!1,r.revalidateOnReconnect=!1,e(t,n,r)),W$e=Jie(U$e,H$e);function _f({isError:e}){return e?h.jsxs("div",{className:"h-full min-h-28 flex flex-col items-center justify-center gap-2 text-destructive-inline",children:[h.jsx(gJ,{className:"size-16 opacity-75"}),h.jsx("span",{children:"Error loading data."})]}):h.jsx("div",{className:"h-full min-h-28 flex items-center justify-center text-muted-foreground",children:h.jsx(cn,{className:"animate-spin size-16 opacity-75"})})}function am({message:e}){return h.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 C8=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}},V$e=(e,t)=>{const n=e.map(C8),r=t.map(C8),i=new Set(n.map(c=>c.name)),s=new Set(r.map(c=>c.name)),a=n.filter(c=>!s.has(c.name)).map(c=>c!=null&&c.version?`${c.name}/${c.version}`:c.name),o=r.filter(c=>!i.has(c.name)).map(c=>c!=null&&c.version?`${c.name}/${c.version}`:c.name),l=n.filter(c=>s.has(c.name)).map(c=>{const d=r.find(u=>u.name===c.name);return{resName:c.name,oldVer:c.version??"???",newVer:(d==null?void 0:d.version)??"???"}});return{removed:a,added:o,updated:l}},k8=e=>e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122,q$e=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;for(;n>0&&(k8(t.charCodeAt(n))||!k8(t.charCodeAt(n-1)));)n--;return n<=1?!1:t.slice(0,n)},Y$e=e=>e.map((t,n)=>{const r=n===0?!1:q$e(e[n-1],t);return{prefix:r,suffix:r?t.slice(r.length):t}}),K$e=(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,c]=e[o];(n?c>=r:o<t)?a.push([l,c]):(i++,s+=c)}return{filteredIn:a,filteredOut:!!i&&{count:s,types:i}}};function G$e({datum:e,isLast:t,isOdd:n}){let r=null;return e.prefix?r=h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-muted-foreground/50",children:e.prefix}),h.jsx("span",{children:e.suffix})]}):r=e.suffix,h.jsxs("tr",{className:ie("font-mono text-sm group",!t&&"border-b",n&&"bg-secondary/15","hover:bg-secondary/35"),children:[h.jsx("td",{className:"min-w-[4ch] px-2 py-1 border-r text-right",title:"Percent of all crashes",children:e.pctStr??"--"}),h.jsx("td",{className:"min-w-[4ch] px-2 py-1 border-r text-right",title:"Crash count",children:e.cntStr??"--"}),h.jsx("td",{className:"px-2 py-1 break-words line-clamp-4",children:r})]})}function X$e({crashTypes:e,crashesGroupReasons:t,crashesTargetLimit:n,setCrashesTargetLimit:r}){if(!e.length)return h.jsx(am,{message:"No player crashes within this time window."});const i=C.useMemo(()=>{t?e.sort((u,f)=>u[0].localeCompare(f[0])):e.sort((u,f)=>f[1]-u[1]);const s=e.reduce((u,[,f])=>u+f,0),{filteredIn:a,filteredOut:o}=n?K$e(e,n,t):{filteredIn:e,filteredOut:!1},l=Y$e(a.map(([u,f])=>u)),c=[];let d=0;for(let u=0;u<a.length;u++){const[f,g]=a[u];d+=g;const x=g/s;c.push({key:f,pctStr:gr(x*100,1)+"%",cntStr:gr(g),...l[u]})}return{display:c,displayPct:gr(d/s*100,1)+"%",filteredOut:o&&{...o,countPct:gr(o.count/s*100,1)+"%"}}},[e,t,n,r]);return h.jsxs("table",{className:"w-full px-4 pt-2",children:[h.jsx("thead",{children:h.jsxs("tr",{className:"border-b text-muted-foreground/75",children:[h.jsx("th",{className:"min-w-[4ch] px-2 py-1 border-r text-right",children:"%"}),h.jsx("th",{className:"min-w-[4ch] px-2 py-1 border-r text-right",children:"Count"}),h.jsx("th",{className:"px-2 py-1",children:"Crash Reason"})]})}),h.jsxs("tbody",{children:[i.display.map((s,a)=>h.jsx(G$e,{datum:s,isOdd:a%2===0,isLast:!i.filteredOut&&a===i.display.length-1},s.key)),i.filteredOut?h.jsx("tr",{children:h.jsxs("td",{colSpan:3,className:ie("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 ",gr(e.length)," reasons which account for ",i.displayPct," of all crashes. ",h.jsx("br",{}),"The remaining ",gr(i.filteredOut.types)," reasons account for ",i.filteredOut.countPct," of all crashes. "," ",h.jsx("button",{className:"text-accent hover:underline",onClick:()=>r(0),children:"Show All!"})]})}):null]})]})}function BE({children:e}){return h.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 zE({children:e}){return h.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 Q$e({children:e}){return h.jsx("span",{className:"font-mono px-1 text-sm text-primary dark:text-background bg-warning/60 dark:bg-warning/90",children:e})}function J$e({change:e}){return h.jsxs(h.Fragment,{children:["Switched from ",h.jsx(BE,{children:e.oldVersion})," to ",h.jsx(zE,{children:e.newVersion})]})}function Z$e({change:e}){return h.jsxs(h.Fragment,{children:["Switched from ",h.jsx(BE,{children:e.oldVersion})," to ",h.jsx(zE,{children:e.newVersion})]})}function eFe({change:e}){const t=C.useMemo(()=>V$e(e.resRemoved,e.resAdded),[e.resRemoved,e.resAdded]);let n=null;t.removed.length&&(n=h.jsxs("p",{children:["Removed: ",t.removed.map((s,a,o)=>h.jsxs(C.Fragment,{children:[h.jsx(BE,{children:s}),a<o.length-1?", ":"."]},s))]}));let r=null;t.added.length&&(r=h.jsxs("p",{children:["Added: ",t.added.map((s,a,o)=>h.jsxs(C.Fragment,{children:[h.jsx(zE,{children:s}),a<o.length-1?", ":"."]},s))]}));let i=null;return t.updated.length&&(i=h.jsxs("p",{children:["Updated: ",t.updated.map((s,a,o)=>h.jsxs(C.Fragment,{children:[h.jsxs(Q$e,{children:[s.resName," ",s.oldVer," -> ",s.newVer]}),a<o.length-1?", ":"."]},a))]})),h.jsxs(h.Fragment,{children:[n,r,i]})}function tFe({changes:e}){const t={fxsChanged:"Changed FXServer version",gameChanged:"Changed game version",resourcesChanged:"Changed boot resources"},n=C.useMemo(()=>e.sort((r,i)=>r.ts-i.ts),[e]);return e.length?h.jsx("div",{className:"md:grid md:grid-cols-[auto_minmax(0,1fr)] gap-4 md:px-4 pt-2 ",children:n.map((r,i)=>h.jsxs(C.Fragment,{children:[h.jsx("div",{className:"hidden mx-auto md:flex items-center gap-4 divide-y",children:h.jsxs("div",{className:"flex flex-col items-center justify-center px-2 py-1 rounded-lg text-xs font-medium bg-muted",children:[h.jsx("span",{children:IN(r.ts,"medium")}),h.jsx("span",{children:use(r.ts)})]})}),h.jsxs("div",{className:ie("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:[h.jsxs("div",{className:"flex flex-wrap-reverse justify-between",children:[h.jsx("h3",{className:"flex-grow inline text-lg font-semibold",children:r.type in t?t[r.type]:r.type}),h.jsx("div",{className:"md:hidden mx-auto",children:h.jsx("span",{className:"border-muted-foreground border rounded px-2 py-0.5 font-normal text-xs text-muted-foreground",children:Uo(r.ts,"medium","short")})})]}),h.jsxs("div",{className:"text-gray-500 dark:text-gray-400",children:[r.type==="fxsChanged"&&h.jsx(J$e,{change:r}),r.type==="gameChanged"&&h.jsx(Z$e,{change:r}),r.type==="resourcesChanged"&&h.jsx(eFe,{change:r})]})]})]},i))}):h.jsx(am,{message:"No environmental changes within this time window."})}var[E_,uUe]=Hi("Tooltip",[bd]),T_=bd(),sW="TooltipProvider",nFe=700,qS="tooltip.open",[rFe,UE]=E_(sW),oW=e=>{const{__scopeTooltip:t,delayDuration:n=nFe,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:s}=e,[a,o]=C.useState(!0),l=C.useRef(!1),c=C.useRef(0);return C.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),h.jsx(rFe,{scope:t,isOpenDelayed:a,delayDuration:n,onOpen:C.useCallback(()=>{window.clearTimeout(c.current),o(!1)},[]),onClose:C.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:C.useCallback(d=>{l.current=d},[]),disableHoverableContent:i,children:s})};oW.displayName=sW;var M_="Tooltip",[iFe,R_]=E_(M_),aW=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i=!1,onOpenChange:s,disableHoverableContent:a,delayDuration:o}=e,l=UE(M_,e.__scopeTooltip),c=T_(t),[d,u]=C.useState(null),f=Ir(),g=C.useRef(0),x=a??l.disableHoverableContent,_=o??l.delayDuration,v=C.useRef(!1),[p=!1,m]=gs({prop:r,defaultProp:i,onChange:E=>{E?(l.onOpen(),document.dispatchEvent(new CustomEvent(qS))):l.onClose(),s==null||s(E)}}),y=C.useMemo(()=>p?v.current?"delayed-open":"instant-open":"closed",[p]),b=C.useCallback(()=>{window.clearTimeout(g.current),v.current=!1,m(!0)},[m]),S=C.useCallback(()=>{window.clearTimeout(g.current),m(!1)},[m]),w=C.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{v.current=!0,m(!0)},_)},[_,m]);return C.useEffect(()=>()=>window.clearTimeout(g.current),[]),h.jsx(uk,{...c,children:h.jsx(iFe,{scope:t,contentId:f,open:p,stateAttribute:y,trigger:d,onTriggerChange:u,onTriggerEnter:C.useCallback(()=>{l.isOpenDelayed?w():b()},[l.isOpenDelayed,w,b]),onTriggerLeave:C.useCallback(()=>{x?S():window.clearTimeout(g.current)},[S,x]),onOpen:b,onClose:S,disableHoverableContent:x,children:n})})};aW.displayName=M_;var YS="TooltipTrigger",lW=C.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=R_(YS,n),s=UE(YS,n),a=T_(n),o=C.useRef(null),l=We(t,o,i.onTriggerChange),c=C.useRef(!1),d=C.useRef(!1),u=C.useCallback(()=>c.current=!1,[]);return C.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),h.jsx(dk,{asChild:!0,...a,children:h.jsx(Me.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:me(e.onPointerMove,f=>{f.pointerType!=="touch"&&!d.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),d.current=!0)}),onPointerLeave:me(e.onPointerLeave,()=>{i.onTriggerLeave(),d.current=!1}),onPointerDown:me(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:me(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:me(e.onBlur,i.onClose),onClick:me(e.onClick,i.onClose)})})});lW.displayName=YS;var sFe="TooltipPortal",[dUe,oFe]=E_(sFe,{forceMount:void 0}),td="TooltipContent",cW=C.forwardRef((e,t)=>{const n=oFe(td,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...s}=e,a=R_(td,e.__scopeTooltip);return h.jsx(wn,{present:r||a.open,children:a.disableHoverableContent?h.jsx(uW,{side:i,...s,ref:t}):h.jsx(aFe,{side:i,...s,ref:t})})}),aFe=C.forwardRef((e,t)=>{const n=R_(td,e.__scopeTooltip),r=UE(td,e.__scopeTooltip),i=C.useRef(null),s=We(t,i),[a,o]=C.useState(null),{trigger:l,onClose:c}=n,d=i.current,{onPointerInTransitChange:u}=r,f=C.useCallback(()=>{o(null),u(!1)},[u]),g=C.useCallback((x,_)=>{const v=x.currentTarget,p={x:x.clientX,y:x.clientY},m=dFe(p,v.getBoundingClientRect()),y=hFe(p,m),b=fFe(_.getBoundingClientRect()),S=mFe([...y,...b]);o(S),u(!0)},[u]);return C.useEffect(()=>()=>f(),[f]),C.useEffect(()=>{if(l&&d){const x=v=>g(v,d),_=v=>g(v,l);return l.addEventListener("pointerleave",x),d.addEventListener("pointerleave",_),()=>{l.removeEventListener("pointerleave",x),d.removeEventListener("pointerleave",_)}}},[l,d,g,f]),C.useEffect(()=>{if(a){const x=_=>{const v=_.target,p={x:_.clientX,y:_.clientY},m=(l==null?void 0:l.contains(v))||(d==null?void 0:d.contains(v)),y=!pFe(p,a);m?f():y&&(f(),c())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[l,d,a,c,f]),h.jsx(uW,{...e,ref:s})}),[lFe,cFe]=E_(M_,{isInside:!1}),uW=C.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:a,...o}=e,l=R_(td,n),c=T_(n),{onClose:d}=l;return C.useEffect(()=>(document.addEventListener(qS,d),()=>document.removeEventListener(qS,d)),[d]),C.useEffect(()=>{if(l.trigger){const u=f=>{const g=f.target;g!=null&&g.contains(l.trigger)&&d()};return window.addEventListener("scroll",u,{capture:!0}),()=>window.removeEventListener("scroll",u,{capture:!0})}},[l.trigger,d]),h.jsx(yd,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:u=>u.preventDefault(),onDismiss:d,children:h.jsxs(hk,{"data-state":l.stateAttribute,...c,...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:[h.jsx(a5,{children:r}),h.jsx(lFe,{scope:n,isInside:!0,children:h.jsx(fI,{id:l.contentId,role:"tooltip",children:i||r})})]})})});cW.displayName=td;var dW="TooltipArrow",uFe=C.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=T_(n);return cFe(dW,n).isInside?null:h.jsx(fk,{...i,...r,ref:t})});uFe.displayName=dW;function dFe(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 hFe(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 fFe(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 pFe(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,c=t[a].x,d=t[a].y;l>r!=d>r&&n<(c-o)*(r-l)/(d-l)+o&&(i=!i)}return i}function mFe(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),gFe(t)}function gFe(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 vFe=oW,yFe=aW,_Fe=lW,hW=cW;const xFe=vFe,Ko=yFe,Go=_Fe,Ws=C.forwardRef(({className:e,sideOffset:t=4,...n},r)=>h.jsx(hW,{ref:r,sideOffset:t,className:ie("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}));Ws.displayName=hW.displayName;function bFe({dropTypes:e}){let{totalDrops:t,categories:n}=C.useMemo(()=>{let r=0;const i={};for(const[s,a]of e)r+=a,s in _n&&(i[s]={label:_n[s].label,tooltip:_n[s].description,color:_n[s].color,count:a});return{totalDrops:r,categories:Object.entries(i)}},[e]);return n.length?h.jsx("div",{className:"px-4 py-4 flex flex-wrap justify-evenly gap-4 text-muted-foreground",children:n.map(([r,i])=>h.jsxs(Ko,{children:[h.jsx(Go,{asChild:!0,children:h.jsxs("div",{className:"px-4 flex flex-col gap-1 items-center justify-center",children:[h.jsx("span",{className:"text-xl tracking-wider border-b-2 font-semibold",style:{borderColor:i.color},children:i.label}),h.jsxs("span",{children:[gr(i.count)," ",h.jsxs("small",{className:"opacity-75",children:["(",gr(i.count/t*100,1),"%)"]})]})]},r)}),h.jsx(Ws,{className:"max-w-96 text-center",children:h.jsx("p",{children:i.tooltip})})]}))}):h.jsx(am,{message:"No player drops within this time window."})}function wFe({resKicks:e}){let{totalKicks:t,resources:n}=C.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?h.jsx("div",{className:"px-4 py-4 flex flex-wrap justify-evenly gap-4 text-muted-foreground",children:n.map(([r,i])=>h.jsxs("div",{className:"px-4 flex flex-col gap-1 items-center justify-center",children:[h.jsx("span",{className:"text-lg tracking-wider border-b-2",children:i.label}),h.jsxs("span",{className:"text-sm",children:[gr(i.count)," ",h.jsxs("small",{className:"opacity-75",children:["(",gr(i.count/t*100,1),"%)"]})]})]},r))}):h.jsx(am,{message:"No players kicked by resources within this time window."})}function SFe({isError:e}){return h.jsxs("div",{className:"space-y-1",children:[h.jsx("div",{className:"text-center space-x-2 text-sm text-muted-foreground",children:h.jsx("span",{children:"Loading..."})}),h.jsxs("div",{className:"pb-2 md:rounded-xl border bg-cardx shadow-sm flex flex-col",children:[h.jsx("div",{className:"flex flex-col flex-shrink px-1 sm:px-4 py-2 space-y-4 border-b rounded-t-xl bg-secondary/35",children:h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx("div",{className:"hidden xs:block",children:h.jsx(dP,{className:"size-4"})}),h.jsx("h2",{className:"font-mono text-sm",children:"Overview"})]})}),h.jsx("div",{className:"px-4 py-2 flex flex-wrap justify-evenly gap-4 text-muted-foreground",children:h.jsx(_f,{isError:e})}),h.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:h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx("div",{className:"hidden xs:block",children:h.jsx(gP,{className:"size-4"})}),h.jsx("h2",{className:"font-mono text-sm",children:"Crash Reasons"})]})}),h.jsx("div",{className:"px-4 pt-2 pb-4",children:h.jsx(_f,{isError:e})}),h.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:h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx("div",{className:"hidden xs:block",children:h.jsx(pP,{className:"size-4"})}),h.jsx("h2",{className:"font-mono text-sm",children:"Environment Changes"})]})}),h.jsx("div",{className:"px-4 pt-2 pb-4 space-y-4",children:h.jsx(_f,{isError:e})})]})]})}const CFe=function({windowStart:t,windowEnd:n,windowData:r,rangeSelected:i,displayLod:s}){const[a,o]=C.useState(50),[l,c]=C.useState(!1),d=new Date(t),u=new Date(n),f=!$0(d)||!$0(d),g=Ff(d,"2-digit","2-digit"),x=Bf(d,"short"),_=f?`${g} - ${x}`:g,v=Ff(u,"2-digit","2-digit"),p=Bf(u,"short"),m=f?`${v} - ${p}`:v;return h.jsxs("div",{className:"space-y-1",children:[h.jsx("div",{className:ie("text-center space-x-2 text-sm text-muted-foreground",i&&"font-semibold text-primary"),children:h.jsxs("span",{children:["Period from ",h.jsx(Mn,{title:d.toISOString(),children:_})," to ",h.jsx(Mn,{title:u.toISOString(),children:m}),"."]})}),h.jsxs("div",{className:"md:rounded-xl border bg-cardx shadow-sm flex flex-col",children:[h.jsxs("div",{className:"",children:[h.jsx("div",{className:"flex flex-col flex-shrink px-1 sm:px-4 py-2 space-y-4 border-b rounded-t-xl bg-secondary/35",children:h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx("div",{className:"hidden xs:block",children:h.jsx(dP,{className:"size-4"})}),h.jsx("h2",{className:"font-mono text-sm",children:"Period Overview"})]})}),h.jsx(bFe,{dropTypes:r.dropTypes})]}),h.jsxs("div",{className:"pb-4",children:[h.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:h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx("div",{className:"hidden xs:block",children:h.jsx(lP,{className:"size-4"})}),h.jsx("h2",{className:"font-mono text-sm",children:"Resource Kicks"})]})}),h.jsx(wFe,{resKicks:r.resKicks})]}),h.jsxs("div",{className:"pb-4",children:[h.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:h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx("div",{className:"hidden xs:block",children:h.jsx(pP,{className:"size-4"})}),h.jsx("h2",{className:"font-mono text-sm",children:"Environment Changes"})]})}),h.jsx(tFe,{changes:r.changes})]}),h.jsxs("div",{className:"",children:[h.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:[h.jsxs("div",{className:"flex items-center py-2 space-x-2",children:[h.jsx("div",{className:"hidden xs:block",children:h.jsx(gP,{className:"size-4"})}),h.jsx("h2",{className:"font-mono text-sm",children:"Crash Reasons"})]}),h.jsxs("div",{className:"flex gap-2",children:[h.jsxs($i,{value:a.toString(),onValueChange:y=>o(parseInt(y)),children:[h.jsx(li,{className:"w-32 h-6 px-3 py-1 text-sm",children:h.jsx(Fi,{placeholder:"Filter by admin"})}),h.jsxs(ci,{className:"px-0",children:[h.jsx(Ue,{value:"50",className:"cursor-pointer",children:"Top ~50"}),h.jsx(Ue,{value:"100",className:"cursor-pointer",children:"Top ~100"}),h.jsx(Ue,{value:"0",className:"cursor-pointer",children:"Show All"})]})]}),h.jsxs($i,{value:l.toString(),onValueChange:y=>c(y==="true"),children:[h.jsx(li,{className:"w-36 h-6 px-3 py-1 text-sm",children:h.jsx(Fi,{placeholder:"Filter by admin"})}),h.jsxs(ci,{className:"px-0",children:[h.jsx(Ue,{value:"false",className:"cursor-pointer",children:"Sort by Count"}),h.jsx(Ue,{value:"true",className:"cursor-pointer",children:"Group Reasons"})]})]})]})]}),h.jsx(X$e,{crashTypes:r.crashTypes,crashesGroupReasons:l,crashesTargetLimit:a,setCrashesTargetLimit:o})]})]})]})},kFe=C.memo(CFe),Fb=(e,t)=>`translate(${e}, ${t})`;function EFe({legendRef:e,svgRef:t,canvasRef:n,setRenderError:r,size:{width:i,height:s},rangeSelected:a,rangeSetter:o,margins:l,isDarkMode:c,chartName:d,data:u}){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 x=!0;console.log("From:",u.startDate.toISOString()),console.log("To:",u.endDate.toISOString()),console.log("Window:",V5(u.startDate.getTime()-u.endDate.getTime())),console.log("Number of intervals:",u.log.length);const _=s-l.top-l.bottom,v=i-l.left-l.right;console.log("Drawable area:",v,_);const p=f.append("g").attr("transform",Fb(l.left,l.top)),m=W3([u.startDate,u.endDate],[0,v]),y=u.maxDrops<10?u.maxDrops+1:u.maxDrops,b=Yo([0,y],[s-l.bottom,l.top]),S=Yo([382,1350],[7,16]),w=DH(m).ticks(S(i));p.append("g").attr("transform",Fb(0,_)).attr("class","time-axis").call(w);const E=y<=7?D3(y+1):null,k=LH(b).ticks(s>200?6:4).tickFormat(ce=>gr(ce)).tickValues(E),T=f.append("g").attr("class","counts-axis").attr("transform",Fb(l.left-l.axis,0)).call(k),R=u.displayLod==="day"?24:1,M=new Date(u.startDate.getTime()+R*60*60*1e3),L=m(M)-m(u.startDate),j=Math.floor(L/2),P=u.displayLod==="day"?12:0,$=c?"rgba(255, 255, 255, 0.15)":"rgba(0, 0, 0, 0.35)",F=c?"#00000035":"#00000007",W=c?"#FFFFFFE0":"#000000D0",I=ce=>b(ce)-l.top;(()=>{var le,X;const ce=g.node();if(!ce)return r("Canvas node not found.");const re=ce.getContext("2d");if(!re)return r("Canvas 2d context not found.");if(!L)return r("Cannot render with zero interval width.");x&&console.time("drawing canvas timeline"),re.clearRect(0,0,v,_),re.fillStyle=F,re.fillRect(0,0,v,_),re.strokeStyle=$,re.setLineDash([2,2]);try{const ne=T.selectAll("g.tick").nodes();for(const ue of ne){const de=ue==null?void 0:ue.getAttribute("transform");if(!de)continue;const ve=Math.round(+de.split(",")[1].replace(")","")-l.top)+.5;re.beginPath(),re.moveTo(0,ve),re.lineTo(v,ve),re.stroke()}}catch(ne){console.error("Error drawing horizontal ticks:",ne)}re.setLineDash([]),re.lineWidth=1;for(const ne of u.log){const ue=m(ne.startDate);if(ue<0||ue>v)continue;const ve=Math.round(ue)-j+P,Te=ue-ve,be=Math.round(L+Te)+1-j-P;if(be<1)continue;let xe=0,Xe=_+1;for(const[Oe,Re]of ne.drops){if(!Re)continue;const ze=Xe-1,st=I(xe+Re)+1,Fe=ze-st,Ie=Math.max(Math.floor(Fe),Fe>.8?1:0);xe+=Re,!(Ie<1)&&(Xe=ze-Ie,re.fillStyle=((le=_n[Oe])==null?void 0:le.color)??"white",re.fillRect(ve,ze,be,-Ie),re.strokeStyle=((X=_n[Oe])==null?void 0:X.border)??"black",re.strokeRect(ve+.5,ze+.5,be-1,-Ie-1))}if(ne.changes){re.fillStyle=W;const Oe=Math.round(ve-.5+be/2)+.5,Re=Xe-6,ze=3;re.beginPath(),re.moveTo(Oe,Re-ze),re.lineTo(Oe+ze,Re),re.lineTo(Oe,Re+ze),re.lineTo(Oe-ze,Re),re.closePath(),re.fill()}}x&&console.timeEnd("drawing canvas timeline")})();let D=null,H=!1,V;const U=`chartMask-${d}`,G=p.append("line").attr("stroke",c?"rgba(216, 245, 19, 0.75)":"rgba(62, 70, 5, 0.75)").attr("stroke-width",1).attr("stroke-dasharray","3,3"),Z=p.append("defs").append("mask").attr("id",U),q=Z.append("rect").attr("width",v).attr("height",_).attr("fill","white").attr("class","transition-opacity").attr("opacity","0"),B=Z.append("rect").attr("height",_).attr("fill","black");p.append("rect").attr("width",v).attr("height",_).attr("fill",c?"rgba(0, 0, 0, 0.5)":"rgba(0, 0, 0, 0.35)").attr("mask",`url(#${U})`);const O=(ce,re)=>{if(typeof ce!="number"||typeof re!="number"||ce<0&&re<0||ce>v&&re>v){q.attr("opacity","0");return}const le=Math.floor(ce),X=Math.floor(re);B.attr("x",Math.min(le,X)+.5-j).attr("width",Math.abs(X-le)+L+.5),q.attr("opacity","1")},z=ce=>{if(!Array.isArray(ce)||ce.length!==2)return o(null);ce[0].getTime()<=ce[1].getTime()?o({startDate:new Date(ce[0]),endDate:new Date(ce[1])}):o({startDate:new Date(ce[1]),endDate:new Date(ce[0])})},Y=(ce=!1)=>{D=null,H=!1,ce&&(O(),a&&z(null))},N=()=>{G.attr("x1",0).attr("y1",0).attr("x2",0).attr("y2",0),e.style.opacity="0",clearTimeout(V)};N(),a&&(console.log("Upsream range selected:",a.startDate.toISOString(),a.endDate.toISOString()),O(m(a.startDate),m(a.endDate)));const J=tm(ce=>ce.startDate).center,K=ce=>{const re=m.invert(ce),le=J(u.log,re);if(le===-1)return;const X=u.log[le],ne=X.startDate.getTime();return{datum:X,datumStartTs:ne,datumStartX:m(X.startDate),dataumIndex:le}};let te=null;const oe=ce=>{var Xe;const re=K(ce);if(!re)return;const{datum:le,datumStartX:X,dataumIndex:ne}=re;if(ne===te)return;if(te=ne,D)return H=!0,O(D.x,X);const ue=e.querySelectorAll("span[data-category]");for(const Oe of ue){const Re=Oe.getAttribute("data-category");if(!Re)continue;const ze=((Xe=le.drops.find(([st])=>st===Re))==null?void 0:Xe[1])??0;Oe.textContent=gr(ze)}const de=e.querySelector("div.change-flag");de&&(le.changes?(de.style.display="block",de.textContent=le.changes>1?`${le.changes} CHANGES`:"1 CHANGE"):(de.style.display="none",de.textContent=""));let ve=!1;e.style.opacity==="0"&&(e.style.transitionProperty="opacity",ve=!0);const Te=e.clientWidth;let be=X-Te-10+l.left;be<l.left&&(be=X+10+l.left),e.style.left=`${be}px`,e.style.opacity="1",ve&&setTimeout(()=>{e.style.transitionProperty="all"},0);const xe=Math.round(X+L/2)+.5-j;G.attr("x1",xe).attr("y1",0).attr("x2",xe).attr("y2",_)},ae=ce=>{const re=K(ce);re&&(N(),D={x:re.datumStartX,datum:re.datum},O(re.datumStartX))},_e=ce=>{if(!D)return Y(!0);const re=K(ce);if(!re||!H&&D.datum.startDate.getTime()===re.datum.startDate.getTime())return Y(!0);console.log("PlayerDrops range selected:",D.datum.startDate,re.datum.startDate),clearTimeout(V),z([D.datum.startDate,re.datum.startDate]),Y()},Se=()=>{setTimeout(()=>{Y(!!D),N()},150)};let ge=!1;const we=20;p.append("rect").attr("width",v).attr("height",_).attr("fill","transparent").on("mousemove",function(ce){const[re]=bi(ce);ge?(clearTimeout(V),V=setTimeout(()=>{oe(re)},we)):(ge=!0,oe(re),setTimeout(()=>{ge=!1},we))}).on("mousedown",function(ce){const[re]=bi(ce);ae(re)}).on("mouseup",function(ce){const[re]=bi(ce);_e(re)}),f.on("mouseleave",Se),x=!1}const TFe=C.memo(({categories:e})=>e.slice().reverse().map(n=>h.jsxs("div",{className:"flex items-center text-sm",children:[h.jsx("div",{className:"size-4 mr-1 rounded-full border dark:border-0",style:{backgroundColor:_n[n].color,borderColor:_n[n].border}}),h.jsxs("span",{className:"tracking-wider",children:[_n[n].label,":"]}),h.jsx("div",{className:"flex-grow text-right font-semibold min-w-[3ch] text-muted-foreground",children:h.jsx("span",{"data-category":n})})]},n)));function MFe({chartData:e,chartName:t,width:n,height:r,rangeSelected:i,rangeSetter:s}){const a=C.useRef(null),o=C.useRef(null),l=C.useRef(null),[c,d]=C.useState(""),[u,f]=C.useState(0),g=__(),x={top:8,right:8,bottom:24,left:42,axis:1};return C.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}`),EFe({chartName:t,legendRef:l.current,svgRef:a.current,canvasRef:o.current,size:{width:n,height:r},rangeSelected:i,margins:x,isDarkMode:g,data:e,setRenderError:d,rangeSetter:s}),f(0),d(""),console.timeEnd(`drawDropsTimeline-${t}`)}catch(_){d(_.message??"Unknown error.")}finally{console.groupEnd()}},[e,t,n,r,i,s,g,l,a,o,c]),!n||!r?null:c?h.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: ",c,h.jsx("br",{}),h.jsxs(Ke,{size:"sm",variant:"outline",className:"text-primary",onClick:()=>{f(_=>_+1),d("")},children:["Retry",u?` (${u})`:""]})]}):e.maxDrops?h.jsxs(h.Fragment,{children:[h.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:[h.jsx(TFe,{categories:e.categoriesSorted}),h.jsx("div",{className:"change-flag w-full mt-1 bg-card/75 rounded-md border text-center text-xs tracking-wider"})]}),h.jsx("svg",{ref:a,width:n,height:r,style:{zIndex:1,position:"absolute",top:"0px",left:"0px"}}),h.jsx("canvas",{ref:o,width:n-x.left-x.right,height:r-x.top-x.bottom,style:{zIndex:0,position:"absolute",top:`${x.top}px`,left:`${x.left}px`}})]}):h.jsx(am,{message:"No players disconnected from your server recently."})}const E8=C.memo(MFe),RFe=(e,t,n)=>{const r=n.getTime(),i=e.findIndex(m=>new Date(m.hour).getTime()>=r),s=e.slice(i);if(s.length===0)return null;const a=Object.fromEntries(b8.map(m=>[m,0])),o=Object.fromEntries(A$e.map(m=>[m,0]));let l=s;if(t==="day"){l=[];let m,y;for(const b of s){const S=new Date(b.hour).getDate();if(!y)m=S,y={hour:b.hour,changes:0,dropTypes:[]};else if(S!==m){l.push(y),m=S,y=Ia(b);continue}y.changes+=b.changes;for(const[w,E]of b.dropTypes.slice()){const k=y.dropTypes.find(([T])=>T===w);k?k[1]+=E:y.dropTypes.push([w,E])}}y&&l.push(y)}let c=0,d=0;const u=[];for(const m of l){const y=[],b=[];let S=0,w=0;for(const[E,k]of m.dropTypes)b8.includes(E)?(S+=k,y.push([E,k]),a[E]+=k):(w+=k,b.push([E,k]),o[E]+=k);c=Math.max(c,S),d=Math.max(d,w),u.push({changes:m.changes,expectedDrops:y,unexpectedDrops:b})}const f=Object.entries(a).sort((m,y)=>y[1]-m[1]),g=Object.fromEntries(f.map(([m,y],b)=>[m,b])),x=Object.entries(o).sort((m,y)=>y[1]-m[1]),_=Object.fromEntries(x.map(([m,y],b)=>[m,b])),v=[],p=[];for(let m=0;m<l.length;m++){const y=l[m],b=u[m];if(!b)continue;const S=new Date(y.hour);v.push({startDate:S,changes:b.changes,drops:b.expectedDrops.sort(([w],[E])=>g[w]-g[E])}),p.push({startDate:S,changes:b.changes,drops:b.unexpectedDrops.sort(([w],[E])=>_[w]-_[E])})}return{expectedSeries:v,expectedSeriesMax:c,expectedCategoriesSorted:f.map(([m,y])=>m),unexpectedSeries:p,unexpectedSeriesMax:d,unexpectedCategoriesSorted:x.map(([m,y])=>m)}},AFe=C.memo(({isError:e,dataTs:t,summaryData:n,rangeSelected:r,rangeSetter:i,displayLod:s,setDisplayLod:a})=>{const[o,l]=C.useState({width:0,height:0}),[c,d]=C.useState({width:0,height:0}),u=C.useMemo(()=>{if(!n||!t)return;const f=new Date(t),g=new Date(t);s==="day"?(f.setHours(-(14*24)-12,-15,0,0),g.setHours(12,0,0,0)):(f.setHours(f.getHours()-7*24,-45,0,0),g.setMinutes(30,0,0));const x=RFe(n,s,f);if(!x)return;const _={displayLod:s,startDate:f,endDate:g};return{expected:{..._,maxDrops:x.expectedSeriesMax,categoriesSorted:x.expectedCategoriesSorted,log:x.expectedSeries},unexpected:{..._,maxDrops:x.unexpectedSeriesMax,categoriesSorted:x.unexpectedCategoriesSorted,log:x.unexpectedSeries}}},[n,s]);return h.jsxs("div",{className:"md:rounded-xl border bg-card shadow-sm flex flex-col",children:[h.jsxs("div",{className:"flex flex-row items-center justify-between px-1 sm:px-4 border-b rounded-t-xl bg-secondary/35",children:[h.jsxs("div",{className:"flex items-center py-2 space-x-2",children:[h.jsx("div",{className:"hidden xs:block",children:h.jsx(k0,{className:"size-4"})}),h.jsx("h2",{className:"font-mono text-sm",children:"Expected Player Drops"})]}),h.jsxs($i,{defaultValue:s,onValueChange:a,children:[h.jsx(li,{className:"w-32 h-6 px-3 py-1 text-sm",children:h.jsx(Fi,{placeholder:"Filter by admin"})}),h.jsxs(ci,{className:"px-0",children:[h.jsx(Ue,{value:"day",className:"cursor-pointer",children:"Days"}),h.jsx(Ue,{value:"hour",className:"cursor-pointer",children:"Hours"})]})]})]}),h.jsx("div",{className:"h-32 max-h-32",children:h.jsx(vp,{onDebouncedResize:l,children:u?h.jsx(E8,{chartData:u.expected,chartName:"expected",width:o.width,height:o.height,rangeSelected:r,rangeSetter:i}):h.jsx(_f,{isError:e})})}),h.jsx("div",{className:"flex flex-row items-center justify-between px-1 sm:px-4 border-t border-b bg-secondary/35",children:h.jsxs("div",{className:"flex items-center py-2 gap-2",children:[h.jsx("div",{className:"hidden xs:block",children:h.jsx(k0,{className:"size-4"})}),h.jsx("h2",{className:"font-mono text-sm",children:"Unexpected Player Drops"})]})}),h.jsx("div",{className:"h-52 max-h-52",children:h.jsx(vp,{onDebouncedResize:d,children:u?h.jsx(E8,{chartData:u.unexpected,chartName:"unexpected",width:c.width,height:c.height,rangeSelected:r,rangeSetter:i}):h.jsx(_f,{isError:e})})})]})}),DFe=C.memo(AFe),LFe=(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 jFe(){var c,d;const[e,t]=C.useState("hour"),[n,r]=C.useState(null),{queryKey:i,queryParams:s}=LFe(n,e),a=qt({method:"GET",path:"/playerDropsData"}),o=W$e(`/playerDropsData?${i}`,async()=>{const u=await a({queryParams:s});if(!u)throw new Error("empty_response");if("fail_reason"in u)throw new Error(u.fail_reason);return u}),l=u=>{t(u),r(null)};return h.jsxs("div",{className:"w-full space-y-8",children:[h.jsx(DFe,{isError:!!o.error,dataTs:(c=o.data)==null?void 0:c.ts,summaryData:(d=o.data)==null?void 0:d.summary,rangeSelected:n,rangeSetter:r,displayLod:e,setDisplayLod:l}),o.data&&!o.isValidating?h.jsx(kFe,{windowStart:o.data.detailed.windowStart,windowEnd:o.data.detailed.windowEnd,windowData:o.data.detailed.windowData,rangeSelected:n,displayLod:e}):h.jsx(SFe,{isError:!!o.error})]})}const PFe=[{path:"/players",title:"Players",children:h.jsx(Mue,{})},{path:"/history",title:"History",children:h.jsx(cde,{})},{path:"/insights/player-drops",title:"Player Drops",children:h.jsx(jFe,{})},{path:"/whitelist",title:"Whitelist",children:h.jsx(mi,{legacyUrl:"whitelist"})},{path:"/admins",title:"Admins",children:h.jsx(mi,{legacyUrl:"adminManager"})},{path:"/settings",title:"Settings",children:h.jsx(mi,{legacyUrl:"settings"})},{path:"/system/master-actions",title:"Master Actions",children:h.jsx(mi,{legacyUrl:"masterActions"})},{path:"/system/diagnostics",title:"Diagnostics",children:h.jsx(mi,{legacyUrl:"diagnostics"})},{path:"/system/console-log",title:"Console Log",children:h.jsx(jR,{pageName:"console"})},{path:"/system/action-log",title:"Action Log",children:h.jsx(jR,{pageName:"action"})},{path:"/",title:"Dashboard",children:h.jsx(B$e,{})},{path:"/server/console",title:"Live Console",children:h.jsx(goe,{})},{path:"/server/resources",title:"Resources",children:h.jsx(mi,{legacyUrl:"resources"})},{path:"/server/server-log",title:"Server Log",children:h.jsx(mi,{legacyUrl:"serverLog"})},{path:"/server/cfg-editor",title:"CFG Editor",children:h.jsx(mi,{legacyUrl:"cfgEditor"})},{path:"/server/setup",title:"Server Setup",children:h.jsx(mi,{legacyUrl:"setup"})},{path:"/server/deployer",title:"Server Deployer",children:h.jsx(mi,{legacyUrl:"deployer"})},{path:"/advanced",title:"Advanced",children:h.jsx(mi,{legacyUrl:"advanced"})},{path:"/settings/ban-templates",title:"Ban Templates",children:h.jsx(jfe,{})},{path:"/ban-identifiers",title:"Ban Identifiers",children:h.jsx(Ofe,{})}];function NFe(e){return cO()(e.title),h.jsx($a,{path:e.path,children:e.children})}function OFe(){const e=it(aO),t=ut(oO);return h.jsx(c7,{FallbackComponent:Use,onError:()=>{console.log("Page ErrorBoundary caught an error"),e(!0)},onReset:()=>{console.log("Page ErrorBoundary reset"),ZC("/"),e(!1)},children:h.jsxs(wj,{children:[PFe.map(n=>h.jsx(NFe,{path:n.path,title:n.title,children:n.children},n.path)),!1,h.jsx($a,{component:Gse})]})},t)}var Wd="NavigationMenu",[HE,fW,IFe]=jp(Wd),[KS,$Fe,FFe]=jp(Wd),[WE,hUe]=Hi(Wd,[IFe,FFe]),[BFe,fi]=WE(Wd),[zFe,UFe]=WE(Wd),pW=C.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:i,defaultValue:s,delayDuration:a=200,skipDelayDuration:o=300,orientation:l="horizontal",dir:c,...d}=e,[u,f]=C.useState(null),g=We(t,T=>f(T)),x=vd(c),_=C.useRef(0),v=C.useRef(0),p=C.useRef(0),[m,y]=C.useState(!0),[b="",S]=gs({prop:r,onChange:T=>{const R=T!=="",M=o>0;R?(window.clearTimeout(p.current),M&&y(!1)):(window.clearTimeout(p.current),p.current=window.setTimeout(()=>y(!0),o)),i==null||i(T)},defaultProp:s}),w=C.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>S(""),150)},[S]),E=C.useCallback(T=>{window.clearTimeout(v.current),S(T)},[S]),k=C.useCallback(T=>{b===T?window.clearTimeout(v.current):_.current=window.setTimeout(()=>{window.clearTimeout(v.current),S(T)},a)},[b,S,a]);return C.useEffect(()=>()=>{window.clearTimeout(_.current),window.clearTimeout(v.current),window.clearTimeout(p.current)},[]),h.jsx(gW,{scope:n,isRootMenu:!0,value:b,dir:x,orientation:l,rootNavigationMenu:u,onTriggerEnter:T=>{window.clearTimeout(_.current),m?k(T):E(T)},onTriggerLeave:()=>{window.clearTimeout(_.current),w()},onContentEnter:()=>window.clearTimeout(v.current),onContentLeave:w,onItemSelect:T=>{S(R=>R===T?"":T)},onItemDismiss:()=>S(""),children:h.jsx(Me.nav,{"aria-label":"Main","data-orientation":l,dir:x,...d,ref:g})})});pW.displayName=Wd;var mW="NavigationMenuSub",HFe=C.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:i,defaultValue:s,orientation:a="horizontal",...o}=e,l=fi(mW,n),[c="",d]=gs({prop:r,onChange:i,defaultProp:s});return h.jsx(gW,{scope:n,isRootMenu:!1,value:c,dir:l.dir,orientation:a,rootNavigationMenu:l.rootNavigationMenu,onTriggerEnter:u=>d(u),onItemSelect:u=>d(u),onItemDismiss:()=>d(""),children:h.jsx(Me.div,{"data-orientation":a,...o,ref:t})})});HFe.displayName=mW;var gW=e=>{const{scope:t,isRootMenu:n,rootNavigationMenu:r,dir:i,orientation:s,children:a,value:o,onItemSelect:l,onItemDismiss:c,onTriggerEnter:d,onTriggerLeave:u,onContentEnter:f,onContentLeave:g}=e,[x,_]=C.useState(null),[v,p]=C.useState(new Map),[m,y]=C.useState(null);return h.jsx(BFe,{scope:t,isRootMenu:n,rootNavigationMenu:r,value:o,previousValue:Tk(o),baseId:Ir(),dir:i,orientation:s,viewport:x,onViewportChange:_,indicatorTrack:m,onIndicatorTrackChange:y,onTriggerEnter:Mt(d),onTriggerLeave:Mt(u),onContentEnter:Mt(f),onContentLeave:Mt(g),onItemSelect:Mt(l),onItemDismiss:Mt(c),onViewportContentChange:C.useCallback((b,S)=>{p(w=>(w.set(b,S),new Map(w)))},[]),onViewportContentRemove:C.useCallback(b=>{p(S=>S.has(b)?(S.delete(b),new Map(S)):S)},[]),children:h.jsx(HE.Provider,{scope:t,children:h.jsx(zFe,{scope:t,items:v,children:a})})})},vW="NavigationMenuList",yW=C.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=fi(vW,n),s=h.jsx(Me.ul,{"data-orientation":i.orientation,...r,ref:t});return h.jsx(Me.div,{style:{position:"relative"},ref:i.onIndicatorTrackChange,children:h.jsx(HE.Slot,{scope:n,children:i.isRootMenu?h.jsx(MW,{asChild:!0,children:s}):s})})});yW.displayName=vW;var _W="NavigationMenuItem",[WFe,xW]=WE(_W),bW=C.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,...i}=e,s=Ir(),a=r||s||"LEGACY_REACT_AUTO_VALUE",o=C.useRef(null),l=C.useRef(null),c=C.useRef(null),d=C.useRef(()=>{}),u=C.useRef(!1),f=C.useCallback((x="start")=>{if(o.current){d.current();const _=XS(o.current);_.length&&YE(x==="start"?_:_.reverse())}},[]),g=C.useCallback(()=>{if(o.current){const x=XS(o.current);x.length&&(d.current=QFe(x))}},[]);return h.jsx(WFe,{scope:n,value:a,triggerRef:l,contentRef:o,focusProxyRef:c,wasEscapeCloseRef:u,onEntryKeyDown:f,onFocusProxyEnter:f,onRootContentClose:g,onContentFocusOutside:g,children:h.jsx(Me.li,{...i,ref:t})})});bW.displayName=_W;var GS="NavigationMenuTrigger",wW=C.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,disabled:r,...i}=e,s=fi(GS,e.__scopeNavigationMenu),a=xW(GS,e.__scopeNavigationMenu),o=C.useRef(null),l=We(o,a.triggerRef,t),c=AW(s.baseId,a.value),d=DW(s.baseId,a.value),u=C.useRef(!1),f=C.useRef(!1),g=a.value===s.value;return h.jsxs(h.Fragment,{children:[h.jsx(HE.ItemSlot,{scope:n,value:a.value,children:h.jsx(RW,{asChild:!0,children:h.jsx(Me.button,{id:c,disabled:r,"data-disabled":r?"":void 0,"data-state":KE(g),"aria-expanded":g,"aria-controls":d,...i,ref:l,onPointerEnter:me(e.onPointerEnter,()=>{f.current=!1,a.wasEscapeCloseRef.current=!1}),onPointerMove:me(e.onPointerMove,Hv(()=>{r||f.current||a.wasEscapeCloseRef.current||u.current||(s.onTriggerEnter(a.value),u.current=!0)})),onPointerLeave:me(e.onPointerLeave,Hv(()=>{r||(s.onTriggerLeave(),u.current=!1)})),onClick:me(e.onClick,()=>{s.onItemSelect(a.value),f.current=g}),onKeyDown:me(e.onKeyDown,x=>{const v={horizontal:"ArrowDown",vertical:s.dir==="rtl"?"ArrowLeft":"ArrowRight"}[s.orientation];g&&x.key===v&&(a.onEntryKeyDown(),x.preventDefault())})})})}),g&&h.jsxs(h.Fragment,{children:[h.jsx(fI,{"aria-hidden":!0,tabIndex:0,ref:a.focusProxyRef,onFocus:x=>{const _=a.contentRef.current,v=x.relatedTarget,p=v===o.current,m=_==null?void 0:_.contains(v);(p||!m)&&a.onFocusProxyEnter(p?"start":"end")}}),s.viewport&&h.jsx("span",{"aria-owns":d})]})]})});wW.displayName=GS;var VFe="NavigationMenuLink",T8="navigationMenu.linkSelect",SW=C.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,active:r,onSelect:i,...s}=e;return h.jsx(RW,{asChild:!0,children:h.jsx(Me.a,{"data-active":r?"":void 0,"aria-current":r?"page":void 0,...s,ref:t,onClick:me(e.onClick,a=>{const o=a.target,l=new CustomEvent(T8,{bubbles:!0,cancelable:!0});if(o.addEventListener(T8,c=>i==null?void 0:i(c),{once:!0}),w0(o,l),!l.defaultPrevented&&!a.metaKey){const c=new CustomEvent(Xg,{bubbles:!0,cancelable:!0});w0(o,c)}},{checkForDefaultPrevented:!1})})})});SW.displayName=VFe;var VE="NavigationMenuIndicator",CW=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=fi(VE,e.__scopeNavigationMenu),s=!!i.value;return i.indicatorTrack?dj.createPortal(h.jsx(wn,{present:n||s,children:h.jsx(qFe,{...r,ref:t})}),i.indicatorTrack):null});CW.displayName=VE;var qFe=C.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=fi(VE,n),s=fW(n),[a,o]=C.useState(null),[l,c]=C.useState(null),d=i.orientation==="horizontal",u=!!i.value;C.useEffect(()=>{var _;const x=(_=s().find(v=>v.value===i.value))==null?void 0:_.ref.current;x&&o(x)},[s,i.value]);const f=()=>{a&&c({size:d?a.offsetWidth:a.offsetHeight,offset:d?a.offsetLeft:a.offsetTop})};return QS(a,f),QS(i.indicatorTrack,f),l?h.jsx(Me.div,{"aria-hidden":!0,"data-state":u?"visible":"hidden","data-orientation":i.orientation,...r,ref:t,style:{position:"absolute",...d?{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}),nd="NavigationMenuContent",kW=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=fi(nd,e.__scopeNavigationMenu),s=xW(nd,e.__scopeNavigationMenu),a=We(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?h.jsx(YFe,{forceMount:n,...l,ref:a}):h.jsx(wn,{present:n||o,children:h.jsx(EW,{"data-state":KE(o),...l,ref:a,onPointerEnter:me(e.onPointerEnter,i.onContentEnter),onPointerLeave:me(e.onPointerLeave,Hv(i.onContentLeave)),style:{pointerEvents:!o&&i.isRootMenu?"none":void 0,...l.style}})})});kW.displayName=nd;var YFe=C.forwardRef((e,t)=>{const n=fi(nd,e.__scopeNavigationMenu),{onViewportContentChange:r,onViewportContentRemove:i}=n;return un(()=>{r(e.value,{ref:t,...e})},[e,t,r]),un(()=>()=>i(e.value),[e.value,i]),null}),Xg="navigationMenu.rootContentDismiss",EW=C.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,triggerRef:i,focusProxyRef:s,wasEscapeCloseRef:a,onRootContentClose:o,onContentFocusOutside:l,...c}=e,d=fi(nd,n),u=C.useRef(null),f=We(u,t),g=AW(d.baseId,r),x=DW(d.baseId,r),_=fW(n),v=C.useRef(null),{onItemDismiss:p}=d;C.useEffect(()=>{const y=u.current;if(d.isRootMenu&&y){const b=()=>{var S;p(),o(),y.contains(document.activeElement)&&((S=i.current)==null||S.focus())};return y.addEventListener(Xg,b),()=>y.removeEventListener(Xg,b)}},[d.isRootMenu,e.value,i,p,o]);const m=C.useMemo(()=>{const b=_().map(R=>R.value);d.dir==="rtl"&&b.reverse();const S=b.indexOf(d.value),w=b.indexOf(d.previousValue),E=r===d.value,k=w===b.indexOf(r);if(!E&&!k)return v.current;const T=(()=>{if(S!==w){if(E&&w!==-1)return S>w?"from-end":"from-start";if(k&&S!==-1)return S>w?"to-start":"to-end"}return null})();return v.current=T,T},[d.previousValue,d.value,d.dir,_,r]);return h.jsx(MW,{asChild:!0,children:h.jsx(yd,{id:x,"aria-labelledby":g,"data-motion":m,"data-orientation":d.orientation,...c,ref:f,disableOutsidePointerEvents:!1,onDismiss:()=>{var b;const y=new Event(Xg,{bubbles:!0,cancelable:!0});(b=u.current)==null||b.dispatchEvent(y)},onFocusOutside:me(e.onFocusOutside,y=>{var S;l();const b=y.target;(S=d.rootNavigationMenu)!=null&&S.contains(b)&&y.preventDefault()}),onPointerDownOutside:me(e.onPointerDownOutside,y=>{var E;const b=y.target,S=_().some(k=>{var T;return(T=k.ref.current)==null?void 0:T.contains(b)}),w=d.isRootMenu&&((E=d.viewport)==null?void 0:E.contains(b));(S||w||!d.isRootMenu)&&y.preventDefault()}),onKeyDown:me(e.onKeyDown,y=>{var w;const b=y.altKey||y.ctrlKey||y.metaKey;if(y.key==="Tab"&&!b){const E=XS(y.currentTarget),k=document.activeElement,T=E.findIndex(L=>L===k),M=y.shiftKey?E.slice(0,T).reverse():E.slice(T+1,E.length);YE(M)?y.preventDefault():(w=s.current)==null||w.focus()}}),onEscapeKeyDown:me(e.onEscapeKeyDown,y=>{a.current=!0})})})}),qE="NavigationMenuViewport",TW=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=!!fi(qE,e.__scopeNavigationMenu).value;return h.jsx(wn,{present:n||s,children:h.jsx(KFe,{...r,ref:t})})});TW.displayName=qE;var KFe=C.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,children:r,...i}=e,s=fi(qE,n),a=We(t,s.onViewportChange),o=UFe(nd,e.__scopeNavigationMenu),[l,c]=C.useState(null),[d,u]=C.useState(null),f=l?(l==null?void 0:l.width)+"px":void 0,g=l?(l==null?void 0:l.height)+"px":void 0,x=!!s.value,_=x?s.value:s.previousValue;return QS(d,()=>{d&&c({width:d.offsetWidth,height:d.offsetHeight})}),h.jsx(Me.div,{"data-state":KE(x),"data-orientation":s.orientation,...i,ref:a,style:{pointerEvents:!x&&s.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":f,"--radix-navigation-menu-viewport-height":g,...i.style},onPointerEnter:me(e.onPointerEnter,s.onContentEnter),onPointerLeave:me(e.onPointerLeave,Hv(s.onContentLeave)),children:Array.from(o.items).map(([p,{ref:m,forceMount:y,...b}])=>{const S=_===p;return h.jsx(wn,{present:y||S,children:h.jsx(EW,{...b,ref:Tp(m,w=>{S&&w&&u(w)})})},p)})})}),GFe="FocusGroup",MW=C.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=fi(GFe,n);return h.jsx(KS.Provider,{scope:n,children:h.jsx(KS.Slot,{scope:n,children:h.jsx(Me.div,{dir:i.dir,...r,ref:t})})})}),M8=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],XFe="FocusGroupItem",RW=C.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=$Fe(n),s=fi(XFe,n);return h.jsx(KS.ItemSlot,{scope:n,children:h.jsx(Me.button,{...r,ref:t,onKeyDown:me(e.onKeyDown,a=>{if(["Home","End",...M8].includes(a.key)){let l=i().map(u=>u.ref.current);if([s.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(a.key)&&l.reverse(),M8.includes(a.key)){const u=l.indexOf(a.currentTarget);l=l.slice(u+1)}setTimeout(()=>YE(l)),a.preventDefault()}})})})});function XS(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 YE(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}function QFe(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 QS(e,t){const n=Mt(t);un(()=>{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 KE(e){return e?"open":"closed"}function AW(e,t){return`${e}-trigger-${t}`}function DW(e,t){return`${e}-content-${t}`}function Hv(e){return t=>t.pointerType==="mouse"?e(t):void 0}var LW=pW,jW=yW,JFe=bW,PW=wW,ZFe=SW,NW=CW,OW=kW,IW=TW;const JS=C.forwardRef(({className:e,children:t,...n},r)=>h.jsxs(LW,{ref:r,className:ie("relative z-10 flex max-w-max flex-1 items-center justify-center",e),...n,children:[t,h.jsx(zW,{})]}));JS.displayName=LW.displayName;const ZS=C.forwardRef(({className:e,...t},n)=>h.jsx(jW,{ref:n,className:ie("group flex flex-1 list-none items-center justify-center space-x-1",e),...t}));ZS.displayName=jW.displayName;const $W=JFe,eBe=Sa("group inline-flex h-10 w-max items-center justify-center rounded-md px-4 py-2 text-sm font-medium transition-colors focus:bg-secondary focus:text-secondary-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-secondary/50 data-[state=open]:bg-secondary/50"),FW=C.forwardRef(({className:e,children:t,...n},r)=>h.jsxs(PW,{ref:r,className:ie(eBe(),"group",e),...n,children:[t," ",h.jsx(ud,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]}));FW.displayName=PW.displayName;const BW=C.forwardRef(({className:e,...t},n)=>h.jsx(OW,{ref:n,className:ie("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}));BW.displayName=OW.displayName;const tBe=ZFe,zW=C.forwardRef(({className:e,...t},n)=>h.jsx("div",{className:ie("absolute left-0 top-full flex justify-center"),children:h.jsx(IW,{className:ie("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})}));zW.displayName=IW.displayName;const nBe=C.forwardRef(({className:e,...t},n)=>h.jsx(NW,{ref:n,className:ie("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:h.jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}));nBe.displayName=NW.displayName;function rBe(e,t){const n=ut(aO),r=j1(),i=m1(),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 h.jsx(ca,{ref:t,href:e.href,onClick:s,className:e.className,children:e.children})}const GE=C.forwardRef(rBe);function qn({href:e,children:t,className:n,disabled:r}){const[i]=a1(e);return r?h.jsxs(Ko,{children:[h.jsx(Go,{className:"cursor-help",children:h.jsx(Ke,{variant:"ghost",className:"w-full justify-start py-1",disabled:!0,children:t})}),h.jsxs(Ws,{side:"right",className:"text-destructive-inline text-center",children:["You do not have permission ",h.jsx("br",{}),"to access this page."]})]}):h.jsx(GE,{href:e,isActive:i,className:ie(Mp({variant:i?"secondary":"ghost"}),"w-full justify-start py-1",n),children:t})}function eC({href:e,children:t,className:n}){const[r]=a1(e);return h.jsx(GE,{href:e,isActive:r,className:n,children:t})}function UW({featName:e,durationDays:t,children:n}){const r=`dynamicNewFeatTs-${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 R8=rt.memo(UW);function iBe({badgeText:e,featName:t,durationDays:n}){return h.jsx(UW,{featName:t,durationDays:n,children:h.jsx("span",{className:"rounded bg-accent text-accent-foreground text-2xs tracking-wider font-semibold px-1 ml-1.5",children:e??"NEW"})})}rt.memo(iBe);const A8=Sa("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 Gh(e){const[t]=a1(e.href);return h.jsx(tBe,{asChild:!0,active:t,children:e.disabled?h.jsxs(Ko,{children:[h.jsx(Go,{className:"cursor-help",children:h.jsx("a",{className:ie(A8({variant:"default"}),"pointer-events-none opacity-50",e.className),children:e.children})}),h.jsxs(Ws,{side:"bottom",className:"text-destructive-inline text-center",children:["You do not have permission ",h.jsx("br",{}),"to access this page."]})]}):h.jsx(GE,{href:e.href,isActive:t,className:ie(A8({variant:t?"secondary":"default"}),e.className),children:e.children})})}function Sc(e){return h.jsx($W,{children:h.jsx(Gh,{href:e.href,disabled:e.disabled,className:e.className,children:e.children})})}function sBe(){const{hasPerm:e}=di();return h.jsxs("div",{className:"space-x-1 flex flex-row select-none",children:[h.jsx(JS,{children:h.jsxs(ZS,{children:[h.jsx(Sc,{href:"/players",children:"Players"}),h.jsx(Sc,{href:"/history",children:"History"}),h.jsxs(Sc,{href:"/insights/player-drops",children:["Player Drops",h.jsx(R8,{featName:"newPlayerDropsPage",durationDays:7,children:h.jsx("div",{className:"ml-1 mb-2 rounded-md size-2 bg-accent"})})]}),h.jsx(Sc,{href:"/whitelist",children:"Whitelist"}),h.jsx(Sc,{href:"/admins",disabled:!e("manage.admins"),children:"Admins"}),h.jsxs(Sc,{href:"/settings",disabled:!e("settings.view"),children:["Settings",h.jsx(R8,{featName:"hideAdminNames",durationDays:7,children:h.jsx("div",{className:"ml-1 mb-2 rounded-md size-2 bg-accent"})})]})]})}),h.jsx(JS,{children:h.jsx(ZS,{className:"aaaaaaaaaaa",children:h.jsxs($W,{children:[h.jsx(FW,{onClick:t=>{t.currentTarget.dataset.state==="open"&&t.preventDefault()},children:"System"}),h.jsxs(BW,{className:"flex flex-col gap-2 p-4 list-none",children:[h.jsx(Gh,{className:"w-36 justify-start",href:"/system/master-actions",children:"Master Actions"}),h.jsx(Gh,{className:"w-36 justify-start",href:"/system/diagnostics",children:"Diagnostics"}),h.jsx(Gh,{className:"w-36 justify-start",href:"/system/console-log",disabled:!e("txadmin.log.view"),children:"Console Log"}),h.jsx(Gh,{className:"w-36 justify-start",href:"/system/action-log",disabled:!e("txadmin.log.view"),children:"Action Log"})]})]})})})]})}var XE="Avatar",[oBe,fUe]=Hi(XE),[aBe,HW]=oBe(XE),WW=C.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,s]=C.useState("idle");return h.jsx(aBe,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:s,children:h.jsx(Me.span,{...r,ref:t})})});WW.displayName=XE;var VW="AvatarImage",qW=C.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...s}=e,a=HW(VW,n),o=lBe(r,s.referrerPolicy),l=Mt(c=>{i(c),a.onImageLoadingStatusChange(c)});return un(()=>{o!=="idle"&&l(o)},[o,l]),o==="loaded"?h.jsx(Me.img,{...s,ref:t,src:r}):null});qW.displayName=VW;var YW="AvatarFallback",KW=C.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,s=HW(YW,n),[a,o]=C.useState(r===void 0);return C.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>o(!0),r);return()=>window.clearTimeout(l)}},[r]),a&&s.imageLoadingStatus!=="loaded"?h.jsx(Me.span,{...i,ref:t}):null});KW.displayName=YW;function lBe(e,t){const[n,r]=C.useState("idle");return un(()=>{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 GW=WW,XW=qW,QW=KW;const JW=C.forwardRef(({className:e,...t},n)=>h.jsx(GW,{ref:n,className:ie("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));JW.displayName=GW.displayName;const ZW=C.forwardRef(({className:e,...t},n)=>h.jsx(XW,{ref:n,className:ie("aspect-square h-full w-full",e),...t}));ZW.displayName=XW.displayName;const eV=C.forwardRef(({className:e,...t},n)=>h.jsx(QW,{ref:n,className:ie("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));eV.displayName=QW.displayName;const D8=["#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"],cBe=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()},uBe=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 D8[Math.abs(t)%D8.length]};function tV({username:e,profilePicture:t,className:n}){return h.jsxs(JW,{className:ie("bg-zinc-200 dark:bg-zinc-800 transition-colors text-zinc-200",n),children:[t&&h.jsx(ZW,{src:t,alt:e}),h.jsx(eV,{className:n,style:{backgroundColor:uBe(e)},delayMs:t?1e3:void 0,children:cBe(e)})]})}function nV(e){return UN({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 QE({style:e,className:t}){const n=C.useId(),r=C.useId();return h.jsxs("svg",{className:t,style:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1115 288",children:[h.jsxs("mask",{id:n,fill:"#fff",children:[h.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"}),h.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"}),h.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"}),h.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"}),h.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"}),h.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"})]}),h.jsx("rect",{fill:`url(#${r})`,mask:`url(#${n})`,width:"100%",height:"100%"}),h.jsxs("linearGradient",{id:r,gradientTransform:"rotate(90)",children:[h.jsx("stop",{offset:"0.2",stopColor:"#5BBE83"}),h.jsx("stop",{offset:"1",stopColor:"#00888F"})]})]})}function dBe({style:e,className:t}){const n=C.useId(),r=C.useId();return h.jsxs("svg",{className:t,style:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 288 288",children:[h.jsx("mask",{id:n,fill:"#fff",children:h.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"})}),h.jsx("rect",{fill:`url(#${r})`,mask:`url(#${n})`,width:"100%",height:"100%"}),h.jsxs("linearGradient",{id:r,gradientTransform:"rotate(90)",children:[h.jsx("stop",{offset:"0.2",stopColor:"#5BBE83"}),h.jsx("stop",{offset:"1",stopColor:"#00888F"})]})]})}function hBe(){const e=ut(L1),t=ut(OP);return h.jsxs("div",{className:"flex justify-start",children:[h.jsx("h1",{className:"line-clamp-1 text-base break-all",children:t}),h.jsxs("span",{children:[": ",h.jsx("span",{className:"font-mono",title:"players connected",children:e})]})]})}const JE=`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 fBe({className:e}){const{setIsSheetOpen:t}=jP();return h.jsxs("button",{className:ie(JE,e),title:"Server Menu",onClick:()=>t(!0),children:[h.jsx(fJ,{className:"h-6 w-6 sm:h-5 sm:w-5"}),h.jsx("div",{className:"hidden sm:flex flex-row min-w-max align-middle",children:"Server"})]})}function pBe({className:e}){const{setIsSheetOpen:t}=LP();return h.jsxs("button",{className:ie(JE,e),title:"Global Menu",onClick:()=>t(!0),children:[h.jsx(hJ,{className:"h-6 w-6 sm:h-5 sm:w-5"}),h.jsx("div",{className:"hidden sm:flex flex-row min-w-max",children:"Menu"})]})}function mBe({className:e}){const{setIsSheetOpen:t}=PP(),n=ut(L1);return h.jsxs("button",{className:ie(JE,e),title:"Global Menu",onClick:()=>t(!0),children:[h.jsx(yJ,{className:"h-6 w-6 sm:h-5 sm:w-5"}),h.jsxs("div",{className:"hidden sm:flex flex-row min-w-max",children:["Players",h.jsxs("span",{className:"hidden lg:inline-block font-mono",children:[": ",n]})]})]})}function gBe(){const{authData:e,logout:t}=$l(),{theme:n,setTheme:r}=mH(),{setAccountModalOpen:i}=m5();if(!e)return null;const s=()=>{r(n==="light"?"dark":"light")},a=()=>{i(!0)},o=()=>{Fl("https://discord.gg/uAmsGa2")},l=()=>{t.mutate()};return h.jsxs(Zc,{children:[h.jsxs(eu,{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:[h.jsx("span",{className:"hidden xl:block text-muted-foreground",children:e.name}),h.jsx(tV,{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})]}),h.jsxs(rl,{children:[window.txConsts.isWebInterface&&h.jsxs(ls,{className:"cursor-pointer",onClick:s,children:[h.jsxs("span",{className:"hidden dark:flex items-center",children:[h.jsx(jJ,{className:"mr-2 h-4 w-4"}),"Light Mode"]}),h.jsxs("span",{className:"flex dark:hidden items-center",children:[h.jsx(pJ,{className:"mr-2 h-4 w-4"}),"Dark Mode"]})]}),h.jsxs(ls,{className:"cursor-pointer",onClick:a,children:[h.jsx(aJ,{className:"mr-2 h-4 w-4"}),"Your Account"]}),h.jsxs(ls,{className:"cursor-pointer",onClick:o,children:[h.jsx(nV,{size:"14",className:"mr-2"}),"Support"]}),window.txConsts.isWebInterface&&h.jsxs(h.Fragment,{children:[h.jsx(tu,{}),h.jsxs(ls,{className:"cursor-pointer",onClick:l,children:[h.jsx(cJ,{className:"mr-2 h-4 w-4"}),"Logout"]})]})]})]})}function vBe(){return h.jsx("header",{className:`sticky top-0 z-20 flex flex-col items-center justify-center
            border-b bg-card text-card-foreground border-card-background`,children:h.jsxs("div",{className:"h-14 lg:px-3 px-2 w-full max-w-[1920px] flex flex-row justify-between transition-all",children:[h.jsxs("div",{className:"flex flex-row items-center flex-grow gap-5 mr-5",children:[h.jsx("div",{className:"w-sidebar hidden xl:flex justify-center",children:h.jsx(eC,{href:"/",children:h.jsx(QE,{className:"h-9 hover:scale-105 hover:brightness-110"})})}),h.jsx(eC,{href:"/",className:"hidden sm:max-xl:block",children:h.jsx(dBe,{className:"h-8 w-8 lg:h-10 lg:w-10 hover:scale-105 hover:brightness-110"})}),h.jsx("div",{className:"lg:hidden",children:h.jsx(hBe,{})}),h.jsx("nav",{className:"hidden lg:block flex-grow",children:h.jsx(sBe,{})})]}),h.jsxs("div",{className:"flex flex-row items-center gap-2 sm:gap-3",children:[h.jsx(fBe,{className:"lg:hidden"}),h.jsx(pBe,{className:"lg:hidden"}),h.jsx(mBe,{className:"xl:hidden"}),h.jsx(gBe,{})]})]})})}function yBe(){return ut(OP)}function _Be({pendingStep:e}){const[t]=wa(),[n,r]=C.useState(""),i=C.useRef("");return C.useEffect(()=>{let s="";if(e==="setup"&&!t.startsWith("/server/setup")?(s="/server/setup",i.current="Go to the setup page!"):e==="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]),h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-4",children:[h.jsx(hP,{className:"h-12 w-12 opacity-75 animate-pulse"}),h.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?h.jsx(ju,{href:n,className:"animate-toastbar-enter",children:i.current}):h.jsx(ju,{href:"#",className:"animate-toastbar-leave pointer-events-none",children:i.current||h.jsx(h.Fragment,{children:" "})})]})}function xBe(){const e=ut(x5),{hasPerm:t}=di();return h.jsxs("div",{className:"relative",children:[e&&h.jsx(_Be,{pendingStep:e}),h.jsxs("div",{className:ie(e&&"opacity-0 pointer-events-none"),children:[h.jsx("h2",{className:"mb-1.5 text-lg font-semibold tracking-tight line-clamp-1",children:h.jsx(yBe,{})}),h.jsxs("div",{className:"space-y-1 select-none",children:[h.jsxs(qn,{href:"/",children:[h.jsx(lJ,{className:"mr-2 h-4 w-4"}),"Dashboard"]}),h.jsxs(qn,{href:"/server/console",disabled:!t("console.view"),children:[h.jsx(RJ,{className:"mr-2 h-4 w-4"}),"Live Console"]}),h.jsxs(qn,{href:"/server/resources",children:[h.jsx(lP,{className:"mr-2 h-4 w-4"}),"Resources"]}),h.jsxs(qn,{href:"/server/server-log",disabled:!t("server.log.view"),children:[h.jsx(ZQ,{className:"mr-2 h-4 w-4"}),"Server Log"]}),h.jsxs(qn,{href:"/server/cfg-editor",disabled:!t("server.cfg.editor"),children:[h.jsx(tJ,{className:"mr-2 h-4 w-4"}),"CFG Editor"]}),window.txConsts.showAdvanced&&h.jsxs(qn,{href:"/advanced",className:"text-accent",disabled:!t("all_permisisons"),children:[h.jsx(JQ,{className:"mr-2 h-4 w-4"}),"Advanced"]}),!1]})]})]})}function bBe({style:e}){return h.jsx("svg",{style:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:h.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 wBe({style:e}){return h.jsx("svg",{style:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:h.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 Ah=Sa(`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 SBe(){const e=ut(x5),t=ut(aZ),n=AP(),r=p1(),i=m1(),{hasPerm:s}=di(),a=qt({method:"POST",path:"/fxserver/controls"}),o=qt({method:"POST",path:"/fxserver/commands"}),l=_=>{const v={start:"Starting server",stop:"Stopping server",restart:"Restarting server"},p=`${v[_]}...`,m=()=>{i(),a({data:{action:_},toastLoadingMessage:p})};_==="start"?m():n({title:v[_],message:`Are you sure you want to ${_} the server?`,onConfirm:m})},c=()=>{l(t?"stop":"start")},d=()=>{t&&l("restart")},u=()=>{t&&r({title:"Send Announcement",message:"Type the message to be broadcasted to all players.",placeholder:"announcement message",submitLabel:"Send",required:!0,onSubmit:_=>{i(),o({data:{action:"admin_broadcast",parameter:_},toastLoadingMessage:"Sending announcement..."})}})},f=()=>{t&&r({title:"Kick All Players",message:"Type the kick reason or leave it blank (press enter)",placeholder:"kick reason",submitLabel:"Send",onSubmit:_=>{i(),o({data:{action:"kick_all",parameter:_},toastLoadingMessage:"Kicking players..."})}})},g=s("control.server"),x=s("announcement");return e?h.jsx("div",{className:"w-full h-8 text-center tracking-wider font-light opacity-75",children:"Server not configured."}):h.jsxs("div",{className:"flex flex-row justify-between gap-2",children:[h.jsxs(Ko,{children:[h.jsx(Go,{asChild:!0,children:t?h.jsx("button",{onClick:c,className:Ah({type:"destructive"}),disabled:!g,children:h.jsx(_J,{className:"h-5"})}):h.jsxs("div",{className:"relative flex flex-grow inset-0",children:[h.jsx("div",{className:"absolute inset-0 bg-success animate-pulse rounded blur-sm"}),h.jsx("button",{onClick:c,className:ie(Ah({type:"success"}),"relative"),disabled:!g,children:h.jsx(xJ,{className:"h-5"})})]})}),h.jsx(Ws,{className:ie(!g&&"text-destructive-inline text-center"),children:g?h.jsx("p",{children:t?"Stop the server":"Start the server! 🚀"}):h.jsxs("p",{children:["You do not have permission ",h.jsx("br",{}),"to control the server."]})})]}),h.jsxs(Ko,{children:[h.jsx(Go,{asChild:!0,children:h.jsx("button",{onClick:d,className:ie(Ah({type:"warning"})),disabled:!g||!t,children:h.jsx(wJ,{className:"h-5"})})}),h.jsx(Ws,{className:ie(!g&&"text-destructive-inline text-center"),children:g?h.jsx("p",{children:"Restart Server"}):h.jsxs("p",{children:["You do not have permission ",h.jsx("br",{}),"to control the server."]})})]}),h.jsxs(Ko,{children:[h.jsx(Go,{asChild:!0,children:h.jsx("button",{onClick:f,className:Ah(),disabled:!g||!t,children:h.jsx(bBe,{style:{height:"1.25rem",width:"1.5rem",fill:"currentcolor"}})})}),h.jsx(Ws,{className:ie(!g&&"text-destructive-inline text-center"),children:g?h.jsx("p",{children:"Kick All Players"}):h.jsxs("p",{children:["You do not have permission ",h.jsx("br",{}),"to control the server."]})})]}),h.jsxs(Ko,{children:[h.jsx(Go,{asChild:!0,children:h.jsx("button",{onClick:u,className:Ah(),disabled:!x||!t,children:h.jsx(dJ,{className:"h-5"})})}),h.jsx(Ws,{className:ie(!x&&"text-destructive-inline text-center"),children:x?h.jsx("p",{children:"Send Announcement"}):h.jsxs("p",{children:["You do not have permission ",h.jsx("br",{}),"to send an Announcement."]})})]})]})}const CBe=Sa("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 hg({children:e,tooltip:t,type:n}){return h.jsxs(Ko,{children:[h.jsx(Go,{asChild:!0,children:h.jsx("span",{className:CBe({type:n}),children:e})}),h.jsx(Ws,{side:"right",children:h.jsx("p",{children:t})})]})}const L8=["READY","CONNECTING","RECONNECTING","IDLE","NEARLY","DISCONNECTED","WAITING_FOR_GUILDS","IDENTIFYING","RESUMING"];function kBe(){const e=IP();let t="--",n="--",r="default",i="--",s="--",a="default",o="--",l="--",c="default";return e&&(t=e.server.status,e.server.status==="ONLINE"?(r="success",n="Resources running, accepting connections."):e.server.status==="PARTIAL"?(r="warning",n="Resources not running or not accepting connections."):e.server.status==="OFFLINE"?(r="destructive",n="Server is offline."):(r="destructive",n="Unknown server status."),e.server.whitelist==="disabled"?(i="DISABLED",s="Anyone can join."):e.server.whitelist==="adminOnly"?(i="ADMIN",a="warning",s="Only admins can join."):e.server.whitelist==="guildMember"?(i="MEMBER",s="Only guild members can join."):e.server.whitelist==="guildRoles"?(i="ROLE",s="Only guild members with the specified roles can join."):e.server.whitelist==="approvedLicense"&&(i="LICENSE",s="Only players with an approved license can join."),e.discord===!1?(o="DISABLED",c="default",l="Discord bot is disabled."):e.discord===0?(o="READY",c="default",l="Discord bot is ready."):(o=`CODE-${e.discord}`,c="destructive",l=L8[e.discord]?`Bot ws status: ${L8[e.discord]}`:"Unknown status code")),h.jsxs("div",{className:"flex flex-col gap-[0.375rem]",children:[h.jsxs("div",{className:"flex justify-between items-center text-muted-foreground text-sm gap-1.5",children:["Server:",h.jsx(hg,{tooltip:n,type:r,children:t})]}),h.jsxs("div",{className:"flex justify-between items-center text-muted-foreground text-sm gap-1.5",children:["Process:",h.jsx(hg,{tooltip:"Status of the FXServer process.",children:(e==null?void 0:e.server.process.toUpperCase())??"--"})]}),h.jsxs("div",{className:"flex justify-between items-center text-muted-foreground text-sm gap-1.5",children:["Whitelist:",h.jsx(hg,{tooltip:s,type:a,children:i})]}),h.jsxs("div",{className:"flex justify-between items-center text-muted-foreground text-sm gap-1.5",children:["Discord Bot:",h.jsx(hg,{tooltip:l,type:c,children:o})]})]})}const rV=Intl.DateTimeFormat().resolvedOptions().timeZone,EBe=h.jsxs("p",{className:"text-destructive",children:["Server's timezone: ",h.jsx("b",{children:window.txConsts.serverTimezone})," ",h.jsx("br",{}),"Your timezone: ",h.jsx("b",{children:rV})," ",h.jsx("br",{}),"Either use relative times, or make sure the scheduled is based on the server timezone."]}),j8={suggestions:["+5","+10","+15","+30"],title:"When should the server restart?",message:h.jsxs(h.Fragment,{children:[h.jsxs("p",{children:["Possible formats: ",h.jsx("br",{}),h.jsxs("ul",{className:"list-disc ml-4",children:[h.jsxs("li",{children:[h.jsx(Mn,{children:"+MM"})," relative time in minutes (example: ",h.jsx(Mn,{children:"+15"})," for 15 minutes from now.)"]}),h.jsxs("li",{children:[h.jsx(Mn,{children:"HH:MM"})," absolute 24-hour time (example: ",h.jsx(Mn,{children:"23:30"})," for 11:30 PM.)"]})]})]}),rV!==window.txConsts.serverTimezone&&EBe]}),placeholder:"+15",required:!0,isWide:!0},TBe=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 MBe(){const e=m1(),t=p1(),{hasPerm:n}=di(),r=qt({method:"POST",path:"/fxserver/schedule"}),i=IP();if(!i)return h.jsxs("div",{children:[h.jsx("h2",{className:"mb-1 text-lg font-semibold tracking-tight",children:"Next Restart:"}),h.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,c=!1,d=!1;const u=typeof s.nextRelativeMs=="number";if(u){const m=s.nextIsTemp?"(temp)":"",y=I0(s.nextRelativeMs,{units:["h","m"]}),b=s.nextRelativeMs<6e4;b?(l=!0,a=`right now ${m}`):a=`in ${y} ${m}`,s.nextSkip?(o="text-muted-foreground line-through",b||(d=!0)):(o="text-warning-inline",b||(c=!0))}const f=m=>{if(e(),m.includes(",")){sn.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(!TBe(m)){sn.error(`Invalid schedule time: ${m}`);return}r({data:{action:"setNextTempSchedule",parameter:m},toastLoadingMessage:"Scheduling server restart..."})},g=()=>{t({...j8,onSubmit:f,submitLabel:"Edit"})},x=()=>{t({...j8,onSubmit:f,submitLabel:"Schedule"})},_=()=>{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..."})},p=n("control.server");return h.jsxs("div",{children:[h.jsx("h2",{className:"mb-1 text-lg font-semibold tracking-tight",children:"Next Restart:"}),h.jsx("span",{className:ie("font-light",o),children:a}),h.jsxs("div",{className:"flex flex-row justify-between gap-2 mt-2 flex-wrap",children:[u?h.jsxs(Ke,{size:"xs",variant:"ghost",className:"flex-grow bg-muted border shadow",disabled:!p||l,onClick:g,children:[h.jsx(vJ,{className:"h-4 w-4 mr-1"})," Edit"]}):h.jsxs(Ke,{size:"xs",variant:"ghost",className:"flex-grow bg-muted border shadow",disabled:!p||l,onClick:x,children:[h.jsx(qQ,{className:"h-4 w-4 mr-1"})," Schedule Restart"]}),c&&h.jsxs(Ke,{size:"xs",variant:"ghost",className:"flex-grow bg-muted border shadow",onClick:_,disabled:!p,children:[h.jsx(YQ,{className:"h-4 w-4 mr-1"})," Cancel"]}),d&&h.jsxs(Ke,{size:"xs",variant:"ghost",className:"flex-grow bg-muted border",onClick:v,disabled:!p,children:[h.jsx(VQ,{className:"h-4 w-4 mr-1"})," Enable"]})]})]})}function iV({isSheet:e}){return h.jsxs("aside",{className:ie("flex flex-col gap-4 z-10",e?"mr-4 pl-2":"tx-sidebar hidden lg:flex"),children:[h.jsx("div",{className:ie(!e&&"rounded-xl border border-border bg-card text-card-foreground shadow-sm p-4"),children:h.jsx(xBe,{})}),h.jsx("hr",{className:e?"block":"hidden"}),h.jsxs("div",{className:ie(!e&&"rounded-xl border border-border bg-card text-card-foreground shadow-sm p-4","flex flex-col gap-4"),children:[h.jsx(SBe,{}),h.jsx(kBe,{}),h.jsx(MBe,{})]}),h.jsx("hr",{className:e?"block":"hidden"}),window.txConsts.adsData.main?h.jsxs("a",{href:window.txConsts.adsData.main.url,onClick:zf,target:"_blank",className:`w-sidebar h-[80px] relative self-center group shadow-sm opacity-80 hover:opacity-100
                    dark:brightness-90 dark:hover:brightness-100`,children:[h.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]`}),h.jsx("img",{className:"rounded-xl max-w-sidebar max-h-[80px] m-auto",src:window.txConsts.adsData.main.img})]}):null,window.txConsts.isWebInterface?h.jsxs("div",{className:"flex flex-col items-center justify-center gap-1 text-sm font-light opacity-85 hover:opacity-100",children:[h.jsxs("span",{className:ie("text-muted-foreground",window.txConsts.txaVersion.includes("-")&&"text-destructive-inline font-semibold"),children:["tx: ",h.jsxs("strong",{children:["v",window.txConsts.txaVersion]})," | fx: ",h.jsxs("strong",{children:["b",window.txConsts.fxsVersion]})]}),h.jsxs("a",{href:"https://github.com/tabarra/txAdmin/blob/master/LICENSE",onClick:zf,target:"_blank",className:"text-muted-foreground hover:text-accent",children:["© 2019-",new Date().getUTCFullYear()," Tabarra"]})]}):null]})}function RBe(){const t=ut(L1).toLocaleString("en-US");return h.jsxs("div",{className:"w-full flex justify-between items-center",children:[h.jsx("div",{className:"w-16 h-16 dark:bg-zinc-600/50 bg-zinc-300/75 rounded-full flex items-center justify-center",children:h.jsx(f5,{className:"w-10 h-10 dark:text-zinc-400 text-zinc-500 text-opacity-80 stroke-1"})}),h.jsxs("div",{className:"flex flex-col items-end",children:[h.jsx("div",{className:"text-4xl font-mono font-extralight",children:t}),h.jsx("div",{className:"opacity-80 text-lg font-light tracking-wider",children:"Players"})]})]})}const ABe=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]),P8=(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},DBe=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},LBe=(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 c=o[l],d=c.codePointAt(0),u=ABe.has(d);if(!n.length&&u)continue;const f=c===r;if(f&&i>=(u?1:3))continue;let g=!1;if(u&&!((d===65038||d===65039)&&DBe(r))){s||(s=c,g=!0);continue}if(!g&&s){if(a>=t-1)break;n+=s,a++,s=""}r=c,i=f?i+1:1,n+=c,a++}return n},N8=String.fromCodePoint(8709,8203),jBe=e=>{if(!e)return{displayName:N8+"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,c,d)=>{if(c)return"";if(d)return d.substring(0,2)}),LBe];let n=e;for(const o of t){const l=o(n);if(l.length)n=l;else{const c=P8(n);return{displayName:`${N8}${c.join(" ").toUpperCase()}`,displayNameEmpty:!0,pureName:c.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 c=P8(s);return{displayName:r,displayNameEmpty:!1,pureName:c.join(""),pureNameEmpty:!0}}}return{displayName:r,displayNameEmpty:!1,pureName:s,pureNameEmpty:!1}};function PBe({filterString:e,setFilterString:t}){const n=C.useRef(null);return Pi("message",r=>{var i;r.data.type==="globalHotkey"&&r.data.action==="focusPlayerlistFilter"&&((i=n.current)==null||i.focus())}),h.jsx("div",{className:"pt-2 px-2 flex gap-2",children:h.jsxs("div",{className:"relative w-full",children:[h.jsx(ln,{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?h.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:h.jsx(bs,{})}):h.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:h.jsx(Mn,{className:"text-xs tracking-wide",children:"ctrl+k"})})]})})}const NBe=C.memo(PBe);function OBe({virtualItem:e,player:t,modalOpener:n}){return h.jsxs("div",{className:"player",style:{height:`${e.size}px`,transform:`translateY(${e.start}px)`},onClick:()=>n(t.netid),children:[h.jsx("div",{className:"pid-block leading-[1.7]",children:h.jsx("span",{className:"pid-badge",children:t.netid})}),h.jsx("span",{className:"pname",children:t.displayName})]})}function IBe(){const e=ut(Z5),t=ut(sO),n=y1(),r=C.useRef(null),[i,s]=C.useState(""),a=C.useMemo(()=>{const u=jBe(i).pureName;return u!=="emptyname"?e.filter(f=>f.pureName.includes(u)||f.netid.toString().includes(u)):e},[e,i]),o=C.useMemo(()=>{var g;const u=((g=e.at(-1))==null?void 0:g.netid)??0;return`.tx-playerlist .player .pid-block { min-width: ${Math.floor(Math.log10(u))+1+1}ch; }`},[e]),l=Ck({isScrollingResetDelay:0,count:a.length,getScrollElement:()=>{var u;return(u=r.current)==null?void 0:u.getElementsByTagName("div")[0]},estimateSize:()=>30,overscan:15}),c=l.getVirtualItems(),d=u=>{t&&n({mutex:t,netid:u})};return h.jsxs(h.Fragment,{children:[h.jsx(NBe,{filterString:i,setFilterString:s}),h.jsxs("div",{className:ie("text-center m-1 text-warning-inline tracking-wider italic text-xs",a.length!==e.length&&c.length?"block":"hidden"),children:["Showing ",a.length," of ",e.length," players."]}),h.jsx("div",{className:ie("text-center m-6 text-muted-foreground tracking-wider italic",c.length?"hidden":"block"),children:e.length&&i?h.jsxs("p",{children:["No players to show.",h.jsx("span",{className:"text-xs block opacity-75",children:"Clear the filter to show all players."})]}):h.jsxs("p",{children:["No players online.",h.jsx("span",{className:"text-xs block opacity-75",children:"Invite some friends to join in!"})]})}),h.jsx("style",{children:o}),h.jsx(Ni,{className:"h-full select-none",ref:r,children:h.jsx("div",{className:"tx-playerlist",style:{height:`${l.getTotalSize()}px`,width:"100%",position:"relative"},children:c.map(u=>h.jsx(OBe,{virtualItem:u,player:a[u.index],modalOpener:d},u.key))})})]})}function sV({isSheet:e}){return h.jsxs("aside",{className:ie("flex flex-col gap-4 z-10",e?"w-full pr-2":"tx-sidebar hidden xl:flex"),style:{height:e?"calc(100vh - 3rem)":"calc(100vh - 3.5rem - 1px - 2rem)"},children:[h.jsx("div",{className:"rounded-xl border border-border bg-card text-card-foreground shadow-sm shrink-0 p-4",children:h.jsx(RBe,{})}),h.jsx("div",{className:ie("min-h-[480px]",!e&&"rounded-xl border border-border bg-card text-card-foreground shadow-sm","flex flex-col gap-2 flex-grow overflow-hidden"),children:h.jsx(IBe,{})})]})}const ZE=Pk,$Be=Nk,oV=C.forwardRef(({className:e,...t},n)=>h.jsx(Fp,{className:ie("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}));oV.displayName=Fp.displayName;const FBe=Sa("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"}}),A_=C.forwardRef(({side:e="right",className:t,children:n,...r},i)=>h.jsxs($Be,{children:[h.jsx(oV,{}),h.jsxs(Bp,{ref:i,className:ie(FBe({side:e}),t),...r,children:[n,h.jsxs(Z1,{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:[h.jsx(bs,{className:"h-8 w-8 sm:h-6 sm:w-6 md:h-4 md:w-4"}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));A_.displayName=Bp.displayName;const aV=({className:e,...t})=>h.jsx("div",{className:ie("flex flex-col space-y-2 text-center sm:text-left",e),...t});aV.displayName="SheetHeader";const lV=C.forwardRef(({className:e,...t},n)=>h.jsx(zp,{ref:n,className:ie("text-lg font-semibold text-foreground",e),...t}));lV.displayName=zp.displayName;const BBe=C.forwardRef(({className:e,...t},n)=>h.jsx(Up,{ref:n,className:ie("text-sm text-muted-foreground",e),...t}));BBe.displayName=Up.displayName;function zBe(){const{isSheetOpen:e,setIsSheetOpen:t}=LP(),{hasPerm:n}=di();return h.jsx(ZE,{open:e,onOpenChange:t,children:h.jsxs(A_,{side:"left",className:"flex flex-col gap-6 w-full xs:w-3/4 select-none",onOpenAutoFocus:r=>r.preventDefault(),children:[h.jsx(aV,{children:h.jsx(lV,{children:h.jsx(eC,{href:"/",children:h.jsx(QE,{className:"h-9 hover:scale-105 hover:brightness-110"})})})}),h.jsxs("div",{children:[h.jsx("h2",{className:"mb-1.5 text-lg font-semibold tracking-tight",children:"Global Menu"}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs(qn,{href:"/players",children:[h.jsx(f5,{className:"mr-2 h-4 w-4"}),"Players"]}),h.jsxs(qn,{href:"/history",children:[h.jsx(SJ,{className:"mr-2 h-4 w-4"}),"History"]}),h.jsxs(qn,{href:"/insights/player-drops",children:[h.jsx(k0,{className:"mr-2 h-4 w-4"}),"Player Drops"]}),h.jsxs(qn,{href:"/whitelist",children:[h.jsx(GQ,{className:"mr-2 h-4 w-4"}),"Whitelist"]}),h.jsxs(qn,{href:"/admins",disabled:!n("manage.admins"),children:[h.jsx(AJ,{className:"mr-2 h-4 w-4"}),"Admins"]}),h.jsxs(qn,{href:"/settings",disabled:!n("settings.view"),children:[h.jsx(EJ,{className:"mr-2 h-4 w-4"}),"Settings"]})]})]}),h.jsxs("div",{children:[h.jsx("h2",{className:"mb-1.5 text-lg font-semibold tracking-tight",children:"System Menu"}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs(qn,{href:"/system/master-actions",children:[h.jsx($J,{className:"mr-2 h-4 w-4"}),"Master Actions"]}),h.jsxs(qn,{href:"/system/diagnostics",children:[h.jsx(BQ,{className:"mr-2 h-4 w-4"}),"Diagnostics"]}),h.jsxs(qn,{href:"/system/console-log",disabled:!n("txadmin.log.view"),children:[h.jsx(T0,{className:"mr-2 h-4 w-4"}),"Console Log"]}),h.jsxs(qn,{href:"/system/action-log",disabled:!n("txadmin.log.view"),children:[h.jsx(T0,{className:"mr-2 h-4 w-4"}),"Action Log"]})]})]})]})})}function UBe(){const{isSheetOpen:e,setIsSheetOpen:t}=jP();return h.jsx(ZE,{open:e,onOpenChange:t,children:h.jsx(A_,{side:"left",className:"w-full xs:w-3/4",onOpenAutoFocus:n=>n.preventDefault(),children:h.jsx(Ni,{className:"h-full",children:h.jsx(iV,{isSheet:!0})})})})}function HBe(){const{isSheetOpen:e,setIsSheetOpen:t}=PP();return h.jsx(ZE,{open:e,onOpenChange:t,children:h.jsx(A_,{side:"right",className:"w-full xs:w-3/4",onOpenAutoFocus:n=>n.preventDefault(),children:h.jsx(Ni,{className:"h-full",children:h.jsx(sV,{isSheet:!0})})})})}function WBe(){return h.jsxs(h.Fragment,{children:[h.jsx(zBe,{}),h.jsx(UBe,{}),h.jsx(HBe,{})]})}const cV=Je(!1),uV=Je(window.txConsts.fxsOutdated),dV=Je(window.txConsts.txaOutdated);function VBe(){const[e,t]=wr(cV),[n,r]=wr(uV),[i,s]=wr(dV);return{offlineWarning:e,setOfflineWarning:t,fxUpdateData:n,setFxUpdateData:r,txUpdateData:i,setTxUpdateData:s}}const qBe=()=>it(cV),YBe=()=>{const e=it(uV),t=it(dV);return n=>{e(n.fxserver),t(n.txadmin),window.txConsts.fxsOutdated=n.fxserver,window.txConsts.txaOutdated=n.txadmin}},hV="tsUpdateDismissed",KBe=12*60*60*1e3,GBe=48*60*60*1e3,XBe=()=>{const e=localStorage.getItem(hV);if(!e)return!1;const t=parseInt(e);return isNaN(t)?!1:t},QBe=e=>{const t=XBe(),n=Date.now();return!t||t+(e?KBe:GBe)<n};function Bb({titleIcon:e,title:t,description:n,isImportant:r,canPostpone:i}){const[s,a]=C.useState(0),o=()=>{a(Math.random())},l=()=>{localStorage.setItem(hV,Date.now().toString()),o()};return C.useEffect(()=>{const c=setInterval(()=>{o()},6e4);return()=>clearInterval(c)},[]),i&&!QBe(r)?null:h.jsx("div",{className:"fixed top-[calc(3.5rem+1px)] w-full flex justify-center z-40",children:h.jsxs("div",{className:ie("w-full sm:w-[28rem] h-9 hover:h-32 overflow-hidden sm:rounded-b-md","flex flex-col justify-center items-center p-2","group cursor-default transition-[height] shadow-xl",r?"bg-destructive text-destructive-foreground":"bg-info text-info-foreground"),children:[h.jsxs("h2",{className:"text-md group-hover:font-medium",children:[e,t]}),h.jsxs("span",{className:"hidden group-hover:block text-center text-sm",children:[n,h.jsxs("div",{className:"flex flex-row justify-center items-center mt-3 gap-4",children:[i&&h.jsxs(Ke,{size:"xs",variant:"outline",onClick:()=>l(),className:r?"text-foreground border-foreground":"dark:border-primary-foreground dark:hover:border-primary",children:[h.jsx(PQ,{className:"h-[0.9rem] mr-1"})," Postpone"]}),h.jsx(Ke,{size:"xs",variant:"outline",asChild:!0,className:r?"text-foreground border-foreground":"dark:border-primary-foreground dark:hover:border-primary",children:h.jsxs("a",{href:"https://discord.gg/uAmsGa2",target:"_blank",children:[h.jsx(nV,{size:"14",className:"mr-1"})," Support"]})})]})]})]})})}function JBe(){const{offlineWarning:e,txUpdateData:t,fxUpdateData:n}=VBe();return e?h.jsx(Bb,{titleIcon:h.jsx(QQ,{className:"inline h-[1.2rem] -mt-1 mr-1"}),title:"Socket connection lost.",description:h.jsxs(h.Fragment,{children:["The connection to the txAdmin server has been lost. ",h.jsx("br",{}),"If you closed FXServer, please restart it."]}),isImportant:!0,canPostpone:!1}):t?h.jsx(Bb,{titleIcon:h.jsx(z4,{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?h.jsx(Bb,{titleIcon:h.jsx(z4,{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 fV="AlertDialog",[ZBe,pUe]=Hi(fV,[QI]),po=QI(),pV=e=>{const{__scopeAlertDialog:t,...n}=e,r=po(t);return h.jsx(Pk,{...r,...n,modal:!0})};pV.displayName=fV;var eze="AlertDialogTrigger",tze=C.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=po(n);return h.jsx(_de,{...i,...r,ref:t})});tze.displayName=eze;var nze="AlertDialogPortal",mV=e=>{const{__scopeAlertDialog:t,...n}=e,r=po(t);return h.jsx(Nk,{...r,...n})};mV.displayName=nze;var rze="AlertDialogOverlay",gV=C.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=po(n);return h.jsx(Fp,{...i,...r,ref:t})});gV.displayName=rze;var lu="AlertDialogContent",[ize,sze]=ZBe(lu),vV=C.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,s=po(n),a=C.useRef(null),o=We(t,a),l=C.useRef(null);return h.jsx(mde,{contentName:lu,titleName:yV,docsSlug:"alert-dialog",children:h.jsx(ize,{scope:n,cancelRef:l,children:h.jsxs(Bp,{role:"alertdialog",...s,...i,ref:o,onOpenAutoFocus:me(i.onOpenAutoFocus,c=>{var d;c.preventDefault(),(d=l.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[h.jsx(a5,{children:r}),h.jsx(aze,{contentRef:a})]})})})});vV.displayName=lu;var yV="AlertDialogTitle",_V=C.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=po(n);return h.jsx(zp,{...i,...r,ref:t})});_V.displayName=yV;var xV="AlertDialogDescription",bV=C.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=po(n);return h.jsx(Up,{...i,...r,ref:t})});bV.displayName=xV;var oze="AlertDialogAction",wV=C.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=po(n);return h.jsx(Z1,{...i,...r,ref:t})});wV.displayName=oze;var SV="AlertDialogCancel",CV=C.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=sze(SV,n),s=po(n),a=We(t,i);return h.jsx(Z1,{...s,...r,ref:a})});CV.displayName=SV;var aze=({contentRef:e})=>{const t=`\`${lu}\` requires a description for the component to be accessible for screen reader users.

You can add a description to the \`${lu}\` by passing a \`${xV}\` 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 \`${lu}\`. 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 C.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},lze=pV,cze=mV,kV=gV,EV=vV,TV=wV,MV=CV,RV=_V,AV=bV;const uze=lze,dze=cze,DV=C.forwardRef(({className:e,...t},n)=>h.jsx(kV,{className:ie("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}));DV.displayName=kV.displayName;const LV=C.forwardRef(({className:e,...t},n)=>h.jsxs(dze,{children:[h.jsx(DV,{}),h.jsx(EV,{ref:n,className:ie("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})]}));LV.displayName=EV.displayName;const jV=({className:e,...t})=>h.jsx("div",{className:ie("flex flex-col space-y-2 text-center sm:text-left",e),...t});jV.displayName="AlertDialogHeader";const PV=({className:e,...t})=>h.jsx("div",{className:ie("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});PV.displayName="AlertDialogFooter";const NV=C.forwardRef(({className:e,...t},n)=>h.jsx(RV,{ref:n,className:ie("text-lg font-semibold",e),...t}));NV.displayName=RV.displayName;const OV=C.forwardRef(({className:e,...t},n)=>h.jsx(AV,{ref:n,className:ie("text-sm text-muted-foreground",e),...t}));OV.displayName=AV.displayName;const IV=C.forwardRef(({className:e,...t},n)=>h.jsx(TV,{ref:n,className:ie(Mp(),e),...t}));IV.displayName=TV.displayName;const $V=C.forwardRef(({className:e,...t},n)=>h.jsx(MV,{ref:n,className:ie(Mp({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));$V.displayName=MV.displayName;function hze(){const e=C.useRef(null),t=rZ(),n=nZ(),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 BK(e,r),h.jsx(uze,{open:t.isOpen,onOpenChange:a,children:h.jsxs(LV,{ref:e,children:[h.jsxs(jV,{children:[h.jsx(NV,{children:t.title}),h.jsx(OV,{children:t.message})]}),h.jsxs(PV,{children:[h.jsx($V,{children:t.cancelLabel??"Cancel"}),h.jsx(IV,{autoFocus:!0,onKeyDown:s,onClick:i,className:ie(Mp({variant:t.confirmBtnVariant??"destructive"})),children:t.actionLabel??"Continue"})]})]})})}function fze(){const e=C.useRef(null),t=sZ(),n=iZ(),r=()=>{var o;if(!t.isOpen)return;n();const a=((o=e.current)==null?void 0:o.value)??"";t.onSubmit(a.trim())},i=a=>{a.preventDefault(),r()},s=a=>{t.isOpen&&(a||(n(),t.onCancel&&t.onCancel()))};return h.jsx(Hp,{open:t.isOpen,onOpenChange:s,children:h.jsx(Sd,{className:ie(t.isWide&&"md:max-w-2xl"),children:h.jsxs("form",{onSubmit:i,className:"grid gap-4",children:[h.jsxs(Cd,{children:[h.jsx(kd,{children:t.title}),h.jsx(p$,{children:t.message})]}),h.jsx(ln,{autoFocus:!0,id:"userInput",ref:e,placeholder:t.placeholder,autoComplete:"off",required:t.required}),h.jsxs(ey,{className:"gap-2 flex-col",children:[h.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)=>h.jsxs(Ke,{type:"button",onClick:()=>{e.current.value=a,r()},variant:"outline",children:[h.jsx("span",{className:"sm:hidden mr-auto text-muted-foreground",children:"Suggestion:"}),a]},o))}),h.jsx(Ke,{type:"submit",variant:t.submitBtnVariant??"default",children:t.submitLabel??"Submit"})]})]})})})}var eT="Tabs",[pze,mUe]=Hi(eT,[B1]),FV=B1(),[mze,tT]=pze(eT),BV=C.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:s,orientation:a="horizontal",dir:o,activationMode:l="automatic",...c}=e,d=vd(o),[u,f]=gs({prop:r,onChange:i,defaultProp:s});return h.jsx(mze,{scope:n,baseId:Ir(),value:u,onValueChange:f,orientation:a,dir:d,activationMode:l,children:h.jsx(Me.div,{dir:d,"data-orientation":a,...c,ref:t})})});BV.displayName=eT;var zV="TabsList",UV=C.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,s=tT(zV,n),a=FV(n);return h.jsx(r9,{asChild:!0,...a,orientation:s.orientation,dir:s.dir,loop:r,children:h.jsx(Me.div,{role:"tablist","aria-orientation":s.orientation,...i,ref:t})})});UV.displayName=zV;var HV="TabsTrigger",WV=C.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...s}=e,a=tT(HV,n),o=FV(n),l=YV(a.baseId,r),c=KV(a.baseId,r),d=r===a.value;return h.jsx(i9,{asChild:!0,...o,focusable:!i,active:d,children:h.jsx(Me.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":c,"data-state":d?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:l,...s,ref:t,onMouseDown:me(e.onMouseDown,u=>{!i&&u.button===0&&u.ctrlKey===!1?a.onValueChange(r):u.preventDefault()}),onKeyDown:me(e.onKeyDown,u=>{[" ","Enter"].includes(u.key)&&a.onValueChange(r)}),onFocus:me(e.onFocus,()=>{const u=a.activationMode!=="manual";!d&&!i&&u&&a.onValueChange(r)})})})});WV.displayName=HV;var VV="TabsContent",qV=C.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:s,...a}=e,o=tT(VV,n),l=YV(o.baseId,r),c=KV(o.baseId,r),d=r===o.value,u=C.useRef(d);return C.useEffect(()=>{const f=requestAnimationFrame(()=>u.current=!1);return()=>cancelAnimationFrame(f)},[]),h.jsx(wn,{present:i||d,children:({present:f})=>h.jsx(Me.div,{"data-state":d?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":l,hidden:!f,id:c,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:u.current?"0s":void 0},children:f&&s})})});qV.displayName=VV;function YV(e,t){return`${e}-trigger-${t}`}function KV(e,t){return`${e}-content-${t}`}var gze=BV,GV=UV,XV=WV,QV=qV;const vze=gze,JV=C.forwardRef(({className:e,...t},n)=>h.jsx(GV,{ref:n,className:ie("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));JV.displayName=GV.displayName;const tC=C.forwardRef(({className:e,...t},n)=>h.jsx(XV,{ref:n,className:ie("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}));tC.displayName=XV.displayName;const nT=C.forwardRef(({className:e,...t},n)=>h.jsx(QV,{ref:n,className:ie("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));nT.displayName=QV.displayName;const fg="123456789ABCDEFGHJKLMNPQRSTUVWXYZ",wi={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:/^\d{17,20}$/,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,regexActionID:new RegExp(`^[${fg}]{4}-[${fg}]{4}$`),regexWhitelistReqID:new RegExp(`R[${fg}]{4}`),regexSvLicenseOld:/^\w{32}$/,regexSvLicenseNew:/^cfxk_\w{1,60}_\w{1,20}$/,regexValidIP:/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,actionIdAlphabet:fg,nuiWebpipePath:"https://monitor/WebPipe/",regexCustomThemeName:/^[a-z0-9]+(-[a-z0-9]+)*$/},yze=C.memo(function(){const{authData:e,setAuthData:t}=$l(),{setAccountModalTab:n}=m5(),r=MP(),i=qt({method:"POST",path:"/auth/changePassword"}),[s,a]=C.useState(""),[o,l]=C.useState(""),[c,d]=C.useState(""),[u,f]=C.useState(""),[g,x]=C.useState(!1),_=v=>{if(v==null||v.preventDefault(),!!e){if(f(""),o.length<wi.adminPasswordMinLength||o.length>wi.adminPasswordMaxLength){f(`The password must be between ${wi.adminPasswordMinLength} and ${wi.adminPasswordMaxLength} digits long.`);return}else if(o!==c){f("The passwords do not match.");return}x(!0),i({data:{newPassword:o,oldPassword:e.isTempPassword?void 0:s},error:p=>{x(!1),f(p)},success:p=>{x(!1),"success"in p?e.isTempPassword?(n("identifiers"),t({...e,isTempPassword:!1})):(sn.success("Password changed successfully!"),r()):f(p.error)}})}};if(e)return h.jsx(nT,{value:"password",tabIndex:void 0,children:h.jsxs("form",{onSubmit:_,children:[e.isTempPassword?h.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. ",h.jsx("br",{}),h.jsx("strong",{children:"Make sure to take note of your new password before saving."})]}):h.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."}),h.jsxs("div",{className:"space-y-3 pt-2 pb-6",children:[!e.isTempPassword&&h.jsxs("div",{className:"space-y-1",children:[h.jsx(sr,{htmlFor:"current-password",children:"Current Password"}),h.jsx(ln,{id:"current-password",placeholder:"Enter current password",type:"password",value:s,autoFocus:!0,required:!0,onChange:v=>{a(v.target.value),f("")}})]}),h.jsxs("div",{className:"space-y-1",children:[h.jsx(sr,{htmlFor:"new-password",children:"New Password"}),h.jsx(ln,{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("")}})]}),h.jsxs("div",{className:"space-y-1",children:[h.jsx(sr,{htmlFor:"confirm-password",children:"Confirm Password"}),h.jsx(ln,{id:"confirm-password",autoComplete:"new-password",placeholder:"Repeat new password",type:"password",required:!0,onChange:v=>{d(v.target.value),f("")}})]})]}),u&&h.jsx("p",{className:"text-destructive text-center -mt-2 mb-4",children:u}),h.jsx(Ke,{className:"w-full",type:"submit",disabled:g,children:g?"Saving...":e.isTempPassword?"Save & Next":"Change Password"})]})})});function _ze(){const e=hI(),[t,n]=C.useState(""),[r,i]=C.useState(""),[s,a]=C.useState(""),[o,l]=C.useState(!1),c=MP(),[d,u]=C.useState(!1),{isPending:f,error:g,data:x}=MQ({queryKey:["getIdentifiers"],gcTime:3e4,queryFn:()=>e("/auth/getIdentifiers")}),_=qt({method:"POST",path:"/auth/changeIdentifiers"});C.useEffect(()=>{x&&(n(x.cfxreId),i(x.discordId))},[x]),C.useEffect(()=>{a(g?g.message:"")},[g]);const v=y=>{y==null||y.preventDefault(),a(""),u(!0),_({data:{cfxreId:t,discordId:r},error:b=>{a(b)},success:b=>{u(!1),"success"in b?(sn.success("Identifiers changed successfully!"),c()):a(b.error)}})},p=async()=>{if(!t)return;const y=t.trim();if(/^\d+$/.test(y))n(`fivem:${y}`);else if(y.startsWith("fivem:"))t!==y&&n(y);else{try{l(!0);const b=await _ue(`https://forum.cfx.re/u/${y}.json`);b.user&&typeof b.user.id=="number"?n(`fivem:${b.user.id}`):a("Could not find the user in the forum. Make sure you typed the username correctly.")}catch{a("Failed to check the identifiers on the forum API.")}l(!1)}},m=()=>{if(!r)return;const y=r.trim();/^\d+$/.test(y)?i(`discord:${y}`):r!==y&&i(y)};return h.jsx(nT,{value:"identifiers",tabIndex:void 0,children:h.jsxs("form",{onSubmit:v,children:[h.jsxs("p",{className:"text-sm text-muted-foreground",children:["The identifiers are optional for accessing the ",h.jsx("strong",{children:"Web Panel"})," but required for you to be able to use the ",h.jsx("strong",{children:"In Game Menu"})," and the ",h.jsx("strong",{children:"Discord Bot"}),". ",h.jsx("br",{}),h.jsx("strong",{children:"It is recommended that you configure at least one."})]}),h.jsxs("div",{className:"space-y-3 pt-2 pb-6",children:[h.jsxs("div",{className:"space-y-1",children:[h.jsxs(sr,{htmlFor:"cfxreId",children:["FiveM identifier ",h.jsx("span",{className:"text-sm opacity-75 text-info",children:"(optional)"})]}),h.jsx(ln,{id:"cfxreId",autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",placeholder:"fivem:000000",value:f||o?"loading...":t,disabled:f||o,autoFocus:!0,onBlur:p,onChange:y=>{n(y.target.value),a("")}}),h.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. ",h.jsx("br",{}),"You can also type in your ",h.jsx(ju,{href:"https://forum.cfx.re/",children:"forum.cfx.re"})," username and it will be converted automatically. ",h.jsx("br",{}),"This is required if you want to login using the Cfx.re button."]})]}),h.jsxs("div",{className:"space-y-1",children:[h.jsxs(sr,{htmlFor:"discordId",children:["Discord identifier ",h.jsx("span",{className:"text-sm opacity-75 text-info",children:"(optional)"})]}),h.jsx(ln,{id:"discordId",autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",placeholder:"discord:000000000000000000",value:f?"loading...":r,disabled:f,onBlur:m,onChange:y=>{i(y.target.value),a("")}}),h.jsxs("p",{className:"text-sm text-muted-foreground",children:["You can get your Discord User ID by following ",h.jsx(ju,{href:"https://support.discordapp.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID",children:"this guide"}),". ",h.jsx("br",{}),"This is required if you want to use the Discord Bot slash commands."]})]})]}),s&&h.jsx("p",{className:"text-destructive text-center -mt-2 mb-4",children:s}),h.jsx(Ke,{className:"w-full",type:"submit",disabled:!x||d,children:d?"Saving...":"Save Changes"})]})})}function xze(){const{authData:e}=$l(),{isAccountModalOpen:t,setAccountModalOpen:n,accountModalTab:r,setAccountModalTab:i}=m5();C.useEffect(()=>{e&&e.isTempPassword&&(n(!0),i("password"))},[]);const s=a=>{!a&&e&&!e.isTempPassword&&(n(!1),setTimeout(()=>{i("password")},500))};if(e)return h.jsx(Hp,{open:t,onOpenChange:s,children:h.jsxs(Sd,{className:"sm:max-w-lg",tabIndex:void 0,children:[h.jsx(Cd,{children:h.jsx(kd,{className:"text-2xl font-bold",children:e.isTempPassword?"Welcome to txAdmin!":`Your Account - ${e.name}`})}),h.jsxs(vze,{defaultValue:"password",value:r,onValueChange:i,children:[h.jsxs(JV,{className:"grid w-full grid-cols-2 mb-4",children:[h.jsx(tC,{value:"password",children:"Password"}),h.jsx(tC,{value:"identifiers",disabled:e.isTempPassword,children:"Identifiers"})]}),h.jsx(yze,{}),h.jsx(_ze,{})]})]})})}const bze=5*60;function cu({tsFetch:e,tsObject:t,serverTime:n,className:r,isDateOnly:i,dateStyle:s,timeStyle:a}){const o=n-e,l=n-t,c=e-l,d=()=>{sn.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.`)},u=i?IN(c,s??"medium"):Uo(c,s??"medium",a??"short");return h.jsxs("span",{className:r,title:Uo(c,"long","long"),children:[u,Math.abs(o)>bze&&h.jsx("button",{className:"ml-1 text-warning-inline",onClick:d,children:"(clock drift)"})]})}function O8({type:e,count:t}){const n=t>1?`${e}s`:e;return t===0?h.jsxs("span",{className:ie("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"]}):h.jsxs("span",{className:ie("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 I8=e=>{if(!e)return 3;const t=e.trim().split(`
`).length+1;return Math.min(Math.max(t,3),16)};function wze({playerRef:e,player:t,refreshModalData:n}){const r=C.useRef(null),[i,s]=C.useState(t.notesLog??""),[a,o]=C.useState(I8(t.notes)),l=qt({method:"POST",path:"/player/save_note"}),c=()=>{var u;s("Saving..."),l({queryParams:e,data:{note:(u=r.current)==null?void 0:u.value.trim()},success:f=>{"error"in f?s(f.error):n()}})},d=u=>{u.key==="Enter"&&!u.shiftKey&&!window.txIsMobile?(u.preventDefault(),c()):o(I8(u.currentTarget.value))};return h.jsxs(h.Fragment,{children:[h.jsxs(sr,{htmlFor:"playerNotes",children:["Notes: ",h.jsx("span",{className:"text-muted-foreground",children:i})]}),h.jsx(oy,{ref:r,id:"playerNotes",className:"w-full mt-1",disabled:!t.isRegistered,defaultValue:t.notes,onChange:()=>s("Press enter to save."),onKeyDown:d,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&&h.jsx("div",{className:"mt-2 w-full",children:h.jsx(Ke,{variant:"outline",size:"xs",onClick:c,disabled:!t.isRegistered,className:"w-full",children:"Save Note"})})]})}function Sze({playerRef:e,player:t,serverTime:n,tsFetch:r,setSelectedTab:i,refreshModalData:s}){const{hasPerm:a}=di(),o=qt({method:"POST",path:"/player/whitelist"}),l=t.sessionTime?I0(t.sessionTime*6e4,{units:["h","m"]}):"--",c=t.tsLastConnection?h.jsx(cu,{className:"opacity-75 cursor-help",serverTime:n,tsObject:t.tsLastConnection,tsFetch:r,isDateOnly:!0}):"--",d=t.playTime?I0(t.playTime*6e4,{units:["d","h","m"]}):"--",u=t.tsJoined?h.jsx(cu,{className:"opacity-75 cursor-help",serverTime:n,tsObject:t.tsJoined,tsFetch:r,isDateOnly:!0}):"--",f=t.tsWhitelisted?h.jsx(cu,{className:"opacity-75 cursor-help",serverTime:n,tsObject:t.tsWhitelisted,tsFetch:r,isDateOnly:!0}):"not yet",g=t.actionHistory.filter(p=>p.type==="ban"&&!p.revokedAt).length,x=t.actionHistory.filter(p=>p.type==="warn"&&!p.revokedAt).length,_=()=>{o({queryParams:e,data:{status:!t.tsWhitelisted},toastLoadingMessage:"Updating whitelist...",genericHandler:{successMsg:"Whitelist changed."},success:(p,m)=>{"success"in p&&s()}})},v=C.useMemo(()=>{if(!t||!n)return;let p;for(const m of t.actionHistory)if(!(m.type!=="ban"||m.revokedAt))if(m.exp)m.exp>=n&&(p=Math.max(p??0,m.exp));else return"This player is permanently banned.";if(p!==void 0)return`This player is banned until ${Uo(p,"short","short")}`},[t,n]);return h.jsxs("div",{className:"p-1",children:[v?h.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:[h.jsx("div",{className:"flex-shrink-0 flex flex-col gap-2 items-center",children:h.jsx(TJ,{className:"size-5 text-warning"})}),h.jsx("div",{className:"flex-grow text-sm font-medium",children:v})]}):null,h.jsxs("dl",{className:"pb-2",children:[t.isConnected&&h.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[h.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Session Time"}),h.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:l})]}),h.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[h.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Play Time"}),h.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:d})]}),h.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[h.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Join Date"}),h.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:u})]}),!t.isConnected&&h.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[h.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Last Connection"}),h.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:c})]}),h.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[h.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"ID Whitelisted"}),h.jsx("dd",{className:"text-sm leading-6 mt-0",children:f}),h.jsx("dd",{className:"text-right",children:h.jsx(Ke,{variant:"outline",size:"inline",style:{minWidth:"8.25ch"},onClick:_,disabled:!a("players.whitelist"),children:t.tsWhitelisted?"Remove":"Add WL"})})]}),h.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[h.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Sanctions"}),h.jsxs("dd",{className:"text-sm leading-6 mt-0 space-x-2",children:[h.jsx(O8,{type:"Ban",count:g}),h.jsx(O8,{type:"Warn",count:x})]}),h.jsx("dd",{className:"text-right",children:h.jsx(Ke,{variant:"outline",size:"inline",style:{minWidth:"8.25ch"},onClick:()=>{i("History")},children:"View"})})]})]}),h.jsx(wze,{player:t,playerRef:e,refreshModalData:s})]})}function $8({title:e,emptyMessage:t,currIds:n,allIds:r,isSmaller:i}){C.useState(!1);const s=n.sort((o,l)=>o.localeCompare(l)),a=r.filter(o=>!n.includes(o)).sort((o,l)=>o.localeCompare(l));return h.jsxs("div",{children:[h.jsx("div",{className:"flex justify-between items-center pb-1",children:h.jsx("h3",{className:"text-xl",children:e})}),h.jsxs("p",{className:ie("font-mono break-all whitespace-pre-wrap border rounded divide-y divide-border/50 text-muted-foreground",i?"text-2xs leading-5 font-extralight tracking-widest":"text-xs leading-6 tracking-wider"),children:[s.length===0&&h.jsx("span",{className:"block px-1 opacity-50 italic",children:t}),s.map(o=>h.jsx("span",{className:"block px-1 font-semibold",children:o},o)),a.map(o=>h.jsx("span",{className:"block px-1 opacity-50",children:o},o))]})]})}function Cze({player:e}){return h.jsxs("div",{className:"flex flex-col gap-4 p-1",children:[h.jsx($8,{title:"Player Identifiers",emptyMessage:"This player has no identifiers.",currIds:e.ids,allIds:(e==null?void 0:e.oldIds)??[]}),h.jsx($8,{title:"Player Hardware IDs",emptyMessage:"This player has no hardware IDs.",currIds:e.hwids,allIds:(e==null?void 0:e.oldHwids)??[],isSmaller:!0})]})}function D_({children:e}){return h.jsx("div",{className:"flex items-center justify-center min-h-[16.5rem] text-xl p1 text-muted-foreground",children:e})}function kze({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=Uo(e.revokedAt??0,"medium","short");r=`Revoked by ${e.revokedBy} on ${a}.`}else if(typeof e.exp=="number"){const a=Uo(e.exp,"medium","short");r=e.exp<t?`Expired on ${a}.`:`Expires in ${a}.`}return h.jsxs("div",{onClick:()=>{n(e.id)},className:ie("pl-2 border-l-4 hover:bg-muted rounded-r-sm bg-muted/30 cursor-pointer",i),children:[h.jsxs("div",{className:"flex w-full justify-between",children:[h.jsx("strong",{className:"text-sm text-muted-foreground",children:s}),h.jsxs("small",{className:"text-right text-2xs space-x-1",children:[h.jsx(Mn,{className:"tracking-widest",children:e.id}),h.jsx("span",{className:"opacity-75 cursor-help",title:Uo(e.ts,"long","long"),children:Uo(e.ts,"medium","short")})]})]}),h.jsx("span",{className:"text-sm",children:e.reason}),r&&h.jsx("small",{className:"block text-xs opacity-75",children:r})]})}function Eze({actionHistory:e,serverTime:t,refreshModalData:n}){const r=P5();if(!e.length)return h.jsx(D_,{children:"No bans/warns found."});const i=a=>{r(a)},s=[...e].reverse();return h.jsx("div",{className:"flex flex-col gap-1 p-1",children:s.map(a=>h.jsx(kze,{action:a,serverTime:t,modalOpener:i},a.id))})}function Tze({playerRef:e,banTemplates:t}){const n=C.useRef(null),[r,i]=C.useState(!1),{hasPerm:s}=di(),a=_5(),o=qt({method:"POST",path:"/player/ban",throwGenericErrors:!0});if(!s("players.ban"))return h.jsx(D_,{children:"You don't have permission to ban players."});const l=()=>{if(!n.current)return;const{reason:c,duration:d}=n.current.getData();if(!c||c.length<3){sn.warning("The reason must be at least 3 characters long."),n.current.focusReason();return}i(!0),o({queryParams:e,data:{reason:c,duration:d},toastLoadingMessage:"Banning player...",genericHandler:{successMsg:"Player banned."},success:u=>{i(!1),a()},error:u=>{i(!1)}})};return h.jsxs("div",{className:"grid gap-4 p-1",children:[h.jsx(K$,{ref:n,banTemplates:t,disabled:r,onNavigateAway:()=>{a()}}),h.jsx("div",{className:"flex place-content-end",children:h.jsx(Ke,{size:"sm",variant:"destructive",disabled:r,onClick:l,children:r?h.jsxs("span",{className:"flex items-center leading-relaxed",children:[h.jsx(cn,{className:"inline animate-spin h-4"})," Banning..."]}):"Apply Ban"})})]})}function L_({msg:e}){return h.jsxs("div",{className:"flex items-center gap-1 text-xl leading-relaxed text-muted-foreground",children:[h.jsx(cn,{className:"inline animate-spin h-5"})," ",e]})}function Mze({playerRef:e,player:t}){const{hasPerm:n}=di(),r=p1(),i=_5(),s=wa()[1],[a]=a1("/admins"),o=j1(),l=m1(),c=qt({method:"POST",path:"/player/message"}),d=qt({method:"POST",path:"/player/kick"}),u=qt({method:"POST",path:"/player/warn"}),f=p=>{"success"in p&&(i(),l())},g=()=>{if(!t)return;const p=new URLSearchParams;p.set("autofill","true"),p.set("name",t.pureName);for(const m of t.ids)m.startsWith("discord:")?p.set("discord",m):m.startsWith("fivem:")&&p.set("citizenfx",m);s(`/admins?${p.toString()}`),console.log("isAlreadyInAdminPage",a),a&&o(),i(),l()},x=()=>{t&&r({title:`Direct Message ${t.displayName}`,message:"Type direct message below",placeholder:"whatever you wanna say",submitLabel:"Send",required:!0,onSubmit:p=>{c({queryParams:e,data:{message:p},genericHandler:{successMsg:"Direct message sent."},toastLoadingMessage:"Sending direct message...",success:f})}})},_=()=>{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:p=>{d({queryParams:e,data:{reason:p},genericHandler:{successMsg:"Player kicked."},toastLoadingMessage:"Kicking player...",success:f})}})},v=()=>{t&&r({title:`Warn ${t.displayName}`,message:h.jsxs("p",{children:["Type below the warn reason. ",h.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:p=>{u({queryParams:e,data:{reason:p},genericHandler:{successMsg:"Warning sent."},toastLoadingMessage:"Sending warning...",success:f})}})};return h.jsxs(ey,{className:"max-w-2xl gap-2 p-2 md:p-4 border-t grid grid-cols-2 sm:flex",children:[h.jsxs(Ke,{variant:"outline",size:"sm",disabled:!n("manage.admins")||!t||!t.ids.length,onClick:g,className:"pl-2 sm:mr-auto",children:[h.jsx(mP,{className:"h-5 mr-1"})," Give Admin"]}),h.jsxs(Ke,{variant:"outline",size:"sm",disabled:!n("players.direct_message")||!t||!t.isConnected,onClick:x,className:"pl-2",children:[h.jsx(uJ,{className:"h-5 mr-1"})," DM"]}),h.jsxs(Ke,{variant:"outline",size:"sm",disabled:!n("players.kick")||!t||!t.isConnected,onClick:_,className:"pl-2",children:[h.jsx(wBe,{style:{height:"1.25rem",width:"1.75rem",marginRight:"0.25rem",fill:"currentcolor"}})," Kick"]}),h.jsxs(Ke,{variant:"outline",size:"sm",disabled:!n("players.warn")||!t,onClick:v,className:"pl-2",children:[h.jsx(M0,{className:"h-5 mr-1"})," Warn"]})]})}const Dh=[{title:"Info",icon:h.jsx(h5,{className:"mr-2 h-5 w-5 hidden xs:block"})},{title:"History",icon:h.jsx(oJ,{className:"mr-2 h-5 w-5 hidden xs:block"})},{title:"IDs",icon:h.jsx(T0,{className:"mr-2 h-5 w-5 hidden xs:block"})},{title:"Ban",icon:h.jsx(E0,{className:"mr-2 h-5 w-5 hidden xs:block"}),className:"hover:bg-destructive hover:text-destructive-foreground"}];function Rze(){const{isModalOpen:e,closeModal:t,playerRef:n}=oZ(),[r,i]=C.useState(Dh[0].title),[s,a]=C.useState(0),[o,l]=C.useState(void 0),[c,d]=C.useState(""),[u,f]=C.useState(0),g=qt({method:"GET",path:"/player",abortOnUnmount:!0}),x=()=>{a(s+1)};C.useEffect(()=>{n&&(l(void 0),d(""),g({queryParams:n,success:m=>{"error"in m?d(m.error):(l(m),f(Math.round(Date.now()/1e3)),!("license"in n)&&m.player.license&&v1(m.player.license))},error:m=>{d(m)}}))},[n,s]),C.useEffect(()=>{e||setTimeout(()=>{i(Dh[0].title)},200)},[e]);const _=m=>{e&&!m&&t()},v=m=>{if(m.key==="ArrowUp"||m.key==="ArrowDown"){m.preventDefault();const y=Dh.findIndex(w=>w.title===r),b=m.key==="ArrowUp"?y-1:y+1,S=Dh[b];if(S){i(S.title);const w=document.getElementById(`player-modal-tab-${S.title}`);w&&w.focus()}}};let p;return o?o.player.netid?p=h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:"text-success-inline font-mono mr-2",children:["[",o.player.netid,"]"]}),o.player.displayName]}):p=h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-destructive-inline font-mono mr-2",children:"[OFF]"}),o.player.displayName]}):c?p=h.jsx("span",{className:"text-destructive-inline",children:"Error!"}):p=h.jsx("span",{className:"text-muted-foreground italic",children:"Loading..."}),h.jsx(Hp,{open:e,onOpenChange:_,children:h.jsxs(Sd,{className:"max-w-2xl h-full sm:h-auto max-h-full p-0 gap-1 sm:gap-4 flex flex-col",children:[h.jsx(Cd,{className:"px-4 py-3 border-b",children:h.jsx(kd,{className:"tracking-wide line-clamp-1 leading-7 break-all mr-6",children:p})}),h.jsxs("div",{className:"flex flex-col md:flex-row md:px-4 h-full",children:[h.jsx("div",{className:"flex flex-row md:flex-col gap-1 bg-muted md:bg-transparent p-1 md:p-0 mx-2 md:mx-0 rounded-md",children:Dh.map(m=>h.jsxs(Ke,{id:`player-modal-tab-${m.title}`,variant:r===m.title?"secondary":"ghost",className:ie("w-full tracking-wider justify-center md:justify-start","h-7 rounded-sm px-2 text-sm","md:h-10 md:text-base",m.className),onClick:()=>i(m.title),onKeyDown:v,children:[m.icon," ",m.title]},m.title))}),h.jsx(Ni,{className:"w-full max-h-[calc(100vh-3.125rem-4rem-5rem)] min-h-[16.5rem] md:max-h-[50vh] px-4 py-2 md:py-0",children:o?h.jsxs(h.Fragment,{children:[r==="Info"&&h.jsx(Sze,{playerRef:n,player:o.player,serverTime:o.serverTime,tsFetch:u,setSelectedTab:i,refreshModalData:x}),r==="History"&&h.jsx(Eze,{actionHistory:o.player.actionHistory,serverTime:o.serverTime,refreshModalData:x}),r==="IDs"&&h.jsx(Cze,{player:o.player}),r==="Ban"&&h.jsx(Tze,{banTemplates:o.banTemplates,playerRef:n})]}):h.jsx(D_,{children:c?h.jsxs("span",{className:"text-destructive-inline",children:["Error: ",c]}):h.jsx(L_,{msg:"Loading..."})})})]}),h.jsx(Mze,{playerRef:n,player:o==null?void 0:o.player})]})})}function Aze(){const e=H5(),t=ise(),n=C.useRef(0),r=qBe(),i=lZ(),s=qse(),a=YBe();return C.useEffect(()=>{const o=window.txConsts.isWebInterface?["status","playerlist"]:["status"],l=q5(o);return l.on("connect",()=>{console.log("Main Socket.IO Connected."),r(!1)}),l.on("disconnect",c=>{console.log("Main Socket.IO Disonnected:",c);const d=n.current+1;n.current=d,setTimeout(()=>{n.current===d&&r(!0)},500)}),l.on("error",c=>{console.log("Main Socket.IO",c)}),l.on("logout",function(c){e("main socketio",c)}),l.on("refreshToUpdate",function(){e("main socketio","got refreshToUpdate",md.UPDATED)}),l.on("status",function(c){i(c)}),l.on("playerlist",function(c){window.txConsts.isWebInterface&&s(c)}),l.on("updateAvailable",function(c){a(c)}),l.on("updateAuthData",function(c){console.warn("Got updateAuthData from websocket",c),t(c)}),()=>{l.removeAllListeners(),l.disconnect(),i(null)}},[]),null}function F8({title:e,emptyMessage:t,ids:n,isSmaller:r}){C.useState(!1);const i=Array.isArray(n)&&n.length;return h.jsxs("div",{className:"px-1 mb-1 md:mb-4",children:[h.jsx("div",{className:"flex justify-between items-center pb-1",children:h.jsx("h3",{className:"text-xl",children:e})}),h.jsx("p",{className:ie("font-mono break-all whitespace-pre-wrap border rounded divide-y divide-border/50 text-muted-foreground",i&&r?"text-2xs leading-5 font-extralight tracking-widest":"text-xs leading-6 tracking-wider"),children:i?n.map(s=>h.jsx("span",{className:"block px-1 font-semibold",children:s},s)):h.jsx("span",{className:"block px-1 opacity-50 italic",children:t})})]})}function Dze({action:e}){return h.jsxs("div",{className:"flex flex-col gap-4 p-1",children:[h.jsx(F8,{title:"Target Identifiers",emptyMessage:"This action targets no identifiers.",ids:e.ids}),h.jsx(F8,{title:"Target Hardware IDs",emptyMessage:"This action targets no hardware IDs.",ids:e.hwids,isSmaller:!0})]})}const Lze=e=>{if(!e)return 3;const t=e.trim().split(`
`).length+1;return Math.min(Math.max(t,3),16)};function jze({actionReason:e}){const t=C.useRef(null),[n,r]=C.useState(Lze(e));return h.jsxs(h.Fragment,{children:[h.jsx(sr,{htmlFor:"actionReason",children:"Reason:"}),h.jsx(oy,{ref:t,id:"actionReason",className:"w-full mt-1",readOnly:!0,value:e,style:{height:`${1+1.25*n}rem`}})]})}function Pze({action:e,serverTime:t,tsFetch:n}){const r=y1();let i;if(e.type==="ban")if(e.expiration===!1)i=h.jsx("span",{className:"text-destructive-inline",children:"Never"});else if(e.expiration>t){const u=I0((t-e.expiration)*1e3,{units:["mo","w","d","h","m"]});i=h.jsxs("span",{className:"text-warning-inline",children:["In ",u]})}else i=h.jsx(cu,{className:"opacity-75 cursor-help",serverTime:t,tsObject:e.expiration,tsFetch:n});let s;e.type==="warn"&&e.acked?s=h.jsx("span",{className:"opacity-75",children:"Yes"}):s=h.jsx("span",{className:"text-warning-inline",children:"Not yet"});let a;e.revocation.timestamp?a=h.jsxs("span",{className:"text-warning-inline",children:["By ",e.revocation.author," on ",h.jsx(cu,{isDateOnly:!0,className:"cursor-help",serverTime:t,tsObject:e.revocation.timestamp,tsFetch:n})]}):a=h.jsx("span",{className:"opacity-75",children:"No"});const o=e.playerName!==!1?h.jsx("span",{children:e.playerName}):h.jsx("span",{className:"italic opacity-75",children:"unknown player"}),l=e.ids.filter(u=>u.startsWith("license:")),c=l.length===1?l[0].split(":")[1]:!1,d=()=>{c&&r({license:c})};return h.jsxs("div",{className:"px-1 mb-1 md:mb-4",children:[h.jsxs("dl",{className:"pb-2",children:[h.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[h.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Date/Time"}),h.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:h.jsx(cu,{className:"opacity-75 cursor-help",serverTime:t,tsObject:e.timestamp,tsFetch:n})})]}),e.type==="ban"&&h.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[h.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Expiration"}),h.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:i})]}),e.type==="warn"&&h.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[h.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Player Accepted"}),h.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:s})]}),h.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[h.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Revoked"}),h.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:a})]}),h.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[h.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Admin"}),h.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:e.author})]}),h.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[h.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Player"}),h.jsx("dd",{className:"text-sm leading-6 col-span-2x mt-0",children:o}),h.jsx("dd",{className:"text-right",children:h.jsx(Ke,{variant:"outline",size:"inline",style:{minWidth:"8.25ch"},onClick:d,disabled:!c,children:"View"})})]})]}),h.jsx(jze,{actionReason:e.reason})]})}function Nze({action:e,refreshModalData:t}){const[n,r]=C.useState(!1),{hasPerm:i}=di(),s=qt({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:u=>{r(!1),"success"in u&&t()}})},l=!!e.revocation.timestamp,c=i(e.type==="warn"?"players.warn":"players.ban"),d=l?`${e.type} revoked`:c?`Revoke ${a}`:"Revoke (no permission)";return h.jsx("div",{className:"flex flex-col gap-4 px-1 mb-1 md:mb-4",children:h.jsxs("div",{className:"space-y-2",children:[h.jsxs("h3",{className:"text-xl",children:["Revoke ",a]}),h.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.",h.jsxs("ul",{className:"list-disc list-inside pt-1",children:[e.type==="ban"&&h.jsx("li",{children:"The player will be able to rejoin the server."}),h.jsx("li",{children:"The player will not be notified of the revocation."}),h.jsxs("li",{children:["This ",e.type," will not be removed from the player history."]}),h.jsx("li",{children:"The revocation cannot be undone!"})]})]}),h.jsx(Ke,{variant:"destructive",size:"xs",className:"col-start-1 col-span-full xs:col-span-3 xs:col-start-2",type:"submit",disabled:l||!c||n,onClick:o,children:n?h.jsxs("span",{className:"flex items-center leading-relaxed",children:[h.jsx(cn,{className:"inline animate-spin h-4"})," Revoking..."]}):d})]})})}const Lh=[{title:"Info",icon:h.jsx(h5,{className:"mr-2 h-5 w-5 hidden xs:block"})},{title:"IDs",icon:h.jsx(T0,{className:"mr-2 h-5 w-5 hidden xs:block"})},{title:"Revoke",icon:h.jsx(yP,{className:"mr-2 h-5 w-5 hidden xs:block"}),className:"hover:bg-destructive hover:text-destructive-foreground"}];function Oze(){const{isModalOpen:e,closeModal:t,actionRef:n}=Cie(),[r,i]=C.useState(Lh[0].title),[s,a]=C.useState(0),[o,l]=C.useState(void 0),[c,d]=C.useState(""),[u,f]=C.useState(0),g=qt({method:"GET",path:"/history/action",abortOnUnmount:!0}),x=()=>{a(s+1)};C.useEffect(()=>{n&&(l(void 0),d(""),g({queryParams:{id:n},success:m=>{"error"in m?d(m.error):(l(m),f(Math.round(Date.now()/1e3)))},error:m=>{d(m)}}))},[n,s]),C.useEffect(()=>{e||setTimeout(()=>{i(Lh[0].title)},200)},[e]);const _=m=>{e&&!m&&t()},v=m=>{if(m.key==="ArrowUp"||m.key==="ArrowDown"){m.preventDefault();const y=Lh.findIndex(w=>w.title===r),b=m.key==="ArrowUp"?y-1:y+1,S=Lh[b];if(S){i(S.title);const w=document.getElementById(`action-modal-tab-${S.title}`);w&&w.focus()}}};let p;if(o){const m=o.action.playerName!==!1?h.jsx("span",{children:o.action.playerName}):h.jsx("span",{className:"italic opacity-75",children:"unknown player"});if(o.action.type==="ban")p=h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:"text-destructive-inline font-mono mr-2",children:["[",o.action.id,"]"]}),"Banned ",m]});else if(o.action.type==="warn")p=h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:"text-warning-inline font-mono mr-2",children:["[",o.action.id,"]"]}),"Warned ",m]});else throw new Error(`Unknown action type: ${o.action.type}`)}else c?p=h.jsx("span",{className:"text-destructive-inline",children:"Error!"}):p=h.jsx("span",{className:"text-muted-foreground italic",children:"Loading..."});return h.jsx(Hp,{open:e,onOpenChange:_,children:h.jsxs(Sd,{className:"max-w-2xl h-full sm:h-auto max-h-full p-0 gap-1 sm:gap-4 flex flex-col",children:[h.jsx(Cd,{className:"px-4 py-3 border-b",children:h.jsx(kd,{className:"tracking-wide line-clamp-1 leading-7 break-all mr-6",children:p})}),h.jsxs("div",{className:"flex flex-col md:flex-row md:px-4 h-full",children:[h.jsx("div",{className:"flex flex-row md:flex-col gap-1 bg-muted md:bg-transparent p-1 md:p-0 mx-2 md:mx-0 rounded-md",children:Lh.map(m=>h.jsxs(Ke,{id:`action-modal-tab-${m.title}`,variant:r===m.title?"secondary":"ghost",className:ie("w-full tracking-wider justify-center md:justify-start","h-7 rounded-sm px-2 text-sm","md:h-10 md:text-base",m.className),onClick:()=>i(m.title),onKeyDown:v,children:[m.icon," ",m.title]},m.title))}),h.jsx(Ni,{className:"w-full max-h-[calc(100vh-3.125rem-4rem)] min-h-[16.5rem] md:max-h-[50vh] px-4 py-2 md:py-0",children:o?h.jsxs(h.Fragment,{children:[r==="Info"&&h.jsx(Pze,{action:o.action,serverTime:o.serverTime,tsFetch:u}),r==="IDs"&&h.jsx(Dze,{action:o.action}),r==="Revoke"&&h.jsx(Nze,{action:o.action,refreshModalData:x})]}):h.jsx(D_,{children:c?h.jsxs("span",{className:"text-destructive-inline",children:["Error: ",c]}):h.jsx(L_,{msg:"Loading..."})})})]})]})})}function Ize(){const e=H5(),t=tZ(),n=y1(),r=P5(),i=aLe();return Pi("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"?ZC(s.data.href):s.data.type==="globalHotkey"&&s.data.action==="toggleLightMode"&&i()}),C.useEffect(()=>{const s=new URL(window.location.toString()),a=s.searchParams.get(i2),o=s.searchParams.get(v2);if(!(!a&&!o)){if(a){if(a.includes("#")){const[l,c]=a.split("#"),d=parseInt(c);if(l.length&&c.length&&!isNaN(d))return n({mutex:l,netid:d})}else if(a.length)return n({license:a})}else if(o&&o.length)return r(o);s.searchParams.delete(i2),s.searchParams.delete(v2),window.history.replaceState({},"",s)}},[]),Pi("keydown",uO),h.jsx(h.Fragment,{children:h.jsxs(xFe,{delayDuration:300,disableHoverableContent:!0,children:[h.jsx(vBe,{}),h.jsxs("div",{className:"md:px-3 min-h-full pt-2 md:py-4 w-full max-w-[1920px] mx-auto flex flex-row gap-4",children:[h.jsx(iV,{}),h.jsx("main",{className:"flex flex-1 min-h-[calc(100vh-4rem-1px)] md:min-h-[calc(100vh-5.5rem-1px)]",children:h.jsx(OFe,{})}),window.txConsts.isWebInterface&&h.jsx(sV,{})]}),h.jsx(WBe,{}),h.jsx(JBe,{}),h.jsx(hze,{}),h.jsx(fze,{}),h.jsx(wie,{}),h.jsx(xze,{}),h.jsx(Rze,{}),h.jsx(Oze,{}),h.jsx(Aze,{})]})})}const Cc=({children:e})=>h.jsx("h1",{className:"text-2xl font-bold text-red-500 mb-4",children:e}),jh=({children:e})=>h.jsx("p",{className:"whitespace-pre-wrap pb-2",children:e}),kc=({returnTo:e})=>h.jsx(gd,{className:"w-full flex justify-center mt-4 pb-0",children:h.jsx(ca,{href:e,children:h.jsx(Ke,{className:"x",children:"Try Again"})})});function ZV({error:e,returnTo:t}){var n,r;if(t=t??"/login","errorTitle"in e)return h.jsxs("div",{children:[h.jsx(Cc,{children:e.errorTitle}),h.jsx(jh,{children:e.errorMessage}),h.jsx(kc,{returnTo:t})]});if(e.errorCode==="invalid_session")return h.jsxs("div",{children:[h.jsx(Cc,{children:"Invalid Browser Session."}),h.jsxs(jh,{children:["You may have restarted txAdmin right before entering this page. ",h.jsx("br",{}),"Please return and try again."]}),h.jsx(kc,{returnTo:t})]});if(e.errorCode==="clock_desync")return h.jsxs("div",{children:[h.jsx(Cc,{children:"Please Update/Synchronize your VPS clock."}),h.jsx(jh,{children:"Failed to login because this host's time is wrong. Please make sure to synchronize it with the internet."}),h.jsx(kc,{returnTo:t})]});if(e.errorCode==="timeout")return h.jsxs("div",{children:[h.jsx(Cc,{children:"Connection to FiveM servers timed out."}),h.jsx(jh,{children:"Please try again or login using your existing username and backup password."}),h.jsx(kc,{returnTo:t})]});if(e.errorCode==="not_admin"){const i=((n=e.errorContext)==null?void 0:n.identifier)??"unknown",s=((r=e.errorContext)==null?void 0:r.name)??"unknown";return h.jsxs("div",{children:[h.jsx(Cc,{children:`The Cfx.re account '${s}' is not an admin.`}),h.jsxs(jh,{children:["The account above with identifier ",h.jsx(Mn,{children:i})," is not assigned to any account registered on txAdmin. ",h.jsx("br",{}),"You can also try to login using your username and backup password."]}),h.jsx(kc,{returnTo:t})]})}else return h.jsxs(h.Fragment,{children:[h.jsx(Cc,{children:"Unknown Error:"}),h.jsx("div",{className:"text-left rounded-sm text-muted-foreground bg-muted p-1",children:h.jsx("code",{className:"text-left whitespace-pre-wrap ",children:JSON.stringify(e,null,2)})}),h.jsx(kc,{returnTo:t})]})}function $ze(){const{authData:e,setAuthData:t}=$l(),[n,r]=C.useState(),i=C.useRef(!1),s=ml({mutationKey:["auth"],mutationFn:({redirectUri:a})=>fetch("/auth/cfxre/callback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({redirectUri:a})}).then(o=>o.json()),onSuccess:a=>{"errorCode"in a||"errorTitle"in a?r(a):t(a)},onError:a=>{a.message.startsWith("NetworkError")?r({errorTitle:"Network Error",errorMessage:"If you closed txAdmin, please restart it and try again."}):r({errorTitle:"Unknown Error",errorMessage:a.message})}});return C.useEffect(()=>{if(!(e||i.current))return i.current=!0,s.mutate({redirectUri:window.location.href}),s.reset},[]),n?h.jsx(ZV,{error:n}):h.jsx(L_,{msg:"Logging in..."})}function Fze(){const[e,t]=C.useState(!1),[n,r]=C.useState(),[i,s]=C.useState(!1),a=C.useRef(null),o=ml({mutationFn:({pin:d,origin:u})=>fetch("/auth/addMaster/pin",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pin:d,origin:u})}).then(f=>f.json()),onSuccess:d=>{"error"in d?d.error==="master_already_set"?(t(!0),window.location.href=`/login${md.MASTER_ALREADY_SET}`):(s(!0),r(d.error)):(t(!0),console.log("Redirecting to",d.authUrl),window.location.href=d.authUrl)},onError:d=>{s(!0),d.message.startsWith("NetworkError")?r("Network error. If you closed txAdmin, please restart it and try again."):r(d.message)}}),l=d=>{var u;d==null||d.preventDefault(),s(!1),r(void 0),o.mutate({pin:((u=a.current)==null?void 0:u.value)||"0000",origin:window.location.origin})};C.useEffect(()=>{/^#\d{4}$/.test(window.location.hash)&&(r("Autofilled ✔"),a.current.value=window.location.hash.substring(1))},[]);const c=o.isPending||e;return h.jsxs("form",{onSubmit:l,className:"w-full",children:[h.jsxs(R1,{className:"space-y-1",children:[h.jsx(K5,{className:"text-3xl",children:"No Cfx.re account linked."}),h.jsx(FN,{className:"text-sm text-muted-foreground",children:'Type the PIN from your terminal and click "Link Account".'})]}),h.jsxs(Lp,{className:"grid gap-2",children:[h.jsx("span",{className:ie("text-center",i?"text-destructive":"text-success"),children:n??h.jsx(h.Fragment,{children:" "})}),h.jsx(ln,{className:ie("text-2xl text-center font-mono tracking-[0.25em] p-2",n&&(i?"border-acctext-destructive text-destructive":"border-succtext-success text-success")),id:"frm-pin",type:"text",ref:a,minLength:4,maxLength:4,placeholder:"0000",autoComplete:"off",onFocus:()=>{s(!1),r(void 0)},disabled:c,required:!0})]}),h.jsx(gd,{children:h.jsxs(Ke,{className:"w-full",disabled:c,children:[c&&h.jsx(cn,{className:"mr-2 h-4 w-4 animate-spin"}),"Link Account"]})})]})}var rT="Checkbox",[Bze,gUe]=Hi(rT),[zze,Uze]=Bze(rT),eq=C.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:s,required:a,disabled:o,value:l="on",onCheckedChange:c,form:d,...u}=e,[f,g]=C.useState(null),x=We(t,b=>g(b)),_=C.useRef(!1),v=f?d||!!f.closest("form"):!0,[p=!1,m]=gs({prop:i,defaultProp:s,onChange:c}),y=C.useRef(p);return C.useEffect(()=>{const b=f==null?void 0:f.form;if(b){const S=()=>m(y.current);return b.addEventListener("reset",S),()=>b.removeEventListener("reset",S)}},[f,m]),h.jsxs(zze,{scope:n,state:p,disabled:o,children:[h.jsx(Me.button,{type:"button",role:"checkbox","aria-checked":oa(p)?"mixed":p,"aria-required":a,"data-state":rq(p),"data-disabled":o?"":void 0,disabled:o,value:l,...u,ref:x,onKeyDown:me(e.onKeyDown,b=>{b.key==="Enter"&&b.preventDefault()}),onClick:me(e.onClick,b=>{m(S=>oa(S)?!0:!S),v&&(_.current=b.isPropagationStopped(),_.current||b.stopPropagation())})}),v&&h.jsx(Hze,{control:f,bubbles:!_.current,name:r,value:l,checked:p,required:a,disabled:o,form:d,style:{transform:"translateX(-100%)"},defaultChecked:oa(s)?!1:s})]})});eq.displayName=rT;var tq="CheckboxIndicator",nq=C.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,s=Uze(tq,n);return h.jsx(wn,{present:r||oa(s.state)||s.state===!0,children:h.jsx(Me.span,{"data-state":rq(s.state),"data-disabled":s.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});nq.displayName=tq;var Hze=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:i,...s}=e,a=C.useRef(null),o=Tk(n),l=UO(t);C.useEffect(()=>{const d=a.current,u=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(u,"checked").set;if(o!==n&&g){const x=new Event("click",{bubbles:r});d.indeterminate=oa(n),g.call(d,oa(n)?!1:n),d.dispatchEvent(x)}},[o,n,r]);const c=C.useRef(oa(n)?!1:n);return h.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i??c.current,...s,tabIndex:-1,ref:a,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function oa(e){return e==="indeterminate"}function rq(e){return oa(e)?"indeterminate":e?"checked":"unchecked"}var iq=eq,Wze=nq;const sq=C.forwardRef(({className:e,...t},n)=>h.jsx(iq,{ref:n,className:ie("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:h.jsx(Wze,{className:ie("flex items-center justify-center text-current"),children:h.jsx(d5,{className:"h-4 w-4"})})}));sq.displayName=iq.displayName;function Vze({fivemId:e,fivemName:t,profilePicture:n}){const{setAuthData:r}=$l(),[i,s]=C.useState(),a=C.useRef(null),o=C.useRef(null),l=C.useRef(null),c=C.useRef(null),d=ml({mutationKey:["auth"],mutationFn:({discordId:f,password:g})=>fetch("/auth/addMaster/save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({discordId:f,password:g})}).then(x=>x.json()),onSuccess:f=>{"error"in f?s(f.error):(window.txConsts.hasMasterAccount=!0,r(f))},onError:f=>{f.message.startsWith("NetworkError")?s("Network error. If you closed txAdmin, please restart it and try again."):s(f.message)}}),u=f=>{var p,m,y,b,S;f==null||f.preventDefault(),s(void 0);let g,x=(m=(p=a.current)==null?void 0:p.value)==null?void 0:m.trim();if(typeof x=="string"&&x.length>0){if(x.startsWith("discord:")&&(x=x.substring(8),a.current.value=x),!wi.validIdentifierParts.discord.test(x)){s(`The Discord ID needs to be the numeric "User ID" instead of the username.
 You can also leave it blank.`);return}g=x}if(((y=c.current)==null?void 0:y.value)!=="on"){s("You MUST agree to the terms.");return}const _=((b=o.current)==null?void 0:b.value)||"",v=((S=l.current)==null?void 0:S.value)||"";if(_.length<wi.adminPasswordMinLength||_.length>wi.adminPasswordMaxLength){s(`The password must be between ${wi.adminPasswordMinLength} and ${wi.adminPasswordMaxLength} characters long.`);return}else if(_!==v){s("The passwords do not match.");return}d.mutate({discordId:g,password:_})};return C.useEffect(()=>{try{const f=localStorage.getItem("authCredsAutofill");if(f){const[g,x]=JSON.parse(f);o.current.value=x??"",l.current.value=x??""}}catch(f){console.error("Passwords autofill failed",f)}},[]),h.jsxs("form",{onSubmit:u,className:"w-full text-left",children:[h.jsxs(Lp,{className:"flex flex-col gap-4",children:[h.jsxs("div",{children:["Cfx.re account",h.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:[h.jsx(tV,{className:"h-16 w-16 text-3xl",username:t,profilePicture:n}),h.jsxs("div",{className:"text-left ml-4 overflow-hidden text-ellipsis",children:[h.jsx("span",{className:"text-2xl",children:t})," ",h.jsx("br",{}),h.jsx("code",{className:"text-muted-foreground",children:e})]})]})]}),h.jsx("input",{type:"text",name:"frm-username",className:"hidden",value:t,readOnly:!0}),h.jsxs("div",{className:"grid gap-2",children:[h.jsxs("div",{className:"flex flex-row justify-between items-center",children:[h.jsx(af,{htmlFor:"frm-discord",children:"Discord ID"}),h.jsx("span",{className:"text-muted-foreground text-xs",children:"(optional)"})]}),h.jsx(ln,{className:"dark:placeholder:text-zinc-800",id:"frm-discord",type:"text",ref:a,placeholder:"000000000000000000",disabled:d.isPending})]}),h.jsxs("div",{className:"grid gap-2",children:[h.jsxs("div",{className:"flex flex-row justify-between items-center",children:[h.jsx(af,{htmlFor:"frm-password",children:"Backup Password"}),h.jsxs("span",{className:"text-muted-foreground text-xs",children:["(",wi.adminPasswordMinLength,"~",wi.adminPasswordMaxLength," digits)"]})]}),h.jsx(ln,{className:"dark:placeholder:text-zinc-800",id:"frm-password",type:"password",ref:o,placeholder:"password",disabled:d.isPending,required:!0})]}),h.jsxs("div",{className:"grid gap-2",children:[h.jsx(af,{htmlFor:"frm-password2",children:"Confirm Password"}),h.jsx(ln,{className:"dark:placeholder:text-zinc-800",id:"frm-password2",type:"password",ref:l,placeholder:"password",disabled:d.isPending,required:!0})]}),h.jsxs("div",{className:"flex items-center space-x-2 mt-2",children:[h.jsx(sq,{id:"terms",ref:c,required:!0}),h.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 ",h.jsx("a",{href:"https://fivem.net/terms",target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline",children:"Creator PLA"})," as well as the ",h.jsx("a",{href:"https://github.com/tabarra/txAdmin/blob/master/LICENSE",target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline",children:"txAdmin License"}),"."]})]})]}),h.jsxs(gd,{className:"flex-col gap-2",children:[h.jsx("span",{className:"text-center text-destructive whitespace-pre-wrap",children:i}),h.jsxs(Ke,{className:"w-full",disabled:d.isPending,children:[d.isPending&&h.jsx(cn,{className:"mr-2 h-4 w-4 animate-spin"}),"Register"]})]})]})}function qze(){const e=C.useRef(!1),[t,n]=C.useState(),[r,i]=C.useState(),s=ml({mutationKey:["auth"],mutationFn:({redirectUri:a})=>fetch("/auth/addMaster/callback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({redirectUri:a})}).then(o=>o.json()),onSuccess:a=>{"errorCode"in a||"errorTitle"in a?i(a):n(a)},onError:a=>{a.message.startsWith("NetworkError")?i({errorTitle:"Network Error",errorMessage:"If you closed txAdmin, please restart it and try again."}):i({errorTitle:"Unknown Error",errorMessage:a.message})}});return C.useEffect(()=>{if(!(t||e.current))return e.current=!0,s.mutate({redirectUri:window.location.href}),s.reset},[]),t?h.jsx(Vze,{...t}):r?h.jsx(ZV,{error:r,returnTo:"/addMaster/pin"}):h.jsx(L_,{msg:"Authenticating..."})}function Yze(){return h.jsx("div",{className:"min-h-screen flex items-center justify-center",children:h.jsxs("div",{className:"text-center m-4 w-full xs:w-[25rem] min-w-[20rem]",children:[h.jsx(QE,{className:"h-12 mx-auto"}),h.jsx(Y5,{className:"min-h-64 mt-8 mb-4 p-4 flex items-center justify-center",children:h.jsxs(wj,{children:[h.jsx($a,{path:"/login",children:h.jsx(ose,{})}),h.jsx($a,{path:"/login/callback",children:h.jsx($ze,{})}),h.jsx($a,{path:"/addMaster/pin",children:h.jsx(Fze,{})}),h.jsx($a,{path:"/addMaster/callback",children:h.jsx(qze,{})}),h.jsx($a,{path:"/:fullPath*",children:h.jsx("small",{children:"redirecting to the login page..."})})]})}),h.jsxs("div",{className:"mx-auto flex flex-wrap gap-4 justify-center mb-2",children:[window.txConsts.adsData.login?h.jsxs("a",{href:window.txConsts.adsData.login.url,onClick:zf,target:"_blank",className:`w-48 h-16 relative group shadow-sm opacity-90 hover:opacity-100
                            dark:brightness-90 dark:hover:brightness-110`,children:[h.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]`}),h.jsx("img",{className:"rounded-lg max-w-48 max-h-16 m-auto",src:window.txConsts.adsData.login.img})]}):null,h.jsxs("a",{href:"https://discord.gg/uAmsGa2",onClick:zf,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:[h.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]`}),h.jsx("img",{className:"rounded-lg max-w-48 max-h-16 m-auto",src:"img/discord.png"})]})]}),h.jsx("div",{children:h.jsxs("small",{className:"text-muted-foreground text-sm font-light",children:["tx: ",h.jsxs("strong",{children:["v",window.txConsts.txaVersion]})," | fx: ",h.jsxs("strong",{children:["b",window.txConsts.fxsVersion]})]})})]})})}function Kze({children:e}){const{theme:t,setTheme:n}=mH();return C.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]),h.jsx(h.Fragment,{children:e})}var iT={exports:{}};iT.exports=sT;var Gze=iT.exports.isMobile=sT;iT.exports.default=sT;const Xze=/(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,Qze=/CrOS/,Jze=/android|ipad|playbook|silk/i;function sT(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=Xze.test(t)&&!Qze.test(t)||!!e.tablet&&Jze.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("Silencing txAdmin Web UI console.* calls inside NUI to prevent confusion."),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=Gze({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)}const Zze=["/login","/addMaster"],B8=e=>Zze.some(t=>e.startsWith(t));function eUe(){ut(sse),ut(Yse);const e=nse();return C.useEffect(()=>{if(e){const n=new URLSearchParams(window.location.search).get("r");n?lse(n)?window.history.replaceState(null,"",n):window.history.replaceState(null,"","/"):B8(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")):B8(window.location.pathname)||(console.log("User is not authenticated. Redirecting to login page."),W5())},[e]),e?h.jsx(Ize,{}):h.jsx(Yze,{})}const tUe=new dQ;zb.createRoot(document.getElementById("root")).render(h.jsx(C.StrictMode,{children:h.jsx(c7,{FallbackComponent:zse,children:h.jsx(gQ,{client:tUe,children:h.jsx(Kze,{children:h.jsx(eUe,{})})})})}));
//# sourceMappingURL=index-dykq9dof.js.map
