From 064214517fbf0d06650310a121492a687de7747c Mon Sep 17 00:00:00 2001 From: Norman Fomferra Date: Mon, 5 Aug 2024 14:46:10 +0200 Subject: [PATCH] Bundled xcube viewer 1.3.0-dev.1 (fix) --- .../{index-C0IJjFZs.js => index-CsG0ZZ4e.js} | 516 +++++++++--------- xcube/webapi/viewer/dist/index.html | 2 +- 2 files changed, 259 insertions(+), 259 deletions(-) rename xcube/webapi/viewer/dist/assets/{index-C0IJjFZs.js => index-CsG0ZZ4e.js} (73%) diff --git a/xcube/webapi/viewer/dist/assets/index-C0IJjFZs.js b/xcube/webapi/viewer/dist/assets/index-CsG0ZZ4e.js similarity index 73% rename from xcube/webapi/viewer/dist/assets/index-C0IJjFZs.js rename to xcube/webapi/viewer/dist/assets/index-CsG0ZZ4e.js index 0059dc86c..fb76b939e 100644 --- a/xcube/webapi/viewer/dist/assets/index-C0IJjFZs.js +++ b/xcube/webapi/viewer/dist/assets/index-CsG0ZZ4e.js @@ -1,58 +1,58 @@ -var A0e=Object.defineProperty;var R0e=(t,e,n)=>e in t?A0e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Yt=(t,e,n)=>(R0e(t,typeof e!="symbol"?e+"":e,n),n);function I0e(t,e){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var Kn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Nt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ea(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var jJ={exports:{}},e1={};/* +var R0e=Object.defineProperty;var I0e=(t,e,n)=>e in t?R0e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Yt=(t,e,n)=>(I0e(t,typeof e!="symbol"?e+"":e,n),n);function D0e(t,e){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var Kn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Nt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ea(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var zJ={exports:{}},e1={};/* object-assign (c) Sindre Sorhus @license MIT -*/var L6=Object.getOwnPropertySymbols,D0e=Object.prototype.hasOwnProperty,L0e=Object.prototype.propertyIsEnumerable;function $0e(t){if(t==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function N0e(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de",Object.getOwnPropertyNames(t)[0]==="5")return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(e).map(function(o){return e[o]});if(r.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(o){i[o]=o}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var BJ=N0e()?Object.assign:function(t,e){for(var n,r=$0e(t),i,o=1;o"u"||typeof MessageChannel!="function"){var l=null,c=null,u=function(){if(l!==null)try{var $=t.unstable_now();l(!0,$),l=null}catch(D){throw setTimeout(u,0),D}};e=function($){l!==null?setTimeout(e,0,$):(l=$,setTimeout(u,0))},n=function($,D){c=setTimeout($,D)},r=function(){clearTimeout(c)},t.unstable_shouldYield=function(){return!1},i=t.unstable_forceFrameRate=function(){}}else{var f=window.setTimeout,d=window.clearTimeout;if(typeof console<"u"){var h=window.cancelAnimationFrame;typeof window.requestAnimationFrame!="function"&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),typeof h!="function"&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var p=!1,m=null,g=-1,v=5,y=0;t.unstable_shouldYield=function(){return t.unstable_now()>=y},i=function(){},t.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):v=0<$?Math.floor(1e3/$):5};var x=new MessageChannel,b=x.port2;x.port1.onmessage=function(){if(m!==null){var $=t.unstable_now();y=$+v;try{m(!0,$)?b.postMessage(null):(p=!1,m=null)}catch(D){throw b.postMessage(null),D}}else p=!1},e=function($){m=$,p||(p=!0,b.postMessage(null))},n=function($,D){g=f(function(){$(t.unstable_now())},D)},r=function(){d(g),g=-1}}function _($,D){var A=$.length;$.push(D);e:for(;;){var q=A-1>>>1,Y=$[q];if(Y!==void 0&&0C(se,A))J!==void 0&&0>C(J,se)?($[q]=J,$[te]=A,q=te):($[q]=se,$[K]=A,q=K);else if(J!==void 0&&0>C(J,A))$[q]=J,$[te]=A,q=te;else break e}}return D}return null}function C($,D){var A=$.sortIndex-D.sortIndex;return A!==0?A:$.id-D.id}var E=[],k=[],I=1,P=null,R=3,T=!1,L=!1,z=!1;function B($){for(var D=S(k);D!==null;){if(D.callback===null)O(k);else if(D.startTime<=$)O(k),D.sortIndex=D.expirationTime,_(E,D);else break;D=S(k)}}function W($){if(z=!1,B($),!L)if(S(E)!==null)L=!0,e(U);else{var D=S(k);D!==null&&n(W,D.startTime-$)}}function U($,D){L=!1,z&&(z=!1,r()),T=!0;var A=R;try{for(B(D),P=S(E);P!==null&&(!(P.expirationTime>D)||$&&!t.unstable_shouldYield());){var q=P.callback;if(typeof q=="function"){P.callback=null,R=P.priorityLevel;var Y=q(P.expirationTime<=D);D=t.unstable_now(),typeof Y=="function"?P.callback=Y:P===S(E)&&O(E),B(D)}else O(E);P=S(E)}if(P!==null)var K=!0;else{var se=S(k);se!==null&&n(W,se.startTime-D),K=!1}return K}finally{P=null,R=A,T=!1}}var N=i;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function($){$.callback=null},t.unstable_continueExecution=function(){L||T||(L=!0,e(U))},t.unstable_getCurrentPriorityLevel=function(){return R},t.unstable_getFirstCallbackNode=function(){return S(E)},t.unstable_next=function($){switch(R){case 1:case 2:case 3:var D=3;break;default:D=R}var A=R;R=D;try{return $()}finally{R=A}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=N,t.unstable_runWithPriority=function($,D){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var A=R;R=$;try{return D()}finally{R=A}},t.unstable_scheduleCallback=function($,D,A){var q=t.unstable_now();switch(typeof A=="object"&&A!==null?(A=A.delay,A=typeof A=="number"&&0q?($.sortIndex=A,_(k,$),S(E)===null&&$===S(k)&&(z?r():z=!0,n(W,A-q))):($.sortIndex=Y,_(E,$),L||T||(L=!0,e(U))),$},t.unstable_wrapCallback=function($){var D=R;return function(){var A=R;R=D;try{return $.apply(this,arguments)}finally{R=A}}}})(oee);iee.exports=oee;var q0e=iee.exports;/** @license React v17.0.2 + */(function(t){var e,n,r,i;if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();t.unstable_now=function(){return a.now()-s}}if(typeof window>"u"||typeof MessageChannel!="function"){var l=null,c=null,u=function(){if(l!==null)try{var $=t.unstable_now();l(!0,$),l=null}catch(D){throw setTimeout(u,0),D}};e=function($){l!==null?setTimeout(e,0,$):(l=$,setTimeout(u,0))},n=function($,D){c=setTimeout($,D)},r=function(){clearTimeout(c)},t.unstable_shouldYield=function(){return!1},i=t.unstable_forceFrameRate=function(){}}else{var f=window.setTimeout,d=window.clearTimeout;if(typeof console<"u"){var h=window.cancelAnimationFrame;typeof window.requestAnimationFrame!="function"&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),typeof h!="function"&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var p=!1,m=null,g=-1,v=5,y=0;t.unstable_shouldYield=function(){return t.unstable_now()>=y},i=function(){},t.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):v=0<$?Math.floor(1e3/$):5};var x=new MessageChannel,b=x.port2;x.port1.onmessage=function(){if(m!==null){var $=t.unstable_now();y=$+v;try{m(!0,$)?b.postMessage(null):(p=!1,m=null)}catch(D){throw b.postMessage(null),D}}else p=!1},e=function($){m=$,p||(p=!0,b.postMessage(null))},n=function($,D){g=f(function(){$(t.unstable_now())},D)},r=function(){d(g),g=-1}}function _($,D){var A=$.length;$.push(D);e:for(;;){var q=A-1>>>1,Y=$[q];if(Y!==void 0&&0C(se,A))J!==void 0&&0>C(J,se)?($[q]=J,$[te]=A,q=te):($[q]=se,$[K]=A,q=K);else if(J!==void 0&&0>C(J,A))$[q]=J,$[te]=A,q=te;else break e}}return D}return null}function C($,D){var A=$.sortIndex-D.sortIndex;return A!==0?A:$.id-D.id}var E=[],k=[],I=1,P=null,R=3,T=!1,L=!1,z=!1;function B($){for(var D=S(k);D!==null;){if(D.callback===null)O(k);else if(D.startTime<=$)O(k),D.sortIndex=D.expirationTime,_(E,D);else break;D=S(k)}}function W($){if(z=!1,B($),!L)if(S(E)!==null)L=!0,e(U);else{var D=S(k);D!==null&&n(W,D.startTime-$)}}function U($,D){L=!1,z&&(z=!1,r()),T=!0;var A=R;try{for(B(D),P=S(E);P!==null&&(!(P.expirationTime>D)||$&&!t.unstable_shouldYield());){var q=P.callback;if(typeof q=="function"){P.callback=null,R=P.priorityLevel;var Y=q(P.expirationTime<=D);D=t.unstable_now(),typeof Y=="function"?P.callback=Y:P===S(E)&&O(E),B(D)}else O(E);P=S(E)}if(P!==null)var K=!0;else{var se=S(k);se!==null&&n(W,se.startTime-D),K=!1}return K}finally{P=null,R=A,T=!1}}var N=i;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function($){$.callback=null},t.unstable_continueExecution=function(){L||T||(L=!0,e(U))},t.unstable_getCurrentPriorityLevel=function(){return R},t.unstable_getFirstCallbackNode=function(){return S(E)},t.unstable_next=function($){switch(R){case 1:case 2:case 3:var D=3;break;default:D=R}var A=R;R=D;try{return $()}finally{R=A}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=N,t.unstable_runWithPriority=function($,D){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var A=R;R=$;try{return D()}finally{R=A}},t.unstable_scheduleCallback=function($,D,A){var q=t.unstable_now();switch(typeof A=="object"&&A!==null?(A=A.delay,A=typeof A=="number"&&0q?($.sortIndex=A,_(k,$),S(E)===null&&$===S(k)&&(z?r():z=!0,n(W,A-q))):($.sortIndex=Y,_(E,$),L||T||(L=!0,e(U))),$},t.unstable_wrapCallback=function($){var D=R;return function(){var A=R;R=D;try{return $.apply(this,arguments)}finally{R=A}}}})(see);aee.exports=see;var X0e=aee.exports;/** @license React v17.0.2 * 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 IP=M,dr=BJ,ci=q0e;function Xe(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),X0e=/^[: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]*$/,j6=Object.prototype.hasOwnProperty,B6={},z6={};function Q0e(t){return j6.call(z6,t)?!0:j6.call(B6,t)?!1:X0e.test(t)?z6[t]=!0:(B6[t]=!0,!1)}function Y0e(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function K0e(t,e,n,r){if(e===null||typeof e>"u"||Y0e(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function go(t,e,n,r,i,o,a){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=o,this.removeEmptyString=a}var Di={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Di[t]=new go(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Di[e]=new go(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Di[t]=new go(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Di[t]=new go(t,2,!1,t,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(t){Di[t]=new go(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Di[t]=new go(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Di[t]=new go(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Di[t]=new go(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Di[t]=new go(t,5,!1,t.toLowerCase(),null,!1,!1)});var RF=/[\-:]([a-z])/g;function IF(t){return t[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(t){var e=t.replace(RF,IF);Di[e]=new go(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(RF,IF);Di[e]=new go(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(RF,IF);Di[e]=new go(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Di[t]=new go(t,1,!1,t.toLowerCase(),null,!1,!1)});Di.xlinkHref=new go("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Di[t]=new go(t,1,!1,t.toLowerCase(),null,!0,!0)});function DF(t,e,n,r){var i=Di.hasOwnProperty(e)?Di[e]:null,o=i!==null?i.type===0:r?!1:!(!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Q0e=/^[: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]*$/,B6=Object.prototype.hasOwnProperty,z6={},U6={};function Y0e(t){return B6.call(U6,t)?!0:B6.call(z6,t)?!1:Q0e.test(t)?U6[t]=!0:(z6[t]=!0,!1)}function K0e(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function Z0e(t,e,n,r){if(e===null||typeof e>"u"||K0e(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function go(t,e,n,r,i,o,a){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=o,this.removeEmptyString=a}var Di={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Di[t]=new go(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Di[e]=new go(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Di[t]=new go(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Di[t]=new go(t,2,!1,t,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(t){Di[t]=new go(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Di[t]=new go(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Di[t]=new go(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Di[t]=new go(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Di[t]=new go(t,5,!1,t.toLowerCase(),null,!1,!1)});var IF=/[\-:]([a-z])/g;function DF(t){return t[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(t){var e=t.replace(IF,DF);Di[e]=new go(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(IF,DF);Di[e]=new go(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(IF,DF);Di[e]=new go(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Di[t]=new go(t,1,!1,t.toLowerCase(),null,!1,!1)});Di.xlinkHref=new go("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Di[t]=new go(t,1,!1,t.toLowerCase(),null,!0,!0)});function LF(t,e,n,r){var i=Di.hasOwnProperty(e)?Di[e]:null,o=i!==null?i.type===0:r?!1:!(!(2s||i[a]!==o[s])return` -`+i[a].replace(" at new "," at ");while(1<=a&&0<=s);break}}}finally{zk=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?J0(t):""}function Z0e(t){switch(t.tag){case 5:return J0(t.type);case 16:return J0("Lazy");case 13:return J0("Suspense");case 19:return J0("SuspenseList");case 0:case 2:case 15:return t=Lw(t.type,!1),t;case 11:return t=Lw(t.type.render,!1),t;case 22:return t=Lw(t.type._render,!1),t;case 1:return t=Lw(t.type,!0),t;default:return""}}function sg(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case lf:return"Fragment";case sh:return"Portal";case bx:return"Profiler";case LF:return"StrictMode";case _x:return"Suspense";case qC:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case NF:return(t.displayName||"Context")+".Consumer";case $F:return(t._context.displayName||"Context")+".Provider";case DP:var e=t.render;return e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case LP:return sg(t.type);case jF:return sg(t._render);case FF:e=t._payload,t=t._init;try{return sg(t(e))}catch{}}return null}function Wf(t){switch(typeof t){case"boolean":case"number":case"object":case"string":case"undefined":return t;default:return""}}function lee(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function J0e(t){var e=lee(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,o.call(this,a)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function $w(t){t._valueTracker||(t._valueTracker=J0e(t))}function cee(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=lee(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function XC(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function ID(t,e){var n=e.checked;return dr({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function W6(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Wf(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function uee(t,e){e=e.checked,e!=null&&DF(t,"checked",e,!1)}function DD(t,e){uee(t,e);var n=Wf(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?LD(t,e.type,n):e.hasOwnProperty("defaultValue")&&LD(t,e.type,Wf(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function V6(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function LD(t,e,n){(e!=="number"||XC(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}function exe(t){var e="";return IP.Children.forEach(t,function(n){n!=null&&(e+=n)}),e}function $D(t,e){return t=dr({children:void 0},e),(e=exe(e.children))&&(t.children=e),t}function lg(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i=n.length))throw Error(Xe(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:Wf(n)}}function fee(t,e){var n=Wf(e.value),r=Wf(e.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),e.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),r!=null&&(t.defaultValue=""+r)}function H6(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}var FD={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function dee(t){switch(t){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 jD(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?dee(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var Nw,hee=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,n,r,i){MSApp.execUnsafeLocalFunction(function(){return t(e,n,r,i)})}:t}(function(t,e){if(t.namespaceURI!==FD.svg||"innerHTML"in t)t.innerHTML=e;else{for(Nw=Nw||document.createElement("div"),Nw.innerHTML=""+e.valueOf().toString()+"",e=Nw.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function ub(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var wx={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,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},txe=["Webkit","ms","Moz","O"];Object.keys(wx).forEach(function(t){txe.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),wx[e]=wx[t]})});function pee(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||wx.hasOwnProperty(t)&&wx[t]?(""+e).trim():e+"px"}function mee(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=pee(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var nxe=dr({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 BD(t,e){if(e){if(nxe[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Xe(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Xe(60));if(!(typeof e.dangerouslySetInnerHTML=="object"&&"__html"in e.dangerouslySetInnerHTML))throw Error(Xe(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Xe(62))}}function zD(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){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}}function UF(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var UD=null,cg=null,ug=null;function q6(t){if(t=r1(t)){if(typeof UD!="function")throw Error(Xe(280));var e=t.stateNode;e&&(e=zP(e),UD(t.stateNode,t.type,e))}}function gee(t){cg?ug?ug.push(t):ug=[t]:cg=t}function vee(){if(cg){var t=cg,e=ug;if(ug=cg=null,q6(t),e)for(t=0;tr?0:1<n;n++)e.push(t);return e}function NP(t,e,n){t.pendingLanes|=e;var r=e-1;t.suspendedLanes&=r,t.pingedLanes&=r,t=t.eventTimes,e=31-Vf(e),t[e]=n}var Vf=Math.clz32?Math.clz32:yxe,gxe=Math.log,vxe=Math.LN2;function yxe(t){return t===0?32:31-(gxe(t)/vxe|0)|0}var xxe=ci.unstable_UserBlockingPriority,bxe=ci.unstable_runWithPriority,aC=!0;function _xe(t,e,n,r){lh||VF();var i=QF,o=lh;lh=!0;try{yee(i,t,e,n,r)}finally{(lh=o)||GF()}}function wxe(t,e,n,r){bxe(xxe,QF.bind(null,t,e,n,r))}function QF(t,e,n,r){if(aC){var i;if((i=(e&4)===0)&&0=Ox),rW=" ",iW=!1;function Lee(t,e){switch(t){case"keyup":return Gxe.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $ee(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var zm=!1;function qxe(t,e){switch(t){case"compositionend":return $ee(e);case"keypress":return e.which!==32?null:(iW=!0,rW);case"textInput":return t=e.data,t===rW&&iW?null:t;default:return null}}function Xxe(t,e){if(zm)return t==="compositionend"||!ej&&Lee(t,e)?(t=Iee(),sC=KF=df=null,zm=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=lW(n)}}function Bee(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Bee(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function uW(){for(var t=window,e=XC();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=XC(t.document)}return e}function qD(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var ibe=ou&&"documentMode"in document&&11>=document.documentMode,Um=null,XD=null,Tx=null,QD=!1;function fW(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;QD||Um==null||Um!==XC(r)||(r=Um,"selectionStart"in r&&qD(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}),Tx&&gb(Tx,r)||(Tx=r,r=ZC(XD,"onSelect"),0Vm||(t.current=KD[Vm],KD[Vm]=null,Vm--)}function xr(t,e){Vm++,KD[Vm]=t.current,t.current=e}var Gf={},Ji=ad(Gf),Io=ad(!1),Uh=Gf;function jg(t,e){var n=t.type.contextTypes;if(!n)return Gf;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=e[o];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Do(t){return t=t.childContextTypes,t!=null}function tT(){Jn(Io),Jn(Ji)}function bW(t,e,n){if(Ji.current!==Gf)throw Error(Xe(168));xr(Ji,e),xr(Io,n)}function Xee(t,e,n){var r=t.stateNode;if(t=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(Xe(108,sg(e)||"Unknown",i));return dr({},n,r)}function cC(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Gf,Uh=Ji.current,xr(Ji,t),xr(Io,Io.current),!0}function _W(t,e,n){var r=t.stateNode;if(!r)throw Error(Xe(169));n?(t=Xee(t,e,Uh),r.__reactInternalMemoizedMergedChildContext=t,Jn(Io),Jn(Ji),xr(Ji,t)):Jn(Io),xr(Io,n)}var nj=null,Eh=null,sbe=ci.unstable_runWithPriority,rj=ci.unstable_scheduleCallback,ZD=ci.unstable_cancelCallback,lbe=ci.unstable_shouldYield,wW=ci.unstable_requestPaint,JD=ci.unstable_now,cbe=ci.unstable_getCurrentPriorityLevel,UP=ci.unstable_ImmediatePriority,Qee=ci.unstable_UserBlockingPriority,Yee=ci.unstable_NormalPriority,Kee=ci.unstable_LowPriority,Zee=ci.unstable_IdlePriority,eA={},ube=wW!==void 0?wW:function(){},Ac=null,uC=null,tA=!1,SW=JD(),Ki=1e4>SW?JD:function(){return JD()-SW};function Bg(){switch(cbe()){case UP:return 99;case Qee:return 98;case Yee:return 97;case Kee:return 96;case Zee:return 95;default:throw Error(Xe(332))}}function Jee(t){switch(t){case 99:return UP;case 98:return Qee;case 97:return Yee;case 96:return Kee;case 95:return Zee;default:throw Error(Xe(332))}}function Wh(t,e){return t=Jee(t),sbe(t,e)}function yb(t,e,n){return t=Jee(t),rj(t,e,n)}function tc(){if(uC!==null){var t=uC;uC=null,ZD(t)}ete()}function ete(){if(!tA&&Ac!==null){tA=!0;var t=0;try{var e=Ac;Wh(99,function(){for(;tO?(C=S,S=null):C=S.sibling;var E=d(g,S,y[O],x);if(E===null){S===null&&(S=C);break}t&&S&&E.alternate===null&&e(g,S),v=o(E,v,O),_===null?b=E:_.sibling=E,_=E,S=C}if(O===y.length)return n(g,S),b;if(S===null){for(;OO?(C=S,S=null):C=S.sibling;var k=d(g,S,E.value,x);if(k===null){S===null&&(S=C);break}t&&S&&k.alternate===null&&e(g,S),v=o(k,v,O),_===null?b=k:_.sibling=k,_=k,S=C}if(E.done)return n(g,S),b;if(S===null){for(;!E.done;O++,E=y.next())E=f(g,E.value,x),E!==null&&(v=o(E,v,O),_===null?b=E:_.sibling=E,_=E);return b}for(S=r(g,S);!E.done;O++,E=y.next())E=h(S,g,O,E.value,x),E!==null&&(t&&E.alternate!==null&&S.delete(E.key===null?O:E.key),v=o(E,v,O),_===null?b=E:_.sibling=E,_=E);return t&&S.forEach(function(I){return e(g,I)}),b}return function(g,v,y,x){var b=typeof y=="object"&&y!==null&&y.type===lf&&y.key===null;b&&(y=y.props.children);var _=typeof y=="object"&&y!==null;if(_)switch(y.$$typeof){case Z0:e:{for(_=y.key,b=v;b!==null;){if(b.key===_){switch(b.tag){case 7:if(y.type===lf){n(g,b.sibling),v=i(b,y.props.children),v.return=g,g=v;break e}break;default:if(b.elementType===y.type){n(g,b.sibling),v=i(b,y.props),v.ref=t0(g,b,y),v.return=g,g=v;break e}}n(g,b);break}else e(g,b);b=b.sibling}y.type===lf?(v=gg(y.props.children,g.mode,x,y.key),v.return=g,g=v):(x=pC(y.type,y.key,y.props,null,g.mode,x),x.ref=t0(g,v,y),x.return=g,g=x)}return a(g);case sh:e:{for(b=y.key;v!==null;){if(v.key===b)if(v.tag===4&&v.stateNode.containerInfo===y.containerInfo&&v.stateNode.implementation===y.implementation){n(g,v.sibling),v=i(v,y.children||[]),v.return=g,g=v;break e}else{n(g,v);break}else e(g,v);v=v.sibling}v=sA(y,g.mode,x),v.return=g,g=v}return a(g)}if(typeof y=="string"||typeof y=="number")return y=""+y,v!==null&&v.tag===6?(n(g,v.sibling),v=i(v,y),v.return=g,g=v):(n(g,v),v=aA(y,g.mode,x),v.return=g,g=v),a(g);if(Bw(y))return p(g,v,y,x);if(Qy(y))return m(g,v,y,x);if(_&&zw(g,y),typeof y>"u"&&!b)switch(g.tag){case 1:case 22:case 0:case 11:case 15:throw Error(Xe(152,sg(g.type)||"Component"))}return n(g,v)}}var aT=ote(!0),ate=ote(!1),i1={},Fl=ad(i1),bb=ad(i1),_b=ad(i1);function uh(t){if(t===i1)throw Error(Xe(174));return t}function tL(t,e){switch(xr(_b,e),xr(bb,t),xr(Fl,i1),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:jD(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=jD(e,t)}Jn(Fl),xr(Fl,e)}function zg(){Jn(Fl),Jn(bb),Jn(_b)}function PW(t){uh(_b.current);var e=uh(Fl.current),n=jD(e,t.type);e!==n&&(xr(bb,t),xr(Fl,n))}function sj(t){bb.current===t&&(Jn(Fl),Jn(bb))}var yr=ad(0);function sT(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&64)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var zc=null,pf=null,jl=!1;function ste(t,e){var n=Wa(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=e,n.return=t,n.flags=8,t.lastEffect!==null?(t.lastEffect.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n}function MW(t,e){switch(t.tag){case 5:var n=t.type;return e=e.nodeType!==1||n.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,!0):!1;case 13:return!1;default:return!1}}function nL(t){if(jl){var e=pf;if(e){var n=e;if(!MW(t,e)){if(e=fg(n.nextSibling),!e||!MW(t,e)){t.flags=t.flags&-1025|2,jl=!1,zc=t;return}ste(zc,n)}zc=t,pf=fg(e.firstChild)}else t.flags=t.flags&-1025|2,jl=!1,zc=t}}function kW(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;zc=t}function Uw(t){if(t!==zc)return!1;if(!jl)return kW(t),jl=!0,!1;var e=t.type;if(t.tag!==5||e!=="head"&&e!=="body"&&!YD(e,t.memoizedProps))for(e=pf;e;)ste(t,e),e=fg(e.nextSibling);if(kW(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(Xe(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){pf=fg(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}pf=null}}else pf=zc?fg(t.stateNode.nextSibling):null;return!0}function nA(){pf=zc=null,jl=!1}var hg=[];function lj(){for(var t=0;to))throw Error(Xe(301));o+=1,wi=Gi=null,e.updateQueue=null,Ex.current=mbe,t=n(r,i)}while(Px)}if(Ex.current=dT,e=Gi!==null&&Gi.next!==null,wb=0,wi=Gi=Pr=null,lT=!1,e)throw Error(Xe(300));return t}function fh(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wi===null?Pr.memoizedState=wi=t:wi=wi.next=t,wi}function vp(){if(Gi===null){var t=Pr.alternate;t=t!==null?t.memoizedState:null}else t=Gi.next;var e=wi===null?Pr.memoizedState:wi.next;if(e!==null)wi=e,Gi=t;else{if(t===null)throw Error(Xe(310));Gi=t,t={memoizedState:Gi.memoizedState,baseState:Gi.baseState,baseQueue:Gi.baseQueue,queue:Gi.queue,next:null},wi===null?Pr.memoizedState=wi=t:wi=wi.next=t}return wi}function El(t,e){return typeof e=="function"?e(t):e}function n0(t){var e=vp(),n=e.queue;if(n===null)throw Error(Xe(311));n.lastRenderedReducer=t;var r=Gi,i=r.baseQueue,o=n.pending;if(o!==null){if(i!==null){var a=i.next;i.next=o.next,o.next=a}r.baseQueue=i=o,n.pending=null}if(i!==null){i=i.next,r=r.baseState;var s=a=o=null,l=i;do{var c=l.lane;if((wb&c)===c)s!==null&&(s=s.next={lane:0,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null}),r=l.eagerReducer===t?l.eagerState:t(r,l.action);else{var u={lane:c,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null};s===null?(a=s=u,o=r):s=s.next=u,Pr.lanes|=c,o1|=c}l=l.next}while(l!==null&&l!==i);s===null?o=r:s.next=a,Ua(r,e.memoizedState)||(Us=!0),e.memoizedState=r,e.baseState=o,e.baseQueue=s,n.lastRenderedState=r}return[e.memoizedState,n.dispatch]}function r0(t){var e=vp(),n=e.queue;if(n===null)throw Error(Xe(311));n.lastRenderedReducer=t;var r=n.dispatch,i=n.pending,o=e.memoizedState;if(i!==null){n.pending=null;var a=i=i.next;do o=t(o,a.action),a=a.next;while(a!==i);Ua(o,e.memoizedState)||(Us=!0),e.memoizedState=o,e.baseQueue===null&&(e.baseState=o),n.lastRenderedState=o}return[o,r]}function AW(t,e,n){var r=e._getVersion;r=r(e._source);var i=e._workInProgressVersionPrimary;if(i!==null?t=i===r:(t=t.mutableReadLanes,(t=(wb&t)===t)&&(e._workInProgressVersionPrimary=r,hg.push(e))),t)return n(e._source);throw hg.push(e),Error(Xe(350))}function lte(t,e,n,r){var i=co;if(i===null)throw Error(Xe(349));var o=e._getVersion,a=o(e._source),s=Ex.current,l=s.useState(function(){return AW(i,e,n)}),c=l[1],u=l[0];l=wi;var f=t.memoizedState,d=f.refs,h=d.getSnapshot,p=f.source;f=f.subscribe;var m=Pr;return t.memoizedState={refs:d,source:e,subscribe:r},s.useEffect(function(){d.getSnapshot=n,d.setSnapshot=c;var g=o(e._source);if(!Ua(a,g)){g=n(e._source),Ua(u,g)||(c(g),g=Af(m),i.mutableReadLanes|=g&i.pendingLanes),g=i.mutableReadLanes,i.entangledLanes|=g;for(var v=i.entanglements,y=g;0n?98:n,function(){t(!0)}),Wh(97<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=a.createElement(n,{is:r.is}):(t=a.createElement(n),n==="select"&&(a=t,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):t=a.createElementNS(t,n),t[hf]=e,t[eT]=r,vte(t,e,!1,!1),e.stateNode=t,a=zD(n,r),n){case"dialog":Hn("cancel",t),Hn("close",t),i=r;break;case"iframe":case"object":case"embed":Hn("load",t),i=r;break;case"video":case"audio":for(i=0;idL&&(e.flags|=64,o=!0,o0(r,!1),e.lanes=33554432)}else{if(!o)if(t=sT(a),t!==null){if(e.flags|=64,o=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),o0(r,!0),r.tail===null&&r.tailMode==="hidden"&&!a.alternate&&!jl)return e=e.lastEffect=r.lastEffect,e!==null&&(e.nextEffect=null),null}else 2*Ki()-r.renderingStartTime>dL&&n!==1073741824&&(e.flags|=64,o=!0,o0(r,!1),e.lanes=33554432);r.isBackwards?(a.sibling=e.child,e.child=a):(n=r.last,n!==null?n.sibling=a:e.child=a,r.last=a)}return r.tail!==null?(n=r.tail,r.rendering=n,r.tail=n.sibling,r.lastEffect=e.lastEffect,r.renderingStartTime=Ki(),n.sibling=null,e=yr.current,xr(yr,o?e&1|2:e&1),n):null;case 23:case 24:return yj(),t!==null&&t.memoizedState!==null!=(e.memoizedState!==null)&&r.mode!=="unstable-defer-without-hiding"&&(e.flags|=4),null}throw Error(Xe(156,e.tag))}function ybe(t){switch(t.tag){case 1:Do(t.type)&&tT();var e=t.flags;return e&4096?(t.flags=e&-4097|64,t):null;case 3:if(zg(),Jn(Io),Jn(Ji),lj(),e=t.flags,e&64)throw Error(Xe(285));return t.flags=e&-4097|64,t;case 5:return sj(t),null;case 13:return Jn(yr),e=t.flags,e&4096?(t.flags=e&-4097|64,t):null;case 19:return Jn(yr),null;case 4:return zg(),null;case 10:return oj(t),null;case 23:case 24:return yj(),null;default:return null}}function pj(t,e){try{var n="",r=e;do n+=Z0e(r),r=r.return;while(r);var i=n}catch(o){i=` +`+i[a].replace(" at new "," at ");while(1<=a&&0<=s);break}}}finally{zk=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?J0(t):""}function J0e(t){switch(t.tag){case 5:return J0(t.type);case 16:return J0("Lazy");case 13:return J0("Suspense");case 19:return J0("SuspenseList");case 0:case 2:case 15:return t=Lw(t.type,!1),t;case 11:return t=Lw(t.type.render,!1),t;case 22:return t=Lw(t.type._render,!1),t;case 1:return t=Lw(t.type,!0),t;default:return""}}function sg(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case lf:return"Fragment";case sh:return"Portal";case bx:return"Profiler";case $F:return"StrictMode";case _x:return"Suspense";case qC:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case FF:return(t.displayName||"Context")+".Consumer";case NF:return(t._context.displayName||"Context")+".Provider";case DP:var e=t.render;return e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case LP:return sg(t.type);case BF:return sg(t._render);case jF:e=t._payload,t=t._init;try{return sg(t(e))}catch{}}return null}function Wf(t){switch(typeof t){case"boolean":case"number":case"object":case"string":case"undefined":return t;default:return""}}function uee(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function exe(t){var e=uee(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,o.call(this,a)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function $w(t){t._valueTracker||(t._valueTracker=exe(t))}function fee(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=uee(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function XC(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function DD(t,e){var n=e.checked;return dr({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function V6(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Wf(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function dee(t,e){e=e.checked,e!=null&&LF(t,"checked",e,!1)}function LD(t,e){dee(t,e);var n=Wf(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?$D(t,e.type,n):e.hasOwnProperty("defaultValue")&&$D(t,e.type,Wf(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function G6(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function $D(t,e,n){(e!=="number"||XC(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}function txe(t){var e="";return IP.Children.forEach(t,function(n){n!=null&&(e+=n)}),e}function ND(t,e){return t=dr({children:void 0},e),(e=txe(e.children))&&(t.children=e),t}function lg(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i=n.length))throw Error(Xe(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:Wf(n)}}function hee(t,e){var n=Wf(e.value),r=Wf(e.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),e.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),r!=null&&(t.defaultValue=""+r)}function q6(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}var jD={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function pee(t){switch(t){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 BD(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?pee(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var Nw,mee=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,n,r,i){MSApp.execUnsafeLocalFunction(function(){return t(e,n,r,i)})}:t}(function(t,e){if(t.namespaceURI!==jD.svg||"innerHTML"in t)t.innerHTML=e;else{for(Nw=Nw||document.createElement("div"),Nw.innerHTML=""+e.valueOf().toString()+"",e=Nw.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function ub(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var wx={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,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},nxe=["Webkit","ms","Moz","O"];Object.keys(wx).forEach(function(t){nxe.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),wx[e]=wx[t]})});function gee(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||wx.hasOwnProperty(t)&&wx[t]?(""+e).trim():e+"px"}function vee(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=gee(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var rxe=dr({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 zD(t,e){if(e){if(rxe[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Xe(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Xe(60));if(!(typeof e.dangerouslySetInnerHTML=="object"&&"__html"in e.dangerouslySetInnerHTML))throw Error(Xe(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Xe(62))}}function UD(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){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}}function WF(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var WD=null,cg=null,ug=null;function X6(t){if(t=r1(t)){if(typeof WD!="function")throw Error(Xe(280));var e=t.stateNode;e&&(e=zP(e),WD(t.stateNode,t.type,e))}}function yee(t){cg?ug?ug.push(t):ug=[t]:cg=t}function xee(){if(cg){var t=cg,e=ug;if(ug=cg=null,X6(t),e)for(t=0;tr?0:1<n;n++)e.push(t);return e}function NP(t,e,n){t.pendingLanes|=e;var r=e-1;t.suspendedLanes&=r,t.pingedLanes&=r,t=t.eventTimes,e=31-Vf(e),t[e]=n}var Vf=Math.clz32?Math.clz32:xxe,vxe=Math.log,yxe=Math.LN2;function xxe(t){return t===0?32:31-(vxe(t)/yxe|0)|0}var bxe=ci.unstable_UserBlockingPriority,_xe=ci.unstable_runWithPriority,aC=!0;function wxe(t,e,n,r){lh||GF();var i=YF,o=lh;lh=!0;try{bee(i,t,e,n,r)}finally{(lh=o)||HF()}}function Sxe(t,e,n,r){_xe(bxe,YF.bind(null,t,e,n,r))}function YF(t,e,n,r){if(aC){var i;if((i=(e&4)===0)&&0=Ox),iW=" ",oW=!1;function Nee(t,e){switch(t){case"keyup":return Hxe.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Fee(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var zm=!1;function Xxe(t,e){switch(t){case"compositionend":return Fee(e);case"keypress":return e.which!==32?null:(oW=!0,iW);case"textInput":return t=e.data,t===iW&&oW?null:t;default:return null}}function Qxe(t,e){if(zm)return t==="compositionend"||!tj&&Nee(t,e)?(t=Lee(),sC=ZF=df=null,zm=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=cW(n)}}function Uee(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Uee(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function fW(){for(var t=window,e=XC();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=XC(t.document)}return e}function XD(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var obe=ou&&"documentMode"in document&&11>=document.documentMode,Um=null,QD=null,Tx=null,YD=!1;function dW(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;YD||Um==null||Um!==XC(r)||(r=Um,"selectionStart"in r&&XD(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}),Tx&&gb(Tx,r)||(Tx=r,r=ZC(QD,"onSelect"),0Vm||(t.current=ZD[Vm],ZD[Vm]=null,Vm--)}function xr(t,e){Vm++,ZD[Vm]=t.current,t.current=e}var Gf={},Ji=ad(Gf),Io=ad(!1),Uh=Gf;function jg(t,e){var n=t.type.contextTypes;if(!n)return Gf;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=e[o];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Do(t){return t=t.childContextTypes,t!=null}function tT(){Jn(Io),Jn(Ji)}function _W(t,e,n){if(Ji.current!==Gf)throw Error(Xe(168));xr(Ji,e),xr(Io,n)}function Yee(t,e,n){var r=t.stateNode;if(t=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(Xe(108,sg(e)||"Unknown",i));return dr({},n,r)}function cC(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Gf,Uh=Ji.current,xr(Ji,t),xr(Io,Io.current),!0}function wW(t,e,n){var r=t.stateNode;if(!r)throw Error(Xe(169));n?(t=Yee(t,e,Uh),r.__reactInternalMemoizedMergedChildContext=t,Jn(Io),Jn(Ji),xr(Ji,t)):Jn(Io),xr(Io,n)}var rj=null,Eh=null,lbe=ci.unstable_runWithPriority,ij=ci.unstable_scheduleCallback,JD=ci.unstable_cancelCallback,cbe=ci.unstable_shouldYield,SW=ci.unstable_requestPaint,eL=ci.unstable_now,ube=ci.unstable_getCurrentPriorityLevel,UP=ci.unstable_ImmediatePriority,Kee=ci.unstable_UserBlockingPriority,Zee=ci.unstable_NormalPriority,Jee=ci.unstable_LowPriority,ete=ci.unstable_IdlePriority,eA={},fbe=SW!==void 0?SW:function(){},Ac=null,uC=null,tA=!1,OW=eL(),Ki=1e4>OW?eL:function(){return eL()-OW};function Bg(){switch(ube()){case UP:return 99;case Kee:return 98;case Zee:return 97;case Jee:return 96;case ete:return 95;default:throw Error(Xe(332))}}function tte(t){switch(t){case 99:return UP;case 98:return Kee;case 97:return Zee;case 96:return Jee;case 95:return ete;default:throw Error(Xe(332))}}function Wh(t,e){return t=tte(t),lbe(t,e)}function yb(t,e,n){return t=tte(t),ij(t,e,n)}function tc(){if(uC!==null){var t=uC;uC=null,JD(t)}nte()}function nte(){if(!tA&&Ac!==null){tA=!0;var t=0;try{var e=Ac;Wh(99,function(){for(;tO?(C=S,S=null):C=S.sibling;var E=d(g,S,y[O],x);if(E===null){S===null&&(S=C);break}t&&S&&E.alternate===null&&e(g,S),v=o(E,v,O),_===null?b=E:_.sibling=E,_=E,S=C}if(O===y.length)return n(g,S),b;if(S===null){for(;OO?(C=S,S=null):C=S.sibling;var k=d(g,S,E.value,x);if(k===null){S===null&&(S=C);break}t&&S&&k.alternate===null&&e(g,S),v=o(k,v,O),_===null?b=k:_.sibling=k,_=k,S=C}if(E.done)return n(g,S),b;if(S===null){for(;!E.done;O++,E=y.next())E=f(g,E.value,x),E!==null&&(v=o(E,v,O),_===null?b=E:_.sibling=E,_=E);return b}for(S=r(g,S);!E.done;O++,E=y.next())E=h(S,g,O,E.value,x),E!==null&&(t&&E.alternate!==null&&S.delete(E.key===null?O:E.key),v=o(E,v,O),_===null?b=E:_.sibling=E,_=E);return t&&S.forEach(function(I){return e(g,I)}),b}return function(g,v,y,x){var b=typeof y=="object"&&y!==null&&y.type===lf&&y.key===null;b&&(y=y.props.children);var _=typeof y=="object"&&y!==null;if(_)switch(y.$$typeof){case Z0:e:{for(_=y.key,b=v;b!==null;){if(b.key===_){switch(b.tag){case 7:if(y.type===lf){n(g,b.sibling),v=i(b,y.props.children),v.return=g,g=v;break e}break;default:if(b.elementType===y.type){n(g,b.sibling),v=i(b,y.props),v.ref=t0(g,b,y),v.return=g,g=v;break e}}n(g,b);break}else e(g,b);b=b.sibling}y.type===lf?(v=gg(y.props.children,g.mode,x,y.key),v.return=g,g=v):(x=pC(y.type,y.key,y.props,null,g.mode,x),x.ref=t0(g,v,y),x.return=g,g=x)}return a(g);case sh:e:{for(b=y.key;v!==null;){if(v.key===b)if(v.tag===4&&v.stateNode.containerInfo===y.containerInfo&&v.stateNode.implementation===y.implementation){n(g,v.sibling),v=i(v,y.children||[]),v.return=g,g=v;break e}else{n(g,v);break}else e(g,v);v=v.sibling}v=sA(y,g.mode,x),v.return=g,g=v}return a(g)}if(typeof y=="string"||typeof y=="number")return y=""+y,v!==null&&v.tag===6?(n(g,v.sibling),v=i(v,y),v.return=g,g=v):(n(g,v),v=aA(y,g.mode,x),v.return=g,g=v),a(g);if(Bw(y))return p(g,v,y,x);if(Qy(y))return m(g,v,y,x);if(_&&zw(g,y),typeof y>"u"&&!b)switch(g.tag){case 1:case 22:case 0:case 11:case 15:throw Error(Xe(152,sg(g.type)||"Component"))}return n(g,v)}}var aT=ste(!0),lte=ste(!1),i1={},Fl=ad(i1),bb=ad(i1),_b=ad(i1);function uh(t){if(t===i1)throw Error(Xe(174));return t}function nL(t,e){switch(xr(_b,e),xr(bb,t),xr(Fl,i1),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:BD(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=BD(e,t)}Jn(Fl),xr(Fl,e)}function zg(){Jn(Fl),Jn(bb),Jn(_b)}function MW(t){uh(_b.current);var e=uh(Fl.current),n=BD(e,t.type);e!==n&&(xr(bb,t),xr(Fl,n))}function lj(t){bb.current===t&&(Jn(Fl),Jn(bb))}var yr=ad(0);function sT(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&64)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var zc=null,pf=null,jl=!1;function cte(t,e){var n=Wa(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=e,n.return=t,n.flags=8,t.lastEffect!==null?(t.lastEffect.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n}function kW(t,e){switch(t.tag){case 5:var n=t.type;return e=e.nodeType!==1||n.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,!0):!1;case 13:return!1;default:return!1}}function rL(t){if(jl){var e=pf;if(e){var n=e;if(!kW(t,e)){if(e=fg(n.nextSibling),!e||!kW(t,e)){t.flags=t.flags&-1025|2,jl=!1,zc=t;return}cte(zc,n)}zc=t,pf=fg(e.firstChild)}else t.flags=t.flags&-1025|2,jl=!1,zc=t}}function AW(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;zc=t}function Uw(t){if(t!==zc)return!1;if(!jl)return AW(t),jl=!0,!1;var e=t.type;if(t.tag!==5||e!=="head"&&e!=="body"&&!KD(e,t.memoizedProps))for(e=pf;e;)cte(t,e),e=fg(e.nextSibling);if(AW(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(Xe(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){pf=fg(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}pf=null}}else pf=zc?fg(t.stateNode.nextSibling):null;return!0}function nA(){pf=zc=null,jl=!1}var hg=[];function cj(){for(var t=0;to))throw Error(Xe(301));o+=1,wi=Gi=null,e.updateQueue=null,Ex.current=gbe,t=n(r,i)}while(Px)}if(Ex.current=dT,e=Gi!==null&&Gi.next!==null,wb=0,wi=Gi=Pr=null,lT=!1,e)throw Error(Xe(300));return t}function fh(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wi===null?Pr.memoizedState=wi=t:wi=wi.next=t,wi}function vp(){if(Gi===null){var t=Pr.alternate;t=t!==null?t.memoizedState:null}else t=Gi.next;var e=wi===null?Pr.memoizedState:wi.next;if(e!==null)wi=e,Gi=t;else{if(t===null)throw Error(Xe(310));Gi=t,t={memoizedState:Gi.memoizedState,baseState:Gi.baseState,baseQueue:Gi.baseQueue,queue:Gi.queue,next:null},wi===null?Pr.memoizedState=wi=t:wi=wi.next=t}return wi}function El(t,e){return typeof e=="function"?e(t):e}function n0(t){var e=vp(),n=e.queue;if(n===null)throw Error(Xe(311));n.lastRenderedReducer=t;var r=Gi,i=r.baseQueue,o=n.pending;if(o!==null){if(i!==null){var a=i.next;i.next=o.next,o.next=a}r.baseQueue=i=o,n.pending=null}if(i!==null){i=i.next,r=r.baseState;var s=a=o=null,l=i;do{var c=l.lane;if((wb&c)===c)s!==null&&(s=s.next={lane:0,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null}),r=l.eagerReducer===t?l.eagerState:t(r,l.action);else{var u={lane:c,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null};s===null?(a=s=u,o=r):s=s.next=u,Pr.lanes|=c,o1|=c}l=l.next}while(l!==null&&l!==i);s===null?o=r:s.next=a,Ua(r,e.memoizedState)||(Us=!0),e.memoizedState=r,e.baseState=o,e.baseQueue=s,n.lastRenderedState=r}return[e.memoizedState,n.dispatch]}function r0(t){var e=vp(),n=e.queue;if(n===null)throw Error(Xe(311));n.lastRenderedReducer=t;var r=n.dispatch,i=n.pending,o=e.memoizedState;if(i!==null){n.pending=null;var a=i=i.next;do o=t(o,a.action),a=a.next;while(a!==i);Ua(o,e.memoizedState)||(Us=!0),e.memoizedState=o,e.baseQueue===null&&(e.baseState=o),n.lastRenderedState=o}return[o,r]}function RW(t,e,n){var r=e._getVersion;r=r(e._source);var i=e._workInProgressVersionPrimary;if(i!==null?t=i===r:(t=t.mutableReadLanes,(t=(wb&t)===t)&&(e._workInProgressVersionPrimary=r,hg.push(e))),t)return n(e._source);throw hg.push(e),Error(Xe(350))}function ute(t,e,n,r){var i=co;if(i===null)throw Error(Xe(349));var o=e._getVersion,a=o(e._source),s=Ex.current,l=s.useState(function(){return RW(i,e,n)}),c=l[1],u=l[0];l=wi;var f=t.memoizedState,d=f.refs,h=d.getSnapshot,p=f.source;f=f.subscribe;var m=Pr;return t.memoizedState={refs:d,source:e,subscribe:r},s.useEffect(function(){d.getSnapshot=n,d.setSnapshot=c;var g=o(e._source);if(!Ua(a,g)){g=n(e._source),Ua(u,g)||(c(g),g=Af(m),i.mutableReadLanes|=g&i.pendingLanes),g=i.mutableReadLanes,i.entangledLanes|=g;for(var v=i.entanglements,y=g;0n?98:n,function(){t(!0)}),Wh(97<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=a.createElement(n,{is:r.is}):(t=a.createElement(n),n==="select"&&(a=t,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):t=a.createElementNS(t,n),t[hf]=e,t[eT]=r,xte(t,e,!1,!1),e.stateNode=t,a=UD(n,r),n){case"dialog":Hn("cancel",t),Hn("close",t),i=r;break;case"iframe":case"object":case"embed":Hn("load",t),i=r;break;case"video":case"audio":for(i=0;ihL&&(e.flags|=64,o=!0,o0(r,!1),e.lanes=33554432)}else{if(!o)if(t=sT(a),t!==null){if(e.flags|=64,o=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),o0(r,!0),r.tail===null&&r.tailMode==="hidden"&&!a.alternate&&!jl)return e=e.lastEffect=r.lastEffect,e!==null&&(e.nextEffect=null),null}else 2*Ki()-r.renderingStartTime>hL&&n!==1073741824&&(e.flags|=64,o=!0,o0(r,!1),e.lanes=33554432);r.isBackwards?(a.sibling=e.child,e.child=a):(n=r.last,n!==null?n.sibling=a:e.child=a,r.last=a)}return r.tail!==null?(n=r.tail,r.rendering=n,r.tail=n.sibling,r.lastEffect=e.lastEffect,r.renderingStartTime=Ki(),n.sibling=null,e=yr.current,xr(yr,o?e&1|2:e&1),n):null;case 23:case 24:return xj(),t!==null&&t.memoizedState!==null!=(e.memoizedState!==null)&&r.mode!=="unstable-defer-without-hiding"&&(e.flags|=4),null}throw Error(Xe(156,e.tag))}function xbe(t){switch(t.tag){case 1:Do(t.type)&&tT();var e=t.flags;return e&4096?(t.flags=e&-4097|64,t):null;case 3:if(zg(),Jn(Io),Jn(Ji),cj(),e=t.flags,e&64)throw Error(Xe(285));return t.flags=e&-4097|64,t;case 5:return lj(t),null;case 13:return Jn(yr),e=t.flags,e&4096?(t.flags=e&-4097|64,t):null;case 19:return Jn(yr),null;case 4:return zg(),null;case 10:return aj(t),null;case 23:case 24:return xj(),null;default:return null}}function mj(t,e){try{var n="",r=e;do n+=J0e(r),r=r.return;while(r);var i=n}catch(o){i=` Error generating stack: `+o.message+` -`+o.stack}return{value:t,source:e,stack:i}}function sL(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var xbe=typeof WeakMap=="function"?WeakMap:Map;function bte(t,e,n){n=Mf(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){pT||(pT=!0,hL=r),sL(t,e)},n}function _te(t,e,n){n=Mf(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var i=e.value;n.payload=function(){return sL(t,e),r(i)}}var o=t.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){typeof r!="function"&&(Pl===null?Pl=new Set([this]):Pl.add(this),sL(t,e));var a=e.stack;this.componentDidCatch(e.value,{componentStack:a!==null?a:""})}),n}var bbe=typeof WeakSet=="function"?WeakSet:Set;function VW(t){var e=t.ref;if(e!==null)if(typeof e=="function")try{e(null)}catch(n){If(t,n)}else e.current=null}function _be(t,e){switch(e.tag){case 0:case 11:case 15:case 22:return;case 1:if(e.flags&256&&t!==null){var n=t.memoizedProps,r=t.memoizedState;t=e.stateNode,e=t.getSnapshotBeforeUpdate(e.elementType===e.type?n:Ls(e.type,n),r),t.__reactInternalSnapshotBeforeUpdate=e}return;case 3:e.flags&256&&tj(e.stateNode.containerInfo);return;case 5:case 6:case 4:case 17:return}throw Error(Xe(163))}function wbe(t,e,n){switch(n.tag){case 0:case 11:case 15:case 22:if(e=n.updateQueue,e=e!==null?e.lastEffect:null,e!==null){t=e=e.next;do{if((t.tag&3)===3){var r=t.create;t.destroy=r()}t=t.next}while(t!==e)}if(e=n.updateQueue,e=e!==null?e.lastEffect:null,e!==null){t=e=e.next;do{var i=t;r=i.next,i=i.tag,i&4&&i&1&&(kte(n,t),kbe(n,t)),t=r}while(t!==e)}return;case 1:t=n.stateNode,n.flags&4&&(e===null?t.componentDidMount():(r=n.elementType===n.type?e.memoizedProps:Ls(n.type,e.memoizedProps),t.componentDidUpdate(r,e.memoizedState,t.__reactInternalSnapshotBeforeUpdate))),e=n.updateQueue,e!==null&&CW(n,e,t);return;case 3:if(e=n.updateQueue,e!==null){if(t=null,n.child!==null)switch(n.child.tag){case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}CW(n,e,t)}return;case 5:t=n.stateNode,e===null&&n.flags&4&&Hee(n.type,n.memoizedProps)&&t.focus();return;case 6:return;case 4:return;case 12:return;case 13:n.memoizedState===null&&(n=n.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&Cee(n))));return;case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(Xe(163))}function GW(t,e){for(var n=t;;){if(n.tag===5){var r=n.stateNode;if(e)r=r.style,typeof r.setProperty=="function"?r.setProperty("display","none","important"):r.display="none";else{r=n.stateNode;var i=n.memoizedProps.style;i=i!=null&&i.hasOwnProperty("display")?i.display:null,r.style.display=pee("display",i)}}else if(n.tag===6)n.stateNode.nodeValue=e?"":n.memoizedProps;else if((n.tag!==23&&n.tag!==24||n.memoizedState===null||n===t)&&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}}function HW(t,e){if(Eh&&typeof Eh.onCommitFiberUnmount=="function")try{Eh.onCommitFiberUnmount(nj,e)}catch{}switch(e.tag){case 0:case 11:case 14:case 15:case 22:if(t=e.updateQueue,t!==null&&(t=t.lastEffect,t!==null)){var n=t=t.next;do{var r=n,i=r.destroy;if(r=r.tag,i!==void 0)if(r&4)kte(e,n);else{r=e;try{i()}catch(o){If(r,o)}}n=n.next}while(n!==t)}break;case 1:if(VW(e),t=e.stateNode,typeof t.componentWillUnmount=="function")try{t.props=e.memoizedProps,t.state=e.memoizedState,t.componentWillUnmount()}catch(o){If(e,o)}break;case 5:VW(e);break;case 4:wte(t,e)}}function qW(t){t.alternate=null,t.child=null,t.dependencies=null,t.firstEffect=null,t.lastEffect=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.return=null,t.updateQueue=null}function XW(t){return t.tag===5||t.tag===3||t.tag===4}function QW(t){e:{for(var e=t.return;e!==null;){if(XW(e))break e;e=e.return}throw Error(Xe(160))}var n=e;switch(e=n.stateNode,n.tag){case 5:var r=!1;break;case 3:e=e.containerInfo,r=!0;break;case 4:e=e.containerInfo,r=!0;break;default:throw Error(Xe(161))}n.flags&16&&(ub(e,""),n.flags&=-17);e:t:for(n=t;;){for(;n.sibling===null;){if(n.return===null||XW(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue t;n.child.return=n,n=n.child}if(!(n.flags&2)){n=n.stateNode;break e}}r?lL(t,n,e):cL(t,n,e)}function lL(t,e,n){var r=t.tag,i=r===5||r===6;if(i)t=i?t.stateNode:t.stateNode.instance,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=JC));else if(r!==4&&(t=t.child,t!==null))for(lL(t,e,n),t=t.sibling;t!==null;)lL(t,e,n),t=t.sibling}function cL(t,e,n){var r=t.tag,i=r===5||r===6;if(i)t=i?t.stateNode:t.stateNode.instance,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(cL(t,e,n),t=t.sibling;t!==null;)cL(t,e,n),t=t.sibling}function wte(t,e){for(var n=e,r=!1,i,o;;){if(!r){r=n.return;e:for(;;){if(r===null)throw Error(Xe(160));switch(i=r.stateNode,r.tag){case 5:o=!1;break e;case 3:i=i.containerInfo,o=!0;break e;case 4:i=i.containerInfo,o=!0;break e}r=r.return}r=!0}if(n.tag===5||n.tag===6){e:for(var a=t,s=n,l=s;;)if(HW(a,l),l.child!==null&&l.tag!==4)l.child.return=l,l=l.child;else{if(l===s)break e;for(;l.sibling===null;){if(l.return===null||l.return===s)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}o?(a=i,s=n.stateNode,a.nodeType===8?a.parentNode.removeChild(s):a.removeChild(s)):i.removeChild(n.stateNode)}else if(n.tag===4){if(n.child!==null){i=n.stateNode.containerInfo,o=!0,n.child.return=n,n=n.child;continue}}else if(HW(t,n),n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return,n.tag===4&&(r=!1)}n.sibling.return=n.return,n=n.sibling}}function oA(t,e){switch(e.tag){case 0:case 11:case 14:case 15:case 22:var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var r=n=n.next;do(r.tag&3)===3&&(t=r.destroy,r.destroy=void 0,t!==void 0&&t()),r=r.next;while(r!==n)}return;case 1:return;case 5:if(n=e.stateNode,n!=null){r=e.memoizedProps;var i=t!==null?t.memoizedProps:r;t=e.type;var o=e.updateQueue;if(e.updateQueue=null,o!==null){for(n[eT]=r,t==="input"&&r.type==="radio"&&r.name!=null&&uee(n,r),zD(t,i),e=zD(t,r),i=0;ii&&(i=a),n&=~o}if(n=i,n=Ki()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Obe(n/1960))-n,10i&&(i=a),n&=~o}if(n=i,n=Ki()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Cbe(n/1960))-n,10 component higher in the tree to provide a loading indicator or placeholder to display.`)}Oi!==5&&(Oi=2),l=pj(l,s),d=a;do{switch(d.tag){case 3:o=l,d.flags|=4096,e&=-e,d.lanes|=e;var _=bte(d,o,e);OW(d,_);break e;case 1:o=l;var S=d.type,O=d.stateNode;if(!(d.flags&64)&&(typeof S.getDerivedStateFromError=="function"||O!==null&&typeof O.componentDidCatch=="function"&&(Pl===null||!Pl.has(O)))){d.flags|=4096,e&=-e,d.lanes|=e;var C=_te(d,o,e);OW(d,C);break e}}d=d.return}while(d!==null)}Mte(n)}catch(E){e=E,Jr===n&&n!==null&&(Jr=n=n.return);continue}break}while(!0)}function Ete(){var t=hT.current;return hT.current=dT,t===null?dT:t}function nx(t,e){var n=Et;Et|=16;var r=Ete();co===t&&Zi===e||mg(t,e);do try{Tbe();break}catch(i){Tte(t,i)}while(!0);if(ij(),Et=n,hT.current=r,Jr!==null)throw Error(Xe(261));return co=null,Zi=0,Oi}function Tbe(){for(;Jr!==null;)Pte(Jr)}function Ebe(){for(;Jr!==null&&!lbe();)Pte(Jr)}function Pte(t){var e=Ate(t.alternate,t,Vh);t.memoizedProps=t.pendingProps,e===null?Mte(t):Jr=e,mj.current=null}function Mte(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&2048){if(n=ybe(e),n!==null){n.flags&=2047,Jr=n;return}t!==null&&(t.firstEffect=t.lastEffect=null,t.flags|=2048)}else{if(n=vbe(n,e,Vh),n!==null){Jr=n;return}if(n=e,n.tag!==24&&n.tag!==23||n.memoizedState===null||Vh&1073741824||!(n.mode&4)){for(var r=0,i=n.child;i!==null;)r|=i.lanes|i.childLanes,i=i.sibling;n.childLanes=r}t!==null&&!(t.flags&2048)&&(t.firstEffect===null&&(t.firstEffect=e.firstEffect),e.lastEffect!==null&&(t.lastEffect!==null&&(t.lastEffect.nextEffect=e.firstEffect),t.lastEffect=e.lastEffect),1a&&(s=a,a=_,_=s),s=cW(y,_),o=cW(y,a),s&&o&&(b.rangeCount!==1||b.anchorNode!==s.node||b.anchorOffset!==s.offset||b.focusNode!==o.node||b.focusOffset!==o.offset)&&(x=x.createRange(),x.setStart(s.node,s.offset),b.removeAllRanges(),_>a?(b.addRange(x),b.extend(o.node,o.offset)):(x.setEnd(o.node,o.offset),b.addRange(x)))))),x=[],b=y;b=b.parentNode;)b.nodeType===1&&x.push({element:b,left:b.scrollLeft,top:b.scrollTop});for(typeof y.focus=="function"&&y.focus(),y=0;yKi()-vj?mg(t,0):gj|=n),ss(t,e)}function Ibe(t,e){var n=t.stateNode;n!==null&&n.delete(e),e=0,e===0&&(e=t.mode,e&2?e&4?($c===0&&($c=Bv),e=Pm(62914560&~$c),e===0&&(e=4194304)):e=Bg()===99?1:2:e=1),n=ya(),t=GP(t,e),t!==null&&(NP(t,e,n),ss(t,n))}var Ate;Ate=function(t,e,n){var r=e.lanes;if(t!==null)if(t.memoizedProps!==e.pendingProps||Io.current)Us=!0;else if(n&r)Us=!!(t.flags&16384);else{switch(Us=!1,e.tag){case 3:NW(e),nA();break;case 5:PW(e);break;case 1:Do(e.type)&&cC(e);break;case 4:tL(e,e.stateNode.containerInfo);break;case 10:r=e.memoizedProps.value;var i=e.type._context;xr(nT,i._currentValue),i._currentValue=r;break;case 13:if(e.memoizedState!==null)return n&e.child.childLanes?FW(t,e,n):(xr(yr,yr.current&1),e=Uc(t,e,n),e!==null?e.sibling:null);xr(yr,yr.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&64){if(r)return WW(t,e,n);e.flags|=64}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),xr(yr,yr.current),r)break;return null;case 23:case 24:return e.lanes=0,rA(t,e,n)}return Uc(t,e,n)}else Us=!1;switch(e.lanes=0,e.tag){case 2:if(r=e.type,t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2),t=e.pendingProps,i=jg(e,Ji.current),dg(e,n),i=uj(null,e,r,t,i,n),e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0){if(e.tag=1,e.memoizedState=null,e.updateQueue=null,Do(r)){var o=!0;cC(e)}else o=!1;e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,aj(e);var a=r.getDerivedStateFromProps;typeof a=="function"&&oT(e,r,a,t),i.updater=WP,e.stateNode=i,i._reactInternals=e,eL(e,r,t,n),e=oL(null,e,r,!0,o,n)}else e.tag=0,wo(null,e,i,n),e=e.child;return e;case 16:i=e.elementType;e:{switch(t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2),t=e.pendingProps,o=i._init,i=o(i._payload),e.type=i,o=e.tag=Lbe(i),t=Ls(i,t),o){case 0:e=iL(null,e,i,t,n);break e;case 1:e=$W(null,e,i,t,n);break e;case 11:e=DW(null,e,i,t,n);break e;case 14:e=LW(null,e,i,Ls(i.type,t),r,n);break e}throw Error(Xe(306,i,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Ls(r,i),iL(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Ls(r,i),$W(t,e,r,i,n);case 3:if(NW(e),r=e.updateQueue,t===null||r===null)throw Error(Xe(282));if(r=e.pendingProps,i=e.memoizedState,i=i!==null?i.element:null,nte(t,e),xb(e,r,null,n),r=e.memoizedState.element,r===i)nA(),e=Uc(t,e,n);else{if(i=e.stateNode,(o=i.hydrate)&&(pf=fg(e.stateNode.containerInfo.firstChild),zc=e,o=jl=!0),o){if(t=i.mutableSourceEagerHydrationData,t!=null)for(i=0;i"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ite)}catch(t){console.error(t)}}Ite(),ree.exports=gs;var Wv=ree.exports;const Hw=Nt(Wv);var Dte={exports:{}},Ube="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Wbe=Ube,Vbe=Wbe;function Lte(){}function $te(){}$te.resetWarningCache=Lte;var Gbe=function(){function t(r,i,o,a,s,l){if(l!==Vbe){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}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:$te,resetWarningCache:Lte};return n.PropTypes=n,n};Dte.exports=Gbe();var s1=Dte.exports;const Qe=Nt(s1);var Nte=ue.createContext(null);function Hbe(t){t()}var Fte=Hbe,qbe=function(e){return Fte=e},Xbe=function(){return Fte};function Qbe(){var t=Xbe(),e=null,n=null;return{clear:function(){e=null,n=null},notify:function(){t(function(){for(var i=e;i;)i.callback(),i=i.next})},get:function(){for(var i=[],o=e;o;)i.push(o),o=o.next;return i},subscribe:function(i){var o=!0,a=n={callback:i,next:null,prev:n};return a.prev?a.prev.next=a:e=a,function(){!o||e===null||(o=!1,a.next?a.next.prev=a.prev:n=a.prev,a.prev?a.prev.next=a.next:e=a.next)}}}}var JW={notify:function(){},get:function(){return[]}};function jte(t,e){var n,r=JW;function i(f){return l(),r.subscribe(f)}function o(){r.notify()}function a(){u.onStateChange&&u.onStateChange()}function s(){return!!n}function l(){n||(n=e?e.addNestedSub(a):t.subscribe(a),r=Qbe())}function c(){n&&(n(),n=void 0,r.clear(),r=JW)}var u={addNestedSub:i,notifyNestedSubs:o,handleChangeWrapper:a,isSubscribed:s,trySubscribe:l,tryUnsubscribe:c,getListeners:function(){return r}};return u}var Bte=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?M.useLayoutEffect:M.useEffect;function Ybe(t){var e=t.store,n=t.context,r=t.children,i=M.useMemo(function(){var s=jte(e);return{store:e,subscription:s}},[e]),o=M.useMemo(function(){return e.getState()},[e]);Bte(function(){var s=i.subscription;return s.onStateChange=s.notifyNestedSubs,s.trySubscribe(),o!==e.getState()&&s.notifyNestedSubs(),function(){s.tryUnsubscribe(),s.onStateChange=null}},[i,o]);var a=n||Nte;return ue.createElement(a.Provider,{value:i},r)}function j(){return j=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}const Zbe=Object.freeze(Object.defineProperty({__proto__:null,default:Ae},Symbol.toStringTag,{value:"Module"}));var zte={exports:{}},Mn={};/** @license React v16.13.1 +Add a component higher in the tree to provide a loading indicator or placeholder to display.`)}Oi!==5&&(Oi=2),l=mj(l,s),d=a;do{switch(d.tag){case 3:o=l,d.flags|=4096,e&=-e,d.lanes|=e;var _=wte(d,o,e);CW(d,_);break e;case 1:o=l;var S=d.type,O=d.stateNode;if(!(d.flags&64)&&(typeof S.getDerivedStateFromError=="function"||O!==null&&typeof O.componentDidCatch=="function"&&(Pl===null||!Pl.has(O)))){d.flags|=4096,e&=-e,d.lanes|=e;var C=Ste(d,o,e);CW(d,C);break e}}d=d.return}while(d!==null)}Ate(n)}catch(E){e=E,Jr===n&&n!==null&&(Jr=n=n.return);continue}break}while(!0)}function Mte(){var t=hT.current;return hT.current=dT,t===null?dT:t}function nx(t,e){var n=Et;Et|=16;var r=Mte();co===t&&Zi===e||mg(t,e);do try{Ebe();break}catch(i){Pte(t,i)}while(!0);if(oj(),Et=n,hT.current=r,Jr!==null)throw Error(Xe(261));return co=null,Zi=0,Oi}function Ebe(){for(;Jr!==null;)kte(Jr)}function Pbe(){for(;Jr!==null&&!cbe();)kte(Jr)}function kte(t){var e=Ite(t.alternate,t,Vh);t.memoizedProps=t.pendingProps,e===null?Ate(t):Jr=e,gj.current=null}function Ate(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&2048){if(n=xbe(e),n!==null){n.flags&=2047,Jr=n;return}t!==null&&(t.firstEffect=t.lastEffect=null,t.flags|=2048)}else{if(n=ybe(n,e,Vh),n!==null){Jr=n;return}if(n=e,n.tag!==24&&n.tag!==23||n.memoizedState===null||Vh&1073741824||!(n.mode&4)){for(var r=0,i=n.child;i!==null;)r|=i.lanes|i.childLanes,i=i.sibling;n.childLanes=r}t!==null&&!(t.flags&2048)&&(t.firstEffect===null&&(t.firstEffect=e.firstEffect),e.lastEffect!==null&&(t.lastEffect!==null&&(t.lastEffect.nextEffect=e.firstEffect),t.lastEffect=e.lastEffect),1a&&(s=a,a=_,_=s),s=uW(y,_),o=uW(y,a),s&&o&&(b.rangeCount!==1||b.anchorNode!==s.node||b.anchorOffset!==s.offset||b.focusNode!==o.node||b.focusOffset!==o.offset)&&(x=x.createRange(),x.setStart(s.node,s.offset),b.removeAllRanges(),_>a?(b.addRange(x),b.extend(o.node,o.offset)):(x.setEnd(o.node,o.offset),b.addRange(x)))))),x=[],b=y;b=b.parentNode;)b.nodeType===1&&x.push({element:b,left:b.scrollLeft,top:b.scrollTop});for(typeof y.focus=="function"&&y.focus(),y=0;yKi()-yj?mg(t,0):vj|=n),ss(t,e)}function Dbe(t,e){var n=t.stateNode;n!==null&&n.delete(e),e=0,e===0&&(e=t.mode,e&2?e&4?($c===0&&($c=Bv),e=Pm(62914560&~$c),e===0&&(e=4194304)):e=Bg()===99?1:2:e=1),n=ya(),t=GP(t,e),t!==null&&(NP(t,e,n),ss(t,n))}var Ite;Ite=function(t,e,n){var r=e.lanes;if(t!==null)if(t.memoizedProps!==e.pendingProps||Io.current)Us=!0;else if(n&r)Us=!!(t.flags&16384);else{switch(Us=!1,e.tag){case 3:FW(e),nA();break;case 5:MW(e);break;case 1:Do(e.type)&&cC(e);break;case 4:nL(e,e.stateNode.containerInfo);break;case 10:r=e.memoizedProps.value;var i=e.type._context;xr(nT,i._currentValue),i._currentValue=r;break;case 13:if(e.memoizedState!==null)return n&e.child.childLanes?jW(t,e,n):(xr(yr,yr.current&1),e=Uc(t,e,n),e!==null?e.sibling:null);xr(yr,yr.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&64){if(r)return VW(t,e,n);e.flags|=64}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),xr(yr,yr.current),r)break;return null;case 23:case 24:return e.lanes=0,rA(t,e,n)}return Uc(t,e,n)}else Us=!1;switch(e.lanes=0,e.tag){case 2:if(r=e.type,t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2),t=e.pendingProps,i=jg(e,Ji.current),dg(e,n),i=fj(null,e,r,t,i,n),e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0){if(e.tag=1,e.memoizedState=null,e.updateQueue=null,Do(r)){var o=!0;cC(e)}else o=!1;e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,sj(e);var a=r.getDerivedStateFromProps;typeof a=="function"&&oT(e,r,a,t),i.updater=WP,e.stateNode=i,i._reactInternals=e,tL(e,r,t,n),e=aL(null,e,r,!0,o,n)}else e.tag=0,wo(null,e,i,n),e=e.child;return e;case 16:i=e.elementType;e:{switch(t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2),t=e.pendingProps,o=i._init,i=o(i._payload),e.type=i,o=e.tag=$be(i),t=Ls(i,t),o){case 0:e=oL(null,e,i,t,n);break e;case 1:e=NW(null,e,i,t,n);break e;case 11:e=LW(null,e,i,t,n);break e;case 14:e=$W(null,e,i,Ls(i.type,t),r,n);break e}throw Error(Xe(306,i,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Ls(r,i),oL(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Ls(r,i),NW(t,e,r,i,n);case 3:if(FW(e),r=e.updateQueue,t===null||r===null)throw Error(Xe(282));if(r=e.pendingProps,i=e.memoizedState,i=i!==null?i.element:null,ite(t,e),xb(e,r,null,n),r=e.memoizedState.element,r===i)nA(),e=Uc(t,e,n);else{if(i=e.stateNode,(o=i.hydrate)&&(pf=fg(e.stateNode.containerInfo.firstChild),zc=e,o=jl=!0),o){if(t=i.mutableSourceEagerHydrationData,t!=null)for(i=0;i"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Lte)}catch(t){console.error(t)}}Lte(),oee.exports=gs;var Wv=oee.exports;const Hw=Nt(Wv);var $te={exports:{}},Wbe="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Vbe=Wbe,Gbe=Vbe;function Nte(){}function Fte(){}Fte.resetWarningCache=Nte;var Hbe=function(){function t(r,i,o,a,s,l){if(l!==Gbe){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}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:Fte,resetWarningCache:Nte};return n.PropTypes=n,n};$te.exports=Hbe();var s1=$te.exports;const Qe=Nt(s1);var jte=ue.createContext(null);function qbe(t){t()}var Bte=qbe,Xbe=function(e){return Bte=e},Qbe=function(){return Bte};function Ybe(){var t=Qbe(),e=null,n=null;return{clear:function(){e=null,n=null},notify:function(){t(function(){for(var i=e;i;)i.callback(),i=i.next})},get:function(){for(var i=[],o=e;o;)i.push(o),o=o.next;return i},subscribe:function(i){var o=!0,a=n={callback:i,next:null,prev:n};return a.prev?a.prev.next=a:e=a,function(){!o||e===null||(o=!1,a.next?a.next.prev=a.prev:n=a.prev,a.prev?a.prev.next=a.next:e=a.next)}}}}var eV={notify:function(){},get:function(){return[]}};function zte(t,e){var n,r=eV;function i(f){return l(),r.subscribe(f)}function o(){r.notify()}function a(){u.onStateChange&&u.onStateChange()}function s(){return!!n}function l(){n||(n=e?e.addNestedSub(a):t.subscribe(a),r=Ybe())}function c(){n&&(n(),n=void 0,r.clear(),r=eV)}var u={addNestedSub:i,notifyNestedSubs:o,handleChangeWrapper:a,isSubscribed:s,trySubscribe:l,tryUnsubscribe:c,getListeners:function(){return r}};return u}var Ute=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?M.useLayoutEffect:M.useEffect;function Kbe(t){var e=t.store,n=t.context,r=t.children,i=M.useMemo(function(){var s=zte(e);return{store:e,subscription:s}},[e]),o=M.useMemo(function(){return e.getState()},[e]);Ute(function(){var s=i.subscription;return s.onStateChange=s.notifyNestedSubs,s.trySubscribe(),o!==e.getState()&&s.notifyNestedSubs(),function(){s.tryUnsubscribe(),s.onStateChange=null}},[i,o]);var a=n||jte;return ue.createElement(a.Provider,{value:i},r)}function j(){return j=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}const Jbe=Object.freeze(Object.defineProperty({__proto__:null,default:Ae},Symbol.toStringTag,{value:"Module"}));var Wte={exports:{}},Mn={};/** @license React v16.13.1 * react-is.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 fi=typeof Symbol=="function"&&Symbol.for,Sj=fi?Symbol.for("react.element"):60103,Oj=fi?Symbol.for("react.portal"):60106,qP=fi?Symbol.for("react.fragment"):60107,XP=fi?Symbol.for("react.strict_mode"):60108,QP=fi?Symbol.for("react.profiler"):60114,YP=fi?Symbol.for("react.provider"):60109,KP=fi?Symbol.for("react.context"):60110,Cj=fi?Symbol.for("react.async_mode"):60111,ZP=fi?Symbol.for("react.concurrent_mode"):60111,JP=fi?Symbol.for("react.forward_ref"):60112,eM=fi?Symbol.for("react.suspense"):60113,Jbe=fi?Symbol.for("react.suspense_list"):60120,tM=fi?Symbol.for("react.memo"):60115,nM=fi?Symbol.for("react.lazy"):60116,e_e=fi?Symbol.for("react.block"):60121,t_e=fi?Symbol.for("react.fundamental"):60117,n_e=fi?Symbol.for("react.responder"):60118,r_e=fi?Symbol.for("react.scope"):60119;function Ma(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case Sj:switch(t=t.type,t){case Cj:case ZP:case qP:case QP:case XP:case eM:return t;default:switch(t=t&&t.$$typeof,t){case KP:case JP:case nM:case tM:case YP:return t;default:return e}}case Oj:return e}}}function Ute(t){return Ma(t)===ZP}Mn.AsyncMode=Cj;Mn.ConcurrentMode=ZP;Mn.ContextConsumer=KP;Mn.ContextProvider=YP;Mn.Element=Sj;Mn.ForwardRef=JP;Mn.Fragment=qP;Mn.Lazy=nM;Mn.Memo=tM;Mn.Portal=Oj;Mn.Profiler=QP;Mn.StrictMode=XP;Mn.Suspense=eM;Mn.isAsyncMode=function(t){return Ute(t)||Ma(t)===Cj};Mn.isConcurrentMode=Ute;Mn.isContextConsumer=function(t){return Ma(t)===KP};Mn.isContextProvider=function(t){return Ma(t)===YP};Mn.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===Sj};Mn.isForwardRef=function(t){return Ma(t)===JP};Mn.isFragment=function(t){return Ma(t)===qP};Mn.isLazy=function(t){return Ma(t)===nM};Mn.isMemo=function(t){return Ma(t)===tM};Mn.isPortal=function(t){return Ma(t)===Oj};Mn.isProfiler=function(t){return Ma(t)===QP};Mn.isStrictMode=function(t){return Ma(t)===XP};Mn.isSuspense=function(t){return Ma(t)===eM};Mn.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===qP||t===ZP||t===QP||t===XP||t===eM||t===Jbe||typeof t=="object"&&t!==null&&(t.$$typeof===nM||t.$$typeof===tM||t.$$typeof===YP||t.$$typeof===KP||t.$$typeof===JP||t.$$typeof===t_e||t.$$typeof===n_e||t.$$typeof===r_e||t.$$typeof===e_e)};Mn.typeOf=Ma;zte.exports=Mn;var i_e=zte.exports,Tj=i_e,o_e={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a_e={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},s_e={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Wte={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Ej={};Ej[Tj.ForwardRef]=s_e;Ej[Tj.Memo]=Wte;function eV(t){return Tj.isMemo(t)?Wte:Ej[t.$$typeof]||o_e}var l_e=Object.defineProperty,c_e=Object.getOwnPropertyNames,tV=Object.getOwnPropertySymbols,u_e=Object.getOwnPropertyDescriptor,f_e=Object.getPrototypeOf,nV=Object.prototype;function Vte(t,e,n){if(typeof e!="string"){if(nV){var r=f_e(e);r&&r!==nV&&Vte(t,r,n)}var i=c_e(e);tV&&(i=i.concat(tV(e)));for(var o=eV(t),a=eV(e),s=0;s=0;r--){var i=e[r](t);if(i)return i}return function(o,a){throw new Error("Invalid value of type "+typeof t+" for "+n+" argument when connecting component "+a.wrappedComponentName+".")}}function K_e(t,e){return t===e}function Z_e(t){var e=t===void 0?{}:t,n=e.connectHOC,r=n===void 0?R_e:n,i=e.mapStateToPropsFactories,o=i===void 0?B_e:i,a=e.mapDispatchToPropsFactories,s=a===void 0?N_e:a,l=e.mergePropsFactories,c=l===void 0?G_e:l,u=e.selectorFactory,f=u===void 0?Q_e:u;return function(h,p,m,g){g===void 0&&(g={});var v=g,y=v.pure,x=y===void 0?!0:y,b=v.areStatesEqual,_=b===void 0?K_e:b,S=v.areOwnPropsEqual,O=S===void 0?cA:S,C=v.areStatePropsEqual,E=C===void 0?cA:C,k=v.areMergedPropsEqual,I=k===void 0?cA:k,P=Ae(v,Y_e),R=uA(h,o,"mapStateToProps"),T=uA(p,s,"mapDispatchToProps"),L=uA(m,c,"mergeProps");return r(f,j({methodName:"connect",getDisplayName:function(B){return"Connect("+B+")"},shouldHandleStateChanges:!!h,initMapStateToProps:R,initMapDispatchToProps:T,initMergeProps:L,pure:x,areStatesEqual:_,areOwnPropsEqual:O,areStatePropsEqual:E,areMergedPropsEqual:I},P))}}const Jt=Z_e();qbe(Wv.unstable_batchedUpdates);function au(t){"@babel/helpers - typeof";return au=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},au(t)}function J_e(t,e){if(au(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(au(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Zte(t){var e=J_e(t,"string");return au(e)=="symbol"?e:e+""}function it(t,e,n){return e=Zte(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function aV(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function sV(t){for(var e=1;e"u"&&(n=e,e=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(ta(1));return n(Jte)(t,e)}if(typeof t!="function")throw new Error(ta(2));var i=t,o=e,a=[],s=a,l=!1;function c(){s===a&&(s=a.slice())}function u(){if(l)throw new Error(ta(3));return o}function f(m){if(typeof m!="function")throw new Error(ta(4));if(l)throw new Error(ta(5));var g=!0;return c(),s.push(m),function(){if(g){if(l)throw new Error(ta(6));g=!1,c();var y=s.indexOf(m);s.splice(y,1),a=null}}}function d(m){if(!e1e(m))throw new Error(ta(7));if(typeof m.type>"u")throw new Error(ta(8));if(l)throw new Error(ta(9));try{l=!0,o=i(o,m)}finally{l=!1}for(var g=a=s,v=0;v"u"?"undefined":L($);return D!=="object"?D:$===Math?"math":$===null?"null":Array.isArray($)?"array":Object.prototype.toString.call($)==="[object Date]"?"date":typeof $.toString=="function"&&/^\/.*\//.test($.toString())?"regexp":"object"}function f($,D,A,q,Y,K,se){Y=Y||[],se=se||[];var te=Y.slice(0);if(typeof K<"u"){if(q){if(typeof q=="function"&&q(te,K))return;if((typeof q>"u"?"undefined":L(q))==="object"){if(q.prefilter&&q.prefilter(te,K))return;if(q.normalize){var J=q.normalize(te,K,$,D);J&&($=J[0],D=J[1])}}}te.push(K)}u($)==="regexp"&&u(D)==="regexp"&&($=$.toString(),D=D.toString());var pe=typeof $>"u"?"undefined":L($),be=typeof D>"u"?"undefined":L(D),re=pe!=="undefined"||se&&se[se.length-1].lhs&&se[se.length-1].lhs.hasOwnProperty(K),ve=be!=="undefined"||se&&se[se.length-1].rhs&&se[se.length-1].rhs.hasOwnProperty(K);if(!re&&ve)A(new a(te,D));else if(!ve&&re)A(new s(te,$));else if(u($)!==u(D))A(new o(te,$,D));else if(u($)==="date"&&$-D!==0)A(new o(te,$,D));else if(pe==="object"&&$!==null&&D!==null)if(se.filter(function(Q){return Q.lhs===$}).length)$!==D&&A(new o(te,$,D));else{if(se.push({lhs:$,rhs:D}),Array.isArray($)){var F;for($.length,F=0;F<$.length;F++)F>=D.length?A(new l(te,F,new s(void 0,$[F]))):f($[F],D[F],A,q,te,F,se);for(;F=0?(f($[Q],D[Q],A,q,te,Q,se),le=c(le,ee)):f($[Q],void 0,A,q,te,Q,se)}),le.forEach(function(Q){f(void 0,D[Q],A,q,te,Q,se)})}se.length=se.length-1}else $!==D&&(pe==="number"&&isNaN($)&&isNaN(D)||A(new o(te,$,D)))}function d($,D,A,q){return q=q||[],f($,D,function(Y){Y&&q.push(Y)},A),q.length?q:void 0}function h($,D,A){if(A.path&&A.path.length){var q,Y=$[D],K=A.path.length-1;for(q=0;q"u"&&(q[A.path[Y]]=typeof A.path[Y]=="number"?[]:{}),q=q[A.path[Y]];switch(A.kind){case"A":h(A.path?q[A.path[Y]]:q,A.index,A.item);break;case"D":delete q[A.path[Y]];break;case"E":case"N":q[A.path[Y]]=A.rhs}}}function m($,D,A){if(A.path&&A.path.length){var q,Y=$[D],K=A.path.length-1;for(q=0;q"u"&&(K[A.path[q]]={}),K=K[A.path[q]];switch(A.kind){case"A":m(K[A.path[q]],A.index,A.item);break;case"D":K[A.path[q]]=A.lhs;break;case"E":K[A.path[q]]=A.lhs;break;case"N":delete K[A.path[q]]}}}function v($,D,A){if($&&D){var q=function(Y){A&&!A($,D,Y)||p($,D,Y)};f($,D,q)}}function y($){return"color: "+W[$].color+"; font-weight: bold"}function x($){var D=$.kind,A=$.path,q=$.lhs,Y=$.rhs,K=$.index,se=$.item;switch(D){case"E":return[A.join("."),q,"→",Y];case"N":return[A.join("."),Y];case"D":return[A.join(".")];case"A":return[A.join(".")+"["+K+"]",se];default:return[]}}function b($,D,A,q){var Y=d($,D);try{q?A.groupCollapsed("diff"):A.group("diff")}catch{A.log("diff")}Y?Y.forEach(function(K){var se=K.kind,te=x(K);A.log.apply(A,["%c "+W[se].text,y(se)].concat(z(te)))}):A.log("—— no diff ——");try{A.groupEnd()}catch{A.log("—— diff end —— ")}}function _($,D,A,q){switch(typeof $>"u"?"undefined":L($)){case"object":return typeof $[q]=="function"?$[q].apply($,z(A)):$[q];case"function":return $(D);default:return $}}function S($){var D=$.timestamp,A=$.duration;return function(q,Y,K){var se=["action"];return se.push("%c"+String(q.type)),D&&se.push("%c@ "+Y),A&&se.push("%c(in "+K.toFixed(2)+" ms)"),se.join(" ")}}function O($,D){var A=D.logger,q=D.actionTransformer,Y=D.titleFormatter,K=Y===void 0?S(D):Y,se=D.collapsed,te=D.colors,J=D.level,pe=D.diff,be=typeof D.titleFormatter>"u";$.forEach(function(re,ve){var F=re.started,ce=re.startedTime,le=re.action,Q=re.prevState,X=re.error,ee=re.took,ge=re.nextState,ye=$[ve+1];ye&&(ge=ye.prevState,ee=ye.started-F);var H=q(le),G=typeof se=="function"?se(function(){return ge},le,re):se,ie=R(ce),he=te.title?"color: "+te.title(H)+";":"",_e=["color: gray; font-weight: lighter;"];_e.push(he),D.timestamp&&_e.push("color: gray; font-weight: lighter;"),D.duration&&_e.push("color: gray; font-weight: lighter;");var oe=K(H,ie,ee);try{G?te.title&&be?A.groupCollapsed.apply(A,["%c "+oe].concat(_e)):A.groupCollapsed(oe):te.title&&be?A.group.apply(A,["%c "+oe].concat(_e)):A.group(oe)}catch{A.log(oe)}var Z=_(J,H,[Q],"prevState"),V=_(J,H,[H],"action"),de=_(J,H,[X,Q],"error"),xe=_(J,H,[ge],"nextState");if(Z)if(te.prevState){var Me="color: "+te.prevState(Q)+"; font-weight: bold";A[Z]("%c prev state",Me,Q)}else A[Z]("prev state",Q);if(V)if(te.action){var me="color: "+te.action(H)+"; font-weight: bold";A[V]("%c action ",me,H)}else A[V]("action ",H);if(X&&de)if(te.error){var Ne="color: "+te.error(X,Q)+"; font-weight: bold;";A[de]("%c error ",Ne,X)}else A[de]("error ",X);if(xe)if(te.nextState){var Ce="color: "+te.nextState(ge)+"; font-weight: bold";A[xe]("%c next state",Ce,ge)}else A[xe]("next state",ge);pe&&b(Q,ge,A,G);try{A.groupEnd()}catch{A.log("—— log end ——")}})}function C(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},D=Object.assign({},U,$),A=D.logger,q=D.stateTransformer,Y=D.errorTransformer,K=D.predicate,se=D.logErrors,te=D.diffPredicate;if(typeof A>"u")return function(){return function(pe){return function(be){return pe(be)}}};if($.getState&&$.dispatch)return console.error(`[redux-logger] redux-logger not installed. Make sure to pass logger instance as middleware: + */var rM=60103,iM=60106,l1=60107,c1=60108,u1=60114,f1=60109,d1=60110,h1=60112,p1=60113,Mj=60120,m1=60115,g1=60116,Xte=60121,Qte=60122,Yte=60117,Kte=60129,Zte=60131;if(typeof Symbol=="function"&&Symbol.for){var xi=Symbol.for;rM=xi("react.element"),iM=xi("react.portal"),l1=xi("react.fragment"),c1=xi("react.strict_mode"),u1=xi("react.profiler"),f1=xi("react.provider"),d1=xi("react.context"),h1=xi("react.forward_ref"),p1=xi("react.suspense"),Mj=xi("react.suspense_list"),m1=xi("react.memo"),g1=xi("react.lazy"),Xte=xi("react.block"),Qte=xi("react.server.block"),Yte=xi("react.fundamental"),Kte=xi("react.debug_trace_mode"),Zte=xi("react.legacy_hidden")}function Js(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case rM:switch(t=t.type,t){case l1:case u1:case c1:case p1:case Mj:return t;default:switch(t=t&&t.$$typeof,t){case d1:case h1:case g1:case m1:case f1:return t;default:return e}}case iM:return e}}}var p_e=f1,m_e=rM,g_e=h1,v_e=l1,y_e=g1,x_e=m1,b_e=iM,__e=u1,w_e=c1,S_e=p1;Nn.ContextConsumer=d1;Nn.ContextProvider=p_e;Nn.Element=m_e;Nn.ForwardRef=g_e;Nn.Fragment=v_e;Nn.Lazy=y_e;Nn.Memo=x_e;Nn.Portal=b_e;Nn.Profiler=__e;Nn.StrictMode=w_e;Nn.Suspense=S_e;Nn.isAsyncMode=function(){return!1};Nn.isConcurrentMode=function(){return!1};Nn.isContextConsumer=function(t){return Js(t)===d1};Nn.isContextProvider=function(t){return Js(t)===f1};Nn.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===rM};Nn.isForwardRef=function(t){return Js(t)===h1};Nn.isFragment=function(t){return Js(t)===l1};Nn.isLazy=function(t){return Js(t)===g1};Nn.isMemo=function(t){return Js(t)===m1};Nn.isPortal=function(t){return Js(t)===iM};Nn.isProfiler=function(t){return Js(t)===u1};Nn.isStrictMode=function(t){return Js(t)===c1};Nn.isSuspense=function(t){return Js(t)===p1};Nn.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===l1||t===u1||t===Kte||t===c1||t===p1||t===Mj||t===Zte||typeof t=="object"&&t!==null&&(t.$$typeof===g1||t.$$typeof===m1||t.$$typeof===f1||t.$$typeof===d1||t.$$typeof===h1||t.$$typeof===Yte||t.$$typeof===Xte||t[0]===Qte)};Nn.typeOf=Js;qte.exports=Nn;var O_e=qte.exports,C_e=["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"],T_e=["reactReduxForwardedRef"],E_e=[],P_e=[null,null];function M_e(t,e){var n=t[1];return[e.payload,n+1]}function iV(t,e,n){Ute(function(){return t.apply(void 0,e)},n)}function k_e(t,e,n,r,i,o,a){t.current=r,e.current=i,n.current=!1,o.current&&(o.current=null,a())}function A_e(t,e,n,r,i,o,a,s,l,c){if(t){var u=!1,f=null,d=function(){if(!u){var m=e.getState(),g,v;try{g=r(m,i.current)}catch(y){v=y,f=y}v||(f=null),g===o.current?a.current||l():(o.current=g,s.current=g,a.current=!0,c({type:"STORE_UPDATED",payload:{error:v}}))}};n.onStateChange=d,n.trySubscribe(),d();var h=function(){if(u=!0,n.tryUnsubscribe(),n.onStateChange=null,f)throw f};return h}}var R_e=function(){return[null,0]};function I_e(t,e){e===void 0&&(e={});var n=e,r=n.getDisplayName,i=r===void 0?function(x){return"ConnectAdvanced("+x+")"}:r,o=n.methodName,a=o===void 0?"connectAdvanced":o,s=n.renderCountProp,l=s===void 0?void 0:s,c=n.shouldHandleStateChanges,u=c===void 0?!0:c,f=n.storeKey,d=f===void 0?"store":f;n.withRef;var h=n.forwardRef,p=h===void 0?!1:h,m=n.context,g=m===void 0?jte:m,v=Ae(n,C_e),y=g;return function(b){var _=b.displayName||b.name||"Component",S=i(_),O=j({},v,{getDisplayName:i,methodName:a,renderCountProp:l,shouldHandleStateChanges:u,storeKey:d,displayName:S,wrappedComponentName:_,WrappedComponent:b}),C=v.pure;function E(T){return t(T.dispatch,O)}var k=C?M.useMemo:function(T){return T()};function I(T){var L=M.useMemo(function(){var ee=T.reactReduxForwardedRef,ge=Ae(T,T_e);return[T.context,ee,ge]},[T]),z=L[0],B=L[1],W=L[2],U=M.useMemo(function(){return z&&z.Consumer&&O_e.isContextConsumer(ue.createElement(z.Consumer,null))?z:y},[z,y]),N=M.useContext(U),$=!!T.store&&!!T.store.getState&&!!T.store.dispatch;N&&N.store;var D=$?T.store:N.store,A=M.useMemo(function(){return E(D)},[D]),q=M.useMemo(function(){if(!u)return P_e;var ee=zte(D,$?null:N.subscription),ge=ee.notifyNestedSubs.bind(ee);return[ee,ge]},[D,$,N]),Y=q[0],K=q[1],se=M.useMemo(function(){return $?N:j({},N,{subscription:Y})},[$,N,Y]),te=M.useReducer(M_e,E_e,R_e),J=te[0],pe=J[0],be=te[1];if(pe&&pe.error)throw pe.error;var re=M.useRef(),ve=M.useRef(W),F=M.useRef(),ce=M.useRef(!1),le=k(function(){return F.current&&W===ve.current?F.current:A(D.getState(),W)},[D,pe,W]);iV(k_e,[ve,re,ce,W,le,F,K]),iV(A_e,[u,D,Y,A,ve,re,ce,F,K,be],[D,Y,A]);var Q=M.useMemo(function(){return ue.createElement(b,j({},le,{ref:B}))},[B,b,le]),X=M.useMemo(function(){return u?ue.createElement(U.Provider,{value:se},Q):Q},[U,Q,se]);return X}var P=C?ue.memo(I):I;if(P.WrappedComponent=b,P.displayName=I.displayName=S,p){var R=ue.forwardRef(function(L,z){return ue.createElement(P,j({},L,{reactReduxForwardedRef:z}))});return R.displayName=S,R.WrappedComponent=b,xL(R,b)}return xL(P,b)}}function oV(t,e){return t===e?t!==0||e!==0||1/t===1/e:t!==t&&e!==e}function cA(t,e){if(oV(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(var i=0;i=0;r--){var i=e[r](t);if(i)return i}return function(o,a){throw new Error("Invalid value of type "+typeof t+" for "+n+" argument when connecting component "+a.wrappedComponentName+".")}}function Z_e(t,e){return t===e}function J_e(t){var e=t===void 0?{}:t,n=e.connectHOC,r=n===void 0?I_e:n,i=e.mapStateToPropsFactories,o=i===void 0?z_e:i,a=e.mapDispatchToPropsFactories,s=a===void 0?F_e:a,l=e.mergePropsFactories,c=l===void 0?H_e:l,u=e.selectorFactory,f=u===void 0?Y_e:u;return function(h,p,m,g){g===void 0&&(g={});var v=g,y=v.pure,x=y===void 0?!0:y,b=v.areStatesEqual,_=b===void 0?Z_e:b,S=v.areOwnPropsEqual,O=S===void 0?cA:S,C=v.areStatePropsEqual,E=C===void 0?cA:C,k=v.areMergedPropsEqual,I=k===void 0?cA:k,P=Ae(v,K_e),R=uA(h,o,"mapStateToProps"),T=uA(p,s,"mapDispatchToProps"),L=uA(m,c,"mergeProps");return r(f,j({methodName:"connect",getDisplayName:function(B){return"Connect("+B+")"},shouldHandleStateChanges:!!h,initMapStateToProps:R,initMapDispatchToProps:T,initMergeProps:L,pure:x,areStatesEqual:_,areOwnPropsEqual:O,areStatePropsEqual:E,areMergedPropsEqual:I},P))}}const Jt=J_e();Xbe(Wv.unstable_batchedUpdates);function au(t){"@babel/helpers - typeof";return au=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},au(t)}function e1e(t,e){if(au(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(au(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ene(t){var e=e1e(t,"string");return au(e)=="symbol"?e:e+""}function it(t,e,n){return e=ene(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function sV(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function lV(t){for(var e=1;e"u"&&(n=e,e=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(ta(1));return n(tne)(t,e)}if(typeof t!="function")throw new Error(ta(2));var i=t,o=e,a=[],s=a,l=!1;function c(){s===a&&(s=a.slice())}function u(){if(l)throw new Error(ta(3));return o}function f(m){if(typeof m!="function")throw new Error(ta(4));if(l)throw new Error(ta(5));var g=!0;return c(),s.push(m),function(){if(g){if(l)throw new Error(ta(6));g=!1,c();var y=s.indexOf(m);s.splice(y,1),a=null}}}function d(m){if(!t1e(m))throw new Error(ta(7));if(typeof m.type>"u")throw new Error(ta(8));if(l)throw new Error(ta(9));try{l=!0,o=i(o,m)}finally{l=!1}for(var g=a=s,v=0;v"u"?"undefined":L($);return D!=="object"?D:$===Math?"math":$===null?"null":Array.isArray($)?"array":Object.prototype.toString.call($)==="[object Date]"?"date":typeof $.toString=="function"&&/^\/.*\//.test($.toString())?"regexp":"object"}function f($,D,A,q,Y,K,se){Y=Y||[],se=se||[];var te=Y.slice(0);if(typeof K<"u"){if(q){if(typeof q=="function"&&q(te,K))return;if((typeof q>"u"?"undefined":L(q))==="object"){if(q.prefilter&&q.prefilter(te,K))return;if(q.normalize){var J=q.normalize(te,K,$,D);J&&($=J[0],D=J[1])}}}te.push(K)}u($)==="regexp"&&u(D)==="regexp"&&($=$.toString(),D=D.toString());var pe=typeof $>"u"?"undefined":L($),be=typeof D>"u"?"undefined":L(D),re=pe!=="undefined"||se&&se[se.length-1].lhs&&se[se.length-1].lhs.hasOwnProperty(K),ve=be!=="undefined"||se&&se[se.length-1].rhs&&se[se.length-1].rhs.hasOwnProperty(K);if(!re&&ve)A(new a(te,D));else if(!ve&&re)A(new s(te,$));else if(u($)!==u(D))A(new o(te,$,D));else if(u($)==="date"&&$-D!==0)A(new o(te,$,D));else if(pe==="object"&&$!==null&&D!==null)if(se.filter(function(Q){return Q.lhs===$}).length)$!==D&&A(new o(te,$,D));else{if(se.push({lhs:$,rhs:D}),Array.isArray($)){var F;for($.length,F=0;F<$.length;F++)F>=D.length?A(new l(te,F,new s(void 0,$[F]))):f($[F],D[F],A,q,te,F,se);for(;F=0?(f($[Q],D[Q],A,q,te,Q,se),le=c(le,ee)):f($[Q],void 0,A,q,te,Q,se)}),le.forEach(function(Q){f(void 0,D[Q],A,q,te,Q,se)})}se.length=se.length-1}else $!==D&&(pe==="number"&&isNaN($)&&isNaN(D)||A(new o(te,$,D)))}function d($,D,A,q){return q=q||[],f($,D,function(Y){Y&&q.push(Y)},A),q.length?q:void 0}function h($,D,A){if(A.path&&A.path.length){var q,Y=$[D],K=A.path.length-1;for(q=0;q"u"&&(q[A.path[Y]]=typeof A.path[Y]=="number"?[]:{}),q=q[A.path[Y]];switch(A.kind){case"A":h(A.path?q[A.path[Y]]:q,A.index,A.item);break;case"D":delete q[A.path[Y]];break;case"E":case"N":q[A.path[Y]]=A.rhs}}}function m($,D,A){if(A.path&&A.path.length){var q,Y=$[D],K=A.path.length-1;for(q=0;q"u"&&(K[A.path[q]]={}),K=K[A.path[q]];switch(A.kind){case"A":m(K[A.path[q]],A.index,A.item);break;case"D":K[A.path[q]]=A.lhs;break;case"E":K[A.path[q]]=A.lhs;break;case"N":delete K[A.path[q]]}}}function v($,D,A){if($&&D){var q=function(Y){A&&!A($,D,Y)||p($,D,Y)};f($,D,q)}}function y($){return"color: "+W[$].color+"; font-weight: bold"}function x($){var D=$.kind,A=$.path,q=$.lhs,Y=$.rhs,K=$.index,se=$.item;switch(D){case"E":return[A.join("."),q,"→",Y];case"N":return[A.join("."),Y];case"D":return[A.join(".")];case"A":return[A.join(".")+"["+K+"]",se];default:return[]}}function b($,D,A,q){var Y=d($,D);try{q?A.groupCollapsed("diff"):A.group("diff")}catch{A.log("diff")}Y?Y.forEach(function(K){var se=K.kind,te=x(K);A.log.apply(A,["%c "+W[se].text,y(se)].concat(z(te)))}):A.log("—— no diff ——");try{A.groupEnd()}catch{A.log("—— diff end —— ")}}function _($,D,A,q){switch(typeof $>"u"?"undefined":L($)){case"object":return typeof $[q]=="function"?$[q].apply($,z(A)):$[q];case"function":return $(D);default:return $}}function S($){var D=$.timestamp,A=$.duration;return function(q,Y,K){var se=["action"];return se.push("%c"+String(q.type)),D&&se.push("%c@ "+Y),A&&se.push("%c(in "+K.toFixed(2)+" ms)"),se.join(" ")}}function O($,D){var A=D.logger,q=D.actionTransformer,Y=D.titleFormatter,K=Y===void 0?S(D):Y,se=D.collapsed,te=D.colors,J=D.level,pe=D.diff,be=typeof D.titleFormatter>"u";$.forEach(function(re,ve){var F=re.started,ce=re.startedTime,le=re.action,Q=re.prevState,X=re.error,ee=re.took,ge=re.nextState,ye=$[ve+1];ye&&(ge=ye.prevState,ee=ye.started-F);var H=q(le),G=typeof se=="function"?se(function(){return ge},le,re):se,ie=R(ce),he=te.title?"color: "+te.title(H)+";":"",_e=["color: gray; font-weight: lighter;"];_e.push(he),D.timestamp&&_e.push("color: gray; font-weight: lighter;"),D.duration&&_e.push("color: gray; font-weight: lighter;");var oe=K(H,ie,ee);try{G?te.title&&be?A.groupCollapsed.apply(A,["%c "+oe].concat(_e)):A.groupCollapsed(oe):te.title&&be?A.group.apply(A,["%c "+oe].concat(_e)):A.group(oe)}catch{A.log(oe)}var Z=_(J,H,[Q],"prevState"),V=_(J,H,[H],"action"),de=_(J,H,[X,Q],"error"),xe=_(J,H,[ge],"nextState");if(Z)if(te.prevState){var Me="color: "+te.prevState(Q)+"; font-weight: bold";A[Z]("%c prev state",Me,Q)}else A[Z]("prev state",Q);if(V)if(te.action){var me="color: "+te.action(H)+"; font-weight: bold";A[V]("%c action ",me,H)}else A[V]("action ",H);if(X&&de)if(te.error){var Ne="color: "+te.error(X,Q)+"; font-weight: bold;";A[de]("%c error ",Ne,X)}else A[de]("error ",X);if(xe)if(te.nextState){var Ce="color: "+te.nextState(ge)+"; font-weight: bold";A[xe]("%c next state",Ce,ge)}else A[xe]("next state",ge);pe&&b(Q,ge,A,G);try{A.groupEnd()}catch{A.log("—— log end ——")}})}function C(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},D=Object.assign({},U,$),A=D.logger,q=D.stateTransformer,Y=D.errorTransformer,K=D.predicate,se=D.logErrors,te=D.diffPredicate;if(typeof A>"u")return function(){return function(pe){return function(be){return pe(be)}}};if($.getState&&$.dispatch)return console.error(`[redux-logger] redux-logger not installed. Make sure to pass logger instance as middleware: // Logger with default options import { logger } from 'redux-logger' const store = createStore( @@ -75,7 +75,7 @@ const store = createStore( [redux-logger v3] import createLogger from 'redux-logger' [redux-logger v3] to [redux-logger v3] import { createLogger } from 'redux-logger' -`)};n.defaults=U,n.createLogger=C,n.logger=N,n.default=N,Object.defineProperty(n,"__esModule",{value:!0})})})(xL,xL.exports);var r1e=xL.exports;function ene(t){var e=function(r){var i=r.dispatch,o=r.getState;return function(a){return function(s){return typeof s=="function"?s(i,o,t):a(s)}}};return e}var tne=ene();tne.withExtraArgument=ene;const i1e=tne,o1e={black:"#000",white:"#fff"},Sb=o1e,a1e={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},Ku=a1e,s1e={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162"},nne=s1e,l1e={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},Zu=l1e,c1e={50:"#ede7f6",100:"#d1c4e9",200:"#b39ddb",300:"#9575cd",400:"#7e57c2",500:"#673ab7",600:"#5e35b1",700:"#512da8",800:"#4527a0",900:"#311b92",A100:"#b388ff",A200:"#7c4dff",A400:"#651fff",A700:"#6200ea"},u1e=c1e,f1e={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe"},rne=f1e,d1e={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},Ju=d1e,h1e={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},ef=h1e,p1e={50:"#e0f7fa",100:"#b2ebf2",200:"#80deea",300:"#4dd0e1",400:"#26c6da",500:"#00bcd4",600:"#00acc1",700:"#0097a7",800:"#00838f",900:"#006064",A100:"#84ffff",A200:"#18ffff",A400:"#00e5ff",A700:"#00b8d4"},ine=p1e,m1e={50:"#e0f2f1",100:"#b2dfdb",200:"#80cbc4",300:"#4db6ac",400:"#26a69a",500:"#009688",600:"#00897b",700:"#00796b",800:"#00695c",900:"#004d40",A100:"#a7ffeb",A200:"#64ffda",A400:"#1de9b6",A700:"#00bfa5"},one=m1e,g1e={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},Rc=g1e,v1e={50:"#f1f8e9",100:"#dcedc8",200:"#c5e1a5",300:"#aed581",400:"#9ccc65",500:"#8bc34a",600:"#7cb342",700:"#689f38",800:"#558b2f",900:"#33691e",A100:"#ccff90",A200:"#b2ff59",A400:"#76ff03",A700:"#64dd17"},y1e=v1e,x1e={50:"#f9fbe7",100:"#f0f4c3",200:"#e6ee9c",300:"#dce775",400:"#d4e157",500:"#cddc39",600:"#c0ca33",700:"#afb42b",800:"#9e9d24",900:"#827717",A100:"#f4ff81",A200:"#eeff41",A400:"#c6ff00",A700:"#aeea00"},ane=x1e,b1e={50:"#fffde7",100:"#fff9c4",200:"#fff59d",300:"#fff176",400:"#ffee58",500:"#ffeb3b",600:"#fdd835",700:"#fbc02d",800:"#f9a825",900:"#f57f17",A100:"#ffff8d",A200:"#ffff00",A400:"#ffea00",A700:"#ffd600"},sne=b1e,_1e={50:"#fff8e1",100:"#ffecb3",200:"#ffe082",300:"#ffd54f",400:"#ffca28",500:"#ffc107",600:"#ffb300",700:"#ffa000",800:"#ff8f00",900:"#ff6f00",A100:"#ffe57f",A200:"#ffd740",A400:"#ffc400",A700:"#ffab00"},lne=_1e,w1e={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},Jd=w1e,Ph={50:"#fbe9e7",100:"#ffccbc",200:"#ffab91",300:"#ff8a65",400:"#ff7043",500:"#ff5722",600:"#f4511e",700:"#e64a19",800:"#d84315",900:"#bf360c",A100:"#ff9e80",A200:"#ff6e40",A400:"#ff3d00",A700:"#dd2c00"},S1e={50:"#efebe9",100:"#d7ccc8",200:"#bcaaa4",300:"#a1887f",400:"#8d6e63",500:"#795548",600:"#6d4c41",700:"#5d4037",800:"#4e342e",900:"#3e2723",A100:"#d7ccc8",A200:"#bcaaa4",A400:"#8d6e63",A700:"#5d4037"},cne=S1e,O1e={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},une=O1e,C1e={50:"#eceff1",100:"#cfd8dc",200:"#b0bec5",300:"#90a4ae",400:"#78909c",500:"#607d8b",600:"#546e7a",700:"#455a64",800:"#37474f",900:"#263238",A100:"#cfd8dc",A200:"#b0bec5",A400:"#78909c",A700:"#455a64"},T1e=C1e;function su(t){let e="https://mui.com/production-error/?code="+t;for(let n=1;n0?Si(Vv,--zo):0,Ug--,$r===10&&(Ug=1,aM--),$r}function xa(){return $r=zo2||Cb($r)>3?"":" "}function W1e(t,e){for(;--e&&xa()&&!($r<48||$r>102||$r>57&&$r<65||$r>70&&$r<97););return v1(t,mC()+(e<6&&Bl()==32&&xa()==32))}function _L(t){for(;xa();)switch($r){case t:return zo;case 34:case 39:t!==34&&t!==39&&_L($r);break;case 40:t===41&&_L(t);break;case 92:xa();break}return zo}function V1e(t,e){for(;xa()&&t+$r!==57;)if(t+$r===84&&Bl()===47)break;return"/*"+v1(e,zo-1)+"*"+oM(t===47?t:xa())}function G1e(t){for(;!Cb(Bl());)xa();return v1(t,zo)}function H1e(t){return vne(vC("",null,null,null,[""],t=gne(t),0,[0],t))}function vC(t,e,n,r,i,o,a,s,l){for(var c=0,u=0,f=a,d=0,h=0,p=0,m=1,g=1,v=1,y=0,x="",b=i,_=o,S=r,O=x;g;)switch(p=y,y=xa()){case 40:if(p!=108&&Si(O,f-1)==58){bL(O+=gn(gC(y),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:O+=gC(y);break;case 9:case 10:case 13:case 32:O+=U1e(p);break;case 92:O+=W1e(mC()-1,7);continue;case 47:switch(Bl()){case 42:case 47:qw(q1e(V1e(xa(),mC()),e,n),l);break;default:O+="/"}break;case 123*m:s[c++]=gl(O)*v;case 125*m:case 59:case 0:switch(y){case 0:case 125:g=0;case 59+u:v==-1&&(O=gn(O,/\f/g,"")),h>0&&gl(O)-f&&qw(h>32?fV(O+";",r,n,f-1):fV(gn(O," ","")+";",r,n,f-2),l);break;case 59:O+=";";default:if(qw(S=uV(O,e,n,c,u,i,s,x,b=[],_=[],f),o),y===123)if(u===0)vC(O,e,S,S,b,o,f,s,_);else switch(d===99&&Si(O,3)===110?100:d){case 100:case 108:case 109:case 115:vC(t,S,S,r&&qw(uV(t,S,S,0,0,i,s,x,i,b=[],f),_),i,_,f,s,r?b:_);break;default:vC(O,S,S,S,[""],_,0,s,_)}}c=u=h=0,m=v=1,x=O="",f=a;break;case 58:f=1+gl(O),h=p;default:if(m<1){if(y==123)--m;else if(y==125&&m++==0&&z1e()==125)continue}switch(O+=oM(y),y*m){case 38:v=u>0?1:(O+="\f",-1);break;case 44:s[c++]=(gl(O)-1)*v,v=1;break;case 64:Bl()===45&&(O+=gC(xa())),d=Bl(),u=f=gl(x=O+=G1e(mC())),y++;break;case 45:p===45&&gl(O)==2&&(m=0)}}return o}function uV(t,e,n,r,i,o,a,s,l,c,u){for(var f=i-1,d=i===0?o:[""],h=Rj(d),p=0,m=0,g=0;p0?d[v]+" "+y:gn(y,/&\f/g,d[v])))&&(l[g++]=x);return sM(t,e,n,i===0?kj:s,l,c,u)}function q1e(t,e,n){return sM(t,e,n,dne,oM(B1e()),Ob(t,2,-2),0)}function fV(t,e,n,r){return sM(t,e,n,Aj,Ob(t,0,r),Ob(t,r+1,-1),r)}function vg(t,e){for(var n="",r=Rj(t),i=0;i6)switch(Si(t,e+1)){case 109:if(Si(t,e+4)!==45)break;case 102:return gn(t,/(.+:)(.+)-([^]+)/,"$1"+pn+"$2-$3$1"+gT+(Si(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~bL(t,"stretch")?yne(gn(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(Si(t,e+1)!==115)break;case 6444:switch(Si(t,gl(t)-3-(~bL(t,"!important")&&10))){case 107:return gn(t,":",":"+pn)+t;case 101:return gn(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+pn+(Si(t,14)===45?"inline-":"")+"box$3$1"+pn+"$2$3$1"+Bi+"$2box$3")+t}break;case 5936:switch(Si(t,e+11)){case 114:return pn+t+Bi+gn(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return pn+t+Bi+gn(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return pn+t+Bi+gn(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return pn+t+Bi+t+t}return t}var nwe=function(e,n,r,i){if(e.length>-1&&!e.return)switch(e.type){case Aj:e.return=yne(e.value,e.length);break;case hne:return vg([s0(e,{value:gn(e.value,"@","@"+pn)})],i);case kj:if(e.length)return j1e(e.props,function(o){switch(F1e(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return vg([s0(e,{props:[gn(o,/:(read-\w+)/,":"+gT+"$1")]})],i);case"::placeholder":return vg([s0(e,{props:[gn(o,/:(plac\w+)/,":"+pn+"input-$1")]}),s0(e,{props:[gn(o,/:(plac\w+)/,":"+gT+"$1")]}),s0(e,{props:[gn(o,/:(plac\w+)/,Bi+"input-$1")]})],i)}return""})}},rwe=[nwe],xne=function(e){var n=e.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(m){var g=m.getAttribute("data-emotion");g.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var i=e.stylisPlugins||rwe,o={},a,s=[];a=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(m){for(var g=m.getAttribute("data-emotion").split(" "),v=1;v=4;++r,i-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(i){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var swe={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},lwe=/[A-Z]|^ms/g,cwe=/_EMO_([^_]+?)_([^]*?)_EMO_/g,wne=function(e){return e.charCodeAt(1)===45},hV=function(e){return e!=null&&typeof e!="boolean"},dA=fne(function(t){return wne(t)?t:t.replace(lwe,"-$&").toLowerCase()}),pV=function(e,n){switch(e){case"animation":case"animationName":if(typeof n=="string")return n.replace(cwe,function(r,i,o){return vl={name:i,styles:o,next:vl},i})}return swe[e]!==1&&!wne(e)&&typeof n=="number"&&n!==0?n+"px":n};function Tb(t,e,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return vl={name:n.name,styles:n.styles,next:vl},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)vl={name:r.name,styles:r.styles,next:vl},r=r.next;var i=n.styles+";";return i}return uwe(t,e,n)}case"function":{if(t!==void 0){var o=vl,a=n(t);return vl=o,Tb(t,e,a)}break}}if(e==null)return n;var s=e[n];return s!==void 0?s:n}function uwe(t,e,n){var r="";if(Array.isArray(n))for(var i=0;i96?mwe:gwe},yV=function(e,n,r){var i;if(n){var o=n.shouldForwardProp;i=e.__emotion_forwardProp&&o?function(a){return e.__emotion_forwardProp(a)&&o(a)}:o}return typeof i!="function"&&r&&(i=e.__emotion_forwardProp),i},vwe=function(e){var n=e.cache,r=e.serialized,i=e.isStringTag;return bne(n,r,i),dwe(function(){return _ne(n,r,i)}),null},ywe=function t(e,n){var r=e.__emotion_real===e,i=r&&e.__emotion_base||e,o,a;n!==void 0&&(o=n.label,a=n.target);var s=yV(e,n,r),l=s||vV(i),c=!l("as");return function(){var u=arguments,f=r&&e.__emotion_styles!==void 0?e.__emotion_styles.slice(0):[];if(o!==void 0&&f.push("label:"+o+";"),u[0]==null||u[0].raw===void 0)f.push.apply(f,u);else{f.push(u[0][0]);for(var d=u.length,h=1;he(bwe(i)?n:i):e;return w.jsx(pwe,{styles:r})}function Dj(t,e){return wL(t,e)}const Pne=(t,e)=>{Array.isArray(t.__emotion_styles)&&(t.__emotion_styles=e(t.__emotion_styles))},_we=Object.freeze(Object.defineProperty({__proto__:null,GlobalStyles:Ene,StyledEngineProvider:Tne,ThemeContext:y1,css:lM,default:Dj,internal_processStyles:Pne,keyframes:Gv},Symbol.toStringTag,{value:"Module"}));function Nc(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function Mne(t){if(!Nc(t))return t;const e={};return Object.keys(t).forEach(n=>{e[n]=Mne(t[n])}),e}function Ii(t,e,n={clone:!0}){const r=n.clone?j({},t):t;return Nc(t)&&Nc(e)&&Object.keys(e).forEach(i=>{i!=="__proto__"&&(Nc(e[i])&&i in t&&Nc(t[i])?r[i]=Ii(t[i],e[i],n):n.clone?r[i]=Nc(e[i])?Mne(e[i]):e[i]:r[i]=e[i])}),r}const wwe=Object.freeze(Object.defineProperty({__proto__:null,default:Ii,isPlainObject:Nc},Symbol.toStringTag,{value:"Module"})),Swe=["values","unit","step"],Owe=t=>{const e=Object.keys(t).map(n=>({key:n,val:t[n]}))||[];return e.sort((n,r)=>n.val-r.val),e.reduce((n,r)=>j({},n,{[r.key]:r.val}),{})};function kne(t){const{values:e={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5}=t,i=Ae(t,Swe),o=Owe(e),a=Object.keys(o);function s(d){return`@media (min-width:${typeof e[d]=="number"?e[d]:d}${n})`}function l(d){return`@media (max-width:${(typeof e[d]=="number"?e[d]:d)-r/100}${n})`}function c(d,h){const p=a.indexOf(h);return`@media (min-width:${typeof e[d]=="number"?e[d]:d}${n}) and (max-width:${(p!==-1&&typeof e[a[p]]=="number"?e[a[p]]:h)-r/100}${n})`}function u(d){return a.indexOf(d)+1`@media (min-width:${Lj[t]}px)`};function Uo(t,e,n){const r=t.theme||{};if(Array.isArray(e)){const o=r.breakpoints||xV;return e.reduce((a,s,l)=>(a[o.up(o.keys[l])]=n(e[l]),a),{})}if(typeof e=="object"){const o=r.breakpoints||xV;return Object.keys(e).reduce((a,s)=>{if(Object.keys(o.values||Lj).indexOf(s)!==-1){const l=o.up(s);a[l]=n(e[s],s)}else{const l=s;a[l]=e[l]}return a},{})}return n(e)}function Ane(t={}){var e;return((e=t.keys)==null?void 0:e.reduce((r,i)=>{const o=t.up(i);return r[o]={},r},{}))||{}}function Rne(t,e){return t.reduce((n,r)=>{const i=n[r];return(!i||Object.keys(i).length===0)&&delete n[r],n},e)}function Ewe(t,...e){const n=Ane(t),r=[n,...e].reduce((i,o)=>Ii(i,o),{});return Rne(Object.keys(n),r)}function Pwe(t,e){if(typeof t!="object")return{};const n={},r=Object.keys(e);return Array.isArray(t)?r.forEach((i,o)=>{o{t[i]!=null&&(n[i]=!0)}),n}function Mh({values:t,breakpoints:e,base:n}){const r=n||Pwe(t,e),i=Object.keys(r);if(i.length===0)return t;let o;return i.reduce((a,s,l)=>(Array.isArray(t)?(a[s]=t[l]!=null?t[l]:t[o],o=l):typeof t=="object"?(a[s]=t[s]!=null?t[s]:t[o],o=s):a[s]=t,a),{})}function De(t){if(typeof t!="string")throw new Error(su(7));return t.charAt(0).toUpperCase()+t.slice(1)}const Mwe=Object.freeze(Object.defineProperty({__proto__:null,default:De},Symbol.toStringTag,{value:"Module"}));function Wg(t,e,n=!0){if(!e||typeof e!="string")return null;if(t&&t.vars&&n){const r=`vars.${e}`.split(".").reduce((i,o)=>i&&i[o]?i[o]:null,t);if(r!=null)return r}return e.split(".").reduce((r,i)=>r&&r[i]!=null?r[i]:null,t)}function vT(t,e,n,r=n){let i;return typeof t=="function"?i=t(n):Array.isArray(t)?i=t[n]||r:i=Wg(t,n)||r,e&&(i=e(i,r,t)),i}function kr(t){const{prop:e,cssProperty:n=t.prop,themeKey:r,transform:i}=t,o=a=>{if(a[e]==null)return null;const s=a[e],l=a.theme,c=Wg(l,r)||{};return Uo(a,s,f=>{let d=vT(c,i,f);return f===d&&typeof f=="string"&&(d=vT(c,i,`${e}${f==="default"?"":De(f)}`,f)),n===!1?d:{[n]:d}})};return o.propTypes={},o.filterProps=[e],o}function kwe(t){const e={};return n=>(e[n]===void 0&&(e[n]=t(n)),e[n])}const Awe={m:"margin",p:"padding"},Rwe={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},bV={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},Iwe=kwe(t=>{if(t.length>2)if(bV[t])t=bV[t];else return[t];const[e,n]=t.split(""),r=Awe[e],i=Rwe[n]||"";return Array.isArray(i)?i.map(o=>r+o):[r+i]}),$j=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Nj=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...$j,...Nj];function x1(t,e,n,r){var i;const o=(i=Wg(t,e,!1))!=null?i:n;return typeof o=="number"?a=>typeof a=="string"?a:o*a:Array.isArray(o)?a=>typeof a=="string"?a:o[a]:typeof o=="function"?o:()=>{}}function Fj(t){return x1(t,"spacing",8)}function Hh(t,e){if(typeof e=="string"||e==null)return e;const n=Math.abs(e),r=t(n);return e>=0?r:typeof r=="number"?-r:`-${r}`}function Dwe(t,e){return n=>t.reduce((r,i)=>(r[i]=Hh(e,n),r),{})}function Lwe(t,e,n,r){if(e.indexOf(n)===-1)return null;const i=Iwe(n),o=Dwe(i,r),a=t[n];return Uo(t,a,o)}function Ine(t,e){const n=Fj(t.theme);return Object.keys(t).map(r=>Lwe(t,e,r,n)).reduce(Rx,{})}function mr(t){return Ine(t,$j)}mr.propTypes={};mr.filterProps=$j;function gr(t){return Ine(t,Nj)}gr.propTypes={};gr.filterProps=Nj;function $we(t=8){if(t.mui)return t;const e=Fj({spacing:t}),n=(...r)=>(r.length===0?[1]:r).map(o=>{const a=e(o);return typeof a=="number"?`${a}px`:a}).join(" ");return n.mui=!0,n}function cM(...t){const e=t.reduce((r,i)=>(i.filterProps.forEach(o=>{r[o]=i}),r),{}),n=r=>Object.keys(r).reduce((i,o)=>e[o]?Rx(i,e[o](r)):i,{});return n.propTypes={},n.filterProps=t.reduce((r,i)=>r.concat(i.filterProps),[]),n}function ja(t){return typeof t!="number"?t:`${t}px solid`}function vs(t,e){return kr({prop:t,themeKey:"borders",transform:e})}const Nwe=vs("border",ja),Fwe=vs("borderTop",ja),jwe=vs("borderRight",ja),Bwe=vs("borderBottom",ja),zwe=vs("borderLeft",ja),Uwe=vs("borderColor"),Wwe=vs("borderTopColor"),Vwe=vs("borderRightColor"),Gwe=vs("borderBottomColor"),Hwe=vs("borderLeftColor"),qwe=vs("outline",ja),Xwe=vs("outlineColor"),uM=t=>{if(t.borderRadius!==void 0&&t.borderRadius!==null){const e=x1(t.theme,"shape.borderRadius",4),n=r=>({borderRadius:Hh(e,r)});return Uo(t,t.borderRadius,n)}return null};uM.propTypes={};uM.filterProps=["borderRadius"];cM(Nwe,Fwe,jwe,Bwe,zwe,Uwe,Wwe,Vwe,Gwe,Hwe,uM,qwe,Xwe);const fM=t=>{if(t.gap!==void 0&&t.gap!==null){const e=x1(t.theme,"spacing",8),n=r=>({gap:Hh(e,r)});return Uo(t,t.gap,n)}return null};fM.propTypes={};fM.filterProps=["gap"];const dM=t=>{if(t.columnGap!==void 0&&t.columnGap!==null){const e=x1(t.theme,"spacing",8),n=r=>({columnGap:Hh(e,r)});return Uo(t,t.columnGap,n)}return null};dM.propTypes={};dM.filterProps=["columnGap"];const hM=t=>{if(t.rowGap!==void 0&&t.rowGap!==null){const e=x1(t.theme,"spacing",8),n=r=>({rowGap:Hh(e,r)});return Uo(t,t.rowGap,n)}return null};hM.propTypes={};hM.filterProps=["rowGap"];const Qwe=kr({prop:"gridColumn"}),Ywe=kr({prop:"gridRow"}),Kwe=kr({prop:"gridAutoFlow"}),Zwe=kr({prop:"gridAutoColumns"}),Jwe=kr({prop:"gridAutoRows"}),eSe=kr({prop:"gridTemplateColumns"}),tSe=kr({prop:"gridTemplateRows"}),nSe=kr({prop:"gridTemplateAreas"}),rSe=kr({prop:"gridArea"});cM(fM,dM,hM,Qwe,Ywe,Kwe,Zwe,Jwe,eSe,tSe,nSe,rSe);function yg(t,e){return e==="grey"?e:t}const iSe=kr({prop:"color",themeKey:"palette",transform:yg}),oSe=kr({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:yg}),aSe=kr({prop:"backgroundColor",themeKey:"palette",transform:yg});cM(iSe,oSe,aSe);function ca(t){return t<=1&&t!==0?`${t*100}%`:t}const sSe=kr({prop:"width",transform:ca}),jj=t=>{if(t.maxWidth!==void 0&&t.maxWidth!==null){const e=n=>{var r,i;const o=((r=t.theme)==null||(r=r.breakpoints)==null||(r=r.values)==null?void 0:r[n])||Lj[n];return o?((i=t.theme)==null||(i=i.breakpoints)==null?void 0:i.unit)!=="px"?{maxWidth:`${o}${t.theme.breakpoints.unit}`}:{maxWidth:o}:{maxWidth:ca(n)}};return Uo(t,t.maxWidth,e)}return null};jj.filterProps=["maxWidth"];const lSe=kr({prop:"minWidth",transform:ca}),cSe=kr({prop:"height",transform:ca}),uSe=kr({prop:"maxHeight",transform:ca}),fSe=kr({prop:"minHeight",transform:ca});kr({prop:"size",cssProperty:"width",transform:ca});kr({prop:"size",cssProperty:"height",transform:ca});const dSe=kr({prop:"boxSizing"});cM(sSe,jj,lSe,cSe,uSe,fSe,dSe);const hSe={border:{themeKey:"borders",transform:ja},borderTop:{themeKey:"borders",transform:ja},borderRight:{themeKey:"borders",transform:ja},borderBottom:{themeKey:"borders",transform:ja},borderLeft:{themeKey:"borders",transform:ja},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:ja},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:uM},color:{themeKey:"palette",transform:yg},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:yg},backgroundColor:{themeKey:"palette",transform:yg},p:{style:gr},pt:{style:gr},pr:{style:gr},pb:{style:gr},pl:{style:gr},px:{style:gr},py:{style:gr},padding:{style:gr},paddingTop:{style:gr},paddingRight:{style:gr},paddingBottom:{style:gr},paddingLeft:{style:gr},paddingX:{style:gr},paddingY:{style:gr},paddingInline:{style:gr},paddingInlineStart:{style:gr},paddingInlineEnd:{style:gr},paddingBlock:{style:gr},paddingBlockStart:{style:gr},paddingBlockEnd:{style:gr},m:{style:mr},mt:{style:mr},mr:{style:mr},mb:{style:mr},ml:{style:mr},mx:{style:mr},my:{style:mr},margin:{style:mr},marginTop:{style:mr},marginRight:{style:mr},marginBottom:{style:mr},marginLeft:{style:mr},marginX:{style:mr},marginY:{style:mr},marginInline:{style:mr},marginInlineStart:{style:mr},marginInlineEnd:{style:mr},marginBlock:{style:mr},marginBlockStart:{style:mr},marginBlockEnd:{style:mr},displayPrint:{cssProperty:!1,transform:t=>({"@media print":{display:t}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:fM},rowGap:{style:hM},columnGap:{style:dM},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:ca},maxWidth:{style:jj},minWidth:{transform:ca},height:{transform:ca},maxHeight:{transform:ca},minHeight:{transform:ca},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}},b1=hSe;function pSe(...t){const e=t.reduce((r,i)=>r.concat(Object.keys(i)),[]),n=new Set(e);return t.every(r=>n.size===Object.keys(r).length)}function mSe(t,e){return typeof t=="function"?t(e):t}function Dne(){function t(n,r,i,o){const a={[n]:r,theme:i},s=o[n];if(!s)return{[n]:r};const{cssProperty:l=n,themeKey:c,transform:u,style:f}=s;if(r==null)return null;if(c==="typography"&&r==="inherit")return{[n]:r};const d=Wg(i,c)||{};return f?f(a):Uo(a,r,p=>{let m=vT(d,u,p);return p===m&&typeof p=="string"&&(m=vT(d,u,`${n}${p==="default"?"":De(p)}`,p)),l===!1?m:{[l]:m}})}function e(n){var r;const{sx:i,theme:o={}}=n||{};if(!i)return null;const a=(r=o.unstable_sxConfig)!=null?r:b1;function s(l){let c=l;if(typeof l=="function")c=l(o);else if(typeof l!="object")return l;if(!c)return null;const u=Ane(o.breakpoints),f=Object.keys(u);let d=u;return Object.keys(c).forEach(h=>{const p=mSe(c[h],o);if(p!=null)if(typeof p=="object")if(a[h])d=Rx(d,t(h,p,o,a));else{const m=Uo({theme:o},p,g=>({[h]:g}));pSe(m,p)?d[h]=e({sx:p,theme:o}):d=Rx(d,m)}else d=Rx(d,t(h,p,o,a))}),Rne(f,d)}return Array.isArray(i)?i.map(s):s(i)}return e}const Lne=Dne();Lne.filterProps=["sx"];const _1=Lne;function $ne(t,e){const n=this;return n.vars&&typeof n.getColorSchemeSelector=="function"?{[n.getColorSchemeSelector(t).replace(/(\[[^\]]+\])/,"*:where($1)")]:e}:n.palette.mode===t?e:{}}const gSe=["breakpoints","palette","spacing","shape"];function w1(t={},...e){const{breakpoints:n={},palette:r={},spacing:i,shape:o={}}=t,a=Ae(t,gSe),s=kne(n),l=$we(i);let c=Ii({breakpoints:s,direction:"ltr",components:{},palette:j({mode:"light"},r),spacing:l,shape:j({},Twe,o)},a);return c.applyStyles=$ne,c=e.reduce((u,f)=>Ii(u,f),c),c.unstable_sxConfig=j({},b1,a==null?void 0:a.unstable_sxConfig),c.unstable_sx=function(f){return _1({sx:f,theme:this})},c}const vSe=Object.freeze(Object.defineProperty({__proto__:null,default:w1,private_createBreakpoints:kne,unstable_applyStyles:$ne},Symbol.toStringTag,{value:"Module"}));function ySe(t){return Object.keys(t).length===0}function Bj(t=null){const e=M.useContext(y1);return!e||ySe(e)?t:e}const xSe=w1();function ld(t=xSe){return Bj(t)}function bSe({styles:t,themeId:e,defaultTheme:n={}}){const r=ld(n),i=typeof t=="function"?t(e&&r[e]||r):t;return w.jsx(Ene,{styles:i})}const _Se=["sx"],wSe=t=>{var e,n;const r={systemProps:{},otherProps:{}},i=(e=t==null||(n=t.theme)==null?void 0:n.unstable_sxConfig)!=null?e:b1;return Object.keys(t).forEach(o=>{i[o]?r.systemProps[o]=t[o]:r.otherProps[o]=t[o]}),r};function S1(t){const{sx:e}=t,n=Ae(t,_Se),{systemProps:r,otherProps:i}=wSe(n);let o;return Array.isArray(e)?o=[r,...e]:typeof e=="function"?o=(...a)=>{const s=e(...a);return Nc(s)?j({},r,s):r}:o=j({},r,e),j({},i,{sx:o})}const SSe=Object.freeze(Object.defineProperty({__proto__:null,default:_1,extendSxProp:S1,unstable_createStyleFunctionSx:Dne,unstable_defaultSxConfig:b1},Symbol.toStringTag,{value:"Module"})),_V=t=>t,OSe=()=>{let t=_V;return{configure(e){t=e},generate(e){return t(e)},reset(){t=_V}}},CSe=OSe(),zj=CSe;function Nne(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;es!=="theme"&&s!=="sx"&&s!=="as"})(_1);return M.forwardRef(function(l,c){const u=ld(n),f=S1(l),{className:d,component:h="div"}=f,p=Ae(f,TSe);return w.jsx(o,j({as:h,ref:c,className:ke(d,i?i(r):r),theme:e&&u[e]||u},p))})}const Fne={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function We(t,e,n="Mui"){const r=Fne[e];return r?`${n}-${r}`:`${zj.generate(t)}-${e}`}function Ve(t,e,n="Mui"){const r={};return e.forEach(i=>{r[i]=We(t,i,n)}),r}var jne={exports:{}},kn={};/** +`)};n.defaults=U,n.createLogger=C,n.logger=N,n.default=N,Object.defineProperty(n,"__esModule",{value:!0})})})(bL,bL.exports);var i1e=bL.exports;function nne(t){var e=function(r){var i=r.dispatch,o=r.getState;return function(a){return function(s){return typeof s=="function"?s(i,o,t):a(s)}}};return e}var rne=nne();rne.withExtraArgument=nne;const o1e=rne,a1e={black:"#000",white:"#fff"},Sb=a1e,s1e={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},Ku=s1e,l1e={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162"},ine=l1e,c1e={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},Zu=c1e,u1e={50:"#ede7f6",100:"#d1c4e9",200:"#b39ddb",300:"#9575cd",400:"#7e57c2",500:"#673ab7",600:"#5e35b1",700:"#512da8",800:"#4527a0",900:"#311b92",A100:"#b388ff",A200:"#7c4dff",A400:"#651fff",A700:"#6200ea"},f1e=u1e,d1e={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe"},one=d1e,h1e={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},Ju=h1e,p1e={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},ef=p1e,m1e={50:"#e0f7fa",100:"#b2ebf2",200:"#80deea",300:"#4dd0e1",400:"#26c6da",500:"#00bcd4",600:"#00acc1",700:"#0097a7",800:"#00838f",900:"#006064",A100:"#84ffff",A200:"#18ffff",A400:"#00e5ff",A700:"#00b8d4"},ane=m1e,g1e={50:"#e0f2f1",100:"#b2dfdb",200:"#80cbc4",300:"#4db6ac",400:"#26a69a",500:"#009688",600:"#00897b",700:"#00796b",800:"#00695c",900:"#004d40",A100:"#a7ffeb",A200:"#64ffda",A400:"#1de9b6",A700:"#00bfa5"},sne=g1e,v1e={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},Rc=v1e,y1e={50:"#f1f8e9",100:"#dcedc8",200:"#c5e1a5",300:"#aed581",400:"#9ccc65",500:"#8bc34a",600:"#7cb342",700:"#689f38",800:"#558b2f",900:"#33691e",A100:"#ccff90",A200:"#b2ff59",A400:"#76ff03",A700:"#64dd17"},x1e=y1e,b1e={50:"#f9fbe7",100:"#f0f4c3",200:"#e6ee9c",300:"#dce775",400:"#d4e157",500:"#cddc39",600:"#c0ca33",700:"#afb42b",800:"#9e9d24",900:"#827717",A100:"#f4ff81",A200:"#eeff41",A400:"#c6ff00",A700:"#aeea00"},lne=b1e,_1e={50:"#fffde7",100:"#fff9c4",200:"#fff59d",300:"#fff176",400:"#ffee58",500:"#ffeb3b",600:"#fdd835",700:"#fbc02d",800:"#f9a825",900:"#f57f17",A100:"#ffff8d",A200:"#ffff00",A400:"#ffea00",A700:"#ffd600"},cne=_1e,w1e={50:"#fff8e1",100:"#ffecb3",200:"#ffe082",300:"#ffd54f",400:"#ffca28",500:"#ffc107",600:"#ffb300",700:"#ffa000",800:"#ff8f00",900:"#ff6f00",A100:"#ffe57f",A200:"#ffd740",A400:"#ffc400",A700:"#ffab00"},une=w1e,S1e={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},Jd=S1e,Ph={50:"#fbe9e7",100:"#ffccbc",200:"#ffab91",300:"#ff8a65",400:"#ff7043",500:"#ff5722",600:"#f4511e",700:"#e64a19",800:"#d84315",900:"#bf360c",A100:"#ff9e80",A200:"#ff6e40",A400:"#ff3d00",A700:"#dd2c00"},O1e={50:"#efebe9",100:"#d7ccc8",200:"#bcaaa4",300:"#a1887f",400:"#8d6e63",500:"#795548",600:"#6d4c41",700:"#5d4037",800:"#4e342e",900:"#3e2723",A100:"#d7ccc8",A200:"#bcaaa4",A400:"#8d6e63",A700:"#5d4037"},fne=O1e,C1e={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},dne=C1e,T1e={50:"#eceff1",100:"#cfd8dc",200:"#b0bec5",300:"#90a4ae",400:"#78909c",500:"#607d8b",600:"#546e7a",700:"#455a64",800:"#37474f",900:"#263238",A100:"#cfd8dc",A200:"#b0bec5",A400:"#78909c",A700:"#455a64"},E1e=T1e;function su(t){let e="https://mui.com/production-error/?code="+t;for(let n=1;n0?Si(Vv,--zo):0,Ug--,$r===10&&(Ug=1,aM--),$r}function xa(){return $r=zo2||Cb($r)>3?"":" "}function V1e(t,e){for(;--e&&xa()&&!($r<48||$r>102||$r>57&&$r<65||$r>70&&$r<97););return v1(t,mC()+(e<6&&Bl()==32&&xa()==32))}function wL(t){for(;xa();)switch($r){case t:return zo;case 34:case 39:t!==34&&t!==39&&wL($r);break;case 40:t===41&&wL(t);break;case 92:xa();break}return zo}function G1e(t,e){for(;xa()&&t+$r!==57;)if(t+$r===84&&Bl()===47)break;return"/*"+v1(e,zo-1)+"*"+oM(t===47?t:xa())}function H1e(t){for(;!Cb(Bl());)xa();return v1(t,zo)}function q1e(t){return xne(vC("",null,null,null,[""],t=yne(t),0,[0],t))}function vC(t,e,n,r,i,o,a,s,l){for(var c=0,u=0,f=a,d=0,h=0,p=0,m=1,g=1,v=1,y=0,x="",b=i,_=o,S=r,O=x;g;)switch(p=y,y=xa()){case 40:if(p!=108&&Si(O,f-1)==58){_L(O+=gn(gC(y),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:O+=gC(y);break;case 9:case 10:case 13:case 32:O+=W1e(p);break;case 92:O+=V1e(mC()-1,7);continue;case 47:switch(Bl()){case 42:case 47:qw(X1e(G1e(xa(),mC()),e,n),l);break;default:O+="/"}break;case 123*m:s[c++]=gl(O)*v;case 125*m:case 59:case 0:switch(y){case 0:case 125:g=0;case 59+u:v==-1&&(O=gn(O,/\f/g,"")),h>0&&gl(O)-f&&qw(h>32?dV(O+";",r,n,f-1):dV(gn(O," ","")+";",r,n,f-2),l);break;case 59:O+=";";default:if(qw(S=fV(O,e,n,c,u,i,s,x,b=[],_=[],f),o),y===123)if(u===0)vC(O,e,S,S,b,o,f,s,_);else switch(d===99&&Si(O,3)===110?100:d){case 100:case 108:case 109:case 115:vC(t,S,S,r&&qw(fV(t,S,S,0,0,i,s,x,i,b=[],f),_),i,_,f,s,r?b:_);break;default:vC(O,S,S,S,[""],_,0,s,_)}}c=u=h=0,m=v=1,x=O="",f=a;break;case 58:f=1+gl(O),h=p;default:if(m<1){if(y==123)--m;else if(y==125&&m++==0&&U1e()==125)continue}switch(O+=oM(y),y*m){case 38:v=u>0?1:(O+="\f",-1);break;case 44:s[c++]=(gl(O)-1)*v,v=1;break;case 64:Bl()===45&&(O+=gC(xa())),d=Bl(),u=f=gl(x=O+=H1e(mC())),y++;break;case 45:p===45&&gl(O)==2&&(m=0)}}return o}function fV(t,e,n,r,i,o,a,s,l,c,u){for(var f=i-1,d=i===0?o:[""],h=Ij(d),p=0,m=0,g=0;p0?d[v]+" "+y:gn(y,/&\f/g,d[v])))&&(l[g++]=x);return sM(t,e,n,i===0?Aj:s,l,c,u)}function X1e(t,e,n){return sM(t,e,n,pne,oM(z1e()),Ob(t,2,-2),0)}function dV(t,e,n,r){return sM(t,e,n,Rj,Ob(t,0,r),Ob(t,r+1,-1),r)}function vg(t,e){for(var n="",r=Ij(t),i=0;i6)switch(Si(t,e+1)){case 109:if(Si(t,e+4)!==45)break;case 102:return gn(t,/(.+:)(.+)-([^]+)/,"$1"+pn+"$2-$3$1"+gT+(Si(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~_L(t,"stretch")?bne(gn(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(Si(t,e+1)!==115)break;case 6444:switch(Si(t,gl(t)-3-(~_L(t,"!important")&&10))){case 107:return gn(t,":",":"+pn)+t;case 101:return gn(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+pn+(Si(t,14)===45?"inline-":"")+"box$3$1"+pn+"$2$3$1"+Bi+"$2box$3")+t}break;case 5936:switch(Si(t,e+11)){case 114:return pn+t+Bi+gn(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return pn+t+Bi+gn(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return pn+t+Bi+gn(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return pn+t+Bi+t+t}return t}var rwe=function(e,n,r,i){if(e.length>-1&&!e.return)switch(e.type){case Rj:e.return=bne(e.value,e.length);break;case mne:return vg([s0(e,{value:gn(e.value,"@","@"+pn)})],i);case Aj:if(e.length)return B1e(e.props,function(o){switch(j1e(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return vg([s0(e,{props:[gn(o,/:(read-\w+)/,":"+gT+"$1")]})],i);case"::placeholder":return vg([s0(e,{props:[gn(o,/:(plac\w+)/,":"+pn+"input-$1")]}),s0(e,{props:[gn(o,/:(plac\w+)/,":"+gT+"$1")]}),s0(e,{props:[gn(o,/:(plac\w+)/,Bi+"input-$1")]})],i)}return""})}},iwe=[rwe],_ne=function(e){var n=e.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(m){var g=m.getAttribute("data-emotion");g.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var i=e.stylisPlugins||iwe,o={},a,s=[];a=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(m){for(var g=m.getAttribute("data-emotion").split(" "),v=1;v=4;++r,i-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(i){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var lwe={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},cwe=/[A-Z]|^ms/g,uwe=/_EMO_([^_]+?)_([^]*?)_EMO_/g,One=function(e){return e.charCodeAt(1)===45},pV=function(e){return e!=null&&typeof e!="boolean"},dA=hne(function(t){return One(t)?t:t.replace(cwe,"-$&").toLowerCase()}),mV=function(e,n){switch(e){case"animation":case"animationName":if(typeof n=="string")return n.replace(uwe,function(r,i,o){return vl={name:i,styles:o,next:vl},i})}return lwe[e]!==1&&!One(e)&&typeof n=="number"&&n!==0?n+"px":n};function Tb(t,e,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return vl={name:n.name,styles:n.styles,next:vl},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)vl={name:r.name,styles:r.styles,next:vl},r=r.next;var i=n.styles+";";return i}return fwe(t,e,n)}case"function":{if(t!==void 0){var o=vl,a=n(t);return vl=o,Tb(t,e,a)}break}}if(e==null)return n;var s=e[n];return s!==void 0?s:n}function fwe(t,e,n){var r="";if(Array.isArray(n))for(var i=0;i96?gwe:vwe},xV=function(e,n,r){var i;if(n){var o=n.shouldForwardProp;i=e.__emotion_forwardProp&&o?function(a){return e.__emotion_forwardProp(a)&&o(a)}:o}return typeof i!="function"&&r&&(i=e.__emotion_forwardProp),i},ywe=function(e){var n=e.cache,r=e.serialized,i=e.isStringTag;return wne(n,r,i),hwe(function(){return Sne(n,r,i)}),null},xwe=function t(e,n){var r=e.__emotion_real===e,i=r&&e.__emotion_base||e,o,a;n!==void 0&&(o=n.label,a=n.target);var s=xV(e,n,r),l=s||yV(i),c=!l("as");return function(){var u=arguments,f=r&&e.__emotion_styles!==void 0?e.__emotion_styles.slice(0):[];if(o!==void 0&&f.push("label:"+o+";"),u[0]==null||u[0].raw===void 0)f.push.apply(f,u);else{f.push(u[0][0]);for(var d=u.length,h=1;he(_we(i)?n:i):e;return w.jsx(mwe,{styles:r})}function Lj(t,e){return SL(t,e)}const kne=(t,e)=>{Array.isArray(t.__emotion_styles)&&(t.__emotion_styles=e(t.__emotion_styles))},wwe=Object.freeze(Object.defineProperty({__proto__:null,GlobalStyles:Mne,StyledEngineProvider:Pne,ThemeContext:y1,css:lM,default:Lj,internal_processStyles:kne,keyframes:Gv},Symbol.toStringTag,{value:"Module"}));function Nc(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function Ane(t){if(!Nc(t))return t;const e={};return Object.keys(t).forEach(n=>{e[n]=Ane(t[n])}),e}function Ii(t,e,n={clone:!0}){const r=n.clone?j({},t):t;return Nc(t)&&Nc(e)&&Object.keys(e).forEach(i=>{i!=="__proto__"&&(Nc(e[i])&&i in t&&Nc(t[i])?r[i]=Ii(t[i],e[i],n):n.clone?r[i]=Nc(e[i])?Ane(e[i]):e[i]:r[i]=e[i])}),r}const Swe=Object.freeze(Object.defineProperty({__proto__:null,default:Ii,isPlainObject:Nc},Symbol.toStringTag,{value:"Module"})),Owe=["values","unit","step"],Cwe=t=>{const e=Object.keys(t).map(n=>({key:n,val:t[n]}))||[];return e.sort((n,r)=>n.val-r.val),e.reduce((n,r)=>j({},n,{[r.key]:r.val}),{})};function Rne(t){const{values:e={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5}=t,i=Ae(t,Owe),o=Cwe(e),a=Object.keys(o);function s(d){return`@media (min-width:${typeof e[d]=="number"?e[d]:d}${n})`}function l(d){return`@media (max-width:${(typeof e[d]=="number"?e[d]:d)-r/100}${n})`}function c(d,h){const p=a.indexOf(h);return`@media (min-width:${typeof e[d]=="number"?e[d]:d}${n}) and (max-width:${(p!==-1&&typeof e[a[p]]=="number"?e[a[p]]:h)-r/100}${n})`}function u(d){return a.indexOf(d)+1`@media (min-width:${$j[t]}px)`};function Uo(t,e,n){const r=t.theme||{};if(Array.isArray(e)){const o=r.breakpoints||bV;return e.reduce((a,s,l)=>(a[o.up(o.keys[l])]=n(e[l]),a),{})}if(typeof e=="object"){const o=r.breakpoints||bV;return Object.keys(e).reduce((a,s)=>{if(Object.keys(o.values||$j).indexOf(s)!==-1){const l=o.up(s);a[l]=n(e[s],s)}else{const l=s;a[l]=e[l]}return a},{})}return n(e)}function Ine(t={}){var e;return((e=t.keys)==null?void 0:e.reduce((r,i)=>{const o=t.up(i);return r[o]={},r},{}))||{}}function Dne(t,e){return t.reduce((n,r)=>{const i=n[r];return(!i||Object.keys(i).length===0)&&delete n[r],n},e)}function Pwe(t,...e){const n=Ine(t),r=[n,...e].reduce((i,o)=>Ii(i,o),{});return Dne(Object.keys(n),r)}function Mwe(t,e){if(typeof t!="object")return{};const n={},r=Object.keys(e);return Array.isArray(t)?r.forEach((i,o)=>{o{t[i]!=null&&(n[i]=!0)}),n}function Mh({values:t,breakpoints:e,base:n}){const r=n||Mwe(t,e),i=Object.keys(r);if(i.length===0)return t;let o;return i.reduce((a,s,l)=>(Array.isArray(t)?(a[s]=t[l]!=null?t[l]:t[o],o=l):typeof t=="object"?(a[s]=t[s]!=null?t[s]:t[o],o=s):a[s]=t,a),{})}function De(t){if(typeof t!="string")throw new Error(su(7));return t.charAt(0).toUpperCase()+t.slice(1)}const kwe=Object.freeze(Object.defineProperty({__proto__:null,default:De},Symbol.toStringTag,{value:"Module"}));function Wg(t,e,n=!0){if(!e||typeof e!="string")return null;if(t&&t.vars&&n){const r=`vars.${e}`.split(".").reduce((i,o)=>i&&i[o]?i[o]:null,t);if(r!=null)return r}return e.split(".").reduce((r,i)=>r&&r[i]!=null?r[i]:null,t)}function vT(t,e,n,r=n){let i;return typeof t=="function"?i=t(n):Array.isArray(t)?i=t[n]||r:i=Wg(t,n)||r,e&&(i=e(i,r,t)),i}function kr(t){const{prop:e,cssProperty:n=t.prop,themeKey:r,transform:i}=t,o=a=>{if(a[e]==null)return null;const s=a[e],l=a.theme,c=Wg(l,r)||{};return Uo(a,s,f=>{let d=vT(c,i,f);return f===d&&typeof f=="string"&&(d=vT(c,i,`${e}${f==="default"?"":De(f)}`,f)),n===!1?d:{[n]:d}})};return o.propTypes={},o.filterProps=[e],o}function Awe(t){const e={};return n=>(e[n]===void 0&&(e[n]=t(n)),e[n])}const Rwe={m:"margin",p:"padding"},Iwe={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},_V={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},Dwe=Awe(t=>{if(t.length>2)if(_V[t])t=_V[t];else return[t];const[e,n]=t.split(""),r=Rwe[e],i=Iwe[n]||"";return Array.isArray(i)?i.map(o=>r+o):[r+i]}),Nj=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Fj=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...Nj,...Fj];function x1(t,e,n,r){var i;const o=(i=Wg(t,e,!1))!=null?i:n;return typeof o=="number"?a=>typeof a=="string"?a:o*a:Array.isArray(o)?a=>typeof a=="string"?a:o[a]:typeof o=="function"?o:()=>{}}function jj(t){return x1(t,"spacing",8)}function Hh(t,e){if(typeof e=="string"||e==null)return e;const n=Math.abs(e),r=t(n);return e>=0?r:typeof r=="number"?-r:`-${r}`}function Lwe(t,e){return n=>t.reduce((r,i)=>(r[i]=Hh(e,n),r),{})}function $we(t,e,n,r){if(e.indexOf(n)===-1)return null;const i=Dwe(n),o=Lwe(i,r),a=t[n];return Uo(t,a,o)}function Lne(t,e){const n=jj(t.theme);return Object.keys(t).map(r=>$we(t,e,r,n)).reduce(Rx,{})}function mr(t){return Lne(t,Nj)}mr.propTypes={};mr.filterProps=Nj;function gr(t){return Lne(t,Fj)}gr.propTypes={};gr.filterProps=Fj;function Nwe(t=8){if(t.mui)return t;const e=jj({spacing:t}),n=(...r)=>(r.length===0?[1]:r).map(o=>{const a=e(o);return typeof a=="number"?`${a}px`:a}).join(" ");return n.mui=!0,n}function cM(...t){const e=t.reduce((r,i)=>(i.filterProps.forEach(o=>{r[o]=i}),r),{}),n=r=>Object.keys(r).reduce((i,o)=>e[o]?Rx(i,e[o](r)):i,{});return n.propTypes={},n.filterProps=t.reduce((r,i)=>r.concat(i.filterProps),[]),n}function ja(t){return typeof t!="number"?t:`${t}px solid`}function vs(t,e){return kr({prop:t,themeKey:"borders",transform:e})}const Fwe=vs("border",ja),jwe=vs("borderTop",ja),Bwe=vs("borderRight",ja),zwe=vs("borderBottom",ja),Uwe=vs("borderLeft",ja),Wwe=vs("borderColor"),Vwe=vs("borderTopColor"),Gwe=vs("borderRightColor"),Hwe=vs("borderBottomColor"),qwe=vs("borderLeftColor"),Xwe=vs("outline",ja),Qwe=vs("outlineColor"),uM=t=>{if(t.borderRadius!==void 0&&t.borderRadius!==null){const e=x1(t.theme,"shape.borderRadius",4),n=r=>({borderRadius:Hh(e,r)});return Uo(t,t.borderRadius,n)}return null};uM.propTypes={};uM.filterProps=["borderRadius"];cM(Fwe,jwe,Bwe,zwe,Uwe,Wwe,Vwe,Gwe,Hwe,qwe,uM,Xwe,Qwe);const fM=t=>{if(t.gap!==void 0&&t.gap!==null){const e=x1(t.theme,"spacing",8),n=r=>({gap:Hh(e,r)});return Uo(t,t.gap,n)}return null};fM.propTypes={};fM.filterProps=["gap"];const dM=t=>{if(t.columnGap!==void 0&&t.columnGap!==null){const e=x1(t.theme,"spacing",8),n=r=>({columnGap:Hh(e,r)});return Uo(t,t.columnGap,n)}return null};dM.propTypes={};dM.filterProps=["columnGap"];const hM=t=>{if(t.rowGap!==void 0&&t.rowGap!==null){const e=x1(t.theme,"spacing",8),n=r=>({rowGap:Hh(e,r)});return Uo(t,t.rowGap,n)}return null};hM.propTypes={};hM.filterProps=["rowGap"];const Ywe=kr({prop:"gridColumn"}),Kwe=kr({prop:"gridRow"}),Zwe=kr({prop:"gridAutoFlow"}),Jwe=kr({prop:"gridAutoColumns"}),eSe=kr({prop:"gridAutoRows"}),tSe=kr({prop:"gridTemplateColumns"}),nSe=kr({prop:"gridTemplateRows"}),rSe=kr({prop:"gridTemplateAreas"}),iSe=kr({prop:"gridArea"});cM(fM,dM,hM,Ywe,Kwe,Zwe,Jwe,eSe,tSe,nSe,rSe,iSe);function yg(t,e){return e==="grey"?e:t}const oSe=kr({prop:"color",themeKey:"palette",transform:yg}),aSe=kr({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:yg}),sSe=kr({prop:"backgroundColor",themeKey:"palette",transform:yg});cM(oSe,aSe,sSe);function ca(t){return t<=1&&t!==0?`${t*100}%`:t}const lSe=kr({prop:"width",transform:ca}),Bj=t=>{if(t.maxWidth!==void 0&&t.maxWidth!==null){const e=n=>{var r,i;const o=((r=t.theme)==null||(r=r.breakpoints)==null||(r=r.values)==null?void 0:r[n])||$j[n];return o?((i=t.theme)==null||(i=i.breakpoints)==null?void 0:i.unit)!=="px"?{maxWidth:`${o}${t.theme.breakpoints.unit}`}:{maxWidth:o}:{maxWidth:ca(n)}};return Uo(t,t.maxWidth,e)}return null};Bj.filterProps=["maxWidth"];const cSe=kr({prop:"minWidth",transform:ca}),uSe=kr({prop:"height",transform:ca}),fSe=kr({prop:"maxHeight",transform:ca}),dSe=kr({prop:"minHeight",transform:ca});kr({prop:"size",cssProperty:"width",transform:ca});kr({prop:"size",cssProperty:"height",transform:ca});const hSe=kr({prop:"boxSizing"});cM(lSe,Bj,cSe,uSe,fSe,dSe,hSe);const pSe={border:{themeKey:"borders",transform:ja},borderTop:{themeKey:"borders",transform:ja},borderRight:{themeKey:"borders",transform:ja},borderBottom:{themeKey:"borders",transform:ja},borderLeft:{themeKey:"borders",transform:ja},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:ja},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:uM},color:{themeKey:"palette",transform:yg},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:yg},backgroundColor:{themeKey:"palette",transform:yg},p:{style:gr},pt:{style:gr},pr:{style:gr},pb:{style:gr},pl:{style:gr},px:{style:gr},py:{style:gr},padding:{style:gr},paddingTop:{style:gr},paddingRight:{style:gr},paddingBottom:{style:gr},paddingLeft:{style:gr},paddingX:{style:gr},paddingY:{style:gr},paddingInline:{style:gr},paddingInlineStart:{style:gr},paddingInlineEnd:{style:gr},paddingBlock:{style:gr},paddingBlockStart:{style:gr},paddingBlockEnd:{style:gr},m:{style:mr},mt:{style:mr},mr:{style:mr},mb:{style:mr},ml:{style:mr},mx:{style:mr},my:{style:mr},margin:{style:mr},marginTop:{style:mr},marginRight:{style:mr},marginBottom:{style:mr},marginLeft:{style:mr},marginX:{style:mr},marginY:{style:mr},marginInline:{style:mr},marginInlineStart:{style:mr},marginInlineEnd:{style:mr},marginBlock:{style:mr},marginBlockStart:{style:mr},marginBlockEnd:{style:mr},displayPrint:{cssProperty:!1,transform:t=>({"@media print":{display:t}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:fM},rowGap:{style:hM},columnGap:{style:dM},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:ca},maxWidth:{style:Bj},minWidth:{transform:ca},height:{transform:ca},maxHeight:{transform:ca},minHeight:{transform:ca},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}},b1=pSe;function mSe(...t){const e=t.reduce((r,i)=>r.concat(Object.keys(i)),[]),n=new Set(e);return t.every(r=>n.size===Object.keys(r).length)}function gSe(t,e){return typeof t=="function"?t(e):t}function $ne(){function t(n,r,i,o){const a={[n]:r,theme:i},s=o[n];if(!s)return{[n]:r};const{cssProperty:l=n,themeKey:c,transform:u,style:f}=s;if(r==null)return null;if(c==="typography"&&r==="inherit")return{[n]:r};const d=Wg(i,c)||{};return f?f(a):Uo(a,r,p=>{let m=vT(d,u,p);return p===m&&typeof p=="string"&&(m=vT(d,u,`${n}${p==="default"?"":De(p)}`,p)),l===!1?m:{[l]:m}})}function e(n){var r;const{sx:i,theme:o={}}=n||{};if(!i)return null;const a=(r=o.unstable_sxConfig)!=null?r:b1;function s(l){let c=l;if(typeof l=="function")c=l(o);else if(typeof l!="object")return l;if(!c)return null;const u=Ine(o.breakpoints),f=Object.keys(u);let d=u;return Object.keys(c).forEach(h=>{const p=gSe(c[h],o);if(p!=null)if(typeof p=="object")if(a[h])d=Rx(d,t(h,p,o,a));else{const m=Uo({theme:o},p,g=>({[h]:g}));mSe(m,p)?d[h]=e({sx:p,theme:o}):d=Rx(d,m)}else d=Rx(d,t(h,p,o,a))}),Dne(f,d)}return Array.isArray(i)?i.map(s):s(i)}return e}const Nne=$ne();Nne.filterProps=["sx"];const _1=Nne;function Fne(t,e){const n=this;return n.vars&&typeof n.getColorSchemeSelector=="function"?{[n.getColorSchemeSelector(t).replace(/(\[[^\]]+\])/,"*:where($1)")]:e}:n.palette.mode===t?e:{}}const vSe=["breakpoints","palette","spacing","shape"];function w1(t={},...e){const{breakpoints:n={},palette:r={},spacing:i,shape:o={}}=t,a=Ae(t,vSe),s=Rne(n),l=Nwe(i);let c=Ii({breakpoints:s,direction:"ltr",components:{},palette:j({mode:"light"},r),spacing:l,shape:j({},Ewe,o)},a);return c.applyStyles=Fne,c=e.reduce((u,f)=>Ii(u,f),c),c.unstable_sxConfig=j({},b1,a==null?void 0:a.unstable_sxConfig),c.unstable_sx=function(f){return _1({sx:f,theme:this})},c}const ySe=Object.freeze(Object.defineProperty({__proto__:null,default:w1,private_createBreakpoints:Rne,unstable_applyStyles:Fne},Symbol.toStringTag,{value:"Module"}));function xSe(t){return Object.keys(t).length===0}function zj(t=null){const e=M.useContext(y1);return!e||xSe(e)?t:e}const bSe=w1();function ld(t=bSe){return zj(t)}function _Se({styles:t,themeId:e,defaultTheme:n={}}){const r=ld(n),i=typeof t=="function"?t(e&&r[e]||r):t;return w.jsx(Mne,{styles:i})}const wSe=["sx"],SSe=t=>{var e,n;const r={systemProps:{},otherProps:{}},i=(e=t==null||(n=t.theme)==null?void 0:n.unstable_sxConfig)!=null?e:b1;return Object.keys(t).forEach(o=>{i[o]?r.systemProps[o]=t[o]:r.otherProps[o]=t[o]}),r};function S1(t){const{sx:e}=t,n=Ae(t,wSe),{systemProps:r,otherProps:i}=SSe(n);let o;return Array.isArray(e)?o=[r,...e]:typeof e=="function"?o=(...a)=>{const s=e(...a);return Nc(s)?j({},r,s):r}:o=j({},r,e),j({},i,{sx:o})}const OSe=Object.freeze(Object.defineProperty({__proto__:null,default:_1,extendSxProp:S1,unstable_createStyleFunctionSx:$ne,unstable_defaultSxConfig:b1},Symbol.toStringTag,{value:"Module"})),wV=t=>t,CSe=()=>{let t=wV;return{configure(e){t=e},generate(e){return t(e)},reset(){t=wV}}},TSe=CSe(),Uj=TSe;function jne(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;es!=="theme"&&s!=="sx"&&s!=="as"})(_1);return M.forwardRef(function(l,c){const u=ld(n),f=S1(l),{className:d,component:h="div"}=f,p=Ae(f,ESe);return w.jsx(o,j({as:h,ref:c,className:ke(d,i?i(r):r),theme:e&&u[e]||u},p))})}const Bne={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function We(t,e,n="Mui"){const r=Bne[e];return r?`${n}-${r}`:`${Uj.generate(t)}-${e}`}function Ve(t,e,n="Mui"){const r={};return e.forEach(i=>{r[i]=We(t,i,n)}),r}var zne={exports:{}},kn={};/** * @license React * react-is.production.min.js * @@ -83,7 +83,7 @@ const store = createStore( * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Uj=Symbol.for("react.element"),Wj=Symbol.for("react.portal"),pM=Symbol.for("react.fragment"),mM=Symbol.for("react.strict_mode"),gM=Symbol.for("react.profiler"),vM=Symbol.for("react.provider"),yM=Symbol.for("react.context"),PSe=Symbol.for("react.server_context"),xM=Symbol.for("react.forward_ref"),bM=Symbol.for("react.suspense"),_M=Symbol.for("react.suspense_list"),wM=Symbol.for("react.memo"),SM=Symbol.for("react.lazy"),MSe=Symbol.for("react.offscreen"),Bne;Bne=Symbol.for("react.module.reference");function ys(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case Uj:switch(t=t.type,t){case pM:case gM:case mM:case bM:case _M:return t;default:switch(t=t&&t.$$typeof,t){case PSe:case yM:case xM:case SM:case wM:case vM:return t;default:return e}}case Wj:return e}}}kn.ContextConsumer=yM;kn.ContextProvider=vM;kn.Element=Uj;kn.ForwardRef=xM;kn.Fragment=pM;kn.Lazy=SM;kn.Memo=wM;kn.Portal=Wj;kn.Profiler=gM;kn.StrictMode=mM;kn.Suspense=bM;kn.SuspenseList=_M;kn.isAsyncMode=function(){return!1};kn.isConcurrentMode=function(){return!1};kn.isContextConsumer=function(t){return ys(t)===yM};kn.isContextProvider=function(t){return ys(t)===vM};kn.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===Uj};kn.isForwardRef=function(t){return ys(t)===xM};kn.isFragment=function(t){return ys(t)===pM};kn.isLazy=function(t){return ys(t)===SM};kn.isMemo=function(t){return ys(t)===wM};kn.isPortal=function(t){return ys(t)===Wj};kn.isProfiler=function(t){return ys(t)===gM};kn.isStrictMode=function(t){return ys(t)===mM};kn.isSuspense=function(t){return ys(t)===bM};kn.isSuspenseList=function(t){return ys(t)===_M};kn.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===pM||t===gM||t===mM||t===bM||t===_M||t===MSe||typeof t=="object"&&t!==null&&(t.$$typeof===SM||t.$$typeof===wM||t.$$typeof===vM||t.$$typeof===yM||t.$$typeof===xM||t.$$typeof===Bne||t.getModuleId!==void 0)};kn.typeOf=ys;jne.exports=kn;var OL=jne.exports;const kSe=Nt(OL),ASe=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function zne(t){const e=`${t}`.match(ASe);return e&&e[1]||""}function Une(t,e=""){return t.displayName||t.name||zne(t)||e}function wV(t,e,n){const r=Une(e);return t.displayName||(r!==""?`${n}(${r})`:n)}function RSe(t){if(t!=null){if(typeof t=="string")return t;if(typeof t=="function")return Une(t,"Component");if(typeof t=="object")switch(t.$$typeof){case OL.ForwardRef:return wV(t,t.render,"ForwardRef");case OL.Memo:return wV(t,t.type,"memo");default:return}}}const ISe=Object.freeze(Object.defineProperty({__proto__:null,default:RSe,getFunctionName:zne},Symbol.toStringTag,{value:"Module"})),DSe=["ownerState"],LSe=["variants"],$Se=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function NSe(t){return Object.keys(t).length===0}function FSe(t){return typeof t=="string"&&t.charCodeAt(0)>96}function hA(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const jSe=w1(),BSe=t=>t&&t.charAt(0).toLowerCase()+t.slice(1);function Xw({defaultTheme:t,theme:e,themeId:n}){return NSe(e)?t:e[n]||e}function zSe(t){return t?(e,n)=>n[t]:null}function yC(t,e){let{ownerState:n}=e,r=Ae(e,DSe);const i=typeof t=="function"?t(j({ownerState:n},r)):t;if(Array.isArray(i))return i.flatMap(o=>yC(o,j({ownerState:n},r)));if(i&&typeof i=="object"&&Array.isArray(i.variants)){const{variants:o=[]}=i;let s=Ae(i,LSe);return o.forEach(l=>{let c=!0;typeof l.props=="function"?c=l.props(j({ownerState:n},r,n)):Object.keys(l.props).forEach(u=>{(n==null?void 0:n[u])!==l.props[u]&&r[u]!==l.props[u]&&(c=!1)}),c&&(Array.isArray(s)||(s=[s]),s.push(typeof l.style=="function"?l.style(j({ownerState:n},r,n)):l.style))}),s}return i}function USe(t={}){const{themeId:e,defaultTheme:n=jSe,rootShouldForwardProp:r=hA,slotShouldForwardProp:i=hA}=t,o=a=>_1(j({},a,{theme:Xw(j({},a,{defaultTheme:n,themeId:e}))}));return o.__mui_systemSx=!0,(a,s={})=>{Pne(a,_=>_.filter(S=>!(S!=null&&S.__mui_systemSx)));const{name:l,slot:c,skipVariantsResolver:u,skipSx:f,overridesResolver:d=zSe(BSe(c))}=s,h=Ae(s,$Se),p=u!==void 0?u:c&&c!=="Root"&&c!=="root"||!1,m=f||!1;let g,v=hA;c==="Root"||c==="root"?v=r:c?v=i:FSe(a)&&(v=void 0);const y=Dj(a,j({shouldForwardProp:v,label:g},h)),x=_=>typeof _=="function"&&_.__emotion_real!==_||Nc(_)?S=>yC(_,j({},S,{theme:Xw({theme:S.theme,defaultTheme:n,themeId:e})})):_,b=(_,...S)=>{let O=x(_);const C=S?S.map(x):[];l&&d&&C.push(I=>{const P=Xw(j({},I,{defaultTheme:n,themeId:e}));if(!P.components||!P.components[l]||!P.components[l].styleOverrides)return null;const R=P.components[l].styleOverrides,T={};return Object.entries(R).forEach(([L,z])=>{T[L]=yC(z,j({},I,{theme:P}))}),d(I,T)}),l&&!p&&C.push(I=>{var P;const R=Xw(j({},I,{defaultTheme:n,themeId:e})),T=R==null||(P=R.components)==null||(P=P[l])==null?void 0:P.variants;return yC({variants:T},j({},I,{theme:R}))}),m||C.push(o);const E=C.length-S.length;if(Array.isArray(_)&&E>0){const I=new Array(E).fill("");O=[..._,...I],O.raw=[..._.raw,...I]}const k=y(O,...C);return a.muiName&&(k.muiName=a.muiName),k};return y.withConfig&&(b.withConfig=y.withConfig),b}}const Li=USe();function OM(t,e){const n=j({},e);return Object.keys(t).forEach(r=>{if(r.toString().match(/^(components|slots)$/))n[r]=j({},t[r],n[r]);else if(r.toString().match(/^(componentsProps|slotProps)$/)){const i=t[r]||{},o=e[r];n[r]={},!o||!Object.keys(o)?n[r]=i:!i||!Object.keys(i)?n[r]=o:(n[r]=j({},o),Object.keys(i).forEach(a=>{n[r][a]=OM(i[a],o[a])}))}else n[r]===void 0&&(n[r]=t[r])}),n}function Wne(t){const{theme:e,name:n,props:r}=t;return!e||!e.components||!e.components[n]||!e.components[n].defaultProps?r:OM(e.components[n].defaultProps,r)}function Vne({props:t,name:e,defaultTheme:n,themeId:r}){let i=ld(n);return r&&(i=i[r]||i),Wne({theme:i,name:e,props:t})}const Vr=typeof window<"u"?M.useLayoutEffect:M.useEffect;function WSe(t,e,n,r,i){const[o,a]=M.useState(()=>i&&n?n(t).matches:r?r(t).matches:e);return Vr(()=>{let s=!0;if(!n)return;const l=n(t),c=()=>{s&&a(l.matches)};return c(),l.addListener(c),()=>{s=!1,l.removeListener(c)}},[t,n]),o}const Gne=M.useSyncExternalStore;function VSe(t,e,n,r,i){const o=M.useCallback(()=>e,[e]),a=M.useMemo(()=>{if(i&&n)return()=>n(t).matches;if(r!==null){const{matches:u}=r(t);return()=>u}return o},[o,t,r,i,n]),[s,l]=M.useMemo(()=>{if(n===null)return[o,()=>()=>{}];const u=n(t);return[()=>u.matches,f=>(u.addListener(f),()=>{u.removeListener(f)})]},[o,n,t]);return Gne(l,s,a)}function GSe(t,e={}){const n=Bj(),r=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:i=!1,matchMedia:o=r?window.matchMedia:null,ssrMatchMedia:a=null,noSsr:s=!1}=Wne({name:"MuiUseMediaQuery",props:e,theme:n});let l=typeof t=="function"?t(n):t;return l=l.replace(/^@media( ?)/m,""),(Gne!==void 0?VSe:WSe)(l,i,o,a,s)}function eh(t,e=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(t,n))}const HSe=Object.freeze(Object.defineProperty({__proto__:null,default:eh},Symbol.toStringTag,{value:"Module"}));function Vj(t,e=0,n=1){return eh(t,e,n)}function qSe(t){t=t.slice(1);const e=new RegExp(`.{1,${t.length>=6?2:1}}`,"g");let n=t.match(e);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,i)=>i<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function CM(t){if(t.type)return t;if(t.charAt(0)==="#")return CM(qSe(t));const e=t.indexOf("("),n=t.substring(0,e);if(["rgb","rgba","hsl","hsla","color"].indexOf(n)===-1)throw new Error(su(9,t));let r=t.substring(e+1,t.length-1),i;if(n==="color"){if(r=r.split(" "),i=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(i)===-1)throw new Error(su(10,i))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:i}}function Gj(t){const{type:e,colorSpace:n}=t;let{values:r}=t;return e.indexOf("rgb")!==-1?r=r.map((i,o)=>o<3?parseInt(i,10):i):e.indexOf("hsl")!==-1&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),e.indexOf("color")!==-1?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${e}(${r})`}function Wc(t,e){return t=CM(t),e=Vj(e),(t.type==="rgb"||t.type==="hsl")&&(t.type+="a"),t.type==="color"?t.values[3]=`/${e}`:t.values[3]=e,Gj(t)}function Hne(t,e){if(t=CM(t),e=Vj(e),t.type.indexOf("hsl")!==-1)t.values[2]*=1-e;else if(t.type.indexOf("rgb")!==-1||t.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)t.values[n]*=1-e;return Gj(t)}function qne(t,e){if(t=CM(t),e=Vj(e),t.type.indexOf("hsl")!==-1)t.values[2]+=(100-t.values[2])*e;else if(t.type.indexOf("rgb")!==-1)for(let n=0;n<3;n+=1)t.values[n]+=(255-t.values[n])*e;else if(t.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)t.values[n]+=(1-t.values[n])*e;return Gj(t)}function yT(...t){return t.reduce((e,n)=>n==null?e:function(...i){e.apply(this,i),n.apply(this,i)},()=>{})}function Hv(t,e=166){let n;function r(...i){const o=()=>{t.apply(this,i)};clearTimeout(n),n=setTimeout(o,e)}return r.clear=()=>{clearTimeout(n)},r}function XSe(t,e){return()=>null}function Ix(t,e){var n,r;return M.isValidElement(t)&&e.indexOf((n=t.type.muiName)!=null?n:(r=t.type)==null||(r=r._payload)==null||(r=r.value)==null?void 0:r.muiName)!==-1}function $n(t){return t&&t.ownerDocument||document}function ls(t){return $n(t).defaultView||window}function QSe(t,e){return()=>null}function xT(t,e){typeof t=="function"?t(e):t&&(t.current=e)}let SV=0;function YSe(t){const[e,n]=M.useState(t),r=t||e;return M.useEffect(()=>{e==null&&(SV+=1,n(`mui-${SV}`))},[e]),r}const OV=AD.useId;function cd(t){if(OV!==void 0){const e=OV();return t??e}return YSe(t)}function KSe(t,e,n,r,i){return null}function Hs({controlled:t,default:e,name:n,state:r="value"}){const{current:i}=M.useRef(t!==void 0),[o,a]=M.useState(e),s=i?t:o,l=M.useCallback(c=>{i||a(c)},[]);return[s,l]}function br(t){const e=M.useRef(t);return Vr(()=>{e.current=t}),M.useRef((...n)=>(0,e.current)(...n)).current}function Zt(...t){return M.useMemo(()=>t.every(e=>e==null)?null:e=>{t.forEach(n=>{xT(n,e)})},t)}const CV={};function ZSe(t,e){const n=M.useRef(CV);return n.current===CV&&(n.current=t(e)),n}const JSe=[];function eOe(t){M.useEffect(t,JSe)}class O1{constructor(){this.currentId=null,this.clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)},this.disposeEffect=()=>this.clear}static create(){return new O1}start(e,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},e)}}function mf(){const t=ZSe(O1.create).current;return eOe(t.disposeEffect),t}let TM=!0,CL=!1;const tOe=new O1,nOe={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function rOe(t){const{type:e,tagName:n}=t;return!!(n==="INPUT"&&nOe[e]&&!t.readOnly||n==="TEXTAREA"&&!t.readOnly||t.isContentEditable)}function iOe(t){t.metaKey||t.altKey||t.ctrlKey||(TM=!0)}function pA(){TM=!1}function oOe(){this.visibilityState==="hidden"&&CL&&(TM=!0)}function aOe(t){t.addEventListener("keydown",iOe,!0),t.addEventListener("mousedown",pA,!0),t.addEventListener("pointerdown",pA,!0),t.addEventListener("touchstart",pA,!0),t.addEventListener("visibilitychange",oOe,!0)}function sOe(t){const{target:e}=t;try{return e.matches(":focus-visible")}catch{}return TM||rOe(e)}function C1(){const t=M.useCallback(i=>{i!=null&&aOe(i.ownerDocument)},[]),e=M.useRef(!1);function n(){return e.current?(CL=!0,tOe.start(100,()=>{CL=!1}),e.current=!1,!0):!1}function r(i){return sOe(i)?(e.current=!0,!0):!1}return{isFocusVisibleRef:e,onFocus:r,onBlur:n,ref:t}}function Xne(t){const e=t.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}let Gp;function Qne(){if(Gp)return Gp;const t=document.createElement("div"),e=document.createElement("div");return e.style.width="10px",e.style.height="1px",t.appendChild(e),t.dir="rtl",t.style.fontSize="14px",t.style.width="4px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.overflow="scroll",document.body.appendChild(t),Gp="reverse",t.scrollLeft>0?Gp="default":(t.scrollLeft=1,t.scrollLeft===0&&(Gp="negative")),document.body.removeChild(t),Gp}function lOe(t,e){const n=t.scrollLeft;if(e!=="rtl")return n;switch(Qne()){case"negative":return t.scrollWidth-t.clientWidth+n;case"reverse":return t.scrollWidth-t.clientWidth-n;default:return n}}function cOe(t){return M.Children.toArray(t).filter(e=>M.isValidElement(e))}const uOe={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"},fOe=uOe;function Ue(t,e,n=void 0){const r={};return Object.keys(t).forEach(i=>{r[i]=t[i].reduce((o,a)=>{if(a){const s=e(a);s!==""&&o.push(s),n&&n[a]&&o.push(n[a])}return o},[]).join(" ")}),r}const dOe=M.createContext(null),Yne=dOe;function Hj(){return M.useContext(Yne)}const hOe=typeof Symbol=="function"&&Symbol.for,Kne=hOe?Symbol.for("mui.nested"):"__THEME_NESTED__";function pOe(t,e){return typeof e=="function"?e(t):j({},t,e)}function mOe(t){const{children:e,theme:n}=t,r=Hj(),i=M.useMemo(()=>{const o=r===null?n:pOe(r,n);return o!=null&&(o[Kne]=r!==null),o},[n,r]);return w.jsx(Yne.Provider,{value:i,children:e})}const gOe=["value"],Zne=M.createContext();function vOe(t){let{value:e}=t,n=Ae(t,gOe);return w.jsx(Zne.Provider,j({value:e??!0},n))}const T1=()=>{const t=M.useContext(Zne);return t??!1},TV={};function EV(t,e,n,r=!1){return M.useMemo(()=>{const i=t&&e[t]||e;if(typeof n=="function"){const o=n(i),a=t?j({},e,{[t]:o}):o;return r?()=>a:a}return t?j({},e,{[t]:n}):j({},e,n)},[t,e,n,r])}function yOe(t){const{children:e,theme:n,themeId:r}=t,i=Bj(TV),o=Hj()||TV,a=EV(r,i,n),s=EV(r,o,n,!0),l=a.direction==="rtl";return w.jsx(mOe,{theme:s,children:w.jsx(y1.Provider,{value:a,children:w.jsx(vOe,{value:l,children:e})})})}const xOe=["component","direction","spacing","divider","children","className","useFlexGap"],bOe=w1(),_Oe=Li("div",{name:"MuiStack",slot:"Root",overridesResolver:(t,e)=>e.root});function wOe(t){return Vne({props:t,name:"MuiStack",defaultTheme:bOe})}function SOe(t,e){const n=M.Children.toArray(t).filter(Boolean);return n.reduce((r,i,o)=>(r.push(i),o({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[t],COe=({ownerState:t,theme:e})=>{let n=j({display:"flex",flexDirection:"column"},Uo({theme:e},Mh({values:t.direction,breakpoints:e.breakpoints.values}),r=>({flexDirection:r})));if(t.spacing){const r=Fj(e),i=Object.keys(e.breakpoints.values).reduce((l,c)=>((typeof t.spacing=="object"&&t.spacing[c]!=null||typeof t.direction=="object"&&t.direction[c]!=null)&&(l[c]=!0),l),{}),o=Mh({values:t.direction,base:i}),a=Mh({values:t.spacing,base:i});typeof o=="object"&&Object.keys(o).forEach((l,c,u)=>{if(!o[l]){const d=c>0?o[u[c-1]]:"column";o[l]=d}}),n=Ii(n,Uo({theme:e},a,(l,c)=>t.useFlexGap?{gap:Hh(r,l)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${OOe(c?o[c]:t.direction)}`]:Hh(r,l)}}))}return n=Ewe(e.breakpoints,n),n};function TOe(t={}){const{createStyledComponent:e=_Oe,useThemeProps:n=wOe,componentName:r="MuiStack"}=t,i=()=>Ue({root:["root"]},l=>We(r,l),{}),o=e(COe);return M.forwardRef(function(l,c){const u=n(l),f=S1(u),{component:d="div",direction:h="column",spacing:p=0,divider:m,children:g,className:v,useFlexGap:y=!1}=f,x=Ae(f,xOe),b={direction:h,spacing:p,useFlexGap:y},_=i();return w.jsx(o,j({as:d,ownerState:b,ref:c,className:ke(_.root,v)},x,{children:m?SOe(g,m):g}))})}function EOe(t,e){return j({toolbar:{minHeight:56,[t.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[t.up("sm")]:{minHeight:64}}},e)}var Ar={},Jne={exports:{}};(function(t){function e(n){return n&&n.__esModule?n:{default:n}}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})(Jne);var ct=Jne.exports;const POe=Ea(E1e),MOe=Ea(HSe);var ere=ct;Object.defineProperty(Ar,"__esModule",{value:!0});var kt=Ar.alpha=ire;Ar.blend=zOe;Ar.colorChannel=void 0;var Eb=Ar.darken=Xj;Ar.decomposeColor=cs;var kOe=Ar.emphasize=ore,AOe=Ar.getContrastRatio=$Oe;Ar.getLuminance=bT;Ar.hexToRgb=tre;Ar.hslToRgb=rre;var Pb=Ar.lighten=Qj;Ar.private_safeAlpha=NOe;Ar.private_safeColorChannel=void 0;Ar.private_safeDarken=FOe;Ar.private_safeEmphasize=BOe;Ar.private_safeLighten=jOe;Ar.recomposeColor=qv;Ar.rgbToHex=LOe;var PV=ere(POe),ROe=ere(MOe);function qj(t,e=0,n=1){return(0,ROe.default)(t,e,n)}function tre(t){t=t.slice(1);const e=new RegExp(`.{1,${t.length>=6?2:1}}`,"g");let n=t.match(e);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,i)=>i<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function IOe(t){const e=t.toString(16);return e.length===1?`0${e}`:e}function cs(t){if(t.type)return t;if(t.charAt(0)==="#")return cs(tre(t));const e=t.indexOf("("),n=t.substring(0,e);if(["rgb","rgba","hsl","hsla","color"].indexOf(n)===-1)throw new Error((0,PV.default)(9,t));let r=t.substring(e+1,t.length-1),i;if(n==="color"){if(r=r.split(" "),i=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(i)===-1)throw new Error((0,PV.default)(10,i))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:i}}const nre=t=>{const e=cs(t);return e.values.slice(0,3).map((n,r)=>e.type.indexOf("hsl")!==-1&&r!==0?`${n}%`:n).join(" ")};Ar.colorChannel=nre;const DOe=(t,e)=>{try{return nre(t)}catch{return t}};Ar.private_safeColorChannel=DOe;function qv(t){const{type:e,colorSpace:n}=t;let{values:r}=t;return e.indexOf("rgb")!==-1?r=r.map((i,o)=>o<3?parseInt(i,10):i):e.indexOf("hsl")!==-1&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),e.indexOf("color")!==-1?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${e}(${r})`}function LOe(t){if(t.indexOf("#")===0)return t;const{values:e}=cs(t);return`#${e.map((n,r)=>IOe(r===3?Math.round(255*n):n)).join("")}`}function rre(t){t=cs(t);const{values:e}=t,n=e[0],r=e[1]/100,i=e[2]/100,o=r*Math.min(i,1-i),a=(c,u=(c+n/30)%12)=>i-o*Math.max(Math.min(u-3,9-u,1),-1);let s="rgb";const l=[Math.round(a(0)*255),Math.round(a(8)*255),Math.round(a(4)*255)];return t.type==="hsla"&&(s+="a",l.push(e[3])),qv({type:s,values:l})}function bT(t){t=cs(t);let e=t.type==="hsl"||t.type==="hsla"?cs(rre(t)).values:t.values;return e=e.map(n=>(t.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*e[0]+.7152*e[1]+.0722*e[2]).toFixed(3))}function $Oe(t,e){const n=bT(t),r=bT(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function ire(t,e){return t=cs(t),e=qj(e),(t.type==="rgb"||t.type==="hsl")&&(t.type+="a"),t.type==="color"?t.values[3]=`/${e}`:t.values[3]=e,qv(t)}function NOe(t,e,n){try{return ire(t,e)}catch{return t}}function Xj(t,e){if(t=cs(t),e=qj(e),t.type.indexOf("hsl")!==-1)t.values[2]*=1-e;else if(t.type.indexOf("rgb")!==-1||t.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)t.values[n]*=1-e;return qv(t)}function FOe(t,e,n){try{return Xj(t,e)}catch{return t}}function Qj(t,e){if(t=cs(t),e=qj(e),t.type.indexOf("hsl")!==-1)t.values[2]+=(100-t.values[2])*e;else if(t.type.indexOf("rgb")!==-1)for(let n=0;n<3;n+=1)t.values[n]+=(255-t.values[n])*e;else if(t.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)t.values[n]+=(1-t.values[n])*e;return qv(t)}function jOe(t,e,n){try{return Qj(t,e)}catch{return t}}function ore(t,e=.15){return bT(t)>.5?Xj(t,e):Qj(t,e)}function BOe(t,e,n){try{return ore(t,e)}catch{return t}}function zOe(t,e,n,r=1){const i=(l,c)=>Math.round((l**(1/r)*(1-n)+c**(1/r)*n)**r),o=cs(t),a=cs(e),s=[i(o.values[0],a.values[0]),i(o.values[1],a.values[1]),i(o.values[2],a.values[2])];return qv({type:"rgb",values:s})}const UOe=["mode","contrastThreshold","tonalOffset"],MV={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:Sb.white,default:Sb.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},mA={text:{primary:Sb.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:Sb.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function kV(t,e,n,r){const i=r.light||r,o=r.dark||r*1.5;t[e]||(t.hasOwnProperty(n)?t[e]=t[n]:e==="light"?t.light=Pb(t.main,i):e==="dark"&&(t.dark=Eb(t.main,o)))}function WOe(t="light"){return t==="dark"?{main:Ju[200],light:Ju[50],dark:Ju[400]}:{main:Ju[700],light:Ju[400],dark:Ju[800]}}function VOe(t="light"){return t==="dark"?{main:Zu[200],light:Zu[50],dark:Zu[400]}:{main:Zu[500],light:Zu[300],dark:Zu[700]}}function GOe(t="light"){return t==="dark"?{main:Ku[500],light:Ku[300],dark:Ku[700]}:{main:Ku[700],light:Ku[400],dark:Ku[800]}}function HOe(t="light"){return t==="dark"?{main:ef[400],light:ef[300],dark:ef[700]}:{main:ef[700],light:ef[500],dark:ef[900]}}function qOe(t="light"){return t==="dark"?{main:Rc[400],light:Rc[300],dark:Rc[700]}:{main:Rc[800],light:Rc[500],dark:Rc[900]}}function XOe(t="light"){return t==="dark"?{main:Jd[400],light:Jd[300],dark:Jd[700]}:{main:"#ed6c02",light:Jd[500],dark:Jd[900]}}function QOe(t){const{mode:e="light",contrastThreshold:n=3,tonalOffset:r=.2}=t,i=Ae(t,UOe),o=t.primary||WOe(e),a=t.secondary||VOe(e),s=t.error||GOe(e),l=t.info||HOe(e),c=t.success||qOe(e),u=t.warning||XOe(e);function f(m){return AOe(m,mA.text.primary)>=n?mA.text.primary:MV.text.primary}const d=({color:m,name:g,mainShade:v=500,lightShade:y=300,darkShade:x=700})=>{if(m=j({},m),!m.main&&m[v]&&(m.main=m[v]),!m.hasOwnProperty("main"))throw new Error(su(11,g?` (${g})`:"",v));if(typeof m.main!="string")throw new Error(su(12,g?` (${g})`:"",JSON.stringify(m.main)));return kV(m,"light",y,r),kV(m,"dark",x,r),m.contrastText||(m.contrastText=f(m.main)),m},h={dark:mA,light:MV};return Ii(j({common:j({},Sb),mode:e,primary:d({color:o,name:"primary"}),secondary:d({color:a,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:d({color:s,name:"error"}),warning:d({color:u,name:"warning"}),info:d({color:l,name:"info"}),success:d({color:c,name:"success"}),grey:une,contrastThreshold:n,getContrastText:f,augmentColor:d,tonalOffset:r},h[e]),i)}const YOe=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function KOe(t){return Math.round(t*1e5)/1e5}const AV={textTransform:"uppercase"},RV='"Roboto", "Helvetica", "Arial", sans-serif';function ZOe(t,e){const n=typeof e=="function"?e(t):e,{fontFamily:r=RV,fontSize:i=14,fontWeightLight:o=300,fontWeightRegular:a=400,fontWeightMedium:s=500,fontWeightBold:l=700,htmlFontSize:c=16,allVariants:u,pxToRem:f}=n,d=Ae(n,YOe),h=i/14,p=f||(v=>`${v/c*h}rem`),m=(v,y,x,b,_)=>j({fontFamily:r,fontWeight:v,fontSize:p(y),lineHeight:x},r===RV?{letterSpacing:`${KOe(b/y)}em`}:{},_,u),g={h1:m(o,96,1.167,-1.5),h2:m(o,60,1.2,-.5),h3:m(a,48,1.167,0),h4:m(a,34,1.235,.25),h5:m(a,24,1.334,0),h6:m(s,20,1.6,.15),subtitle1:m(a,16,1.75,.15),subtitle2:m(s,14,1.57,.1),body1:m(a,16,1.5,.15),body2:m(a,14,1.43,.15),button:m(s,14,1.75,.4,AV),caption:m(a,12,1.66,.4),overline:m(a,12,2.66,1,AV),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return Ii(j({htmlFontSize:c,pxToRem:p,fontFamily:r,fontSize:i,fontWeightLight:o,fontWeightRegular:a,fontWeightMedium:s,fontWeightBold:l},g),d,{clone:!1})}const JOe=.2,eCe=.14,tCe=.12;function ir(...t){return[`${t[0]}px ${t[1]}px ${t[2]}px ${t[3]}px rgba(0,0,0,${JOe})`,`${t[4]}px ${t[5]}px ${t[6]}px ${t[7]}px rgba(0,0,0,${eCe})`,`${t[8]}px ${t[9]}px ${t[10]}px ${t[11]}px rgba(0,0,0,${tCe})`].join(",")}const nCe=["none",ir(0,2,1,-1,0,1,1,0,0,1,3,0),ir(0,3,1,-2,0,2,2,0,0,1,5,0),ir(0,3,3,-2,0,3,4,0,0,1,8,0),ir(0,2,4,-1,0,4,5,0,0,1,10,0),ir(0,3,5,-1,0,5,8,0,0,1,14,0),ir(0,3,5,-1,0,6,10,0,0,1,18,0),ir(0,4,5,-2,0,7,10,1,0,2,16,1),ir(0,5,5,-3,0,8,10,1,0,3,14,2),ir(0,5,6,-3,0,9,12,1,0,3,16,2),ir(0,6,6,-3,0,10,14,1,0,4,18,3),ir(0,6,7,-4,0,11,15,1,0,4,20,3),ir(0,7,8,-4,0,12,17,2,0,5,22,4),ir(0,7,8,-4,0,13,19,2,0,5,24,4),ir(0,7,9,-4,0,14,21,2,0,5,26,4),ir(0,8,9,-5,0,15,22,2,0,6,28,5),ir(0,8,10,-5,0,16,24,2,0,6,30,5),ir(0,8,11,-5,0,17,26,2,0,6,32,5),ir(0,9,11,-5,0,18,28,2,0,7,34,6),ir(0,9,12,-6,0,19,29,2,0,7,36,6),ir(0,10,13,-6,0,20,31,3,0,8,38,7),ir(0,10,13,-6,0,21,33,3,0,8,40,7),ir(0,10,14,-6,0,22,35,3,0,8,42,7),ir(0,11,14,-7,0,23,36,3,0,9,44,8),ir(0,11,15,-7,0,24,38,3,0,9,46,8)],rCe=["duration","easing","delay"],iCe={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},are={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function IV(t){return`${Math.round(t)}ms`}function oCe(t){if(!t)return 0;const e=t/36;return Math.round((4+15*e**.25+e/5)*10)}function aCe(t){const e=j({},iCe,t.easing),n=j({},are,t.duration);return j({getAutoHeightDuration:oCe,create:(i=["all"],o={})=>{const{duration:a=n.standard,easing:s=e.easeInOut,delay:l=0}=o;return Ae(o,rCe),(Array.isArray(i)?i:[i]).map(c=>`${c} ${typeof a=="string"?a:IV(a)} ${s} ${typeof l=="string"?l:IV(l)}`).join(",")}},t,{easing:e,duration:n})}const sCe={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},lCe=sCe,cCe=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function Yj(t={},...e){const{mixins:n={},palette:r={},transitions:i={},typography:o={}}=t,a=Ae(t,cCe);if(t.vars)throw new Error(su(18));const s=QOe(r),l=w1(t);let c=Ii(l,{mixins:EOe(l.breakpoints,n),palette:s,shadows:nCe.slice(),typography:ZOe(s,o),transitions:aCe(i),zIndex:j({},lCe)});return c=Ii(c,a),c=e.reduce((u,f)=>Ii(u,f),c),c.unstable_sxConfig=j({},b1,a==null?void 0:a.unstable_sxConfig),c.unstable_sx=function(f){return _1({sx:f,theme:this})},c}const uCe=Yj(),EM=uCe;function Vo(){const t=ld(EM);return t[Gh]||t}function qe({props:t,name:e}){return Vne({props:t,name:e,defaultTheme:EM,themeId:Gh})}var E1={};const fCe=Ea(Kbe),dCe=Ea(Zbe),sre=Ea(_we),hCe=Ea(wwe),pCe=Ea(Mwe),mCe=Ea(ISe),gCe=Ea(vSe),vCe=Ea(SSe);var Xv=ct;Object.defineProperty(E1,"__esModule",{value:!0});var yCe=E1.default=ACe;E1.shouldForwardProp=xC;E1.systemDefaultTheme=void 0;var Na=Xv(fCe),TL=Xv(dCe),DV=CCe(sre),xCe=hCe;Xv(pCe);Xv(mCe);var bCe=Xv(gCe),_Ce=Xv(vCe);const wCe=["ownerState"],SCe=["variants"],OCe=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function lre(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(lre=function(r){return r?n:e})(t)}function CCe(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=lre(e);if(n&&n.has(t))return n.get(t);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&Object.prototype.hasOwnProperty.call(t,o)){var a=i?Object.getOwnPropertyDescriptor(t,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=t[o]}return r.default=t,n&&n.set(t,r),r}function TCe(t){return Object.keys(t).length===0}function ECe(t){return typeof t=="string"&&t.charCodeAt(0)>96}function xC(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const PCe=E1.systemDefaultTheme=(0,bCe.default)(),MCe=t=>t&&t.charAt(0).toLowerCase()+t.slice(1);function Qw({defaultTheme:t,theme:e,themeId:n}){return TCe(e)?t:e[n]||e}function kCe(t){return t?(e,n)=>n[t]:null}function bC(t,e){let{ownerState:n}=e,r=(0,TL.default)(e,wCe);const i=typeof t=="function"?t((0,Na.default)({ownerState:n},r)):t;if(Array.isArray(i))return i.flatMap(o=>bC(o,(0,Na.default)({ownerState:n},r)));if(i&&typeof i=="object"&&Array.isArray(i.variants)){const{variants:o=[]}=i;let s=(0,TL.default)(i,SCe);return o.forEach(l=>{let c=!0;typeof l.props=="function"?c=l.props((0,Na.default)({ownerState:n},r,n)):Object.keys(l.props).forEach(u=>{(n==null?void 0:n[u])!==l.props[u]&&r[u]!==l.props[u]&&(c=!1)}),c&&(Array.isArray(s)||(s=[s]),s.push(typeof l.style=="function"?l.style((0,Na.default)({ownerState:n},r,n)):l.style))}),s}return i}function ACe(t={}){const{themeId:e,defaultTheme:n=PCe,rootShouldForwardProp:r=xC,slotShouldForwardProp:i=xC}=t,o=a=>(0,_Ce.default)((0,Na.default)({},a,{theme:Qw((0,Na.default)({},a,{defaultTheme:n,themeId:e}))}));return o.__mui_systemSx=!0,(a,s={})=>{(0,DV.internal_processStyles)(a,_=>_.filter(S=>!(S!=null&&S.__mui_systemSx)));const{name:l,slot:c,skipVariantsResolver:u,skipSx:f,overridesResolver:d=kCe(MCe(c))}=s,h=(0,TL.default)(s,OCe),p=u!==void 0?u:c&&c!=="Root"&&c!=="root"||!1,m=f||!1;let g,v=xC;c==="Root"||c==="root"?v=r:c?v=i:ECe(a)&&(v=void 0);const y=(0,DV.default)(a,(0,Na.default)({shouldForwardProp:v,label:g},h)),x=_=>typeof _=="function"&&_.__emotion_real!==_||(0,xCe.isPlainObject)(_)?S=>bC(_,(0,Na.default)({},S,{theme:Qw({theme:S.theme,defaultTheme:n,themeId:e})})):_,b=(_,...S)=>{let O=x(_);const C=S?S.map(x):[];l&&d&&C.push(I=>{const P=Qw((0,Na.default)({},I,{defaultTheme:n,themeId:e}));if(!P.components||!P.components[l]||!P.components[l].styleOverrides)return null;const R=P.components[l].styleOverrides,T={};return Object.entries(R).forEach(([L,z])=>{T[L]=bC(z,(0,Na.default)({},I,{theme:P}))}),d(I,T)}),l&&!p&&C.push(I=>{var P;const R=Qw((0,Na.default)({},I,{defaultTheme:n,themeId:e})),T=R==null||(P=R.components)==null||(P=P[l])==null?void 0:P.variants;return bC({variants:T},(0,Na.default)({},I,{theme:R}))}),m||C.push(o);const E=C.length-S.length;if(Array.isArray(_)&&E>0){const I=new Array(E).fill("");O=[..._,...I],O.raw=[..._.raw,...I]}const k=y(O,...C);return a.muiName&&(k.muiName=a.muiName),k};return y.withConfig&&(b.withConfig=y.withConfig),b}}function PM(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const RCe=t=>PM(t)&&t!=="classes",di=RCe,we=yCe({themeId:Gh,defaultTheme:EM,rootShouldForwardProp:di}),ICe=["theme"];function DCe(t){let{theme:e}=t,n=Ae(t,ICe);const r=e[Gh];return w.jsx(yOe,j({},n,{themeId:r?Gh:void 0,theme:r||e}))}const LV=t=>{let e;return t<1?e=5.11916*t**2:e=4.5*Math.log(t+1)+2,(e/100).toFixed(2)};function LCe(t){return We("MuiSvgIcon",t)}Ve("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const $Ce=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],NCe=t=>{const{color:e,fontSize:n,classes:r}=t,i={root:["root",e!=="inherit"&&`color${De(e)}`,`fontSize${De(n)}`]};return Ue(i,LCe,r)},FCe=we("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color!=="inherit"&&e[`color${De(n.color)}`],e[`fontSize${De(n.fontSize)}`]]}})(({theme:t,ownerState:e})=>{var n,r,i,o,a,s,l,c,u,f,d,h,p;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:e.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(n=t.transitions)==null||(r=n.create)==null?void 0:r.call(n,"fill",{duration:(i=t.transitions)==null||(i=i.duration)==null?void 0:i.shorter}),fontSize:{inherit:"inherit",small:((o=t.typography)==null||(a=o.pxToRem)==null?void 0:a.call(o,20))||"1.25rem",medium:((s=t.typography)==null||(l=s.pxToRem)==null?void 0:l.call(s,24))||"1.5rem",large:((c=t.typography)==null||(u=c.pxToRem)==null?void 0:u.call(c,35))||"2.1875rem"}[e.fontSize],color:(f=(d=(t.vars||t).palette)==null||(d=d[e.color])==null?void 0:d.main)!=null?f:{action:(h=(t.vars||t).palette)==null||(h=h.action)==null?void 0:h.active,disabled:(p=(t.vars||t).palette)==null||(p=p.action)==null?void 0:p.disabled,inherit:void 0}[e.color]}}),EL=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiSvgIcon"}),{children:i,className:o,color:a="inherit",component:s="svg",fontSize:l="medium",htmlColor:c,inheritViewBox:u=!1,titleAccess:f,viewBox:d="0 0 24 24"}=r,h=Ae(r,$Ce),p=M.isValidElement(i)&&i.type==="svg",m=j({},r,{color:a,component:s,fontSize:l,instanceFontSize:e.fontSize,inheritViewBox:u,viewBox:d,hasSvgAsChild:p}),g={};u||(g.viewBox=d);const v=NCe(m);return w.jsxs(FCe,j({as:s,className:ke(v.root,o),focusable:"false",color:c,"aria-hidden":f?void 0:!0,role:f?"img":void 0,ref:n},g,h,p&&i.props,{ownerState:m,children:[p?i.props.children:i,f?w.jsx("title",{children:f}):null]}))});EL.muiName="SvgIcon";function ti(t,e){function n(r,i){return w.jsx(EL,j({"data-testid":`${e}Icon`,ref:i},r,{children:t}))}return n.muiName=EL.muiName,M.memo(M.forwardRef(n))}const jCe={configure:t=>{zj.configure(t)}},BCe=Object.freeze(Object.defineProperty({__proto__:null,capitalize:De,createChainedFunction:yT,createSvgIcon:ti,debounce:Hv,deprecatedPropType:XSe,isMuiElement:Ix,ownerDocument:$n,ownerWindow:ls,requirePropFactory:QSe,setRef:xT,unstable_ClassNameGenerator:jCe,unstable_useEnhancedEffect:Vr,unstable_useId:cd,unsupportedProp:KSe,useControlled:Hs,useEventCallback:br,useForkRef:Zt,useIsFocusVisible:C1},Symbol.toStringTag,{value:"Module"}));function Kj(t){return qe}function _T(t,e){return _T=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},_T(t,e)}function P1(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,_T(t,e)}function zCe(t,e){return t.classList?!!e&&t.classList.contains(e):(" "+(t.className.baseVal||t.className)+" ").indexOf(" "+e+" ")!==-1}function UCe(t,e){t.classList?t.classList.add(e):zCe(t,e)||(typeof t.className=="string"?t.className=t.className+" "+e:t.setAttribute("class",(t.className&&t.className.baseVal||"")+" "+e))}function $V(t,e){return t.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function WCe(t,e){t.classList?t.classList.remove(e):typeof t.className=="string"?t.className=$V(t.className,e):t.setAttribute("class",$V(t.className&&t.className.baseVal||"",e))}const NV={disabled:!1},wT=ue.createContext(null);var cre=function(e){return e.scrollTop},rx="unmounted",Vd="exited",Gd="entering",Mm="entered",PL="exiting",yu=function(t){P1(e,t);function e(r,i){var o;o=t.call(this,r,i)||this;var a=i,s=a&&!a.isMounting?r.enter:r.appear,l;return o.appearStatus=null,r.in?s?(l=Vd,o.appearStatus=Gd):l=Mm:r.unmountOnExit||r.mountOnEnter?l=rx:l=Vd,o.state={status:l},o.nextCallback=null,o}e.getDerivedStateFromProps=function(i,o){var a=i.in;return a&&o.status===rx?{status:Vd}:null};var n=e.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var o=null;if(i!==this.props){var a=this.state.status;this.props.in?a!==Gd&&a!==Mm&&(o=Gd):(a===Gd||a===Mm)&&(o=PL)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,o,a,s;return o=a=s=i,i!=null&&typeof i!="number"&&(o=i.exit,a=i.enter,s=i.appear!==void 0?i.appear:a),{exit:o,enter:a,appear:s}},n.updateStatus=function(i,o){if(i===void 0&&(i=!1),o!==null)if(this.cancelNextCallback(),o===Gd){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:Hw.findDOMNode(this);a&&cre(a)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Vd&&this.setState({status:rx})},n.performEnter=function(i){var o=this,a=this.props.enter,s=this.context?this.context.isMounting:i,l=this.props.nodeRef?[s]:[Hw.findDOMNode(this),s],c=l[0],u=l[1],f=this.getTimeouts(),d=s?f.appear:f.enter;if(!i&&!a||NV.disabled){this.safeSetState({status:Mm},function(){o.props.onEntered(c)});return}this.props.onEnter(c,u),this.safeSetState({status:Gd},function(){o.props.onEntering(c,u),o.onTransitionEnd(d,function(){o.safeSetState({status:Mm},function(){o.props.onEntered(c,u)})})})},n.performExit=function(){var i=this,o=this.props.exit,a=this.getTimeouts(),s=this.props.nodeRef?void 0:Hw.findDOMNode(this);if(!o||NV.disabled){this.safeSetState({status:Vd},function(){i.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:PL},function(){i.props.onExiting(s),i.onTransitionEnd(a.exit,function(){i.safeSetState({status:Vd},function(){i.props.onExited(s)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,o){o=this.setNextCallback(o),this.setState(i,o)},n.setNextCallback=function(i){var o=this,a=!0;return this.nextCallback=function(s){a&&(a=!1,o.nextCallback=null,i(s))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(i,o){this.setNextCallback(o);var a=this.props.nodeRef?this.props.nodeRef.current:Hw.findDOMNode(this),s=i==null&&!this.props.addEndListener;if(!a||s){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],c=l[0],u=l[1];this.props.addEndListener(c,u)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===rx)return null;var o=this.props,a=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var s=Ae(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return ue.createElement(wT.Provider,{value:null},typeof a=="function"?a(i,s):ue.cloneElement(ue.Children.only(a),s))},e}(ue.Component);yu.contextType=wT;yu.propTypes={};function Hp(){}yu.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Hp,onEntering:Hp,onEntered:Hp,onExit:Hp,onExiting:Hp,onExited:Hp};yu.UNMOUNTED=rx;yu.EXITED=Vd;yu.ENTERING=Gd;yu.ENTERED=Mm;yu.EXITING=PL;const M1=yu;var VCe=function(e,n){return e&&n&&n.split(" ").forEach(function(r){return UCe(e,r)})},gA=function(e,n){return e&&n&&n.split(" ").forEach(function(r){return WCe(e,r)})},Zj=function(t){P1(e,t);function e(){for(var r,i=arguments.length,o=new Array(i),a=0;at.scrollTop;function Xf(t,e){var n,r;const{timeout:i,easing:o,style:a={}}=t;return{duration:(n=a.transitionDuration)!=null?n:typeof i=="number"?i:i[e.mode]||0,easing:(r=a.transitionTimingFunction)!=null?r:typeof o=="object"?o[e.mode]:o,delay:a.transitionDelay}}function KCe(t){return We("MuiCollapse",t)}Ve("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const ZCe=["addEndListener","children","className","collapsedSize","component","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","orientation","style","timeout","TransitionComponent"],JCe=t=>{const{orientation:e,classes:n}=t,r={root:["root",`${e}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${e}`],wrapperInner:["wrapperInner",`${e}`]};return Ue(r,KCe,n)},eTe=we("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.orientation],n.state==="entered"&&e.entered,n.state==="exited"&&!n.in&&n.collapsedSize==="0px"&&e.hidden]}})(({theme:t,ownerState:e})=>j({height:0,overflow:"hidden",transition:t.transitions.create("height")},e.orientation==="horizontal"&&{height:"auto",width:0,transition:t.transitions.create("width")},e.state==="entered"&&j({height:"auto",overflow:"visible"},e.orientation==="horizontal"&&{width:"auto"}),e.state==="exited"&&!e.in&&e.collapsedSize==="0px"&&{visibility:"hidden"})),tTe=we("div",{name:"MuiCollapse",slot:"Wrapper",overridesResolver:(t,e)=>e.wrapper})(({ownerState:t})=>j({display:"flex",width:"100%"},t.orientation==="horizontal"&&{width:"auto",height:"100%"})),nTe=we("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:(t,e)=>e.wrapperInner})(({ownerState:t})=>j({width:"100%"},t.orientation==="horizontal"&&{width:"auto",height:"100%"})),ure=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiCollapse"}),{addEndListener:i,children:o,className:a,collapsedSize:s="0px",component:l,easing:c,in:u,onEnter:f,onEntered:d,onEntering:h,onExit:p,onExited:m,onExiting:g,orientation:v="vertical",style:y,timeout:x=are.standard,TransitionComponent:b=M1}=r,_=Ae(r,ZCe),S=j({},r,{orientation:v,collapsedSize:s}),O=JCe(S),C=Vo(),E=mf(),k=M.useRef(null),I=M.useRef(),P=typeof s=="number"?`${s}px`:s,R=v==="horizontal",T=R?"width":"height",L=M.useRef(null),z=Zt(n,L),B=K=>se=>{if(K){const te=L.current;se===void 0?K(te):K(te,se)}},W=()=>k.current?k.current[R?"clientWidth":"clientHeight"]:0,U=B((K,se)=>{k.current&&R&&(k.current.style.position="absolute"),K.style[T]=P,f&&f(K,se)}),N=B((K,se)=>{const te=W();k.current&&R&&(k.current.style.position="");const{duration:J,easing:pe}=Xf({style:y,timeout:x,easing:c},{mode:"enter"});if(x==="auto"){const be=C.transitions.getAutoHeightDuration(te);K.style.transitionDuration=`${be}ms`,I.current=be}else K.style.transitionDuration=typeof J=="string"?J:`${J}ms`;K.style[T]=`${te}px`,K.style.transitionTimingFunction=pe,h&&h(K,se)}),$=B((K,se)=>{K.style[T]="auto",d&&d(K,se)}),D=B(K=>{K.style[T]=`${W()}px`,p&&p(K)}),A=B(m),q=B(K=>{const se=W(),{duration:te,easing:J}=Xf({style:y,timeout:x,easing:c},{mode:"exit"});if(x==="auto"){const pe=C.transitions.getAutoHeightDuration(se);K.style.transitionDuration=`${pe}ms`,I.current=pe}else K.style.transitionDuration=typeof te=="string"?te:`${te}ms`;K.style[T]=P,K.style.transitionTimingFunction=J,g&&g(K)}),Y=K=>{x==="auto"&&E.start(I.current||0,K),i&&i(L.current,K)};return w.jsx(b,j({in:u,onEnter:U,onEntered:$,onEntering:N,onExit:D,onExited:A,onExiting:q,addEndListener:Y,nodeRef:L,timeout:x==="auto"?null:x},_,{children:(K,se)=>w.jsx(eTe,j({as:l,className:ke(O.root,a,{entered:O.entered,exited:!u&&P==="0px"&&O.hidden}[K]),style:j({[R?"minWidth":"minHeight"]:P},y),ref:z},se,{ownerState:j({},S,{state:K}),children:w.jsx(tTe,{ownerState:j({},S,{state:K}),className:O.wrapper,ref:k,children:w.jsx(nTe,{ownerState:j({},S,{state:K}),className:O.wrapperInner,children:o})})}))}))});ure.muiSupportAuto=!0;const fre=ure;function rTe(t){return We("MuiPaper",t)}Ve("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const iTe=["className","component","elevation","square","variant"],oTe=t=>{const{square:e,elevation:n,variant:r,classes:i}=t,o={root:["root",r,!e&&"rounded",r==="elevation"&&`elevation${n}`]};return Ue(o,rTe,i)},aTe=we("div",{name:"MuiPaper",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],!n.square&&e.rounded,n.variant==="elevation"&&e[`elevation${n.elevation}`]]}})(({theme:t,ownerState:e})=>{var n;return j({backgroundColor:(t.vars||t).palette.background.paper,color:(t.vars||t).palette.text.primary,transition:t.transitions.create("box-shadow")},!e.square&&{borderRadius:t.shape.borderRadius},e.variant==="outlined"&&{border:`1px solid ${(t.vars||t).palette.divider}`},e.variant==="elevation"&&j({boxShadow:(t.vars||t).shadows[e.elevation]},!t.vars&&t.palette.mode==="dark"&&{backgroundImage:`linear-gradient(${kt("#fff",LV(e.elevation))}, ${kt("#fff",LV(e.elevation))})`},t.vars&&{backgroundImage:(n=t.vars.overlays)==null?void 0:n[e.elevation]}))}),sTe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiPaper"}),{className:i,component:o="div",elevation:a=1,square:s=!1,variant:l="elevation"}=r,c=Ae(r,iTe),u=j({},r,{component:o,elevation:a,square:s,variant:l}),f=oTe(u);return w.jsx(aTe,j({as:o,ownerState:u,className:ke(f.root,i),ref:n},c))}),Go=sTe;function zl(t){return typeof t=="string"}function Hm(t,e,n){return t===void 0||zl(t)?e:j({},e,{ownerState:j({},e.ownerState,n)})}function lTe(t,e,n=(r,i)=>r===i){return t.length===e.length&&t.every((r,i)=>n(r,e[i]))}const cTe={disableDefaultClasses:!1},uTe=M.createContext(cTe);function fTe(t){const{disableDefaultClasses:e}=M.useContext(uTe);return n=>e?"":t(n)}function kh(t,e=[]){if(t===void 0)return{};const n={};return Object.keys(t).filter(r=>r.match(/^on[A-Z]/)&&typeof t[r]=="function"&&!e.includes(r)).forEach(r=>{n[r]=t[r]}),n}function dre(t,e,n){return typeof t=="function"?t(e,n):t}function FV(t){if(t===void 0)return{};const e={};return Object.keys(t).filter(n=>!(n.match(/^on[A-Z]/)&&typeof t[n]=="function")).forEach(n=>{e[n]=t[n]}),e}function hre(t){const{getSlotProps:e,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:o}=t;if(!e){const h=ke(n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),p=j({},n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),m=j({},n,i,r);return h.length>0&&(m.className=h),Object.keys(p).length>0&&(m.style=p),{props:m,internalRef:void 0}}const a=kh(j({},i,r)),s=FV(r),l=FV(i),c=e(a),u=ke(c==null?void 0:c.className,n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),f=j({},c==null?void 0:c.style,n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),d=j({},c,n,l,s);return u.length>0&&(d.className=u),Object.keys(f).length>0&&(d.style=f),{props:d,internalRef:c.ref}}const dTe=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function Lr(t){var e;const{elementType:n,externalSlotProps:r,ownerState:i,skipResolvingSlotProps:o=!1}=t,a=Ae(t,dTe),s=o?{}:dre(r,i),{props:l,internalRef:c}=hre(j({},a,{externalSlotProps:s})),u=Zt(c,s==null?void 0:s.ref,(e=t.additionalProps)==null?void 0:e.ref);return Hm(n,j({},l,{ref:u}),i)}const hTe=["className","elementType","ownerState","externalForwardedProps","getSlotOwnerState","internalForwardedProps"],pTe=["component","slots","slotProps"],mTe=["component"];function gTe(t,e){const{className:n,elementType:r,ownerState:i,externalForwardedProps:o,getSlotOwnerState:a,internalForwardedProps:s}=e,l=Ae(e,hTe),{component:c,slots:u={[t]:void 0},slotProps:f={[t]:void 0}}=o,d=Ae(o,pTe),h=u[t]||r,p=dre(f[t],i),m=hre(j({className:n},l,{externalForwardedProps:t==="root"?d:void 0,externalSlotProps:p})),{props:{component:g},internalRef:v}=m,y=Ae(m.props,mTe),x=Zt(v,p==null?void 0:p.ref,e.ref),b=a?a(y):{},_=j({},i,b),S=t==="root"?g||c:g,O=Hm(h,j({},t==="root"&&!c&&!u[t]&&s,t!=="root"&&!u[t]&&s,y,S&&{as:S},{ref:x}),_);return Object.keys(b).forEach(C=>{delete O[C]}),[h,O]}function vTe(t){const{className:e,classes:n,pulsate:r=!1,rippleX:i,rippleY:o,rippleSize:a,in:s,onExited:l,timeout:c}=t,[u,f]=M.useState(!1),d=ke(e,n.ripple,n.rippleVisible,r&&n.ripplePulsate),h={width:a,height:a,top:-(a/2)+o,left:-(a/2)+i},p=ke(n.child,u&&n.childLeaving,r&&n.childPulsate);return!s&&!u&&f(!0),M.useEffect(()=>{if(!s&&l!=null){const m=setTimeout(l,c);return()=>{clearTimeout(m)}}},[l,s,c]),w.jsx("span",{className:d,style:h,children:w.jsx("span",{className:p})})}const Fa=Ve("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),yTe=["center","classes","className"];let MM=t=>t,jV,BV,zV,UV;const ML=550,xTe=80,bTe=Gv(jV||(jV=MM` + */var Wj=Symbol.for("react.element"),Vj=Symbol.for("react.portal"),pM=Symbol.for("react.fragment"),mM=Symbol.for("react.strict_mode"),gM=Symbol.for("react.profiler"),vM=Symbol.for("react.provider"),yM=Symbol.for("react.context"),MSe=Symbol.for("react.server_context"),xM=Symbol.for("react.forward_ref"),bM=Symbol.for("react.suspense"),_M=Symbol.for("react.suspense_list"),wM=Symbol.for("react.memo"),SM=Symbol.for("react.lazy"),kSe=Symbol.for("react.offscreen"),Une;Une=Symbol.for("react.module.reference");function ys(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case Wj:switch(t=t.type,t){case pM:case gM:case mM:case bM:case _M:return t;default:switch(t=t&&t.$$typeof,t){case MSe:case yM:case xM:case SM:case wM:case vM:return t;default:return e}}case Vj:return e}}}kn.ContextConsumer=yM;kn.ContextProvider=vM;kn.Element=Wj;kn.ForwardRef=xM;kn.Fragment=pM;kn.Lazy=SM;kn.Memo=wM;kn.Portal=Vj;kn.Profiler=gM;kn.StrictMode=mM;kn.Suspense=bM;kn.SuspenseList=_M;kn.isAsyncMode=function(){return!1};kn.isConcurrentMode=function(){return!1};kn.isContextConsumer=function(t){return ys(t)===yM};kn.isContextProvider=function(t){return ys(t)===vM};kn.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===Wj};kn.isForwardRef=function(t){return ys(t)===xM};kn.isFragment=function(t){return ys(t)===pM};kn.isLazy=function(t){return ys(t)===SM};kn.isMemo=function(t){return ys(t)===wM};kn.isPortal=function(t){return ys(t)===Vj};kn.isProfiler=function(t){return ys(t)===gM};kn.isStrictMode=function(t){return ys(t)===mM};kn.isSuspense=function(t){return ys(t)===bM};kn.isSuspenseList=function(t){return ys(t)===_M};kn.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===pM||t===gM||t===mM||t===bM||t===_M||t===kSe||typeof t=="object"&&t!==null&&(t.$$typeof===SM||t.$$typeof===wM||t.$$typeof===vM||t.$$typeof===yM||t.$$typeof===xM||t.$$typeof===Une||t.getModuleId!==void 0)};kn.typeOf=ys;zne.exports=kn;var CL=zne.exports;const ASe=Nt(CL),RSe=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function Wne(t){const e=`${t}`.match(RSe);return e&&e[1]||""}function Vne(t,e=""){return t.displayName||t.name||Wne(t)||e}function SV(t,e,n){const r=Vne(e);return t.displayName||(r!==""?`${n}(${r})`:n)}function ISe(t){if(t!=null){if(typeof t=="string")return t;if(typeof t=="function")return Vne(t,"Component");if(typeof t=="object")switch(t.$$typeof){case CL.ForwardRef:return SV(t,t.render,"ForwardRef");case CL.Memo:return SV(t,t.type,"memo");default:return}}}const DSe=Object.freeze(Object.defineProperty({__proto__:null,default:ISe,getFunctionName:Wne},Symbol.toStringTag,{value:"Module"})),LSe=["ownerState"],$Se=["variants"],NSe=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function FSe(t){return Object.keys(t).length===0}function jSe(t){return typeof t=="string"&&t.charCodeAt(0)>96}function hA(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const BSe=w1(),zSe=t=>t&&t.charAt(0).toLowerCase()+t.slice(1);function Xw({defaultTheme:t,theme:e,themeId:n}){return FSe(e)?t:e[n]||e}function USe(t){return t?(e,n)=>n[t]:null}function yC(t,e){let{ownerState:n}=e,r=Ae(e,LSe);const i=typeof t=="function"?t(j({ownerState:n},r)):t;if(Array.isArray(i))return i.flatMap(o=>yC(o,j({ownerState:n},r)));if(i&&typeof i=="object"&&Array.isArray(i.variants)){const{variants:o=[]}=i;let s=Ae(i,$Se);return o.forEach(l=>{let c=!0;typeof l.props=="function"?c=l.props(j({ownerState:n},r,n)):Object.keys(l.props).forEach(u=>{(n==null?void 0:n[u])!==l.props[u]&&r[u]!==l.props[u]&&(c=!1)}),c&&(Array.isArray(s)||(s=[s]),s.push(typeof l.style=="function"?l.style(j({ownerState:n},r,n)):l.style))}),s}return i}function WSe(t={}){const{themeId:e,defaultTheme:n=BSe,rootShouldForwardProp:r=hA,slotShouldForwardProp:i=hA}=t,o=a=>_1(j({},a,{theme:Xw(j({},a,{defaultTheme:n,themeId:e}))}));return o.__mui_systemSx=!0,(a,s={})=>{kne(a,_=>_.filter(S=>!(S!=null&&S.__mui_systemSx)));const{name:l,slot:c,skipVariantsResolver:u,skipSx:f,overridesResolver:d=USe(zSe(c))}=s,h=Ae(s,NSe),p=u!==void 0?u:c&&c!=="Root"&&c!=="root"||!1,m=f||!1;let g,v=hA;c==="Root"||c==="root"?v=r:c?v=i:jSe(a)&&(v=void 0);const y=Lj(a,j({shouldForwardProp:v,label:g},h)),x=_=>typeof _=="function"&&_.__emotion_real!==_||Nc(_)?S=>yC(_,j({},S,{theme:Xw({theme:S.theme,defaultTheme:n,themeId:e})})):_,b=(_,...S)=>{let O=x(_);const C=S?S.map(x):[];l&&d&&C.push(I=>{const P=Xw(j({},I,{defaultTheme:n,themeId:e}));if(!P.components||!P.components[l]||!P.components[l].styleOverrides)return null;const R=P.components[l].styleOverrides,T={};return Object.entries(R).forEach(([L,z])=>{T[L]=yC(z,j({},I,{theme:P}))}),d(I,T)}),l&&!p&&C.push(I=>{var P;const R=Xw(j({},I,{defaultTheme:n,themeId:e})),T=R==null||(P=R.components)==null||(P=P[l])==null?void 0:P.variants;return yC({variants:T},j({},I,{theme:R}))}),m||C.push(o);const E=C.length-S.length;if(Array.isArray(_)&&E>0){const I=new Array(E).fill("");O=[..._,...I],O.raw=[..._.raw,...I]}const k=y(O,...C);return a.muiName&&(k.muiName=a.muiName),k};return y.withConfig&&(b.withConfig=y.withConfig),b}}const Li=WSe();function OM(t,e){const n=j({},e);return Object.keys(t).forEach(r=>{if(r.toString().match(/^(components|slots)$/))n[r]=j({},t[r],n[r]);else if(r.toString().match(/^(componentsProps|slotProps)$/)){const i=t[r]||{},o=e[r];n[r]={},!o||!Object.keys(o)?n[r]=i:!i||!Object.keys(i)?n[r]=o:(n[r]=j({},o),Object.keys(i).forEach(a=>{n[r][a]=OM(i[a],o[a])}))}else n[r]===void 0&&(n[r]=t[r])}),n}function Gne(t){const{theme:e,name:n,props:r}=t;return!e||!e.components||!e.components[n]||!e.components[n].defaultProps?r:OM(e.components[n].defaultProps,r)}function Hne({props:t,name:e,defaultTheme:n,themeId:r}){let i=ld(n);return r&&(i=i[r]||i),Gne({theme:i,name:e,props:t})}const Vr=typeof window<"u"?M.useLayoutEffect:M.useEffect;function VSe(t,e,n,r,i){const[o,a]=M.useState(()=>i&&n?n(t).matches:r?r(t).matches:e);return Vr(()=>{let s=!0;if(!n)return;const l=n(t),c=()=>{s&&a(l.matches)};return c(),l.addListener(c),()=>{s=!1,l.removeListener(c)}},[t,n]),o}const qne=M.useSyncExternalStore;function GSe(t,e,n,r,i){const o=M.useCallback(()=>e,[e]),a=M.useMemo(()=>{if(i&&n)return()=>n(t).matches;if(r!==null){const{matches:u}=r(t);return()=>u}return o},[o,t,r,i,n]),[s,l]=M.useMemo(()=>{if(n===null)return[o,()=>()=>{}];const u=n(t);return[()=>u.matches,f=>(u.addListener(f),()=>{u.removeListener(f)})]},[o,n,t]);return qne(l,s,a)}function HSe(t,e={}){const n=zj(),r=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:i=!1,matchMedia:o=r?window.matchMedia:null,ssrMatchMedia:a=null,noSsr:s=!1}=Gne({name:"MuiUseMediaQuery",props:e,theme:n});let l=typeof t=="function"?t(n):t;return l=l.replace(/^@media( ?)/m,""),(qne!==void 0?GSe:VSe)(l,i,o,a,s)}function eh(t,e=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(t,n))}const qSe=Object.freeze(Object.defineProperty({__proto__:null,default:eh},Symbol.toStringTag,{value:"Module"}));function Gj(t,e=0,n=1){return eh(t,e,n)}function XSe(t){t=t.slice(1);const e=new RegExp(`.{1,${t.length>=6?2:1}}`,"g");let n=t.match(e);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,i)=>i<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function CM(t){if(t.type)return t;if(t.charAt(0)==="#")return CM(XSe(t));const e=t.indexOf("("),n=t.substring(0,e);if(["rgb","rgba","hsl","hsla","color"].indexOf(n)===-1)throw new Error(su(9,t));let r=t.substring(e+1,t.length-1),i;if(n==="color"){if(r=r.split(" "),i=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(i)===-1)throw new Error(su(10,i))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:i}}function Hj(t){const{type:e,colorSpace:n}=t;let{values:r}=t;return e.indexOf("rgb")!==-1?r=r.map((i,o)=>o<3?parseInt(i,10):i):e.indexOf("hsl")!==-1&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),e.indexOf("color")!==-1?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${e}(${r})`}function Wc(t,e){return t=CM(t),e=Gj(e),(t.type==="rgb"||t.type==="hsl")&&(t.type+="a"),t.type==="color"?t.values[3]=`/${e}`:t.values[3]=e,Hj(t)}function Xne(t,e){if(t=CM(t),e=Gj(e),t.type.indexOf("hsl")!==-1)t.values[2]*=1-e;else if(t.type.indexOf("rgb")!==-1||t.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)t.values[n]*=1-e;return Hj(t)}function Qne(t,e){if(t=CM(t),e=Gj(e),t.type.indexOf("hsl")!==-1)t.values[2]+=(100-t.values[2])*e;else if(t.type.indexOf("rgb")!==-1)for(let n=0;n<3;n+=1)t.values[n]+=(255-t.values[n])*e;else if(t.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)t.values[n]+=(1-t.values[n])*e;return Hj(t)}function yT(...t){return t.reduce((e,n)=>n==null?e:function(...i){e.apply(this,i),n.apply(this,i)},()=>{})}function Hv(t,e=166){let n;function r(...i){const o=()=>{t.apply(this,i)};clearTimeout(n),n=setTimeout(o,e)}return r.clear=()=>{clearTimeout(n)},r}function QSe(t,e){return()=>null}function Ix(t,e){var n,r;return M.isValidElement(t)&&e.indexOf((n=t.type.muiName)!=null?n:(r=t.type)==null||(r=r._payload)==null||(r=r.value)==null?void 0:r.muiName)!==-1}function $n(t){return t&&t.ownerDocument||document}function ls(t){return $n(t).defaultView||window}function YSe(t,e){return()=>null}function xT(t,e){typeof t=="function"?t(e):t&&(t.current=e)}let OV=0;function KSe(t){const[e,n]=M.useState(t),r=t||e;return M.useEffect(()=>{e==null&&(OV+=1,n(`mui-${OV}`))},[e]),r}const CV=RD.useId;function cd(t){if(CV!==void 0){const e=CV();return t??e}return KSe(t)}function ZSe(t,e,n,r,i){return null}function Hs({controlled:t,default:e,name:n,state:r="value"}){const{current:i}=M.useRef(t!==void 0),[o,a]=M.useState(e),s=i?t:o,l=M.useCallback(c=>{i||a(c)},[]);return[s,l]}function br(t){const e=M.useRef(t);return Vr(()=>{e.current=t}),M.useRef((...n)=>(0,e.current)(...n)).current}function Zt(...t){return M.useMemo(()=>t.every(e=>e==null)?null:e=>{t.forEach(n=>{xT(n,e)})},t)}const TV={};function JSe(t,e){const n=M.useRef(TV);return n.current===TV&&(n.current=t(e)),n}const eOe=[];function tOe(t){M.useEffect(t,eOe)}class O1{constructor(){this.currentId=null,this.clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)},this.disposeEffect=()=>this.clear}static create(){return new O1}start(e,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},e)}}function mf(){const t=JSe(O1.create).current;return tOe(t.disposeEffect),t}let TM=!0,TL=!1;const nOe=new O1,rOe={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function iOe(t){const{type:e,tagName:n}=t;return!!(n==="INPUT"&&rOe[e]&&!t.readOnly||n==="TEXTAREA"&&!t.readOnly||t.isContentEditable)}function oOe(t){t.metaKey||t.altKey||t.ctrlKey||(TM=!0)}function pA(){TM=!1}function aOe(){this.visibilityState==="hidden"&&TL&&(TM=!0)}function sOe(t){t.addEventListener("keydown",oOe,!0),t.addEventListener("mousedown",pA,!0),t.addEventListener("pointerdown",pA,!0),t.addEventListener("touchstart",pA,!0),t.addEventListener("visibilitychange",aOe,!0)}function lOe(t){const{target:e}=t;try{return e.matches(":focus-visible")}catch{}return TM||iOe(e)}function C1(){const t=M.useCallback(i=>{i!=null&&sOe(i.ownerDocument)},[]),e=M.useRef(!1);function n(){return e.current?(TL=!0,nOe.start(100,()=>{TL=!1}),e.current=!1,!0):!1}function r(i){return lOe(i)?(e.current=!0,!0):!1}return{isFocusVisibleRef:e,onFocus:r,onBlur:n,ref:t}}function Yne(t){const e=t.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}let Gp;function Kne(){if(Gp)return Gp;const t=document.createElement("div"),e=document.createElement("div");return e.style.width="10px",e.style.height="1px",t.appendChild(e),t.dir="rtl",t.style.fontSize="14px",t.style.width="4px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.overflow="scroll",document.body.appendChild(t),Gp="reverse",t.scrollLeft>0?Gp="default":(t.scrollLeft=1,t.scrollLeft===0&&(Gp="negative")),document.body.removeChild(t),Gp}function cOe(t,e){const n=t.scrollLeft;if(e!=="rtl")return n;switch(Kne()){case"negative":return t.scrollWidth-t.clientWidth+n;case"reverse":return t.scrollWidth-t.clientWidth-n;default:return n}}function uOe(t){return M.Children.toArray(t).filter(e=>M.isValidElement(e))}const fOe={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"},dOe=fOe;function Ue(t,e,n=void 0){const r={};return Object.keys(t).forEach(i=>{r[i]=t[i].reduce((o,a)=>{if(a){const s=e(a);s!==""&&o.push(s),n&&n[a]&&o.push(n[a])}return o},[]).join(" ")}),r}const hOe=M.createContext(null),Zne=hOe;function qj(){return M.useContext(Zne)}const pOe=typeof Symbol=="function"&&Symbol.for,Jne=pOe?Symbol.for("mui.nested"):"__THEME_NESTED__";function mOe(t,e){return typeof e=="function"?e(t):j({},t,e)}function gOe(t){const{children:e,theme:n}=t,r=qj(),i=M.useMemo(()=>{const o=r===null?n:mOe(r,n);return o!=null&&(o[Jne]=r!==null),o},[n,r]);return w.jsx(Zne.Provider,{value:i,children:e})}const vOe=["value"],ere=M.createContext();function yOe(t){let{value:e}=t,n=Ae(t,vOe);return w.jsx(ere.Provider,j({value:e??!0},n))}const T1=()=>{const t=M.useContext(ere);return t??!1},EV={};function PV(t,e,n,r=!1){return M.useMemo(()=>{const i=t&&e[t]||e;if(typeof n=="function"){const o=n(i),a=t?j({},e,{[t]:o}):o;return r?()=>a:a}return t?j({},e,{[t]:n}):j({},e,n)},[t,e,n,r])}function xOe(t){const{children:e,theme:n,themeId:r}=t,i=zj(EV),o=qj()||EV,a=PV(r,i,n),s=PV(r,o,n,!0),l=a.direction==="rtl";return w.jsx(gOe,{theme:s,children:w.jsx(y1.Provider,{value:a,children:w.jsx(yOe,{value:l,children:e})})})}const bOe=["component","direction","spacing","divider","children","className","useFlexGap"],_Oe=w1(),wOe=Li("div",{name:"MuiStack",slot:"Root",overridesResolver:(t,e)=>e.root});function SOe(t){return Hne({props:t,name:"MuiStack",defaultTheme:_Oe})}function OOe(t,e){const n=M.Children.toArray(t).filter(Boolean);return n.reduce((r,i,o)=>(r.push(i),o({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[t],TOe=({ownerState:t,theme:e})=>{let n=j({display:"flex",flexDirection:"column"},Uo({theme:e},Mh({values:t.direction,breakpoints:e.breakpoints.values}),r=>({flexDirection:r})));if(t.spacing){const r=jj(e),i=Object.keys(e.breakpoints.values).reduce((l,c)=>((typeof t.spacing=="object"&&t.spacing[c]!=null||typeof t.direction=="object"&&t.direction[c]!=null)&&(l[c]=!0),l),{}),o=Mh({values:t.direction,base:i}),a=Mh({values:t.spacing,base:i});typeof o=="object"&&Object.keys(o).forEach((l,c,u)=>{if(!o[l]){const d=c>0?o[u[c-1]]:"column";o[l]=d}}),n=Ii(n,Uo({theme:e},a,(l,c)=>t.useFlexGap?{gap:Hh(r,l)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${COe(c?o[c]:t.direction)}`]:Hh(r,l)}}))}return n=Pwe(e.breakpoints,n),n};function EOe(t={}){const{createStyledComponent:e=wOe,useThemeProps:n=SOe,componentName:r="MuiStack"}=t,i=()=>Ue({root:["root"]},l=>We(r,l),{}),o=e(TOe);return M.forwardRef(function(l,c){const u=n(l),f=S1(u),{component:d="div",direction:h="column",spacing:p=0,divider:m,children:g,className:v,useFlexGap:y=!1}=f,x=Ae(f,bOe),b={direction:h,spacing:p,useFlexGap:y},_=i();return w.jsx(o,j({as:d,ownerState:b,ref:c,className:ke(_.root,v)},x,{children:m?OOe(g,m):g}))})}function POe(t,e){return j({toolbar:{minHeight:56,[t.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[t.up("sm")]:{minHeight:64}}},e)}var Ar={},tre={exports:{}};(function(t){function e(n){return n&&n.__esModule?n:{default:n}}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})(tre);var ct=tre.exports;const MOe=Ea(P1e),kOe=Ea(qSe);var nre=ct;Object.defineProperty(Ar,"__esModule",{value:!0});var kt=Ar.alpha=are;Ar.blend=UOe;Ar.colorChannel=void 0;var Eb=Ar.darken=Qj;Ar.decomposeColor=cs;var AOe=Ar.emphasize=sre,ROe=Ar.getContrastRatio=NOe;Ar.getLuminance=bT;Ar.hexToRgb=rre;Ar.hslToRgb=ore;var Pb=Ar.lighten=Yj;Ar.private_safeAlpha=FOe;Ar.private_safeColorChannel=void 0;Ar.private_safeDarken=jOe;Ar.private_safeEmphasize=zOe;Ar.private_safeLighten=BOe;Ar.recomposeColor=qv;Ar.rgbToHex=$Oe;var MV=nre(MOe),IOe=nre(kOe);function Xj(t,e=0,n=1){return(0,IOe.default)(t,e,n)}function rre(t){t=t.slice(1);const e=new RegExp(`.{1,${t.length>=6?2:1}}`,"g");let n=t.match(e);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,i)=>i<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function DOe(t){const e=t.toString(16);return e.length===1?`0${e}`:e}function cs(t){if(t.type)return t;if(t.charAt(0)==="#")return cs(rre(t));const e=t.indexOf("("),n=t.substring(0,e);if(["rgb","rgba","hsl","hsla","color"].indexOf(n)===-1)throw new Error((0,MV.default)(9,t));let r=t.substring(e+1,t.length-1),i;if(n==="color"){if(r=r.split(" "),i=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(i)===-1)throw new Error((0,MV.default)(10,i))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:i}}const ire=t=>{const e=cs(t);return e.values.slice(0,3).map((n,r)=>e.type.indexOf("hsl")!==-1&&r!==0?`${n}%`:n).join(" ")};Ar.colorChannel=ire;const LOe=(t,e)=>{try{return ire(t)}catch{return t}};Ar.private_safeColorChannel=LOe;function qv(t){const{type:e,colorSpace:n}=t;let{values:r}=t;return e.indexOf("rgb")!==-1?r=r.map((i,o)=>o<3?parseInt(i,10):i):e.indexOf("hsl")!==-1&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),e.indexOf("color")!==-1?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${e}(${r})`}function $Oe(t){if(t.indexOf("#")===0)return t;const{values:e}=cs(t);return`#${e.map((n,r)=>DOe(r===3?Math.round(255*n):n)).join("")}`}function ore(t){t=cs(t);const{values:e}=t,n=e[0],r=e[1]/100,i=e[2]/100,o=r*Math.min(i,1-i),a=(c,u=(c+n/30)%12)=>i-o*Math.max(Math.min(u-3,9-u,1),-1);let s="rgb";const l=[Math.round(a(0)*255),Math.round(a(8)*255),Math.round(a(4)*255)];return t.type==="hsla"&&(s+="a",l.push(e[3])),qv({type:s,values:l})}function bT(t){t=cs(t);let e=t.type==="hsl"||t.type==="hsla"?cs(ore(t)).values:t.values;return e=e.map(n=>(t.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*e[0]+.7152*e[1]+.0722*e[2]).toFixed(3))}function NOe(t,e){const n=bT(t),r=bT(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function are(t,e){return t=cs(t),e=Xj(e),(t.type==="rgb"||t.type==="hsl")&&(t.type+="a"),t.type==="color"?t.values[3]=`/${e}`:t.values[3]=e,qv(t)}function FOe(t,e,n){try{return are(t,e)}catch{return t}}function Qj(t,e){if(t=cs(t),e=Xj(e),t.type.indexOf("hsl")!==-1)t.values[2]*=1-e;else if(t.type.indexOf("rgb")!==-1||t.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)t.values[n]*=1-e;return qv(t)}function jOe(t,e,n){try{return Qj(t,e)}catch{return t}}function Yj(t,e){if(t=cs(t),e=Xj(e),t.type.indexOf("hsl")!==-1)t.values[2]+=(100-t.values[2])*e;else if(t.type.indexOf("rgb")!==-1)for(let n=0;n<3;n+=1)t.values[n]+=(255-t.values[n])*e;else if(t.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)t.values[n]+=(1-t.values[n])*e;return qv(t)}function BOe(t,e,n){try{return Yj(t,e)}catch{return t}}function sre(t,e=.15){return bT(t)>.5?Qj(t,e):Yj(t,e)}function zOe(t,e,n){try{return sre(t,e)}catch{return t}}function UOe(t,e,n,r=1){const i=(l,c)=>Math.round((l**(1/r)*(1-n)+c**(1/r)*n)**r),o=cs(t),a=cs(e),s=[i(o.values[0],a.values[0]),i(o.values[1],a.values[1]),i(o.values[2],a.values[2])];return qv({type:"rgb",values:s})}const WOe=["mode","contrastThreshold","tonalOffset"],kV={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:Sb.white,default:Sb.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},mA={text:{primary:Sb.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:Sb.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function AV(t,e,n,r){const i=r.light||r,o=r.dark||r*1.5;t[e]||(t.hasOwnProperty(n)?t[e]=t[n]:e==="light"?t.light=Pb(t.main,i):e==="dark"&&(t.dark=Eb(t.main,o)))}function VOe(t="light"){return t==="dark"?{main:Ju[200],light:Ju[50],dark:Ju[400]}:{main:Ju[700],light:Ju[400],dark:Ju[800]}}function GOe(t="light"){return t==="dark"?{main:Zu[200],light:Zu[50],dark:Zu[400]}:{main:Zu[500],light:Zu[300],dark:Zu[700]}}function HOe(t="light"){return t==="dark"?{main:Ku[500],light:Ku[300],dark:Ku[700]}:{main:Ku[700],light:Ku[400],dark:Ku[800]}}function qOe(t="light"){return t==="dark"?{main:ef[400],light:ef[300],dark:ef[700]}:{main:ef[700],light:ef[500],dark:ef[900]}}function XOe(t="light"){return t==="dark"?{main:Rc[400],light:Rc[300],dark:Rc[700]}:{main:Rc[800],light:Rc[500],dark:Rc[900]}}function QOe(t="light"){return t==="dark"?{main:Jd[400],light:Jd[300],dark:Jd[700]}:{main:"#ed6c02",light:Jd[500],dark:Jd[900]}}function YOe(t){const{mode:e="light",contrastThreshold:n=3,tonalOffset:r=.2}=t,i=Ae(t,WOe),o=t.primary||VOe(e),a=t.secondary||GOe(e),s=t.error||HOe(e),l=t.info||qOe(e),c=t.success||XOe(e),u=t.warning||QOe(e);function f(m){return ROe(m,mA.text.primary)>=n?mA.text.primary:kV.text.primary}const d=({color:m,name:g,mainShade:v=500,lightShade:y=300,darkShade:x=700})=>{if(m=j({},m),!m.main&&m[v]&&(m.main=m[v]),!m.hasOwnProperty("main"))throw new Error(su(11,g?` (${g})`:"",v));if(typeof m.main!="string")throw new Error(su(12,g?` (${g})`:"",JSON.stringify(m.main)));return AV(m,"light",y,r),AV(m,"dark",x,r),m.contrastText||(m.contrastText=f(m.main)),m},h={dark:mA,light:kV};return Ii(j({common:j({},Sb),mode:e,primary:d({color:o,name:"primary"}),secondary:d({color:a,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:d({color:s,name:"error"}),warning:d({color:u,name:"warning"}),info:d({color:l,name:"info"}),success:d({color:c,name:"success"}),grey:dne,contrastThreshold:n,getContrastText:f,augmentColor:d,tonalOffset:r},h[e]),i)}const KOe=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function ZOe(t){return Math.round(t*1e5)/1e5}const RV={textTransform:"uppercase"},IV='"Roboto", "Helvetica", "Arial", sans-serif';function JOe(t,e){const n=typeof e=="function"?e(t):e,{fontFamily:r=IV,fontSize:i=14,fontWeightLight:o=300,fontWeightRegular:a=400,fontWeightMedium:s=500,fontWeightBold:l=700,htmlFontSize:c=16,allVariants:u,pxToRem:f}=n,d=Ae(n,KOe),h=i/14,p=f||(v=>`${v/c*h}rem`),m=(v,y,x,b,_)=>j({fontFamily:r,fontWeight:v,fontSize:p(y),lineHeight:x},r===IV?{letterSpacing:`${ZOe(b/y)}em`}:{},_,u),g={h1:m(o,96,1.167,-1.5),h2:m(o,60,1.2,-.5),h3:m(a,48,1.167,0),h4:m(a,34,1.235,.25),h5:m(a,24,1.334,0),h6:m(s,20,1.6,.15),subtitle1:m(a,16,1.75,.15),subtitle2:m(s,14,1.57,.1),body1:m(a,16,1.5,.15),body2:m(a,14,1.43,.15),button:m(s,14,1.75,.4,RV),caption:m(a,12,1.66,.4),overline:m(a,12,2.66,1,RV),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return Ii(j({htmlFontSize:c,pxToRem:p,fontFamily:r,fontSize:i,fontWeightLight:o,fontWeightRegular:a,fontWeightMedium:s,fontWeightBold:l},g),d,{clone:!1})}const eCe=.2,tCe=.14,nCe=.12;function ir(...t){return[`${t[0]}px ${t[1]}px ${t[2]}px ${t[3]}px rgba(0,0,0,${eCe})`,`${t[4]}px ${t[5]}px ${t[6]}px ${t[7]}px rgba(0,0,0,${tCe})`,`${t[8]}px ${t[9]}px ${t[10]}px ${t[11]}px rgba(0,0,0,${nCe})`].join(",")}const rCe=["none",ir(0,2,1,-1,0,1,1,0,0,1,3,0),ir(0,3,1,-2,0,2,2,0,0,1,5,0),ir(0,3,3,-2,0,3,4,0,0,1,8,0),ir(0,2,4,-1,0,4,5,0,0,1,10,0),ir(0,3,5,-1,0,5,8,0,0,1,14,0),ir(0,3,5,-1,0,6,10,0,0,1,18,0),ir(0,4,5,-2,0,7,10,1,0,2,16,1),ir(0,5,5,-3,0,8,10,1,0,3,14,2),ir(0,5,6,-3,0,9,12,1,0,3,16,2),ir(0,6,6,-3,0,10,14,1,0,4,18,3),ir(0,6,7,-4,0,11,15,1,0,4,20,3),ir(0,7,8,-4,0,12,17,2,0,5,22,4),ir(0,7,8,-4,0,13,19,2,0,5,24,4),ir(0,7,9,-4,0,14,21,2,0,5,26,4),ir(0,8,9,-5,0,15,22,2,0,6,28,5),ir(0,8,10,-5,0,16,24,2,0,6,30,5),ir(0,8,11,-5,0,17,26,2,0,6,32,5),ir(0,9,11,-5,0,18,28,2,0,7,34,6),ir(0,9,12,-6,0,19,29,2,0,7,36,6),ir(0,10,13,-6,0,20,31,3,0,8,38,7),ir(0,10,13,-6,0,21,33,3,0,8,40,7),ir(0,10,14,-6,0,22,35,3,0,8,42,7),ir(0,11,14,-7,0,23,36,3,0,9,44,8),ir(0,11,15,-7,0,24,38,3,0,9,46,8)],iCe=["duration","easing","delay"],oCe={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},lre={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function DV(t){return`${Math.round(t)}ms`}function aCe(t){if(!t)return 0;const e=t/36;return Math.round((4+15*e**.25+e/5)*10)}function sCe(t){const e=j({},oCe,t.easing),n=j({},lre,t.duration);return j({getAutoHeightDuration:aCe,create:(i=["all"],o={})=>{const{duration:a=n.standard,easing:s=e.easeInOut,delay:l=0}=o;return Ae(o,iCe),(Array.isArray(i)?i:[i]).map(c=>`${c} ${typeof a=="string"?a:DV(a)} ${s} ${typeof l=="string"?l:DV(l)}`).join(",")}},t,{easing:e,duration:n})}const lCe={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},cCe=lCe,uCe=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function Kj(t={},...e){const{mixins:n={},palette:r={},transitions:i={},typography:o={}}=t,a=Ae(t,uCe);if(t.vars)throw new Error(su(18));const s=YOe(r),l=w1(t);let c=Ii(l,{mixins:POe(l.breakpoints,n),palette:s,shadows:rCe.slice(),typography:JOe(s,o),transitions:sCe(i),zIndex:j({},cCe)});return c=Ii(c,a),c=e.reduce((u,f)=>Ii(u,f),c),c.unstable_sxConfig=j({},b1,a==null?void 0:a.unstable_sxConfig),c.unstable_sx=function(f){return _1({sx:f,theme:this})},c}const fCe=Kj(),EM=fCe;function Vo(){const t=ld(EM);return t[Gh]||t}function qe({props:t,name:e}){return Hne({props:t,name:e,defaultTheme:EM,themeId:Gh})}var E1={};const dCe=Ea(Zbe),hCe=Ea(Jbe),cre=Ea(wwe),pCe=Ea(Swe),mCe=Ea(kwe),gCe=Ea(DSe),vCe=Ea(ySe),yCe=Ea(OSe);var Xv=ct;Object.defineProperty(E1,"__esModule",{value:!0});var xCe=E1.default=RCe;E1.shouldForwardProp=xC;E1.systemDefaultTheme=void 0;var Na=Xv(dCe),EL=Xv(hCe),LV=TCe(cre),bCe=pCe;Xv(mCe);Xv(gCe);var _Ce=Xv(vCe),wCe=Xv(yCe);const SCe=["ownerState"],OCe=["variants"],CCe=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function ure(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(ure=function(r){return r?n:e})(t)}function TCe(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=ure(e);if(n&&n.has(t))return n.get(t);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&Object.prototype.hasOwnProperty.call(t,o)){var a=i?Object.getOwnPropertyDescriptor(t,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=t[o]}return r.default=t,n&&n.set(t,r),r}function ECe(t){return Object.keys(t).length===0}function PCe(t){return typeof t=="string"&&t.charCodeAt(0)>96}function xC(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const MCe=E1.systemDefaultTheme=(0,_Ce.default)(),kCe=t=>t&&t.charAt(0).toLowerCase()+t.slice(1);function Qw({defaultTheme:t,theme:e,themeId:n}){return ECe(e)?t:e[n]||e}function ACe(t){return t?(e,n)=>n[t]:null}function bC(t,e){let{ownerState:n}=e,r=(0,EL.default)(e,SCe);const i=typeof t=="function"?t((0,Na.default)({ownerState:n},r)):t;if(Array.isArray(i))return i.flatMap(o=>bC(o,(0,Na.default)({ownerState:n},r)));if(i&&typeof i=="object"&&Array.isArray(i.variants)){const{variants:o=[]}=i;let s=(0,EL.default)(i,OCe);return o.forEach(l=>{let c=!0;typeof l.props=="function"?c=l.props((0,Na.default)({ownerState:n},r,n)):Object.keys(l.props).forEach(u=>{(n==null?void 0:n[u])!==l.props[u]&&r[u]!==l.props[u]&&(c=!1)}),c&&(Array.isArray(s)||(s=[s]),s.push(typeof l.style=="function"?l.style((0,Na.default)({ownerState:n},r,n)):l.style))}),s}return i}function RCe(t={}){const{themeId:e,defaultTheme:n=MCe,rootShouldForwardProp:r=xC,slotShouldForwardProp:i=xC}=t,o=a=>(0,wCe.default)((0,Na.default)({},a,{theme:Qw((0,Na.default)({},a,{defaultTheme:n,themeId:e}))}));return o.__mui_systemSx=!0,(a,s={})=>{(0,LV.internal_processStyles)(a,_=>_.filter(S=>!(S!=null&&S.__mui_systemSx)));const{name:l,slot:c,skipVariantsResolver:u,skipSx:f,overridesResolver:d=ACe(kCe(c))}=s,h=(0,EL.default)(s,CCe),p=u!==void 0?u:c&&c!=="Root"&&c!=="root"||!1,m=f||!1;let g,v=xC;c==="Root"||c==="root"?v=r:c?v=i:PCe(a)&&(v=void 0);const y=(0,LV.default)(a,(0,Na.default)({shouldForwardProp:v,label:g},h)),x=_=>typeof _=="function"&&_.__emotion_real!==_||(0,bCe.isPlainObject)(_)?S=>bC(_,(0,Na.default)({},S,{theme:Qw({theme:S.theme,defaultTheme:n,themeId:e})})):_,b=(_,...S)=>{let O=x(_);const C=S?S.map(x):[];l&&d&&C.push(I=>{const P=Qw((0,Na.default)({},I,{defaultTheme:n,themeId:e}));if(!P.components||!P.components[l]||!P.components[l].styleOverrides)return null;const R=P.components[l].styleOverrides,T={};return Object.entries(R).forEach(([L,z])=>{T[L]=bC(z,(0,Na.default)({},I,{theme:P}))}),d(I,T)}),l&&!p&&C.push(I=>{var P;const R=Qw((0,Na.default)({},I,{defaultTheme:n,themeId:e})),T=R==null||(P=R.components)==null||(P=P[l])==null?void 0:P.variants;return bC({variants:T},(0,Na.default)({},I,{theme:R}))}),m||C.push(o);const E=C.length-S.length;if(Array.isArray(_)&&E>0){const I=new Array(E).fill("");O=[..._,...I],O.raw=[..._.raw,...I]}const k=y(O,...C);return a.muiName&&(k.muiName=a.muiName),k};return y.withConfig&&(b.withConfig=y.withConfig),b}}function PM(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const ICe=t=>PM(t)&&t!=="classes",di=ICe,we=xCe({themeId:Gh,defaultTheme:EM,rootShouldForwardProp:di}),DCe=["theme"];function LCe(t){let{theme:e}=t,n=Ae(t,DCe);const r=e[Gh];return w.jsx(xOe,j({},n,{themeId:r?Gh:void 0,theme:r||e}))}const $V=t=>{let e;return t<1?e=5.11916*t**2:e=4.5*Math.log(t+1)+2,(e/100).toFixed(2)};function $Ce(t){return We("MuiSvgIcon",t)}Ve("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const NCe=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],FCe=t=>{const{color:e,fontSize:n,classes:r}=t,i={root:["root",e!=="inherit"&&`color${De(e)}`,`fontSize${De(n)}`]};return Ue(i,$Ce,r)},jCe=we("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color!=="inherit"&&e[`color${De(n.color)}`],e[`fontSize${De(n.fontSize)}`]]}})(({theme:t,ownerState:e})=>{var n,r,i,o,a,s,l,c,u,f,d,h,p;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:e.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(n=t.transitions)==null||(r=n.create)==null?void 0:r.call(n,"fill",{duration:(i=t.transitions)==null||(i=i.duration)==null?void 0:i.shorter}),fontSize:{inherit:"inherit",small:((o=t.typography)==null||(a=o.pxToRem)==null?void 0:a.call(o,20))||"1.25rem",medium:((s=t.typography)==null||(l=s.pxToRem)==null?void 0:l.call(s,24))||"1.5rem",large:((c=t.typography)==null||(u=c.pxToRem)==null?void 0:u.call(c,35))||"2.1875rem"}[e.fontSize],color:(f=(d=(t.vars||t).palette)==null||(d=d[e.color])==null?void 0:d.main)!=null?f:{action:(h=(t.vars||t).palette)==null||(h=h.action)==null?void 0:h.active,disabled:(p=(t.vars||t).palette)==null||(p=p.action)==null?void 0:p.disabled,inherit:void 0}[e.color]}}),PL=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiSvgIcon"}),{children:i,className:o,color:a="inherit",component:s="svg",fontSize:l="medium",htmlColor:c,inheritViewBox:u=!1,titleAccess:f,viewBox:d="0 0 24 24"}=r,h=Ae(r,NCe),p=M.isValidElement(i)&&i.type==="svg",m=j({},r,{color:a,component:s,fontSize:l,instanceFontSize:e.fontSize,inheritViewBox:u,viewBox:d,hasSvgAsChild:p}),g={};u||(g.viewBox=d);const v=FCe(m);return w.jsxs(jCe,j({as:s,className:ke(v.root,o),focusable:"false",color:c,"aria-hidden":f?void 0:!0,role:f?"img":void 0,ref:n},g,h,p&&i.props,{ownerState:m,children:[p?i.props.children:i,f?w.jsx("title",{children:f}):null]}))});PL.muiName="SvgIcon";function ti(t,e){function n(r,i){return w.jsx(PL,j({"data-testid":`${e}Icon`,ref:i},r,{children:t}))}return n.muiName=PL.muiName,M.memo(M.forwardRef(n))}const BCe={configure:t=>{Uj.configure(t)}},zCe=Object.freeze(Object.defineProperty({__proto__:null,capitalize:De,createChainedFunction:yT,createSvgIcon:ti,debounce:Hv,deprecatedPropType:QSe,isMuiElement:Ix,ownerDocument:$n,ownerWindow:ls,requirePropFactory:YSe,setRef:xT,unstable_ClassNameGenerator:BCe,unstable_useEnhancedEffect:Vr,unstable_useId:cd,unsupportedProp:ZSe,useControlled:Hs,useEventCallback:br,useForkRef:Zt,useIsFocusVisible:C1},Symbol.toStringTag,{value:"Module"}));function Zj(t){return qe}function _T(t,e){return _T=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},_T(t,e)}function P1(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,_T(t,e)}function UCe(t,e){return t.classList?!!e&&t.classList.contains(e):(" "+(t.className.baseVal||t.className)+" ").indexOf(" "+e+" ")!==-1}function WCe(t,e){t.classList?t.classList.add(e):UCe(t,e)||(typeof t.className=="string"?t.className=t.className+" "+e:t.setAttribute("class",(t.className&&t.className.baseVal||"")+" "+e))}function NV(t,e){return t.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function VCe(t,e){t.classList?t.classList.remove(e):typeof t.className=="string"?t.className=NV(t.className,e):t.setAttribute("class",NV(t.className&&t.className.baseVal||"",e))}const FV={disabled:!1},wT=ue.createContext(null);var fre=function(e){return e.scrollTop},rx="unmounted",Vd="exited",Gd="entering",Mm="entered",ML="exiting",yu=function(t){P1(e,t);function e(r,i){var o;o=t.call(this,r,i)||this;var a=i,s=a&&!a.isMounting?r.enter:r.appear,l;return o.appearStatus=null,r.in?s?(l=Vd,o.appearStatus=Gd):l=Mm:r.unmountOnExit||r.mountOnEnter?l=rx:l=Vd,o.state={status:l},o.nextCallback=null,o}e.getDerivedStateFromProps=function(i,o){var a=i.in;return a&&o.status===rx?{status:Vd}:null};var n=e.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var o=null;if(i!==this.props){var a=this.state.status;this.props.in?a!==Gd&&a!==Mm&&(o=Gd):(a===Gd||a===Mm)&&(o=ML)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,o,a,s;return o=a=s=i,i!=null&&typeof i!="number"&&(o=i.exit,a=i.enter,s=i.appear!==void 0?i.appear:a),{exit:o,enter:a,appear:s}},n.updateStatus=function(i,o){if(i===void 0&&(i=!1),o!==null)if(this.cancelNextCallback(),o===Gd){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:Hw.findDOMNode(this);a&&fre(a)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Vd&&this.setState({status:rx})},n.performEnter=function(i){var o=this,a=this.props.enter,s=this.context?this.context.isMounting:i,l=this.props.nodeRef?[s]:[Hw.findDOMNode(this),s],c=l[0],u=l[1],f=this.getTimeouts(),d=s?f.appear:f.enter;if(!i&&!a||FV.disabled){this.safeSetState({status:Mm},function(){o.props.onEntered(c)});return}this.props.onEnter(c,u),this.safeSetState({status:Gd},function(){o.props.onEntering(c,u),o.onTransitionEnd(d,function(){o.safeSetState({status:Mm},function(){o.props.onEntered(c,u)})})})},n.performExit=function(){var i=this,o=this.props.exit,a=this.getTimeouts(),s=this.props.nodeRef?void 0:Hw.findDOMNode(this);if(!o||FV.disabled){this.safeSetState({status:Vd},function(){i.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:ML},function(){i.props.onExiting(s),i.onTransitionEnd(a.exit,function(){i.safeSetState({status:Vd},function(){i.props.onExited(s)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,o){o=this.setNextCallback(o),this.setState(i,o)},n.setNextCallback=function(i){var o=this,a=!0;return this.nextCallback=function(s){a&&(a=!1,o.nextCallback=null,i(s))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(i,o){this.setNextCallback(o);var a=this.props.nodeRef?this.props.nodeRef.current:Hw.findDOMNode(this),s=i==null&&!this.props.addEndListener;if(!a||s){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],c=l[0],u=l[1];this.props.addEndListener(c,u)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===rx)return null;var o=this.props,a=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var s=Ae(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return ue.createElement(wT.Provider,{value:null},typeof a=="function"?a(i,s):ue.cloneElement(ue.Children.only(a),s))},e}(ue.Component);yu.contextType=wT;yu.propTypes={};function Hp(){}yu.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Hp,onEntering:Hp,onEntered:Hp,onExit:Hp,onExiting:Hp,onExited:Hp};yu.UNMOUNTED=rx;yu.EXITED=Vd;yu.ENTERING=Gd;yu.ENTERED=Mm;yu.EXITING=ML;const M1=yu;var GCe=function(e,n){return e&&n&&n.split(" ").forEach(function(r){return WCe(e,r)})},gA=function(e,n){return e&&n&&n.split(" ").forEach(function(r){return VCe(e,r)})},Jj=function(t){P1(e,t);function e(){for(var r,i=arguments.length,o=new Array(i),a=0;at.scrollTop;function Xf(t,e){var n,r;const{timeout:i,easing:o,style:a={}}=t;return{duration:(n=a.transitionDuration)!=null?n:typeof i=="number"?i:i[e.mode]||0,easing:(r=a.transitionTimingFunction)!=null?r:typeof o=="object"?o[e.mode]:o,delay:a.transitionDelay}}function ZCe(t){return We("MuiCollapse",t)}Ve("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const JCe=["addEndListener","children","className","collapsedSize","component","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","orientation","style","timeout","TransitionComponent"],eTe=t=>{const{orientation:e,classes:n}=t,r={root:["root",`${e}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${e}`],wrapperInner:["wrapperInner",`${e}`]};return Ue(r,ZCe,n)},tTe=we("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.orientation],n.state==="entered"&&e.entered,n.state==="exited"&&!n.in&&n.collapsedSize==="0px"&&e.hidden]}})(({theme:t,ownerState:e})=>j({height:0,overflow:"hidden",transition:t.transitions.create("height")},e.orientation==="horizontal"&&{height:"auto",width:0,transition:t.transitions.create("width")},e.state==="entered"&&j({height:"auto",overflow:"visible"},e.orientation==="horizontal"&&{width:"auto"}),e.state==="exited"&&!e.in&&e.collapsedSize==="0px"&&{visibility:"hidden"})),nTe=we("div",{name:"MuiCollapse",slot:"Wrapper",overridesResolver:(t,e)=>e.wrapper})(({ownerState:t})=>j({display:"flex",width:"100%"},t.orientation==="horizontal"&&{width:"auto",height:"100%"})),rTe=we("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:(t,e)=>e.wrapperInner})(({ownerState:t})=>j({width:"100%"},t.orientation==="horizontal"&&{width:"auto",height:"100%"})),dre=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiCollapse"}),{addEndListener:i,children:o,className:a,collapsedSize:s="0px",component:l,easing:c,in:u,onEnter:f,onEntered:d,onEntering:h,onExit:p,onExited:m,onExiting:g,orientation:v="vertical",style:y,timeout:x=lre.standard,TransitionComponent:b=M1}=r,_=Ae(r,JCe),S=j({},r,{orientation:v,collapsedSize:s}),O=eTe(S),C=Vo(),E=mf(),k=M.useRef(null),I=M.useRef(),P=typeof s=="number"?`${s}px`:s,R=v==="horizontal",T=R?"width":"height",L=M.useRef(null),z=Zt(n,L),B=K=>se=>{if(K){const te=L.current;se===void 0?K(te):K(te,se)}},W=()=>k.current?k.current[R?"clientWidth":"clientHeight"]:0,U=B((K,se)=>{k.current&&R&&(k.current.style.position="absolute"),K.style[T]=P,f&&f(K,se)}),N=B((K,se)=>{const te=W();k.current&&R&&(k.current.style.position="");const{duration:J,easing:pe}=Xf({style:y,timeout:x,easing:c},{mode:"enter"});if(x==="auto"){const be=C.transitions.getAutoHeightDuration(te);K.style.transitionDuration=`${be}ms`,I.current=be}else K.style.transitionDuration=typeof J=="string"?J:`${J}ms`;K.style[T]=`${te}px`,K.style.transitionTimingFunction=pe,h&&h(K,se)}),$=B((K,se)=>{K.style[T]="auto",d&&d(K,se)}),D=B(K=>{K.style[T]=`${W()}px`,p&&p(K)}),A=B(m),q=B(K=>{const se=W(),{duration:te,easing:J}=Xf({style:y,timeout:x,easing:c},{mode:"exit"});if(x==="auto"){const pe=C.transitions.getAutoHeightDuration(se);K.style.transitionDuration=`${pe}ms`,I.current=pe}else K.style.transitionDuration=typeof te=="string"?te:`${te}ms`;K.style[T]=P,K.style.transitionTimingFunction=J,g&&g(K)}),Y=K=>{x==="auto"&&E.start(I.current||0,K),i&&i(L.current,K)};return w.jsx(b,j({in:u,onEnter:U,onEntered:$,onEntering:N,onExit:D,onExited:A,onExiting:q,addEndListener:Y,nodeRef:L,timeout:x==="auto"?null:x},_,{children:(K,se)=>w.jsx(tTe,j({as:l,className:ke(O.root,a,{entered:O.entered,exited:!u&&P==="0px"&&O.hidden}[K]),style:j({[R?"minWidth":"minHeight"]:P},y),ref:z},se,{ownerState:j({},S,{state:K}),children:w.jsx(nTe,{ownerState:j({},S,{state:K}),className:O.wrapper,ref:k,children:w.jsx(rTe,{ownerState:j({},S,{state:K}),className:O.wrapperInner,children:o})})}))}))});dre.muiSupportAuto=!0;const hre=dre;function iTe(t){return We("MuiPaper",t)}Ve("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const oTe=["className","component","elevation","square","variant"],aTe=t=>{const{square:e,elevation:n,variant:r,classes:i}=t,o={root:["root",r,!e&&"rounded",r==="elevation"&&`elevation${n}`]};return Ue(o,iTe,i)},sTe=we("div",{name:"MuiPaper",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],!n.square&&e.rounded,n.variant==="elevation"&&e[`elevation${n.elevation}`]]}})(({theme:t,ownerState:e})=>{var n;return j({backgroundColor:(t.vars||t).palette.background.paper,color:(t.vars||t).palette.text.primary,transition:t.transitions.create("box-shadow")},!e.square&&{borderRadius:t.shape.borderRadius},e.variant==="outlined"&&{border:`1px solid ${(t.vars||t).palette.divider}`},e.variant==="elevation"&&j({boxShadow:(t.vars||t).shadows[e.elevation]},!t.vars&&t.palette.mode==="dark"&&{backgroundImage:`linear-gradient(${kt("#fff",$V(e.elevation))}, ${kt("#fff",$V(e.elevation))})`},t.vars&&{backgroundImage:(n=t.vars.overlays)==null?void 0:n[e.elevation]}))}),lTe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiPaper"}),{className:i,component:o="div",elevation:a=1,square:s=!1,variant:l="elevation"}=r,c=Ae(r,oTe),u=j({},r,{component:o,elevation:a,square:s,variant:l}),f=aTe(u);return w.jsx(sTe,j({as:o,ownerState:u,className:ke(f.root,i),ref:n},c))}),Go=lTe;function zl(t){return typeof t=="string"}function Hm(t,e,n){return t===void 0||zl(t)?e:j({},e,{ownerState:j({},e.ownerState,n)})}function cTe(t,e,n=(r,i)=>r===i){return t.length===e.length&&t.every((r,i)=>n(r,e[i]))}const uTe={disableDefaultClasses:!1},fTe=M.createContext(uTe);function dTe(t){const{disableDefaultClasses:e}=M.useContext(fTe);return n=>e?"":t(n)}function kh(t,e=[]){if(t===void 0)return{};const n={};return Object.keys(t).filter(r=>r.match(/^on[A-Z]/)&&typeof t[r]=="function"&&!e.includes(r)).forEach(r=>{n[r]=t[r]}),n}function pre(t,e,n){return typeof t=="function"?t(e,n):t}function jV(t){if(t===void 0)return{};const e={};return Object.keys(t).filter(n=>!(n.match(/^on[A-Z]/)&&typeof t[n]=="function")).forEach(n=>{e[n]=t[n]}),e}function mre(t){const{getSlotProps:e,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:o}=t;if(!e){const h=ke(n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),p=j({},n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),m=j({},n,i,r);return h.length>0&&(m.className=h),Object.keys(p).length>0&&(m.style=p),{props:m,internalRef:void 0}}const a=kh(j({},i,r)),s=jV(r),l=jV(i),c=e(a),u=ke(c==null?void 0:c.className,n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),f=j({},c==null?void 0:c.style,n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),d=j({},c,n,l,s);return u.length>0&&(d.className=u),Object.keys(f).length>0&&(d.style=f),{props:d,internalRef:c.ref}}const hTe=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function Lr(t){var e;const{elementType:n,externalSlotProps:r,ownerState:i,skipResolvingSlotProps:o=!1}=t,a=Ae(t,hTe),s=o?{}:pre(r,i),{props:l,internalRef:c}=mre(j({},a,{externalSlotProps:s})),u=Zt(c,s==null?void 0:s.ref,(e=t.additionalProps)==null?void 0:e.ref);return Hm(n,j({},l,{ref:u}),i)}const pTe=["className","elementType","ownerState","externalForwardedProps","getSlotOwnerState","internalForwardedProps"],mTe=["component","slots","slotProps"],gTe=["component"];function vTe(t,e){const{className:n,elementType:r,ownerState:i,externalForwardedProps:o,getSlotOwnerState:a,internalForwardedProps:s}=e,l=Ae(e,pTe),{component:c,slots:u={[t]:void 0},slotProps:f={[t]:void 0}}=o,d=Ae(o,mTe),h=u[t]||r,p=pre(f[t],i),m=mre(j({className:n},l,{externalForwardedProps:t==="root"?d:void 0,externalSlotProps:p})),{props:{component:g},internalRef:v}=m,y=Ae(m.props,gTe),x=Zt(v,p==null?void 0:p.ref,e.ref),b=a?a(y):{},_=j({},i,b),S=t==="root"?g||c:g,O=Hm(h,j({},t==="root"&&!c&&!u[t]&&s,t!=="root"&&!u[t]&&s,y,S&&{as:S},{ref:x}),_);return Object.keys(b).forEach(C=>{delete O[C]}),[h,O]}function yTe(t){const{className:e,classes:n,pulsate:r=!1,rippleX:i,rippleY:o,rippleSize:a,in:s,onExited:l,timeout:c}=t,[u,f]=M.useState(!1),d=ke(e,n.ripple,n.rippleVisible,r&&n.ripplePulsate),h={width:a,height:a,top:-(a/2)+o,left:-(a/2)+i},p=ke(n.child,u&&n.childLeaving,r&&n.childPulsate);return!s&&!u&&f(!0),M.useEffect(()=>{if(!s&&l!=null){const m=setTimeout(l,c);return()=>{clearTimeout(m)}}},[l,s,c]),w.jsx("span",{className:d,style:h,children:w.jsx("span",{className:p})})}const Fa=Ve("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),xTe=["center","classes","className"];let MM=t=>t,BV,zV,UV,WV;const kL=550,bTe=80,_Te=Gv(BV||(BV=MM` 0% { transform: scale(0); opacity: 0.1; @@ -93,7 +93,7 @@ const store = createStore( transform: scale(1); opacity: 0.3; } -`)),_Te=Gv(BV||(BV=MM` +`)),wTe=Gv(zV||(zV=MM` 0% { opacity: 1; } @@ -101,7 +101,7 @@ const store = createStore( 100% { opacity: 0; } -`)),wTe=Gv(zV||(zV=MM` +`)),STe=Gv(UV||(UV=MM` 0% { transform: scale(1); } @@ -113,7 +113,7 @@ const store = createStore( 100% { transform: scale(1); } -`)),STe=we("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),OTe=we(vTe,{name:"MuiTouchRipple",slot:"Ripple"})(UV||(UV=MM` +`)),OTe=we("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),CTe=we(yTe,{name:"MuiTouchRipple",slot:"Ripple"})(WV||(WV=MM` opacity: 0; position: absolute; @@ -156,8 +156,8 @@ const store = createStore( animation-iteration-count: infinite; animation-delay: 200ms; } -`),Fa.rippleVisible,bTe,ML,({theme:t})=>t.transitions.easing.easeInOut,Fa.ripplePulsate,({theme:t})=>t.transitions.duration.shorter,Fa.child,Fa.childLeaving,_Te,ML,({theme:t})=>t.transitions.easing.easeInOut,Fa.childPulsate,wTe,({theme:t})=>t.transitions.easing.easeInOut),CTe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTouchRipple"}),{center:i=!1,classes:o={},className:a}=r,s=Ae(r,yTe),[l,c]=M.useState([]),u=M.useRef(0),f=M.useRef(null);M.useEffect(()=>{f.current&&(f.current(),f.current=null)},[l]);const d=M.useRef(!1),h=mf(),p=M.useRef(null),m=M.useRef(null),g=M.useCallback(b=>{const{pulsate:_,rippleX:S,rippleY:O,rippleSize:C,cb:E}=b;c(k=>[...k,w.jsx(OTe,{classes:{ripple:ke(o.ripple,Fa.ripple),rippleVisible:ke(o.rippleVisible,Fa.rippleVisible),ripplePulsate:ke(o.ripplePulsate,Fa.ripplePulsate),child:ke(o.child,Fa.child),childLeaving:ke(o.childLeaving,Fa.childLeaving),childPulsate:ke(o.childPulsate,Fa.childPulsate)},timeout:ML,pulsate:_,rippleX:S,rippleY:O,rippleSize:C},u.current)]),u.current+=1,f.current=E},[o]),v=M.useCallback((b={},_={},S=()=>{})=>{const{pulsate:O=!1,center:C=i||_.pulsate,fakeElement:E=!1}=_;if((b==null?void 0:b.type)==="mousedown"&&d.current){d.current=!1;return}(b==null?void 0:b.type)==="touchstart"&&(d.current=!0);const k=E?null:m.current,I=k?k.getBoundingClientRect():{width:0,height:0,left:0,top:0};let P,R,T;if(C||b===void 0||b.clientX===0&&b.clientY===0||!b.clientX&&!b.touches)P=Math.round(I.width/2),R=Math.round(I.height/2);else{const{clientX:L,clientY:z}=b.touches&&b.touches.length>0?b.touches[0]:b;P=Math.round(L-I.left),R=Math.round(z-I.top)}if(C)T=Math.sqrt((2*I.width**2+I.height**2)/3),T%2===0&&(T+=1);else{const L=Math.max(Math.abs((k?k.clientWidth:0)-P),P)*2+2,z=Math.max(Math.abs((k?k.clientHeight:0)-R),R)*2+2;T=Math.sqrt(L**2+z**2)}b!=null&&b.touches?p.current===null&&(p.current=()=>{g({pulsate:O,rippleX:P,rippleY:R,rippleSize:T,cb:S})},h.start(xTe,()=>{p.current&&(p.current(),p.current=null)})):g({pulsate:O,rippleX:P,rippleY:R,rippleSize:T,cb:S})},[i,g,h]),y=M.useCallback(()=>{v({},{pulsate:!0})},[v]),x=M.useCallback((b,_)=>{if(h.clear(),(b==null?void 0:b.type)==="touchend"&&p.current){p.current(),p.current=null,h.start(0,()=>{x(b,_)});return}p.current=null,c(S=>S.length>0?S.slice(1):S),f.current=_},[h]);return M.useImperativeHandle(n,()=>({pulsate:y,start:v,stop:x}),[y,v,x]),w.jsx(STe,j({className:ke(Fa.root,o.root,a),ref:m},s,{children:w.jsx(t5,{component:null,exit:!0,children:l})}))}),TTe=CTe;function ETe(t){return We("MuiButtonBase",t)}const PTe=Ve("MuiButtonBase",["root","disabled","focusVisible"]),MTe=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],kTe=t=>{const{disabled:e,focusVisible:n,focusVisibleClassName:r,classes:i}=t,a=Ue({root:["root",e&&"disabled",n&&"focusVisible"]},ETe,i);return n&&r&&(a.root+=` ${r}`),a},ATe=we("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${PTe.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),RTe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiButtonBase"}),{action:i,centerRipple:o=!1,children:a,className:s,component:l="button",disabled:c=!1,disableRipple:u=!1,disableTouchRipple:f=!1,focusRipple:d=!1,LinkComponent:h="a",onBlur:p,onClick:m,onContextMenu:g,onDragLeave:v,onFocus:y,onFocusVisible:x,onKeyDown:b,onKeyUp:_,onMouseDown:S,onMouseLeave:O,onMouseUp:C,onTouchEnd:E,onTouchMove:k,onTouchStart:I,tabIndex:P=0,TouchRippleProps:R,touchRippleRef:T,type:L}=r,z=Ae(r,MTe),B=M.useRef(null),W=M.useRef(null),U=Zt(W,T),{isFocusVisibleRef:N,onFocus:$,onBlur:D,ref:A}=C1(),[q,Y]=M.useState(!1);c&&q&&Y(!1),M.useImperativeHandle(i,()=>({focusVisible:()=>{Y(!0),B.current.focus()}}),[]);const[K,se]=M.useState(!1);M.useEffect(()=>{se(!0)},[]);const te=K&&!u&&!c;M.useEffect(()=>{q&&d&&!u&&K&&W.current.pulsate()},[u,d,q,K]);function J(V,de,xe=f){return br(Me=>(de&&de(Me),!xe&&W.current&&W.current[V](Me),!0))}const pe=J("start",S),be=J("stop",g),re=J("stop",v),ve=J("stop",C),F=J("stop",V=>{q&&V.preventDefault(),O&&O(V)}),ce=J("start",I),le=J("stop",E),Q=J("stop",k),X=J("stop",V=>{D(V),N.current===!1&&Y(!1),p&&p(V)},!1),ee=br(V=>{B.current||(B.current=V.currentTarget),$(V),N.current===!0&&(Y(!0),x&&x(V)),y&&y(V)}),ge=()=>{const V=B.current;return l&&l!=="button"&&!(V.tagName==="A"&&V.href)},ye=M.useRef(!1),H=br(V=>{d&&!ye.current&&q&&W.current&&V.key===" "&&(ye.current=!0,W.current.stop(V,()=>{W.current.start(V)})),V.target===V.currentTarget&&ge()&&V.key===" "&&V.preventDefault(),b&&b(V),V.target===V.currentTarget&&ge()&&V.key==="Enter"&&!c&&(V.preventDefault(),m&&m(V))}),G=br(V=>{d&&V.key===" "&&W.current&&q&&!V.defaultPrevented&&(ye.current=!1,W.current.stop(V,()=>{W.current.pulsate(V)})),_&&_(V),m&&V.target===V.currentTarget&&ge()&&V.key===" "&&!V.defaultPrevented&&m(V)});let ie=l;ie==="button"&&(z.href||z.to)&&(ie=h);const he={};ie==="button"?(he.type=L===void 0?"button":L,he.disabled=c):(!z.href&&!z.to&&(he.role="button"),c&&(he["aria-disabled"]=c));const _e=Zt(n,A,B),oe=j({},r,{centerRipple:o,component:l,disabled:c,disableRipple:u,disableTouchRipple:f,focusRipple:d,tabIndex:P,focusVisible:q}),Z=kTe(oe);return w.jsxs(ATe,j({as:ie,className:ke(Z.root,s),ownerState:oe,onBlur:X,onClick:m,onContextMenu:be,onFocus:ee,onKeyDown:H,onKeyUp:G,onMouseDown:pe,onMouseLeave:F,onMouseUp:ve,onDragLeave:re,onTouchEnd:le,onTouchMove:Q,onTouchStart:ce,ref:_e,tabIndex:c?-1:P,type:L},he,z,{children:[a,te?w.jsx(TTe,j({ref:U,center:o},R)):null]}))}),us=RTe;function ITe(t){return We("MuiIconButton",t)}const DTe=Ve("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),LTe=["edge","children","className","color","disabled","disableFocusRipple","size"],$Te=t=>{const{classes:e,disabled:n,color:r,edge:i,size:o}=t,a={root:["root",n&&"disabled",r!=="default"&&`color${De(r)}`,i&&`edge${De(i)}`,`size${De(o)}`]};return Ue(a,ITe,e)},NTe=we(us,{name:"MuiIconButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color!=="default"&&e[`color${De(n.color)}`],n.edge&&e[`edge${De(n.edge)}`],e[`size${De(n.size)}`]]}})(({theme:t,ownerState:e})=>j({textAlign:"center",flex:"0 0 auto",fontSize:t.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(t.vars||t).palette.action.active,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest})},!e.disableRipple&&{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},e.edge==="start"&&{marginLeft:e.size==="small"?-3:-12},e.edge==="end"&&{marginRight:e.size==="small"?-3:-12}),({theme:t,ownerState:e})=>{var n;const r=(n=(t.vars||t).palette)==null?void 0:n[e.color];return j({},e.color==="inherit"&&{color:"inherit"},e.color!=="inherit"&&e.color!=="default"&&j({color:r==null?void 0:r.main},!e.disableRipple&&{"&:hover":j({},r&&{backgroundColor:t.vars?`rgba(${r.mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(r.main,t.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),e.size==="small"&&{padding:5,fontSize:t.typography.pxToRem(18)},e.size==="large"&&{padding:12,fontSize:t.typography.pxToRem(28)},{[`&.${DTe.disabled}`]:{backgroundColor:"transparent",color:(t.vars||t).palette.action.disabled}})}),FTe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiIconButton"}),{edge:i=!1,children:o,className:a,color:s="default",disabled:l=!1,disableFocusRipple:c=!1,size:u="medium"}=r,f=Ae(r,LTe),d=j({},r,{edge:i,color:s,disabled:l,disableFocusRipple:c,size:u}),h=$Te(d);return w.jsx(NTe,j({className:ke(h.root,a),centerRipple:!0,focusRipple:!c,disabled:l,ref:n},f,{ownerState:d,children:o}))}),Ot=FTe;function jTe(t){return We("MuiTypography",t)}Ve("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const BTe=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],zTe=t=>{const{align:e,gutterBottom:n,noWrap:r,paragraph:i,variant:o,classes:a}=t,s={root:["root",o,t.align!=="inherit"&&`align${De(e)}`,n&&"gutterBottom",r&&"noWrap",i&&"paragraph"]};return Ue(s,jTe,a)},UTe=we("span",{name:"MuiTypography",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.variant&&e[n.variant],n.align!=="inherit"&&e[`align${De(n.align)}`],n.noWrap&&e.noWrap,n.gutterBottom&&e.gutterBottom,n.paragraph&&e.paragraph]}})(({theme:t,ownerState:e})=>j({margin:0},e.variant==="inherit"&&{font:"inherit"},e.variant!=="inherit"&&t.typography[e.variant],e.align!=="inherit"&&{textAlign:e.align},e.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},e.gutterBottom&&{marginBottom:"0.35em"},e.paragraph&&{marginBottom:16})),WV={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},WTe={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},VTe=t=>WTe[t]||t,GTe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTypography"}),i=VTe(r.color),o=S1(j({},r,{color:i})),{align:a="inherit",className:s,component:l,gutterBottom:c=!1,noWrap:u=!1,paragraph:f=!1,variant:d="body1",variantMapping:h=WV}=o,p=Ae(o,BTe),m=j({},o,{align:a,color:i,className:s,component:l,gutterBottom:c,noWrap:u,paragraph:f,variant:d,variantMapping:h}),g=l||(f?"p":h[d]||WV[d])||"span",v=zTe(m);return w.jsx(UTe,j({as:g,ref:n,ownerState:m,className:ke(v.root,s)},p))}),At=GTe;function HTe(t){return We("MuiAppBar",t)}Ve("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const qTe=["className","color","enableColorOnDark","position"],XTe=t=>{const{color:e,position:n,classes:r}=t,i={root:["root",`color${De(e)}`,`position${De(n)}`]};return Ue(i,HTe,r)},Yw=(t,e)=>t?`${t==null?void 0:t.replace(")","")}, ${e})`:e,QTe=we(Go,{name:"MuiAppBar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`position${De(n.position)}`],e[`color${De(n.color)}`]]}})(({theme:t,ownerState:e})=>{const n=t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[900];return j({display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0},e.position==="fixed"&&{position:"fixed",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}},e.position==="absolute"&&{position:"absolute",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0},e.position==="sticky"&&{position:"sticky",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0},e.position==="static"&&{position:"static"},e.position==="relative"&&{position:"relative"},!t.vars&&j({},e.color==="default"&&{backgroundColor:n,color:t.palette.getContrastText(n)},e.color&&e.color!=="default"&&e.color!=="inherit"&&e.color!=="transparent"&&{backgroundColor:t.palette[e.color].main,color:t.palette[e.color].contrastText},e.color==="inherit"&&{color:"inherit"},t.palette.mode==="dark"&&!e.enableColorOnDark&&{backgroundColor:null,color:null},e.color==="transparent"&&j({backgroundColor:"transparent",color:"inherit"},t.palette.mode==="dark"&&{backgroundImage:"none"})),t.vars&&j({},e.color==="default"&&{"--AppBar-background":e.enableColorOnDark?t.vars.palette.AppBar.defaultBg:Yw(t.vars.palette.AppBar.darkBg,t.vars.palette.AppBar.defaultBg),"--AppBar-color":e.enableColorOnDark?t.vars.palette.text.primary:Yw(t.vars.palette.AppBar.darkColor,t.vars.palette.text.primary)},e.color&&!e.color.match(/^(default|inherit|transparent)$/)&&{"--AppBar-background":e.enableColorOnDark?t.vars.palette[e.color].main:Yw(t.vars.palette.AppBar.darkBg,t.vars.palette[e.color].main),"--AppBar-color":e.enableColorOnDark?t.vars.palette[e.color].contrastText:Yw(t.vars.palette.AppBar.darkColor,t.vars.palette[e.color].contrastText)},{backgroundColor:"var(--AppBar-background)",color:e.color==="inherit"?"inherit":"var(--AppBar-color)"},e.color==="transparent"&&{backgroundImage:"none",backgroundColor:"transparent",color:"inherit"}))}),YTe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiAppBar"}),{className:i,color:o="primary",enableColorOnDark:a=!1,position:s="fixed"}=r,l=Ae(r,qTe),c=j({},r,{color:o,position:s,enableColorOnDark:a}),u=XTe(c);return w.jsx(QTe,j({square:!0,component:"header",ownerState:c,elevation:4,className:ke(u.root,i,s==="fixed"&&"mui-fixed"),ref:n},l))}),pre=YTe,mre="base";function KTe(t){return`${mre}--${t}`}function ZTe(t,e){return`${mre}-${t}-${e}`}function gre(t,e){const n=Fne[e];return n?KTe(n):ZTe(t,e)}function JTe(t,e){const n={};return e.forEach(r=>{n[r]=gre(t,r)}),n}function VV(t){return t.substring(2).toLowerCase()}function eEe(t,e){return e.documentElement.clientWidth(setTimeout(()=>{l.current=!0},0),()=>{l.current=!1}),[]);const u=Zt(e.ref,s),f=br(p=>{const m=c.current;c.current=!1;const g=$n(s.current);if(!l.current||!s.current||"clientX"in p&&eEe(p,g))return;if(a.current){a.current=!1;return}let v;p.composedPath?v=p.composedPath().indexOf(s.current)>-1:v=!g.documentElement.contains(p.target)||s.current.contains(p.target),!v&&(n||!m)&&i(p)}),d=p=>m=>{c.current=!0;const g=e.props[p];g&&g(m)},h={ref:u};return o!==!1&&(h[o]=d(o)),M.useEffect(()=>{if(o!==!1){const p=VV(o),m=$n(s.current),g=()=>{a.current=!0};return m.addEventListener(p,f),m.addEventListener("touchmove",g),()=>{m.removeEventListener(p,f),m.removeEventListener("touchmove",g)}}},[f,o]),r!==!1&&(h[r]=d(r)),M.useEffect(()=>{if(r!==!1){const p=VV(r),m=$n(s.current);return m.addEventListener(p,f),()=>{m.removeEventListener(p,f)}}},[f,r]),w.jsx(M.Fragment,{children:M.cloneElement(e,h)})}const nEe=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function rEe(t){const e=parseInt(t.getAttribute("tabindex")||"",10);return Number.isNaN(e)?t.contentEditable==="true"||(t.nodeName==="AUDIO"||t.nodeName==="VIDEO"||t.nodeName==="DETAILS")&&t.getAttribute("tabindex")===null?0:t.tabIndex:e}function iEe(t){if(t.tagName!=="INPUT"||t.type!=="radio"||!t.name)return!1;const e=r=>t.ownerDocument.querySelector(`input[type="radio"]${r}`);let n=e(`[name="${t.name}"]:checked`);return n||(n=e(`[name="${t.name}"]`)),n!==t}function oEe(t){return!(t.disabled||t.tagName==="INPUT"&&t.type==="hidden"||iEe(t))}function aEe(t){const e=[],n=[];return Array.from(t.querySelectorAll(nEe)).forEach((r,i)=>{const o=rEe(r);o===-1||!oEe(r)||(o===0?e.push(r):n.push({documentOrder:i,tabIndex:o,node:r}))}),n.sort((r,i)=>r.tabIndex===i.tabIndex?r.documentOrder-i.documentOrder:r.tabIndex-i.tabIndex).map(r=>r.node).concat(e)}function sEe(){return!0}function vre(t){const{children:e,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:i=!1,getTabbable:o=aEe,isEnabled:a=sEe,open:s}=t,l=M.useRef(!1),c=M.useRef(null),u=M.useRef(null),f=M.useRef(null),d=M.useRef(null),h=M.useRef(!1),p=M.useRef(null),m=Zt(e.ref,p),g=M.useRef(null);M.useEffect(()=>{!s||!p.current||(h.current=!n)},[n,s]),M.useEffect(()=>{if(!s||!p.current)return;const x=$n(p.current);return p.current.contains(x.activeElement)||(p.current.hasAttribute("tabIndex")||p.current.setAttribute("tabIndex","-1"),h.current&&p.current.focus()),()=>{i||(f.current&&f.current.focus&&(l.current=!0,f.current.focus()),f.current=null)}},[s]),M.useEffect(()=>{if(!s||!p.current)return;const x=$n(p.current),b=O=>{g.current=O,!(r||!a()||O.key!=="Tab")&&x.activeElement===p.current&&O.shiftKey&&(l.current=!0,u.current&&u.current.focus())},_=()=>{const O=p.current;if(O===null)return;if(!x.hasFocus()||!a()||l.current){l.current=!1;return}if(O.contains(x.activeElement)||r&&x.activeElement!==c.current&&x.activeElement!==u.current)return;if(x.activeElement!==d.current)d.current=null;else if(d.current!==null)return;if(!h.current)return;let C=[];if((x.activeElement===c.current||x.activeElement===u.current)&&(C=o(p.current)),C.length>0){var E,k;const I=!!((E=g.current)!=null&&E.shiftKey&&((k=g.current)==null?void 0:k.key)==="Tab"),P=C[0],R=C[C.length-1];typeof P!="string"&&typeof R!="string"&&(I?R.focus():P.focus())}else O.focus()};x.addEventListener("focusin",_),x.addEventListener("keydown",b,!0);const S=setInterval(()=>{x.activeElement&&x.activeElement.tagName==="BODY"&&_()},50);return()=>{clearInterval(S),x.removeEventListener("focusin",_),x.removeEventListener("keydown",b,!0)}},[n,r,i,a,s,o]);const v=x=>{f.current===null&&(f.current=x.relatedTarget),h.current=!0,d.current=x.target;const b=e.props.onFocus;b&&b(x)},y=x=>{f.current===null&&(f.current=x.relatedTarget),h.current=!0};return w.jsxs(M.Fragment,{children:[w.jsx("div",{tabIndex:s?0:-1,onFocus:y,ref:c,"data-testid":"sentinelStart"}),M.cloneElement(e,{ref:m,onFocus:v}),w.jsx("div",{tabIndex:s?0:-1,onFocus:y,ref:u,"data-testid":"sentinelEnd"})]})}function lEe(t){return typeof t=="function"?t():t}const yre=M.forwardRef(function(e,n){const{children:r,container:i,disablePortal:o=!1}=e,[a,s]=M.useState(null),l=Zt(M.isValidElement(r)?r.ref:null,n);if(Vr(()=>{o||s(lEe(i)||document.body)},[i,o]),Vr(()=>{if(a&&!o)return xT(n,a),()=>{xT(n,null)}},[n,a,o]),o){if(M.isValidElement(r)){const c={ref:l};return M.cloneElement(r,c)}return w.jsx(M.Fragment,{children:r})}return w.jsx(M.Fragment,{children:a&&Wv.createPortal(r,a)})});function cEe(t){const e=$n(t);return e.body===t?ls(t).innerWidth>e.documentElement.clientWidth:t.scrollHeight>t.clientHeight}function Dx(t,e){e?t.setAttribute("aria-hidden","true"):t.removeAttribute("aria-hidden")}function GV(t){return parseInt(ls(t).getComputedStyle(t).paddingRight,10)||0}function uEe(t){const n=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(t.tagName)!==-1,r=t.tagName==="INPUT"&&t.getAttribute("type")==="hidden";return n||r}function HV(t,e,n,r,i){const o=[e,n,...r];[].forEach.call(t.children,a=>{const s=o.indexOf(a)===-1,l=!uEe(a);s&&l&&Dx(a,i)})}function vA(t,e){let n=-1;return t.some((r,i)=>e(r)?(n=i,!0):!1),n}function fEe(t,e){const n=[],r=t.container;if(!e.disableScrollLock){if(cEe(r)){const a=Xne($n(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${GV(r)+a}px`;const s=$n(r).querySelectorAll(".mui-fixed");[].forEach.call(s,l=>{n.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${GV(l)+a}px`})}let o;if(r.parentNode instanceof DocumentFragment)o=$n(r).body;else{const a=r.parentElement,s=ls(r);o=(a==null?void 0:a.nodeName)==="HTML"&&s.getComputedStyle(a).overflowY==="scroll"?a:r}n.push({value:o.style.overflow,property:"overflow",el:o},{value:o.style.overflowX,property:"overflow-x",el:o},{value:o.style.overflowY,property:"overflow-y",el:o}),o.style.overflow="hidden"}return()=>{n.forEach(({value:o,el:a,property:s})=>{o?a.style.setProperty(s,o):a.style.removeProperty(s)})}}function dEe(t){const e=[];return[].forEach.call(t.children,n=>{n.getAttribute("aria-hidden")==="true"&&e.push(n)}),e}class hEe{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(e,n){let r=this.modals.indexOf(e);if(r!==-1)return r;r=this.modals.length,this.modals.push(e),e.modalRef&&Dx(e.modalRef,!1);const i=dEe(n);HV(n,e.mount,e.modalRef,i,!0);const o=vA(this.containers,a=>a.container===n);return o!==-1?(this.containers[o].modals.push(e),r):(this.containers.push({modals:[e],container:n,restore:null,hiddenSiblings:i}),r)}mount(e,n){const r=vA(this.containers,o=>o.modals.indexOf(e)!==-1),i=this.containers[r];i.restore||(i.restore=fEe(i,n))}remove(e,n=!0){const r=this.modals.indexOf(e);if(r===-1)return r;const i=vA(this.containers,a=>a.modals.indexOf(e)!==-1),o=this.containers[i];if(o.modals.splice(o.modals.indexOf(e),1),this.modals.splice(r,1),o.modals.length===0)o.restore&&o.restore(),e.modalRef&&Dx(e.modalRef,n),HV(o.container,e.mount,e.modalRef,o.hiddenSiblings,!1),this.containers.splice(i,1);else{const a=o.modals[o.modals.length-1];a.modalRef&&Dx(a.modalRef,!1)}return r}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}}function pEe(t){return typeof t=="function"?t():t}function mEe(t){return t?t.props.hasOwnProperty("in"):!1}const gEe=new hEe;function vEe(t){const{container:e,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,manager:i=gEe,closeAfterTransition:o=!1,onTransitionEnter:a,onTransitionExited:s,children:l,onClose:c,open:u,rootRef:f}=t,d=M.useRef({}),h=M.useRef(null),p=M.useRef(null),m=Zt(p,f),[g,v]=M.useState(!u),y=mEe(l);let x=!0;(t["aria-hidden"]==="false"||t["aria-hidden"]===!1)&&(x=!1);const b=()=>$n(h.current),_=()=>(d.current.modalRef=p.current,d.current.mount=h.current,d.current),S=()=>{i.mount(_(),{disableScrollLock:r}),p.current&&(p.current.scrollTop=0)},O=br(()=>{const z=pEe(e)||b().body;i.add(_(),z),p.current&&S()}),C=M.useCallback(()=>i.isTopModal(_()),[i]),E=br(z=>{h.current=z,z&&(u&&C()?S():p.current&&Dx(p.current,x))}),k=M.useCallback(()=>{i.remove(_(),x)},[x,i]);M.useEffect(()=>()=>{k()},[k]),M.useEffect(()=>{u?O():(!y||!o)&&k()},[u,k,y,o,O]);const I=z=>B=>{var W;(W=z.onKeyDown)==null||W.call(z,B),!(B.key!=="Escape"||B.which===229||!C())&&(n||(B.stopPropagation(),c&&c(B,"escapeKeyDown")))},P=z=>B=>{var W;(W=z.onClick)==null||W.call(z,B),B.target===B.currentTarget&&c&&c(B,"backdropClick")};return{getRootProps:(z={})=>{const B=kh(t);delete B.onTransitionEnter,delete B.onTransitionExited;const W=j({},B,z);return j({role:"presentation"},W,{onKeyDown:I(W),ref:m})},getBackdropProps:(z={})=>{const B=z;return j({"aria-hidden":!0},B,{onClick:P(B),open:u})},getTransitionProps:()=>{const z=()=>{v(!1),a&&a()},B=()=>{v(!0),s&&s(),o&&k()};return{onEnter:yT(z,l==null?void 0:l.props.onEnter),onExited:yT(B,l==null?void 0:l.props.onExited)}},rootRef:m,portalRef:E,isTopModal:C,exited:g,hasTransition:y}}var Lo="top",fs="bottom",ds="right",$o="left",r5="auto",k1=[Lo,fs,ds,$o],Vg="start",Mb="end",yEe="clippingParents",xre="viewport",l0="popper",xEe="reference",qV=k1.reduce(function(t,e){return t.concat([e+"-"+Vg,e+"-"+Mb])},[]),bre=[].concat(k1,[r5]).reduce(function(t,e){return t.concat([e,e+"-"+Vg,e+"-"+Mb])},[]),bEe="beforeRead",_Ee="read",wEe="afterRead",SEe="beforeMain",OEe="main",CEe="afterMain",TEe="beforeWrite",EEe="write",PEe="afterWrite",MEe=[bEe,_Ee,wEe,SEe,OEe,CEe,TEe,EEe,PEe];function Yl(t){return t?(t.nodeName||"").toLowerCase():null}function Sa(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function qh(t){var e=Sa(t).Element;return t instanceof e||t instanceof Element}function Ja(t){var e=Sa(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function i5(t){if(typeof ShadowRoot>"u")return!1;var e=Sa(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function kEe(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},o=e.elements[n];!Ja(o)||!Yl(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var s=i[a];s===!1?o.removeAttribute(a):o.setAttribute(a,s===!0?"":s)}))})}function AEe(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},a=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),s=a.reduce(function(l,c){return l[c]="",l},{});!Ja(i)||!Yl(i)||(Object.assign(i.style,s),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const REe={name:"applyStyles",enabled:!0,phase:"write",fn:kEe,effect:AEe,requires:["computeStyles"]};function Ul(t){return t.split("-")[0]}var Ah=Math.max,ST=Math.min,Gg=Math.round;function kL(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function _re(){return!/^((?!chrome|android).)*safari/i.test(kL())}function Hg(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&Ja(t)&&(i=t.offsetWidth>0&&Gg(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&Gg(r.height)/t.offsetHeight||1);var a=qh(t)?Sa(t):window,s=a.visualViewport,l=!_re()&&n,c=(r.left+(l&&s?s.offsetLeft:0))/i,u=(r.top+(l&&s?s.offsetTop:0))/o,f=r.width/i,d=r.height/o;return{width:f,height:d,top:u,right:c+f,bottom:u+d,left:c,x:c,y:u}}function o5(t){var e=Hg(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function wre(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&i5(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function lu(t){return Sa(t).getComputedStyle(t)}function IEe(t){return["table","td","th"].indexOf(Yl(t))>=0}function ud(t){return((qh(t)?t.ownerDocument:t.document)||window.document).documentElement}function kM(t){return Yl(t)==="html"?t:t.assignedSlot||t.parentNode||(i5(t)?t.host:null)||ud(t)}function XV(t){return!Ja(t)||lu(t).position==="fixed"?null:t.offsetParent}function DEe(t){var e=/firefox/i.test(kL()),n=/Trident/i.test(kL());if(n&&Ja(t)){var r=lu(t);if(r.position==="fixed")return null}var i=kM(t);for(i5(i)&&(i=i.host);Ja(i)&&["html","body"].indexOf(Yl(i))<0;){var o=lu(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function A1(t){for(var e=Sa(t),n=XV(t);n&&IEe(n)&&lu(n).position==="static";)n=XV(n);return n&&(Yl(n)==="html"||Yl(n)==="body"&&lu(n).position==="static")?e:n||DEe(t)||e}function a5(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Lx(t,e,n){return Ah(t,ST(e,n))}function LEe(t,e,n){var r=Lx(t,e,n);return r>n?n:r}function Sre(){return{top:0,right:0,bottom:0,left:0}}function Ore(t){return Object.assign({},Sre(),t)}function Cre(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var $Ee=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,Ore(typeof e!="number"?e:Cre(e,k1))};function NEe(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Ul(n.placement),l=a5(s),c=[$o,ds].indexOf(s)>=0,u=c?"height":"width";if(!(!o||!a)){var f=$Ee(i.padding,n),d=o5(o),h=l==="y"?Lo:$o,p=l==="y"?fs:ds,m=n.rects.reference[u]+n.rects.reference[l]-a[l]-n.rects.popper[u],g=a[l]-n.rects.reference[l],v=A1(o),y=v?l==="y"?v.clientHeight||0:v.clientWidth||0:0,x=m/2-g/2,b=f[h],_=y-d[u]-f[p],S=y/2-d[u]/2+x,O=Lx(b,S,_),C=l;n.modifiersData[r]=(e={},e[C]=O,e.centerOffset=O-S,e)}}function FEe(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||wre(e.elements.popper,i)&&(e.elements.arrow=i))}const jEe={name:"arrow",enabled:!0,phase:"main",fn:NEe,effect:FEe,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function qg(t){return t.split("-")[1]}var BEe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function zEe(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:Gg(n*i)/i||0,y:Gg(r*i)/i||0}}function QV(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,a=t.offsets,s=t.position,l=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,f=t.isFixed,d=a.x,h=d===void 0?0:d,p=a.y,m=p===void 0?0:p,g=typeof u=="function"?u({x:h,y:m}):{x:h,y:m};h=g.x,m=g.y;var v=a.hasOwnProperty("x"),y=a.hasOwnProperty("y"),x=$o,b=Lo,_=window;if(c){var S=A1(n),O="clientHeight",C="clientWidth";if(S===Sa(n)&&(S=ud(n),lu(S).position!=="static"&&s==="absolute"&&(O="scrollHeight",C="scrollWidth")),S=S,i===Lo||(i===$o||i===ds)&&o===Mb){b=fs;var E=f&&S===_&&_.visualViewport?_.visualViewport.height:S[O];m-=E-r.height,m*=l?1:-1}if(i===$o||(i===Lo||i===fs)&&o===Mb){x=ds;var k=f&&S===_&&_.visualViewport?_.visualViewport.width:S[C];h-=k-r.width,h*=l?1:-1}}var I=Object.assign({position:s},c&&BEe),P=u===!0?zEe({x:h,y:m},Sa(n)):{x:h,y:m};if(h=P.x,m=P.y,l){var R;return Object.assign({},I,(R={},R[b]=y?"0":"",R[x]=v?"0":"",R.transform=(_.devicePixelRatio||1)<=1?"translate("+h+"px, "+m+"px)":"translate3d("+h+"px, "+m+"px, 0)",R))}return Object.assign({},I,(e={},e[b]=y?m+"px":"",e[x]=v?h+"px":"",e.transform="",e))}function UEe(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,s=n.roundOffsets,l=s===void 0?!0:s,c={placement:Ul(e.placement),variation:qg(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,QV(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,QV(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const WEe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:UEe,data:{}};var Kw={passive:!0};function VEe(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,s=a===void 0?!0:a,l=Sa(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach(function(u){u.addEventListener("scroll",n.update,Kw)}),s&&l.addEventListener("resize",n.update,Kw),function(){o&&c.forEach(function(u){u.removeEventListener("scroll",n.update,Kw)}),s&&l.removeEventListener("resize",n.update,Kw)}}const GEe={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:VEe,data:{}};var HEe={left:"right",right:"left",bottom:"top",top:"bottom"};function _C(t){return t.replace(/left|right|bottom|top/g,function(e){return HEe[e]})}var qEe={start:"end",end:"start"};function YV(t){return t.replace(/start|end/g,function(e){return qEe[e]})}function s5(t){var e=Sa(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function l5(t){return Hg(ud(t)).left+s5(t).scrollLeft}function XEe(t,e){var n=Sa(t),r=ud(t),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;var c=_re();(c||!c&&e==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s+l5(t),y:l}}function QEe(t){var e,n=ud(t),r=s5(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=Ah(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=Ah(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+l5(t),l=-r.scrollTop;return lu(i||n).direction==="rtl"&&(s+=Ah(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}function c5(t){var e=lu(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Tre(t){return["html","body","#document"].indexOf(Yl(t))>=0?t.ownerDocument.body:Ja(t)&&c5(t)?t:Tre(kM(t))}function $x(t,e){var n;e===void 0&&(e=[]);var r=Tre(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=Sa(r),a=i?[o].concat(o.visualViewport||[],c5(r)?r:[]):r,s=e.concat(a);return i?s:s.concat($x(kM(a)))}function AL(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function YEe(t,e){var n=Hg(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function KV(t,e,n){return e===xre?AL(XEe(t,n)):qh(e)?YEe(e,n):AL(QEe(ud(t)))}function KEe(t){var e=$x(kM(t)),n=["absolute","fixed"].indexOf(lu(t).position)>=0,r=n&&Ja(t)?A1(t):t;return qh(r)?e.filter(function(i){return qh(i)&&wre(i,r)&&Yl(i)!=="body"}):[]}function ZEe(t,e,n,r){var i=e==="clippingParents"?KEe(t):[].concat(e),o=[].concat(i,[n]),a=o[0],s=o.reduce(function(l,c){var u=KV(t,c,r);return l.top=Ah(u.top,l.top),l.right=ST(u.right,l.right),l.bottom=ST(u.bottom,l.bottom),l.left=Ah(u.left,l.left),l},KV(t,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Ere(t){var e=t.reference,n=t.element,r=t.placement,i=r?Ul(r):null,o=r?qg(r):null,a=e.x+e.width/2-n.width/2,s=e.y+e.height/2-n.height/2,l;switch(i){case Lo:l={x:a,y:e.y-n.height};break;case fs:l={x:a,y:e.y+e.height};break;case ds:l={x:e.x+e.width,y:s};break;case $o:l={x:e.x-n.width,y:s};break;default:l={x:e.x,y:e.y}}var c=i?a5(i):null;if(c!=null){var u=c==="y"?"height":"width";switch(o){case Vg:l[c]=l[c]-(e[u]/2-n[u]/2);break;case Mb:l[c]=l[c]+(e[u]/2-n[u]/2);break}}return l}function kb(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,a=o===void 0?t.strategy:o,s=n.boundary,l=s===void 0?yEe:s,c=n.rootBoundary,u=c===void 0?xre:c,f=n.elementContext,d=f===void 0?l0:f,h=n.altBoundary,p=h===void 0?!1:h,m=n.padding,g=m===void 0?0:m,v=Ore(typeof g!="number"?g:Cre(g,k1)),y=d===l0?xEe:l0,x=t.rects.popper,b=t.elements[p?y:d],_=ZEe(qh(b)?b:b.contextElement||ud(t.elements.popper),l,u,a),S=Hg(t.elements.reference),O=Ere({reference:S,element:x,strategy:"absolute",placement:i}),C=AL(Object.assign({},x,O)),E=d===l0?C:S,k={top:_.top-E.top+v.top,bottom:E.bottom-_.bottom+v.bottom,left:_.left-E.left+v.left,right:E.right-_.right+v.right},I=t.modifiersData.offset;if(d===l0&&I){var P=I[i];Object.keys(k).forEach(function(R){var T=[ds,fs].indexOf(R)>=0?1:-1,L=[Lo,fs].indexOf(R)>=0?"y":"x";k[R]+=P[L]*T})}return k}function JEe(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?bre:l,u=qg(r),f=u?s?qV:qV.filter(function(p){return qg(p)===u}):k1,d=f.filter(function(p){return c.indexOf(p)>=0});d.length===0&&(d=f);var h=d.reduce(function(p,m){return p[m]=kb(t,{placement:m,boundary:i,rootBoundary:o,padding:a})[Ul(m)],p},{});return Object.keys(h).sort(function(p,m){return h[p]-h[m]})}function ePe(t){if(Ul(t)===r5)return[];var e=_C(t);return[YV(t),e,YV(e)]}function tPe(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!0:a,l=n.fallbackPlacements,c=n.padding,u=n.boundary,f=n.rootBoundary,d=n.altBoundary,h=n.flipVariations,p=h===void 0?!0:h,m=n.allowedAutoPlacements,g=e.options.placement,v=Ul(g),y=v===g,x=l||(y||!p?[_C(g)]:ePe(g)),b=[g].concat(x).reduce(function(q,Y){return q.concat(Ul(Y)===r5?JEe(e,{placement:Y,boundary:u,rootBoundary:f,padding:c,flipVariations:p,allowedAutoPlacements:m}):Y)},[]),_=e.rects.reference,S=e.rects.popper,O=new Map,C=!0,E=b[0],k=0;k=0,L=T?"width":"height",z=kb(e,{placement:I,boundary:u,rootBoundary:f,altBoundary:d,padding:c}),B=T?R?ds:$o:R?fs:Lo;_[L]>S[L]&&(B=_C(B));var W=_C(B),U=[];if(o&&U.push(z[P]<=0),s&&U.push(z[B]<=0,z[W]<=0),U.every(function(q){return q})){E=I,C=!1;break}O.set(I,U)}if(C)for(var N=p?3:1,$=function(Y){var K=b.find(function(se){var te=O.get(se);if(te)return te.slice(0,Y).every(function(J){return J})});if(K)return E=K,"break"},D=N;D>0;D--){var A=$(D);if(A==="break")break}e.placement!==E&&(e.modifiersData[r]._skip=!0,e.placement=E,e.reset=!0)}}const nPe={name:"flip",enabled:!0,phase:"main",fn:tPe,requiresIfExists:["offset"],data:{_skip:!1}};function ZV(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function JV(t){return[Lo,ds,fs,$o].some(function(e){return t[e]>=0})}function rPe(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,a=kb(e,{elementContext:"reference"}),s=kb(e,{altBoundary:!0}),l=ZV(a,r),c=ZV(s,i,o),u=JV(l),f=JV(c);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}const iPe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:rPe};function oPe(t,e,n){var r=Ul(t),i=[$o,Lo].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[$o,ds].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function aPe(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,a=bre.reduce(function(u,f){return u[f]=oPe(f,e.rects,o),u},{}),s=a[e.placement],l=s.x,c=s.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=a}const sPe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:aPe};function lPe(t){var e=t.state,n=t.name;e.modifiersData[n]=Ere({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const cPe={name:"popperOffsets",enabled:!0,phase:"read",fn:lPe,data:{}};function uPe(t){return t==="x"?"y":"x"}function fPe(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!1:a,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,f=n.padding,d=n.tether,h=d===void 0?!0:d,p=n.tetherOffset,m=p===void 0?0:p,g=kb(e,{boundary:l,rootBoundary:c,padding:f,altBoundary:u}),v=Ul(e.placement),y=qg(e.placement),x=!y,b=a5(v),_=uPe(b),S=e.modifiersData.popperOffsets,O=e.rects.reference,C=e.rects.popper,E=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,k=typeof E=="number"?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),I=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,P={x:0,y:0};if(S){if(o){var R,T=b==="y"?Lo:$o,L=b==="y"?fs:ds,z=b==="y"?"height":"width",B=S[b],W=B+g[T],U=B-g[L],N=h?-C[z]/2:0,$=y===Vg?O[z]:C[z],D=y===Vg?-C[z]:-O[z],A=e.elements.arrow,q=h&&A?o5(A):{width:0,height:0},Y=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Sre(),K=Y[T],se=Y[L],te=Lx(0,O[z],q[z]),J=x?O[z]/2-N-te-K-k.mainAxis:$-te-K-k.mainAxis,pe=x?-O[z]/2+N+te+se+k.mainAxis:D+te+se+k.mainAxis,be=e.elements.arrow&&A1(e.elements.arrow),re=be?b==="y"?be.clientTop||0:be.clientLeft||0:0,ve=(R=I==null?void 0:I[b])!=null?R:0,F=B+J-ve-re,ce=B+pe-ve,le=Lx(h?ST(W,F):W,B,h?Ah(U,ce):U);S[b]=le,P[b]=le-B}if(s){var Q,X=b==="x"?Lo:$o,ee=b==="x"?fs:ds,ge=S[_],ye=_==="y"?"height":"width",H=ge+g[X],G=ge-g[ee],ie=[Lo,$o].indexOf(v)!==-1,he=(Q=I==null?void 0:I[_])!=null?Q:0,_e=ie?H:ge-O[ye]-C[ye]-he+k.altAxis,oe=ie?ge+O[ye]+C[ye]-he-k.altAxis:G,Z=h&&ie?LEe(_e,ge,oe):Lx(h?_e:H,ge,h?oe:G);S[_]=Z,P[_]=Z-ge}e.modifiersData[r]=P}}const dPe={name:"preventOverflow",enabled:!0,phase:"main",fn:fPe,requiresIfExists:["offset"]};function hPe(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function pPe(t){return t===Sa(t)||!Ja(t)?s5(t):hPe(t)}function mPe(t){var e=t.getBoundingClientRect(),n=Gg(e.width)/t.offsetWidth||1,r=Gg(e.height)/t.offsetHeight||1;return n!==1||r!==1}function gPe(t,e,n){n===void 0&&(n=!1);var r=Ja(e),i=Ja(e)&&mPe(e),o=ud(e),a=Hg(t,i,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((Yl(e)!=="body"||c5(o))&&(s=pPe(e)),Ja(e)?(l=Hg(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):o&&(l.x=l5(o))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function vPe(t){var e=new Map,n=new Set,r=[];t.forEach(function(o){e.set(o.name,o)});function i(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(s){if(!n.has(s)){var l=e.get(s);l&&i(l)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function yPe(t){var e=vPe(t);return MEe.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function xPe(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function bPe(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var e8={placement:"bottom",modifiers:[],strategy:"absolute"};function t8(){for(var t=arguments.length,e=new Array(t),n=0;nUe({root:["root"]},fTe(OPe)),kPe={},APe=M.forwardRef(function(e,n){var r;const{anchorEl:i,children:o,direction:a,disablePortal:s,modifiers:l,open:c,placement:u,popperOptions:f,popperRef:d,slotProps:h={},slots:p={},TransitionProps:m}=e,g=Ae(e,CPe),v=M.useRef(null),y=Zt(v,n),x=M.useRef(null),b=Zt(x,d),_=M.useRef(b);Vr(()=>{_.current=b},[b]),M.useImperativeHandle(d,()=>x.current,[]);const S=EPe(u,a),[O,C]=M.useState(S),[E,k]=M.useState(RL(i));M.useEffect(()=>{x.current&&x.current.forceUpdate()}),M.useEffect(()=>{i&&k(RL(i))},[i]),Vr(()=>{if(!E||!c)return;const L=W=>{C(W.placement)};let z=[{name:"preventOverflow",options:{altBoundary:s}},{name:"flip",options:{altBoundary:s}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:W})=>{L(W)}}];l!=null&&(z=z.concat(l)),f&&f.modifiers!=null&&(z=z.concat(f.modifiers));const B=SPe(E,v.current,j({placement:S},f,{modifiers:z}));return _.current(B),()=>{B.destroy(),_.current(null)}},[E,s,l,c,f,S]);const I={placement:O};m!==null&&(I.TransitionProps=m);const P=MPe(),R=(r=p.root)!=null?r:"div",T=Lr({elementType:R,externalSlotProps:h.root,externalForwardedProps:g,additionalProps:{role:"tooltip",ref:y},ownerState:e,className:P.root});return w.jsx(R,j({},T,{children:typeof o=="function"?o(I):o}))}),RPe=M.forwardRef(function(e,n){const{anchorEl:r,children:i,container:o,direction:a="ltr",disablePortal:s=!1,keepMounted:l=!1,modifiers:c,open:u,placement:f="bottom",popperOptions:d=kPe,popperRef:h,style:p,transition:m=!1,slotProps:g={},slots:v={}}=e,y=Ae(e,TPe),[x,b]=M.useState(!0),_=()=>{b(!1)},S=()=>{b(!0)};if(!l&&!u&&(!m||x))return null;let O;if(o)O=o;else if(r){const k=RL(r);O=k&&PPe(k)?$n(k).body:$n(null).body}const C=!u&&l&&(!m||x)?"none":void 0,E=m?{in:u,onEnter:_,onExited:S}:void 0;return w.jsx(yre,{disablePortal:s,container:O,children:w.jsx(APe,j({anchorEl:r,direction:a,disablePortal:s,modifiers:c,ref:n,open:m?!x:u,placement:f,popperOptions:d,popperRef:h,slotProps:g,slots:v},y,{style:j({position:"fixed",top:0,left:0,display:C},p),TransitionProps:E,children:i}))})}),IPe=2;function Mre(t,e){return t-e}function n8(t,e){var n;const{index:r}=(n=t.reduce((i,o,a)=>{const s=Math.abs(e-o);return i===null||s({left:`${t}%`}),leap:t=>({width:`${t}%`})},"horizontal-reverse":{offset:t=>({right:`${t}%`}),leap:t=>({width:`${t}%`})},vertical:{offset:t=>({bottom:`${t}%`}),leap:t=>({height:`${t}%`})}},FPe=t=>t;let tS;function i8(){return tS===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?tS=CSS.supports("touch-action","none"):tS=!0),tS}function jPe(t){const{"aria-labelledby":e,defaultValue:n,disabled:r=!1,disableSwap:i=!1,isRtl:o=!1,marks:a=!1,max:s=100,min:l=0,name:c,onChange:u,onChangeCommitted:f,orientation:d="horizontal",rootRef:h,scale:p=FPe,step:m=1,shiftStep:g=10,tabIndex:v,value:y}=t,x=M.useRef(),[b,_]=M.useState(-1),[S,O]=M.useState(-1),[C,E]=M.useState(!1),k=M.useRef(0),[I,P]=Hs({controlled:y,default:n??l,name:"Slider"}),R=u&&((Z,V,de)=>{const xe=Z.nativeEvent||Z,Me=new xe.constructor(xe.type,xe);Object.defineProperty(Me,"target",{writable:!0,value:{value:V,name:c}}),u(Me,V,de)}),T=Array.isArray(I);let L=T?I.slice().sort(Mre):[I];L=L.map(Z=>Z==null?l:eh(Z,l,s));const z=a===!0&&m!==null?[...Array(Math.floor((s-l)/m)+1)].map((Z,V)=>({value:l+m*V})):a||[],B=z.map(Z=>Z.value),{isFocusVisibleRef:W,onBlur:U,onFocus:N,ref:$}=C1(),[D,A]=M.useState(-1),q=M.useRef(),Y=Zt($,q),K=Zt(h,Y),se=Z=>V=>{var de;const xe=Number(V.currentTarget.getAttribute("data-index"));N(V),W.current===!0&&A(xe),O(xe),Z==null||(de=Z.onFocus)==null||de.call(Z,V)},te=Z=>V=>{var de;U(V),W.current===!1&&A(-1),O(-1),Z==null||(de=Z.onBlur)==null||de.call(Z,V)},J=(Z,V)=>{const de=Number(Z.currentTarget.getAttribute("data-index")),xe=L[de],Me=B.indexOf(xe);let me=V;if(z&&m==null){const Ne=B[B.length-1];me>Ne?me=Ne:meV=>{var de;if(m!==null){const xe=Number(V.currentTarget.getAttribute("data-index")),Me=L[xe];let me=null;(V.key==="ArrowLeft"||V.key==="ArrowDown")&&V.shiftKey||V.key==="PageDown"?me=Math.max(Me-g,l):((V.key==="ArrowRight"||V.key==="ArrowUp")&&V.shiftKey||V.key==="PageUp")&&(me=Math.min(Me+g,s)),me!==null&&(J(V,me),V.preventDefault())}Z==null||(de=Z.onKeyDown)==null||de.call(Z,V)};Vr(()=>{if(r&&q.current.contains(document.activeElement)){var Z;(Z=document.activeElement)==null||Z.blur()}},[r]),r&&b!==-1&&_(-1),r&&D!==-1&&A(-1);const be=Z=>V=>{var de;(de=Z.onChange)==null||de.call(Z,V),J(V,V.target.valueAsNumber)},re=M.useRef();let ve=d;o&&d==="horizontal"&&(ve+="-reverse");const F=({finger:Z,move:V=!1})=>{const{current:de}=q,{width:xe,height:Me,bottom:me,left:Ne}=de.getBoundingClientRect();let Ce;ve.indexOf("vertical")===0?Ce=(me-Z.y)/Me:Ce=(Z.x-Ne)/xe,ve.indexOf("-reverse")!==-1&&(Ce=1-Ce);let Re;if(Re=DPe(Ce,l,s),m)Re=$Pe(Re,m,l);else{const Le=n8(B,Re);Re=B[Le]}Re=eh(Re,l,s);let ae=0;if(T){V?ae=re.current:ae=n8(L,Re),i&&(Re=eh(Re,L[ae-1]||-1/0,L[ae+1]||1/0));const Le=Re;Re=r8({values:L,newValue:Re,index:ae}),i&&V||(ae=Re.indexOf(Le),re.current=ae)}return{newValue:Re,activeIndex:ae}},ce=br(Z=>{const V=Zw(Z,x);if(!V)return;if(k.current+=1,Z.type==="mousemove"&&Z.buttons===0){le(Z);return}const{newValue:de,activeIndex:xe}=F({finger:V,move:!0});Jw({sliderRef:q,activeIndex:xe,setActive:_}),P(de),!C&&k.current>IPe&&E(!0),R&&!eS(de,I)&&R(Z,de,xe)}),le=br(Z=>{const V=Zw(Z,x);if(E(!1),!V)return;const{newValue:de}=F({finger:V,move:!0});_(-1),Z.type==="touchend"&&O(-1),f&&f(Z,de),x.current=void 0,X()}),Q=br(Z=>{if(r)return;i8()||Z.preventDefault();const V=Z.changedTouches[0];V!=null&&(x.current=V.identifier);const de=Zw(Z,x);if(de!==!1){const{newValue:Me,activeIndex:me}=F({finger:de});Jw({sliderRef:q,activeIndex:me,setActive:_}),P(Me),R&&!eS(Me,I)&&R(Z,Me,me)}k.current=0;const xe=$n(q.current);xe.addEventListener("touchmove",ce,{passive:!0}),xe.addEventListener("touchend",le,{passive:!0})}),X=M.useCallback(()=>{const Z=$n(q.current);Z.removeEventListener("mousemove",ce),Z.removeEventListener("mouseup",le),Z.removeEventListener("touchmove",ce),Z.removeEventListener("touchend",le)},[le,ce]);M.useEffect(()=>{const{current:Z}=q;return Z.addEventListener("touchstart",Q,{passive:i8()}),()=>{Z.removeEventListener("touchstart",Q),X()}},[X,Q]),M.useEffect(()=>{r&&X()},[r,X]);const ee=Z=>V=>{var de;if((de=Z.onMouseDown)==null||de.call(Z,V),r||V.defaultPrevented||V.button!==0)return;V.preventDefault();const xe=Zw(V,x);if(xe!==!1){const{newValue:me,activeIndex:Ne}=F({finger:xe});Jw({sliderRef:q,activeIndex:Ne,setActive:_}),P(me),R&&!eS(me,I)&&R(V,me,Ne)}k.current=0;const Me=$n(q.current);Me.addEventListener("mousemove",ce,{passive:!0}),Me.addEventListener("mouseup",le)},ge=OT(T?L[0]:l,l,s),ye=OT(L[L.length-1],l,s)-ge,H=(Z={})=>{const V=kh(Z),de={onMouseDown:ee(V||{})},xe=j({},V,de);return j({},Z,{ref:K},xe)},G=Z=>V=>{var de;(de=Z.onMouseOver)==null||de.call(Z,V);const xe=Number(V.currentTarget.getAttribute("data-index"));O(xe)},ie=Z=>V=>{var de;(de=Z.onMouseLeave)==null||de.call(Z,V),O(-1)};return{active:b,axis:ve,axisProps:NPe,dragging:C,focusedThumbIndex:D,getHiddenInputProps:(Z={})=>{var V;const de=kh(Z),xe={onChange:be(de||{}),onFocus:se(de||{}),onBlur:te(de||{}),onKeyDown:pe(de||{})},Me=j({},de,xe);return j({tabIndex:v,"aria-labelledby":e,"aria-orientation":d,"aria-valuemax":p(s),"aria-valuemin":p(l),name:c,type:"range",min:t.min,max:t.max,step:t.step===null&&t.marks?"any":(V=t.step)!=null?V:void 0,disabled:r},Z,Me,{style:j({},fOe,{direction:o?"rtl":"ltr",width:"100%",height:"100%"})})},getRootProps:H,getThumbProps:(Z={})=>{const V=kh(Z),de={onMouseOver:G(V||{}),onMouseLeave:ie(V||{})};return j({},Z,V,de)},marks:z,open:S,range:T,rootRef:K,trackLeap:ye,trackOffset:ge,values:L,getThumbStyle:Z=>({pointerEvents:b!==-1&&b!==Z?"none":void 0})}}function BPe(t={}){const{autoHideDuration:e=null,disableWindowBlurListener:n=!1,onClose:r,open:i,resumeHideDuration:o}=t,a=mf();M.useEffect(()=>{if(!i)return;function v(y){y.defaultPrevented||(y.key==="Escape"||y.key==="Esc")&&(r==null||r(y,"escapeKeyDown"))}return document.addEventListener("keydown",v),()=>{document.removeEventListener("keydown",v)}},[i,r]);const s=br((v,y)=>{r==null||r(v,y)}),l=br(v=>{!r||v==null||a.start(v,()=>{s(null,"timeout")})});M.useEffect(()=>(i&&l(e),a.clear),[i,e,l,a]);const c=v=>{r==null||r(v,"clickaway")},u=a.clear,f=M.useCallback(()=>{e!=null&&l(o??e*.5)},[e,o,l]),d=v=>y=>{const x=v.onBlur;x==null||x(y),f()},h=v=>y=>{const x=v.onFocus;x==null||x(y),u()},p=v=>y=>{const x=v.onMouseEnter;x==null||x(y),u()},m=v=>y=>{const x=v.onMouseLeave;x==null||x(y),f()};return M.useEffect(()=>{if(!n&&i)return window.addEventListener("focus",f),window.addEventListener("blur",u),()=>{window.removeEventListener("focus",f),window.removeEventListener("blur",u)}},[n,i,f,u]),{getRootProps:(v={})=>{const y=j({},kh(t),kh(v));return j({role:"presentation"},v,y,{onBlur:d(y),onFocus:h(y),onMouseEnter:p(y),onMouseLeave:m(y)})},onClickAway:c}}const zPe=["onChange","maxRows","minRows","style","value"];function nS(t){return parseInt(t,10)||0}const UPe={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function WPe(t){return t==null||Object.keys(t).length===0||t.outerHeightStyle===0&&!t.overflowing}const VPe=M.forwardRef(function(e,n){const{onChange:r,maxRows:i,minRows:o=1,style:a,value:s}=e,l=Ae(e,zPe),{current:c}=M.useRef(s!=null),u=M.useRef(null),f=Zt(n,u),d=M.useRef(null),h=M.useCallback(()=>{const g=u.current,y=ls(g).getComputedStyle(g);if(y.width==="0px")return{outerHeightStyle:0,overflowing:!1};const x=d.current;x.style.width=y.width,x.value=g.value||e.placeholder||"x",x.value.slice(-1)===` -`&&(x.value+=" ");const b=y.boxSizing,_=nS(y.paddingBottom)+nS(y.paddingTop),S=nS(y.borderBottomWidth)+nS(y.borderTopWidth),O=x.scrollHeight;x.value="x";const C=x.scrollHeight;let E=O;o&&(E=Math.max(Number(o)*C,E)),i&&(E=Math.min(Number(i)*C,E)),E=Math.max(E,C);const k=E+(b==="border-box"?_+S:0),I=Math.abs(E-O)<=1;return{outerHeightStyle:k,overflowing:I}},[i,o,e.placeholder]),p=M.useCallback(()=>{const g=h();if(WPe(g))return;const v=u.current;v.style.height=`${g.outerHeightStyle}px`,v.style.overflow=g.overflowing?"hidden":""},[h]);Vr(()=>{const g=()=>{p()};let v;const y=Hv(g),x=u.current,b=ls(x);b.addEventListener("resize",y);let _;return typeof ResizeObserver<"u"&&(_=new ResizeObserver(g),_.observe(x)),()=>{y.clear(),cancelAnimationFrame(v),b.removeEventListener("resize",y),_&&_.disconnect()}},[h,p]),Vr(()=>{p()});const m=g=>{c||p(),r&&r(g)};return w.jsxs(M.Fragment,{children:[w.jsx("textarea",j({value:s,onChange:m,ref:f,rows:o,style:a},l)),w.jsx("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:d,tabIndex:-1,style:j({},UPe.shadow,a,{paddingTop:0,paddingBottom:0})})]})});var u5={};Object.defineProperty(u5,"__esModule",{value:!0});var kre=u5.default=void 0,GPe=qPe(M),HPe=sre;function Are(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(Are=function(r){return r?n:e})(t)}function qPe(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=Are(e);if(n&&n.has(t))return n.get(t);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&Object.prototype.hasOwnProperty.call(t,o)){var a=i?Object.getOwnPropertyDescriptor(t,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=t[o]}return r.default=t,n&&n.set(t,r),r}function XPe(t){return Object.keys(t).length===0}function QPe(t=null){const e=GPe.useContext(HPe.ThemeContext);return!e||XPe(e)?t:e}kre=u5.default=QPe;const YPe=["anchorEl","component","components","componentsProps","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition","slots","slotProps"],KPe=we(RPe,{name:"MuiPopper",slot:"Root",overridesResolver:(t,e)=>e.root})({}),ZPe=M.forwardRef(function(e,n){var r;const i=kre(),o=qe({props:e,name:"MuiPopper"}),{anchorEl:a,component:s,components:l,componentsProps:c,container:u,disablePortal:f,keepMounted:d,modifiers:h,open:p,placement:m,popperOptions:g,popperRef:v,transition:y,slots:x,slotProps:b}=o,_=Ae(o,YPe),S=(r=x==null?void 0:x.root)!=null?r:l==null?void 0:l.Root,O=j({anchorEl:a,container:u,disablePortal:f,keepMounted:d,modifiers:h,open:p,placement:m,popperOptions:g,popperRef:v,transition:y},_);return w.jsx(KPe,j({as:s,direction:i==null?void 0:i.direction,slots:{root:S},slotProps:b??c},O,{ref:n}))}),f5=ZPe,JPe=ti(w.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");function eMe(t){return We("MuiChip",t)}const tMe=Ve("MuiChip",["root","sizeSmall","sizeMedium","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),fn=tMe,nMe=["avatar","className","clickable","color","component","deleteIcon","disabled","icon","label","onClick","onDelete","onKeyDown","onKeyUp","size","variant","tabIndex","skipFocusWhenDisabled"],rMe=t=>{const{classes:e,disabled:n,size:r,color:i,iconColor:o,onDelete:a,clickable:s,variant:l}=t,c={root:["root",l,n&&"disabled",`size${De(r)}`,`color${De(i)}`,s&&"clickable",s&&`clickableColor${De(i)}`,a&&"deletable",a&&`deletableColor${De(i)}`,`${l}${De(i)}`],label:["label",`label${De(r)}`],avatar:["avatar",`avatar${De(r)}`,`avatarColor${De(i)}`],icon:["icon",`icon${De(r)}`,`iconColor${De(o)}`],deleteIcon:["deleteIcon",`deleteIcon${De(r)}`,`deleteIconColor${De(i)}`,`deleteIcon${De(l)}Color${De(i)}`]};return Ue(c,eMe,e)},iMe=we("div",{name:"MuiChip",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{color:r,iconColor:i,clickable:o,onDelete:a,size:s,variant:l}=n;return[{[`& .${fn.avatar}`]:e.avatar},{[`& .${fn.avatar}`]:e[`avatar${De(s)}`]},{[`& .${fn.avatar}`]:e[`avatarColor${De(r)}`]},{[`& .${fn.icon}`]:e.icon},{[`& .${fn.icon}`]:e[`icon${De(s)}`]},{[`& .${fn.icon}`]:e[`iconColor${De(i)}`]},{[`& .${fn.deleteIcon}`]:e.deleteIcon},{[`& .${fn.deleteIcon}`]:e[`deleteIcon${De(s)}`]},{[`& .${fn.deleteIcon}`]:e[`deleteIconColor${De(r)}`]},{[`& .${fn.deleteIcon}`]:e[`deleteIcon${De(l)}Color${De(r)}`]},e.root,e[`size${De(s)}`],e[`color${De(r)}`],o&&e.clickable,o&&r!=="default"&&e[`clickableColor${De(r)})`],a&&e.deletable,a&&r!=="default"&&e[`deletableColor${De(r)}`],e[l],e[`${l}${De(r)}`]]}})(({theme:t,ownerState:e})=>{const n=t.palette.mode==="light"?t.palette.grey[700]:t.palette.grey[300];return j({maxWidth:"100%",fontFamily:t.typography.fontFamily,fontSize:t.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(t.vars||t).palette.text.primary,backgroundColor:(t.vars||t).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:t.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${fn.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${fn.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:t.vars?t.vars.palette.Chip.defaultAvatarColor:n,fontSize:t.typography.pxToRem(12)},[`& .${fn.avatarColorPrimary}`]:{color:(t.vars||t).palette.primary.contrastText,backgroundColor:(t.vars||t).palette.primary.dark},[`& .${fn.avatarColorSecondary}`]:{color:(t.vars||t).palette.secondary.contrastText,backgroundColor:(t.vars||t).palette.secondary.dark},[`& .${fn.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:t.typography.pxToRem(10)},[`& .${fn.icon}`]:j({marginLeft:5,marginRight:-6},e.size==="small"&&{fontSize:18,marginLeft:4,marginRight:-4},e.iconColor===e.color&&j({color:t.vars?t.vars.palette.Chip.defaultIconColor:n},e.color!=="default"&&{color:"inherit"})),[`& .${fn.deleteIcon}`]:j({WebkitTapHighlightColor:"transparent",color:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / 0.26)`:kt(t.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / 0.4)`:kt(t.palette.text.primary,.4)}},e.size==="small"&&{fontSize:16,marginRight:4,marginLeft:-4},e.color!=="default"&&{color:t.vars?`rgba(${t.vars.palette[e.color].contrastTextChannel} / 0.7)`:kt(t.palette[e.color].contrastText,.7),"&:hover, &:active":{color:(t.vars||t).palette[e.color].contrastText}})},e.size==="small"&&{height:24},e.color!=="default"&&{backgroundColor:(t.vars||t).palette[e.color].main,color:(t.vars||t).palette[e.color].contrastText},e.onDelete&&{[`&.${fn.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:kt(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},e.onDelete&&e.color!=="default"&&{[`&.${fn.focusVisible}`]:{backgroundColor:(t.vars||t).palette[e.color].dark}})},({theme:t,ownerState:e})=>j({},e.clickable&&{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:kt(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity)},[`&.${fn.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:kt(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)},"&:active":{boxShadow:(t.vars||t).shadows[1]}},e.clickable&&e.color!=="default"&&{[`&:hover, &.${fn.focusVisible}`]:{backgroundColor:(t.vars||t).palette[e.color].dark}}),({theme:t,ownerState:e})=>j({},e.variant==="outlined"&&{backgroundColor:"transparent",border:t.vars?`1px solid ${t.vars.palette.Chip.defaultBorder}`:`1px solid ${t.palette.mode==="light"?t.palette.grey[400]:t.palette.grey[700]}`,[`&.${fn.clickable}:hover`]:{backgroundColor:(t.vars||t).palette.action.hover},[`&.${fn.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`& .${fn.avatar}`]:{marginLeft:4},[`& .${fn.avatarSmall}`]:{marginLeft:2},[`& .${fn.icon}`]:{marginLeft:4},[`& .${fn.iconSmall}`]:{marginLeft:2},[`& .${fn.deleteIcon}`]:{marginRight:5},[`& .${fn.deleteIconSmall}`]:{marginRight:3}},e.variant==="outlined"&&e.color!=="default"&&{color:(t.vars||t).palette[e.color].main,border:`1px solid ${t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / 0.7)`:kt(t.palette[e.color].main,.7)}`,[`&.${fn.clickable}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette[e.color].main,t.palette.action.hoverOpacity)},[`&.${fn.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.focusOpacity})`:kt(t.palette[e.color].main,t.palette.action.focusOpacity)},[`& .${fn.deleteIcon}`]:{color:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / 0.7)`:kt(t.palette[e.color].main,.7),"&:hover, &:active":{color:(t.vars||t).palette[e.color].main}}})),oMe=we("span",{name:"MuiChip",slot:"Label",overridesResolver:(t,e)=>{const{ownerState:n}=t,{size:r}=n;return[e.label,e[`label${De(r)}`]]}})(({ownerState:t})=>j({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap"},t.variant==="outlined"&&{paddingLeft:11,paddingRight:11},t.size==="small"&&{paddingLeft:8,paddingRight:8},t.size==="small"&&t.variant==="outlined"&&{paddingLeft:7,paddingRight:7}));function o8(t){return t.key==="Backspace"||t.key==="Delete"}const aMe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiChip"}),{avatar:i,className:o,clickable:a,color:s="default",component:l,deleteIcon:c,disabled:u=!1,icon:f,label:d,onClick:h,onDelete:p,onKeyDown:m,onKeyUp:g,size:v="medium",variant:y="filled",tabIndex:x,skipFocusWhenDisabled:b=!1}=r,_=Ae(r,nMe),S=M.useRef(null),O=Zt(S,n),C=U=>{U.stopPropagation(),p&&p(U)},E=U=>{U.currentTarget===U.target&&o8(U)&&U.preventDefault(),m&&m(U)},k=U=>{U.currentTarget===U.target&&(p&&o8(U)?p(U):U.key==="Escape"&&S.current&&S.current.blur()),g&&g(U)},I=a!==!1&&h?!0:a,P=I||p?us:l||"div",R=j({},r,{component:P,disabled:u,size:v,color:s,iconColor:M.isValidElement(f)&&f.props.color||s,onDelete:!!p,clickable:I,variant:y}),T=rMe(R),L=P===us?j({component:l||"div",focusVisibleClassName:T.focusVisible},p&&{disableRipple:!0}):{};let z=null;p&&(z=c&&M.isValidElement(c)?M.cloneElement(c,{className:ke(c.props.className,T.deleteIcon),onClick:C}):w.jsx(JPe,{className:ke(T.deleteIcon),onClick:C}));let B=null;i&&M.isValidElement(i)&&(B=M.cloneElement(i,{className:ke(T.avatar,i.props.className)}));let W=null;return f&&M.isValidElement(f)&&(W=M.cloneElement(f,{className:ke(T.icon,f.props.className)})),w.jsxs(iMe,j({as:P,className:ke(T.root,o),disabled:I&&u?!0:void 0,onClick:h,onKeyDown:E,onKeyUp:k,ref:O,tabIndex:b&&u?-1:x,ownerState:R},L,_,{children:[B||W,w.jsx(oMe,{className:ke(T.label),ownerState:R,children:d}),z]}))}),sMe=aMe;function fd({props:t,states:e,muiFormControl:n}){return e.reduce((r,i)=>(r[i]=t[i],n&&typeof t[i]>"u"&&(r[i]=n[i]),r),{})}const lMe=M.createContext(void 0),AM=lMe;function nc(){return M.useContext(AM)}function Rre(t){return w.jsx(bSe,j({},t,{defaultTheme:EM,themeId:Gh}))}function a8(t){return t!=null&&!(Array.isArray(t)&&t.length===0)}function CT(t,e=!1){return t&&(a8(t.value)&&t.value!==""||e&&a8(t.defaultValue)&&t.defaultValue!=="")}function cMe(t){return t.startAdornment}function uMe(t){return We("MuiInputBase",t)}const fMe=Ve("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),Xg=fMe,dMe=["aria-describedby","autoComplete","autoFocus","className","color","components","componentsProps","defaultValue","disabled","disableInjectingGlobalStyles","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","maxRows","minRows","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","size","slotProps","slots","startAdornment","type","value"],RM=(t,e)=>{const{ownerState:n}=t;return[e.root,n.formControl&&e.formControl,n.startAdornment&&e.adornedStart,n.endAdornment&&e.adornedEnd,n.error&&e.error,n.size==="small"&&e.sizeSmall,n.multiline&&e.multiline,n.color&&e[`color${De(n.color)}`],n.fullWidth&&e.fullWidth,n.hiddenLabel&&e.hiddenLabel]},IM=(t,e)=>{const{ownerState:n}=t;return[e.input,n.size==="small"&&e.inputSizeSmall,n.multiline&&e.inputMultiline,n.type==="search"&&e.inputTypeSearch,n.startAdornment&&e.inputAdornedStart,n.endAdornment&&e.inputAdornedEnd,n.hiddenLabel&&e.inputHiddenLabel]},hMe=t=>{const{classes:e,color:n,disabled:r,error:i,endAdornment:o,focused:a,formControl:s,fullWidth:l,hiddenLabel:c,multiline:u,readOnly:f,size:d,startAdornment:h,type:p}=t,m={root:["root",`color${De(n)}`,r&&"disabled",i&&"error",l&&"fullWidth",a&&"focused",s&&"formControl",d&&d!=="medium"&&`size${De(d)}`,u&&"multiline",h&&"adornedStart",o&&"adornedEnd",c&&"hiddenLabel",f&&"readOnly"],input:["input",r&&"disabled",p==="search"&&"inputTypeSearch",u&&"inputMultiline",d==="small"&&"inputSizeSmall",c&&"inputHiddenLabel",h&&"inputAdornedStart",o&&"inputAdornedEnd",f&&"readOnly"]};return Ue(m,uMe,e)},DM=we("div",{name:"MuiInputBase",slot:"Root",overridesResolver:RM})(({theme:t,ownerState:e})=>j({},t.typography.body1,{color:(t.vars||t).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${Xg.disabled}`]:{color:(t.vars||t).palette.text.disabled,cursor:"default"}},e.multiline&&j({padding:"4px 0 5px"},e.size==="small"&&{paddingTop:1}),e.fullWidth&&{width:"100%"})),LM=we("input",{name:"MuiInputBase",slot:"Input",overridesResolver:IM})(({theme:t,ownerState:e})=>{const n=t.palette.mode==="light",r=j({color:"currentColor"},t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:n?.42:.5},{transition:t.transitions.create("opacity",{duration:t.transitions.duration.shorter})}),i={opacity:"0 !important"},o=t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:n?.42:.5};return j({font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%",animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&:-ms-input-placeholder":r,"&::-ms-input-placeholder":r,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${Xg.formControl} &`]:{"&::-webkit-input-placeholder":i,"&::-moz-placeholder":i,"&:-ms-input-placeholder":i,"&::-ms-input-placeholder":i,"&:focus::-webkit-input-placeholder":o,"&:focus::-moz-placeholder":o,"&:focus:-ms-input-placeholder":o,"&:focus::-ms-input-placeholder":o},[`&.${Xg.disabled}`]:{opacity:1,WebkitTextFillColor:(t.vars||t).palette.text.disabled},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},e.size==="small"&&{paddingTop:1},e.multiline&&{height:"auto",resize:"none",padding:0,paddingTop:0},e.type==="search"&&{MozAppearance:"textfield"})}),pMe=w.jsx(Rre,{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}}),mMe=M.forwardRef(function(e,n){var r;const i=qe({props:e,name:"MuiInputBase"}),{"aria-describedby":o,autoComplete:a,autoFocus:s,className:l,components:c={},componentsProps:u={},defaultValue:f,disabled:d,disableInjectingGlobalStyles:h,endAdornment:p,fullWidth:m=!1,id:g,inputComponent:v="input",inputProps:y={},inputRef:x,maxRows:b,minRows:_,multiline:S=!1,name:O,onBlur:C,onChange:E,onClick:k,onFocus:I,onKeyDown:P,onKeyUp:R,placeholder:T,readOnly:L,renderSuffix:z,rows:B,slotProps:W={},slots:U={},startAdornment:N,type:$="text",value:D}=i,A=Ae(i,dMe),q=y.value!=null?y.value:D,{current:Y}=M.useRef(q!=null),K=M.useRef(),se=M.useCallback(Z=>{},[]),te=Zt(K,x,y.ref,se),[J,pe]=M.useState(!1),be=nc(),re=fd({props:i,muiFormControl:be,states:["color","disabled","error","hiddenLabel","size","required","filled"]});re.focused=be?be.focused:J,M.useEffect(()=>{!be&&d&&J&&(pe(!1),C&&C())},[be,d,J,C]);const ve=be&&be.onFilled,F=be&&be.onEmpty,ce=M.useCallback(Z=>{CT(Z)?ve&&ve():F&&F()},[ve,F]);Vr(()=>{Y&&ce({value:q})},[q,ce,Y]);const le=Z=>{if(re.disabled){Z.stopPropagation();return}I&&I(Z),y.onFocus&&y.onFocus(Z),be&&be.onFocus?be.onFocus(Z):pe(!0)},Q=Z=>{C&&C(Z),y.onBlur&&y.onBlur(Z),be&&be.onBlur?be.onBlur(Z):pe(!1)},X=(Z,...V)=>{if(!Y){const de=Z.target||K.current;if(de==null)throw new Error(su(1));ce({value:de.value})}y.onChange&&y.onChange(Z,...V),E&&E(Z,...V)};M.useEffect(()=>{ce(K.current)},[]);const ee=Z=>{K.current&&Z.currentTarget===Z.target&&K.current.focus(),k&&k(Z)};let ge=v,ye=y;S&&ge==="input"&&(B?ye=j({type:void 0,minRows:B,maxRows:B},ye):ye=j({type:void 0,maxRows:b,minRows:_},ye),ge=VPe);const H=Z=>{ce(Z.animationName==="mui-auto-fill-cancel"?K.current:{value:"x"})};M.useEffect(()=>{be&&be.setAdornedStart(!!N)},[be,N]);const G=j({},i,{color:re.color||"primary",disabled:re.disabled,endAdornment:p,error:re.error,focused:re.focused,formControl:be,fullWidth:m,hiddenLabel:re.hiddenLabel,multiline:S,size:re.size,startAdornment:N,type:$}),ie=hMe(G),he=U.root||c.Root||DM,_e=W.root||u.root||{},oe=U.input||c.Input||LM;return ye=j({},ye,(r=W.input)!=null?r:u.input),w.jsxs(M.Fragment,{children:[!h&&pMe,w.jsxs(he,j({},_e,!zl(he)&&{ownerState:j({},G,_e.ownerState)},{ref:n,onClick:ee},A,{className:ke(ie.root,_e.className,l,L&&"MuiInputBase-readOnly"),children:[N,w.jsx(AM.Provider,{value:null,children:w.jsx(oe,j({ownerState:G,"aria-invalid":re.error,"aria-describedby":o,autoComplete:a,autoFocus:s,defaultValue:f,disabled:re.disabled,id:g,onAnimationStart:H,name:O,placeholder:T,readOnly:L,required:re.required,rows:B,value:q,onKeyDown:P,onKeyUp:R,type:$},ye,!zl(oe)&&{as:ge,ownerState:j({},G,ye.ownerState)},{ref:te,className:ke(ie.input,ye.className,L&&"MuiInputBase-readOnly"),onBlur:Q,onChange:X,onFocus:le}))}),p,z?z(j({},re,{startAdornment:N})):null]}))]})}),d5=mMe;function gMe(t){return We("MuiInput",t)}const vMe=j({},Xg,Ve("MuiInput",["root","underline","input"])),c0=vMe;function yMe(t){return We("MuiOutlinedInput",t)}const xMe=j({},Xg,Ve("MuiOutlinedInput",["root","notchedOutline","input"])),Tu=xMe;function bMe(t){return We("MuiFilledInput",t)}const _Me=j({},Xg,Ve("MuiFilledInput",["root","underline","input"])),kd=_Me,wMe=ti(w.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),SMe=ti(w.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}),"Person");function OMe(t){return We("MuiAvatar",t)}Ve("MuiAvatar",["root","colorDefault","circular","rounded","square","img","fallback"]);const CMe=["alt","children","className","component","slots","slotProps","imgProps","sizes","src","srcSet","variant"],TMe=Kj(),EMe=t=>{const{classes:e,variant:n,colorDefault:r}=t;return Ue({root:["root",n,r&&"colorDefault"],img:["img"],fallback:["fallback"]},OMe,e)},PMe=we("div",{name:"MuiAvatar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],n.colorDefault&&e.colorDefault]}})(({theme:t})=>({position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:40,height:40,fontFamily:t.typography.fontFamily,fontSize:t.typography.pxToRem(20),lineHeight:1,borderRadius:"50%",overflow:"hidden",userSelect:"none",variants:[{props:{variant:"rounded"},style:{borderRadius:(t.vars||t).shape.borderRadius}},{props:{variant:"square"},style:{borderRadius:0}},{props:{colorDefault:!0},style:j({color:(t.vars||t).palette.background.default},t.vars?{backgroundColor:t.vars.palette.Avatar.defaultBg}:j({backgroundColor:t.palette.grey[400]},t.applyStyles("dark",{backgroundColor:t.palette.grey[600]})))}]})),MMe=we("img",{name:"MuiAvatar",slot:"Img",overridesResolver:(t,e)=>e.img})({width:"100%",height:"100%",textAlign:"center",objectFit:"cover",color:"transparent",textIndent:1e4}),kMe=we(SMe,{name:"MuiAvatar",slot:"Fallback",overridesResolver:(t,e)=>e.fallback})({width:"75%",height:"75%"});function AMe({crossOrigin:t,referrerPolicy:e,src:n,srcSet:r}){const[i,o]=M.useState(!1);return M.useEffect(()=>{if(!n&&!r)return;o(!1);let a=!0;const s=new Image;return s.onload=()=>{a&&o("loaded")},s.onerror=()=>{a&&o("error")},s.crossOrigin=t,s.referrerPolicy=e,s.src=n,r&&(s.srcset=r),()=>{a=!1}},[t,e,n,r]),i}const RMe=M.forwardRef(function(e,n){const r=TMe({props:e,name:"MuiAvatar"}),{alt:i,children:o,className:a,component:s="div",slots:l={},slotProps:c={},imgProps:u,sizes:f,src:d,srcSet:h,variant:p="circular"}=r,m=Ae(r,CMe);let g=null;const v=AMe(j({},u,{src:d,srcSet:h})),y=d||h,x=y&&v!=="error",b=j({},r,{colorDefault:!x,component:s,variant:p}),_=EMe(b),[S,O]=gTe("img",{className:_.img,elementType:MMe,externalForwardedProps:{slots:l,slotProps:{img:j({},u,c.img)}},additionalProps:{alt:i,src:d,srcSet:h,sizes:f},ownerState:b});return x?g=w.jsx(S,j({},O)):o||o===0?g=o:y&&i?g=i[0]:g=w.jsx(kMe,{ownerState:b,className:_.fallback}),w.jsx(PMe,j({as:s,ownerState:b,className:ke(_.root,a),ref:n},m,{children:g}))}),yA=RMe,IMe=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],DMe={entering:{opacity:1},entered:{opacity:1}},LMe=M.forwardRef(function(e,n){const r=Vo(),i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:o,appear:a=!0,children:s,easing:l,in:c,onEnter:u,onEntered:f,onEntering:d,onExit:h,onExited:p,onExiting:m,style:g,timeout:v=i,TransitionComponent:y=M1}=e,x=Ae(e,IMe),b=M.useRef(null),_=Zt(b,s.ref,n),S=T=>L=>{if(T){const z=b.current;L===void 0?T(z):T(z,L)}},O=S(d),C=S((T,L)=>{n5(T);const z=Xf({style:g,timeout:v,easing:l},{mode:"enter"});T.style.webkitTransition=r.transitions.create("opacity",z),T.style.transition=r.transitions.create("opacity",z),u&&u(T,L)}),E=S(f),k=S(m),I=S(T=>{const L=Xf({style:g,timeout:v,easing:l},{mode:"exit"});T.style.webkitTransition=r.transitions.create("opacity",L),T.style.transition=r.transitions.create("opacity",L),h&&h(T)}),P=S(p),R=T=>{o&&o(b.current,T)};return w.jsx(y,j({appear:a,in:c,nodeRef:b,onEnter:C,onEntered:E,onEntering:O,onExit:I,onExited:P,onExiting:k,addEndListener:R,timeout:v},x,{children:(T,L)=>M.cloneElement(s,j({style:j({opacity:0,visibility:T==="exited"&&!c?"hidden":void 0},DMe[T],g,s.props.style),ref:_},L))}))}),$M=LMe;function $Me(t){return We("MuiBackdrop",t)}Ve("MuiBackdrop",["root","invisible"]);const NMe=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],FMe=t=>{const{classes:e,invisible:n}=t;return Ue({root:["root",n&&"invisible"]},$Me,e)},jMe=we("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.invisible&&e.invisible]}})(({ownerState:t})=>j({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},t.invisible&&{backgroundColor:"transparent"})),BMe=M.forwardRef(function(e,n){var r,i,o;const a=qe({props:e,name:"MuiBackdrop"}),{children:s,className:l,component:c="div",components:u={},componentsProps:f={},invisible:d=!1,open:h,slotProps:p={},slots:m={},TransitionComponent:g=$M,transitionDuration:v}=a,y=Ae(a,NMe),x=j({},a,{component:c,invisible:d}),b=FMe(x),_=(r=p.root)!=null?r:f.root;return w.jsx(g,j({in:h,timeout:v},y,{children:w.jsx(jMe,j({"aria-hidden":!0},_,{as:(i=(o=m.root)!=null?o:u.Root)!=null?i:c,className:ke(b.root,l,_==null?void 0:_.className),ownerState:j({},x,_==null?void 0:_.ownerState),classes:b,ref:n,children:s}))}))}),Ire=BMe,zMe=Ve("MuiBox",["root"]),UMe=zMe,WMe=Yj(),VMe=ESe({themeId:Gh,defaultTheme:WMe,defaultClassName:UMe.root,generateClassName:zj.generate}),Ke=VMe;function GMe(t){return We("MuiButton",t)}const HMe=Ve("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),rS=HMe,qMe=M.createContext({}),XMe=qMe,QMe=M.createContext(void 0),YMe=QMe,KMe=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],ZMe=t=>{const{color:e,disableElevation:n,fullWidth:r,size:i,variant:o,classes:a}=t,s={root:["root",o,`${o}${De(e)}`,`size${De(i)}`,`${o}Size${De(i)}`,`color${De(e)}`,n&&"disableElevation",r&&"fullWidth"],label:["label"],startIcon:["icon","startIcon",`iconSize${De(i)}`],endIcon:["icon","endIcon",`iconSize${De(i)}`]},l=Ue(s,GMe,a);return j({},a,l)},Dre=t=>j({},t.size==="small"&&{"& > *:nth-of-type(1)":{fontSize:18}},t.size==="medium"&&{"& > *:nth-of-type(1)":{fontSize:20}},t.size==="large"&&{"& > *:nth-of-type(1)":{fontSize:22}}),JMe=we(us,{shouldForwardProp:t=>di(t)||t==="classes",name:"MuiButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`${n.variant}${De(n.color)}`],e[`size${De(n.size)}`],e[`${n.variant}Size${De(n.size)}`],n.color==="inherit"&&e.colorInherit,n.disableElevation&&e.disableElevation,n.fullWidth&&e.fullWidth]}})(({theme:t,ownerState:e})=>{var n,r;const i=t.palette.mode==="light"?t.palette.grey[300]:t.palette.grey[800],o=t.palette.mode==="light"?t.palette.grey.A100:t.palette.grey[700];return j({},t.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create(["background-color","box-shadow","border-color","color"],{duration:t.transitions.duration.short}),"&:hover":j({textDecoration:"none",backgroundColor:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.text.primary,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},e.variant==="text"&&e.color!=="inherit"&&{backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette[e.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},e.variant==="outlined"&&e.color!=="inherit"&&{border:`1px solid ${(t.vars||t).palette[e.color].main}`,backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette[e.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},e.variant==="contained"&&{backgroundColor:t.vars?t.vars.palette.Button.inheritContainedHoverBg:o,boxShadow:(t.vars||t).shadows[4],"@media (hover: none)":{boxShadow:(t.vars||t).shadows[2],backgroundColor:(t.vars||t).palette.grey[300]}},e.variant==="contained"&&e.color!=="inherit"&&{backgroundColor:(t.vars||t).palette[e.color].dark,"@media (hover: none)":{backgroundColor:(t.vars||t).palette[e.color].main}}),"&:active":j({},e.variant==="contained"&&{boxShadow:(t.vars||t).shadows[8]}),[`&.${rS.focusVisible}`]:j({},e.variant==="contained"&&{boxShadow:(t.vars||t).shadows[6]}),[`&.${rS.disabled}`]:j({color:(t.vars||t).palette.action.disabled},e.variant==="outlined"&&{border:`1px solid ${(t.vars||t).palette.action.disabledBackground}`},e.variant==="contained"&&{color:(t.vars||t).palette.action.disabled,boxShadow:(t.vars||t).shadows[0],backgroundColor:(t.vars||t).palette.action.disabledBackground})},e.variant==="text"&&{padding:"6px 8px"},e.variant==="text"&&e.color!=="inherit"&&{color:(t.vars||t).palette[e.color].main},e.variant==="outlined"&&{padding:"5px 15px",border:"1px solid currentColor"},e.variant==="outlined"&&e.color!=="inherit"&&{color:(t.vars||t).palette[e.color].main,border:t.vars?`1px solid rgba(${t.vars.palette[e.color].mainChannel} / 0.5)`:`1px solid ${kt(t.palette[e.color].main,.5)}`},e.variant==="contained"&&{color:t.vars?t.vars.palette.text.primary:(n=(r=t.palette).getContrastText)==null?void 0:n.call(r,t.palette.grey[300]),backgroundColor:t.vars?t.vars.palette.Button.inheritContainedBg:i,boxShadow:(t.vars||t).shadows[2]},e.variant==="contained"&&e.color!=="inherit"&&{color:(t.vars||t).palette[e.color].contrastText,backgroundColor:(t.vars||t).palette[e.color].main},e.color==="inherit"&&{color:"inherit",borderColor:"currentColor"},e.size==="small"&&e.variant==="text"&&{padding:"4px 5px",fontSize:t.typography.pxToRem(13)},e.size==="large"&&e.variant==="text"&&{padding:"8px 11px",fontSize:t.typography.pxToRem(15)},e.size==="small"&&e.variant==="outlined"&&{padding:"3px 9px",fontSize:t.typography.pxToRem(13)},e.size==="large"&&e.variant==="outlined"&&{padding:"7px 21px",fontSize:t.typography.pxToRem(15)},e.size==="small"&&e.variant==="contained"&&{padding:"4px 10px",fontSize:t.typography.pxToRem(13)},e.size==="large"&&e.variant==="contained"&&{padding:"8px 22px",fontSize:t.typography.pxToRem(15)},e.fullWidth&&{width:"100%"})},({ownerState:t})=>t.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${rS.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${rS.disabled}`]:{boxShadow:"none"}}),e2e=we("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.startIcon,e[`iconSize${De(n.size)}`]]}})(({ownerState:t})=>j({display:"inherit",marginRight:8,marginLeft:-4},t.size==="small"&&{marginLeft:-2},Dre(t))),t2e=we("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.endIcon,e[`iconSize${De(n.size)}`]]}})(({ownerState:t})=>j({display:"inherit",marginRight:-4,marginLeft:8},t.size==="small"&&{marginRight:-2},Dre(t))),n2e=M.forwardRef(function(e,n){const r=M.useContext(XMe),i=M.useContext(YMe),o=OM(r,e),a=qe({props:o,name:"MuiButton"}),{children:s,color:l="primary",component:c="button",className:u,disabled:f=!1,disableElevation:d=!1,disableFocusRipple:h=!1,endIcon:p,focusVisibleClassName:m,fullWidth:g=!1,size:v="medium",startIcon:y,type:x,variant:b="text"}=a,_=Ae(a,KMe),S=j({},a,{color:l,component:c,disabled:f,disableElevation:d,disableFocusRipple:h,fullWidth:g,size:v,type:x,variant:b}),O=ZMe(S),C=y&&w.jsx(e2e,{className:O.startIcon,ownerState:S,children:y}),E=p&&w.jsx(t2e,{className:O.endIcon,ownerState:S,children:p}),k=i||"";return w.jsxs(JMe,j({ownerState:S,className:ke(r.className,O.root,u,k),component:c,disabled:f,focusRipple:!h,focusVisibleClassName:ke(O.focusVisible,m),ref:n,type:x},_,{classes:O,children:[C,s,E]}))}),er=n2e;function r2e(t){return We("MuiCard",t)}Ve("MuiCard",["root"]);const i2e=["className","raised"],o2e=t=>{const{classes:e}=t;return Ue({root:["root"]},r2e,e)},a2e=we(Go,{name:"MuiCard",slot:"Root",overridesResolver:(t,e)=>e.root})(()=>({overflow:"hidden"})),s2e=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiCard"}),{className:i,raised:o=!1}=r,a=Ae(r,i2e),s=j({},r,{raised:o}),l=o2e(s);return w.jsx(a2e,j({className:ke(l.root,i),elevation:o?8:void 0,ref:n,ownerState:s},a))}),Lre=s2e;function l2e(t){return We("MuiCardActions",t)}Ve("MuiCardActions",["root","spacing"]);const c2e=["disableSpacing","className"],u2e=t=>{const{classes:e,disableSpacing:n}=t;return Ue({root:["root",!n&&"spacing"]},l2e,e)},f2e=we("div",{name:"MuiCardActions",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disableSpacing&&e.spacing]}})(({ownerState:t})=>j({display:"flex",alignItems:"center",padding:8},!t.disableSpacing&&{"& > :not(style) ~ :not(style)":{marginLeft:8}})),d2e=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiCardActions"}),{disableSpacing:i=!1,className:o}=r,a=Ae(r,c2e),s=j({},r,{disableSpacing:i}),l=u2e(s);return w.jsx(f2e,j({className:ke(l.root,o),ownerState:s,ref:n},a))}),$re=d2e;function h2e(t){return We("MuiCardContent",t)}Ve("MuiCardContent",["root"]);const p2e=["className","component"],m2e=t=>{const{classes:e}=t;return Ue({root:["root"]},h2e,e)},g2e=we("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(t,e)=>e.root})(()=>({padding:16,"&:last-child":{paddingBottom:24}})),v2e=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiCardContent"}),{className:i,component:o="div"}=r,a=Ae(r,p2e),s=j({},r,{component:o}),l=m2e(s);return w.jsx(g2e,j({as:o,className:ke(l.root,i),ownerState:s,ref:n},a))}),Nre=v2e;function y2e(t){return We("MuiCardHeader",t)}const x2e=Ve("MuiCardHeader",["root","avatar","action","content","title","subheader"]),s8=x2e,b2e=["action","avatar","className","component","disableTypography","subheader","subheaderTypographyProps","title","titleTypographyProps"],_2e=t=>{const{classes:e}=t;return Ue({root:["root"],avatar:["avatar"],action:["action"],content:["content"],title:["title"],subheader:["subheader"]},y2e,e)},w2e=we("div",{name:"MuiCardHeader",slot:"Root",overridesResolver:(t,e)=>j({[`& .${s8.title}`]:e.title,[`& .${s8.subheader}`]:e.subheader},e.root)})({display:"flex",alignItems:"center",padding:16}),S2e=we("div",{name:"MuiCardHeader",slot:"Avatar",overridesResolver:(t,e)=>e.avatar})({display:"flex",flex:"0 0 auto",marginRight:16}),O2e=we("div",{name:"MuiCardHeader",slot:"Action",overridesResolver:(t,e)=>e.action})({flex:"0 0 auto",alignSelf:"flex-start",marginTop:-4,marginRight:-8,marginBottom:-4}),C2e=we("div",{name:"MuiCardHeader",slot:"Content",overridesResolver:(t,e)=>e.content})({flex:"1 1 auto"}),T2e=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiCardHeader"}),{action:i,avatar:o,className:a,component:s="div",disableTypography:l=!1,subheader:c,subheaderTypographyProps:u,title:f,titleTypographyProps:d}=r,h=Ae(r,b2e),p=j({},r,{component:s,disableTypography:l}),m=_2e(p);let g=f;g!=null&&g.type!==At&&!l&&(g=w.jsx(At,j({variant:o?"body2":"h5",className:m.title,component:"span",display:"block"},d,{children:g})));let v=c;return v!=null&&v.type!==At&&!l&&(v=w.jsx(At,j({variant:o?"body2":"body1",className:m.subheader,color:"text.secondary",component:"span",display:"block"},u,{children:v}))),w.jsxs(w2e,j({className:ke(m.root,a),as:s,ref:n,ownerState:p},h,{children:[o&&w.jsx(S2e,{className:m.avatar,ownerState:p,children:o}),w.jsxs(C2e,{className:m.content,ownerState:p,children:[g,v]}),i&&w.jsx(O2e,{className:m.action,ownerState:p,children:i})]}))}),E2e=T2e;function P2e(t){return We("MuiCardMedia",t)}Ve("MuiCardMedia",["root","media","img"]);const M2e=["children","className","component","image","src","style"],k2e=t=>{const{classes:e,isMediaComponent:n,isImageComponent:r}=t;return Ue({root:["root",n&&"media",r&&"img"]},P2e,e)},A2e=we("div",{name:"MuiCardMedia",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{isMediaComponent:r,isImageComponent:i}=n;return[e.root,r&&e.media,i&&e.img]}})(({ownerState:t})=>j({display:"block",backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"center"},t.isMediaComponent&&{width:"100%"},t.isImageComponent&&{objectFit:"cover"})),R2e=["video","audio","picture","iframe","img"],I2e=["picture","img"],D2e=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiCardMedia"}),{children:i,className:o,component:a="div",image:s,src:l,style:c}=r,u=Ae(r,M2e),f=R2e.indexOf(a)!==-1,d=!f&&s?j({backgroundImage:`url("${s}")`},c):c,h=j({},r,{component:a,isMediaComponent:f,isImageComponent:I2e.indexOf(a)!==-1}),p=k2e(h);return w.jsx(A2e,j({className:ke(p.root,o),as:a,role:!f&&s?"img":void 0,ref:n,style:d,ownerState:h,src:f?s||l:void 0},u,{children:i}))}),L2e=D2e;function $2e(t){return We("PrivateSwitchBase",t)}Ve("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const N2e=["autoFocus","checked","checkedIcon","className","defaultChecked","disabled","disableFocusRipple","edge","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"],F2e=t=>{const{classes:e,checked:n,disabled:r,edge:i}=t,o={root:["root",n&&"checked",r&&"disabled",i&&`edge${De(i)}`],input:["input"]};return Ue(o,$2e,e)},j2e=we(us)(({ownerState:t})=>j({padding:9,borderRadius:"50%"},t.edge==="start"&&{marginLeft:t.size==="small"?-3:-12},t.edge==="end"&&{marginRight:t.size==="small"?-3:-12})),B2e=we("input",{shouldForwardProp:di})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),z2e=M.forwardRef(function(e,n){const{autoFocus:r,checked:i,checkedIcon:o,className:a,defaultChecked:s,disabled:l,disableFocusRipple:c=!1,edge:u=!1,icon:f,id:d,inputProps:h,inputRef:p,name:m,onBlur:g,onChange:v,onFocus:y,readOnly:x,required:b=!1,tabIndex:_,type:S,value:O}=e,C=Ae(e,N2e),[E,k]=Hs({controlled:i,default:!!s,name:"SwitchBase",state:"checked"}),I=nc(),P=U=>{y&&y(U),I&&I.onFocus&&I.onFocus(U)},R=U=>{g&&g(U),I&&I.onBlur&&I.onBlur(U)},T=U=>{if(U.nativeEvent.defaultPrevented)return;const N=U.target.checked;k(N),v&&v(U,N)};let L=l;I&&typeof L>"u"&&(L=I.disabled);const z=S==="checkbox"||S==="radio",B=j({},e,{checked:E,disabled:L,disableFocusRipple:c,edge:u}),W=F2e(B);return w.jsxs(j2e,j({component:"span",className:ke(W.root,a),centerRipple:!0,focusRipple:!c,disabled:L,tabIndex:null,role:void 0,onFocus:P,onBlur:R,ownerState:B,ref:n},C,{children:[w.jsx(B2e,j({autoFocus:r,checked:i,defaultChecked:s,className:W.input,disabled:L,id:z?d:void 0,name:m,onChange:T,readOnly:x,ref:p,required:b,ownerState:B,tabIndex:_,type:S},S==="checkbox"&&O===void 0?{}:{value:O},h)),E?o:f]}))}),h5=z2e,U2e=ti(w.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),W2e=ti(w.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),V2e=ti(w.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function G2e(t){return We("MuiCheckbox",t)}const H2e=Ve("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),xA=H2e,q2e=["checkedIcon","color","icon","indeterminate","indeterminateIcon","inputProps","size","className"],X2e=t=>{const{classes:e,indeterminate:n,color:r,size:i}=t,o={root:["root",n&&"indeterminate",`color${De(r)}`,`size${De(i)}`]},a=Ue(o,G2e,e);return j({},e,a)},Q2e=we(h5,{shouldForwardProp:t=>di(t)||t==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.indeterminate&&e.indeterminate,e[`size${De(n.size)}`],n.color!=="default"&&e[`color${De(n.color)}`]]}})(({theme:t,ownerState:e})=>j({color:(t.vars||t).palette.text.secondary},!e.disableRipple&&{"&:hover":{backgroundColor:t.vars?`rgba(${e.color==="default"?t.vars.palette.action.activeChannel:t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(e.color==="default"?t.palette.action.active:t.palette[e.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},e.color!=="default"&&{[`&.${xA.checked}, &.${xA.indeterminate}`]:{color:(t.vars||t).palette[e.color].main},[`&.${xA.disabled}`]:{color:(t.vars||t).palette.action.disabled}})),Y2e=w.jsx(W2e,{}),K2e=w.jsx(U2e,{}),Z2e=w.jsx(V2e,{}),J2e=M.forwardRef(function(e,n){var r,i;const o=qe({props:e,name:"MuiCheckbox"}),{checkedIcon:a=Y2e,color:s="primary",icon:l=K2e,indeterminate:c=!1,indeterminateIcon:u=Z2e,inputProps:f,size:d="medium",className:h}=o,p=Ae(o,q2e),m=c?u:l,g=c?u:a,v=j({},o,{color:s,indeterminate:c,size:d}),y=X2e(v);return w.jsx(Q2e,j({type:"checkbox",inputProps:j({"data-indeterminate":c},f),icon:M.cloneElement(m,{fontSize:(r=m.props.fontSize)!=null?r:d}),checkedIcon:M.cloneElement(g,{fontSize:(i=g.props.fontSize)!=null?i:d}),ownerState:v,ref:n,className:ke(y.root,h)},p,{classes:y}))}),IL=J2e;function eke(t){return We("MuiCircularProgress",t)}Ve("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const tke=["className","color","disableShrink","size","style","thickness","value","variant"];let NM=t=>t,l8,c8,u8,f8;const Eu=44,nke=Gv(l8||(l8=NM` +`),Fa.rippleVisible,_Te,kL,({theme:t})=>t.transitions.easing.easeInOut,Fa.ripplePulsate,({theme:t})=>t.transitions.duration.shorter,Fa.child,Fa.childLeaving,wTe,kL,({theme:t})=>t.transitions.easing.easeInOut,Fa.childPulsate,STe,({theme:t})=>t.transitions.easing.easeInOut),TTe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTouchRipple"}),{center:i=!1,classes:o={},className:a}=r,s=Ae(r,xTe),[l,c]=M.useState([]),u=M.useRef(0),f=M.useRef(null);M.useEffect(()=>{f.current&&(f.current(),f.current=null)},[l]);const d=M.useRef(!1),h=mf(),p=M.useRef(null),m=M.useRef(null),g=M.useCallback(b=>{const{pulsate:_,rippleX:S,rippleY:O,rippleSize:C,cb:E}=b;c(k=>[...k,w.jsx(CTe,{classes:{ripple:ke(o.ripple,Fa.ripple),rippleVisible:ke(o.rippleVisible,Fa.rippleVisible),ripplePulsate:ke(o.ripplePulsate,Fa.ripplePulsate),child:ke(o.child,Fa.child),childLeaving:ke(o.childLeaving,Fa.childLeaving),childPulsate:ke(o.childPulsate,Fa.childPulsate)},timeout:kL,pulsate:_,rippleX:S,rippleY:O,rippleSize:C},u.current)]),u.current+=1,f.current=E},[o]),v=M.useCallback((b={},_={},S=()=>{})=>{const{pulsate:O=!1,center:C=i||_.pulsate,fakeElement:E=!1}=_;if((b==null?void 0:b.type)==="mousedown"&&d.current){d.current=!1;return}(b==null?void 0:b.type)==="touchstart"&&(d.current=!0);const k=E?null:m.current,I=k?k.getBoundingClientRect():{width:0,height:0,left:0,top:0};let P,R,T;if(C||b===void 0||b.clientX===0&&b.clientY===0||!b.clientX&&!b.touches)P=Math.round(I.width/2),R=Math.round(I.height/2);else{const{clientX:L,clientY:z}=b.touches&&b.touches.length>0?b.touches[0]:b;P=Math.round(L-I.left),R=Math.round(z-I.top)}if(C)T=Math.sqrt((2*I.width**2+I.height**2)/3),T%2===0&&(T+=1);else{const L=Math.max(Math.abs((k?k.clientWidth:0)-P),P)*2+2,z=Math.max(Math.abs((k?k.clientHeight:0)-R),R)*2+2;T=Math.sqrt(L**2+z**2)}b!=null&&b.touches?p.current===null&&(p.current=()=>{g({pulsate:O,rippleX:P,rippleY:R,rippleSize:T,cb:S})},h.start(bTe,()=>{p.current&&(p.current(),p.current=null)})):g({pulsate:O,rippleX:P,rippleY:R,rippleSize:T,cb:S})},[i,g,h]),y=M.useCallback(()=>{v({},{pulsate:!0})},[v]),x=M.useCallback((b,_)=>{if(h.clear(),(b==null?void 0:b.type)==="touchend"&&p.current){p.current(),p.current=null,h.start(0,()=>{x(b,_)});return}p.current=null,c(S=>S.length>0?S.slice(1):S),f.current=_},[h]);return M.useImperativeHandle(n,()=>({pulsate:y,start:v,stop:x}),[y,v,x]),w.jsx(OTe,j({className:ke(Fa.root,o.root,a),ref:m},s,{children:w.jsx(n5,{component:null,exit:!0,children:l})}))}),ETe=TTe;function PTe(t){return We("MuiButtonBase",t)}const MTe=Ve("MuiButtonBase",["root","disabled","focusVisible"]),kTe=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],ATe=t=>{const{disabled:e,focusVisible:n,focusVisibleClassName:r,classes:i}=t,a=Ue({root:["root",e&&"disabled",n&&"focusVisible"]},PTe,i);return n&&r&&(a.root+=` ${r}`),a},RTe=we("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${MTe.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),ITe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiButtonBase"}),{action:i,centerRipple:o=!1,children:a,className:s,component:l="button",disabled:c=!1,disableRipple:u=!1,disableTouchRipple:f=!1,focusRipple:d=!1,LinkComponent:h="a",onBlur:p,onClick:m,onContextMenu:g,onDragLeave:v,onFocus:y,onFocusVisible:x,onKeyDown:b,onKeyUp:_,onMouseDown:S,onMouseLeave:O,onMouseUp:C,onTouchEnd:E,onTouchMove:k,onTouchStart:I,tabIndex:P=0,TouchRippleProps:R,touchRippleRef:T,type:L}=r,z=Ae(r,kTe),B=M.useRef(null),W=M.useRef(null),U=Zt(W,T),{isFocusVisibleRef:N,onFocus:$,onBlur:D,ref:A}=C1(),[q,Y]=M.useState(!1);c&&q&&Y(!1),M.useImperativeHandle(i,()=>({focusVisible:()=>{Y(!0),B.current.focus()}}),[]);const[K,se]=M.useState(!1);M.useEffect(()=>{se(!0)},[]);const te=K&&!u&&!c;M.useEffect(()=>{q&&d&&!u&&K&&W.current.pulsate()},[u,d,q,K]);function J(V,de,xe=f){return br(Me=>(de&&de(Me),!xe&&W.current&&W.current[V](Me),!0))}const pe=J("start",S),be=J("stop",g),re=J("stop",v),ve=J("stop",C),F=J("stop",V=>{q&&V.preventDefault(),O&&O(V)}),ce=J("start",I),le=J("stop",E),Q=J("stop",k),X=J("stop",V=>{D(V),N.current===!1&&Y(!1),p&&p(V)},!1),ee=br(V=>{B.current||(B.current=V.currentTarget),$(V),N.current===!0&&(Y(!0),x&&x(V)),y&&y(V)}),ge=()=>{const V=B.current;return l&&l!=="button"&&!(V.tagName==="A"&&V.href)},ye=M.useRef(!1),H=br(V=>{d&&!ye.current&&q&&W.current&&V.key===" "&&(ye.current=!0,W.current.stop(V,()=>{W.current.start(V)})),V.target===V.currentTarget&&ge()&&V.key===" "&&V.preventDefault(),b&&b(V),V.target===V.currentTarget&&ge()&&V.key==="Enter"&&!c&&(V.preventDefault(),m&&m(V))}),G=br(V=>{d&&V.key===" "&&W.current&&q&&!V.defaultPrevented&&(ye.current=!1,W.current.stop(V,()=>{W.current.pulsate(V)})),_&&_(V),m&&V.target===V.currentTarget&&ge()&&V.key===" "&&!V.defaultPrevented&&m(V)});let ie=l;ie==="button"&&(z.href||z.to)&&(ie=h);const he={};ie==="button"?(he.type=L===void 0?"button":L,he.disabled=c):(!z.href&&!z.to&&(he.role="button"),c&&(he["aria-disabled"]=c));const _e=Zt(n,A,B),oe=j({},r,{centerRipple:o,component:l,disabled:c,disableRipple:u,disableTouchRipple:f,focusRipple:d,tabIndex:P,focusVisible:q}),Z=ATe(oe);return w.jsxs(RTe,j({as:ie,className:ke(Z.root,s),ownerState:oe,onBlur:X,onClick:m,onContextMenu:be,onFocus:ee,onKeyDown:H,onKeyUp:G,onMouseDown:pe,onMouseLeave:F,onMouseUp:ve,onDragLeave:re,onTouchEnd:le,onTouchMove:Q,onTouchStart:ce,ref:_e,tabIndex:c?-1:P,type:L},he,z,{children:[a,te?w.jsx(ETe,j({ref:U,center:o},R)):null]}))}),us=ITe;function DTe(t){return We("MuiIconButton",t)}const LTe=Ve("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),$Te=["edge","children","className","color","disabled","disableFocusRipple","size"],NTe=t=>{const{classes:e,disabled:n,color:r,edge:i,size:o}=t,a={root:["root",n&&"disabled",r!=="default"&&`color${De(r)}`,i&&`edge${De(i)}`,`size${De(o)}`]};return Ue(a,DTe,e)},FTe=we(us,{name:"MuiIconButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color!=="default"&&e[`color${De(n.color)}`],n.edge&&e[`edge${De(n.edge)}`],e[`size${De(n.size)}`]]}})(({theme:t,ownerState:e})=>j({textAlign:"center",flex:"0 0 auto",fontSize:t.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(t.vars||t).palette.action.active,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest})},!e.disableRipple&&{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},e.edge==="start"&&{marginLeft:e.size==="small"?-3:-12},e.edge==="end"&&{marginRight:e.size==="small"?-3:-12}),({theme:t,ownerState:e})=>{var n;const r=(n=(t.vars||t).palette)==null?void 0:n[e.color];return j({},e.color==="inherit"&&{color:"inherit"},e.color!=="inherit"&&e.color!=="default"&&j({color:r==null?void 0:r.main},!e.disableRipple&&{"&:hover":j({},r&&{backgroundColor:t.vars?`rgba(${r.mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(r.main,t.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),e.size==="small"&&{padding:5,fontSize:t.typography.pxToRem(18)},e.size==="large"&&{padding:12,fontSize:t.typography.pxToRem(28)},{[`&.${LTe.disabled}`]:{backgroundColor:"transparent",color:(t.vars||t).palette.action.disabled}})}),jTe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiIconButton"}),{edge:i=!1,children:o,className:a,color:s="default",disabled:l=!1,disableFocusRipple:c=!1,size:u="medium"}=r,f=Ae(r,$Te),d=j({},r,{edge:i,color:s,disabled:l,disableFocusRipple:c,size:u}),h=NTe(d);return w.jsx(FTe,j({className:ke(h.root,a),centerRipple:!0,focusRipple:!c,disabled:l,ref:n},f,{ownerState:d,children:o}))}),Ot=jTe;function BTe(t){return We("MuiTypography",t)}Ve("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const zTe=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],UTe=t=>{const{align:e,gutterBottom:n,noWrap:r,paragraph:i,variant:o,classes:a}=t,s={root:["root",o,t.align!=="inherit"&&`align${De(e)}`,n&&"gutterBottom",r&&"noWrap",i&&"paragraph"]};return Ue(s,BTe,a)},WTe=we("span",{name:"MuiTypography",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.variant&&e[n.variant],n.align!=="inherit"&&e[`align${De(n.align)}`],n.noWrap&&e.noWrap,n.gutterBottom&&e.gutterBottom,n.paragraph&&e.paragraph]}})(({theme:t,ownerState:e})=>j({margin:0},e.variant==="inherit"&&{font:"inherit"},e.variant!=="inherit"&&t.typography[e.variant],e.align!=="inherit"&&{textAlign:e.align},e.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},e.gutterBottom&&{marginBottom:"0.35em"},e.paragraph&&{marginBottom:16})),VV={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},VTe={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},GTe=t=>VTe[t]||t,HTe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTypography"}),i=GTe(r.color),o=S1(j({},r,{color:i})),{align:a="inherit",className:s,component:l,gutterBottom:c=!1,noWrap:u=!1,paragraph:f=!1,variant:d="body1",variantMapping:h=VV}=o,p=Ae(o,zTe),m=j({},o,{align:a,color:i,className:s,component:l,gutterBottom:c,noWrap:u,paragraph:f,variant:d,variantMapping:h}),g=l||(f?"p":h[d]||VV[d])||"span",v=UTe(m);return w.jsx(WTe,j({as:g,ref:n,ownerState:m,className:ke(v.root,s)},p))}),At=HTe;function qTe(t){return We("MuiAppBar",t)}Ve("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const XTe=["className","color","enableColorOnDark","position"],QTe=t=>{const{color:e,position:n,classes:r}=t,i={root:["root",`color${De(e)}`,`position${De(n)}`]};return Ue(i,qTe,r)},Yw=(t,e)=>t?`${t==null?void 0:t.replace(")","")}, ${e})`:e,YTe=we(Go,{name:"MuiAppBar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`position${De(n.position)}`],e[`color${De(n.color)}`]]}})(({theme:t,ownerState:e})=>{const n=t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[900];return j({display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0},e.position==="fixed"&&{position:"fixed",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}},e.position==="absolute"&&{position:"absolute",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0},e.position==="sticky"&&{position:"sticky",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0},e.position==="static"&&{position:"static"},e.position==="relative"&&{position:"relative"},!t.vars&&j({},e.color==="default"&&{backgroundColor:n,color:t.palette.getContrastText(n)},e.color&&e.color!=="default"&&e.color!=="inherit"&&e.color!=="transparent"&&{backgroundColor:t.palette[e.color].main,color:t.palette[e.color].contrastText},e.color==="inherit"&&{color:"inherit"},t.palette.mode==="dark"&&!e.enableColorOnDark&&{backgroundColor:null,color:null},e.color==="transparent"&&j({backgroundColor:"transparent",color:"inherit"},t.palette.mode==="dark"&&{backgroundImage:"none"})),t.vars&&j({},e.color==="default"&&{"--AppBar-background":e.enableColorOnDark?t.vars.palette.AppBar.defaultBg:Yw(t.vars.palette.AppBar.darkBg,t.vars.palette.AppBar.defaultBg),"--AppBar-color":e.enableColorOnDark?t.vars.palette.text.primary:Yw(t.vars.palette.AppBar.darkColor,t.vars.palette.text.primary)},e.color&&!e.color.match(/^(default|inherit|transparent)$/)&&{"--AppBar-background":e.enableColorOnDark?t.vars.palette[e.color].main:Yw(t.vars.palette.AppBar.darkBg,t.vars.palette[e.color].main),"--AppBar-color":e.enableColorOnDark?t.vars.palette[e.color].contrastText:Yw(t.vars.palette.AppBar.darkColor,t.vars.palette[e.color].contrastText)},{backgroundColor:"var(--AppBar-background)",color:e.color==="inherit"?"inherit":"var(--AppBar-color)"},e.color==="transparent"&&{backgroundImage:"none",backgroundColor:"transparent",color:"inherit"}))}),KTe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiAppBar"}),{className:i,color:o="primary",enableColorOnDark:a=!1,position:s="fixed"}=r,l=Ae(r,XTe),c=j({},r,{color:o,position:s,enableColorOnDark:a}),u=QTe(c);return w.jsx(YTe,j({square:!0,component:"header",ownerState:c,elevation:4,className:ke(u.root,i,s==="fixed"&&"mui-fixed"),ref:n},l))}),gre=KTe,vre="base";function ZTe(t){return`${vre}--${t}`}function JTe(t,e){return`${vre}-${t}-${e}`}function yre(t,e){const n=Bne[e];return n?ZTe(n):JTe(t,e)}function eEe(t,e){const n={};return e.forEach(r=>{n[r]=yre(t,r)}),n}function GV(t){return t.substring(2).toLowerCase()}function tEe(t,e){return e.documentElement.clientWidth(setTimeout(()=>{l.current=!0},0),()=>{l.current=!1}),[]);const u=Zt(e.ref,s),f=br(p=>{const m=c.current;c.current=!1;const g=$n(s.current);if(!l.current||!s.current||"clientX"in p&&tEe(p,g))return;if(a.current){a.current=!1;return}let v;p.composedPath?v=p.composedPath().indexOf(s.current)>-1:v=!g.documentElement.contains(p.target)||s.current.contains(p.target),!v&&(n||!m)&&i(p)}),d=p=>m=>{c.current=!0;const g=e.props[p];g&&g(m)},h={ref:u};return o!==!1&&(h[o]=d(o)),M.useEffect(()=>{if(o!==!1){const p=GV(o),m=$n(s.current),g=()=>{a.current=!0};return m.addEventListener(p,f),m.addEventListener("touchmove",g),()=>{m.removeEventListener(p,f),m.removeEventListener("touchmove",g)}}},[f,o]),r!==!1&&(h[r]=d(r)),M.useEffect(()=>{if(r!==!1){const p=GV(r),m=$n(s.current);return m.addEventListener(p,f),()=>{m.removeEventListener(p,f)}}},[f,r]),w.jsx(M.Fragment,{children:M.cloneElement(e,h)})}const rEe=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function iEe(t){const e=parseInt(t.getAttribute("tabindex")||"",10);return Number.isNaN(e)?t.contentEditable==="true"||(t.nodeName==="AUDIO"||t.nodeName==="VIDEO"||t.nodeName==="DETAILS")&&t.getAttribute("tabindex")===null?0:t.tabIndex:e}function oEe(t){if(t.tagName!=="INPUT"||t.type!=="radio"||!t.name)return!1;const e=r=>t.ownerDocument.querySelector(`input[type="radio"]${r}`);let n=e(`[name="${t.name}"]:checked`);return n||(n=e(`[name="${t.name}"]`)),n!==t}function aEe(t){return!(t.disabled||t.tagName==="INPUT"&&t.type==="hidden"||oEe(t))}function sEe(t){const e=[],n=[];return Array.from(t.querySelectorAll(rEe)).forEach((r,i)=>{const o=iEe(r);o===-1||!aEe(r)||(o===0?e.push(r):n.push({documentOrder:i,tabIndex:o,node:r}))}),n.sort((r,i)=>r.tabIndex===i.tabIndex?r.documentOrder-i.documentOrder:r.tabIndex-i.tabIndex).map(r=>r.node).concat(e)}function lEe(){return!0}function xre(t){const{children:e,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:i=!1,getTabbable:o=sEe,isEnabled:a=lEe,open:s}=t,l=M.useRef(!1),c=M.useRef(null),u=M.useRef(null),f=M.useRef(null),d=M.useRef(null),h=M.useRef(!1),p=M.useRef(null),m=Zt(e.ref,p),g=M.useRef(null);M.useEffect(()=>{!s||!p.current||(h.current=!n)},[n,s]),M.useEffect(()=>{if(!s||!p.current)return;const x=$n(p.current);return p.current.contains(x.activeElement)||(p.current.hasAttribute("tabIndex")||p.current.setAttribute("tabIndex","-1"),h.current&&p.current.focus()),()=>{i||(f.current&&f.current.focus&&(l.current=!0,f.current.focus()),f.current=null)}},[s]),M.useEffect(()=>{if(!s||!p.current)return;const x=$n(p.current),b=O=>{g.current=O,!(r||!a()||O.key!=="Tab")&&x.activeElement===p.current&&O.shiftKey&&(l.current=!0,u.current&&u.current.focus())},_=()=>{const O=p.current;if(O===null)return;if(!x.hasFocus()||!a()||l.current){l.current=!1;return}if(O.contains(x.activeElement)||r&&x.activeElement!==c.current&&x.activeElement!==u.current)return;if(x.activeElement!==d.current)d.current=null;else if(d.current!==null)return;if(!h.current)return;let C=[];if((x.activeElement===c.current||x.activeElement===u.current)&&(C=o(p.current)),C.length>0){var E,k;const I=!!((E=g.current)!=null&&E.shiftKey&&((k=g.current)==null?void 0:k.key)==="Tab"),P=C[0],R=C[C.length-1];typeof P!="string"&&typeof R!="string"&&(I?R.focus():P.focus())}else O.focus()};x.addEventListener("focusin",_),x.addEventListener("keydown",b,!0);const S=setInterval(()=>{x.activeElement&&x.activeElement.tagName==="BODY"&&_()},50);return()=>{clearInterval(S),x.removeEventListener("focusin",_),x.removeEventListener("keydown",b,!0)}},[n,r,i,a,s,o]);const v=x=>{f.current===null&&(f.current=x.relatedTarget),h.current=!0,d.current=x.target;const b=e.props.onFocus;b&&b(x)},y=x=>{f.current===null&&(f.current=x.relatedTarget),h.current=!0};return w.jsxs(M.Fragment,{children:[w.jsx("div",{tabIndex:s?0:-1,onFocus:y,ref:c,"data-testid":"sentinelStart"}),M.cloneElement(e,{ref:m,onFocus:v}),w.jsx("div",{tabIndex:s?0:-1,onFocus:y,ref:u,"data-testid":"sentinelEnd"})]})}function cEe(t){return typeof t=="function"?t():t}const bre=M.forwardRef(function(e,n){const{children:r,container:i,disablePortal:o=!1}=e,[a,s]=M.useState(null),l=Zt(M.isValidElement(r)?r.ref:null,n);if(Vr(()=>{o||s(cEe(i)||document.body)},[i,o]),Vr(()=>{if(a&&!o)return xT(n,a),()=>{xT(n,null)}},[n,a,o]),o){if(M.isValidElement(r)){const c={ref:l};return M.cloneElement(r,c)}return w.jsx(M.Fragment,{children:r})}return w.jsx(M.Fragment,{children:a&&Wv.createPortal(r,a)})});function uEe(t){const e=$n(t);return e.body===t?ls(t).innerWidth>e.documentElement.clientWidth:t.scrollHeight>t.clientHeight}function Dx(t,e){e?t.setAttribute("aria-hidden","true"):t.removeAttribute("aria-hidden")}function HV(t){return parseInt(ls(t).getComputedStyle(t).paddingRight,10)||0}function fEe(t){const n=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(t.tagName)!==-1,r=t.tagName==="INPUT"&&t.getAttribute("type")==="hidden";return n||r}function qV(t,e,n,r,i){const o=[e,n,...r];[].forEach.call(t.children,a=>{const s=o.indexOf(a)===-1,l=!fEe(a);s&&l&&Dx(a,i)})}function vA(t,e){let n=-1;return t.some((r,i)=>e(r)?(n=i,!0):!1),n}function dEe(t,e){const n=[],r=t.container;if(!e.disableScrollLock){if(uEe(r)){const a=Yne($n(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${HV(r)+a}px`;const s=$n(r).querySelectorAll(".mui-fixed");[].forEach.call(s,l=>{n.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${HV(l)+a}px`})}let o;if(r.parentNode instanceof DocumentFragment)o=$n(r).body;else{const a=r.parentElement,s=ls(r);o=(a==null?void 0:a.nodeName)==="HTML"&&s.getComputedStyle(a).overflowY==="scroll"?a:r}n.push({value:o.style.overflow,property:"overflow",el:o},{value:o.style.overflowX,property:"overflow-x",el:o},{value:o.style.overflowY,property:"overflow-y",el:o}),o.style.overflow="hidden"}return()=>{n.forEach(({value:o,el:a,property:s})=>{o?a.style.setProperty(s,o):a.style.removeProperty(s)})}}function hEe(t){const e=[];return[].forEach.call(t.children,n=>{n.getAttribute("aria-hidden")==="true"&&e.push(n)}),e}class pEe{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(e,n){let r=this.modals.indexOf(e);if(r!==-1)return r;r=this.modals.length,this.modals.push(e),e.modalRef&&Dx(e.modalRef,!1);const i=hEe(n);qV(n,e.mount,e.modalRef,i,!0);const o=vA(this.containers,a=>a.container===n);return o!==-1?(this.containers[o].modals.push(e),r):(this.containers.push({modals:[e],container:n,restore:null,hiddenSiblings:i}),r)}mount(e,n){const r=vA(this.containers,o=>o.modals.indexOf(e)!==-1),i=this.containers[r];i.restore||(i.restore=dEe(i,n))}remove(e,n=!0){const r=this.modals.indexOf(e);if(r===-1)return r;const i=vA(this.containers,a=>a.modals.indexOf(e)!==-1),o=this.containers[i];if(o.modals.splice(o.modals.indexOf(e),1),this.modals.splice(r,1),o.modals.length===0)o.restore&&o.restore(),e.modalRef&&Dx(e.modalRef,n),qV(o.container,e.mount,e.modalRef,o.hiddenSiblings,!1),this.containers.splice(i,1);else{const a=o.modals[o.modals.length-1];a.modalRef&&Dx(a.modalRef,!1)}return r}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}}function mEe(t){return typeof t=="function"?t():t}function gEe(t){return t?t.props.hasOwnProperty("in"):!1}const vEe=new pEe;function yEe(t){const{container:e,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,manager:i=vEe,closeAfterTransition:o=!1,onTransitionEnter:a,onTransitionExited:s,children:l,onClose:c,open:u,rootRef:f}=t,d=M.useRef({}),h=M.useRef(null),p=M.useRef(null),m=Zt(p,f),[g,v]=M.useState(!u),y=gEe(l);let x=!0;(t["aria-hidden"]==="false"||t["aria-hidden"]===!1)&&(x=!1);const b=()=>$n(h.current),_=()=>(d.current.modalRef=p.current,d.current.mount=h.current,d.current),S=()=>{i.mount(_(),{disableScrollLock:r}),p.current&&(p.current.scrollTop=0)},O=br(()=>{const z=mEe(e)||b().body;i.add(_(),z),p.current&&S()}),C=M.useCallback(()=>i.isTopModal(_()),[i]),E=br(z=>{h.current=z,z&&(u&&C()?S():p.current&&Dx(p.current,x))}),k=M.useCallback(()=>{i.remove(_(),x)},[x,i]);M.useEffect(()=>()=>{k()},[k]),M.useEffect(()=>{u?O():(!y||!o)&&k()},[u,k,y,o,O]);const I=z=>B=>{var W;(W=z.onKeyDown)==null||W.call(z,B),!(B.key!=="Escape"||B.which===229||!C())&&(n||(B.stopPropagation(),c&&c(B,"escapeKeyDown")))},P=z=>B=>{var W;(W=z.onClick)==null||W.call(z,B),B.target===B.currentTarget&&c&&c(B,"backdropClick")};return{getRootProps:(z={})=>{const B=kh(t);delete B.onTransitionEnter,delete B.onTransitionExited;const W=j({},B,z);return j({role:"presentation"},W,{onKeyDown:I(W),ref:m})},getBackdropProps:(z={})=>{const B=z;return j({"aria-hidden":!0},B,{onClick:P(B),open:u})},getTransitionProps:()=>{const z=()=>{v(!1),a&&a()},B=()=>{v(!0),s&&s(),o&&k()};return{onEnter:yT(z,l==null?void 0:l.props.onEnter),onExited:yT(B,l==null?void 0:l.props.onExited)}},rootRef:m,portalRef:E,isTopModal:C,exited:g,hasTransition:y}}var Lo="top",fs="bottom",ds="right",$o="left",i5="auto",k1=[Lo,fs,ds,$o],Vg="start",Mb="end",xEe="clippingParents",_re="viewport",l0="popper",bEe="reference",XV=k1.reduce(function(t,e){return t.concat([e+"-"+Vg,e+"-"+Mb])},[]),wre=[].concat(k1,[i5]).reduce(function(t,e){return t.concat([e,e+"-"+Vg,e+"-"+Mb])},[]),_Ee="beforeRead",wEe="read",SEe="afterRead",OEe="beforeMain",CEe="main",TEe="afterMain",EEe="beforeWrite",PEe="write",MEe="afterWrite",kEe=[_Ee,wEe,SEe,OEe,CEe,TEe,EEe,PEe,MEe];function Yl(t){return t?(t.nodeName||"").toLowerCase():null}function Sa(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function qh(t){var e=Sa(t).Element;return t instanceof e||t instanceof Element}function Ja(t){var e=Sa(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function o5(t){if(typeof ShadowRoot>"u")return!1;var e=Sa(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function AEe(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},o=e.elements[n];!Ja(o)||!Yl(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var s=i[a];s===!1?o.removeAttribute(a):o.setAttribute(a,s===!0?"":s)}))})}function REe(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},a=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),s=a.reduce(function(l,c){return l[c]="",l},{});!Ja(i)||!Yl(i)||(Object.assign(i.style,s),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const IEe={name:"applyStyles",enabled:!0,phase:"write",fn:AEe,effect:REe,requires:["computeStyles"]};function Ul(t){return t.split("-")[0]}var Ah=Math.max,ST=Math.min,Gg=Math.round;function AL(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Sre(){return!/^((?!chrome|android).)*safari/i.test(AL())}function Hg(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&Ja(t)&&(i=t.offsetWidth>0&&Gg(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&Gg(r.height)/t.offsetHeight||1);var a=qh(t)?Sa(t):window,s=a.visualViewport,l=!Sre()&&n,c=(r.left+(l&&s?s.offsetLeft:0))/i,u=(r.top+(l&&s?s.offsetTop:0))/o,f=r.width/i,d=r.height/o;return{width:f,height:d,top:u,right:c+f,bottom:u+d,left:c,x:c,y:u}}function a5(t){var e=Hg(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function Ore(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&o5(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function lu(t){return Sa(t).getComputedStyle(t)}function DEe(t){return["table","td","th"].indexOf(Yl(t))>=0}function ud(t){return((qh(t)?t.ownerDocument:t.document)||window.document).documentElement}function kM(t){return Yl(t)==="html"?t:t.assignedSlot||t.parentNode||(o5(t)?t.host:null)||ud(t)}function QV(t){return!Ja(t)||lu(t).position==="fixed"?null:t.offsetParent}function LEe(t){var e=/firefox/i.test(AL()),n=/Trident/i.test(AL());if(n&&Ja(t)){var r=lu(t);if(r.position==="fixed")return null}var i=kM(t);for(o5(i)&&(i=i.host);Ja(i)&&["html","body"].indexOf(Yl(i))<0;){var o=lu(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function A1(t){for(var e=Sa(t),n=QV(t);n&&DEe(n)&&lu(n).position==="static";)n=QV(n);return n&&(Yl(n)==="html"||Yl(n)==="body"&&lu(n).position==="static")?e:n||LEe(t)||e}function s5(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Lx(t,e,n){return Ah(t,ST(e,n))}function $Ee(t,e,n){var r=Lx(t,e,n);return r>n?n:r}function Cre(){return{top:0,right:0,bottom:0,left:0}}function Tre(t){return Object.assign({},Cre(),t)}function Ere(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var NEe=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,Tre(typeof e!="number"?e:Ere(e,k1))};function FEe(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Ul(n.placement),l=s5(s),c=[$o,ds].indexOf(s)>=0,u=c?"height":"width";if(!(!o||!a)){var f=NEe(i.padding,n),d=a5(o),h=l==="y"?Lo:$o,p=l==="y"?fs:ds,m=n.rects.reference[u]+n.rects.reference[l]-a[l]-n.rects.popper[u],g=a[l]-n.rects.reference[l],v=A1(o),y=v?l==="y"?v.clientHeight||0:v.clientWidth||0:0,x=m/2-g/2,b=f[h],_=y-d[u]-f[p],S=y/2-d[u]/2+x,O=Lx(b,S,_),C=l;n.modifiersData[r]=(e={},e[C]=O,e.centerOffset=O-S,e)}}function jEe(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||Ore(e.elements.popper,i)&&(e.elements.arrow=i))}const BEe={name:"arrow",enabled:!0,phase:"main",fn:FEe,effect:jEe,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function qg(t){return t.split("-")[1]}var zEe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function UEe(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:Gg(n*i)/i||0,y:Gg(r*i)/i||0}}function YV(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,a=t.offsets,s=t.position,l=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,f=t.isFixed,d=a.x,h=d===void 0?0:d,p=a.y,m=p===void 0?0:p,g=typeof u=="function"?u({x:h,y:m}):{x:h,y:m};h=g.x,m=g.y;var v=a.hasOwnProperty("x"),y=a.hasOwnProperty("y"),x=$o,b=Lo,_=window;if(c){var S=A1(n),O="clientHeight",C="clientWidth";if(S===Sa(n)&&(S=ud(n),lu(S).position!=="static"&&s==="absolute"&&(O="scrollHeight",C="scrollWidth")),S=S,i===Lo||(i===$o||i===ds)&&o===Mb){b=fs;var E=f&&S===_&&_.visualViewport?_.visualViewport.height:S[O];m-=E-r.height,m*=l?1:-1}if(i===$o||(i===Lo||i===fs)&&o===Mb){x=ds;var k=f&&S===_&&_.visualViewport?_.visualViewport.width:S[C];h-=k-r.width,h*=l?1:-1}}var I=Object.assign({position:s},c&&zEe),P=u===!0?UEe({x:h,y:m},Sa(n)):{x:h,y:m};if(h=P.x,m=P.y,l){var R;return Object.assign({},I,(R={},R[b]=y?"0":"",R[x]=v?"0":"",R.transform=(_.devicePixelRatio||1)<=1?"translate("+h+"px, "+m+"px)":"translate3d("+h+"px, "+m+"px, 0)",R))}return Object.assign({},I,(e={},e[b]=y?m+"px":"",e[x]=v?h+"px":"",e.transform="",e))}function WEe(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,s=n.roundOffsets,l=s===void 0?!0:s,c={placement:Ul(e.placement),variation:qg(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,YV(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,YV(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const VEe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:WEe,data:{}};var Kw={passive:!0};function GEe(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,s=a===void 0?!0:a,l=Sa(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach(function(u){u.addEventListener("scroll",n.update,Kw)}),s&&l.addEventListener("resize",n.update,Kw),function(){o&&c.forEach(function(u){u.removeEventListener("scroll",n.update,Kw)}),s&&l.removeEventListener("resize",n.update,Kw)}}const HEe={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:GEe,data:{}};var qEe={left:"right",right:"left",bottom:"top",top:"bottom"};function _C(t){return t.replace(/left|right|bottom|top/g,function(e){return qEe[e]})}var XEe={start:"end",end:"start"};function KV(t){return t.replace(/start|end/g,function(e){return XEe[e]})}function l5(t){var e=Sa(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function c5(t){return Hg(ud(t)).left+l5(t).scrollLeft}function QEe(t,e){var n=Sa(t),r=ud(t),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;var c=Sre();(c||!c&&e==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s+c5(t),y:l}}function YEe(t){var e,n=ud(t),r=l5(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=Ah(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=Ah(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+c5(t),l=-r.scrollTop;return lu(i||n).direction==="rtl"&&(s+=Ah(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}function u5(t){var e=lu(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Pre(t){return["html","body","#document"].indexOf(Yl(t))>=0?t.ownerDocument.body:Ja(t)&&u5(t)?t:Pre(kM(t))}function $x(t,e){var n;e===void 0&&(e=[]);var r=Pre(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=Sa(r),a=i?[o].concat(o.visualViewport||[],u5(r)?r:[]):r,s=e.concat(a);return i?s:s.concat($x(kM(a)))}function RL(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function KEe(t,e){var n=Hg(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function ZV(t,e,n){return e===_re?RL(QEe(t,n)):qh(e)?KEe(e,n):RL(YEe(ud(t)))}function ZEe(t){var e=$x(kM(t)),n=["absolute","fixed"].indexOf(lu(t).position)>=0,r=n&&Ja(t)?A1(t):t;return qh(r)?e.filter(function(i){return qh(i)&&Ore(i,r)&&Yl(i)!=="body"}):[]}function JEe(t,e,n,r){var i=e==="clippingParents"?ZEe(t):[].concat(e),o=[].concat(i,[n]),a=o[0],s=o.reduce(function(l,c){var u=ZV(t,c,r);return l.top=Ah(u.top,l.top),l.right=ST(u.right,l.right),l.bottom=ST(u.bottom,l.bottom),l.left=Ah(u.left,l.left),l},ZV(t,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Mre(t){var e=t.reference,n=t.element,r=t.placement,i=r?Ul(r):null,o=r?qg(r):null,a=e.x+e.width/2-n.width/2,s=e.y+e.height/2-n.height/2,l;switch(i){case Lo:l={x:a,y:e.y-n.height};break;case fs:l={x:a,y:e.y+e.height};break;case ds:l={x:e.x+e.width,y:s};break;case $o:l={x:e.x-n.width,y:s};break;default:l={x:e.x,y:e.y}}var c=i?s5(i):null;if(c!=null){var u=c==="y"?"height":"width";switch(o){case Vg:l[c]=l[c]-(e[u]/2-n[u]/2);break;case Mb:l[c]=l[c]+(e[u]/2-n[u]/2);break}}return l}function kb(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,a=o===void 0?t.strategy:o,s=n.boundary,l=s===void 0?xEe:s,c=n.rootBoundary,u=c===void 0?_re:c,f=n.elementContext,d=f===void 0?l0:f,h=n.altBoundary,p=h===void 0?!1:h,m=n.padding,g=m===void 0?0:m,v=Tre(typeof g!="number"?g:Ere(g,k1)),y=d===l0?bEe:l0,x=t.rects.popper,b=t.elements[p?y:d],_=JEe(qh(b)?b:b.contextElement||ud(t.elements.popper),l,u,a),S=Hg(t.elements.reference),O=Mre({reference:S,element:x,strategy:"absolute",placement:i}),C=RL(Object.assign({},x,O)),E=d===l0?C:S,k={top:_.top-E.top+v.top,bottom:E.bottom-_.bottom+v.bottom,left:_.left-E.left+v.left,right:E.right-_.right+v.right},I=t.modifiersData.offset;if(d===l0&&I){var P=I[i];Object.keys(k).forEach(function(R){var T=[ds,fs].indexOf(R)>=0?1:-1,L=[Lo,fs].indexOf(R)>=0?"y":"x";k[R]+=P[L]*T})}return k}function ePe(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?wre:l,u=qg(r),f=u?s?XV:XV.filter(function(p){return qg(p)===u}):k1,d=f.filter(function(p){return c.indexOf(p)>=0});d.length===0&&(d=f);var h=d.reduce(function(p,m){return p[m]=kb(t,{placement:m,boundary:i,rootBoundary:o,padding:a})[Ul(m)],p},{});return Object.keys(h).sort(function(p,m){return h[p]-h[m]})}function tPe(t){if(Ul(t)===i5)return[];var e=_C(t);return[KV(t),e,KV(e)]}function nPe(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!0:a,l=n.fallbackPlacements,c=n.padding,u=n.boundary,f=n.rootBoundary,d=n.altBoundary,h=n.flipVariations,p=h===void 0?!0:h,m=n.allowedAutoPlacements,g=e.options.placement,v=Ul(g),y=v===g,x=l||(y||!p?[_C(g)]:tPe(g)),b=[g].concat(x).reduce(function(q,Y){return q.concat(Ul(Y)===i5?ePe(e,{placement:Y,boundary:u,rootBoundary:f,padding:c,flipVariations:p,allowedAutoPlacements:m}):Y)},[]),_=e.rects.reference,S=e.rects.popper,O=new Map,C=!0,E=b[0],k=0;k=0,L=T?"width":"height",z=kb(e,{placement:I,boundary:u,rootBoundary:f,altBoundary:d,padding:c}),B=T?R?ds:$o:R?fs:Lo;_[L]>S[L]&&(B=_C(B));var W=_C(B),U=[];if(o&&U.push(z[P]<=0),s&&U.push(z[B]<=0,z[W]<=0),U.every(function(q){return q})){E=I,C=!1;break}O.set(I,U)}if(C)for(var N=p?3:1,$=function(Y){var K=b.find(function(se){var te=O.get(se);if(te)return te.slice(0,Y).every(function(J){return J})});if(K)return E=K,"break"},D=N;D>0;D--){var A=$(D);if(A==="break")break}e.placement!==E&&(e.modifiersData[r]._skip=!0,e.placement=E,e.reset=!0)}}const rPe={name:"flip",enabled:!0,phase:"main",fn:nPe,requiresIfExists:["offset"],data:{_skip:!1}};function JV(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function e8(t){return[Lo,ds,fs,$o].some(function(e){return t[e]>=0})}function iPe(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,a=kb(e,{elementContext:"reference"}),s=kb(e,{altBoundary:!0}),l=JV(a,r),c=JV(s,i,o),u=e8(l),f=e8(c);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}const oPe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:iPe};function aPe(t,e,n){var r=Ul(t),i=[$o,Lo].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[$o,ds].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function sPe(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,a=wre.reduce(function(u,f){return u[f]=aPe(f,e.rects,o),u},{}),s=a[e.placement],l=s.x,c=s.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=a}const lPe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:sPe};function cPe(t){var e=t.state,n=t.name;e.modifiersData[n]=Mre({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const uPe={name:"popperOffsets",enabled:!0,phase:"read",fn:cPe,data:{}};function fPe(t){return t==="x"?"y":"x"}function dPe(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!1:a,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,f=n.padding,d=n.tether,h=d===void 0?!0:d,p=n.tetherOffset,m=p===void 0?0:p,g=kb(e,{boundary:l,rootBoundary:c,padding:f,altBoundary:u}),v=Ul(e.placement),y=qg(e.placement),x=!y,b=s5(v),_=fPe(b),S=e.modifiersData.popperOffsets,O=e.rects.reference,C=e.rects.popper,E=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,k=typeof E=="number"?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),I=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,P={x:0,y:0};if(S){if(o){var R,T=b==="y"?Lo:$o,L=b==="y"?fs:ds,z=b==="y"?"height":"width",B=S[b],W=B+g[T],U=B-g[L],N=h?-C[z]/2:0,$=y===Vg?O[z]:C[z],D=y===Vg?-C[z]:-O[z],A=e.elements.arrow,q=h&&A?a5(A):{width:0,height:0},Y=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Cre(),K=Y[T],se=Y[L],te=Lx(0,O[z],q[z]),J=x?O[z]/2-N-te-K-k.mainAxis:$-te-K-k.mainAxis,pe=x?-O[z]/2+N+te+se+k.mainAxis:D+te+se+k.mainAxis,be=e.elements.arrow&&A1(e.elements.arrow),re=be?b==="y"?be.clientTop||0:be.clientLeft||0:0,ve=(R=I==null?void 0:I[b])!=null?R:0,F=B+J-ve-re,ce=B+pe-ve,le=Lx(h?ST(W,F):W,B,h?Ah(U,ce):U);S[b]=le,P[b]=le-B}if(s){var Q,X=b==="x"?Lo:$o,ee=b==="x"?fs:ds,ge=S[_],ye=_==="y"?"height":"width",H=ge+g[X],G=ge-g[ee],ie=[Lo,$o].indexOf(v)!==-1,he=(Q=I==null?void 0:I[_])!=null?Q:0,_e=ie?H:ge-O[ye]-C[ye]-he+k.altAxis,oe=ie?ge+O[ye]+C[ye]-he-k.altAxis:G,Z=h&&ie?$Ee(_e,ge,oe):Lx(h?_e:H,ge,h?oe:G);S[_]=Z,P[_]=Z-ge}e.modifiersData[r]=P}}const hPe={name:"preventOverflow",enabled:!0,phase:"main",fn:dPe,requiresIfExists:["offset"]};function pPe(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function mPe(t){return t===Sa(t)||!Ja(t)?l5(t):pPe(t)}function gPe(t){var e=t.getBoundingClientRect(),n=Gg(e.width)/t.offsetWidth||1,r=Gg(e.height)/t.offsetHeight||1;return n!==1||r!==1}function vPe(t,e,n){n===void 0&&(n=!1);var r=Ja(e),i=Ja(e)&&gPe(e),o=ud(e),a=Hg(t,i,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((Yl(e)!=="body"||u5(o))&&(s=mPe(e)),Ja(e)?(l=Hg(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):o&&(l.x=c5(o))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function yPe(t){var e=new Map,n=new Set,r=[];t.forEach(function(o){e.set(o.name,o)});function i(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(s){if(!n.has(s)){var l=e.get(s);l&&i(l)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function xPe(t){var e=yPe(t);return kEe.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function bPe(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function _Pe(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var t8={placement:"bottom",modifiers:[],strategy:"absolute"};function n8(){for(var t=arguments.length,e=new Array(t),n=0;nUe({root:["root"]},dTe(CPe)),APe={},RPe=M.forwardRef(function(e,n){var r;const{anchorEl:i,children:o,direction:a,disablePortal:s,modifiers:l,open:c,placement:u,popperOptions:f,popperRef:d,slotProps:h={},slots:p={},TransitionProps:m}=e,g=Ae(e,TPe),v=M.useRef(null),y=Zt(v,n),x=M.useRef(null),b=Zt(x,d),_=M.useRef(b);Vr(()=>{_.current=b},[b]),M.useImperativeHandle(d,()=>x.current,[]);const S=PPe(u,a),[O,C]=M.useState(S),[E,k]=M.useState(IL(i));M.useEffect(()=>{x.current&&x.current.forceUpdate()}),M.useEffect(()=>{i&&k(IL(i))},[i]),Vr(()=>{if(!E||!c)return;const L=W=>{C(W.placement)};let z=[{name:"preventOverflow",options:{altBoundary:s}},{name:"flip",options:{altBoundary:s}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:W})=>{L(W)}}];l!=null&&(z=z.concat(l)),f&&f.modifiers!=null&&(z=z.concat(f.modifiers));const B=OPe(E,v.current,j({placement:S},f,{modifiers:z}));return _.current(B),()=>{B.destroy(),_.current(null)}},[E,s,l,c,f,S]);const I={placement:O};m!==null&&(I.TransitionProps=m);const P=kPe(),R=(r=p.root)!=null?r:"div",T=Lr({elementType:R,externalSlotProps:h.root,externalForwardedProps:g,additionalProps:{role:"tooltip",ref:y},ownerState:e,className:P.root});return w.jsx(R,j({},T,{children:typeof o=="function"?o(I):o}))}),IPe=M.forwardRef(function(e,n){const{anchorEl:r,children:i,container:o,direction:a="ltr",disablePortal:s=!1,keepMounted:l=!1,modifiers:c,open:u,placement:f="bottom",popperOptions:d=APe,popperRef:h,style:p,transition:m=!1,slotProps:g={},slots:v={}}=e,y=Ae(e,EPe),[x,b]=M.useState(!0),_=()=>{b(!1)},S=()=>{b(!0)};if(!l&&!u&&(!m||x))return null;let O;if(o)O=o;else if(r){const k=IL(r);O=k&&MPe(k)?$n(k).body:$n(null).body}const C=!u&&l&&(!m||x)?"none":void 0,E=m?{in:u,onEnter:_,onExited:S}:void 0;return w.jsx(bre,{disablePortal:s,container:O,children:w.jsx(RPe,j({anchorEl:r,direction:a,disablePortal:s,modifiers:c,ref:n,open:m?!x:u,placement:f,popperOptions:d,popperRef:h,slotProps:g,slots:v},y,{style:j({position:"fixed",top:0,left:0,display:C},p),TransitionProps:E,children:i}))})}),DPe=2;function Are(t,e){return t-e}function r8(t,e){var n;const{index:r}=(n=t.reduce((i,o,a)=>{const s=Math.abs(e-o);return i===null||s({left:`${t}%`}),leap:t=>({width:`${t}%`})},"horizontal-reverse":{offset:t=>({right:`${t}%`}),leap:t=>({width:`${t}%`})},vertical:{offset:t=>({bottom:`${t}%`}),leap:t=>({height:`${t}%`})}},jPe=t=>t;let tS;function o8(){return tS===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?tS=CSS.supports("touch-action","none"):tS=!0),tS}function BPe(t){const{"aria-labelledby":e,defaultValue:n,disabled:r=!1,disableSwap:i=!1,isRtl:o=!1,marks:a=!1,max:s=100,min:l=0,name:c,onChange:u,onChangeCommitted:f,orientation:d="horizontal",rootRef:h,scale:p=jPe,step:m=1,shiftStep:g=10,tabIndex:v,value:y}=t,x=M.useRef(),[b,_]=M.useState(-1),[S,O]=M.useState(-1),[C,E]=M.useState(!1),k=M.useRef(0),[I,P]=Hs({controlled:y,default:n??l,name:"Slider"}),R=u&&((Z,V,de)=>{const xe=Z.nativeEvent||Z,Me=new xe.constructor(xe.type,xe);Object.defineProperty(Me,"target",{writable:!0,value:{value:V,name:c}}),u(Me,V,de)}),T=Array.isArray(I);let L=T?I.slice().sort(Are):[I];L=L.map(Z=>Z==null?l:eh(Z,l,s));const z=a===!0&&m!==null?[...Array(Math.floor((s-l)/m)+1)].map((Z,V)=>({value:l+m*V})):a||[],B=z.map(Z=>Z.value),{isFocusVisibleRef:W,onBlur:U,onFocus:N,ref:$}=C1(),[D,A]=M.useState(-1),q=M.useRef(),Y=Zt($,q),K=Zt(h,Y),se=Z=>V=>{var de;const xe=Number(V.currentTarget.getAttribute("data-index"));N(V),W.current===!0&&A(xe),O(xe),Z==null||(de=Z.onFocus)==null||de.call(Z,V)},te=Z=>V=>{var de;U(V),W.current===!1&&A(-1),O(-1),Z==null||(de=Z.onBlur)==null||de.call(Z,V)},J=(Z,V)=>{const de=Number(Z.currentTarget.getAttribute("data-index")),xe=L[de],Me=B.indexOf(xe);let me=V;if(z&&m==null){const Ne=B[B.length-1];me>Ne?me=Ne:meV=>{var de;if(m!==null){const xe=Number(V.currentTarget.getAttribute("data-index")),Me=L[xe];let me=null;(V.key==="ArrowLeft"||V.key==="ArrowDown")&&V.shiftKey||V.key==="PageDown"?me=Math.max(Me-g,l):((V.key==="ArrowRight"||V.key==="ArrowUp")&&V.shiftKey||V.key==="PageUp")&&(me=Math.min(Me+g,s)),me!==null&&(J(V,me),V.preventDefault())}Z==null||(de=Z.onKeyDown)==null||de.call(Z,V)};Vr(()=>{if(r&&q.current.contains(document.activeElement)){var Z;(Z=document.activeElement)==null||Z.blur()}},[r]),r&&b!==-1&&_(-1),r&&D!==-1&&A(-1);const be=Z=>V=>{var de;(de=Z.onChange)==null||de.call(Z,V),J(V,V.target.valueAsNumber)},re=M.useRef();let ve=d;o&&d==="horizontal"&&(ve+="-reverse");const F=({finger:Z,move:V=!1})=>{const{current:de}=q,{width:xe,height:Me,bottom:me,left:Ne}=de.getBoundingClientRect();let Ce;ve.indexOf("vertical")===0?Ce=(me-Z.y)/Me:Ce=(Z.x-Ne)/xe,ve.indexOf("-reverse")!==-1&&(Ce=1-Ce);let Re;if(Re=LPe(Ce,l,s),m)Re=NPe(Re,m,l);else{const Le=r8(B,Re);Re=B[Le]}Re=eh(Re,l,s);let ae=0;if(T){V?ae=re.current:ae=r8(L,Re),i&&(Re=eh(Re,L[ae-1]||-1/0,L[ae+1]||1/0));const Le=Re;Re=i8({values:L,newValue:Re,index:ae}),i&&V||(ae=Re.indexOf(Le),re.current=ae)}return{newValue:Re,activeIndex:ae}},ce=br(Z=>{const V=Zw(Z,x);if(!V)return;if(k.current+=1,Z.type==="mousemove"&&Z.buttons===0){le(Z);return}const{newValue:de,activeIndex:xe}=F({finger:V,move:!0});Jw({sliderRef:q,activeIndex:xe,setActive:_}),P(de),!C&&k.current>DPe&&E(!0),R&&!eS(de,I)&&R(Z,de,xe)}),le=br(Z=>{const V=Zw(Z,x);if(E(!1),!V)return;const{newValue:de}=F({finger:V,move:!0});_(-1),Z.type==="touchend"&&O(-1),f&&f(Z,de),x.current=void 0,X()}),Q=br(Z=>{if(r)return;o8()||Z.preventDefault();const V=Z.changedTouches[0];V!=null&&(x.current=V.identifier);const de=Zw(Z,x);if(de!==!1){const{newValue:Me,activeIndex:me}=F({finger:de});Jw({sliderRef:q,activeIndex:me,setActive:_}),P(Me),R&&!eS(Me,I)&&R(Z,Me,me)}k.current=0;const xe=$n(q.current);xe.addEventListener("touchmove",ce,{passive:!0}),xe.addEventListener("touchend",le,{passive:!0})}),X=M.useCallback(()=>{const Z=$n(q.current);Z.removeEventListener("mousemove",ce),Z.removeEventListener("mouseup",le),Z.removeEventListener("touchmove",ce),Z.removeEventListener("touchend",le)},[le,ce]);M.useEffect(()=>{const{current:Z}=q;return Z.addEventListener("touchstart",Q,{passive:o8()}),()=>{Z.removeEventListener("touchstart",Q),X()}},[X,Q]),M.useEffect(()=>{r&&X()},[r,X]);const ee=Z=>V=>{var de;if((de=Z.onMouseDown)==null||de.call(Z,V),r||V.defaultPrevented||V.button!==0)return;V.preventDefault();const xe=Zw(V,x);if(xe!==!1){const{newValue:me,activeIndex:Ne}=F({finger:xe});Jw({sliderRef:q,activeIndex:Ne,setActive:_}),P(me),R&&!eS(me,I)&&R(V,me,Ne)}k.current=0;const Me=$n(q.current);Me.addEventListener("mousemove",ce,{passive:!0}),Me.addEventListener("mouseup",le)},ge=OT(T?L[0]:l,l,s),ye=OT(L[L.length-1],l,s)-ge,H=(Z={})=>{const V=kh(Z),de={onMouseDown:ee(V||{})},xe=j({},V,de);return j({},Z,{ref:K},xe)},G=Z=>V=>{var de;(de=Z.onMouseOver)==null||de.call(Z,V);const xe=Number(V.currentTarget.getAttribute("data-index"));O(xe)},ie=Z=>V=>{var de;(de=Z.onMouseLeave)==null||de.call(Z,V),O(-1)};return{active:b,axis:ve,axisProps:FPe,dragging:C,focusedThumbIndex:D,getHiddenInputProps:(Z={})=>{var V;const de=kh(Z),xe={onChange:be(de||{}),onFocus:se(de||{}),onBlur:te(de||{}),onKeyDown:pe(de||{})},Me=j({},de,xe);return j({tabIndex:v,"aria-labelledby":e,"aria-orientation":d,"aria-valuemax":p(s),"aria-valuemin":p(l),name:c,type:"range",min:t.min,max:t.max,step:t.step===null&&t.marks?"any":(V=t.step)!=null?V:void 0,disabled:r},Z,Me,{style:j({},dOe,{direction:o?"rtl":"ltr",width:"100%",height:"100%"})})},getRootProps:H,getThumbProps:(Z={})=>{const V=kh(Z),de={onMouseOver:G(V||{}),onMouseLeave:ie(V||{})};return j({},Z,V,de)},marks:z,open:S,range:T,rootRef:K,trackLeap:ye,trackOffset:ge,values:L,getThumbStyle:Z=>({pointerEvents:b!==-1&&b!==Z?"none":void 0})}}function zPe(t={}){const{autoHideDuration:e=null,disableWindowBlurListener:n=!1,onClose:r,open:i,resumeHideDuration:o}=t,a=mf();M.useEffect(()=>{if(!i)return;function v(y){y.defaultPrevented||(y.key==="Escape"||y.key==="Esc")&&(r==null||r(y,"escapeKeyDown"))}return document.addEventListener("keydown",v),()=>{document.removeEventListener("keydown",v)}},[i,r]);const s=br((v,y)=>{r==null||r(v,y)}),l=br(v=>{!r||v==null||a.start(v,()=>{s(null,"timeout")})});M.useEffect(()=>(i&&l(e),a.clear),[i,e,l,a]);const c=v=>{r==null||r(v,"clickaway")},u=a.clear,f=M.useCallback(()=>{e!=null&&l(o??e*.5)},[e,o,l]),d=v=>y=>{const x=v.onBlur;x==null||x(y),f()},h=v=>y=>{const x=v.onFocus;x==null||x(y),u()},p=v=>y=>{const x=v.onMouseEnter;x==null||x(y),u()},m=v=>y=>{const x=v.onMouseLeave;x==null||x(y),f()};return M.useEffect(()=>{if(!n&&i)return window.addEventListener("focus",f),window.addEventListener("blur",u),()=>{window.removeEventListener("focus",f),window.removeEventListener("blur",u)}},[n,i,f,u]),{getRootProps:(v={})=>{const y=j({},kh(t),kh(v));return j({role:"presentation"},v,y,{onBlur:d(y),onFocus:h(y),onMouseEnter:p(y),onMouseLeave:m(y)})},onClickAway:c}}const UPe=["onChange","maxRows","minRows","style","value"];function nS(t){return parseInt(t,10)||0}const WPe={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function VPe(t){return t==null||Object.keys(t).length===0||t.outerHeightStyle===0&&!t.overflowing}const GPe=M.forwardRef(function(e,n){const{onChange:r,maxRows:i,minRows:o=1,style:a,value:s}=e,l=Ae(e,UPe),{current:c}=M.useRef(s!=null),u=M.useRef(null),f=Zt(n,u),d=M.useRef(null),h=M.useCallback(()=>{const g=u.current,y=ls(g).getComputedStyle(g);if(y.width==="0px")return{outerHeightStyle:0,overflowing:!1};const x=d.current;x.style.width=y.width,x.value=g.value||e.placeholder||"x",x.value.slice(-1)===` +`&&(x.value+=" ");const b=y.boxSizing,_=nS(y.paddingBottom)+nS(y.paddingTop),S=nS(y.borderBottomWidth)+nS(y.borderTopWidth),O=x.scrollHeight;x.value="x";const C=x.scrollHeight;let E=O;o&&(E=Math.max(Number(o)*C,E)),i&&(E=Math.min(Number(i)*C,E)),E=Math.max(E,C);const k=E+(b==="border-box"?_+S:0),I=Math.abs(E-O)<=1;return{outerHeightStyle:k,overflowing:I}},[i,o,e.placeholder]),p=M.useCallback(()=>{const g=h();if(VPe(g))return;const v=u.current;v.style.height=`${g.outerHeightStyle}px`,v.style.overflow=g.overflowing?"hidden":""},[h]);Vr(()=>{const g=()=>{p()};let v;const y=Hv(g),x=u.current,b=ls(x);b.addEventListener("resize",y);let _;return typeof ResizeObserver<"u"&&(_=new ResizeObserver(g),_.observe(x)),()=>{y.clear(),cancelAnimationFrame(v),b.removeEventListener("resize",y),_&&_.disconnect()}},[h,p]),Vr(()=>{p()});const m=g=>{c||p(),r&&r(g)};return w.jsxs(M.Fragment,{children:[w.jsx("textarea",j({value:s,onChange:m,ref:f,rows:o,style:a},l)),w.jsx("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:d,tabIndex:-1,style:j({},WPe.shadow,a,{paddingTop:0,paddingBottom:0})})]})});var f5={};Object.defineProperty(f5,"__esModule",{value:!0});var Rre=f5.default=void 0,HPe=XPe(M),qPe=cre;function Ire(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(Ire=function(r){return r?n:e})(t)}function XPe(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=Ire(e);if(n&&n.has(t))return n.get(t);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&Object.prototype.hasOwnProperty.call(t,o)){var a=i?Object.getOwnPropertyDescriptor(t,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=t[o]}return r.default=t,n&&n.set(t,r),r}function QPe(t){return Object.keys(t).length===0}function YPe(t=null){const e=HPe.useContext(qPe.ThemeContext);return!e||QPe(e)?t:e}Rre=f5.default=YPe;const KPe=["anchorEl","component","components","componentsProps","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition","slots","slotProps"],ZPe=we(IPe,{name:"MuiPopper",slot:"Root",overridesResolver:(t,e)=>e.root})({}),JPe=M.forwardRef(function(e,n){var r;const i=Rre(),o=qe({props:e,name:"MuiPopper"}),{anchorEl:a,component:s,components:l,componentsProps:c,container:u,disablePortal:f,keepMounted:d,modifiers:h,open:p,placement:m,popperOptions:g,popperRef:v,transition:y,slots:x,slotProps:b}=o,_=Ae(o,KPe),S=(r=x==null?void 0:x.root)!=null?r:l==null?void 0:l.Root,O=j({anchorEl:a,container:u,disablePortal:f,keepMounted:d,modifiers:h,open:p,placement:m,popperOptions:g,popperRef:v,transition:y},_);return w.jsx(ZPe,j({as:s,direction:i==null?void 0:i.direction,slots:{root:S},slotProps:b??c},O,{ref:n}))}),d5=JPe,eMe=ti(w.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");function tMe(t){return We("MuiChip",t)}const nMe=Ve("MuiChip",["root","sizeSmall","sizeMedium","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),fn=nMe,rMe=["avatar","className","clickable","color","component","deleteIcon","disabled","icon","label","onClick","onDelete","onKeyDown","onKeyUp","size","variant","tabIndex","skipFocusWhenDisabled"],iMe=t=>{const{classes:e,disabled:n,size:r,color:i,iconColor:o,onDelete:a,clickable:s,variant:l}=t,c={root:["root",l,n&&"disabled",`size${De(r)}`,`color${De(i)}`,s&&"clickable",s&&`clickableColor${De(i)}`,a&&"deletable",a&&`deletableColor${De(i)}`,`${l}${De(i)}`],label:["label",`label${De(r)}`],avatar:["avatar",`avatar${De(r)}`,`avatarColor${De(i)}`],icon:["icon",`icon${De(r)}`,`iconColor${De(o)}`],deleteIcon:["deleteIcon",`deleteIcon${De(r)}`,`deleteIconColor${De(i)}`,`deleteIcon${De(l)}Color${De(i)}`]};return Ue(c,tMe,e)},oMe=we("div",{name:"MuiChip",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{color:r,iconColor:i,clickable:o,onDelete:a,size:s,variant:l}=n;return[{[`& .${fn.avatar}`]:e.avatar},{[`& .${fn.avatar}`]:e[`avatar${De(s)}`]},{[`& .${fn.avatar}`]:e[`avatarColor${De(r)}`]},{[`& .${fn.icon}`]:e.icon},{[`& .${fn.icon}`]:e[`icon${De(s)}`]},{[`& .${fn.icon}`]:e[`iconColor${De(i)}`]},{[`& .${fn.deleteIcon}`]:e.deleteIcon},{[`& .${fn.deleteIcon}`]:e[`deleteIcon${De(s)}`]},{[`& .${fn.deleteIcon}`]:e[`deleteIconColor${De(r)}`]},{[`& .${fn.deleteIcon}`]:e[`deleteIcon${De(l)}Color${De(r)}`]},e.root,e[`size${De(s)}`],e[`color${De(r)}`],o&&e.clickable,o&&r!=="default"&&e[`clickableColor${De(r)})`],a&&e.deletable,a&&r!=="default"&&e[`deletableColor${De(r)}`],e[l],e[`${l}${De(r)}`]]}})(({theme:t,ownerState:e})=>{const n=t.palette.mode==="light"?t.palette.grey[700]:t.palette.grey[300];return j({maxWidth:"100%",fontFamily:t.typography.fontFamily,fontSize:t.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(t.vars||t).palette.text.primary,backgroundColor:(t.vars||t).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:t.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${fn.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${fn.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:t.vars?t.vars.palette.Chip.defaultAvatarColor:n,fontSize:t.typography.pxToRem(12)},[`& .${fn.avatarColorPrimary}`]:{color:(t.vars||t).palette.primary.contrastText,backgroundColor:(t.vars||t).palette.primary.dark},[`& .${fn.avatarColorSecondary}`]:{color:(t.vars||t).palette.secondary.contrastText,backgroundColor:(t.vars||t).palette.secondary.dark},[`& .${fn.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:t.typography.pxToRem(10)},[`& .${fn.icon}`]:j({marginLeft:5,marginRight:-6},e.size==="small"&&{fontSize:18,marginLeft:4,marginRight:-4},e.iconColor===e.color&&j({color:t.vars?t.vars.palette.Chip.defaultIconColor:n},e.color!=="default"&&{color:"inherit"})),[`& .${fn.deleteIcon}`]:j({WebkitTapHighlightColor:"transparent",color:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / 0.26)`:kt(t.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / 0.4)`:kt(t.palette.text.primary,.4)}},e.size==="small"&&{fontSize:16,marginRight:4,marginLeft:-4},e.color!=="default"&&{color:t.vars?`rgba(${t.vars.palette[e.color].contrastTextChannel} / 0.7)`:kt(t.palette[e.color].contrastText,.7),"&:hover, &:active":{color:(t.vars||t).palette[e.color].contrastText}})},e.size==="small"&&{height:24},e.color!=="default"&&{backgroundColor:(t.vars||t).palette[e.color].main,color:(t.vars||t).palette[e.color].contrastText},e.onDelete&&{[`&.${fn.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:kt(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},e.onDelete&&e.color!=="default"&&{[`&.${fn.focusVisible}`]:{backgroundColor:(t.vars||t).palette[e.color].dark}})},({theme:t,ownerState:e})=>j({},e.clickable&&{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:kt(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity)},[`&.${fn.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:kt(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)},"&:active":{boxShadow:(t.vars||t).shadows[1]}},e.clickable&&e.color!=="default"&&{[`&:hover, &.${fn.focusVisible}`]:{backgroundColor:(t.vars||t).palette[e.color].dark}}),({theme:t,ownerState:e})=>j({},e.variant==="outlined"&&{backgroundColor:"transparent",border:t.vars?`1px solid ${t.vars.palette.Chip.defaultBorder}`:`1px solid ${t.palette.mode==="light"?t.palette.grey[400]:t.palette.grey[700]}`,[`&.${fn.clickable}:hover`]:{backgroundColor:(t.vars||t).palette.action.hover},[`&.${fn.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`& .${fn.avatar}`]:{marginLeft:4},[`& .${fn.avatarSmall}`]:{marginLeft:2},[`& .${fn.icon}`]:{marginLeft:4},[`& .${fn.iconSmall}`]:{marginLeft:2},[`& .${fn.deleteIcon}`]:{marginRight:5},[`& .${fn.deleteIconSmall}`]:{marginRight:3}},e.variant==="outlined"&&e.color!=="default"&&{color:(t.vars||t).palette[e.color].main,border:`1px solid ${t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / 0.7)`:kt(t.palette[e.color].main,.7)}`,[`&.${fn.clickable}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette[e.color].main,t.palette.action.hoverOpacity)},[`&.${fn.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.focusOpacity})`:kt(t.palette[e.color].main,t.palette.action.focusOpacity)},[`& .${fn.deleteIcon}`]:{color:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / 0.7)`:kt(t.palette[e.color].main,.7),"&:hover, &:active":{color:(t.vars||t).palette[e.color].main}}})),aMe=we("span",{name:"MuiChip",slot:"Label",overridesResolver:(t,e)=>{const{ownerState:n}=t,{size:r}=n;return[e.label,e[`label${De(r)}`]]}})(({ownerState:t})=>j({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap"},t.variant==="outlined"&&{paddingLeft:11,paddingRight:11},t.size==="small"&&{paddingLeft:8,paddingRight:8},t.size==="small"&&t.variant==="outlined"&&{paddingLeft:7,paddingRight:7}));function a8(t){return t.key==="Backspace"||t.key==="Delete"}const sMe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiChip"}),{avatar:i,className:o,clickable:a,color:s="default",component:l,deleteIcon:c,disabled:u=!1,icon:f,label:d,onClick:h,onDelete:p,onKeyDown:m,onKeyUp:g,size:v="medium",variant:y="filled",tabIndex:x,skipFocusWhenDisabled:b=!1}=r,_=Ae(r,rMe),S=M.useRef(null),O=Zt(S,n),C=U=>{U.stopPropagation(),p&&p(U)},E=U=>{U.currentTarget===U.target&&a8(U)&&U.preventDefault(),m&&m(U)},k=U=>{U.currentTarget===U.target&&(p&&a8(U)?p(U):U.key==="Escape"&&S.current&&S.current.blur()),g&&g(U)},I=a!==!1&&h?!0:a,P=I||p?us:l||"div",R=j({},r,{component:P,disabled:u,size:v,color:s,iconColor:M.isValidElement(f)&&f.props.color||s,onDelete:!!p,clickable:I,variant:y}),T=iMe(R),L=P===us?j({component:l||"div",focusVisibleClassName:T.focusVisible},p&&{disableRipple:!0}):{};let z=null;p&&(z=c&&M.isValidElement(c)?M.cloneElement(c,{className:ke(c.props.className,T.deleteIcon),onClick:C}):w.jsx(eMe,{className:ke(T.deleteIcon),onClick:C}));let B=null;i&&M.isValidElement(i)&&(B=M.cloneElement(i,{className:ke(T.avatar,i.props.className)}));let W=null;return f&&M.isValidElement(f)&&(W=M.cloneElement(f,{className:ke(T.icon,f.props.className)})),w.jsxs(oMe,j({as:P,className:ke(T.root,o),disabled:I&&u?!0:void 0,onClick:h,onKeyDown:E,onKeyUp:k,ref:O,tabIndex:b&&u?-1:x,ownerState:R},L,_,{children:[B||W,w.jsx(aMe,{className:ke(T.label),ownerState:R,children:d}),z]}))}),lMe=sMe;function fd({props:t,states:e,muiFormControl:n}){return e.reduce((r,i)=>(r[i]=t[i],n&&typeof t[i]>"u"&&(r[i]=n[i]),r),{})}const cMe=M.createContext(void 0),AM=cMe;function nc(){return M.useContext(AM)}function Dre(t){return w.jsx(_Se,j({},t,{defaultTheme:EM,themeId:Gh}))}function s8(t){return t!=null&&!(Array.isArray(t)&&t.length===0)}function CT(t,e=!1){return t&&(s8(t.value)&&t.value!==""||e&&s8(t.defaultValue)&&t.defaultValue!=="")}function uMe(t){return t.startAdornment}function fMe(t){return We("MuiInputBase",t)}const dMe=Ve("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),Xg=dMe,hMe=["aria-describedby","autoComplete","autoFocus","className","color","components","componentsProps","defaultValue","disabled","disableInjectingGlobalStyles","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","maxRows","minRows","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","size","slotProps","slots","startAdornment","type","value"],RM=(t,e)=>{const{ownerState:n}=t;return[e.root,n.formControl&&e.formControl,n.startAdornment&&e.adornedStart,n.endAdornment&&e.adornedEnd,n.error&&e.error,n.size==="small"&&e.sizeSmall,n.multiline&&e.multiline,n.color&&e[`color${De(n.color)}`],n.fullWidth&&e.fullWidth,n.hiddenLabel&&e.hiddenLabel]},IM=(t,e)=>{const{ownerState:n}=t;return[e.input,n.size==="small"&&e.inputSizeSmall,n.multiline&&e.inputMultiline,n.type==="search"&&e.inputTypeSearch,n.startAdornment&&e.inputAdornedStart,n.endAdornment&&e.inputAdornedEnd,n.hiddenLabel&&e.inputHiddenLabel]},pMe=t=>{const{classes:e,color:n,disabled:r,error:i,endAdornment:o,focused:a,formControl:s,fullWidth:l,hiddenLabel:c,multiline:u,readOnly:f,size:d,startAdornment:h,type:p}=t,m={root:["root",`color${De(n)}`,r&&"disabled",i&&"error",l&&"fullWidth",a&&"focused",s&&"formControl",d&&d!=="medium"&&`size${De(d)}`,u&&"multiline",h&&"adornedStart",o&&"adornedEnd",c&&"hiddenLabel",f&&"readOnly"],input:["input",r&&"disabled",p==="search"&&"inputTypeSearch",u&&"inputMultiline",d==="small"&&"inputSizeSmall",c&&"inputHiddenLabel",h&&"inputAdornedStart",o&&"inputAdornedEnd",f&&"readOnly"]};return Ue(m,fMe,e)},DM=we("div",{name:"MuiInputBase",slot:"Root",overridesResolver:RM})(({theme:t,ownerState:e})=>j({},t.typography.body1,{color:(t.vars||t).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${Xg.disabled}`]:{color:(t.vars||t).palette.text.disabled,cursor:"default"}},e.multiline&&j({padding:"4px 0 5px"},e.size==="small"&&{paddingTop:1}),e.fullWidth&&{width:"100%"})),LM=we("input",{name:"MuiInputBase",slot:"Input",overridesResolver:IM})(({theme:t,ownerState:e})=>{const n=t.palette.mode==="light",r=j({color:"currentColor"},t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:n?.42:.5},{transition:t.transitions.create("opacity",{duration:t.transitions.duration.shorter})}),i={opacity:"0 !important"},o=t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:n?.42:.5};return j({font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%",animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&:-ms-input-placeholder":r,"&::-ms-input-placeholder":r,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${Xg.formControl} &`]:{"&::-webkit-input-placeholder":i,"&::-moz-placeholder":i,"&:-ms-input-placeholder":i,"&::-ms-input-placeholder":i,"&:focus::-webkit-input-placeholder":o,"&:focus::-moz-placeholder":o,"&:focus:-ms-input-placeholder":o,"&:focus::-ms-input-placeholder":o},[`&.${Xg.disabled}`]:{opacity:1,WebkitTextFillColor:(t.vars||t).palette.text.disabled},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},e.size==="small"&&{paddingTop:1},e.multiline&&{height:"auto",resize:"none",padding:0,paddingTop:0},e.type==="search"&&{MozAppearance:"textfield"})}),mMe=w.jsx(Dre,{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}}),gMe=M.forwardRef(function(e,n){var r;const i=qe({props:e,name:"MuiInputBase"}),{"aria-describedby":o,autoComplete:a,autoFocus:s,className:l,components:c={},componentsProps:u={},defaultValue:f,disabled:d,disableInjectingGlobalStyles:h,endAdornment:p,fullWidth:m=!1,id:g,inputComponent:v="input",inputProps:y={},inputRef:x,maxRows:b,minRows:_,multiline:S=!1,name:O,onBlur:C,onChange:E,onClick:k,onFocus:I,onKeyDown:P,onKeyUp:R,placeholder:T,readOnly:L,renderSuffix:z,rows:B,slotProps:W={},slots:U={},startAdornment:N,type:$="text",value:D}=i,A=Ae(i,hMe),q=y.value!=null?y.value:D,{current:Y}=M.useRef(q!=null),K=M.useRef(),se=M.useCallback(Z=>{},[]),te=Zt(K,x,y.ref,se),[J,pe]=M.useState(!1),be=nc(),re=fd({props:i,muiFormControl:be,states:["color","disabled","error","hiddenLabel","size","required","filled"]});re.focused=be?be.focused:J,M.useEffect(()=>{!be&&d&&J&&(pe(!1),C&&C())},[be,d,J,C]);const ve=be&&be.onFilled,F=be&&be.onEmpty,ce=M.useCallback(Z=>{CT(Z)?ve&&ve():F&&F()},[ve,F]);Vr(()=>{Y&&ce({value:q})},[q,ce,Y]);const le=Z=>{if(re.disabled){Z.stopPropagation();return}I&&I(Z),y.onFocus&&y.onFocus(Z),be&&be.onFocus?be.onFocus(Z):pe(!0)},Q=Z=>{C&&C(Z),y.onBlur&&y.onBlur(Z),be&&be.onBlur?be.onBlur(Z):pe(!1)},X=(Z,...V)=>{if(!Y){const de=Z.target||K.current;if(de==null)throw new Error(su(1));ce({value:de.value})}y.onChange&&y.onChange(Z,...V),E&&E(Z,...V)};M.useEffect(()=>{ce(K.current)},[]);const ee=Z=>{K.current&&Z.currentTarget===Z.target&&K.current.focus(),k&&k(Z)};let ge=v,ye=y;S&&ge==="input"&&(B?ye=j({type:void 0,minRows:B,maxRows:B},ye):ye=j({type:void 0,maxRows:b,minRows:_},ye),ge=GPe);const H=Z=>{ce(Z.animationName==="mui-auto-fill-cancel"?K.current:{value:"x"})};M.useEffect(()=>{be&&be.setAdornedStart(!!N)},[be,N]);const G=j({},i,{color:re.color||"primary",disabled:re.disabled,endAdornment:p,error:re.error,focused:re.focused,formControl:be,fullWidth:m,hiddenLabel:re.hiddenLabel,multiline:S,size:re.size,startAdornment:N,type:$}),ie=pMe(G),he=U.root||c.Root||DM,_e=W.root||u.root||{},oe=U.input||c.Input||LM;return ye=j({},ye,(r=W.input)!=null?r:u.input),w.jsxs(M.Fragment,{children:[!h&&mMe,w.jsxs(he,j({},_e,!zl(he)&&{ownerState:j({},G,_e.ownerState)},{ref:n,onClick:ee},A,{className:ke(ie.root,_e.className,l,L&&"MuiInputBase-readOnly"),children:[N,w.jsx(AM.Provider,{value:null,children:w.jsx(oe,j({ownerState:G,"aria-invalid":re.error,"aria-describedby":o,autoComplete:a,autoFocus:s,defaultValue:f,disabled:re.disabled,id:g,onAnimationStart:H,name:O,placeholder:T,readOnly:L,required:re.required,rows:B,value:q,onKeyDown:P,onKeyUp:R,type:$},ye,!zl(oe)&&{as:ge,ownerState:j({},G,ye.ownerState)},{ref:te,className:ke(ie.input,ye.className,L&&"MuiInputBase-readOnly"),onBlur:Q,onChange:X,onFocus:le}))}),p,z?z(j({},re,{startAdornment:N})):null]}))]})}),h5=gMe;function vMe(t){return We("MuiInput",t)}const yMe=j({},Xg,Ve("MuiInput",["root","underline","input"])),c0=yMe;function xMe(t){return We("MuiOutlinedInput",t)}const bMe=j({},Xg,Ve("MuiOutlinedInput",["root","notchedOutline","input"])),Tu=bMe;function _Me(t){return We("MuiFilledInput",t)}const wMe=j({},Xg,Ve("MuiFilledInput",["root","underline","input"])),kd=wMe,SMe=ti(w.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),OMe=ti(w.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}),"Person");function CMe(t){return We("MuiAvatar",t)}Ve("MuiAvatar",["root","colorDefault","circular","rounded","square","img","fallback"]);const TMe=["alt","children","className","component","slots","slotProps","imgProps","sizes","src","srcSet","variant"],EMe=Zj(),PMe=t=>{const{classes:e,variant:n,colorDefault:r}=t;return Ue({root:["root",n,r&&"colorDefault"],img:["img"],fallback:["fallback"]},CMe,e)},MMe=we("div",{name:"MuiAvatar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],n.colorDefault&&e.colorDefault]}})(({theme:t})=>({position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:40,height:40,fontFamily:t.typography.fontFamily,fontSize:t.typography.pxToRem(20),lineHeight:1,borderRadius:"50%",overflow:"hidden",userSelect:"none",variants:[{props:{variant:"rounded"},style:{borderRadius:(t.vars||t).shape.borderRadius}},{props:{variant:"square"},style:{borderRadius:0}},{props:{colorDefault:!0},style:j({color:(t.vars||t).palette.background.default},t.vars?{backgroundColor:t.vars.palette.Avatar.defaultBg}:j({backgroundColor:t.palette.grey[400]},t.applyStyles("dark",{backgroundColor:t.palette.grey[600]})))}]})),kMe=we("img",{name:"MuiAvatar",slot:"Img",overridesResolver:(t,e)=>e.img})({width:"100%",height:"100%",textAlign:"center",objectFit:"cover",color:"transparent",textIndent:1e4}),AMe=we(OMe,{name:"MuiAvatar",slot:"Fallback",overridesResolver:(t,e)=>e.fallback})({width:"75%",height:"75%"});function RMe({crossOrigin:t,referrerPolicy:e,src:n,srcSet:r}){const[i,o]=M.useState(!1);return M.useEffect(()=>{if(!n&&!r)return;o(!1);let a=!0;const s=new Image;return s.onload=()=>{a&&o("loaded")},s.onerror=()=>{a&&o("error")},s.crossOrigin=t,s.referrerPolicy=e,s.src=n,r&&(s.srcset=r),()=>{a=!1}},[t,e,n,r]),i}const IMe=M.forwardRef(function(e,n){const r=EMe({props:e,name:"MuiAvatar"}),{alt:i,children:o,className:a,component:s="div",slots:l={},slotProps:c={},imgProps:u,sizes:f,src:d,srcSet:h,variant:p="circular"}=r,m=Ae(r,TMe);let g=null;const v=RMe(j({},u,{src:d,srcSet:h})),y=d||h,x=y&&v!=="error",b=j({},r,{colorDefault:!x,component:s,variant:p}),_=PMe(b),[S,O]=vTe("img",{className:_.img,elementType:kMe,externalForwardedProps:{slots:l,slotProps:{img:j({},u,c.img)}},additionalProps:{alt:i,src:d,srcSet:h,sizes:f},ownerState:b});return x?g=w.jsx(S,j({},O)):o||o===0?g=o:y&&i?g=i[0]:g=w.jsx(AMe,{ownerState:b,className:_.fallback}),w.jsx(MMe,j({as:s,ownerState:b,className:ke(_.root,a),ref:n},m,{children:g}))}),yA=IMe,DMe=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],LMe={entering:{opacity:1},entered:{opacity:1}},$Me=M.forwardRef(function(e,n){const r=Vo(),i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:o,appear:a=!0,children:s,easing:l,in:c,onEnter:u,onEntered:f,onEntering:d,onExit:h,onExited:p,onExiting:m,style:g,timeout:v=i,TransitionComponent:y=M1}=e,x=Ae(e,DMe),b=M.useRef(null),_=Zt(b,s.ref,n),S=T=>L=>{if(T){const z=b.current;L===void 0?T(z):T(z,L)}},O=S(d),C=S((T,L)=>{r5(T);const z=Xf({style:g,timeout:v,easing:l},{mode:"enter"});T.style.webkitTransition=r.transitions.create("opacity",z),T.style.transition=r.transitions.create("opacity",z),u&&u(T,L)}),E=S(f),k=S(m),I=S(T=>{const L=Xf({style:g,timeout:v,easing:l},{mode:"exit"});T.style.webkitTransition=r.transitions.create("opacity",L),T.style.transition=r.transitions.create("opacity",L),h&&h(T)}),P=S(p),R=T=>{o&&o(b.current,T)};return w.jsx(y,j({appear:a,in:c,nodeRef:b,onEnter:C,onEntered:E,onEntering:O,onExit:I,onExited:P,onExiting:k,addEndListener:R,timeout:v},x,{children:(T,L)=>M.cloneElement(s,j({style:j({opacity:0,visibility:T==="exited"&&!c?"hidden":void 0},LMe[T],g,s.props.style),ref:_},L))}))}),$M=$Me;function NMe(t){return We("MuiBackdrop",t)}Ve("MuiBackdrop",["root","invisible"]);const FMe=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],jMe=t=>{const{classes:e,invisible:n}=t;return Ue({root:["root",n&&"invisible"]},NMe,e)},BMe=we("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.invisible&&e.invisible]}})(({ownerState:t})=>j({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},t.invisible&&{backgroundColor:"transparent"})),zMe=M.forwardRef(function(e,n){var r,i,o;const a=qe({props:e,name:"MuiBackdrop"}),{children:s,className:l,component:c="div",components:u={},componentsProps:f={},invisible:d=!1,open:h,slotProps:p={},slots:m={},TransitionComponent:g=$M,transitionDuration:v}=a,y=Ae(a,FMe),x=j({},a,{component:c,invisible:d}),b=jMe(x),_=(r=p.root)!=null?r:f.root;return w.jsx(g,j({in:h,timeout:v},y,{children:w.jsx(BMe,j({"aria-hidden":!0},_,{as:(i=(o=m.root)!=null?o:u.Root)!=null?i:c,className:ke(b.root,l,_==null?void 0:_.className),ownerState:j({},x,_==null?void 0:_.ownerState),classes:b,ref:n,children:s}))}))}),Lre=zMe,UMe=Ve("MuiBox",["root"]),WMe=UMe,VMe=Kj(),GMe=PSe({themeId:Gh,defaultTheme:VMe,defaultClassName:WMe.root,generateClassName:Uj.generate}),Ke=GMe;function HMe(t){return We("MuiButton",t)}const qMe=Ve("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),rS=qMe,XMe=M.createContext({}),QMe=XMe,YMe=M.createContext(void 0),KMe=YMe,ZMe=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],JMe=t=>{const{color:e,disableElevation:n,fullWidth:r,size:i,variant:o,classes:a}=t,s={root:["root",o,`${o}${De(e)}`,`size${De(i)}`,`${o}Size${De(i)}`,`color${De(e)}`,n&&"disableElevation",r&&"fullWidth"],label:["label"],startIcon:["icon","startIcon",`iconSize${De(i)}`],endIcon:["icon","endIcon",`iconSize${De(i)}`]},l=Ue(s,HMe,a);return j({},a,l)},$re=t=>j({},t.size==="small"&&{"& > *:nth-of-type(1)":{fontSize:18}},t.size==="medium"&&{"& > *:nth-of-type(1)":{fontSize:20}},t.size==="large"&&{"& > *:nth-of-type(1)":{fontSize:22}}),e2e=we(us,{shouldForwardProp:t=>di(t)||t==="classes",name:"MuiButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`${n.variant}${De(n.color)}`],e[`size${De(n.size)}`],e[`${n.variant}Size${De(n.size)}`],n.color==="inherit"&&e.colorInherit,n.disableElevation&&e.disableElevation,n.fullWidth&&e.fullWidth]}})(({theme:t,ownerState:e})=>{var n,r;const i=t.palette.mode==="light"?t.palette.grey[300]:t.palette.grey[800],o=t.palette.mode==="light"?t.palette.grey.A100:t.palette.grey[700];return j({},t.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create(["background-color","box-shadow","border-color","color"],{duration:t.transitions.duration.short}),"&:hover":j({textDecoration:"none",backgroundColor:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.text.primary,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},e.variant==="text"&&e.color!=="inherit"&&{backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette[e.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},e.variant==="outlined"&&e.color!=="inherit"&&{border:`1px solid ${(t.vars||t).palette[e.color].main}`,backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette[e.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},e.variant==="contained"&&{backgroundColor:t.vars?t.vars.palette.Button.inheritContainedHoverBg:o,boxShadow:(t.vars||t).shadows[4],"@media (hover: none)":{boxShadow:(t.vars||t).shadows[2],backgroundColor:(t.vars||t).palette.grey[300]}},e.variant==="contained"&&e.color!=="inherit"&&{backgroundColor:(t.vars||t).palette[e.color].dark,"@media (hover: none)":{backgroundColor:(t.vars||t).palette[e.color].main}}),"&:active":j({},e.variant==="contained"&&{boxShadow:(t.vars||t).shadows[8]}),[`&.${rS.focusVisible}`]:j({},e.variant==="contained"&&{boxShadow:(t.vars||t).shadows[6]}),[`&.${rS.disabled}`]:j({color:(t.vars||t).palette.action.disabled},e.variant==="outlined"&&{border:`1px solid ${(t.vars||t).palette.action.disabledBackground}`},e.variant==="contained"&&{color:(t.vars||t).palette.action.disabled,boxShadow:(t.vars||t).shadows[0],backgroundColor:(t.vars||t).palette.action.disabledBackground})},e.variant==="text"&&{padding:"6px 8px"},e.variant==="text"&&e.color!=="inherit"&&{color:(t.vars||t).palette[e.color].main},e.variant==="outlined"&&{padding:"5px 15px",border:"1px solid currentColor"},e.variant==="outlined"&&e.color!=="inherit"&&{color:(t.vars||t).palette[e.color].main,border:t.vars?`1px solid rgba(${t.vars.palette[e.color].mainChannel} / 0.5)`:`1px solid ${kt(t.palette[e.color].main,.5)}`},e.variant==="contained"&&{color:t.vars?t.vars.palette.text.primary:(n=(r=t.palette).getContrastText)==null?void 0:n.call(r,t.palette.grey[300]),backgroundColor:t.vars?t.vars.palette.Button.inheritContainedBg:i,boxShadow:(t.vars||t).shadows[2]},e.variant==="contained"&&e.color!=="inherit"&&{color:(t.vars||t).palette[e.color].contrastText,backgroundColor:(t.vars||t).palette[e.color].main},e.color==="inherit"&&{color:"inherit",borderColor:"currentColor"},e.size==="small"&&e.variant==="text"&&{padding:"4px 5px",fontSize:t.typography.pxToRem(13)},e.size==="large"&&e.variant==="text"&&{padding:"8px 11px",fontSize:t.typography.pxToRem(15)},e.size==="small"&&e.variant==="outlined"&&{padding:"3px 9px",fontSize:t.typography.pxToRem(13)},e.size==="large"&&e.variant==="outlined"&&{padding:"7px 21px",fontSize:t.typography.pxToRem(15)},e.size==="small"&&e.variant==="contained"&&{padding:"4px 10px",fontSize:t.typography.pxToRem(13)},e.size==="large"&&e.variant==="contained"&&{padding:"8px 22px",fontSize:t.typography.pxToRem(15)},e.fullWidth&&{width:"100%"})},({ownerState:t})=>t.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${rS.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${rS.disabled}`]:{boxShadow:"none"}}),t2e=we("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.startIcon,e[`iconSize${De(n.size)}`]]}})(({ownerState:t})=>j({display:"inherit",marginRight:8,marginLeft:-4},t.size==="small"&&{marginLeft:-2},$re(t))),n2e=we("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.endIcon,e[`iconSize${De(n.size)}`]]}})(({ownerState:t})=>j({display:"inherit",marginRight:-4,marginLeft:8},t.size==="small"&&{marginRight:-2},$re(t))),r2e=M.forwardRef(function(e,n){const r=M.useContext(QMe),i=M.useContext(KMe),o=OM(r,e),a=qe({props:o,name:"MuiButton"}),{children:s,color:l="primary",component:c="button",className:u,disabled:f=!1,disableElevation:d=!1,disableFocusRipple:h=!1,endIcon:p,focusVisibleClassName:m,fullWidth:g=!1,size:v="medium",startIcon:y,type:x,variant:b="text"}=a,_=Ae(a,ZMe),S=j({},a,{color:l,component:c,disabled:f,disableElevation:d,disableFocusRipple:h,fullWidth:g,size:v,type:x,variant:b}),O=JMe(S),C=y&&w.jsx(t2e,{className:O.startIcon,ownerState:S,children:y}),E=p&&w.jsx(n2e,{className:O.endIcon,ownerState:S,children:p}),k=i||"";return w.jsxs(e2e,j({ownerState:S,className:ke(r.className,O.root,u,k),component:c,disabled:f,focusRipple:!h,focusVisibleClassName:ke(O.focusVisible,m),ref:n,type:x},_,{classes:O,children:[C,s,E]}))}),er=r2e;function i2e(t){return We("MuiCard",t)}Ve("MuiCard",["root"]);const o2e=["className","raised"],a2e=t=>{const{classes:e}=t;return Ue({root:["root"]},i2e,e)},s2e=we(Go,{name:"MuiCard",slot:"Root",overridesResolver:(t,e)=>e.root})(()=>({overflow:"hidden"})),l2e=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiCard"}),{className:i,raised:o=!1}=r,a=Ae(r,o2e),s=j({},r,{raised:o}),l=a2e(s);return w.jsx(s2e,j({className:ke(l.root,i),elevation:o?8:void 0,ref:n,ownerState:s},a))}),Nre=l2e;function c2e(t){return We("MuiCardActions",t)}Ve("MuiCardActions",["root","spacing"]);const u2e=["disableSpacing","className"],f2e=t=>{const{classes:e,disableSpacing:n}=t;return Ue({root:["root",!n&&"spacing"]},c2e,e)},d2e=we("div",{name:"MuiCardActions",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disableSpacing&&e.spacing]}})(({ownerState:t})=>j({display:"flex",alignItems:"center",padding:8},!t.disableSpacing&&{"& > :not(style) ~ :not(style)":{marginLeft:8}})),h2e=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiCardActions"}),{disableSpacing:i=!1,className:o}=r,a=Ae(r,u2e),s=j({},r,{disableSpacing:i}),l=f2e(s);return w.jsx(d2e,j({className:ke(l.root,o),ownerState:s,ref:n},a))}),Fre=h2e;function p2e(t){return We("MuiCardContent",t)}Ve("MuiCardContent",["root"]);const m2e=["className","component"],g2e=t=>{const{classes:e}=t;return Ue({root:["root"]},p2e,e)},v2e=we("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(t,e)=>e.root})(()=>({padding:16,"&:last-child":{paddingBottom:24}})),y2e=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiCardContent"}),{className:i,component:o="div"}=r,a=Ae(r,m2e),s=j({},r,{component:o}),l=g2e(s);return w.jsx(v2e,j({as:o,className:ke(l.root,i),ownerState:s,ref:n},a))}),jre=y2e;function x2e(t){return We("MuiCardHeader",t)}const b2e=Ve("MuiCardHeader",["root","avatar","action","content","title","subheader"]),l8=b2e,_2e=["action","avatar","className","component","disableTypography","subheader","subheaderTypographyProps","title","titleTypographyProps"],w2e=t=>{const{classes:e}=t;return Ue({root:["root"],avatar:["avatar"],action:["action"],content:["content"],title:["title"],subheader:["subheader"]},x2e,e)},S2e=we("div",{name:"MuiCardHeader",slot:"Root",overridesResolver:(t,e)=>j({[`& .${l8.title}`]:e.title,[`& .${l8.subheader}`]:e.subheader},e.root)})({display:"flex",alignItems:"center",padding:16}),O2e=we("div",{name:"MuiCardHeader",slot:"Avatar",overridesResolver:(t,e)=>e.avatar})({display:"flex",flex:"0 0 auto",marginRight:16}),C2e=we("div",{name:"MuiCardHeader",slot:"Action",overridesResolver:(t,e)=>e.action})({flex:"0 0 auto",alignSelf:"flex-start",marginTop:-4,marginRight:-8,marginBottom:-4}),T2e=we("div",{name:"MuiCardHeader",slot:"Content",overridesResolver:(t,e)=>e.content})({flex:"1 1 auto"}),E2e=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiCardHeader"}),{action:i,avatar:o,className:a,component:s="div",disableTypography:l=!1,subheader:c,subheaderTypographyProps:u,title:f,titleTypographyProps:d}=r,h=Ae(r,_2e),p=j({},r,{component:s,disableTypography:l}),m=w2e(p);let g=f;g!=null&&g.type!==At&&!l&&(g=w.jsx(At,j({variant:o?"body2":"h5",className:m.title,component:"span",display:"block"},d,{children:g})));let v=c;return v!=null&&v.type!==At&&!l&&(v=w.jsx(At,j({variant:o?"body2":"body1",className:m.subheader,color:"text.secondary",component:"span",display:"block"},u,{children:v}))),w.jsxs(S2e,j({className:ke(m.root,a),as:s,ref:n,ownerState:p},h,{children:[o&&w.jsx(O2e,{className:m.avatar,ownerState:p,children:o}),w.jsxs(T2e,{className:m.content,ownerState:p,children:[g,v]}),i&&w.jsx(C2e,{className:m.action,ownerState:p,children:i})]}))}),P2e=E2e;function M2e(t){return We("MuiCardMedia",t)}Ve("MuiCardMedia",["root","media","img"]);const k2e=["children","className","component","image","src","style"],A2e=t=>{const{classes:e,isMediaComponent:n,isImageComponent:r}=t;return Ue({root:["root",n&&"media",r&&"img"]},M2e,e)},R2e=we("div",{name:"MuiCardMedia",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{isMediaComponent:r,isImageComponent:i}=n;return[e.root,r&&e.media,i&&e.img]}})(({ownerState:t})=>j({display:"block",backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"center"},t.isMediaComponent&&{width:"100%"},t.isImageComponent&&{objectFit:"cover"})),I2e=["video","audio","picture","iframe","img"],D2e=["picture","img"],L2e=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiCardMedia"}),{children:i,className:o,component:a="div",image:s,src:l,style:c}=r,u=Ae(r,k2e),f=I2e.indexOf(a)!==-1,d=!f&&s?j({backgroundImage:`url("${s}")`},c):c,h=j({},r,{component:a,isMediaComponent:f,isImageComponent:D2e.indexOf(a)!==-1}),p=A2e(h);return w.jsx(R2e,j({className:ke(p.root,o),as:a,role:!f&&s?"img":void 0,ref:n,style:d,ownerState:h,src:f?s||l:void 0},u,{children:i}))}),$2e=L2e;function N2e(t){return We("PrivateSwitchBase",t)}Ve("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const F2e=["autoFocus","checked","checkedIcon","className","defaultChecked","disabled","disableFocusRipple","edge","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"],j2e=t=>{const{classes:e,checked:n,disabled:r,edge:i}=t,o={root:["root",n&&"checked",r&&"disabled",i&&`edge${De(i)}`],input:["input"]};return Ue(o,N2e,e)},B2e=we(us)(({ownerState:t})=>j({padding:9,borderRadius:"50%"},t.edge==="start"&&{marginLeft:t.size==="small"?-3:-12},t.edge==="end"&&{marginRight:t.size==="small"?-3:-12})),z2e=we("input",{shouldForwardProp:di})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),U2e=M.forwardRef(function(e,n){const{autoFocus:r,checked:i,checkedIcon:o,className:a,defaultChecked:s,disabled:l,disableFocusRipple:c=!1,edge:u=!1,icon:f,id:d,inputProps:h,inputRef:p,name:m,onBlur:g,onChange:v,onFocus:y,readOnly:x,required:b=!1,tabIndex:_,type:S,value:O}=e,C=Ae(e,F2e),[E,k]=Hs({controlled:i,default:!!s,name:"SwitchBase",state:"checked"}),I=nc(),P=U=>{y&&y(U),I&&I.onFocus&&I.onFocus(U)},R=U=>{g&&g(U),I&&I.onBlur&&I.onBlur(U)},T=U=>{if(U.nativeEvent.defaultPrevented)return;const N=U.target.checked;k(N),v&&v(U,N)};let L=l;I&&typeof L>"u"&&(L=I.disabled);const z=S==="checkbox"||S==="radio",B=j({},e,{checked:E,disabled:L,disableFocusRipple:c,edge:u}),W=j2e(B);return w.jsxs(B2e,j({component:"span",className:ke(W.root,a),centerRipple:!0,focusRipple:!c,disabled:L,tabIndex:null,role:void 0,onFocus:P,onBlur:R,ownerState:B,ref:n},C,{children:[w.jsx(z2e,j({autoFocus:r,checked:i,defaultChecked:s,className:W.input,disabled:L,id:z?d:void 0,name:m,onChange:T,readOnly:x,ref:p,required:b,ownerState:B,tabIndex:_,type:S},S==="checkbox"&&O===void 0?{}:{value:O},h)),E?o:f]}))}),p5=U2e,W2e=ti(w.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),V2e=ti(w.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),G2e=ti(w.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function H2e(t){return We("MuiCheckbox",t)}const q2e=Ve("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),xA=q2e,X2e=["checkedIcon","color","icon","indeterminate","indeterminateIcon","inputProps","size","className"],Q2e=t=>{const{classes:e,indeterminate:n,color:r,size:i}=t,o={root:["root",n&&"indeterminate",`color${De(r)}`,`size${De(i)}`]},a=Ue(o,H2e,e);return j({},e,a)},Y2e=we(p5,{shouldForwardProp:t=>di(t)||t==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.indeterminate&&e.indeterminate,e[`size${De(n.size)}`],n.color!=="default"&&e[`color${De(n.color)}`]]}})(({theme:t,ownerState:e})=>j({color:(t.vars||t).palette.text.secondary},!e.disableRipple&&{"&:hover":{backgroundColor:t.vars?`rgba(${e.color==="default"?t.vars.palette.action.activeChannel:t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(e.color==="default"?t.palette.action.active:t.palette[e.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},e.color!=="default"&&{[`&.${xA.checked}, &.${xA.indeterminate}`]:{color:(t.vars||t).palette[e.color].main},[`&.${xA.disabled}`]:{color:(t.vars||t).palette.action.disabled}})),K2e=w.jsx(V2e,{}),Z2e=w.jsx(W2e,{}),J2e=w.jsx(G2e,{}),eke=M.forwardRef(function(e,n){var r,i;const o=qe({props:e,name:"MuiCheckbox"}),{checkedIcon:a=K2e,color:s="primary",icon:l=Z2e,indeterminate:c=!1,indeterminateIcon:u=J2e,inputProps:f,size:d="medium",className:h}=o,p=Ae(o,X2e),m=c?u:l,g=c?u:a,v=j({},o,{color:s,indeterminate:c,size:d}),y=Q2e(v);return w.jsx(Y2e,j({type:"checkbox",inputProps:j({"data-indeterminate":c},f),icon:M.cloneElement(m,{fontSize:(r=m.props.fontSize)!=null?r:d}),checkedIcon:M.cloneElement(g,{fontSize:(i=g.props.fontSize)!=null?i:d}),ownerState:v,ref:n,className:ke(y.root,h)},p,{classes:y}))}),DL=eke;function tke(t){return We("MuiCircularProgress",t)}Ve("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const nke=["className","color","disableShrink","size","style","thickness","value","variant"];let NM=t=>t,c8,u8,f8,d8;const Eu=44,rke=Gv(c8||(c8=NM` 0% { transform: rotate(0deg); } @@ -165,7 +165,7 @@ const store = createStore( 100% { transform: rotate(360deg); } -`)),rke=Gv(c8||(c8=NM` +`)),ike=Gv(u8||(u8=NM` 0% { stroke-dasharray: 1px, 200px; stroke-dashoffset: 0; @@ -180,28 +180,28 @@ const store = createStore( stroke-dasharray: 100px, 200px; stroke-dashoffset: -125px; } -`)),ike=t=>{const{classes:e,variant:n,color:r,disableShrink:i}=t,o={root:["root",n,`color${De(r)}`],svg:["svg"],circle:["circle",`circle${De(n)}`,i&&"circleDisableShrink"]};return Ue(o,eke,e)},oke=we("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`color${De(n.color)}`]]}})(({ownerState:t,theme:e})=>j({display:"inline-block"},t.variant==="determinate"&&{transition:e.transitions.create("transform")},t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].main}),({ownerState:t})=>t.variant==="indeterminate"&&lM(u8||(u8=NM` +`)),oke=t=>{const{classes:e,variant:n,color:r,disableShrink:i}=t,o={root:["root",n,`color${De(r)}`],svg:["svg"],circle:["circle",`circle${De(n)}`,i&&"circleDisableShrink"]};return Ue(o,tke,e)},ake=we("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`color${De(n.color)}`]]}})(({ownerState:t,theme:e})=>j({display:"inline-block"},t.variant==="determinate"&&{transition:e.transitions.create("transform")},t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].main}),({ownerState:t})=>t.variant==="indeterminate"&&lM(f8||(f8=NM` animation: ${0} 1.4s linear infinite; - `),nke)),ake=we("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(t,e)=>e.svg})({display:"block"}),ske=we("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.circle,e[`circle${De(n.variant)}`],n.disableShrink&&e.circleDisableShrink]}})(({ownerState:t,theme:e})=>j({stroke:"currentColor"},t.variant==="determinate"&&{transition:e.transitions.create("stroke-dashoffset")},t.variant==="indeterminate"&&{strokeDasharray:"80px, 200px",strokeDashoffset:0}),({ownerState:t})=>t.variant==="indeterminate"&&!t.disableShrink&&lM(f8||(f8=NM` + `),rke)),ske=we("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(t,e)=>e.svg})({display:"block"}),lke=we("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.circle,e[`circle${De(n.variant)}`],n.disableShrink&&e.circleDisableShrink]}})(({ownerState:t,theme:e})=>j({stroke:"currentColor"},t.variant==="determinate"&&{transition:e.transitions.create("stroke-dashoffset")},t.variant==="indeterminate"&&{strokeDasharray:"80px, 200px",strokeDashoffset:0}),({ownerState:t})=>t.variant==="indeterminate"&&!t.disableShrink&&lM(d8||(d8=NM` animation: ${0} 1.4s ease-in-out infinite; - `),rke)),lke=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiCircularProgress"}),{className:i,color:o="primary",disableShrink:a=!1,size:s=40,style:l,thickness:c=3.6,value:u=0,variant:f="indeterminate"}=r,d=Ae(r,tke),h=j({},r,{color:o,disableShrink:a,size:s,thickness:c,value:u,variant:f}),p=ike(h),m={},g={},v={};if(f==="determinate"){const y=2*Math.PI*((Eu-c)/2);m.strokeDasharray=y.toFixed(3),v["aria-valuenow"]=Math.round(u),m.strokeDashoffset=`${((100-u)/100*y).toFixed(3)}px`,g.transform="rotate(-90deg)"}return w.jsx(oke,j({className:ke(p.root,i),style:j({width:s,height:s},g,l),ownerState:h,ref:n,role:"progressbar"},v,d,{children:w.jsx(ake,{className:p.svg,ownerState:h,viewBox:`${Eu/2} ${Eu/2} ${Eu} ${Eu}`,children:w.jsx(ske,{className:p.circle,style:m,ownerState:h,cx:Eu,cy:Eu,r:(Eu-c)/2,fill:"none",strokeWidth:c})})}))}),Qv=lke,cke=(t,e)=>j({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%"},e&&!t.vars&&{colorScheme:t.palette.mode}),uke=t=>j({color:(t.vars||t).palette.text.primary},t.typography.body1,{backgroundColor:(t.vars||t).palette.background.default,"@media print":{backgroundColor:(t.vars||t).palette.common.white}}),fke=(t,e=!1)=>{var n;const r={};e&&t.colorSchemes&&Object.entries(t.colorSchemes).forEach(([a,s])=>{var l;r[t.getColorSchemeSelector(a).replace(/\s*&/,"")]={colorScheme:(l=s.palette)==null?void 0:l.mode}});let i=j({html:cke(t,e),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:t.typography.fontWeightBold},body:j({margin:0},uke(t),{"&::backdrop":{backgroundColor:(t.vars||t).palette.background.default}})},r);const o=(n=t.components)==null||(n=n.MuiCssBaseline)==null?void 0:n.styleOverrides;return o&&(i=[i,o]),i};function dke(t){const e=qe({props:t,name:"MuiCssBaseline"}),{children:n,enableColorScheme:r=!1}=e;return w.jsxs(M.Fragment,{children:[w.jsx(Rre,{styles:i=>fke(i,r)}),n]})}function hke(t){return We("MuiModal",t)}Ve("MuiModal",["root","hidden","backdrop"]);const pke=["BackdropComponent","BackdropProps","classes","className","closeAfterTransition","children","container","component","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onBackdropClick","onClose","onTransitionEnter","onTransitionExited","open","slotProps","slots","theme"],mke=t=>{const{open:e,exited:n,classes:r}=t;return Ue({root:["root",!e&&n&&"hidden"],backdrop:["backdrop"]},hke,r)},gke=we("div",{name:"MuiModal",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.open&&n.exited&&e.hidden]}})(({theme:t,ownerState:e})=>j({position:"fixed",zIndex:(t.vars||t).zIndex.modal,right:0,bottom:0,top:0,left:0},!e.open&&e.exited&&{visibility:"hidden"})),vke=we(Ire,{name:"MuiModal",slot:"Backdrop",overridesResolver:(t,e)=>e.backdrop})({zIndex:-1}),yke=M.forwardRef(function(e,n){var r,i,o,a,s,l;const c=qe({name:"MuiModal",props:e}),{BackdropComponent:u=vke,BackdropProps:f,className:d,closeAfterTransition:h=!1,children:p,container:m,component:g,components:v={},componentsProps:y={},disableAutoFocus:x=!1,disableEnforceFocus:b=!1,disableEscapeKeyDown:_=!1,disablePortal:S=!1,disableRestoreFocus:O=!1,disableScrollLock:C=!1,hideBackdrop:E=!1,keepMounted:k=!1,onBackdropClick:I,open:P,slotProps:R,slots:T}=c,L=Ae(c,pke),z=j({},c,{closeAfterTransition:h,disableAutoFocus:x,disableEnforceFocus:b,disableEscapeKeyDown:_,disablePortal:S,disableRestoreFocus:O,disableScrollLock:C,hideBackdrop:E,keepMounted:k}),{getRootProps:B,getBackdropProps:W,getTransitionProps:U,portalRef:N,isTopModal:$,exited:D,hasTransition:A}=vEe(j({},z,{rootRef:n})),q=j({},z,{exited:D}),Y=mke(q),K={};if(p.props.tabIndex===void 0&&(K.tabIndex="-1"),A){const{onEnter:ve,onExited:F}=U();K.onEnter=ve,K.onExited=F}const se=(r=(i=T==null?void 0:T.root)!=null?i:v.Root)!=null?r:gke,te=(o=(a=T==null?void 0:T.backdrop)!=null?a:v.Backdrop)!=null?o:u,J=(s=R==null?void 0:R.root)!=null?s:y.root,pe=(l=R==null?void 0:R.backdrop)!=null?l:y.backdrop,be=Lr({elementType:se,externalSlotProps:J,externalForwardedProps:L,getSlotProps:B,additionalProps:{ref:n,as:g},ownerState:q,className:ke(d,J==null?void 0:J.className,Y==null?void 0:Y.root,!q.open&&q.exited&&(Y==null?void 0:Y.hidden))}),re=Lr({elementType:te,externalSlotProps:pe,additionalProps:f,getSlotProps:ve=>W(j({},ve,{onClick:F=>{I&&I(F),ve!=null&&ve.onClick&&ve.onClick(F)}})),className:ke(pe==null?void 0:pe.className,f==null?void 0:f.className,Y==null?void 0:Y.backdrop),ownerState:q});return!k&&!P&&(!A||D)?null:w.jsx(yre,{ref:N,container:m,disablePortal:S,children:w.jsxs(se,j({},be,{children:[!E&&u?w.jsx(te,j({},re)):null,w.jsx(vre,{disableEnforceFocus:b,disableAutoFocus:x,disableRestoreFocus:O,isEnabled:$,open:P,children:M.cloneElement(p,K)})]}))})}),Fre=yke;function xke(t){return We("MuiDialog",t)}const bke=Ve("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),Nx=bke,_ke=M.createContext({}),jre=_ke,wke=["aria-describedby","aria-labelledby","BackdropComponent","BackdropProps","children","className","disableEscapeKeyDown","fullScreen","fullWidth","maxWidth","onBackdropClick","onClose","open","PaperComponent","PaperProps","scroll","TransitionComponent","transitionDuration","TransitionProps"],Ske=we(Ire,{name:"MuiDialog",slot:"Backdrop",overrides:(t,e)=>e.backdrop})({zIndex:-1}),Oke=t=>{const{classes:e,scroll:n,maxWidth:r,fullWidth:i,fullScreen:o}=t,a={root:["root"],container:["container",`scroll${De(n)}`],paper:["paper",`paperScroll${De(n)}`,`paperWidth${De(String(r))}`,i&&"paperFullWidth",o&&"paperFullScreen"]};return Ue(a,xke,e)},Cke=we(Fre,{name:"MuiDialog",slot:"Root",overridesResolver:(t,e)=>e.root})({"@media print":{position:"absolute !important"}}),Tke=we("div",{name:"MuiDialog",slot:"Container",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.container,e[`scroll${De(n.scroll)}`]]}})(({ownerState:t})=>j({height:"100%","@media print":{height:"auto"},outline:0},t.scroll==="paper"&&{display:"flex",justifyContent:"center",alignItems:"center"},t.scroll==="body"&&{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}})),Eke=we(Go,{name:"MuiDialog",slot:"Paper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.paper,e[`scrollPaper${De(n.scroll)}`],e[`paperWidth${De(String(n.maxWidth))}`],n.fullWidth&&e.paperFullWidth,n.fullScreen&&e.paperFullScreen]}})(({theme:t,ownerState:e})=>j({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"}},e.scroll==="paper"&&{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"},e.scroll==="body"&&{display:"inline-block",verticalAlign:"middle",textAlign:"left"},!e.maxWidth&&{maxWidth:"calc(100% - 64px)"},e.maxWidth==="xs"&&{maxWidth:t.breakpoints.unit==="px"?Math.max(t.breakpoints.values.xs,444):`max(${t.breakpoints.values.xs}${t.breakpoints.unit}, 444px)`,[`&.${Nx.paperScrollBody}`]:{[t.breakpoints.down(Math.max(t.breakpoints.values.xs,444)+32*2)]:{maxWidth:"calc(100% - 64px)"}}},e.maxWidth&&e.maxWidth!=="xs"&&{maxWidth:`${t.breakpoints.values[e.maxWidth]}${t.breakpoints.unit}`,[`&.${Nx.paperScrollBody}`]:{[t.breakpoints.down(t.breakpoints.values[e.maxWidth]+32*2)]:{maxWidth:"calc(100% - 64px)"}}},e.fullWidth&&{width:"calc(100% - 64px)"},e.fullScreen&&{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${Nx.paperScrollBody}`]:{margin:0,maxWidth:"100%"}})),Pke=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiDialog"}),i=Vo(),o={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{"aria-describedby":a,"aria-labelledby":s,BackdropComponent:l,BackdropProps:c,children:u,className:f,disableEscapeKeyDown:d=!1,fullScreen:h=!1,fullWidth:p=!1,maxWidth:m="sm",onBackdropClick:g,onClose:v,open:y,PaperComponent:x=Go,PaperProps:b={},scroll:_="paper",TransitionComponent:S=$M,transitionDuration:O=o,TransitionProps:C}=r,E=Ae(r,wke),k=j({},r,{disableEscapeKeyDown:d,fullScreen:h,fullWidth:p,maxWidth:m,scroll:_}),I=Oke(k),P=M.useRef(),R=B=>{P.current=B.target===B.currentTarget},T=B=>{P.current&&(P.current=null,g&&g(B),v&&v(B,"backdropClick"))},L=cd(s),z=M.useMemo(()=>({titleId:L}),[L]);return w.jsx(Cke,j({className:ke(I.root,f),closeAfterTransition:!0,components:{Backdrop:Ske},componentsProps:{backdrop:j({transitionDuration:O,as:l},c)},disableEscapeKeyDown:d,onClose:v,open:y,ref:n,onClick:T,ownerState:k},E,{children:w.jsx(S,j({appear:!0,in:y,timeout:O,role:"presentation"},C,{children:w.jsx(Tke,{className:ke(I.container),onMouseDown:R,ownerState:k,children:w.jsx(Eke,j({as:x,elevation:24,role:"dialog","aria-describedby":a,"aria-labelledby":L},b,{className:ke(I.paper,b.className),ownerState:k,children:w.jsx(jre.Provider,{value:z,children:u})}))})}))}))}),el=Pke;function Mke(t){return We("MuiDialogActions",t)}Ve("MuiDialogActions",["root","spacing"]);const kke=["className","disableSpacing"],Ake=t=>{const{classes:e,disableSpacing:n}=t;return Ue({root:["root",!n&&"spacing"]},Mke,e)},Rke=we("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disableSpacing&&e.spacing]}})(({ownerState:t})=>j({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto"},!t.disableSpacing&&{"& > :not(style) ~ :not(style)":{marginLeft:8}})),Ike=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiDialogActions"}),{className:i,disableSpacing:o=!1}=r,a=Ae(r,kke),s=j({},r,{disableSpacing:o}),l=Ake(s);return w.jsx(Rke,j({className:ke(l.root,i),ownerState:s,ref:n},a))}),yp=Ike;function Dke(t){return We("MuiDialogContent",t)}Ve("MuiDialogContent",["root","dividers"]);function Lke(t){return We("MuiDialogTitle",t)}const $ke=Ve("MuiDialogTitle",["root"]),Nke=$ke,Fke=["className","dividers"],jke=t=>{const{classes:e,dividers:n}=t;return Ue({root:["root",n&&"dividers"]},Dke,e)},Bke=we("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.dividers&&e.dividers]}})(({theme:t,ownerState:e})=>j({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px"},e.dividers?{padding:"16px 24px",borderTop:`1px solid ${(t.vars||t).palette.divider}`,borderBottom:`1px solid ${(t.vars||t).palette.divider}`}:{[`.${Nke.root} + &`]:{paddingTop:0}})),zke=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiDialogContent"}),{className:i,dividers:o=!1}=r,a=Ae(r,Fke),s=j({},r,{dividers:o}),l=jke(s);return w.jsx(Bke,j({className:ke(l.root,i),ownerState:s,ref:n},a))}),qs=zke;function Uke(t){return We("MuiDialogContentText",t)}Ve("MuiDialogContentText",["root"]);const Wke=["children","className"],Vke=t=>{const{classes:e}=t,r=Ue({root:["root"]},Uke,e);return j({},e,r)},Gke=we(At,{shouldForwardProp:t=>di(t)||t==="classes",name:"MuiDialogContentText",slot:"Root",overridesResolver:(t,e)=>e.root})({}),Hke=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiDialogContentText"}),{className:i}=r,o=Ae(r,Wke),a=Vke(o);return w.jsx(Gke,j({component:"p",variant:"body1",color:"text.secondary",ref:n,ownerState:o,className:ke(a.root,i)},r,{classes:a}))}),qke=Hke,Xke=["className","id"],Qke=t=>{const{classes:e}=t;return Ue({root:["root"]},Lke,e)},Yke=we(At,{name:"MuiDialogTitle",slot:"Root",overridesResolver:(t,e)=>e.root})({padding:"16px 24px",flex:"0 0 auto"}),Kke=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiDialogTitle"}),{className:i,id:o}=r,a=Ae(r,Xke),s=r,l=Qke(s),{titleId:c=o}=M.useContext(jre);return w.jsx(Yke,j({component:"h2",className:ke(l.root,i),ownerState:s,ref:n,variant:"h6",id:o??c},a))}),dd=Kke;function Zke(t){return We("MuiDivider",t)}const Jke=Ve("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),d8=Jke,eAe=["absolute","children","className","component","flexItem","light","orientation","role","textAlign","variant"],tAe=t=>{const{absolute:e,children:n,classes:r,flexItem:i,light:o,orientation:a,textAlign:s,variant:l}=t;return Ue({root:["root",e&&"absolute",l,o&&"light",a==="vertical"&&"vertical",i&&"flexItem",n&&"withChildren",n&&a==="vertical"&&"withChildrenVertical",s==="right"&&a!=="vertical"&&"textAlignRight",s==="left"&&a!=="vertical"&&"textAlignLeft"],wrapper:["wrapper",a==="vertical"&&"wrapperVertical"]},Zke,r)},nAe=we("div",{name:"MuiDivider",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.absolute&&e.absolute,e[n.variant],n.light&&e.light,n.orientation==="vertical"&&e.vertical,n.flexItem&&e.flexItem,n.children&&e.withChildren,n.children&&n.orientation==="vertical"&&e.withChildrenVertical,n.textAlign==="right"&&n.orientation!=="vertical"&&e.textAlignRight,n.textAlign==="left"&&n.orientation!=="vertical"&&e.textAlignLeft]}})(({theme:t,ownerState:e})=>j({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(t.vars||t).palette.divider,borderBottomWidth:"thin"},e.absolute&&{position:"absolute",bottom:0,left:0,width:"100%"},e.light&&{borderColor:t.vars?`rgba(${t.vars.palette.dividerChannel} / 0.08)`:kt(t.palette.divider,.08)},e.variant==="inset"&&{marginLeft:72},e.variant==="middle"&&e.orientation==="horizontal"&&{marginLeft:t.spacing(2),marginRight:t.spacing(2)},e.variant==="middle"&&e.orientation==="vertical"&&{marginTop:t.spacing(1),marginBottom:t.spacing(1)},e.orientation==="vertical"&&{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"},e.flexItem&&{alignSelf:"stretch",height:"auto"}),({ownerState:t})=>j({},t.children&&{display:"flex",whiteSpace:"nowrap",textAlign:"center",border:0,"&::before, &::after":{content:'""',alignSelf:"center"}}),({theme:t,ownerState:e})=>j({},e.children&&e.orientation!=="vertical"&&{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(t.vars||t).palette.divider}`}}),({theme:t,ownerState:e})=>j({},e.children&&e.orientation==="vertical"&&{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(t.vars||t).palette.divider}`}}),({ownerState:t})=>j({},t.textAlign==="right"&&t.orientation!=="vertical"&&{"&::before":{width:"90%"},"&::after":{width:"10%"}},t.textAlign==="left"&&t.orientation!=="vertical"&&{"&::before":{width:"10%"},"&::after":{width:"90%"}})),rAe=we("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.wrapper,n.orientation==="vertical"&&e.wrapperVertical]}})(({theme:t,ownerState:e})=>j({display:"inline-block",paddingLeft:`calc(${t.spacing(1)} * 1.2)`,paddingRight:`calc(${t.spacing(1)} * 1.2)`},e.orientation==="vertical"&&{paddingTop:`calc(${t.spacing(1)} * 1.2)`,paddingBottom:`calc(${t.spacing(1)} * 1.2)`})),Bre=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiDivider"}),{absolute:i=!1,children:o,className:a,component:s=o?"div":"hr",flexItem:l=!1,light:c=!1,orientation:u="horizontal",role:f=s!=="hr"?"separator":void 0,textAlign:d="center",variant:h="fullWidth"}=r,p=Ae(r,eAe),m=j({},r,{absolute:i,component:s,flexItem:l,light:c,orientation:u,role:f,textAlign:d,variant:h}),g=tAe(m);return w.jsx(nAe,j({as:s,className:ke(g.root,a),role:f,ref:n,ownerState:m},p,{children:o?w.jsx(rAe,{className:g.wrapper,ownerState:m,children:o}):null}))});Bre.muiSkipListHighlight=!0;const Qg=Bre,iAe=["addEndListener","appear","children","container","direction","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function oAe(t,e,n){const r=e.getBoundingClientRect(),i=n&&n.getBoundingClientRect(),o=ls(e);let a;if(e.fakeTransform)a=e.fakeTransform;else{const c=o.getComputedStyle(e);a=c.getPropertyValue("-webkit-transform")||c.getPropertyValue("transform")}let s=0,l=0;if(a&&a!=="none"&&typeof a=="string"){const c=a.split("(")[1].split(")")[0].split(",");s=parseInt(c[4],10),l=parseInt(c[5],10)}return t==="left"?i?`translateX(${i.right+s-r.left}px)`:`translateX(${o.innerWidth+s-r.left}px)`:t==="right"?i?`translateX(-${r.right-i.left-s}px)`:`translateX(-${r.left+r.width-s}px)`:t==="up"?i?`translateY(${i.bottom+l-r.top}px)`:`translateY(${o.innerHeight+l-r.top}px)`:i?`translateY(-${r.top-i.top+r.height-l}px)`:`translateY(-${r.top+r.height-l}px)`}function aAe(t){return typeof t=="function"?t():t}function iS(t,e,n){const r=aAe(n),i=oAe(t,e,r);i&&(e.style.webkitTransform=i,e.style.transform=i)}const sAe=M.forwardRef(function(e,n){const r=Vo(),i={enter:r.transitions.easing.easeOut,exit:r.transitions.easing.sharp},o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:a,appear:s=!0,children:l,container:c,direction:u="down",easing:f=i,in:d,onEnter:h,onEntered:p,onEntering:m,onExit:g,onExited:v,onExiting:y,style:x,timeout:b=o,TransitionComponent:_=M1}=e,S=Ae(e,iAe),O=M.useRef(null),C=Zt(l.ref,O,n),E=W=>U=>{W&&(U===void 0?W(O.current):W(O.current,U))},k=E((W,U)=>{iS(u,W,c),n5(W),h&&h(W,U)}),I=E((W,U)=>{const N=Xf({timeout:b,style:x,easing:f},{mode:"enter"});W.style.webkitTransition=r.transitions.create("-webkit-transform",j({},N)),W.style.transition=r.transitions.create("transform",j({},N)),W.style.webkitTransform="none",W.style.transform="none",m&&m(W,U)}),P=E(p),R=E(y),T=E(W=>{const U=Xf({timeout:b,style:x,easing:f},{mode:"exit"});W.style.webkitTransition=r.transitions.create("-webkit-transform",U),W.style.transition=r.transitions.create("transform",U),iS(u,W,c),g&&g(W)}),L=E(W=>{W.style.webkitTransition="",W.style.transition="",v&&v(W)}),z=W=>{a&&a(O.current,W)},B=M.useCallback(()=>{O.current&&iS(u,O.current,c)},[u,c]);return M.useEffect(()=>{if(d||u==="down"||u==="right")return;const W=Hv(()=>{O.current&&iS(u,O.current,c)}),U=ls(O.current);return U.addEventListener("resize",W),()=>{W.clear(),U.removeEventListener("resize",W)}},[u,d,c]),M.useEffect(()=>{d||B()},[d,B]),w.jsx(_,j({nodeRef:O,onEnter:k,onEntered:P,onEntering:I,onExit:T,onExited:L,onExiting:R,addEndListener:z,appear:s,in:d,timeout:b},S,{children:(W,U)=>M.cloneElement(l,j({ref:C,style:j({visibility:W==="exited"&&!d?"hidden":void 0},x,l.props.style)},U))}))}),lAe=sAe,cAe=["disableUnderline","components","componentsProps","fullWidth","hiddenLabel","inputComponent","multiline","slotProps","slots","type"],uAe=t=>{const{classes:e,disableUnderline:n}=t,i=Ue({root:["root",!n&&"underline"],input:["input"]},bMe,e);return j({},e,i)},fAe=we(DM,{shouldForwardProp:t=>di(t)||t==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[...RM(t,e),!n.disableUnderline&&e.underline]}})(({theme:t,ownerState:e})=>{var n;const r=t.palette.mode==="light",i=r?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",o=r?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",a=r?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",s=r?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return j({position:"relative",backgroundColor:t.vars?t.vars.palette.FilledInput.bg:o,borderTopLeftRadius:(t.vars||t).shape.borderRadius,borderTopRightRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),"&:hover":{backgroundColor:t.vars?t.vars.palette.FilledInput.hoverBg:a,"@media (hover: none)":{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:o}},[`&.${kd.focused}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:o},[`&.${kd.disabled}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.disabledBg:s}},!e.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(n=(t.vars||t).palette[e.color||"primary"])==null?void 0:n.main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${kd.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${kd.error}`]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`:i}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${kd.disabled}, .${kd.error}):before`]:{borderBottom:`1px solid ${(t.vars||t).palette.text.primary}`},[`&.${kd.disabled}:before`]:{borderBottomStyle:"dotted"}},e.startAdornment&&{paddingLeft:12},e.endAdornment&&{paddingRight:12},e.multiline&&j({padding:"25px 12px 8px"},e.size==="small"&&{paddingTop:21,paddingBottom:4},e.hiddenLabel&&{paddingTop:16,paddingBottom:17},e.hiddenLabel&&e.size==="small"&&{paddingTop:8,paddingBottom:9}))}),dAe=we(LM,{name:"MuiFilledInput",slot:"Input",overridesResolver:IM})(({theme:t,ownerState:e})=>j({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12},!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:t.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:t.palette.mode==="light"?null:"#fff",caretColor:t.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},t.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},e.size==="small"&&{paddingTop:21,paddingBottom:4},e.hiddenLabel&&{paddingTop:16,paddingBottom:17},e.startAdornment&&{paddingLeft:0},e.endAdornment&&{paddingRight:0},e.hiddenLabel&&e.size==="small"&&{paddingTop:8,paddingBottom:9},e.multiline&&{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0})),zre=M.forwardRef(function(e,n){var r,i,o,a;const s=qe({props:e,name:"MuiFilledInput"}),{components:l={},componentsProps:c,fullWidth:u=!1,inputComponent:f="input",multiline:d=!1,slotProps:h,slots:p={},type:m="text"}=s,g=Ae(s,cAe),v=j({},s,{fullWidth:u,inputComponent:f,multiline:d,type:m}),y=uAe(s),x={root:{ownerState:v},input:{ownerState:v}},b=h??c?Ii(x,h??c):x,_=(r=(i=p.root)!=null?i:l.Root)!=null?r:fAe,S=(o=(a=p.input)!=null?a:l.Input)!=null?o:dAe;return w.jsx(d5,j({slots:{root:_,input:S},componentsProps:b,fullWidth:u,inputComponent:f,multiline:d,ref:n,type:m},g,{classes:y}))});zre.muiName="Input";const Ure=zre;function hAe(t){return We("MuiFormControl",t)}Ve("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const pAe=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],mAe=t=>{const{classes:e,margin:n,fullWidth:r}=t,i={root:["root",n!=="none"&&`margin${De(n)}`,r&&"fullWidth"]};return Ue(i,hAe,e)},gAe=we("div",{name:"MuiFormControl",slot:"Root",overridesResolver:({ownerState:t},e)=>j({},e.root,e[`margin${De(t.margin)}`],t.fullWidth&&e.fullWidth)})(({ownerState:t})=>j({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},t.margin==="normal"&&{marginTop:16,marginBottom:8},t.margin==="dense"&&{marginTop:8,marginBottom:4},t.fullWidth&&{width:"100%"})),vAe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiFormControl"}),{children:i,className:o,color:a="primary",component:s="div",disabled:l=!1,error:c=!1,focused:u,fullWidth:f=!1,hiddenLabel:d=!1,margin:h="none",required:p=!1,size:m="medium",variant:g="outlined"}=r,v=Ae(r,pAe),y=j({},r,{color:a,component:s,disabled:l,error:c,fullWidth:f,hiddenLabel:d,margin:h,required:p,size:m,variant:g}),x=mAe(y),[b,_]=M.useState(()=>{let R=!1;return i&&M.Children.forEach(i,T=>{if(!Ix(T,["Input","Select"]))return;const L=Ix(T,["Select"])?T.props.input:T;L&&cMe(L.props)&&(R=!0)}),R}),[S,O]=M.useState(()=>{let R=!1;return i&&M.Children.forEach(i,T=>{Ix(T,["Input","Select"])&&(CT(T.props,!0)||CT(T.props.inputProps,!0))&&(R=!0)}),R}),[C,E]=M.useState(!1);l&&C&&E(!1);const k=u!==void 0&&!l?u:C;let I;const P=M.useMemo(()=>({adornedStart:b,setAdornedStart:_,color:a,disabled:l,error:c,filled:S,focused:k,fullWidth:f,hiddenLabel:d,size:m,onBlur:()=>{E(!1)},onEmpty:()=>{O(!1)},onFilled:()=>{O(!0)},onFocus:()=>{E(!0)},registerEffect:I,required:p,variant:g}),[b,a,l,c,S,k,f,d,I,p,m,g]);return w.jsx(AM.Provider,{value:P,children:w.jsx(gAe,j({as:s,ownerState:y,className:ke(x.root,o),ref:n},v,{children:i}))})}),Yv=vAe,yAe=TOe({createStyledComponent:we("div",{name:"MuiStack",slot:"Root",overridesResolver:(t,e)=>e.root}),useThemeProps:t=>qe({props:t,name:"MuiStack"})}),xAe=yAe;function bAe(t){return We("MuiFormControlLabel",t)}const _Ae=Ve("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),ix=_Ae,wAe=["checked","className","componentsProps","control","disabled","disableTypography","inputRef","label","labelPlacement","name","onChange","required","slotProps","value"],SAe=t=>{const{classes:e,disabled:n,labelPlacement:r,error:i,required:o}=t,a={root:["root",n&&"disabled",`labelPlacement${De(r)}`,i&&"error",o&&"required"],label:["label",n&&"disabled"],asterisk:["asterisk",i&&"error"]};return Ue(a,bAe,e)},OAe=we("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${ix.label}`]:e.label},e.root,e[`labelPlacement${De(n.labelPlacement)}`]]}})(({theme:t,ownerState:e})=>j({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${ix.disabled}`]:{cursor:"default"}},e.labelPlacement==="start"&&{flexDirection:"row-reverse",marginLeft:16,marginRight:-11},e.labelPlacement==="top"&&{flexDirection:"column-reverse",marginLeft:16},e.labelPlacement==="bottom"&&{flexDirection:"column",marginLeft:16},{[`& .${ix.label}`]:{[`&.${ix.disabled}`]:{color:(t.vars||t).palette.text.disabled}}})),CAe=we("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(t,e)=>e.asterisk})(({theme:t})=>({[`&.${ix.error}`]:{color:(t.vars||t).palette.error.main}})),TAe=M.forwardRef(function(e,n){var r,i;const o=qe({props:e,name:"MuiFormControlLabel"}),{className:a,componentsProps:s={},control:l,disabled:c,disableTypography:u,label:f,labelPlacement:d="end",required:h,slotProps:p={}}=o,m=Ae(o,wAe),g=nc(),v=(r=c??l.props.disabled)!=null?r:g==null?void 0:g.disabled,y=h??l.props.required,x={disabled:v,required:y};["checked","name","onChange","value","inputRef"].forEach(E=>{typeof l.props[E]>"u"&&typeof o[E]<"u"&&(x[E]=o[E])});const b=fd({props:o,muiFormControl:g,states:["error"]}),_=j({},o,{disabled:v,labelPlacement:d,required:y,error:b.error}),S=SAe(_),O=(i=p.typography)!=null?i:s.typography;let C=f;return C!=null&&C.type!==At&&!u&&(C=w.jsx(At,j({component:"span"},O,{className:ke(S.label,O==null?void 0:O.className),children:C}))),w.jsxs(OAe,j({className:ke(S.root,a),ownerState:_,ref:n},m,{children:[M.cloneElement(l,x),y?w.jsxs(xAe,{display:"block",children:[C,w.jsxs(CAe,{ownerState:_,"aria-hidden":!0,className:S.asterisk,children:[" ","*"]})]}):C]}))}),xg=TAe;function EAe(t){return We("MuiFormGroup",t)}Ve("MuiFormGroup",["root","row","error"]);const PAe=["className","row"],MAe=t=>{const{classes:e,row:n,error:r}=t;return Ue({root:["root",n&&"row",r&&"error"]},EAe,e)},kAe=we("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.row&&e.row]}})(({ownerState:t})=>j({display:"flex",flexDirection:"column",flexWrap:"wrap"},t.row&&{flexDirection:"row"})),AAe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiFormGroup"}),{className:i,row:o=!1}=r,a=Ae(r,PAe),s=nc(),l=fd({props:r,muiFormControl:s,states:["error"]}),c=j({},r,{row:o,error:l.error}),u=MAe(c);return w.jsx(kAe,j({className:ke(u.root,i),ownerState:c,ref:n},a))}),RAe=AAe;function IAe(t){return We("MuiFormHelperText",t)}const DAe=Ve("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]),h8=DAe;var p8;const LAe=["children","className","component","disabled","error","filled","focused","margin","required","variant"],$Ae=t=>{const{classes:e,contained:n,size:r,disabled:i,error:o,filled:a,focused:s,required:l}=t,c={root:["root",i&&"disabled",o&&"error",r&&`size${De(r)}`,n&&"contained",s&&"focused",a&&"filled",l&&"required"]};return Ue(c,IAe,e)},NAe=we("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.size&&e[`size${De(n.size)}`],n.contained&&e.contained,n.filled&&e.filled]}})(({theme:t,ownerState:e})=>j({color:(t.vars||t).palette.text.secondary},t.typography.caption,{textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${h8.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${h8.error}`]:{color:(t.vars||t).palette.error.main}},e.size==="small"&&{marginTop:4},e.contained&&{marginLeft:14,marginRight:14})),FAe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiFormHelperText"}),{children:i,className:o,component:a="p"}=r,s=Ae(r,LAe),l=nc(),c=fd({props:r,muiFormControl:l,states:["variant","size","disabled","error","filled","focused","required"]}),u=j({},r,{component:a,contained:c.variant==="filled"||c.variant==="outlined",variant:c.variant,size:c.size,disabled:c.disabled,error:c.error,filled:c.filled,focused:c.focused,required:c.required}),f=$Ae(u);return w.jsx(NAe,j({as:a,ownerState:u,className:ke(f.root,o),ref:n},s,{children:i===" "?p8||(p8=w.jsx("span",{className:"notranslate",children:"​"})):i}))}),Wre=FAe;function jAe(t){return We("MuiFormLabel",t)}const BAe=Ve("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),Fx=BAe,zAe=["children","className","color","component","disabled","error","filled","focused","required"],UAe=t=>{const{classes:e,color:n,focused:r,disabled:i,error:o,filled:a,required:s}=t,l={root:["root",`color${De(n)}`,i&&"disabled",o&&"error",a&&"filled",r&&"focused",s&&"required"],asterisk:["asterisk",o&&"error"]};return Ue(l,jAe,e)},WAe=we("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:({ownerState:t},e)=>j({},e.root,t.color==="secondary"&&e.colorSecondary,t.filled&&e.filled)})(({theme:t,ownerState:e})=>j({color:(t.vars||t).palette.text.secondary},t.typography.body1,{lineHeight:"1.4375em",padding:0,position:"relative",[`&.${Fx.focused}`]:{color:(t.vars||t).palette[e.color].main},[`&.${Fx.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${Fx.error}`]:{color:(t.vars||t).palette.error.main}})),VAe=we("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(t,e)=>e.asterisk})(({theme:t})=>({[`&.${Fx.error}`]:{color:(t.vars||t).palette.error.main}})),GAe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiFormLabel"}),{children:i,className:o,component:a="label"}=r,s=Ae(r,zAe),l=nc(),c=fd({props:r,muiFormControl:l,states:["color","required","focused","disabled","error","filled"]}),u=j({},r,{color:c.color||"primary",component:a,disabled:c.disabled,error:c.error,filled:c.filled,focused:c.focused,required:c.required}),f=UAe(u);return w.jsxs(WAe,j({as:a,ownerState:u,className:ke(f.root,o),ref:n},s,{children:[i,c.required&&w.jsxs(VAe,{ownerState:u,"aria-hidden":!0,className:f.asterisk,children:[" ","*"]})]}))}),HAe=GAe,qAe=M.createContext(),m8=qAe;function XAe(t){return We("MuiGrid",t)}const QAe=[0,1,2,3,4,5,6,7,8,9,10],YAe=["column-reverse","column","row-reverse","row"],KAe=["nowrap","wrap-reverse","wrap"],u0=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],Ab=Ve("MuiGrid",["root","container","item","zeroMinWidth",...QAe.map(t=>`spacing-xs-${t}`),...YAe.map(t=>`direction-xs-${t}`),...KAe.map(t=>`wrap-xs-${t}`),...u0.map(t=>`grid-xs-${t}`),...u0.map(t=>`grid-sm-${t}`),...u0.map(t=>`grid-md-${t}`),...u0.map(t=>`grid-lg-${t}`),...u0.map(t=>`grid-xl-${t}`)]),ZAe=["className","columns","columnSpacing","component","container","direction","item","rowSpacing","spacing","wrap","zeroMinWidth"];function bg(t){const e=parseFloat(t);return`${e}${String(t).replace(String(e),"")||"px"}`}function JAe({theme:t,ownerState:e}){let n;return t.breakpoints.keys.reduce((r,i)=>{let o={};if(e[i]&&(n=e[i]),!n)return r;if(n===!0)o={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if(n==="auto")o={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{const a=Mh({values:e.columns,breakpoints:t.breakpoints.values}),s=typeof a=="object"?a[i]:a;if(s==null)return r;const l=`${Math.round(n/s*1e8)/1e6}%`;let c={};if(e.container&&e.item&&e.columnSpacing!==0){const u=t.spacing(e.columnSpacing);if(u!=="0px"){const f=`calc(${l} + ${bg(u)})`;c={flexBasis:f,maxWidth:f}}}o=j({flexBasis:l,flexGrow:0,maxWidth:l},c)}return t.breakpoints.values[i]===0?Object.assign(r,o):r[t.breakpoints.up(i)]=o,r},{})}function eRe({theme:t,ownerState:e}){const n=Mh({values:e.direction,breakpoints:t.breakpoints.values});return Uo({theme:t},n,r=>{const i={flexDirection:r};return r.indexOf("column")===0&&(i[`& > .${Ab.item}`]={maxWidth:"none"}),i})}function Vre({breakpoints:t,values:e}){let n="";Object.keys(e).forEach(i=>{n===""&&e[i]!==0&&(n=i)});const r=Object.keys(t).sort((i,o)=>t[i]-t[o]);return r.slice(0,r.indexOf(n))}function tRe({theme:t,ownerState:e}){const{container:n,rowSpacing:r}=e;let i={};if(n&&r!==0){const o=Mh({values:r,breakpoints:t.breakpoints.values});let a;typeof o=="object"&&(a=Vre({breakpoints:t.breakpoints.values,values:o})),i=Uo({theme:t},o,(s,l)=>{var c;const u=t.spacing(s);return u!=="0px"?{marginTop:`-${bg(u)}`,[`& > .${Ab.item}`]:{paddingTop:bg(u)}}:(c=a)!=null&&c.includes(l)?{}:{marginTop:0,[`& > .${Ab.item}`]:{paddingTop:0}}})}return i}function nRe({theme:t,ownerState:e}){const{container:n,columnSpacing:r}=e;let i={};if(n&&r!==0){const o=Mh({values:r,breakpoints:t.breakpoints.values});let a;typeof o=="object"&&(a=Vre({breakpoints:t.breakpoints.values,values:o})),i=Uo({theme:t},o,(s,l)=>{var c;const u=t.spacing(s);return u!=="0px"?{width:`calc(100% + ${bg(u)})`,marginLeft:`-${bg(u)}`,[`& > .${Ab.item}`]:{paddingLeft:bg(u)}}:(c=a)!=null&&c.includes(l)?{}:{width:"100%",marginLeft:0,[`& > .${Ab.item}`]:{paddingLeft:0}}})}return i}function rRe(t,e,n={}){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[n[`spacing-xs-${String(t)}`]];const r=[];return e.forEach(i=>{const o=t[i];Number(o)>0&&r.push(n[`spacing-${i}-${String(o)}`])}),r}const iRe=we("div",{name:"MuiGrid",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{container:r,direction:i,item:o,spacing:a,wrap:s,zeroMinWidth:l,breakpoints:c}=n;let u=[];r&&(u=rRe(a,c,e));const f=[];return c.forEach(d=>{const h=n[d];h&&f.push(e[`grid-${d}-${String(h)}`])}),[e.root,r&&e.container,o&&e.item,l&&e.zeroMinWidth,...u,i!=="row"&&e[`direction-xs-${String(i)}`],s!=="wrap"&&e[`wrap-xs-${String(s)}`],...f]}})(({ownerState:t})=>j({boxSizing:"border-box"},t.container&&{display:"flex",flexWrap:"wrap",width:"100%"},t.item&&{margin:0},t.zeroMinWidth&&{minWidth:0},t.wrap!=="wrap"&&{flexWrap:t.wrap}),eRe,tRe,nRe,JAe);function oRe(t,e){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[`spacing-xs-${String(t)}`];const n=[];return e.forEach(r=>{const i=t[r];if(Number(i)>0){const o=`spacing-${r}-${String(i)}`;n.push(o)}}),n}const aRe=t=>{const{classes:e,container:n,direction:r,item:i,spacing:o,wrap:a,zeroMinWidth:s,breakpoints:l}=t;let c=[];n&&(c=oRe(o,l));const u=[];l.forEach(d=>{const h=t[d];h&&u.push(`grid-${d}-${String(h)}`)});const f={root:["root",n&&"container",i&&"item",s&&"zeroMinWidth",...c,r!=="row"&&`direction-xs-${String(r)}`,a!=="wrap"&&`wrap-xs-${String(a)}`,...u]};return Ue(f,XAe,e)},sRe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiGrid"}),{breakpoints:i}=Vo(),o=S1(r),{className:a,columns:s,columnSpacing:l,component:c="div",container:u=!1,direction:f="row",item:d=!1,rowSpacing:h,spacing:p=0,wrap:m="wrap",zeroMinWidth:g=!1}=o,v=Ae(o,ZAe),y=h||p,x=l||p,b=M.useContext(m8),_=u?s||12:b,S={},O=j({},v);i.keys.forEach(k=>{v[k]!=null&&(S[k]=v[k],delete O[k])});const C=j({},o,{columns:_,container:u,direction:f,item:d,rowSpacing:y,columnSpacing:x,wrap:m,zeroMinWidth:g,spacing:p},S,{breakpoints:i.keys}),E=aRe(C);return w.jsx(m8.Provider,{value:_,children:w.jsx(iRe,j({ownerState:C,className:ke(E.root,a),as:c,ref:n},O))})}),wC=sRe,lRe=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function DL(t){return`scale(${t}, ${t**2})`}const cRe={entering:{opacity:1,transform:DL(1)},entered:{opacity:1,transform:"none"}},bA=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),Gre=M.forwardRef(function(e,n){const{addEndListener:r,appear:i=!0,children:o,easing:a,in:s,onEnter:l,onEntered:c,onEntering:u,onExit:f,onExited:d,onExiting:h,style:p,timeout:m="auto",TransitionComponent:g=M1}=e,v=Ae(e,lRe),y=mf(),x=M.useRef(),b=Vo(),_=M.useRef(null),S=Zt(_,o.ref,n),O=L=>z=>{if(L){const B=_.current;z===void 0?L(B):L(B,z)}},C=O(u),E=O((L,z)=>{n5(L);const{duration:B,delay:W,easing:U}=Xf({style:p,timeout:m,easing:a},{mode:"enter"});let N;m==="auto"?(N=b.transitions.getAutoHeightDuration(L.clientHeight),x.current=N):N=B,L.style.transition=[b.transitions.create("opacity",{duration:N,delay:W}),b.transitions.create("transform",{duration:bA?N:N*.666,delay:W,easing:U})].join(","),l&&l(L,z)}),k=O(c),I=O(h),P=O(L=>{const{duration:z,delay:B,easing:W}=Xf({style:p,timeout:m,easing:a},{mode:"exit"});let U;m==="auto"?(U=b.transitions.getAutoHeightDuration(L.clientHeight),x.current=U):U=z,L.style.transition=[b.transitions.create("opacity",{duration:U,delay:B}),b.transitions.create("transform",{duration:bA?U:U*.666,delay:bA?B:B||U*.333,easing:W})].join(","),L.style.opacity=0,L.style.transform=DL(.75),f&&f(L)}),R=O(d),T=L=>{m==="auto"&&y.start(x.current||0,L),r&&r(_.current,L)};return w.jsx(g,j({appear:i,in:s,nodeRef:_,onEnter:E,onEntered:k,onEntering:C,onExit:P,onExited:R,onExiting:I,addEndListener:T,timeout:m==="auto"?null:m},v,{children:(L,z)=>M.cloneElement(o,j({style:j({opacity:0,transform:DL(.75),visibility:L==="exited"&&!s?"hidden":void 0},cRe[L],p,o.props.style),ref:S},z))}))});Gre.muiSupportAuto=!0;const Rb=Gre,uRe=["disableUnderline","components","componentsProps","fullWidth","inputComponent","multiline","slotProps","slots","type"],fRe=t=>{const{classes:e,disableUnderline:n}=t,i=Ue({root:["root",!n&&"underline"],input:["input"]},gMe,e);return j({},e,i)},dRe=we(DM,{shouldForwardProp:t=>di(t)||t==="classes",name:"MuiInput",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[...RM(t,e),!n.disableUnderline&&e.underline]}})(({theme:t,ownerState:e})=>{let r=t.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return t.vars&&(r=`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`),j({position:"relative"},e.formControl&&{"label + &":{marginTop:16}},!e.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(t.vars||t).palette[e.color].main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${c0.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${c0.error}`]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${r}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${c0.disabled}, .${c0.error}):before`]:{borderBottom:`2px solid ${(t.vars||t).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${r}`}},[`&.${c0.disabled}:before`]:{borderBottomStyle:"dotted"}})}),hRe=we(LM,{name:"MuiInput",slot:"Input",overridesResolver:IM})({}),Hre=M.forwardRef(function(e,n){var r,i,o,a;const s=qe({props:e,name:"MuiInput"}),{disableUnderline:l,components:c={},componentsProps:u,fullWidth:f=!1,inputComponent:d="input",multiline:h=!1,slotProps:p,slots:m={},type:g="text"}=s,v=Ae(s,uRe),y=fRe(s),b={root:{ownerState:{disableUnderline:l}}},_=p??u?Ii(p??u,b):b,S=(r=(i=m.root)!=null?i:c.Root)!=null?r:dRe,O=(o=(a=m.input)!=null?a:c.Input)!=null?o:hRe;return w.jsx(d5,j({slots:{root:S,input:O},slotProps:_,fullWidth:f,inputComponent:d,multiline:h,ref:n,type:g},v,{classes:y}))});Hre.muiName="Input";const xp=Hre;function pRe(t){return We("MuiInputAdornment",t)}const mRe=Ve("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]),g8=mRe;var v8;const gRe=["children","className","component","disablePointerEvents","disableTypography","position","variant"],vRe=(t,e)=>{const{ownerState:n}=t;return[e.root,e[`position${De(n.position)}`],n.disablePointerEvents===!0&&e.disablePointerEvents,e[n.variant]]},yRe=t=>{const{classes:e,disablePointerEvents:n,hiddenLabel:r,position:i,size:o,variant:a}=t,s={root:["root",n&&"disablePointerEvents",i&&`position${De(i)}`,a,r&&"hiddenLabel",o&&`size${De(o)}`]};return Ue(s,pRe,e)},xRe=we("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:vRe})(({theme:t,ownerState:e})=>j({display:"flex",height:"0.01em",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(t.vars||t).palette.action.active},e.variant==="filled"&&{[`&.${g8.positionStart}&:not(.${g8.hiddenLabel})`]:{marginTop:16}},e.position==="start"&&{marginRight:8},e.position==="end"&&{marginLeft:8},e.disablePointerEvents===!0&&{pointerEvents:"none"})),bRe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiInputAdornment"}),{children:i,className:o,component:a="div",disablePointerEvents:s=!1,disableTypography:l=!1,position:c,variant:u}=r,f=Ae(r,gRe),d=nc()||{};let h=u;u&&d.variant,d&&!h&&(h=d.variant);const p=j({},r,{hiddenLabel:d.hiddenLabel,size:d.size,disablePointerEvents:s,position:c,variant:h}),m=yRe(p);return w.jsx(AM.Provider,{value:null,children:w.jsx(xRe,j({as:a,ownerState:p,className:ke(m.root,o),ref:n},f,{children:typeof i=="string"&&!l?w.jsx(At,{color:"text.secondary",children:i}):w.jsxs(M.Fragment,{children:[c==="start"?v8||(v8=w.jsx("span",{className:"notranslate",children:"​"})):null,i]})}))})}),_Re=bRe;function wRe(t){return We("MuiInputLabel",t)}Ve("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const SRe=["disableAnimation","margin","shrink","variant","className"],ORe=t=>{const{classes:e,formControl:n,size:r,shrink:i,disableAnimation:o,variant:a,required:s}=t,l={root:["root",n&&"formControl",!o&&"animated",i&&"shrink",r&&r!=="normal"&&`size${De(r)}`,a],asterisk:[s&&"asterisk"]},c=Ue(l,wRe,e);return j({},e,c)},CRe=we(HAe,{shouldForwardProp:t=>di(t)||t==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${Fx.asterisk}`]:e.asterisk},e.root,n.formControl&&e.formControl,n.size==="small"&&e.sizeSmall,n.shrink&&e.shrink,!n.disableAnimation&&e.animated,n.focused&&e.focused,e[n.variant]]}})(({theme:t,ownerState:e})=>j({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},e.formControl&&{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"},e.size==="small"&&{transform:"translate(0, 17px) scale(1)"},e.shrink&&{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"},!e.disableAnimation&&{transition:t.transitions.create(["color","transform","max-width"],{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut})},e.variant==="filled"&&j({zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},e.size==="small"&&{transform:"translate(12px, 13px) scale(1)"},e.shrink&&j({userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"},e.size==="small"&&{transform:"translate(12px, 4px) scale(0.75)"})),e.variant==="outlined"&&j({zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},e.size==="small"&&{transform:"translate(14px, 9px) scale(1)"},e.shrink&&{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}))),TRe=M.forwardRef(function(e,n){const r=qe({name:"MuiInputLabel",props:e}),{disableAnimation:i=!1,shrink:o,className:a}=r,s=Ae(r,SRe),l=nc();let c=o;typeof c>"u"&&l&&(c=l.filled||l.focused||l.adornedStart);const u=fd({props:r,muiFormControl:l,states:["size","variant","required","focused"]}),f=j({},r,{disableAnimation:i,formControl:l,shrink:c,size:u.size,variant:u.variant,required:u.required,focused:u.focused}),d=ORe(f);return w.jsx(CRe,j({"data-shrink":c,ownerState:f,ref:n,className:ke(d.root,a)},s,{classes:d}))}),Kv=TRe;function ERe(t){return We("MuiLink",t)}const PRe=Ve("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),MRe=PRe,qre={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},kRe=t=>qre[t]||t,ARe=({theme:t,ownerState:e})=>{const n=kRe(e.color),r=Wg(t,`palette.${n}`,!1)||e.color,i=Wg(t,`palette.${n}Channel`);return"vars"in t&&i?`rgba(${i} / 0.4)`:kt(r,.4)},RRe=["className","color","component","onBlur","onFocus","TypographyClasses","underline","variant","sx"],IRe=t=>{const{classes:e,component:n,focusVisible:r,underline:i}=t,o={root:["root",`underline${De(i)}`,n==="button"&&"button",r&&"focusVisible"]};return Ue(o,ERe,e)},DRe=we(At,{name:"MuiLink",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`underline${De(n.underline)}`],n.component==="button"&&e.button]}})(({theme:t,ownerState:e})=>j({},e.underline==="none"&&{textDecoration:"none"},e.underline==="hover"&&{textDecoration:"none","&:hover":{textDecoration:"underline"}},e.underline==="always"&&j({textDecoration:"underline"},e.color!=="inherit"&&{textDecorationColor:ARe({theme:t,ownerState:e})},{"&:hover":{textDecorationColor:"inherit"}}),e.component==="button"&&{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${MRe.focusVisible}`]:{outline:"auto"}})),LRe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiLink"}),{className:i,color:o="primary",component:a="a",onBlur:s,onFocus:l,TypographyClasses:c,underline:u="always",variant:f="inherit",sx:d}=r,h=Ae(r,RRe),{isFocusVisibleRef:p,onBlur:m,onFocus:g,ref:v}=C1(),[y,x]=M.useState(!1),b=Zt(n,v),_=E=>{m(E),p.current===!1&&x(!1),s&&s(E)},S=E=>{g(E),p.current===!0&&x(!0),l&&l(E)},O=j({},r,{color:o,component:a,focusVisible:y,underline:u,variant:f}),C=IRe(O);return w.jsx(DRe,j({color:o,className:ke(C.root,i),classes:c,component:a,onBlur:_,onFocus:S,ref:b,ownerState:O,variant:f,sx:[...Object.keys(qre).includes(o)?[]:[{color:o}],...Array.isArray(d)?d:[d]]},h))}),$Re=LRe,NRe=M.createContext({}),Gs=NRe;function FRe(t){return We("MuiList",t)}Ve("MuiList",["root","padding","dense","subheader"]);const jRe=["children","className","component","dense","disablePadding","subheader"],BRe=t=>{const{classes:e,disablePadding:n,dense:r,subheader:i}=t;return Ue({root:["root",!n&&"padding",r&&"dense",i&&"subheader"]},FRe,e)},zRe=we("ul",{name:"MuiList",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disablePadding&&e.padding,n.dense&&e.dense,n.subheader&&e.subheader]}})(({ownerState:t})=>j({listStyle:"none",margin:0,padding:0,position:"relative"},!t.disablePadding&&{paddingTop:8,paddingBottom:8},t.subheader&&{paddingTop:0})),URe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiList"}),{children:i,className:o,component:a="ul",dense:s=!1,disablePadding:l=!1,subheader:c}=r,u=Ae(r,jRe),f=M.useMemo(()=>({dense:s}),[s]),d=j({},r,{component:a,dense:s,disablePadding:l}),h=BRe(d);return w.jsx(Gs.Provider,{value:f,children:w.jsxs(zRe,j({as:a,className:ke(h.root,o),ref:n,ownerState:d},u,{children:[c,i]}))})}),FM=URe;function WRe(t){return We("MuiListItem",t)}const VRe=Ve("MuiListItem",["root","container","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","padding","button","secondaryAction","selected"]),km=VRe;function GRe(t){return We("MuiListItemButton",t)}const HRe=Ve("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),Am=HRe,qRe=["alignItems","autoFocus","component","children","dense","disableGutters","divider","focusVisibleClassName","selected","className"],XRe=(t,e)=>{const{ownerState:n}=t;return[e.root,n.dense&&e.dense,n.alignItems==="flex-start"&&e.alignItemsFlexStart,n.divider&&e.divider,!n.disableGutters&&e.gutters]},QRe=t=>{const{alignItems:e,classes:n,dense:r,disabled:i,disableGutters:o,divider:a,selected:s}=t,c=Ue({root:["root",r&&"dense",!o&&"gutters",a&&"divider",i&&"disabled",e==="flex-start"&&"alignItemsFlexStart",s&&"selected"]},GRe,n);return j({},n,c)},YRe=we(us,{shouldForwardProp:t=>di(t)||t==="classes",name:"MuiListItemButton",slot:"Root",overridesResolver:XRe})(({theme:t,ownerState:e})=>j({display:"flex",flexGrow:1,justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minWidth:0,boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Am.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${Am.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:kt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${Am.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:kt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.primary.main,t.palette.action.selectedOpacity)}},[`&.${Am.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${Am.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.divider&&{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"},e.alignItems==="flex-start"&&{alignItems:"flex-start"},!e.disableGutters&&{paddingLeft:16,paddingRight:16},e.dense&&{paddingTop:4,paddingBottom:4})),KRe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiListItemButton"}),{alignItems:i="center",autoFocus:o=!1,component:a="div",children:s,dense:l=!1,disableGutters:c=!1,divider:u=!1,focusVisibleClassName:f,selected:d=!1,className:h}=r,p=Ae(r,qRe),m=M.useContext(Gs),g=M.useMemo(()=>({dense:l||m.dense||!1,alignItems:i,disableGutters:c}),[i,m.dense,l,c]),v=M.useRef(null);Vr(()=>{o&&v.current&&v.current.focus()},[o]);const y=j({},r,{alignItems:i,dense:g.dense,disableGutters:c,divider:u,selected:d}),x=QRe(y),b=Zt(v,n);return w.jsx(Gs.Provider,{value:g,children:w.jsx(YRe,j({ref:b,href:p.href||p.to,component:(p.href||p.to)&&a==="div"?"button":a,focusVisibleClassName:ke(x.focusVisible,f),ownerState:y,className:ke(x.root,h)},p,{classes:x,children:s}))})}),Xre=KRe;function ZRe(t){return We("MuiListItemSecondaryAction",t)}Ve("MuiListItemSecondaryAction",["root","disableGutters"]);const JRe=["className"],eIe=t=>{const{disableGutters:e,classes:n}=t;return Ue({root:["root",e&&"disableGutters"]},ZRe,n)},tIe=we("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.disableGutters&&e.disableGutters]}})(({ownerState:t})=>j({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)"},t.disableGutters&&{right:0})),Qre=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiListItemSecondaryAction"}),{className:i}=r,o=Ae(r,JRe),a=M.useContext(Gs),s=j({},r,{disableGutters:a.disableGutters}),l=eIe(s);return w.jsx(tIe,j({className:ke(l.root,i),ownerState:s,ref:n},o))});Qre.muiName="ListItemSecondaryAction";const TT=Qre,nIe=["className"],rIe=["alignItems","autoFocus","button","children","className","component","components","componentsProps","ContainerComponent","ContainerProps","dense","disabled","disableGutters","disablePadding","divider","focusVisibleClassName","secondaryAction","selected","slotProps","slots"],iIe=(t,e)=>{const{ownerState:n}=t;return[e.root,n.dense&&e.dense,n.alignItems==="flex-start"&&e.alignItemsFlexStart,n.divider&&e.divider,!n.disableGutters&&e.gutters,!n.disablePadding&&e.padding,n.button&&e.button,n.hasSecondaryAction&&e.secondaryAction]},oIe=t=>{const{alignItems:e,button:n,classes:r,dense:i,disabled:o,disableGutters:a,disablePadding:s,divider:l,hasSecondaryAction:c,selected:u}=t;return Ue({root:["root",i&&"dense",!a&&"gutters",!s&&"padding",l&&"divider",o&&"disabled",n&&"button",e==="flex-start"&&"alignItemsFlexStart",c&&"secondaryAction",u&&"selected"],container:["container"]},WRe,r)},aIe=we("div",{name:"MuiListItem",slot:"Root",overridesResolver:iIe})(({theme:t,ownerState:e})=>j({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left"},!e.disablePadding&&j({paddingTop:8,paddingBottom:8},e.dense&&{paddingTop:4,paddingBottom:4},!e.disableGutters&&{paddingLeft:16,paddingRight:16},!!e.secondaryAction&&{paddingRight:48}),!!e.secondaryAction&&{[`& > .${Am.root}`]:{paddingRight:48}},{[`&.${km.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${km.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${km.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:kt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${km.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.alignItems==="flex-start"&&{alignItems:"flex-start"},e.divider&&{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"},e.button&&{transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${km.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:kt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.primary.main,t.palette.action.selectedOpacity)}}},e.hasSecondaryAction&&{paddingRight:48})),sIe=we("li",{name:"MuiListItem",slot:"Container",overridesResolver:(t,e)=>e.container})({position:"relative"}),lIe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiListItem"}),{alignItems:i="center",autoFocus:o=!1,button:a=!1,children:s,className:l,component:c,components:u={},componentsProps:f={},ContainerComponent:d="li",ContainerProps:{className:h}={},dense:p=!1,disabled:m=!1,disableGutters:g=!1,disablePadding:v=!1,divider:y=!1,focusVisibleClassName:x,secondaryAction:b,selected:_=!1,slotProps:S={},slots:O={}}=r,C=Ae(r.ContainerProps,nIe),E=Ae(r,rIe),k=M.useContext(Gs),I=M.useMemo(()=>({dense:p||k.dense||!1,alignItems:i,disableGutters:g}),[i,k.dense,p,g]),P=M.useRef(null);Vr(()=>{o&&P.current&&P.current.focus()},[o]);const R=M.Children.toArray(s),T=R.length&&Ix(R[R.length-1],["ListItemSecondaryAction"]),L=j({},r,{alignItems:i,autoFocus:o,button:a,dense:I.dense,disabled:m,disableGutters:g,disablePadding:v,divider:y,hasSecondaryAction:T,selected:_}),z=oIe(L),B=Zt(P,n),W=O.root||u.Root||aIe,U=S.root||f.root||{},N=j({className:ke(z.root,U.className,l),disabled:m},E);let $=c||"li";return a&&(N.component=c||"div",N.focusVisibleClassName=ke(km.focusVisible,x),$=us),T?($=!N.component&&!c?"div":$,d==="li"&&($==="li"?$="div":N.component==="li"&&(N.component="div")),w.jsx(Gs.Provider,{value:I,children:w.jsxs(sIe,j({as:d,className:ke(z.container,h),ref:B,ownerState:L},C,{children:[w.jsx(W,j({},U,!zl(W)&&{as:$,ownerState:j({},L,U.ownerState)},N,{children:R})),R.pop()]}))})):w.jsx(Gs.Provider,{value:I,children:w.jsxs(W,j({},U,{as:$,ref:B},!zl(W)&&{ownerState:j({},L,U.ownerState)},N,{children:[R,b&&w.jsx(TT,{children:b})]}))})}),jx=lIe;function cIe(t){return We("MuiListItemIcon",t)}const uIe=Ve("MuiListItemIcon",["root","alignItemsFlexStart"]),y8=uIe,fIe=["className"],dIe=t=>{const{alignItems:e,classes:n}=t;return Ue({root:["root",e==="flex-start"&&"alignItemsFlexStart"]},cIe,n)},hIe=we("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.alignItems==="flex-start"&&e.alignItemsFlexStart]}})(({theme:t,ownerState:e})=>j({minWidth:56,color:(t.vars||t).palette.action.active,flexShrink:0,display:"inline-flex"},e.alignItems==="flex-start"&&{marginTop:8})),pIe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiListItemIcon"}),{className:i}=r,o=Ae(r,fIe),a=M.useContext(Gs),s=j({},r,{alignItems:a.alignItems}),l=dIe(s);return w.jsx(hIe,j({className:ke(l.root,i),ownerState:s,ref:n},o))}),Yre=pIe;function mIe(t){return We("MuiListItemText",t)}const gIe=Ve("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),ET=gIe,vIe=["children","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps"],yIe=t=>{const{classes:e,inset:n,primary:r,secondary:i,dense:o}=t;return Ue({root:["root",n&&"inset",o&&"dense",r&&i&&"multiline"],primary:["primary"],secondary:["secondary"]},mIe,e)},xIe=we("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${ET.primary}`]:e.primary},{[`& .${ET.secondary}`]:e.secondary},e.root,n.inset&&e.inset,n.primary&&n.secondary&&e.multiline,n.dense&&e.dense]}})(({ownerState:t})=>j({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4},t.primary&&t.secondary&&{marginTop:6,marginBottom:6},t.inset&&{paddingLeft:56})),bIe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiListItemText"}),{children:i,className:o,disableTypography:a=!1,inset:s=!1,primary:l,primaryTypographyProps:c,secondary:u,secondaryTypographyProps:f}=r,d=Ae(r,vIe),{dense:h}=M.useContext(Gs);let p=l??i,m=u;const g=j({},r,{disableTypography:a,inset:s,primary:!!p,secondary:!!m,dense:h}),v=yIe(g);return p!=null&&p.type!==At&&!a&&(p=w.jsx(At,j({variant:h?"body2":"body1",className:v.primary,component:c!=null&&c.variant?void 0:"span",display:"block"},c,{children:p}))),m!=null&&m.type!==At&&!a&&(m=w.jsx(At,j({variant:"body2",className:v.secondary,color:"text.secondary",display:"block"},f,{children:m}))),w.jsxs(xIe,j({className:ke(v.root,o),ownerState:g,ref:n},d,{children:[p,m]}))}),es=bIe,_Ie=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function _A(t,e,n){return t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:n?null:t.firstChild}function x8(t,e,n){return t===e?n?t.firstChild:t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:n?null:t.lastChild}function Kre(t,e){if(e===void 0)return!0;let n=t.innerText;return n===void 0&&(n=t.textContent),n=n.trim().toLowerCase(),n.length===0?!1:e.repeating?n[0]===e.keys[0]:n.indexOf(e.keys.join(""))===0}function f0(t,e,n,r,i,o){let a=!1,s=i(t,e,e?n:!1);for(;s;){if(s===t.firstChild){if(a)return!1;a=!0}const l=r?!1:s.disabled||s.getAttribute("aria-disabled")==="true";if(!s.hasAttribute("tabindex")||!Kre(s,o)||l)s=i(t,s,n);else return s.focus(),!0}return!1}const wIe=M.forwardRef(function(e,n){const{actions:r,autoFocus:i=!1,autoFocusItem:o=!1,children:a,className:s,disabledItemsFocusable:l=!1,disableListWrap:c=!1,onKeyDown:u,variant:f="selectedMenu"}=e,d=Ae(e,_Ie),h=M.useRef(null),p=M.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});Vr(()=>{i&&h.current.focus()},[i]),M.useImperativeHandle(r,()=>({adjustStyleForScrollbar:(x,{direction:b})=>{const _=!h.current.style.width;if(x.clientHeight{const b=h.current,_=x.key,S=$n(b).activeElement;if(_==="ArrowDown")x.preventDefault(),f0(b,S,c,l,_A);else if(_==="ArrowUp")x.preventDefault(),f0(b,S,c,l,x8);else if(_==="Home")x.preventDefault(),f0(b,null,c,l,_A);else if(_==="End")x.preventDefault(),f0(b,null,c,l,x8);else if(_.length===1){const O=p.current,C=_.toLowerCase(),E=performance.now();O.keys.length>0&&(E-O.lastTime>500?(O.keys=[],O.repeating=!0,O.previousKeyMatched=!0):O.repeating&&C!==O.keys[0]&&(O.repeating=!1)),O.lastTime=E,O.keys.push(C);const k=S&&!O.repeating&&Kre(S,O);O.previousKeyMatched&&(k||f0(b,S,!1,l,_A,O))?x.preventDefault():O.previousKeyMatched=!1}u&&u(x)},g=Zt(h,n);let v=-1;M.Children.forEach(a,(x,b)=>{if(!M.isValidElement(x)){v===b&&(v+=1,v>=a.length&&(v=-1));return}x.props.disabled||(f==="selectedMenu"&&x.props.selected||v===-1)&&(v=b),v===b&&(x.props.disabled||x.props.muiSkipListHighlight||x.type.muiSkipListHighlight)&&(v+=1,v>=a.length&&(v=-1))});const y=M.Children.map(a,(x,b)=>{if(b===v){const _={};return o&&(_.autoFocus=!0),x.props.tabIndex===void 0&&f==="selectedMenu"&&(_.tabIndex=0),M.cloneElement(x,_)}return x});return w.jsx(FM,j({role:"menu",ref:g,className:s,onKeyDown:m,tabIndex:i?0:-1},d,{children:y}))}),Zre=wIe;function SIe(t){return We("MuiPopover",t)}Ve("MuiPopover",["root","paper"]);const OIe=["onEntering"],CIe=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],TIe=["slotProps"];function b8(t,e){let n=0;return typeof e=="number"?n=e:e==="center"?n=t.height/2:e==="bottom"&&(n=t.height),n}function _8(t,e){let n=0;return typeof e=="number"?n=e:e==="center"?n=t.width/2:e==="right"&&(n=t.width),n}function w8(t){return[t.horizontal,t.vertical].map(e=>typeof e=="number"?`${e}px`:e).join(" ")}function wA(t){return typeof t=="function"?t():t}const EIe=t=>{const{classes:e}=t;return Ue({root:["root"],paper:["paper"]},SIe,e)},PIe=we(Fre,{name:"MuiPopover",slot:"Root",overridesResolver:(t,e)=>e.root})({}),Jre=we(Go,{name:"MuiPopover",slot:"Paper",overridesResolver:(t,e)=>e.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),MIe=M.forwardRef(function(e,n){var r,i,o;const a=qe({props:e,name:"MuiPopover"}),{action:s,anchorEl:l,anchorOrigin:c={vertical:"top",horizontal:"left"},anchorPosition:u,anchorReference:f="anchorEl",children:d,className:h,container:p,elevation:m=8,marginThreshold:g=16,open:v,PaperProps:y={},slots:x,slotProps:b,transformOrigin:_={vertical:"top",horizontal:"left"},TransitionComponent:S=Rb,transitionDuration:O="auto",TransitionProps:{onEntering:C}={},disableScrollLock:E=!1}=a,k=Ae(a.TransitionProps,OIe),I=Ae(a,CIe),P=(r=b==null?void 0:b.paper)!=null?r:y,R=M.useRef(),T=Zt(R,P.ref),L=j({},a,{anchorOrigin:c,anchorReference:f,elevation:m,marginThreshold:g,externalPaperSlotProps:P,transformOrigin:_,TransitionComponent:S,transitionDuration:O,TransitionProps:k}),z=EIe(L),B=M.useCallback(()=>{if(f==="anchorPosition")return u;const ve=wA(l),ce=(ve&&ve.nodeType===1?ve:$n(R.current).body).getBoundingClientRect();return{top:ce.top+b8(ce,c.vertical),left:ce.left+_8(ce,c.horizontal)}},[l,c.horizontal,c.vertical,u,f]),W=M.useCallback(ve=>({vertical:b8(ve,_.vertical),horizontal:_8(ve,_.horizontal)}),[_.horizontal,_.vertical]),U=M.useCallback(ve=>{const F={width:ve.offsetWidth,height:ve.offsetHeight},ce=W(F);if(f==="none")return{top:null,left:null,transformOrigin:w8(ce)};const le=B();let Q=le.top-ce.vertical,X=le.left-ce.horizontal;const ee=Q+F.height,ge=X+F.width,ye=ls(wA(l)),H=ye.innerHeight-g,G=ye.innerWidth-g;if(g!==null&&QH){const ie=ee-H;Q-=ie,ce.vertical+=ie}if(g!==null&&XG){const ie=ge-G;X-=ie,ce.horizontal+=ie}return{top:`${Math.round(Q)}px`,left:`${Math.round(X)}px`,transformOrigin:w8(ce)}},[l,f,B,W,g]),[N,$]=M.useState(v),D=M.useCallback(()=>{const ve=R.current;if(!ve)return;const F=U(ve);F.top!==null&&(ve.style.top=F.top),F.left!==null&&(ve.style.left=F.left),ve.style.transformOrigin=F.transformOrigin,$(!0)},[U]);M.useEffect(()=>(E&&window.addEventListener("scroll",D),()=>window.removeEventListener("scroll",D)),[l,E,D]);const A=(ve,F)=>{C&&C(ve,F),D()},q=()=>{$(!1)};M.useEffect(()=>{v&&D()}),M.useImperativeHandle(s,()=>v?{updatePosition:()=>{D()}}:null,[v,D]),M.useEffect(()=>{if(!v)return;const ve=Hv(()=>{D()}),F=ls(l);return F.addEventListener("resize",ve),()=>{ve.clear(),F.removeEventListener("resize",ve)}},[l,v,D]);let Y=O;O==="auto"&&!S.muiSupportAuto&&(Y=void 0);const K=p||(l?$n(wA(l)).body:void 0),se=(i=x==null?void 0:x.root)!=null?i:PIe,te=(o=x==null?void 0:x.paper)!=null?o:Jre,J=Lr({elementType:te,externalSlotProps:j({},P,{style:N?P.style:j({},P.style,{opacity:0})}),additionalProps:{elevation:m,ref:T},ownerState:L,className:ke(z.paper,P==null?void 0:P.className)}),pe=Lr({elementType:se,externalSlotProps:(b==null?void 0:b.root)||{},externalForwardedProps:I,additionalProps:{ref:n,slotProps:{backdrop:{invisible:!0}},container:K,open:v},ownerState:L,className:ke(z.root,h)}),{slotProps:be}=pe,re=Ae(pe,TIe);return w.jsx(se,j({},re,!zl(se)&&{slotProps:be,disableScrollLock:E},{children:w.jsx(S,j({appear:!0,in:v,onEntering:A,onExited:q,timeout:Y},k,{children:w.jsx(te,j({},J,{children:d}))}))}))}),bp=MIe;function kIe(t){return We("MuiMenu",t)}Ve("MuiMenu",["root","paper","list"]);const AIe=["onEntering"],RIe=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],IIe={vertical:"top",horizontal:"right"},DIe={vertical:"top",horizontal:"left"},LIe=t=>{const{classes:e}=t;return Ue({root:["root"],paper:["paper"],list:["list"]},kIe,e)},$Ie=we(bp,{shouldForwardProp:t=>di(t)||t==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(t,e)=>e.root})({}),NIe=we(Jre,{name:"MuiMenu",slot:"Paper",overridesResolver:(t,e)=>e.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),FIe=we(Zre,{name:"MuiMenu",slot:"List",overridesResolver:(t,e)=>e.list})({outline:0}),jIe=M.forwardRef(function(e,n){var r,i;const o=qe({props:e,name:"MuiMenu"}),{autoFocus:a=!0,children:s,className:l,disableAutoFocusItem:c=!1,MenuListProps:u={},onClose:f,open:d,PaperProps:h={},PopoverClasses:p,transitionDuration:m="auto",TransitionProps:{onEntering:g}={},variant:v="selectedMenu",slots:y={},slotProps:x={}}=o,b=Ae(o.TransitionProps,AIe),_=Ae(o,RIe),S=T1(),O=j({},o,{autoFocus:a,disableAutoFocusItem:c,MenuListProps:u,onEntering:g,PaperProps:h,transitionDuration:m,TransitionProps:b,variant:v}),C=LIe(O),E=a&&!c&&d,k=M.useRef(null),I=(W,U)=>{k.current&&k.current.adjustStyleForScrollbar(W,{direction:S?"rtl":"ltr"}),g&&g(W,U)},P=W=>{W.key==="Tab"&&(W.preventDefault(),f&&f(W,"tabKeyDown"))};let R=-1;M.Children.map(s,(W,U)=>{M.isValidElement(W)&&(W.props.disabled||(v==="selectedMenu"&&W.props.selected||R===-1)&&(R=U))});const T=(r=y.paper)!=null?r:NIe,L=(i=x.paper)!=null?i:h,z=Lr({elementType:y.root,externalSlotProps:x.root,ownerState:O,className:[C.root,l]}),B=Lr({elementType:T,externalSlotProps:L,ownerState:O,className:C.paper});return w.jsx($Ie,j({onClose:f,anchorOrigin:{vertical:"bottom",horizontal:S?"right":"left"},transformOrigin:S?IIe:DIe,slots:{paper:T,root:y.root},slotProps:{root:z,paper:B},open:d,ref:n,transitionDuration:m,TransitionProps:j({onEntering:I},b),ownerState:O},_,{classes:p,children:w.jsx(FIe,j({onKeyDown:P,actions:k,autoFocus:a&&(R===-1||c),autoFocusItem:E,variant:v},u,{className:ke(C.list,u.className),children:s}))}))}),_p=jIe;function BIe(t){return We("MuiMenuItem",t)}const zIe=Ve("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),d0=zIe,UIe=["autoFocus","component","dense","divider","disableGutters","focusVisibleClassName","role","tabIndex","className"],WIe=(t,e)=>{const{ownerState:n}=t;return[e.root,n.dense&&e.dense,n.divider&&e.divider,!n.disableGutters&&e.gutters]},VIe=t=>{const{disabled:e,dense:n,divider:r,disableGutters:i,selected:o,classes:a}=t,l=Ue({root:["root",n&&"dense",e&&"disabled",!i&&"gutters",r&&"divider",o&&"selected"]},BIe,a);return j({},a,l)},GIe=we(us,{shouldForwardProp:t=>di(t)||t==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:WIe})(({theme:t,ownerState:e})=>j({},t.typography.body1,{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap"},!e.disableGutters&&{paddingLeft:16,paddingRight:16},e.divider&&{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"},{"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${d0.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${d0.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:kt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${d0.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:kt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.primary.main,t.palette.action.selectedOpacity)}},[`&.${d0.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${d0.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity},[`& + .${d8.root}`]:{marginTop:t.spacing(1),marginBottom:t.spacing(1)},[`& + .${d8.inset}`]:{marginLeft:52},[`& .${ET.root}`]:{marginTop:0,marginBottom:0},[`& .${ET.inset}`]:{paddingLeft:36},[`& .${y8.root}`]:{minWidth:36}},!e.dense&&{[t.breakpoints.up("sm")]:{minHeight:"auto"}},e.dense&&j({minHeight:32,paddingTop:4,paddingBottom:4},t.typography.body2,{[`& .${y8.root} svg`]:{fontSize:"1.25rem"}}))),HIe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiMenuItem"}),{autoFocus:i=!1,component:o="li",dense:a=!1,divider:s=!1,disableGutters:l=!1,focusVisibleClassName:c,role:u="menuitem",tabIndex:f,className:d}=r,h=Ae(r,UIe),p=M.useContext(Gs),m=M.useMemo(()=>({dense:a||p.dense||!1,disableGutters:l}),[p.dense,a,l]),g=M.useRef(null);Vr(()=>{i&&g.current&&g.current.focus()},[i]);const v=j({},r,{dense:m.dense,divider:s,disableGutters:l}),y=VIe(r),x=Zt(g,n);let b;return r.disabled||(b=f!==void 0?f:-1),w.jsx(Gs.Provider,{value:m,children:w.jsx(GIe,j({ref:x,role:u,tabIndex:b,component:o,focusVisibleClassName:ke(y.focusVisible,c),className:ke(y.root,d)},h,{ownerState:v,classes:y}))})}),Nr=HIe;function qIe(t){return We("MuiNativeSelect",t)}const XIe=Ve("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),p5=XIe,QIe=["className","disabled","error","IconComponent","inputRef","variant"],YIe=t=>{const{classes:e,variant:n,disabled:r,multiple:i,open:o,error:a}=t,s={select:["select",n,r&&"disabled",i&&"multiple",a&&"error"],icon:["icon",`icon${De(n)}`,o&&"iconOpen",r&&"disabled"]};return Ue(s,qIe,e)},eie=({ownerState:t,theme:e})=>j({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":j({},e.vars?{backgroundColor:`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.05)`}:{backgroundColor:e.palette.mode==="light"?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)"},{borderRadius:0}),"&::-ms-expand":{display:"none"},[`&.${p5.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(e.vars||e).palette.background.paper},"&&&":{paddingRight:24,minWidth:16}},t.variant==="filled"&&{"&&&":{paddingRight:32}},t.variant==="outlined"&&{borderRadius:(e.vars||e).shape.borderRadius,"&:focus":{borderRadius:(e.vars||e).shape.borderRadius},"&&&":{paddingRight:32}}),KIe=we("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:di,overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.select,e[n.variant],n.error&&e.error,{[`&.${p5.multiple}`]:e.multiple}]}})(eie),tie=({ownerState:t,theme:e})=>j({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(e.vars||e).palette.action.active,[`&.${p5.disabled}`]:{color:(e.vars||e).palette.action.disabled}},t.open&&{transform:"rotate(180deg)"},t.variant==="filled"&&{right:7},t.variant==="outlined"&&{right:7}),ZIe=we("svg",{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.icon,n.variant&&e[`icon${De(n.variant)}`],n.open&&e.iconOpen]}})(tie),JIe=M.forwardRef(function(e,n){const{className:r,disabled:i,error:o,IconComponent:a,inputRef:s,variant:l="standard"}=e,c=Ae(e,QIe),u=j({},e,{disabled:i,variant:l,error:o}),f=YIe(u);return w.jsxs(M.Fragment,{children:[w.jsx(KIe,j({ownerState:u,className:ke(f.select,r),disabled:i,ref:s||n},c)),e.multiple?null:w.jsx(ZIe,{as:a,ownerState:u,className:f.icon})]})}),eDe=JIe;var S8;const tDe=["children","classes","className","label","notched"],nDe=we("fieldset",{shouldForwardProp:di})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),rDe=we("legend",{shouldForwardProp:di})(({ownerState:t,theme:e})=>j({float:"unset",width:"auto",overflow:"hidden"},!t.withLabel&&{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})},t.withLabel&&j({display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}},t.notched&&{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})})));function iDe(t){const{className:e,label:n,notched:r}=t,i=Ae(t,tDe),o=n!=null&&n!=="",a=j({},t,{notched:r,withLabel:o});return w.jsx(nDe,j({"aria-hidden":!0,className:e,ownerState:a},i,{children:w.jsx(rDe,{ownerState:a,children:o?w.jsx("span",{children:n}):S8||(S8=w.jsx("span",{className:"notranslate",children:"​"}))})}))}const oDe=["components","fullWidth","inputComponent","label","multiline","notched","slots","type"],aDe=t=>{const{classes:e}=t,r=Ue({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},yMe,e);return j({},e,r)},sDe=we(DM,{shouldForwardProp:t=>di(t)||t==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:RM})(({theme:t,ownerState:e})=>{const n=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return j({position:"relative",borderRadius:(t.vars||t).shape.borderRadius,[`&:hover .${Tu.notchedOutline}`]:{borderColor:(t.vars||t).palette.text.primary},"@media (hover: none)":{[`&:hover .${Tu.notchedOutline}`]:{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:n}},[`&.${Tu.focused} .${Tu.notchedOutline}`]:{borderColor:(t.vars||t).palette[e.color].main,borderWidth:2},[`&.${Tu.error} .${Tu.notchedOutline}`]:{borderColor:(t.vars||t).palette.error.main},[`&.${Tu.disabled} .${Tu.notchedOutline}`]:{borderColor:(t.vars||t).palette.action.disabled}},e.startAdornment&&{paddingLeft:14},e.endAdornment&&{paddingRight:14},e.multiline&&j({padding:"16.5px 14px"},e.size==="small"&&{padding:"8.5px 14px"}))}),lDe=we(iDe,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(t,e)=>e.notchedOutline})(({theme:t})=>{const e=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:e}}),cDe=we(LM,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:IM})(({theme:t,ownerState:e})=>j({padding:"16.5px 14px"},!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:t.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:t.palette.mode==="light"?null:"#fff",caretColor:t.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},t.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},e.size==="small"&&{padding:"8.5px 14px"},e.multiline&&{padding:0},e.startAdornment&&{paddingLeft:0},e.endAdornment&&{paddingRight:0})),nie=M.forwardRef(function(e,n){var r,i,o,a,s;const l=qe({props:e,name:"MuiOutlinedInput"}),{components:c={},fullWidth:u=!1,inputComponent:f="input",label:d,multiline:h=!1,notched:p,slots:m={},type:g="text"}=l,v=Ae(l,oDe),y=aDe(l),x=nc(),b=fd({props:l,muiFormControl:x,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),_=j({},l,{color:b.color||"primary",disabled:b.disabled,error:b.error,focused:b.focused,formControl:x,fullWidth:u,hiddenLabel:b.hiddenLabel,multiline:h,size:b.size,type:g}),S=(r=(i=m.root)!=null?i:c.Root)!=null?r:sDe,O=(o=(a=m.input)!=null?a:c.Input)!=null?o:cDe;return w.jsx(d5,j({slots:{root:S,input:O},renderSuffix:C=>w.jsx(lDe,{ownerState:_,className:y.notchedOutline,label:d!=null&&d!==""&&b.required?s||(s=w.jsxs(M.Fragment,{children:[d," ","*"]})):d,notched:typeof p<"u"?p:!!(C.startAdornment||C.filled||C.focused)}),fullWidth:u,inputComponent:f,multiline:h,ref:n,type:g},v,{classes:j({},y,{notchedOutline:null})}))});nie.muiName="Input";const rie=nie,uDe=ti(w.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"RadioButtonUnchecked"),fDe=ti(w.jsx("path",{d:"M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"}),"RadioButtonChecked"),dDe=we("span",{shouldForwardProp:di})({position:"relative",display:"flex"}),hDe=we(uDe)({transform:"scale(1)"}),pDe=we(fDe)(({theme:t,ownerState:e})=>j({left:0,position:"absolute",transform:"scale(0)",transition:t.transitions.create("transform",{easing:t.transitions.easing.easeIn,duration:t.transitions.duration.shortest})},e.checked&&{transform:"scale(1)",transition:t.transitions.create("transform",{easing:t.transitions.easing.easeOut,duration:t.transitions.duration.shortest})}));function iie(t){const{checked:e=!1,classes:n={},fontSize:r}=t,i=j({},t,{checked:e});return w.jsxs(dDe,{className:n.root,ownerState:i,children:[w.jsx(hDe,{fontSize:r,className:n.background,ownerState:i}),w.jsx(pDe,{fontSize:r,className:n.dot,ownerState:i})]})}const mDe=M.createContext(void 0),oie=mDe;function gDe(){return M.useContext(oie)}function vDe(t){return We("MuiRadio",t)}const O8=Ve("MuiRadio",["root","checked","disabled","colorPrimary","colorSecondary","sizeSmall"]),yDe=["checked","checkedIcon","color","icon","name","onChange","size","className"],xDe=t=>{const{classes:e,color:n,size:r}=t,i={root:["root",`color${De(n)}`,r!=="medium"&&`size${De(r)}`]};return j({},e,Ue(i,vDe,e))},bDe=we(h5,{shouldForwardProp:t=>di(t)||t==="classes",name:"MuiRadio",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.size!=="medium"&&e[`size${De(n.size)}`],e[`color${De(n.color)}`]]}})(({theme:t,ownerState:e})=>j({color:(t.vars||t).palette.text.secondary},!e.disableRipple&&{"&:hover":{backgroundColor:t.vars?`rgba(${e.color==="default"?t.vars.palette.action.activeChannel:t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(e.color==="default"?t.palette.action.active:t.palette[e.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},e.color!=="default"&&{[`&.${O8.checked}`]:{color:(t.vars||t).palette[e.color].main}},{[`&.${O8.disabled}`]:{color:(t.vars||t).palette.action.disabled}}));function _De(t,e){return typeof e=="object"&&e!==null?t===e:String(t)===String(e)}const C8=w.jsx(iie,{checked:!0}),T8=w.jsx(iie,{}),wDe=M.forwardRef(function(e,n){var r,i;const o=qe({props:e,name:"MuiRadio"}),{checked:a,checkedIcon:s=C8,color:l="primary",icon:c=T8,name:u,onChange:f,size:d="medium",className:h}=o,p=Ae(o,yDe),m=j({},o,{color:l,size:d}),g=xDe(m),v=gDe();let y=a;const x=yT(f,v&&v.onChange);let b=u;return v&&(typeof y>"u"&&(y=_De(v.value,o.value)),typeof b>"u"&&(b=v.name)),w.jsx(bDe,j({type:"radio",icon:M.cloneElement(c,{fontSize:(r=T8.props.fontSize)!=null?r:d}),checkedIcon:M.cloneElement(s,{fontSize:(i=C8.props.fontSize)!=null?i:d}),ownerState:m,classes:g,name:b,checked:y,onChange:x,ref:n,className:ke(g.root,h)},p))}),Bx=wDe;function SDe(t){return We("MuiRadioGroup",t)}Ve("MuiRadioGroup",["root","row","error"]);const ODe=["actions","children","className","defaultValue","name","onChange","value"],CDe=t=>{const{classes:e,row:n,error:r}=t;return Ue({root:["root",n&&"row",r&&"error"]},SDe,e)},TDe=M.forwardRef(function(e,n){const{actions:r,children:i,className:o,defaultValue:a,name:s,onChange:l,value:c}=e,u=Ae(e,ODe),f=M.useRef(null),d=CDe(e),[h,p]=Hs({controlled:c,default:a,name:"RadioGroup"});M.useImperativeHandle(r,()=>({focus:()=>{let y=f.current.querySelector("input:not(:disabled):checked");y||(y=f.current.querySelector("input:not(:disabled)")),y&&y.focus()}}),[]);const m=Zt(n,f),g=cd(s),v=M.useMemo(()=>({name:g,onChange(y){p(y.target.value),l&&l(y,y.target.value)},value:h}),[g,l,p,h]);return w.jsx(oie.Provider,{value:v,children:w.jsx(RAe,j({role:"radiogroup",ref:m,className:ke(d.root,o)},u,{children:i}))})}),m5=TDe;function EDe(t){return We("MuiSelect",t)}const h0=Ve("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var E8;const PDe=["aria-describedby","aria-label","autoFocus","autoWidth","children","className","defaultOpen","defaultValue","disabled","displayEmpty","error","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"],MDe=we("div",{name:"MuiSelect",slot:"Select",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`&.${h0.select}`]:e.select},{[`&.${h0.select}`]:e[n.variant]},{[`&.${h0.error}`]:e.error},{[`&.${h0.multiple}`]:e.multiple}]}})(eie,{[`&.${h0.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),kDe=we("svg",{name:"MuiSelect",slot:"Icon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.icon,n.variant&&e[`icon${De(n.variant)}`],n.open&&e.iconOpen]}})(tie),ADe=we("input",{shouldForwardProp:t=>PM(t)&&t!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(t,e)=>e.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function P8(t,e){return typeof e=="object"&&e!==null?t===e:String(t)===String(e)}function RDe(t){return t==null||typeof t=="string"&&!t.trim()}const IDe=t=>{const{classes:e,variant:n,disabled:r,multiple:i,open:o,error:a}=t,s={select:["select",n,r&&"disabled",i&&"multiple",a&&"error"],icon:["icon",`icon${De(n)}`,o&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return Ue(s,EDe,e)},DDe=M.forwardRef(function(e,n){var r;const{"aria-describedby":i,"aria-label":o,autoFocus:a,autoWidth:s,children:l,className:c,defaultOpen:u,defaultValue:f,disabled:d,displayEmpty:h,error:p=!1,IconComponent:m,inputRef:g,labelId:v,MenuProps:y={},multiple:x,name:b,onBlur:_,onChange:S,onClose:O,onFocus:C,onOpen:E,open:k,readOnly:I,renderValue:P,SelectDisplayProps:R={},tabIndex:T,value:L,variant:z="standard"}=e,B=Ae(e,PDe),[W,U]=Hs({controlled:L,default:f,name:"Select"}),[N,$]=Hs({controlled:k,default:u,name:"Select"}),D=M.useRef(null),A=M.useRef(null),[q,Y]=M.useState(null),{current:K}=M.useRef(k!=null),[se,te]=M.useState(),J=Zt(n,g),pe=M.useCallback(me=>{A.current=me,me&&Y(me)},[]),be=q==null?void 0:q.parentNode;M.useImperativeHandle(J,()=>({focus:()=>{A.current.focus()},node:D.current,value:W}),[W]),M.useEffect(()=>{u&&N&&q&&!K&&(te(s?null:be.clientWidth),A.current.focus())},[q,s]),M.useEffect(()=>{a&&A.current.focus()},[a]),M.useEffect(()=>{if(!v)return;const me=$n(A.current).getElementById(v);if(me){const Ne=()=>{getSelection().isCollapsed&&A.current.focus()};return me.addEventListener("click",Ne),()=>{me.removeEventListener("click",Ne)}}},[v]);const re=(me,Ne)=>{me?E&&E(Ne):O&&O(Ne),K||(te(s?null:be.clientWidth),$(me))},ve=me=>{me.button===0&&(me.preventDefault(),A.current.focus(),re(!0,me))},F=me=>{re(!1,me)},ce=M.Children.toArray(l),le=me=>{const Ne=ce.find(Ce=>Ce.props.value===me.target.value);Ne!==void 0&&(U(Ne.props.value),S&&S(me,Ne))},Q=me=>Ne=>{let Ce;if(Ne.currentTarget.hasAttribute("tabindex")){if(x){Ce=Array.isArray(W)?W.slice():[];const Re=W.indexOf(me.props.value);Re===-1?Ce.push(me.props.value):Ce.splice(Re,1)}else Ce=me.props.value;if(me.props.onClick&&me.props.onClick(Ne),W!==Ce&&(U(Ce),S)){const Re=Ne.nativeEvent||Ne,ae=new Re.constructor(Re.type,Re);Object.defineProperty(ae,"target",{writable:!0,value:{value:Ce,name:b}}),S(ae,me)}x||re(!1,Ne)}},X=me=>{I||[" ","ArrowUp","ArrowDown","Enter"].indexOf(me.key)!==-1&&(me.preventDefault(),re(!0,me))},ee=q!==null&&N,ge=me=>{!ee&&_&&(Object.defineProperty(me,"target",{writable:!0,value:{value:W,name:b}}),_(me))};delete B["aria-invalid"];let ye,H;const G=[];let ie=!1;(CT({value:W})||h)&&(P?ye=P(W):ie=!0);const he=ce.map(me=>{if(!M.isValidElement(me))return null;let Ne;if(x){if(!Array.isArray(W))throw new Error(su(2));Ne=W.some(Ce=>P8(Ce,me.props.value)),Ne&&ie&&G.push(me.props.children)}else Ne=P8(W,me.props.value),Ne&&ie&&(H=me.props.children);return M.cloneElement(me,{"aria-selected":Ne?"true":"false",onClick:Q(me),onKeyUp:Ce=>{Ce.key===" "&&Ce.preventDefault(),me.props.onKeyUp&&me.props.onKeyUp(Ce)},role:"option",selected:Ne,value:void 0,"data-value":me.props.value})});ie&&(x?G.length===0?ye=null:ye=G.reduce((me,Ne,Ce)=>(me.push(Ne),Ce{const{classes:e}=t;return e},g5={name:"MuiSelect",overridesResolver:(t,e)=>e.root,shouldForwardProp:t=>di(t)&&t!=="variant",slot:"Root"},jDe=we(xp,g5)(""),BDe=we(rie,g5)(""),zDe=we(Ure,g5)(""),aie=M.forwardRef(function(e,n){const r=qe({name:"MuiSelect",props:e}),{autoWidth:i=!1,children:o,classes:a={},className:s,defaultOpen:l=!1,displayEmpty:c=!1,IconComponent:u=wMe,id:f,input:d,inputProps:h,label:p,labelId:m,MenuProps:g,multiple:v=!1,native:y=!1,onClose:x,onOpen:b,open:_,renderValue:S,SelectDisplayProps:O,variant:C="outlined"}=r,E=Ae(r,$De),k=y?eDe:LDe,I=nc(),P=fd({props:r,muiFormControl:I,states:["variant","error"]}),R=P.variant||C,T=j({},r,{variant:R,classes:a}),L=FDe(T),z=Ae(L,NDe),B=d||{standard:w.jsx(jDe,{ownerState:T}),outlined:w.jsx(BDe,{label:p,ownerState:T}),filled:w.jsx(zDe,{ownerState:T})}[R],W=Zt(n,B.ref);return w.jsx(M.Fragment,{children:M.cloneElement(B,j({inputComponent:k,inputProps:j({children:o,error:P.error,IconComponent:u,variant:R,type:void 0,multiple:v},y?{id:f}:{autoWidth:i,defaultOpen:l,displayEmpty:c,labelId:m,MenuProps:g,onClose:x,onOpen:b,open:_,renderValue:S,SelectDisplayProps:j({id:f},O)},h,{classes:h?Ii(z,h.classes):z},d?d.props.inputProps:{})},(v&&y||c)&&R==="outlined"?{notched:!0}:{},{ref:W,className:ke(B.props.className,s,L.root)},!d&&{variant:R},E))})});aie.muiName="Select";const wp=aie,UDe=t=>!t||!zl(t);function WDe(t){return We("MuiSlider",t)}const VDe=Ve("MuiSlider",["root","active","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","disabled","dragging","focusVisible","mark","markActive","marked","markLabel","markLabelActive","rail","sizeSmall","thumb","thumbColorPrimary","thumbColorSecondary","thumbColorError","thumbColorSuccess","thumbColorInfo","thumbColorWarning","track","trackInverted","trackFalse","thumbSizeSmall","valueLabel","valueLabelOpen","valueLabelCircle","valueLabelLabel","vertical"]),qa=VDe,GDe=t=>{const{open:e}=t;return{offset:ke(e&&qa.valueLabelOpen),circle:qa.valueLabelCircle,label:qa.valueLabelLabel}};function HDe(t){const{children:e,className:n,value:r}=t,i=GDe(t);return e?M.cloneElement(e,{className:ke(e.props.className)},w.jsxs(M.Fragment,{children:[e.props.children,w.jsx("span",{className:ke(i.offset,n),"aria-hidden":!0,children:w.jsx("span",{className:i.circle,children:w.jsx("span",{className:i.label,children:r})})})]})):null}const qDe=["aria-label","aria-valuetext","aria-labelledby","component","components","componentsProps","color","classes","className","disableSwap","disabled","getAriaLabel","getAriaValueText","marks","max","min","name","onChange","onChangeCommitted","orientation","shiftStep","size","step","scale","slotProps","slots","tabIndex","track","value","valueLabelDisplay","valueLabelFormat"],XDe=Kj();function M8(t){return t}const QDe=we("span",{name:"MuiSlider",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`color${De(n.color)}`],n.size!=="medium"&&e[`size${De(n.size)}`],n.marked&&e.marked,n.orientation==="vertical"&&e.vertical,n.track==="inverted"&&e.trackInverted,n.track===!1&&e.trackFalse]}})(({theme:t})=>{var e;return{borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",WebkitTapHighlightColor:"transparent","@media print":{colorAdjust:"exact"},[`&.${qa.disabled}`]:{pointerEvents:"none",cursor:"default",color:(t.vars||t).palette.grey[400]},[`&.${qa.dragging}`]:{[`& .${qa.thumb}, & .${qa.track}`]:{transition:"none"}},variants:[...Object.keys(((e=t.vars)!=null?e:t).palette).filter(n=>{var r;return((r=t.vars)!=null?r:t).palette[n].main}).map(n=>({props:{color:n},style:{color:(t.vars||t).palette[n].main}})),{props:{orientation:"horizontal"},style:{height:4,width:"100%",padding:"13px 0","@media (pointer: coarse)":{padding:"20px 0"}}},{props:{orientation:"horizontal",size:"small"},style:{height:2}},{props:{orientation:"horizontal",marked:!0},style:{marginBottom:20}},{props:{orientation:"vertical"},style:{height:"100%",width:4,padding:"0 13px","@media (pointer: coarse)":{padding:"0 20px"}}},{props:{orientation:"vertical",size:"small"},style:{width:2}},{props:{orientation:"vertical",marked:!0},style:{marginRight:44}}]}}),YDe=we("span",{name:"MuiSlider",slot:"Rail",overridesResolver:(t,e)=>e.rail})({display:"block",position:"absolute",borderRadius:"inherit",backgroundColor:"currentColor",opacity:.38,variants:[{props:{orientation:"horizontal"},style:{width:"100%",height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{height:"100%",width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:"inverted"},style:{opacity:1}}]}),KDe=we("span",{name:"MuiSlider",slot:"Track",overridesResolver:(t,e)=>e.track})(({theme:t})=>{var e;return{display:"block",position:"absolute",borderRadius:"inherit",border:"1px solid currentColor",backgroundColor:"currentColor",transition:t.transitions.create(["left","width","bottom","height"],{duration:t.transitions.duration.shortest}),variants:[{props:{size:"small"},style:{border:"none"}},{props:{orientation:"horizontal"},style:{height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:!1},style:{display:"none"}},...Object.keys(((e=t.vars)!=null?e:t).palette).filter(n=>{var r;return((r=t.vars)!=null?r:t).palette[n].main}).map(n=>({props:{color:n,track:"inverted"},style:j({},t.vars?{backgroundColor:t.vars.palette.Slider[`${n}Track`],borderColor:t.vars.palette.Slider[`${n}Track`]}:j({backgroundColor:Pb(t.palette[n].main,.62),borderColor:Pb(t.palette[n].main,.62)},t.applyStyles("dark",{backgroundColor:Eb(t.palette[n].main,.5)}),t.applyStyles("dark",{borderColor:Eb(t.palette[n].main,.5)})))}))]}}),ZDe=we("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.thumb,e[`thumbColor${De(n.color)}`],n.size!=="medium"&&e[`thumbSize${De(n.size)}`]]}})(({theme:t})=>{var e;return{position:"absolute",width:20,height:20,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:t.transitions.create(["box-shadow","left","bottom"],{duration:t.transitions.duration.shortest}),"&::before":{position:"absolute",content:'""',borderRadius:"inherit",width:"100%",height:"100%",boxShadow:(t.vars||t).shadows[2]},"&::after":{position:"absolute",content:'""',borderRadius:"50%",width:42,height:42,top:"50%",left:"50%",transform:"translate(-50%, -50%)"},[`&.${qa.disabled}`]:{"&:hover":{boxShadow:"none"}},variants:[...Object.keys(((e=t.vars)!=null?e:t).palette).filter(n=>{var r;return((r=t.vars)!=null?r:t).palette[n].main}).map(n=>({props:{color:n},style:{[`&:hover, &.${qa.focusVisible}`]:j({},t.vars?{boxShadow:`0px 0px 0px 8px rgba(${t.vars.palette[n].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 8px ${kt(t.palette[n].main,.16)}`},{"@media (hover: none)":{boxShadow:"none"}}),[`&.${qa.active}`]:j({},t.vars?{boxShadow:`0px 0px 0px 14px rgba(${t.vars.palette[n].mainChannel} / 0.16)}`}:{boxShadow:`0px 0px 0px 14px ${kt(t.palette[n].main,.16)}`})}})),{props:{size:"small"},style:{width:12,height:12,"&::before":{boxShadow:"none"}}},{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-50%, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 50%)"}}]}}),JDe=we(HDe,{name:"MuiSlider",slot:"ValueLabel",overridesResolver:(t,e)=>e.valueLabel})(({theme:t})=>j({zIndex:1,whiteSpace:"nowrap"},t.typography.body2,{fontWeight:500,transition:t.transitions.create(["transform"],{duration:t.transitions.duration.shortest}),position:"absolute",backgroundColor:(t.vars||t).palette.grey[600],borderRadius:2,color:(t.vars||t).palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",padding:"0.25rem 0.75rem",variants:[{props:{orientation:"horizontal"},style:{transform:"translateY(-100%) scale(0)",top:"-10px",transformOrigin:"bottom center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, 50%) rotate(45deg)",backgroundColor:"inherit",bottom:0,left:"50%"},[`&.${qa.valueLabelOpen}`]:{transform:"translateY(-100%) scale(1)"}}},{props:{orientation:"vertical"},style:{transform:"translateY(-50%) scale(0)",right:"30px",top:"50%",transformOrigin:"right center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, -50%) rotate(45deg)",backgroundColor:"inherit",right:-8,top:"50%"},[`&.${qa.valueLabelOpen}`]:{transform:"translateY(-50%) scale(1)"}}},{props:{size:"small"},style:{fontSize:t.typography.pxToRem(12),padding:"0.25rem 0.5rem"}},{props:{orientation:"vertical",size:"small"},style:{right:"20px"}}]})),eLe=we("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:t=>PM(t)&&t!=="markActive",overridesResolver:(t,e)=>{const{markActive:n}=t;return[e.mark,n&&e.markActive]}})(({theme:t})=>({position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor",variants:[{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-1px, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 1px)"}},{props:{markActive:!0},style:{backgroundColor:(t.vars||t).palette.background.paper,opacity:.8}}]})),tLe=we("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:t=>PM(t)&&t!=="markLabelActive",overridesResolver:(t,e)=>e.markLabel})(({theme:t})=>j({},t.typography.body2,{color:(t.vars||t).palette.text.secondary,position:"absolute",whiteSpace:"nowrap",variants:[{props:{orientation:"horizontal"},style:{top:30,transform:"translateX(-50%)","@media (pointer: coarse)":{top:40}}},{props:{orientation:"vertical"},style:{left:36,transform:"translateY(50%)","@media (pointer: coarse)":{left:44}}},{props:{markLabelActive:!0},style:{color:(t.vars||t).palette.text.primary}}]})),nLe=t=>{const{disabled:e,dragging:n,marked:r,orientation:i,track:o,classes:a,color:s,size:l}=t,c={root:["root",e&&"disabled",n&&"dragging",r&&"marked",i==="vertical"&&"vertical",o==="inverted"&&"trackInverted",o===!1&&"trackFalse",s&&`color${De(s)}`,l&&`size${De(l)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",e&&"disabled",l&&`thumbSize${De(l)}`,s&&`thumbColor${De(s)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return Ue(c,WDe,a)},rLe=({children:t})=>t,iLe=M.forwardRef(function(e,n){var r,i,o,a,s,l,c,u,f,d,h,p,m,g,v,y,x,b,_,S,O,C,E,k;const I=XDe({props:e,name:"MuiSlider"}),P=T1(),{"aria-label":R,"aria-valuetext":T,"aria-labelledby":L,component:z="span",components:B={},componentsProps:W={},color:U="primary",classes:N,className:$,disableSwap:D=!1,disabled:A=!1,getAriaLabel:q,getAriaValueText:Y,marks:K=!1,max:se=100,min:te=0,orientation:J="horizontal",shiftStep:pe=10,size:be="medium",step:re=1,scale:ve=M8,slotProps:F,slots:ce,track:le="normal",valueLabelDisplay:Q="off",valueLabelFormat:X=M8}=I,ee=Ae(I,qDe),ge=j({},I,{isRtl:P,max:se,min:te,classes:N,disabled:A,disableSwap:D,orientation:J,marks:K,color:U,size:be,step:re,shiftStep:pe,scale:ve,track:le,valueLabelDisplay:Q,valueLabelFormat:X}),{axisProps:ye,getRootProps:H,getHiddenInputProps:G,getThumbProps:ie,open:he,active:_e,axis:oe,focusedThumbIndex:Z,range:V,dragging:de,marks:xe,values:Me,trackOffset:me,trackLeap:Ne,getThumbStyle:Ce}=jPe(j({},ge,{rootRef:n}));ge.marked=xe.length>0&&xe.some(Ze=>Ze.label),ge.dragging=de,ge.focusedThumbIndex=Z;const Re=nLe(ge),ae=(r=(i=ce==null?void 0:ce.root)!=null?i:B.Root)!=null?r:QDe,Le=(o=(a=ce==null?void 0:ce.rail)!=null?a:B.Rail)!=null?o:YDe,Ee=(s=(l=ce==null?void 0:ce.track)!=null?l:B.Track)!=null?s:KDe,ze=(c=(u=ce==null?void 0:ce.thumb)!=null?u:B.Thumb)!=null?c:ZDe,He=(f=(d=ce==null?void 0:ce.valueLabel)!=null?d:B.ValueLabel)!=null?f:JDe,xt=(h=(p=ce==null?void 0:ce.mark)!=null?p:B.Mark)!=null?h:eLe,Dt=(m=(g=ce==null?void 0:ce.markLabel)!=null?g:B.MarkLabel)!=null?m:tLe,nn=(v=(y=ce==null?void 0:ce.input)!=null?y:B.Input)!=null?v:"input",Hr=(x=F==null?void 0:F.root)!=null?x:W.root,Cn=(b=F==null?void 0:F.rail)!=null?b:W.rail,qr=(_=F==null?void 0:F.track)!=null?_:W.track,rr=(S=F==null?void 0:F.thumb)!=null?S:W.thumb,to=(O=F==null?void 0:F.valueLabel)!=null?O:W.valueLabel,yo=(C=F==null?void 0:F.mark)!=null?C:W.mark,qo=(E=F==null?void 0:F.markLabel)!=null?E:W.markLabel,rl=(k=F==null?void 0:F.input)!=null?k:W.input,yi=Lr({elementType:ae,getSlotProps:H,externalSlotProps:Hr,externalForwardedProps:ee,additionalProps:j({},UDe(ae)&&{as:z}),ownerState:j({},ge,Hr==null?void 0:Hr.ownerState),className:[Re.root,$]}),Ss=Lr({elementType:Le,externalSlotProps:Cn,ownerState:ge,className:Re.rail}),ne=Lr({elementType:Ee,externalSlotProps:qr,additionalProps:{style:j({},ye[oe].offset(me),ye[oe].leap(Ne))},ownerState:j({},ge,qr==null?void 0:qr.ownerState),className:Re.track}),Pe=Lr({elementType:ze,getSlotProps:ie,externalSlotProps:rr,ownerState:j({},ge,rr==null?void 0:rr.ownerState),className:Re.thumb}),Ie=Lr({elementType:He,externalSlotProps:to,ownerState:j({},ge,to==null?void 0:to.ownerState),className:Re.valueLabel}),Oe=Lr({elementType:xt,externalSlotProps:yo,ownerState:ge,className:Re.mark}),$e=Lr({elementType:Dt,externalSlotProps:qo,ownerState:ge,className:Re.markLabel}),ot=Lr({elementType:nn,getSlotProps:G,externalSlotProps:rl,ownerState:ge});return w.jsxs(ae,j({},yi,{children:[w.jsx(Le,j({},Ss)),w.jsx(Ee,j({},ne)),xe.filter(Ze=>Ze.value>=te&&Ze.value<=se).map((Ze,mt)=>{const wt=OT(Ze.value,te,se),zt=ye[oe].offset(wt);let Pt;return le===!1?Pt=Me.indexOf(Ze.value)!==-1:Pt=le==="normal"&&(V?Ze.value>=Me[0]&&Ze.value<=Me[Me.length-1]:Ze.value<=Me[0])||le==="inverted"&&(V?Ze.value<=Me[0]||Ze.value>=Me[Me.length-1]:Ze.value>=Me[0]),w.jsxs(M.Fragment,{children:[w.jsx(xt,j({"data-index":mt},Oe,!zl(xt)&&{markActive:Pt},{style:j({},zt,Oe.style),className:ke(Oe.className,Pt&&Re.markActive)})),Ze.label!=null?w.jsx(Dt,j({"aria-hidden":!0,"data-index":mt},$e,!zl(Dt)&&{markLabelActive:Pt},{style:j({},zt,$e.style),className:ke(Re.markLabel,$e.className,Pt&&Re.markLabelActive),children:Ze.label})):null]},mt)}),Me.map((Ze,mt)=>{const wt=OT(Ze,te,se),zt=ye[oe].offset(wt),Pt=Q==="off"?rLe:He;return w.jsx(Pt,j({},!zl(Pt)&&{valueLabelFormat:X,valueLabelDisplay:Q,value:typeof X=="function"?X(ve(Ze),mt):X,index:mt,open:he===mt||_e===mt||Q==="on",disabled:A},Ie,{children:w.jsx(ze,j({"data-index":mt},Pe,{className:ke(Re.thumb,Pe.className,_e===mt&&Re.active,Z===mt&&Re.focusVisible),style:j({},zt,Ce(mt),Pe.style),children:w.jsx(nn,j({"data-index":mt,"aria-label":q?q(mt):R,"aria-valuenow":ve(Ze),"aria-labelledby":L,"aria-valuetext":Y?Y(ve(Ze),mt):T,value:Me[mt]},ot))}))}),mt)})]}))}),Zv=iLe;function oLe(t){return We("MuiSnackbarContent",t)}Ve("MuiSnackbarContent",["root","message","action"]);const aLe=["action","className","message","role"],sLe=t=>{const{classes:e}=t;return Ue({root:["root"],action:["action"],message:["message"]},oLe,e)},lLe=we(Go,{name:"MuiSnackbarContent",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>{const e=t.palette.mode==="light"?.8:.98,n=kOe(t.palette.background.default,e);return j({},t.typography.body2,{color:t.vars?t.vars.palette.SnackbarContent.color:t.palette.getContrastText(n),backgroundColor:t.vars?t.vars.palette.SnackbarContent.bg:n,display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",borderRadius:(t.vars||t).shape.borderRadius,flexGrow:1,[t.breakpoints.up("sm")]:{flexGrow:"initial",minWidth:288}})}),cLe=we("div",{name:"MuiSnackbarContent",slot:"Message",overridesResolver:(t,e)=>e.message})({padding:"8px 0"}),uLe=we("div",{name:"MuiSnackbarContent",slot:"Action",overridesResolver:(t,e)=>e.action})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),fLe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiSnackbarContent"}),{action:i,className:o,message:a,role:s="alert"}=r,l=Ae(r,aLe),c=r,u=sLe(c);return w.jsxs(lLe,j({role:s,square:!0,elevation:6,className:ke(u.root,o),ownerState:c,ref:n},l,{children:[w.jsx(cLe,{className:u.message,ownerState:c,children:a}),i?w.jsx(uLe,{className:u.action,ownerState:c,children:i}):null]}))}),sie=fLe;function dLe(t){return We("MuiSnackbar",t)}Ve("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const hLe=["onEnter","onExited"],pLe=["action","anchorOrigin","autoHideDuration","children","className","ClickAwayListenerProps","ContentProps","disableWindowBlurListener","message","onBlur","onClose","onFocus","onMouseEnter","onMouseLeave","open","resumeHideDuration","TransitionComponent","transitionDuration","TransitionProps"],mLe=t=>{const{classes:e,anchorOrigin:n}=t,r={root:["root",`anchorOrigin${De(n.vertical)}${De(n.horizontal)}`]};return Ue(r,dLe,e)},k8=we("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`anchorOrigin${De(n.anchorOrigin.vertical)}${De(n.anchorOrigin.horizontal)}`]]}})(({theme:t,ownerState:e})=>{const n={left:"50%",right:"auto",transform:"translateX(-50%)"};return j({zIndex:(t.vars||t).zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center"},e.anchorOrigin.vertical==="top"?{top:8}:{bottom:8},e.anchorOrigin.horizontal==="left"&&{justifyContent:"flex-start"},e.anchorOrigin.horizontal==="right"&&{justifyContent:"flex-end"},{[t.breakpoints.up("sm")]:j({},e.anchorOrigin.vertical==="top"?{top:24}:{bottom:24},e.anchorOrigin.horizontal==="center"&&n,e.anchorOrigin.horizontal==="left"&&{left:24,right:"auto"},e.anchorOrigin.horizontal==="right"&&{right:24,left:"auto"})})}),gLe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiSnackbar"}),i=Vo(),o={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{action:a,anchorOrigin:{vertical:s,horizontal:l}={vertical:"bottom",horizontal:"left"},autoHideDuration:c=null,children:u,className:f,ClickAwayListenerProps:d,ContentProps:h,disableWindowBlurListener:p=!1,message:m,open:g,TransitionComponent:v=Rb,transitionDuration:y=o,TransitionProps:{onEnter:x,onExited:b}={}}=r,_=Ae(r.TransitionProps,hLe),S=Ae(r,pLe),O=j({},r,{anchorOrigin:{vertical:s,horizontal:l},autoHideDuration:c,disableWindowBlurListener:p,TransitionComponent:v,transitionDuration:y}),C=mLe(O),{getRootProps:E,onClickAway:k}=BPe(j({},O)),[I,P]=M.useState(!0),R=Lr({elementType:k8,getSlotProps:E,externalForwardedProps:S,ownerState:O,additionalProps:{ref:n},className:[C.root,f]}),T=z=>{P(!0),b&&b(z)},L=(z,B)=>{P(!1),x&&x(z,B)};return!g&&I?null:w.jsx(tEe,j({onClickAway:k},d,{children:w.jsx(k8,j({},R,{children:w.jsx(v,j({appear:!0,in:g,timeout:y,direction:s==="top"?"down":"up",onEnter:L,onExited:T},_,{children:u||w.jsx(sie,j({message:m,action:a},h))}))}))}))}),vLe=gLe;function yLe(t){return We("MuiTooltip",t)}const xLe=Ve("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]),gf=xLe,bLe=["arrow","children","classes","components","componentsProps","describeChild","disableFocusListener","disableHoverListener","disableInteractive","disableTouchListener","enterDelay","enterNextDelay","enterTouchDelay","followCursor","id","leaveDelay","leaveTouchDelay","onClose","onOpen","open","placement","PopperComponent","PopperProps","slotProps","slots","title","TransitionComponent","TransitionProps"];function _Le(t){return Math.round(t*1e5)/1e5}const wLe=t=>{const{classes:e,disableInteractive:n,arrow:r,touch:i,placement:o}=t,a={popper:["popper",!n&&"popperInteractive",r&&"popperArrow"],tooltip:["tooltip",r&&"tooltipArrow",i&&"touch",`tooltipPlacement${De(o.split("-")[0])}`],arrow:["arrow"]};return Ue(a,yLe,e)},SLe=we(f5,{name:"MuiTooltip",slot:"Popper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.popper,!n.disableInteractive&&e.popperInteractive,n.arrow&&e.popperArrow,!n.open&&e.popperClose]}})(({theme:t,ownerState:e,open:n})=>j({zIndex:(t.vars||t).zIndex.tooltip,pointerEvents:"none"},!e.disableInteractive&&{pointerEvents:"auto"},!n&&{pointerEvents:"none"},e.arrow&&{[`&[data-popper-placement*="bottom"] .${gf.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${gf.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${gf.arrow}`]:j({},e.isRtl?{right:0,marginRight:"-0.71em"}:{left:0,marginLeft:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}}),[`&[data-popper-placement*="left"] .${gf.arrow}`]:j({},e.isRtl?{left:0,marginLeft:"-0.71em"}:{right:0,marginRight:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}})})),OLe=we("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.tooltip,n.touch&&e.touch,n.arrow&&e.tooltipArrow,e[`tooltipPlacement${De(n.placement.split("-")[0])}`]]}})(({theme:t,ownerState:e})=>j({backgroundColor:t.vars?t.vars.palette.Tooltip.bg:kt(t.palette.grey[700],.92),borderRadius:(t.vars||t).shape.borderRadius,color:(t.vars||t).palette.common.white,fontFamily:t.typography.fontFamily,padding:"4px 8px",fontSize:t.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:t.typography.fontWeightMedium},e.arrow&&{position:"relative",margin:0},e.touch&&{padding:"8px 16px",fontSize:t.typography.pxToRem(14),lineHeight:`${_Le(16/14)}em`,fontWeight:t.typography.fontWeightRegular},{[`.${gf.popper}[data-popper-placement*="left"] &`]:j({transformOrigin:"right center"},e.isRtl?j({marginLeft:"14px"},e.touch&&{marginLeft:"24px"}):j({marginRight:"14px"},e.touch&&{marginRight:"24px"})),[`.${gf.popper}[data-popper-placement*="right"] &`]:j({transformOrigin:"left center"},e.isRtl?j({marginRight:"14px"},e.touch&&{marginRight:"24px"}):j({marginLeft:"14px"},e.touch&&{marginLeft:"24px"})),[`.${gf.popper}[data-popper-placement*="top"] &`]:j({transformOrigin:"center bottom",marginBottom:"14px"},e.touch&&{marginBottom:"24px"}),[`.${gf.popper}[data-popper-placement*="bottom"] &`]:j({transformOrigin:"center top",marginTop:"14px"},e.touch&&{marginTop:"24px"})})),CLe=we("span",{name:"MuiTooltip",slot:"Arrow",overridesResolver:(t,e)=>e.arrow})(({theme:t})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:t.vars?t.vars.palette.Tooltip.bg:kt(t.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}}));let oS=!1;const A8=new O1;let p0={x:0,y:0};function aS(t,e){return(n,...r)=>{e&&e(n,...r),t(n,...r)}}const TLe=M.forwardRef(function(e,n){var r,i,o,a,s,l,c,u,f,d,h,p,m,g,v,y,x,b,_;const S=qe({props:e,name:"MuiTooltip"}),{arrow:O=!1,children:C,components:E={},componentsProps:k={},describeChild:I=!1,disableFocusListener:P=!1,disableHoverListener:R=!1,disableInteractive:T=!1,disableTouchListener:L=!1,enterDelay:z=100,enterNextDelay:B=0,enterTouchDelay:W=700,followCursor:U=!1,id:N,leaveDelay:$=0,leaveTouchDelay:D=1500,onClose:A,onOpen:q,open:Y,placement:K="bottom",PopperComponent:se,PopperProps:te={},slotProps:J={},slots:pe={},title:be,TransitionComponent:re=Rb,TransitionProps:ve}=S,F=Ae(S,bLe),ce=M.isValidElement(C)?C:w.jsx("span",{children:C}),le=Vo(),Q=T1(),[X,ee]=M.useState(),[ge,ye]=M.useState(null),H=M.useRef(!1),G=T||U,ie=mf(),he=mf(),_e=mf(),oe=mf(),[Z,V]=Hs({controlled:Y,default:!1,name:"Tooltip",state:"open"});let de=Z;const xe=cd(N),Me=M.useRef(),me=br(()=>{Me.current!==void 0&&(document.body.style.WebkitUserSelect=Me.current,Me.current=void 0),oe.clear()});M.useEffect(()=>me,[me]);const Ne=st=>{A8.clear(),oS=!0,V(!0),q&&!de&&q(st)},Ce=br(st=>{A8.start(800+$,()=>{oS=!1}),V(!1),A&&de&&A(st),ie.start(le.transitions.duration.shortest,()=>{H.current=!1})}),Re=st=>{H.current&&st.type!=="touchstart"||(X&&X.removeAttribute("title"),he.clear(),_e.clear(),z||oS&&B?he.start(oS?B:z,()=>{Ne(st)}):Ne(st))},ae=st=>{he.clear(),_e.start($,()=>{Ce(st)})},{isFocusVisibleRef:Le,onBlur:Ee,onFocus:ze,ref:He}=C1(),[,xt]=M.useState(!1),Dt=st=>{Ee(st),Le.current===!1&&(xt(!1),ae(st))},nn=st=>{X||ee(st.currentTarget),ze(st),Le.current===!0&&(xt(!0),Re(st))},Hr=st=>{H.current=!0;const Qt=ce.props;Qt.onTouchStart&&Qt.onTouchStart(st)},Cn=st=>{Hr(st),_e.clear(),ie.clear(),me(),Me.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",oe.start(W,()=>{document.body.style.WebkitUserSelect=Me.current,Re(st)})},qr=st=>{ce.props.onTouchEnd&&ce.props.onTouchEnd(st),me(),_e.start(D,()=>{Ce(st)})};M.useEffect(()=>{if(!de)return;function st(Qt){(Qt.key==="Escape"||Qt.key==="Esc")&&Ce(Qt)}return document.addEventListener("keydown",st),()=>{document.removeEventListener("keydown",st)}},[Ce,de]);const rr=Zt(ce.ref,He,ee,n);!be&&be!==0&&(de=!1);const to=M.useRef(),yo=st=>{const Qt=ce.props;Qt.onMouseMove&&Qt.onMouseMove(st),p0={x:st.clientX,y:st.clientY},to.current&&to.current.update()},qo={},rl=typeof be=="string";I?(qo.title=!de&&rl&&!R?be:null,qo["aria-describedby"]=de?xe:null):(qo["aria-label"]=rl?be:null,qo["aria-labelledby"]=de&&!rl?xe:null);const yi=j({},qo,F,ce.props,{className:ke(F.className,ce.props.className),onTouchStart:Hr,ref:rr},U?{onMouseMove:yo}:{}),Ss={};L||(yi.onTouchStart=Cn,yi.onTouchEnd=qr),R||(yi.onMouseOver=aS(Re,yi.onMouseOver),yi.onMouseLeave=aS(ae,yi.onMouseLeave),G||(Ss.onMouseOver=Re,Ss.onMouseLeave=ae)),P||(yi.onFocus=aS(nn,yi.onFocus),yi.onBlur=aS(Dt,yi.onBlur),G||(Ss.onFocus=nn,Ss.onBlur=Dt));const ne=M.useMemo(()=>{var st;let Qt=[{name:"arrow",enabled:!!ge,options:{element:ge,padding:4}}];return(st=te.popperOptions)!=null&&st.modifiers&&(Qt=Qt.concat(te.popperOptions.modifiers)),j({},te.popperOptions,{modifiers:Qt})},[ge,te]),Pe=j({},S,{isRtl:Q,arrow:O,disableInteractive:G,placement:K,PopperComponentProp:se,touch:H.current}),Ie=wLe(Pe),Oe=(r=(i=pe.popper)!=null?i:E.Popper)!=null?r:SLe,$e=(o=(a=(s=pe.transition)!=null?s:E.Transition)!=null?a:re)!=null?o:Rb,ot=(l=(c=pe.tooltip)!=null?c:E.Tooltip)!=null?l:OLe,Ze=(u=(f=pe.arrow)!=null?f:E.Arrow)!=null?u:CLe,mt=Hm(Oe,j({},te,(d=J.popper)!=null?d:k.popper,{className:ke(Ie.popper,te==null?void 0:te.className,(h=(p=J.popper)!=null?p:k.popper)==null?void 0:h.className)}),Pe),wt=Hm($e,j({},ve,(m=J.transition)!=null?m:k.transition),Pe),zt=Hm(ot,j({},(g=J.tooltip)!=null?g:k.tooltip,{className:ke(Ie.tooltip,(v=(y=J.tooltip)!=null?y:k.tooltip)==null?void 0:v.className)}),Pe),Pt=Hm(Ze,j({},(x=J.arrow)!=null?x:k.arrow,{className:ke(Ie.arrow,(b=(_=J.arrow)!=null?_:k.arrow)==null?void 0:b.className)}),Pe);return w.jsxs(M.Fragment,{children:[M.cloneElement(ce,yi),w.jsx(Oe,j({as:se??f5,placement:K,anchorEl:U?{getBoundingClientRect:()=>({top:p0.y,left:p0.x,right:p0.x,bottom:p0.y,width:0,height:0})}:X,popperRef:to,open:X?de:!1,id:xe,transition:!0},Ss,mt,{popperOptions:ne,children:({TransitionProps:st})=>w.jsx($e,j({timeout:le.transitions.duration.shorter},st,wt,{children:w.jsxs(ot,j({},zt,{children:[be,O?w.jsx(Ze,j({},Pt,{ref:ye})):null]}))}))}))]})}),_t=TLe;function ELe(t){return We("MuiSwitch",t)}const oo=Ve("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),PLe=["className","color","edge","size","sx"],MLe=Kj(),kLe=t=>{const{classes:e,edge:n,size:r,color:i,checked:o,disabled:a}=t,s={root:["root",n&&`edge${De(n)}`,`size${De(r)}`],switchBase:["switchBase",`color${De(i)}`,o&&"checked",a&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},l=Ue(s,ELe,e);return j({},e,l)},ALe=we("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.edge&&e[`edge${De(n.edge)}`],e[`size${De(n.size)}`]]}})({display:"inline-flex",width:34+12*2,height:14+12*2,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${oo.thumb}`]:{width:16,height:16},[`& .${oo.switchBase}`]:{padding:4,[`&.${oo.checked}`]:{transform:"translateX(16px)"}}}}]}),RLe=we(h5,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.switchBase,{[`& .${oo.input}`]:e.input},n.color!=="default"&&e[`color${De(n.color)}`]]}})(({theme:t})=>({position:"absolute",top:0,left:0,zIndex:1,color:t.vars?t.vars.palette.Switch.defaultColor:`${t.palette.mode==="light"?t.palette.common.white:t.palette.grey[300]}`,transition:t.transitions.create(["left","transform"],{duration:t.transitions.duration.shortest}),[`&.${oo.checked}`]:{transform:"translateX(20px)"},[`&.${oo.disabled}`]:{color:t.vars?t.vars.palette.Switch.defaultDisabledColor:`${t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[600]}`},[`&.${oo.checked} + .${oo.track}`]:{opacity:.5},[`&.${oo.disabled} + .${oo.track}`]:{opacity:t.vars?t.vars.opacity.switchTrackDisabled:`${t.palette.mode==="light"?.12:.2}`},[`& .${oo.input}`]:{left:"-100%",width:"300%"}}),({theme:t})=>({"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(t.palette).filter(([,e])=>e.main&&e.light).map(([e])=>({props:{color:e},style:{[`&.${oo.checked}`]:{color:(t.vars||t).palette[e].main,"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[e].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette[e].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${oo.disabled}`]:{color:t.vars?t.vars.palette.Switch[`${e}DisabledColor`]:`${t.palette.mode==="light"?Pb(t.palette[e].main,.62):Eb(t.palette[e].main,.55)}`}},[`&.${oo.checked} + .${oo.track}`]:{backgroundColor:(t.vars||t).palette[e].main}}}))]})),ILe=we("span",{name:"MuiSwitch",slot:"Track",overridesResolver:(t,e)=>e.track})(({theme:t})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:t.transitions.create(["opacity","background-color"],{duration:t.transitions.duration.shortest}),backgroundColor:t.vars?t.vars.palette.common.onBackground:`${t.palette.mode==="light"?t.palette.common.black:t.palette.common.white}`,opacity:t.vars?t.vars.opacity.switchTrack:`${t.palette.mode==="light"?.38:.3}`})),DLe=we("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:(t,e)=>e.thumb})(({theme:t})=>({boxShadow:(t.vars||t).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"})),LLe=M.forwardRef(function(e,n){const r=MLe({props:e,name:"MuiSwitch"}),{className:i,color:o="primary",edge:a=!1,size:s="medium",sx:l}=r,c=Ae(r,PLe),u=j({},r,{color:o,edge:a,size:s}),f=kLe(u),d=w.jsx(DLe,{className:f.thumb,ownerState:u});return w.jsxs(ALe,{className:ke(f.root,i),sx:l,ownerState:u,children:[w.jsx(RLe,j({type:"checkbox",icon:d,checkedIcon:d,ref:n,ownerState:u},c,{classes:j({},f,{root:f.switchBase})})),w.jsx(ILe,{className:f.track,ownerState:u})]})}),lie=LLe;function $Le(t){return We("MuiTab",t)}const NLe=Ve("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),Ad=NLe,FLe=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],jLe=t=>{const{classes:e,textColor:n,fullWidth:r,wrapped:i,icon:o,label:a,selected:s,disabled:l}=t,c={root:["root",o&&a&&"labelIcon",`textColor${De(n)}`,r&&"fullWidth",i&&"wrapped",s&&"selected",l&&"disabled"],iconWrapper:["iconWrapper"]};return Ue(c,$Le,e)},BLe=we(us,{name:"MuiTab",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.label&&n.icon&&e.labelIcon,e[`textColor${De(n.textColor)}`],n.fullWidth&&e.fullWidth,n.wrapped&&e.wrapped]}})(({theme:t,ownerState:e})=>j({},t.typography.button,{maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center"},e.label&&{flexDirection:e.iconPosition==="top"||e.iconPosition==="bottom"?"column":"row"},{lineHeight:1.25},e.icon&&e.label&&{minHeight:72,paddingTop:9,paddingBottom:9,[`& > .${Ad.iconWrapper}`]:j({},e.iconPosition==="top"&&{marginBottom:6},e.iconPosition==="bottom"&&{marginTop:6},e.iconPosition==="start"&&{marginRight:t.spacing(1)},e.iconPosition==="end"&&{marginLeft:t.spacing(1)})},e.textColor==="inherit"&&{color:"inherit",opacity:.6,[`&.${Ad.selected}`]:{opacity:1},[`&.${Ad.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.textColor==="primary"&&{color:(t.vars||t).palette.text.secondary,[`&.${Ad.selected}`]:{color:(t.vars||t).palette.primary.main},[`&.${Ad.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.textColor==="secondary"&&{color:(t.vars||t).palette.text.secondary,[`&.${Ad.selected}`]:{color:(t.vars||t).palette.secondary.main},[`&.${Ad.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.fullWidth&&{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},e.wrapped&&{fontSize:t.typography.pxToRem(12)})),zLe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTab"}),{className:i,disabled:o=!1,disableFocusRipple:a=!1,fullWidth:s,icon:l,iconPosition:c="top",indicator:u,label:f,onChange:d,onClick:h,onFocus:p,selected:m,selectionFollowsFocus:g,textColor:v="inherit",value:y,wrapped:x=!1}=r,b=Ae(r,FLe),_=j({},r,{disabled:o,disableFocusRipple:a,selected:m,icon:!!l,iconPosition:c,label:!!f,fullWidth:s,textColor:v,wrapped:x}),S=jLe(_),O=l&&f&&M.isValidElement(l)?M.cloneElement(l,{className:ke(S.iconWrapper,l.props.className)}):l,C=k=>{!m&&d&&d(k,y),h&&h(k)},E=k=>{g&&!m&&d&&d(k,y),p&&p(k)};return w.jsxs(BLe,j({focusRipple:!a,className:ke(S.root,i),ref:n,role:"tab","aria-selected":m,disabled:o,onClick:C,onFocus:E,ownerState:_,tabIndex:m?0:-1},b,{children:[c==="top"||c==="start"?w.jsxs(M.Fragment,{children:[O,f]}):w.jsxs(M.Fragment,{children:[f,O]}),u]}))}),Ib=zLe,ULe=M.createContext(),cie=ULe;function WLe(t){return We("MuiTable",t)}Ve("MuiTable",["root","stickyHeader"]);const VLe=["className","component","padding","size","stickyHeader"],GLe=t=>{const{classes:e,stickyHeader:n}=t;return Ue({root:["root",n&&"stickyHeader"]},WLe,e)},HLe=we("table",{name:"MuiTable",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.stickyHeader&&e.stickyHeader]}})(({theme:t,ownerState:e})=>j({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":j({},t.typography.body2,{padding:t.spacing(2),color:(t.vars||t).palette.text.secondary,textAlign:"left",captionSide:"bottom"})},e.stickyHeader&&{borderCollapse:"separate"})),R8="table",qLe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTable"}),{className:i,component:o=R8,padding:a="normal",size:s="medium",stickyHeader:l=!1}=r,c=Ae(r,VLe),u=j({},r,{component:o,padding:a,size:s,stickyHeader:l}),f=GLe(u),d=M.useMemo(()=>({padding:a,size:s,stickyHeader:l}),[a,s,l]);return w.jsx(cie.Provider,{value:d,children:w.jsx(HLe,j({as:o,role:o===R8?null:"table",ref:n,className:ke(f.root,i),ownerState:u},c))})}),v5=qLe,XLe=M.createContext(),jM=XLe;function QLe(t){return We("MuiTableBody",t)}Ve("MuiTableBody",["root"]);const YLe=["className","component"],KLe=t=>{const{classes:e}=t;return Ue({root:["root"]},QLe,e)},ZLe=we("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"table-row-group"}),JLe={variant:"body"},I8="tbody",e$e=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTableBody"}),{className:i,component:o=I8}=r,a=Ae(r,YLe),s=j({},r,{component:o}),l=KLe(s);return w.jsx(jM.Provider,{value:JLe,children:w.jsx(ZLe,j({className:ke(l.root,i),as:o,ref:n,role:o===I8?null:"rowgroup",ownerState:s},a))})}),y5=e$e;function t$e(t){return We("MuiTableCell",t)}const n$e=Ve("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),r$e=n$e,i$e=["align","className","component","padding","scope","size","sortDirection","variant"],o$e=t=>{const{classes:e,variant:n,align:r,padding:i,size:o,stickyHeader:a}=t,s={root:["root",n,a&&"stickyHeader",r!=="inherit"&&`align${De(r)}`,i!=="normal"&&`padding${De(i)}`,`size${De(o)}`]};return Ue(s,t$e,e)},a$e=we("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`size${De(n.size)}`],n.padding!=="normal"&&e[`padding${De(n.padding)}`],n.align!=="inherit"&&e[`align${De(n.align)}`],n.stickyHeader&&e.stickyHeader]}})(({theme:t,ownerState:e})=>j({},t.typography.body2,{display:"table-cell",verticalAlign:"inherit",borderBottom:t.vars?`1px solid ${t.vars.palette.TableCell.border}`:`1px solid - ${t.palette.mode==="light"?Pb(kt(t.palette.divider,1),.88):Eb(kt(t.palette.divider,1),.68)}`,textAlign:"left",padding:16},e.variant==="head"&&{color:(t.vars||t).palette.text.primary,lineHeight:t.typography.pxToRem(24),fontWeight:t.typography.fontWeightMedium},e.variant==="body"&&{color:(t.vars||t).palette.text.primary},e.variant==="footer"&&{color:(t.vars||t).palette.text.secondary,lineHeight:t.typography.pxToRem(21),fontSize:t.typography.pxToRem(12)},e.size==="small"&&{padding:"6px 16px",[`&.${r$e.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}},e.padding==="checkbox"&&{width:48,padding:"0 0 0 4px"},e.padding==="none"&&{padding:0},e.align==="left"&&{textAlign:"left"},e.align==="center"&&{textAlign:"center"},e.align==="right"&&{textAlign:"right",flexDirection:"row-reverse"},e.align==="justify"&&{textAlign:"justify"},e.stickyHeader&&{position:"sticky",top:0,zIndex:2,backgroundColor:(t.vars||t).palette.background.default})),s$e=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTableCell"}),{align:i="inherit",className:o,component:a,padding:s,scope:l,size:c,sortDirection:u,variant:f}=r,d=Ae(r,i$e),h=M.useContext(cie),p=M.useContext(jM),m=p&&p.variant==="head";let g;a?g=a:g=m?"th":"td";let v=l;g==="td"?v=void 0:!v&&m&&(v="col");const y=f||p&&p.variant,x=j({},r,{align:i,component:g,padding:s||(h&&h.padding?h.padding:"normal"),size:c||(h&&h.size?h.size:"medium"),sortDirection:u,stickyHeader:y==="head"&&h&&h.stickyHeader,variant:y}),b=o$e(x);let _=null;return u&&(_=u==="asc"?"ascending":"descending"),w.jsx(a$e,j({as:g,ref:n,className:ke(b.root,o),"aria-sort":_,scope:v,ownerState:x},d))}),ar=s$e;function l$e(t){return We("MuiTableContainer",t)}Ve("MuiTableContainer",["root"]);const c$e=["className","component"],u$e=t=>{const{classes:e}=t;return Ue({root:["root"]},l$e,e)},f$e=we("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(t,e)=>e.root})({width:"100%",overflowX:"auto"}),d$e=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTableContainer"}),{className:i,component:o="div"}=r,a=Ae(r,c$e),s=j({},r,{component:o}),l=u$e(s);return w.jsx(f$e,j({ref:n,as:o,className:ke(l.root,i),ownerState:s},a))}),uie=d$e;function h$e(t){return We("MuiTableHead",t)}Ve("MuiTableHead",["root"]);const p$e=["className","component"],m$e=t=>{const{classes:e}=t;return Ue({root:["root"]},h$e,e)},g$e=we("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"table-header-group"}),v$e={variant:"head"},D8="thead",y$e=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTableHead"}),{className:i,component:o=D8}=r,a=Ae(r,p$e),s=j({},r,{component:o}),l=m$e(s);return w.jsx(jM.Provider,{value:v$e,children:w.jsx(g$e,j({as:o,className:ke(l.root,i),ref:n,role:o===D8?null:"rowgroup",ownerState:s},a))})}),x$e=y$e;function b$e(t){return We("MuiToolbar",t)}Ve("MuiToolbar",["root","gutters","regular","dense"]);const _$e=["className","component","disableGutters","variant"],w$e=t=>{const{classes:e,disableGutters:n,variant:r}=t;return Ue({root:["root",!n&&"gutters",r]},b$e,e)},S$e=we("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disableGutters&&e.gutters,e[n.variant]]}})(({theme:t,ownerState:e})=>j({position:"relative",display:"flex",alignItems:"center"},!e.disableGutters&&{paddingLeft:t.spacing(2),paddingRight:t.spacing(2),[t.breakpoints.up("sm")]:{paddingLeft:t.spacing(3),paddingRight:t.spacing(3)}},e.variant==="dense"&&{minHeight:48}),({theme:t,ownerState:e})=>e.variant==="regular"&&t.mixins.toolbar),O$e=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiToolbar"}),{className:i,component:o="div",disableGutters:a=!1,variant:s="regular"}=r,l=Ae(r,_$e),c=j({},r,{component:o,disableGutters:a,variant:s}),u=w$e(c);return w.jsx(S$e,j({as:o,className:ke(u.root,i),ref:n,ownerState:c},l))}),BM=O$e,C$e=ti(w.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),T$e=ti(w.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight");function E$e(t){return We("MuiTableRow",t)}const P$e=Ve("MuiTableRow",["root","selected","hover","head","footer"]),L8=P$e,M$e=["className","component","hover","selected"],k$e=t=>{const{classes:e,selected:n,hover:r,head:i,footer:o}=t;return Ue({root:["root",n&&"selected",r&&"hover",i&&"head",o&&"footer"]},E$e,e)},A$e=we("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.head&&e.head,n.footer&&e.footer]}})(({theme:t})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${L8.hover}:hover`]:{backgroundColor:(t.vars||t).palette.action.hover},[`&.${L8.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.primary.main,t.palette.action.selectedOpacity),"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:kt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity)}}})),$8="tr",R$e=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTableRow"}),{className:i,component:o=$8,hover:a=!1,selected:s=!1}=r,l=Ae(r,M$e),c=M.useContext(jM),u=j({},r,{component:o,hover:a,selected:s,head:c&&c.variant==="head",footer:c&&c.variant==="footer"}),f=k$e(u);return w.jsx(A$e,j({as:o,ref:n,className:ke(f.root,i),role:o===$8?null:"row",ownerState:u},l))}),pl=R$e;function I$e(t){return(1+Math.sin(Math.PI*t-Math.PI/2))/2}function D$e(t,e,n,r={},i=()=>{}){const{ease:o=I$e,duration:a=300}=r;let s=null;const l=e[t];let c=!1;const u=()=>{c=!0},f=d=>{if(c){i(new Error("Animation cancelled"));return}s===null&&(s=d);const h=Math.min(1,(d-s)/a);if(e[t]=o(h)*(n-l)+l,h>=1){requestAnimationFrame(()=>{i(null)});return}requestAnimationFrame(f)};return l===n?(i(new Error("Element already at target position")),u):(requestAnimationFrame(f),u)}const L$e=["onChange"],$$e={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function N$e(t){const{onChange:e}=t,n=Ae(t,L$e),r=M.useRef(),i=M.useRef(null),o=()=>{r.current=i.current.offsetHeight-i.current.clientHeight};return Vr(()=>{const a=Hv(()=>{const l=r.current;o(),l!==r.current&&e(r.current)}),s=ls(i.current);return s.addEventListener("resize",a),()=>{a.clear(),s.removeEventListener("resize",a)}},[e]),M.useEffect(()=>{o(),e(r.current)},[e]),w.jsx("div",j({style:$$e,ref:i},n))}function F$e(t){return We("MuiTabScrollButton",t)}const j$e=Ve("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),B$e=j$e,z$e=["className","slots","slotProps","direction","orientation","disabled"],U$e=t=>{const{classes:e,orientation:n,disabled:r}=t;return Ue({root:["root",n,r&&"disabled"]},F$e,e)},W$e=we(us,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.orientation&&e[n.orientation]]}})(({ownerState:t})=>j({width:40,flexShrink:0,opacity:.8,[`&.${B$e.disabled}`]:{opacity:0}},t.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${t.isRtl?-90:90}deg)`}})),V$e=M.forwardRef(function(e,n){var r,i;const o=qe({props:e,name:"MuiTabScrollButton"}),{className:a,slots:s={},slotProps:l={},direction:c}=o,u=Ae(o,z$e),f=T1(),d=j({isRtl:f},o),h=U$e(d),p=(r=s.StartScrollButtonIcon)!=null?r:C$e,m=(i=s.EndScrollButtonIcon)!=null?i:T$e,g=Lr({elementType:p,externalSlotProps:l.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:d}),v=Lr({elementType:m,externalSlotProps:l.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:d});return w.jsx(W$e,j({component:"div",className:ke(h.root,a),ref:n,role:null,ownerState:d,tabIndex:null},u,{children:c==="left"?w.jsx(p,j({},g)):w.jsx(m,j({},v))}))}),G$e=V$e;function H$e(t){return We("MuiTabs",t)}const q$e=Ve("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),SC=q$e,X$e=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","slots","slotProps","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],N8=(t,e)=>t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:t.firstChild,F8=(t,e)=>t===e?t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:t.lastChild,sS=(t,e,n)=>{let r=!1,i=n(t,e);for(;i;){if(i===t.firstChild){if(r)return;r=!0}const o=i.disabled||i.getAttribute("aria-disabled")==="true";if(!i.hasAttribute("tabindex")||o)i=n(t,i);else{i.focus();return}}},Q$e=t=>{const{vertical:e,fixed:n,hideScrollbar:r,scrollableX:i,scrollableY:o,centered:a,scrollButtonsHideMobile:s,classes:l}=t;return Ue({root:["root",e&&"vertical"],scroller:["scroller",n&&"fixed",r&&"hideScrollbar",i&&"scrollableX",o&&"scrollableY"],flexContainer:["flexContainer",e&&"flexContainerVertical",a&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",s&&"scrollButtonsHideMobile"],scrollableX:[i&&"scrollableX"],hideScrollbar:[r&&"hideScrollbar"]},H$e,l)},Y$e=we("div",{name:"MuiTabs",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${SC.scrollButtons}`]:e.scrollButtons},{[`& .${SC.scrollButtons}`]:n.scrollButtonsHideMobile&&e.scrollButtonsHideMobile},e.root,n.vertical&&e.vertical]}})(({ownerState:t,theme:e})=>j({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},t.vertical&&{flexDirection:"column"},t.scrollButtonsHideMobile&&{[`& .${SC.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}})),K$e=we("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.scroller,n.fixed&&e.fixed,n.hideScrollbar&&e.hideScrollbar,n.scrollableX&&e.scrollableX,n.scrollableY&&e.scrollableY]}})(({ownerState:t})=>j({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},t.fixed&&{overflowX:"hidden",width:"100%"},t.hideScrollbar&&{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},t.scrollableX&&{overflowX:"auto",overflowY:"hidden"},t.scrollableY&&{overflowY:"auto",overflowX:"hidden"})),Z$e=we("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.flexContainer,n.vertical&&e.flexContainerVertical,n.centered&&e.centered]}})(({ownerState:t})=>j({display:"flex"},t.vertical&&{flexDirection:"column"},t.centered&&{justifyContent:"center"})),J$e=we("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(t,e)=>e.indicator})(({ownerState:t,theme:e})=>j({position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create()},t.indicatorColor==="primary"&&{backgroundColor:(e.vars||e).palette.primary.main},t.indicatorColor==="secondary"&&{backgroundColor:(e.vars||e).palette.secondary.main},t.vertical&&{height:"100%",width:2,right:0})),e3e=we(N$e)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),j8={},t3e=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTabs"}),i=Vo(),o=T1(),{"aria-label":a,"aria-labelledby":s,action:l,centered:c=!1,children:u,className:f,component:d="div",allowScrollButtonsMobile:h=!1,indicatorColor:p="primary",onChange:m,orientation:g="horizontal",ScrollButtonComponent:v=G$e,scrollButtons:y="auto",selectionFollowsFocus:x,slots:b={},slotProps:_={},TabIndicatorProps:S={},TabScrollButtonProps:O={},textColor:C="primary",value:E,variant:k="standard",visibleScrollbar:I=!1}=r,P=Ae(r,X$e),R=k==="scrollable",T=g==="vertical",L=T?"scrollTop":"scrollLeft",z=T?"top":"left",B=T?"bottom":"right",W=T?"clientHeight":"clientWidth",U=T?"height":"width",N=j({},r,{component:d,allowScrollButtonsMobile:h,indicatorColor:p,orientation:g,vertical:T,scrollButtons:y,textColor:C,variant:k,visibleScrollbar:I,fixed:!R,hideScrollbar:R&&!I,scrollableX:R&&!T,scrollableY:R&&T,centered:c&&!R,scrollButtonsHideMobile:!h}),$=Q$e(N),D=Lr({elementType:b.StartScrollButtonIcon,externalSlotProps:_.startScrollButtonIcon,ownerState:N}),A=Lr({elementType:b.EndScrollButtonIcon,externalSlotProps:_.endScrollButtonIcon,ownerState:N}),[q,Y]=M.useState(!1),[K,se]=M.useState(j8),[te,J]=M.useState(!1),[pe,be]=M.useState(!1),[re,ve]=M.useState(!1),[F,ce]=M.useState({overflow:"hidden",scrollbarWidth:0}),le=new Map,Q=M.useRef(null),X=M.useRef(null),ee=()=>{const Ce=Q.current;let Re;if(Ce){const Le=Ce.getBoundingClientRect();Re={clientWidth:Ce.clientWidth,scrollLeft:Ce.scrollLeft,scrollTop:Ce.scrollTop,scrollLeftNormalized:lOe(Ce,o?"rtl":"ltr"),scrollWidth:Ce.scrollWidth,top:Le.top,bottom:Le.bottom,left:Le.left,right:Le.right}}let ae;if(Ce&&E!==!1){const Le=X.current.children;if(Le.length>0){const Ee=Le[le.get(E)];ae=Ee?Ee.getBoundingClientRect():null}}return{tabsMeta:Re,tabMeta:ae}},ge=br(()=>{const{tabsMeta:Ce,tabMeta:Re}=ee();let ae=0,Le;if(T)Le="top",Re&&Ce&&(ae=Re.top-Ce.top+Ce.scrollTop);else if(Le=o?"right":"left",Re&&Ce){const ze=o?Ce.scrollLeftNormalized+Ce.clientWidth-Ce.scrollWidth:Ce.scrollLeft;ae=(o?-1:1)*(Re[Le]-Ce[Le]+ze)}const Ee={[Le]:ae,[U]:Re?Re[U]:0};if(isNaN(K[Le])||isNaN(K[U]))se(Ee);else{const ze=Math.abs(K[Le]-Ee[Le]),He=Math.abs(K[U]-Ee[U]);(ze>=1||He>=1)&&se(Ee)}}),ye=(Ce,{animation:Re=!0}={})=>{Re?D$e(L,Q.current,Ce,{duration:i.transitions.duration.standard}):Q.current[L]=Ce},H=Ce=>{let Re=Q.current[L];T?Re+=Ce:(Re+=Ce*(o?-1:1),Re*=o&&Qne()==="reverse"?-1:1),ye(Re)},G=()=>{const Ce=Q.current[W];let Re=0;const ae=Array.from(X.current.children);for(let Le=0;LeCe){Le===0&&(Re=Ce);break}Re+=Ee[W]}return Re},ie=()=>{H(-1*G())},he=()=>{H(G())},_e=M.useCallback(Ce=>{ce({overflow:null,scrollbarWidth:Ce})},[]),oe=()=>{const Ce={};Ce.scrollbarSizeListener=R?w.jsx(e3e,{onChange:_e,className:ke($.scrollableX,$.hideScrollbar)}):null;const ae=R&&(y==="auto"&&(te||pe)||y===!0);return Ce.scrollButtonStart=ae?w.jsx(v,j({slots:{StartScrollButtonIcon:b.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:D},orientation:g,direction:o?"right":"left",onClick:ie,disabled:!te},O,{className:ke($.scrollButtons,O.className)})):null,Ce.scrollButtonEnd=ae?w.jsx(v,j({slots:{EndScrollButtonIcon:b.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:A},orientation:g,direction:o?"left":"right",onClick:he,disabled:!pe},O,{className:ke($.scrollButtons,O.className)})):null,Ce},Z=br(Ce=>{const{tabsMeta:Re,tabMeta:ae}=ee();if(!(!ae||!Re)){if(ae[z]Re[B]){const Le=Re[L]+(ae[B]-Re[B]);ye(Le,{animation:Ce})}}}),V=br(()=>{R&&y!==!1&&ve(!re)});M.useEffect(()=>{const Ce=Hv(()=>{Q.current&&ge()});let Re;const ae=ze=>{ze.forEach(He=>{He.removedNodes.forEach(xt=>{var Dt;(Dt=Re)==null||Dt.unobserve(xt)}),He.addedNodes.forEach(xt=>{var Dt;(Dt=Re)==null||Dt.observe(xt)})}),Ce(),V()},Le=ls(Q.current);Le.addEventListener("resize",Ce);let Ee;return typeof ResizeObserver<"u"&&(Re=new ResizeObserver(Ce),Array.from(X.current.children).forEach(ze=>{Re.observe(ze)})),typeof MutationObserver<"u"&&(Ee=new MutationObserver(ae),Ee.observe(X.current,{childList:!0})),()=>{var ze,He;Ce.clear(),Le.removeEventListener("resize",Ce),(ze=Ee)==null||ze.disconnect(),(He=Re)==null||He.disconnect()}},[ge,V]),M.useEffect(()=>{const Ce=Array.from(X.current.children),Re=Ce.length;if(typeof IntersectionObserver<"u"&&Re>0&&R&&y!==!1){const ae=Ce[0],Le=Ce[Re-1],Ee={root:Q.current,threshold:.99},ze=nn=>{J(!nn[0].isIntersecting)},He=new IntersectionObserver(ze,Ee);He.observe(ae);const xt=nn=>{be(!nn[0].isIntersecting)},Dt=new IntersectionObserver(xt,Ee);return Dt.observe(Le),()=>{He.disconnect(),Dt.disconnect()}}},[R,y,re,u==null?void 0:u.length]),M.useEffect(()=>{Y(!0)},[]),M.useEffect(()=>{ge()}),M.useEffect(()=>{Z(j8!==K)},[Z,K]),M.useImperativeHandle(l,()=>({updateIndicator:ge,updateScrollButtons:V}),[ge,V]);const de=w.jsx(J$e,j({},S,{className:ke($.indicator,S.className),ownerState:N,style:j({},K,S.style)}));let xe=0;const Me=M.Children.map(u,Ce=>{if(!M.isValidElement(Ce))return null;const Re=Ce.props.value===void 0?xe:Ce.props.value;le.set(Re,xe);const ae=Re===E;return xe+=1,M.cloneElement(Ce,j({fullWidth:k==="fullWidth",indicator:ae&&!q&&de,selected:ae,selectionFollowsFocus:x,onChange:m,textColor:C,value:Re},xe===1&&E===!1&&!Ce.props.tabIndex?{tabIndex:0}:{}))}),me=Ce=>{const Re=X.current,ae=$n(Re).activeElement;if(ae.getAttribute("role")!=="tab")return;let Ee=g==="horizontal"?"ArrowLeft":"ArrowUp",ze=g==="horizontal"?"ArrowRight":"ArrowDown";switch(g==="horizontal"&&o&&(Ee="ArrowRight",ze="ArrowLeft"),Ce.key){case Ee:Ce.preventDefault(),sS(Re,ae,F8);break;case ze:Ce.preventDefault(),sS(Re,ae,N8);break;case"Home":Ce.preventDefault(),sS(Re,null,N8);break;case"End":Ce.preventDefault(),sS(Re,null,F8);break}},Ne=oe();return w.jsxs(Y$e,j({className:ke($.root,f),ownerState:N,ref:n,as:d},P,{children:[Ne.scrollButtonStart,Ne.scrollbarSizeListener,w.jsxs(K$e,{className:$.scroller,ownerState:N,style:{overflow:F.overflow,[T?`margin${o?"Left":"Right"}`:"marginBottom"]:I?void 0:-F.scrollbarWidth},ref:Q,children:[w.jsx(Z$e,{"aria-label":a,"aria-labelledby":s,"aria-orientation":g==="vertical"?"vertical":null,className:$.flexContainer,ownerState:N,onKeyDown:me,ref:X,role:"tablist",children:Me}),q&&de]}),Ne.scrollButtonEnd]}))}),x5=t3e;function n3e(t){return We("MuiTextField",t)}Ve("MuiTextField",["root"]);const r3e=["autoComplete","autoFocus","children","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","id","InputLabelProps","inputProps","InputProps","inputRef","label","maxRows","minRows","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","select","SelectProps","type","value","variant"],i3e={standard:xp,filled:Ure,outlined:rie},o3e=t=>{const{classes:e}=t;return Ue({root:["root"]},n3e,e)},a3e=we(Yv,{name:"MuiTextField",slot:"Root",overridesResolver:(t,e)=>e.root})({}),s3e=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTextField"}),{autoComplete:i,autoFocus:o=!1,children:a,className:s,color:l="primary",defaultValue:c,disabled:u=!1,error:f=!1,FormHelperTextProps:d,fullWidth:h=!1,helperText:p,id:m,InputLabelProps:g,inputProps:v,InputProps:y,inputRef:x,label:b,maxRows:_,minRows:S,multiline:O=!1,name:C,onBlur:E,onChange:k,onFocus:I,placeholder:P,required:R=!1,rows:T,select:L=!1,SelectProps:z,type:B,value:W,variant:U="outlined"}=r,N=Ae(r,r3e),$=j({},r,{autoFocus:o,color:l,disabled:u,error:f,fullWidth:h,multiline:O,required:R,select:L,variant:U}),D=o3e($),A={};U==="outlined"&&(g&&typeof g.shrink<"u"&&(A.notched=g.shrink),A.label=b),L&&((!z||!z.native)&&(A.id=void 0),A["aria-describedby"]=void 0);const q=cd(m),Y=p&&q?`${q}-helper-text`:void 0,K=b&&q?`${q}-label`:void 0,se=i3e[U],te=w.jsx(se,j({"aria-describedby":Y,autoComplete:i,autoFocus:o,defaultValue:c,fullWidth:h,multiline:O,name:C,rows:T,maxRows:_,minRows:S,type:B,value:W,id:q,inputRef:x,onBlur:E,onChange:k,onFocus:I,placeholder:P,inputProps:v},A,y));return w.jsxs(a3e,j({className:ke(D.root,s),disabled:u,error:f,fullWidth:h,ref:n,required:R,color:l,variant:U,ownerState:$},N,{children:[b!=null&&b!==""&&w.jsx(Kv,j({htmlFor:q,id:K},g,{children:b})),L?w.jsx(wp,j({"aria-describedby":Y,id:q,labelId:K,value:W,input:te},z,{children:a})):te,p&&w.jsx(Wre,j({id:Y},d,{children:p}))]}))}),lr=s3e;function l3e(t){return We("MuiToggleButton",t)}const c3e=Ve("MuiToggleButton",["root","disabled","selected","standard","primary","secondary","sizeSmall","sizeMedium","sizeLarge","fullWidth"]),qm=c3e,u3e=M.createContext({}),fie=u3e,f3e=M.createContext(void 0),die=f3e;function d3e(t,e){return e===void 0||t===void 0?!1:Array.isArray(e)?e.indexOf(t)>=0:t===e}const h3e=["value"],p3e=["children","className","color","disabled","disableFocusRipple","fullWidth","onChange","onClick","selected","size","value"],m3e=t=>{const{classes:e,fullWidth:n,selected:r,disabled:i,size:o,color:a}=t,s={root:["root",r&&"selected",i&&"disabled",n&&"fullWidth",`size${De(o)}`,a]};return Ue(s,l3e,e)},g3e=we(us,{name:"MuiToggleButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`size${De(n.size)}`]]}})(({theme:t,ownerState:e})=>{let n=e.color==="standard"?t.palette.text.primary:t.palette[e.color].main,r;return t.vars&&(n=e.color==="standard"?t.vars.palette.text.primary:t.vars.palette[e.color].main,r=e.color==="standard"?t.vars.palette.text.primaryChannel:t.vars.palette[e.color].mainChannel),j({},t.typography.button,{borderRadius:(t.vars||t).shape.borderRadius,padding:11,border:`1px solid ${(t.vars||t).palette.divider}`,color:(t.vars||t).palette.action.active},e.fullWidth&&{width:"100%"},{[`&.${qm.disabled}`]:{color:(t.vars||t).palette.action.disabled,border:`1px solid ${(t.vars||t).palette.action.disabledBackground}`},"&:hover":{textDecoration:"none",backgroundColor:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.hoverOpacity})`:Wc(t.palette.text.primary,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${qm.selected}`]:{color:n,backgroundColor:t.vars?`rgba(${r} / ${t.vars.palette.action.selectedOpacity})`:Wc(n,t.palette.action.selectedOpacity),"&:hover":{backgroundColor:t.vars?`rgba(${r} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:Wc(n,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${r} / ${t.vars.palette.action.selectedOpacity})`:Wc(n,t.palette.action.selectedOpacity)}}}},e.size==="small"&&{padding:7,fontSize:t.typography.pxToRem(13)},e.size==="large"&&{padding:15,fontSize:t.typography.pxToRem(15)})}),v3e=M.forwardRef(function(e,n){const r=M.useContext(fie),{value:i}=r,o=Ae(r,h3e),a=M.useContext(die),s=OM(j({},o,{selected:d3e(e.value,i)}),e),l=qe({props:s,name:"MuiToggleButton"}),{children:c,className:u,color:f="standard",disabled:d=!1,disableFocusRipple:h=!1,fullWidth:p=!1,onChange:m,onClick:g,selected:v,size:y="medium",value:x}=l,b=Ae(l,p3e),_=j({},l,{color:f,disabled:d,disableFocusRipple:h,fullWidth:p,size:y}),S=m3e(_),O=E=>{g&&(g(E,x),E.defaultPrevented)||m&&m(E,x)},C=a||"";return w.jsx(g3e,j({className:ke(o.className,S.root,u,C),disabled:d,focusRipple:!h,ref:n,onClick:O,onChange:m,value:x,ownerState:_,"aria-pressed":v},b,{children:c}))}),Pn=v3e;function y3e(t){return We("MuiToggleButtonGroup",t)}const x3e=Ve("MuiToggleButtonGroup",["root","selected","vertical","disabled","grouped","groupedHorizontal","groupedVertical","fullWidth","firstButton","lastButton","middleButton"]),or=x3e,b3e=["children","className","color","disabled","exclusive","fullWidth","onChange","orientation","size","value"],_3e=t=>{const{classes:e,orientation:n,fullWidth:r,disabled:i}=t,o={root:["root",n==="vertical"&&"vertical",r&&"fullWidth"],grouped:["grouped",`grouped${De(n)}`,i&&"disabled"],firstButton:["firstButton"],lastButton:["lastButton"],middleButton:["middleButton"]};return Ue(o,y3e,e)},w3e=we("div",{name:"MuiToggleButtonGroup",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${or.grouped}`]:e.grouped},{[`& .${or.grouped}`]:e[`grouped${De(n.orientation)}`]},{[`& .${or.firstButton}`]:e.firstButton},{[`& .${or.lastButton}`]:e.lastButton},{[`& .${or.middleButton}`]:e.middleButton},e.root,n.orientation==="vertical"&&e.vertical,n.fullWidth&&e.fullWidth]}})(({ownerState:t,theme:e})=>j({display:"inline-flex",borderRadius:(e.vars||e).shape.borderRadius},t.orientation==="vertical"&&{flexDirection:"column"},t.fullWidth&&{width:"100%"},{[`& .${or.grouped}`]:j({},t.orientation==="horizontal"?{[`&.${or.selected} + .${or.grouped}.${or.selected}`]:{borderLeft:0,marginLeft:0}}:{[`&.${or.selected} + .${or.grouped}.${or.selected}`]:{borderTop:0,marginTop:0}})},t.orientation==="horizontal"?{[`& .${or.firstButton},& .${or.middleButton}`]:{borderTopRightRadius:0,borderBottomRightRadius:0},[`& .${or.lastButton},& .${or.middleButton}`]:{marginLeft:-1,borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0}}:{[`& .${or.firstButton},& .${or.middleButton}`]:{borderBottomLeftRadius:0,borderBottomRightRadius:0},[`& .${or.lastButton},& .${or.middleButton}`]:{marginTop:-1,borderTop:"1px solid transparent",borderTopLeftRadius:0,borderTopRightRadius:0}},t.orientation==="horizontal"?{[`& .${or.lastButton}.${qm.disabled},& .${or.middleButton}.${qm.disabled}`]:{borderLeft:"1px solid transparent"}}:{[`& .${or.lastButton}.${qm.disabled},& .${or.middleButton}.${qm.disabled}`]:{borderTop:"1px solid transparent"}})),S3e=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiToggleButtonGroup"}),{children:i,className:o,color:a="standard",disabled:s=!1,exclusive:l=!1,fullWidth:c=!1,onChange:u,orientation:f="horizontal",size:d="medium",value:h}=r,p=Ae(r,b3e),m=j({},r,{disabled:s,fullWidth:c,orientation:f,size:d}),g=_3e(m),v=M.useCallback((O,C)=>{if(!u)return;const E=h&&h.indexOf(C);let k;h&&E>=0?(k=h.slice(),k.splice(E,1)):k=h?h.concat(C):[C],u(O,k)},[u,h]),y=M.useCallback((O,C)=>{u&&u(O,h===C?null:C)},[u,h]),x=M.useMemo(()=>({className:g.grouped,onChange:l?y:v,value:h,size:d,fullWidth:c,color:a,disabled:s}),[g.grouped,l,y,v,h,d,c,a,s]),b=cOe(i),_=b.length,S=O=>{const C=O===0,E=O===_-1;return C&&E?"":C?g.firstButton:E?g.lastButton:g.middleButton};return w.jsx(w3e,j({role:"group",className:ke(g.root,o),ref:n,ownerState:m},p,{children:w.jsx(fie.Provider,{value:x,children:b.map((O,C)=>w.jsx(die.Provider,{value:S(C),children:O},C))})}))}),Jv=S3e,O3e="default",C3e={id:"local",name:"Local Server",url:"http://localhost:8080"},T3e={appBarTitle:"xcube Viewer",windowTitle:"xcube Viewer",windowIcon:null,compact:!1,themeName:"light",primaryColor:"blue",secondaryColor:"pink",organisationUrl:"https://xcube.readthedocs.io/",logoImage:"images/logo.png",logoWidth:32,baseMapUrl:"https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",defaultAgg:"mean",polygonFillOpacity:.2,mapProjection:"EPSG:3857",allowDownloads:!0,allowRefresh:!0,allowUserVariables:!0,allow3D:!0},lS={name:O3e,server:C3e,branding:T3e};function E3e(){const t=new URL(window.location.href),e=t.pathname.split("/"),n=e.length;return n>0?e[n-1]==="index.html"?new URL(e.slice(0,n-1).join("/"),window.location.origin):new URL(t.pathname,window.location.origin):new URL(window.location.origin)}const zM=E3e();console.log("baseUrl = ",zM.href);function hie(t,...e){let n=t;for(const r of e)r!==""&&(n.endsWith("/")?r.startsWith("/")?n+=r.substring(1):n+=r:r.startsWith("/")?n+=r:n+="/"+r);return n}const P3e={amber:lne,blue:Ju,blueGrey:T1e,brown:cne,cyan:ine,deepOrange:Ph,deepPurple:u1e,green:Rc,grey:une,indigo:rne,lightBlue:ef,lightGreen:y1e,lime:ane,orange:Jd,pink:nne,purple:Zu,red:Ku,teal:one,yellow:sne};function B8(t,e){const n=t[e];let r=null;if(typeof n=="string"?(r=P3e[n]||null,r===null&&n.startsWith("#")&&(n.length===7||n.length===9)&&(r={main:n})):typeof n=="object"&&n!==null&&"main"in n&&(r=n),r!==null)t[e]=r;else throw new Error(`Value of branding.${e} is invalid: ${n}`)}function M3e(t,e,n){const r=t[e];typeof r=="string"&&(t[e]=hie(zM.href,n,r))}function k3e(t,e){return t={...t},B8(t,"primaryColor"),B8(t,"secondaryColor"),M3e(t,"logoImage",e),t}function En(t){return typeof t=="number"}function ey(t){return typeof t=="string"}function A3e(t){return typeof t=="function"}function z8(t){return t!==null&&typeof t=="object"&&t.constructor===Object}var qp={BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const cf=new URLSearchParams(window.location.search),Ds=class Ds{constructor(e,n,r,i){Yt(this,"name");Yt(this,"server");Yt(this,"branding");Yt(this,"authClient");this.name=e,this.server=n,this.branding=r,this.authClient=i}static async load(){let e=cf.get("configPath")||"config";const n=await this.loadRawConfig(e);n===lS&&(e="");const r=n.name||"default",i=this.getAuthConfig(n),o=this.getServerConfig(n),a=parseInt(cf.get("compact")||"0")!==0;let s=k3e({...lS.branding,...n.branding,compact:a||n.branding.compact},e);return s=W8(s,"allowUserVariables"),s=W8(s,"allow3D"),Ds._instance=new Ds(r,o,s,i),s.windowTitle&&this.changeWindowTitle(s.windowTitle),s.windowIcon&&this.changeWindowIcon(s.windowIcon),Ds._instance}static getAuthConfig(e){let n=e.authClient&&{...e.authClient};const r=Ds.getAuthClientFromEnv();if(!n&&r.authority&&r.clientId&&(n={authority:r.authority,client_id:r.clientId}),n){if(r.authority){const i=r.authority;n={...n,authority:i}}if(r.clientId){const i=r.clientId;n={...n,client_id:i}}if(r.audience){const i=r.audience,o=n.extraQueryParams;n={...n,extraQueryParams:{...o,audience:i}}}}return n}static getServerConfig(e){const n={...lS.server,...e.server},r=Ds.getApiServerFromEnv();return n.id=cf.get("serverId")||r.id||n.id,n.name=cf.get("serverName")||r.name||n.name,n.url=cf.get("serverUrl")||r.url||n.url,n}static async loadRawConfig(e){let n=null,r=null;const i=hie(zM.href,e,"config.json");try{const o=await fetch(i);if(o.ok)n=await o.json();else{const{status:a,statusText:s}=o;r=`HTTP status ${a}`,s&&(r+=` (${s})`)}}catch(o){n=null,r=`${o}`}return n===null&&(n=lS),n}static get instance(){return Ds.assertConfigLoaded(),Ds._instance}static assertConfigLoaded(){if(!Ds._instance)throw new Error("internal error: configuration not available yet")}static changeWindowTitle(e){document.title=e}static changeWindowIcon(e){let n=document.querySelector('link[rel="icon"]');n!==null?n.href=e:(n=document.createElement("link"),n.rel="icon",n.href=e,document.head.appendChild(n))}static getAuthClientFromEnv(){const e=qp.XCV_OAUTH2_AUTHORITY,n=qp.XCV_OAUTH2_CLIENT_ID,r=qp.XCV_OAUTH2_AUDIENCE;return{authority:e,clientId:n,audience:r}}static getApiServerFromEnv(){const e=qp.XCV_APP_SERVER_ID,n=qp.XCV_SERVER_NAME,r=qp.XCV_SERVER_URL;return{id:e,name:n,url:r}}};Yt(Ds,"_instance");let Kt=Ds;const b5=[["red",Ku],["yellow",sne],["blue",Ju],["pink",nne],["lightBlue",ef],["green",Rc],["orange",Jd],["lime",ane],["purple",Zu],["indigo",rne],["cyan",ine],["brown",cne],["teal",one]],R3e=(()=>{const t={};return b5.forEach(([e,n])=>{t[e]=n}),t})(),U8=b5.map(([t,e])=>t);function I3e(t){return t==="light"?800:400}function Xh(t){return U8[t%U8.length]}function pie(t,e){const n=I3e(e);return R3e[t][n]}function _5(t){return En(t)||(t=Kt.instance.branding.polygonFillOpacity),En(t)?t:.25}const D3e={Mapbox:{param:"access_token",token:"pk.eyJ1IjoiZm9ybWFuIiwiYSI6ImNrM2JranV0bDBtenczb2szZG84djh6bWUifQ.q0UKwf4CWt5fcQwIDwF8Bg"}};function L3e(t){return D3e[t]}function W8(t,e){const n=cf.get(e),r=n?!!parseInt(n):!!t[e];return{...t,[e]:r}}function ox(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var mie={exports:{}};const $3e={},N3e=Object.freeze(Object.defineProperty({__proto__:null,default:$3e},Symbol.toStringTag,{value:"Module"})),F3e=Ea(N3e);(function(t,e){(function(n,r){t.exports=r()})(Kn,function(){var n=n||function(r,i){var o;if(typeof window<"u"&&window.crypto&&(o=window.crypto),typeof self<"u"&&self.crypto&&(o=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(o=globalThis.crypto),!o&&typeof window<"u"&&window.msCrypto&&(o=window.msCrypto),!o&&typeof Kn<"u"&&Kn.crypto&&(o=Kn.crypto),!o&&typeof ox=="function")try{o=F3e}catch{}var a=function(){if(o){if(typeof o.getRandomValues=="function")try{return o.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof o.randomBytes=="function")try{return o.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},s=Object.create||function(){function y(){}return function(x){var b;return y.prototype=x,b=new y,y.prototype=null,b}}(),l={},c=l.lib={},u=c.Base=function(){return{extend:function(y){var x=s(this);return y&&x.mixIn(y),(!x.hasOwnProperty("init")||this.init===x.init)&&(x.init=function(){x.$super.init.apply(this,arguments)}),x.init.prototype=x,x.$super=this,x},create:function(){var y=this.extend();return y.init.apply(y,arguments),y},init:function(){},mixIn:function(y){for(var x in y)y.hasOwnProperty(x)&&(this[x]=y[x]);y.hasOwnProperty("toString")&&(this.toString=y.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),f=c.WordArray=u.extend({init:function(y,x){y=this.words=y||[],x!=i?this.sigBytes=x:this.sigBytes=y.length*4},toString:function(y){return(y||h).stringify(this)},concat:function(y){var x=this.words,b=y.words,_=this.sigBytes,S=y.sigBytes;if(this.clamp(),_%4)for(var O=0;O>>2]>>>24-O%4*8&255;x[_+O>>>2]|=C<<24-(_+O)%4*8}else for(var E=0;E>>2]=b[E>>>2];return this.sigBytes+=S,this},clamp:function(){var y=this.words,x=this.sigBytes;y[x>>>2]&=4294967295<<32-x%4*8,y.length=r.ceil(x/4)},clone:function(){var y=u.clone.call(this);return y.words=this.words.slice(0),y},random:function(y){for(var x=[],b=0;b>>2]>>>24-S%4*8&255;_.push((O>>>4).toString(16)),_.push((O&15).toString(16))}return _.join("")},parse:function(y){for(var x=y.length,b=[],_=0;_>>3]|=parseInt(y.substr(_,2),16)<<24-_%8*4;return new f.init(b,x/2)}},p=d.Latin1={stringify:function(y){for(var x=y.words,b=y.sigBytes,_=[],S=0;S>>2]>>>24-S%4*8&255;_.push(String.fromCharCode(O))}return _.join("")},parse:function(y){for(var x=y.length,b=[],_=0;_>>2]|=(y.charCodeAt(_)&255)<<24-_%4*8;return new f.init(b,x)}},m=d.Utf8={stringify:function(y){try{return decodeURIComponent(escape(p.stringify(y)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(y){return p.parse(unescape(encodeURIComponent(y)))}},g=c.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new f.init,this._nDataBytes=0},_append:function(y){typeof y=="string"&&(y=m.parse(y)),this._data.concat(y),this._nDataBytes+=y.sigBytes},_process:function(y){var x,b=this._data,_=b.words,S=b.sigBytes,O=this.blockSize,C=O*4,E=S/C;y?E=r.ceil(E):E=r.max((E|0)-this._minBufferSize,0);var k=E*O,I=r.min(k*4,S);if(k){for(var P=0;P>>7)^(E<<14|E>>>18)^E>>>3,I=f[C-2],P=(I<<15|I>>>17)^(I<<13|I>>>19)^I>>>10;f[C]=k+f[C-7]+P+f[C-16]}var R=b&_^~b&S,T=g&v^g&y^v&y,L=(g<<30|g>>>2)^(g<<19|g>>>13)^(g<<10|g>>>22),z=(b<<26|b>>>6)^(b<<21|b>>>11)^(b<<7|b>>>25),B=O+z+R+u[C]+f[C],W=L+T;O=S,S=_,_=b,b=x+B|0,x=y,y=v,v=g,g=B+W|0}m[0]=m[0]+g|0,m[1]=m[1]+v|0,m[2]=m[2]+y|0,m[3]=m[3]+x|0,m[4]=m[4]+b|0,m[5]=m[5]+_|0,m[6]=m[6]+S|0,m[7]=m[7]+O|0},_doFinalize:function(){var h=this._data,p=h.words,m=this._nDataBytes*8,g=h.sigBytes*8;return p[g>>>5]|=128<<24-g%32,p[(g+64>>>9<<4)+14]=r.floor(m/4294967296),p[(g+64>>>9<<4)+15]=m,h.sigBytes=p.length*4,this._process(),this._hash},clone:function(){var h=s.clone.call(this);return h._hash=this._hash.clone(),h}});i.SHA256=s._createHelper(d),i.HmacSHA256=s._createHmacHelper(d)}(Math),n.SHA256})})(gie);var B3e=gie.exports;const z3e=Nt(B3e);var vie={exports:{}};(function(t,e){(function(n,r){t.exports=r(UM)})(Kn,function(n){return function(){var r=n,i=r.lib,o=i.WordArray,a=r.enc;a.Base64={stringify:function(l){var c=l.words,u=l.sigBytes,f=this._map;l.clamp();for(var d=[],h=0;h>>2]>>>24-h%4*8&255,m=c[h+1>>>2]>>>24-(h+1)%4*8&255,g=c[h+2>>>2]>>>24-(h+2)%4*8&255,v=p<<16|m<<8|g,y=0;y<4&&h+y*.75>>6*(3-y)&63));var x=f.charAt(64);if(x)for(;d.length%4;)d.push(x);return d.join("")},parse:function(l){var c=l.length,u=this._map,f=this._reverseMap;if(!f){f=this._reverseMap=[];for(var d=0;d>>6-h%4*2,g=p|m;f[d>>>2]|=g<<24-d%4*8,d++}return o.create(f,d)}}(),n.enc.Base64})})(vie);var U3e=vie.exports;const V8=Nt(U3e);var yie={exports:{}};(function(t,e){(function(n,r){t.exports=r(UM)})(Kn,function(n){return n.enc.Utf8})})(yie);var W3e=yie.exports;const V3e=Nt(W3e);function LL(t){this.message=t}LL.prototype=new Error,LL.prototype.name="InvalidCharacterError";var G8=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new LL("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,i=0,o=0,a="";r=e.charAt(o++);~r&&(n=i%4?64*n+r:r,i++%4)?a+=String.fromCharCode(255&n>>(-2*i&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return a};function G3e(t){var e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw"Illegal base64url string!"}try{return function(n){return decodeURIComponent(G8(n).replace(/(.)/g,function(r,i){var o=i.charCodeAt(0).toString(16).toUpperCase();return o.length<2&&(o="0"+o),"%"+o}))}(e)}catch{return G8(e)}}function PT(t){this.message=t}function H3e(t,e){if(typeof t!="string")throw new PT("Invalid token specified");var n=(e=e||{}).header===!0?0:1;try{return JSON.parse(G3e(t.split(".")[n]))}catch(r){throw new PT("Invalid token specified: "+r.message)}}PT.prototype=new Error,PT.prototype.name="InvalidTokenError";var q3e={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}},fl,dl,MT=(t=>(t[t.NONE=0]="NONE",t[t.ERROR=1]="ERROR",t[t.WARN=2]="WARN",t[t.INFO=3]="INFO",t[t.DEBUG=4]="DEBUG",t))(MT||{});(t=>{function e(){fl=3,dl=q3e}t.reset=e;function n(i){if(!(0<=i&&i<=4))throw new Error("Invalid log level");fl=i}t.setLevel=n;function r(i){dl=i}t.setLogger=r})(MT||(MT={}));var Rt=class{constructor(t){this._name=t}debug(...t){fl>=4&&dl.debug(Rt._format(this._name,this._method),...t)}info(...t){fl>=3&&dl.info(Rt._format(this._name,this._method),...t)}warn(...t){fl>=2&&dl.warn(Rt._format(this._name,this._method),...t)}error(...t){fl>=1&&dl.error(Rt._format(this._name,this._method),...t)}throw(t){throw this.error(t),t}create(t){const e=Object.create(this);return e._method=t,e.debug("begin"),e}static createStatic(t,e){const n=new Rt(`${t}.${e}`);return n.debug("begin"),n}static _format(t,e){const n=`[${t}]`;return e?`${n} ${e}:`:n}static debug(t,...e){fl>=4&&dl.debug(Rt._format(t),...e)}static info(t,...e){fl>=3&&dl.info(Rt._format(t),...e)}static warn(t,...e){fl>=2&&dl.warn(Rt._format(t),...e)}static error(t,...e){fl>=1&&dl.error(Rt._format(t),...e)}};MT.reset();var X3e="10000000-1000-4000-8000-100000000000",Ml=class{static _randomWord(){return j3e.lib.WordArray.random(1).words[0]}static generateUUIDv4(){return X3e.replace(/[018]/g,e=>(+e^Ml._randomWord()&15>>+e/4).toString(16)).replace(/-/g,"")}static generateCodeVerifier(){return Ml.generateUUIDv4()+Ml.generateUUIDv4()+Ml.generateUUIDv4()}static generateCodeChallenge(t){try{const e=z3e(t);return V8.stringify(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(e){throw Rt.error("CryptoUtils.generateCodeChallenge",e),e}}static generateBasicAuth(t,e){const n=V3e.parse([t,e].join(":"));return V8.stringify(n)}},tf=class{constructor(e){this._name=e,this._logger=new Rt(`Event('${this._name}')`),this._callbacks=[]}addHandler(e){return this._callbacks.push(e),()=>this.removeHandler(e)}removeHandler(e){const n=this._callbacks.lastIndexOf(e);n>=0&&this._callbacks.splice(n,1)}raise(...e){this._logger.debug("raise:",...e);for(const n of this._callbacks)n(...e)}},$L=class{static decode(t){try{return H3e(t)}catch(e){throw Rt.error("JwtUtils.decode",e),e}}},H8=class{static center({...t}){var e,n,r;return t.width==null&&(t.width=(e=[800,720,600,480].find(i=>i<=window.outerWidth/1.618))!=null?e:360),(n=t.left)!=null||(t.left=Math.max(0,Math.round(window.screenX+(window.outerWidth-t.width)/2))),t.height!=null&&((r=t.top)!=null||(t.top=Math.max(0,Math.round(window.screenY+(window.outerHeight-t.height)/2)))),t}static serialize(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e}=${typeof n!="boolean"?n:n?"yes":"no"}`).join(",")}},ts=class extends tf{constructor(){super(...arguments),this._logger=new Rt(`Timer('${this._name}')`),this._timerHandle=null,this._expiration=0,this._callback=()=>{const t=this._expiration-ts.getEpochTime();this._logger.debug("timer completes in",t),this._expiration<=ts.getEpochTime()&&(this.cancel(),super.raise())}}static getEpochTime(){return Math.floor(Date.now()/1e3)}init(t){const e=this._logger.create("init");t=Math.max(Math.floor(t),1);const n=ts.getEpochTime()+t;if(this.expiration===n&&this._timerHandle){e.debug("skipping since already initialized for expiration at",this.expiration);return}this.cancel(),e.debug("using duration",t),this._expiration=n;const r=Math.min(t,5);this._timerHandle=setInterval(this._callback,r*1e3)}get expiration(){return this._expiration}cancel(){this._logger.create("cancel"),this._timerHandle&&(clearInterval(this._timerHandle),this._timerHandle=null)}},NL=class{static readParams(t,e="query"){if(!t)throw new TypeError("Invalid URL");const r=new URL(t,"http://127.0.0.1")[e==="fragment"?"hash":"search"];return new URLSearchParams(r.slice(1))}},FL=";",Qh=class extends Error{constructor(t,e){var n,r,i;if(super(t.error_description||t.error||""),this.form=e,this.name="ErrorResponse",!t.error)throw Rt.error("ErrorResponse","No error passed"),new Error("No error passed");this.error=t.error,this.error_description=(n=t.error_description)!=null?n:null,this.error_uri=(r=t.error_uri)!=null?r:null,this.state=t.userState,this.session_state=(i=t.session_state)!=null?i:null,this.url_state=t.url_state}},w5=class extends Error{constructor(t){super(t),this.name="ErrorTimeout"}},Q3e=class{constructor(t){this._logger=new Rt("AccessTokenEvents"),this._expiringTimer=new ts("Access token expiring"),this._expiredTimer=new ts("Access token expired"),this._expiringNotificationTimeInSeconds=t.expiringNotificationTimeInSeconds}load(t){const e=this._logger.create("load");if(t.access_token&&t.expires_in!==void 0){const n=t.expires_in;if(e.debug("access token present, remaining duration:",n),n>0){let i=n-this._expiringNotificationTimeInSeconds;i<=0&&(i=1),e.debug("registering expiring timer, raising in",i,"seconds"),this._expiringTimer.init(i)}else e.debug("canceling existing expiring timer because we're past expiration."),this._expiringTimer.cancel();const r=n+1;e.debug("registering expired timer, raising in",r,"seconds"),this._expiredTimer.init(r)}else this._expiringTimer.cancel(),this._expiredTimer.cancel()}unload(){this._logger.debug("unload: canceling existing access token timers"),this._expiringTimer.cancel(),this._expiredTimer.cancel()}addAccessTokenExpiring(t){return this._expiringTimer.addHandler(t)}removeAccessTokenExpiring(t){this._expiringTimer.removeHandler(t)}addAccessTokenExpired(t){return this._expiredTimer.addHandler(t)}removeAccessTokenExpired(t){this._expiredTimer.removeHandler(t)}},Y3e=class{constructor(t,e,n,r,i){this._callback=t,this._client_id=e,this._intervalInSeconds=r,this._stopOnError=i,this._logger=new Rt("CheckSessionIFrame"),this._timer=null,this._session_state=null,this._message=a=>{a.origin===this._frame_origin&&a.source===this._frame.contentWindow&&(a.data==="error"?(this._logger.error("error message from check session op iframe"),this._stopOnError&&this.stop()):a.data==="changed"?(this._logger.debug("changed message from check session op iframe"),this.stop(),this._callback()):this._logger.debug(a.data+" message from check session op iframe"))};const o=new URL(n);this._frame_origin=o.origin,this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="fixed",this._frame.style.left="-1000px",this._frame.style.top="0",this._frame.width="0",this._frame.height="0",this._frame.src=o.href}load(){return new Promise(t=>{this._frame.onload=()=>{t()},window.document.body.appendChild(this._frame),window.addEventListener("message",this._message,!1)})}start(t){if(this._session_state===t)return;this._logger.create("start"),this.stop(),this._session_state=t;const e=()=>{!this._frame.contentWindow||!this._session_state||this._frame.contentWindow.postMessage(this._client_id+" "+this._session_state,this._frame_origin)};e(),this._timer=setInterval(e,this._intervalInSeconds*1e3)}stop(){this._logger.create("stop"),this._session_state=null,this._timer&&(clearInterval(this._timer),this._timer=null)}},xie=class{constructor(){this._logger=new Rt("InMemoryWebStorage"),this._data={}}clear(){this._logger.create("clear"),this._data={}}getItem(t){return this._logger.create(`getItem('${t}')`),this._data[t]}setItem(t,e){this._logger.create(`setItem('${t}')`),this._data[t]=e}removeItem(t){this._logger.create(`removeItem('${t}')`),delete this._data[t]}get length(){return Object.getOwnPropertyNames(this._data).length}key(t){return Object.getOwnPropertyNames(this._data)[t]}},S5=class{constructor(t=[],e=null,n={}){this._jwtHandler=e,this._extraHeaders=n,this._logger=new Rt("JsonService"),this._contentTypes=[],this._contentTypes.push(...t,"application/json"),e&&this._contentTypes.push("application/jwt")}async fetchWithTimeout(t,e={}){const{timeoutInSeconds:n,...r}=e;if(!n)return await fetch(t,r);const i=new AbortController,o=setTimeout(()=>i.abort(),n*1e3);try{return await fetch(t,{...e,signal:i.signal})}catch(a){throw a instanceof DOMException&&a.name==="AbortError"?new w5("Network timed out"):a}finally{clearTimeout(o)}}async getJson(t,{token:e,credentials:n}={}){const r=this._logger.create("getJson"),i={Accept:this._contentTypes.join(", ")};e&&(r.debug("token passed, setting Authorization header"),i.Authorization="Bearer "+e),this.appendExtraHeaders(i);let o;try{r.debug("url:",t),o=await this.fetchWithTimeout(t,{method:"GET",headers:i,credentials:n})}catch(l){throw r.error("Network Error"),l}r.debug("HTTP response received, status",o.status);const a=o.headers.get("Content-Type");if(a&&!this._contentTypes.find(l=>a.startsWith(l))&&r.throw(new Error(`Invalid response Content-Type: ${a??"undefined"}, from URL: ${t}`)),o.ok&&this._jwtHandler&&(a!=null&&a.startsWith("application/jwt")))return await this._jwtHandler(await o.text());let s;try{s=await o.json()}catch(l){throw r.error("Error parsing JSON response",l),o.ok?l:new Error(`${o.statusText} (${o.status})`)}if(!o.ok)throw r.error("Error from server:",s),s.error?new Qh(s):new Error(`${o.statusText} (${o.status}): ${JSON.stringify(s)}`);return s}async postForm(t,{body:e,basicAuth:n,timeoutInSeconds:r,initCredentials:i}){const o=this._logger.create("postForm"),a={Accept:this._contentTypes.join(", "),"Content-Type":"application/x-www-form-urlencoded"};n!==void 0&&(a.Authorization="Basic "+n),this.appendExtraHeaders(a);let s;try{o.debug("url:",t),s=await this.fetchWithTimeout(t,{method:"POST",headers:a,body:e,timeoutInSeconds:r,credentials:i})}catch(f){throw o.error("Network error"),f}o.debug("HTTP response received, status",s.status);const l=s.headers.get("Content-Type");if(l&&!this._contentTypes.find(f=>l.startsWith(f)))throw new Error(`Invalid response Content-Type: ${l??"undefined"}, from URL: ${t}`);const c=await s.text();let u={};if(c)try{u=JSON.parse(c)}catch(f){throw o.error("Error parsing JSON response",f),s.ok?f:new Error(`${s.statusText} (${s.status})`)}if(!s.ok)throw o.error("Error from server:",u),u.error?new Qh(u,e):new Error(`${s.statusText} (${s.status}): ${JSON.stringify(u)}`);return u}appendExtraHeaders(t){const e=this._logger.create("appendExtraHeaders"),n=Object.keys(this._extraHeaders),r=["authorization","accept","content-type"];n.length!==0&&n.forEach(i=>{if(r.includes(i.toLocaleLowerCase())){e.warn("Protected header could not be overridden",i,r);return}const o=typeof this._extraHeaders[i]=="function"?this._extraHeaders[i]():this._extraHeaders[i];o&&o!==""&&(t[i]=o)})}},K3e=class{constructor(t){this._settings=t,this._logger=new Rt("MetadataService"),this._signingKeys=null,this._metadata=null,this._metadataUrl=this._settings.metadataUrl,this._jsonService=new S5(["application/jwk-set+json"],null,this._settings.extraHeaders),this._settings.signingKeys&&(this._logger.debug("using signingKeys from settings"),this._signingKeys=this._settings.signingKeys),this._settings.metadata&&(this._logger.debug("using metadata from settings"),this._metadata=this._settings.metadata),this._settings.fetchRequestCredentials&&(this._logger.debug("using fetchRequestCredentials from settings"),this._fetchRequestCredentials=this._settings.fetchRequestCredentials)}resetSigningKeys(){this._signingKeys=null}async getMetadata(){const t=this._logger.create("getMetadata");if(this._metadata)return t.debug("using cached values"),this._metadata;if(!this._metadataUrl)throw t.throw(new Error("No authority or metadataUrl configured on settings")),null;t.debug("getting metadata from",this._metadataUrl);const e=await this._jsonService.getJson(this._metadataUrl,{credentials:this._fetchRequestCredentials});return t.debug("merging remote JSON with seed metadata"),this._metadata=Object.assign({},this._settings.metadataSeed,e),this._metadata}getIssuer(){return this._getMetadataProperty("issuer")}getAuthorizationEndpoint(){return this._getMetadataProperty("authorization_endpoint")}getUserInfoEndpoint(){return this._getMetadataProperty("userinfo_endpoint")}getTokenEndpoint(t=!0){return this._getMetadataProperty("token_endpoint",t)}getCheckSessionIframe(){return this._getMetadataProperty("check_session_iframe",!0)}getEndSessionEndpoint(){return this._getMetadataProperty("end_session_endpoint",!0)}getRevocationEndpoint(t=!0){return this._getMetadataProperty("revocation_endpoint",t)}getKeysEndpoint(t=!0){return this._getMetadataProperty("jwks_uri",t)}async _getMetadataProperty(t,e=!1){const n=this._logger.create(`_getMetadataProperty('${t}')`),r=await this.getMetadata();if(n.debug("resolved"),r[t]===void 0){if(e===!0){n.warn("Metadata does not contain optional property");return}n.throw(new Error("Metadata does not contain property "+t))}return r[t]}async getSigningKeys(){const t=this._logger.create("getSigningKeys");if(this._signingKeys)return t.debug("returning signingKeys from cache"),this._signingKeys;const e=await this.getKeysEndpoint(!1);t.debug("got jwks_uri",e);const n=await this._jsonService.getJson(e);if(t.debug("got key set",n),!Array.isArray(n.keys))throw t.throw(new Error("Missing keys on keyset")),null;return this._signingKeys=n.keys,this._signingKeys}},bie=class{constructor({prefix:t="oidc.",store:e=localStorage}={}){this._logger=new Rt("WebStorageStateStore"),this._store=e,this._prefix=t}async set(t,e){this._logger.create(`set('${t}')`),t=this._prefix+t,await this._store.setItem(t,e)}async get(t){return this._logger.create(`get('${t}')`),t=this._prefix+t,await this._store.getItem(t)}async remove(t){this._logger.create(`remove('${t}')`),t=this._prefix+t;const e=await this._store.getItem(t);return await this._store.removeItem(t),e}async getAllKeys(){this._logger.create("getAllKeys");const t=await this._store.length,e=[];for(let n=0;n{const r=this._logger.create("_getClaimsFromJwt");try{const i=$L.decode(n);return r.debug("JWT decoding successful"),i}catch(i){throw r.error("Error parsing JWT response"),i}},this._jsonService=new S5(void 0,this._getClaimsFromJwt,this._settings.extraHeaders)}async getClaims(t){const e=this._logger.create("getClaims");t||this._logger.throw(new Error("No token passed"));const n=await this._metadataService.getUserInfoEndpoint();e.debug("got userinfo url",n);const r=await this._jsonService.getJson(n,{token:t,credentials:this._settings.fetchRequestCredentials});return e.debug("got claims",r),r}},_ie=class{constructor(t,e){this._settings=t,this._metadataService=e,this._logger=new Rt("TokenClient"),this._jsonService=new S5(this._settings.revokeTokenAdditionalContentTypes,null,this._settings.extraHeaders)}async exchangeCode({grant_type:t="authorization_code",redirect_uri:e=this._settings.redirect_uri,client_id:n=this._settings.client_id,client_secret:r=this._settings.client_secret,...i}){const o=this._logger.create("exchangeCode");n||o.throw(new Error("A client_id is required")),e||o.throw(new Error("A redirect_uri is required")),i.code||o.throw(new Error("A code is required"));const a=new URLSearchParams({grant_type:t,redirect_uri:e});for(const[u,f]of Object.entries(i))f!=null&&a.set(u,f);let s;switch(this._settings.client_authentication){case"client_secret_basic":if(!r)throw o.throw(new Error("A client_secret is required")),null;s=Ml.generateBasicAuth(n,r);break;case"client_secret_post":a.append("client_id",n),r&&a.append("client_secret",r);break}const l=await this._metadataService.getTokenEndpoint(!1);o.debug("got token endpoint");const c=await this._jsonService.postForm(l,{body:a,basicAuth:s,initCredentials:this._settings.fetchRequestCredentials});return o.debug("got response"),c}async exchangeCredentials({grant_type:t="password",client_id:e=this._settings.client_id,client_secret:n=this._settings.client_secret,scope:r=this._settings.scope,...i}){const o=this._logger.create("exchangeCredentials");e||o.throw(new Error("A client_id is required"));const a=new URLSearchParams({grant_type:t,scope:r});for(const[u,f]of Object.entries(i))f!=null&&a.set(u,f);let s;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw o.throw(new Error("A client_secret is required")),null;s=Ml.generateBasicAuth(e,n);break;case"client_secret_post":a.append("client_id",e),n&&a.append("client_secret",n);break}const l=await this._metadataService.getTokenEndpoint(!1);o.debug("got token endpoint");const c=await this._jsonService.postForm(l,{body:a,basicAuth:s,initCredentials:this._settings.fetchRequestCredentials});return o.debug("got response"),c}async exchangeRefreshToken({grant_type:t="refresh_token",client_id:e=this._settings.client_id,client_secret:n=this._settings.client_secret,timeoutInSeconds:r,...i}){const o=this._logger.create("exchangeRefreshToken");e||o.throw(new Error("A client_id is required")),i.refresh_token||o.throw(new Error("A refresh_token is required"));const a=new URLSearchParams({grant_type:t});for(const[u,f]of Object.entries(i))Array.isArray(f)?f.forEach(d=>a.append(u,d)):f!=null&&a.set(u,f);let s;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw o.throw(new Error("A client_secret is required")),null;s=Ml.generateBasicAuth(e,n);break;case"client_secret_post":a.append("client_id",e),n&&a.append("client_secret",n);break}const l=await this._metadataService.getTokenEndpoint(!1);o.debug("got token endpoint");const c=await this._jsonService.postForm(l,{body:a,basicAuth:s,timeoutInSeconds:r,initCredentials:this._settings.fetchRequestCredentials});return o.debug("got response"),c}async revoke(t){var e;const n=this._logger.create("revoke");t.token||n.throw(new Error("A token is required"));const r=await this._metadataService.getRevocationEndpoint(!1);n.debug(`got revocation endpoint, revoking ${(e=t.token_type_hint)!=null?e:"default token type"}`);const i=new URLSearchParams;for(const[o,a]of Object.entries(t))a!=null&&i.set(o,a);i.set("client_id",this._settings.client_id),this._settings.client_secret&&i.set("client_secret",this._settings.client_secret),await this._jsonService.postForm(r,{body:i}),n.debug("got response")}},oNe=class{constructor(t,e,n){this._settings=t,this._metadataService=e,this._claimsService=n,this._logger=new Rt("ResponseValidator"),this._userInfoService=new iNe(this._settings,this._metadataService),this._tokenClient=new _ie(this._settings,this._metadataService)}async validateSigninResponse(t,e){const n=this._logger.create("validateSigninResponse");this._processSigninState(t,e),n.debug("state processed"),await this._processCode(t,e),n.debug("code processed"),t.isOpenId&&this._validateIdTokenAttributes(t),n.debug("tokens validated"),await this._processClaims(t,e==null?void 0:e.skipUserInfo,t.isOpenId),n.debug("claims processed")}async validateCredentialsResponse(t,e){const n=this._logger.create("validateCredentialsResponse");t.isOpenId&&t.id_token&&this._validateIdTokenAttributes(t),n.debug("tokens validated"),await this._processClaims(t,e,t.isOpenId),n.debug("claims processed")}async validateRefreshResponse(t,e){var n,r;const i=this._logger.create("validateRefreshResponse");t.userState=e.data,(n=t.session_state)!=null||(t.session_state=e.session_state),(r=t.scope)!=null||(t.scope=e.scope),t.isOpenId&&t.id_token&&(this._validateIdTokenAttributes(t,e.id_token),i.debug("ID Token validated")),t.id_token||(t.id_token=e.id_token,t.profile=e.profile);const o=t.isOpenId&&!!t.id_token;await this._processClaims(t,!1,o),i.debug("claims processed")}validateSignoutResponse(t,e){const n=this._logger.create("validateSignoutResponse");if(e.id!==t.state&&n.throw(new Error("State does not match")),n.debug("state validated"),t.userState=e.data,t.error)throw n.warn("Response was error",t.error),new Qh(t)}_processSigninState(t,e){var n;const r=this._logger.create("_processSigninState");if(e.id!==t.state&&r.throw(new Error("State does not match")),e.client_id||r.throw(new Error("No client_id on state")),e.authority||r.throw(new Error("No authority on state")),this._settings.authority!==e.authority&&r.throw(new Error("authority mismatch on settings vs. signin state")),this._settings.client_id&&this._settings.client_id!==e.client_id&&r.throw(new Error("client_id mismatch on settings vs. signin state")),r.debug("state validated"),t.userState=e.data,t.url_state=e.url_state,(n=t.scope)!=null||(t.scope=e.scope),t.error)throw r.warn("Response was error",t.error),new Qh(t);e.code_verifier&&!t.code&&r.throw(new Error("Expected code in response"))}async _processClaims(t,e=!1,n=!0){const r=this._logger.create("_processClaims");if(t.profile=this._claimsService.filterProtocolClaims(t.profile),e||!this._settings.loadUserInfo||!t.access_token){r.debug("not loading user info");return}r.debug("loading user info");const i=await this._userInfoService.getClaims(t.access_token);r.debug("user info claims received from user info endpoint"),n&&i.sub!==t.profile.sub&&r.throw(new Error("subject from UserInfo response does not match subject in ID Token")),t.profile=this._claimsService.mergeClaims(t.profile,this._claimsService.filterProtocolClaims(i)),r.debug("user info claims received, updated profile:",t.profile)}async _processCode(t,e){const n=this._logger.create("_processCode");if(t.code){n.debug("Validating code");const r=await this._tokenClient.exchangeCode({client_id:e.client_id,client_secret:e.client_secret,code:t.code,redirect_uri:e.redirect_uri,code_verifier:e.code_verifier,...e.extraTokenParams});Object.assign(t,r)}else n.debug("No code to process")}_validateIdTokenAttributes(t,e){var n;const r=this._logger.create("_validateIdTokenAttributes");r.debug("decoding ID Token JWT");const i=$L.decode((n=t.id_token)!=null?n:"");if(i.sub||r.throw(new Error("ID Token is missing a subject claim")),e){const o=$L.decode(e);i.sub!==o.sub&&r.throw(new Error("sub in id_token does not match current sub")),i.auth_time&&i.auth_time!==o.auth_time&&r.throw(new Error("auth_time in id_token does not match original auth_time")),i.azp&&i.azp!==o.azp&&r.throw(new Error("azp in id_token does not match original azp")),!i.azp&&o.azp&&r.throw(new Error("azp not in id_token, but present in original id_token"))}t.profile=i}},Yg=class{constructor(t){this.id=t.id||Ml.generateUUIDv4(),this.data=t.data,t.created&&t.created>0?this.created=t.created:this.created=ts.getEpochTime(),this.request_type=t.request_type,this.url_state=t.url_state}toStorageString(){return new Rt("State").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,url_state:this.url_state})}static fromStorageString(t){return Rt.createStatic("State","fromStorageString"),new Yg(JSON.parse(t))}static async clearStaleState(t,e){const n=Rt.createStatic("State","clearStaleState"),r=ts.getEpochTime()-e,i=await t.getAllKeys();n.debug("got keys",i);for(let o=0;oy.searchParams.append("resource",_));for(const[b,_]of Object.entries({response_mode:s,...v,...p}))_!=null&&y.searchParams.append(b,_.toString());this.url=y.href}},sNe="openid",SA=class{constructor(t){if(this.access_token="",this.token_type="",this.profile={},this.state=t.get("state"),this.session_state=t.get("session_state"),this.state){const e=decodeURIComponent(this.state).split(FL);this.state=e[0],e.length>1&&(this.url_state=e.slice(1).join(FL))}this.error=t.get("error"),this.error_description=t.get("error_description"),this.error_uri=t.get("error_uri"),this.code=t.get("code")}get expires_in(){if(this.expires_at!==void 0)return this.expires_at-ts.getEpochTime()}set expires_in(t){typeof t=="string"&&(t=Number(t)),t!==void 0&&t>=0&&(this.expires_at=Math.floor(t)+ts.getEpochTime())}get isOpenId(){var t;return((t=this.scope)==null?void 0:t.split(" ").includes(sNe))||!!this.id_token}},lNe=class{constructor({url:t,state_data:e,id_token_hint:n,post_logout_redirect_uri:r,extraQueryParams:i,request_type:o,client_id:a}){if(this._logger=new Rt("SignoutRequest"),!t)throw this._logger.error("ctor: No url passed"),new Error("url");const s=new URL(t);n&&s.searchParams.append("id_token_hint",n),a&&s.searchParams.append("client_id",a),r&&(s.searchParams.append("post_logout_redirect_uri",r),e&&(this.state=new Yg({data:e,request_type:o}),s.searchParams.append("state",this.state.id)));for(const[l,c]of Object.entries({...i}))c!=null&&s.searchParams.append(l,c.toString());this.url=s.href}},cNe=class{constructor(t){this.state=t.get("state"),this.error=t.get("error"),this.error_description=t.get("error_description"),this.error_uri=t.get("error_uri")}},uNe=["nbf","jti","auth_time","nonce","acr","amr","azp","at_hash"],fNe=["sub","iss","aud","exp","iat"],dNe=class{constructor(t){this._settings=t,this._logger=new Rt("ClaimsService")}filterProtocolClaims(t){const e={...t};if(this._settings.filterProtocolClaims){let n;Array.isArray(this._settings.filterProtocolClaims)?n=this._settings.filterProtocolClaims:n=uNe;for(const r of n)fNe.includes(r)||delete e[r]}return e}mergeClaims(t,e){const n={...t};for(const[r,i]of Object.entries(e))for(const o of Array.isArray(i)?i:[i]){const a=n[r];a===void 0?n[r]=o:Array.isArray(a)?a.includes(o)||a.push(o):n[r]!==o&&(typeof o=="object"&&this._settings.mergeClaims?n[r]=this.mergeClaims(a,o):n[r]=[a,o])}return n}},hNe=class{constructor(t,e){this._logger=new Rt("OidcClient"),this.settings=t instanceof jL?t:new jL(t),this.metadataService=e??new K3e(this.settings),this._claimsService=new dNe(this.settings),this._validator=new oNe(this.settings,this.metadataService,this._claimsService),this._tokenClient=new _ie(this.settings,this.metadataService)}async createSigninRequest({state:t,request:e,request_uri:n,request_type:r,id_token_hint:i,login_hint:o,skipUserInfo:a,nonce:s,url_state:l,response_type:c=this.settings.response_type,scope:u=this.settings.scope,redirect_uri:f=this.settings.redirect_uri,prompt:d=this.settings.prompt,display:h=this.settings.display,max_age:p=this.settings.max_age,ui_locales:m=this.settings.ui_locales,acr_values:g=this.settings.acr_values,resource:v=this.settings.resource,response_mode:y=this.settings.response_mode,extraQueryParams:x=this.settings.extraQueryParams,extraTokenParams:b=this.settings.extraTokenParams}){const _=this._logger.create("createSigninRequest");if(c!=="code")throw new Error("Only the Authorization Code flow (with PKCE) is supported");const S=await this.metadataService.getAuthorizationEndpoint();_.debug("Received authorization endpoint",S);const O=new aNe({url:S,authority:this.settings.authority,client_id:this.settings.client_id,redirect_uri:f,response_type:c,scope:u,state_data:t,url_state:l,prompt:d,display:h,max_age:p,ui_locales:m,id_token_hint:i,login_hint:o,acr_values:g,resource:v,request:e,request_uri:n,extraQueryParams:x,extraTokenParams:b,request_type:r,response_mode:y,client_secret:this.settings.client_secret,skipUserInfo:a,nonce:s,disablePKCE:this.settings.disablePKCE});await this.clearStaleState();const C=O.state;return await this.settings.stateStore.set(C.id,C.toStorageString()),O}async readSigninResponseState(t,e=!1){const n=this._logger.create("readSigninResponseState"),r=new SA(NL.readParams(t,this.settings.response_mode));if(!r.state)throw n.throw(new Error("No state in response")),null;const i=await this.settings.stateStore[e?"remove":"get"](r.state);if(!i)throw n.throw(new Error("No matching state found in storage")),null;return{state:O5.fromStorageString(i),response:r}}async processSigninResponse(t){const e=this._logger.create("processSigninResponse"),{state:n,response:r}=await this.readSigninResponseState(t,!0);return e.debug("received state from storage; validating response"),await this._validator.validateSigninResponse(r,n),r}async processResourceOwnerPasswordCredentials({username:t,password:e,skipUserInfo:n=!1,extraTokenParams:r={}}){const i=await this._tokenClient.exchangeCredentials({username:t,password:e,...r}),o=new SA(new URLSearchParams);return Object.assign(o,i),await this._validator.validateCredentialsResponse(o,n),o}async useRefreshToken({state:t,timeoutInSeconds:e}){var n;const r=this._logger.create("useRefreshToken");let i;if(this.settings.refreshTokenAllowedScope===void 0)i=t.scope;else{const s=this.settings.refreshTokenAllowedScope.split(" ");i=(((n=t.scope)==null?void 0:n.split(" "))||[]).filter(c=>s.includes(c)).join(" ")}const o=await this._tokenClient.exchangeRefreshToken({refresh_token:t.refresh_token,resource:t.resource,scope:i,timeoutInSeconds:e}),a=new SA(new URLSearchParams);return Object.assign(a,o),r.debug("validating response",a),await this._validator.validateRefreshResponse(a,{...t,scope:i}),a}async createSignoutRequest({state:t,id_token_hint:e,client_id:n,request_type:r,post_logout_redirect_uri:i=this.settings.post_logout_redirect_uri,extraQueryParams:o=this.settings.extraQueryParams}={}){const a=this._logger.create("createSignoutRequest"),s=await this.metadataService.getEndSessionEndpoint();if(!s)throw a.throw(new Error("No end session endpoint")),null;a.debug("Received end session endpoint",s),!n&&i&&!e&&(n=this.settings.client_id);const l=new lNe({url:s,id_token_hint:e,client_id:n,post_logout_redirect_uri:i,state_data:t,extraQueryParams:o,request_type:r});await this.clearStaleState();const c=l.state;return c&&(a.debug("Signout request has state to persist"),await this.settings.stateStore.set(c.id,c.toStorageString())),l}async readSignoutResponseState(t,e=!1){const n=this._logger.create("readSignoutResponseState"),r=new cNe(NL.readParams(t,this.settings.response_mode));if(!r.state){if(n.debug("No state in response"),r.error)throw n.warn("Response was error:",r.error),new Qh(r);return{state:void 0,response:r}}const i=await this.settings.stateStore[e?"remove":"get"](r.state);if(!i)throw n.throw(new Error("No matching state found in storage")),null;return{state:Yg.fromStorageString(i),response:r}}async processSignoutResponse(t){const e=this._logger.create("processSignoutResponse"),{state:n,response:r}=await this.readSignoutResponseState(t,!0);return n?(e.debug("Received state from storage; validating response"),this._validator.validateSignoutResponse(r,n)):e.debug("No state from storage; skipping response validation"),r}clearStaleState(){return this._logger.create("clearStaleState"),Yg.clearStaleState(this.settings.stateStore,this.settings.staleStateAgeInSeconds)}async revokeToken(t,e){return this._logger.create("revokeToken"),await this._tokenClient.revoke({token:t,token_type_hint:e})}},pNe=class{constructor(t){this._userManager=t,this._logger=new Rt("SessionMonitor"),this._start=async e=>{const n=e.session_state;if(!n)return;const r=this._logger.create("_start");if(e.profile?(this._sub=e.profile.sub,this._sid=e.profile.sid,r.debug("session_state",n,", sub",this._sub)):(this._sub=void 0,this._sid=void 0,r.debug("session_state",n,", anonymous user")),this._checkSessionIFrame){this._checkSessionIFrame.start(n);return}try{const i=await this._userManager.metadataService.getCheckSessionIframe();if(i){r.debug("initializing check session iframe");const o=this._userManager.settings.client_id,a=this._userManager.settings.checkSessionIntervalInSeconds,s=this._userManager.settings.stopCheckSessionOnError,l=new Y3e(this._callback,o,i,a,s);await l.load(),this._checkSessionIFrame=l,l.start(n)}else r.warn("no check session iframe found in the metadata")}catch(i){r.error("Error from getCheckSessionIframe:",i instanceof Error?i.message:i)}},this._stop=()=>{const e=this._logger.create("_stop");if(this._sub=void 0,this._sid=void 0,this._checkSessionIFrame&&this._checkSessionIFrame.stop(),this._userManager.settings.monitorAnonymousSession){const n=setInterval(async()=>{clearInterval(n);try{const r=await this._userManager.querySessionStatus();if(r){const i={session_state:r.session_state,profile:r.sub&&r.sid?{sub:r.sub,sid:r.sid}:null};this._start(i)}}catch(r){e.error("error from querySessionStatus",r instanceof Error?r.message:r)}},1e3)}},this._callback=async()=>{const e=this._logger.create("_callback");try{const n=await this._userManager.querySessionStatus();let r=!0;n&&this._checkSessionIFrame?n.sub===this._sub?(r=!1,this._checkSessionIFrame.start(n.session_state),n.sid===this._sid?e.debug("same sub still logged in at OP, restarting check session iframe; session_state",n.session_state):(e.debug("same sub still logged in at OP, session state has changed, restarting check session iframe; session_state",n.session_state),this._userManager.events._raiseUserSessionChanged())):e.debug("different subject signed into OP",n.sub):e.debug("subject no longer signed into OP"),r?this._sub?this._userManager.events._raiseUserSignedOut():this._userManager.events._raiseUserSignedIn():e.debug("no change in session detected, no event to raise")}catch(n){this._sub&&(e.debug("Error calling queryCurrentSigninSession; raising signed out event",n),this._userManager.events._raiseUserSignedOut())}},t||this._logger.throw(new Error("No user manager passed")),this._userManager.events.addUserLoaded(this._start),this._userManager.events.addUserUnloaded(this._stop),this._init().catch(e=>{this._logger.error(e)})}async _init(){this._logger.create("_init");const t=await this._userManager.getUser();if(t)this._start(t);else if(this._userManager.settings.monitorAnonymousSession){const e=await this._userManager.querySessionStatus();if(e){const n={session_state:e.session_state,profile:e.sub&&e.sid?{sub:e.sub,sid:e.sid}:null};this._start(n)}}}},OC=class{constructor(t){var e;this.id_token=t.id_token,this.session_state=(e=t.session_state)!=null?e:null,this.access_token=t.access_token,this.refresh_token=t.refresh_token,this.token_type=t.token_type,this.scope=t.scope,this.profile=t.profile,this.expires_at=t.expires_at,this.state=t.userState,this.url_state=t.url_state}get expires_in(){if(this.expires_at!==void 0)return this.expires_at-ts.getEpochTime()}set expires_in(t){t!==void 0&&(this.expires_at=Math.floor(t)+ts.getEpochTime())}get expired(){const t=this.expires_in;if(t!==void 0)return t<=0}get scopes(){var t,e;return(e=(t=this.scope)==null?void 0:t.split(" "))!=null?e:[]}toStorageString(){return new Rt("User").create("toStorageString"),JSON.stringify({id_token:this.id_token,session_state:this.session_state,access_token:this.access_token,refresh_token:this.refresh_token,token_type:this.token_type,scope:this.scope,profile:this.profile,expires_at:this.expires_at})}static fromStorageString(t){return Rt.createStatic("User","fromStorageString"),new OC(JSON.parse(t))}},q8="oidc-client",wie=class{constructor(){this._abort=new tf("Window navigation aborted"),this._disposeHandlers=new Set,this._window=null}async navigate(t){const e=this._logger.create("navigate");if(!this._window)throw new Error("Attempted to navigate on a disposed window");e.debug("setting URL in window"),this._window.location.replace(t.url);const{url:n,keepOpen:r}=await new Promise((i,o)=>{const a=s=>{var l;const c=s.data,u=(l=t.scriptOrigin)!=null?l:window.location.origin;if(!(s.origin!==u||(c==null?void 0:c.source)!==q8)){try{const f=NL.readParams(c.url,t.response_mode).get("state");if(f||e.warn("no state found in response url"),s.source!==this._window&&f!==t.state)return}catch{this._dispose(),o(new Error("Invalid response from window"))}i(c)}};window.addEventListener("message",a,!1),this._disposeHandlers.add(()=>window.removeEventListener("message",a,!1)),this._disposeHandlers.add(this._abort.addHandler(s=>{this._dispose(),o(s)}))});return e.debug("got response from window"),this._dispose(),r||this.close(),{url:n}}_dispose(){this._logger.create("_dispose");for(const t of this._disposeHandlers)t();this._disposeHandlers.clear()}static _notifyParent(t,e,n=!1,r=window.location.origin){t.postMessage({source:q8,url:e,keepOpen:n},r)}},Sie={location:!1,toolbar:!1,height:640,closePopupWindowAfterInSeconds:-1},Oie="_blank",mNe=60,gNe=2,Cie=10,vNe=class extends jL{constructor(t){const{popup_redirect_uri:e=t.redirect_uri,popup_post_logout_redirect_uri:n=t.post_logout_redirect_uri,popupWindowFeatures:r=Sie,popupWindowTarget:i=Oie,redirectMethod:o="assign",redirectTarget:a="self",iframeNotifyParentOrigin:s=t.iframeNotifyParentOrigin,iframeScriptOrigin:l=t.iframeScriptOrigin,silent_redirect_uri:c=t.redirect_uri,silentRequestTimeoutInSeconds:u=Cie,automaticSilentRenew:f=!0,validateSubOnSilentRenew:d=!0,includeIdTokenInSilentRenew:h=!1,monitorSession:p=!1,monitorAnonymousSession:m=!1,checkSessionIntervalInSeconds:g=gNe,query_status_response_type:v="code",stopCheckSessionOnError:y=!0,revokeTokenTypes:x=["access_token","refresh_token"],revokeTokensOnSignout:b=!1,includeIdTokenInSilentSignout:_=!1,accessTokenExpiringNotificationTimeInSeconds:S=mNe,userStore:O}=t;if(super(t),this.popup_redirect_uri=e,this.popup_post_logout_redirect_uri=n,this.popupWindowFeatures=r,this.popupWindowTarget=i,this.redirectMethod=o,this.redirectTarget=a,this.iframeNotifyParentOrigin=s,this.iframeScriptOrigin=l,this.silent_redirect_uri=c,this.silentRequestTimeoutInSeconds=u,this.automaticSilentRenew=f,this.validateSubOnSilentRenew=d,this.includeIdTokenInSilentRenew=h,this.monitorSession=p,this.monitorAnonymousSession=m,this.checkSessionIntervalInSeconds=g,this.stopCheckSessionOnError=y,this.query_status_response_type=v,this.revokeTokenTypes=x,this.revokeTokensOnSignout=b,this.includeIdTokenInSilentSignout=_,this.accessTokenExpiringNotificationTimeInSeconds=S,O)this.userStore=O;else{const C=typeof window<"u"?window.sessionStorage:new xie;this.userStore=new bie({store:C})}}},BL=class extends wie{constructor({silentRequestTimeoutInSeconds:t=Cie}){super(),this._logger=new Rt("IFrameWindow"),this._timeoutInSeconds=t,this._frame=BL.createHiddenIframe(),this._window=this._frame.contentWindow}static createHiddenIframe(){const t=window.document.createElement("iframe");return t.style.visibility="hidden",t.style.position="fixed",t.style.left="-1000px",t.style.top="0",t.width="0",t.height="0",window.document.body.appendChild(t),t}async navigate(t){this._logger.debug("navigate: Using timeout of:",this._timeoutInSeconds);const e=setTimeout(()=>this._abort.raise(new w5("IFrame timed out without a response")),this._timeoutInSeconds*1e3);return this._disposeHandlers.add(()=>clearTimeout(e)),await super.navigate(t)}close(){var t;this._frame&&(this._frame.parentNode&&(this._frame.addEventListener("load",e=>{var n;const r=e.target;(n=r.parentNode)==null||n.removeChild(r),this._abort.raise(new Error("IFrame removed from DOM"))},!0),(t=this._frame.contentWindow)==null||t.location.replace("about:blank")),this._frame=null),this._window=null}static notifyParent(t,e){return super._notifyParent(window.parent,t,!1,e)}},yNe=class{constructor(t){this._settings=t,this._logger=new Rt("IFrameNavigator")}async prepare({silentRequestTimeoutInSeconds:t=this._settings.silentRequestTimeoutInSeconds}){return new BL({silentRequestTimeoutInSeconds:t})}async callback(t){this._logger.create("callback"),BL.notifyParent(t,this._settings.iframeNotifyParentOrigin)}},xNe=500,bNe=1e3,X8=class extends wie{constructor({popupWindowTarget:t=Oie,popupWindowFeatures:e={}}){super(),this._logger=new Rt("PopupWindow");const n=H8.center({...Sie,...e});this._window=window.open(void 0,t,H8.serialize(n)),e.closePopupWindowAfterInSeconds&&e.closePopupWindowAfterInSeconds>0&&setTimeout(()=>{if(!this._window||typeof this._window.closed!="boolean"||this._window.closed){this._abort.raise(new Error("Popup blocked by user"));return}this.close()},e.closePopupWindowAfterInSeconds*bNe)}async navigate(t){var e;(e=this._window)==null||e.focus();const n=setInterval(()=>{(!this._window||this._window.closed)&&this._abort.raise(new Error("Popup closed by user"))},xNe);return this._disposeHandlers.add(()=>clearInterval(n)),await super.navigate(t)}close(){this._window&&(this._window.closed||(this._window.close(),this._abort.raise(new Error("Popup closed")))),this._window=null}static notifyOpener(t,e){if(!window.opener)throw new Error("No window.opener. Can't complete notification.");return super._notifyParent(window.opener,t,e)}},_Ne=class{constructor(t){this._settings=t,this._logger=new Rt("PopupNavigator")}async prepare({popupWindowFeatures:t=this._settings.popupWindowFeatures,popupWindowTarget:e=this._settings.popupWindowTarget}){return new X8({popupWindowFeatures:t,popupWindowTarget:e})}async callback(t,{keepOpen:e=!1}){this._logger.create("callback"),X8.notifyOpener(t,e)}},wNe=class{constructor(t){this._settings=t,this._logger=new Rt("RedirectNavigator")}async prepare({redirectMethod:t=this._settings.redirectMethod,redirectTarget:e=this._settings.redirectTarget}){var n;this._logger.create("prepare");let r=window.self;e==="top"&&(r=(n=window.top)!=null?n:window.self);const i=r.location[t].bind(r.location);let o;return{navigate:async a=>{this._logger.create("navigate");const s=new Promise((l,c)=>{o=c});return i(a.url),await s},close:()=>{this._logger.create("close"),o==null||o(new Error("Redirect aborted")),r.stop()}}}async callback(){}},SNe=class extends Q3e{constructor(t){super({expiringNotificationTimeInSeconds:t.accessTokenExpiringNotificationTimeInSeconds}),this._logger=new Rt("UserManagerEvents"),this._userLoaded=new tf("User loaded"),this._userUnloaded=new tf("User unloaded"),this._silentRenewError=new tf("Silent renew error"),this._userSignedIn=new tf("User signed in"),this._userSignedOut=new tf("User signed out"),this._userSessionChanged=new tf("User session changed")}load(t,e=!0){super.load(t),e&&this._userLoaded.raise(t)}unload(){super.unload(),this._userUnloaded.raise()}addUserLoaded(t){return this._userLoaded.addHandler(t)}removeUserLoaded(t){return this._userLoaded.removeHandler(t)}addUserUnloaded(t){return this._userUnloaded.addHandler(t)}removeUserUnloaded(t){return this._userUnloaded.removeHandler(t)}addSilentRenewError(t){return this._silentRenewError.addHandler(t)}removeSilentRenewError(t){return this._silentRenewError.removeHandler(t)}_raiseSilentRenewError(t){this._silentRenewError.raise(t)}addUserSignedIn(t){return this._userSignedIn.addHandler(t)}removeUserSignedIn(t){this._userSignedIn.removeHandler(t)}_raiseUserSignedIn(){this._userSignedIn.raise()}addUserSignedOut(t){return this._userSignedOut.addHandler(t)}removeUserSignedOut(t){this._userSignedOut.removeHandler(t)}_raiseUserSignedOut(){this._userSignedOut.raise()}addUserSessionChanged(t){return this._userSessionChanged.addHandler(t)}removeUserSessionChanged(t){this._userSessionChanged.removeHandler(t)}_raiseUserSessionChanged(){this._userSessionChanged.raise()}},ONe=class{constructor(t){this._userManager=t,this._logger=new Rt("SilentRenewService"),this._isStarted=!1,this._retryTimer=new ts("Retry Silent Renew"),this._tokenExpiring=async()=>{const e=this._logger.create("_tokenExpiring");try{await this._userManager.signinSilent(),e.debug("silent token renewal successful")}catch(n){if(n instanceof w5){e.warn("ErrorTimeout from signinSilent:",n,"retry in 5s"),this._retryTimer.init(5);return}e.error("Error from signinSilent:",n),this._userManager.events._raiseSilentRenewError(n)}}}async start(){const t=this._logger.create("start");if(!this._isStarted){this._isStarted=!0,this._userManager.events.addAccessTokenExpiring(this._tokenExpiring),this._retryTimer.addHandler(this._tokenExpiring);try{await this._userManager.getUser()}catch(e){t.error("getUser error",e)}}}stop(){this._isStarted&&(this._retryTimer.cancel(),this._retryTimer.removeHandler(this._tokenExpiring),this._userManager.events.removeAccessTokenExpiring(this._tokenExpiring),this._isStarted=!1)}},CNe=class{constructor(t,e){this.refresh_token=t.refresh_token,this.id_token=t.id_token,this.session_state=t.session_state,this.scope=t.scope,this.profile=t.profile,this.resource=e,this.data=t.state}},TNe=class{constructor(t,e,n,r){this._logger=new Rt("UserManager"),this.settings=new vNe(t),this._client=new hNe(t),this._redirectNavigator=e??new wNe(this.settings),this._popupNavigator=n??new _Ne(this.settings),this._iframeNavigator=r??new yNe(this.settings),this._events=new SNe(this.settings),this._silentRenewService=new ONe(this),this.settings.automaticSilentRenew&&this.startSilentRenew(),this._sessionMonitor=null,this.settings.monitorSession&&(this._sessionMonitor=new pNe(this))}get events(){return this._events}get metadataService(){return this._client.metadataService}async getUser(){const t=this._logger.create("getUser"),e=await this._loadUser();return e?(t.info("user loaded"),this._events.load(e,!1),e):(t.info("user not found in storage"),null)}async removeUser(){const t=this._logger.create("removeUser");await this.storeUser(null),t.info("user removed from storage"),this._events.unload()}async signinRedirect(t={}){this._logger.create("signinRedirect");const{redirectMethod:e,...n}=t,r=await this._redirectNavigator.prepare({redirectMethod:e});await this._signinStart({request_type:"si:r",...n},r)}async signinRedirectCallback(t=window.location.href){const e=this._logger.create("signinRedirectCallback"),n=await this._signinEnd(t);return n.profile&&n.profile.sub?e.info("success, signed in subject",n.profile.sub):e.info("no subject"),n}async signinResourceOwnerCredentials({username:t,password:e,skipUserInfo:n=!1}){const r=this._logger.create("signinResourceOwnerCredential"),i=await this._client.processResourceOwnerPasswordCredentials({username:t,password:e,skipUserInfo:n,extraTokenParams:this.settings.extraTokenParams});r.debug("got signin response");const o=await this._buildUser(i);return o.profile&&o.profile.sub?r.info("success, signed in subject",o.profile.sub):r.info("no subject"),o}async signinPopup(t={}){const e=this._logger.create("signinPopup"),{popupWindowFeatures:n,popupWindowTarget:r,...i}=t,o=this.settings.popup_redirect_uri;o||e.throw(new Error("No popup_redirect_uri configured"));const a=await this._popupNavigator.prepare({popupWindowFeatures:n,popupWindowTarget:r}),s=await this._signin({request_type:"si:p",redirect_uri:o,display:"popup",...i},a);return s&&(s.profile&&s.profile.sub?e.info("success, signed in subject",s.profile.sub):e.info("no subject")),s}async signinPopupCallback(t=window.location.href,e=!1){const n=this._logger.create("signinPopupCallback");await this._popupNavigator.callback(t,{keepOpen:e}),n.info("success")}async signinSilent(t={}){var e;const n=this._logger.create("signinSilent"),{silentRequestTimeoutInSeconds:r,resource:i,...o}=t;let a=await this._loadUser();if(a!=null&&a.refresh_token){n.debug("using refresh token");const u=new CNe(a,i);return await this._useRefreshToken(u)}const s=this.settings.silent_redirect_uri;s||n.throw(new Error("No silent_redirect_uri configured"));let l;a&&this.settings.validateSubOnSilentRenew&&(n.debug("subject prior to silent renew:",a.profile.sub),l=a.profile.sub);const c=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:r});return a=await this._signin({request_type:"si:s",redirect_uri:s,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?a==null?void 0:a.id_token:void 0,...o},c,l),a&&((e=a.profile)!=null&&e.sub?n.info("success, signed in subject",a.profile.sub):n.info("no subject")),a}async _useRefreshToken(t){const e=await this._client.useRefreshToken({state:t,timeoutInSeconds:this.settings.silentRequestTimeoutInSeconds}),n=new OC({...t,...e});return await this.storeUser(n),this._events.load(n),n}async signinSilentCallback(t=window.location.href){const e=this._logger.create("signinSilentCallback");await this._iframeNavigator.callback(t),e.info("success")}async signinCallback(t=window.location.href){const{state:e}=await this._client.readSigninResponseState(t);switch(e.request_type){case"si:r":return await this.signinRedirectCallback(t);case"si:p":return await this.signinPopupCallback(t);case"si:s":return await this.signinSilentCallback(t);default:throw new Error("invalid response_type in state")}}async signoutCallback(t=window.location.href,e=!1){const{state:n}=await this._client.readSignoutResponseState(t);if(n)switch(n.request_type){case"so:r":await this.signoutRedirectCallback(t);break;case"so:p":await this.signoutPopupCallback(t,e);break;case"so:s":await this.signoutSilentCallback(t);break;default:throw new Error("invalid response_type in state")}}async querySessionStatus(t={}){const e=this._logger.create("querySessionStatus"),{silentRequestTimeoutInSeconds:n,...r}=t,i=this.settings.silent_redirect_uri;i||e.throw(new Error("No silent_redirect_uri configured"));const o=await this._loadUser(),a=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:n}),s=await this._signinStart({request_type:"si:s",redirect_uri:i,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?o==null?void 0:o.id_token:void 0,response_type:this.settings.query_status_response_type,scope:"openid",skipUserInfo:!0,...r},a);try{const l=await this._client.processSigninResponse(s.url);return e.debug("got signin response"),l.session_state&&l.profile.sub?(e.info("success for subject",l.profile.sub),{session_state:l.session_state,sub:l.profile.sub,sid:l.profile.sid}):(e.info("success, user not authenticated"),null)}catch(l){if(this.settings.monitorAnonymousSession&&l instanceof Qh)switch(l.error){case"login_required":case"consent_required":case"interaction_required":case"account_selection_required":return e.info("success for anonymous user"),{session_state:l.session_state}}throw l}}async _signin(t,e,n){const r=await this._signinStart(t,e);return await this._signinEnd(r.url,n)}async _signinStart(t,e){const n=this._logger.create("_signinStart");try{const r=await this._client.createSigninRequest(t);return n.debug("got signin request"),await e.navigate({url:r.url,state:r.state.id,response_mode:r.state.response_mode,scriptOrigin:this.settings.iframeScriptOrigin})}catch(r){throw n.debug("error after preparing navigator, closing navigator window"),e.close(),r}}async _signinEnd(t,e){const n=this._logger.create("_signinEnd"),r=await this._client.processSigninResponse(t);return n.debug("got signin response"),await this._buildUser(r,e)}async _buildUser(t,e){const n=this._logger.create("_buildUser"),r=new OC(t);if(e){if(e!==r.profile.sub)throw n.debug("current user does not match user returned from signin. sub from signin:",r.profile.sub),new Qh({...t,error:"login_required"});n.debug("current user matches user returned from signin")}return await this.storeUser(r),n.debug("user stored"),this._events.load(r),r}async signoutRedirect(t={}){const e=this._logger.create("signoutRedirect"),{redirectMethod:n,...r}=t,i=await this._redirectNavigator.prepare({redirectMethod:n});await this._signoutStart({request_type:"so:r",post_logout_redirect_uri:this.settings.post_logout_redirect_uri,...r},i),e.info("success")}async signoutRedirectCallback(t=window.location.href){const e=this._logger.create("signoutRedirectCallback"),n=await this._signoutEnd(t);return e.info("success"),n}async signoutPopup(t={}){const e=this._logger.create("signoutPopup"),{popupWindowFeatures:n,popupWindowTarget:r,...i}=t,o=this.settings.popup_post_logout_redirect_uri,a=await this._popupNavigator.prepare({popupWindowFeatures:n,popupWindowTarget:r});await this._signout({request_type:"so:p",post_logout_redirect_uri:o,state:o==null?void 0:{},...i},a),e.info("success")}async signoutPopupCallback(t=window.location.href,e=!1){const n=this._logger.create("signoutPopupCallback");await this._popupNavigator.callback(t,{keepOpen:e}),n.info("success")}async _signout(t,e){const n=await this._signoutStart(t,e);return await this._signoutEnd(n.url)}async _signoutStart(t={},e){var n;const r=this._logger.create("_signoutStart");try{const i=await this._loadUser();r.debug("loaded current user from storage"),this.settings.revokeTokensOnSignout&&await this._revokeInternal(i);const o=t.id_token_hint||i&&i.id_token;o&&(r.debug("setting id_token_hint in signout request"),t.id_token_hint=o),await this.removeUser(),r.debug("user removed, creating signout request");const a=await this._client.createSignoutRequest(t);return r.debug("got signout request"),await e.navigate({url:a.url,state:(n=a.state)==null?void 0:n.id,scriptOrigin:this.settings.iframeScriptOrigin})}catch(i){throw r.debug("error after preparing navigator, closing navigator window"),e.close(),i}}async _signoutEnd(t){const e=this._logger.create("_signoutEnd"),n=await this._client.processSignoutResponse(t);return e.debug("got signout response"),n}async signoutSilent(t={}){var e;const n=this._logger.create("signoutSilent"),{silentRequestTimeoutInSeconds:r,...i}=t,o=this.settings.includeIdTokenInSilentSignout?(e=await this._loadUser())==null?void 0:e.id_token:void 0,a=this.settings.popup_post_logout_redirect_uri,s=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:r});await this._signout({request_type:"so:s",post_logout_redirect_uri:a,id_token_hint:o,...i},s),n.info("success")}async signoutSilentCallback(t=window.location.href){const e=this._logger.create("signoutSilentCallback");await this._iframeNavigator.callback(t),e.info("success")}async revokeTokens(t){const e=await this._loadUser();await this._revokeInternal(e,t)}async _revokeInternal(t,e=this.settings.revokeTokenTypes){const n=this._logger.create("_revokeInternal");if(!t)return;const r=e.filter(i=>typeof t[i]=="string");if(!r.length){n.debug("no need to revoke due to no token(s)");return}for(const i of r)await this._client.revokeToken(t[i],i),n.info(`${i} revoked successfully`),i!=="access_token"&&(t[i]=null);await this.storeUser(t),n.debug("user stored"),this._events.load(t)}startSilentRenew(){this._logger.create("startSilentRenew"),this._silentRenewService.start()}stopSilentRenew(){this._silentRenewService.stop()}get _userStoreKey(){return`user:${this.settings.authority}:${this.settings.client_id}`}async _loadUser(){const t=this._logger.create("_loadUser"),e=await this.settings.userStore.get(this._userStoreKey);return e?(t.debug("user storageString loaded"),OC.fromStorageString(e)):(t.debug("no user storageString"),null)}async storeUser(t){const e=this._logger.create("storeUser");if(t){e.debug("storing user");const n=t.toStorageString();await this.settings.userStore.set(this._userStoreKey,n)}else this._logger.debug("removing user"),await this.settings.userStore.remove(this._userStoreKey)}async clearStaleState(){await this._client.clearStaleState()}},C5=ue.createContext(void 0);C5.displayName="AuthContext";var ENe={isLoading:!0,isAuthenticated:!1},PNe=(t,e)=>{switch(e.type){case"INITIALISED":case"USER_LOADED":return{...t,user:e.user,isLoading:!1,isAuthenticated:e.user?!e.user.expired:!1,error:void 0};case"USER_UNLOADED":return{...t,user:void 0,isAuthenticated:!1};case"NAVIGATOR_INIT":return{...t,isLoading:!0,activeNavigator:e.method};case"NAVIGATOR_CLOSE":return{...t,isLoading:!1,activeNavigator:void 0};case"ERROR":return{...t,isLoading:!1,error:e.error};default:return{...t,isLoading:!1,error:new Error(`unknown type ${e.type}`)}}},MNe=(t=window.location)=>{let e=new URLSearchParams(t.search);return!!((e.get("code")||e.get("error"))&&e.get("state")||(e=new URLSearchParams(t.hash.replace("#","?")),(e.get("code")||e.get("error"))&&e.get("state")))},kNe=t=>e=>e instanceof Error?e:new Error(t),ANe=kNe("Login failed"),RNe=["clearStaleState","querySessionStatus","revokeTokens","startSilentRenew","stopSilentRenew"],INe=["signinPopup","signinSilent","signinRedirect","signinResourceOwnerCredentials","signoutPopup","signoutRedirect","signoutSilent"],OA=t=>()=>{throw new Error(`UserManager#${t} was called from an unsupported context. If this is a server-rendered page, defer this call with useEffect() or pass a custom UserManager implementation.`)},DNe=typeof window>"u"?null:TNe,LNe=t=>{const{children:e,onSigninCallback:n,skipSigninCallback:r,onRemoveUser:i,onSignoutRedirect:o,onSignoutPopup:a,implementation:s=DNe,userManager:l,...c}=t,[u]=M.useState(()=>l??(s?new s(c):{settings:c})),[f,d]=M.useReducer(PNe,ENe),h=M.useMemo(()=>Object.assign({settings:u.settings,events:u.events},Object.fromEntries(RNe.map(x=>{var b,_;return[x,(_=(b=u[x])==null?void 0:b.bind(u))!=null?_:OA(x)]})),Object.fromEntries(INe.map(x=>[x,u[x]?async b=>{d({type:"NAVIGATOR_INIT",method:x});try{return await u[x](b)}catch(_){return d({type:"ERROR",error:_}),null}finally{d({type:"NAVIGATOR_CLOSE"})}}:OA(x)]))),[u]),p=M.useRef(!1);M.useEffect(()=>{!u||p.current||(p.current=!0,(async()=>{let x=null;try{MNe()&&!r&&(x=await u.signinCallback(),n&&await n(x)),x=x||await u.getUser(),d({type:"INITIALISED",user:x})}catch(b){d({type:"ERROR",error:ANe(b)})}})())},[u,r,n]),M.useEffect(()=>{if(!u)return;const x=S=>{d({type:"USER_LOADED",user:S})};u.events.addUserLoaded(x);const b=()=>{d({type:"USER_UNLOADED"})};u.events.addUserUnloaded(b);const _=S=>{d({type:"ERROR",error:S})};return u.events.addSilentRenewError(_),()=>{u.events.removeUserLoaded(x),u.events.removeUserUnloaded(b),u.events.removeSilentRenewError(_)}},[u]);const m=M.useCallback(u?()=>u.removeUser().then(i):OA("removeUser"),[u,i]),g=M.useCallback(x=>h.signoutRedirect(x).then(o),[h.signoutRedirect,o]),v=M.useCallback(x=>h.signoutPopup(x).then(a),[h.signoutPopup,a]),y=M.useCallback(x=>h.signoutSilent(x),[h.signoutSilent]);return ue.createElement(C5.Provider,{value:{...f,...h,removeUser:m,signoutRedirect:g,signoutPopup:v,signoutSilent:y}},e)},$Ne=()=>{const t=ue.useContext(C5);return t||console.warn("AuthProvider context is undefined, please verify you are calling useAuth() as child of a component."),t};const Q8="color:green;font-weight:bold;",NNe="color:blue;font-weight:bold;";class FNe{constructor(e){Yt(this,"_languages");Yt(this,"_content");Yt(this,"_locale");const n=Object.getOwnPropertyNames(e.languages);if(n.findIndex(i=>i==="en")<0)throw new Error('Internal error: locale "en" must be included in supported languages');const r={};e.dictionary.forEach((i,o)=>{n.forEach(s=>{if(!i[s])throw new Error(`Internal error: invalid entry at index ${o} in "./resources/lang.json": missing translation for locale: "${s}": ${i}`)});const a=Y8(i.en);r[a]&&console.warn(`Translation already defined for "${i.en}".`),r[a]=i}),this._languages=e.languages,this._content=r,this._locale="en"}get languages(){return this._languages}get locale(){return this._locale}set locale(e){const n=Object.getOwnPropertyNames(this._languages);if(n.findIndex(r=>r===e)<0){const r=e.split("-")[0];if(n.findIndex(i=>i===r)<0){console.error(`No translations found for locale "${e}", staying with "${this._locale}".`);return}else console.warn(`No translations found for locale "${e}", falling back to "${r}".`),e=r}this._locale=e}get(e,n){const r=Y8(e),i=this._content[r];let o;return i?(o=i[this._locale],o||(console.debug(`missing translation of phrase %c${e}`,Q8,` for locale %c${this._locale}`,NNe),o=e)):(console.debug(`missing translation for phrase %c${e}`,Q8),o=e),n&&Object.keys(n).forEach(a=>{o=o.replace("${"+a+"}",`${n[a]}`)}),o}}const jNe=()=>{let t;return navigator.languages&&navigator.languages.length>0?t=navigator.languages[0]:t=navigator.language||navigator.userLanguage||navigator.browserLanguage||"en",t.split("-")[0]},Y8=t=>t.toLowerCase(),BNe={en:"English",de:"Deutsch",se:"Svenska"},zNe=[{en:"OK",de:"OK",se:"OK"},{en:"Cancel",de:"Abbrechen",se:"Avbryt"},{en:"Save",de:"Speichern",se:"Spara"},{en:"Select",de:"Auswählen",se:"Välj"},{en:"Add",de:"Hinzufügen",se:"Lägg till"},{en:"Edit",de:"Bearbeiten",se:"Redigera"},{en:"Remove",de:"Entfernen",se:"Ta bort"},{en:"Dataset",de:"Datensatz",se:"Dataset"},{en:"Variable",de:"Variable",se:"Variabel"},{en:"My places",de:"Meine Orte",se:"Mina platser"},{en:"Loading places",de:"Lade Orte",se:"Laddar platser"},{en:"Places",de:"Orte",se:"Platser"},{en:"Place",de:"Ort",se:"Plats"},{en:"Time",de:"Zeit",se:"Tid"},{en:"Missing time axis",de:"Fehlende Zeitachse",se:"Saknar tidsaxel"},{en:"Geometry type",de:"Geometry-Typ",se:"Geometri typ"},{en:"Point",de:"Punkt",se:"Punkt"},{en:"Polygon",de:"Polygon",se:"Polygon"},{en:"Circle",de:"Kreis",se:"Cirkel"},{en:"Multi",de:"Multi",se:"Multi"},{en:"Something went wrong.",de:"Irgendetwas lief schief.",se:"Något gick fel."},{en:"Time-Series",de:"Zeitserie",se:"Tidsserier"},{en:"Quantity",de:"Größe",se:"Kvantitet"},{en:"unknown units",de:"unbekannte Einheiten",se:"okända enheter"},{en:"Values",de:"Werte",se:"Värden"},{en:"Start",de:"Start",se:"Start"},{en:"Stop",de:"Stopp",se:"Stopp"},{en:"Please wait...",de:"Bitte warten...",se:"Vänta ..."},{en:"Loading data",de:"Lade Daten",se:"Laddar data"},{en:"Connecting to server",de:"Verbindung zum Server wird hergestellt",se:"Ansluta till servern"},{en:"Cannot reach server",de:"Kann Server nicht erreichen",se:"Kan inte nå servern"},{en:"Language",de:"Sprache",se:"Språk"},{en:"Settings",de:"Einstellungen",se:"Inställningar"},{en:"General",de:"Allgemein",se:"Allmänhet"},{en:"System Information",de:"Systeminformation",se:"Systeminformation"},{en:"version",de:"Version",se:"Version"},{en:"Server",de:"Server",se:"Server"},{en:"Add Server",de:"Server hinzufügen",se:"Lägg till server"},{en:"Edit Server",de:"Server bearbeiten",se:"Redigera server"},{en:"Select Server",de:"Server auswählen",se:"Välj server"},{en:"On",de:"An",se:"På"},{en:"Off",de:"Aus",se:"Av"},{en:"Time interval of the player",de:"Zeitintervall des Abspielers",se:"Spelarens tidsintervall"},{en:"Show chart after adding a place",de:"Diagram anzeigen, nachdem ein Ort hinzugefügt wurde",se:"Visa diagram efter att du har lagt till en plats"},{en:"Calculate standard deviation",de:"Berechne Standardabweichung",se:"Beräkna standardavvikelsen"},{en:"Calculate median instead of mean (disables standard deviation)",de:"Median statt Mittelwert berechnen (deaktiviert Standardabweichung)",se:"Beräkna median istället för medelvärde (inaktiverar standardavvikelse)"},{en:"Minimal number of data points in a time series update",de:"Minimale Anzahl Datenpunkte in einer Zeitreihen-Aktualisierung",se:"Minimalt antal datapunkter i en tidsserieuppdatering"},{en:"Map",de:"Karte",se:"Karta"},{en:"Projection",de:"Projektion",se:"Projektion"},{en:"Geographic",de:"Geografisch",se:"Geografiskt"},{en:"Mercator",de:"Mercator",se:"Mercator"},{en:"Image smoothing",de:"Bildglättung",se:"Bildutjämning"},{en:"Show dataset boundaries",de:"Datensatzgrenzen anzeigen",se:"Visa datauppsättningsgränser"},{en:"Base map",de:"Basiskarte",se:"Grundkarta"},{en:"Hide small values",de:"Kleine Werte ausblenden",se:"Dölja små värden"},{en:"Reverse",de:"Umkehren",se:"Omvänt"},{en:"Color",de:"Farbe",se:"Färg"},{en:"Opacity",de:"Opazität",se:"Opacitet"},{en:"Value Range",de:"Wertebereich",se:"Värdeintervall"},{en:"Assign min/max from color mapping values",de:"Min./Max. aus Farbzuordnungswerten übertragen",se:"Tilldela min/max från färgmappningsvärden"},{en:"Log-scaled",de:"Log-skaliert",se:"Log-skalad"},{en:"Logarithmic scaling",de:"Logarithmische Skalierung",se:"Logaritmisk skalning"},{en:"Others",de:"Andere",se:"Andra"},{en:"Dataset information",de:"Informationen zum Datensatz",se:"Information om dataset"},{en:"Variable information",de:"Informationen zur Variablen",se:"Information om variabeln"},{en:"Place information",de:"Informationen zum Ort",se:"Platsinformation"},{en:"Dimension names",de:"Namen der Dimensionen",se:"Dimensioner namn"},{en:"Dimension data types",de:"Datentypen der Dimensionen",se:"Dimensionsdatatyper"},{en:"Dimension lengths",de:"Länge der Dimensionen",se:"Måttlängder"},{en:"Time chunk size",de:"Zeitblockgröße",se:"Tidsblockstorlek"},{en:"Geographical extent",de:"Geografische Ausdehnung",se:"Geografisk omfattning"},{en:"Spatial reference system",de:"Räumliches Bezugssystem",se:"Rumsligt referenssystem"},{en:"Name",de:"Name",se:"Namn"},{en:"Title",de:"Titel",se:"Titel"},{en:"Units",de:"Einheiten",se:"Enheter"},{en:"Expression",de:"Ausdruck",se:"Uttryck"},{en:"Data type",de:"Datentyp",se:"Datatyp"},{en:"There is no information available for this location.",de:"Zu diesem Ort sind keine keine Informationen vorhanden.",se:"Det finns ingen information tillgänglig för den här platsen."},{en:"Log out",de:"Abmelden",se:"Logga ut"},{en:"Profile",de:"Profil",se:"Profil"},{en:"User Profile",de:"Nutzerprofil",se:"Användarprofil"},{en:"User name",de:"Nutzername",se:"Användarnamn"},{en:"E-mail",de:"E-mail",se:"E-post"},{en:"Nickname",de:"Spitzname",se:"Smeknamn"},{en:"verified",de:"verifiziert",se:"verified"},{en:"not verified",de:"nicht verifiziert",se:"inte verifierad"},{en:"RGB",de:"RGB",se:"RGB"},{en:"Imprint",de:"Impressum",se:"Avtryck"},{en:"User Manual",de:"Benutzerhandbuch",se:"Användarmanual"},{en:"Show time-series diagram",de:"Zeitserien-Diagramm anzeigen",se:"Visa tidsseriediagram"},{en:"Help",de:"Hilfe",se:"Hjälp"},{en:"Copy snapshot of chart to clipboard",de:"Schnappschuss des Diagramms in die Zwischenablage kopieren",se:"Kopiera ögonblicksbild av diagrammet till urklipp"},{en:"Snapshot copied to clipboard",de:"Schnappschuss wurde in die Zwischenablage kopiert",se:"Ögonblicksbild har kopierats till urklipp"},{en:"Error copying snapshot to clipboard",de:"Fehler beim Kopieren des Schnappschusses in die Zwischenablage",se:"Det gick inte att kopiera ögonblicksbilden till urklipp"},{en:"Export data",de:"Daten exportieren",se:"Exportera data"},{en:"Export Settings",de:"Export-Einstellungen",se:"Exportera Inställningar"},{en:"Include time-series data",de:"Zeitseriendaten einschließen",se:"Inkludera tidsseriedata"},{en:"Include places data",de:"Ortsdaten einschließen",se:"Inkludera platsdata"},{en:"File name",de:"Dateiname",se:"Filnamn"},{en:"Separator for time-series data",de:"Trennzeichen für Zeitreihendaten",se:"Separator för tidsseriedata"},{en:"Combine place data in one file",de:"Ortsdaten in einer Datei zusammenfassen",se:"Kombinera platsdata i en fil"},{en:"As ZIP archive",de:"Als ZIP-Archiv",se:"Som ett ZIP-arkiv"},{en:"Download",de:"Herunterladen",se:"Ladda ner"},{en:"Locate place in map",de:"Lokalisiere Ort in Karte",se:"Leta upp plats på kartan"},{en:"Locate dataset in map",de:"Lokalisiere Datensatz in Karte",se:"Leta upp dataset på kartan"},{en:"Open information panel",de:"Informationsfeld öffnen",se:"Öppet informationsfält"},{en:"Select a place in map",de:"Ort in der Karte auswählen",se:"Välj plats på kartan"},{en:"Add a point location in map",de:"Punkt zur Karte hinzufügen",se:"Lägg till punkt på kartan"},{en:"Draw a polygon area in map",de:"Polygonale Fläche in der Karte zeichnen",se:"Rita en polygonal yta på kartan"},{en:"Draw a circular area in map",de:"Kreisförmige Fläche in der Karte zeichnen",se:"Rita ett cirkulärt område på kartan"},{en:"Rename place",de:"Ort umbenennen",se:"Byt namn på plats"},{en:"Remove place",de:"Ort entfernen",se:"Ta bort plats"},{en:"Rename place group",de:"Ortsgruppe umbenennen",se:"Byt namn på platsgrupp"},{en:"Remove places",de:"Orte entfernen",se:"Ta bort platser"},{en:"Show RGB layer instead",de:"Stattdessen RGB-Layer anzeigen",se:"Visa RGB-lager istället"},{en:"Auto-step through times in the dataset",de:"Zeiten im Datensatz automatisch durchlaufen",se:"Kör automatiskt genom tider i dataposten"},{en:"Select time in dataset",de:"Datensatz-Zeit auswählen",se:"Välj tid i dataset"},{en:"Refresh",de:"Aktualisieren",se:"Att uppdatera"},{en:"Accept and continue",de:"Akzeptieren und weiter",se:"Acceptera och fortsätt"},{en:"Leave",de:"Verlassen",se:"Lämna"},{en:"Import places",de:"Orte importieren",se:"Importera platser"},{en:"Text/CSV",de:"Text/CSV",se:"Text/CSV"},{en:"GeoJSON",de:"GeoJSON",se:"GeoJSON"},{en:"WKT",de:"WKT",se:"WKT"},{en:"Enter text or drag & drop a text file.",de:"Text eingeben oder Textdatei per Drag & Drop einfügen.",se:"Skriv in text eller dra och släpp en textfil."},{en:"From File",de:"Aus Datei",se:"Från fil"},{en:"Clear",de:"Löschen",se:"Tömma"},{en:"Options",de:"Optionen",se:"Alternativ"},{en:"Time (UTC, ISO-format)",de:"Zeit (UTC, ISO-Format)",se:"Tid (UTC, ISO-format)"},{en:"Group",de:"Gruppe",se:"Grupp"},{en:"Label",de:"Label",se:"Etikett"},{en:"Time property names",de:"Eigenschaftsnamen für Zeit",se:"Gruppegendomsnamn"},{en:"Group property names",de:"Eigenschaftsnamen für Gruppe",se:"Gruppegendomsnamn"},{en:"Label property names",de:"Eigenschaftsnamen für Label",se:"Etikett egendomsnamn"},{en:"Group prefix (used as fallback)",de:"Gruppen-Präfix (als Fallback verwendet)",se:"Gruppprefix (används som reserv)"},{en:"Label prefix (used as fallback)",de:"Label-Präfix (als Fallback verwendet)",se:"Etikettprefix (används som reserv)"},{en:"X/longitude column names",de:"Spaltennamen für y/Längengrad",se:"X/longitud kolumnnamn"},{en:"Y/latitude column names",de:"Spaltennamen für y/Breitengrad",se:"Y/latitud kolumnnamn"},{en:"Geometry column names",de:"Spaltennamen für Geometrie",se:"Geometrikolumnnamn"},{en:"Time column names",de:"Spaltennamen für Zeit",se:"Tidskolumnnamn"},{en:"Group column names",de:"Spaltennamen für Gruppe",se:"Gruppkolumnnamn"},{en:"Label column names",de:"Spaltennamen für Label",se:"Etikettkolumnnamn"},{en:"Separator character",de:"Trennzeichen",se:"Skiljetecken"},{en:"Comment character",de:"Kommentar-Zeichen",se:"Kommentar karaktär"},{en:"Quote character",de:"Zitierzeichen",se:"Citat karaktär"},{en:"Escape character",de:"Escape character",se:"Escape karaktär"},{en:"Not-a-number token",de:"Token für 'keine Zahl'",se:"Not-a-number token"},{en:"True token",de:"Token für 'wahr'",se:"Sann token"},{en:"False token",de:"Token für 'falsch'",se:"Falsk token"},{en:"Revoke consent",de:"Zustimmung widerrufen",se:"Återkalla samtycke "},{en:"Accepted",de:"Akzeptiert",se:"Accepterad"},{en:"Legal Agreement",de:"Rechtliches Übereinkommen",se:"Laglig Överenskommelse"},{en:"Privacy Notice",de:"Datenschutzhinweis",se:"Sekretessmeddelande"},{en:"WMS URL",de:"WMS URL",se:"WMS URL"},{en:"WMS Layer",de:"WMS Layer",se:"WMS Lager"},{en:"Add layer from a Web Map Service",de:"Layer aus einem Web Map Service hinzufügen",se:"Lägg till lager från en Web Map Service"},{en:"Add layer from a Tiled Web Map",de:"Layer aus einer Tiled Web Map hinzufügen",se:"Lägg till lager från en Tiled Web Map"},{en:"Show or hide layers panel",de:"Layer-Bedienfeld ein- oder ausblenden",se:"Visa eller dölj panelen Lager"},{en:"Turn layer split mode on or off",de:"Layer-Split-Modus ein- oder ausschalten",se:"Aktivera eller inaktivera lagerdelningsläget"},{en:"Turn info box on or off",de:"Infobox ein- oder ausschalten",se:"Slå på eller av informationsrutan"},{en:"Show or hide sidebar",de:"Seitenleiste ein- oder ausblenden",se:"Visa eller dölja sidofält"},{en:"Unknown color bar",de:"Unbekannte Farbskala",se:"Färgskala okänd"},{en:"Points",de:"Punkte",se:"Punkter"},{en:"Lines",de:"Linien",se:"Linjer"},{en:"Bars",de:"Balken",se:"Staplar"},{en:"Default chart type",de:"Diagrammtyp (default)",se:"Diagramtyp (default)"},{en:"User Base Maps",de:"Nutzer Basiskarte",se:"Användare Grundkarta"},{en:"Overlay",de:"Overlay (überlagernder Layer)",se:"Overlay (överliggande lager)"},{en:"User Overlays",de:"Nutzer Overlay",se:"Användare Overlay"},{en:"On dataset selection",de:"Bei Auswahl von Datensatz",se:"Vid val av dataset"},{en:"On place selection",de:"Bei Auswahl von Ort",se:"Vid val av plats"},{en:"Do nothing",de:"Nichts tun",se:"Gör ingenting"},{en:"Pan",de:"Verschieben",se:"Panorera"},{en:"Pan and zoom",de:"Verschieben und zoom",se:"Panorera och zooma"},{en:"User Layers",de:"Nutzer Layer",se:"Användare lager"},{en:"XYZ Layer URL",de:"XYZ-Layer URL",se:"XYZ lager URL"},{en:"Layer Title",de:"Layer Titel",se:"Lagertitel "},{en:"Layer Attribution",de:"Layer Attribution",se:"Lagerattribution"},{en:"Info",de:"Info",se:"Info"},{en:"Charts",de:"Diagramme",se:"Diagrammer"},{en:"Statistics",de:"Statistik",se:"Statistik"},{en:"Volume",de:"Volumen",se:"Volym"},{en:"Toggle zoom mode (or press CTRL key)",de:"Zoom-Modus umschalten (oder drücke CTRL-Taste)",se:"Växla zoomläge (eller tryck på CTRL-tangenten)"},{en:"Enter fixed y-range",de:"Festen y-Bereich angeben",se:"Ange fast y-intervall"},{en:"Toggle showing info popup on hover",de:"Anzeige des Info-Popups bei Hover umschalten",se:"Växla visning av popup-info vid hover"},{en:"Show points",de:"Punkte anzeigen",se:"Visa punkter"},{en:"Show lines",de:"Linien anzeigen",se:"Visa linjer"},{en:"Show bars",de:"Balken anzeigen",se:"Visa staplar"},{en:"Show standard deviation (if any)",de:"Standardabweichung anzeigen",se:"Visa standardavvikelsen"},{en:"Add time-series from places",de:"Zeitserien hinzufügen von Orten",se:"Lägg till tidsserier från platser"},{en:"Zoom to full range",de:"Zoom auf gesamten x-Bereich",se:"Zooma till hela x-intervallet"},{en:"Make it 2nd variable for comparison",de:"Festlegen als 2. Variable für Vergleich",se:"Ställ in som 2:a variabel för jämförelse"},{en:"Load Volume Data",de:"Lade Volumendaten",se:"Ladda volymdata"},{en:"Please note that the 3D volume rendering is still an experimental feature.",de:"Bitte beachte, dass das 3D-Volumen-Rendering noch eine experimentelle Funktion ist.",se:"Observera att 3D-volymrendering fortfarande är en experimentell funktion."},{en:"User-defined color bars.",de:"Benutzerdefinierte Farbskalen.",se:"Användardefinierade färgskalor."},{en:"Contin.",de:"Kontin.",se:"Kontin."},{en:"Stepwise",de:"Schrittw.",se:"Stegvis"},{en:"Categ.",de:"Kateg.",se:"Kateg."},{en:"Continuous color assignment, where each value represents a support point of a color gradient",de:"Kontinuierliche Farbzuordnung, bei der jeder Wert eine Stützstelle eines Farbverlaufs darstellt",se:"Kontinuerlig färgtilldelning där varje värde representerar en punkt i en färggradient"},{en:"Stepwise color mapping where values are bounds of value ranges mapped to the same color",de:"Schrittweise Farbzuordnung, bei der die Werte Bereichsgrenzen darstellen, die einer einzelnen Farbe zugeordnet werden",se:"Gradvis färgmappning, där värdena representerar intervallgränser mappade till en enda färg"},{en:"Values represent unique categories or indexes that are mapped to a color",de:"Werte stellen eindeutige Kategorien oder Indizes dar, die einer Farbe zugeordnet sind",se:"Värden representerar unika kategorier eller index som är mappade till en färg"},{en:"User",de:"Nutzer",se:"Användare"},{en:"Add Time-Series",de:"Zeitserien hinzufügen",se:"Lägg till tidsserier"},{en:"No time-series have been obtained yet. Select a variable and a place first.",de:"Es wurden noch keine Zeitreihen abgerufen. Wähle zuerst eine Variable und einen Ort aus.",se:"Inga tidsserier har hämtats ännu. Välj först en variabel och en plats."},{en:"Count",de:"Anzahl",se:"Antal"},{en:"Minimum",de:"Minimum",se:"Minimum"},{en:"Maximum",de:"Maximum",se:"Maximum"},{en:"Mean",de:"Mittelwert",se:"Medelvärde"},{en:"Deviation",de:"Abweichung",se:"Avvikelse"},{en:"Toggle adjustable x-range",de:"Anpassbaren x-Bereich umschalten",se:"Växla justerbart x-intervall"},{en:"pinned",de:"angepinnt",se:"fäst"},{en:"Compare Mode (Drag)",de:"Vergleichsmodus (Ziehen)",se:"Jämförelseläge (Dra)"},{en:"Point Info Mode (Hover)",de:"Punktinformationsmodus (Bewegen)",se:"Punktinformationsläge (Sväva)"},{en:"Dataset RGB",de:"Datensatz RGB",se:"Dataset RGB"},{en:"Dataset RGB 2",de:"Datensatz RGB 2",se:"Dataset RGB 2"},{en:"Dataset Variable",de:"Datensatz Variable",se:"Dataset Variabel"},{en:"Dataset Variable 2",de:"Datensatz Variable 2",se:"Dataset Variabel 2"},{en:"Dataset Boundary",de:"Datensatz Außengrenze",se:"Dataset Yttre Gräns"},{en:"Dataset Places",de:"Datensatz Orte",se:"Dataset Platser"},{en:"User Places",de:"Nutzer Orte",se:"Användare Platser"},{en:"Layers",de:"Layer",se:"Lager"},{en:"User Variables",de:"Nutzer-Variablen",se:"Användarvariabler"},{en:"Create and manage user variables",de:"Nutzer-Variablen erstellen und verwalten",se:"Skapa och hantera användarvariabler"},{en:"Manage user variables",de:"Nutzer-Variablen verwalten",se:"Hantera användarvariabler"},{en:"Add user variable",de:"Nutzer-Variable hinzufügen",se:"Lägg till användarvariabel"},{en:"Duplicate user variable",de:"Nutzer-Variable duplizieren",se:"Duplicera användarvariabel"},{en:"Edit user variable",de:"Nutzer-Variable bearbeiten",se:"Redigera användarvariabel"},{en:"Remove user variable",de:"Nutzer-Variable löschen",se:"Ta bort användarvariabel"},{en:"Use keys CTRL+SPACE to show autocompletions",de:"Tasten STRG+LEER benutzen, um Autovervollständigungen zu zeigen",se:"Använd tangenterna CTRL+MELLANSLAG för att visa autoslutföranden"},{en:"Display further elements to be used in expressions",de:"Weitere Elemente anzeigen, die in Ausdrücken verwendet werden können",se:"Visa fler element som kan användas i uttryck"},{en:"Variables",de:"Variablen",se:"Variabler"},{en:"Constants",de:"Konstanten",se:"Konstanter"},{en:"Array operators",de:"Array-Operatoren",se:"Arrayoperatorer"},{en:"Other operators",de:"Andere Operatoren",se:"Andra Operatorer"},{en:"Array functions",de:"Array-Funktionen",se:"Arrayfunktioner"},{en:"Other functions",de:"Andere Funktionen",se:"Andra funktioner"},{en:"Not a valid identifier",de:"Kein gültiger Bezeichner",se:"Inte en giltig identifierare"},{en:"Must not be empty",de:"Darf nicht leer sein",se:"Får inte vara tom"},{en:"docs/privacy-note.en.md",de:"docs/privacy-note.de.md",se:"docs/privacy-note.se.md"},{en:"docs/add-layer-wms.en.md",de:"docs/add-layer-wms.de.md",se:"docs/add-layer-wms.se.md"},{en:"docs/add-layer-xyz.en.md",de:"docs/add-layer-xyz.de.md",se:"docs/add-layer-xyz.se.md"},{en:"docs/color-mappings.en.md",de:"docs/color-mappings.de.md",se:"docs/color-mappings.se.md"},{en:"docs/user-variables.en.md",de:"docs/user-variables.de.md",se:"docs/user-variables.se.md"}],UNe={languages:BNe,dictionary:zNe},fe=new FNe(UNe);fe.locale=jNe();class Tie extends M.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,n){console.error(e),n.componentStack&&console.error(n.componentStack)}render(){if(!this.props.children)throw new Error("An ErrorBoundary requires at least one child");return this.state.error?w.jsxs("div",{children:[w.jsx("h2",{className:"errorBoundary-header",children:fe.get("Something went wrong.")}),w.jsxs("details",{className:"errorBoundary-details",style:{whiteSpace:"pre-wrap"},children:[this.state.error.toString(),w.jsx("br",{})]})]}):this.props.children}}const WNe=({children:t})=>{const e=Kt.instance.authClient;if(!e)return w.jsx(w.Fragment,{children:t});const n=o=>{console.info("handleSigninCallback:",o),window.history.replaceState({},document.title,window.location.pathname)},r=()=>{console.info("handleRemoveUser"),window.location.pathname="/"},i=zM.href;return w.jsx(Tie,{children:w.jsx(LNe,{...e,loadUserInfo:!0,scope:"openid email profile",automaticSilentRenew:!0,redirect_uri:i,post_logout_redirect_uri:i,popup_post_logout_redirect_uri:i,onSigninCallback:n,onRemoveUser:r,children:t})})};var T5={},CA={};const VNe=Ea(BCe);var K8;function pt(){return K8||(K8=1,function(t){"use client";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return e.createSvgIcon}});var e=VNe}(CA)),CA}var GNe=ct;Object.defineProperty(T5,"__esModule",{value:!0});var E5=T5.default=void 0,HNe=GNe(pt()),qNe=w;E5=T5.default=(0,HNe.default)((0,qNe.jsx)("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutline");var P5={},XNe=ct;Object.defineProperty(P5,"__esModule",{value:!0});var M5=P5.default=void 0,QNe=XNe(pt()),YNe=w;M5=P5.default=(0,QNe.default)((0,YNe.jsx)("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings");var k5={},KNe=ct;Object.defineProperty(k5,"__esModule",{value:!0});var A5=k5.default=void 0,ZNe=KNe(pt()),JNe=w;A5=k5.default=(0,ZNe.default)((0,JNe.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh");var R5={},eFe=ct;Object.defineProperty(R5,"__esModule",{value:!0});var Eie=R5.default=void 0,tFe=eFe(pt()),Z8=w;Eie=R5.default=(0,tFe.default)([(0,Z8.jsx)("path",{d:"m21 5-9-4-9 4v6c0 5.55 3.84 10.74 9 12 2.3-.56 4.33-1.9 5.88-3.71l-3.12-3.12c-1.94 1.29-4.58 1.07-6.29-.64-1.95-1.95-1.95-5.12 0-7.07 1.95-1.95 5.12-1.95 7.07 0 1.71 1.71 1.92 4.35.64 6.29l2.9 2.9C20.29 15.69 21 13.38 21 11z"},"0"),(0,Z8.jsx)("circle",{cx:"12",cy:"12",r:"3"},"1")],"Policy");var I5={},nFe=ct;Object.defineProperty(I5,"__esModule",{value:!0});var D5=I5.default=void 0,rFe=nFe(pt()),iFe=w;D5=I5.default=(0,rFe.default)((0,iFe.jsx)("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M17 13l-5 5-5-5h3V9h4v4z"}),"CloudDownload");var oFe=function(){function t(e){this.propagationStopped,this.defaultPrevented,this.type=e,this.target=null}return t.prototype.preventDefault=function(){this.defaultPrevented=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t}();const rc=oFe,Kg={PROPERTYCHANGE:"propertychange"};var aFe=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();const L5=aFe;function sFe(t,e,n){for(var r,i,o=n||Yh,a=0,s=t.length,l=!1;a>1),i=+o(t[r],e),i<0?a=r+1:(s=r,l=!i);return l?a:~a}function Yh(t,e){return t>e?1:t0){for(i=1;i0?i-1:i:t[i-1]-e0||n&&a===0)})}function Rh(){return!0}function R1(){return!1}function Kh(){}function uFe(t){var e=!1,n,r,i;return function(){var o=Array.prototype.slice.call(arguments);return(!e||this!==i||!Sp(o,r))&&(e=!0,i=this,r=o,n=t.apply(this,arguments)),n}}var cr=typeof Object.assign=="function"?Object.assign:function(t,e){if(t==null)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(t),r=1,i=arguments.length;r0:!1},e.prototype.removeEventListener=function(n,r){var i=this.listeners_&&this.listeners_[n];if(i){var o=i.indexOf(r);o!==-1&&(this.pendingRemovals_&&n in this.pendingRemovals_?(i[o]=Kh,++this.pendingRemovals_[n]):(i.splice(o,1),i.length===0&&delete this.listeners_[n]))}},e}(L5);const Mt={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function rn(t,e,n,r,i){if(r&&r!==t&&(n=n.bind(r)),i){var o=n;n=function(){t.removeEventListener(e,n),o.apply(this,arguments)}}var a={target:t,type:e,listener:n};return t.addEventListener(e,n),a}function kT(t,e,n,r){return rn(t,e,n,r,!0)}function tr(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),I1(t))}var dFe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),WM=function(t){dFe(e,t);function e(){var n=t.call(this)||this;return n.on=n.onInternal,n.once=n.onceInternal,n.un=n.unInternal,n.revision_=0,n}return e.prototype.changed=function(){++this.revision_,this.dispatchEvent(Mt.CHANGE)},e.prototype.getRevision=function(){return this.revision_},e.prototype.onInternal=function(n,r){if(Array.isArray(n)){for(var i=n.length,o=new Array(i),a=0;a=0||Qf.match(/cpu (os|iphone os) 15_4 like mac os x/));var SFe=Qf.indexOf("webkit")!==-1&&Qf.indexOf("edge")==-1,OFe=Qf.indexOf("macintosh")!==-1,Rie=typeof devicePixelRatio<"u"?devicePixelRatio:1,VM=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,CFe=typeof Image<"u"&&Image.prototype.decode,Iie=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch{}return t}();new Array(6);function Wl(){return[1,0,0,1,0,0]}function TFe(t,e,n,r,i,o,a){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t}function EFe(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function Or(t,e){var n=e[0],r=e[1];return e[0]=t[0]*n+t[2]*r+t[4],e[1]=t[1]*n+t[3]*r+t[5],e}function PFe(t,e,n){return TFe(t,e,0,0,n,0,0)}function cu(t,e,n,r,i,o,a,s){var l=Math.sin(o),c=Math.cos(o);return t[0]=r*c,t[1]=i*l,t[2]=-r*l,t[3]=i*c,t[4]=a*r*c-s*r*l+e,t[5]=a*i*l+s*i*c+n,t}function N5(t,e){var n=MFe(e);Ut(n!==0,32);var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],l=e[5];return t[0]=a/n,t[1]=-i/n,t[2]=-o/n,t[3]=r/n,t[4]=(o*l-a*s)/n,t[5]=-(r*l-i*s)/n,t}function MFe(t){return t[0]*t[3]-t[1]*t[2]}var eG;function Die(t){var e="matrix("+t.join(", ")+")";if(VM)return e;var n=eG||(eG=document.createElement("div"));return n.style.transform=e,n.style.transform}const ai={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function tG(t){for(var e=Oa(),n=0,r=t.length;ni&&(l=l|ai.RIGHT),so&&(l=l|ai.ABOVE),l===ai.UNKNOWN&&(l=ai.INTERSECTING),l}function Oa(){return[1/0,1/0,-1/0,-1/0]}function Qs(t,e,n,r,i){return i?(i[0]=t,i[1]=e,i[2]=n,i[3]=r,i):[t,e,n,r]}function L1(t){return Qs(1/0,1/0,-1/0,-1/0,t)}function AFe(t,e){var n=t[0],r=t[1];return Qs(n,r,n,r,e)}function $ie(t,e,n,r,i){var o=L1(i);return Fie(o,t,e,n,r)}function Lb(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function Nie(t,e){return e[0]t[2]&&(t[2]=e[2]),e[1]t[3]&&(t[3]=e[3]),t}function zx(t,e){e[0]t[2]&&(t[2]=e[0]),e[1]t[3]&&(t[3]=e[1])}function Fie(t,e,n,r,i){for(;ne[0]?r[0]=t[0]:r[0]=e[0],t[1]>e[1]?r[1]=t[1]:r[1]=e[1],t[2]=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function B5(t){return t[2]=a&&m<=l),!r&&o&ai.RIGHT&&!(i&ai.RIGHT)&&(g=h-(d-l)*p,r=g>=s&&g<=c),!r&&o&ai.BELOW&&!(i&ai.BELOW)&&(m=d-(h-s)/p,r=m>=a&&m<=l),!r&&o&ai.LEFT&&!(i&ai.LEFT)&&(g=h-(d-a)*p,r=g>=s&&g<=c)}return r}function $Fe(t,e,n,r){var i=[];if(r>1)for(var o=t[2]-t[0],a=t[3]-t[1],s=0;s=n[2])){var i=Yn(n),o=Math.floor((r[0]-n[0])/i),a=o*i;t[0]-=a,t[2]-=a}return t}function NFe(t,e){if(e.canWrapX()){var n=e.getExtent();if(!isFinite(t[0])||!isFinite(t[2]))return[[n[0],t[1],n[2],t[3]]];jie(t,e);var r=Yn(n);if(Yn(t)>r)return[[n[0],t[1],n[2],t[3]]];if(t[0]n[2])return[[t[0],t[1],n[2],t[3]],[n[0],t[1],t[2]-r,t[3]]]}return[t]}var FFe=function(){function t(e){this.code_=e.code,this.units_=e.units,this.extent_=e.extent!==void 0?e.extent:null,this.worldExtent_=e.worldExtent!==void 0?e.worldExtent:null,this.axisOrientation_=e.axisOrientation!==void 0?e.axisOrientation:"enu",this.global_=e.global!==void 0?e.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=e.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=e.metersPerUnit}return t.prototype.canWrapX=function(){return this.canWrapX_},t.prototype.getCode=function(){return this.code_},t.prototype.getExtent=function(){return this.extent_},t.prototype.getUnits=function(){return this.units_},t.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||Xs[this.units_]},t.prototype.getWorldExtent=function(){return this.worldExtent_},t.prototype.getAxisOrientation=function(){return this.axisOrientation_},t.prototype.isGlobal=function(){return this.global_},t.prototype.setGlobal=function(e){this.global_=e,this.canWrapX_=!!(e&&this.extent_)},t.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},t.prototype.setDefaultTileGrid=function(e){this.defaultTileGrid_=e},t.prototype.setExtent=function(e){this.extent_=e,this.canWrapX_=!!(this.global_&&e)},t.prototype.setWorldExtent=function(e){this.worldExtent_=e},t.prototype.setGetPointResolution=function(e){this.getPointResolutionFunc_=e},t.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},t}();const Bie=FFe;function Fr(t,e,n){return Math.min(Math.max(t,e),n)}var jFe=function(){var t;return"cosh"in Math?t=Math.cosh:t=function(e){var n=Math.exp(e);return(n+1/n)/2},t}(),BFe=function(){var t;return"log2"in Math?t=Math.log2:t=function(e){return Math.log(e)*Math.LOG2E},t}();function zFe(t,e,n,r,i,o){var a=i-n,s=o-r;if(a!==0||s!==0){var l=((t-n)*a+(e-r)*s)/(a*a+s*s);l>1?(n=i,r=o):l>0&&(n+=a*l,r+=s*l)}return Ih(t,e,n,r)}function Ih(t,e,n,r){var i=n-t,o=r-e;return i*i+o*o}function UFe(t){for(var e=t.length,n=0;ni&&(i=a,r=o)}if(i===0)return null;var s=t[r];t[r]=t[n],t[n]=s;for(var l=n+1;l=0;d--){f[d]=t[d][e]/t[d][d];for(var h=d-1;h>=0;h--)t[h][e]-=t[h][d]*f[d]}return f}function CC(t){return t*Math.PI/180}function Df(t,e){var n=t%e;return n*e<0?n+e:n}function Ic(t,e,n){return t+n*(e-t)}function zie(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n}function cS(t,e){return Math.floor(zie(t,e))}function uS(t,e){return Math.ceil(zie(t,e))}var WFe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$1=6378137,Qm=Math.PI*$1,VFe=[-Qm,-Qm,Qm,Qm],GFe=[-180,-85,180,85],fS=$1*Math.log(Math.tan(Math.PI/2)),Xp=function(t){WFe(e,t);function e(n){return t.call(this,{code:n,units:li.METERS,extent:VFe,global:!0,worldExtent:GFe,getPointResolution:function(r,i){return r/jFe(i[1]/$1)}})||this}return e}(Bie),nG=[new Xp("EPSG:3857"),new Xp("EPSG:102100"),new Xp("EPSG:102113"),new Xp("EPSG:900913"),new Xp("http://www.opengis.net/def/crs/EPSG/0/3857"),new Xp("http://www.opengis.net/gml/srs/epsg.xml#3857")];function HFe(t,e,n){var r=t.length,i=n>1?n:2,o=e;o===void 0&&(i>2?o=t.slice():o=new Array(r));for(var a=0;afS?s=fS:s<-fS&&(s=-fS),o[a+1]=s}return o}function qFe(t,e,n){var r=t.length,i=n>1?n:2,o=e;o===void 0&&(i>2?o=t.slice():o=new Array(r));for(var a=0;aa)return 1;if(a>o)return-1}return 0}function tje(t,e){return t[0]+=+e[0],t[1]+=+e[1],t}function RT(t,e){for(var n=!0,r=t.length-1;r>=0;--r)if(t[r]!=e[r]){n=!1;break}return n}function z5(t,e){var n=Math.cos(e),r=Math.sin(e),i=t[0]*n-t[1]*r,o=t[1]*n+t[0]*r;return t[0]=i,t[1]=o,t}function nje(t,e){return t[0]*=e,t[1]*=e,t}function rje(t,e){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function Uie(t,e){if(e.canWrapX()){var n=Yn(e.getExtent()),r=ije(t,e,n);r&&(t[0]-=r*n)}return t}function ije(t,e,n){var r=e.getExtent(),i=0;if(e.canWrapX()&&(t[0]r[2])){var o=n||Yn(r);i=Math.floor((t[0]-r[0])/o)}return i}var oje=63710088e-1;function oG(t,e,n){var r=n||oje,i=CC(t[1]),o=CC(e[1]),a=(o-i)/2,s=CC(e[0]-t[0])/2,l=Math.sin(a)*Math.sin(a)+Math.sin(s)*Math.sin(s)*Math.cos(i)*Math.cos(o);return 2*r*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}var HL=!0;function aje(t){var e=t===void 0?!0:t;HL=!e}function U5(t,e,n){var r;if(e!==void 0){for(var i=0,o=t.length;i=-180&&t[0]<=180&&t[1]>=-90&&t[1]<=90&&(HL=!1,console.warn("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),t}function Gie(t,e){return t}function hh(t,e){return t}function dje(){aG(nG),aG(iG),cje(iG,nG,HFe,qFe)}dje();function Dh(t,e,n,r,i,o){for(var a=o||[],s=0,l=e;l1)f=n;else if(d>0){for(var h=0;hi&&(i=c),o=s,a=l}return i}function q5(t,e,n,r,i){for(var o=0,a=n.length;o0;){for(var f=c.pop(),d=c.pop(),h=0,p=t[d],m=t[d+1],g=t[f],v=t[f+1],y=d+r;yh&&(u=y,h=_)}h>i&&(l[(u-e)/r]=1,d+r0&&m>h)&&(p<0&&g0&&g>p)){c=f,u=d;continue}o[a++]=c,o[a++]=u,s=c,l=u,c=f,u=d}}return o[a++]=c,o[a++]=u,a}function Yie(t,e,n,r,i,o,a,s){for(var l=0,c=n.length;l1?a:2,b=o||new Array(x),p=0;p>1;io&&(c-s)*(o-l)-(i-s)*(u-l)>0&&a++:u<=o&&(c-s)*(o-l)-(i-s)*(u-l)<0&&a--,s=c,l=u}return a!==0}function Z5(t,e,n,r,i,o){if(n.length===0||!ph(t,e,n[0],r,i,o))return!1;for(var a=1,s=n.length;a=i[0]&&o[2]<=i[2]||o[1]>=i[1]&&o[3]<=i[3]?!0:Kie(t,e,n,r,function(a,s){return LFe(i,a,s)}):!1}function Dje(t,e,n,r,i){for(var o=0,a=n.length;ob&&(c=(u+f)/2,Z5(t,e,n,r,c,p)&&(x=c,b=_)),u=f}return isNaN(x)&&(x=i[o]),a?(a.push(x,p,b),a):[x,p,b]}function qje(t,e,n,r,i){for(var o=[],a=0,s=n.length;a0}function aoe(t,e,n,r,i){for(var o=i!==void 0?i:!1,a=0,s=n.length;a0){const n=e.map(r=>r.map(encodeURIComponent).join("=")).join("&");return t.includes("?")?t.endsWith("&")?t+n:t+"&"+n:t+"?"+n}return t}async function loe(t,e){let n;try{if(n=await fetch(t,e),n.ok)return n}catch(i){throw i instanceof TypeError?(console.error(`Server did not respond for ${t}. May be caused by timeout, refused connection, network error, etc.`,i),new Error(fe.get("Cannot reach server"))):(console.error(i),i)}let r=n.statusText;try{const i=await n.json();if(i&&i.error){const o=i.error;console.error(o),o.message&&(r+=`: ${o.message}`)}}catch{}throw console.error(n),new soe(n.status,r)}async function xu(t,e,n){let r;A3e(e)?n=e:r=e;const o=await(await loe(t,r)).json();return n?n(o):o}function v5e(t){return xu(`${t}/colorbars`,y5e)}function y5e(t){const e=[],n={};return t.forEach(r=>{const[i,o,a]=r,s=[];a.forEach(l=>{const[c,u]=l;s.push(c),n[c]=u}),e.push({title:i,description:o,names:s})}),{groups:e,images:n}}function x5e(t,e){const n=ry(`${t}/datasets`,[["details","1"]]),r=ny(e);return xu(n,r,b5e)}function b5e(t){return(t.datasets||[]).map(_5e)}function _5e(t){if(t.dimensions&&t.dimensions.length){let e=t.dimensions;const n=e.findIndex(r=>r.name==="time");if(n>-1){const r=e[n],i=r.coordinates;if(i&&i.length&&typeof i[0]=="string"){const o=i,a=o.map(s=>new Date(s).getTime());return e=[...e],e[n]={...r,coordinates:a,labels:o},{...t,dimensions:e}}}}return t}function w5e(t,e,n,r){const i=ny(r),o=encodeURIComponent(e),a=encodeURIComponent(n);return xu(`${t}/datasets/${o}/places/${a}`,i)}function S5e(t){return xu(`${t}/expressions/capabilities`)}function O5e(t){return xu(`${t}/`)}function N1(t){return ey(t.expression)}function iy(t){return encodeURIComponent(ey(t)?t:t.id)}function F1(t){return encodeURIComponent(ey(t)?t:N1(t)?`${t.name}=${t.expression}`:t.name)}function C5e(t,e,n,r,i,o,a,s,l,c){let u,f=null;const d=[];s?(d.push(["aggMethods","median"]),u="median"):l?(d.push(["aggMethods","mean,std"]),u="mean",f="std"):(d.push(["aggMethods","mean"]),u="mean"),o&&d.push(["startDate",o]),a&&d.push(["endDate",a]);const h=ry(`${t}/timeseries/${iy(e)}/${F1(n)}`,d),p={...ny(c),method:"post",body:JSON.stringify(i)};return xu(h,p,g=>{const v=g.result;if(!v||v.length===0)return null;const y=v.map(b=>({...b,time:new Date(b.time).getTime()}));return{source:{datasetId:e.id,datasetTitle:e.title,variableName:n.name,variableUnits:n.units||void 0,placeId:r,geometry:i,valueDataKey:u,errorDataKey:f},data:y}})}function T5e(t,e,n,r,i,o){const a=[["time",i]],s=ry(`${t}/statistics/${iy(e)}/${F1(n)}`,a),l={...ny(o),method:"post",body:JSON.stringify(r.place.geometry)},c={dataset:e,variable:n,placeInfo:r,time:i};return xu(s,l,u=>({source:c,statistics:u.result}))}function E5e(t,e,n,r,i,o,a){const s=[["lon",r.toString()],["lat",i.toString()]];o&&s.push(["time",o]);const l=ry(`${t}/statistics/${iy(e)}/${F1(n)}`,s);return xu(l,ny(a),c=>c.result?c.result:{})}function P5e(t,e){const n=ry(`${t}/maintenance/update`,[]),r=ny(e);try{return xu(n,r).then(()=>!0).catch(i=>(console.error(i),!1))}catch(i){return console.error(i),Promise.resolve(!1)}}class NT extends Error{}function M5e(t,e){if(t===null)throw new NT(`assertion failed: ${e} must not be null`)}function k5e(t,e){if(typeof t>"u")throw new NT(`assertion failed: ${e} must not be undefined`)}function A5e(t,e){M5e(t,e),k5e(t,e)}function TA(t,e){if(Array.isArray(t)){if(t.length===0)throw new NT(`assertion failed: ${e} must be a non-empty array`)}else throw new NT(`assertion failed: ${e} must be an array`)}function Fb(t,e){return e&&t.find(n=>n.id===e)||null}function e$(t,e){return e&&t.variables.find(n=>n.name===e)||null}function R5e(t){return t.variables.findIndex(e=>ey(e.expression))}function nB(t){const e=R5e(t);return e>=0?[t.variables.slice(0,e),t.variables.slice(e)]:[t.variables,[]]}function coe(t){A5e(t,"dataset"),TA(t.dimensions,"dataset.dimensions");const e=t.dimensions.find(n=>n.name==="time");return e?(TA(e.coordinates,"timeDimension.coordinates"),TA(e.labels,"timeDimension.labels"),e):null}function uoe(t){const e=coe(t);if(!e)return null;const n=e.coordinates;return[n[0],n[n.length-1]]}var FT="NOT_FOUND";function I5e(t){var e;return{get:function(r){return e&&t(e.key,r)?e.value:FT},put:function(r,i){e={key:r,value:i}},getEntries:function(){return e?[e]:[]},clear:function(){e=void 0}}}function D5e(t,e){var n=[];function r(s){var l=n.findIndex(function(u){return e(s,u.key)});if(l>-1){var c=n[l];return l>0&&(n.splice(l,1),n.unshift(c)),c.value}return FT}function i(s,l){r(s)===FT&&(n.unshift({key:s,value:l}),n.length>t&&n.pop())}function o(){return n}function a(){n=[]}return{get:r,put:i,getEntries:o,clear:a}}var L5e=function(e,n){return e===n};function $5e(t){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var i=n.length,o=0;o1?e-1:0),r=1;r0&&o[0]!==s&&(o=[s,...o])}n.properties&&(a=dG(n.properties,o)),a===void 0&&(a=dG(n,o)),t[r]=a||i}function G5e(t,e){let n=e;if(t.properties)for(const r of Object.getOwnPropertyNames(t.properties)){if(!n.includes("${"))break;const i="${"+r+"}";n.includes(i)&&(n=n.replace(i,`${t.properties[r]}`))}return n}function dG(t,e){let n;for(const r of e)if(r in t)return t[r];return n}function j1(t){let e=[];for(const n of t)e=e.concat(n.toLowerCase(),n.toUpperCase(),n[0].toUpperCase()+n.substring(1).toLowerCase());return e}function oB(t,e){t.forEach(n=>{ay(n)&&n.features.forEach(r=>{e(n,r)})})}function H5e(t,e){const n=ey(e)?(r,i)=>i.id===e:e;for(const r of t)if(ay(r)){const i=r.features.find(o=>n(r,o));if(i)return ZM(r,i)}return null}function q5e(t){const e=t.id+"";let n=0,r,i;if(e.length===0)return n;for(r=0;ri.id===e);if(n)return n;const r=t.placeGroups;if(r)for(const i in r){const o=doe(r[i],e);if(o)return o}return null}function aB(t,e){if(e)for(const n of t){const r=doe(n,e);if(r!==null)return r}return null}const X5e=/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,Q5e=t=>{let e;if(t.includes(",")){const r=t.split(",");if(r.length===3||r.length===4){const i=[0,0,0,255];for(let o=0;o<3;o++){const a=Number.parseInt(r[o]);if(a<0||a>255)return;i[o]=a}if(r.length===4){if(e=hG(r[3]),e===void 0)return;i[3]=e}return i}if(r.length!==2||(t=r[0],e=hG(r[1]),e===void 0))return}const n=(t.startsWith("#")?hoe:Z5e)(t);if(n){if(n.length===3)return[...n,e===void 0?255:e];if(n.length===4&&e===void 0)return n}};function Y5e(t){return"#"+t.map(e=>{const n=e.toString(16);return n.length===1?"0"+n:n}).join("")}function hoe(t){if(X5e.test(t)){if(t.length===4)return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)];if(t.length===7)return[parseInt(t.substring(1,3),16),parseInt(t.substring(3,5),16),parseInt(t.substring(5,7),16)];if(t.length===9)return[parseInt(t.substring(1,3),16),parseInt(t.substring(3,5),16),parseInt(t.substring(5,7),16),parseInt(t.substring(7,9),16)]}}const hG=t=>{const e=Number.parseFloat(t);if(e===0)return 0;if(e===1)return 255;if(e>0&&e<1)return Math.round(256*e)},K5e=t=>J5e[t.toLowerCase()],Z5e=t=>{const e=K5e(t);if(e)return hoe(e)},J5e={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#00FFFF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blue:"#0000FF",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#FF00FF",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#00FF00",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#FF0000",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFFFFF",whitesmoke:"#F5F5F5",yellow:"#FFFF00",yellowgreen:"#9ACD32"},poe="User",moe=`0.0: #23FF52 + `),ike)),cke=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiCircularProgress"}),{className:i,color:o="primary",disableShrink:a=!1,size:s=40,style:l,thickness:c=3.6,value:u=0,variant:f="indeterminate"}=r,d=Ae(r,nke),h=j({},r,{color:o,disableShrink:a,size:s,thickness:c,value:u,variant:f}),p=oke(h),m={},g={},v={};if(f==="determinate"){const y=2*Math.PI*((Eu-c)/2);m.strokeDasharray=y.toFixed(3),v["aria-valuenow"]=Math.round(u),m.strokeDashoffset=`${((100-u)/100*y).toFixed(3)}px`,g.transform="rotate(-90deg)"}return w.jsx(ake,j({className:ke(p.root,i),style:j({width:s,height:s},g,l),ownerState:h,ref:n,role:"progressbar"},v,d,{children:w.jsx(ske,{className:p.svg,ownerState:h,viewBox:`${Eu/2} ${Eu/2} ${Eu} ${Eu}`,children:w.jsx(lke,{className:p.circle,style:m,ownerState:h,cx:Eu,cy:Eu,r:(Eu-c)/2,fill:"none",strokeWidth:c})})}))}),Qv=cke,uke=(t,e)=>j({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%"},e&&!t.vars&&{colorScheme:t.palette.mode}),fke=t=>j({color:(t.vars||t).palette.text.primary},t.typography.body1,{backgroundColor:(t.vars||t).palette.background.default,"@media print":{backgroundColor:(t.vars||t).palette.common.white}}),dke=(t,e=!1)=>{var n;const r={};e&&t.colorSchemes&&Object.entries(t.colorSchemes).forEach(([a,s])=>{var l;r[t.getColorSchemeSelector(a).replace(/\s*&/,"")]={colorScheme:(l=s.palette)==null?void 0:l.mode}});let i=j({html:uke(t,e),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:t.typography.fontWeightBold},body:j({margin:0},fke(t),{"&::backdrop":{backgroundColor:(t.vars||t).palette.background.default}})},r);const o=(n=t.components)==null||(n=n.MuiCssBaseline)==null?void 0:n.styleOverrides;return o&&(i=[i,o]),i};function hke(t){const e=qe({props:t,name:"MuiCssBaseline"}),{children:n,enableColorScheme:r=!1}=e;return w.jsxs(M.Fragment,{children:[w.jsx(Dre,{styles:i=>dke(i,r)}),n]})}function pke(t){return We("MuiModal",t)}Ve("MuiModal",["root","hidden","backdrop"]);const mke=["BackdropComponent","BackdropProps","classes","className","closeAfterTransition","children","container","component","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onBackdropClick","onClose","onTransitionEnter","onTransitionExited","open","slotProps","slots","theme"],gke=t=>{const{open:e,exited:n,classes:r}=t;return Ue({root:["root",!e&&n&&"hidden"],backdrop:["backdrop"]},pke,r)},vke=we("div",{name:"MuiModal",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.open&&n.exited&&e.hidden]}})(({theme:t,ownerState:e})=>j({position:"fixed",zIndex:(t.vars||t).zIndex.modal,right:0,bottom:0,top:0,left:0},!e.open&&e.exited&&{visibility:"hidden"})),yke=we(Lre,{name:"MuiModal",slot:"Backdrop",overridesResolver:(t,e)=>e.backdrop})({zIndex:-1}),xke=M.forwardRef(function(e,n){var r,i,o,a,s,l;const c=qe({name:"MuiModal",props:e}),{BackdropComponent:u=yke,BackdropProps:f,className:d,closeAfterTransition:h=!1,children:p,container:m,component:g,components:v={},componentsProps:y={},disableAutoFocus:x=!1,disableEnforceFocus:b=!1,disableEscapeKeyDown:_=!1,disablePortal:S=!1,disableRestoreFocus:O=!1,disableScrollLock:C=!1,hideBackdrop:E=!1,keepMounted:k=!1,onBackdropClick:I,open:P,slotProps:R,slots:T}=c,L=Ae(c,mke),z=j({},c,{closeAfterTransition:h,disableAutoFocus:x,disableEnforceFocus:b,disableEscapeKeyDown:_,disablePortal:S,disableRestoreFocus:O,disableScrollLock:C,hideBackdrop:E,keepMounted:k}),{getRootProps:B,getBackdropProps:W,getTransitionProps:U,portalRef:N,isTopModal:$,exited:D,hasTransition:A}=yEe(j({},z,{rootRef:n})),q=j({},z,{exited:D}),Y=gke(q),K={};if(p.props.tabIndex===void 0&&(K.tabIndex="-1"),A){const{onEnter:ve,onExited:F}=U();K.onEnter=ve,K.onExited=F}const se=(r=(i=T==null?void 0:T.root)!=null?i:v.Root)!=null?r:vke,te=(o=(a=T==null?void 0:T.backdrop)!=null?a:v.Backdrop)!=null?o:u,J=(s=R==null?void 0:R.root)!=null?s:y.root,pe=(l=R==null?void 0:R.backdrop)!=null?l:y.backdrop,be=Lr({elementType:se,externalSlotProps:J,externalForwardedProps:L,getSlotProps:B,additionalProps:{ref:n,as:g},ownerState:q,className:ke(d,J==null?void 0:J.className,Y==null?void 0:Y.root,!q.open&&q.exited&&(Y==null?void 0:Y.hidden))}),re=Lr({elementType:te,externalSlotProps:pe,additionalProps:f,getSlotProps:ve=>W(j({},ve,{onClick:F=>{I&&I(F),ve!=null&&ve.onClick&&ve.onClick(F)}})),className:ke(pe==null?void 0:pe.className,f==null?void 0:f.className,Y==null?void 0:Y.backdrop),ownerState:q});return!k&&!P&&(!A||D)?null:w.jsx(bre,{ref:N,container:m,disablePortal:S,children:w.jsxs(se,j({},be,{children:[!E&&u?w.jsx(te,j({},re)):null,w.jsx(xre,{disableEnforceFocus:b,disableAutoFocus:x,disableRestoreFocus:O,isEnabled:$,open:P,children:M.cloneElement(p,K)})]}))})}),Bre=xke;function bke(t){return We("MuiDialog",t)}const _ke=Ve("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),Nx=_ke,wke=M.createContext({}),zre=wke,Ske=["aria-describedby","aria-labelledby","BackdropComponent","BackdropProps","children","className","disableEscapeKeyDown","fullScreen","fullWidth","maxWidth","onBackdropClick","onClose","open","PaperComponent","PaperProps","scroll","TransitionComponent","transitionDuration","TransitionProps"],Oke=we(Lre,{name:"MuiDialog",slot:"Backdrop",overrides:(t,e)=>e.backdrop})({zIndex:-1}),Cke=t=>{const{classes:e,scroll:n,maxWidth:r,fullWidth:i,fullScreen:o}=t,a={root:["root"],container:["container",`scroll${De(n)}`],paper:["paper",`paperScroll${De(n)}`,`paperWidth${De(String(r))}`,i&&"paperFullWidth",o&&"paperFullScreen"]};return Ue(a,bke,e)},Tke=we(Bre,{name:"MuiDialog",slot:"Root",overridesResolver:(t,e)=>e.root})({"@media print":{position:"absolute !important"}}),Eke=we("div",{name:"MuiDialog",slot:"Container",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.container,e[`scroll${De(n.scroll)}`]]}})(({ownerState:t})=>j({height:"100%","@media print":{height:"auto"},outline:0},t.scroll==="paper"&&{display:"flex",justifyContent:"center",alignItems:"center"},t.scroll==="body"&&{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}})),Pke=we(Go,{name:"MuiDialog",slot:"Paper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.paper,e[`scrollPaper${De(n.scroll)}`],e[`paperWidth${De(String(n.maxWidth))}`],n.fullWidth&&e.paperFullWidth,n.fullScreen&&e.paperFullScreen]}})(({theme:t,ownerState:e})=>j({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"}},e.scroll==="paper"&&{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"},e.scroll==="body"&&{display:"inline-block",verticalAlign:"middle",textAlign:"left"},!e.maxWidth&&{maxWidth:"calc(100% - 64px)"},e.maxWidth==="xs"&&{maxWidth:t.breakpoints.unit==="px"?Math.max(t.breakpoints.values.xs,444):`max(${t.breakpoints.values.xs}${t.breakpoints.unit}, 444px)`,[`&.${Nx.paperScrollBody}`]:{[t.breakpoints.down(Math.max(t.breakpoints.values.xs,444)+32*2)]:{maxWidth:"calc(100% - 64px)"}}},e.maxWidth&&e.maxWidth!=="xs"&&{maxWidth:`${t.breakpoints.values[e.maxWidth]}${t.breakpoints.unit}`,[`&.${Nx.paperScrollBody}`]:{[t.breakpoints.down(t.breakpoints.values[e.maxWidth]+32*2)]:{maxWidth:"calc(100% - 64px)"}}},e.fullWidth&&{width:"calc(100% - 64px)"},e.fullScreen&&{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${Nx.paperScrollBody}`]:{margin:0,maxWidth:"100%"}})),Mke=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiDialog"}),i=Vo(),o={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{"aria-describedby":a,"aria-labelledby":s,BackdropComponent:l,BackdropProps:c,children:u,className:f,disableEscapeKeyDown:d=!1,fullScreen:h=!1,fullWidth:p=!1,maxWidth:m="sm",onBackdropClick:g,onClose:v,open:y,PaperComponent:x=Go,PaperProps:b={},scroll:_="paper",TransitionComponent:S=$M,transitionDuration:O=o,TransitionProps:C}=r,E=Ae(r,Ske),k=j({},r,{disableEscapeKeyDown:d,fullScreen:h,fullWidth:p,maxWidth:m,scroll:_}),I=Cke(k),P=M.useRef(),R=B=>{P.current=B.target===B.currentTarget},T=B=>{P.current&&(P.current=null,g&&g(B),v&&v(B,"backdropClick"))},L=cd(s),z=M.useMemo(()=>({titleId:L}),[L]);return w.jsx(Tke,j({className:ke(I.root,f),closeAfterTransition:!0,components:{Backdrop:Oke},componentsProps:{backdrop:j({transitionDuration:O,as:l},c)},disableEscapeKeyDown:d,onClose:v,open:y,ref:n,onClick:T,ownerState:k},E,{children:w.jsx(S,j({appear:!0,in:y,timeout:O,role:"presentation"},C,{children:w.jsx(Eke,{className:ke(I.container),onMouseDown:R,ownerState:k,children:w.jsx(Pke,j({as:x,elevation:24,role:"dialog","aria-describedby":a,"aria-labelledby":L},b,{className:ke(I.paper,b.className),ownerState:k,children:w.jsx(zre.Provider,{value:z,children:u})}))})}))}))}),el=Mke;function kke(t){return We("MuiDialogActions",t)}Ve("MuiDialogActions",["root","spacing"]);const Ake=["className","disableSpacing"],Rke=t=>{const{classes:e,disableSpacing:n}=t;return Ue({root:["root",!n&&"spacing"]},kke,e)},Ike=we("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disableSpacing&&e.spacing]}})(({ownerState:t})=>j({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto"},!t.disableSpacing&&{"& > :not(style) ~ :not(style)":{marginLeft:8}})),Dke=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiDialogActions"}),{className:i,disableSpacing:o=!1}=r,a=Ae(r,Ake),s=j({},r,{disableSpacing:o}),l=Rke(s);return w.jsx(Ike,j({className:ke(l.root,i),ownerState:s,ref:n},a))}),yp=Dke;function Lke(t){return We("MuiDialogContent",t)}Ve("MuiDialogContent",["root","dividers"]);function $ke(t){return We("MuiDialogTitle",t)}const Nke=Ve("MuiDialogTitle",["root"]),Fke=Nke,jke=["className","dividers"],Bke=t=>{const{classes:e,dividers:n}=t;return Ue({root:["root",n&&"dividers"]},Lke,e)},zke=we("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.dividers&&e.dividers]}})(({theme:t,ownerState:e})=>j({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px"},e.dividers?{padding:"16px 24px",borderTop:`1px solid ${(t.vars||t).palette.divider}`,borderBottom:`1px solid ${(t.vars||t).palette.divider}`}:{[`.${Fke.root} + &`]:{paddingTop:0}})),Uke=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiDialogContent"}),{className:i,dividers:o=!1}=r,a=Ae(r,jke),s=j({},r,{dividers:o}),l=Bke(s);return w.jsx(zke,j({className:ke(l.root,i),ownerState:s,ref:n},a))}),qs=Uke;function Wke(t){return We("MuiDialogContentText",t)}Ve("MuiDialogContentText",["root"]);const Vke=["children","className"],Gke=t=>{const{classes:e}=t,r=Ue({root:["root"]},Wke,e);return j({},e,r)},Hke=we(At,{shouldForwardProp:t=>di(t)||t==="classes",name:"MuiDialogContentText",slot:"Root",overridesResolver:(t,e)=>e.root})({}),qke=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiDialogContentText"}),{className:i}=r,o=Ae(r,Vke),a=Gke(o);return w.jsx(Hke,j({component:"p",variant:"body1",color:"text.secondary",ref:n,ownerState:o,className:ke(a.root,i)},r,{classes:a}))}),Xke=qke,Qke=["className","id"],Yke=t=>{const{classes:e}=t;return Ue({root:["root"]},$ke,e)},Kke=we(At,{name:"MuiDialogTitle",slot:"Root",overridesResolver:(t,e)=>e.root})({padding:"16px 24px",flex:"0 0 auto"}),Zke=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiDialogTitle"}),{className:i,id:o}=r,a=Ae(r,Qke),s=r,l=Yke(s),{titleId:c=o}=M.useContext(zre);return w.jsx(Kke,j({component:"h2",className:ke(l.root,i),ownerState:s,ref:n,variant:"h6",id:o??c},a))}),dd=Zke;function Jke(t){return We("MuiDivider",t)}const eAe=Ve("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),h8=eAe,tAe=["absolute","children","className","component","flexItem","light","orientation","role","textAlign","variant"],nAe=t=>{const{absolute:e,children:n,classes:r,flexItem:i,light:o,orientation:a,textAlign:s,variant:l}=t;return Ue({root:["root",e&&"absolute",l,o&&"light",a==="vertical"&&"vertical",i&&"flexItem",n&&"withChildren",n&&a==="vertical"&&"withChildrenVertical",s==="right"&&a!=="vertical"&&"textAlignRight",s==="left"&&a!=="vertical"&&"textAlignLeft"],wrapper:["wrapper",a==="vertical"&&"wrapperVertical"]},Jke,r)},rAe=we("div",{name:"MuiDivider",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.absolute&&e.absolute,e[n.variant],n.light&&e.light,n.orientation==="vertical"&&e.vertical,n.flexItem&&e.flexItem,n.children&&e.withChildren,n.children&&n.orientation==="vertical"&&e.withChildrenVertical,n.textAlign==="right"&&n.orientation!=="vertical"&&e.textAlignRight,n.textAlign==="left"&&n.orientation!=="vertical"&&e.textAlignLeft]}})(({theme:t,ownerState:e})=>j({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(t.vars||t).palette.divider,borderBottomWidth:"thin"},e.absolute&&{position:"absolute",bottom:0,left:0,width:"100%"},e.light&&{borderColor:t.vars?`rgba(${t.vars.palette.dividerChannel} / 0.08)`:kt(t.palette.divider,.08)},e.variant==="inset"&&{marginLeft:72},e.variant==="middle"&&e.orientation==="horizontal"&&{marginLeft:t.spacing(2),marginRight:t.spacing(2)},e.variant==="middle"&&e.orientation==="vertical"&&{marginTop:t.spacing(1),marginBottom:t.spacing(1)},e.orientation==="vertical"&&{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"},e.flexItem&&{alignSelf:"stretch",height:"auto"}),({ownerState:t})=>j({},t.children&&{display:"flex",whiteSpace:"nowrap",textAlign:"center",border:0,"&::before, &::after":{content:'""',alignSelf:"center"}}),({theme:t,ownerState:e})=>j({},e.children&&e.orientation!=="vertical"&&{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(t.vars||t).palette.divider}`}}),({theme:t,ownerState:e})=>j({},e.children&&e.orientation==="vertical"&&{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(t.vars||t).palette.divider}`}}),({ownerState:t})=>j({},t.textAlign==="right"&&t.orientation!=="vertical"&&{"&::before":{width:"90%"},"&::after":{width:"10%"}},t.textAlign==="left"&&t.orientation!=="vertical"&&{"&::before":{width:"10%"},"&::after":{width:"90%"}})),iAe=we("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.wrapper,n.orientation==="vertical"&&e.wrapperVertical]}})(({theme:t,ownerState:e})=>j({display:"inline-block",paddingLeft:`calc(${t.spacing(1)} * 1.2)`,paddingRight:`calc(${t.spacing(1)} * 1.2)`},e.orientation==="vertical"&&{paddingTop:`calc(${t.spacing(1)} * 1.2)`,paddingBottom:`calc(${t.spacing(1)} * 1.2)`})),Ure=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiDivider"}),{absolute:i=!1,children:o,className:a,component:s=o?"div":"hr",flexItem:l=!1,light:c=!1,orientation:u="horizontal",role:f=s!=="hr"?"separator":void 0,textAlign:d="center",variant:h="fullWidth"}=r,p=Ae(r,tAe),m=j({},r,{absolute:i,component:s,flexItem:l,light:c,orientation:u,role:f,textAlign:d,variant:h}),g=nAe(m);return w.jsx(rAe,j({as:s,className:ke(g.root,a),role:f,ref:n,ownerState:m},p,{children:o?w.jsx(iAe,{className:g.wrapper,ownerState:m,children:o}):null}))});Ure.muiSkipListHighlight=!0;const Qg=Ure,oAe=["addEndListener","appear","children","container","direction","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function aAe(t,e,n){const r=e.getBoundingClientRect(),i=n&&n.getBoundingClientRect(),o=ls(e);let a;if(e.fakeTransform)a=e.fakeTransform;else{const c=o.getComputedStyle(e);a=c.getPropertyValue("-webkit-transform")||c.getPropertyValue("transform")}let s=0,l=0;if(a&&a!=="none"&&typeof a=="string"){const c=a.split("(")[1].split(")")[0].split(",");s=parseInt(c[4],10),l=parseInt(c[5],10)}return t==="left"?i?`translateX(${i.right+s-r.left}px)`:`translateX(${o.innerWidth+s-r.left}px)`:t==="right"?i?`translateX(-${r.right-i.left-s}px)`:`translateX(-${r.left+r.width-s}px)`:t==="up"?i?`translateY(${i.bottom+l-r.top}px)`:`translateY(${o.innerHeight+l-r.top}px)`:i?`translateY(-${r.top-i.top+r.height-l}px)`:`translateY(-${r.top+r.height-l}px)`}function sAe(t){return typeof t=="function"?t():t}function iS(t,e,n){const r=sAe(n),i=aAe(t,e,r);i&&(e.style.webkitTransform=i,e.style.transform=i)}const lAe=M.forwardRef(function(e,n){const r=Vo(),i={enter:r.transitions.easing.easeOut,exit:r.transitions.easing.sharp},o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:a,appear:s=!0,children:l,container:c,direction:u="down",easing:f=i,in:d,onEnter:h,onEntered:p,onEntering:m,onExit:g,onExited:v,onExiting:y,style:x,timeout:b=o,TransitionComponent:_=M1}=e,S=Ae(e,oAe),O=M.useRef(null),C=Zt(l.ref,O,n),E=W=>U=>{W&&(U===void 0?W(O.current):W(O.current,U))},k=E((W,U)=>{iS(u,W,c),r5(W),h&&h(W,U)}),I=E((W,U)=>{const N=Xf({timeout:b,style:x,easing:f},{mode:"enter"});W.style.webkitTransition=r.transitions.create("-webkit-transform",j({},N)),W.style.transition=r.transitions.create("transform",j({},N)),W.style.webkitTransform="none",W.style.transform="none",m&&m(W,U)}),P=E(p),R=E(y),T=E(W=>{const U=Xf({timeout:b,style:x,easing:f},{mode:"exit"});W.style.webkitTransition=r.transitions.create("-webkit-transform",U),W.style.transition=r.transitions.create("transform",U),iS(u,W,c),g&&g(W)}),L=E(W=>{W.style.webkitTransition="",W.style.transition="",v&&v(W)}),z=W=>{a&&a(O.current,W)},B=M.useCallback(()=>{O.current&&iS(u,O.current,c)},[u,c]);return M.useEffect(()=>{if(d||u==="down"||u==="right")return;const W=Hv(()=>{O.current&&iS(u,O.current,c)}),U=ls(O.current);return U.addEventListener("resize",W),()=>{W.clear(),U.removeEventListener("resize",W)}},[u,d,c]),M.useEffect(()=>{d||B()},[d,B]),w.jsx(_,j({nodeRef:O,onEnter:k,onEntered:P,onEntering:I,onExit:T,onExited:L,onExiting:R,addEndListener:z,appear:s,in:d,timeout:b},S,{children:(W,U)=>M.cloneElement(l,j({ref:C,style:j({visibility:W==="exited"&&!d?"hidden":void 0},x,l.props.style)},U))}))}),cAe=lAe,uAe=["disableUnderline","components","componentsProps","fullWidth","hiddenLabel","inputComponent","multiline","slotProps","slots","type"],fAe=t=>{const{classes:e,disableUnderline:n}=t,i=Ue({root:["root",!n&&"underline"],input:["input"]},_Me,e);return j({},e,i)},dAe=we(DM,{shouldForwardProp:t=>di(t)||t==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[...RM(t,e),!n.disableUnderline&&e.underline]}})(({theme:t,ownerState:e})=>{var n;const r=t.palette.mode==="light",i=r?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",o=r?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",a=r?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",s=r?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return j({position:"relative",backgroundColor:t.vars?t.vars.palette.FilledInput.bg:o,borderTopLeftRadius:(t.vars||t).shape.borderRadius,borderTopRightRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),"&:hover":{backgroundColor:t.vars?t.vars.palette.FilledInput.hoverBg:a,"@media (hover: none)":{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:o}},[`&.${kd.focused}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:o},[`&.${kd.disabled}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.disabledBg:s}},!e.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(n=(t.vars||t).palette[e.color||"primary"])==null?void 0:n.main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${kd.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${kd.error}`]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`:i}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${kd.disabled}, .${kd.error}):before`]:{borderBottom:`1px solid ${(t.vars||t).palette.text.primary}`},[`&.${kd.disabled}:before`]:{borderBottomStyle:"dotted"}},e.startAdornment&&{paddingLeft:12},e.endAdornment&&{paddingRight:12},e.multiline&&j({padding:"25px 12px 8px"},e.size==="small"&&{paddingTop:21,paddingBottom:4},e.hiddenLabel&&{paddingTop:16,paddingBottom:17},e.hiddenLabel&&e.size==="small"&&{paddingTop:8,paddingBottom:9}))}),hAe=we(LM,{name:"MuiFilledInput",slot:"Input",overridesResolver:IM})(({theme:t,ownerState:e})=>j({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12},!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:t.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:t.palette.mode==="light"?null:"#fff",caretColor:t.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},t.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},e.size==="small"&&{paddingTop:21,paddingBottom:4},e.hiddenLabel&&{paddingTop:16,paddingBottom:17},e.startAdornment&&{paddingLeft:0},e.endAdornment&&{paddingRight:0},e.hiddenLabel&&e.size==="small"&&{paddingTop:8,paddingBottom:9},e.multiline&&{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0})),Wre=M.forwardRef(function(e,n){var r,i,o,a;const s=qe({props:e,name:"MuiFilledInput"}),{components:l={},componentsProps:c,fullWidth:u=!1,inputComponent:f="input",multiline:d=!1,slotProps:h,slots:p={},type:m="text"}=s,g=Ae(s,uAe),v=j({},s,{fullWidth:u,inputComponent:f,multiline:d,type:m}),y=fAe(s),x={root:{ownerState:v},input:{ownerState:v}},b=h??c?Ii(x,h??c):x,_=(r=(i=p.root)!=null?i:l.Root)!=null?r:dAe,S=(o=(a=p.input)!=null?a:l.Input)!=null?o:hAe;return w.jsx(h5,j({slots:{root:_,input:S},componentsProps:b,fullWidth:u,inputComponent:f,multiline:d,ref:n,type:m},g,{classes:y}))});Wre.muiName="Input";const Vre=Wre;function pAe(t){return We("MuiFormControl",t)}Ve("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const mAe=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],gAe=t=>{const{classes:e,margin:n,fullWidth:r}=t,i={root:["root",n!=="none"&&`margin${De(n)}`,r&&"fullWidth"]};return Ue(i,pAe,e)},vAe=we("div",{name:"MuiFormControl",slot:"Root",overridesResolver:({ownerState:t},e)=>j({},e.root,e[`margin${De(t.margin)}`],t.fullWidth&&e.fullWidth)})(({ownerState:t})=>j({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},t.margin==="normal"&&{marginTop:16,marginBottom:8},t.margin==="dense"&&{marginTop:8,marginBottom:4},t.fullWidth&&{width:"100%"})),yAe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiFormControl"}),{children:i,className:o,color:a="primary",component:s="div",disabled:l=!1,error:c=!1,focused:u,fullWidth:f=!1,hiddenLabel:d=!1,margin:h="none",required:p=!1,size:m="medium",variant:g="outlined"}=r,v=Ae(r,mAe),y=j({},r,{color:a,component:s,disabled:l,error:c,fullWidth:f,hiddenLabel:d,margin:h,required:p,size:m,variant:g}),x=gAe(y),[b,_]=M.useState(()=>{let R=!1;return i&&M.Children.forEach(i,T=>{if(!Ix(T,["Input","Select"]))return;const L=Ix(T,["Select"])?T.props.input:T;L&&uMe(L.props)&&(R=!0)}),R}),[S,O]=M.useState(()=>{let R=!1;return i&&M.Children.forEach(i,T=>{Ix(T,["Input","Select"])&&(CT(T.props,!0)||CT(T.props.inputProps,!0))&&(R=!0)}),R}),[C,E]=M.useState(!1);l&&C&&E(!1);const k=u!==void 0&&!l?u:C;let I;const P=M.useMemo(()=>({adornedStart:b,setAdornedStart:_,color:a,disabled:l,error:c,filled:S,focused:k,fullWidth:f,hiddenLabel:d,size:m,onBlur:()=>{E(!1)},onEmpty:()=>{O(!1)},onFilled:()=>{O(!0)},onFocus:()=>{E(!0)},registerEffect:I,required:p,variant:g}),[b,a,l,c,S,k,f,d,I,p,m,g]);return w.jsx(AM.Provider,{value:P,children:w.jsx(vAe,j({as:s,ownerState:y,className:ke(x.root,o),ref:n},v,{children:i}))})}),Yv=yAe,xAe=EOe({createStyledComponent:we("div",{name:"MuiStack",slot:"Root",overridesResolver:(t,e)=>e.root}),useThemeProps:t=>qe({props:t,name:"MuiStack"})}),bAe=xAe;function _Ae(t){return We("MuiFormControlLabel",t)}const wAe=Ve("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),ix=wAe,SAe=["checked","className","componentsProps","control","disabled","disableTypography","inputRef","label","labelPlacement","name","onChange","required","slotProps","value"],OAe=t=>{const{classes:e,disabled:n,labelPlacement:r,error:i,required:o}=t,a={root:["root",n&&"disabled",`labelPlacement${De(r)}`,i&&"error",o&&"required"],label:["label",n&&"disabled"],asterisk:["asterisk",i&&"error"]};return Ue(a,_Ae,e)},CAe=we("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${ix.label}`]:e.label},e.root,e[`labelPlacement${De(n.labelPlacement)}`]]}})(({theme:t,ownerState:e})=>j({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${ix.disabled}`]:{cursor:"default"}},e.labelPlacement==="start"&&{flexDirection:"row-reverse",marginLeft:16,marginRight:-11},e.labelPlacement==="top"&&{flexDirection:"column-reverse",marginLeft:16},e.labelPlacement==="bottom"&&{flexDirection:"column",marginLeft:16},{[`& .${ix.label}`]:{[`&.${ix.disabled}`]:{color:(t.vars||t).palette.text.disabled}}})),TAe=we("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(t,e)=>e.asterisk})(({theme:t})=>({[`&.${ix.error}`]:{color:(t.vars||t).palette.error.main}})),EAe=M.forwardRef(function(e,n){var r,i;const o=qe({props:e,name:"MuiFormControlLabel"}),{className:a,componentsProps:s={},control:l,disabled:c,disableTypography:u,label:f,labelPlacement:d="end",required:h,slotProps:p={}}=o,m=Ae(o,SAe),g=nc(),v=(r=c??l.props.disabled)!=null?r:g==null?void 0:g.disabled,y=h??l.props.required,x={disabled:v,required:y};["checked","name","onChange","value","inputRef"].forEach(E=>{typeof l.props[E]>"u"&&typeof o[E]<"u"&&(x[E]=o[E])});const b=fd({props:o,muiFormControl:g,states:["error"]}),_=j({},o,{disabled:v,labelPlacement:d,required:y,error:b.error}),S=OAe(_),O=(i=p.typography)!=null?i:s.typography;let C=f;return C!=null&&C.type!==At&&!u&&(C=w.jsx(At,j({component:"span"},O,{className:ke(S.label,O==null?void 0:O.className),children:C}))),w.jsxs(CAe,j({className:ke(S.root,a),ownerState:_,ref:n},m,{children:[M.cloneElement(l,x),y?w.jsxs(bAe,{display:"block",children:[C,w.jsxs(TAe,{ownerState:_,"aria-hidden":!0,className:S.asterisk,children:[" ","*"]})]}):C]}))}),xg=EAe;function PAe(t){return We("MuiFormGroup",t)}Ve("MuiFormGroup",["root","row","error"]);const MAe=["className","row"],kAe=t=>{const{classes:e,row:n,error:r}=t;return Ue({root:["root",n&&"row",r&&"error"]},PAe,e)},AAe=we("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.row&&e.row]}})(({ownerState:t})=>j({display:"flex",flexDirection:"column",flexWrap:"wrap"},t.row&&{flexDirection:"row"})),RAe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiFormGroup"}),{className:i,row:o=!1}=r,a=Ae(r,MAe),s=nc(),l=fd({props:r,muiFormControl:s,states:["error"]}),c=j({},r,{row:o,error:l.error}),u=kAe(c);return w.jsx(AAe,j({className:ke(u.root,i),ownerState:c,ref:n},a))}),IAe=RAe;function DAe(t){return We("MuiFormHelperText",t)}const LAe=Ve("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]),p8=LAe;var m8;const $Ae=["children","className","component","disabled","error","filled","focused","margin","required","variant"],NAe=t=>{const{classes:e,contained:n,size:r,disabled:i,error:o,filled:a,focused:s,required:l}=t,c={root:["root",i&&"disabled",o&&"error",r&&`size${De(r)}`,n&&"contained",s&&"focused",a&&"filled",l&&"required"]};return Ue(c,DAe,e)},FAe=we("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.size&&e[`size${De(n.size)}`],n.contained&&e.contained,n.filled&&e.filled]}})(({theme:t,ownerState:e})=>j({color:(t.vars||t).palette.text.secondary},t.typography.caption,{textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${p8.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${p8.error}`]:{color:(t.vars||t).palette.error.main}},e.size==="small"&&{marginTop:4},e.contained&&{marginLeft:14,marginRight:14})),jAe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiFormHelperText"}),{children:i,className:o,component:a="p"}=r,s=Ae(r,$Ae),l=nc(),c=fd({props:r,muiFormControl:l,states:["variant","size","disabled","error","filled","focused","required"]}),u=j({},r,{component:a,contained:c.variant==="filled"||c.variant==="outlined",variant:c.variant,size:c.size,disabled:c.disabled,error:c.error,filled:c.filled,focused:c.focused,required:c.required}),f=NAe(u);return w.jsx(FAe,j({as:a,ownerState:u,className:ke(f.root,o),ref:n},s,{children:i===" "?m8||(m8=w.jsx("span",{className:"notranslate",children:"​"})):i}))}),Gre=jAe;function BAe(t){return We("MuiFormLabel",t)}const zAe=Ve("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),Fx=zAe,UAe=["children","className","color","component","disabled","error","filled","focused","required"],WAe=t=>{const{classes:e,color:n,focused:r,disabled:i,error:o,filled:a,required:s}=t,l={root:["root",`color${De(n)}`,i&&"disabled",o&&"error",a&&"filled",r&&"focused",s&&"required"],asterisk:["asterisk",o&&"error"]};return Ue(l,BAe,e)},VAe=we("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:({ownerState:t},e)=>j({},e.root,t.color==="secondary"&&e.colorSecondary,t.filled&&e.filled)})(({theme:t,ownerState:e})=>j({color:(t.vars||t).palette.text.secondary},t.typography.body1,{lineHeight:"1.4375em",padding:0,position:"relative",[`&.${Fx.focused}`]:{color:(t.vars||t).palette[e.color].main},[`&.${Fx.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${Fx.error}`]:{color:(t.vars||t).palette.error.main}})),GAe=we("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(t,e)=>e.asterisk})(({theme:t})=>({[`&.${Fx.error}`]:{color:(t.vars||t).palette.error.main}})),HAe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiFormLabel"}),{children:i,className:o,component:a="label"}=r,s=Ae(r,UAe),l=nc(),c=fd({props:r,muiFormControl:l,states:["color","required","focused","disabled","error","filled"]}),u=j({},r,{color:c.color||"primary",component:a,disabled:c.disabled,error:c.error,filled:c.filled,focused:c.focused,required:c.required}),f=WAe(u);return w.jsxs(VAe,j({as:a,ownerState:u,className:ke(f.root,o),ref:n},s,{children:[i,c.required&&w.jsxs(GAe,{ownerState:u,"aria-hidden":!0,className:f.asterisk,children:[" ","*"]})]}))}),qAe=HAe,XAe=M.createContext(),g8=XAe;function QAe(t){return We("MuiGrid",t)}const YAe=[0,1,2,3,4,5,6,7,8,9,10],KAe=["column-reverse","column","row-reverse","row"],ZAe=["nowrap","wrap-reverse","wrap"],u0=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],Ab=Ve("MuiGrid",["root","container","item","zeroMinWidth",...YAe.map(t=>`spacing-xs-${t}`),...KAe.map(t=>`direction-xs-${t}`),...ZAe.map(t=>`wrap-xs-${t}`),...u0.map(t=>`grid-xs-${t}`),...u0.map(t=>`grid-sm-${t}`),...u0.map(t=>`grid-md-${t}`),...u0.map(t=>`grid-lg-${t}`),...u0.map(t=>`grid-xl-${t}`)]),JAe=["className","columns","columnSpacing","component","container","direction","item","rowSpacing","spacing","wrap","zeroMinWidth"];function bg(t){const e=parseFloat(t);return`${e}${String(t).replace(String(e),"")||"px"}`}function eRe({theme:t,ownerState:e}){let n;return t.breakpoints.keys.reduce((r,i)=>{let o={};if(e[i]&&(n=e[i]),!n)return r;if(n===!0)o={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if(n==="auto")o={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{const a=Mh({values:e.columns,breakpoints:t.breakpoints.values}),s=typeof a=="object"?a[i]:a;if(s==null)return r;const l=`${Math.round(n/s*1e8)/1e6}%`;let c={};if(e.container&&e.item&&e.columnSpacing!==0){const u=t.spacing(e.columnSpacing);if(u!=="0px"){const f=`calc(${l} + ${bg(u)})`;c={flexBasis:f,maxWidth:f}}}o=j({flexBasis:l,flexGrow:0,maxWidth:l},c)}return t.breakpoints.values[i]===0?Object.assign(r,o):r[t.breakpoints.up(i)]=o,r},{})}function tRe({theme:t,ownerState:e}){const n=Mh({values:e.direction,breakpoints:t.breakpoints.values});return Uo({theme:t},n,r=>{const i={flexDirection:r};return r.indexOf("column")===0&&(i[`& > .${Ab.item}`]={maxWidth:"none"}),i})}function Hre({breakpoints:t,values:e}){let n="";Object.keys(e).forEach(i=>{n===""&&e[i]!==0&&(n=i)});const r=Object.keys(t).sort((i,o)=>t[i]-t[o]);return r.slice(0,r.indexOf(n))}function nRe({theme:t,ownerState:e}){const{container:n,rowSpacing:r}=e;let i={};if(n&&r!==0){const o=Mh({values:r,breakpoints:t.breakpoints.values});let a;typeof o=="object"&&(a=Hre({breakpoints:t.breakpoints.values,values:o})),i=Uo({theme:t},o,(s,l)=>{var c;const u=t.spacing(s);return u!=="0px"?{marginTop:`-${bg(u)}`,[`& > .${Ab.item}`]:{paddingTop:bg(u)}}:(c=a)!=null&&c.includes(l)?{}:{marginTop:0,[`& > .${Ab.item}`]:{paddingTop:0}}})}return i}function rRe({theme:t,ownerState:e}){const{container:n,columnSpacing:r}=e;let i={};if(n&&r!==0){const o=Mh({values:r,breakpoints:t.breakpoints.values});let a;typeof o=="object"&&(a=Hre({breakpoints:t.breakpoints.values,values:o})),i=Uo({theme:t},o,(s,l)=>{var c;const u=t.spacing(s);return u!=="0px"?{width:`calc(100% + ${bg(u)})`,marginLeft:`-${bg(u)}`,[`& > .${Ab.item}`]:{paddingLeft:bg(u)}}:(c=a)!=null&&c.includes(l)?{}:{width:"100%",marginLeft:0,[`& > .${Ab.item}`]:{paddingLeft:0}}})}return i}function iRe(t,e,n={}){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[n[`spacing-xs-${String(t)}`]];const r=[];return e.forEach(i=>{const o=t[i];Number(o)>0&&r.push(n[`spacing-${i}-${String(o)}`])}),r}const oRe=we("div",{name:"MuiGrid",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{container:r,direction:i,item:o,spacing:a,wrap:s,zeroMinWidth:l,breakpoints:c}=n;let u=[];r&&(u=iRe(a,c,e));const f=[];return c.forEach(d=>{const h=n[d];h&&f.push(e[`grid-${d}-${String(h)}`])}),[e.root,r&&e.container,o&&e.item,l&&e.zeroMinWidth,...u,i!=="row"&&e[`direction-xs-${String(i)}`],s!=="wrap"&&e[`wrap-xs-${String(s)}`],...f]}})(({ownerState:t})=>j({boxSizing:"border-box"},t.container&&{display:"flex",flexWrap:"wrap",width:"100%"},t.item&&{margin:0},t.zeroMinWidth&&{minWidth:0},t.wrap!=="wrap"&&{flexWrap:t.wrap}),tRe,nRe,rRe,eRe);function aRe(t,e){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[`spacing-xs-${String(t)}`];const n=[];return e.forEach(r=>{const i=t[r];if(Number(i)>0){const o=`spacing-${r}-${String(i)}`;n.push(o)}}),n}const sRe=t=>{const{classes:e,container:n,direction:r,item:i,spacing:o,wrap:a,zeroMinWidth:s,breakpoints:l}=t;let c=[];n&&(c=aRe(o,l));const u=[];l.forEach(d=>{const h=t[d];h&&u.push(`grid-${d}-${String(h)}`)});const f={root:["root",n&&"container",i&&"item",s&&"zeroMinWidth",...c,r!=="row"&&`direction-xs-${String(r)}`,a!=="wrap"&&`wrap-xs-${String(a)}`,...u]};return Ue(f,QAe,e)},lRe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiGrid"}),{breakpoints:i}=Vo(),o=S1(r),{className:a,columns:s,columnSpacing:l,component:c="div",container:u=!1,direction:f="row",item:d=!1,rowSpacing:h,spacing:p=0,wrap:m="wrap",zeroMinWidth:g=!1}=o,v=Ae(o,JAe),y=h||p,x=l||p,b=M.useContext(g8),_=u?s||12:b,S={},O=j({},v);i.keys.forEach(k=>{v[k]!=null&&(S[k]=v[k],delete O[k])});const C=j({},o,{columns:_,container:u,direction:f,item:d,rowSpacing:y,columnSpacing:x,wrap:m,zeroMinWidth:g,spacing:p},S,{breakpoints:i.keys}),E=sRe(C);return w.jsx(g8.Provider,{value:_,children:w.jsx(oRe,j({ownerState:C,className:ke(E.root,a),as:c,ref:n},O))})}),wC=lRe,cRe=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function LL(t){return`scale(${t}, ${t**2})`}const uRe={entering:{opacity:1,transform:LL(1)},entered:{opacity:1,transform:"none"}},bA=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),qre=M.forwardRef(function(e,n){const{addEndListener:r,appear:i=!0,children:o,easing:a,in:s,onEnter:l,onEntered:c,onEntering:u,onExit:f,onExited:d,onExiting:h,style:p,timeout:m="auto",TransitionComponent:g=M1}=e,v=Ae(e,cRe),y=mf(),x=M.useRef(),b=Vo(),_=M.useRef(null),S=Zt(_,o.ref,n),O=L=>z=>{if(L){const B=_.current;z===void 0?L(B):L(B,z)}},C=O(u),E=O((L,z)=>{r5(L);const{duration:B,delay:W,easing:U}=Xf({style:p,timeout:m,easing:a},{mode:"enter"});let N;m==="auto"?(N=b.transitions.getAutoHeightDuration(L.clientHeight),x.current=N):N=B,L.style.transition=[b.transitions.create("opacity",{duration:N,delay:W}),b.transitions.create("transform",{duration:bA?N:N*.666,delay:W,easing:U})].join(","),l&&l(L,z)}),k=O(c),I=O(h),P=O(L=>{const{duration:z,delay:B,easing:W}=Xf({style:p,timeout:m,easing:a},{mode:"exit"});let U;m==="auto"?(U=b.transitions.getAutoHeightDuration(L.clientHeight),x.current=U):U=z,L.style.transition=[b.transitions.create("opacity",{duration:U,delay:B}),b.transitions.create("transform",{duration:bA?U:U*.666,delay:bA?B:B||U*.333,easing:W})].join(","),L.style.opacity=0,L.style.transform=LL(.75),f&&f(L)}),R=O(d),T=L=>{m==="auto"&&y.start(x.current||0,L),r&&r(_.current,L)};return w.jsx(g,j({appear:i,in:s,nodeRef:_,onEnter:E,onEntered:k,onEntering:C,onExit:P,onExited:R,onExiting:I,addEndListener:T,timeout:m==="auto"?null:m},v,{children:(L,z)=>M.cloneElement(o,j({style:j({opacity:0,transform:LL(.75),visibility:L==="exited"&&!s?"hidden":void 0},uRe[L],p,o.props.style),ref:S},z))}))});qre.muiSupportAuto=!0;const Rb=qre,fRe=["disableUnderline","components","componentsProps","fullWidth","inputComponent","multiline","slotProps","slots","type"],dRe=t=>{const{classes:e,disableUnderline:n}=t,i=Ue({root:["root",!n&&"underline"],input:["input"]},vMe,e);return j({},e,i)},hRe=we(DM,{shouldForwardProp:t=>di(t)||t==="classes",name:"MuiInput",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[...RM(t,e),!n.disableUnderline&&e.underline]}})(({theme:t,ownerState:e})=>{let r=t.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return t.vars&&(r=`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`),j({position:"relative"},e.formControl&&{"label + &":{marginTop:16}},!e.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(t.vars||t).palette[e.color].main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${c0.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${c0.error}`]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${r}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${c0.disabled}, .${c0.error}):before`]:{borderBottom:`2px solid ${(t.vars||t).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${r}`}},[`&.${c0.disabled}:before`]:{borderBottomStyle:"dotted"}})}),pRe=we(LM,{name:"MuiInput",slot:"Input",overridesResolver:IM})({}),Xre=M.forwardRef(function(e,n){var r,i,o,a;const s=qe({props:e,name:"MuiInput"}),{disableUnderline:l,components:c={},componentsProps:u,fullWidth:f=!1,inputComponent:d="input",multiline:h=!1,slotProps:p,slots:m={},type:g="text"}=s,v=Ae(s,fRe),y=dRe(s),b={root:{ownerState:{disableUnderline:l}}},_=p??u?Ii(p??u,b):b,S=(r=(i=m.root)!=null?i:c.Root)!=null?r:hRe,O=(o=(a=m.input)!=null?a:c.Input)!=null?o:pRe;return w.jsx(h5,j({slots:{root:S,input:O},slotProps:_,fullWidth:f,inputComponent:d,multiline:h,ref:n,type:g},v,{classes:y}))});Xre.muiName="Input";const xp=Xre;function mRe(t){return We("MuiInputAdornment",t)}const gRe=Ve("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]),v8=gRe;var y8;const vRe=["children","className","component","disablePointerEvents","disableTypography","position","variant"],yRe=(t,e)=>{const{ownerState:n}=t;return[e.root,e[`position${De(n.position)}`],n.disablePointerEvents===!0&&e.disablePointerEvents,e[n.variant]]},xRe=t=>{const{classes:e,disablePointerEvents:n,hiddenLabel:r,position:i,size:o,variant:a}=t,s={root:["root",n&&"disablePointerEvents",i&&`position${De(i)}`,a,r&&"hiddenLabel",o&&`size${De(o)}`]};return Ue(s,mRe,e)},bRe=we("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:yRe})(({theme:t,ownerState:e})=>j({display:"flex",height:"0.01em",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(t.vars||t).palette.action.active},e.variant==="filled"&&{[`&.${v8.positionStart}&:not(.${v8.hiddenLabel})`]:{marginTop:16}},e.position==="start"&&{marginRight:8},e.position==="end"&&{marginLeft:8},e.disablePointerEvents===!0&&{pointerEvents:"none"})),_Re=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiInputAdornment"}),{children:i,className:o,component:a="div",disablePointerEvents:s=!1,disableTypography:l=!1,position:c,variant:u}=r,f=Ae(r,vRe),d=nc()||{};let h=u;u&&d.variant,d&&!h&&(h=d.variant);const p=j({},r,{hiddenLabel:d.hiddenLabel,size:d.size,disablePointerEvents:s,position:c,variant:h}),m=xRe(p);return w.jsx(AM.Provider,{value:null,children:w.jsx(bRe,j({as:a,ownerState:p,className:ke(m.root,o),ref:n},f,{children:typeof i=="string"&&!l?w.jsx(At,{color:"text.secondary",children:i}):w.jsxs(M.Fragment,{children:[c==="start"?y8||(y8=w.jsx("span",{className:"notranslate",children:"​"})):null,i]})}))})}),wRe=_Re;function SRe(t){return We("MuiInputLabel",t)}Ve("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const ORe=["disableAnimation","margin","shrink","variant","className"],CRe=t=>{const{classes:e,formControl:n,size:r,shrink:i,disableAnimation:o,variant:a,required:s}=t,l={root:["root",n&&"formControl",!o&&"animated",i&&"shrink",r&&r!=="normal"&&`size${De(r)}`,a],asterisk:[s&&"asterisk"]},c=Ue(l,SRe,e);return j({},e,c)},TRe=we(qAe,{shouldForwardProp:t=>di(t)||t==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${Fx.asterisk}`]:e.asterisk},e.root,n.formControl&&e.formControl,n.size==="small"&&e.sizeSmall,n.shrink&&e.shrink,!n.disableAnimation&&e.animated,n.focused&&e.focused,e[n.variant]]}})(({theme:t,ownerState:e})=>j({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},e.formControl&&{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"},e.size==="small"&&{transform:"translate(0, 17px) scale(1)"},e.shrink&&{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"},!e.disableAnimation&&{transition:t.transitions.create(["color","transform","max-width"],{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut})},e.variant==="filled"&&j({zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},e.size==="small"&&{transform:"translate(12px, 13px) scale(1)"},e.shrink&&j({userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"},e.size==="small"&&{transform:"translate(12px, 4px) scale(0.75)"})),e.variant==="outlined"&&j({zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},e.size==="small"&&{transform:"translate(14px, 9px) scale(1)"},e.shrink&&{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}))),ERe=M.forwardRef(function(e,n){const r=qe({name:"MuiInputLabel",props:e}),{disableAnimation:i=!1,shrink:o,className:a}=r,s=Ae(r,ORe),l=nc();let c=o;typeof c>"u"&&l&&(c=l.filled||l.focused||l.adornedStart);const u=fd({props:r,muiFormControl:l,states:["size","variant","required","focused"]}),f=j({},r,{disableAnimation:i,formControl:l,shrink:c,size:u.size,variant:u.variant,required:u.required,focused:u.focused}),d=CRe(f);return w.jsx(TRe,j({"data-shrink":c,ownerState:f,ref:n,className:ke(d.root,a)},s,{classes:d}))}),Kv=ERe;function PRe(t){return We("MuiLink",t)}const MRe=Ve("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),kRe=MRe,Qre={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},ARe=t=>Qre[t]||t,RRe=({theme:t,ownerState:e})=>{const n=ARe(e.color),r=Wg(t,`palette.${n}`,!1)||e.color,i=Wg(t,`palette.${n}Channel`);return"vars"in t&&i?`rgba(${i} / 0.4)`:kt(r,.4)},IRe=["className","color","component","onBlur","onFocus","TypographyClasses","underline","variant","sx"],DRe=t=>{const{classes:e,component:n,focusVisible:r,underline:i}=t,o={root:["root",`underline${De(i)}`,n==="button"&&"button",r&&"focusVisible"]};return Ue(o,PRe,e)},LRe=we(At,{name:"MuiLink",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`underline${De(n.underline)}`],n.component==="button"&&e.button]}})(({theme:t,ownerState:e})=>j({},e.underline==="none"&&{textDecoration:"none"},e.underline==="hover"&&{textDecoration:"none","&:hover":{textDecoration:"underline"}},e.underline==="always"&&j({textDecoration:"underline"},e.color!=="inherit"&&{textDecorationColor:RRe({theme:t,ownerState:e})},{"&:hover":{textDecorationColor:"inherit"}}),e.component==="button"&&{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${kRe.focusVisible}`]:{outline:"auto"}})),$Re=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiLink"}),{className:i,color:o="primary",component:a="a",onBlur:s,onFocus:l,TypographyClasses:c,underline:u="always",variant:f="inherit",sx:d}=r,h=Ae(r,IRe),{isFocusVisibleRef:p,onBlur:m,onFocus:g,ref:v}=C1(),[y,x]=M.useState(!1),b=Zt(n,v),_=E=>{m(E),p.current===!1&&x(!1),s&&s(E)},S=E=>{g(E),p.current===!0&&x(!0),l&&l(E)},O=j({},r,{color:o,component:a,focusVisible:y,underline:u,variant:f}),C=DRe(O);return w.jsx(LRe,j({color:o,className:ke(C.root,i),classes:c,component:a,onBlur:_,onFocus:S,ref:b,ownerState:O,variant:f,sx:[...Object.keys(Qre).includes(o)?[]:[{color:o}],...Array.isArray(d)?d:[d]]},h))}),NRe=$Re,FRe=M.createContext({}),Gs=FRe;function jRe(t){return We("MuiList",t)}Ve("MuiList",["root","padding","dense","subheader"]);const BRe=["children","className","component","dense","disablePadding","subheader"],zRe=t=>{const{classes:e,disablePadding:n,dense:r,subheader:i}=t;return Ue({root:["root",!n&&"padding",r&&"dense",i&&"subheader"]},jRe,e)},URe=we("ul",{name:"MuiList",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disablePadding&&e.padding,n.dense&&e.dense,n.subheader&&e.subheader]}})(({ownerState:t})=>j({listStyle:"none",margin:0,padding:0,position:"relative"},!t.disablePadding&&{paddingTop:8,paddingBottom:8},t.subheader&&{paddingTop:0})),WRe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiList"}),{children:i,className:o,component:a="ul",dense:s=!1,disablePadding:l=!1,subheader:c}=r,u=Ae(r,BRe),f=M.useMemo(()=>({dense:s}),[s]),d=j({},r,{component:a,dense:s,disablePadding:l}),h=zRe(d);return w.jsx(Gs.Provider,{value:f,children:w.jsxs(URe,j({as:a,className:ke(h.root,o),ref:n,ownerState:d},u,{children:[c,i]}))})}),FM=WRe;function VRe(t){return We("MuiListItem",t)}const GRe=Ve("MuiListItem",["root","container","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","padding","button","secondaryAction","selected"]),km=GRe;function HRe(t){return We("MuiListItemButton",t)}const qRe=Ve("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),Am=qRe,XRe=["alignItems","autoFocus","component","children","dense","disableGutters","divider","focusVisibleClassName","selected","className"],QRe=(t,e)=>{const{ownerState:n}=t;return[e.root,n.dense&&e.dense,n.alignItems==="flex-start"&&e.alignItemsFlexStart,n.divider&&e.divider,!n.disableGutters&&e.gutters]},YRe=t=>{const{alignItems:e,classes:n,dense:r,disabled:i,disableGutters:o,divider:a,selected:s}=t,c=Ue({root:["root",r&&"dense",!o&&"gutters",a&&"divider",i&&"disabled",e==="flex-start"&&"alignItemsFlexStart",s&&"selected"]},HRe,n);return j({},n,c)},KRe=we(us,{shouldForwardProp:t=>di(t)||t==="classes",name:"MuiListItemButton",slot:"Root",overridesResolver:QRe})(({theme:t,ownerState:e})=>j({display:"flex",flexGrow:1,justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minWidth:0,boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Am.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${Am.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:kt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${Am.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:kt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.primary.main,t.palette.action.selectedOpacity)}},[`&.${Am.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${Am.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.divider&&{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"},e.alignItems==="flex-start"&&{alignItems:"flex-start"},!e.disableGutters&&{paddingLeft:16,paddingRight:16},e.dense&&{paddingTop:4,paddingBottom:4})),ZRe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiListItemButton"}),{alignItems:i="center",autoFocus:o=!1,component:a="div",children:s,dense:l=!1,disableGutters:c=!1,divider:u=!1,focusVisibleClassName:f,selected:d=!1,className:h}=r,p=Ae(r,XRe),m=M.useContext(Gs),g=M.useMemo(()=>({dense:l||m.dense||!1,alignItems:i,disableGutters:c}),[i,m.dense,l,c]),v=M.useRef(null);Vr(()=>{o&&v.current&&v.current.focus()},[o]);const y=j({},r,{alignItems:i,dense:g.dense,disableGutters:c,divider:u,selected:d}),x=YRe(y),b=Zt(v,n);return w.jsx(Gs.Provider,{value:g,children:w.jsx(KRe,j({ref:b,href:p.href||p.to,component:(p.href||p.to)&&a==="div"?"button":a,focusVisibleClassName:ke(x.focusVisible,f),ownerState:y,className:ke(x.root,h)},p,{classes:x,children:s}))})}),Yre=ZRe;function JRe(t){return We("MuiListItemSecondaryAction",t)}Ve("MuiListItemSecondaryAction",["root","disableGutters"]);const eIe=["className"],tIe=t=>{const{disableGutters:e,classes:n}=t;return Ue({root:["root",e&&"disableGutters"]},JRe,n)},nIe=we("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.disableGutters&&e.disableGutters]}})(({ownerState:t})=>j({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)"},t.disableGutters&&{right:0})),Kre=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiListItemSecondaryAction"}),{className:i}=r,o=Ae(r,eIe),a=M.useContext(Gs),s=j({},r,{disableGutters:a.disableGutters}),l=tIe(s);return w.jsx(nIe,j({className:ke(l.root,i),ownerState:s,ref:n},o))});Kre.muiName="ListItemSecondaryAction";const TT=Kre,rIe=["className"],iIe=["alignItems","autoFocus","button","children","className","component","components","componentsProps","ContainerComponent","ContainerProps","dense","disabled","disableGutters","disablePadding","divider","focusVisibleClassName","secondaryAction","selected","slotProps","slots"],oIe=(t,e)=>{const{ownerState:n}=t;return[e.root,n.dense&&e.dense,n.alignItems==="flex-start"&&e.alignItemsFlexStart,n.divider&&e.divider,!n.disableGutters&&e.gutters,!n.disablePadding&&e.padding,n.button&&e.button,n.hasSecondaryAction&&e.secondaryAction]},aIe=t=>{const{alignItems:e,button:n,classes:r,dense:i,disabled:o,disableGutters:a,disablePadding:s,divider:l,hasSecondaryAction:c,selected:u}=t;return Ue({root:["root",i&&"dense",!a&&"gutters",!s&&"padding",l&&"divider",o&&"disabled",n&&"button",e==="flex-start"&&"alignItemsFlexStart",c&&"secondaryAction",u&&"selected"],container:["container"]},VRe,r)},sIe=we("div",{name:"MuiListItem",slot:"Root",overridesResolver:oIe})(({theme:t,ownerState:e})=>j({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left"},!e.disablePadding&&j({paddingTop:8,paddingBottom:8},e.dense&&{paddingTop:4,paddingBottom:4},!e.disableGutters&&{paddingLeft:16,paddingRight:16},!!e.secondaryAction&&{paddingRight:48}),!!e.secondaryAction&&{[`& > .${Am.root}`]:{paddingRight:48}},{[`&.${km.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${km.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${km.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:kt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${km.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.alignItems==="flex-start"&&{alignItems:"flex-start"},e.divider&&{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"},e.button&&{transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${km.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:kt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.primary.main,t.palette.action.selectedOpacity)}}},e.hasSecondaryAction&&{paddingRight:48})),lIe=we("li",{name:"MuiListItem",slot:"Container",overridesResolver:(t,e)=>e.container})({position:"relative"}),cIe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiListItem"}),{alignItems:i="center",autoFocus:o=!1,button:a=!1,children:s,className:l,component:c,components:u={},componentsProps:f={},ContainerComponent:d="li",ContainerProps:{className:h}={},dense:p=!1,disabled:m=!1,disableGutters:g=!1,disablePadding:v=!1,divider:y=!1,focusVisibleClassName:x,secondaryAction:b,selected:_=!1,slotProps:S={},slots:O={}}=r,C=Ae(r.ContainerProps,rIe),E=Ae(r,iIe),k=M.useContext(Gs),I=M.useMemo(()=>({dense:p||k.dense||!1,alignItems:i,disableGutters:g}),[i,k.dense,p,g]),P=M.useRef(null);Vr(()=>{o&&P.current&&P.current.focus()},[o]);const R=M.Children.toArray(s),T=R.length&&Ix(R[R.length-1],["ListItemSecondaryAction"]),L=j({},r,{alignItems:i,autoFocus:o,button:a,dense:I.dense,disabled:m,disableGutters:g,disablePadding:v,divider:y,hasSecondaryAction:T,selected:_}),z=aIe(L),B=Zt(P,n),W=O.root||u.Root||sIe,U=S.root||f.root||{},N=j({className:ke(z.root,U.className,l),disabled:m},E);let $=c||"li";return a&&(N.component=c||"div",N.focusVisibleClassName=ke(km.focusVisible,x),$=us),T?($=!N.component&&!c?"div":$,d==="li"&&($==="li"?$="div":N.component==="li"&&(N.component="div")),w.jsx(Gs.Provider,{value:I,children:w.jsxs(lIe,j({as:d,className:ke(z.container,h),ref:B,ownerState:L},C,{children:[w.jsx(W,j({},U,!zl(W)&&{as:$,ownerState:j({},L,U.ownerState)},N,{children:R})),R.pop()]}))})):w.jsx(Gs.Provider,{value:I,children:w.jsxs(W,j({},U,{as:$,ref:B},!zl(W)&&{ownerState:j({},L,U.ownerState)},N,{children:[R,b&&w.jsx(TT,{children:b})]}))})}),jx=cIe;function uIe(t){return We("MuiListItemIcon",t)}const fIe=Ve("MuiListItemIcon",["root","alignItemsFlexStart"]),x8=fIe,dIe=["className"],hIe=t=>{const{alignItems:e,classes:n}=t;return Ue({root:["root",e==="flex-start"&&"alignItemsFlexStart"]},uIe,n)},pIe=we("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.alignItems==="flex-start"&&e.alignItemsFlexStart]}})(({theme:t,ownerState:e})=>j({minWidth:56,color:(t.vars||t).palette.action.active,flexShrink:0,display:"inline-flex"},e.alignItems==="flex-start"&&{marginTop:8})),mIe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiListItemIcon"}),{className:i}=r,o=Ae(r,dIe),a=M.useContext(Gs),s=j({},r,{alignItems:a.alignItems}),l=hIe(s);return w.jsx(pIe,j({className:ke(l.root,i),ownerState:s,ref:n},o))}),Zre=mIe;function gIe(t){return We("MuiListItemText",t)}const vIe=Ve("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),ET=vIe,yIe=["children","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps"],xIe=t=>{const{classes:e,inset:n,primary:r,secondary:i,dense:o}=t;return Ue({root:["root",n&&"inset",o&&"dense",r&&i&&"multiline"],primary:["primary"],secondary:["secondary"]},gIe,e)},bIe=we("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${ET.primary}`]:e.primary},{[`& .${ET.secondary}`]:e.secondary},e.root,n.inset&&e.inset,n.primary&&n.secondary&&e.multiline,n.dense&&e.dense]}})(({ownerState:t})=>j({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4},t.primary&&t.secondary&&{marginTop:6,marginBottom:6},t.inset&&{paddingLeft:56})),_Ie=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiListItemText"}),{children:i,className:o,disableTypography:a=!1,inset:s=!1,primary:l,primaryTypographyProps:c,secondary:u,secondaryTypographyProps:f}=r,d=Ae(r,yIe),{dense:h}=M.useContext(Gs);let p=l??i,m=u;const g=j({},r,{disableTypography:a,inset:s,primary:!!p,secondary:!!m,dense:h}),v=xIe(g);return p!=null&&p.type!==At&&!a&&(p=w.jsx(At,j({variant:h?"body2":"body1",className:v.primary,component:c!=null&&c.variant?void 0:"span",display:"block"},c,{children:p}))),m!=null&&m.type!==At&&!a&&(m=w.jsx(At,j({variant:"body2",className:v.secondary,color:"text.secondary",display:"block"},f,{children:m}))),w.jsxs(bIe,j({className:ke(v.root,o),ownerState:g,ref:n},d,{children:[p,m]}))}),es=_Ie,wIe=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function _A(t,e,n){return t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:n?null:t.firstChild}function b8(t,e,n){return t===e?n?t.firstChild:t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:n?null:t.lastChild}function Jre(t,e){if(e===void 0)return!0;let n=t.innerText;return n===void 0&&(n=t.textContent),n=n.trim().toLowerCase(),n.length===0?!1:e.repeating?n[0]===e.keys[0]:n.indexOf(e.keys.join(""))===0}function f0(t,e,n,r,i,o){let a=!1,s=i(t,e,e?n:!1);for(;s;){if(s===t.firstChild){if(a)return!1;a=!0}const l=r?!1:s.disabled||s.getAttribute("aria-disabled")==="true";if(!s.hasAttribute("tabindex")||!Jre(s,o)||l)s=i(t,s,n);else return s.focus(),!0}return!1}const SIe=M.forwardRef(function(e,n){const{actions:r,autoFocus:i=!1,autoFocusItem:o=!1,children:a,className:s,disabledItemsFocusable:l=!1,disableListWrap:c=!1,onKeyDown:u,variant:f="selectedMenu"}=e,d=Ae(e,wIe),h=M.useRef(null),p=M.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});Vr(()=>{i&&h.current.focus()},[i]),M.useImperativeHandle(r,()=>({adjustStyleForScrollbar:(x,{direction:b})=>{const _=!h.current.style.width;if(x.clientHeight{const b=h.current,_=x.key,S=$n(b).activeElement;if(_==="ArrowDown")x.preventDefault(),f0(b,S,c,l,_A);else if(_==="ArrowUp")x.preventDefault(),f0(b,S,c,l,b8);else if(_==="Home")x.preventDefault(),f0(b,null,c,l,_A);else if(_==="End")x.preventDefault(),f0(b,null,c,l,b8);else if(_.length===1){const O=p.current,C=_.toLowerCase(),E=performance.now();O.keys.length>0&&(E-O.lastTime>500?(O.keys=[],O.repeating=!0,O.previousKeyMatched=!0):O.repeating&&C!==O.keys[0]&&(O.repeating=!1)),O.lastTime=E,O.keys.push(C);const k=S&&!O.repeating&&Jre(S,O);O.previousKeyMatched&&(k||f0(b,S,!1,l,_A,O))?x.preventDefault():O.previousKeyMatched=!1}u&&u(x)},g=Zt(h,n);let v=-1;M.Children.forEach(a,(x,b)=>{if(!M.isValidElement(x)){v===b&&(v+=1,v>=a.length&&(v=-1));return}x.props.disabled||(f==="selectedMenu"&&x.props.selected||v===-1)&&(v=b),v===b&&(x.props.disabled||x.props.muiSkipListHighlight||x.type.muiSkipListHighlight)&&(v+=1,v>=a.length&&(v=-1))});const y=M.Children.map(a,(x,b)=>{if(b===v){const _={};return o&&(_.autoFocus=!0),x.props.tabIndex===void 0&&f==="selectedMenu"&&(_.tabIndex=0),M.cloneElement(x,_)}return x});return w.jsx(FM,j({role:"menu",ref:g,className:s,onKeyDown:m,tabIndex:i?0:-1},d,{children:y}))}),eie=SIe;function OIe(t){return We("MuiPopover",t)}Ve("MuiPopover",["root","paper"]);const CIe=["onEntering"],TIe=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],EIe=["slotProps"];function _8(t,e){let n=0;return typeof e=="number"?n=e:e==="center"?n=t.height/2:e==="bottom"&&(n=t.height),n}function w8(t,e){let n=0;return typeof e=="number"?n=e:e==="center"?n=t.width/2:e==="right"&&(n=t.width),n}function S8(t){return[t.horizontal,t.vertical].map(e=>typeof e=="number"?`${e}px`:e).join(" ")}function wA(t){return typeof t=="function"?t():t}const PIe=t=>{const{classes:e}=t;return Ue({root:["root"],paper:["paper"]},OIe,e)},MIe=we(Bre,{name:"MuiPopover",slot:"Root",overridesResolver:(t,e)=>e.root})({}),tie=we(Go,{name:"MuiPopover",slot:"Paper",overridesResolver:(t,e)=>e.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),kIe=M.forwardRef(function(e,n){var r,i,o;const a=qe({props:e,name:"MuiPopover"}),{action:s,anchorEl:l,anchorOrigin:c={vertical:"top",horizontal:"left"},anchorPosition:u,anchorReference:f="anchorEl",children:d,className:h,container:p,elevation:m=8,marginThreshold:g=16,open:v,PaperProps:y={},slots:x,slotProps:b,transformOrigin:_={vertical:"top",horizontal:"left"},TransitionComponent:S=Rb,transitionDuration:O="auto",TransitionProps:{onEntering:C}={},disableScrollLock:E=!1}=a,k=Ae(a.TransitionProps,CIe),I=Ae(a,TIe),P=(r=b==null?void 0:b.paper)!=null?r:y,R=M.useRef(),T=Zt(R,P.ref),L=j({},a,{anchorOrigin:c,anchorReference:f,elevation:m,marginThreshold:g,externalPaperSlotProps:P,transformOrigin:_,TransitionComponent:S,transitionDuration:O,TransitionProps:k}),z=PIe(L),B=M.useCallback(()=>{if(f==="anchorPosition")return u;const ve=wA(l),ce=(ve&&ve.nodeType===1?ve:$n(R.current).body).getBoundingClientRect();return{top:ce.top+_8(ce,c.vertical),left:ce.left+w8(ce,c.horizontal)}},[l,c.horizontal,c.vertical,u,f]),W=M.useCallback(ve=>({vertical:_8(ve,_.vertical),horizontal:w8(ve,_.horizontal)}),[_.horizontal,_.vertical]),U=M.useCallback(ve=>{const F={width:ve.offsetWidth,height:ve.offsetHeight},ce=W(F);if(f==="none")return{top:null,left:null,transformOrigin:S8(ce)};const le=B();let Q=le.top-ce.vertical,X=le.left-ce.horizontal;const ee=Q+F.height,ge=X+F.width,ye=ls(wA(l)),H=ye.innerHeight-g,G=ye.innerWidth-g;if(g!==null&&QH){const ie=ee-H;Q-=ie,ce.vertical+=ie}if(g!==null&&XG){const ie=ge-G;X-=ie,ce.horizontal+=ie}return{top:`${Math.round(Q)}px`,left:`${Math.round(X)}px`,transformOrigin:S8(ce)}},[l,f,B,W,g]),[N,$]=M.useState(v),D=M.useCallback(()=>{const ve=R.current;if(!ve)return;const F=U(ve);F.top!==null&&(ve.style.top=F.top),F.left!==null&&(ve.style.left=F.left),ve.style.transformOrigin=F.transformOrigin,$(!0)},[U]);M.useEffect(()=>(E&&window.addEventListener("scroll",D),()=>window.removeEventListener("scroll",D)),[l,E,D]);const A=(ve,F)=>{C&&C(ve,F),D()},q=()=>{$(!1)};M.useEffect(()=>{v&&D()}),M.useImperativeHandle(s,()=>v?{updatePosition:()=>{D()}}:null,[v,D]),M.useEffect(()=>{if(!v)return;const ve=Hv(()=>{D()}),F=ls(l);return F.addEventListener("resize",ve),()=>{ve.clear(),F.removeEventListener("resize",ve)}},[l,v,D]);let Y=O;O==="auto"&&!S.muiSupportAuto&&(Y=void 0);const K=p||(l?$n(wA(l)).body:void 0),se=(i=x==null?void 0:x.root)!=null?i:MIe,te=(o=x==null?void 0:x.paper)!=null?o:tie,J=Lr({elementType:te,externalSlotProps:j({},P,{style:N?P.style:j({},P.style,{opacity:0})}),additionalProps:{elevation:m,ref:T},ownerState:L,className:ke(z.paper,P==null?void 0:P.className)}),pe=Lr({elementType:se,externalSlotProps:(b==null?void 0:b.root)||{},externalForwardedProps:I,additionalProps:{ref:n,slotProps:{backdrop:{invisible:!0}},container:K,open:v},ownerState:L,className:ke(z.root,h)}),{slotProps:be}=pe,re=Ae(pe,EIe);return w.jsx(se,j({},re,!zl(se)&&{slotProps:be,disableScrollLock:E},{children:w.jsx(S,j({appear:!0,in:v,onEntering:A,onExited:q,timeout:Y},k,{children:w.jsx(te,j({},J,{children:d}))}))}))}),bp=kIe;function AIe(t){return We("MuiMenu",t)}Ve("MuiMenu",["root","paper","list"]);const RIe=["onEntering"],IIe=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],DIe={vertical:"top",horizontal:"right"},LIe={vertical:"top",horizontal:"left"},$Ie=t=>{const{classes:e}=t;return Ue({root:["root"],paper:["paper"],list:["list"]},AIe,e)},NIe=we(bp,{shouldForwardProp:t=>di(t)||t==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(t,e)=>e.root})({}),FIe=we(tie,{name:"MuiMenu",slot:"Paper",overridesResolver:(t,e)=>e.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),jIe=we(eie,{name:"MuiMenu",slot:"List",overridesResolver:(t,e)=>e.list})({outline:0}),BIe=M.forwardRef(function(e,n){var r,i;const o=qe({props:e,name:"MuiMenu"}),{autoFocus:a=!0,children:s,className:l,disableAutoFocusItem:c=!1,MenuListProps:u={},onClose:f,open:d,PaperProps:h={},PopoverClasses:p,transitionDuration:m="auto",TransitionProps:{onEntering:g}={},variant:v="selectedMenu",slots:y={},slotProps:x={}}=o,b=Ae(o.TransitionProps,RIe),_=Ae(o,IIe),S=T1(),O=j({},o,{autoFocus:a,disableAutoFocusItem:c,MenuListProps:u,onEntering:g,PaperProps:h,transitionDuration:m,TransitionProps:b,variant:v}),C=$Ie(O),E=a&&!c&&d,k=M.useRef(null),I=(W,U)=>{k.current&&k.current.adjustStyleForScrollbar(W,{direction:S?"rtl":"ltr"}),g&&g(W,U)},P=W=>{W.key==="Tab"&&(W.preventDefault(),f&&f(W,"tabKeyDown"))};let R=-1;M.Children.map(s,(W,U)=>{M.isValidElement(W)&&(W.props.disabled||(v==="selectedMenu"&&W.props.selected||R===-1)&&(R=U))});const T=(r=y.paper)!=null?r:FIe,L=(i=x.paper)!=null?i:h,z=Lr({elementType:y.root,externalSlotProps:x.root,ownerState:O,className:[C.root,l]}),B=Lr({elementType:T,externalSlotProps:L,ownerState:O,className:C.paper});return w.jsx(NIe,j({onClose:f,anchorOrigin:{vertical:"bottom",horizontal:S?"right":"left"},transformOrigin:S?DIe:LIe,slots:{paper:T,root:y.root},slotProps:{root:z,paper:B},open:d,ref:n,transitionDuration:m,TransitionProps:j({onEntering:I},b),ownerState:O},_,{classes:p,children:w.jsx(jIe,j({onKeyDown:P,actions:k,autoFocus:a&&(R===-1||c),autoFocusItem:E,variant:v},u,{className:ke(C.list,u.className),children:s}))}))}),_p=BIe;function zIe(t){return We("MuiMenuItem",t)}const UIe=Ve("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),d0=UIe,WIe=["autoFocus","component","dense","divider","disableGutters","focusVisibleClassName","role","tabIndex","className"],VIe=(t,e)=>{const{ownerState:n}=t;return[e.root,n.dense&&e.dense,n.divider&&e.divider,!n.disableGutters&&e.gutters]},GIe=t=>{const{disabled:e,dense:n,divider:r,disableGutters:i,selected:o,classes:a}=t,l=Ue({root:["root",n&&"dense",e&&"disabled",!i&&"gutters",r&&"divider",o&&"selected"]},zIe,a);return j({},a,l)},HIe=we(us,{shouldForwardProp:t=>di(t)||t==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:VIe})(({theme:t,ownerState:e})=>j({},t.typography.body1,{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap"},!e.disableGutters&&{paddingLeft:16,paddingRight:16},e.divider&&{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"},{"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${d0.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${d0.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:kt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${d0.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:kt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.primary.main,t.palette.action.selectedOpacity)}},[`&.${d0.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${d0.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity},[`& + .${h8.root}`]:{marginTop:t.spacing(1),marginBottom:t.spacing(1)},[`& + .${h8.inset}`]:{marginLeft:52},[`& .${ET.root}`]:{marginTop:0,marginBottom:0},[`& .${ET.inset}`]:{paddingLeft:36},[`& .${x8.root}`]:{minWidth:36}},!e.dense&&{[t.breakpoints.up("sm")]:{minHeight:"auto"}},e.dense&&j({minHeight:32,paddingTop:4,paddingBottom:4},t.typography.body2,{[`& .${x8.root} svg`]:{fontSize:"1.25rem"}}))),qIe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiMenuItem"}),{autoFocus:i=!1,component:o="li",dense:a=!1,divider:s=!1,disableGutters:l=!1,focusVisibleClassName:c,role:u="menuitem",tabIndex:f,className:d}=r,h=Ae(r,WIe),p=M.useContext(Gs),m=M.useMemo(()=>({dense:a||p.dense||!1,disableGutters:l}),[p.dense,a,l]),g=M.useRef(null);Vr(()=>{i&&g.current&&g.current.focus()},[i]);const v=j({},r,{dense:m.dense,divider:s,disableGutters:l}),y=GIe(r),x=Zt(g,n);let b;return r.disabled||(b=f!==void 0?f:-1),w.jsx(Gs.Provider,{value:m,children:w.jsx(HIe,j({ref:x,role:u,tabIndex:b,component:o,focusVisibleClassName:ke(y.focusVisible,c),className:ke(y.root,d)},h,{ownerState:v,classes:y}))})}),Nr=qIe;function XIe(t){return We("MuiNativeSelect",t)}const QIe=Ve("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),m5=QIe,YIe=["className","disabled","error","IconComponent","inputRef","variant"],KIe=t=>{const{classes:e,variant:n,disabled:r,multiple:i,open:o,error:a}=t,s={select:["select",n,r&&"disabled",i&&"multiple",a&&"error"],icon:["icon",`icon${De(n)}`,o&&"iconOpen",r&&"disabled"]};return Ue(s,XIe,e)},nie=({ownerState:t,theme:e})=>j({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":j({},e.vars?{backgroundColor:`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.05)`}:{backgroundColor:e.palette.mode==="light"?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)"},{borderRadius:0}),"&::-ms-expand":{display:"none"},[`&.${m5.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(e.vars||e).palette.background.paper},"&&&":{paddingRight:24,minWidth:16}},t.variant==="filled"&&{"&&&":{paddingRight:32}},t.variant==="outlined"&&{borderRadius:(e.vars||e).shape.borderRadius,"&:focus":{borderRadius:(e.vars||e).shape.borderRadius},"&&&":{paddingRight:32}}),ZIe=we("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:di,overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.select,e[n.variant],n.error&&e.error,{[`&.${m5.multiple}`]:e.multiple}]}})(nie),rie=({ownerState:t,theme:e})=>j({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(e.vars||e).palette.action.active,[`&.${m5.disabled}`]:{color:(e.vars||e).palette.action.disabled}},t.open&&{transform:"rotate(180deg)"},t.variant==="filled"&&{right:7},t.variant==="outlined"&&{right:7}),JIe=we("svg",{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.icon,n.variant&&e[`icon${De(n.variant)}`],n.open&&e.iconOpen]}})(rie),eDe=M.forwardRef(function(e,n){const{className:r,disabled:i,error:o,IconComponent:a,inputRef:s,variant:l="standard"}=e,c=Ae(e,YIe),u=j({},e,{disabled:i,variant:l,error:o}),f=KIe(u);return w.jsxs(M.Fragment,{children:[w.jsx(ZIe,j({ownerState:u,className:ke(f.select,r),disabled:i,ref:s||n},c)),e.multiple?null:w.jsx(JIe,{as:a,ownerState:u,className:f.icon})]})}),tDe=eDe;var O8;const nDe=["children","classes","className","label","notched"],rDe=we("fieldset",{shouldForwardProp:di})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),iDe=we("legend",{shouldForwardProp:di})(({ownerState:t,theme:e})=>j({float:"unset",width:"auto",overflow:"hidden"},!t.withLabel&&{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})},t.withLabel&&j({display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}},t.notched&&{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})})));function oDe(t){const{className:e,label:n,notched:r}=t,i=Ae(t,nDe),o=n!=null&&n!=="",a=j({},t,{notched:r,withLabel:o});return w.jsx(rDe,j({"aria-hidden":!0,className:e,ownerState:a},i,{children:w.jsx(iDe,{ownerState:a,children:o?w.jsx("span",{children:n}):O8||(O8=w.jsx("span",{className:"notranslate",children:"​"}))})}))}const aDe=["components","fullWidth","inputComponent","label","multiline","notched","slots","type"],sDe=t=>{const{classes:e}=t,r=Ue({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},xMe,e);return j({},e,r)},lDe=we(DM,{shouldForwardProp:t=>di(t)||t==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:RM})(({theme:t,ownerState:e})=>{const n=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return j({position:"relative",borderRadius:(t.vars||t).shape.borderRadius,[`&:hover .${Tu.notchedOutline}`]:{borderColor:(t.vars||t).palette.text.primary},"@media (hover: none)":{[`&:hover .${Tu.notchedOutline}`]:{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:n}},[`&.${Tu.focused} .${Tu.notchedOutline}`]:{borderColor:(t.vars||t).palette[e.color].main,borderWidth:2},[`&.${Tu.error} .${Tu.notchedOutline}`]:{borderColor:(t.vars||t).palette.error.main},[`&.${Tu.disabled} .${Tu.notchedOutline}`]:{borderColor:(t.vars||t).palette.action.disabled}},e.startAdornment&&{paddingLeft:14},e.endAdornment&&{paddingRight:14},e.multiline&&j({padding:"16.5px 14px"},e.size==="small"&&{padding:"8.5px 14px"}))}),cDe=we(oDe,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(t,e)=>e.notchedOutline})(({theme:t})=>{const e=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:e}}),uDe=we(LM,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:IM})(({theme:t,ownerState:e})=>j({padding:"16.5px 14px"},!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:t.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:t.palette.mode==="light"?null:"#fff",caretColor:t.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},t.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},e.size==="small"&&{padding:"8.5px 14px"},e.multiline&&{padding:0},e.startAdornment&&{paddingLeft:0},e.endAdornment&&{paddingRight:0})),iie=M.forwardRef(function(e,n){var r,i,o,a,s;const l=qe({props:e,name:"MuiOutlinedInput"}),{components:c={},fullWidth:u=!1,inputComponent:f="input",label:d,multiline:h=!1,notched:p,slots:m={},type:g="text"}=l,v=Ae(l,aDe),y=sDe(l),x=nc(),b=fd({props:l,muiFormControl:x,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),_=j({},l,{color:b.color||"primary",disabled:b.disabled,error:b.error,focused:b.focused,formControl:x,fullWidth:u,hiddenLabel:b.hiddenLabel,multiline:h,size:b.size,type:g}),S=(r=(i=m.root)!=null?i:c.Root)!=null?r:lDe,O=(o=(a=m.input)!=null?a:c.Input)!=null?o:uDe;return w.jsx(h5,j({slots:{root:S,input:O},renderSuffix:C=>w.jsx(cDe,{ownerState:_,className:y.notchedOutline,label:d!=null&&d!==""&&b.required?s||(s=w.jsxs(M.Fragment,{children:[d," ","*"]})):d,notched:typeof p<"u"?p:!!(C.startAdornment||C.filled||C.focused)}),fullWidth:u,inputComponent:f,multiline:h,ref:n,type:g},v,{classes:j({},y,{notchedOutline:null})}))});iie.muiName="Input";const oie=iie,fDe=ti(w.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"RadioButtonUnchecked"),dDe=ti(w.jsx("path",{d:"M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"}),"RadioButtonChecked"),hDe=we("span",{shouldForwardProp:di})({position:"relative",display:"flex"}),pDe=we(fDe)({transform:"scale(1)"}),mDe=we(dDe)(({theme:t,ownerState:e})=>j({left:0,position:"absolute",transform:"scale(0)",transition:t.transitions.create("transform",{easing:t.transitions.easing.easeIn,duration:t.transitions.duration.shortest})},e.checked&&{transform:"scale(1)",transition:t.transitions.create("transform",{easing:t.transitions.easing.easeOut,duration:t.transitions.duration.shortest})}));function aie(t){const{checked:e=!1,classes:n={},fontSize:r}=t,i=j({},t,{checked:e});return w.jsxs(hDe,{className:n.root,ownerState:i,children:[w.jsx(pDe,{fontSize:r,className:n.background,ownerState:i}),w.jsx(mDe,{fontSize:r,className:n.dot,ownerState:i})]})}const gDe=M.createContext(void 0),sie=gDe;function vDe(){return M.useContext(sie)}function yDe(t){return We("MuiRadio",t)}const C8=Ve("MuiRadio",["root","checked","disabled","colorPrimary","colorSecondary","sizeSmall"]),xDe=["checked","checkedIcon","color","icon","name","onChange","size","className"],bDe=t=>{const{classes:e,color:n,size:r}=t,i={root:["root",`color${De(n)}`,r!=="medium"&&`size${De(r)}`]};return j({},e,Ue(i,yDe,e))},_De=we(p5,{shouldForwardProp:t=>di(t)||t==="classes",name:"MuiRadio",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.size!=="medium"&&e[`size${De(n.size)}`],e[`color${De(n.color)}`]]}})(({theme:t,ownerState:e})=>j({color:(t.vars||t).palette.text.secondary},!e.disableRipple&&{"&:hover":{backgroundColor:t.vars?`rgba(${e.color==="default"?t.vars.palette.action.activeChannel:t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(e.color==="default"?t.palette.action.active:t.palette[e.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},e.color!=="default"&&{[`&.${C8.checked}`]:{color:(t.vars||t).palette[e.color].main}},{[`&.${C8.disabled}`]:{color:(t.vars||t).palette.action.disabled}}));function wDe(t,e){return typeof e=="object"&&e!==null?t===e:String(t)===String(e)}const T8=w.jsx(aie,{checked:!0}),E8=w.jsx(aie,{}),SDe=M.forwardRef(function(e,n){var r,i;const o=qe({props:e,name:"MuiRadio"}),{checked:a,checkedIcon:s=T8,color:l="primary",icon:c=E8,name:u,onChange:f,size:d="medium",className:h}=o,p=Ae(o,xDe),m=j({},o,{color:l,size:d}),g=bDe(m),v=vDe();let y=a;const x=yT(f,v&&v.onChange);let b=u;return v&&(typeof y>"u"&&(y=wDe(v.value,o.value)),typeof b>"u"&&(b=v.name)),w.jsx(_De,j({type:"radio",icon:M.cloneElement(c,{fontSize:(r=E8.props.fontSize)!=null?r:d}),checkedIcon:M.cloneElement(s,{fontSize:(i=T8.props.fontSize)!=null?i:d}),ownerState:m,classes:g,name:b,checked:y,onChange:x,ref:n,className:ke(g.root,h)},p))}),Bx=SDe;function ODe(t){return We("MuiRadioGroup",t)}Ve("MuiRadioGroup",["root","row","error"]);const CDe=["actions","children","className","defaultValue","name","onChange","value"],TDe=t=>{const{classes:e,row:n,error:r}=t;return Ue({root:["root",n&&"row",r&&"error"]},ODe,e)},EDe=M.forwardRef(function(e,n){const{actions:r,children:i,className:o,defaultValue:a,name:s,onChange:l,value:c}=e,u=Ae(e,CDe),f=M.useRef(null),d=TDe(e),[h,p]=Hs({controlled:c,default:a,name:"RadioGroup"});M.useImperativeHandle(r,()=>({focus:()=>{let y=f.current.querySelector("input:not(:disabled):checked");y||(y=f.current.querySelector("input:not(:disabled)")),y&&y.focus()}}),[]);const m=Zt(n,f),g=cd(s),v=M.useMemo(()=>({name:g,onChange(y){p(y.target.value),l&&l(y,y.target.value)},value:h}),[g,l,p,h]);return w.jsx(sie.Provider,{value:v,children:w.jsx(IAe,j({role:"radiogroup",ref:m,className:ke(d.root,o)},u,{children:i}))})}),g5=EDe;function PDe(t){return We("MuiSelect",t)}const h0=Ve("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var P8;const MDe=["aria-describedby","aria-label","autoFocus","autoWidth","children","className","defaultOpen","defaultValue","disabled","displayEmpty","error","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"],kDe=we("div",{name:"MuiSelect",slot:"Select",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`&.${h0.select}`]:e.select},{[`&.${h0.select}`]:e[n.variant]},{[`&.${h0.error}`]:e.error},{[`&.${h0.multiple}`]:e.multiple}]}})(nie,{[`&.${h0.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),ADe=we("svg",{name:"MuiSelect",slot:"Icon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.icon,n.variant&&e[`icon${De(n.variant)}`],n.open&&e.iconOpen]}})(rie),RDe=we("input",{shouldForwardProp:t=>PM(t)&&t!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(t,e)=>e.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function M8(t,e){return typeof e=="object"&&e!==null?t===e:String(t)===String(e)}function IDe(t){return t==null||typeof t=="string"&&!t.trim()}const DDe=t=>{const{classes:e,variant:n,disabled:r,multiple:i,open:o,error:a}=t,s={select:["select",n,r&&"disabled",i&&"multiple",a&&"error"],icon:["icon",`icon${De(n)}`,o&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return Ue(s,PDe,e)},LDe=M.forwardRef(function(e,n){var r;const{"aria-describedby":i,"aria-label":o,autoFocus:a,autoWidth:s,children:l,className:c,defaultOpen:u,defaultValue:f,disabled:d,displayEmpty:h,error:p=!1,IconComponent:m,inputRef:g,labelId:v,MenuProps:y={},multiple:x,name:b,onBlur:_,onChange:S,onClose:O,onFocus:C,onOpen:E,open:k,readOnly:I,renderValue:P,SelectDisplayProps:R={},tabIndex:T,value:L,variant:z="standard"}=e,B=Ae(e,MDe),[W,U]=Hs({controlled:L,default:f,name:"Select"}),[N,$]=Hs({controlled:k,default:u,name:"Select"}),D=M.useRef(null),A=M.useRef(null),[q,Y]=M.useState(null),{current:K}=M.useRef(k!=null),[se,te]=M.useState(),J=Zt(n,g),pe=M.useCallback(me=>{A.current=me,me&&Y(me)},[]),be=q==null?void 0:q.parentNode;M.useImperativeHandle(J,()=>({focus:()=>{A.current.focus()},node:D.current,value:W}),[W]),M.useEffect(()=>{u&&N&&q&&!K&&(te(s?null:be.clientWidth),A.current.focus())},[q,s]),M.useEffect(()=>{a&&A.current.focus()},[a]),M.useEffect(()=>{if(!v)return;const me=$n(A.current).getElementById(v);if(me){const Ne=()=>{getSelection().isCollapsed&&A.current.focus()};return me.addEventListener("click",Ne),()=>{me.removeEventListener("click",Ne)}}},[v]);const re=(me,Ne)=>{me?E&&E(Ne):O&&O(Ne),K||(te(s?null:be.clientWidth),$(me))},ve=me=>{me.button===0&&(me.preventDefault(),A.current.focus(),re(!0,me))},F=me=>{re(!1,me)},ce=M.Children.toArray(l),le=me=>{const Ne=ce.find(Ce=>Ce.props.value===me.target.value);Ne!==void 0&&(U(Ne.props.value),S&&S(me,Ne))},Q=me=>Ne=>{let Ce;if(Ne.currentTarget.hasAttribute("tabindex")){if(x){Ce=Array.isArray(W)?W.slice():[];const Re=W.indexOf(me.props.value);Re===-1?Ce.push(me.props.value):Ce.splice(Re,1)}else Ce=me.props.value;if(me.props.onClick&&me.props.onClick(Ne),W!==Ce&&(U(Ce),S)){const Re=Ne.nativeEvent||Ne,ae=new Re.constructor(Re.type,Re);Object.defineProperty(ae,"target",{writable:!0,value:{value:Ce,name:b}}),S(ae,me)}x||re(!1,Ne)}},X=me=>{I||[" ","ArrowUp","ArrowDown","Enter"].indexOf(me.key)!==-1&&(me.preventDefault(),re(!0,me))},ee=q!==null&&N,ge=me=>{!ee&&_&&(Object.defineProperty(me,"target",{writable:!0,value:{value:W,name:b}}),_(me))};delete B["aria-invalid"];let ye,H;const G=[];let ie=!1;(CT({value:W})||h)&&(P?ye=P(W):ie=!0);const he=ce.map(me=>{if(!M.isValidElement(me))return null;let Ne;if(x){if(!Array.isArray(W))throw new Error(su(2));Ne=W.some(Ce=>M8(Ce,me.props.value)),Ne&&ie&&G.push(me.props.children)}else Ne=M8(W,me.props.value),Ne&&ie&&(H=me.props.children);return M.cloneElement(me,{"aria-selected":Ne?"true":"false",onClick:Q(me),onKeyUp:Ce=>{Ce.key===" "&&Ce.preventDefault(),me.props.onKeyUp&&me.props.onKeyUp(Ce)},role:"option",selected:Ne,value:void 0,"data-value":me.props.value})});ie&&(x?G.length===0?ye=null:ye=G.reduce((me,Ne,Ce)=>(me.push(Ne),Ce{const{classes:e}=t;return e},v5={name:"MuiSelect",overridesResolver:(t,e)=>e.root,shouldForwardProp:t=>di(t)&&t!=="variant",slot:"Root"},BDe=we(xp,v5)(""),zDe=we(oie,v5)(""),UDe=we(Vre,v5)(""),lie=M.forwardRef(function(e,n){const r=qe({name:"MuiSelect",props:e}),{autoWidth:i=!1,children:o,classes:a={},className:s,defaultOpen:l=!1,displayEmpty:c=!1,IconComponent:u=SMe,id:f,input:d,inputProps:h,label:p,labelId:m,MenuProps:g,multiple:v=!1,native:y=!1,onClose:x,onOpen:b,open:_,renderValue:S,SelectDisplayProps:O,variant:C="outlined"}=r,E=Ae(r,NDe),k=y?tDe:$De,I=nc(),P=fd({props:r,muiFormControl:I,states:["variant","error"]}),R=P.variant||C,T=j({},r,{variant:R,classes:a}),L=jDe(T),z=Ae(L,FDe),B=d||{standard:w.jsx(BDe,{ownerState:T}),outlined:w.jsx(zDe,{label:p,ownerState:T}),filled:w.jsx(UDe,{ownerState:T})}[R],W=Zt(n,B.ref);return w.jsx(M.Fragment,{children:M.cloneElement(B,j({inputComponent:k,inputProps:j({children:o,error:P.error,IconComponent:u,variant:R,type:void 0,multiple:v},y?{id:f}:{autoWidth:i,defaultOpen:l,displayEmpty:c,labelId:m,MenuProps:g,onClose:x,onOpen:b,open:_,renderValue:S,SelectDisplayProps:j({id:f},O)},h,{classes:h?Ii(z,h.classes):z},d?d.props.inputProps:{})},(v&&y||c)&&R==="outlined"?{notched:!0}:{},{ref:W,className:ke(B.props.className,s,L.root)},!d&&{variant:R},E))})});lie.muiName="Select";const wp=lie,WDe=t=>!t||!zl(t);function VDe(t){return We("MuiSlider",t)}const GDe=Ve("MuiSlider",["root","active","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","disabled","dragging","focusVisible","mark","markActive","marked","markLabel","markLabelActive","rail","sizeSmall","thumb","thumbColorPrimary","thumbColorSecondary","thumbColorError","thumbColorSuccess","thumbColorInfo","thumbColorWarning","track","trackInverted","trackFalse","thumbSizeSmall","valueLabel","valueLabelOpen","valueLabelCircle","valueLabelLabel","vertical"]),qa=GDe,HDe=t=>{const{open:e}=t;return{offset:ke(e&&qa.valueLabelOpen),circle:qa.valueLabelCircle,label:qa.valueLabelLabel}};function qDe(t){const{children:e,className:n,value:r}=t,i=HDe(t);return e?M.cloneElement(e,{className:ke(e.props.className)},w.jsxs(M.Fragment,{children:[e.props.children,w.jsx("span",{className:ke(i.offset,n),"aria-hidden":!0,children:w.jsx("span",{className:i.circle,children:w.jsx("span",{className:i.label,children:r})})})]})):null}const XDe=["aria-label","aria-valuetext","aria-labelledby","component","components","componentsProps","color","classes","className","disableSwap","disabled","getAriaLabel","getAriaValueText","marks","max","min","name","onChange","onChangeCommitted","orientation","shiftStep","size","step","scale","slotProps","slots","tabIndex","track","value","valueLabelDisplay","valueLabelFormat"],QDe=Zj();function k8(t){return t}const YDe=we("span",{name:"MuiSlider",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`color${De(n.color)}`],n.size!=="medium"&&e[`size${De(n.size)}`],n.marked&&e.marked,n.orientation==="vertical"&&e.vertical,n.track==="inverted"&&e.trackInverted,n.track===!1&&e.trackFalse]}})(({theme:t})=>{var e;return{borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",WebkitTapHighlightColor:"transparent","@media print":{colorAdjust:"exact"},[`&.${qa.disabled}`]:{pointerEvents:"none",cursor:"default",color:(t.vars||t).palette.grey[400]},[`&.${qa.dragging}`]:{[`& .${qa.thumb}, & .${qa.track}`]:{transition:"none"}},variants:[...Object.keys(((e=t.vars)!=null?e:t).palette).filter(n=>{var r;return((r=t.vars)!=null?r:t).palette[n].main}).map(n=>({props:{color:n},style:{color:(t.vars||t).palette[n].main}})),{props:{orientation:"horizontal"},style:{height:4,width:"100%",padding:"13px 0","@media (pointer: coarse)":{padding:"20px 0"}}},{props:{orientation:"horizontal",size:"small"},style:{height:2}},{props:{orientation:"horizontal",marked:!0},style:{marginBottom:20}},{props:{orientation:"vertical"},style:{height:"100%",width:4,padding:"0 13px","@media (pointer: coarse)":{padding:"0 20px"}}},{props:{orientation:"vertical",size:"small"},style:{width:2}},{props:{orientation:"vertical",marked:!0},style:{marginRight:44}}]}}),KDe=we("span",{name:"MuiSlider",slot:"Rail",overridesResolver:(t,e)=>e.rail})({display:"block",position:"absolute",borderRadius:"inherit",backgroundColor:"currentColor",opacity:.38,variants:[{props:{orientation:"horizontal"},style:{width:"100%",height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{height:"100%",width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:"inverted"},style:{opacity:1}}]}),ZDe=we("span",{name:"MuiSlider",slot:"Track",overridesResolver:(t,e)=>e.track})(({theme:t})=>{var e;return{display:"block",position:"absolute",borderRadius:"inherit",border:"1px solid currentColor",backgroundColor:"currentColor",transition:t.transitions.create(["left","width","bottom","height"],{duration:t.transitions.duration.shortest}),variants:[{props:{size:"small"},style:{border:"none"}},{props:{orientation:"horizontal"},style:{height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:!1},style:{display:"none"}},...Object.keys(((e=t.vars)!=null?e:t).palette).filter(n=>{var r;return((r=t.vars)!=null?r:t).palette[n].main}).map(n=>({props:{color:n,track:"inverted"},style:j({},t.vars?{backgroundColor:t.vars.palette.Slider[`${n}Track`],borderColor:t.vars.palette.Slider[`${n}Track`]}:j({backgroundColor:Pb(t.palette[n].main,.62),borderColor:Pb(t.palette[n].main,.62)},t.applyStyles("dark",{backgroundColor:Eb(t.palette[n].main,.5)}),t.applyStyles("dark",{borderColor:Eb(t.palette[n].main,.5)})))}))]}}),JDe=we("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.thumb,e[`thumbColor${De(n.color)}`],n.size!=="medium"&&e[`thumbSize${De(n.size)}`]]}})(({theme:t})=>{var e;return{position:"absolute",width:20,height:20,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:t.transitions.create(["box-shadow","left","bottom"],{duration:t.transitions.duration.shortest}),"&::before":{position:"absolute",content:'""',borderRadius:"inherit",width:"100%",height:"100%",boxShadow:(t.vars||t).shadows[2]},"&::after":{position:"absolute",content:'""',borderRadius:"50%",width:42,height:42,top:"50%",left:"50%",transform:"translate(-50%, -50%)"},[`&.${qa.disabled}`]:{"&:hover":{boxShadow:"none"}},variants:[...Object.keys(((e=t.vars)!=null?e:t).palette).filter(n=>{var r;return((r=t.vars)!=null?r:t).palette[n].main}).map(n=>({props:{color:n},style:{[`&:hover, &.${qa.focusVisible}`]:j({},t.vars?{boxShadow:`0px 0px 0px 8px rgba(${t.vars.palette[n].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 8px ${kt(t.palette[n].main,.16)}`},{"@media (hover: none)":{boxShadow:"none"}}),[`&.${qa.active}`]:j({},t.vars?{boxShadow:`0px 0px 0px 14px rgba(${t.vars.palette[n].mainChannel} / 0.16)}`}:{boxShadow:`0px 0px 0px 14px ${kt(t.palette[n].main,.16)}`})}})),{props:{size:"small"},style:{width:12,height:12,"&::before":{boxShadow:"none"}}},{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-50%, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 50%)"}}]}}),eLe=we(qDe,{name:"MuiSlider",slot:"ValueLabel",overridesResolver:(t,e)=>e.valueLabel})(({theme:t})=>j({zIndex:1,whiteSpace:"nowrap"},t.typography.body2,{fontWeight:500,transition:t.transitions.create(["transform"],{duration:t.transitions.duration.shortest}),position:"absolute",backgroundColor:(t.vars||t).palette.grey[600],borderRadius:2,color:(t.vars||t).palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",padding:"0.25rem 0.75rem",variants:[{props:{orientation:"horizontal"},style:{transform:"translateY(-100%) scale(0)",top:"-10px",transformOrigin:"bottom center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, 50%) rotate(45deg)",backgroundColor:"inherit",bottom:0,left:"50%"},[`&.${qa.valueLabelOpen}`]:{transform:"translateY(-100%) scale(1)"}}},{props:{orientation:"vertical"},style:{transform:"translateY(-50%) scale(0)",right:"30px",top:"50%",transformOrigin:"right center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, -50%) rotate(45deg)",backgroundColor:"inherit",right:-8,top:"50%"},[`&.${qa.valueLabelOpen}`]:{transform:"translateY(-50%) scale(1)"}}},{props:{size:"small"},style:{fontSize:t.typography.pxToRem(12),padding:"0.25rem 0.5rem"}},{props:{orientation:"vertical",size:"small"},style:{right:"20px"}}]})),tLe=we("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:t=>PM(t)&&t!=="markActive",overridesResolver:(t,e)=>{const{markActive:n}=t;return[e.mark,n&&e.markActive]}})(({theme:t})=>({position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor",variants:[{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-1px, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 1px)"}},{props:{markActive:!0},style:{backgroundColor:(t.vars||t).palette.background.paper,opacity:.8}}]})),nLe=we("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:t=>PM(t)&&t!=="markLabelActive",overridesResolver:(t,e)=>e.markLabel})(({theme:t})=>j({},t.typography.body2,{color:(t.vars||t).palette.text.secondary,position:"absolute",whiteSpace:"nowrap",variants:[{props:{orientation:"horizontal"},style:{top:30,transform:"translateX(-50%)","@media (pointer: coarse)":{top:40}}},{props:{orientation:"vertical"},style:{left:36,transform:"translateY(50%)","@media (pointer: coarse)":{left:44}}},{props:{markLabelActive:!0},style:{color:(t.vars||t).palette.text.primary}}]})),rLe=t=>{const{disabled:e,dragging:n,marked:r,orientation:i,track:o,classes:a,color:s,size:l}=t,c={root:["root",e&&"disabled",n&&"dragging",r&&"marked",i==="vertical"&&"vertical",o==="inverted"&&"trackInverted",o===!1&&"trackFalse",s&&`color${De(s)}`,l&&`size${De(l)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",e&&"disabled",l&&`thumbSize${De(l)}`,s&&`thumbColor${De(s)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return Ue(c,VDe,a)},iLe=({children:t})=>t,oLe=M.forwardRef(function(e,n){var r,i,o,a,s,l,c,u,f,d,h,p,m,g,v,y,x,b,_,S,O,C,E,k;const I=QDe({props:e,name:"MuiSlider"}),P=T1(),{"aria-label":R,"aria-valuetext":T,"aria-labelledby":L,component:z="span",components:B={},componentsProps:W={},color:U="primary",classes:N,className:$,disableSwap:D=!1,disabled:A=!1,getAriaLabel:q,getAriaValueText:Y,marks:K=!1,max:se=100,min:te=0,orientation:J="horizontal",shiftStep:pe=10,size:be="medium",step:re=1,scale:ve=k8,slotProps:F,slots:ce,track:le="normal",valueLabelDisplay:Q="off",valueLabelFormat:X=k8}=I,ee=Ae(I,XDe),ge=j({},I,{isRtl:P,max:se,min:te,classes:N,disabled:A,disableSwap:D,orientation:J,marks:K,color:U,size:be,step:re,shiftStep:pe,scale:ve,track:le,valueLabelDisplay:Q,valueLabelFormat:X}),{axisProps:ye,getRootProps:H,getHiddenInputProps:G,getThumbProps:ie,open:he,active:_e,axis:oe,focusedThumbIndex:Z,range:V,dragging:de,marks:xe,values:Me,trackOffset:me,trackLeap:Ne,getThumbStyle:Ce}=BPe(j({},ge,{rootRef:n}));ge.marked=xe.length>0&&xe.some(Ze=>Ze.label),ge.dragging=de,ge.focusedThumbIndex=Z;const Re=rLe(ge),ae=(r=(i=ce==null?void 0:ce.root)!=null?i:B.Root)!=null?r:YDe,Le=(o=(a=ce==null?void 0:ce.rail)!=null?a:B.Rail)!=null?o:KDe,Ee=(s=(l=ce==null?void 0:ce.track)!=null?l:B.Track)!=null?s:ZDe,ze=(c=(u=ce==null?void 0:ce.thumb)!=null?u:B.Thumb)!=null?c:JDe,He=(f=(d=ce==null?void 0:ce.valueLabel)!=null?d:B.ValueLabel)!=null?f:eLe,xt=(h=(p=ce==null?void 0:ce.mark)!=null?p:B.Mark)!=null?h:tLe,Dt=(m=(g=ce==null?void 0:ce.markLabel)!=null?g:B.MarkLabel)!=null?m:nLe,nn=(v=(y=ce==null?void 0:ce.input)!=null?y:B.Input)!=null?v:"input",Hr=(x=F==null?void 0:F.root)!=null?x:W.root,Cn=(b=F==null?void 0:F.rail)!=null?b:W.rail,qr=(_=F==null?void 0:F.track)!=null?_:W.track,rr=(S=F==null?void 0:F.thumb)!=null?S:W.thumb,to=(O=F==null?void 0:F.valueLabel)!=null?O:W.valueLabel,yo=(C=F==null?void 0:F.mark)!=null?C:W.mark,qo=(E=F==null?void 0:F.markLabel)!=null?E:W.markLabel,rl=(k=F==null?void 0:F.input)!=null?k:W.input,yi=Lr({elementType:ae,getSlotProps:H,externalSlotProps:Hr,externalForwardedProps:ee,additionalProps:j({},WDe(ae)&&{as:z}),ownerState:j({},ge,Hr==null?void 0:Hr.ownerState),className:[Re.root,$]}),Ss=Lr({elementType:Le,externalSlotProps:Cn,ownerState:ge,className:Re.rail}),ne=Lr({elementType:Ee,externalSlotProps:qr,additionalProps:{style:j({},ye[oe].offset(me),ye[oe].leap(Ne))},ownerState:j({},ge,qr==null?void 0:qr.ownerState),className:Re.track}),Pe=Lr({elementType:ze,getSlotProps:ie,externalSlotProps:rr,ownerState:j({},ge,rr==null?void 0:rr.ownerState),className:Re.thumb}),Ie=Lr({elementType:He,externalSlotProps:to,ownerState:j({},ge,to==null?void 0:to.ownerState),className:Re.valueLabel}),Oe=Lr({elementType:xt,externalSlotProps:yo,ownerState:ge,className:Re.mark}),$e=Lr({elementType:Dt,externalSlotProps:qo,ownerState:ge,className:Re.markLabel}),ot=Lr({elementType:nn,getSlotProps:G,externalSlotProps:rl,ownerState:ge});return w.jsxs(ae,j({},yi,{children:[w.jsx(Le,j({},Ss)),w.jsx(Ee,j({},ne)),xe.filter(Ze=>Ze.value>=te&&Ze.value<=se).map((Ze,mt)=>{const wt=OT(Ze.value,te,se),zt=ye[oe].offset(wt);let Pt;return le===!1?Pt=Me.indexOf(Ze.value)!==-1:Pt=le==="normal"&&(V?Ze.value>=Me[0]&&Ze.value<=Me[Me.length-1]:Ze.value<=Me[0])||le==="inverted"&&(V?Ze.value<=Me[0]||Ze.value>=Me[Me.length-1]:Ze.value>=Me[0]),w.jsxs(M.Fragment,{children:[w.jsx(xt,j({"data-index":mt},Oe,!zl(xt)&&{markActive:Pt},{style:j({},zt,Oe.style),className:ke(Oe.className,Pt&&Re.markActive)})),Ze.label!=null?w.jsx(Dt,j({"aria-hidden":!0,"data-index":mt},$e,!zl(Dt)&&{markLabelActive:Pt},{style:j({},zt,$e.style),className:ke(Re.markLabel,$e.className,Pt&&Re.markLabelActive),children:Ze.label})):null]},mt)}),Me.map((Ze,mt)=>{const wt=OT(Ze,te,se),zt=ye[oe].offset(wt),Pt=Q==="off"?iLe:He;return w.jsx(Pt,j({},!zl(Pt)&&{valueLabelFormat:X,valueLabelDisplay:Q,value:typeof X=="function"?X(ve(Ze),mt):X,index:mt,open:he===mt||_e===mt||Q==="on",disabled:A},Ie,{children:w.jsx(ze,j({"data-index":mt},Pe,{className:ke(Re.thumb,Pe.className,_e===mt&&Re.active,Z===mt&&Re.focusVisible),style:j({},zt,Ce(mt),Pe.style),children:w.jsx(nn,j({"data-index":mt,"aria-label":q?q(mt):R,"aria-valuenow":ve(Ze),"aria-labelledby":L,"aria-valuetext":Y?Y(ve(Ze),mt):T,value:Me[mt]},ot))}))}),mt)})]}))}),Zv=oLe;function aLe(t){return We("MuiSnackbarContent",t)}Ve("MuiSnackbarContent",["root","message","action"]);const sLe=["action","className","message","role"],lLe=t=>{const{classes:e}=t;return Ue({root:["root"],action:["action"],message:["message"]},aLe,e)},cLe=we(Go,{name:"MuiSnackbarContent",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>{const e=t.palette.mode==="light"?.8:.98,n=AOe(t.palette.background.default,e);return j({},t.typography.body2,{color:t.vars?t.vars.palette.SnackbarContent.color:t.palette.getContrastText(n),backgroundColor:t.vars?t.vars.palette.SnackbarContent.bg:n,display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",borderRadius:(t.vars||t).shape.borderRadius,flexGrow:1,[t.breakpoints.up("sm")]:{flexGrow:"initial",minWidth:288}})}),uLe=we("div",{name:"MuiSnackbarContent",slot:"Message",overridesResolver:(t,e)=>e.message})({padding:"8px 0"}),fLe=we("div",{name:"MuiSnackbarContent",slot:"Action",overridesResolver:(t,e)=>e.action})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),dLe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiSnackbarContent"}),{action:i,className:o,message:a,role:s="alert"}=r,l=Ae(r,sLe),c=r,u=lLe(c);return w.jsxs(cLe,j({role:s,square:!0,elevation:6,className:ke(u.root,o),ownerState:c,ref:n},l,{children:[w.jsx(uLe,{className:u.message,ownerState:c,children:a}),i?w.jsx(fLe,{className:u.action,ownerState:c,children:i}):null]}))}),cie=dLe;function hLe(t){return We("MuiSnackbar",t)}Ve("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const pLe=["onEnter","onExited"],mLe=["action","anchorOrigin","autoHideDuration","children","className","ClickAwayListenerProps","ContentProps","disableWindowBlurListener","message","onBlur","onClose","onFocus","onMouseEnter","onMouseLeave","open","resumeHideDuration","TransitionComponent","transitionDuration","TransitionProps"],gLe=t=>{const{classes:e,anchorOrigin:n}=t,r={root:["root",`anchorOrigin${De(n.vertical)}${De(n.horizontal)}`]};return Ue(r,hLe,e)},A8=we("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`anchorOrigin${De(n.anchorOrigin.vertical)}${De(n.anchorOrigin.horizontal)}`]]}})(({theme:t,ownerState:e})=>{const n={left:"50%",right:"auto",transform:"translateX(-50%)"};return j({zIndex:(t.vars||t).zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center"},e.anchorOrigin.vertical==="top"?{top:8}:{bottom:8},e.anchorOrigin.horizontal==="left"&&{justifyContent:"flex-start"},e.anchorOrigin.horizontal==="right"&&{justifyContent:"flex-end"},{[t.breakpoints.up("sm")]:j({},e.anchorOrigin.vertical==="top"?{top:24}:{bottom:24},e.anchorOrigin.horizontal==="center"&&n,e.anchorOrigin.horizontal==="left"&&{left:24,right:"auto"},e.anchorOrigin.horizontal==="right"&&{right:24,left:"auto"})})}),vLe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiSnackbar"}),i=Vo(),o={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{action:a,anchorOrigin:{vertical:s,horizontal:l}={vertical:"bottom",horizontal:"left"},autoHideDuration:c=null,children:u,className:f,ClickAwayListenerProps:d,ContentProps:h,disableWindowBlurListener:p=!1,message:m,open:g,TransitionComponent:v=Rb,transitionDuration:y=o,TransitionProps:{onEnter:x,onExited:b}={}}=r,_=Ae(r.TransitionProps,pLe),S=Ae(r,mLe),O=j({},r,{anchorOrigin:{vertical:s,horizontal:l},autoHideDuration:c,disableWindowBlurListener:p,TransitionComponent:v,transitionDuration:y}),C=gLe(O),{getRootProps:E,onClickAway:k}=zPe(j({},O)),[I,P]=M.useState(!0),R=Lr({elementType:A8,getSlotProps:E,externalForwardedProps:S,ownerState:O,additionalProps:{ref:n},className:[C.root,f]}),T=z=>{P(!0),b&&b(z)},L=(z,B)=>{P(!1),x&&x(z,B)};return!g&&I?null:w.jsx(nEe,j({onClickAway:k},d,{children:w.jsx(A8,j({},R,{children:w.jsx(v,j({appear:!0,in:g,timeout:y,direction:s==="top"?"down":"up",onEnter:L,onExited:T},_,{children:u||w.jsx(cie,j({message:m,action:a},h))}))}))}))}),yLe=vLe;function xLe(t){return We("MuiTooltip",t)}const bLe=Ve("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]),gf=bLe,_Le=["arrow","children","classes","components","componentsProps","describeChild","disableFocusListener","disableHoverListener","disableInteractive","disableTouchListener","enterDelay","enterNextDelay","enterTouchDelay","followCursor","id","leaveDelay","leaveTouchDelay","onClose","onOpen","open","placement","PopperComponent","PopperProps","slotProps","slots","title","TransitionComponent","TransitionProps"];function wLe(t){return Math.round(t*1e5)/1e5}const SLe=t=>{const{classes:e,disableInteractive:n,arrow:r,touch:i,placement:o}=t,a={popper:["popper",!n&&"popperInteractive",r&&"popperArrow"],tooltip:["tooltip",r&&"tooltipArrow",i&&"touch",`tooltipPlacement${De(o.split("-")[0])}`],arrow:["arrow"]};return Ue(a,xLe,e)},OLe=we(d5,{name:"MuiTooltip",slot:"Popper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.popper,!n.disableInteractive&&e.popperInteractive,n.arrow&&e.popperArrow,!n.open&&e.popperClose]}})(({theme:t,ownerState:e,open:n})=>j({zIndex:(t.vars||t).zIndex.tooltip,pointerEvents:"none"},!e.disableInteractive&&{pointerEvents:"auto"},!n&&{pointerEvents:"none"},e.arrow&&{[`&[data-popper-placement*="bottom"] .${gf.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${gf.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${gf.arrow}`]:j({},e.isRtl?{right:0,marginRight:"-0.71em"}:{left:0,marginLeft:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}}),[`&[data-popper-placement*="left"] .${gf.arrow}`]:j({},e.isRtl?{left:0,marginLeft:"-0.71em"}:{right:0,marginRight:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}})})),CLe=we("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.tooltip,n.touch&&e.touch,n.arrow&&e.tooltipArrow,e[`tooltipPlacement${De(n.placement.split("-")[0])}`]]}})(({theme:t,ownerState:e})=>j({backgroundColor:t.vars?t.vars.palette.Tooltip.bg:kt(t.palette.grey[700],.92),borderRadius:(t.vars||t).shape.borderRadius,color:(t.vars||t).palette.common.white,fontFamily:t.typography.fontFamily,padding:"4px 8px",fontSize:t.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:t.typography.fontWeightMedium},e.arrow&&{position:"relative",margin:0},e.touch&&{padding:"8px 16px",fontSize:t.typography.pxToRem(14),lineHeight:`${wLe(16/14)}em`,fontWeight:t.typography.fontWeightRegular},{[`.${gf.popper}[data-popper-placement*="left"] &`]:j({transformOrigin:"right center"},e.isRtl?j({marginLeft:"14px"},e.touch&&{marginLeft:"24px"}):j({marginRight:"14px"},e.touch&&{marginRight:"24px"})),[`.${gf.popper}[data-popper-placement*="right"] &`]:j({transformOrigin:"left center"},e.isRtl?j({marginRight:"14px"},e.touch&&{marginRight:"24px"}):j({marginLeft:"14px"},e.touch&&{marginLeft:"24px"})),[`.${gf.popper}[data-popper-placement*="top"] &`]:j({transformOrigin:"center bottom",marginBottom:"14px"},e.touch&&{marginBottom:"24px"}),[`.${gf.popper}[data-popper-placement*="bottom"] &`]:j({transformOrigin:"center top",marginTop:"14px"},e.touch&&{marginTop:"24px"})})),TLe=we("span",{name:"MuiTooltip",slot:"Arrow",overridesResolver:(t,e)=>e.arrow})(({theme:t})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:t.vars?t.vars.palette.Tooltip.bg:kt(t.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}}));let oS=!1;const R8=new O1;let p0={x:0,y:0};function aS(t,e){return(n,...r)=>{e&&e(n,...r),t(n,...r)}}const ELe=M.forwardRef(function(e,n){var r,i,o,a,s,l,c,u,f,d,h,p,m,g,v,y,x,b,_;const S=qe({props:e,name:"MuiTooltip"}),{arrow:O=!1,children:C,components:E={},componentsProps:k={},describeChild:I=!1,disableFocusListener:P=!1,disableHoverListener:R=!1,disableInteractive:T=!1,disableTouchListener:L=!1,enterDelay:z=100,enterNextDelay:B=0,enterTouchDelay:W=700,followCursor:U=!1,id:N,leaveDelay:$=0,leaveTouchDelay:D=1500,onClose:A,onOpen:q,open:Y,placement:K="bottom",PopperComponent:se,PopperProps:te={},slotProps:J={},slots:pe={},title:be,TransitionComponent:re=Rb,TransitionProps:ve}=S,F=Ae(S,_Le),ce=M.isValidElement(C)?C:w.jsx("span",{children:C}),le=Vo(),Q=T1(),[X,ee]=M.useState(),[ge,ye]=M.useState(null),H=M.useRef(!1),G=T||U,ie=mf(),he=mf(),_e=mf(),oe=mf(),[Z,V]=Hs({controlled:Y,default:!1,name:"Tooltip",state:"open"});let de=Z;const xe=cd(N),Me=M.useRef(),me=br(()=>{Me.current!==void 0&&(document.body.style.WebkitUserSelect=Me.current,Me.current=void 0),oe.clear()});M.useEffect(()=>me,[me]);const Ne=st=>{R8.clear(),oS=!0,V(!0),q&&!de&&q(st)},Ce=br(st=>{R8.start(800+$,()=>{oS=!1}),V(!1),A&&de&&A(st),ie.start(le.transitions.duration.shortest,()=>{H.current=!1})}),Re=st=>{H.current&&st.type!=="touchstart"||(X&&X.removeAttribute("title"),he.clear(),_e.clear(),z||oS&&B?he.start(oS?B:z,()=>{Ne(st)}):Ne(st))},ae=st=>{he.clear(),_e.start($,()=>{Ce(st)})},{isFocusVisibleRef:Le,onBlur:Ee,onFocus:ze,ref:He}=C1(),[,xt]=M.useState(!1),Dt=st=>{Ee(st),Le.current===!1&&(xt(!1),ae(st))},nn=st=>{X||ee(st.currentTarget),ze(st),Le.current===!0&&(xt(!0),Re(st))},Hr=st=>{H.current=!0;const Qt=ce.props;Qt.onTouchStart&&Qt.onTouchStart(st)},Cn=st=>{Hr(st),_e.clear(),ie.clear(),me(),Me.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",oe.start(W,()=>{document.body.style.WebkitUserSelect=Me.current,Re(st)})},qr=st=>{ce.props.onTouchEnd&&ce.props.onTouchEnd(st),me(),_e.start(D,()=>{Ce(st)})};M.useEffect(()=>{if(!de)return;function st(Qt){(Qt.key==="Escape"||Qt.key==="Esc")&&Ce(Qt)}return document.addEventListener("keydown",st),()=>{document.removeEventListener("keydown",st)}},[Ce,de]);const rr=Zt(ce.ref,He,ee,n);!be&&be!==0&&(de=!1);const to=M.useRef(),yo=st=>{const Qt=ce.props;Qt.onMouseMove&&Qt.onMouseMove(st),p0={x:st.clientX,y:st.clientY},to.current&&to.current.update()},qo={},rl=typeof be=="string";I?(qo.title=!de&&rl&&!R?be:null,qo["aria-describedby"]=de?xe:null):(qo["aria-label"]=rl?be:null,qo["aria-labelledby"]=de&&!rl?xe:null);const yi=j({},qo,F,ce.props,{className:ke(F.className,ce.props.className),onTouchStart:Hr,ref:rr},U?{onMouseMove:yo}:{}),Ss={};L||(yi.onTouchStart=Cn,yi.onTouchEnd=qr),R||(yi.onMouseOver=aS(Re,yi.onMouseOver),yi.onMouseLeave=aS(ae,yi.onMouseLeave),G||(Ss.onMouseOver=Re,Ss.onMouseLeave=ae)),P||(yi.onFocus=aS(nn,yi.onFocus),yi.onBlur=aS(Dt,yi.onBlur),G||(Ss.onFocus=nn,Ss.onBlur=Dt));const ne=M.useMemo(()=>{var st;let Qt=[{name:"arrow",enabled:!!ge,options:{element:ge,padding:4}}];return(st=te.popperOptions)!=null&&st.modifiers&&(Qt=Qt.concat(te.popperOptions.modifiers)),j({},te.popperOptions,{modifiers:Qt})},[ge,te]),Pe=j({},S,{isRtl:Q,arrow:O,disableInteractive:G,placement:K,PopperComponentProp:se,touch:H.current}),Ie=SLe(Pe),Oe=(r=(i=pe.popper)!=null?i:E.Popper)!=null?r:OLe,$e=(o=(a=(s=pe.transition)!=null?s:E.Transition)!=null?a:re)!=null?o:Rb,ot=(l=(c=pe.tooltip)!=null?c:E.Tooltip)!=null?l:CLe,Ze=(u=(f=pe.arrow)!=null?f:E.Arrow)!=null?u:TLe,mt=Hm(Oe,j({},te,(d=J.popper)!=null?d:k.popper,{className:ke(Ie.popper,te==null?void 0:te.className,(h=(p=J.popper)!=null?p:k.popper)==null?void 0:h.className)}),Pe),wt=Hm($e,j({},ve,(m=J.transition)!=null?m:k.transition),Pe),zt=Hm(ot,j({},(g=J.tooltip)!=null?g:k.tooltip,{className:ke(Ie.tooltip,(v=(y=J.tooltip)!=null?y:k.tooltip)==null?void 0:v.className)}),Pe),Pt=Hm(Ze,j({},(x=J.arrow)!=null?x:k.arrow,{className:ke(Ie.arrow,(b=(_=J.arrow)!=null?_:k.arrow)==null?void 0:b.className)}),Pe);return w.jsxs(M.Fragment,{children:[M.cloneElement(ce,yi),w.jsx(Oe,j({as:se??d5,placement:K,anchorEl:U?{getBoundingClientRect:()=>({top:p0.y,left:p0.x,right:p0.x,bottom:p0.y,width:0,height:0})}:X,popperRef:to,open:X?de:!1,id:xe,transition:!0},Ss,mt,{popperOptions:ne,children:({TransitionProps:st})=>w.jsx($e,j({timeout:le.transitions.duration.shorter},st,wt,{children:w.jsxs(ot,j({},zt,{children:[be,O?w.jsx(Ze,j({},Pt,{ref:ye})):null]}))}))}))]})}),_t=ELe;function PLe(t){return We("MuiSwitch",t)}const oo=Ve("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),MLe=["className","color","edge","size","sx"],kLe=Zj(),ALe=t=>{const{classes:e,edge:n,size:r,color:i,checked:o,disabled:a}=t,s={root:["root",n&&`edge${De(n)}`,`size${De(r)}`],switchBase:["switchBase",`color${De(i)}`,o&&"checked",a&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},l=Ue(s,PLe,e);return j({},e,l)},RLe=we("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.edge&&e[`edge${De(n.edge)}`],e[`size${De(n.size)}`]]}})({display:"inline-flex",width:34+12*2,height:14+12*2,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${oo.thumb}`]:{width:16,height:16},[`& .${oo.switchBase}`]:{padding:4,[`&.${oo.checked}`]:{transform:"translateX(16px)"}}}}]}),ILe=we(p5,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.switchBase,{[`& .${oo.input}`]:e.input},n.color!=="default"&&e[`color${De(n.color)}`]]}})(({theme:t})=>({position:"absolute",top:0,left:0,zIndex:1,color:t.vars?t.vars.palette.Switch.defaultColor:`${t.palette.mode==="light"?t.palette.common.white:t.palette.grey[300]}`,transition:t.transitions.create(["left","transform"],{duration:t.transitions.duration.shortest}),[`&.${oo.checked}`]:{transform:"translateX(20px)"},[`&.${oo.disabled}`]:{color:t.vars?t.vars.palette.Switch.defaultDisabledColor:`${t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[600]}`},[`&.${oo.checked} + .${oo.track}`]:{opacity:.5},[`&.${oo.disabled} + .${oo.track}`]:{opacity:t.vars?t.vars.opacity.switchTrackDisabled:`${t.palette.mode==="light"?.12:.2}`},[`& .${oo.input}`]:{left:"-100%",width:"300%"}}),({theme:t})=>({"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(t.palette).filter(([,e])=>e.main&&e.light).map(([e])=>({props:{color:e},style:{[`&.${oo.checked}`]:{color:(t.vars||t).palette[e].main,"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[e].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette[e].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${oo.disabled}`]:{color:t.vars?t.vars.palette.Switch[`${e}DisabledColor`]:`${t.palette.mode==="light"?Pb(t.palette[e].main,.62):Eb(t.palette[e].main,.55)}`}},[`&.${oo.checked} + .${oo.track}`]:{backgroundColor:(t.vars||t).palette[e].main}}}))]})),DLe=we("span",{name:"MuiSwitch",slot:"Track",overridesResolver:(t,e)=>e.track})(({theme:t})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:t.transitions.create(["opacity","background-color"],{duration:t.transitions.duration.shortest}),backgroundColor:t.vars?t.vars.palette.common.onBackground:`${t.palette.mode==="light"?t.palette.common.black:t.palette.common.white}`,opacity:t.vars?t.vars.opacity.switchTrack:`${t.palette.mode==="light"?.38:.3}`})),LLe=we("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:(t,e)=>e.thumb})(({theme:t})=>({boxShadow:(t.vars||t).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"})),$Le=M.forwardRef(function(e,n){const r=kLe({props:e,name:"MuiSwitch"}),{className:i,color:o="primary",edge:a=!1,size:s="medium",sx:l}=r,c=Ae(r,MLe),u=j({},r,{color:o,edge:a,size:s}),f=ALe(u),d=w.jsx(LLe,{className:f.thumb,ownerState:u});return w.jsxs(RLe,{className:ke(f.root,i),sx:l,ownerState:u,children:[w.jsx(ILe,j({type:"checkbox",icon:d,checkedIcon:d,ref:n,ownerState:u},c,{classes:j({},f,{root:f.switchBase})})),w.jsx(DLe,{className:f.track,ownerState:u})]})}),uie=$Le;function NLe(t){return We("MuiTab",t)}const FLe=Ve("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),Ad=FLe,jLe=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],BLe=t=>{const{classes:e,textColor:n,fullWidth:r,wrapped:i,icon:o,label:a,selected:s,disabled:l}=t,c={root:["root",o&&a&&"labelIcon",`textColor${De(n)}`,r&&"fullWidth",i&&"wrapped",s&&"selected",l&&"disabled"],iconWrapper:["iconWrapper"]};return Ue(c,NLe,e)},zLe=we(us,{name:"MuiTab",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.label&&n.icon&&e.labelIcon,e[`textColor${De(n.textColor)}`],n.fullWidth&&e.fullWidth,n.wrapped&&e.wrapped]}})(({theme:t,ownerState:e})=>j({},t.typography.button,{maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center"},e.label&&{flexDirection:e.iconPosition==="top"||e.iconPosition==="bottom"?"column":"row"},{lineHeight:1.25},e.icon&&e.label&&{minHeight:72,paddingTop:9,paddingBottom:9,[`& > .${Ad.iconWrapper}`]:j({},e.iconPosition==="top"&&{marginBottom:6},e.iconPosition==="bottom"&&{marginTop:6},e.iconPosition==="start"&&{marginRight:t.spacing(1)},e.iconPosition==="end"&&{marginLeft:t.spacing(1)})},e.textColor==="inherit"&&{color:"inherit",opacity:.6,[`&.${Ad.selected}`]:{opacity:1},[`&.${Ad.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.textColor==="primary"&&{color:(t.vars||t).palette.text.secondary,[`&.${Ad.selected}`]:{color:(t.vars||t).palette.primary.main},[`&.${Ad.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.textColor==="secondary"&&{color:(t.vars||t).palette.text.secondary,[`&.${Ad.selected}`]:{color:(t.vars||t).palette.secondary.main},[`&.${Ad.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.fullWidth&&{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},e.wrapped&&{fontSize:t.typography.pxToRem(12)})),ULe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTab"}),{className:i,disabled:o=!1,disableFocusRipple:a=!1,fullWidth:s,icon:l,iconPosition:c="top",indicator:u,label:f,onChange:d,onClick:h,onFocus:p,selected:m,selectionFollowsFocus:g,textColor:v="inherit",value:y,wrapped:x=!1}=r,b=Ae(r,jLe),_=j({},r,{disabled:o,disableFocusRipple:a,selected:m,icon:!!l,iconPosition:c,label:!!f,fullWidth:s,textColor:v,wrapped:x}),S=BLe(_),O=l&&f&&M.isValidElement(l)?M.cloneElement(l,{className:ke(S.iconWrapper,l.props.className)}):l,C=k=>{!m&&d&&d(k,y),h&&h(k)},E=k=>{g&&!m&&d&&d(k,y),p&&p(k)};return w.jsxs(zLe,j({focusRipple:!a,className:ke(S.root,i),ref:n,role:"tab","aria-selected":m,disabled:o,onClick:C,onFocus:E,ownerState:_,tabIndex:m?0:-1},b,{children:[c==="top"||c==="start"?w.jsxs(M.Fragment,{children:[O,f]}):w.jsxs(M.Fragment,{children:[f,O]}),u]}))}),Ib=ULe,WLe=M.createContext(),fie=WLe;function VLe(t){return We("MuiTable",t)}Ve("MuiTable",["root","stickyHeader"]);const GLe=["className","component","padding","size","stickyHeader"],HLe=t=>{const{classes:e,stickyHeader:n}=t;return Ue({root:["root",n&&"stickyHeader"]},VLe,e)},qLe=we("table",{name:"MuiTable",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.stickyHeader&&e.stickyHeader]}})(({theme:t,ownerState:e})=>j({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":j({},t.typography.body2,{padding:t.spacing(2),color:(t.vars||t).palette.text.secondary,textAlign:"left",captionSide:"bottom"})},e.stickyHeader&&{borderCollapse:"separate"})),I8="table",XLe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTable"}),{className:i,component:o=I8,padding:a="normal",size:s="medium",stickyHeader:l=!1}=r,c=Ae(r,GLe),u=j({},r,{component:o,padding:a,size:s,stickyHeader:l}),f=HLe(u),d=M.useMemo(()=>({padding:a,size:s,stickyHeader:l}),[a,s,l]);return w.jsx(fie.Provider,{value:d,children:w.jsx(qLe,j({as:o,role:o===I8?null:"table",ref:n,className:ke(f.root,i),ownerState:u},c))})}),y5=XLe,QLe=M.createContext(),jM=QLe;function YLe(t){return We("MuiTableBody",t)}Ve("MuiTableBody",["root"]);const KLe=["className","component"],ZLe=t=>{const{classes:e}=t;return Ue({root:["root"]},YLe,e)},JLe=we("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"table-row-group"}),e$e={variant:"body"},D8="tbody",t$e=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTableBody"}),{className:i,component:o=D8}=r,a=Ae(r,KLe),s=j({},r,{component:o}),l=ZLe(s);return w.jsx(jM.Provider,{value:e$e,children:w.jsx(JLe,j({className:ke(l.root,i),as:o,ref:n,role:o===D8?null:"rowgroup",ownerState:s},a))})}),x5=t$e;function n$e(t){return We("MuiTableCell",t)}const r$e=Ve("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),i$e=r$e,o$e=["align","className","component","padding","scope","size","sortDirection","variant"],a$e=t=>{const{classes:e,variant:n,align:r,padding:i,size:o,stickyHeader:a}=t,s={root:["root",n,a&&"stickyHeader",r!=="inherit"&&`align${De(r)}`,i!=="normal"&&`padding${De(i)}`,`size${De(o)}`]};return Ue(s,n$e,e)},s$e=we("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`size${De(n.size)}`],n.padding!=="normal"&&e[`padding${De(n.padding)}`],n.align!=="inherit"&&e[`align${De(n.align)}`],n.stickyHeader&&e.stickyHeader]}})(({theme:t,ownerState:e})=>j({},t.typography.body2,{display:"table-cell",verticalAlign:"inherit",borderBottom:t.vars?`1px solid ${t.vars.palette.TableCell.border}`:`1px solid + ${t.palette.mode==="light"?Pb(kt(t.palette.divider,1),.88):Eb(kt(t.palette.divider,1),.68)}`,textAlign:"left",padding:16},e.variant==="head"&&{color:(t.vars||t).palette.text.primary,lineHeight:t.typography.pxToRem(24),fontWeight:t.typography.fontWeightMedium},e.variant==="body"&&{color:(t.vars||t).palette.text.primary},e.variant==="footer"&&{color:(t.vars||t).palette.text.secondary,lineHeight:t.typography.pxToRem(21),fontSize:t.typography.pxToRem(12)},e.size==="small"&&{padding:"6px 16px",[`&.${i$e.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}},e.padding==="checkbox"&&{width:48,padding:"0 0 0 4px"},e.padding==="none"&&{padding:0},e.align==="left"&&{textAlign:"left"},e.align==="center"&&{textAlign:"center"},e.align==="right"&&{textAlign:"right",flexDirection:"row-reverse"},e.align==="justify"&&{textAlign:"justify"},e.stickyHeader&&{position:"sticky",top:0,zIndex:2,backgroundColor:(t.vars||t).palette.background.default})),l$e=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTableCell"}),{align:i="inherit",className:o,component:a,padding:s,scope:l,size:c,sortDirection:u,variant:f}=r,d=Ae(r,o$e),h=M.useContext(fie),p=M.useContext(jM),m=p&&p.variant==="head";let g;a?g=a:g=m?"th":"td";let v=l;g==="td"?v=void 0:!v&&m&&(v="col");const y=f||p&&p.variant,x=j({},r,{align:i,component:g,padding:s||(h&&h.padding?h.padding:"normal"),size:c||(h&&h.size?h.size:"medium"),sortDirection:u,stickyHeader:y==="head"&&h&&h.stickyHeader,variant:y}),b=a$e(x);let _=null;return u&&(_=u==="asc"?"ascending":"descending"),w.jsx(s$e,j({as:g,ref:n,className:ke(b.root,o),"aria-sort":_,scope:v,ownerState:x},d))}),ar=l$e;function c$e(t){return We("MuiTableContainer",t)}Ve("MuiTableContainer",["root"]);const u$e=["className","component"],f$e=t=>{const{classes:e}=t;return Ue({root:["root"]},c$e,e)},d$e=we("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(t,e)=>e.root})({width:"100%",overflowX:"auto"}),h$e=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTableContainer"}),{className:i,component:o="div"}=r,a=Ae(r,u$e),s=j({},r,{component:o}),l=f$e(s);return w.jsx(d$e,j({ref:n,as:o,className:ke(l.root,i),ownerState:s},a))}),die=h$e;function p$e(t){return We("MuiTableHead",t)}Ve("MuiTableHead",["root"]);const m$e=["className","component"],g$e=t=>{const{classes:e}=t;return Ue({root:["root"]},p$e,e)},v$e=we("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"table-header-group"}),y$e={variant:"head"},L8="thead",x$e=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTableHead"}),{className:i,component:o=L8}=r,a=Ae(r,m$e),s=j({},r,{component:o}),l=g$e(s);return w.jsx(jM.Provider,{value:y$e,children:w.jsx(v$e,j({as:o,className:ke(l.root,i),ref:n,role:o===L8?null:"rowgroup",ownerState:s},a))})}),b$e=x$e;function _$e(t){return We("MuiToolbar",t)}Ve("MuiToolbar",["root","gutters","regular","dense"]);const w$e=["className","component","disableGutters","variant"],S$e=t=>{const{classes:e,disableGutters:n,variant:r}=t;return Ue({root:["root",!n&&"gutters",r]},_$e,e)},O$e=we("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disableGutters&&e.gutters,e[n.variant]]}})(({theme:t,ownerState:e})=>j({position:"relative",display:"flex",alignItems:"center"},!e.disableGutters&&{paddingLeft:t.spacing(2),paddingRight:t.spacing(2),[t.breakpoints.up("sm")]:{paddingLeft:t.spacing(3),paddingRight:t.spacing(3)}},e.variant==="dense"&&{minHeight:48}),({theme:t,ownerState:e})=>e.variant==="regular"&&t.mixins.toolbar),C$e=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiToolbar"}),{className:i,component:o="div",disableGutters:a=!1,variant:s="regular"}=r,l=Ae(r,w$e),c=j({},r,{component:o,disableGutters:a,variant:s}),u=S$e(c);return w.jsx(O$e,j({as:o,className:ke(u.root,i),ref:n,ownerState:c},l))}),BM=C$e,T$e=ti(w.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),E$e=ti(w.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight");function P$e(t){return We("MuiTableRow",t)}const M$e=Ve("MuiTableRow",["root","selected","hover","head","footer"]),$8=M$e,k$e=["className","component","hover","selected"],A$e=t=>{const{classes:e,selected:n,hover:r,head:i,footer:o}=t;return Ue({root:["root",n&&"selected",r&&"hover",i&&"head",o&&"footer"]},P$e,e)},R$e=we("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.head&&e.head,n.footer&&e.footer]}})(({theme:t})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${$8.hover}:hover`]:{backgroundColor:(t.vars||t).palette.action.hover},[`&.${$8.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.primary.main,t.palette.action.selectedOpacity),"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:kt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity)}}})),N8="tr",I$e=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTableRow"}),{className:i,component:o=N8,hover:a=!1,selected:s=!1}=r,l=Ae(r,k$e),c=M.useContext(jM),u=j({},r,{component:o,hover:a,selected:s,head:c&&c.variant==="head",footer:c&&c.variant==="footer"}),f=A$e(u);return w.jsx(R$e,j({as:o,ref:n,className:ke(f.root,i),role:o===N8?null:"row",ownerState:u},l))}),pl=I$e;function D$e(t){return(1+Math.sin(Math.PI*t-Math.PI/2))/2}function L$e(t,e,n,r={},i=()=>{}){const{ease:o=D$e,duration:a=300}=r;let s=null;const l=e[t];let c=!1;const u=()=>{c=!0},f=d=>{if(c){i(new Error("Animation cancelled"));return}s===null&&(s=d);const h=Math.min(1,(d-s)/a);if(e[t]=o(h)*(n-l)+l,h>=1){requestAnimationFrame(()=>{i(null)});return}requestAnimationFrame(f)};return l===n?(i(new Error("Element already at target position")),u):(requestAnimationFrame(f),u)}const $$e=["onChange"],N$e={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function F$e(t){const{onChange:e}=t,n=Ae(t,$$e),r=M.useRef(),i=M.useRef(null),o=()=>{r.current=i.current.offsetHeight-i.current.clientHeight};return Vr(()=>{const a=Hv(()=>{const l=r.current;o(),l!==r.current&&e(r.current)}),s=ls(i.current);return s.addEventListener("resize",a),()=>{a.clear(),s.removeEventListener("resize",a)}},[e]),M.useEffect(()=>{o(),e(r.current)},[e]),w.jsx("div",j({style:N$e,ref:i},n))}function j$e(t){return We("MuiTabScrollButton",t)}const B$e=Ve("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),z$e=B$e,U$e=["className","slots","slotProps","direction","orientation","disabled"],W$e=t=>{const{classes:e,orientation:n,disabled:r}=t;return Ue({root:["root",n,r&&"disabled"]},j$e,e)},V$e=we(us,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.orientation&&e[n.orientation]]}})(({ownerState:t})=>j({width:40,flexShrink:0,opacity:.8,[`&.${z$e.disabled}`]:{opacity:0}},t.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${t.isRtl?-90:90}deg)`}})),G$e=M.forwardRef(function(e,n){var r,i;const o=qe({props:e,name:"MuiTabScrollButton"}),{className:a,slots:s={},slotProps:l={},direction:c}=o,u=Ae(o,U$e),f=T1(),d=j({isRtl:f},o),h=W$e(d),p=(r=s.StartScrollButtonIcon)!=null?r:T$e,m=(i=s.EndScrollButtonIcon)!=null?i:E$e,g=Lr({elementType:p,externalSlotProps:l.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:d}),v=Lr({elementType:m,externalSlotProps:l.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:d});return w.jsx(V$e,j({component:"div",className:ke(h.root,a),ref:n,role:null,ownerState:d,tabIndex:null},u,{children:c==="left"?w.jsx(p,j({},g)):w.jsx(m,j({},v))}))}),H$e=G$e;function q$e(t){return We("MuiTabs",t)}const X$e=Ve("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),SC=X$e,Q$e=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","slots","slotProps","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],F8=(t,e)=>t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:t.firstChild,j8=(t,e)=>t===e?t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:t.lastChild,sS=(t,e,n)=>{let r=!1,i=n(t,e);for(;i;){if(i===t.firstChild){if(r)return;r=!0}const o=i.disabled||i.getAttribute("aria-disabled")==="true";if(!i.hasAttribute("tabindex")||o)i=n(t,i);else{i.focus();return}}},Y$e=t=>{const{vertical:e,fixed:n,hideScrollbar:r,scrollableX:i,scrollableY:o,centered:a,scrollButtonsHideMobile:s,classes:l}=t;return Ue({root:["root",e&&"vertical"],scroller:["scroller",n&&"fixed",r&&"hideScrollbar",i&&"scrollableX",o&&"scrollableY"],flexContainer:["flexContainer",e&&"flexContainerVertical",a&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",s&&"scrollButtonsHideMobile"],scrollableX:[i&&"scrollableX"],hideScrollbar:[r&&"hideScrollbar"]},q$e,l)},K$e=we("div",{name:"MuiTabs",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${SC.scrollButtons}`]:e.scrollButtons},{[`& .${SC.scrollButtons}`]:n.scrollButtonsHideMobile&&e.scrollButtonsHideMobile},e.root,n.vertical&&e.vertical]}})(({ownerState:t,theme:e})=>j({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},t.vertical&&{flexDirection:"column"},t.scrollButtonsHideMobile&&{[`& .${SC.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}})),Z$e=we("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.scroller,n.fixed&&e.fixed,n.hideScrollbar&&e.hideScrollbar,n.scrollableX&&e.scrollableX,n.scrollableY&&e.scrollableY]}})(({ownerState:t})=>j({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},t.fixed&&{overflowX:"hidden",width:"100%"},t.hideScrollbar&&{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},t.scrollableX&&{overflowX:"auto",overflowY:"hidden"},t.scrollableY&&{overflowY:"auto",overflowX:"hidden"})),J$e=we("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.flexContainer,n.vertical&&e.flexContainerVertical,n.centered&&e.centered]}})(({ownerState:t})=>j({display:"flex"},t.vertical&&{flexDirection:"column"},t.centered&&{justifyContent:"center"})),e3e=we("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(t,e)=>e.indicator})(({ownerState:t,theme:e})=>j({position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create()},t.indicatorColor==="primary"&&{backgroundColor:(e.vars||e).palette.primary.main},t.indicatorColor==="secondary"&&{backgroundColor:(e.vars||e).palette.secondary.main},t.vertical&&{height:"100%",width:2,right:0})),t3e=we(F$e)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),B8={},n3e=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTabs"}),i=Vo(),o=T1(),{"aria-label":a,"aria-labelledby":s,action:l,centered:c=!1,children:u,className:f,component:d="div",allowScrollButtonsMobile:h=!1,indicatorColor:p="primary",onChange:m,orientation:g="horizontal",ScrollButtonComponent:v=H$e,scrollButtons:y="auto",selectionFollowsFocus:x,slots:b={},slotProps:_={},TabIndicatorProps:S={},TabScrollButtonProps:O={},textColor:C="primary",value:E,variant:k="standard",visibleScrollbar:I=!1}=r,P=Ae(r,Q$e),R=k==="scrollable",T=g==="vertical",L=T?"scrollTop":"scrollLeft",z=T?"top":"left",B=T?"bottom":"right",W=T?"clientHeight":"clientWidth",U=T?"height":"width",N=j({},r,{component:d,allowScrollButtonsMobile:h,indicatorColor:p,orientation:g,vertical:T,scrollButtons:y,textColor:C,variant:k,visibleScrollbar:I,fixed:!R,hideScrollbar:R&&!I,scrollableX:R&&!T,scrollableY:R&&T,centered:c&&!R,scrollButtonsHideMobile:!h}),$=Y$e(N),D=Lr({elementType:b.StartScrollButtonIcon,externalSlotProps:_.startScrollButtonIcon,ownerState:N}),A=Lr({elementType:b.EndScrollButtonIcon,externalSlotProps:_.endScrollButtonIcon,ownerState:N}),[q,Y]=M.useState(!1),[K,se]=M.useState(B8),[te,J]=M.useState(!1),[pe,be]=M.useState(!1),[re,ve]=M.useState(!1),[F,ce]=M.useState({overflow:"hidden",scrollbarWidth:0}),le=new Map,Q=M.useRef(null),X=M.useRef(null),ee=()=>{const Ce=Q.current;let Re;if(Ce){const Le=Ce.getBoundingClientRect();Re={clientWidth:Ce.clientWidth,scrollLeft:Ce.scrollLeft,scrollTop:Ce.scrollTop,scrollLeftNormalized:cOe(Ce,o?"rtl":"ltr"),scrollWidth:Ce.scrollWidth,top:Le.top,bottom:Le.bottom,left:Le.left,right:Le.right}}let ae;if(Ce&&E!==!1){const Le=X.current.children;if(Le.length>0){const Ee=Le[le.get(E)];ae=Ee?Ee.getBoundingClientRect():null}}return{tabsMeta:Re,tabMeta:ae}},ge=br(()=>{const{tabsMeta:Ce,tabMeta:Re}=ee();let ae=0,Le;if(T)Le="top",Re&&Ce&&(ae=Re.top-Ce.top+Ce.scrollTop);else if(Le=o?"right":"left",Re&&Ce){const ze=o?Ce.scrollLeftNormalized+Ce.clientWidth-Ce.scrollWidth:Ce.scrollLeft;ae=(o?-1:1)*(Re[Le]-Ce[Le]+ze)}const Ee={[Le]:ae,[U]:Re?Re[U]:0};if(isNaN(K[Le])||isNaN(K[U]))se(Ee);else{const ze=Math.abs(K[Le]-Ee[Le]),He=Math.abs(K[U]-Ee[U]);(ze>=1||He>=1)&&se(Ee)}}),ye=(Ce,{animation:Re=!0}={})=>{Re?L$e(L,Q.current,Ce,{duration:i.transitions.duration.standard}):Q.current[L]=Ce},H=Ce=>{let Re=Q.current[L];T?Re+=Ce:(Re+=Ce*(o?-1:1),Re*=o&&Kne()==="reverse"?-1:1),ye(Re)},G=()=>{const Ce=Q.current[W];let Re=0;const ae=Array.from(X.current.children);for(let Le=0;LeCe){Le===0&&(Re=Ce);break}Re+=Ee[W]}return Re},ie=()=>{H(-1*G())},he=()=>{H(G())},_e=M.useCallback(Ce=>{ce({overflow:null,scrollbarWidth:Ce})},[]),oe=()=>{const Ce={};Ce.scrollbarSizeListener=R?w.jsx(t3e,{onChange:_e,className:ke($.scrollableX,$.hideScrollbar)}):null;const ae=R&&(y==="auto"&&(te||pe)||y===!0);return Ce.scrollButtonStart=ae?w.jsx(v,j({slots:{StartScrollButtonIcon:b.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:D},orientation:g,direction:o?"right":"left",onClick:ie,disabled:!te},O,{className:ke($.scrollButtons,O.className)})):null,Ce.scrollButtonEnd=ae?w.jsx(v,j({slots:{EndScrollButtonIcon:b.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:A},orientation:g,direction:o?"left":"right",onClick:he,disabled:!pe},O,{className:ke($.scrollButtons,O.className)})):null,Ce},Z=br(Ce=>{const{tabsMeta:Re,tabMeta:ae}=ee();if(!(!ae||!Re)){if(ae[z]Re[B]){const Le=Re[L]+(ae[B]-Re[B]);ye(Le,{animation:Ce})}}}),V=br(()=>{R&&y!==!1&&ve(!re)});M.useEffect(()=>{const Ce=Hv(()=>{Q.current&&ge()});let Re;const ae=ze=>{ze.forEach(He=>{He.removedNodes.forEach(xt=>{var Dt;(Dt=Re)==null||Dt.unobserve(xt)}),He.addedNodes.forEach(xt=>{var Dt;(Dt=Re)==null||Dt.observe(xt)})}),Ce(),V()},Le=ls(Q.current);Le.addEventListener("resize",Ce);let Ee;return typeof ResizeObserver<"u"&&(Re=new ResizeObserver(Ce),Array.from(X.current.children).forEach(ze=>{Re.observe(ze)})),typeof MutationObserver<"u"&&(Ee=new MutationObserver(ae),Ee.observe(X.current,{childList:!0})),()=>{var ze,He;Ce.clear(),Le.removeEventListener("resize",Ce),(ze=Ee)==null||ze.disconnect(),(He=Re)==null||He.disconnect()}},[ge,V]),M.useEffect(()=>{const Ce=Array.from(X.current.children),Re=Ce.length;if(typeof IntersectionObserver<"u"&&Re>0&&R&&y!==!1){const ae=Ce[0],Le=Ce[Re-1],Ee={root:Q.current,threshold:.99},ze=nn=>{J(!nn[0].isIntersecting)},He=new IntersectionObserver(ze,Ee);He.observe(ae);const xt=nn=>{be(!nn[0].isIntersecting)},Dt=new IntersectionObserver(xt,Ee);return Dt.observe(Le),()=>{He.disconnect(),Dt.disconnect()}}},[R,y,re,u==null?void 0:u.length]),M.useEffect(()=>{Y(!0)},[]),M.useEffect(()=>{ge()}),M.useEffect(()=>{Z(B8!==K)},[Z,K]),M.useImperativeHandle(l,()=>({updateIndicator:ge,updateScrollButtons:V}),[ge,V]);const de=w.jsx(e3e,j({},S,{className:ke($.indicator,S.className),ownerState:N,style:j({},K,S.style)}));let xe=0;const Me=M.Children.map(u,Ce=>{if(!M.isValidElement(Ce))return null;const Re=Ce.props.value===void 0?xe:Ce.props.value;le.set(Re,xe);const ae=Re===E;return xe+=1,M.cloneElement(Ce,j({fullWidth:k==="fullWidth",indicator:ae&&!q&&de,selected:ae,selectionFollowsFocus:x,onChange:m,textColor:C,value:Re},xe===1&&E===!1&&!Ce.props.tabIndex?{tabIndex:0}:{}))}),me=Ce=>{const Re=X.current,ae=$n(Re).activeElement;if(ae.getAttribute("role")!=="tab")return;let Ee=g==="horizontal"?"ArrowLeft":"ArrowUp",ze=g==="horizontal"?"ArrowRight":"ArrowDown";switch(g==="horizontal"&&o&&(Ee="ArrowRight",ze="ArrowLeft"),Ce.key){case Ee:Ce.preventDefault(),sS(Re,ae,j8);break;case ze:Ce.preventDefault(),sS(Re,ae,F8);break;case"Home":Ce.preventDefault(),sS(Re,null,F8);break;case"End":Ce.preventDefault(),sS(Re,null,j8);break}},Ne=oe();return w.jsxs(K$e,j({className:ke($.root,f),ownerState:N,ref:n,as:d},P,{children:[Ne.scrollButtonStart,Ne.scrollbarSizeListener,w.jsxs(Z$e,{className:$.scroller,ownerState:N,style:{overflow:F.overflow,[T?`margin${o?"Left":"Right"}`:"marginBottom"]:I?void 0:-F.scrollbarWidth},ref:Q,children:[w.jsx(J$e,{"aria-label":a,"aria-labelledby":s,"aria-orientation":g==="vertical"?"vertical":null,className:$.flexContainer,ownerState:N,onKeyDown:me,ref:X,role:"tablist",children:Me}),q&&de]}),Ne.scrollButtonEnd]}))}),b5=n3e;function r3e(t){return We("MuiTextField",t)}Ve("MuiTextField",["root"]);const i3e=["autoComplete","autoFocus","children","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","id","InputLabelProps","inputProps","InputProps","inputRef","label","maxRows","minRows","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","select","SelectProps","type","value","variant"],o3e={standard:xp,filled:Vre,outlined:oie},a3e=t=>{const{classes:e}=t;return Ue({root:["root"]},r3e,e)},s3e=we(Yv,{name:"MuiTextField",slot:"Root",overridesResolver:(t,e)=>e.root})({}),l3e=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTextField"}),{autoComplete:i,autoFocus:o=!1,children:a,className:s,color:l="primary",defaultValue:c,disabled:u=!1,error:f=!1,FormHelperTextProps:d,fullWidth:h=!1,helperText:p,id:m,InputLabelProps:g,inputProps:v,InputProps:y,inputRef:x,label:b,maxRows:_,minRows:S,multiline:O=!1,name:C,onBlur:E,onChange:k,onFocus:I,placeholder:P,required:R=!1,rows:T,select:L=!1,SelectProps:z,type:B,value:W,variant:U="outlined"}=r,N=Ae(r,i3e),$=j({},r,{autoFocus:o,color:l,disabled:u,error:f,fullWidth:h,multiline:O,required:R,select:L,variant:U}),D=a3e($),A={};U==="outlined"&&(g&&typeof g.shrink<"u"&&(A.notched=g.shrink),A.label=b),L&&((!z||!z.native)&&(A.id=void 0),A["aria-describedby"]=void 0);const q=cd(m),Y=p&&q?`${q}-helper-text`:void 0,K=b&&q?`${q}-label`:void 0,se=o3e[U],te=w.jsx(se,j({"aria-describedby":Y,autoComplete:i,autoFocus:o,defaultValue:c,fullWidth:h,multiline:O,name:C,rows:T,maxRows:_,minRows:S,type:B,value:W,id:q,inputRef:x,onBlur:E,onChange:k,onFocus:I,placeholder:P,inputProps:v},A,y));return w.jsxs(s3e,j({className:ke(D.root,s),disabled:u,error:f,fullWidth:h,ref:n,required:R,color:l,variant:U,ownerState:$},N,{children:[b!=null&&b!==""&&w.jsx(Kv,j({htmlFor:q,id:K},g,{children:b})),L?w.jsx(wp,j({"aria-describedby":Y,id:q,labelId:K,value:W,input:te},z,{children:a})):te,p&&w.jsx(Gre,j({id:Y},d,{children:p}))]}))}),lr=l3e;function c3e(t){return We("MuiToggleButton",t)}const u3e=Ve("MuiToggleButton",["root","disabled","selected","standard","primary","secondary","sizeSmall","sizeMedium","sizeLarge","fullWidth"]),qm=u3e,f3e=M.createContext({}),hie=f3e,d3e=M.createContext(void 0),pie=d3e;function h3e(t,e){return e===void 0||t===void 0?!1:Array.isArray(e)?e.indexOf(t)>=0:t===e}const p3e=["value"],m3e=["children","className","color","disabled","disableFocusRipple","fullWidth","onChange","onClick","selected","size","value"],g3e=t=>{const{classes:e,fullWidth:n,selected:r,disabled:i,size:o,color:a}=t,s={root:["root",r&&"selected",i&&"disabled",n&&"fullWidth",`size${De(o)}`,a]};return Ue(s,c3e,e)},v3e=we(us,{name:"MuiToggleButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`size${De(n.size)}`]]}})(({theme:t,ownerState:e})=>{let n=e.color==="standard"?t.palette.text.primary:t.palette[e.color].main,r;return t.vars&&(n=e.color==="standard"?t.vars.palette.text.primary:t.vars.palette[e.color].main,r=e.color==="standard"?t.vars.palette.text.primaryChannel:t.vars.palette[e.color].mainChannel),j({},t.typography.button,{borderRadius:(t.vars||t).shape.borderRadius,padding:11,border:`1px solid ${(t.vars||t).palette.divider}`,color:(t.vars||t).palette.action.active},e.fullWidth&&{width:"100%"},{[`&.${qm.disabled}`]:{color:(t.vars||t).palette.action.disabled,border:`1px solid ${(t.vars||t).palette.action.disabledBackground}`},"&:hover":{textDecoration:"none",backgroundColor:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.hoverOpacity})`:Wc(t.palette.text.primary,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${qm.selected}`]:{color:n,backgroundColor:t.vars?`rgba(${r} / ${t.vars.palette.action.selectedOpacity})`:Wc(n,t.palette.action.selectedOpacity),"&:hover":{backgroundColor:t.vars?`rgba(${r} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:Wc(n,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${r} / ${t.vars.palette.action.selectedOpacity})`:Wc(n,t.palette.action.selectedOpacity)}}}},e.size==="small"&&{padding:7,fontSize:t.typography.pxToRem(13)},e.size==="large"&&{padding:15,fontSize:t.typography.pxToRem(15)})}),y3e=M.forwardRef(function(e,n){const r=M.useContext(hie),{value:i}=r,o=Ae(r,p3e),a=M.useContext(pie),s=OM(j({},o,{selected:h3e(e.value,i)}),e),l=qe({props:s,name:"MuiToggleButton"}),{children:c,className:u,color:f="standard",disabled:d=!1,disableFocusRipple:h=!1,fullWidth:p=!1,onChange:m,onClick:g,selected:v,size:y="medium",value:x}=l,b=Ae(l,m3e),_=j({},l,{color:f,disabled:d,disableFocusRipple:h,fullWidth:p,size:y}),S=g3e(_),O=E=>{g&&(g(E,x),E.defaultPrevented)||m&&m(E,x)},C=a||"";return w.jsx(v3e,j({className:ke(o.className,S.root,u,C),disabled:d,focusRipple:!h,ref:n,onClick:O,onChange:m,value:x,ownerState:_,"aria-pressed":v},b,{children:c}))}),Pn=y3e;function x3e(t){return We("MuiToggleButtonGroup",t)}const b3e=Ve("MuiToggleButtonGroup",["root","selected","vertical","disabled","grouped","groupedHorizontal","groupedVertical","fullWidth","firstButton","lastButton","middleButton"]),or=b3e,_3e=["children","className","color","disabled","exclusive","fullWidth","onChange","orientation","size","value"],w3e=t=>{const{classes:e,orientation:n,fullWidth:r,disabled:i}=t,o={root:["root",n==="vertical"&&"vertical",r&&"fullWidth"],grouped:["grouped",`grouped${De(n)}`,i&&"disabled"],firstButton:["firstButton"],lastButton:["lastButton"],middleButton:["middleButton"]};return Ue(o,x3e,e)},S3e=we("div",{name:"MuiToggleButtonGroup",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${or.grouped}`]:e.grouped},{[`& .${or.grouped}`]:e[`grouped${De(n.orientation)}`]},{[`& .${or.firstButton}`]:e.firstButton},{[`& .${or.lastButton}`]:e.lastButton},{[`& .${or.middleButton}`]:e.middleButton},e.root,n.orientation==="vertical"&&e.vertical,n.fullWidth&&e.fullWidth]}})(({ownerState:t,theme:e})=>j({display:"inline-flex",borderRadius:(e.vars||e).shape.borderRadius},t.orientation==="vertical"&&{flexDirection:"column"},t.fullWidth&&{width:"100%"},{[`& .${or.grouped}`]:j({},t.orientation==="horizontal"?{[`&.${or.selected} + .${or.grouped}.${or.selected}`]:{borderLeft:0,marginLeft:0}}:{[`&.${or.selected} + .${or.grouped}.${or.selected}`]:{borderTop:0,marginTop:0}})},t.orientation==="horizontal"?{[`& .${or.firstButton},& .${or.middleButton}`]:{borderTopRightRadius:0,borderBottomRightRadius:0},[`& .${or.lastButton},& .${or.middleButton}`]:{marginLeft:-1,borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0}}:{[`& .${or.firstButton},& .${or.middleButton}`]:{borderBottomLeftRadius:0,borderBottomRightRadius:0},[`& .${or.lastButton},& .${or.middleButton}`]:{marginTop:-1,borderTop:"1px solid transparent",borderTopLeftRadius:0,borderTopRightRadius:0}},t.orientation==="horizontal"?{[`& .${or.lastButton}.${qm.disabled},& .${or.middleButton}.${qm.disabled}`]:{borderLeft:"1px solid transparent"}}:{[`& .${or.lastButton}.${qm.disabled},& .${or.middleButton}.${qm.disabled}`]:{borderTop:"1px solid transparent"}})),O3e=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiToggleButtonGroup"}),{children:i,className:o,color:a="standard",disabled:s=!1,exclusive:l=!1,fullWidth:c=!1,onChange:u,orientation:f="horizontal",size:d="medium",value:h}=r,p=Ae(r,_3e),m=j({},r,{disabled:s,fullWidth:c,orientation:f,size:d}),g=w3e(m),v=M.useCallback((O,C)=>{if(!u)return;const E=h&&h.indexOf(C);let k;h&&E>=0?(k=h.slice(),k.splice(E,1)):k=h?h.concat(C):[C],u(O,k)},[u,h]),y=M.useCallback((O,C)=>{u&&u(O,h===C?null:C)},[u,h]),x=M.useMemo(()=>({className:g.grouped,onChange:l?y:v,value:h,size:d,fullWidth:c,color:a,disabled:s}),[g.grouped,l,y,v,h,d,c,a,s]),b=uOe(i),_=b.length,S=O=>{const C=O===0,E=O===_-1;return C&&E?"":C?g.firstButton:E?g.lastButton:g.middleButton};return w.jsx(S3e,j({role:"group",className:ke(g.root,o),ref:n,ownerState:m},p,{children:w.jsx(hie.Provider,{value:x,children:b.map((O,C)=>w.jsx(pie.Provider,{value:S(C),children:O},C))})}))}),Jv=O3e,C3e="default",T3e={id:"local",name:"Local Server",url:"http://localhost:8080"},E3e={appBarTitle:"xcube Viewer",windowTitle:"xcube Viewer",windowIcon:null,compact:!1,themeName:"light",primaryColor:"blue",secondaryColor:"pink",organisationUrl:"https://xcube.readthedocs.io/",logoImage:"images/logo.png",logoWidth:32,baseMapUrl:"https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",defaultAgg:"mean",polygonFillOpacity:.2,mapProjection:"EPSG:3857",allowDownloads:!0,allowRefresh:!0,allowUserVariables:!0,allow3D:!0},lS={name:C3e,server:T3e,branding:E3e};function P3e(){const t=new URL(window.location.href),e=t.pathname.split("/"),n=e.length;return n>0?e[n-1]==="index.html"?new URL(e.slice(0,n-1).join("/"),window.location.origin):new URL(t.pathname,window.location.origin):new URL(window.location.origin)}const zM=P3e();console.log("baseUrl = ",zM.href);function mie(t,...e){let n=t;for(const r of e)r!==""&&(n.endsWith("/")?r.startsWith("/")?n+=r.substring(1):n+=r:r.startsWith("/")?n+=r:n+="/"+r);return n}const M3e={amber:une,blue:Ju,blueGrey:E1e,brown:fne,cyan:ane,deepOrange:Ph,deepPurple:f1e,green:Rc,grey:dne,indigo:one,lightBlue:ef,lightGreen:x1e,lime:lne,orange:Jd,pink:ine,purple:Zu,red:Ku,teal:sne,yellow:cne};function z8(t,e){const n=t[e];let r=null;if(typeof n=="string"?(r=M3e[n]||null,r===null&&n.startsWith("#")&&(n.length===7||n.length===9)&&(r={main:n})):typeof n=="object"&&n!==null&&"main"in n&&(r=n),r!==null)t[e]=r;else throw new Error(`Value of branding.${e} is invalid: ${n}`)}function k3e(t,e,n){const r=t[e];typeof r=="string"&&(t[e]=mie(zM.href,n,r))}function A3e(t,e){return t={...t},z8(t,"primaryColor"),z8(t,"secondaryColor"),k3e(t,"logoImage",e),t}function En(t){return typeof t=="number"}function ey(t){return typeof t=="string"}function R3e(t){return typeof t=="function"}function U8(t){return t!==null&&typeof t=="object"&&t.constructor===Object}var qp={BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const cf=new URLSearchParams(window.location.search),Ds=class Ds{constructor(e,n,r,i){Yt(this,"name");Yt(this,"server");Yt(this,"branding");Yt(this,"authClient");this.name=e,this.server=n,this.branding=r,this.authClient=i}static async load(){let e=cf.get("configPath")||"config";const n=await this.loadRawConfig(e);n===lS&&(e="");const r=n.name||"default",i=this.getAuthConfig(n),o=this.getServerConfig(n),a=parseInt(cf.get("compact")||"0")!==0;let s=A3e({...lS.branding,...n.branding,compact:a||n.branding.compact},e);return s=V8(s,"allowUserVariables"),s=V8(s,"allow3D"),Ds._instance=new Ds(r,o,s,i),s.windowTitle&&this.changeWindowTitle(s.windowTitle),s.windowIcon&&this.changeWindowIcon(s.windowIcon),Ds._instance}static getAuthConfig(e){let n=e.authClient&&{...e.authClient};const r=Ds.getAuthClientFromEnv();if(!n&&r.authority&&r.clientId&&(n={authority:r.authority,client_id:r.clientId}),n){if(r.authority){const i=r.authority;n={...n,authority:i}}if(r.clientId){const i=r.clientId;n={...n,client_id:i}}if(r.audience){const i=r.audience,o=n.extraQueryParams;n={...n,extraQueryParams:{...o,audience:i}}}}return n}static getServerConfig(e){const n={...lS.server,...e.server},r=Ds.getApiServerFromEnv();return n.id=cf.get("serverId")||r.id||n.id,n.name=cf.get("serverName")||r.name||n.name,n.url=cf.get("serverUrl")||r.url||n.url,n}static async loadRawConfig(e){let n=null,r=null;const i=mie(zM.href,e,"config.json");try{const o=await fetch(i);if(o.ok)n=await o.json();else{const{status:a,statusText:s}=o;r=`HTTP status ${a}`,s&&(r+=` (${s})`)}}catch(o){n=null,r=`${o}`}return n===null&&(n=lS),n}static get instance(){return Ds.assertConfigLoaded(),Ds._instance}static assertConfigLoaded(){if(!Ds._instance)throw new Error("internal error: configuration not available yet")}static changeWindowTitle(e){document.title=e}static changeWindowIcon(e){let n=document.querySelector('link[rel="icon"]');n!==null?n.href=e:(n=document.createElement("link"),n.rel="icon",n.href=e,document.head.appendChild(n))}static getAuthClientFromEnv(){const e=qp.XCV_OAUTH2_AUTHORITY,n=qp.XCV_OAUTH2_CLIENT_ID,r=qp.XCV_OAUTH2_AUDIENCE;return{authority:e,clientId:n,audience:r}}static getApiServerFromEnv(){const e=qp.XCV_APP_SERVER_ID,n=qp.XCV_SERVER_NAME,r=qp.XCV_SERVER_URL;return{id:e,name:n,url:r}}};Yt(Ds,"_instance");let Kt=Ds;const _5=[["red",Ku],["yellow",cne],["blue",Ju],["pink",ine],["lightBlue",ef],["green",Rc],["orange",Jd],["lime",lne],["purple",Zu],["indigo",one],["cyan",ane],["brown",fne],["teal",sne]],I3e=(()=>{const t={};return _5.forEach(([e,n])=>{t[e]=n}),t})(),W8=_5.map(([t,e])=>t);function D3e(t){return t==="light"?800:400}function Xh(t){return W8[t%W8.length]}function gie(t,e){const n=D3e(e);return I3e[t][n]}function w5(t){return En(t)||(t=Kt.instance.branding.polygonFillOpacity),En(t)?t:.25}const L3e={Mapbox:{param:"access_token",token:"pk.eyJ1IjoiZm9ybWFuIiwiYSI6ImNrM2JranV0bDBtenczb2szZG84djh6bWUifQ.q0UKwf4CWt5fcQwIDwF8Bg"}};function $3e(t){return L3e[t]}function V8(t,e){const n=cf.get(e),r=n?!!parseInt(n):!!t[e];return{...t,[e]:r}}function ox(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var SA={exports:{}};const N3e={},F3e=Object.freeze(Object.defineProperty({__proto__:null,default:N3e},Symbol.toStringTag,{value:"Module"})),j3e=Ea(F3e);var G8;function UM(){return G8||(G8=1,function(t,e){(function(n,r){t.exports=r()})(Kn,function(){var n=n||function(r,i){var o;if(typeof window<"u"&&window.crypto&&(o=window.crypto),typeof self<"u"&&self.crypto&&(o=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(o=globalThis.crypto),!o&&typeof window<"u"&&window.msCrypto&&(o=window.msCrypto),!o&&typeof Kn<"u"&&Kn.crypto&&(o=Kn.crypto),!o&&typeof ox=="function")try{o=j3e}catch{}var a=function(){if(o){if(typeof o.getRandomValues=="function")try{return o.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof o.randomBytes=="function")try{return o.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},s=Object.create||function(){function y(){}return function(x){var b;return y.prototype=x,b=new y,y.prototype=null,b}}(),l={},c=l.lib={},u=c.Base=function(){return{extend:function(y){var x=s(this);return y&&x.mixIn(y),(!x.hasOwnProperty("init")||this.init===x.init)&&(x.init=function(){x.$super.init.apply(this,arguments)}),x.init.prototype=x,x.$super=this,x},create:function(){var y=this.extend();return y.init.apply(y,arguments),y},init:function(){},mixIn:function(y){for(var x in y)y.hasOwnProperty(x)&&(this[x]=y[x]);y.hasOwnProperty("toString")&&(this.toString=y.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),f=c.WordArray=u.extend({init:function(y,x){y=this.words=y||[],x!=i?this.sigBytes=x:this.sigBytes=y.length*4},toString:function(y){return(y||h).stringify(this)},concat:function(y){var x=this.words,b=y.words,_=this.sigBytes,S=y.sigBytes;if(this.clamp(),_%4)for(var O=0;O>>2]>>>24-O%4*8&255;x[_+O>>>2]|=C<<24-(_+O)%4*8}else for(var E=0;E>>2]=b[E>>>2];return this.sigBytes+=S,this},clamp:function(){var y=this.words,x=this.sigBytes;y[x>>>2]&=4294967295<<32-x%4*8,y.length=r.ceil(x/4)},clone:function(){var y=u.clone.call(this);return y.words=this.words.slice(0),y},random:function(y){for(var x=[],b=0;b>>2]>>>24-S%4*8&255;_.push((O>>>4).toString(16)),_.push((O&15).toString(16))}return _.join("")},parse:function(y){for(var x=y.length,b=[],_=0;_>>3]|=parseInt(y.substr(_,2),16)<<24-_%8*4;return new f.init(b,x/2)}},p=d.Latin1={stringify:function(y){for(var x=y.words,b=y.sigBytes,_=[],S=0;S>>2]>>>24-S%4*8&255;_.push(String.fromCharCode(O))}return _.join("")},parse:function(y){for(var x=y.length,b=[],_=0;_>>2]|=(y.charCodeAt(_)&255)<<24-_%4*8;return new f.init(b,x)}},m=d.Utf8={stringify:function(y){try{return decodeURIComponent(escape(p.stringify(y)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(y){return p.parse(unescape(encodeURIComponent(y)))}},g=c.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new f.init,this._nDataBytes=0},_append:function(y){typeof y=="string"&&(y=m.parse(y)),this._data.concat(y),this._nDataBytes+=y.sigBytes},_process:function(y){var x,b=this._data,_=b.words,S=b.sigBytes,O=this.blockSize,C=O*4,E=S/C;y?E=r.ceil(E):E=r.max((E|0)-this._minBufferSize,0);var k=E*O,I=r.min(k*4,S);if(k){for(var P=0;P>>7)^(E<<14|E>>>18)^E>>>3,I=f[C-2],P=(I<<15|I>>>17)^(I<<13|I>>>19)^I>>>10;f[C]=k+f[C-7]+P+f[C-16]}var R=b&_^~b&S,T=g&v^g&y^v&y,L=(g<<30|g>>>2)^(g<<19|g>>>13)^(g<<10|g>>>22),z=(b<<26|b>>>6)^(b<<21|b>>>11)^(b<<7|b>>>25),B=O+z+R+u[C]+f[C],W=L+T;O=S,S=_,_=b,b=x+B|0,x=y,y=v,v=g,g=B+W|0}m[0]=m[0]+g|0,m[1]=m[1]+v|0,m[2]=m[2]+y|0,m[3]=m[3]+x|0,m[4]=m[4]+b|0,m[5]=m[5]+_|0,m[6]=m[6]+S|0,m[7]=m[7]+O|0},_doFinalize:function(){var h=this._data,p=h.words,m=this._nDataBytes*8,g=h.sigBytes*8;return p[g>>>5]|=128<<24-g%32,p[(g+64>>>9<<4)+14]=r.floor(m/4294967296),p[(g+64>>>9<<4)+15]=m,h.sigBytes=p.length*4,this._process(),this._hash},clone:function(){var h=s.clone.call(this);return h._hash=this._hash.clone(),h}});i.SHA256=s._createHelper(d),i.HmacSHA256=s._createHmacHelper(d)}(Math),n.SHA256})})(vie);var U3e=vie.exports;const W3e=Nt(U3e);var yie={exports:{}};(function(t,e){(function(n,r){t.exports=r(UM())})(Kn,function(n){return function(){var r=n,i=r.lib,o=i.WordArray,a=r.enc;a.Base64={stringify:function(l){var c=l.words,u=l.sigBytes,f=this._map;l.clamp();for(var d=[],h=0;h>>2]>>>24-h%4*8&255,m=c[h+1>>>2]>>>24-(h+1)%4*8&255,g=c[h+2>>>2]>>>24-(h+2)%4*8&255,v=p<<16|m<<8|g,y=0;y<4&&h+y*.75>>6*(3-y)&63));var x=f.charAt(64);if(x)for(;d.length%4;)d.push(x);return d.join("")},parse:function(l){var c=l.length,u=this._map,f=this._reverseMap;if(!f){f=this._reverseMap=[];for(var d=0;d>>6-h%4*2,g=p|m;f[d>>>2]|=g<<24-d%4*8,d++}return o.create(f,d)}}(),n.enc.Base64})})(yie);var V3e=yie.exports;const H8=Nt(V3e);var xie={exports:{}};(function(t,e){(function(n,r){t.exports=r(UM())})(Kn,function(n){return n.enc.Utf8})})(xie);var G3e=xie.exports;const H3e=Nt(G3e);function $L(t){this.message=t}$L.prototype=new Error,$L.prototype.name="InvalidCharacterError";var q8=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new $L("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,i=0,o=0,a="";r=e.charAt(o++);~r&&(n=i%4?64*n+r:r,i++%4)?a+=String.fromCharCode(255&n>>(-2*i&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return a};function q3e(t){var e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw"Illegal base64url string!"}try{return function(n){return decodeURIComponent(q8(n).replace(/(.)/g,function(r,i){var o=i.charCodeAt(0).toString(16).toUpperCase();return o.length<2&&(o="0"+o),"%"+o}))}(e)}catch{return q8(e)}}function PT(t){this.message=t}function X3e(t,e){if(typeof t!="string")throw new PT("Invalid token specified");var n=(e=e||{}).header===!0?0:1;try{return JSON.parse(q3e(t.split(".")[n]))}catch(r){throw new PT("Invalid token specified: "+r.message)}}PT.prototype=new Error,PT.prototype.name="InvalidTokenError";var Q3e={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}},fl,dl,MT=(t=>(t[t.NONE=0]="NONE",t[t.ERROR=1]="ERROR",t[t.WARN=2]="WARN",t[t.INFO=3]="INFO",t[t.DEBUG=4]="DEBUG",t))(MT||{});(t=>{function e(){fl=3,dl=Q3e}t.reset=e;function n(i){if(!(0<=i&&i<=4))throw new Error("Invalid log level");fl=i}t.setLevel=n;function r(i){dl=i}t.setLogger=r})(MT||(MT={}));var Rt=class{constructor(t){this._name=t}debug(...t){fl>=4&&dl.debug(Rt._format(this._name,this._method),...t)}info(...t){fl>=3&&dl.info(Rt._format(this._name,this._method),...t)}warn(...t){fl>=2&&dl.warn(Rt._format(this._name,this._method),...t)}error(...t){fl>=1&&dl.error(Rt._format(this._name,this._method),...t)}throw(t){throw this.error(t),t}create(t){const e=Object.create(this);return e._method=t,e.debug("begin"),e}static createStatic(t,e){const n=new Rt(`${t}.${e}`);return n.debug("begin"),n}static _format(t,e){const n=`[${t}]`;return e?`${n} ${e}:`:n}static debug(t,...e){fl>=4&&dl.debug(Rt._format(t),...e)}static info(t,...e){fl>=3&&dl.info(Rt._format(t),...e)}static warn(t,...e){fl>=2&&dl.warn(Rt._format(t),...e)}static error(t,...e){fl>=1&&dl.error(Rt._format(t),...e)}};MT.reset();var Y3e="10000000-1000-4000-8000-100000000000",Ml=class{static _randomWord(){return z3e.lib.WordArray.random(1).words[0]}static generateUUIDv4(){return Y3e.replace(/[018]/g,e=>(+e^Ml._randomWord()&15>>+e/4).toString(16)).replace(/-/g,"")}static generateCodeVerifier(){return Ml.generateUUIDv4()+Ml.generateUUIDv4()+Ml.generateUUIDv4()}static generateCodeChallenge(t){try{const e=W3e(t);return H8.stringify(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(e){throw Rt.error("CryptoUtils.generateCodeChallenge",e),e}}static generateBasicAuth(t,e){const n=H3e.parse([t,e].join(":"));return H8.stringify(n)}},tf=class{constructor(e){this._name=e,this._logger=new Rt(`Event('${this._name}')`),this._callbacks=[]}addHandler(e){return this._callbacks.push(e),()=>this.removeHandler(e)}removeHandler(e){const n=this._callbacks.lastIndexOf(e);n>=0&&this._callbacks.splice(n,1)}raise(...e){this._logger.debug("raise:",...e);for(const n of this._callbacks)n(...e)}},NL=class{static decode(t){try{return X3e(t)}catch(e){throw Rt.error("JwtUtils.decode",e),e}}},X8=class{static center({...t}){var e,n,r;return t.width==null&&(t.width=(e=[800,720,600,480].find(i=>i<=window.outerWidth/1.618))!=null?e:360),(n=t.left)!=null||(t.left=Math.max(0,Math.round(window.screenX+(window.outerWidth-t.width)/2))),t.height!=null&&((r=t.top)!=null||(t.top=Math.max(0,Math.round(window.screenY+(window.outerHeight-t.height)/2)))),t}static serialize(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e}=${typeof n!="boolean"?n:n?"yes":"no"}`).join(",")}},ts=class extends tf{constructor(){super(...arguments),this._logger=new Rt(`Timer('${this._name}')`),this._timerHandle=null,this._expiration=0,this._callback=()=>{const t=this._expiration-ts.getEpochTime();this._logger.debug("timer completes in",t),this._expiration<=ts.getEpochTime()&&(this.cancel(),super.raise())}}static getEpochTime(){return Math.floor(Date.now()/1e3)}init(t){const e=this._logger.create("init");t=Math.max(Math.floor(t),1);const n=ts.getEpochTime()+t;if(this.expiration===n&&this._timerHandle){e.debug("skipping since already initialized for expiration at",this.expiration);return}this.cancel(),e.debug("using duration",t),this._expiration=n;const r=Math.min(t,5);this._timerHandle=setInterval(this._callback,r*1e3)}get expiration(){return this._expiration}cancel(){this._logger.create("cancel"),this._timerHandle&&(clearInterval(this._timerHandle),this._timerHandle=null)}},FL=class{static readParams(t,e="query"){if(!t)throw new TypeError("Invalid URL");const r=new URL(t,"http://127.0.0.1")[e==="fragment"?"hash":"search"];return new URLSearchParams(r.slice(1))}},jL=";",Qh=class extends Error{constructor(t,e){var n,r,i;if(super(t.error_description||t.error||""),this.form=e,this.name="ErrorResponse",!t.error)throw Rt.error("ErrorResponse","No error passed"),new Error("No error passed");this.error=t.error,this.error_description=(n=t.error_description)!=null?n:null,this.error_uri=(r=t.error_uri)!=null?r:null,this.state=t.userState,this.session_state=(i=t.session_state)!=null?i:null,this.url_state=t.url_state}},S5=class extends Error{constructor(t){super(t),this.name="ErrorTimeout"}},K3e=class{constructor(t){this._logger=new Rt("AccessTokenEvents"),this._expiringTimer=new ts("Access token expiring"),this._expiredTimer=new ts("Access token expired"),this._expiringNotificationTimeInSeconds=t.expiringNotificationTimeInSeconds}load(t){const e=this._logger.create("load");if(t.access_token&&t.expires_in!==void 0){const n=t.expires_in;if(e.debug("access token present, remaining duration:",n),n>0){let i=n-this._expiringNotificationTimeInSeconds;i<=0&&(i=1),e.debug("registering expiring timer, raising in",i,"seconds"),this._expiringTimer.init(i)}else e.debug("canceling existing expiring timer because we're past expiration."),this._expiringTimer.cancel();const r=n+1;e.debug("registering expired timer, raising in",r,"seconds"),this._expiredTimer.init(r)}else this._expiringTimer.cancel(),this._expiredTimer.cancel()}unload(){this._logger.debug("unload: canceling existing access token timers"),this._expiringTimer.cancel(),this._expiredTimer.cancel()}addAccessTokenExpiring(t){return this._expiringTimer.addHandler(t)}removeAccessTokenExpiring(t){this._expiringTimer.removeHandler(t)}addAccessTokenExpired(t){return this._expiredTimer.addHandler(t)}removeAccessTokenExpired(t){this._expiredTimer.removeHandler(t)}},Z3e=class{constructor(t,e,n,r,i){this._callback=t,this._client_id=e,this._intervalInSeconds=r,this._stopOnError=i,this._logger=new Rt("CheckSessionIFrame"),this._timer=null,this._session_state=null,this._message=a=>{a.origin===this._frame_origin&&a.source===this._frame.contentWindow&&(a.data==="error"?(this._logger.error("error message from check session op iframe"),this._stopOnError&&this.stop()):a.data==="changed"?(this._logger.debug("changed message from check session op iframe"),this.stop(),this._callback()):this._logger.debug(a.data+" message from check session op iframe"))};const o=new URL(n);this._frame_origin=o.origin,this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="fixed",this._frame.style.left="-1000px",this._frame.style.top="0",this._frame.width="0",this._frame.height="0",this._frame.src=o.href}load(){return new Promise(t=>{this._frame.onload=()=>{t()},window.document.body.appendChild(this._frame),window.addEventListener("message",this._message,!1)})}start(t){if(this._session_state===t)return;this._logger.create("start"),this.stop(),this._session_state=t;const e=()=>{!this._frame.contentWindow||!this._session_state||this._frame.contentWindow.postMessage(this._client_id+" "+this._session_state,this._frame_origin)};e(),this._timer=setInterval(e,this._intervalInSeconds*1e3)}stop(){this._logger.create("stop"),this._session_state=null,this._timer&&(clearInterval(this._timer),this._timer=null)}},bie=class{constructor(){this._logger=new Rt("InMemoryWebStorage"),this._data={}}clear(){this._logger.create("clear"),this._data={}}getItem(t){return this._logger.create(`getItem('${t}')`),this._data[t]}setItem(t,e){this._logger.create(`setItem('${t}')`),this._data[t]=e}removeItem(t){this._logger.create(`removeItem('${t}')`),delete this._data[t]}get length(){return Object.getOwnPropertyNames(this._data).length}key(t){return Object.getOwnPropertyNames(this._data)[t]}},O5=class{constructor(t=[],e=null,n={}){this._jwtHandler=e,this._extraHeaders=n,this._logger=new Rt("JsonService"),this._contentTypes=[],this._contentTypes.push(...t,"application/json"),e&&this._contentTypes.push("application/jwt")}async fetchWithTimeout(t,e={}){const{timeoutInSeconds:n,...r}=e;if(!n)return await fetch(t,r);const i=new AbortController,o=setTimeout(()=>i.abort(),n*1e3);try{return await fetch(t,{...e,signal:i.signal})}catch(a){throw a instanceof DOMException&&a.name==="AbortError"?new S5("Network timed out"):a}finally{clearTimeout(o)}}async getJson(t,{token:e,credentials:n}={}){const r=this._logger.create("getJson"),i={Accept:this._contentTypes.join(", ")};e&&(r.debug("token passed, setting Authorization header"),i.Authorization="Bearer "+e),this.appendExtraHeaders(i);let o;try{r.debug("url:",t),o=await this.fetchWithTimeout(t,{method:"GET",headers:i,credentials:n})}catch(l){throw r.error("Network Error"),l}r.debug("HTTP response received, status",o.status);const a=o.headers.get("Content-Type");if(a&&!this._contentTypes.find(l=>a.startsWith(l))&&r.throw(new Error(`Invalid response Content-Type: ${a??"undefined"}, from URL: ${t}`)),o.ok&&this._jwtHandler&&(a!=null&&a.startsWith("application/jwt")))return await this._jwtHandler(await o.text());let s;try{s=await o.json()}catch(l){throw r.error("Error parsing JSON response",l),o.ok?l:new Error(`${o.statusText} (${o.status})`)}if(!o.ok)throw r.error("Error from server:",s),s.error?new Qh(s):new Error(`${o.statusText} (${o.status}): ${JSON.stringify(s)}`);return s}async postForm(t,{body:e,basicAuth:n,timeoutInSeconds:r,initCredentials:i}){const o=this._logger.create("postForm"),a={Accept:this._contentTypes.join(", "),"Content-Type":"application/x-www-form-urlencoded"};n!==void 0&&(a.Authorization="Basic "+n),this.appendExtraHeaders(a);let s;try{o.debug("url:",t),s=await this.fetchWithTimeout(t,{method:"POST",headers:a,body:e,timeoutInSeconds:r,credentials:i})}catch(f){throw o.error("Network error"),f}o.debug("HTTP response received, status",s.status);const l=s.headers.get("Content-Type");if(l&&!this._contentTypes.find(f=>l.startsWith(f)))throw new Error(`Invalid response Content-Type: ${l??"undefined"}, from URL: ${t}`);const c=await s.text();let u={};if(c)try{u=JSON.parse(c)}catch(f){throw o.error("Error parsing JSON response",f),s.ok?f:new Error(`${s.statusText} (${s.status})`)}if(!s.ok)throw o.error("Error from server:",u),u.error?new Qh(u,e):new Error(`${s.statusText} (${s.status}): ${JSON.stringify(u)}`);return u}appendExtraHeaders(t){const e=this._logger.create("appendExtraHeaders"),n=Object.keys(this._extraHeaders),r=["authorization","accept","content-type"];n.length!==0&&n.forEach(i=>{if(r.includes(i.toLocaleLowerCase())){e.warn("Protected header could not be overridden",i,r);return}const o=typeof this._extraHeaders[i]=="function"?this._extraHeaders[i]():this._extraHeaders[i];o&&o!==""&&(t[i]=o)})}},J3e=class{constructor(t){this._settings=t,this._logger=new Rt("MetadataService"),this._signingKeys=null,this._metadata=null,this._metadataUrl=this._settings.metadataUrl,this._jsonService=new O5(["application/jwk-set+json"],null,this._settings.extraHeaders),this._settings.signingKeys&&(this._logger.debug("using signingKeys from settings"),this._signingKeys=this._settings.signingKeys),this._settings.metadata&&(this._logger.debug("using metadata from settings"),this._metadata=this._settings.metadata),this._settings.fetchRequestCredentials&&(this._logger.debug("using fetchRequestCredentials from settings"),this._fetchRequestCredentials=this._settings.fetchRequestCredentials)}resetSigningKeys(){this._signingKeys=null}async getMetadata(){const t=this._logger.create("getMetadata");if(this._metadata)return t.debug("using cached values"),this._metadata;if(!this._metadataUrl)throw t.throw(new Error("No authority or metadataUrl configured on settings")),null;t.debug("getting metadata from",this._metadataUrl);const e=await this._jsonService.getJson(this._metadataUrl,{credentials:this._fetchRequestCredentials});return t.debug("merging remote JSON with seed metadata"),this._metadata=Object.assign({},this._settings.metadataSeed,e),this._metadata}getIssuer(){return this._getMetadataProperty("issuer")}getAuthorizationEndpoint(){return this._getMetadataProperty("authorization_endpoint")}getUserInfoEndpoint(){return this._getMetadataProperty("userinfo_endpoint")}getTokenEndpoint(t=!0){return this._getMetadataProperty("token_endpoint",t)}getCheckSessionIframe(){return this._getMetadataProperty("check_session_iframe",!0)}getEndSessionEndpoint(){return this._getMetadataProperty("end_session_endpoint",!0)}getRevocationEndpoint(t=!0){return this._getMetadataProperty("revocation_endpoint",t)}getKeysEndpoint(t=!0){return this._getMetadataProperty("jwks_uri",t)}async _getMetadataProperty(t,e=!1){const n=this._logger.create(`_getMetadataProperty('${t}')`),r=await this.getMetadata();if(n.debug("resolved"),r[t]===void 0){if(e===!0){n.warn("Metadata does not contain optional property");return}n.throw(new Error("Metadata does not contain property "+t))}return r[t]}async getSigningKeys(){const t=this._logger.create("getSigningKeys");if(this._signingKeys)return t.debug("returning signingKeys from cache"),this._signingKeys;const e=await this.getKeysEndpoint(!1);t.debug("got jwks_uri",e);const n=await this._jsonService.getJson(e);if(t.debug("got key set",n),!Array.isArray(n.keys))throw t.throw(new Error("Missing keys on keyset")),null;return this._signingKeys=n.keys,this._signingKeys}},_ie=class{constructor({prefix:t="oidc.",store:e=localStorage}={}){this._logger=new Rt("WebStorageStateStore"),this._store=e,this._prefix=t}async set(t,e){this._logger.create(`set('${t}')`),t=this._prefix+t,await this._store.setItem(t,e)}async get(t){return this._logger.create(`get('${t}')`),t=this._prefix+t,await this._store.getItem(t)}async remove(t){this._logger.create(`remove('${t}')`),t=this._prefix+t;const e=await this._store.getItem(t);return await this._store.removeItem(t),e}async getAllKeys(){this._logger.create("getAllKeys");const t=await this._store.length,e=[];for(let n=0;n{const r=this._logger.create("_getClaimsFromJwt");try{const i=NL.decode(n);return r.debug("JWT decoding successful"),i}catch(i){throw r.error("Error parsing JWT response"),i}},this._jsonService=new O5(void 0,this._getClaimsFromJwt,this._settings.extraHeaders)}async getClaims(t){const e=this._logger.create("getClaims");t||this._logger.throw(new Error("No token passed"));const n=await this._metadataService.getUserInfoEndpoint();e.debug("got userinfo url",n);const r=await this._jsonService.getJson(n,{token:t,credentials:this._settings.fetchRequestCredentials});return e.debug("got claims",r),r}},wie=class{constructor(t,e){this._settings=t,this._metadataService=e,this._logger=new Rt("TokenClient"),this._jsonService=new O5(this._settings.revokeTokenAdditionalContentTypes,null,this._settings.extraHeaders)}async exchangeCode({grant_type:t="authorization_code",redirect_uri:e=this._settings.redirect_uri,client_id:n=this._settings.client_id,client_secret:r=this._settings.client_secret,...i}){const o=this._logger.create("exchangeCode");n||o.throw(new Error("A client_id is required")),e||o.throw(new Error("A redirect_uri is required")),i.code||o.throw(new Error("A code is required"));const a=new URLSearchParams({grant_type:t,redirect_uri:e});for(const[u,f]of Object.entries(i))f!=null&&a.set(u,f);let s;switch(this._settings.client_authentication){case"client_secret_basic":if(!r)throw o.throw(new Error("A client_secret is required")),null;s=Ml.generateBasicAuth(n,r);break;case"client_secret_post":a.append("client_id",n),r&&a.append("client_secret",r);break}const l=await this._metadataService.getTokenEndpoint(!1);o.debug("got token endpoint");const c=await this._jsonService.postForm(l,{body:a,basicAuth:s,initCredentials:this._settings.fetchRequestCredentials});return o.debug("got response"),c}async exchangeCredentials({grant_type:t="password",client_id:e=this._settings.client_id,client_secret:n=this._settings.client_secret,scope:r=this._settings.scope,...i}){const o=this._logger.create("exchangeCredentials");e||o.throw(new Error("A client_id is required"));const a=new URLSearchParams({grant_type:t,scope:r});for(const[u,f]of Object.entries(i))f!=null&&a.set(u,f);let s;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw o.throw(new Error("A client_secret is required")),null;s=Ml.generateBasicAuth(e,n);break;case"client_secret_post":a.append("client_id",e),n&&a.append("client_secret",n);break}const l=await this._metadataService.getTokenEndpoint(!1);o.debug("got token endpoint");const c=await this._jsonService.postForm(l,{body:a,basicAuth:s,initCredentials:this._settings.fetchRequestCredentials});return o.debug("got response"),c}async exchangeRefreshToken({grant_type:t="refresh_token",client_id:e=this._settings.client_id,client_secret:n=this._settings.client_secret,timeoutInSeconds:r,...i}){const o=this._logger.create("exchangeRefreshToken");e||o.throw(new Error("A client_id is required")),i.refresh_token||o.throw(new Error("A refresh_token is required"));const a=new URLSearchParams({grant_type:t});for(const[u,f]of Object.entries(i))Array.isArray(f)?f.forEach(d=>a.append(u,d)):f!=null&&a.set(u,f);let s;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw o.throw(new Error("A client_secret is required")),null;s=Ml.generateBasicAuth(e,n);break;case"client_secret_post":a.append("client_id",e),n&&a.append("client_secret",n);break}const l=await this._metadataService.getTokenEndpoint(!1);o.debug("got token endpoint");const c=await this._jsonService.postForm(l,{body:a,basicAuth:s,timeoutInSeconds:r,initCredentials:this._settings.fetchRequestCredentials});return o.debug("got response"),c}async revoke(t){var e;const n=this._logger.create("revoke");t.token||n.throw(new Error("A token is required"));const r=await this._metadataService.getRevocationEndpoint(!1);n.debug(`got revocation endpoint, revoking ${(e=t.token_type_hint)!=null?e:"default token type"}`);const i=new URLSearchParams;for(const[o,a]of Object.entries(t))a!=null&&i.set(o,a);i.set("client_id",this._settings.client_id),this._settings.client_secret&&i.set("client_secret",this._settings.client_secret),await this._jsonService.postForm(r,{body:i}),n.debug("got response")}},sNe=class{constructor(t,e,n){this._settings=t,this._metadataService=e,this._claimsService=n,this._logger=new Rt("ResponseValidator"),this._userInfoService=new aNe(this._settings,this._metadataService),this._tokenClient=new wie(this._settings,this._metadataService)}async validateSigninResponse(t,e){const n=this._logger.create("validateSigninResponse");this._processSigninState(t,e),n.debug("state processed"),await this._processCode(t,e),n.debug("code processed"),t.isOpenId&&this._validateIdTokenAttributes(t),n.debug("tokens validated"),await this._processClaims(t,e==null?void 0:e.skipUserInfo,t.isOpenId),n.debug("claims processed")}async validateCredentialsResponse(t,e){const n=this._logger.create("validateCredentialsResponse");t.isOpenId&&t.id_token&&this._validateIdTokenAttributes(t),n.debug("tokens validated"),await this._processClaims(t,e,t.isOpenId),n.debug("claims processed")}async validateRefreshResponse(t,e){var n,r;const i=this._logger.create("validateRefreshResponse");t.userState=e.data,(n=t.session_state)!=null||(t.session_state=e.session_state),(r=t.scope)!=null||(t.scope=e.scope),t.isOpenId&&t.id_token&&(this._validateIdTokenAttributes(t,e.id_token),i.debug("ID Token validated")),t.id_token||(t.id_token=e.id_token,t.profile=e.profile);const o=t.isOpenId&&!!t.id_token;await this._processClaims(t,!1,o),i.debug("claims processed")}validateSignoutResponse(t,e){const n=this._logger.create("validateSignoutResponse");if(e.id!==t.state&&n.throw(new Error("State does not match")),n.debug("state validated"),t.userState=e.data,t.error)throw n.warn("Response was error",t.error),new Qh(t)}_processSigninState(t,e){var n;const r=this._logger.create("_processSigninState");if(e.id!==t.state&&r.throw(new Error("State does not match")),e.client_id||r.throw(new Error("No client_id on state")),e.authority||r.throw(new Error("No authority on state")),this._settings.authority!==e.authority&&r.throw(new Error("authority mismatch on settings vs. signin state")),this._settings.client_id&&this._settings.client_id!==e.client_id&&r.throw(new Error("client_id mismatch on settings vs. signin state")),r.debug("state validated"),t.userState=e.data,t.url_state=e.url_state,(n=t.scope)!=null||(t.scope=e.scope),t.error)throw r.warn("Response was error",t.error),new Qh(t);e.code_verifier&&!t.code&&r.throw(new Error("Expected code in response"))}async _processClaims(t,e=!1,n=!0){const r=this._logger.create("_processClaims");if(t.profile=this._claimsService.filterProtocolClaims(t.profile),e||!this._settings.loadUserInfo||!t.access_token){r.debug("not loading user info");return}r.debug("loading user info");const i=await this._userInfoService.getClaims(t.access_token);r.debug("user info claims received from user info endpoint"),n&&i.sub!==t.profile.sub&&r.throw(new Error("subject from UserInfo response does not match subject in ID Token")),t.profile=this._claimsService.mergeClaims(t.profile,this._claimsService.filterProtocolClaims(i)),r.debug("user info claims received, updated profile:",t.profile)}async _processCode(t,e){const n=this._logger.create("_processCode");if(t.code){n.debug("Validating code");const r=await this._tokenClient.exchangeCode({client_id:e.client_id,client_secret:e.client_secret,code:t.code,redirect_uri:e.redirect_uri,code_verifier:e.code_verifier,...e.extraTokenParams});Object.assign(t,r)}else n.debug("No code to process")}_validateIdTokenAttributes(t,e){var n;const r=this._logger.create("_validateIdTokenAttributes");r.debug("decoding ID Token JWT");const i=NL.decode((n=t.id_token)!=null?n:"");if(i.sub||r.throw(new Error("ID Token is missing a subject claim")),e){const o=NL.decode(e);i.sub!==o.sub&&r.throw(new Error("sub in id_token does not match current sub")),i.auth_time&&i.auth_time!==o.auth_time&&r.throw(new Error("auth_time in id_token does not match original auth_time")),i.azp&&i.azp!==o.azp&&r.throw(new Error("azp in id_token does not match original azp")),!i.azp&&o.azp&&r.throw(new Error("azp not in id_token, but present in original id_token"))}t.profile=i}},Yg=class{constructor(t){this.id=t.id||Ml.generateUUIDv4(),this.data=t.data,t.created&&t.created>0?this.created=t.created:this.created=ts.getEpochTime(),this.request_type=t.request_type,this.url_state=t.url_state}toStorageString(){return new Rt("State").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,url_state:this.url_state})}static fromStorageString(t){return Rt.createStatic("State","fromStorageString"),new Yg(JSON.parse(t))}static async clearStaleState(t,e){const n=Rt.createStatic("State","clearStaleState"),r=ts.getEpochTime()-e,i=await t.getAllKeys();n.debug("got keys",i);for(let o=0;oy.searchParams.append("resource",_));for(const[b,_]of Object.entries({response_mode:s,...v,...p}))_!=null&&y.searchParams.append(b,_.toString());this.url=y.href}},cNe="openid",OA=class{constructor(t){if(this.access_token="",this.token_type="",this.profile={},this.state=t.get("state"),this.session_state=t.get("session_state"),this.state){const e=decodeURIComponent(this.state).split(jL);this.state=e[0],e.length>1&&(this.url_state=e.slice(1).join(jL))}this.error=t.get("error"),this.error_description=t.get("error_description"),this.error_uri=t.get("error_uri"),this.code=t.get("code")}get expires_in(){if(this.expires_at!==void 0)return this.expires_at-ts.getEpochTime()}set expires_in(t){typeof t=="string"&&(t=Number(t)),t!==void 0&&t>=0&&(this.expires_at=Math.floor(t)+ts.getEpochTime())}get isOpenId(){var t;return((t=this.scope)==null?void 0:t.split(" ").includes(cNe))||!!this.id_token}},uNe=class{constructor({url:t,state_data:e,id_token_hint:n,post_logout_redirect_uri:r,extraQueryParams:i,request_type:o,client_id:a}){if(this._logger=new Rt("SignoutRequest"),!t)throw this._logger.error("ctor: No url passed"),new Error("url");const s=new URL(t);n&&s.searchParams.append("id_token_hint",n),a&&s.searchParams.append("client_id",a),r&&(s.searchParams.append("post_logout_redirect_uri",r),e&&(this.state=new Yg({data:e,request_type:o}),s.searchParams.append("state",this.state.id)));for(const[l,c]of Object.entries({...i}))c!=null&&s.searchParams.append(l,c.toString());this.url=s.href}},fNe=class{constructor(t){this.state=t.get("state"),this.error=t.get("error"),this.error_description=t.get("error_description"),this.error_uri=t.get("error_uri")}},dNe=["nbf","jti","auth_time","nonce","acr","amr","azp","at_hash"],hNe=["sub","iss","aud","exp","iat"],pNe=class{constructor(t){this._settings=t,this._logger=new Rt("ClaimsService")}filterProtocolClaims(t){const e={...t};if(this._settings.filterProtocolClaims){let n;Array.isArray(this._settings.filterProtocolClaims)?n=this._settings.filterProtocolClaims:n=dNe;for(const r of n)hNe.includes(r)||delete e[r]}return e}mergeClaims(t,e){const n={...t};for(const[r,i]of Object.entries(e))for(const o of Array.isArray(i)?i:[i]){const a=n[r];a===void 0?n[r]=o:Array.isArray(a)?a.includes(o)||a.push(o):n[r]!==o&&(typeof o=="object"&&this._settings.mergeClaims?n[r]=this.mergeClaims(a,o):n[r]=[a,o])}return n}},mNe=class{constructor(t,e){this._logger=new Rt("OidcClient"),this.settings=t instanceof BL?t:new BL(t),this.metadataService=e??new J3e(this.settings),this._claimsService=new pNe(this.settings),this._validator=new sNe(this.settings,this.metadataService,this._claimsService),this._tokenClient=new wie(this.settings,this.metadataService)}async createSigninRequest({state:t,request:e,request_uri:n,request_type:r,id_token_hint:i,login_hint:o,skipUserInfo:a,nonce:s,url_state:l,response_type:c=this.settings.response_type,scope:u=this.settings.scope,redirect_uri:f=this.settings.redirect_uri,prompt:d=this.settings.prompt,display:h=this.settings.display,max_age:p=this.settings.max_age,ui_locales:m=this.settings.ui_locales,acr_values:g=this.settings.acr_values,resource:v=this.settings.resource,response_mode:y=this.settings.response_mode,extraQueryParams:x=this.settings.extraQueryParams,extraTokenParams:b=this.settings.extraTokenParams}){const _=this._logger.create("createSigninRequest");if(c!=="code")throw new Error("Only the Authorization Code flow (with PKCE) is supported");const S=await this.metadataService.getAuthorizationEndpoint();_.debug("Received authorization endpoint",S);const O=new lNe({url:S,authority:this.settings.authority,client_id:this.settings.client_id,redirect_uri:f,response_type:c,scope:u,state_data:t,url_state:l,prompt:d,display:h,max_age:p,ui_locales:m,id_token_hint:i,login_hint:o,acr_values:g,resource:v,request:e,request_uri:n,extraQueryParams:x,extraTokenParams:b,request_type:r,response_mode:y,client_secret:this.settings.client_secret,skipUserInfo:a,nonce:s,disablePKCE:this.settings.disablePKCE});await this.clearStaleState();const C=O.state;return await this.settings.stateStore.set(C.id,C.toStorageString()),O}async readSigninResponseState(t,e=!1){const n=this._logger.create("readSigninResponseState"),r=new OA(FL.readParams(t,this.settings.response_mode));if(!r.state)throw n.throw(new Error("No state in response")),null;const i=await this.settings.stateStore[e?"remove":"get"](r.state);if(!i)throw n.throw(new Error("No matching state found in storage")),null;return{state:C5.fromStorageString(i),response:r}}async processSigninResponse(t){const e=this._logger.create("processSigninResponse"),{state:n,response:r}=await this.readSigninResponseState(t,!0);return e.debug("received state from storage; validating response"),await this._validator.validateSigninResponse(r,n),r}async processResourceOwnerPasswordCredentials({username:t,password:e,skipUserInfo:n=!1,extraTokenParams:r={}}){const i=await this._tokenClient.exchangeCredentials({username:t,password:e,...r}),o=new OA(new URLSearchParams);return Object.assign(o,i),await this._validator.validateCredentialsResponse(o,n),o}async useRefreshToken({state:t,timeoutInSeconds:e}){var n;const r=this._logger.create("useRefreshToken");let i;if(this.settings.refreshTokenAllowedScope===void 0)i=t.scope;else{const s=this.settings.refreshTokenAllowedScope.split(" ");i=(((n=t.scope)==null?void 0:n.split(" "))||[]).filter(c=>s.includes(c)).join(" ")}const o=await this._tokenClient.exchangeRefreshToken({refresh_token:t.refresh_token,resource:t.resource,scope:i,timeoutInSeconds:e}),a=new OA(new URLSearchParams);return Object.assign(a,o),r.debug("validating response",a),await this._validator.validateRefreshResponse(a,{...t,scope:i}),a}async createSignoutRequest({state:t,id_token_hint:e,client_id:n,request_type:r,post_logout_redirect_uri:i=this.settings.post_logout_redirect_uri,extraQueryParams:o=this.settings.extraQueryParams}={}){const a=this._logger.create("createSignoutRequest"),s=await this.metadataService.getEndSessionEndpoint();if(!s)throw a.throw(new Error("No end session endpoint")),null;a.debug("Received end session endpoint",s),!n&&i&&!e&&(n=this.settings.client_id);const l=new uNe({url:s,id_token_hint:e,client_id:n,post_logout_redirect_uri:i,state_data:t,extraQueryParams:o,request_type:r});await this.clearStaleState();const c=l.state;return c&&(a.debug("Signout request has state to persist"),await this.settings.stateStore.set(c.id,c.toStorageString())),l}async readSignoutResponseState(t,e=!1){const n=this._logger.create("readSignoutResponseState"),r=new fNe(FL.readParams(t,this.settings.response_mode));if(!r.state){if(n.debug("No state in response"),r.error)throw n.warn("Response was error:",r.error),new Qh(r);return{state:void 0,response:r}}const i=await this.settings.stateStore[e?"remove":"get"](r.state);if(!i)throw n.throw(new Error("No matching state found in storage")),null;return{state:Yg.fromStorageString(i),response:r}}async processSignoutResponse(t){const e=this._logger.create("processSignoutResponse"),{state:n,response:r}=await this.readSignoutResponseState(t,!0);return n?(e.debug("Received state from storage; validating response"),this._validator.validateSignoutResponse(r,n)):e.debug("No state from storage; skipping response validation"),r}clearStaleState(){return this._logger.create("clearStaleState"),Yg.clearStaleState(this.settings.stateStore,this.settings.staleStateAgeInSeconds)}async revokeToken(t,e){return this._logger.create("revokeToken"),await this._tokenClient.revoke({token:t,token_type_hint:e})}},gNe=class{constructor(t){this._userManager=t,this._logger=new Rt("SessionMonitor"),this._start=async e=>{const n=e.session_state;if(!n)return;const r=this._logger.create("_start");if(e.profile?(this._sub=e.profile.sub,this._sid=e.profile.sid,r.debug("session_state",n,", sub",this._sub)):(this._sub=void 0,this._sid=void 0,r.debug("session_state",n,", anonymous user")),this._checkSessionIFrame){this._checkSessionIFrame.start(n);return}try{const i=await this._userManager.metadataService.getCheckSessionIframe();if(i){r.debug("initializing check session iframe");const o=this._userManager.settings.client_id,a=this._userManager.settings.checkSessionIntervalInSeconds,s=this._userManager.settings.stopCheckSessionOnError,l=new Z3e(this._callback,o,i,a,s);await l.load(),this._checkSessionIFrame=l,l.start(n)}else r.warn("no check session iframe found in the metadata")}catch(i){r.error("Error from getCheckSessionIframe:",i instanceof Error?i.message:i)}},this._stop=()=>{const e=this._logger.create("_stop");if(this._sub=void 0,this._sid=void 0,this._checkSessionIFrame&&this._checkSessionIFrame.stop(),this._userManager.settings.monitorAnonymousSession){const n=setInterval(async()=>{clearInterval(n);try{const r=await this._userManager.querySessionStatus();if(r){const i={session_state:r.session_state,profile:r.sub&&r.sid?{sub:r.sub,sid:r.sid}:null};this._start(i)}}catch(r){e.error("error from querySessionStatus",r instanceof Error?r.message:r)}},1e3)}},this._callback=async()=>{const e=this._logger.create("_callback");try{const n=await this._userManager.querySessionStatus();let r=!0;n&&this._checkSessionIFrame?n.sub===this._sub?(r=!1,this._checkSessionIFrame.start(n.session_state),n.sid===this._sid?e.debug("same sub still logged in at OP, restarting check session iframe; session_state",n.session_state):(e.debug("same sub still logged in at OP, session state has changed, restarting check session iframe; session_state",n.session_state),this._userManager.events._raiseUserSessionChanged())):e.debug("different subject signed into OP",n.sub):e.debug("subject no longer signed into OP"),r?this._sub?this._userManager.events._raiseUserSignedOut():this._userManager.events._raiseUserSignedIn():e.debug("no change in session detected, no event to raise")}catch(n){this._sub&&(e.debug("Error calling queryCurrentSigninSession; raising signed out event",n),this._userManager.events._raiseUserSignedOut())}},t||this._logger.throw(new Error("No user manager passed")),this._userManager.events.addUserLoaded(this._start),this._userManager.events.addUserUnloaded(this._stop),this._init().catch(e=>{this._logger.error(e)})}async _init(){this._logger.create("_init");const t=await this._userManager.getUser();if(t)this._start(t);else if(this._userManager.settings.monitorAnonymousSession){const e=await this._userManager.querySessionStatus();if(e){const n={session_state:e.session_state,profile:e.sub&&e.sid?{sub:e.sub,sid:e.sid}:null};this._start(n)}}}},OC=class{constructor(t){var e;this.id_token=t.id_token,this.session_state=(e=t.session_state)!=null?e:null,this.access_token=t.access_token,this.refresh_token=t.refresh_token,this.token_type=t.token_type,this.scope=t.scope,this.profile=t.profile,this.expires_at=t.expires_at,this.state=t.userState,this.url_state=t.url_state}get expires_in(){if(this.expires_at!==void 0)return this.expires_at-ts.getEpochTime()}set expires_in(t){t!==void 0&&(this.expires_at=Math.floor(t)+ts.getEpochTime())}get expired(){const t=this.expires_in;if(t!==void 0)return t<=0}get scopes(){var t,e;return(e=(t=this.scope)==null?void 0:t.split(" "))!=null?e:[]}toStorageString(){return new Rt("User").create("toStorageString"),JSON.stringify({id_token:this.id_token,session_state:this.session_state,access_token:this.access_token,refresh_token:this.refresh_token,token_type:this.token_type,scope:this.scope,profile:this.profile,expires_at:this.expires_at})}static fromStorageString(t){return Rt.createStatic("User","fromStorageString"),new OC(JSON.parse(t))}},Q8="oidc-client",Sie=class{constructor(){this._abort=new tf("Window navigation aborted"),this._disposeHandlers=new Set,this._window=null}async navigate(t){const e=this._logger.create("navigate");if(!this._window)throw new Error("Attempted to navigate on a disposed window");e.debug("setting URL in window"),this._window.location.replace(t.url);const{url:n,keepOpen:r}=await new Promise((i,o)=>{const a=s=>{var l;const c=s.data,u=(l=t.scriptOrigin)!=null?l:window.location.origin;if(!(s.origin!==u||(c==null?void 0:c.source)!==Q8)){try{const f=FL.readParams(c.url,t.response_mode).get("state");if(f||e.warn("no state found in response url"),s.source!==this._window&&f!==t.state)return}catch{this._dispose(),o(new Error("Invalid response from window"))}i(c)}};window.addEventListener("message",a,!1),this._disposeHandlers.add(()=>window.removeEventListener("message",a,!1)),this._disposeHandlers.add(this._abort.addHandler(s=>{this._dispose(),o(s)}))});return e.debug("got response from window"),this._dispose(),r||this.close(),{url:n}}_dispose(){this._logger.create("_dispose");for(const t of this._disposeHandlers)t();this._disposeHandlers.clear()}static _notifyParent(t,e,n=!1,r=window.location.origin){t.postMessage({source:Q8,url:e,keepOpen:n},r)}},Oie={location:!1,toolbar:!1,height:640,closePopupWindowAfterInSeconds:-1},Cie="_blank",vNe=60,yNe=2,Tie=10,xNe=class extends BL{constructor(t){const{popup_redirect_uri:e=t.redirect_uri,popup_post_logout_redirect_uri:n=t.post_logout_redirect_uri,popupWindowFeatures:r=Oie,popupWindowTarget:i=Cie,redirectMethod:o="assign",redirectTarget:a="self",iframeNotifyParentOrigin:s=t.iframeNotifyParentOrigin,iframeScriptOrigin:l=t.iframeScriptOrigin,silent_redirect_uri:c=t.redirect_uri,silentRequestTimeoutInSeconds:u=Tie,automaticSilentRenew:f=!0,validateSubOnSilentRenew:d=!0,includeIdTokenInSilentRenew:h=!1,monitorSession:p=!1,monitorAnonymousSession:m=!1,checkSessionIntervalInSeconds:g=yNe,query_status_response_type:v="code",stopCheckSessionOnError:y=!0,revokeTokenTypes:x=["access_token","refresh_token"],revokeTokensOnSignout:b=!1,includeIdTokenInSilentSignout:_=!1,accessTokenExpiringNotificationTimeInSeconds:S=vNe,userStore:O}=t;if(super(t),this.popup_redirect_uri=e,this.popup_post_logout_redirect_uri=n,this.popupWindowFeatures=r,this.popupWindowTarget=i,this.redirectMethod=o,this.redirectTarget=a,this.iframeNotifyParentOrigin=s,this.iframeScriptOrigin=l,this.silent_redirect_uri=c,this.silentRequestTimeoutInSeconds=u,this.automaticSilentRenew=f,this.validateSubOnSilentRenew=d,this.includeIdTokenInSilentRenew=h,this.monitorSession=p,this.monitorAnonymousSession=m,this.checkSessionIntervalInSeconds=g,this.stopCheckSessionOnError=y,this.query_status_response_type=v,this.revokeTokenTypes=x,this.revokeTokensOnSignout=b,this.includeIdTokenInSilentSignout=_,this.accessTokenExpiringNotificationTimeInSeconds=S,O)this.userStore=O;else{const C=typeof window<"u"?window.sessionStorage:new bie;this.userStore=new _ie({store:C})}}},zL=class extends Sie{constructor({silentRequestTimeoutInSeconds:t=Tie}){super(),this._logger=new Rt("IFrameWindow"),this._timeoutInSeconds=t,this._frame=zL.createHiddenIframe(),this._window=this._frame.contentWindow}static createHiddenIframe(){const t=window.document.createElement("iframe");return t.style.visibility="hidden",t.style.position="fixed",t.style.left="-1000px",t.style.top="0",t.width="0",t.height="0",window.document.body.appendChild(t),t}async navigate(t){this._logger.debug("navigate: Using timeout of:",this._timeoutInSeconds);const e=setTimeout(()=>this._abort.raise(new S5("IFrame timed out without a response")),this._timeoutInSeconds*1e3);return this._disposeHandlers.add(()=>clearTimeout(e)),await super.navigate(t)}close(){var t;this._frame&&(this._frame.parentNode&&(this._frame.addEventListener("load",e=>{var n;const r=e.target;(n=r.parentNode)==null||n.removeChild(r),this._abort.raise(new Error("IFrame removed from DOM"))},!0),(t=this._frame.contentWindow)==null||t.location.replace("about:blank")),this._frame=null),this._window=null}static notifyParent(t,e){return super._notifyParent(window.parent,t,!1,e)}},bNe=class{constructor(t){this._settings=t,this._logger=new Rt("IFrameNavigator")}async prepare({silentRequestTimeoutInSeconds:t=this._settings.silentRequestTimeoutInSeconds}){return new zL({silentRequestTimeoutInSeconds:t})}async callback(t){this._logger.create("callback"),zL.notifyParent(t,this._settings.iframeNotifyParentOrigin)}},_Ne=500,wNe=1e3,Y8=class extends Sie{constructor({popupWindowTarget:t=Cie,popupWindowFeatures:e={}}){super(),this._logger=new Rt("PopupWindow");const n=X8.center({...Oie,...e});this._window=window.open(void 0,t,X8.serialize(n)),e.closePopupWindowAfterInSeconds&&e.closePopupWindowAfterInSeconds>0&&setTimeout(()=>{if(!this._window||typeof this._window.closed!="boolean"||this._window.closed){this._abort.raise(new Error("Popup blocked by user"));return}this.close()},e.closePopupWindowAfterInSeconds*wNe)}async navigate(t){var e;(e=this._window)==null||e.focus();const n=setInterval(()=>{(!this._window||this._window.closed)&&this._abort.raise(new Error("Popup closed by user"))},_Ne);return this._disposeHandlers.add(()=>clearInterval(n)),await super.navigate(t)}close(){this._window&&(this._window.closed||(this._window.close(),this._abort.raise(new Error("Popup closed")))),this._window=null}static notifyOpener(t,e){if(!window.opener)throw new Error("No window.opener. Can't complete notification.");return super._notifyParent(window.opener,t,e)}},SNe=class{constructor(t){this._settings=t,this._logger=new Rt("PopupNavigator")}async prepare({popupWindowFeatures:t=this._settings.popupWindowFeatures,popupWindowTarget:e=this._settings.popupWindowTarget}){return new Y8({popupWindowFeatures:t,popupWindowTarget:e})}async callback(t,{keepOpen:e=!1}){this._logger.create("callback"),Y8.notifyOpener(t,e)}},ONe=class{constructor(t){this._settings=t,this._logger=new Rt("RedirectNavigator")}async prepare({redirectMethod:t=this._settings.redirectMethod,redirectTarget:e=this._settings.redirectTarget}){var n;this._logger.create("prepare");let r=window.self;e==="top"&&(r=(n=window.top)!=null?n:window.self);const i=r.location[t].bind(r.location);let o;return{navigate:async a=>{this._logger.create("navigate");const s=new Promise((l,c)=>{o=c});return i(a.url),await s},close:()=>{this._logger.create("close"),o==null||o(new Error("Redirect aborted")),r.stop()}}}async callback(){}},CNe=class extends K3e{constructor(t){super({expiringNotificationTimeInSeconds:t.accessTokenExpiringNotificationTimeInSeconds}),this._logger=new Rt("UserManagerEvents"),this._userLoaded=new tf("User loaded"),this._userUnloaded=new tf("User unloaded"),this._silentRenewError=new tf("Silent renew error"),this._userSignedIn=new tf("User signed in"),this._userSignedOut=new tf("User signed out"),this._userSessionChanged=new tf("User session changed")}load(t,e=!0){super.load(t),e&&this._userLoaded.raise(t)}unload(){super.unload(),this._userUnloaded.raise()}addUserLoaded(t){return this._userLoaded.addHandler(t)}removeUserLoaded(t){return this._userLoaded.removeHandler(t)}addUserUnloaded(t){return this._userUnloaded.addHandler(t)}removeUserUnloaded(t){return this._userUnloaded.removeHandler(t)}addSilentRenewError(t){return this._silentRenewError.addHandler(t)}removeSilentRenewError(t){return this._silentRenewError.removeHandler(t)}_raiseSilentRenewError(t){this._silentRenewError.raise(t)}addUserSignedIn(t){return this._userSignedIn.addHandler(t)}removeUserSignedIn(t){this._userSignedIn.removeHandler(t)}_raiseUserSignedIn(){this._userSignedIn.raise()}addUserSignedOut(t){return this._userSignedOut.addHandler(t)}removeUserSignedOut(t){this._userSignedOut.removeHandler(t)}_raiseUserSignedOut(){this._userSignedOut.raise()}addUserSessionChanged(t){return this._userSessionChanged.addHandler(t)}removeUserSessionChanged(t){this._userSessionChanged.removeHandler(t)}_raiseUserSessionChanged(){this._userSessionChanged.raise()}},TNe=class{constructor(t){this._userManager=t,this._logger=new Rt("SilentRenewService"),this._isStarted=!1,this._retryTimer=new ts("Retry Silent Renew"),this._tokenExpiring=async()=>{const e=this._logger.create("_tokenExpiring");try{await this._userManager.signinSilent(),e.debug("silent token renewal successful")}catch(n){if(n instanceof S5){e.warn("ErrorTimeout from signinSilent:",n,"retry in 5s"),this._retryTimer.init(5);return}e.error("Error from signinSilent:",n),this._userManager.events._raiseSilentRenewError(n)}}}async start(){const t=this._logger.create("start");if(!this._isStarted){this._isStarted=!0,this._userManager.events.addAccessTokenExpiring(this._tokenExpiring),this._retryTimer.addHandler(this._tokenExpiring);try{await this._userManager.getUser()}catch(e){t.error("getUser error",e)}}}stop(){this._isStarted&&(this._retryTimer.cancel(),this._retryTimer.removeHandler(this._tokenExpiring),this._userManager.events.removeAccessTokenExpiring(this._tokenExpiring),this._isStarted=!1)}},ENe=class{constructor(t,e){this.refresh_token=t.refresh_token,this.id_token=t.id_token,this.session_state=t.session_state,this.scope=t.scope,this.profile=t.profile,this.resource=e,this.data=t.state}},PNe=class{constructor(t,e,n,r){this._logger=new Rt("UserManager"),this.settings=new xNe(t),this._client=new mNe(t),this._redirectNavigator=e??new ONe(this.settings),this._popupNavigator=n??new SNe(this.settings),this._iframeNavigator=r??new bNe(this.settings),this._events=new CNe(this.settings),this._silentRenewService=new TNe(this),this.settings.automaticSilentRenew&&this.startSilentRenew(),this._sessionMonitor=null,this.settings.monitorSession&&(this._sessionMonitor=new gNe(this))}get events(){return this._events}get metadataService(){return this._client.metadataService}async getUser(){const t=this._logger.create("getUser"),e=await this._loadUser();return e?(t.info("user loaded"),this._events.load(e,!1),e):(t.info("user not found in storage"),null)}async removeUser(){const t=this._logger.create("removeUser");await this.storeUser(null),t.info("user removed from storage"),this._events.unload()}async signinRedirect(t={}){this._logger.create("signinRedirect");const{redirectMethod:e,...n}=t,r=await this._redirectNavigator.prepare({redirectMethod:e});await this._signinStart({request_type:"si:r",...n},r)}async signinRedirectCallback(t=window.location.href){const e=this._logger.create("signinRedirectCallback"),n=await this._signinEnd(t);return n.profile&&n.profile.sub?e.info("success, signed in subject",n.profile.sub):e.info("no subject"),n}async signinResourceOwnerCredentials({username:t,password:e,skipUserInfo:n=!1}){const r=this._logger.create("signinResourceOwnerCredential"),i=await this._client.processResourceOwnerPasswordCredentials({username:t,password:e,skipUserInfo:n,extraTokenParams:this.settings.extraTokenParams});r.debug("got signin response");const o=await this._buildUser(i);return o.profile&&o.profile.sub?r.info("success, signed in subject",o.profile.sub):r.info("no subject"),o}async signinPopup(t={}){const e=this._logger.create("signinPopup"),{popupWindowFeatures:n,popupWindowTarget:r,...i}=t,o=this.settings.popup_redirect_uri;o||e.throw(new Error("No popup_redirect_uri configured"));const a=await this._popupNavigator.prepare({popupWindowFeatures:n,popupWindowTarget:r}),s=await this._signin({request_type:"si:p",redirect_uri:o,display:"popup",...i},a);return s&&(s.profile&&s.profile.sub?e.info("success, signed in subject",s.profile.sub):e.info("no subject")),s}async signinPopupCallback(t=window.location.href,e=!1){const n=this._logger.create("signinPopupCallback");await this._popupNavigator.callback(t,{keepOpen:e}),n.info("success")}async signinSilent(t={}){var e;const n=this._logger.create("signinSilent"),{silentRequestTimeoutInSeconds:r,resource:i,...o}=t;let a=await this._loadUser();if(a!=null&&a.refresh_token){n.debug("using refresh token");const u=new ENe(a,i);return await this._useRefreshToken(u)}const s=this.settings.silent_redirect_uri;s||n.throw(new Error("No silent_redirect_uri configured"));let l;a&&this.settings.validateSubOnSilentRenew&&(n.debug("subject prior to silent renew:",a.profile.sub),l=a.profile.sub);const c=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:r});return a=await this._signin({request_type:"si:s",redirect_uri:s,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?a==null?void 0:a.id_token:void 0,...o},c,l),a&&((e=a.profile)!=null&&e.sub?n.info("success, signed in subject",a.profile.sub):n.info("no subject")),a}async _useRefreshToken(t){const e=await this._client.useRefreshToken({state:t,timeoutInSeconds:this.settings.silentRequestTimeoutInSeconds}),n=new OC({...t,...e});return await this.storeUser(n),this._events.load(n),n}async signinSilentCallback(t=window.location.href){const e=this._logger.create("signinSilentCallback");await this._iframeNavigator.callback(t),e.info("success")}async signinCallback(t=window.location.href){const{state:e}=await this._client.readSigninResponseState(t);switch(e.request_type){case"si:r":return await this.signinRedirectCallback(t);case"si:p":return await this.signinPopupCallback(t);case"si:s":return await this.signinSilentCallback(t);default:throw new Error("invalid response_type in state")}}async signoutCallback(t=window.location.href,e=!1){const{state:n}=await this._client.readSignoutResponseState(t);if(n)switch(n.request_type){case"so:r":await this.signoutRedirectCallback(t);break;case"so:p":await this.signoutPopupCallback(t,e);break;case"so:s":await this.signoutSilentCallback(t);break;default:throw new Error("invalid response_type in state")}}async querySessionStatus(t={}){const e=this._logger.create("querySessionStatus"),{silentRequestTimeoutInSeconds:n,...r}=t,i=this.settings.silent_redirect_uri;i||e.throw(new Error("No silent_redirect_uri configured"));const o=await this._loadUser(),a=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:n}),s=await this._signinStart({request_type:"si:s",redirect_uri:i,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?o==null?void 0:o.id_token:void 0,response_type:this.settings.query_status_response_type,scope:"openid",skipUserInfo:!0,...r},a);try{const l=await this._client.processSigninResponse(s.url);return e.debug("got signin response"),l.session_state&&l.profile.sub?(e.info("success for subject",l.profile.sub),{session_state:l.session_state,sub:l.profile.sub,sid:l.profile.sid}):(e.info("success, user not authenticated"),null)}catch(l){if(this.settings.monitorAnonymousSession&&l instanceof Qh)switch(l.error){case"login_required":case"consent_required":case"interaction_required":case"account_selection_required":return e.info("success for anonymous user"),{session_state:l.session_state}}throw l}}async _signin(t,e,n){const r=await this._signinStart(t,e);return await this._signinEnd(r.url,n)}async _signinStart(t,e){const n=this._logger.create("_signinStart");try{const r=await this._client.createSigninRequest(t);return n.debug("got signin request"),await e.navigate({url:r.url,state:r.state.id,response_mode:r.state.response_mode,scriptOrigin:this.settings.iframeScriptOrigin})}catch(r){throw n.debug("error after preparing navigator, closing navigator window"),e.close(),r}}async _signinEnd(t,e){const n=this._logger.create("_signinEnd"),r=await this._client.processSigninResponse(t);return n.debug("got signin response"),await this._buildUser(r,e)}async _buildUser(t,e){const n=this._logger.create("_buildUser"),r=new OC(t);if(e){if(e!==r.profile.sub)throw n.debug("current user does not match user returned from signin. sub from signin:",r.profile.sub),new Qh({...t,error:"login_required"});n.debug("current user matches user returned from signin")}return await this.storeUser(r),n.debug("user stored"),this._events.load(r),r}async signoutRedirect(t={}){const e=this._logger.create("signoutRedirect"),{redirectMethod:n,...r}=t,i=await this._redirectNavigator.prepare({redirectMethod:n});await this._signoutStart({request_type:"so:r",post_logout_redirect_uri:this.settings.post_logout_redirect_uri,...r},i),e.info("success")}async signoutRedirectCallback(t=window.location.href){const e=this._logger.create("signoutRedirectCallback"),n=await this._signoutEnd(t);return e.info("success"),n}async signoutPopup(t={}){const e=this._logger.create("signoutPopup"),{popupWindowFeatures:n,popupWindowTarget:r,...i}=t,o=this.settings.popup_post_logout_redirect_uri,a=await this._popupNavigator.prepare({popupWindowFeatures:n,popupWindowTarget:r});await this._signout({request_type:"so:p",post_logout_redirect_uri:o,state:o==null?void 0:{},...i},a),e.info("success")}async signoutPopupCallback(t=window.location.href,e=!1){const n=this._logger.create("signoutPopupCallback");await this._popupNavigator.callback(t,{keepOpen:e}),n.info("success")}async _signout(t,e){const n=await this._signoutStart(t,e);return await this._signoutEnd(n.url)}async _signoutStart(t={},e){var n;const r=this._logger.create("_signoutStart");try{const i=await this._loadUser();r.debug("loaded current user from storage"),this.settings.revokeTokensOnSignout&&await this._revokeInternal(i);const o=t.id_token_hint||i&&i.id_token;o&&(r.debug("setting id_token_hint in signout request"),t.id_token_hint=o),await this.removeUser(),r.debug("user removed, creating signout request");const a=await this._client.createSignoutRequest(t);return r.debug("got signout request"),await e.navigate({url:a.url,state:(n=a.state)==null?void 0:n.id,scriptOrigin:this.settings.iframeScriptOrigin})}catch(i){throw r.debug("error after preparing navigator, closing navigator window"),e.close(),i}}async _signoutEnd(t){const e=this._logger.create("_signoutEnd"),n=await this._client.processSignoutResponse(t);return e.debug("got signout response"),n}async signoutSilent(t={}){var e;const n=this._logger.create("signoutSilent"),{silentRequestTimeoutInSeconds:r,...i}=t,o=this.settings.includeIdTokenInSilentSignout?(e=await this._loadUser())==null?void 0:e.id_token:void 0,a=this.settings.popup_post_logout_redirect_uri,s=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:r});await this._signout({request_type:"so:s",post_logout_redirect_uri:a,id_token_hint:o,...i},s),n.info("success")}async signoutSilentCallback(t=window.location.href){const e=this._logger.create("signoutSilentCallback");await this._iframeNavigator.callback(t),e.info("success")}async revokeTokens(t){const e=await this._loadUser();await this._revokeInternal(e,t)}async _revokeInternal(t,e=this.settings.revokeTokenTypes){const n=this._logger.create("_revokeInternal");if(!t)return;const r=e.filter(i=>typeof t[i]=="string");if(!r.length){n.debug("no need to revoke due to no token(s)");return}for(const i of r)await this._client.revokeToken(t[i],i),n.info(`${i} revoked successfully`),i!=="access_token"&&(t[i]=null);await this.storeUser(t),n.debug("user stored"),this._events.load(t)}startSilentRenew(){this._logger.create("startSilentRenew"),this._silentRenewService.start()}stopSilentRenew(){this._silentRenewService.stop()}get _userStoreKey(){return`user:${this.settings.authority}:${this.settings.client_id}`}async _loadUser(){const t=this._logger.create("_loadUser"),e=await this.settings.userStore.get(this._userStoreKey);return e?(t.debug("user storageString loaded"),OC.fromStorageString(e)):(t.debug("no user storageString"),null)}async storeUser(t){const e=this._logger.create("storeUser");if(t){e.debug("storing user");const n=t.toStorageString();await this.settings.userStore.set(this._userStoreKey,n)}else this._logger.debug("removing user"),await this.settings.userStore.remove(this._userStoreKey)}async clearStaleState(){await this._client.clearStaleState()}},T5=ue.createContext(void 0);T5.displayName="AuthContext";var MNe={isLoading:!0,isAuthenticated:!1},kNe=(t,e)=>{switch(e.type){case"INITIALISED":case"USER_LOADED":return{...t,user:e.user,isLoading:!1,isAuthenticated:e.user?!e.user.expired:!1,error:void 0};case"USER_UNLOADED":return{...t,user:void 0,isAuthenticated:!1};case"NAVIGATOR_INIT":return{...t,isLoading:!0,activeNavigator:e.method};case"NAVIGATOR_CLOSE":return{...t,isLoading:!1,activeNavigator:void 0};case"ERROR":return{...t,isLoading:!1,error:e.error};default:return{...t,isLoading:!1,error:new Error(`unknown type ${e.type}`)}}},ANe=(t=window.location)=>{let e=new URLSearchParams(t.search);return!!((e.get("code")||e.get("error"))&&e.get("state")||(e=new URLSearchParams(t.hash.replace("#","?")),(e.get("code")||e.get("error"))&&e.get("state")))},RNe=t=>e=>e instanceof Error?e:new Error(t),INe=RNe("Login failed"),DNe=["clearStaleState","querySessionStatus","revokeTokens","startSilentRenew","stopSilentRenew"],LNe=["signinPopup","signinSilent","signinRedirect","signinResourceOwnerCredentials","signoutPopup","signoutRedirect","signoutSilent"],CA=t=>()=>{throw new Error(`UserManager#${t} was called from an unsupported context. If this is a server-rendered page, defer this call with useEffect() or pass a custom UserManager implementation.`)},$Ne=typeof window>"u"?null:PNe,NNe=t=>{const{children:e,onSigninCallback:n,skipSigninCallback:r,onRemoveUser:i,onSignoutRedirect:o,onSignoutPopup:a,implementation:s=$Ne,userManager:l,...c}=t,[u]=M.useState(()=>l??(s?new s(c):{settings:c})),[f,d]=M.useReducer(kNe,MNe),h=M.useMemo(()=>Object.assign({settings:u.settings,events:u.events},Object.fromEntries(DNe.map(x=>{var b,_;return[x,(_=(b=u[x])==null?void 0:b.bind(u))!=null?_:CA(x)]})),Object.fromEntries(LNe.map(x=>[x,u[x]?async b=>{d({type:"NAVIGATOR_INIT",method:x});try{return await u[x](b)}catch(_){return d({type:"ERROR",error:_}),null}finally{d({type:"NAVIGATOR_CLOSE"})}}:CA(x)]))),[u]),p=M.useRef(!1);M.useEffect(()=>{!u||p.current||(p.current=!0,(async()=>{let x=null;try{ANe()&&!r&&(x=await u.signinCallback(),n&&await n(x)),x=x||await u.getUser(),d({type:"INITIALISED",user:x})}catch(b){d({type:"ERROR",error:INe(b)})}})())},[u,r,n]),M.useEffect(()=>{if(!u)return;const x=S=>{d({type:"USER_LOADED",user:S})};u.events.addUserLoaded(x);const b=()=>{d({type:"USER_UNLOADED"})};u.events.addUserUnloaded(b);const _=S=>{d({type:"ERROR",error:S})};return u.events.addSilentRenewError(_),()=>{u.events.removeUserLoaded(x),u.events.removeUserUnloaded(b),u.events.removeSilentRenewError(_)}},[u]);const m=M.useCallback(u?()=>u.removeUser().then(i):CA("removeUser"),[u,i]),g=M.useCallback(x=>h.signoutRedirect(x).then(o),[h.signoutRedirect,o]),v=M.useCallback(x=>h.signoutPopup(x).then(a),[h.signoutPopup,a]),y=M.useCallback(x=>h.signoutSilent(x),[h.signoutSilent]);return ue.createElement(T5.Provider,{value:{...f,...h,removeUser:m,signoutRedirect:g,signoutPopup:v,signoutSilent:y}},e)},FNe=()=>{const t=ue.useContext(T5);return t||console.warn("AuthProvider context is undefined, please verify you are calling useAuth() as child of a component."),t};const K8="color:green;font-weight:bold;",jNe="color:blue;font-weight:bold;";class BNe{constructor(e){Yt(this,"_languages");Yt(this,"_content");Yt(this,"_locale");const n=Object.getOwnPropertyNames(e.languages);if(n.findIndex(i=>i==="en")<0)throw new Error('Internal error: locale "en" must be included in supported languages');const r={};e.dictionary.forEach((i,o)=>{n.forEach(s=>{if(!i[s])throw new Error(`Internal error: invalid entry at index ${o} in "./resources/lang.json": missing translation for locale: "${s}": ${i}`)});const a=Z8(i.en);r[a]&&console.warn(`Translation already defined for "${i.en}".`),r[a]=i}),this._languages=e.languages,this._content=r,this._locale="en"}get languages(){return this._languages}get locale(){return this._locale}set locale(e){const n=Object.getOwnPropertyNames(this._languages);if(n.findIndex(r=>r===e)<0){const r=e.split("-")[0];if(n.findIndex(i=>i===r)<0){console.error(`No translations found for locale "${e}", staying with "${this._locale}".`);return}else console.warn(`No translations found for locale "${e}", falling back to "${r}".`),e=r}this._locale=e}get(e,n){const r=Z8(e),i=this._content[r];let o;return i?(o=i[this._locale],o||(console.debug(`missing translation of phrase %c${e}`,K8,` for locale %c${this._locale}`,jNe),o=e)):(console.debug(`missing translation for phrase %c${e}`,K8),o=e),n&&Object.keys(n).forEach(a=>{o=o.replace("${"+a+"}",`${n[a]}`)}),o}}const zNe=()=>{let t;return navigator.languages&&navigator.languages.length>0?t=navigator.languages[0]:t=navigator.language||navigator.userLanguage||navigator.browserLanguage||"en",t.split("-")[0]},Z8=t=>t.toLowerCase(),UNe={en:"English",de:"Deutsch",se:"Svenska"},WNe=[{en:"OK",de:"OK",se:"OK"},{en:"Cancel",de:"Abbrechen",se:"Avbryt"},{en:"Save",de:"Speichern",se:"Spara"},{en:"Select",de:"Auswählen",se:"Välj"},{en:"Add",de:"Hinzufügen",se:"Lägg till"},{en:"Edit",de:"Bearbeiten",se:"Redigera"},{en:"Remove",de:"Entfernen",se:"Ta bort"},{en:"Dataset",de:"Datensatz",se:"Dataset"},{en:"Variable",de:"Variable",se:"Variabel"},{en:"My places",de:"Meine Orte",se:"Mina platser"},{en:"Loading places",de:"Lade Orte",se:"Laddar platser"},{en:"Places",de:"Orte",se:"Platser"},{en:"Place",de:"Ort",se:"Plats"},{en:"Time",de:"Zeit",se:"Tid"},{en:"Missing time axis",de:"Fehlende Zeitachse",se:"Saknar tidsaxel"},{en:"Geometry type",de:"Geometry-Typ",se:"Geometri typ"},{en:"Point",de:"Punkt",se:"Punkt"},{en:"Polygon",de:"Polygon",se:"Polygon"},{en:"Circle",de:"Kreis",se:"Cirkel"},{en:"Multi",de:"Multi",se:"Multi"},{en:"Something went wrong.",de:"Irgendetwas lief schief.",se:"Något gick fel."},{en:"Time-Series",de:"Zeitserie",se:"Tidsserier"},{en:"Quantity",de:"Größe",se:"Kvantitet"},{en:"unknown units",de:"unbekannte Einheiten",se:"okända enheter"},{en:"Values",de:"Werte",se:"Värden"},{en:"Start",de:"Start",se:"Start"},{en:"Stop",de:"Stopp",se:"Stopp"},{en:"Please wait...",de:"Bitte warten...",se:"Vänta ..."},{en:"Loading data",de:"Lade Daten",se:"Laddar data"},{en:"Connecting to server",de:"Verbindung zum Server wird hergestellt",se:"Ansluta till servern"},{en:"Cannot reach server",de:"Kann Server nicht erreichen",se:"Kan inte nå servern"},{en:"Language",de:"Sprache",se:"Språk"},{en:"Settings",de:"Einstellungen",se:"Inställningar"},{en:"General",de:"Allgemein",se:"Allmänhet"},{en:"System Information",de:"Systeminformation",se:"Systeminformation"},{en:"version",de:"Version",se:"Version"},{en:"Server",de:"Server",se:"Server"},{en:"Add Server",de:"Server hinzufügen",se:"Lägg till server"},{en:"Edit Server",de:"Server bearbeiten",se:"Redigera server"},{en:"Select Server",de:"Server auswählen",se:"Välj server"},{en:"On",de:"An",se:"På"},{en:"Off",de:"Aus",se:"Av"},{en:"Time interval of the player",de:"Zeitintervall des Abspielers",se:"Spelarens tidsintervall"},{en:"Show chart after adding a place",de:"Diagram anzeigen, nachdem ein Ort hinzugefügt wurde",se:"Visa diagram efter att du har lagt till en plats"},{en:"Calculate standard deviation",de:"Berechne Standardabweichung",se:"Beräkna standardavvikelsen"},{en:"Calculate median instead of mean (disables standard deviation)",de:"Median statt Mittelwert berechnen (deaktiviert Standardabweichung)",se:"Beräkna median istället för medelvärde (inaktiverar standardavvikelse)"},{en:"Minimal number of data points in a time series update",de:"Minimale Anzahl Datenpunkte in einer Zeitreihen-Aktualisierung",se:"Minimalt antal datapunkter i en tidsserieuppdatering"},{en:"Map",de:"Karte",se:"Karta"},{en:"Projection",de:"Projektion",se:"Projektion"},{en:"Geographic",de:"Geografisch",se:"Geografiskt"},{en:"Mercator",de:"Mercator",se:"Mercator"},{en:"Image smoothing",de:"Bildglättung",se:"Bildutjämning"},{en:"Show dataset boundaries",de:"Datensatzgrenzen anzeigen",se:"Visa datauppsättningsgränser"},{en:"Base map",de:"Basiskarte",se:"Grundkarta"},{en:"Hide small values",de:"Kleine Werte ausblenden",se:"Dölja små värden"},{en:"Reverse",de:"Umkehren",se:"Omvänt"},{en:"Color",de:"Farbe",se:"Färg"},{en:"Opacity",de:"Opazität",se:"Opacitet"},{en:"Value Range",de:"Wertebereich",se:"Värdeintervall"},{en:"Assign min/max from color mapping values",de:"Min./Max. aus Farbzuordnungswerten übertragen",se:"Tilldela min/max från färgmappningsvärden"},{en:"Log-scaled",de:"Log-skaliert",se:"Log-skalad"},{en:"Logarithmic scaling",de:"Logarithmische Skalierung",se:"Logaritmisk skalning"},{en:"Others",de:"Andere",se:"Andra"},{en:"Dataset information",de:"Informationen zum Datensatz",se:"Information om dataset"},{en:"Variable information",de:"Informationen zur Variablen",se:"Information om variabeln"},{en:"Place information",de:"Informationen zum Ort",se:"Platsinformation"},{en:"Dimension names",de:"Namen der Dimensionen",se:"Dimensioner namn"},{en:"Dimension data types",de:"Datentypen der Dimensionen",se:"Dimensionsdatatyper"},{en:"Dimension lengths",de:"Länge der Dimensionen",se:"Måttlängder"},{en:"Time chunk size",de:"Zeitblockgröße",se:"Tidsblockstorlek"},{en:"Geographical extent",de:"Geografische Ausdehnung",se:"Geografisk omfattning"},{en:"Spatial reference system",de:"Räumliches Bezugssystem",se:"Rumsligt referenssystem"},{en:"Name",de:"Name",se:"Namn"},{en:"Title",de:"Titel",se:"Titel"},{en:"Units",de:"Einheiten",se:"Enheter"},{en:"Expression",de:"Ausdruck",se:"Uttryck"},{en:"Data type",de:"Datentyp",se:"Datatyp"},{en:"There is no information available for this location.",de:"Zu diesem Ort sind keine keine Informationen vorhanden.",se:"Det finns ingen information tillgänglig för den här platsen."},{en:"Log out",de:"Abmelden",se:"Logga ut"},{en:"Profile",de:"Profil",se:"Profil"},{en:"User Profile",de:"Nutzerprofil",se:"Användarprofil"},{en:"User name",de:"Nutzername",se:"Användarnamn"},{en:"E-mail",de:"E-mail",se:"E-post"},{en:"Nickname",de:"Spitzname",se:"Smeknamn"},{en:"verified",de:"verifiziert",se:"verified"},{en:"not verified",de:"nicht verifiziert",se:"inte verifierad"},{en:"RGB",de:"RGB",se:"RGB"},{en:"Imprint",de:"Impressum",se:"Avtryck"},{en:"User Manual",de:"Benutzerhandbuch",se:"Användarmanual"},{en:"Show time-series diagram",de:"Zeitserien-Diagramm anzeigen",se:"Visa tidsseriediagram"},{en:"Help",de:"Hilfe",se:"Hjälp"},{en:"Copy snapshot of chart to clipboard",de:"Schnappschuss des Diagramms in die Zwischenablage kopieren",se:"Kopiera ögonblicksbild av diagrammet till urklipp"},{en:"Snapshot copied to clipboard",de:"Schnappschuss wurde in die Zwischenablage kopiert",se:"Ögonblicksbild har kopierats till urklipp"},{en:"Error copying snapshot to clipboard",de:"Fehler beim Kopieren des Schnappschusses in die Zwischenablage",se:"Det gick inte att kopiera ögonblicksbilden till urklipp"},{en:"Export data",de:"Daten exportieren",se:"Exportera data"},{en:"Export Settings",de:"Export-Einstellungen",se:"Exportera Inställningar"},{en:"Include time-series data",de:"Zeitseriendaten einschließen",se:"Inkludera tidsseriedata"},{en:"Include places data",de:"Ortsdaten einschließen",se:"Inkludera platsdata"},{en:"File name",de:"Dateiname",se:"Filnamn"},{en:"Separator for time-series data",de:"Trennzeichen für Zeitreihendaten",se:"Separator för tidsseriedata"},{en:"Combine place data in one file",de:"Ortsdaten in einer Datei zusammenfassen",se:"Kombinera platsdata i en fil"},{en:"As ZIP archive",de:"Als ZIP-Archiv",se:"Som ett ZIP-arkiv"},{en:"Download",de:"Herunterladen",se:"Ladda ner"},{en:"Locate place in map",de:"Lokalisiere Ort in Karte",se:"Leta upp plats på kartan"},{en:"Locate dataset in map",de:"Lokalisiere Datensatz in Karte",se:"Leta upp dataset på kartan"},{en:"Open information panel",de:"Informationsfeld öffnen",se:"Öppet informationsfält"},{en:"Select a place in map",de:"Ort in der Karte auswählen",se:"Välj plats på kartan"},{en:"Add a point location in map",de:"Punkt zur Karte hinzufügen",se:"Lägg till punkt på kartan"},{en:"Draw a polygon area in map",de:"Polygonale Fläche in der Karte zeichnen",se:"Rita en polygonal yta på kartan"},{en:"Draw a circular area in map",de:"Kreisförmige Fläche in der Karte zeichnen",se:"Rita ett cirkulärt område på kartan"},{en:"Rename place",de:"Ort umbenennen",se:"Byt namn på plats"},{en:"Remove place",de:"Ort entfernen",se:"Ta bort plats"},{en:"Rename place group",de:"Ortsgruppe umbenennen",se:"Byt namn på platsgrupp"},{en:"Remove places",de:"Orte entfernen",se:"Ta bort platser"},{en:"Show RGB layer instead",de:"Stattdessen RGB-Layer anzeigen",se:"Visa RGB-lager istället"},{en:"Auto-step through times in the dataset",de:"Zeiten im Datensatz automatisch durchlaufen",se:"Kör automatiskt genom tider i dataposten"},{en:"Select time in dataset",de:"Datensatz-Zeit auswählen",se:"Välj tid i dataset"},{en:"Refresh",de:"Aktualisieren",se:"Att uppdatera"},{en:"Accept and continue",de:"Akzeptieren und weiter",se:"Acceptera och fortsätt"},{en:"Leave",de:"Verlassen",se:"Lämna"},{en:"Import places",de:"Orte importieren",se:"Importera platser"},{en:"Text/CSV",de:"Text/CSV",se:"Text/CSV"},{en:"GeoJSON",de:"GeoJSON",se:"GeoJSON"},{en:"WKT",de:"WKT",se:"WKT"},{en:"Enter text or drag & drop a text file.",de:"Text eingeben oder Textdatei per Drag & Drop einfügen.",se:"Skriv in text eller dra och släpp en textfil."},{en:"From File",de:"Aus Datei",se:"Från fil"},{en:"Clear",de:"Löschen",se:"Tömma"},{en:"Options",de:"Optionen",se:"Alternativ"},{en:"Time (UTC, ISO-format)",de:"Zeit (UTC, ISO-Format)",se:"Tid (UTC, ISO-format)"},{en:"Group",de:"Gruppe",se:"Grupp"},{en:"Label",de:"Label",se:"Etikett"},{en:"Time property names",de:"Eigenschaftsnamen für Zeit",se:"Gruppegendomsnamn"},{en:"Group property names",de:"Eigenschaftsnamen für Gruppe",se:"Gruppegendomsnamn"},{en:"Label property names",de:"Eigenschaftsnamen für Label",se:"Etikett egendomsnamn"},{en:"Group prefix (used as fallback)",de:"Gruppen-Präfix (als Fallback verwendet)",se:"Gruppprefix (används som reserv)"},{en:"Label prefix (used as fallback)",de:"Label-Präfix (als Fallback verwendet)",se:"Etikettprefix (används som reserv)"},{en:"X/longitude column names",de:"Spaltennamen für y/Längengrad",se:"X/longitud kolumnnamn"},{en:"Y/latitude column names",de:"Spaltennamen für y/Breitengrad",se:"Y/latitud kolumnnamn"},{en:"Geometry column names",de:"Spaltennamen für Geometrie",se:"Geometrikolumnnamn"},{en:"Time column names",de:"Spaltennamen für Zeit",se:"Tidskolumnnamn"},{en:"Group column names",de:"Spaltennamen für Gruppe",se:"Gruppkolumnnamn"},{en:"Label column names",de:"Spaltennamen für Label",se:"Etikettkolumnnamn"},{en:"Separator character",de:"Trennzeichen",se:"Skiljetecken"},{en:"Comment character",de:"Kommentar-Zeichen",se:"Kommentar karaktär"},{en:"Quote character",de:"Zitierzeichen",se:"Citat karaktär"},{en:"Escape character",de:"Escape character",se:"Escape karaktär"},{en:"Not-a-number token",de:"Token für 'keine Zahl'",se:"Not-a-number token"},{en:"True token",de:"Token für 'wahr'",se:"Sann token"},{en:"False token",de:"Token für 'falsch'",se:"Falsk token"},{en:"Revoke consent",de:"Zustimmung widerrufen",se:"Återkalla samtycke "},{en:"Accepted",de:"Akzeptiert",se:"Accepterad"},{en:"Legal Agreement",de:"Rechtliches Übereinkommen",se:"Laglig Överenskommelse"},{en:"Privacy Notice",de:"Datenschutzhinweis",se:"Sekretessmeddelande"},{en:"WMS URL",de:"WMS URL",se:"WMS URL"},{en:"WMS Layer",de:"WMS Layer",se:"WMS Lager"},{en:"Add layer from a Web Map Service",de:"Layer aus einem Web Map Service hinzufügen",se:"Lägg till lager från en Web Map Service"},{en:"Add layer from a Tiled Web Map",de:"Layer aus einer Tiled Web Map hinzufügen",se:"Lägg till lager från en Tiled Web Map"},{en:"Show or hide layers panel",de:"Layer-Bedienfeld ein- oder ausblenden",se:"Visa eller dölj panelen Lager"},{en:"Turn layer split mode on or off",de:"Layer-Split-Modus ein- oder ausschalten",se:"Aktivera eller inaktivera lagerdelningsläget"},{en:"Turn info box on or off",de:"Infobox ein- oder ausschalten",se:"Slå på eller av informationsrutan"},{en:"Show or hide sidebar",de:"Seitenleiste ein- oder ausblenden",se:"Visa eller dölja sidofält"},{en:"Unknown color bar",de:"Unbekannte Farbskala",se:"Färgskala okänd"},{en:"Points",de:"Punkte",se:"Punkter"},{en:"Lines",de:"Linien",se:"Linjer"},{en:"Bars",de:"Balken",se:"Staplar"},{en:"Default chart type",de:"Diagrammtyp (default)",se:"Diagramtyp (default)"},{en:"User Base Maps",de:"Nutzer Basiskarte",se:"Användare Grundkarta"},{en:"Overlay",de:"Overlay (überlagernder Layer)",se:"Overlay (överliggande lager)"},{en:"User Overlays",de:"Nutzer Overlay",se:"Användare Overlay"},{en:"On dataset selection",de:"Bei Auswahl von Datensatz",se:"Vid val av dataset"},{en:"On place selection",de:"Bei Auswahl von Ort",se:"Vid val av plats"},{en:"Do nothing",de:"Nichts tun",se:"Gör ingenting"},{en:"Pan",de:"Verschieben",se:"Panorera"},{en:"Pan and zoom",de:"Verschieben und zoom",se:"Panorera och zooma"},{en:"User Layers",de:"Nutzer Layer",se:"Användare lager"},{en:"XYZ Layer URL",de:"XYZ-Layer URL",se:"XYZ lager URL"},{en:"Layer Title",de:"Layer Titel",se:"Lagertitel "},{en:"Layer Attribution",de:"Layer Attribution",se:"Lagerattribution"},{en:"Info",de:"Info",se:"Info"},{en:"Charts",de:"Diagramme",se:"Diagrammer"},{en:"Statistics",de:"Statistik",se:"Statistik"},{en:"Volume",de:"Volumen",se:"Volym"},{en:"Toggle zoom mode (or press CTRL key)",de:"Zoom-Modus umschalten (oder drücke CTRL-Taste)",se:"Växla zoomläge (eller tryck på CTRL-tangenten)"},{en:"Enter fixed y-range",de:"Festen y-Bereich angeben",se:"Ange fast y-intervall"},{en:"Toggle showing info popup on hover",de:"Anzeige des Info-Popups bei Hover umschalten",se:"Växla visning av popup-info vid hover"},{en:"Show points",de:"Punkte anzeigen",se:"Visa punkter"},{en:"Show lines",de:"Linien anzeigen",se:"Visa linjer"},{en:"Show bars",de:"Balken anzeigen",se:"Visa staplar"},{en:"Show standard deviation (if any)",de:"Standardabweichung anzeigen",se:"Visa standardavvikelsen"},{en:"Add time-series from places",de:"Zeitserien hinzufügen von Orten",se:"Lägg till tidsserier från platser"},{en:"Zoom to full range",de:"Zoom auf gesamten x-Bereich",se:"Zooma till hela x-intervallet"},{en:"Make it 2nd variable for comparison",de:"Festlegen als 2. Variable für Vergleich",se:"Ställ in som 2:a variabel för jämförelse"},{en:"Load Volume Data",de:"Lade Volumendaten",se:"Ladda volymdata"},{en:"Please note that the 3D volume rendering is still an experimental feature.",de:"Bitte beachte, dass das 3D-Volumen-Rendering noch eine experimentelle Funktion ist.",se:"Observera att 3D-volymrendering fortfarande är en experimentell funktion."},{en:"User-defined color bars.",de:"Benutzerdefinierte Farbskalen.",se:"Användardefinierade färgskalor."},{en:"Contin.",de:"Kontin.",se:"Kontin."},{en:"Stepwise",de:"Schrittw.",se:"Stegvis"},{en:"Categ.",de:"Kateg.",se:"Kateg."},{en:"Continuous color assignment, where each value represents a support point of a color gradient",de:"Kontinuierliche Farbzuordnung, bei der jeder Wert eine Stützstelle eines Farbverlaufs darstellt",se:"Kontinuerlig färgtilldelning där varje värde representerar en punkt i en färggradient"},{en:"Stepwise color mapping where values are bounds of value ranges mapped to the same color",de:"Schrittweise Farbzuordnung, bei der die Werte Bereichsgrenzen darstellen, die einer einzelnen Farbe zugeordnet werden",se:"Gradvis färgmappning, där värdena representerar intervallgränser mappade till en enda färg"},{en:"Values represent unique categories or indexes that are mapped to a color",de:"Werte stellen eindeutige Kategorien oder Indizes dar, die einer Farbe zugeordnet sind",se:"Värden representerar unika kategorier eller index som är mappade till en färg"},{en:"User",de:"Nutzer",se:"Användare"},{en:"Add Time-Series",de:"Zeitserien hinzufügen",se:"Lägg till tidsserier"},{en:"No time-series have been obtained yet. Select a variable and a place first.",de:"Es wurden noch keine Zeitreihen abgerufen. Wähle zuerst eine Variable und einen Ort aus.",se:"Inga tidsserier har hämtats ännu. Välj först en variabel och en plats."},{en:"Count",de:"Anzahl",se:"Antal"},{en:"Minimum",de:"Minimum",se:"Minimum"},{en:"Maximum",de:"Maximum",se:"Maximum"},{en:"Mean",de:"Mittelwert",se:"Medelvärde"},{en:"Deviation",de:"Abweichung",se:"Avvikelse"},{en:"Toggle adjustable x-range",de:"Anpassbaren x-Bereich umschalten",se:"Växla justerbart x-intervall"},{en:"pinned",de:"angepinnt",se:"fäst"},{en:"Compare Mode (Drag)",de:"Vergleichsmodus (Ziehen)",se:"Jämförelseläge (Dra)"},{en:"Point Info Mode (Hover)",de:"Punktinformationsmodus (Bewegen)",se:"Punktinformationsläge (Sväva)"},{en:"Dataset RGB",de:"Datensatz RGB",se:"Dataset RGB"},{en:"Dataset RGB 2",de:"Datensatz RGB 2",se:"Dataset RGB 2"},{en:"Dataset Variable",de:"Datensatz Variable",se:"Dataset Variabel"},{en:"Dataset Variable 2",de:"Datensatz Variable 2",se:"Dataset Variabel 2"},{en:"Dataset Boundary",de:"Datensatz Außengrenze",se:"Dataset Yttre Gräns"},{en:"Dataset Places",de:"Datensatz Orte",se:"Dataset Platser"},{en:"User Places",de:"Nutzer Orte",se:"Användare Platser"},{en:"Layers",de:"Layer",se:"Lager"},{en:"User Variables",de:"Nutzer-Variablen",se:"Användarvariabler"},{en:"Create and manage user variables",de:"Nutzer-Variablen erstellen und verwalten",se:"Skapa och hantera användarvariabler"},{en:"Manage user variables",de:"Nutzer-Variablen verwalten",se:"Hantera användarvariabler"},{en:"Add user variable",de:"Nutzer-Variable hinzufügen",se:"Lägg till användarvariabel"},{en:"Duplicate user variable",de:"Nutzer-Variable duplizieren",se:"Duplicera användarvariabel"},{en:"Edit user variable",de:"Nutzer-Variable bearbeiten",se:"Redigera användarvariabel"},{en:"Remove user variable",de:"Nutzer-Variable löschen",se:"Ta bort användarvariabel"},{en:"Use keys CTRL+SPACE to show autocompletions",de:"Tasten STRG+LEER benutzen, um Autovervollständigungen zu zeigen",se:"Använd tangenterna CTRL+MELLANSLAG för att visa autoslutföranden"},{en:"Display further elements to be used in expressions",de:"Weitere Elemente anzeigen, die in Ausdrücken verwendet werden können",se:"Visa fler element som kan användas i uttryck"},{en:"Variables",de:"Variablen",se:"Variabler"},{en:"Constants",de:"Konstanten",se:"Konstanter"},{en:"Array operators",de:"Array-Operatoren",se:"Arrayoperatorer"},{en:"Other operators",de:"Andere Operatoren",se:"Andra Operatorer"},{en:"Array functions",de:"Array-Funktionen",se:"Arrayfunktioner"},{en:"Other functions",de:"Andere Funktionen",se:"Andra funktioner"},{en:"Not a valid identifier",de:"Kein gültiger Bezeichner",se:"Inte en giltig identifierare"},{en:"Must not be empty",de:"Darf nicht leer sein",se:"Får inte vara tom"},{en:"docs/privacy-note.en.md",de:"docs/privacy-note.de.md",se:"docs/privacy-note.se.md"},{en:"docs/add-layer-wms.en.md",de:"docs/add-layer-wms.de.md",se:"docs/add-layer-wms.se.md"},{en:"docs/add-layer-xyz.en.md",de:"docs/add-layer-xyz.de.md",se:"docs/add-layer-xyz.se.md"},{en:"docs/color-mappings.en.md",de:"docs/color-mappings.de.md",se:"docs/color-mappings.se.md"},{en:"docs/user-variables.en.md",de:"docs/user-variables.de.md",se:"docs/user-variables.se.md"}],VNe={languages:UNe,dictionary:WNe},fe=new BNe(VNe);fe.locale=zNe();class Eie extends M.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,n){console.error(e),n.componentStack&&console.error(n.componentStack)}render(){if(!this.props.children)throw new Error("An ErrorBoundary requires at least one child");return this.state.error?w.jsxs("div",{children:[w.jsx("h2",{className:"errorBoundary-header",children:fe.get("Something went wrong.")}),w.jsxs("details",{className:"errorBoundary-details",style:{whiteSpace:"pre-wrap"},children:[this.state.error.toString(),w.jsx("br",{})]})]}):this.props.children}}const GNe=({children:t})=>{const e=Kt.instance.authClient;if(!e)return w.jsx(w.Fragment,{children:t});const n=o=>{console.info("handleSigninCallback:",o),window.history.replaceState({},document.title,window.location.pathname)},r=()=>{console.info("handleRemoveUser"),window.location.pathname="/"},i=zM.href;return w.jsx(Eie,{children:w.jsx(NNe,{...e,loadUserInfo:!0,scope:"openid email profile",automaticSilentRenew:!0,redirect_uri:i,post_logout_redirect_uri:i,popup_post_logout_redirect_uri:i,onSigninCallback:n,onRemoveUser:r,children:t})})};var E5={},TA={};const HNe=Ea(zCe);var J8;function pt(){return J8||(J8=1,function(t){"use client";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return e.createSvgIcon}});var e=HNe}(TA)),TA}var qNe=ct;Object.defineProperty(E5,"__esModule",{value:!0});var P5=E5.default=void 0,XNe=qNe(pt()),QNe=w;P5=E5.default=(0,XNe.default)((0,QNe.jsx)("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutline");var M5={},YNe=ct;Object.defineProperty(M5,"__esModule",{value:!0});var k5=M5.default=void 0,KNe=YNe(pt()),ZNe=w;k5=M5.default=(0,KNe.default)((0,ZNe.jsx)("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings");var A5={},JNe=ct;Object.defineProperty(A5,"__esModule",{value:!0});var R5=A5.default=void 0,eFe=JNe(pt()),tFe=w;R5=A5.default=(0,eFe.default)((0,tFe.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh");var I5={},nFe=ct;Object.defineProperty(I5,"__esModule",{value:!0});var Pie=I5.default=void 0,rFe=nFe(pt()),eG=w;Pie=I5.default=(0,rFe.default)([(0,eG.jsx)("path",{d:"m21 5-9-4-9 4v6c0 5.55 3.84 10.74 9 12 2.3-.56 4.33-1.9 5.88-3.71l-3.12-3.12c-1.94 1.29-4.58 1.07-6.29-.64-1.95-1.95-1.95-5.12 0-7.07 1.95-1.95 5.12-1.95 7.07 0 1.71 1.71 1.92 4.35.64 6.29l2.9 2.9C20.29 15.69 21 13.38 21 11z"},"0"),(0,eG.jsx)("circle",{cx:"12",cy:"12",r:"3"},"1")],"Policy");var D5={},iFe=ct;Object.defineProperty(D5,"__esModule",{value:!0});var L5=D5.default=void 0,oFe=iFe(pt()),aFe=w;L5=D5.default=(0,oFe.default)((0,aFe.jsx)("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M17 13l-5 5-5-5h3V9h4v4z"}),"CloudDownload");var sFe=function(){function t(e){this.propagationStopped,this.defaultPrevented,this.type=e,this.target=null}return t.prototype.preventDefault=function(){this.defaultPrevented=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t}();const rc=sFe,Kg={PROPERTYCHANGE:"propertychange"};var lFe=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();const $5=lFe;function cFe(t,e,n){for(var r,i,o=n||Yh,a=0,s=t.length,l=!1;a>1),i=+o(t[r],e),i<0?a=r+1:(s=r,l=!i);return l?a:~a}function Yh(t,e){return t>e?1:t0){for(i=1;i0?i-1:i:t[i-1]-e0||n&&a===0)})}function Rh(){return!0}function R1(){return!1}function Kh(){}function dFe(t){var e=!1,n,r,i;return function(){var o=Array.prototype.slice.call(arguments);return(!e||this!==i||!Sp(o,r))&&(e=!0,i=this,r=o,n=t.apply(this,arguments)),n}}var cr=typeof Object.assign=="function"?Object.assign:function(t,e){if(t==null)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(t),r=1,i=arguments.length;r0:!1},e.prototype.removeEventListener=function(n,r){var i=this.listeners_&&this.listeners_[n];if(i){var o=i.indexOf(r);o!==-1&&(this.pendingRemovals_&&n in this.pendingRemovals_?(i[o]=Kh,++this.pendingRemovals_[n]):(i.splice(o,1),i.length===0&&delete this.listeners_[n]))}},e}($5);const Mt={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function rn(t,e,n,r,i){if(r&&r!==t&&(n=n.bind(r)),i){var o=n;n=function(){t.removeEventListener(e,n),o.apply(this,arguments)}}var a={target:t,type:e,listener:n};return t.addEventListener(e,n),a}function kT(t,e,n,r){return rn(t,e,n,r,!0)}function tr(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),I1(t))}var pFe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),WM=function(t){pFe(e,t);function e(){var n=t.call(this)||this;return n.on=n.onInternal,n.once=n.onceInternal,n.un=n.unInternal,n.revision_=0,n}return e.prototype.changed=function(){++this.revision_,this.dispatchEvent(Mt.CHANGE)},e.prototype.getRevision=function(){return this.revision_},e.prototype.onInternal=function(n,r){if(Array.isArray(n)){for(var i=n.length,o=new Array(i),a=0;a=0||Qf.match(/cpu (os|iphone os) 15_4 like mac os x/));var CFe=Qf.indexOf("webkit")!==-1&&Qf.indexOf("edge")==-1,TFe=Qf.indexOf("macintosh")!==-1,Iie=typeof devicePixelRatio<"u"?devicePixelRatio:1,VM=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,EFe=typeof Image<"u"&&Image.prototype.decode,Die=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch{}return t}();new Array(6);function Wl(){return[1,0,0,1,0,0]}function PFe(t,e,n,r,i,o,a){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t}function MFe(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function Or(t,e){var n=e[0],r=e[1];return e[0]=t[0]*n+t[2]*r+t[4],e[1]=t[1]*n+t[3]*r+t[5],e}function kFe(t,e,n){return PFe(t,e,0,0,n,0,0)}function cu(t,e,n,r,i,o,a,s){var l=Math.sin(o),c=Math.cos(o);return t[0]=r*c,t[1]=i*l,t[2]=-r*l,t[3]=i*c,t[4]=a*r*c-s*r*l+e,t[5]=a*i*l+s*i*c+n,t}function F5(t,e){var n=AFe(e);Ut(n!==0,32);var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],l=e[5];return t[0]=a/n,t[1]=-i/n,t[2]=-o/n,t[3]=r/n,t[4]=(o*l-a*s)/n,t[5]=-(r*l-i*s)/n,t}function AFe(t){return t[0]*t[3]-t[1]*t[2]}var nG;function Lie(t){var e="matrix("+t.join(", ")+")";if(VM)return e;var n=nG||(nG=document.createElement("div"));return n.style.transform=e,n.style.transform}const ai={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function rG(t){for(var e=Oa(),n=0,r=t.length;ni&&(l=l|ai.RIGHT),so&&(l=l|ai.ABOVE),l===ai.UNKNOWN&&(l=ai.INTERSECTING),l}function Oa(){return[1/0,1/0,-1/0,-1/0]}function Qs(t,e,n,r,i){return i?(i[0]=t,i[1]=e,i[2]=n,i[3]=r,i):[t,e,n,r]}function L1(t){return Qs(1/0,1/0,-1/0,-1/0,t)}function IFe(t,e){var n=t[0],r=t[1];return Qs(n,r,n,r,e)}function Nie(t,e,n,r,i){var o=L1(i);return jie(o,t,e,n,r)}function Lb(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function Fie(t,e){return e[0]t[2]&&(t[2]=e[2]),e[1]t[3]&&(t[3]=e[3]),t}function zx(t,e){e[0]t[2]&&(t[2]=e[0]),e[1]t[3]&&(t[3]=e[1])}function jie(t,e,n,r,i){for(;ne[0]?r[0]=t[0]:r[0]=e[0],t[1]>e[1]?r[1]=t[1]:r[1]=e[1],t[2]=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function z5(t){return t[2]=a&&m<=l),!r&&o&ai.RIGHT&&!(i&ai.RIGHT)&&(g=h-(d-l)*p,r=g>=s&&g<=c),!r&&o&ai.BELOW&&!(i&ai.BELOW)&&(m=d-(h-s)/p,r=m>=a&&m<=l),!r&&o&ai.LEFT&&!(i&ai.LEFT)&&(g=h-(d-a)*p,r=g>=s&&g<=c)}return r}function FFe(t,e,n,r){var i=[];if(r>1)for(var o=t[2]-t[0],a=t[3]-t[1],s=0;s=n[2])){var i=Yn(n),o=Math.floor((r[0]-n[0])/i),a=o*i;t[0]-=a,t[2]-=a}return t}function jFe(t,e){if(e.canWrapX()){var n=e.getExtent();if(!isFinite(t[0])||!isFinite(t[2]))return[[n[0],t[1],n[2],t[3]]];Bie(t,e);var r=Yn(n);if(Yn(t)>r)return[[n[0],t[1],n[2],t[3]]];if(t[0]n[2])return[[t[0],t[1],n[2],t[3]],[n[0],t[1],t[2]-r,t[3]]]}return[t]}var BFe=function(){function t(e){this.code_=e.code,this.units_=e.units,this.extent_=e.extent!==void 0?e.extent:null,this.worldExtent_=e.worldExtent!==void 0?e.worldExtent:null,this.axisOrientation_=e.axisOrientation!==void 0?e.axisOrientation:"enu",this.global_=e.global!==void 0?e.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=e.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=e.metersPerUnit}return t.prototype.canWrapX=function(){return this.canWrapX_},t.prototype.getCode=function(){return this.code_},t.prototype.getExtent=function(){return this.extent_},t.prototype.getUnits=function(){return this.units_},t.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||Xs[this.units_]},t.prototype.getWorldExtent=function(){return this.worldExtent_},t.prototype.getAxisOrientation=function(){return this.axisOrientation_},t.prototype.isGlobal=function(){return this.global_},t.prototype.setGlobal=function(e){this.global_=e,this.canWrapX_=!!(e&&this.extent_)},t.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},t.prototype.setDefaultTileGrid=function(e){this.defaultTileGrid_=e},t.prototype.setExtent=function(e){this.extent_=e,this.canWrapX_=!!(this.global_&&e)},t.prototype.setWorldExtent=function(e){this.worldExtent_=e},t.prototype.setGetPointResolution=function(e){this.getPointResolutionFunc_=e},t.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},t}();const zie=BFe;function Fr(t,e,n){return Math.min(Math.max(t,e),n)}var zFe=function(){var t;return"cosh"in Math?t=Math.cosh:t=function(e){var n=Math.exp(e);return(n+1/n)/2},t}(),UFe=function(){var t;return"log2"in Math?t=Math.log2:t=function(e){return Math.log(e)*Math.LOG2E},t}();function WFe(t,e,n,r,i,o){var a=i-n,s=o-r;if(a!==0||s!==0){var l=((t-n)*a+(e-r)*s)/(a*a+s*s);l>1?(n=i,r=o):l>0&&(n+=a*l,r+=s*l)}return Ih(t,e,n,r)}function Ih(t,e,n,r){var i=n-t,o=r-e;return i*i+o*o}function VFe(t){for(var e=t.length,n=0;ni&&(i=a,r=o)}if(i===0)return null;var s=t[r];t[r]=t[n],t[n]=s;for(var l=n+1;l=0;d--){f[d]=t[d][e]/t[d][d];for(var h=d-1;h>=0;h--)t[h][e]-=t[h][d]*f[d]}return f}function CC(t){return t*Math.PI/180}function Df(t,e){var n=t%e;return n*e<0?n+e:n}function Ic(t,e,n){return t+n*(e-t)}function Uie(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n}function cS(t,e){return Math.floor(Uie(t,e))}function uS(t,e){return Math.ceil(Uie(t,e))}var GFe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$1=6378137,Qm=Math.PI*$1,HFe=[-Qm,-Qm,Qm,Qm],qFe=[-180,-85,180,85],fS=$1*Math.log(Math.tan(Math.PI/2)),Xp=function(t){GFe(e,t);function e(n){return t.call(this,{code:n,units:li.METERS,extent:HFe,global:!0,worldExtent:qFe,getPointResolution:function(r,i){return r/zFe(i[1]/$1)}})||this}return e}(zie),iG=[new Xp("EPSG:3857"),new Xp("EPSG:102100"),new Xp("EPSG:102113"),new Xp("EPSG:900913"),new Xp("http://www.opengis.net/def/crs/EPSG/0/3857"),new Xp("http://www.opengis.net/gml/srs/epsg.xml#3857")];function XFe(t,e,n){var r=t.length,i=n>1?n:2,o=e;o===void 0&&(i>2?o=t.slice():o=new Array(r));for(var a=0;afS?s=fS:s<-fS&&(s=-fS),o[a+1]=s}return o}function QFe(t,e,n){var r=t.length,i=n>1?n:2,o=e;o===void 0&&(i>2?o=t.slice():o=new Array(r));for(var a=0;aa)return 1;if(a>o)return-1}return 0}function rje(t,e){return t[0]+=+e[0],t[1]+=+e[1],t}function RT(t,e){for(var n=!0,r=t.length-1;r>=0;--r)if(t[r]!=e[r]){n=!1;break}return n}function U5(t,e){var n=Math.cos(e),r=Math.sin(e),i=t[0]*n-t[1]*r,o=t[1]*n+t[0]*r;return t[0]=i,t[1]=o,t}function ije(t,e){return t[0]*=e,t[1]*=e,t}function oje(t,e){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function Wie(t,e){if(e.canWrapX()){var n=Yn(e.getExtent()),r=aje(t,e,n);r&&(t[0]-=r*n)}return t}function aje(t,e,n){var r=e.getExtent(),i=0;if(e.canWrapX()&&(t[0]r[2])){var o=n||Yn(r);i=Math.floor((t[0]-r[0])/o)}return i}var sje=63710088e-1;function sG(t,e,n){var r=n||sje,i=CC(t[1]),o=CC(e[1]),a=(o-i)/2,s=CC(e[0]-t[0])/2,l=Math.sin(a)*Math.sin(a)+Math.sin(s)*Math.sin(s)*Math.cos(i)*Math.cos(o);return 2*r*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}var qL=!0;function lje(t){var e=t===void 0?!0:t;qL=!e}function W5(t,e,n){var r;if(e!==void 0){for(var i=0,o=t.length;i=-180&&t[0]<=180&&t[1]>=-90&&t[1]<=90&&(qL=!1,console.warn("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),t}function Hie(t,e){return t}function hh(t,e){return t}function pje(){lG(iG),lG(aG),fje(aG,iG,XFe,QFe)}pje();function Dh(t,e,n,r,i,o){for(var a=o||[],s=0,l=e;l1)f=n;else if(d>0){for(var h=0;hi&&(i=c),o=s,a=l}return i}function X5(t,e,n,r,i){for(var o=0,a=n.length;o0;){for(var f=c.pop(),d=c.pop(),h=0,p=t[d],m=t[d+1],g=t[f],v=t[f+1],y=d+r;yh&&(u=y,h=_)}h>i&&(l[(u-e)/r]=1,d+r0&&m>h)&&(p<0&&g0&&g>p)){c=f,u=d;continue}o[a++]=c,o[a++]=u,s=c,l=u,c=f,u=d}}return o[a++]=c,o[a++]=u,a}function Kie(t,e,n,r,i,o,a,s){for(var l=0,c=n.length;l1?a:2,b=o||new Array(x),p=0;p>1;io&&(c-s)*(o-l)-(i-s)*(u-l)>0&&a++:u<=o&&(c-s)*(o-l)-(i-s)*(u-l)<0&&a--,s=c,l=u}return a!==0}function J5(t,e,n,r,i,o){if(n.length===0||!ph(t,e,n[0],r,i,o))return!1;for(var a=1,s=n.length;a=i[0]&&o[2]<=i[2]||o[1]>=i[1]&&o[3]<=i[3]?!0:Zie(t,e,n,r,function(a,s){return NFe(i,a,s)}):!1}function $je(t,e,n,r,i){for(var o=0,a=n.length;ob&&(c=(u+f)/2,J5(t,e,n,r,c,p)&&(x=c,b=_)),u=f}return isNaN(x)&&(x=i[o]),a?(a.push(x,p,b),a):[x,p,b]}function Qje(t,e,n,r,i){for(var o=[],a=0,s=n.length;a0}function soe(t,e,n,r,i){for(var o=i!==void 0?i:!1,a=0,s=n.length;a0){const n=e.map(r=>r.map(encodeURIComponent).join("=")).join("&");return t.includes("?")?t.endsWith("&")?t+n:t+"&"+n:t+"?"+n}return t}async function coe(t,e){let n;try{if(n=await fetch(t,e),n.ok)return n}catch(i){throw i instanceof TypeError?(console.error(`Server did not respond for ${t}. May be caused by timeout, refused connection, network error, etc.`,i),new Error(fe.get("Cannot reach server"))):(console.error(i),i)}let r=n.statusText;try{const i=await n.json();if(i&&i.error){const o=i.error;console.error(o),o.message&&(r+=`: ${o.message}`)}}catch{}throw console.error(n),new loe(n.status,r)}async function xu(t,e,n){let r;R3e(e)?n=e:r=e;const o=await(await coe(t,r)).json();return n?n(o):o}function x5e(t){return xu(`${t}/colorbars`,b5e)}function b5e(t){const e=[],n={};return t.forEach(r=>{const[i,o,a]=r,s=[];a.forEach(l=>{const[c,u]=l;s.push(c),n[c]=u}),e.push({title:i,description:o,names:s})}),{groups:e,images:n}}function _5e(t,e){const n=ry(`${t}/datasets`,[["details","1"]]),r=ny(e);return xu(n,r,w5e)}function w5e(t){return(t.datasets||[]).map(S5e)}function S5e(t){if(t.dimensions&&t.dimensions.length){let e=t.dimensions;const n=e.findIndex(r=>r.name==="time");if(n>-1){const r=e[n],i=r.coordinates;if(i&&i.length&&typeof i[0]=="string"){const o=i,a=o.map(s=>new Date(s).getTime());return e=[...e],e[n]={...r,coordinates:a,labels:o},{...t,dimensions:e}}}}return t}function O5e(t,e,n,r){const i=ny(r),o=encodeURIComponent(e),a=encodeURIComponent(n);return xu(`${t}/datasets/${o}/places/${a}`,i)}function C5e(t){return xu(`${t}/expressions/capabilities`)}function T5e(t){return xu(`${t}/`)}function N1(t){return ey(t.expression)}function iy(t){return encodeURIComponent(ey(t)?t:t.id)}function F1(t){return encodeURIComponent(ey(t)?t:N1(t)?`${t.name}=${t.expression}`:t.name)}function E5e(t,e,n,r,i,o,a,s,l,c){let u,f=null;const d=[];s?(d.push(["aggMethods","median"]),u="median"):l?(d.push(["aggMethods","mean,std"]),u="mean",f="std"):(d.push(["aggMethods","mean"]),u="mean"),o&&d.push(["startDate",o]),a&&d.push(["endDate",a]);const h=ry(`${t}/timeseries/${iy(e)}/${F1(n)}`,d),p={...ny(c),method:"post",body:JSON.stringify(i)};return xu(h,p,g=>{const v=g.result;if(!v||v.length===0)return null;const y=v.map(b=>({...b,time:new Date(b.time).getTime()}));return{source:{datasetId:e.id,datasetTitle:e.title,variableName:n.name,variableUnits:n.units||void 0,placeId:r,geometry:i,valueDataKey:u,errorDataKey:f},data:y}})}function P5e(t,e,n,r,i,o){const a=[["time",i]],s=ry(`${t}/statistics/${iy(e)}/${F1(n)}`,a),l={...ny(o),method:"post",body:JSON.stringify(r.place.geometry)},c={dataset:e,variable:n,placeInfo:r,time:i};return xu(s,l,u=>({source:c,statistics:u.result}))}function M5e(t,e,n,r,i,o,a){const s=[["lon",r.toString()],["lat",i.toString()]];o&&s.push(["time",o]);const l=ry(`${t}/statistics/${iy(e)}/${F1(n)}`,s);return xu(l,ny(a),c=>c.result?c.result:{})}function k5e(t,e){const n=ry(`${t}/maintenance/update`,[]),r=ny(e);try{return xu(n,r).then(()=>!0).catch(i=>(console.error(i),!1))}catch(i){return console.error(i),Promise.resolve(!1)}}class NT extends Error{}function A5e(t,e){if(t===null)throw new NT(`assertion failed: ${e} must not be null`)}function R5e(t,e){if(typeof t>"u")throw new NT(`assertion failed: ${e} must not be undefined`)}function I5e(t,e){A5e(t,e),R5e(t,e)}function EA(t,e){if(Array.isArray(t)){if(t.length===0)throw new NT(`assertion failed: ${e} must be a non-empty array`)}else throw new NT(`assertion failed: ${e} must be an array`)}function Fb(t,e){return e&&t.find(n=>n.id===e)||null}function t$(t,e){return e&&t.variables.find(n=>n.name===e)||null}function D5e(t){return t.variables.findIndex(e=>ey(e.expression))}function rB(t){const e=D5e(t);return e>=0?[t.variables.slice(0,e),t.variables.slice(e)]:[t.variables,[]]}function uoe(t){I5e(t,"dataset"),EA(t.dimensions,"dataset.dimensions");const e=t.dimensions.find(n=>n.name==="time");return e?(EA(e.coordinates,"timeDimension.coordinates"),EA(e.labels,"timeDimension.labels"),e):null}function foe(t){const e=uoe(t);if(!e)return null;const n=e.coordinates;return[n[0],n[n.length-1]]}var FT="NOT_FOUND";function L5e(t){var e;return{get:function(r){return e&&t(e.key,r)?e.value:FT},put:function(r,i){e={key:r,value:i}},getEntries:function(){return e?[e]:[]},clear:function(){e=void 0}}}function $5e(t,e){var n=[];function r(s){var l=n.findIndex(function(u){return e(s,u.key)});if(l>-1){var c=n[l];return l>0&&(n.splice(l,1),n.unshift(c)),c.value}return FT}function i(s,l){r(s)===FT&&(n.unshift({key:s,value:l}),n.length>t&&n.pop())}function o(){return n}function a(){n=[]}return{get:r,put:i,getEntries:o,clear:a}}var N5e=function(e,n){return e===n};function F5e(t){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var i=n.length,o=0;o1?e-1:0),r=1;r0&&o[0]!==s&&(o=[s,...o])}n.properties&&(a=pG(n.properties,o)),a===void 0&&(a=pG(n,o)),t[r]=a||i}function q5e(t,e){let n=e;if(t.properties)for(const r of Object.getOwnPropertyNames(t.properties)){if(!n.includes("${"))break;const i="${"+r+"}";n.includes(i)&&(n=n.replace(i,`${t.properties[r]}`))}return n}function pG(t,e){let n;for(const r of e)if(r in t)return t[r];return n}function j1(t){let e=[];for(const n of t)e=e.concat(n.toLowerCase(),n.toUpperCase(),n[0].toUpperCase()+n.substring(1).toLowerCase());return e}function aB(t,e){t.forEach(n=>{ay(n)&&n.features.forEach(r=>{e(n,r)})})}function X5e(t,e){const n=ey(e)?(r,i)=>i.id===e:e;for(const r of t)if(ay(r)){const i=r.features.find(o=>n(r,o));if(i)return ZM(r,i)}return null}function Q5e(t){const e=t.id+"";let n=0,r,i;if(e.length===0)return n;for(r=0;ri.id===e);if(n)return n;const r=t.placeGroups;if(r)for(const i in r){const o=hoe(r[i],e);if(o)return o}return null}function sB(t,e){if(e)for(const n of t){const r=hoe(n,e);if(r!==null)return r}return null}const Y5e=/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,K5e=t=>{let e;if(t.includes(",")){const r=t.split(",");if(r.length===3||r.length===4){const i=[0,0,0,255];for(let o=0;o<3;o++){const a=Number.parseInt(r[o]);if(a<0||a>255)return;i[o]=a}if(r.length===4){if(e=mG(r[3]),e===void 0)return;i[3]=e}return i}if(r.length!==2||(t=r[0],e=mG(r[1]),e===void 0))return}const n=(t.startsWith("#")?poe:eBe)(t);if(n){if(n.length===3)return[...n,e===void 0?255:e];if(n.length===4&&e===void 0)return n}};function Z5e(t){return"#"+t.map(e=>{const n=e.toString(16);return n.length===1?"0"+n:n}).join("")}function poe(t){if(Y5e.test(t)){if(t.length===4)return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)];if(t.length===7)return[parseInt(t.substring(1,3),16),parseInt(t.substring(3,5),16),parseInt(t.substring(5,7),16)];if(t.length===9)return[parseInt(t.substring(1,3),16),parseInt(t.substring(3,5),16),parseInt(t.substring(5,7),16),parseInt(t.substring(7,9),16)]}}const mG=t=>{const e=Number.parseFloat(t);if(e===0)return 0;if(e===1)return 255;if(e>0&&e<1)return Math.round(256*e)},J5e=t=>tBe[t.toLowerCase()],eBe=t=>{const e=J5e(t);if(e)return poe(e)},tBe={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#00FFFF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blue:"#0000FF",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#FF00FF",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#00FF00",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#FF0000",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFFFFF",whitesmoke:"#F5F5F5",yellow:"#FFFF00",yellowgreen:"#9ACD32"},moe="User",goe=`0.0: #23FF52 0.5: red -1.0: 120,30,255`;function eBe(t,e,n){const r=new Uint8ClampedArray(4*n),i=t.length;if(e==="categorical"||e==="stepwise"){const o=e==="categorical"?i:i-1;for(let a=0,s=0;a(f.value-o)/(a-o));let l=0,c=s[0],u=s[1];for(let f=0,d=0;fu&&(l++,c=s[l],u=s[l+1]);const p=(h-c)/(u-c),[m,g,v,y]=t[l].color,[x,b,_,S]=t[l+1].color;r[d]=m+p*(x-m),r[d+1]=g+p*(b-g),r[d+2]=v+p*(_-v),r[d+3]=y+p*(S-y)}}return r}function tBe(t,e,n){const r=eBe(t,e,n.width),i=new ImageData(r,r.length/4,1);return createImageBitmap(i).then(o=>{const a=n.getContext("2d");a&&a.drawImage(o,0,0,n.width,n.height)})}function nBe(t){const{colorRecords:e,errorMessage:n}=voe(t.code);if(!e)return Promise.resolve({errorMessage:n});const r=document.createElement("canvas");return r.width=256,r.height=1,tBe(e,t.type,r).then(()=>({imageData:r.toDataURL("image/png").split(",")[1]}))}function goe(t){const{colorRecords:e}=voe(t);if(e)return e.map(n=>({...n,color:Y5e(n.color)}))}function voe(t){try{return{colorRecords:rBe(t)}}catch(e){if(e instanceof SyntaxError)return{errorMessage:`${e.message}`};throw e}}function rBe(t){const e=[];t.split(` -`).map(o=>o.trim().split(":").map(a=>a.trim())).forEach((o,a)=>{if(o.length==2||o.length==3){const[s,l]=o,c=parseFloat(s),u=Q5e(l);if(!Number.isFinite(c))throw new SyntaxError(`Line ${a+1}: invalid value: ${s}`);if(!u)throw new SyntaxError(`Line ${a+1}: invalid color: ${l}`);o.length==3?e.push({value:c,color:u,label:o[2]}):e.push({value:c,color:u})}else if(o.length===1&&o[0]!=="")throw new SyntaxError(`Line ${a+1}: invalid color record: ${o[0]}`)});const n=e.length;if(n<2)throw new SyntaxError("At least two color records must be given");e.sort((o,a)=>o.value-a.value);const r=e[0].value,i=e[n-1].value;if(r===i)throw new SyntaxError("Values must form a range");return e}var sB={exports:{}};function iBe(t,e){var n=e&&e.cache?e.cache:uBe,r=e&&e.serializer?e.serializer:cBe,i=e&&e.strategy?e.strategy:aBe;return i(t,{cache:n,serializer:r})}function oBe(t){return t==null||typeof t=="number"||typeof t=="boolean"}function yoe(t,e,n,r){var i=oBe(r)?r:n(r),o=e.get(i);return typeof o>"u"&&(o=t.call(this,r),e.set(i,o)),o}function xoe(t,e,n){var r=Array.prototype.slice.call(arguments,3),i=n(r),o=e.get(i);return typeof o>"u"&&(o=t.apply(this,r),e.set(i,o)),o}function lB(t,e,n,r,i){return n.bind(e,t,r,i)}function aBe(t,e){var n=t.length===1?yoe:xoe;return lB(t,this,n,e.cache.create(),e.serializer)}function sBe(t,e){var n=xoe;return lB(t,this,n,e.cache.create(),e.serializer)}function lBe(t,e){var n=yoe;return lB(t,this,n,e.cache.create(),e.serializer)}function cBe(){return JSON.stringify(arguments)}function JM(){this.cache=Object.create(null)}JM.prototype.has=function(t){return t in this.cache};JM.prototype.get=function(t){return this.cache[t]};JM.prototype.set=function(t,e){this.cache[t]=e};var uBe={create:function(){return new JM}};sB.exports=iBe;sB.exports.strategies={variadic:sBe,monadic:lBe};var fBe=sB.exports;const dBe=Nt(fBe),Oo={ADD:"add",REMOVE:"remove"};var boe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),pG={LENGTH:"length"},hS=function(t){boe(e,t);function e(n,r,i){var o=t.call(this,n)||this;return o.element=r,o.index=i,o}return e}(rc),Xa=function(t){boe(e,t);function e(n,r){var i=t.call(this)||this;i.on,i.once,i.un;var o=r||{};if(i.unique_=!!o.unique,i.array_=n||[],i.unique_)for(var a=0,s=i.array_.length;a0;)this.pop()},e.prototype.extend=function(n){for(var r=0,i=n.length;r0&&t[1]>0}function _oe(t,e,n){return n===void 0&&(n=[0,0]),n[0]=t[0]*e+.5|0,n[1]=t[1]*e+.5|0,n}function ua(t,e){return Array.isArray(t)?t:(e===void 0?e=[t,t]:(e[0]=t,e[1]=t),e)}var hBe=function(){function t(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale,this.scaleArray_=ua(e.scale),this.displacement_=e.displacement,this.declutterMode_=e.declutterMode}return t.prototype.clone=function(){var e=this.getScale();return new t({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})},t.prototype.getOpacity=function(){return this.opacity_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getDisplacement=function(){return this.displacement_},t.prototype.getDeclutterMode=function(){return this.declutterMode_},t.prototype.getAnchor=function(){return vt()},t.prototype.getImage=function(e){return vt()},t.prototype.getHitDetectionImage=function(){return vt()},t.prototype.getPixelRatio=function(e){return 1},t.prototype.getImageState=function(){return vt()},t.prototype.getImageSize=function(){return vt()},t.prototype.getOrigin=function(){return vt()},t.prototype.getSize=function(){return vt()},t.prototype.setDisplacement=function(e){this.displacement_=e},t.prototype.setOpacity=function(e){this.opacity_=e},t.prototype.setRotateWithView=function(e){this.rotateWithView_=e},t.prototype.setRotation=function(e){this.rotation_=e},t.prototype.setScale=function(e){this.scale_=e,this.scaleArray_=ua(e)},t.prototype.listenImageChange=function(e){vt()},t.prototype.load=function(){vt()},t.prototype.unlistenImageChange=function(e){vt()},t}();const woe=hBe;var pBe=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,mBe=/^([a-z]*)$|^hsla?\(.*\)$/i;function Soe(t){return typeof t=="string"?t:Ooe(t)}function gBe(t){var e=document.createElement("div");if(e.style.color=t,e.style.color!==""){document.body.appendChild(e);var n=getComputedStyle(e).color;return document.body.removeChild(e),n}else return""}var vBe=function(){var t=1024,e={},n=0;return function(r){var i;if(e.hasOwnProperty(r))i=e[r];else{if(n>=t){var o=0;for(var a in e)o++&3||(delete e[a],--n)}i=yBe(r),e[r]=i,++n}return i}}();function jT(t){return Array.isArray(t)?t:vBe(t)}function yBe(t){var e,n,r,i,o;if(mBe.exec(t)&&(t=gBe(t)),pBe.exec(t)){var a=t.length-1,s=void 0;a<=4?s=1:s=2;var l=a===4||a===8;e=parseInt(t.substr(1+0*s,s),16),n=parseInt(t.substr(1+1*s,s),16),r=parseInt(t.substr(1+2*s,s),16),l?i=parseInt(t.substr(1+3*s,s),16):i=255,s==1&&(e=(e<<4)+e,n=(n<<4)+n,r=(r<<4)+r,l&&(i=(i<<4)+i)),o=[e,n,r,i/255]}else t.indexOf("rgba(")==0?(o=t.slice(5,-1).split(",").map(Number),vG(o)):t.indexOf("rgb(")==0?(o=t.slice(4,-1).split(",").map(Number),o.push(1),vG(o)):Ut(!1,14);return o}function vG(t){return t[0]=Fr(t[0]+.5|0,0,255),t[1]=Fr(t[1]+.5|0,0,255),t[2]=Fr(t[2]+.5|0,0,255),t[3]=Fr(t[3],0,1),t}function Ooe(t){var e=t[0];e!=(e|0)&&(e=e+.5|0);var n=t[1];n!=(n|0)&&(n=n+.5|0);var r=t[2];r!=(r|0)&&(r=r+.5|0);var i=t[3]===void 0?1:Math.round(t[3]*100)/100;return"rgba("+e+","+n+","+r+","+i+")"}function kl(t){return Array.isArray(t)?Ooe(t):t}function Ca(t,e,n,r){var i;return n&&n.length?i=n.shift():VM?i=new OffscreenCanvas(t||300,e||300):i=document.createElement("canvas"),t&&(i.width=t),e&&(i.height=e),i.getContext("2d",r)}function Coe(t){var e=t.canvas;e.width=1,e.height=1,t.clearRect(0,0,1,1)}function yG(t,e){var n=e.parentNode;n&&n.replaceChild(t,e)}function t$(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}function xBe(t){for(;t.lastChild;)t.removeChild(t.lastChild)}function bBe(t,e){for(var n=t.childNodes,r=0;;++r){var i=n[r],o=e[r];if(!i&&!o)break;if(i!==o){if(!i){t.appendChild(o);continue}if(!o){t.removeChild(i),--r;continue}t.insertBefore(o,i)}}}var pS="ol-hidden",B1="ol-unselectable",cB="ol-control",xG="ol-collapsed",_Be=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",`?\\s*([-,\\"\\'\\sa-z]+?)\\s*$`].join(""),"i"),bG=["style","variant","weight","size","lineHeight","family"],Toe=function(t){var e=t.match(_Be);if(!e)return null;for(var n={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},r=0,i=bG.length;r(f.value-o)/(a-o));let l=0,c=s[0],u=s[1];for(let f=0,d=0;fu&&(l++,c=s[l],u=s[l+1]);const p=(h-c)/(u-c),[m,g,v,y]=t[l].color,[x,b,_,S]=t[l+1].color;r[d]=m+p*(x-m),r[d+1]=g+p*(b-g),r[d+2]=v+p*(_-v),r[d+3]=y+p*(S-y)}}return r}function rBe(t,e,n){const r=nBe(t,e,n.width),i=new ImageData(r,r.length/4,1);return createImageBitmap(i).then(o=>{const a=n.getContext("2d");a&&a.drawImage(o,0,0,n.width,n.height)})}function iBe(t){const{colorRecords:e,errorMessage:n}=yoe(t.code);if(!e)return Promise.resolve({errorMessage:n});const r=document.createElement("canvas");return r.width=256,r.height=1,rBe(e,t.type,r).then(()=>({imageData:r.toDataURL("image/png").split(",")[1]}))}function voe(t){const{colorRecords:e}=yoe(t);if(e)return e.map(n=>({...n,color:Z5e(n.color)}))}function yoe(t){try{return{colorRecords:oBe(t)}}catch(e){if(e instanceof SyntaxError)return{errorMessage:`${e.message}`};throw e}}function oBe(t){const e=[];t.split(` +`).map(o=>o.trim().split(":").map(a=>a.trim())).forEach((o,a)=>{if(o.length==2||o.length==3){const[s,l]=o,c=parseFloat(s),u=K5e(l);if(!Number.isFinite(c))throw new SyntaxError(`Line ${a+1}: invalid value: ${s}`);if(!u)throw new SyntaxError(`Line ${a+1}: invalid color: ${l}`);o.length==3?e.push({value:c,color:u,label:o[2]}):e.push({value:c,color:u})}else if(o.length===1&&o[0]!=="")throw new SyntaxError(`Line ${a+1}: invalid color record: ${o[0]}`)});const n=e.length;if(n<2)throw new SyntaxError("At least two color records must be given");e.sort((o,a)=>o.value-a.value);const r=e[0].value,i=e[n-1].value;if(r===i)throw new SyntaxError("Values must form a range");return e}var lB={exports:{}};function aBe(t,e){var n=e&&e.cache?e.cache:dBe,r=e&&e.serializer?e.serializer:fBe,i=e&&e.strategy?e.strategy:lBe;return i(t,{cache:n,serializer:r})}function sBe(t){return t==null||typeof t=="number"||typeof t=="boolean"}function xoe(t,e,n,r){var i=sBe(r)?r:n(r),o=e.get(i);return typeof o>"u"&&(o=t.call(this,r),e.set(i,o)),o}function boe(t,e,n){var r=Array.prototype.slice.call(arguments,3),i=n(r),o=e.get(i);return typeof o>"u"&&(o=t.apply(this,r),e.set(i,o)),o}function cB(t,e,n,r,i){return n.bind(e,t,r,i)}function lBe(t,e){var n=t.length===1?xoe:boe;return cB(t,this,n,e.cache.create(),e.serializer)}function cBe(t,e){var n=boe;return cB(t,this,n,e.cache.create(),e.serializer)}function uBe(t,e){var n=xoe;return cB(t,this,n,e.cache.create(),e.serializer)}function fBe(){return JSON.stringify(arguments)}function JM(){this.cache=Object.create(null)}JM.prototype.has=function(t){return t in this.cache};JM.prototype.get=function(t){return this.cache[t]};JM.prototype.set=function(t,e){this.cache[t]=e};var dBe={create:function(){return new JM}};lB.exports=aBe;lB.exports.strategies={variadic:cBe,monadic:uBe};var hBe=lB.exports;const pBe=Nt(hBe),Oo={ADD:"add",REMOVE:"remove"};var _oe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),gG={LENGTH:"length"},hS=function(t){_oe(e,t);function e(n,r,i){var o=t.call(this,n)||this;return o.element=r,o.index=i,o}return e}(rc),Xa=function(t){_oe(e,t);function e(n,r){var i=t.call(this)||this;i.on,i.once,i.un;var o=r||{};if(i.unique_=!!o.unique,i.array_=n||[],i.unique_)for(var a=0,s=i.array_.length;a0;)this.pop()},e.prototype.extend=function(n){for(var r=0,i=n.length;r0&&t[1]>0}function woe(t,e,n){return n===void 0&&(n=[0,0]),n[0]=t[0]*e+.5|0,n[1]=t[1]*e+.5|0,n}function ua(t,e){return Array.isArray(t)?t:(e===void 0?e=[t,t]:(e[0]=t,e[1]=t),e)}var mBe=function(){function t(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale,this.scaleArray_=ua(e.scale),this.displacement_=e.displacement,this.declutterMode_=e.declutterMode}return t.prototype.clone=function(){var e=this.getScale();return new t({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})},t.prototype.getOpacity=function(){return this.opacity_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getDisplacement=function(){return this.displacement_},t.prototype.getDeclutterMode=function(){return this.declutterMode_},t.prototype.getAnchor=function(){return vt()},t.prototype.getImage=function(e){return vt()},t.prototype.getHitDetectionImage=function(){return vt()},t.prototype.getPixelRatio=function(e){return 1},t.prototype.getImageState=function(){return vt()},t.prototype.getImageSize=function(){return vt()},t.prototype.getOrigin=function(){return vt()},t.prototype.getSize=function(){return vt()},t.prototype.setDisplacement=function(e){this.displacement_=e},t.prototype.setOpacity=function(e){this.opacity_=e},t.prototype.setRotateWithView=function(e){this.rotateWithView_=e},t.prototype.setRotation=function(e){this.rotation_=e},t.prototype.setScale=function(e){this.scale_=e,this.scaleArray_=ua(e)},t.prototype.listenImageChange=function(e){vt()},t.prototype.load=function(){vt()},t.prototype.unlistenImageChange=function(e){vt()},t}();const Soe=mBe;var gBe=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,vBe=/^([a-z]*)$|^hsla?\(.*\)$/i;function Ooe(t){return typeof t=="string"?t:Coe(t)}function yBe(t){var e=document.createElement("div");if(e.style.color=t,e.style.color!==""){document.body.appendChild(e);var n=getComputedStyle(e).color;return document.body.removeChild(e),n}else return""}var xBe=function(){var t=1024,e={},n=0;return function(r){var i;if(e.hasOwnProperty(r))i=e[r];else{if(n>=t){var o=0;for(var a in e)o++&3||(delete e[a],--n)}i=bBe(r),e[r]=i,++n}return i}}();function jT(t){return Array.isArray(t)?t:xBe(t)}function bBe(t){var e,n,r,i,o;if(vBe.exec(t)&&(t=yBe(t)),gBe.exec(t)){var a=t.length-1,s=void 0;a<=4?s=1:s=2;var l=a===4||a===8;e=parseInt(t.substr(1+0*s,s),16),n=parseInt(t.substr(1+1*s,s),16),r=parseInt(t.substr(1+2*s,s),16),l?i=parseInt(t.substr(1+3*s,s),16):i=255,s==1&&(e=(e<<4)+e,n=(n<<4)+n,r=(r<<4)+r,l&&(i=(i<<4)+i)),o=[e,n,r,i/255]}else t.indexOf("rgba(")==0?(o=t.slice(5,-1).split(",").map(Number),xG(o)):t.indexOf("rgb(")==0?(o=t.slice(4,-1).split(",").map(Number),o.push(1),xG(o)):Ut(!1,14);return o}function xG(t){return t[0]=Fr(t[0]+.5|0,0,255),t[1]=Fr(t[1]+.5|0,0,255),t[2]=Fr(t[2]+.5|0,0,255),t[3]=Fr(t[3],0,1),t}function Coe(t){var e=t[0];e!=(e|0)&&(e=e+.5|0);var n=t[1];n!=(n|0)&&(n=n+.5|0);var r=t[2];r!=(r|0)&&(r=r+.5|0);var i=t[3]===void 0?1:Math.round(t[3]*100)/100;return"rgba("+e+","+n+","+r+","+i+")"}function kl(t){return Array.isArray(t)?Coe(t):t}function Ca(t,e,n,r){var i;return n&&n.length?i=n.shift():VM?i=new OffscreenCanvas(t||300,e||300):i=document.createElement("canvas"),t&&(i.width=t),e&&(i.height=e),i.getContext("2d",r)}function Toe(t){var e=t.canvas;e.width=1,e.height=1,t.clearRect(0,0,1,1)}function bG(t,e){var n=e.parentNode;n&&n.replaceChild(t,e)}function n$(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}function _Be(t){for(;t.lastChild;)t.removeChild(t.lastChild)}function wBe(t,e){for(var n=t.childNodes,r=0;;++r){var i=n[r],o=e[r];if(!i&&!o)break;if(i!==o){if(!i){t.appendChild(o);continue}if(!o){t.removeChild(i),--r;continue}t.insertBefore(o,i)}}}var pS="ol-hidden",B1="ol-unselectable",uB="ol-control",_G="ol-collapsed",SBe=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",`?\\s*([-,\\"\\'\\sa-z]+?)\\s*$`].join(""),"i"),wG=["style","variant","weight","size","lineHeight","family"],Eoe=function(t){var e=t.match(SBe);if(!e)return null;for(var n={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},r=0,i=wG.length;r=t.maxResolution)return!1;var r=e.zoom;return r>t.minZoom&&r<=t.maxZoom}const e2=jBe;function BBe(t,e,n,r,i){koe(t,e,n||0,r||t.length-1,i||zBe)}function koe(t,e,n,r,i){for(;r>n;){if(r-n>600){var o=r-n+1,a=e-n+1,s=Math.log(o),l=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*l*(o-l)/o)*(a-o/2<0?-1:1),u=Math.max(n,Math.floor(e-a*l/o+c)),f=Math.min(r,Math.floor(e+(o-a)*l/o+c));koe(t,e,u,f,i)}var d=t[e],h=n,p=r;for(g0(t,n,e),i(t[r],d)>0&&g0(t,n,r);h0;)p--}i(t[n],d)===0?g0(t,n,p):(p++,g0(t,p,r)),p<=e&&(n=p+1),e<=p&&(r=p-1)}}function g0(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function zBe(t,e){return te?1:0}let Aoe=class{constructor(e=9){this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(e){let n=this.data;const r=[];if(!gS(e,n))return r;const i=this.toBBox,o=[];for(;n;){for(let a=0;a=0&&o[n].children.length>this._maxEntries;)this._split(o,n),n--;this._adjustParentBBoxes(i,o,n)}_split(e,n){const r=e[n],i=r.children.length,o=this._minEntries;this._chooseSplitAxis(r,o,i);const a=this._chooseSplitIndex(r,o,i),s=Im(r.children.splice(a,r.children.length-a));s.height=r.height,s.leaf=r.leaf,Qp(r,this.toBBox),Qp(s,this.toBBox),n?e[n-1].children.push(s):this._splitRoot(r,s)}_splitRoot(e,n){this.data=Im([e,n]),this.data.height=e.height+1,this.data.leaf=!1,Qp(this.data,this.toBBox)}_chooseSplitIndex(e,n,r){let i,o=1/0,a=1/0;for(let s=n;s<=r-n;s++){const l=ax(e,0,s,this.toBBox),c=ax(e,s,r,this.toBBox),u=HBe(l,c),f=PA(l)+PA(c);u=n;c--){const u=e.children[c];sx(s,e.leaf?o(u):u),l+=mS(s)}return l}_adjustParentBBoxes(e,n,r){for(let i=r;i>=0;i--)sx(n[i],e)}_condense(e){for(let n=e.length-1,r;n>=0;n--)e[n].children.length===0?n>0?(r=e[n-1].children,r.splice(r.indexOf(e[n]),1)):this.clear():Qp(e[n],this.toBBox)}};function UBe(t,e,n){if(!n)return e.indexOf(t);for(let r=0;r=t.minX&&e.maxY>=t.minY}function Im(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function SG(t,e,n,r,i){const o=[e,n];for(;o.length;){if(n=o.pop(),e=o.pop(),n-e<=r)continue;const a=e+Math.ceil((n-e)/r/2)*r;BBe(t,a,e,n,i),o.push(e,a,a,n)}}var qBe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),OG={RENDER_ORDER:"renderOrder"},XBe=function(t){qBe(e,t);function e(n){var r=this,i=n||{},o=cr({},i);return delete o.style,delete o.renderBuffer,delete o.updateWhileAnimating,delete o.updateWhileInteracting,r=t.call(this,o)||this,r.declutter_=i.declutter!==void 0?i.declutter:!1,r.renderBuffer_=i.renderBuffer!==void 0?i.renderBuffer:100,r.style_=null,r.styleFunction_=void 0,r.setStyle(i.style),r.updateWhileAnimating_=i.updateWhileAnimating!==void 0?i.updateWhileAnimating:!1,r.updateWhileInteracting_=i.updateWhileInteracting!==void 0?i.updateWhileInteracting:!1,r}return e.prototype.getDeclutter=function(){return this.declutter_},e.prototype.getFeatures=function(n){return t.prototype.getFeatures.call(this,n)},e.prototype.getRenderBuffer=function(){return this.renderBuffer_},e.prototype.getRenderOrder=function(){return this.get(OG.RENDER_ORDER)},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},e.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},e.prototype.renderDeclutter=function(n){n.declutterTree||(n.declutterTree=new Aoe(9)),this.getRenderer().renderDeclutter(n)},e.prototype.setRenderOrder=function(n){this.set(OG.RENDER_ORDER,n)},e.prototype.setStyle=function(n){this.style_=n!==void 0?n:IBe,this.styleFunction_=n===null?void 0:RBe(this.style_),this.changed()},e}(e2);const QBe=XBe;var bt={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},vS=[bt.FILL],yf=[bt.STROKE],gh=[bt.BEGIN_PATH],CG=[bt.CLOSE_PATH],YBe=function(){function t(){}return t.prototype.drawCustom=function(e,n,r,i){},t.prototype.drawGeometry=function(e){},t.prototype.setStyle=function(e){},t.prototype.drawCircle=function(e,n){},t.prototype.drawFeature=function(e,n){},t.prototype.drawGeometryCollection=function(e,n){},t.prototype.drawLineString=function(e,n){},t.prototype.drawMultiLineString=function(e,n){},t.prototype.drawMultiPoint=function(e,n){},t.prototype.drawMultiPolygon=function(e,n){},t.prototype.drawPoint=function(e,n){},t.prototype.drawPolygon=function(e,n){},t.prototype.drawText=function(e,n){},t.prototype.setFillStrokeStyle=function(e,n){},t.prototype.setImageStyle=function(e,n){},t.prototype.setTextStyle=function(e,n){},t}();const Roe=YBe;var KBe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ZBe=function(t){KBe(e,t);function e(n,r,i,o){var a=t.call(this)||this;return a.tolerance=n,a.maxExtent=r,a.pixelRatio=o,a.maxLineWidth=0,a.resolution=i,a.beginGeometryInstruction1_=null,a.beginGeometryInstruction2_=null,a.bufferedMaxExtent_=null,a.instructions=[],a.coordinates=[],a.tmpCoordinate_=[],a.hitDetectionInstructions=[],a.state={},a}return e.prototype.applyPixelRatio=function(n){var r=this.pixelRatio;return r==1?n:n.map(function(i){return i*r})},e.prototype.appendFlatPointCoordinates=function(n,r){for(var i=this.getBufferedMaxExtent(),o=this.tmpCoordinate_,a=this.coordinates,s=a.length,l=0,c=n.length;ll&&(this.instructions.push([bt.CUSTOM,l,u,n,i,vf]),this.hitDetectionInstructions.push([bt.CUSTOM,l,u,n,o||i,vf]));break;case"Point":c=n.getFlatCoordinates(),this.coordinates.push(c[0],c[1]),u=this.coordinates.length,this.instructions.push([bt.CUSTOM,l,u,n,i]),this.hitDetectionInstructions.push([bt.CUSTOM,l,u,n,o||i]);break}this.endGeometry(r)},e.prototype.beginGeometry=function(n,r){this.beginGeometryInstruction1_=[bt.BEGIN_GEOMETRY,r,0,n],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[bt.BEGIN_GEOMETRY,r,0,n],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var n=this.hitDetectionInstructions;n.reverse();var r,i=n.length,o,a,s=-1;for(r=0;rthis.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0},e.prototype.createFill=function(n){var r=n.fillStyle,i=[bt.SET_FILL_STYLE,r];return typeof r!="string"&&i.push(!0),i},e.prototype.applyStroke=function(n){this.instructions.push(this.createStroke(n))},e.prototype.createStroke=function(n){return[bt.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth*this.pixelRatio,n.lineCap,n.lineJoin,n.miterLimit,this.applyPixelRatio(n.lineDash),n.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(n,r){var i=n.fillStyle;(typeof i!="string"||n.currentFillStyle!=i)&&(i!==void 0&&this.instructions.push(r.call(this,n)),n.currentFillStyle=i)},e.prototype.updateStrokeStyle=function(n,r){var i=n.strokeStyle,o=n.lineCap,a=n.lineDash,s=n.lineDashOffset,l=n.lineJoin,c=n.lineWidth,u=n.miterLimit;(n.currentStrokeStyle!=i||n.currentLineCap!=o||a!=n.currentLineDash&&!Sp(n.currentLineDash,a)||n.currentLineDashOffset!=s||n.currentLineJoin!=l||n.currentLineWidth!=c||n.currentMiterLimit!=u)&&(i!==void 0&&r.call(this,n),n.currentStrokeStyle=i,n.currentLineCap=o,n.currentLineDash=a,n.currentLineDashOffset=s,n.currentLineJoin=l,n.currentLineWidth=c,n.currentMiterLimit=u)},e.prototype.endGeometry=function(n){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var r=[bt.END_GEOMETRY,n];this.instructions.push(r),this.hitDetectionInstructions.push(r)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Lie(this.maxExtent),this.maxLineWidth>0)){var n=this.resolution*(this.maxLineWidth+1)/2;Db(this.bufferedMaxExtent_,n,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(Roe);const W1=ZBe;var JBe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),eze=function(t){JBe(e,t);function e(n,r,i,o){var a=t.call(this,n,r,i,o)||this;return a.hitDetectionImage_=null,a.image_=null,a.imagePixelRatio_=void 0,a.anchorX_=void 0,a.anchorY_=void 0,a.height_=void 0,a.opacity_=void 0,a.originX_=void 0,a.originY_=void 0,a.rotateWithView_=void 0,a.rotation_=void 0,a.scale_=void 0,a.width_=void 0,a.declutterMode_=void 0,a.declutterImageWithText_=void 0,a}return e.prototype.drawPoint=function(n,r){if(this.image_){this.beginGeometry(n,r);var i=n.getFlatCoordinates(),o=n.getStride(),a=this.coordinates.length,s=this.appendFlatPointCoordinates(i,o);this.instructions.push([bt.DRAW_IMAGE,a,s,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([bt.DRAW_IMAGE,a,s,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(r)}},e.prototype.drawMultiPoint=function(n,r){if(this.image_){this.beginGeometry(n,r);var i=n.getFlatCoordinates(),o=n.getStride(),a=this.coordinates.length,s=this.appendFlatPointCoordinates(i,o);this.instructions.push([bt.DRAW_IMAGE,a,s,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([bt.DRAW_IMAGE,a,s,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(r)}},e.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(n,r){var i=n.getAnchor(),o=n.getSize(),a=n.getOrigin();this.imagePixelRatio_=n.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=n.getHitDetectionImage(),this.image_=n.getImage(this.pixelRatio),this.height_=o[1],this.opacity_=n.getOpacity(),this.originX_=a[0],this.originY_=a[1],this.rotateWithView_=n.getRotateWithView(),this.rotation_=n.getRotation(),this.scale_=n.getScaleArray(),this.width_=o[0],this.declutterMode_=n.getDeclutterMode(),this.declutterImageWithText_=r},e}(W1);const tze=eze;var nze=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),rze=function(t){nze(e,t);function e(n,r,i,o){return t.call(this,n,r,i,o)||this}return e.prototype.drawFlatCoordinates_=function(n,r,i,o){var a=this.coordinates.length,s=this.appendFlatLineCoordinates(n,r,i,o,!1,!1),l=[bt.MOVE_TO_LINE_TO,a,s];return this.instructions.push(l),this.hitDetectionInstructions.push(l),i},e.prototype.drawLineString=function(n,r){var i=this.state,o=i.strokeStyle,a=i.lineWidth;if(!(o===void 0||a===void 0)){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(n,r),this.hitDetectionInstructions.push([bt.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,jb,Bb],gh);var s=n.getFlatCoordinates(),l=n.getStride();this.drawFlatCoordinates_(s,0,s.length,l),this.hitDetectionInstructions.push(yf),this.endGeometry(r)}},e.prototype.drawMultiLineString=function(n,r){var i=this.state,o=i.strokeStyle,a=i.lineWidth;if(!(o===void 0||a===void 0)){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(n,r),this.hitDetectionInstructions.push([bt.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],gh);for(var s=n.getEnds(),l=n.getFlatCoordinates(),c=n.getStride(),u=0,f=0,d=s.length;ft&&(l>s&&(s=l,o=c,a=f),l=0,c=f-i)),d=h,g=y,v=x),p=b,m=_}return l+=h,l>s?[c,f]:[o,a]}var lze=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Wx={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},cze=function(t){lze(e,t);function e(n,r,i,o){var a=t.call(this,n,r,i,o)||this;return a.labels_=null,a.text_="",a.textOffsetX_=0,a.textOffsetY_=0,a.textRotateWithView_=void 0,a.textRotation_=0,a.textFillState_=null,a.fillStates={},a.textStrokeState_=null,a.strokeStates={},a.textState_={},a.textStates={},a.textKey_="",a.fillKey_="",a.strokeKey_="",a.declutterImageWithText_=void 0,a}return e.prototype.finish=function(){var n=t.prototype.finish.call(this);return n.textStates=this.textStates,n.fillStates=this.fillStates,n.strokeStates=this.strokeStates,n},e.prototype.drawText=function(n,r){var i=this.textFillState_,o=this.textStrokeState_,a=this.textState_;if(!(this.text_===""||!a||!i&&!o)){var s=this.coordinates,l=s.length,c=n.getType(),u=null,f=n.getStride();if(a.placement===LBe.LINE&&(c=="LineString"||c=="MultiLineString"||c=="Polygon"||c=="MultiPolygon")){if(!so(this.getBufferedMaxExtent(),n.getExtent()))return;var d=void 0;if(u=n.getFlatCoordinates(),c=="LineString")d=[u.length];else if(c=="MultiLineString")d=n.getEnds();else if(c=="Polygon")d=n.getEnds().slice(0,1);else if(c=="MultiPolygon"){var h=n.getEndss();d=[];for(var p=0,m=h.length;pP[2]}else I=b>E;var R=Math.PI,T=[],L=S+r===e;e=S,g=0,v=O,d=t[e],h=t[e+1];var z;if(L){y(),z=Math.atan2(h-m,d-p),I&&(z+=z>0?-R:R);var B=(E+b)/2,W=(k+_)/2;return T[0]=[B,W,(C-o)/2,z,i],T}i=i.replace(/\n/g," ");for(var U=0,N=i.length;U0?-R:R),z!==void 0){var D=$-z;if(D+=D>R?-2*R:D<-R?2*R:0,Math.abs(D)>a)return null}z=$;for(var A=U,q=0;U0&&t.push(` -`,""),t.push(e,""),t}var wze=function(){function t(e,n,r,i){this.overlaps=r,this.pixelRatio=n,this.resolution=e,this.alignFill_,this.instructions=i.instructions,this.coordinates=i.coordinates,this.coordinateCache_={},this.renderedTransform_=Wl(),this.hitDetectionInstructions=i.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=i.fillStates||{},this.strokeStates=i.strokeStates||{},this.textStates=i.textStates||{},this.widths_={},this.labels_={}}return t.prototype.createLabel=function(e,n,r,i){var o=e+n+r+i;if(this.labels_[o])return this.labels_[o];var a=i?this.strokeStates[i]:null,s=r?this.fillStates[r]:null,l=this.textStates[n],c=this.pixelRatio,u=[l.scale[0]*c,l.scale[1]*c],f=Array.isArray(e),d=l.justify?Wx[l.justify]:kG(Array.isArray(e)?e[0]:e,l.textAlign||Wb),h=i&&a.lineWidth?a.lineWidth:0,p=f?e:e.split(` -`).reduce(_ze,[]),m=CBe(l,p),g=m.width,v=m.height,y=m.widths,x=m.heights,b=m.lineWidths,_=g+h,S=[],O=(_+2)*u[0],C=(v+h)*u[1],E={width:O<0?Math.floor(O):Math.ceil(O),height:C<0?Math.floor(C):Math.ceil(C),contextInstructions:S};if((u[0]!=1||u[1]!=1)&&S.push("scale",u),i){S.push("strokeStyle",a.strokeStyle),S.push("lineWidth",h),S.push("lineCap",a.lineCap),S.push("lineJoin",a.lineJoin),S.push("miterLimit",a.miterLimit);var k=VM?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D;k.prototype.setLineDash&&(S.push("setLineDash",[a.lineDash]),S.push("lineDashOffset",a.lineDashOffset))}r&&S.push("fillStyle",s.fillStyle),S.push("textBaseline","middle"),S.push("textAlign","center");for(var I=.5-d,P=d*_+I*h,R=[],T=[],L=0,z=0,B=0,W=0,U,N=0,$=p.length;N<$;N+=2){var D=p[N];if(D===` -`){z+=L,L=0,P=d*_+I*h,++W;continue}var A=p[N+1]||l.font;A!==U&&(i&&R.push("font",A),r&&T.push("font",A),U=A),L=Math.max(L,x[B]);var q=[D,P+I*y[B]+d*(y[B]-b[W]),.5*(h+L)+z];P+=y[B],i&&R.push("strokeText",q),r&&T.push("fillText",q),++B}return Array.prototype.push.apply(S,R),Array.prototype.push.apply(S,T),this.labels_[o]=E,E},t.prototype.replayTextBackground_=function(e,n,r,i,o,a,s){e.beginPath(),e.moveTo.apply(e,n),e.lineTo.apply(e,r),e.lineTo.apply(e,i),e.lineTo.apply(e,o),e.lineTo.apply(e,n),a&&(this.alignFill_=a[2],this.fill_(e)),s&&(this.setStrokeStyle_(e,s),e.stroke())},t.prototype.calculateImageOrLabelDimensions_=function(e,n,r,i,o,a,s,l,c,u,f,d,h,p,m,g){s*=d[0],l*=d[1];var v=r-s,y=i-l,x=o+c>e?e-c:o,b=a+u>n?n-u:a,_=p[3]+x*d[0]+p[1],S=p[0]+b*d[1]+p[2],O=v-p[3],C=y-p[0];(m||f!==0)&&(Pu[0]=O,Mu[0]=O,Pu[1]=C,dc[1]=C,dc[0]=O+_,hc[0]=dc[0],hc[1]=C+S,Mu[1]=hc[1]);var E;return f!==0?(E=cu(Wl(),r,i,1,1,f,-r,-i),Or(E,Pu),Or(E,dc),Or(E,hc),Or(E,Mu),Qs(Math.min(Pu[0],dc[0],hc[0],Mu[0]),Math.min(Pu[1],dc[1],hc[1],Mu[1]),Math.max(Pu[0],dc[0],hc[0],Mu[0]),Math.max(Pu[1],dc[1],hc[1],Mu[1]),Yp)):Qs(Math.min(O,O+_),Math.min(C,C+S),Math.max(O,O+_),Math.max(C,C+S),Yp),h&&(v=Math.round(v),y=Math.round(y)),{drawImageX:v,drawImageY:y,drawImageW:x,drawImageH:b,originX:c,originY:u,declutterBox:{minX:Yp[0],minY:Yp[1],maxX:Yp[2],maxY:Yp[3],value:g},canvasTransform:E,scale:d}},t.prototype.replayImageOrLabel_=function(e,n,r,i,o,a,s){var l=!!(a||s),c=i.declutterBox,u=e.canvas,f=s?s[2]*i.scale[0]/2:0,d=c.minX-f<=u.width/n&&c.maxX+f>=0&&c.minY-f<=u.height/n&&c.maxY+f>=0;return d&&(l&&this.replayTextBackground_(e,Pu,dc,hc,Mu,a,s),TBe(e,i.canvasTransform,o,r,i.originX,i.originY,i.drawImageW,i.drawImageH,i.drawImageX,i.drawImageY,i.scale)),!0},t.prototype.fill_=function(e){if(this.alignFill_){var n=Or(this.renderedTransform_,[0,0]),r=512*this.pixelRatio;e.save(),e.translate(n[0]%r,n[1]%r),e.rotate(this.viewRotation_)}e.fill(),this.alignFill_&&e.restore()},t.prototype.setStrokeStyle_=function(e,n){e.strokeStyle=n[1],e.lineWidth=n[2],e.lineCap=n[3],e.lineJoin=n[4],e.miterLimit=n[5],e.setLineDash&&(e.lineDashOffset=n[7],e.setLineDash(n[6]))},t.prototype.drawLabelWithPointPlacement_=function(e,n,r,i){var o=this.textStates[n],a=this.createLabel(e,n,i,r),s=this.strokeStates[r],l=this.pixelRatio,c=kG(Array.isArray(e)?e[0]:e,o.textAlign||Wb),u=Wx[o.textBaseline||zT],f=s&&s.lineWidth?s.lineWidth:0,d=a.width/l-2*o.scale[0],h=c*d+2*(.5-c)*f,p=u*a.height/l+2*(.5-u)*f;return{label:a,anchorX:h,anchorY:p}},t.prototype.execute_=function(e,n,r,i,o,a,s,l){var c;this.pixelCoordinates_&&Sp(r,this.renderedTransform_)?c=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),c=Dh(this.coordinates,0,this.coordinates.length,2,r,this.pixelCoordinates_),EFe(this.renderedTransform_,r));for(var u=0,f=i.length,d=0,h,p,m,g,v,y,x,b,_,S,O,C,E=0,k=0,I=null,P=null,R=this.coordinateCache_,T=this.viewRotation_,L=Math.round(Math.atan2(-r[1],r[0])*1e12)/1e12,z={context:e,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:T},B=this.instructions!=i||this.overlaps?0:200,W,U,N,$;uB&&(this.fill_(e),E=0),k>B&&(e.stroke(),k=0),!E&&!k&&(e.beginPath(),g=NaN,v=NaN),++u;break;case bt.CIRCLE:d=D[1];var q=c[d],Y=c[d+1],K=c[d+2],se=c[d+3],te=K-q,J=se-Y,pe=Math.sqrt(te*te+J*J);e.moveTo(q+pe,Y),e.arc(q,Y,pe,0,2*Math.PI,!0),++u;break;case bt.CLOSE_PATH:e.closePath(),++u;break;case bt.CUSTOM:d=D[1],h=D[2];var be=D[3],re=D[4],ve=D.length==6?D[5]:void 0;z.geometry=be,z.feature=W,u in R||(R[u]=[]);var F=R[u];ve?ve(c,d,h,2,F):(F[0]=c[d],F[1]=c[d+1],F.length=2),re(F,z),++u;break;case bt.DRAW_IMAGE:d=D[1],h=D[2],b=D[3],p=D[4],m=D[5];var ce=D[6],le=D[7],Q=D[8],X=D[9],ee=D[10],ge=D[11],ye=D[12],H=D[13],G=D[14],ie=D[15];if(!b&&D.length>=20){_=D[19],S=D[20],O=D[21],C=D[22];var he=this.drawLabelWithPointPlacement_(_,S,O,C);b=he.label,D[3]=b;var _e=D[23];p=(he.anchorX-_e)*this.pixelRatio,D[4]=p;var oe=D[24];m=(he.anchorY-oe)*this.pixelRatio,D[5]=m,ce=b.height,D[6]=ce,H=b.width,D[13]=H}var Z=void 0;D.length>25&&(Z=D[25]);var V=void 0,de=void 0,xe=void 0;D.length>17?(V=D[16],de=D[17],xe=D[18]):(V=mh,de=!1,xe=!1),ee&&L?ge+=T:!ee&&!L&&(ge-=T);for(var Me=0;d0){if(!a||h!=="Image"&&h!=="Text"||a.indexOf(S)!==-1){var I=(d[E]-3)/4,P=i-I%s,R=i-(I/s|0),T=o(S,O,P*P+R*R);if(T)return T}u.clearRect(0,0,s,s);break}}var m=Object.keys(this.executorsByZIndex_).map(Number);m.sort(Yh);var g,v,y,x,b;for(g=m.length-1;g>=0;--g){var _=m[g].toString();for(y=this.executorsByZIndex_[_],v=kA.length-1;v>=0;--v)if(h=kA[v],x=y[h],x!==void 0&&(b=x.executeHitDetection(u,l,r,p,f),b))return b}},t.prototype.getClipCoords=function(e){var n=this.maxExtent_;if(!n)return null;var r=n[0],i=n[1],o=n[2],a=n[3],s=[r,i,r,a,o,a,o,i];return Dh(s,0,8,2,e,s),s},t.prototype.isEmpty=function(){return Zg(this.executorsByZIndex_)},t.prototype.execute=function(e,n,r,i,o,a,s){var l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(Yh),this.maxExtent_&&(e.save(),this.clip(e,r));var c=a||kA,u,f,d,h,p,m;for(s&&l.reverse(),u=0,f=l.length;un)break;var s=r[a];s||(s=[],r[a]=s),s.push(((t+i)*e+(t+o))*4+3),i>0&&s.push(((t-i)*e+(t+o))*4+3),o>0&&(s.push(((t+i)*e+(t-o))*4+3),i>0&&s.push(((t-i)*e+(t-o))*4+3))}for(var l=[],i=0,c=r.length;ithis.maxCacheSize_},t.prototype.expire=function(){if(this.canExpireCache()){var e=0;for(var n in this.cache_){var r=this.cache_[n];!(e++&3)&&!r.hasListener()&&(delete this.cache_[n],--this.cacheSize_)}}},t.prototype.get=function(e,n,r){var i=RG(e,n,r);return i in this.cache_?this.cache_[i]:null},t.prototype.set=function(e,n,r,i){var o=RG(e,n,r);this.cache_[o]=i,++this.cacheSize_},t.prototype.setSize=function(e){this.maxCacheSize_=e,this.expire()},t}();function RG(t,e,n){var r=n?Soe(n):"null";return e+":"+t+":"+r}var VT=new Pze,Mze=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),kze=function(t){Mze(e,t);function e(n,r,i,o){var a=t.call(this)||this;return a.extent=n,a.pixelRatio_=i,a.resolution=r,a.state=o,a}return e.prototype.changed=function(){this.dispatchEvent(Mt.CHANGE)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return vt()},e.prototype.getPixelRatio=function(){return this.pixelRatio_},e.prototype.getResolution=function(){return this.resolution},e.prototype.getState=function(){return this.state},e.prototype.load=function(){vt()},e}(ty);const Aze=kze;var Rze=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){Rze(e,t);function e(n,r,i,o,a,s){var l=t.call(this,n,r,i,Un.IDLE)||this;return l.src_=o,l.image_=new Image,a!==null&&(l.image_.crossOrigin=a),l.unlisten_=null,l.state=Un.IDLE,l.imageLoadFunction_=s,l}return e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=Un.ERROR,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){this.resolution===void 0&&(this.resolution=hs(this.extent)/this.image_.height),this.state=Un.LOADED,this.unlistenImage_(),this.changed()},e.prototype.load=function(){(this.state==Un.IDLE||this.state==Un.ERROR)&&(this.state=Un.LOADING,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=uB(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(n){this.image_=n,this.resolution=hs(this.extent)/this.image_.height},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e})(Aze);function uB(t,e,n){var r=t,i=!0,o=!1,a=!1,s=[kT(r,Mt.LOAD,function(){a=!0,o||e()})];return r.src&&CFe?(o=!0,r.decode().then(function(){i&&e()}).catch(function(l){i&&(a?e():n())})):s.push(kT(r,Mt.ERROR,n)),function(){i=!1,s.forEach(tr)}}var Ize=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),v0=null,Dze=function(t){Ize(e,t);function e(n,r,i,o,a,s){var l=t.call(this)||this;return l.hitDetectionImage_=null,l.image_=n||new Image,o!==null&&(l.image_.crossOrigin=o),l.canvas_={},l.color_=s,l.unlisten_=null,l.imageState_=a,l.size_=i,l.src_=r,l.tainted_,l}return e.prototype.isTainted_=function(){if(this.tainted_===void 0&&this.imageState_===Un.LOADED){v0||(v0=Ca(1,1)),v0.drawImage(this.image_,0,0);try{v0.getImageData(0,0,1,1),this.tainted_=!1}catch{v0=null,this.tainted_=!0}}return this.tainted_===!0},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(Mt.CHANGE)},e.prototype.handleImageError_=function(){this.imageState_=Un.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=Un.LOADED,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.getImage=function(n){return this.replaceColor_(n),this.canvas_[n]?this.canvas_[n]:this.image_},e.prototype.getPixelRatio=function(n){return this.replaceColor_(n),this.canvas_[n]?n:1},e.prototype.getImageState=function(){return this.imageState_},e.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var n=this.size_[0],r=this.size_[1],i=Ca(n,r);i.fillRect(0,0,n,r),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},e.prototype.getSize=function(){return this.size_},e.prototype.getSrc=function(){return this.src_},e.prototype.load=function(){if(this.imageState_==Un.IDLE){this.imageState_=Un.LOADING;try{this.image_.src=this.src_}catch{this.handleImageError_()}this.unlisten_=uB(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(n){if(!(!this.color_||this.canvas_[n]||this.imageState_!==Un.LOADED)){var r=document.createElement("canvas");this.canvas_[n]=r,r.width=Math.ceil(this.image_.width*n),r.height=Math.ceil(this.image_.height*n);var i=r.getContext("2d");if(i.scale(n,n),i.drawImage(this.image_,0,0),i.globalCompositeOperation="multiply",i.globalCompositeOperation==="multiply"||this.isTainted_())i.fillStyle=Soe(this.color_),i.fillRect(0,0,r.width/n,r.height/n),i.globalCompositeOperation="destination-in",i.drawImage(this.image_,0,0);else{for(var o=i.getImageData(0,0,r.width,r.height),a=o.data,s=this.color_[0]/255,l=this.color_[1]/255,c=this.color_[2]/255,u=this.color_[3],f=0,d=a.length;f0,6);var f=i.src!==void 0?Un.IDLE:Un.LOADED;return r.color_=i.color!==void 0?jT(i.color):null,r.iconImage_=Lze(c,u,r.imgSize_!==void 0?r.imgSize_:null,r.crossOrigin_,f,r.color_),r.offset_=i.offset!==void 0?i.offset:[0,0],r.offsetOrigin_=i.offsetOrigin!==void 0?i.offsetOrigin:Ra.TOP_LEFT,r.origin_=null,r.size_=i.size!==void 0?i.size:null,r}return e.prototype.clone=function(){var n=this.getScale();return new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,imgSize:this.imgSize_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:Array.isArray(n)?n.slice():n,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})},e.prototype.getAnchor=function(){var n=this.normalizedAnchor_;if(!n){n=this.anchor_;var r=this.getSize();if(this.anchorXUnits_==nf.FRACTION||this.anchorYUnits_==nf.FRACTION){if(!r)return null;n=this.anchor_.slice(),this.anchorXUnits_==nf.FRACTION&&(n[0]*=r[0]),this.anchorYUnits_==nf.FRACTION&&(n[1]*=r[1])}if(this.anchorOrigin_!=Ra.TOP_LEFT){if(!r)return null;n===this.anchor_&&(n=this.anchor_.slice()),(this.anchorOrigin_==Ra.TOP_RIGHT||this.anchorOrigin_==Ra.BOTTOM_RIGHT)&&(n[0]=-n[0]+r[0]),(this.anchorOrigin_==Ra.BOTTOM_LEFT||this.anchorOrigin_==Ra.BOTTOM_RIGHT)&&(n[1]=-n[1]+r[1])}this.normalizedAnchor_=n}var i=this.getDisplacement();return[n[0]-i[0],n[1]+i[1]]},e.prototype.setAnchor=function(n){this.anchor_=n,this.normalizedAnchor_=null},e.prototype.getColor=function(){return this.color_},e.prototype.getImage=function(n){return this.iconImage_.getImage(n)},e.prototype.getPixelRatio=function(n){return this.iconImage_.getPixelRatio(n)},e.prototype.getImageSize=function(){return this.iconImage_.getSize()},e.prototype.getImageState=function(){return this.iconImage_.getImageState()},e.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},e.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var n=this.offset_;if(this.offsetOrigin_!=Ra.TOP_LEFT){var r=this.getSize(),i=this.iconImage_.getSize();if(!r||!i)return null;n=n.slice(),(this.offsetOrigin_==Ra.TOP_RIGHT||this.offsetOrigin_==Ra.BOTTOM_RIGHT)&&(n[0]=i[0]-r[0]-n[0]),(this.offsetOrigin_==Ra.BOTTOM_LEFT||this.offsetOrigin_==Ra.BOTTOM_RIGHT)&&(n[1]=i[1]-r[1]-n[1])}return this.origin_=n,this.origin_},e.prototype.getSrc=function(){return this.iconImage_.getSrc()},e.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},e.prototype.listenImageChange=function(n){this.iconImage_.addEventListener(Mt.CHANGE,n)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(n){this.iconImage_.removeEventListener(Mt.CHANGE,n)},e}(woe);const Fze=Nze;var bl=.5;function jze(t,e,n,r,i,o,a){var s=t[0]*bl,l=t[1]*bl,c=Ca(s,l);c.imageSmoothingEnabled=!1;for(var u=c.canvas,f=new Eze(c,bl,i,null,a),d=n.length,h=Math.floor((256*256*256-1)/d),p={},m=1;m<=d;++m){var g=n[m-1],v=g.getStyleFunction()||r;if(r){var y=v(g,o);if(y){Array.isArray(y)||(y=[y]);for(var x=m*h,b="#"+("000000"+x.toString(16)).slice(-6),_=0,S=y.length;_m[2];)++y,x=v*y,f.push(this.getRenderTransform(o,a,s,bl,d,h,x).slice()),g-=v}this.hitDetectionImageData_=jze(i,f,this.renderedFeatures_,u.getStyleFunction(),c,a,s)}r(Bze(n,this.renderedFeatures_,this.hitDetectionImageData_))}).bind(this))},e.prototype.forEachFeatureAtCoordinate=function(n,r,i,o,a){var s=this;if(this.replayGroup_){var l=r.viewState.resolution,c=r.viewState.rotation,u=this.getLayer(),f={},d=function(m,g,v){var y=vn(m),x=f[y];if(x){if(x!==!0&&v_[0]&&C[2]>_[2]&&b.push([C[0]-S,C[1],C[2]-S,C[3]])}if(this.ready&&this.renderedResolution_==d&&this.renderedRevision_==p&&this.renderedRenderOrder_==g&&Xm(this.wrappedRenderedExtent_,y))return Sp(this.renderedExtent_,x)||(this.hitDetectionImageData_=null,this.renderedExtent_=x),this.renderedCenter_=v,this.replayGroupChanged=!1,!0;this.replayGroup_=null;var E=new EG(o$(d,h),y,d,h),k;this.getLayer().getDeclutter()&&(k=new EG(o$(d,h),y,d,h));for(var I,P,R,P=0,R=b.length;P=200&&s.status<300){var c=e.getType(),u=void 0;c=="json"||c=="text"?u=s.responseText:c=="xml"?(u=s.responseXML,u||(u=new DOMParser().parseFromString(s.responseText,"application/xml"))):c=="arraybuffer"&&(u=s.response),u?o(e.readFeatures(u,{extent:n,featureProjection:i}),e.readProjection(u)):a()}else a()},s.onerror=a,s.send()}function $G(t,e){return function(n,r,i,o,a){var s=this;s4e(t,e,n,r,i,function(l,c){s.addFeatures(l),o!==void 0&&o(l)},a||Kh)}}var Foe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ku=function(t){Foe(e,t);function e(n,r,i){var o=t.call(this,n)||this;return o.feature=r,o.features=i,o}return e}(rc),l4e=function(t){Foe(e,t);function e(n){var r=this,i=n||{};r=t.call(this,{attributions:i.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:i.wrapX!==void 0?i.wrapX:!0})||this,r.on,r.once,r.un,r.loader_=Kh,r.format_=i.format,r.overlaps_=i.overlaps===void 0?!0:i.overlaps,r.url_=i.url,i.loader!==void 0?r.loader_=i.loader:r.url_!==void 0&&(Ut(r.format_,7),r.loader_=$G(r.url_,r.format_)),r.strategy_=i.strategy!==void 0?i.strategy:o4e;var o=i.useSpatialIndex!==void 0?i.useSpatialIndex:!0;r.featuresRtree_=o?new DG:null,r.loadedExtentsRtree_=new DG,r.loadingExtentsCount_=0,r.nullGeometryFeatures_={},r.idIndex_={},r.uidIndex_={},r.featureChangeKeys_={},r.featuresCollection_=null;var a,s;return Array.isArray(i.features)?s=i.features:i.features&&(a=i.features,s=a.getArray()),!o&&a===void 0&&(a=new Xa(s)),s!==void 0&&r.addFeaturesInternal(s),a!==void 0&&r.bindFeaturesCollection_(a),r}return e.prototype.addFeature=function(n){this.addFeatureInternal(n),this.changed()},e.prototype.addFeatureInternal=function(n){var r=vn(n);if(!this.addToIndex_(r,n)){this.featuresCollection_&&this.featuresCollection_.remove(n);return}this.setupChangeEvents_(r,n);var i=n.getGeometry();if(i){var o=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(o,n)}else this.nullGeometryFeatures_[r]=n;this.dispatchEvent(new ku(Cs.ADDFEATURE,n))},e.prototype.setupChangeEvents_=function(n,r){this.featureChangeKeys_[n]=[rn(r,Mt.CHANGE,this.handleFeatureChange_,this),rn(r,Kg.PROPERTYCHANGE,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(n,r){var i=!0,o=r.getId();return o!==void 0&&(o.toString()in this.idIndex_?i=!1:this.idIndex_[o.toString()]=r),i&&(Ut(!(n in this.uidIndex_),30),this.uidIndex_[n]=r),i},e.prototype.addFeatures=function(n){this.addFeaturesInternal(n),this.changed()},e.prototype.addFeaturesInternal=function(n){for(var r=[],i=[],o=[],a=0,s=n.length;a0},e.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),t.prototype.refresh.call(this)},e.prototype.removeLoadedExtent=function(n){var r=this.loadedExtentsRtree_,i;r.forEachInExtent(n,function(o){if(Lb(o.extent,n))return i=o,!0}),i&&r.remove(i)},e.prototype.removeFeature=function(n){if(n){var r=vn(n);r in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[r]:this.featuresRtree_&&this.featuresRtree_.remove(n);var i=this.removeFeatureInternal(n);i&&this.changed()}},e.prototype.removeFeatureInternal=function(n){var r=vn(n),i=this.featureChangeKeys_[r];if(i){i.forEach(tr),delete this.featureChangeKeys_[r];var o=n.getId();return o!==void 0&&delete this.idIndex_[o.toString()],delete this.uidIndex_[r],this.dispatchEvent(new ku(Cs.REMOVEFEATURE,n)),n}},e.prototype.removeFromIdIndex_=function(n){var r=!1;for(var i in this.idIndex_)if(this.idIndex_[i]===n){delete this.idIndex_[i],r=!0;break}return r},e.prototype.setLoader=function(n){this.loader_=n},e.prototype.setUrl=function(n){Ut(this.format_,7),this.url_=n,this.setLoader($G(n,this.format_))},e}(Noe);const V1=l4e;function Au(t,e){return Or(t.inversePixelTransform,e.slice(0))}const St={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function joe(t){return Math.pow(t,3)}function sy(t){return 1-joe(1-t)}function c4e(t){return 3*t*t-2*t*t*t}function u4e(t){return t}var f4e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),d4e=function(t){f4e(e,t);function e(n,r,i){var o=t.call(this)||this,a=i||{};return o.tileCoord=n,o.state=r,o.interimTile=null,o.key="",o.transition_=a.transition===void 0?250:a.transition,o.transitionStarts_={},o.interpolate=!!a.interpolate,o}return e.prototype.changed=function(){this.dispatchEvent(Mt.CHANGE)},e.prototype.release=function(){},e.prototype.getKey=function(){return this.key+"/"+this.tileCoord},e.prototype.getInterimTile=function(){if(!this.interimTile)return this;var n=this.interimTile;do{if(n.getState()==St.LOADED)return this.transition_=0,n;n=n.interimTile}while(n);return this},e.prototype.refreshInterimChain=function(){if(this.interimTile){var n=this.interimTile,r=this;do{if(n.getState()==St.LOADED){n.interimTile=null;break}else n.getState()==St.LOADING?r=n:n.getState()==St.IDLE?r.interimTile=n.interimTile:r=n;n=r.interimTile}while(n)}},e.prototype.getTileCoord=function(){return this.tileCoord},e.prototype.getState=function(){return this.state},e.prototype.setState=function(n){if(this.state!==St.ERROR&&this.state>n)throw new Error("Tile load sequence violation");this.state=n,this.changed()},e.prototype.load=function(){vt()},e.prototype.getAlpha=function(n,r){if(!this.transition_)return 1;var i=this.transitionStarts_[n];if(!i)i=r,this.transitionStarts_[n]=i;else if(i===-1)return 1;var o=r-i+1e3/60;return o>=this.transition_?1:joe(o/this.transition_)},e.prototype.inTransition=function(n){return this.transition_?this.transitionStarts_[n]!==-1:!1},e.prototype.endTransition=function(n){this.transition_&&(this.transitionStarts_[n]=-1)},e}(ty);const Boe=d4e;var h4e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),p4e=function(t){h4e(e,t);function e(n,r,i,o,a,s){var l=t.call(this,n,r,s)||this;return l.crossOrigin_=o,l.src_=i,l.key=i,l.image_=new Image,o!==null&&(l.image_.crossOrigin=o),l.unlisten_=null,l.tileLoadFunction_=a,l}return e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(n){this.image_=n,this.state=St.LOADED,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){this.state=St.ERROR,this.unlistenImage_(),this.image_=m4e(),this.changed()},e.prototype.handleImageLoad_=function(){var n=this.image_;n.naturalWidth&&n.naturalHeight?this.state=St.LOADED:this.state=St.EMPTY,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==St.ERROR&&(this.state=St.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==St.IDLE&&(this.state=St.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=uB(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(Boe);function m4e(){var t=Ca(1,1);return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas}const fB=p4e;var g4e=function(){function t(e,n,r){this.decay_=e,this.minVelocity_=n,this.delay_=r,this.points_=[],this.angle_=0,this.initialVelocity_=0}return t.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},t.prototype.update=function(e,n){this.points_.push(e,n,Date.now())},t.prototype.end=function(){if(this.points_.length<6)return!1;var e=Date.now()-this.delay_,n=this.points_.length-3;if(this.points_[n+2]0&&this.points_[r+2]>e;)r-=3;var i=this.points_[n+2]-this.points_[r+2];if(i<1e3/60)return!1;var o=this.points_[n]-this.points_[r],a=this.points_[n+1]-this.points_[r+1];return this.angle_=Math.atan2(a,o),this.initialVelocity_=Math.sqrt(o*o+a*a)/i,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}(),v4e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),y4e=function(t){v4e(e,t);function e(n){var r=t.call(this)||this;return r.map_=n,r}return e.prototype.dispatchRenderEvent=function(n,r){vt()},e.prototype.calculateMatrices2D=function(n){var r=n.viewState,i=n.coordinateToPixelTransform,o=n.pixelToCoordinateTransform;cu(i,n.size[0]/2,n.size[1]/2,1/r.resolution,-1/r.resolution,-r.rotation,-r.center[0],-r.center[1]),N5(o,i)},e.prototype.forEachFeatureAtCoordinate=function(n,r,i,o,a,s,l,c){var u,f=r.viewState;function d(L,z,B,W){return a.call(s,z,L?B:null,W)}var h=f.projection,p=Uie(n.slice(),h),m=[[0,0]];if(h.canWrapX()&&o){var g=h.getExtent(),v=Yn(g);m.push([-v,0],[v,0])}for(var y=r.layerStatesArray,x=y.length,b=[],_=[],S=0;S=0;--O){var C=y[O],E=C.layer;if(E.hasRenderer()&&WT(C,f)&&l.call(c,E)){var k=E.getRenderer(),I=E.getSource();if(k&&I){var P=I.getWrapX()?p:n,R=d.bind(null,C.managed);_[0]=P[0]+m[S][0],_[1]=P[1]+m[S][1],u=k.forEachFeatureAtCoordinate(_,r,i,R,b)}if(u)return u}}if(b.length!==0){var T=1/b.length;return b.forEach(function(L,z){return L.distanceSq+=z*T}),b.sort(function(L,z){return L.distanceSq-z.distanceSq}),b.some(function(L){return u=L.callback(L.feature,L.layer,L.geometry)}),u}},e.prototype.forEachLayerAtPixel=function(n,r,i,o,a){return vt()},e.prototype.hasFeatureAtCoordinate=function(n,r,i,o,a,s){var l=this.forEachFeatureAtCoordinate(n,r,i,o,Rh,this,a,s);return l!==void 0},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(n){vt()},e.prototype.scheduleExpireIconCache=function(n){VT.canExpireCache()&&n.postRenderFunctions.push(x4e)},e}(L5);function x4e(t,e){VT.expire()}const b4e=y4e;var _4e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),w4e=function(t){_4e(e,t);function e(n){var r=t.call(this,n)||this;r.fontChangeListenerKey_=rn(Sc,Kg.PROPERTYCHANGE,n.redrawText.bind(n)),r.element_=document.createElement("div");var i=r.element_.style;i.position="absolute",i.width="100%",i.height="100%",i.zIndex="0",r.element_.className=B1+" ol-layers";var o=n.getViewport();return o.insertBefore(r.element_,o.firstChild||null),r.children_=[],r.renderedVisible_=!0,r}return e.prototype.dispatchRenderEvent=function(n,r){var i=this.getMap();if(i.hasListener(n)){var o=new Ioe(n,void 0,r);i.dispatchEvent(o)}},e.prototype.disposeInternal=function(){tr(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),t.prototype.disposeInternal.call(this)},e.prototype.renderFrame=function(n){if(!n){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(n),this.dispatchRenderEvent(Lf.PRECOMPOSE,n);var r=n.layerStatesArray.sort(function(h,p){return h.zIndex-p.zIndex}),i=n.viewState;this.children_.length=0;for(var o=[],a=null,s=0,l=r.length;s=0;--s)o[s].renderDeclutter(n);bBe(this.element_,this.children_),this.dispatchRenderEvent(Lf.POSTCOMPOSE,n),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(n)},e.prototype.forEachLayerAtPixel=function(n,r,i,o,a){for(var s=r.viewState,l=r.layerStatesArray,c=l.length,u=c-1;u>=0;--u){var f=l[u],d=f.layer;if(d.hasRenderer()&&WT(f,s)&&a(d)){var h=d.getRenderer(),p=h.getDataAtPixel(n,r,i);if(p){var m=o(d,p);if(m)return m}}}},e}(b4e);const S4e=w4e;var zoe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),rf=function(t){zoe(e,t);function e(n,r){var i=t.call(this,n)||this;return i.layer=r,i}return e}(rc),RA={LAYERS:"layers"},O4e=function(t){zoe(e,t);function e(n){var r=this,i=n||{},o=cr({},i);delete o.layers;var a=i.layers;return r=t.call(this,o)||this,r.on,r.once,r.un,r.layersListenerKeys_=[],r.listenerKeys_={},r.addChangeListener(RA.LAYERS,r.handleLayersChanged_),a?Array.isArray(a)?a=new Xa(a.slice(),{unique:!0}):Ut(typeof a.getArray=="function",43):a=new Xa(void 0,{unique:!0}),r.setLayers(a),r}return e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(tr),this.layersListenerKeys_.length=0;var n=this.getLayers();this.layersListenerKeys_.push(rn(n,Oo.ADD,this.handleLayersAdd_,this),rn(n,Oo.REMOVE,this.handleLayersRemove_,this));for(var r in this.listenerKeys_)this.listenerKeys_[r].forEach(tr);I1(this.listenerKeys_);for(var i=n.getArray(),o=0,a=i.length;othis.moveTolerance_||Math.abs(n.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(tr(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(Mt.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(tr(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(tr),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(ty);const A4e=k4e,Hu={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},Ui={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"};var GT=1/0,R4e=function(){function t(e,n){this.priorityFunction_=e,this.keyFunction_=n,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return t.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,I1(this.queuedElements_)},t.prototype.dequeue=function(){var e=this.elements_,n=this.priorities_,r=e[0];e.length==1?(e.length=0,n.length=0):(e[0]=e.pop(),n[0]=n.pop(),this.siftUp_(0));var i=this.keyFunction_(r);return delete this.queuedElements_[i],r},t.prototype.enqueue=function(e){Ut(!(this.keyFunction_(e)in this.queuedElements_),31);var n=this.priorityFunction_(e);return n!=GT?(this.elements_.push(e),this.priorities_.push(n),this.queuedElements_[this.keyFunction_(e)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1},t.prototype.getCount=function(){return this.elements_.length},t.prototype.getLeftChildIndex_=function(e){return e*2+1},t.prototype.getRightChildIndex_=function(e){return e*2+2},t.prototype.getParentIndex_=function(e){return e-1>>1},t.prototype.heapify_=function(){var e;for(e=(this.elements_.length>>1)-1;e>=0;e--)this.siftUp_(e)},t.prototype.isEmpty=function(){return this.elements_.length===0},t.prototype.isKeyQueued=function(e){return e in this.queuedElements_},t.prototype.isQueued=function(e){return this.isKeyQueued(this.keyFunction_(e))},t.prototype.siftUp_=function(e){for(var n=this.elements_,r=this.priorities_,i=n.length,o=n[e],a=r[e],s=e;e>1;){var l=this.getLeftChildIndex_(e),c=this.getRightChildIndex_(e),u=ce;){var s=this.getParentIndex_(n);if(i[s]>a)r[n]=r[s],i[n]=i[s],n=s;else break}r[n]=o,i[n]=a},t.prototype.reprioritize=function(){var e=this.priorityFunction_,n=this.elements_,r=this.priorities_,i=0,o=n.length,a,s,l;for(s=0;s0;)a=this.dequeue()[0],s=a.getKey(),o=a.getState(),o===St.IDLE&&!(s in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[s]=!0,++this.tilesLoading_,++i,a.load())},e}(I4e);const $4e=L4e;function N4e(t,e,n,r,i){if(!t||!(n in t.wantedTiles)||!t.wantedTiles[n][e.getKey()])return GT;var o=t.viewState.center,a=r[0]-o[0],s=r[1]-o[1];return 65536*Math.log(i)+Math.sqrt(a*a+s*s)/i}const Ts={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};var F4e=42,dB=256;function NG(t,e,n){return function(r,i,o,a,s){if(r){if(!i&&!e)return r;var l=e?0:o[0]*i,c=e?0:o[1]*i,u=s?s[0]:0,f=s?s[1]:0,d=t[0]+l/2+u,h=t[2]-l/2+u,p=t[1]+c/2+f,m=t[3]-c/2+f;d>h&&(d=(h+d)/2,h=d),p>m&&(p=(m+p)/2,m=p);var g=Fr(r[0],d,h),v=Fr(r[1],p,m);if(a&&n&&i){var y=30*i;g+=-y*Math.log(1+Math.max(0,d-r[0])/y)+y*Math.log(1+Math.max(0,r[0]-h)/y),v+=-y*Math.log(1+Math.max(0,p-r[1])/y)+y*Math.log(1+Math.max(0,r[1]-m)/y)}return[g,v]}}}function j4e(t){return t}function hB(t,e,n,r){var i=Yn(e)/n[0],o=hs(e)/n[1];return r?Math.min(t,Math.max(i,o)):Math.min(t,Math.min(i,o))}function pB(t,e,n){var r=Math.min(t,e),i=50;return r*=Math.log(1+i*Math.max(0,t/e-1))/i+1,n&&(r=Math.max(r,n),r/=Math.log(1+i*Math.max(0,n/t-1))/i+1),Fr(r,n/2,e*2)}function B4e(t,e,n,r){return function(i,o,a,s){if(i!==void 0){var l=t[0],c=t[t.length-1],u=n?hB(l,n,a,r):l;if(s){var f=e!==void 0?e:!0;return f?pB(i,u,c):Fr(i,c,u)}var d=Math.min(u,i),h=Math.floor($5(t,d,o));return t[h]>u&&h1&&typeof arguments[r-1]=="function"&&(i=arguments[r-1],--r);for(var o=0;o0},e.prototype.getInteracting=function(){return this.hints_[Hi.INTERACTING]>0},e.prototype.cancelAnimations=function(){this.setHint(Hi.ANIMATING,-this.hints_[Hi.ANIMATING]);for(var n,r=0,i=this.animations_.length;r=0;--i){for(var o=this.animations_[i],a=!0,s=0,l=o.length;s0?u/c.duration:1;f>=1?(c.complete=!0,f=1):a=!1;var d=c.easing(f);if(c.sourceCenter){var h=c.sourceCenter[0],p=c.sourceCenter[1],m=c.targetCenter[0],g=c.targetCenter[1];this.nextCenter_=c.targetCenter;var v=h+d*(m-h),y=p+d*(g-p);this.targetCenter_=[v,y]}if(c.sourceResolution&&c.targetResolution){var x=d===1?c.targetResolution:c.sourceResolution+d*(c.targetResolution-c.sourceResolution);if(c.anchor){var b=this.getViewportSize_(this.getRotation()),_=this.constraints_.resolution(x,0,b,!0);this.targetCenter_=this.calculateCenterZoom(_,c.anchor)}this.nextResolution_=c.targetResolution,this.targetResolution_=x,this.applyTargetState_(!0)}if(c.sourceRotation!==void 0&&c.targetRotation!==void 0){var S=d===1?Df(c.targetRotation+Math.PI,2*Math.PI)-Math.PI:c.sourceRotation+d*(c.targetRotation-c.sourceRotation);if(c.anchor){var O=this.constraints_.rotation(S,!0);this.targetCenter_=this.calculateCenterRotate(O,c.anchor)}this.nextRotation_=c.targetRotation,this.targetRotation_=S}if(this.applyTargetState_(!0),r=!0,!c.complete)break}}if(a){this.animations_[i]=null,this.setHint(Hi.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var C=o[0].callback;C&&yS(C,!0)}}this.animations_=this.animations_.filter(Boolean),r&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},e.prototype.calculateCenterRotate=function(n,r){var i,o=this.getCenterInternal();return o!==void 0&&(i=[o[0]-r[0],o[1]-r[1]],z5(i,n-this.getRotation()),tje(i,r)),i},e.prototype.calculateCenterZoom=function(n,r){var i,o=this.getCenterInternal(),a=this.getResolution();if(o!==void 0&&a!==void 0){var s=r[0]-n*(r[0]-o[0])/a,l=r[1]-n*(r[1]-o[1])/a;i=[s,l]}return i},e.prototype.getViewportSize_=function(n){var r=this.viewportSize_;if(n){var i=r[0],o=r[1];return[Math.abs(i*Math.cos(n))+Math.abs(o*Math.sin(n)),Math.abs(i*Math.sin(n))+Math.abs(o*Math.cos(n))]}else return r},e.prototype.setViewportSize=function(n){this.viewportSize_=Array.isArray(n)?n.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},e.prototype.getCenter=function(){var n=this.getCenterInternal();return n&&qL(n,this.getProjection())},e.prototype.getCenterInternal=function(){return this.get(Ts.CENTER)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.get("constrainResolution")},e.prototype.getHints=function(n){return n!==void 0?(n[0]=this.hints_[0],n[1]=this.hints_[1],n):this.hints_.slice()},e.prototype.calculateExtent=function(n){var r=this.calculateExtentInternal(n);return Gie(r,this.getProjection())},e.prototype.calculateExtentInternal=function(n){var r=n||this.getViewportSizeMinusPadding_(),i=this.getCenterInternal();Ut(i,1);var o=this.getResolution();Ut(o!==void 0,2);var a=this.getRotation();return Ut(a!==void 0,3),WL(i,o,a,r)},e.prototype.getMaxResolution=function(){return this.maxResolution_},e.prototype.getMinResolution=function(){return this.minResolution_},e.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},e.prototype.setMaxZoom=function(n){this.applyOptions_(this.getUpdatedOptions_({maxZoom:n}))},e.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},e.prototype.setMinZoom=function(n){this.applyOptions_(this.getUpdatedOptions_({minZoom:n}))},e.prototype.setConstrainResolution=function(n){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:n}))},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get(Ts.RESOLUTION)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(n,r){return this.getResolutionForExtentInternal(hh(n,this.getProjection()),r)},e.prototype.getResolutionForExtentInternal=function(n,r){var i=r||this.getViewportSizeMinusPadding_(),o=Yn(n)/i[0],a=hs(n)/i[1];return Math.max(o,a)},e.prototype.getResolutionForValueFunction=function(n){var r=n||2,i=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,a=Math.log(i/o)/Math.log(r);return function(s){var l=i/Math.pow(r,s*a);return l}},e.prototype.getRotation=function(){return this.get(Ts.ROTATION)},e.prototype.getValueForResolutionFunction=function(n){var r=Math.log(n||2),i=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,a=Math.log(i/o)/r;return function(s){var l=Math.log(i/s)/r/a;return l}},e.prototype.getViewportSizeMinusPadding_=function(n){var r=this.getViewportSize_(n),i=this.padding_;return i&&(r=[r[0]-i[1]-i[3],r[1]-i[0]-i[2]]),r},e.prototype.getState=function(){var n=this.getProjection(),r=this.getResolution(),i=this.getRotation(),o=this.getCenterInternal(),a=this.padding_;if(a){var s=this.getViewportSizeMinusPadding_();o=DA(o,this.getViewportSize_(),[s[0]/2+a[3],s[1]/2+a[0]],r,i)}return{center:o.slice(0),projection:n!==void 0?n:null,resolution:r,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}},e.prototype.getZoom=function(){var n,r=this.getResolution();return r!==void 0&&(n=this.getZoomForResolution(r)),n},e.prototype.getZoomForResolution=function(n){var r=this.minZoom_||0,i,o;if(this.resolutions_){var a=$5(this.resolutions_,n,1);r=a,i=this.resolutions_[a],a==this.resolutions_.length-1?o=2:o=i/this.resolutions_[a+1]}else i=this.maxResolution_,o=this.zoomFactor_;return r+Math.log(i/n)/Math.log(o)},e.prototype.getResolutionForZoom=function(n){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var r=Fr(Math.floor(n),0,this.resolutions_.length-2),i=this.resolutions_[r]/this.resolutions_[r+1];return this.resolutions_[r]/Math.pow(i,Fr(n-r,0,1))}else return this.maxResolution_/Math.pow(this.zoomFactor_,n-this.minZoom_)},e.prototype.fit=function(n,r){var i;if(Ut(Array.isArray(n)||typeof n.getSimplifiedGeometry=="function",24),Array.isArray(n)){Ut(!B5(n),25);var o=hh(n,this.getProjection());i=KL(o)}else if(n.getType()==="Circle"){var o=hh(n.getExtent(),this.getProjection());i=KL(o),i.rotate(this.getRotation(),Yf(o))}else{var a=fje();a?i=n.clone().transform(a,this.getProjection()):i=n}this.fitInternal(i,r)},e.prototype.rotatedExtentForGeometry=function(n){for(var r=this.getRotation(),i=Math.cos(r),o=Math.sin(-r),a=n.getFlatCoordinates(),s=n.getStride(),l=1/0,c=1/0,u=-1/0,f=-1/0,d=0,h=a.length;d=0;c--){var u=l[c];if(!(u.getMap()!==this||!u.getActive()||!this.getTargetElement())){var f=u.handleEvent(n);if(!f||n.propagationStopped)break}}}},e.prototype.handlePostRender=function(){var n=this.frameState_,r=this.tileQueue_;if(!r.isEmpty()){var i=this.maxTilesLoading_,o=i;if(n){var a=n.viewHints;if(a[Hi.ANIMATING]||a[Hi.INTERACTING]){var s=Date.now()-n.time>8;i=s?0:8,o=s?0:2}}r.getTilesLoading()0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!Sp(r,this.renderedAttributions_)){xBe(this.ulElement_);for(var o=0,a=r.length;o0&&i%(2*Math.PI)!==0?r.animate({rotation:0,duration:this.duration_,easing:sy}):r.setRotation(0))}},e.prototype.render=function(n){var r=n.frameState;if(r){var i=r.viewState.rotation;if(i!=this.rotation_){var o="rotate("+i+"rad)";if(this.autoHide_){var a=this.element.classList.contains(pS);!a&&i===0?this.element.classList.add(pS):a&&i!==0&&this.element.classList.remove(pS)}this.label_.style.transform=o}this.rotation_=i}},e}(r2);const aUe=oUe;var sUe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),lUe=function(t){sUe(e,t);function e(n){var r=this,i=n||{};r=t.call(this,{element:document.createElement("div"),target:i.target})||this;var o=i.className!==void 0?i.className:"ol-zoom",a=i.delta!==void 0?i.delta:1,s=i.zoomInClassName!==void 0?i.zoomInClassName:o+"-in",l=i.zoomOutClassName!==void 0?i.zoomOutClassName:o+"-out",c=i.zoomInLabel!==void 0?i.zoomInLabel:"+",u=i.zoomOutLabel!==void 0?i.zoomOutLabel:"–",f=i.zoomInTipLabel!==void 0?i.zoomInTipLabel:"Zoom in",d=i.zoomOutTipLabel!==void 0?i.zoomOutTipLabel:"Zoom out",h=document.createElement("button");h.className=s,h.setAttribute("type","button"),h.title=f,h.appendChild(typeof c=="string"?document.createTextNode(c):c),h.addEventListener(Mt.CLICK,r.handleClick_.bind(r,a),!1);var p=document.createElement("button");p.className=l,p.setAttribute("type","button"),p.title=d,p.appendChild(typeof u=="string"?document.createTextNode(u):u),p.addEventListener(Mt.CLICK,r.handleClick_.bind(r,-a),!1);var m=o+" "+B1+" "+cB,g=r.element;return g.className=m,g.appendChild(h),g.appendChild(p),r.duration_=i.duration!==void 0?i.duration:250,r}return e.prototype.handleClick_=function(n,r){r.preventDefault(),this.zoomByDelta_(n)},e.prototype.zoomByDelta_=function(n){var r=this.getMap(),i=r.getView();if(i){var o=i.getZoom();if(o!==void 0){var a=i.getConstrainedZoom(o+n);this.duration_>0?(i.getAnimating()&&i.cancelAnimations(),i.animate({zoom:a,duration:this.duration_,easing:sy})):i.setZoom(a)}}},e}(r2);const cUe=lUe;var uUe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),LA="units",Id={DEGREES:"degrees",IMPERIAL:"imperial",NAUTICAL:"nautical",METRIC:"metric",US:"us"},fUe=[1,2,5],y0=25.4/.28,dUe=function(t){uUe(e,t);function e(n){var r=this,i=n||{},o=i.className!==void 0?i.className:i.bar?"ol-scale-bar":"ol-scale-line";return r=t.call(this,{element:document.createElement("div"),render:i.render,target:i.target})||this,r.on,r.once,r.un,r.innerElement_=document.createElement("div"),r.innerElement_.className=o+"-inner",r.element.className=o+" "+B1,r.element.appendChild(r.innerElement_),r.viewState_=null,r.minWidth_=i.minWidth!==void 0?i.minWidth:64,r.maxWidth_=i.maxWidth,r.renderedVisible_=!1,r.renderedWidth_=void 0,r.renderedHTML_="",r.addChangeListener(LA,r.handleUnitsChanged_),r.setUnits(i.units||Id.METRIC),r.scaleBar_=i.bar||!1,r.scaleBarSteps_=i.steps||4,r.scaleBarText_=i.text||!1,r.dpi_=i.dpi||void 0,r}return e.prototype.getUnits=function(){return this.get(LA)},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(n){this.set(LA,n)},e.prototype.setDpi=function(n){this.dpi_=n},e.prototype.updateElement_=function(){var n=this.viewState_;if(!n){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}var r=n.center,i=n.projection,o=this.getUnits(),a=o==Id.DEGREES?li.DEGREES:li.METERS,s=IT(i,n.resolution,r,a),l=this.minWidth_*(this.dpi_||y0)/y0,c=this.maxWidth_!==void 0?this.maxWidth_*(this.dpi_||y0)/y0:void 0,u=l*s,f="";if(o==Id.DEGREES){var d=Xs[li.DEGREES];u*=d,u=c){p=v,m=y,g=x;break}else if(m>=l)break;v=p,y=m,x=g,++h}var _;this.scaleBar_?_=this.createScaleBar(m,p,f):_=p.toFixed(g<0?-g:0)+" "+f,this.renderedHTML_!=_&&(this.innerElement_.innerHTML=_,this.renderedHTML_=_),this.renderedWidth_!=m&&(this.innerElement_.style.width=m+"px",this.renderedWidth_=m),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)},e.prototype.createScaleBar=function(n,r,i){for(var o="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),a=[],s=n/this.scaleBarSteps_,l="ol-scale-singlebar-odd",c=0;c
'+this.createMarker("relative",c)+(c%2===0||this.scaleBarSteps_===2?this.createStepText(c,n,!1,r,i):"")+""),c===this.scaleBarSteps_-1&&a.push(this.createStepText(c+1,n,!0,r,i)),l=l==="ol-scale-singlebar-odd"?"ol-scale-singlebar-even":"ol-scale-singlebar-odd";var u;this.scaleBarText_?u='
'+o+"
":u="";var f='
'+u+a.join("")+"
";return f},e.prototype.createMarker=function(n,r){var i=n==="absolute"?3:-10;return'
'},e.prototype.createStepText=function(n,r,i,o,a){var s=n===0?0:Math.round(o/this.scaleBarSteps_*n*100)/100,l=s+(n===0?"":" "+a),c=n===0?-3:r/this.scaleBarSteps_*-1,u=n===0?0:r/this.scaleBarSteps_*2;return'
'+l+"
"},e.prototype.getScaleForResolution=function(){var n=IT(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,li.METERS),r=this.dpi_||y0,i=1e3/25.4;return parseFloat(n.toString())*i*r},e.prototype.render=function(n){var r=n.frameState;r?this.viewState_=r.viewState:this.viewState_=null,this.updateElement_()},e}(r2);function hUe(t){var e=t||{},n=new Xa,r=e.zoom!==void 0?e.zoom:!0;r&&n.push(new cUe(e.zoomOptions));var i=e.rotate!==void 0?e.rotate:!0;i&&n.push(new aUe(e.rotateOptions));var o=e.attribution!==void 0?e.attribution:!0;return o&&n.push(new rUe(e.attributionOptions)),n}const s$={ACTIVE:"active"};var pUe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),mUe=function(t){pUe(e,t);function e(n){var r=t.call(this)||this;return r.on,r.once,r.un,n&&n.handleEvent&&(r.handleEvent=n.handleEvent),r.map_=null,r.setActive(!0),r}return e.prototype.getActive=function(){return this.get(s$.ACTIVE)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(n){return!0},e.prototype.setActive=function(n){this.set(s$.ACTIVE,n)},e.prototype.setMap=function(n){this.map_=n},e}(ic);function gUe(t,e,n){var r=t.getCenterInternal();if(r){var i=[r[0]+e[0],r[1]+e[1]];t.animateInternal({duration:n!==void 0?n:250,easing:u4e,center:t.getConstrainedCenter(i)})}}function gB(t,e,n,r){var i=t.getZoom();if(i!==void 0){var o=t.getConstrainedZoom(i+e),a=t.getResolutionForZoom(o);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:a,anchor:n,duration:r!==void 0?r:250,easing:sy})}}const G1=mUe;var vUe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),yUe=function(t){vUe(e,t);function e(n){var r=t.call(this)||this,i=n||{};return r.delta_=i.delta?i.delta:1,r.duration_=i.duration!==void 0?i.duration:250,r}return e.prototype.handleEvent=function(n){var r=!1;if(n.type==wn.DBLCLICK){var i=n.originalEvent,o=n.map,a=n.coordinate,s=i.shiftKey?-this.delta_:this.delta_,l=o.getView();gB(l,s,a,this.duration_),i.preventDefault(),r=!0}return!r},e}(G1);const xUe=yUe;var bUe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),_Ue=function(t){bUe(e,t);function e(n){var r=this,i=n||{};return r=t.call(this,i)||this,i.handleDownEvent&&(r.handleDownEvent=i.handleDownEvent),i.handleDragEvent&&(r.handleDragEvent=i.handleDragEvent),i.handleMoveEvent&&(r.handleMoveEvent=i.handleMoveEvent),i.handleUpEvent&&(r.handleUpEvent=i.handleUpEvent),i.stopDown&&(r.stopDown=i.stopDown),r.handlingDownUpSequence=!1,r.targetPointers=[],r}return e.prototype.getPointerCount=function(){return this.targetPointers.length},e.prototype.handleDownEvent=function(n){return!1},e.prototype.handleDragEvent=function(n){},e.prototype.handleEvent=function(n){if(!n.originalEvent)return!0;var r=!1;if(this.updateTrackedPointers_(n),this.handlingDownUpSequence){if(n.type==wn.POINTERDRAG)this.handleDragEvent(n),n.originalEvent.preventDefault();else if(n.type==wn.POINTERUP){var i=this.handleUpEvent(n);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(n.type==wn.POINTERDOWN){var o=this.handleDownEvent(n);this.handlingDownUpSequence=o,r=this.stopDown(o)}else n.type==wn.POINTERMOVE&&this.handleMoveEvent(n);return!r},e.prototype.handleMoveEvent=function(n){},e.prototype.handleUpEvent=function(n){return!1},e.prototype.stopDown=function(n){return n},e.prototype.updateTrackedPointers_=function(n){n.activePointers&&(this.targetPointers=n.activePointers)},e}(G1);function vB(t){for(var e=t.length,n=0,r=0,i=0;i0&&this.condition_(n)){var r=n.map,i=r.getView();return this.lastCentroid=null,i.getAnimating()&&i.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}else return!1},e}(ly);const EUe=TUe;var PUe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),MUe=function(t){PUe(e,t);function e(n){var r=this,i=n||{};return r=t.call(this,{stopDown:R1})||this,r.condition_=i.condition?i.condition:wUe,r.lastAngle_=void 0,r.duration_=i.duration!==void 0?i.duration:250,r}return e.prototype.handleDragEvent=function(n){if($A(n)){var r=n.map,i=r.getView();if(i.getConstraints().rotation!==mB){var o=r.getSize(),a=n.pixel,s=Math.atan2(o[1]/2-a[1],a[0]-o[0]/2);if(this.lastAngle_!==void 0){var l=s-this.lastAngle_;i.adjustRotationInternal(-l)}this.lastAngle_=s}}},e.prototype.handleUpEvent=function(n){if(!$A(n))return!0;var r=n.map,i=r.getView();return i.endInteraction(this.duration_),!1},e.prototype.handleDownEvent=function(n){if(!$A(n))return!1;if(Hoe(n)&&this.condition_(n)){var r=n.map;return r.getView().beginInteraction(),this.lastAngle_=void 0,!0}else return!1},e}(ly),kUe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),AUe=function(t){kUe(e,t);function e(n){var r=t.call(this)||this;return r.geometry_=null,r.element_=document.createElement("div"),r.element_.style.position="absolute",r.element_.style.pointerEvents="auto",r.element_.className="ol-box "+n,r.map_=null,r.startPixel_=null,r.endPixel_=null,r}return e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var n=this.startPixel_,r=this.endPixel_,i="px",o=this.element_.style;o.left=Math.min(n[0],r[0])+i,o.top=Math.min(n[1],r[1])+i,o.width=Math.abs(r[0]-n[0])+i,o.height=Math.abs(r[1]-n[1])+i},e.prototype.setMap=function(n){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var r=this.element_.style;r.left="inherit",r.top="inherit",r.width="inherit",r.height="inherit"}this.map_=n,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},e.prototype.setPixels=function(n,r){this.startPixel_=n,this.endPixel_=r,this.createOrUpdateGeometry(),this.render_()},e.prototype.createOrUpdateGeometry=function(){var n=this.startPixel_,r=this.endPixel_,i=[n,[n[0],r[1]],r,[r[0],n[1]]],o=i.map(this.map_.getCoordinateFromPixelInternal,this.map_);o[4]=o[0].slice(),this.geometry_?this.geometry_.setCoordinates([o]):this.geometry_=new Jg([o])},e.prototype.getGeometry=function(){return this.geometry_},e}(L5);const RUe=AUe;var Qoe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),xS={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"},NA=function(t){Qoe(e,t);function e(n,r,i){var o=t.call(this,n)||this;return o.coordinate=r,o.mapBrowserEvent=i,o}return e}(rc),IUe=function(t){Qoe(e,t);function e(n){var r=t.call(this)||this;r.on,r.once,r.un;var i=n||{};return r.box_=new RUe(i.className||"ol-dragbox"),r.minArea_=i.minArea!==void 0?i.minArea:64,i.onBoxEnd&&(r.onBoxEnd=i.onBoxEnd),r.startPixel_=null,r.condition_=i.condition?i.condition:Hoe,r.boxEndCondition_=i.boxEndCondition?i.boxEndCondition:r.defaultBoxEndCondition,r}return e.prototype.defaultBoxEndCondition=function(n,r,i){var o=i[0]-r[0],a=i[1]-r[1];return o*o+a*a>=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(n){this.box_.setPixels(this.startPixel_,n.pixel),this.dispatchEvent(new NA(xS.BOXDRAG,n.coordinate,n))},e.prototype.handleUpEvent=function(n){this.box_.setMap(null);var r=this.boxEndCondition_(n,this.startPixel_,n.pixel);return r&&this.onBoxEnd(n),this.dispatchEvent(new NA(r?xS.BOXEND:xS.BOXCANCEL,n.coordinate,n)),!1},e.prototype.handleDownEvent=function(n){return this.condition_(n)?(this.startPixel_=n.pixel,this.box_.setMap(n.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new NA(xS.BOXSTART,n.coordinate,n)),!0):!1},e.prototype.onBoxEnd=function(n){},e}(ly);const DUe=IUe;var LUe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$Ue=function(t){LUe(e,t);function e(n){var r=this,i=n||{},o=i.condition?i.condition:qoe;return r=t.call(this,{condition:o,className:i.className||"ol-dragzoom",minArea:i.minArea})||this,r.duration_=i.duration!==void 0?i.duration:200,r.out_=i.out!==void 0?i.out:!1,r}return e.prototype.onBoxEnd=function(n){var r=this.getMap(),i=r.getView(),o=this.getGeometry();if(this.out_){var a=i.rotatedExtentForGeometry(o),s=i.getResolutionForExtentInternal(a),l=i.getResolution()/s;o=o.clone(),o.scale(l*l)}i.fitInternal(o,{duration:this.duration_,easing:sy})},e}(DUe);const NUe=$Ue,Dd={LEFT:37,UP:38,RIGHT:39,DOWN:40};var FUe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),jUe=function(t){FUe(e,t);function e(n){var r=t.call(this)||this,i=n||{};return r.defaultCondition_=function(o){return yB(o)&&Xoe(o)},r.condition_=i.condition!==void 0?i.condition:r.defaultCondition_,r.duration_=i.duration!==void 0?i.duration:100,r.pixelDelta_=i.pixelDelta!==void 0?i.pixelDelta:128,r}return e.prototype.handleEvent=function(n){var r=!1;if(n.type==Mt.KEYDOWN){var i=n.originalEvent,o=i.keyCode;if(this.condition_(n)&&(o==Dd.DOWN||o==Dd.LEFT||o==Dd.RIGHT||o==Dd.UP)){var a=n.map,s=a.getView(),l=s.getResolution()*this.pixelDelta_,c=0,u=0;o==Dd.DOWN?u=-l:o==Dd.LEFT?c=-l:o==Dd.RIGHT?c=l:u=l;var f=[c,u];z5(f,s.getRotation()),gUe(s,f,this.duration_),i.preventDefault(),r=!0}}return!r},e}(G1),BUe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),zUe=function(t){BUe(e,t);function e(n){var r=t.call(this)||this,i=n||{};return r.condition_=i.condition?i.condition:Xoe,r.delta_=i.delta?i.delta:1,r.duration_=i.duration!==void 0?i.duration:100,r}return e.prototype.handleEvent=function(n){var r=!1;if(n.type==Mt.KEYDOWN||n.type==Mt.KEYPRESS){var i=n.originalEvent,o=i.charCode;if(this.condition_(n)&&(o==43||o==45)){var a=n.map,s=o==43?this.delta_:-this.delta_,l=a.getView();gB(l,s,void 0,this.duration_),i.preventDefault(),r=!0}}return!r},e}(G1);const UUe=zUe;var WUe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),FA={TRACKPAD:"trackpad",WHEEL:"wheel"},VUe=function(t){WUe(e,t);function e(n){var r=this,i=n||{};r=t.call(this,i)||this,r.totalDelta_=0,r.lastDelta_=0,r.maxDelta_=i.maxDelta!==void 0?i.maxDelta:1,r.duration_=i.duration!==void 0?i.duration:250,r.timeout_=i.timeout!==void 0?i.timeout:80,r.useAnchor_=i.useAnchor!==void 0?i.useAnchor:!0,r.constrainResolution_=i.constrainResolution!==void 0?i.constrainResolution:!1;var o=i.condition?i.condition:Goe;return r.condition_=i.onFocusOnly?l$(Voe,o):o,r.lastAnchor_=null,r.startTime_=void 0,r.timeoutId_,r.mode_=void 0,r.trackpadEventGap_=400,r.trackpadTimeoutId_,r.deltaPerZoom_=300,r}return e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0;var n=this.getMap();if(n){var r=n.getView();r.endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)}},e.prototype.handleEvent=function(n){if(!this.condition_(n))return!0;var r=n.type;if(r!==Mt.WHEEL)return!0;var i=n.map,o=n.originalEvent;o.preventDefault(),this.useAnchor_&&(this.lastAnchor_=n.coordinate);var a;if(n.type==Mt.WHEEL&&(a=o.deltaY,_Fe&&o.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(a/=Rie),o.deltaMode===WheelEvent.DOM_DELTA_LINE&&(a*=40)),a===0)return!1;this.lastDelta_=a;var s=Date.now();this.startTime_===void 0&&(this.startTime_=s),(!this.mode_||s-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(a)<4?FA.TRACKPAD:FA.WHEEL);var l=i.getView();if(this.mode_===FA.TRACKPAD&&!(l.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(l.getAnimating()&&l.cancelAnimations(),l.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),l.adjustZoom(-a/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=s,!1;this.totalDelta_+=a;var c=Math.max(this.timeout_-(s-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),c),!1},e.prototype.handleWheelZoom_=function(n){var r=n.getView();r.getAnimating()&&r.cancelAnimations();var i=-Fr(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(r.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),gB(r,i,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(n){this.useAnchor_=n,n||(this.lastAnchor_=null)},e}(G1);const GUe=VUe;var HUe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),qUe=function(t){HUe(e,t);function e(n){var r=this,i=n||{},o=i;return o.stopDown||(o.stopDown=R1),r=t.call(this,o)||this,r.anchor_=null,r.lastAngle_=void 0,r.rotating_=!1,r.rotationDelta_=0,r.threshold_=i.threshold!==void 0?i.threshold:.3,r.duration_=i.duration!==void 0?i.duration:250,r}return e.prototype.handleDragEvent=function(n){var r=0,i=this.targetPointers[0],o=this.targetPointers[1],a=Math.atan2(o.clientY-i.clientY,o.clientX-i.clientX);if(this.lastAngle_!==void 0){var s=a-this.lastAngle_;this.rotationDelta_+=s,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),r=s}this.lastAngle_=a;var l=n.map,c=l.getView();if(c.getConstraints().rotation!==mB){var u=l.getViewport().getBoundingClientRect(),f=vB(this.targetPointers);f[0]-=u.left,f[1]-=u.top,this.anchor_=l.getCoordinateFromPixelInternal(f),this.rotating_&&(l.render(),c.adjustRotationInternal(r,this.anchor_))}},e.prototype.handleUpEvent=function(n){if(this.targetPointers.length<2){var r=n.map,i=r.getView();return i.endInteraction(this.duration_),!1}else return!0},e.prototype.handleDownEvent=function(n){if(this.targetPointers.length>=2){var r=n.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||r.getView().beginInteraction(),!0}else return!1},e}(ly),XUe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),QUe=function(t){XUe(e,t);function e(n){var r=this,i=n||{},o=i;return o.stopDown||(o.stopDown=R1),r=t.call(this,o)||this,r.anchor_=null,r.duration_=i.duration!==void 0?i.duration:400,r.lastDistance_=void 0,r.lastScaleDelta_=1,r}return e.prototype.handleDragEvent=function(n){var r=1,i=this.targetPointers[0],o=this.targetPointers[1],a=i.clientX-o.clientX,s=i.clientY-o.clientY,l=Math.sqrt(a*a+s*s);this.lastDistance_!==void 0&&(r=this.lastDistance_/l),this.lastDistance_=l;var c=n.map,u=c.getView();r!=1&&(this.lastScaleDelta_=r);var f=c.getViewport().getBoundingClientRect(),d=vB(this.targetPointers);d[0]-=f.left,d[1]-=f.top,this.anchor_=c.getCoordinateFromPixelInternal(d),c.render(),u.adjustResolutionInternal(r,this.anchor_)},e.prototype.handleUpEvent=function(n){if(this.targetPointers.length<2){var r=n.map,i=r.getView(),o=this.lastScaleDelta_>1?1:-1;return i.endInteraction(this.duration_,o),!1}else return!0},e.prototype.handleDownEvent=function(n){if(this.targetPointers.length>=2){var r=n.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||r.getView().beginInteraction(),!0}else return!1},e}(ly);const YUe=QUe;var KUe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Yoe=function(t){KUe(e,t);function e(n,r,i){var o=t.call(this)||this;if(i!==void 0&&r===void 0)o.setFlatCoordinates(i,n);else{var a=r||0;o.setCenterAndRadius(n,a,i)}return o}return e.prototype.clone=function(){var n=new e(this.flatCoordinates.slice(),void 0,this.layout);return n.applyProperties(this),n},e.prototype.closestPointXY=function(n,r,i,o){var a=this.flatCoordinates,s=n-a[0],l=r-a[1],c=s*s+l*l;if(c=i[0]||n[1]<=i[1]&&n[3]>=i[1]?!0:j5(n,this.intersectsCoordinate.bind(this))}return!1},e.prototype.setCenter=function(n){var r=this.stride,i=this.flatCoordinates[r]-this.flatCoordinates[0],o=n.slice();o[r]=o[0]+i;for(var a=1;a=this.dragVertexDelay_?(this.downPx_=n.pixel,this.shouldHandle_=!this.freehand_,r=!0):this.lastDragTime_=void 0,this.shouldHandle_&&this.downTimeout_!==void 0&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0)}return this.freehand_&&n.type===wn.POINTERDRAG&&this.sketchFeature_!==null?(this.addToDrawing_(n.coordinate),i=!1):this.freehand_&&n.type===wn.POINTERDOWN?i=!1:r&&this.getPointerCount()<2?(i=n.type===wn.POINTERMOVE,i&&this.freehand_?(this.handlePointerMove_(n),this.shouldHandle_&&n.originalEvent.preventDefault()):(n.originalEvent.pointerType==="mouse"||n.type===wn.POINTERDRAG&&this.downTimeout_===void 0)&&this.handlePointerMove_(n)):n.type===wn.DBLCLICK&&(i=!1),t.prototype.handleEvent.call(this,n)&&i},e.prototype.handleDownEvent=function(n){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=n.pixel,this.finishCoordinate_||this.startDrawing_(n.coordinate),!0):this.condition_(n)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout((function(){this.handlePointerMove_(new Pc(wn.POINTERMOVE,n.map,n.originalEvent,!1,n.frameState))}).bind(this),this.dragVertexDelay_),this.downPx_=n.pixel,!0):(this.lastDragTime_=void 0,!1)},e.prototype.handleUpEvent=function(n){var r=!0;if(this.getPointerCount()===0)if(this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(n),this.shouldHandle_){var i=!this.finishCoordinate_;i&&this.startDrawing_(n.coordinate),!i&&this.freehand_?this.finishDrawing():!this.freehand_&&(!i||this.mode_===an.POINT)&&(this.atFinish_(n.pixel)?this.finishCondition_(n)&&this.finishDrawing():this.addToDrawing_(n.coordinate)),r=!1}else this.freehand_&&this.abortDrawing();return!r&&this.stopClick_&&n.preventDefault(),r},e.prototype.handlePointerMove_=function(n){if(this.pointerType_=n.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var r=this.downPx_,i=n.pixel,o=r[0]-i[0],a=r[1]-i[1],s=o*o+a*a;if(this.shouldHandle_=this.freehand_?s>this.squaredClickTolerance_:s<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?this.modifyDrawing_(n.coordinate):this.createOrUpdateSketchPoint_(n.coordinate.slice())},e.prototype.atFinish_=function(n){var r=!1;if(this.sketchFeature_){var i=!1,o=[this.finishCoordinate_],a=this.mode_;if(a===an.POINT)r=!0;else if(a===an.CIRCLE)r=this.sketchCoords_.length===2;else if(a===an.LINE_STRING)i=this.sketchCoords_.length>this.minPoints_;else if(a===an.POLYGON){var s=this.sketchCoords_;i=s[0].length>this.minPoints_,o=[s[0][0],s[0][s[0].length-2]]}if(i)for(var l=this.getMap(),c=0,u=o.length;c=this.maxPoints_&&(this.freehand_?a.pop():o=!0),a.push(n.slice()),this.geometryFunction_(a,r,i)):s===an.POLYGON&&(a=this.sketchCoords_[0],a.length>=this.maxPoints_&&(this.freehand_?a.pop():o=!0),a.push(n.slice()),o&&(this.finishCoordinate_=a[0]),this.geometryFunction_(this.sketchCoords_,r,i)),this.createOrUpdateSketchPoint_(n.slice()),this.updateSketchFeatures_(),o&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(this.sketchFeature_){var n=this.sketchFeature_.getGeometry(),r=this.getMap().getView().getProjection(),i,o=this.mode_;if(o===an.LINE_STRING||o===an.CIRCLE){if(i=this.sketchCoords_,i.splice(-2,1),i.length>=2){this.finishCoordinate_=i[i.length-2].slice();var a=this.finishCoordinate_.slice();i[i.length-1]=a,this.createOrUpdateSketchPoint_(a)}this.geometryFunction_(i,n,r),n.getType()==="Polygon"&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(n)}else if(o===an.POLYGON){i=this.sketchCoords_[0],i.splice(-2,1);var s=this.sketchLine_.getGeometry();if(i.length>=2){var a=i[i.length-2].slice();i[i.length-1]=a,this.createOrUpdateSketchPoint_(a)}s.setCoordinates(i),this.geometryFunction_(this.sketchCoords_,n,r)}i.length===1&&this.abortDrawing(),this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var n=this.abortDrawing_();if(n){var r=this.sketchCoords_,i=n.getGeometry(),o=this.getMap().getView().getProjection();this.mode_===an.LINE_STRING?(r.pop(),this.geometryFunction_(r,i,o)):this.mode_===an.POLYGON&&(r[0].pop(),this.geometryFunction_(r,i,o),r=i.getCoordinates()),this.type_==="MultiPoint"?n.setGeometry(new KM([r])):this.type_==="MultiLineString"?n.setGeometry(new J5([r])):this.type_==="MultiPolygon"&&n.setGeometry(new tB([r])),this.dispatchEvent(new _S(bS.DRAWEND,n)),this.features_&&this.features_.push(n),this.source_&&this.source_.addFeature(n)}},e.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var n=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),n},e.prototype.abortDrawing=function(){var n=this.abortDrawing_();n&&this.dispatchEvent(new _S(bS.DRAWABORT,n))},e.prototype.appendCoordinates=function(n){var r=this.mode_,i=!this.sketchFeature_;i&&this.startDrawing_(n[0]);var o;if(r===an.LINE_STRING||r===an.CIRCLE)o=this.sketchCoords_;else if(r===an.POLYGON)o=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[];else return;i&&o.shift(),o.pop();for(var a=0;a0&&this.getCount()>this.highWaterMark},t.prototype.expireCache=function(e){for(;this.canExpireCache();)this.pop()},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},t.prototype.containsKey=function(e){return this.entries_.hasOwnProperty(e)},t.prototype.forEach=function(e){for(var n=this.oldest_;n;)e(n.value_,n.key_,this),n=n.newer},t.prototype.get=function(e,n){var r=this.entries_[e];return Ut(r!==void 0,15),r===this.newest_||(r===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(r.newer.older=r.older,r.older.newer=r.newer),r.newer=null,r.older=this.newest_,this.newest_.newer=r,this.newest_=r),r.value_},t.prototype.remove=function(e){var n=this.entries_[e];return Ut(n!==void 0,15),n===this.newest_?(this.newest_=n.older,this.newest_&&(this.newest_.newer=null)):n===this.oldest_?(this.oldest_=n.newer,this.oldest_&&(this.oldest_.older=null)):(n.newer.older=n.older,n.older.newer=n.newer),delete this.entries_[e],--this.count_,n.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var e=new Array(this.count_),n=0,r;for(r=this.newest_;r;r=r.older)e[n++]=r.key_;return e},t.prototype.getValues=function(){var e=new Array(this.count_),n=0,r;for(r=this.newest_;r;r=r.older)e[n++]=r.value_;return e},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.peek=function(e){if(this.containsKey(e))return this.entries_[e].value_},t.prototype.pop=function(){var e=this.oldest_;return delete this.entries_[e.key_],e.newer&&(e.newer.older=null),this.oldest_=e.newer,this.oldest_||(this.newest_=null),--this.count_,e.value_},t.prototype.replace=function(e,n){this.get(e),this.entries_[e].value_=n},t.prototype.set=function(e,n){Ut(!(e in this.entries_),16);var r={key_:e,newer:null,older:this.newest_,value_:n};this.newest_?this.newest_.newer=r:this.oldest_=r,this.newest_=r,this.entries_[e]=r,++this.count_},t.prototype.setSize=function(e){this.highWaterMark=e},t}();const i6e=r6e;function zG(t,e,n,r){return r!==void 0?(r[0]=t,r[1]=e,r[2]=n,r):[t,e,n]}function i2(t,e,n){return t+"/"+e+"/"+n}function Joe(t){return i2(t[0],t[1],t[2])}function o6e(t){return t.split("/").map(Number)}function eae(t){return(t[1]<n||n>e.getMaxZoom())return!1;var o=e.getFullTileRange(n);return o?o.containsXY(r,i):!0}var s6e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),l6e=function(t){s6e(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.expireCache=function(n){for(;this.canExpireCache();){var r=this.peekLast();if(r.getKey()in n)break;this.pop().release()}},e.prototype.pruneExceptNewestZ=function(){if(this.getCount()!==0){var n=this.peekFirstKey(),r=o6e(n),i=r[0];this.forEach((function(o){o.tileCoord[0]!==i&&(this.remove(Joe(o.tileCoord)),o.release())}).bind(this))}},e}(i6e);const tae=l6e;var xB=function(){function t(e,n,r,i){this.minX=e,this.maxX=n,this.minY=r,this.maxY=i}return t.prototype.contains=function(e){return this.containsXY(e[1],e[2])},t.prototype.containsTileRange=function(e){return this.minX<=e.minX&&e.maxX<=this.maxX&&this.minY<=e.minY&&e.maxY<=this.maxY},t.prototype.containsXY=function(e,n){return this.minX<=e&&e<=this.maxX&&this.minY<=n&&n<=this.maxY},t.prototype.equals=function(e){return this.minX==e.minX&&this.minY==e.minY&&this.maxX==e.maxX&&this.maxY==e.maxY},t.prototype.extend=function(e){e.minXthis.maxX&&(this.maxX=e.maxX),e.minYthis.maxY&&(this.maxY=e.maxY)},t.prototype.getHeight=function(){return this.maxY-this.minY+1},t.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},t.prototype.getWidth=function(){return this.maxX-this.minX+1},t.prototype.intersects=function(e){return this.minX<=e.maxX&&this.maxX>=e.minX&&this.minY<=e.maxY&&this.maxY>=e.minY},t}();function Kp(t,e,n,r,i){return i!==void 0?(i.minX=t,i.maxX=e,i.minY=n,i.maxY=r,i):new xB(t,e,n,r)}var c6e=.5,u6e=10,UG=.25,f6e=function(){function t(e,n,r,i,o,a){this.sourceProj_=e,this.targetProj_=n;var s={},l=$b(this.targetProj_,this.sourceProj_);this.transformInv_=function(x){var b=x[0]+"/"+x[1];return s[b]||(s[b]=l(x)),s[b]},this.maxSourceExtent_=i,this.errorThresholdSquared_=o*o,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!i&&!!this.sourceProj_.getExtent()&&Yn(i)==Yn(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Yn(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Yn(this.targetProj_.getExtent()):null;var c=Cp(r),u=qM(r),f=HM(r),d=GM(r),h=this.transformInv_(c),p=this.transformInv_(u),m=this.transformInv_(f),g=this.transformInv_(d),v=u6e+(a?Math.max(0,Math.ceil(BFe(UL(r)/(a*a*256*256)))):0);if(this.addQuad_(c,u,f,d,h,p,m,g,v),this.wrapsXInSource_){var y=1/0;this.triangles_.forEach(function(x,b,_){y=Math.min(y,x.source[0][0],x.source[1][0],x.source[2][0])}),this.triangles_.forEach((function(x){if(Math.max(x.source[0][0],x.source[1][0],x.source[2][0])-y>this.sourceWorldWidth_/2){var b=[[x.source[0][0],x.source[0][1]],[x.source[1][0],x.source[1][1]],[x.source[2][0],x.source[2][1]]];b[0][0]-y>this.sourceWorldWidth_/2&&(b[0][0]-=this.sourceWorldWidth_),b[1][0]-y>this.sourceWorldWidth_/2&&(b[1][0]-=this.sourceWorldWidth_),b[2][0]-y>this.sourceWorldWidth_/2&&(b[2][0]-=this.sourceWorldWidth_);var _=Math.min(b[0][0],b[1][0],b[2][0]),S=Math.max(b[0][0],b[1][0],b[2][0]);S-_.5&&f<1,p=!1;if(c>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){var m=tG([e,n,r,i]),g=Yn(m)/this.targetWorldWidth_;p=g>UG||p}!h&&this.sourceProj_.isGlobal()&&f&&(p=f>UG||p)}if(!(!p&&this.maxSourceExtent_&&isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(u[3])&&!so(u,this.maxSourceExtent_))){var v=0;if(!p&&(!isFinite(o[0])||!isFinite(o[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(s[0])||!isFinite(s[1])||!isFinite(l[0])||!isFinite(l[1]))){if(c>0)p=!0;else if(v=(!isFinite(o[0])||!isFinite(o[1])?8:0)+(!isFinite(a[0])||!isFinite(a[1])?4:0)+(!isFinite(s[0])||!isFinite(s[1])?2:0)+(!isFinite(l[0])||!isFinite(l[1])?1:0),v!=1&&v!=2&&v!=4&&v!=8)return}if(c>0){if(!p){var y=[(e[0]+r[0])/2,(e[1]+r[1])/2],x=this.transformInv_(y),b=void 0;if(h){var _=(Df(o[0],d)+Df(s[0],d))/2;b=_-Df(x[0],d)}else b=(o[0]+s[0])/2-x[0];var S=(o[1]+s[1])/2-x[1],O=b*b+S*S;p=O>this.errorThresholdSquared_}if(p){if(Math.abs(e[0]-r[0])<=Math.abs(e[1]-r[1])){var C=[(n[0]+r[0])/2,(n[1]+r[1])/2],E=this.transformInv_(C),k=[(i[0]+e[0])/2,(i[1]+e[1])/2],I=this.transformInv_(k);this.addQuad_(e,n,C,k,o,a,E,I,c-1),this.addQuad_(k,C,r,i,I,E,s,l,c-1)}else{var P=[(e[0]+n[0])/2,(e[1]+n[1])/2],R=this.transformInv_(P),T=[(r[0]+i[0])/2,(r[1]+i[1])/2],L=this.transformInv_(T);this.addQuad_(e,P,T,i,o,R,L,l,c-1),this.addQuad_(P,n,r,T,R,a,s,L,c-1)}return}}if(h){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}v&11||this.addTriangle_(e,r,i,o,s,l),v&14||this.addTriangle_(e,r,n,o,s,a),v&&(v&13||this.addTriangle_(n,i,e,a,l,o),v&7||this.addTriangle_(n,i,r,a,l,s))}},t.prototype.calculateSourceExtent=function(){var e=Oa();return this.triangles_.forEach(function(n,r,i){var o=n.source;zx(e,o[0]),zx(e,o[1]),zx(e,o[2])}),e},t.prototype.getTriangles=function(){return this.triangles_},t}(),c$={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1},d6e={imageSmoothingEnabled:!0,msImageSmoothingEnabled:!0},jA,nae=[];function WG(t,e,n,r,i){t.beginPath(),t.moveTo(0,0),t.lineTo(e,n),t.lineTo(r,i),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,r)+1,Math.max(n,i)),t.restore()}function BA(t,e){return Math.abs(t[e*4]-210)>2||Math.abs(t[e*4+3]-.75*255)>2}function h6e(){if(jA===void 0){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",WG(t,4,5,4,0),WG(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;jA=BA(e,0)||BA(e,4)||BA(e,8)}return jA}function u$(t,e,n,r){var i=XM(n,e,t),o=IT(e,r,n),a=e.getMetersPerUnit();a!==void 0&&(o*=a);var s=t.getMetersPerUnit();s!==void 0&&(o/=s);var l=t.getExtent();if(!l||D1(l,i)){var c=IT(t,o,i)/o;isFinite(c)&&c>0&&(o/=c)}return o}function p6e(t,e,n,r){var i=Yf(n),o=u$(t,e,i,r);return(!isFinite(o)||o<=0)&&j5(n,function(a){return o=u$(t,e,a,r),isFinite(o)&&o>0}),o}function m6e(t,e,n,r,i,o,a,s,l,c,u,f){var d=Ca(Math.round(n*t),Math.round(n*e),nae);if(f||cr(d,c$),l.length===0)return d.canvas;d.scale(n,n);function h(b){return Math.round(b*n)/n}d.globalCompositeOperation="lighter";var p=Oa();l.forEach(function(b,_,S){Nie(p,b.extent)});var m=Yn(p),g=hs(p),v=Ca(Math.round(n*m/r),Math.round(n*g/r));f||cr(v,c$);var y=n/r;l.forEach(function(b,_,S){var O=b.extent[0]-p[0],C=-(b.extent[3]-p[3]),E=Yn(b.extent),k=hs(b.extent);b.image.width>0&&b.image.height>0&&v.drawImage(b.image,c,c,b.image.width-2*c,b.image.height-2*c,O*y,C*y,E*y,k*y)});var x=Cp(a);return s.getTriangles().forEach(function(b,_,S){var O=b.source,C=b.target,E=O[0][0],k=O[0][1],I=O[1][0],P=O[1][1],R=O[2][0],T=O[2][1],L=h((C[0][0]-x[0])/o),z=h(-(C[0][1]-x[1])/o),B=h((C[1][0]-x[0])/o),W=h(-(C[1][1]-x[1])/o),U=h((C[2][0]-x[0])/o),N=h(-(C[2][1]-x[1])/o),$=E,D=k;E=0,k=0,I-=$,P-=D,R-=$,T-=D;var A=[[I,P,0,0,B-L],[R,T,0,0,U-L],[0,0,I,P,W-z],[0,0,R,T,N-z]],q=UFe(A);if(q){if(d.save(),d.beginPath(),h6e()||!f){d.moveTo(B,W);for(var Y=4,K=L-B,se=z-W,te=0;te=this.minZoom;){if(this.zoomFactor_===2?(a=Math.floor(a/2),s=Math.floor(s/2),o=Kp(a,a,s,s,r)):o=this.getTileRangeForExtentAndZ(l,c,r),n(c,o))return!0;--c}return!1},t.prototype.getExtent=function(){return this.extent_},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(e){return this.origin_?this.origin_:this.origins_[e]},t.prototype.getResolution=function(e){return this.resolutions_[e]},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getTileCoordChildTileRange=function(e,n,r){if(e[0]this.maxZoom||n0?r:Math.max(a/s[0],o/s[1]),c=i+1,u=new Array(c),f=0;fi.highWaterMark&&(i.highWaterMark=n)},e.prototype.useTile=function(n,r,i,o){},e}(Noe),C6e=function(t){aae(e,t);function e(n,r){var i=t.call(this,n)||this;return i.tile=r,i}return e}(rc);const T6e=O6e;function E6e(t,e){var n=/\{z\}/g,r=/\{x\}/g,i=/\{y\}/g,o=/\{-y\}/g;return function(a,s,l){if(a)return t.replace(n,a[0].toString()).replace(r,a[1].toString()).replace(i,a[2].toString()).replace(o,function(){var c=a[0],u=e.getFullTileRange(c);Ut(u,55);var f=u.getHeight()-a[2]-1;return f.toString()})}}function P6e(t,e){for(var n=t.length,r=new Array(n),i=0;i=0},e.prototype.tileUrlFunction=function(n,r,i){var o=this.getTileGrid();if(o||(o=this.getTileGridForProjection(i)),!(o.getResolutions().length<=n[0])){r!=1&&(!this.hidpi_||this.serverType_===void 0)&&(r=1);var a=o.getResolution(n[0]),s=o.getTileCoordExtent(n,this.tmpExtent_),l=ua(o.getTileSize(n[0]),this.tmpSize),c=this.gutter_;c!==0&&(l=mG(l,c,this.tmpSize),s=Db(s,a*c,s)),r!=1&&(l=_oe(l,r,this.tmpSize));var u={SERVICE:"WMS",VERSION:wS,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};return cr(u,this.params_),this.getRequestUrl_(n,l,s,r,i,u)}},e}(sae);const F6e=N6e;function lae(t){return w.jsx(M.Fragment,{children:t.children})}const SS={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};var j6e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),B6e=function(t){j6e(e,t);function e(n){var r=this,i=n||{},o=cr({},i);return delete o.preload,delete o.useInterimTilesOnError,r=t.call(this,o)||this,r.on,r.once,r.un,r.setPreload(i.preload!==void 0?i.preload:0),r.setUseInterimTilesOnError(i.useInterimTilesOnError!==void 0?i.useInterimTilesOnError:!0),r}return e.prototype.getPreload=function(){return this.get(SS.PRELOAD)},e.prototype.setPreload=function(n){this.set(SS.PRELOAD,n)},e.prototype.getUseInterimTilesOnError=function(){return this.get(SS.USE_INTERIM_TILES_ON_ERROR)},e.prototype.setUseInterimTilesOnError=function(n){this.set(SS.USE_INTERIM_TILES_ON_ERROR,n)},e.prototype.getData=function(n){return t.prototype.getData.call(this,n)},e}(e2);const z6e=B6e;var U6e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),W6e=function(t){U6e(e,t);function e(n){var r=t.call(this,n)||this;return r.extentChanged=!0,r.renderedExtent_=null,r.renderedPixelRatio,r.renderedProjection=null,r.renderedRevision,r.renderedTiles=[],r.newTiles_=!1,r.tmpExtent=Oa(),r.tmpTileRange_=new xB(0,0,0,0),r}return e.prototype.isDrawableTile=function(n){var r=this.getLayer(),i=n.getState(),o=r.getUseInterimTilesOnError();return i==St.LOADED||i==St.EMPTY||i==St.ERROR&&!o},e.prototype.getTile=function(n,r,i,o){var a=o.pixelRatio,s=o.viewState.projection,l=this.getLayer(),c=l.getSource(),u=c.getTile(n,r,i,a,s);return u.getState()==St.ERROR&&(l.getUseInterimTilesOnError()?l.getPreload()>0&&(this.newTiles_=!0):u.setState(St.LOADED)),this.isDrawableTile(u)||(u=u.getInterimTile()),u},e.prototype.getData=function(n){var r=this.frameState;if(!r)return null;var i=this.getLayer(),o=Or(r.pixelToCoordinateTransform,n.slice()),a=i.getExtent();if(a&&!D1(a,o))return null;for(var s=r.pixelRatio,l=r.viewState.projection,c=r.viewState,u=i.getRenderSource(),f=u.getTileGridForProjection(c.projection),d=u.getTilePixelRatio(r.pixelRatio),h=f.getZForResolution(c.resolution);h>=f.getMinZoom();--h){var p=f.getTileCoordForCoordAndZ(o,h),m=u.getTile(h,p[1],p[2],s,l);if(!(m instanceof fB||m instanceof rae))return null;if(m.getState()===St.LOADED){var g=f.getOrigin(h),v=ua(f.getTileSize(h)),y=f.getResolution(h),x=Math.floor(d*((o[0]-g[0])/y-p[1]*v[0])),b=Math.floor(d*((g[1]-o[1])/y-p[2]*v[1])),_=Math.round(d*u.getGutterForProjection(c.projection));return this.getImageData(m.getImage(),x+_,b+_)}}return null},e.prototype.loadedTileCallback=function(n,r,i){return this.isDrawableTile(i)?t.prototype.loadedTileCallback.call(this,n,r,i):!1},e.prototype.prepareFrame=function(n){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(n,r){var i=n.layerStatesArray[n.layerIndex],o=n.viewState,a=o.projection,s=o.resolution,l=o.center,c=o.rotation,u=n.pixelRatio,f=this.getLayer(),d=f.getSource(),h=d.getRevision(),p=d.getTileGridForProjection(a),m=p.getZForResolution(s,d.zDirection),g=p.getResolution(m),v=n.extent,y=n.viewState.resolution,x=d.getTilePixelRatio(u),b=Math.round(Yn(v)/y*u),_=Math.round(hs(v)/y*u),S=i.extent&&hh(i.extent);S&&(v=Ux(v,hh(i.extent)));var O=g*b/2/x,C=g*_/2/x,E=[l[0]-O,l[1]-C,l[0]+O,l[1]+C],k=p.getTileRangeForExtentAndZ(v,m),I={};I[m]={};var P=this.createLoadedTileFinder(d,a,I),R=this.tmpExtent,T=this.tmpTileRange_;this.newTiles_=!1;for(var L=c?VL(o.center,y,c,n.size):void 0,z=k.minX;z<=k.maxX;++z)for(var B=k.minY;B<=k.maxY;++B)if(!(c&&!p.tileCoordIntersectsViewport([m,z,B],L))){var W=this.getTile(m,z,B,n);if(this.isDrawableTile(W)){var U=vn(this);if(W.getState()==St.LOADED){I[m][W.tileCoord.toString()]=W;var N=W.inTransition(U);N&&i.opacity!==1&&(W.endTransition(U),N=!1),!this.newTiles_&&(N||this.renderedTiles.indexOf(W)===-1)&&(this.newTiles_=!0)}if(W.getAlpha(U,n.time)===1)continue}var $=p.getTileCoordChildTileRange(W.tileCoord,T,R),D=!1;$&&(D=P(m+1,$)),D||p.forEachTileCoordParentTileRange(W.tileCoord,P,T,R)}var A=g/s*u/x;cu(this.pixelTransform,n.size[0]/2,n.size[1]/2,1/u,1/u,c,-b/2,-_/2);var q=Die(this.pixelTransform);this.useContainer(r,q,this.getBackground(n));var Y=this.context,K=Y.canvas;N5(this.inversePixelTransform,this.pixelTransform),cu(this.tempTransform,b/2,_/2,A,A,0,-b/2,-_/2),K.width!=b||K.height!=_?(K.width=b,K.height=_):this.containerReused||Y.clearRect(0,0,b,_),S&&this.clipUnrotated(Y,n,S),d.getInterpolate()||cr(Y,c$),this.preRender(Y,n),this.renderedTiles.length=0;var se=Object.keys(I).map(Number);se.sort(Yh);var te,J,pe;i.opacity===1&&(!this.containerReused||d.getOpaque(n.viewState.projection))?se=se.reverse():(te=[],J=[]);for(var be=se.length-1;be>=0;--be){var re=se[be],ve=d.getTilePixelSize(re,u,a),F=p.getResolution(re),ce=F/g,le=ve[0]*ce*A,Q=ve[1]*ce*A,X=p.getTileCoordForCoordAndZ(Cp(E),re),ee=p.getTileCoordExtent(X),ge=Or(this.tempTransform,[x*(ee[0]-E[0])/g,x*(E[3]-ee[3])/g]),ye=x*d.getGutterForProjection(a),H=I[re];for(var G in H){var W=H[G],ie=W.tileCoord,he=X[1]-ie[1],_e=Math.round(ge[0]-(he-1)*le),oe=X[2]-ie[2],Z=Math.round(ge[1]-(oe-1)*Q),z=Math.round(ge[0]-he*le),B=Math.round(ge[1]-oe*Q),V=_e-z,de=Z-B,xe=m===re,N=xe&&W.getAlpha(vn(this),n.time)!==1,Me=!1;if(!N)if(te){pe=[z,B,z+V,B,z+V,B+de,z,B+de];for(var me=0,Ne=te.length;me{const r=this.props.onClick;r&&r(n)});Yt(this,"handleDrop",n=>{if(this.props.onDropFiles){n.preventDefault();const r=[];if(n.dataTransfer.items)for(let i=0;i{this.props.onDropFiles&&n.preventDefault()});Yt(this,"handleRef",n=>{this.contextValue.mapDiv=n});Yt(this,"handleResize",()=>{const n=this.contextValue.mapDiv,r=this.contextValue.map;if(n&&r){r.updateSize();const i=r.getView(),o=this.getMinZoom(n);o!==i.getMinZoom()&&i.setMinZoom(o)}});Yt(this,"getMinZoom",n=>{const r=n.clientWidth,i=Math.LOG2E*Math.log(r/256);return i>=0?i:0});const{id:r,mapObjects:i}=n;i?this.contextValue={map:i[r]||void 0,mapObjects:i}:this.contextValue={mapObjects:{}}}componentDidMount(){const{id:n}=this.props,r=this.contextValue.mapDiv;let i=null;if(this.props.isStale){const a=this.contextValue.mapObjects[n];a instanceof BG&&(i=a,i.setTarget(r),this.clickEventsKey&&i.un("click",this.clickEventsKey.listener))}if(!i){const a=this.getMinZoom(r),s=new jc({projection:uae,center:[0,0],minZoom:a,zoom:a});i=new BG({view:s,...this.getMapOptions(),target:r})}this.contextValue.map=i,this.contextValue.mapObjects[n]=i,this.clickEventsKey=i.on("click",this.handleClick),i.updateSize(),this.forceUpdate(),window.addEventListener("resize",this.handleResize);const o=this.props.onMapRef;o&&o(i)}componentDidUpdate(n){const r=this.contextValue.map,i=this.contextValue.mapDiv,o=this.getMapOptions();r.setProperties({...o}),r.setTarget(i),r.updateSize()}componentWillUnmount(){window.removeEventListener("resize",this.handleResize);const n=this.props.onMapRef;n&&n(null)}render(){let n;return this.contextValue.map&&(n=w.jsx(fae.Provider,{value:this.contextValue,children:this.props.children})),w.jsx("div",{ref:this.handleRef,style:Q6e,onDragOver:this.handleDragOver,onDrop:this.handleDrop,children:n})}getMapOptions(){const n={...this.props};return delete n.children,delete n.onClick,delete n.onDropFiles,n}};class fy extends M.PureComponent{constructor(){super(...arguments);Yt(this,"context",{});Yt(this,"object",null)}getMapObject(n){return this.context.mapObjects&&this.context.mapObjects[n]||null}getOptions(){const n={...this.props};return delete n.id,n}componentDidMount(){this._updateMapObject(this.addMapObject(this.context.map))}componentDidUpdate(n){this._updateMapObject(this.updateMapObject(this.context.map,this.object,n))}componentWillUnmount(){const n=this.context.map;this.removeMapObject(n,this.object),this.props.id&&delete this.context.mapObjects[this.props.id],this.object=null}_updateMapObject(n){n!=null&&this.props.id&&(n.set("objectId",this.props.id),this.context.mapObjects[this.props.id]=n),this.object=n}render(){return null}}Yt(fy,"contextType",fae);function dae(t,e,n){Zp(t,e,n,"visible",!0),Zp(t,e,n,"opacity",1),Zp(t,e,n,"zIndex",void 0),Zp(t,e,n,"extent",void 0),Zp(t,e,n,"minResolution",void 0),Zp(t,e,n,"maxResolution",void 0)}function Zp(t,e,n,r,i){const o=GG(e[r],i),a=GG(n[r],i);o!==a&&t.set(r,a)}function GG(t,e){return t===void 0?e:t}let So;So=()=>{};class hae extends fy{addMapObject(e){const n=new cae(this.props);return n.set("id",this.props.id),e.getLayers().push(n),n}updateMapObject(e,n,r){const i=n.getSource(),o=this.props.source||null;if(i===o)return n;if(o!==null&&i!==o){let a=!0;if(i instanceof f$&&o instanceof f$){const c=i,u=o,f=c.getTileGrid(),d=u.getTileGrid();if(K6e(f,d)){So("--> Equal tile grids!");const h=c.getUrls(),p=u.getUrls();h!==p&&p&&(h===null||h[0]!==p[0])&&(c.setUrls(p),a=!1);const m=c.getTileLoadFunction(),g=u.getTileLoadFunction();m!==g&&(c.setTileLoadFunction(g),a=!1);const v=c.getTileUrlFunction(),y=u.getTileUrlFunction();v!==y&&(c.setTileUrlFunction(y),a=!1)}else So("--> Tile grids are not equal!")}const s=i==null?void 0:i.getInterpolate(),l=o==null?void 0:o.getInterpolate();s!==l&&(a=!0),a?(n.setSource(o),So("--> Replaced source (expect flickering!)")):So("--> Updated source (check, is it still flickering?)")}return dae(n,r,this.props),n}removeMapObject(e,n){e.getLayers().remove(n)}}new cy({url:"https://a.tiles.mapbox.com/v3/mapbox.natural-earth-2/{z}/{x}/{y}.png",attributions:["© MapBox","© MapBox and contributors"]});new cy({url:"https://gis.ngdc.noaa.gov/arcgis/rest/services/web_mercator/gebco_2014_contours/MapServer/tile/{z}/{y}/{x}",attributions:["© GEBCO","© NOAHH and contributors"]});new X6e;new cy({url:"https://tiles.wmflabs.org/bw-mapnik/{z}/{x}/{y}.png",attributions:["© OpenStreetMap contributors"]});function K6e(t,e){if(t===e)return!0;if(t===null||e===null||(So("tile grid:",t,e),So("min zoom:",t.getMinZoom(),e.getMinZoom()),So("max zoom:",t.getMaxZoom(),e.getMaxZoom()),t.getMinZoom()!==e.getMinZoom()||t.getMaxZoom()!==e.getMaxZoom()))return!1;const n=t.getExtent(),r=e.getExtent();So("extent:",n,r);for(let s=0;s=t[i])return i;let o=Math.floor(n/2),a;for(let s=0;sa)[r,o]=[o,Math.floor((o+i)/2)];else return o;if(r===o||o===i)return Math.abs(t[r]-e)<=Math.abs(t[i]-e)?r:i}return-1}function On(t){if(t===null||t===!0||t===!1)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function tt(t,e){if(e.length1?"s":"")+" required, but only "+e.length+" present")}function nt(t){tt(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||au(t)==="object"&&e==="[object Date]"?new Date(t.getTime()):typeof t=="number"||e==="[object Number]"?new Date(t):((typeof t=="string"||e==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function d$(t,e){tt(2,arguments);var n=nt(t),r=On(e);return isNaN(r)?new Date(NaN):(r&&n.setDate(n.getDate()+r),n)}function TC(t,e){tt(2,arguments);var n=nt(t),r=On(e);if(isNaN(r))return new Date(NaN);if(!r)return n;var i=n.getDate(),o=new Date(n.getTime());o.setMonth(n.getMonth()+r+1,0);var a=o.getDate();return i>=a?o:(n.setFullYear(o.getFullYear(),o.getMonth(),i),n)}function a2(t,e){tt(2,arguments);var n=nt(t).getTime(),r=On(e);return new Date(n+r)}var Z6e=36e5;function J6e(t,e){tt(2,arguments);var n=On(e);return a2(t,n*Z6e)}var eWe={};function pd(){return eWe}function UA(t,e){var n,r,i,o,a,s,l,c;tt(1,arguments);var u=pd(),f=On((n=(r=(i=(o=e==null?void 0:e.weekStartsOn)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.weekStartsOn)!==null&&i!==void 0?i:u.weekStartsOn)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=nt(t),h=d.getDay(),p=(h0?1:i}var s2=6e4,l2=36e5,sWe=1e3;function lWe(t,e){tt(2,arguments);var n=tv(t),r=tv(e);return n.getTime()===r.getTime()}function cWe(t){return tt(1,arguments),t instanceof Date||au(t)==="object"&&Object.prototype.toString.call(t)==="[object Date]"}function mae(t){if(tt(1,arguments),!cWe(t)&&typeof t!="number")return!1;var e=nt(t);return!isNaN(Number(e))}function uWe(t,e){tt(2,arguments);var n=nt(t),r=nt(e),i=n.getFullYear()-r.getFullYear(),o=n.getMonth()-r.getMonth();return i*12+o}function fWe(t,e){tt(2,arguments);var n=nt(t),r=nt(e);return n.getFullYear()-r.getFullYear()}function qG(t,e){var n=t.getFullYear()-e.getFullYear()||t.getMonth()-e.getMonth()||t.getDate()-e.getDate()||t.getHours()-e.getHours()||t.getMinutes()-e.getMinutes()||t.getSeconds()-e.getSeconds()||t.getMilliseconds()-e.getMilliseconds();return n<0?-1:n>0?1:n}function gae(t,e){tt(2,arguments);var n=nt(t),r=nt(e),i=qG(n,r),o=Math.abs(nWe(n,r));n.setDate(n.getDate()-i*o);var a=+(qG(n,r)===-i),s=i*(o-a);return s===0?0:s}function c2(t,e){return tt(2,arguments),nt(t).getTime()-nt(e).getTime()}var XG={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}},dWe="trunc";function H1(t){return t?XG[t]:XG[dWe]}function hWe(t,e,n){tt(2,arguments);var r=c2(t,e)/l2;return H1(n==null?void 0:n.roundingMethod)(r)}function pWe(t,e,n){tt(2,arguments);var r=c2(t,e)/s2;return H1(n==null?void 0:n.roundingMethod)(r)}function h$(t){tt(1,arguments);var e=nt(t);return e.setHours(23,59,59,999),e}function p$(t){tt(1,arguments);var e=nt(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(23,59,59,999),e}function mWe(t){tt(1,arguments);var e=nt(t);return h$(e).getTime()===p$(e).getTime()}function vae(t,e){tt(2,arguments);var n=nt(t),r=nt(e),i=Vx(n,r),o=Math.abs(uWe(n,r)),a;if(o<1)a=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-i*o);var s=Vx(n,r)===-i;mWe(nt(t))&&o===1&&Vx(t,r)===1&&(s=!1),a=i*(o-Number(s))}return a===0?0:a}function gWe(t,e,n){tt(2,arguments);var r=vae(t,e)/3;return H1(n==null?void 0:n.roundingMethod)(r)}function vWe(t,e,n){tt(2,arguments);var r=c2(t,e)/1e3;return H1(n==null?void 0:n.roundingMethod)(r)}function yWe(t,e,n){tt(2,arguments);var r=gae(t,e)/7;return H1(n==null?void 0:n.roundingMethod)(r)}function xWe(t,e){tt(2,arguments);var n=nt(t),r=nt(e),i=Vx(n,r),o=Math.abs(fWe(n,r));n.setFullYear(1584),r.setFullYear(1584);var a=Vx(n,r)===-i,s=i*(o-Number(a));return s===0?0:s}function bWe(t,e){var n;tt(1,arguments);var r=t||{},i=nt(r.start),o=nt(r.end),a=o.getTime();if(!(i.getTime()<=a))throw new RangeError("Invalid interval");var s=[],l=i;l.setHours(0,0,0,0);var c=Number((n=e==null?void 0:e.step)!==null&&n!==void 0?n:1);if(c<1||isNaN(c))throw new RangeError("`options.step` must be a number greater than 1");for(;l.getTime()<=a;)s.push(nt(l)),l.setDate(l.getDate()+c),l.setHours(0,0,0,0);return s}function OS(t){tt(1,arguments);var e=nt(t);return e.setDate(1),e.setHours(0,0,0,0),e}function WA(t){tt(1,arguments);var e=nt(t),n=e.getFullYear();return e.setFullYear(n+1,0,0),e.setHours(23,59,59,999),e}function CS(t){tt(1,arguments);var e=nt(t),n=new Date(0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}function VA(t,e){var n,r,i,o,a,s,l,c;tt(1,arguments);var u=pd(),f=On((n=(r=(i=(o=e==null?void 0:e.weekStartsOn)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.weekStartsOn)!==null&&i!==void 0?i:u.weekStartsOn)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=nt(t),h=d.getDay(),p=(h=i.getTime()?n+1:e.getTime()>=a.getTime()?n:n-1}function SWe(t){tt(1,arguments);var e=xae(t),n=new Date(0);n.setUTCFullYear(e,0,4),n.setUTCHours(0,0,0,0);var r=nv(n);return r}var OWe=6048e5;function bae(t){tt(1,arguments);var e=nt(t),n=nv(e).getTime()-SWe(e).getTime();return Math.round(n/OWe)+1}function Jh(t,e){var n,r,i,o,a,s,l,c;tt(1,arguments);var u=pd(),f=On((n=(r=(i=(o=e==null?void 0:e.weekStartsOn)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.weekStartsOn)!==null&&i!==void 0?i:u.weekStartsOn)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=nt(t),h=d.getUTCDay(),p=(h=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setUTCFullYear(f+1,0,h),p.setUTCHours(0,0,0,0);var m=Jh(p,e),g=new Date(0);g.setUTCFullYear(f,0,h),g.setUTCHours(0,0,0,0);var v=Jh(g,e);return u.getTime()>=m.getTime()?f+1:u.getTime()>=v.getTime()?f:f-1}function CWe(t,e){var n,r,i,o,a,s,l,c;tt(1,arguments);var u=pd(),f=On((n=(r=(i=(o=e==null?void 0:e.firstWeekContainsDate)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&i!==void 0?i:u.firstWeekContainsDate)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1),d=SB(t,e),h=new Date(0);h.setUTCFullYear(d,0,f),h.setUTCHours(0,0,0,0);var p=Jh(h,e);return p}var TWe=6048e5;function _ae(t,e){tt(1,arguments);var n=nt(t),r=Jh(n,e).getTime()-CWe(n,e).getTime();return Math.round(r/TWe)+1}function Gt(t,e){for(var n=t<0?"-":"",r=Math.abs(t).toString();r.length0?r:1-r;return Gt(n==="yy"?i%100:i,n.length)},M:function(e,n){var r=e.getUTCMonth();return n==="M"?String(r+1):Gt(r+1,2)},d:function(e,n){return Gt(e.getUTCDate(),n.length)},a:function(e,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h:function(e,n){return Gt(e.getUTCHours()%12||12,n.length)},H:function(e,n){return Gt(e.getUTCHours(),n.length)},m:function(e,n){return Gt(e.getUTCMinutes(),n.length)},s:function(e,n){return Gt(e.getUTCSeconds(),n.length)},S:function(e,n){var r=n.length,i=e.getUTCMilliseconds(),o=Math.floor(i*Math.pow(10,r-3));return Gt(o,n.length)}};const Iu=EWe;var Jp={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},PWe={G:function(e,n,r){var i=e.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return r.era(i,{width:"abbreviated"});case"GGGGG":return r.era(i,{width:"narrow"});case"GGGG":default:return r.era(i,{width:"wide"})}},y:function(e,n,r){if(n==="yo"){var i=e.getUTCFullYear(),o=i>0?i:1-i;return r.ordinalNumber(o,{unit:"year"})}return Iu.y(e,n)},Y:function(e,n,r,i){var o=SB(e,i),a=o>0?o:1-o;if(n==="YY"){var s=a%100;return Gt(s,2)}return n==="Yo"?r.ordinalNumber(a,{unit:"year"}):Gt(a,n.length)},R:function(e,n){var r=xae(e);return Gt(r,n.length)},u:function(e,n){var r=e.getUTCFullYear();return Gt(r,n.length)},Q:function(e,n,r){var i=Math.ceil((e.getUTCMonth()+1)/3);switch(n){case"Q":return String(i);case"QQ":return Gt(i,2);case"Qo":return r.ordinalNumber(i,{unit:"quarter"});case"QQQ":return r.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,n,r){var i=Math.ceil((e.getUTCMonth()+1)/3);switch(n){case"q":return String(i);case"qq":return Gt(i,2);case"qo":return r.ordinalNumber(i,{unit:"quarter"});case"qqq":return r.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,n,r){var i=e.getUTCMonth();switch(n){case"M":case"MM":return Iu.M(e,n);case"Mo":return r.ordinalNumber(i+1,{unit:"month"});case"MMM":return r.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(i,{width:"wide",context:"formatting"})}},L:function(e,n,r){var i=e.getUTCMonth();switch(n){case"L":return String(i+1);case"LL":return Gt(i+1,2);case"Lo":return r.ordinalNumber(i+1,{unit:"month"});case"LLL":return r.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(i,{width:"wide",context:"standalone"})}},w:function(e,n,r,i){var o=_ae(e,i);return n==="wo"?r.ordinalNumber(o,{unit:"week"}):Gt(o,n.length)},I:function(e,n,r){var i=bae(e);return n==="Io"?r.ordinalNumber(i,{unit:"week"}):Gt(i,n.length)},d:function(e,n,r){return n==="do"?r.ordinalNumber(e.getUTCDate(),{unit:"date"}):Iu.d(e,n)},D:function(e,n,r){var i=wWe(e);return n==="Do"?r.ordinalNumber(i,{unit:"dayOfYear"}):Gt(i,n.length)},E:function(e,n,r){var i=e.getUTCDay();switch(n){case"E":case"EE":case"EEE":return r.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(i,{width:"short",context:"formatting"});case"EEEE":default:return r.day(i,{width:"wide",context:"formatting"})}},e:function(e,n,r,i){var o=e.getUTCDay(),a=(o-i.weekStartsOn+8)%7||7;switch(n){case"e":return String(a);case"ee":return Gt(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(o,{width:"short",context:"formatting"});case"eeee":default:return r.day(o,{width:"wide",context:"formatting"})}},c:function(e,n,r,i){var o=e.getUTCDay(),a=(o-i.weekStartsOn+8)%7||7;switch(n){case"c":return String(a);case"cc":return Gt(a,n.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(o,{width:"narrow",context:"standalone"});case"cccccc":return r.day(o,{width:"short",context:"standalone"});case"cccc":default:return r.day(o,{width:"wide",context:"standalone"})}},i:function(e,n,r){var i=e.getUTCDay(),o=i===0?7:i;switch(n){case"i":return String(o);case"ii":return Gt(o,n.length);case"io":return r.ordinalNumber(o,{unit:"day"});case"iii":return r.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(i,{width:"short",context:"formatting"});case"iiii":default:return r.day(i,{width:"wide",context:"formatting"})}},a:function(e,n,r){var i=e.getUTCHours(),o=i/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,n,r){var i=e.getUTCHours(),o;switch(i===12?o=Jp.noon:i===0?o=Jp.midnight:o=i/12>=1?"pm":"am",n){case"b":case"bb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,n,r){var i=e.getUTCHours(),o;switch(i>=17?o=Jp.evening:i>=12?o=Jp.afternoon:i>=4?o=Jp.morning:o=Jp.night,n){case"B":case"BB":case"BBB":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,n,r){if(n==="ho"){var i=e.getUTCHours()%12;return i===0&&(i=12),r.ordinalNumber(i,{unit:"hour"})}return Iu.h(e,n)},H:function(e,n,r){return n==="Ho"?r.ordinalNumber(e.getUTCHours(),{unit:"hour"}):Iu.H(e,n)},K:function(e,n,r){var i=e.getUTCHours()%12;return n==="Ko"?r.ordinalNumber(i,{unit:"hour"}):Gt(i,n.length)},k:function(e,n,r){var i=e.getUTCHours();return i===0&&(i=24),n==="ko"?r.ordinalNumber(i,{unit:"hour"}):Gt(i,n.length)},m:function(e,n,r){return n==="mo"?r.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):Iu.m(e,n)},s:function(e,n,r){return n==="so"?r.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):Iu.s(e,n)},S:function(e,n){return Iu.S(e,n)},X:function(e,n,r,i){var o=i._originalDate||e,a=o.getTimezoneOffset();if(a===0)return"Z";switch(n){case"X":return YG(a);case"XXXX":case"XX":return qd(a);case"XXXXX":case"XXX":default:return qd(a,":")}},x:function(e,n,r,i){var o=i._originalDate||e,a=o.getTimezoneOffset();switch(n){case"x":return YG(a);case"xxxx":case"xx":return qd(a);case"xxxxx":case"xxx":default:return qd(a,":")}},O:function(e,n,r,i){var o=i._originalDate||e,a=o.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+QG(a,":");case"OOOO":default:return"GMT"+qd(a,":")}},z:function(e,n,r,i){var o=i._originalDate||e,a=o.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+QG(a,":");case"zzzz":default:return"GMT"+qd(a,":")}},t:function(e,n,r,i){var o=i._originalDate||e,a=Math.floor(o.getTime()/1e3);return Gt(a,n.length)},T:function(e,n,r,i){var o=i._originalDate||e,a=o.getTime();return Gt(a,n.length)}};function QG(t,e){var n=t>0?"-":"+",r=Math.abs(t),i=Math.floor(r/60),o=r%60;if(o===0)return n+String(i);var a=e||"";return n+String(i)+a+Gt(o,2)}function YG(t,e){if(t%60===0){var n=t>0?"-":"+";return n+Gt(Math.abs(t)/60,2)}return qd(t,e)}function qd(t,e){var n=e||"",r=t>0?"-":"+",i=Math.abs(t),o=Gt(Math.floor(i/60),2),a=Gt(i%60,2);return r+o+n+a}var KG=function(e,n){switch(e){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},wae=function(e,n){switch(e){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},MWe=function(e,n){var r=e.match(/(P+)(p+)?/)||[],i=r[1],o=r[2];if(!o)return KG(e,n);var a;switch(i){case"P":a=n.dateTime({width:"short"});break;case"PP":a=n.dateTime({width:"medium"});break;case"PPP":a=n.dateTime({width:"long"});break;case"PPPP":default:a=n.dateTime({width:"full"});break}return a.replace("{{date}}",KG(i,n)).replace("{{time}}",wae(o,n))},m$={p:wae,P:MWe},kWe=["D","DD"],AWe=["YY","YYYY"];function Sae(t){return kWe.indexOf(t)!==-1}function Oae(t){return AWe.indexOf(t)!==-1}function qT(t,e,n){if(t==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var RWe={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},IWe=function(e,n,r){var i,o=RWe[e];return typeof o=="string"?i=o:n===1?i=o.one:i=o.other.replace("{{count}}",n.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+i:i+" ago":i};const DWe=IWe;function GA(t){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.width?String(e.width):t.defaultWidth,r=t.formats[n]||t.formats[t.defaultWidth];return r}}var LWe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},$We={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},NWe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},FWe={date:GA({formats:LWe,defaultWidth:"full"}),time:GA({formats:$We,defaultWidth:"full"}),dateTime:GA({formats:NWe,defaultWidth:"full"})};const jWe=FWe;var BWe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},zWe=function(e,n,r,i){return BWe[e]};const UWe=zWe;function x0(t){return function(e,n){var r=n!=null&&n.context?String(n.context):"standalone",i;if(r==="formatting"&&t.formattingValues){var o=t.defaultFormattingWidth||t.defaultWidth,a=n!=null&&n.width?String(n.width):o;i=t.formattingValues[a]||t.formattingValues[o]}else{var s=t.defaultWidth,l=n!=null&&n.width?String(n.width):t.defaultWidth;i=t.values[l]||t.values[s]}var c=t.argumentCallback?t.argumentCallback(e):e;return i[c]}}var WWe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},VWe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},GWe={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},HWe={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},qWe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},XWe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},QWe=function(e,n){var r=Number(e),i=r%100;if(i>20||i<10)switch(i%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},YWe={ordinalNumber:QWe,era:x0({values:WWe,defaultWidth:"wide"}),quarter:x0({values:VWe,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:x0({values:GWe,defaultWidth:"wide"}),day:x0({values:HWe,defaultWidth:"wide"}),dayPeriod:x0({values:qWe,defaultWidth:"wide",formattingValues:XWe,defaultFormattingWidth:"wide"})};const KWe=YWe;function b0(t){return function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.width,i=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=e.match(i);if(!o)return null;var a=o[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(s)?JWe(s,function(f){return f.test(a)}):ZWe(s,function(f){return f.test(a)}),c;c=t.valueCallback?t.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;var u=e.slice(a.length);return{value:c,rest:u}}}function ZWe(t,e){for(var n in t)if(t.hasOwnProperty(n)&&e(t[n]))return n}function JWe(t,e){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{},r=e.match(t.matchPattern);if(!r)return null;var i=r[0],o=e.match(t.parsePattern);if(!o)return null;var a=t.valueCallback?t.valueCallback(o[0]):o[0];a=n.valueCallback?n.valueCallback(a):a;var s=e.slice(i.length);return{value:a,rest:s}}}var tVe=/^(\d+)(th|st|nd|rd)?/i,nVe=/\d+/i,rVe={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},iVe={any:[/^b/i,/^(a|c)/i]},oVe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},aVe={any:[/1/i,/2/i,/3/i,/4/i]},sVe={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},lVe={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},cVe={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},uVe={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},fVe={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},dVe={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},hVe={ordinalNumber:eVe({matchPattern:tVe,parsePattern:nVe,valueCallback:function(e){return parseInt(e,10)}}),era:b0({matchPatterns:rVe,defaultMatchWidth:"wide",parsePatterns:iVe,defaultParseWidth:"any"}),quarter:b0({matchPatterns:oVe,defaultMatchWidth:"wide",parsePatterns:aVe,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:b0({matchPatterns:sVe,defaultMatchWidth:"wide",parsePatterns:lVe,defaultParseWidth:"any"}),day:b0({matchPatterns:cVe,defaultMatchWidth:"wide",parsePatterns:uVe,defaultParseWidth:"any"}),dayPeriod:b0({matchPatterns:fVe,defaultMatchWidth:"any",parsePatterns:dVe,defaultParseWidth:"any"})};const pVe=hVe;var u2={code:"en-US",formatDistance:DWe,formatLong:jWe,formatRelative:UWe,localize:KWe,match:pVe,options:{weekStartsOn:0,firstWeekContainsDate:1}},mVe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,gVe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,vVe=/^'([^]*?)'?$/,yVe=/''/g,xVe=/[a-zA-Z]/;function bVe(t,e,n){var r,i,o,a,s,l,c,u,f,d,h,p,m,g,v,y,x,b;tt(2,arguments);var _=String(e),S=pd(),O=(r=(i=n==null?void 0:n.locale)!==null&&i!==void 0?i:S.locale)!==null&&r!==void 0?r:u2,C=On((o=(a=(s=(l=n==null?void 0:n.firstWeekContainsDate)!==null&&l!==void 0?l:n==null||(c=n.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&s!==void 0?s:S.firstWeekContainsDate)!==null&&a!==void 0?a:(f=S.locale)===null||f===void 0||(d=f.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&o!==void 0?o:1);if(!(C>=1&&C<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var E=On((h=(p=(m=(g=n==null?void 0:n.weekStartsOn)!==null&&g!==void 0?g:n==null||(v=n.locale)===null||v===void 0||(y=v.options)===null||y===void 0?void 0:y.weekStartsOn)!==null&&m!==void 0?m:S.weekStartsOn)!==null&&p!==void 0?p:(x=S.locale)===null||x===void 0||(b=x.options)===null||b===void 0?void 0:b.weekStartsOn)!==null&&h!==void 0?h:0);if(!(E>=0&&E<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!O.localize)throw new RangeError("locale must contain localize property");if(!O.formatLong)throw new RangeError("locale must contain formatLong property");var k=nt(t);if(!mae(k))throw new RangeError("Invalid time value");var I=HT(k),P=yae(k,I),R={firstWeekContainsDate:C,weekStartsOn:E,locale:O,_originalDate:k},T=_.match(gVe).map(function(L){var z=L[0];if(z==="p"||z==="P"){var B=m$[z];return B(L,O.formatLong)}return L}).join("").match(mVe).map(function(L){if(L==="''")return"'";var z=L[0];if(z==="'")return _Ve(L);var B=PWe[z];if(B)return!(n!=null&&n.useAdditionalWeekYearTokens)&&Oae(L)&&qT(L,e,String(t)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&Sae(L)&&qT(L,e,String(t)),B(P,L,O.localize,R);if(z.match(xVe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+z+"`");return L}).join("");return T}function _Ve(t){var e=t.match(vVe);return e?e[1].replace(yVe,"'"):t}function wVe(t,e){if(t==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}function SVe(t,e){var n,r;tt(1,arguments);var i=nt(t);if(isNaN(i.getTime()))throw new RangeError("Invalid time value");var o=String((n=e==null?void 0:e.format)!==null&&n!==void 0?n:"extended"),a=String((r=e==null?void 0:e.representation)!==null&&r!==void 0?r:"complete");if(o!=="extended"&&o!=="basic")throw new RangeError("format must be 'extended' or 'basic'");if(a!=="date"&&a!=="time"&&a!=="complete")throw new RangeError("representation must be 'date', 'time', or 'complete'");var s="",l="",c=o==="extended"?"-":"",u=o==="extended"?":":"";if(a!=="time"){var f=Gt(i.getDate(),2),d=Gt(i.getMonth()+1,2),h=Gt(i.getFullYear(),4);s="".concat(h).concat(c).concat(d).concat(c).concat(f)}if(a!=="date"){var p=i.getTimezoneOffset();if(p!==0){var m=Math.abs(p),g=Gt(Math.floor(m/60),2),v=Gt(m%60,2),y=p<0?"+":"-";l="".concat(y).concat(g,":").concat(v)}else l="Z";var x=Gt(i.getHours(),2),b=Gt(i.getMinutes(),2),_=Gt(i.getSeconds(),2),S=s===""?"":"T",O=[x,b,_].join(u);s="".concat(s).concat(S).concat(O).concat(l)}return s}function OVe(t){tt(1,arguments);var e=nt(t),n=e.getDate();return n}function CVe(t){tt(1,arguments);var e=nt(t),n=e.getDay();return n}function Cae(t){tt(1,arguments);var e=nt(t),n=e.getFullYear(),r=e.getMonth(),i=new Date(0);return i.setFullYear(n,r+1,0),i.setHours(0,0,0,0),i.getDate()}function TVe(t){tt(1,arguments);var e=nt(t),n=e.getHours();return n}function EVe(t){tt(1,arguments);var e=nt(t),n=e.getMinutes();return n}function PVe(t){tt(1,arguments);var e=nt(t),n=e.getMonth();return n}function MVe(t){tt(1,arguments);var e=nt(t),n=e.getSeconds();return n}function kVe(t){return tt(1,arguments),nt(t).getFullYear()}function TS(t,e){tt(2,arguments);var n=nt(t),r=nt(e);return n.getTime()>r.getTime()}function em(t,e){tt(2,arguments);var n=nt(t),r=nt(e);return n.getTime()t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(c){throw c},f:i}}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 o=!0,a=!1,s;return{s:function(){n=n.call(t)},n:function(){var c=n.next();return o=c.done,c},e:function(c){a=!0,s=c},f:function(){try{!o&&n.return!=null&&n.return()}finally{if(a)throw s}}}}function cn(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_T(t,e)}function XT(t){return XT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},XT(t)}function Eae(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Eae=function(){return!!t})()}function RVe(t,e){if(e&&(au(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return lt(t)}function un(t){var e=Eae();return function(){var r=XT(t),i;if(e){var o=XT(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return RVe(this,i)}}function tn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function JG(t,e){for(var n=0;n0,r=n?e:1-e,i;if(r<=50)i=t||100;else{var o=r+50,a=Math.floor(o/100)*100,s=t>=o%100;i=t+a-(s?100:0)}return n?i:1-i}function Aae(t){return t%400===0||t%4===0&&t%100!==0}var NVe=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a0}},{key:"set",value:function(i,o,a){var s=i.getUTCFullYear();if(a.isTwoDigitYear){var l=kae(a.year,s);return i.setUTCFullYear(l,0,1),i.setUTCHours(0,0,0,0),i}var c=!("era"in o)||o.era===1?a.year:1-a.year;return i.setUTCFullYear(c,0,1),i.setUTCHours(0,0,0,0),i}}]),n}(bn),FVe=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a0}},{key:"set",value:function(i,o,a,s){var l=SB(i,s);if(a.isTwoDigitYear){var c=kae(a.year,l);return i.setUTCFullYear(c,0,s.firstWeekContainsDate),i.setUTCHours(0,0,0,0),Jh(i,s)}var u=!("era"in o)||o.era===1?a.year:1-a.year;return i.setUTCFullYear(u,0,s.firstWeekContainsDate),i.setUTCHours(0,0,0,0),Jh(i,s)}}]),n}(bn),jVe=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a=1&&o<=4}},{key:"set",value:function(i,o,a){return i.setUTCMonth((a-1)*3,1),i.setUTCHours(0,0,0,0),i}}]),n}(bn),UVe=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a=1&&o<=4}},{key:"set",value:function(i,o,a){return i.setUTCMonth((a-1)*3,1),i.setUTCHours(0,0,0,0),i}}]),n}(bn),WVe=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a=0&&o<=11}},{key:"set",value:function(i,o,a){return i.setUTCMonth(a,1),i.setUTCHours(0,0,0,0),i}}]),n}(bn),VVe=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a=0&&o<=11}},{key:"set",value:function(i,o,a){return i.setUTCMonth(a,1),i.setUTCHours(0,0,0,0),i}}]),n}(bn);function GVe(t,e,n){tt(2,arguments);var r=nt(t),i=On(e),o=_ae(r,n)-i;return r.setUTCDate(r.getUTCDate()-o*7),r}var HVe=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a=1&&o<=53}},{key:"set",value:function(i,o,a,s){return Jh(GVe(i,a,s),s)}}]),n}(bn);function qVe(t,e){tt(2,arguments);var n=nt(t),r=On(e),i=bae(n)-r;return n.setUTCDate(n.getUTCDate()-i*7),n}var XVe=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a=1&&o<=53}},{key:"set",value:function(i,o,a){return nv(qVe(i,a))}}]),n}(bn),QVe=[31,28,31,30,31,30,31,31,30,31,30,31],YVe=[31,29,31,30,31,30,31,31,30,31,30,31],KVe=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a=1&&o<=YVe[l]:o>=1&&o<=QVe[l]}},{key:"set",value:function(i,o,a){return i.setUTCDate(a),i.setUTCHours(0,0,0,0),i}}]),n}(bn),ZVe=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a=1&&o<=366:o>=1&&o<=365}},{key:"set",value:function(i,o,a){return i.setUTCMonth(0,a),i.setUTCHours(0,0,0,0),i}}]),n}(bn);function CB(t,e,n){var r,i,o,a,s,l,c,u;tt(2,arguments);var f=pd(),d=On((r=(i=(o=(a=n==null?void 0:n.weekStartsOn)!==null&&a!==void 0?a:n==null||(s=n.locale)===null||s===void 0||(l=s.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&o!==void 0?o:f.weekStartsOn)!==null&&i!==void 0?i:(c=f.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&r!==void 0?r:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=nt(t),p=On(e),m=h.getUTCDay(),g=p%7,v=(g+7)%7,y=(v=0&&o<=6}},{key:"set",value:function(i,o,a,s){return i=CB(i,a,s),i.setUTCHours(0,0,0,0),i}}]),n}(bn),e8e=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a=0&&o<=6}},{key:"set",value:function(i,o,a,s){return i=CB(i,a,s),i.setUTCHours(0,0,0,0),i}}]),n}(bn),t8e=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a=0&&o<=6}},{key:"set",value:function(i,o,a,s){return i=CB(i,a,s),i.setUTCHours(0,0,0,0),i}}]),n}(bn);function n8e(t,e){tt(2,arguments);var n=On(e);n%7===0&&(n=n-7);var r=1,i=nt(t),o=i.getUTCDay(),a=n%7,s=(a+7)%7,l=(s=1&&o<=7}},{key:"set",value:function(i,o,a){return i=n8e(i,a),i.setUTCHours(0,0,0,0),i}}]),n}(bn),i8e=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a=1&&o<=12}},{key:"set",value:function(i,o,a){var s=i.getUTCHours()>=12;return s&&a<12?i.setUTCHours(a+12,0,0,0):!s&&a===12?i.setUTCHours(0,0,0,0):i.setUTCHours(a,0,0,0),i}}]),n}(bn),l8e=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a=0&&o<=23}},{key:"set",value:function(i,o,a){return i.setUTCHours(a,0,0,0),i}}]),n}(bn),c8e=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a=0&&o<=11}},{key:"set",value:function(i,o,a){var s=i.getUTCHours()>=12;return s&&a<12?i.setUTCHours(a+12,0,0,0):i.setUTCHours(a,0,0,0),i}}]),n}(bn),u8e=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a=1&&o<=24}},{key:"set",value:function(i,o,a){var s=a<=24?a%24:a;return i.setUTCHours(s,0,0,0),i}}]),n}(bn),f8e=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a=0&&o<=59}},{key:"set",value:function(i,o,a){return i.setUTCMinutes(a,0,0),i}}]),n}(bn),d8e=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a=0&&o<=59}},{key:"set",value:function(i,o,a){return i.setUTCSeconds(a,0),i}}]),n}(bn),h8e=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a=1&&k<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var I=On((p=(m=(g=(v=r==null?void 0:r.weekStartsOn)!==null&&v!==void 0?v:r==null||(y=r.locale)===null||y===void 0||(x=y.options)===null||x===void 0?void 0:x.weekStartsOn)!==null&&g!==void 0?g:C.weekStartsOn)!==null&&m!==void 0?m:(b=C.locale)===null||b===void 0||(_=b.options)===null||_===void 0?void 0:_.weekStartsOn)!==null&&p!==void 0?p:0);if(!(I>=0&&I<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(O==="")return S===""?nt(n):new Date(NaN);var P={firstWeekContainsDate:k,weekStartsOn:I,locale:E},R=[new LVe],T=O.match(b8e).map(function(te){var J=te[0];if(J in m$){var pe=m$[J];return pe(te,E.formatLong)}return te}).join("").match(x8e),L=[],z=ZG(T),B;try{var W=function(){var J=B.value;!(r!=null&&r.useAdditionalWeekYearTokens)&&Oae(J)&&qT(J,O,t),!(r!=null&&r.useAdditionalDayOfYearTokens)&&Sae(J)&&qT(J,O,t);var pe=J[0],be=y8e[pe];if(be){var re=be.incompatibleTokens;if(Array.isArray(re)){var ve=L.find(function(ce){return re.includes(ce.token)||ce.token===pe});if(ve)throw new RangeError("The format string mustn't contain `".concat(ve.fullToken,"` and `").concat(J,"` at the same time"))}else if(be.incompatibleTokens==="*"&&L.length>0)throw new RangeError("The format string mustn't contain `".concat(J,"` and any other token at the same time"));L.push({token:pe,fullToken:J});var F=be.run(S,J,E.match,P);if(!F)return{v:new Date(NaN)};R.push(F.setter),S=F.rest}else{if(pe.match(O8e))throw new RangeError("Format string contains an unescaped latin alphabet character `"+pe+"`");if(J==="''"?J="'":pe==="'"&&(J=T8e(J)),S.indexOf(J)===0)S=S.slice(J.length);else return{v:new Date(NaN)}}};for(z.s();!(B=z.n()).done;){var U=W();if(au(U)==="object")return U.v}}catch(te){z.e(te)}finally{z.f()}if(S.length>0&&S8e.test(S))return new Date(NaN);var N=R.map(function(te){return te.priority}).sort(function(te,J){return J-te}).filter(function(te,J,pe){return pe.indexOf(te)===J}).map(function(te){return R.filter(function(J){return J.priority===te}).sort(function(J,pe){return pe.subPriority-J.subPriority})}).map(function(te){return te[0]}),$=nt(n);if(isNaN($.getTime()))return new Date(NaN);var D=yae($,HT($)),A={},q=ZG(N),Y;try{for(q.s();!(Y=q.n()).done;){var K=Y.value;if(!K.validate(D,P))return new Date(NaN);var se=K.set(D,A,P);Array.isArray(se)?(D=se[0],wVe(A,se[1])):D=se}}catch(te){q.e(te)}finally{q.f()}return D}function T8e(t){return t.match(_8e)[1].replace(w8e,"'")}function eH(t){tt(1,arguments);var e=nt(t);return e.setMinutes(0,0,0),e}function E8e(t,e){tt(2,arguments);var n=eH(t),r=eH(e);return n.getTime()===r.getTime()}function P8e(t,e){tt(2,arguments);var n=nt(t),r=nt(e);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function M8e(t,e){tt(2,arguments);var n=nt(t),r=nt(e);return n.getFullYear()===r.getFullYear()}function k8e(t,e){tt(2,arguments);var n=nt(t).getTime(),r=nt(e.start).getTime(),i=nt(e.end).getTime();if(!(r<=i))throw new RangeError("Invalid interval");return n>=r&&n<=i}function Rae(t,e){var n;tt(1,arguments);var r=On((n=e==null?void 0:e.additionalDigits)!==null&&n!==void 0?n:2);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof t=="string"||Object.prototype.toString.call(t)==="[object String]"))return new Date(NaN);var i=D8e(t),o;if(i.date){var a=L8e(i.date,r);o=$8e(a.restDateString,a.year)}if(!o||isNaN(o.getTime()))return new Date(NaN);var s=o.getTime(),l=0,c;if(i.time&&(l=N8e(i.time),isNaN(l)))return new Date(NaN);if(i.timezone){if(c=F8e(i.timezone),isNaN(c))return new Date(NaN)}else{var u=new Date(s+l),f=new Date(0);return f.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),f.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),f}return new Date(s+l+c)}var ES={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},A8e=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,R8e=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,I8e=/^([+-])(\d{2})(?::?(\d{2}))?$/;function D8e(t){var e={},n=t.split(ES.dateTimeDelimiter),r;if(n.length>2)return e;if(/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],ES.timeZoneDelimiter.test(e.date)&&(e.date=t.split(ES.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length))),r){var i=ES.timezone.exec(r);i?(e.time=r.replace(i[1],""),e.timezone=i[1]):e.time=r}return e}function L8e(t,e){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=t.match(n);if(!r)return{year:NaN,restDateString:""};var i=r[1]?parseInt(r[1]):null,o=r[2]?parseInt(r[2]):null;return{year:o===null?i:o*100,restDateString:t.slice((r[1]||r[2]).length)}}function $8e(t,e){if(e===null)return new Date(NaN);var n=t.match(A8e);if(!n)return new Date(NaN);var r=!!n[4],i=_0(n[1]),o=_0(n[2])-1,a=_0(n[3]),s=_0(n[4]),l=_0(n[5])-1;if(r)return W8e(e,s,l)?j8e(e,s,l):new Date(NaN);var c=new Date(0);return!z8e(e,o,a)||!U8e(e,i)?new Date(NaN):(c.setUTCFullYear(e,o,Math.max(i,a)),c)}function _0(t){return t?parseInt(t):1}function N8e(t){var e=t.match(R8e);if(!e)return NaN;var n=HA(e[1]),r=HA(e[2]),i=HA(e[3]);return V8e(n,r,i)?n*l2+r*s2+i*1e3:NaN}function HA(t){return t&&parseFloat(t.replace(",","."))||0}function F8e(t){if(t==="Z")return 0;var e=t.match(I8e);if(!e)return 0;var n=e[1]==="+"?-1:1,r=parseInt(e[2]),i=e[3]&&parseInt(e[3])||0;return G8e(r,i)?n*(r*l2+i*s2):NaN}function j8e(t,e,n){var r=new Date(0);r.setUTCFullYear(t,0,4);var i=r.getUTCDay()||7,o=(e-1)*7+n+1-i;return r.setUTCDate(r.getUTCDate()+o),r}var B8e=[31,null,31,30,31,30,31,31,30,31,30,31];function Iae(t){return t%400===0||t%4===0&&t%100!==0}function z8e(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(B8e[e]||(Iae(t)?29:28))}function U8e(t,e){return e>=1&&e<=(Iae(t)?366:365)}function W8e(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}function V8e(t,e,n){return t===24?e===0&&n===0:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}function G8e(t,e){return e>=0&&e<=59}function H8e(t,e){tt(2,arguments);var n=nt(t),r=On(e),i=n.getFullYear(),o=n.getDate(),a=new Date(0);a.setFullYear(i,r,15),a.setHours(0,0,0,0);var s=Cae(a);return n.setMonth(r,Math.min(o,s)),n}function q8e(t,e){tt(2,arguments);var n=nt(t),r=On(e);return n.setDate(r),n}function X8e(t,e){tt(2,arguments);var n=nt(t),r=On(e);return n.setHours(r),n}function Q8e(t,e){tt(2,arguments);var n=nt(t),r=On(e);return n.setMinutes(r),n}function Y8e(t,e){tt(2,arguments);var n=nt(t),r=On(e);return n.setSeconds(r),n}function K8e(t,e){tt(2,arguments);var n=nt(t),r=On(e);return isNaN(n.getTime())?new Date(NaN):(n.setFullYear(r),n)}function Dae(t){return t.getTimezoneOffset()*6e4}function Z8e(t){return t.getTime()-Dae(t)}function qA(t){const e=new Date(t);return new Date(e.getTime()+Dae(e))}function Gb(t){return new Date(t).toISOString().substring(0,10)}function dy(t){return Lae(new Date(t).toISOString())}function Lae(t){return t.substring(0,19).replace("T"," ")}const $ae={seconds:1e3,minutes:1e3*60,hours:1e3*60*60,days:1e3*60*60*24,weeks:1e3*60*60*24*7,years:1e3*60*60*24*365};function J8e(t,e){return t===e?!0:t!==null&&e!=null?t[0]===e[0]&&t[1]===e[1]:!1}function eGe(t,e){const n=new Set,r=new Set,i={};for(const l of t)for(const c of l.timeSeriesArray){const{placeId:u,datasetId:f,variableName:d,valueDataKey:h,errorDataKey:p}=c.source;u!==null&&r.add(u);const m=`${f}.${d}.${h}`;n.add(m);let g=null;p&&(g=`${f}.${d}.${p}`,n.add(g)),c.data.forEach(v=>{const y=dy(v.time),x=`${u!==null?u:f}-${y}`,b=i[x];b?i[x]={...b,[m]:v[h]}:i[x]={placeId:u,time:y,[m]:v[h]},g!==null&&(i[x][g]=v[p])})}const o=["placeId","time"].concat(Array.from(n).sort()),a=[];Object.keys(i).forEach(l=>{const c=i[l],u=new Array(o.length);o.forEach((f,d)=>{u[d]=c[f]}),a.push(u)}),a.sort((l,c)=>{const u=l[1],f=c[1],d=u.localeCompare(f);if(d!==0)return d;const h=l[0],p=c[0];return h.localeCompare(p)});const s={};return r.forEach(l=>{s[l]=aB(e,l)}),{colNames:o,dataRows:a,referencedPlaces:s}}function tGe(t){let e=null;const n=t.features||[];for(const r of n){if(!r.properties)continue;const i=r.properties.time;if(typeof i!="string")continue;const a=Rae(i).getTime();if(!Number.isNaN(a))for(const s of Object.getOwnPropertyNames(r.properties)){let l=r.properties[s];const c=typeof l;if(c==="boolean"?l=l?1:0:c!=="number"&&(l=Number.NaN),Number.isNaN(l))continue;const u={time:a,countTot:1,mean:l};e===null&&(e={});const f=e[s];f?f.data.push(u):e[s]={source:{datasetId:t.id,datasetTitle:t.title,variableName:s,placeId:null,geometry:null,valueDataKey:"mean",errorDataKey:null},data:[u],dataProgress:1}}}return e===null?null:{placeGroup:t,timeSeries:e}}const q1=t=>t.dataState.datasets||[],nGe=t=>t.dataState.colorBars,Nae=t=>t.dataState.timeSeriesGroups,X1=t=>t.dataState.userPlaceGroups,Fae=t=>t.dataState.userServers||[],rGe=t=>t.dataState.expressionCapabilities,iGe=t=>t.dataState.statistics.loading,oGe=t=>t.dataState.statistics.records,jae=at(q1,X1,(t,e)=>{const n={},r=[];return t.forEach(i=>{i.placeGroups&&i.placeGroups.forEach(o=>{n[o.id]||(n[o.id]=o,r.push(o))})}),[...r,...e]}),aGe=at(jae,t=>{const e=[];return t.forEach(n=>{const r=tGe(n);r!==null&&e.push(r)}),e}),sGe=[{name:"OpenStreetMap",link:"https://openstreetmap.org",datasets:[{name:"OSM Mapnik",endpoint:"https://a.tile.osm.org/{z}/{x}/{y}.png"},{name:"OSM Humanitarian",endpoint:"https://a.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png"},{name:"OSM Landscape",endpoint:"https://a.tile3.opencyclemap.org/landscape/{z}/{x}/{y}.png"}],overlays:[]},{name:"ESRI",link:"https://services.arcgisonline.com/arcgis/rest/services",datasets:[{name:"Dark Gray Base",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Canvas/World_Dark_Gray_Base/MapServer/tile/{z}/{y}/{x}"},{name:"Light Gray Base",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}"},{name:"World Hillshade",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer/tile/{z}/{y}/{x}"},{name:"World Ocean Base",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer/tile/{z}/{y}/{x}"},{name:"DeLorme World Base Map",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Specialty/DeLorme_World_Base_Map/MapServer/tile/{z}/{y}/{x}"},{name:"World Street Map",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}"},{name:"World Navigation Charts",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Specialty/World_Navigation_Charts/MapServer/tile/{z}/{y}/{x}"},{name:"National Geographic",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}"},{name:"World Imagery",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"},{name:"World Physical Map",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/World_Physical_Map/MapServer/tile/{z}/{y}/{x}"},{name:"World Shaded Relief",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/World_Shaded_Relief/MapServer/tile/{z}/{y}/{x}"},{name:"World Terrain",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/World_Terrain_Base/MapServer/tile/{z}/{y}/{x}"},{name:"World Topo Map",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}"}],overlays:[{name:"Dark Gray Reference",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Canvas/World_Dark_Gray_Reference/MapServer/tile/{z}/{y}/{x}"},{name:"Light Gray Reference",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Canvas/World_Light_Gray_Reference/MapServer/tile/{z}/{y}/{x}"},{name:"World Ocean Reference",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer/tile/{z}/{y}/{x}"},{name:"World Boundaries & Places",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Reference/World_Boundaries_and_Places/MapServer/tile/{z}/{y}/{x}"},{name:"World Reference Overlay",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Reference/World_Reference_Overlay/MapServer/tile/{z}/{y}/{x}"},{name:"World Transportation",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Reference/World_Transportation/MapServer/tile/{z}/{y}/{x}"}]},{name:"CartoDB",link:"https://cartodb.com/basemaps/",datasets:[{name:"Positron",endpoint:"https://a.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png"},{name:"Dark Matter",endpoint:"https://a.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png"},{name:"Positron (No Labels)",endpoint:"https://a.basemaps.cartocdn.com/light_nolabels/{z}/{x}/{y}.png"},{name:"Dark Matter (No Labels)",endpoint:"https://a.basemaps.cartocdn.com/dark_nolabels/{z}/{x}/{y}.png"}],overlays:[{name:"Positron Labels",endpoint:"https://a.basemaps.cartocdn.com/light_only_labels/{z}/{x}/{y}.png"},{name:"Dark Matter Labels",endpoint:"https://a.basemaps.cartocdn.com/dark_only_labels/{z}/{x}/{y}.png"}]},{name:"Stamen",link:"https://maps.stamen.com",datasets:[{name:"Toner",endpoint:"https://tile.stamen.com/toner/{z}/{x}/{y}.png",attribution:'Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL.'},{name:"Terrain",endpoint:"https://tile.stamen.com/terrain/{z}/{x}/{y}.png"},{name:"Watercolor",endpoint:"https://tile.stamen.com/watercolor/{z}/{x}/{y}.png"}],overlays:[]},{name:"Mapbox",link:"https://a.tiles.mapbox.com/v3/mapbox/maps.html",datasets:[{name:"Blue Marble (January)",endpoint:"https://a.tiles.mapbox.com/v3/mapbox.blue-marble-topo-bathy-jan/{z}/{x}/{y}.png"},{name:"Blue Marble (July)",endpoint:"https://a.tiles.mapbox.com/v3/mapbox.blue-marble-topo-bathy-jul/{z}/{x}/{y}.png"},{name:"Blue Marble Topo & Bathy B/W (July)",endpoint:"https://a.tiles.mapbox.com/v3/mapbox.blue-marble-topo-bathy-jul-bw/{z}/{x}/{y}.png"},{name:"Control Room",endpoint:"https://a.tiles.mapbox.com/v3/mapbox.control-room/{z}/{x}/{y}.png"},{name:"Geography Class",endpoint:"https://a.tiles.mapbox.com/v3/mapbox.geography-class/{z}/{x}/{y}.png"},{name:"World Dark",endpoint:"https://a.tiles.mapbox.com/v3/mapbox.world-dark/{z}/{x}/{y}.png"},{name:"World Light",endpoint:"https:a.tiles.mapbox.com/v3/mapbox.world-light/{z}/{x}/{y}.png"},{name:"World Glass",endpoint:"https:a.tiles.mapbox.com/v3/mapbox.world-glass/{z}/{x}/{y}.png"},{name:"World Print",endpoint:"https:a.tiles.mapbox.com/v3/mapbox.world-print/{z}/{x}/{y}.png"},{name:"World Blue",endpoint:"https:a.tiles.mapbox.com/v3/mapbox.world-blue/{z}/{x}/{y}.png"}],overlays:[]}],lGe=sGe,TB="User";function YT(t){return t?`${t.group}: ${t.title}`:"-"}function KT(t,e){return t.find(n=>n.id===e)||null}function Bae(t="datasets"){const e=[];return lGe.forEach(n=>{n[t].forEach(r=>{e.push({id:`${n.name}-${r.name}`,group:n.name,attribution:n.link,title:r.name,url:r.endpoint})})}),e}const zae=Bae("datasets"),cGe=Bae("overlays"),uGe=zae[0].id;var fGe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),dGe=function(t){fGe(e,t);function e(){return t.call(this)||this}return e.prototype.getType=function(){return"text"},e.prototype.readFeature=function(n,r){return this.readFeatureFromText(PS(n),this.adaptOptions(r))},e.prototype.readFeatureFromText=function(n,r){return vt()},e.prototype.readFeatures=function(n,r){return this.readFeaturesFromText(PS(n),this.adaptOptions(r))},e.prototype.readFeaturesFromText=function(n,r){return vt()},e.prototype.readGeometry=function(n,r){return this.readGeometryFromText(PS(n),this.adaptOptions(r))},e.prototype.readGeometryFromText=function(n,r){return vt()},e.prototype.readProjection=function(n){return this.readProjectionFromText(PS(n))},e.prototype.readProjectionFromText=function(n){return this.dataProjection},e.prototype.writeFeature=function(n,r){return this.writeFeatureText(n,this.adaptOptions(r))},e.prototype.writeFeatureText=function(n,r){return vt()},e.prototype.writeFeatures=function(n,r){return this.writeFeaturesText(n,this.adaptOptions(r))},e.prototype.writeFeaturesText=function(n,r){return vt()},e.prototype.writeGeometry=function(n,r){return this.writeGeometryText(n,this.adaptOptions(r))},e.prototype.writeGeometryText=function(n,r){return vt()},e}(Xie);function PS(t){return typeof t=="string"?t:""}const hGe=dGe;var pGe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),mGe={POINT:Vl,LINESTRING:Lh,POLYGON:Jg,MULTIPOINT:KM,MULTILINESTRING:J5,MULTIPOLYGON:tB},Uae="EMPTY",Wae="Z",Vae="M",gGe="ZM",mn={START:0,TEXT:1,LEFT_PAREN:2,RIGHT_PAREN:3,NUMBER:4,COMMA:5,EOF:6},vGe={Point:"POINT",LineString:"LINESTRING",Polygon:"POLYGON",MultiPoint:"MULTIPOINT",MultiLineString:"MULTILINESTRING",MultiPolygon:"MULTIPOLYGON",GeometryCollection:"GEOMETRYCOLLECTION",Circle:"CIRCLE"},yGe=function(){function t(e){this.wkt=e,this.index_=-1}return t.prototype.isAlpha_=function(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"},t.prototype.isNumeric_=function(e,n){var r=n!==void 0?n:!1;return e>="0"&&e<="9"||e=="."&&!r},t.prototype.isWhiteSpace_=function(e){return e==" "||e==" "||e=="\r"||e==` -`},t.prototype.nextChar_=function(){return this.wkt.charAt(++this.index_)},t.prototype.nextToken=function(){var e=this.nextChar_(),n=this.index_,r=e,i;if(e=="(")i=mn.LEFT_PAREN;else if(e==",")i=mn.COMMA;else if(e==")")i=mn.RIGHT_PAREN;else if(this.isNumeric_(e)||e=="-")i=mn.NUMBER,r=this.readNumber_();else if(this.isAlpha_(e))i=mn.TEXT,r=this.readText_();else{if(this.isWhiteSpace_(e))return this.nextToken();if(e==="")i=mn.EOF;else throw new Error("Unexpected character: "+e)}return{position:n,value:r,type:i}},t.prototype.readNumber_=function(){var e,n=this.index_,r=!1,i=!1;do e=="."?r=!0:(e=="e"||e=="E")&&(i=!0),e=this.nextChar_();while(this.isNumeric_(e,r)||!i&&(e=="e"||e=="E")||i&&(e=="-"||e=="+"));return parseFloat(this.wkt.substring(n,this.index_--))},t.prototype.readText_=function(){var e,n=this.index_;do e=this.nextChar_();while(this.isAlpha_(e));return this.wkt.substring(n,this.index_--).toUpperCase()},t}(),xGe=function(){function t(e){this.lexer_=e,this.token_={position:0,type:mn.START},this.layout_=dn.XY}return t.prototype.consume_=function(){this.token_=this.lexer_.nextToken()},t.prototype.isTokenType=function(e){return this.token_.type==e},t.prototype.match=function(e){var n=this.isTokenType(e);return n&&this.consume_(),n},t.prototype.parse=function(){return this.consume_(),this.parseGeometry_()},t.prototype.parseGeometryLayout_=function(){var e=dn.XY,n=this.token_;if(this.isTokenType(mn.TEXT)){var r=n.value;r===Wae?e=dn.XYZ:r===Vae?e=dn.XYM:r===gGe&&(e=dn.XYZM),e!==dn.XY&&this.consume_()}return e},t.prototype.parseGeometryCollectionText_=function(){if(this.match(mn.LEFT_PAREN)){var e=[];do e.push(this.parseGeometry_());while(this.match(mn.COMMA));if(this.match(mn.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())},t.prototype.parsePointText_=function(){if(this.match(mn.LEFT_PAREN)){var e=this.parsePoint_();if(this.match(mn.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())},t.prototype.parseLineStringText_=function(){if(this.match(mn.LEFT_PAREN)){var e=this.parsePointList_();if(this.match(mn.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())},t.prototype.parsePolygonText_=function(){if(this.match(mn.LEFT_PAREN)){var e=this.parseLineStringTextList_();if(this.match(mn.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())},t.prototype.parseMultiPointText_=function(){if(this.match(mn.LEFT_PAREN)){var e=void 0;if(this.token_.type==mn.LEFT_PAREN?e=this.parsePointTextList_():e=this.parsePointList_(),this.match(mn.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())},t.prototype.parseMultiLineStringText_=function(){if(this.match(mn.LEFT_PAREN)){var e=this.parseLineStringTextList_();if(this.match(mn.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())},t.prototype.parseMultiPolygonText_=function(){if(this.match(mn.LEFT_PAREN)){var e=this.parsePolygonTextList_();if(this.match(mn.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())},t.prototype.parsePoint_=function(){for(var e=[],n=this.layout_.length,r=0;r0&&(i+=" "+o)}return r.length===0?i+" "+Uae:i+"("+r+")"}class TGe extends Error{}const Qae={separator:",",comment:"#",quote:'"',escape:"\\",trim:!0,nanToken:"NaN",trueToken:"true",falseToken:"false"};function Yae(t,e){return new EGe(e).parse(t)}let EGe=class{constructor(e){Yt(this,"options");this.options={...Qae,...e},this.parseLine=this.parseLine.bind(this)}parse(e){return this.parseText(e).map(this.parseLine)}parseText(e){const{comment:n,trim:r}=this.options;return e.split(` -`).map((i,o)=>(r&&(i=i.trim()),[i,o])).filter(([i,o])=>i.trim()!==""&&!i.startsWith(n))}parseLine([e,n]){const{separator:r,quote:i,escape:o}=this.options;let a=!1;const s=[];let l=0,c=0;for(;ct.toLowerCase());function tH(t){if(t=t.trim(),t==="")return"csv";if(t[0]==="{")return"geojson";const e=t.substring(0,20).toLowerCase();return kGe.find(r=>e.startsWith(r)&&(e.length===r.length||` - (`.indexOf(e[r.length])>=0))?"wkt":"csv"}function EC(t){return t.split(",").map(e=>e.trim().toLowerCase()).filter(e=>e!=="")}const AGe=t=>{if(t.trim()!=="")try{Yae(t)}catch(e){return console.error(e),`${e}`}return null},Kae={name:"Text/CSV",fileExt:".txt,.csv",checkError:AGe},v$={...Qae,xNames:"longitude, lon, x",yNames:"latitude, lat, y",forceGeometry:!1,geometryNames:"geometry, geom",timeNames:"time, date, datetime, date-time",groupNames:"group, cruise, station, type",groupPrefix:"Group-",labelNames:"label, name, title, id",labelPrefix:"Place-"};let RGe=0,IGe=0;function DGe(t,e){const n=Yae(t,e);if(n.length<2)throw new Error(fe.get("Missing header line in CSV"));for(const S of n[0])if(typeof S!="string"||S==="")throw new Error(fe.get("Invalid header line in CSV"));const r=n[0].map(S=>S),i=r.map(S=>S.toLowerCase()),o=r.length;for(const S of n)if(S.length!==o)throw new Error(fe.get("All rows must have same length"));const a=LGe(i),s=tm(a,e.groupNames),l=tm(a,e.labelNames),c=tm(a,e.timeNames),u=tm(a,e.xNames),f=tm(a,e.yNames);let d=tm(a,e.geometryNames);if(e.forceGeometry||u<0||f<0||u===f){if(d<0)throw new Error(fe.get("No geometry column(s) found"))}else d=-1;let p=e.groupPrefix.trim();p===""&&(p=v$.groupPrefix);let m=e.labelPrefix.trim();m===""&&(m=v$.labelPrefix);let g="";if(s===-1){const S=++RGe;g=`${p}${S}`}const v=new Gae,y={};let x=1,b=0,_=Xh(0);for(;x=0&&(O=`${S[c]}`),s>=0&&(g=`${S[s]}`);let C=y[g];C||(C=rB(g,[]),y[g]=C,_=Xh(b),b++);let E=null;if(d>=0){if(typeof S[d]=="string")try{E=v.readGeometry(t)}catch{}}else{const P=S[u],R=S[f];typeof P=="number"&&Number.isFinite(P)&&typeof R=="number"&&Number.isFinite(R)&&(E=new Vl([P,R]))}if(E===null)throw new Error(fe.get(`Invalid geometry in data row ${x}`));const k={};S.forEach((P,R)=>{if(R!==u&&R!==f&&R!==d){const T=r[R];k[T]=P}});let I;if(l>=0)I=`${S[l]}`;else{const P=++IGe;I=`${m}${P}`}O!==""&&(k.time=O),k.color||(k.color=_),k.label||(k.label=I),k.source||(k.source="CSV"),C.features.push(iB(E,k))}return Object.getOwnPropertyNames(y).map(S=>y[S])}function LGe(t){const e={};for(let n=0;n{if(t.trim()!=="")try{JSON.parse(t)}catch(e){return console.error(e),`${e}`}return null},Zae={name:"GeoJSON",fileExt:".json,.geojson",checkError:$Ge},y$={groupNames:"group, cruise, station, type",groupPrefix:"Group-",labelNames:"label, name, title, id",labelPrefix:"Place-",timeNames:"time, date, datetime, date-time"};let NGe=0,FGe=0;function jGe(t,e){const n=EC(e.groupNames||"");let r=e.groupPrefix.trim();r===""&&(r=y$.groupPrefix);const i=EC(e.labelNames||"");let o=e.labelPrefix.trim();o===""&&(o=y$.labelPrefix);const a=EC(e.timeNames||""),s=new Tp;let l;try{l=s.readFeatures(t)}catch{try{const d=s.readGeometry(t);l=[new Fc(d)]}catch{throw new Error(fe.get("Invalid GeoJSON"))}}const c={};let u=0;return l.forEach(f=>{const d=f.getProperties(),h=f.getGeometry();if(h){let p="",m="",g="",v=Xh(0);if(d){const b={};Object.getOwnPropertyNames(d).forEach(_=>{b[_.toLowerCase()]=d[_]}),p=XA(b,a,p),g=XA(b,i,g),m=XA(b,n,m)}if(m===""){const b=++NGe;m=`${r}-${b}`}if(g===""){const b=++FGe;g=`${o}-${b}`}let y=c[m];y||(y=rB(m,[]),c[m]=y,v=Xh(u),u++);const x={...d};p!==""&&(x.time=p),x.color||(x.color=v),x.label||(x.label=g),x.source||(x.source="GeoJSON"),y.features.push(iB(h,x))}}),Object.getOwnPropertyNames(c).map(f=>c[f])}function XA(t,e,n){if(n===""){for(const r of e)if(t[r]==="string")return t[r]}return n}const BGe=t=>null,Jae={name:"WKT",fileExt:".txt,.wkt",checkError:BGe},x$={group:"",groupPrefix:"Group-",label:"",labelPrefix:"Place-",time:dy(new Date().getTime())};let zGe=0,UGe=0;function WGe(t,e){let n=e.groupPrefix.trim();n===""&&(n=x$.groupPrefix);let r=e.group.trim();if(r===""){const s=++zGe;r=`${n}${s}`}let i=e.labelPrefix.trim();i===""&&(i=x$.labelPrefix);let o=e.label.trim();if(o===""){const s=++UGe;o=`${i}${s}`}const a=e.time.trim();try{const s=new Gae().readGeometry(t);let l={color:Xh(Math.floor(1e3*Math.random())),label:o,source:"WKT"};a!==""&&(l={time:a,...l});const c=[iB(s,l)];return[rB(r,c)]}catch{throw new Error(fe.get("Invalid Geometry WKT"))}}function hy(t){return VGe("localStorage",t)}function VGe(t,e){try{const n=window[t],r="__storage_test__";return n.setItem(r,r),n.removeItem(r),new GGe(n,e)}catch{return null}}class GGe{constructor(e,n){Yt(this,"nativeStorage");Yt(this,"brandingName");this.nativeStorage=e,this.brandingName=n}getItem(e,n,r,i){const o=this.nativeStorage.getItem(this.makeKey(e));if(o!==null)try{const a=r?r(o):o;return i?i(a):a}catch(a){console.error(`Failed parsing user setting "${e}": ${a}`)}return typeof n>"u"?null:n}getObjectItem(e,n){return this.getItem(e,n,r=>JSON.parse(r))}getBooleanProperty(e,n,r){this.getProperty(e,n,r,i=>i==="true")}getIntProperty(e,n,r){this.getProperty(e,n,r,parseInt)}getStringProperty(e,n,r){this.getProperty(e,n,r,i=>i)}getArrayProperty(e,n,r,i){this.getProperty(e,n,r,o=>{const a=JSON.parse(o);if(Array.isArray(a))return a;const s=r[e];return Array.isArray(s)?s:[]},i)}getObjectProperty(e,n,r){this.getProperty(e,n,r,i=>{const o=JSON.parse(i),a=r[e],s={...a,...o};return Object.getOwnPropertyNames(o).forEach(l=>{const c=a[l],u=o[l];z8(c)&&z8(u)&&(s[l]={...c,...u})}),s})}getProperty(e,n,r,i,o){n[e]=this.getItem(e,r[e],i,o)}setItem(e,n,r){if(typeof n>"u"||n===null)this.nativeStorage.removeItem(this.makeKey(e));else{const i=r?r(n):n+"";this.nativeStorage.setItem(this.makeKey(e),i)}}setObjectItem(e,n){this.setItem(e,n,r=>JSON.stringify(r))}setPrimitiveProperty(e,n){this.setItem(e,n[e])}setArrayProperty(e,n){this.setObjectItem(e,n[e])}setObjectProperty(e,n){this.setObjectItem(e,n[e])}makeKey(e){return`xcube.${this.brandingName}.${e}`}}function HGe(t){const e=hy(Kt.instance.name);if(e)try{e.setObjectItem("userServers",t)}catch(n){console.warn(`failed to store user servers: ${n}`)}}function qGe(){const t=hy(Kt.instance.name);if(t)try{return t.getObjectItem("userServers",[])}catch(e){console.warn(`failed to load user servers: ${e}`)}return[]}function XGe(t){const e=hy(Kt.instance.name);if(e)try{e.setObjectItem("userVariables",t)}catch(n){console.warn(`failed to store user variables: ${n}`)}}function QGe(){const t=hy(Kt.instance.name);if(t)try{return t.getObjectItem("userVariables",{})}catch(e){console.warn(`failed to load user variables: ${e}`)}return{}}function ol(t){const e=hy(Kt.instance.name);if(e)try{e.setPrimitiveProperty("locale",t),e.setPrimitiveProperty("privacyNoticeAccepted",t),e.setPrimitiveProperty("autoShowTimeSeries",t),e.setPrimitiveProperty("timeSeriesIncludeStdev",t),e.setPrimitiveProperty("timeSeriesChartTypeDefault",t),e.setPrimitiveProperty("timeSeriesUseMedian",t),e.setPrimitiveProperty("timeAnimationInterval",t),e.setPrimitiveProperty("timeChunkSize",t),e.setPrimitiveProperty("sidebarOpen",t),e.setPrimitiveProperty("sidebarPanelId",t),e.setPrimitiveProperty("volumeRenderMode",t),e.setObjectProperty("infoCardElementStates",t),e.setPrimitiveProperty("imageSmoothingEnabled",t),e.setPrimitiveProperty("mapProjection",t),e.setPrimitiveProperty("selectedBaseMapId",t),e.setPrimitiveProperty("selectedOverlayId",t),e.setArrayProperty("userBaseMaps",t),e.setArrayProperty("userOverlays",t),e.setArrayProperty("userColorBars",t),e.setPrimitiveProperty("userDrawnPlaceGroupName",t),e.setPrimitiveProperty("datasetLocateMode",t),e.setPrimitiveProperty("placeLocateMode",t),e.setPrimitiveProperty("exportTimeSeries",t),e.setPrimitiveProperty("exportTimeSeriesSeparator",t),e.setPrimitiveProperty("exportPlaces",t),e.setPrimitiveProperty("exportPlacesAsCollection",t),e.setPrimitiveProperty("exportZipArchive",t),e.setPrimitiveProperty("exportFileName",t),e.setPrimitiveProperty("userPlacesFormatName",t),e.setObjectProperty("userPlacesFormatOptions",t)}catch(n){console.warn(`failed to store user settings: ${n}`)}}function YGe(t){const e=hy(Kt.instance.name);if(e){const n={...t};try{e.getStringProperty("locale",n,t),e.getBooleanProperty("privacyNoticeAccepted",n,t),e.getBooleanProperty("autoShowTimeSeries",n,t),e.getBooleanProperty("timeSeriesIncludeStdev",n,t),e.getStringProperty("timeSeriesChartTypeDefault",n,t),e.getBooleanProperty("timeSeriesUseMedian",n,t),e.getIntProperty("timeAnimationInterval",n,t),e.getIntProperty("timeChunkSize",n,t),e.getBooleanProperty("sidebarOpen",n,t),e.getStringProperty("sidebarPanelId",n,t),e.getStringProperty("volumeRenderMode",n,t),e.getObjectProperty("infoCardElementStates",n,t),e.getBooleanProperty("imageSmoothingEnabled",n,t),e.getStringProperty("mapProjection",n,t),e.getStringProperty("selectedBaseMapId",n,t),e.getStringProperty("selectedOverlayId",n,t),e.getArrayProperty("userBaseMaps",n,t),e.getArrayProperty("userOverlays",n,t),e.getArrayProperty("userColorBars",n,t,KGe),e.getStringProperty("userDrawnPlaceGroupName",n,t),e.getStringProperty("datasetLocateMode",n,t),e.getStringProperty("placeLocateMode",n,t),e.getBooleanProperty("exportTimeSeries",n,t),e.getStringProperty("exportTimeSeriesSeparator",n,t),e.getBooleanProperty("exportPlaces",n,t),e.getBooleanProperty("exportPlacesAsCollection",n,t),e.getBooleanProperty("exportZipArchive",n,t),e.getStringProperty("exportFileName",n,t),e.getStringProperty("userPlacesFormatName",n,t),e.getObjectProperty("userPlacesFormatOptions",n,t)}catch(r){console.warn(`Failed to load user settings: ${r}`)}return n}else console.warn("User settings not found or access denied");return t}const nH={node:"continuous",continuous:"continuous",bound:"stepwise",stepwise:"stepwise",key:"categorical",categorical:"categorical"};function KGe(t){if(Array.isArray(t))return t.map(e=>({...e,type:ZGe(e.type)}))}function ZGe(t){return ey(t)&&t in nH?nH[t]:"continuous"}const JGe=[250,500,1e3,2500],eHe=["info","timeSeries","stats","volume"];function tHe(){const t=Kt.instance.branding,e={selectedDatasetId:null,selectedVariableName:null,selectedDataset2Id:null,selectedVariable2Name:null,selectedPlaceGroupIds:[],selectedPlaceId:null,selectedUserPlaceId:null,selectedServerId:Kt.instance.server.id,selectedTime:null,selectedTimeRange:null,timeSeriesUpdateMode:"add",timeAnimationActive:!1,timeAnimationInterval:1e3,timeChunkSize:20,autoShowTimeSeries:!0,timeSeriesChartTypeDefault:"line",timeSeriesIncludeStdev:!0,timeSeriesUseMedian:t.defaultAgg==="median",userDrawnPlaceGroupName:"",userPlacesFormatName:"csv",userPlacesFormatOptions:{csv:{...v$},geojson:{...y$},wkt:{...x$}},flyTo:null,activities:{},locale:"en",dialogOpen:{},privacyNoticeAccepted:!1,mapInteraction:"Select",lastMapInteraction:"Select",layerVisibilities:{baseMap:!0,datasetRgb:!1,datasetVariable:!0,datasetVariable2:!0,datasetBoundary:!1,datasetPlaces:!0,userPlaces:!0,overlay:!0},variableCompareMode:!1,mapPointInfoBoxEnabled:!1,datasetLocateMode:"panAndZoom",placeLocateMode:"panAndZoom",layerMenuOpen:!1,sidebarPosition:2*Math.max(window.innerWidth,window.innerHeight)/3,sidebarOpen:!1,sidebarPanelId:"info",volumeRenderMode:"mip",volumeStates:{},infoCardElementStates:{dataset:{visible:!0,viewMode:"text"},variable:{visible:!0,viewMode:"text"},place:{visible:!0,viewMode:"text"}},mapProjection:t.mapProjection||uae,imageSmoothingEnabled:!1,selectedBaseMapId:uGe,selectedOverlayId:null,userBaseMaps:[],userOverlays:[],userColorBars:[],exportTimeSeries:!0,exportTimeSeriesSeparator:"TAB",exportPlaces:!0,exportPlacesAsCollection:!0,exportZipArchive:!0,exportFileName:"export"};return YGe(e)}const Va={},nHe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAGUExURcDAwP///ytph7QAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAUSURBVBjTYwABQSCglEENMxgYGAAynwRB8BEAgQAAAABJRU5ErkJggg==",ese=new Image;ese.src=nHe;const b$="_alpha",_$="_r";function rHe(t){let e=t;const n=e.endsWith(b$);n&&(e=e.slice(0,e.length-b$.length));const r=e.endsWith(_$);return r&&(e=e.slice(0,e.length-_$.length)),{baseName:e,isAlpha:n,isReversed:r}}function ZT(t){let e=t.baseName;return t.isReversed&&(e+=_$),t.isAlpha&&(e+=b$),e}function iHe(t,e,n){aHe(t,e).then(r=>{Promise.resolve(createImageBitmap(r)).then(i=>{const o=n.getContext("2d");if(o!==null){const a=o.createPattern(ese,"repeat");a!==null?o.fillStyle=a:o.fillStyle="#ffffff",o.fillRect(0,0,n.width,n.height),o.drawImage(i,0,0,n.width,n.height)}})})}function oHe(t,e){return new Promise((n,r)=>{const i=e||new Image,o=t.imageData;if(!o){n(i);return}i.onload=()=>{n(i)},i.onerror=(a,s,l,c,u)=>{r(u)},i.src=`data:image/png;base64,${o}`})}function aHe(t,e){return oHe(t).then(n=>{const r=sHe(t,e,n);if(r!==null)return r;throw new Error("failed to retrieve 2d context")})}function sHe(t,e,n){const r=document.createElement("canvas");r.width=n.width||1,r.height=n.height||1;const i=r.getContext("2d");if(i===null)return null;i.drawImage(n,0,0);let a=i.getImageData(0,0,r.width,r.height).data;if(t.isReversed){const s=new Uint8ClampedArray(a.length);for(let l=0;lt.controlState.selectedDatasetId,py=t=>t.controlState.selectedVariableName,lHe=t=>t.controlState.selectedDataset2Id,tse=t=>t.controlState.selectedVariable2Name,PB=t=>t.controlState.selectedPlaceGroupIds,my=t=>t.controlState.selectedPlaceId,gy=t=>t.controlState.selectedTime,cHe=t=>t.controlState.selectedServerId,uHe=t=>t.controlState.activities,f2=t=>t.controlState.timeAnimationActive,Y1=t=>t.controlState.imageSmoothingEnabled,fHe=t=>t.controlState.userBaseMaps,dHe=t=>t.controlState.userOverlays,MB=t=>t.controlState.selectedBaseMapId,kB=t=>t.controlState.selectedOverlayId,hHe=t=>!!t.controlState.layerVisibilities.baseMap,pHe=t=>!!t.controlState.layerVisibilities.datasetBoundary,mHe=t=>!!t.controlState.layerVisibilities.datasetVariable,gHe=t=>!!t.controlState.layerVisibilities.datasetVariable2,vHe=t=>!!t.controlState.layerVisibilities.datasetRgb,yHe=t=>!!t.controlState.layerVisibilities.datasetRgb2,xHe=t=>!!t.controlState.layerVisibilities.datasetPlaces,nse=t=>!!t.controlState.layerVisibilities.userPlaces,bHe=t=>!!t.controlState.layerVisibilities.overlay,_He=t=>t.controlState.layerVisibilities,rse=t=>t.controlState.infoCardElementStates,md=t=>t.controlState.mapProjection,wHe=t=>t.controlState.timeChunkSize,SHe=t=>t.controlState.userPlacesFormatName,OHe=t=>t.controlState.userPlacesFormatOptions.csv,CHe=t=>t.controlState.userPlacesFormatOptions.geojson,THe=t=>t.controlState.userPlacesFormatOptions.wkt,Ep=t=>t.controlState.userColorBars,EHe=t=>Kt.instance.branding.allowUserVariables,PHe=()=>"variable",MHe=()=>"variable2",kHe=()=>"rgb",AHe=()=>"rgb2",RHe=()=>13,IHe=()=>12,DHe=()=>11,LHe=()=>10,Gr=at(q1,Q1,Fb),gd=at(q1,lHe,Fb),$He=at(Gr,t=>t&&t.variables||[]),NHe=at(Gr,t=>t?nB(t)[1]:[]),ise=(t,e)=>!t||!e?null:e$(t,e),vo=at(Gr,py,ise),bu=at(gd,tse,ise),ose=t=>t&&(t.title||t.name),FHe=at(vo,ose),jHe=at(bu,ose),ase=t=>t&&t.units||"-",BHe=at(vo,ase),zHe=at(bu,ase),sse=t=>t&&t.colorBarName||"viridis",d2=at(vo,sse),h2=at(bu,sse),lse=t=>t?[t.colorBarMin,t.colorBarMax]:[0,1],cse=at(vo,lse),use=at(bu,lse),fse=t=>(t&&t.colorBarNorm)==="log"?"log":"lin",dse=at(vo,fse),hse=at(bu,fse),p2=at(Ep,nGe,(t,e)=>{const n={title:poe,description:"User-defined color bars.",names:t.map(i=>i.id)},r={};return t.forEach(({id:i,imageData:o})=>{o&&(r[i]=o)}),e?{...e,groups:[n,...e.groups],images:{...e.images,...r}}:{groups:[n],images:r}}),pse=(t,e,n)=>{const r=rHe(t),i=e.images[r.baseName],{baseName:o}=r,a=n.find(s=>s.id===o);if(a){const s=a.type,l=goe(a.code);return{...r,imageData:i,type:s,colorRecords:l}}return{...r,imageData:i}},AB=at(d2,p2,Ep,pse),mse=at(h2,p2,Ep,pse),gse=(t,e,n)=>{const{baseName:r}=t,i=n.find(o=>o.id===r);if(i){const o=goe(i.code);if(o)return JSON.stringify({name:e,type:i.type,colors:o.map(a=>[a.value,a.color])})}return null},UHe=at(AB,d2,Ep,gse),WHe=at(mse,h2,Ep,gse),vse=t=>!t||typeof t.opacity!="number"?1:t.opacity,yse=at(vo,vse),xse=at(bu,vse),VHe=at(Gr,t=>t!==null?uoe(t):null),GHe=at(Gr,t=>t!==null&&t.rgbSchema||null),HHe=at(gd,t=>t!==null&&t.rgbSchema||null),bse=at(Gr,t=>t&&t.placeGroups||[]),m2=at(bse,X1,(t,e)=>t.concat(e));function _se(t,e){const n=[];return e!==null&&e.length>0&&t.forEach(r=>{e.indexOf(r.id)>-1&&n.push(r)}),n}const qHe=at(X1,PB,nse,(t,e)=>{const n={},r=new Set(e||[]);return t.forEach(i=>{n[i.id]=r.has(i.id)}),n}),wse=at(bse,PB,_se),vy=at(m2,PB,_se),XHe=at(vy,t=>t.map(e=>e.title||e.id).join(", ")),K1=at(vy,t=>{const e=t.map(n=>ay(n)?n.features:[]);return[].concat(...e)}),Sse=at(K1,my,(t,e)=>t.find(n=>n.id===e)||null),Z1=at(vy,my,(t,e)=>t.length===0||e===null?null:H5e(t,e)),QHe=at(Q1,py,Sse,(t,e,n)=>{if(t&&e){if(!n)return`${t}-${e}-all`;if(n.geometry.type==="Polygon"||n.geometry.type==="MultiPolygon")return`${t}-${e}-${n.id}`}return null}),Ose=at(Nae,Q1,py,my,(t,e,n,r)=>{if(!e||!n||!r)return!1;for(const i of t)for(const o of i.timeSeriesArray){const a=o.source;if(a.datasetId===e&&a.variableName===n&&a.placeId===r)return!1}return!0}),YHe=at(Nae,m2,(t,e)=>{const n={};return oB(e,(r,i)=>{for(const o of t)if(o.timeSeriesArray.find(a=>a.source.placeId===i.id)){n[i.id]=ZM(r,i);break}}),n}),Cse=at(Q1,py,gy,my,(t,e,n,r)=>!!(t&&e&&n&&r)),KHe=at(oGe,m2,(t,e)=>{const n=[];return t.forEach(r=>{const i=r.source.placeInfo.place.id;oB(e,(o,a)=>{if(a.id===i){const s=ZM(o,a);n.push({...r,source:{...r.source,placeInfo:s}})}})}),n}),ZHe=at(vy,t=>{const e=[];return oB(t,(n,r)=>{e.push(ZM(n,r).label)}),e}),JHe=at(vo,wHe,(t,e)=>{if(t&&t.timeChunkSize){const n=t.timeChunkSize;return n*Math.ceil(e/n)}return e}),Tse=t=>t&&coe(t)||null,yy=at(Gr,Tse),e9e=at(gd,Tse),Ese=t=>t&&t.attributions||null,RB=at(Gr,Ese),t9e=at(gd,Ese),Pse=t=>t===null||t.coordinates.length===0?null:t.coordinates,w$=at(yy,Pse),n9e=at(yy,Pse),Mse=(t,e)=>t===null||e===null?-1:pae(e,t),kse=at(gy,w$,Mse),r9e=at(gy,n9e,Mse),Ase=(t,e,n)=>t===null?null:n&&e>-1?n.labels[e]:new Date(t).toISOString(),xy=at(gy,kse,yy,Ase),i9e=at(gy,r9e,e9e,Ase);function o9e(t,e){if(t!==wB){const n=typeof e=="number"?e+1:20;return new bB({tileSize:[256,256],origin:[-180,90],extent:[-180,-90,180,90],resolutions:Array.from({length:n},(r,i)=>180/256/Math.pow(2,i))})}}function a9e(t,e,n,r,i,o,a,s,l){return new cy({url:t,projection:e,tileGrid:n,attributions:r||void 0,transition:i?0:250,imageSmoothing:o,tileLoadFunction:a,maxZoom:l})}function s9e(t){if(t)return(e,n)=>{e instanceof fB&&(t.getView().getInteracting()?t.once("moveend",function(){e.getImage().src=n}):e.getImage().src=n)}}const l9e=dBe(s9e,{serializer:t=>{const e=t[0];if(e){const n=e.getTarget();return typeof n=="string"?n:n&&n.id||"map"}return""}});function c9e(){const t=Va.map;return l9e(t)}function Rse(t,e,n,r,i,o,a,s,l,c,u,f,d=10){s!==null&&(o=[...o,["time",s]]);const h=ry(e,o);typeof i=="number"&&(i+=3);const p=o9e(c,i),m=a9e(h,c,p,u,l,f,c9e(),r,i),g=c===uy?n:Vie(n,"EPSG:4326",c);return console.log("extent:",n,g),w.jsx(hae,{id:t,source:m,extent:g,zIndex:d,opacity:a})}const u9e=at(Gr,md,pHe,(t,e,n)=>{if(!t||!n)return null;let r=t.geometry;if(!r)if(t.bbox){const[a,s,l,c]=t.bbox;r={type:"Polygon",coordinates:[[[a,s],[l,s],[l,c],[a,c],[a,s]]]}}else return console.warn(`Dataset ${t.id} has no bbox!`),null;const i=new V1({features:new Tp({dataProjection:uy,featureProjection:e}).readFeatures({type:"Feature",geometry:r})}),o=new U1({stroke:new Gl({color:"orange",width:3,lineDash:[2,4]})});return w.jsx(o2,{id:`${t.id}.bbox`,source:i,style:o,zIndex:16,opacity:.5})}),hi=at(Fae,cHe,(t,e)=>{if(t.length===0)throw new Error("internal error: no servers configured");const n=t.find(r=>r.id===e);if(!n)throw new Error(`internal error: server with ID "${e}" not found`);return n}),Ise=(t,e,n,r,i,o,a,s,l,c,u,f,d,h,p,m)=>{if(!e||!i||!u)return null;const g=[["crs",p],["vmin",`${a[0]}`],["vmax",`${a[1]}`],["cmap",l||o]];return s==="log"&&g.push(["norm",s]),Rse(f,Lse(t.url,e,i),e.bbox,i.tileLevelMin,i.tileLevelMax,g,c,n,h,p,r,m,d)},f9e=at(hi,Gr,xy,RB,vo,d2,cse,dse,UHe,yse,mHe,PHe,RHe,f2,md,Y1,Ise),d9e=at(hi,gd,i9e,t9e,bu,h2,use,hse,WHe,xse,gHe,MHe,IHe,f2,md,Y1,Ise),Dse=(t,e,n,r,i,o,a,s,l,c,u)=>{if(!e||!n||!r)return null;const f=[["crs",l]];return Rse(i,Lse(t.url,e,"rgb"),e.bbox,n.tileLevelMin,n.tileLevelMax,f,1,a,s,l,c,u,o)},h9e=at(hi,Gr,GHe,vHe,kHe,DHe,xy,f2,md,RB,Y1,Dse),p9e=at(hi,gd,HHe,yHe,AHe,LHe,xy,f2,md,RB,Y1,Dse);function Lse(t,e,n){return`${t}/tiles/${iy(e)}/${F1(n)}/{z}/{y}/{x}`}function m9e(){return _5()}function g9e(){return new z1({fill:Nse(),stroke:$se(),radius:6})}function $se(){return new Gl({color:[200,0,0,.75],width:1.25})}function Nse(){return new Zh({color:[255,0,0,m9e()]})}function v9e(){return new U1({image:g9e(),stroke:$se(),fill:Nse()})}const y9e=at(wse,md,xHe,(t,e,n)=>{if(!n||t.length===0)return null;const r=[];return t.forEach((i,o)=>{ay(i)&&r.push(w.jsx(o2,{id:`placeGroup.${i.id}`,style:v9e(),zIndex:100,source:new V1({features:new Tp({dataProjection:uy,featureProjection:e}).readFeatures(i)})},o))}),w.jsx(lae,{children:r})}),x9e=at(rse,t=>{const e=[];return Object.getOwnPropertyNames(t).forEach(n=>{t[n].visible&&e.push(n)}),e}),b9e=at(rse,t=>{const e={};return Object.getOwnPropertyNames(t).forEach(n=>{e[n]=t[n].viewMode||"text"}),e}),_9e=at(uHe,t=>Object.keys(t).map(e=>t[e])),IB=at(fHe,t=>[...t,...zae]),DB=at(dHe,t=>[...t,...cGe]),Fse=(t,e,n,r)=>{if(!n||!e)return null;const i=KT(t,e);if(!i)return null;let o=i.attribution;o&&(o.startsWith("http://")||o.startsWith("https://"))&&(o=`© ${i.group}`);let a;if(i.wms){const{layerName:s,styleName:l}=i.wms;a=new F6e({url:i.url,params:{...l?{STYLES:l}:{},LAYERS:s},attributions:o,attributionsCollapsible:!0})}else{const s=L3e(i.group);a=new cy({url:i.url+(s?`?${s.param}=${s.token}`:""),attributions:o,attributionsCollapsible:!0})}return w.jsx(hae,{id:i.id,source:a,zIndex:r})},w9e=at(IB,MB,hHe,()=>0,Fse),S9e=at(DB,kB,bHe,()=>20,Fse),jse=(t,e)=>{const n=KT(t,e);return n?YT(n):null},O9e=at(IB,MB,jse),C9e=at(DB,kB,jse),T9e=at(O9e,C9e,MB,kB,Gr,gd,vo,bu,_He,(t,e,n,r,i,o,a,s,l)=>({baseMap:{title:"Base Map",subTitle:t||void 0,visible:l.baseMap,disabled:!n},overlay:{title:"Overlay",subTitle:e||void 0,visible:l.overlay,disabled:!r},datasetRgb:{title:"Dataset RGB",subTitle:i?i.title:void 0,visible:l.datasetRgb,disabled:!i},datasetRgb2:{title:"Dataset RGB",subTitle:o?o.title:void 0,visible:l.datasetRgb2,disabled:!o,pinned:!0},datasetVariable:{title:"Dataset Variable",subTitle:i&&a?`${i.title} / ${a.title||a.name}`:void 0,visible:l.datasetVariable,disabled:!(i&&a)},datasetVariable2:{title:"Dataset Variable",subTitle:o&&s?`${o.title} / ${s.title||s.name}`:void 0,visible:l.datasetVariable2,disabled:!(o&&s),pinned:!0},datasetBoundary:{title:"Dataset Boundary",subTitle:i?i.title:void 0,visible:l.datasetBoundary,disabled:!i},datasetPlaces:{title:"Dataset Places",visible:l.datasetPlaces},userPlaces:{title:"User Places",visible:l.userPlaces}}));var Bse={exports:{}};/*! +`+p;Sc.get(m)===void 0&&(Sc.set(m,t,!0),s(u.style,u.weight,p)||(Sc.set(m,0,!0),o===void 0&&(o=setInterval(l,32))))}}}(),TBe=function(){var t;return function(e){var n=i$[e];if(n==null){if(VM){var r=Eoe(e),i=Moe(e,"Žg"),o=isNaN(Number(r.lineHeight))?1.2:Number(r.lineHeight);n=o*(i.actualBoundingBoxAscent+i.actualBoundingBoxDescent)}else t||(t=document.createElement("div"),t.innerHTML="M",t.style.minHeight="0",t.style.maxHeight="none",t.style.height="auto",t.style.padding="0",t.style.border="none",t.style.position="absolute",t.style.display="block",t.style.left="-99999px"),t.style.font=e,document.body.appendChild(t),n=t.offsetHeight,document.body.removeChild(t);i$[e]=n}return n}}();function Moe(t,e){return Rm||(Rm=Ca(1,1)),t!=r$&&(Rm.font=t,r$=Rm.font),Rm.measureText(e)}function UT(t,e){return Moe(t,e).width}function SG(t,e,n){if(e in n)return n[e];var r=e.split(` +`).reduce(function(i,o){return Math.max(i,UT(t,o))},0);return n[e]=r,r}function EBe(t,e){for(var n=[],r=[],i=[],o=0,a=0,s=0,l=0,c=0,u=e.length;c<=u;c+=2){var f=e[c];if(f===` +`||c===u){o=Math.max(o,a),i.push(a),a=0,s+=l;continue}var d=e[c+1]||t.font,h=UT(d,f);n.push(h),a+=h;var p=TBe(d);r.push(p),l=Math.max(l,p)}return{width:o,height:s,widths:n,heights:r,lineWidths:i}}function PBe(t,e,n,r,i,o,a,s,l,c,u){t.save(),n!==1&&(t.globalAlpha*=n),e&&t.setTransform.apply(t,e),r.contextInstructions?(t.translate(l,c),t.scale(u[0],u[1]),MBe(r,t)):u[0]<0||u[1]<0?(t.translate(l,c),t.scale(u[0],u[1]),t.drawImage(r,i,o,a,s,0,0,a,s)):t.drawImage(r,i,o,a,s,l,c,a*u[0],s*u[1]),t.restore()}function MBe(t,e){for(var n=t.contextInstructions,r=0,i=n.length;r=t.maxResolution)return!1;var r=e.zoom;return r>t.minZoom&&r<=t.maxZoom}const e2=zBe;function UBe(t,e,n,r,i){Aoe(t,e,n||0,r||t.length-1,i||WBe)}function Aoe(t,e,n,r,i){for(;r>n;){if(r-n>600){var o=r-n+1,a=e-n+1,s=Math.log(o),l=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*l*(o-l)/o)*(a-o/2<0?-1:1),u=Math.max(n,Math.floor(e-a*l/o+c)),f=Math.min(r,Math.floor(e+(o-a)*l/o+c));Aoe(t,e,u,f,i)}var d=t[e],h=n,p=r;for(g0(t,n,e),i(t[r],d)>0&&g0(t,n,r);h0;)p--}i(t[n],d)===0?g0(t,n,p):(p++,g0(t,p,r)),p<=e&&(n=p+1),e<=p&&(r=p-1)}}function g0(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function WBe(t,e){return te?1:0}let Roe=class{constructor(e=9){this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(e){let n=this.data;const r=[];if(!gS(e,n))return r;const i=this.toBBox,o=[];for(;n;){for(let a=0;a=0&&o[n].children.length>this._maxEntries;)this._split(o,n),n--;this._adjustParentBBoxes(i,o,n)}_split(e,n){const r=e[n],i=r.children.length,o=this._minEntries;this._chooseSplitAxis(r,o,i);const a=this._chooseSplitIndex(r,o,i),s=Im(r.children.splice(a,r.children.length-a));s.height=r.height,s.leaf=r.leaf,Qp(r,this.toBBox),Qp(s,this.toBBox),n?e[n-1].children.push(s):this._splitRoot(r,s)}_splitRoot(e,n){this.data=Im([e,n]),this.data.height=e.height+1,this.data.leaf=!1,Qp(this.data,this.toBBox)}_chooseSplitIndex(e,n,r){let i,o=1/0,a=1/0;for(let s=n;s<=r-n;s++){const l=ax(e,0,s,this.toBBox),c=ax(e,s,r,this.toBBox),u=XBe(l,c),f=MA(l)+MA(c);u=n;c--){const u=e.children[c];sx(s,e.leaf?o(u):u),l+=mS(s)}return l}_adjustParentBBoxes(e,n,r){for(let i=r;i>=0;i--)sx(n[i],e)}_condense(e){for(let n=e.length-1,r;n>=0;n--)e[n].children.length===0?n>0?(r=e[n-1].children,r.splice(r.indexOf(e[n]),1)):this.clear():Qp(e[n],this.toBBox)}};function VBe(t,e,n){if(!n)return e.indexOf(t);for(let r=0;r=t.minX&&e.maxY>=t.minY}function Im(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function CG(t,e,n,r,i){const o=[e,n];for(;o.length;){if(n=o.pop(),e=o.pop(),n-e<=r)continue;const a=e+Math.ceil((n-e)/r/2)*r;UBe(t,a,e,n,i),o.push(e,a,a,n)}}var QBe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),TG={RENDER_ORDER:"renderOrder"},YBe=function(t){QBe(e,t);function e(n){var r=this,i=n||{},o=cr({},i);return delete o.style,delete o.renderBuffer,delete o.updateWhileAnimating,delete o.updateWhileInteracting,r=t.call(this,o)||this,r.declutter_=i.declutter!==void 0?i.declutter:!1,r.renderBuffer_=i.renderBuffer!==void 0?i.renderBuffer:100,r.style_=null,r.styleFunction_=void 0,r.setStyle(i.style),r.updateWhileAnimating_=i.updateWhileAnimating!==void 0?i.updateWhileAnimating:!1,r.updateWhileInteracting_=i.updateWhileInteracting!==void 0?i.updateWhileInteracting:!1,r}return e.prototype.getDeclutter=function(){return this.declutter_},e.prototype.getFeatures=function(n){return t.prototype.getFeatures.call(this,n)},e.prototype.getRenderBuffer=function(){return this.renderBuffer_},e.prototype.getRenderOrder=function(){return this.get(TG.RENDER_ORDER)},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},e.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},e.prototype.renderDeclutter=function(n){n.declutterTree||(n.declutterTree=new Roe(9)),this.getRenderer().renderDeclutter(n)},e.prototype.setRenderOrder=function(n){this.set(TG.RENDER_ORDER,n)},e.prototype.setStyle=function(n){this.style_=n!==void 0?n:LBe,this.styleFunction_=n===null?void 0:DBe(this.style_),this.changed()},e}(e2);const KBe=YBe;var bt={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},vS=[bt.FILL],yf=[bt.STROKE],gh=[bt.BEGIN_PATH],EG=[bt.CLOSE_PATH],ZBe=function(){function t(){}return t.prototype.drawCustom=function(e,n,r,i){},t.prototype.drawGeometry=function(e){},t.prototype.setStyle=function(e){},t.prototype.drawCircle=function(e,n){},t.prototype.drawFeature=function(e,n){},t.prototype.drawGeometryCollection=function(e,n){},t.prototype.drawLineString=function(e,n){},t.prototype.drawMultiLineString=function(e,n){},t.prototype.drawMultiPoint=function(e,n){},t.prototype.drawMultiPolygon=function(e,n){},t.prototype.drawPoint=function(e,n){},t.prototype.drawPolygon=function(e,n){},t.prototype.drawText=function(e,n){},t.prototype.setFillStrokeStyle=function(e,n){},t.prototype.setImageStyle=function(e,n){},t.prototype.setTextStyle=function(e,n){},t}();const Ioe=ZBe;var JBe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),eze=function(t){JBe(e,t);function e(n,r,i,o){var a=t.call(this)||this;return a.tolerance=n,a.maxExtent=r,a.pixelRatio=o,a.maxLineWidth=0,a.resolution=i,a.beginGeometryInstruction1_=null,a.beginGeometryInstruction2_=null,a.bufferedMaxExtent_=null,a.instructions=[],a.coordinates=[],a.tmpCoordinate_=[],a.hitDetectionInstructions=[],a.state={},a}return e.prototype.applyPixelRatio=function(n){var r=this.pixelRatio;return r==1?n:n.map(function(i){return i*r})},e.prototype.appendFlatPointCoordinates=function(n,r){for(var i=this.getBufferedMaxExtent(),o=this.tmpCoordinate_,a=this.coordinates,s=a.length,l=0,c=n.length;ll&&(this.instructions.push([bt.CUSTOM,l,u,n,i,vf]),this.hitDetectionInstructions.push([bt.CUSTOM,l,u,n,o||i,vf]));break;case"Point":c=n.getFlatCoordinates(),this.coordinates.push(c[0],c[1]),u=this.coordinates.length,this.instructions.push([bt.CUSTOM,l,u,n,i]),this.hitDetectionInstructions.push([bt.CUSTOM,l,u,n,o||i]);break}this.endGeometry(r)},e.prototype.beginGeometry=function(n,r){this.beginGeometryInstruction1_=[bt.BEGIN_GEOMETRY,r,0,n],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[bt.BEGIN_GEOMETRY,r,0,n],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var n=this.hitDetectionInstructions;n.reverse();var r,i=n.length,o,a,s=-1;for(r=0;rthis.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0},e.prototype.createFill=function(n){var r=n.fillStyle,i=[bt.SET_FILL_STYLE,r];return typeof r!="string"&&i.push(!0),i},e.prototype.applyStroke=function(n){this.instructions.push(this.createStroke(n))},e.prototype.createStroke=function(n){return[bt.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth*this.pixelRatio,n.lineCap,n.lineJoin,n.miterLimit,this.applyPixelRatio(n.lineDash),n.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(n,r){var i=n.fillStyle;(typeof i!="string"||n.currentFillStyle!=i)&&(i!==void 0&&this.instructions.push(r.call(this,n)),n.currentFillStyle=i)},e.prototype.updateStrokeStyle=function(n,r){var i=n.strokeStyle,o=n.lineCap,a=n.lineDash,s=n.lineDashOffset,l=n.lineJoin,c=n.lineWidth,u=n.miterLimit;(n.currentStrokeStyle!=i||n.currentLineCap!=o||a!=n.currentLineDash&&!Sp(n.currentLineDash,a)||n.currentLineDashOffset!=s||n.currentLineJoin!=l||n.currentLineWidth!=c||n.currentMiterLimit!=u)&&(i!==void 0&&r.call(this,n),n.currentStrokeStyle=i,n.currentLineCap=o,n.currentLineDash=a,n.currentLineDashOffset=s,n.currentLineJoin=l,n.currentLineWidth=c,n.currentMiterLimit=u)},e.prototype.endGeometry=function(n){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var r=[bt.END_GEOMETRY,n];this.instructions.push(r),this.hitDetectionInstructions.push(r)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=$ie(this.maxExtent),this.maxLineWidth>0)){var n=this.resolution*(this.maxLineWidth+1)/2;Db(this.bufferedMaxExtent_,n,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(Ioe);const W1=eze;var tze=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),nze=function(t){tze(e,t);function e(n,r,i,o){var a=t.call(this,n,r,i,o)||this;return a.hitDetectionImage_=null,a.image_=null,a.imagePixelRatio_=void 0,a.anchorX_=void 0,a.anchorY_=void 0,a.height_=void 0,a.opacity_=void 0,a.originX_=void 0,a.originY_=void 0,a.rotateWithView_=void 0,a.rotation_=void 0,a.scale_=void 0,a.width_=void 0,a.declutterMode_=void 0,a.declutterImageWithText_=void 0,a}return e.prototype.drawPoint=function(n,r){if(this.image_){this.beginGeometry(n,r);var i=n.getFlatCoordinates(),o=n.getStride(),a=this.coordinates.length,s=this.appendFlatPointCoordinates(i,o);this.instructions.push([bt.DRAW_IMAGE,a,s,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([bt.DRAW_IMAGE,a,s,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(r)}},e.prototype.drawMultiPoint=function(n,r){if(this.image_){this.beginGeometry(n,r);var i=n.getFlatCoordinates(),o=n.getStride(),a=this.coordinates.length,s=this.appendFlatPointCoordinates(i,o);this.instructions.push([bt.DRAW_IMAGE,a,s,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([bt.DRAW_IMAGE,a,s,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(r)}},e.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(n,r){var i=n.getAnchor(),o=n.getSize(),a=n.getOrigin();this.imagePixelRatio_=n.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=n.getHitDetectionImage(),this.image_=n.getImage(this.pixelRatio),this.height_=o[1],this.opacity_=n.getOpacity(),this.originX_=a[0],this.originY_=a[1],this.rotateWithView_=n.getRotateWithView(),this.rotation_=n.getRotation(),this.scale_=n.getScaleArray(),this.width_=o[0],this.declutterMode_=n.getDeclutterMode(),this.declutterImageWithText_=r},e}(W1);const rze=nze;var ize=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),oze=function(t){ize(e,t);function e(n,r,i,o){return t.call(this,n,r,i,o)||this}return e.prototype.drawFlatCoordinates_=function(n,r,i,o){var a=this.coordinates.length,s=this.appendFlatLineCoordinates(n,r,i,o,!1,!1),l=[bt.MOVE_TO_LINE_TO,a,s];return this.instructions.push(l),this.hitDetectionInstructions.push(l),i},e.prototype.drawLineString=function(n,r){var i=this.state,o=i.strokeStyle,a=i.lineWidth;if(!(o===void 0||a===void 0)){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(n,r),this.hitDetectionInstructions.push([bt.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,jb,Bb],gh);var s=n.getFlatCoordinates(),l=n.getStride();this.drawFlatCoordinates_(s,0,s.length,l),this.hitDetectionInstructions.push(yf),this.endGeometry(r)}},e.prototype.drawMultiLineString=function(n,r){var i=this.state,o=i.strokeStyle,a=i.lineWidth;if(!(o===void 0||a===void 0)){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(n,r),this.hitDetectionInstructions.push([bt.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],gh);for(var s=n.getEnds(),l=n.getFlatCoordinates(),c=n.getStride(),u=0,f=0,d=s.length;ft&&(l>s&&(s=l,o=c,a=f),l=0,c=f-i)),d=h,g=y,v=x),p=b,m=_}return l+=h,l>s?[c,f]:[o,a]}var uze=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Wx={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},fze=function(t){uze(e,t);function e(n,r,i,o){var a=t.call(this,n,r,i,o)||this;return a.labels_=null,a.text_="",a.textOffsetX_=0,a.textOffsetY_=0,a.textRotateWithView_=void 0,a.textRotation_=0,a.textFillState_=null,a.fillStates={},a.textStrokeState_=null,a.strokeStates={},a.textState_={},a.textStates={},a.textKey_="",a.fillKey_="",a.strokeKey_="",a.declutterImageWithText_=void 0,a}return e.prototype.finish=function(){var n=t.prototype.finish.call(this);return n.textStates=this.textStates,n.fillStates=this.fillStates,n.strokeStates=this.strokeStates,n},e.prototype.drawText=function(n,r){var i=this.textFillState_,o=this.textStrokeState_,a=this.textState_;if(!(this.text_===""||!a||!i&&!o)){var s=this.coordinates,l=s.length,c=n.getType(),u=null,f=n.getStride();if(a.placement===NBe.LINE&&(c=="LineString"||c=="MultiLineString"||c=="Polygon"||c=="MultiPolygon")){if(!so(this.getBufferedMaxExtent(),n.getExtent()))return;var d=void 0;if(u=n.getFlatCoordinates(),c=="LineString")d=[u.length];else if(c=="MultiLineString")d=n.getEnds();else if(c=="Polygon")d=n.getEnds().slice(0,1);else if(c=="MultiPolygon"){var h=n.getEndss();d=[];for(var p=0,m=h.length;pP[2]}else I=b>E;var R=Math.PI,T=[],L=S+r===e;e=S,g=0,v=O,d=t[e],h=t[e+1];var z;if(L){y(),z=Math.atan2(h-m,d-p),I&&(z+=z>0?-R:R);var B=(E+b)/2,W=(k+_)/2;return T[0]=[B,W,(C-o)/2,z,i],T}i=i.replace(/\n/g," ");for(var U=0,N=i.length;U0?-R:R),z!==void 0){var D=$-z;if(D+=D>R?-2*R:D<-R?2*R:0,Math.abs(D)>a)return null}z=$;for(var A=U,q=0;U0&&t.push(` +`,""),t.push(e,""),t}var Oze=function(){function t(e,n,r,i){this.overlaps=r,this.pixelRatio=n,this.resolution=e,this.alignFill_,this.instructions=i.instructions,this.coordinates=i.coordinates,this.coordinateCache_={},this.renderedTransform_=Wl(),this.hitDetectionInstructions=i.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=i.fillStates||{},this.strokeStates=i.strokeStates||{},this.textStates=i.textStates||{},this.widths_={},this.labels_={}}return t.prototype.createLabel=function(e,n,r,i){var o=e+n+r+i;if(this.labels_[o])return this.labels_[o];var a=i?this.strokeStates[i]:null,s=r?this.fillStates[r]:null,l=this.textStates[n],c=this.pixelRatio,u=[l.scale[0]*c,l.scale[1]*c],f=Array.isArray(e),d=l.justify?Wx[l.justify]:RG(Array.isArray(e)?e[0]:e,l.textAlign||Wb),h=i&&a.lineWidth?a.lineWidth:0,p=f?e:e.split(` +`).reduce(Sze,[]),m=EBe(l,p),g=m.width,v=m.height,y=m.widths,x=m.heights,b=m.lineWidths,_=g+h,S=[],O=(_+2)*u[0],C=(v+h)*u[1],E={width:O<0?Math.floor(O):Math.ceil(O),height:C<0?Math.floor(C):Math.ceil(C),contextInstructions:S};if((u[0]!=1||u[1]!=1)&&S.push("scale",u),i){S.push("strokeStyle",a.strokeStyle),S.push("lineWidth",h),S.push("lineCap",a.lineCap),S.push("lineJoin",a.lineJoin),S.push("miterLimit",a.miterLimit);var k=VM?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D;k.prototype.setLineDash&&(S.push("setLineDash",[a.lineDash]),S.push("lineDashOffset",a.lineDashOffset))}r&&S.push("fillStyle",s.fillStyle),S.push("textBaseline","middle"),S.push("textAlign","center");for(var I=.5-d,P=d*_+I*h,R=[],T=[],L=0,z=0,B=0,W=0,U,N=0,$=p.length;N<$;N+=2){var D=p[N];if(D===` +`){z+=L,L=0,P=d*_+I*h,++W;continue}var A=p[N+1]||l.font;A!==U&&(i&&R.push("font",A),r&&T.push("font",A),U=A),L=Math.max(L,x[B]);var q=[D,P+I*y[B]+d*(y[B]-b[W]),.5*(h+L)+z];P+=y[B],i&&R.push("strokeText",q),r&&T.push("fillText",q),++B}return Array.prototype.push.apply(S,R),Array.prototype.push.apply(S,T),this.labels_[o]=E,E},t.prototype.replayTextBackground_=function(e,n,r,i,o,a,s){e.beginPath(),e.moveTo.apply(e,n),e.lineTo.apply(e,r),e.lineTo.apply(e,i),e.lineTo.apply(e,o),e.lineTo.apply(e,n),a&&(this.alignFill_=a[2],this.fill_(e)),s&&(this.setStrokeStyle_(e,s),e.stroke())},t.prototype.calculateImageOrLabelDimensions_=function(e,n,r,i,o,a,s,l,c,u,f,d,h,p,m,g){s*=d[0],l*=d[1];var v=r-s,y=i-l,x=o+c>e?e-c:o,b=a+u>n?n-u:a,_=p[3]+x*d[0]+p[1],S=p[0]+b*d[1]+p[2],O=v-p[3],C=y-p[0];(m||f!==0)&&(Pu[0]=O,Mu[0]=O,Pu[1]=C,dc[1]=C,dc[0]=O+_,hc[0]=dc[0],hc[1]=C+S,Mu[1]=hc[1]);var E;return f!==0?(E=cu(Wl(),r,i,1,1,f,-r,-i),Or(E,Pu),Or(E,dc),Or(E,hc),Or(E,Mu),Qs(Math.min(Pu[0],dc[0],hc[0],Mu[0]),Math.min(Pu[1],dc[1],hc[1],Mu[1]),Math.max(Pu[0],dc[0],hc[0],Mu[0]),Math.max(Pu[1],dc[1],hc[1],Mu[1]),Yp)):Qs(Math.min(O,O+_),Math.min(C,C+S),Math.max(O,O+_),Math.max(C,C+S),Yp),h&&(v=Math.round(v),y=Math.round(y)),{drawImageX:v,drawImageY:y,drawImageW:x,drawImageH:b,originX:c,originY:u,declutterBox:{minX:Yp[0],minY:Yp[1],maxX:Yp[2],maxY:Yp[3],value:g},canvasTransform:E,scale:d}},t.prototype.replayImageOrLabel_=function(e,n,r,i,o,a,s){var l=!!(a||s),c=i.declutterBox,u=e.canvas,f=s?s[2]*i.scale[0]/2:0,d=c.minX-f<=u.width/n&&c.maxX+f>=0&&c.minY-f<=u.height/n&&c.maxY+f>=0;return d&&(l&&this.replayTextBackground_(e,Pu,dc,hc,Mu,a,s),PBe(e,i.canvasTransform,o,r,i.originX,i.originY,i.drawImageW,i.drawImageH,i.drawImageX,i.drawImageY,i.scale)),!0},t.prototype.fill_=function(e){if(this.alignFill_){var n=Or(this.renderedTransform_,[0,0]),r=512*this.pixelRatio;e.save(),e.translate(n[0]%r,n[1]%r),e.rotate(this.viewRotation_)}e.fill(),this.alignFill_&&e.restore()},t.prototype.setStrokeStyle_=function(e,n){e.strokeStyle=n[1],e.lineWidth=n[2],e.lineCap=n[3],e.lineJoin=n[4],e.miterLimit=n[5],e.setLineDash&&(e.lineDashOffset=n[7],e.setLineDash(n[6]))},t.prototype.drawLabelWithPointPlacement_=function(e,n,r,i){var o=this.textStates[n],a=this.createLabel(e,n,i,r),s=this.strokeStates[r],l=this.pixelRatio,c=RG(Array.isArray(e)?e[0]:e,o.textAlign||Wb),u=Wx[o.textBaseline||zT],f=s&&s.lineWidth?s.lineWidth:0,d=a.width/l-2*o.scale[0],h=c*d+2*(.5-c)*f,p=u*a.height/l+2*(.5-u)*f;return{label:a,anchorX:h,anchorY:p}},t.prototype.execute_=function(e,n,r,i,o,a,s,l){var c;this.pixelCoordinates_&&Sp(r,this.renderedTransform_)?c=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),c=Dh(this.coordinates,0,this.coordinates.length,2,r,this.pixelCoordinates_),MFe(this.renderedTransform_,r));for(var u=0,f=i.length,d=0,h,p,m,g,v,y,x,b,_,S,O,C,E=0,k=0,I=null,P=null,R=this.coordinateCache_,T=this.viewRotation_,L=Math.round(Math.atan2(-r[1],r[0])*1e12)/1e12,z={context:e,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:T},B=this.instructions!=i||this.overlaps?0:200,W,U,N,$;uB&&(this.fill_(e),E=0),k>B&&(e.stroke(),k=0),!E&&!k&&(e.beginPath(),g=NaN,v=NaN),++u;break;case bt.CIRCLE:d=D[1];var q=c[d],Y=c[d+1],K=c[d+2],se=c[d+3],te=K-q,J=se-Y,pe=Math.sqrt(te*te+J*J);e.moveTo(q+pe,Y),e.arc(q,Y,pe,0,2*Math.PI,!0),++u;break;case bt.CLOSE_PATH:e.closePath(),++u;break;case bt.CUSTOM:d=D[1],h=D[2];var be=D[3],re=D[4],ve=D.length==6?D[5]:void 0;z.geometry=be,z.feature=W,u in R||(R[u]=[]);var F=R[u];ve?ve(c,d,h,2,F):(F[0]=c[d],F[1]=c[d+1],F.length=2),re(F,z),++u;break;case bt.DRAW_IMAGE:d=D[1],h=D[2],b=D[3],p=D[4],m=D[5];var ce=D[6],le=D[7],Q=D[8],X=D[9],ee=D[10],ge=D[11],ye=D[12],H=D[13],G=D[14],ie=D[15];if(!b&&D.length>=20){_=D[19],S=D[20],O=D[21],C=D[22];var he=this.drawLabelWithPointPlacement_(_,S,O,C);b=he.label,D[3]=b;var _e=D[23];p=(he.anchorX-_e)*this.pixelRatio,D[4]=p;var oe=D[24];m=(he.anchorY-oe)*this.pixelRatio,D[5]=m,ce=b.height,D[6]=ce,H=b.width,D[13]=H}var Z=void 0;D.length>25&&(Z=D[25]);var V=void 0,de=void 0,xe=void 0;D.length>17?(V=D[16],de=D[17],xe=D[18]):(V=mh,de=!1,xe=!1),ee&&L?ge+=T:!ee&&!L&&(ge-=T);for(var Me=0;d0){if(!a||h!=="Image"&&h!=="Text"||a.indexOf(S)!==-1){var I=(d[E]-3)/4,P=i-I%s,R=i-(I/s|0),T=o(S,O,P*P+R*R);if(T)return T}u.clearRect(0,0,s,s);break}}var m=Object.keys(this.executorsByZIndex_).map(Number);m.sort(Yh);var g,v,y,x,b;for(g=m.length-1;g>=0;--g){var _=m[g].toString();for(y=this.executorsByZIndex_[_],v=AA.length-1;v>=0;--v)if(h=AA[v],x=y[h],x!==void 0&&(b=x.executeHitDetection(u,l,r,p,f),b))return b}},t.prototype.getClipCoords=function(e){var n=this.maxExtent_;if(!n)return null;var r=n[0],i=n[1],o=n[2],a=n[3],s=[r,i,r,a,o,a,o,i];return Dh(s,0,8,2,e,s),s},t.prototype.isEmpty=function(){return Zg(this.executorsByZIndex_)},t.prototype.execute=function(e,n,r,i,o,a,s){var l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(Yh),this.maxExtent_&&(e.save(),this.clip(e,r));var c=a||AA,u,f,d,h,p,m;for(s&&l.reverse(),u=0,f=l.length;un)break;var s=r[a];s||(s=[],r[a]=s),s.push(((t+i)*e+(t+o))*4+3),i>0&&s.push(((t-i)*e+(t+o))*4+3),o>0&&(s.push(((t+i)*e+(t-o))*4+3),i>0&&s.push(((t-i)*e+(t-o))*4+3))}for(var l=[],i=0,c=r.length;ithis.maxCacheSize_},t.prototype.expire=function(){if(this.canExpireCache()){var e=0;for(var n in this.cache_){var r=this.cache_[n];!(e++&3)&&!r.hasListener()&&(delete this.cache_[n],--this.cacheSize_)}}},t.prototype.get=function(e,n,r){var i=DG(e,n,r);return i in this.cache_?this.cache_[i]:null},t.prototype.set=function(e,n,r,i){var o=DG(e,n,r);this.cache_[o]=i,++this.cacheSize_},t.prototype.setSize=function(e){this.maxCacheSize_=e,this.expire()},t}();function DG(t,e,n){var r=n?Ooe(n):"null";return e+":"+t+":"+r}var VT=new kze,Aze=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Rze=function(t){Aze(e,t);function e(n,r,i,o){var a=t.call(this)||this;return a.extent=n,a.pixelRatio_=i,a.resolution=r,a.state=o,a}return e.prototype.changed=function(){this.dispatchEvent(Mt.CHANGE)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return vt()},e.prototype.getPixelRatio=function(){return this.pixelRatio_},e.prototype.getResolution=function(){return this.resolution},e.prototype.getState=function(){return this.state},e.prototype.load=function(){vt()},e}(ty);const Ize=Rze;var Dze=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){Dze(e,t);function e(n,r,i,o,a,s){var l=t.call(this,n,r,i,Un.IDLE)||this;return l.src_=o,l.image_=new Image,a!==null&&(l.image_.crossOrigin=a),l.unlisten_=null,l.state=Un.IDLE,l.imageLoadFunction_=s,l}return e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=Un.ERROR,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){this.resolution===void 0&&(this.resolution=hs(this.extent)/this.image_.height),this.state=Un.LOADED,this.unlistenImage_(),this.changed()},e.prototype.load=function(){(this.state==Un.IDLE||this.state==Un.ERROR)&&(this.state=Un.LOADING,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=fB(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(n){this.image_=n,this.resolution=hs(this.extent)/this.image_.height},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e})(Ize);function fB(t,e,n){var r=t,i=!0,o=!1,a=!1,s=[kT(r,Mt.LOAD,function(){a=!0,o||e()})];return r.src&&EFe?(o=!0,r.decode().then(function(){i&&e()}).catch(function(l){i&&(a?e():n())})):s.push(kT(r,Mt.ERROR,n)),function(){i=!1,s.forEach(tr)}}var Lze=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),v0=null,$ze=function(t){Lze(e,t);function e(n,r,i,o,a,s){var l=t.call(this)||this;return l.hitDetectionImage_=null,l.image_=n||new Image,o!==null&&(l.image_.crossOrigin=o),l.canvas_={},l.color_=s,l.unlisten_=null,l.imageState_=a,l.size_=i,l.src_=r,l.tainted_,l}return e.prototype.isTainted_=function(){if(this.tainted_===void 0&&this.imageState_===Un.LOADED){v0||(v0=Ca(1,1)),v0.drawImage(this.image_,0,0);try{v0.getImageData(0,0,1,1),this.tainted_=!1}catch{v0=null,this.tainted_=!0}}return this.tainted_===!0},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(Mt.CHANGE)},e.prototype.handleImageError_=function(){this.imageState_=Un.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=Un.LOADED,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.getImage=function(n){return this.replaceColor_(n),this.canvas_[n]?this.canvas_[n]:this.image_},e.prototype.getPixelRatio=function(n){return this.replaceColor_(n),this.canvas_[n]?n:1},e.prototype.getImageState=function(){return this.imageState_},e.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var n=this.size_[0],r=this.size_[1],i=Ca(n,r);i.fillRect(0,0,n,r),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},e.prototype.getSize=function(){return this.size_},e.prototype.getSrc=function(){return this.src_},e.prototype.load=function(){if(this.imageState_==Un.IDLE){this.imageState_=Un.LOADING;try{this.image_.src=this.src_}catch{this.handleImageError_()}this.unlisten_=fB(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(n){if(!(!this.color_||this.canvas_[n]||this.imageState_!==Un.LOADED)){var r=document.createElement("canvas");this.canvas_[n]=r,r.width=Math.ceil(this.image_.width*n),r.height=Math.ceil(this.image_.height*n);var i=r.getContext("2d");if(i.scale(n,n),i.drawImage(this.image_,0,0),i.globalCompositeOperation="multiply",i.globalCompositeOperation==="multiply"||this.isTainted_())i.fillStyle=Ooe(this.color_),i.fillRect(0,0,r.width/n,r.height/n),i.globalCompositeOperation="destination-in",i.drawImage(this.image_,0,0);else{for(var o=i.getImageData(0,0,r.width,r.height),a=o.data,s=this.color_[0]/255,l=this.color_[1]/255,c=this.color_[2]/255,u=this.color_[3],f=0,d=a.length;f0,6);var f=i.src!==void 0?Un.IDLE:Un.LOADED;return r.color_=i.color!==void 0?jT(i.color):null,r.iconImage_=Nze(c,u,r.imgSize_!==void 0?r.imgSize_:null,r.crossOrigin_,f,r.color_),r.offset_=i.offset!==void 0?i.offset:[0,0],r.offsetOrigin_=i.offsetOrigin!==void 0?i.offsetOrigin:Ra.TOP_LEFT,r.origin_=null,r.size_=i.size!==void 0?i.size:null,r}return e.prototype.clone=function(){var n=this.getScale();return new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,imgSize:this.imgSize_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:Array.isArray(n)?n.slice():n,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})},e.prototype.getAnchor=function(){var n=this.normalizedAnchor_;if(!n){n=this.anchor_;var r=this.getSize();if(this.anchorXUnits_==nf.FRACTION||this.anchorYUnits_==nf.FRACTION){if(!r)return null;n=this.anchor_.slice(),this.anchorXUnits_==nf.FRACTION&&(n[0]*=r[0]),this.anchorYUnits_==nf.FRACTION&&(n[1]*=r[1])}if(this.anchorOrigin_!=Ra.TOP_LEFT){if(!r)return null;n===this.anchor_&&(n=this.anchor_.slice()),(this.anchorOrigin_==Ra.TOP_RIGHT||this.anchorOrigin_==Ra.BOTTOM_RIGHT)&&(n[0]=-n[0]+r[0]),(this.anchorOrigin_==Ra.BOTTOM_LEFT||this.anchorOrigin_==Ra.BOTTOM_RIGHT)&&(n[1]=-n[1]+r[1])}this.normalizedAnchor_=n}var i=this.getDisplacement();return[n[0]-i[0],n[1]+i[1]]},e.prototype.setAnchor=function(n){this.anchor_=n,this.normalizedAnchor_=null},e.prototype.getColor=function(){return this.color_},e.prototype.getImage=function(n){return this.iconImage_.getImage(n)},e.prototype.getPixelRatio=function(n){return this.iconImage_.getPixelRatio(n)},e.prototype.getImageSize=function(){return this.iconImage_.getSize()},e.prototype.getImageState=function(){return this.iconImage_.getImageState()},e.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},e.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var n=this.offset_;if(this.offsetOrigin_!=Ra.TOP_LEFT){var r=this.getSize(),i=this.iconImage_.getSize();if(!r||!i)return null;n=n.slice(),(this.offsetOrigin_==Ra.TOP_RIGHT||this.offsetOrigin_==Ra.BOTTOM_RIGHT)&&(n[0]=i[0]-r[0]-n[0]),(this.offsetOrigin_==Ra.BOTTOM_LEFT||this.offsetOrigin_==Ra.BOTTOM_RIGHT)&&(n[1]=i[1]-r[1]-n[1])}return this.origin_=n,this.origin_},e.prototype.getSrc=function(){return this.iconImage_.getSrc()},e.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},e.prototype.listenImageChange=function(n){this.iconImage_.addEventListener(Mt.CHANGE,n)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(n){this.iconImage_.removeEventListener(Mt.CHANGE,n)},e}(Soe);const Bze=jze;var bl=.5;function zze(t,e,n,r,i,o,a){var s=t[0]*bl,l=t[1]*bl,c=Ca(s,l);c.imageSmoothingEnabled=!1;for(var u=c.canvas,f=new Mze(c,bl,i,null,a),d=n.length,h=Math.floor((256*256*256-1)/d),p={},m=1;m<=d;++m){var g=n[m-1],v=g.getStyleFunction()||r;if(r){var y=v(g,o);if(y){Array.isArray(y)||(y=[y]);for(var x=m*h,b="#"+("000000"+x.toString(16)).slice(-6),_=0,S=y.length;_m[2];)++y,x=v*y,f.push(this.getRenderTransform(o,a,s,bl,d,h,x).slice()),g-=v}this.hitDetectionImageData_=zze(i,f,this.renderedFeatures_,u.getStyleFunction(),c,a,s)}r(Uze(n,this.renderedFeatures_,this.hitDetectionImageData_))}).bind(this))},e.prototype.forEachFeatureAtCoordinate=function(n,r,i,o,a){var s=this;if(this.replayGroup_){var l=r.viewState.resolution,c=r.viewState.rotation,u=this.getLayer(),f={},d=function(m,g,v){var y=vn(m),x=f[y];if(x){if(x!==!0&&v_[0]&&C[2]>_[2]&&b.push([C[0]-S,C[1],C[2]-S,C[3]])}if(this.ready&&this.renderedResolution_==d&&this.renderedRevision_==p&&this.renderedRenderOrder_==g&&Xm(this.wrappedRenderedExtent_,y))return Sp(this.renderedExtent_,x)||(this.hitDetectionImageData_=null,this.renderedExtent_=x),this.renderedCenter_=v,this.replayGroupChanged=!1,!0;this.replayGroup_=null;var E=new MG(a$(d,h),y,d,h),k;this.getLayer().getDeclutter()&&(k=new MG(a$(d,h),y,d,h));for(var I,P,R,P=0,R=b.length;P=200&&s.status<300){var c=e.getType(),u=void 0;c=="json"||c=="text"?u=s.responseText:c=="xml"?(u=s.responseXML,u||(u=new DOMParser().parseFromString(s.responseText,"application/xml"))):c=="arraybuffer"&&(u=s.response),u?o(e.readFeatures(u,{extent:n,featureProjection:i}),e.readProjection(u)):a()}else a()},s.onerror=a,s.send()}function FG(t,e){return function(n,r,i,o,a){var s=this;c4e(t,e,n,r,i,function(l,c){s.addFeatures(l),o!==void 0&&o(l)},a||Kh)}}var joe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ku=function(t){joe(e,t);function e(n,r,i){var o=t.call(this,n)||this;return o.feature=r,o.features=i,o}return e}(rc),u4e=function(t){joe(e,t);function e(n){var r=this,i=n||{};r=t.call(this,{attributions:i.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:i.wrapX!==void 0?i.wrapX:!0})||this,r.on,r.once,r.un,r.loader_=Kh,r.format_=i.format,r.overlaps_=i.overlaps===void 0?!0:i.overlaps,r.url_=i.url,i.loader!==void 0?r.loader_=i.loader:r.url_!==void 0&&(Ut(r.format_,7),r.loader_=FG(r.url_,r.format_)),r.strategy_=i.strategy!==void 0?i.strategy:s4e;var o=i.useSpatialIndex!==void 0?i.useSpatialIndex:!0;r.featuresRtree_=o?new $G:null,r.loadedExtentsRtree_=new $G,r.loadingExtentsCount_=0,r.nullGeometryFeatures_={},r.idIndex_={},r.uidIndex_={},r.featureChangeKeys_={},r.featuresCollection_=null;var a,s;return Array.isArray(i.features)?s=i.features:i.features&&(a=i.features,s=a.getArray()),!o&&a===void 0&&(a=new Xa(s)),s!==void 0&&r.addFeaturesInternal(s),a!==void 0&&r.bindFeaturesCollection_(a),r}return e.prototype.addFeature=function(n){this.addFeatureInternal(n),this.changed()},e.prototype.addFeatureInternal=function(n){var r=vn(n);if(!this.addToIndex_(r,n)){this.featuresCollection_&&this.featuresCollection_.remove(n);return}this.setupChangeEvents_(r,n);var i=n.getGeometry();if(i){var o=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(o,n)}else this.nullGeometryFeatures_[r]=n;this.dispatchEvent(new ku(Cs.ADDFEATURE,n))},e.prototype.setupChangeEvents_=function(n,r){this.featureChangeKeys_[n]=[rn(r,Mt.CHANGE,this.handleFeatureChange_,this),rn(r,Kg.PROPERTYCHANGE,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(n,r){var i=!0,o=r.getId();return o!==void 0&&(o.toString()in this.idIndex_?i=!1:this.idIndex_[o.toString()]=r),i&&(Ut(!(n in this.uidIndex_),30),this.uidIndex_[n]=r),i},e.prototype.addFeatures=function(n){this.addFeaturesInternal(n),this.changed()},e.prototype.addFeaturesInternal=function(n){for(var r=[],i=[],o=[],a=0,s=n.length;a0},e.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),t.prototype.refresh.call(this)},e.prototype.removeLoadedExtent=function(n){var r=this.loadedExtentsRtree_,i;r.forEachInExtent(n,function(o){if(Lb(o.extent,n))return i=o,!0}),i&&r.remove(i)},e.prototype.removeFeature=function(n){if(n){var r=vn(n);r in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[r]:this.featuresRtree_&&this.featuresRtree_.remove(n);var i=this.removeFeatureInternal(n);i&&this.changed()}},e.prototype.removeFeatureInternal=function(n){var r=vn(n),i=this.featureChangeKeys_[r];if(i){i.forEach(tr),delete this.featureChangeKeys_[r];var o=n.getId();return o!==void 0&&delete this.idIndex_[o.toString()],delete this.uidIndex_[r],this.dispatchEvent(new ku(Cs.REMOVEFEATURE,n)),n}},e.prototype.removeFromIdIndex_=function(n){var r=!1;for(var i in this.idIndex_)if(this.idIndex_[i]===n){delete this.idIndex_[i],r=!0;break}return r},e.prototype.setLoader=function(n){this.loader_=n},e.prototype.setUrl=function(n){Ut(this.format_,7),this.url_=n,this.setLoader(FG(n,this.format_))},e}(Foe);const V1=u4e;function Au(t,e){return Or(t.inversePixelTransform,e.slice(0))}const St={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function Boe(t){return Math.pow(t,3)}function sy(t){return 1-Boe(1-t)}function f4e(t){return 3*t*t-2*t*t*t}function d4e(t){return t}var h4e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),p4e=function(t){h4e(e,t);function e(n,r,i){var o=t.call(this)||this,a=i||{};return o.tileCoord=n,o.state=r,o.interimTile=null,o.key="",o.transition_=a.transition===void 0?250:a.transition,o.transitionStarts_={},o.interpolate=!!a.interpolate,o}return e.prototype.changed=function(){this.dispatchEvent(Mt.CHANGE)},e.prototype.release=function(){},e.prototype.getKey=function(){return this.key+"/"+this.tileCoord},e.prototype.getInterimTile=function(){if(!this.interimTile)return this;var n=this.interimTile;do{if(n.getState()==St.LOADED)return this.transition_=0,n;n=n.interimTile}while(n);return this},e.prototype.refreshInterimChain=function(){if(this.interimTile){var n=this.interimTile,r=this;do{if(n.getState()==St.LOADED){n.interimTile=null;break}else n.getState()==St.LOADING?r=n:n.getState()==St.IDLE?r.interimTile=n.interimTile:r=n;n=r.interimTile}while(n)}},e.prototype.getTileCoord=function(){return this.tileCoord},e.prototype.getState=function(){return this.state},e.prototype.setState=function(n){if(this.state!==St.ERROR&&this.state>n)throw new Error("Tile load sequence violation");this.state=n,this.changed()},e.prototype.load=function(){vt()},e.prototype.getAlpha=function(n,r){if(!this.transition_)return 1;var i=this.transitionStarts_[n];if(!i)i=r,this.transitionStarts_[n]=i;else if(i===-1)return 1;var o=r-i+1e3/60;return o>=this.transition_?1:Boe(o/this.transition_)},e.prototype.inTransition=function(n){return this.transition_?this.transitionStarts_[n]!==-1:!1},e.prototype.endTransition=function(n){this.transition_&&(this.transitionStarts_[n]=-1)},e}(ty);const zoe=p4e;var m4e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),g4e=function(t){m4e(e,t);function e(n,r,i,o,a,s){var l=t.call(this,n,r,s)||this;return l.crossOrigin_=o,l.src_=i,l.key=i,l.image_=new Image,o!==null&&(l.image_.crossOrigin=o),l.unlisten_=null,l.tileLoadFunction_=a,l}return e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(n){this.image_=n,this.state=St.LOADED,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){this.state=St.ERROR,this.unlistenImage_(),this.image_=v4e(),this.changed()},e.prototype.handleImageLoad_=function(){var n=this.image_;n.naturalWidth&&n.naturalHeight?this.state=St.LOADED:this.state=St.EMPTY,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==St.ERROR&&(this.state=St.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==St.IDLE&&(this.state=St.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=fB(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(zoe);function v4e(){var t=Ca(1,1);return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas}const dB=g4e;var y4e=function(){function t(e,n,r){this.decay_=e,this.minVelocity_=n,this.delay_=r,this.points_=[],this.angle_=0,this.initialVelocity_=0}return t.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},t.prototype.update=function(e,n){this.points_.push(e,n,Date.now())},t.prototype.end=function(){if(this.points_.length<6)return!1;var e=Date.now()-this.delay_,n=this.points_.length-3;if(this.points_[n+2]0&&this.points_[r+2]>e;)r-=3;var i=this.points_[n+2]-this.points_[r+2];if(i<1e3/60)return!1;var o=this.points_[n]-this.points_[r],a=this.points_[n+1]-this.points_[r+1];return this.angle_=Math.atan2(a,o),this.initialVelocity_=Math.sqrt(o*o+a*a)/i,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}(),x4e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),b4e=function(t){x4e(e,t);function e(n){var r=t.call(this)||this;return r.map_=n,r}return e.prototype.dispatchRenderEvent=function(n,r){vt()},e.prototype.calculateMatrices2D=function(n){var r=n.viewState,i=n.coordinateToPixelTransform,o=n.pixelToCoordinateTransform;cu(i,n.size[0]/2,n.size[1]/2,1/r.resolution,-1/r.resolution,-r.rotation,-r.center[0],-r.center[1]),F5(o,i)},e.prototype.forEachFeatureAtCoordinate=function(n,r,i,o,a,s,l,c){var u,f=r.viewState;function d(L,z,B,W){return a.call(s,z,L?B:null,W)}var h=f.projection,p=Wie(n.slice(),h),m=[[0,0]];if(h.canWrapX()&&o){var g=h.getExtent(),v=Yn(g);m.push([-v,0],[v,0])}for(var y=r.layerStatesArray,x=y.length,b=[],_=[],S=0;S=0;--O){var C=y[O],E=C.layer;if(E.hasRenderer()&&WT(C,f)&&l.call(c,E)){var k=E.getRenderer(),I=E.getSource();if(k&&I){var P=I.getWrapX()?p:n,R=d.bind(null,C.managed);_[0]=P[0]+m[S][0],_[1]=P[1]+m[S][1],u=k.forEachFeatureAtCoordinate(_,r,i,R,b)}if(u)return u}}if(b.length!==0){var T=1/b.length;return b.forEach(function(L,z){return L.distanceSq+=z*T}),b.sort(function(L,z){return L.distanceSq-z.distanceSq}),b.some(function(L){return u=L.callback(L.feature,L.layer,L.geometry)}),u}},e.prototype.forEachLayerAtPixel=function(n,r,i,o,a){return vt()},e.prototype.hasFeatureAtCoordinate=function(n,r,i,o,a,s){var l=this.forEachFeatureAtCoordinate(n,r,i,o,Rh,this,a,s);return l!==void 0},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(n){vt()},e.prototype.scheduleExpireIconCache=function(n){VT.canExpireCache()&&n.postRenderFunctions.push(_4e)},e}($5);function _4e(t,e){VT.expire()}const w4e=b4e;var S4e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),O4e=function(t){S4e(e,t);function e(n){var r=t.call(this,n)||this;r.fontChangeListenerKey_=rn(Sc,Kg.PROPERTYCHANGE,n.redrawText.bind(n)),r.element_=document.createElement("div");var i=r.element_.style;i.position="absolute",i.width="100%",i.height="100%",i.zIndex="0",r.element_.className=B1+" ol-layers";var o=n.getViewport();return o.insertBefore(r.element_,o.firstChild||null),r.children_=[],r.renderedVisible_=!0,r}return e.prototype.dispatchRenderEvent=function(n,r){var i=this.getMap();if(i.hasListener(n)){var o=new Doe(n,void 0,r);i.dispatchEvent(o)}},e.prototype.disposeInternal=function(){tr(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),t.prototype.disposeInternal.call(this)},e.prototype.renderFrame=function(n){if(!n){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(n),this.dispatchRenderEvent(Lf.PRECOMPOSE,n);var r=n.layerStatesArray.sort(function(h,p){return h.zIndex-p.zIndex}),i=n.viewState;this.children_.length=0;for(var o=[],a=null,s=0,l=r.length;s=0;--s)o[s].renderDeclutter(n);wBe(this.element_,this.children_),this.dispatchRenderEvent(Lf.POSTCOMPOSE,n),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(n)},e.prototype.forEachLayerAtPixel=function(n,r,i,o,a){for(var s=r.viewState,l=r.layerStatesArray,c=l.length,u=c-1;u>=0;--u){var f=l[u],d=f.layer;if(d.hasRenderer()&&WT(f,s)&&a(d)){var h=d.getRenderer(),p=h.getDataAtPixel(n,r,i);if(p){var m=o(d,p);if(m)return m}}}},e}(w4e);const C4e=O4e;var Uoe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),rf=function(t){Uoe(e,t);function e(n,r){var i=t.call(this,n)||this;return i.layer=r,i}return e}(rc),IA={LAYERS:"layers"},T4e=function(t){Uoe(e,t);function e(n){var r=this,i=n||{},o=cr({},i);delete o.layers;var a=i.layers;return r=t.call(this,o)||this,r.on,r.once,r.un,r.layersListenerKeys_=[],r.listenerKeys_={},r.addChangeListener(IA.LAYERS,r.handleLayersChanged_),a?Array.isArray(a)?a=new Xa(a.slice(),{unique:!0}):Ut(typeof a.getArray=="function",43):a=new Xa(void 0,{unique:!0}),r.setLayers(a),r}return e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(tr),this.layersListenerKeys_.length=0;var n=this.getLayers();this.layersListenerKeys_.push(rn(n,Oo.ADD,this.handleLayersAdd_,this),rn(n,Oo.REMOVE,this.handleLayersRemove_,this));for(var r in this.listenerKeys_)this.listenerKeys_[r].forEach(tr);I1(this.listenerKeys_);for(var i=n.getArray(),o=0,a=i.length;othis.moveTolerance_||Math.abs(n.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(tr(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(Mt.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(tr(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(tr),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(ty);const I4e=R4e,Hu={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},Ui={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"};var GT=1/0,D4e=function(){function t(e,n){this.priorityFunction_=e,this.keyFunction_=n,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return t.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,I1(this.queuedElements_)},t.prototype.dequeue=function(){var e=this.elements_,n=this.priorities_,r=e[0];e.length==1?(e.length=0,n.length=0):(e[0]=e.pop(),n[0]=n.pop(),this.siftUp_(0));var i=this.keyFunction_(r);return delete this.queuedElements_[i],r},t.prototype.enqueue=function(e){Ut(!(this.keyFunction_(e)in this.queuedElements_),31);var n=this.priorityFunction_(e);return n!=GT?(this.elements_.push(e),this.priorities_.push(n),this.queuedElements_[this.keyFunction_(e)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1},t.prototype.getCount=function(){return this.elements_.length},t.prototype.getLeftChildIndex_=function(e){return e*2+1},t.prototype.getRightChildIndex_=function(e){return e*2+2},t.prototype.getParentIndex_=function(e){return e-1>>1},t.prototype.heapify_=function(){var e;for(e=(this.elements_.length>>1)-1;e>=0;e--)this.siftUp_(e)},t.prototype.isEmpty=function(){return this.elements_.length===0},t.prototype.isKeyQueued=function(e){return e in this.queuedElements_},t.prototype.isQueued=function(e){return this.isKeyQueued(this.keyFunction_(e))},t.prototype.siftUp_=function(e){for(var n=this.elements_,r=this.priorities_,i=n.length,o=n[e],a=r[e],s=e;e>1;){var l=this.getLeftChildIndex_(e),c=this.getRightChildIndex_(e),u=ce;){var s=this.getParentIndex_(n);if(i[s]>a)r[n]=r[s],i[n]=i[s],n=s;else break}r[n]=o,i[n]=a},t.prototype.reprioritize=function(){var e=this.priorityFunction_,n=this.elements_,r=this.priorities_,i=0,o=n.length,a,s,l;for(s=0;s0;)a=this.dequeue()[0],s=a.getKey(),o=a.getState(),o===St.IDLE&&!(s in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[s]=!0,++this.tilesLoading_,++i,a.load())},e}(L4e);const F4e=N4e;function j4e(t,e,n,r,i){if(!t||!(n in t.wantedTiles)||!t.wantedTiles[n][e.getKey()])return GT;var o=t.viewState.center,a=r[0]-o[0],s=r[1]-o[1];return 65536*Math.log(i)+Math.sqrt(a*a+s*s)/i}const Ts={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};var B4e=42,hB=256;function jG(t,e,n){return function(r,i,o,a,s){if(r){if(!i&&!e)return r;var l=e?0:o[0]*i,c=e?0:o[1]*i,u=s?s[0]:0,f=s?s[1]:0,d=t[0]+l/2+u,h=t[2]-l/2+u,p=t[1]+c/2+f,m=t[3]-c/2+f;d>h&&(d=(h+d)/2,h=d),p>m&&(p=(m+p)/2,m=p);var g=Fr(r[0],d,h),v=Fr(r[1],p,m);if(a&&n&&i){var y=30*i;g+=-y*Math.log(1+Math.max(0,d-r[0])/y)+y*Math.log(1+Math.max(0,r[0]-h)/y),v+=-y*Math.log(1+Math.max(0,p-r[1])/y)+y*Math.log(1+Math.max(0,r[1]-m)/y)}return[g,v]}}}function z4e(t){return t}function pB(t,e,n,r){var i=Yn(e)/n[0],o=hs(e)/n[1];return r?Math.min(t,Math.max(i,o)):Math.min(t,Math.min(i,o))}function mB(t,e,n){var r=Math.min(t,e),i=50;return r*=Math.log(1+i*Math.max(0,t/e-1))/i+1,n&&(r=Math.max(r,n),r/=Math.log(1+i*Math.max(0,n/t-1))/i+1),Fr(r,n/2,e*2)}function U4e(t,e,n,r){return function(i,o,a,s){if(i!==void 0){var l=t[0],c=t[t.length-1],u=n?pB(l,n,a,r):l;if(s){var f=e!==void 0?e:!0;return f?mB(i,u,c):Fr(i,c,u)}var d=Math.min(u,i),h=Math.floor(N5(t,d,o));return t[h]>u&&h1&&typeof arguments[r-1]=="function"&&(i=arguments[r-1],--r);for(var o=0;o0},e.prototype.getInteracting=function(){return this.hints_[Hi.INTERACTING]>0},e.prototype.cancelAnimations=function(){this.setHint(Hi.ANIMATING,-this.hints_[Hi.ANIMATING]);for(var n,r=0,i=this.animations_.length;r=0;--i){for(var o=this.animations_[i],a=!0,s=0,l=o.length;s0?u/c.duration:1;f>=1?(c.complete=!0,f=1):a=!1;var d=c.easing(f);if(c.sourceCenter){var h=c.sourceCenter[0],p=c.sourceCenter[1],m=c.targetCenter[0],g=c.targetCenter[1];this.nextCenter_=c.targetCenter;var v=h+d*(m-h),y=p+d*(g-p);this.targetCenter_=[v,y]}if(c.sourceResolution&&c.targetResolution){var x=d===1?c.targetResolution:c.sourceResolution+d*(c.targetResolution-c.sourceResolution);if(c.anchor){var b=this.getViewportSize_(this.getRotation()),_=this.constraints_.resolution(x,0,b,!0);this.targetCenter_=this.calculateCenterZoom(_,c.anchor)}this.nextResolution_=c.targetResolution,this.targetResolution_=x,this.applyTargetState_(!0)}if(c.sourceRotation!==void 0&&c.targetRotation!==void 0){var S=d===1?Df(c.targetRotation+Math.PI,2*Math.PI)-Math.PI:c.sourceRotation+d*(c.targetRotation-c.sourceRotation);if(c.anchor){var O=this.constraints_.rotation(S,!0);this.targetCenter_=this.calculateCenterRotate(O,c.anchor)}this.nextRotation_=c.targetRotation,this.targetRotation_=S}if(this.applyTargetState_(!0),r=!0,!c.complete)break}}if(a){this.animations_[i]=null,this.setHint(Hi.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var C=o[0].callback;C&&yS(C,!0)}}this.animations_=this.animations_.filter(Boolean),r&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},e.prototype.calculateCenterRotate=function(n,r){var i,o=this.getCenterInternal();return o!==void 0&&(i=[o[0]-r[0],o[1]-r[1]],U5(i,n-this.getRotation()),rje(i,r)),i},e.prototype.calculateCenterZoom=function(n,r){var i,o=this.getCenterInternal(),a=this.getResolution();if(o!==void 0&&a!==void 0){var s=r[0]-n*(r[0]-o[0])/a,l=r[1]-n*(r[1]-o[1])/a;i=[s,l]}return i},e.prototype.getViewportSize_=function(n){var r=this.viewportSize_;if(n){var i=r[0],o=r[1];return[Math.abs(i*Math.cos(n))+Math.abs(o*Math.sin(n)),Math.abs(i*Math.sin(n))+Math.abs(o*Math.cos(n))]}else return r},e.prototype.setViewportSize=function(n){this.viewportSize_=Array.isArray(n)?n.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},e.prototype.getCenter=function(){var n=this.getCenterInternal();return n&&XL(n,this.getProjection())},e.prototype.getCenterInternal=function(){return this.get(Ts.CENTER)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.get("constrainResolution")},e.prototype.getHints=function(n){return n!==void 0?(n[0]=this.hints_[0],n[1]=this.hints_[1],n):this.hints_.slice()},e.prototype.calculateExtent=function(n){var r=this.calculateExtentInternal(n);return Hie(r,this.getProjection())},e.prototype.calculateExtentInternal=function(n){var r=n||this.getViewportSizeMinusPadding_(),i=this.getCenterInternal();Ut(i,1);var o=this.getResolution();Ut(o!==void 0,2);var a=this.getRotation();return Ut(a!==void 0,3),VL(i,o,a,r)},e.prototype.getMaxResolution=function(){return this.maxResolution_},e.prototype.getMinResolution=function(){return this.minResolution_},e.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},e.prototype.setMaxZoom=function(n){this.applyOptions_(this.getUpdatedOptions_({maxZoom:n}))},e.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},e.prototype.setMinZoom=function(n){this.applyOptions_(this.getUpdatedOptions_({minZoom:n}))},e.prototype.setConstrainResolution=function(n){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:n}))},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get(Ts.RESOLUTION)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(n,r){return this.getResolutionForExtentInternal(hh(n,this.getProjection()),r)},e.prototype.getResolutionForExtentInternal=function(n,r){var i=r||this.getViewportSizeMinusPadding_(),o=Yn(n)/i[0],a=hs(n)/i[1];return Math.max(o,a)},e.prototype.getResolutionForValueFunction=function(n){var r=n||2,i=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,a=Math.log(i/o)/Math.log(r);return function(s){var l=i/Math.pow(r,s*a);return l}},e.prototype.getRotation=function(){return this.get(Ts.ROTATION)},e.prototype.getValueForResolutionFunction=function(n){var r=Math.log(n||2),i=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,a=Math.log(i/o)/r;return function(s){var l=Math.log(i/s)/r/a;return l}},e.prototype.getViewportSizeMinusPadding_=function(n){var r=this.getViewportSize_(n),i=this.padding_;return i&&(r=[r[0]-i[1]-i[3],r[1]-i[0]-i[2]]),r},e.prototype.getState=function(){var n=this.getProjection(),r=this.getResolution(),i=this.getRotation(),o=this.getCenterInternal(),a=this.padding_;if(a){var s=this.getViewportSizeMinusPadding_();o=LA(o,this.getViewportSize_(),[s[0]/2+a[3],s[1]/2+a[0]],r,i)}return{center:o.slice(0),projection:n!==void 0?n:null,resolution:r,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}},e.prototype.getZoom=function(){var n,r=this.getResolution();return r!==void 0&&(n=this.getZoomForResolution(r)),n},e.prototype.getZoomForResolution=function(n){var r=this.minZoom_||0,i,o;if(this.resolutions_){var a=N5(this.resolutions_,n,1);r=a,i=this.resolutions_[a],a==this.resolutions_.length-1?o=2:o=i/this.resolutions_[a+1]}else i=this.maxResolution_,o=this.zoomFactor_;return r+Math.log(i/n)/Math.log(o)},e.prototype.getResolutionForZoom=function(n){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var r=Fr(Math.floor(n),0,this.resolutions_.length-2),i=this.resolutions_[r]/this.resolutions_[r+1];return this.resolutions_[r]/Math.pow(i,Fr(n-r,0,1))}else return this.maxResolution_/Math.pow(this.zoomFactor_,n-this.minZoom_)},e.prototype.fit=function(n,r){var i;if(Ut(Array.isArray(n)||typeof n.getSimplifiedGeometry=="function",24),Array.isArray(n)){Ut(!z5(n),25);var o=hh(n,this.getProjection());i=ZL(o)}else if(n.getType()==="Circle"){var o=hh(n.getExtent(),this.getProjection());i=ZL(o),i.rotate(this.getRotation(),Yf(o))}else{var a=hje();a?i=n.clone().transform(a,this.getProjection()):i=n}this.fitInternal(i,r)},e.prototype.rotatedExtentForGeometry=function(n){for(var r=this.getRotation(),i=Math.cos(r),o=Math.sin(-r),a=n.getFlatCoordinates(),s=n.getStride(),l=1/0,c=1/0,u=-1/0,f=-1/0,d=0,h=a.length;d=0;c--){var u=l[c];if(!(u.getMap()!==this||!u.getActive()||!this.getTargetElement())){var f=u.handleEvent(n);if(!f||n.propagationStopped)break}}}},e.prototype.handlePostRender=function(){var n=this.frameState_,r=this.tileQueue_;if(!r.isEmpty()){var i=this.maxTilesLoading_,o=i;if(n){var a=n.viewHints;if(a[Hi.ANIMATING]||a[Hi.INTERACTING]){var s=Date.now()-n.time>8;i=s?0:8,o=s?0:2}}r.getTilesLoading()0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!Sp(r,this.renderedAttributions_)){_Be(this.ulElement_);for(var o=0,a=r.length;o0&&i%(2*Math.PI)!==0?r.animate({rotation:0,duration:this.duration_,easing:sy}):r.setRotation(0))}},e.prototype.render=function(n){var r=n.frameState;if(r){var i=r.viewState.rotation;if(i!=this.rotation_){var o="rotate("+i+"rad)";if(this.autoHide_){var a=this.element.classList.contains(pS);!a&&i===0?this.element.classList.add(pS):a&&i!==0&&this.element.classList.remove(pS)}this.label_.style.transform=o}this.rotation_=i}},e}(r2);const lUe=sUe;var cUe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),uUe=function(t){cUe(e,t);function e(n){var r=this,i=n||{};r=t.call(this,{element:document.createElement("div"),target:i.target})||this;var o=i.className!==void 0?i.className:"ol-zoom",a=i.delta!==void 0?i.delta:1,s=i.zoomInClassName!==void 0?i.zoomInClassName:o+"-in",l=i.zoomOutClassName!==void 0?i.zoomOutClassName:o+"-out",c=i.zoomInLabel!==void 0?i.zoomInLabel:"+",u=i.zoomOutLabel!==void 0?i.zoomOutLabel:"–",f=i.zoomInTipLabel!==void 0?i.zoomInTipLabel:"Zoom in",d=i.zoomOutTipLabel!==void 0?i.zoomOutTipLabel:"Zoom out",h=document.createElement("button");h.className=s,h.setAttribute("type","button"),h.title=f,h.appendChild(typeof c=="string"?document.createTextNode(c):c),h.addEventListener(Mt.CLICK,r.handleClick_.bind(r,a),!1);var p=document.createElement("button");p.className=l,p.setAttribute("type","button"),p.title=d,p.appendChild(typeof u=="string"?document.createTextNode(u):u),p.addEventListener(Mt.CLICK,r.handleClick_.bind(r,-a),!1);var m=o+" "+B1+" "+uB,g=r.element;return g.className=m,g.appendChild(h),g.appendChild(p),r.duration_=i.duration!==void 0?i.duration:250,r}return e.prototype.handleClick_=function(n,r){r.preventDefault(),this.zoomByDelta_(n)},e.prototype.zoomByDelta_=function(n){var r=this.getMap(),i=r.getView();if(i){var o=i.getZoom();if(o!==void 0){var a=i.getConstrainedZoom(o+n);this.duration_>0?(i.getAnimating()&&i.cancelAnimations(),i.animate({zoom:a,duration:this.duration_,easing:sy})):i.setZoom(a)}}},e}(r2);const fUe=uUe;var dUe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$A="units",Id={DEGREES:"degrees",IMPERIAL:"imperial",NAUTICAL:"nautical",METRIC:"metric",US:"us"},hUe=[1,2,5],y0=25.4/.28,pUe=function(t){dUe(e,t);function e(n){var r=this,i=n||{},o=i.className!==void 0?i.className:i.bar?"ol-scale-bar":"ol-scale-line";return r=t.call(this,{element:document.createElement("div"),render:i.render,target:i.target})||this,r.on,r.once,r.un,r.innerElement_=document.createElement("div"),r.innerElement_.className=o+"-inner",r.element.className=o+" "+B1,r.element.appendChild(r.innerElement_),r.viewState_=null,r.minWidth_=i.minWidth!==void 0?i.minWidth:64,r.maxWidth_=i.maxWidth,r.renderedVisible_=!1,r.renderedWidth_=void 0,r.renderedHTML_="",r.addChangeListener($A,r.handleUnitsChanged_),r.setUnits(i.units||Id.METRIC),r.scaleBar_=i.bar||!1,r.scaleBarSteps_=i.steps||4,r.scaleBarText_=i.text||!1,r.dpi_=i.dpi||void 0,r}return e.prototype.getUnits=function(){return this.get($A)},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(n){this.set($A,n)},e.prototype.setDpi=function(n){this.dpi_=n},e.prototype.updateElement_=function(){var n=this.viewState_;if(!n){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}var r=n.center,i=n.projection,o=this.getUnits(),a=o==Id.DEGREES?li.DEGREES:li.METERS,s=IT(i,n.resolution,r,a),l=this.minWidth_*(this.dpi_||y0)/y0,c=this.maxWidth_!==void 0?this.maxWidth_*(this.dpi_||y0)/y0:void 0,u=l*s,f="";if(o==Id.DEGREES){var d=Xs[li.DEGREES];u*=d,u=c){p=v,m=y,g=x;break}else if(m>=l)break;v=p,y=m,x=g,++h}var _;this.scaleBar_?_=this.createScaleBar(m,p,f):_=p.toFixed(g<0?-g:0)+" "+f,this.renderedHTML_!=_&&(this.innerElement_.innerHTML=_,this.renderedHTML_=_),this.renderedWidth_!=m&&(this.innerElement_.style.width=m+"px",this.renderedWidth_=m),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)},e.prototype.createScaleBar=function(n,r,i){for(var o="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),a=[],s=n/this.scaleBarSteps_,l="ol-scale-singlebar-odd",c=0;c
'+this.createMarker("relative",c)+(c%2===0||this.scaleBarSteps_===2?this.createStepText(c,n,!1,r,i):"")+""),c===this.scaleBarSteps_-1&&a.push(this.createStepText(c+1,n,!0,r,i)),l=l==="ol-scale-singlebar-odd"?"ol-scale-singlebar-even":"ol-scale-singlebar-odd";var u;this.scaleBarText_?u='
'+o+"
":u="";var f='
'+u+a.join("")+"
";return f},e.prototype.createMarker=function(n,r){var i=n==="absolute"?3:-10;return'
'},e.prototype.createStepText=function(n,r,i,o,a){var s=n===0?0:Math.round(o/this.scaleBarSteps_*n*100)/100,l=s+(n===0?"":" "+a),c=n===0?-3:r/this.scaleBarSteps_*-1,u=n===0?0:r/this.scaleBarSteps_*2;return'
'+l+"
"},e.prototype.getScaleForResolution=function(){var n=IT(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,li.METERS),r=this.dpi_||y0,i=1e3/25.4;return parseFloat(n.toString())*i*r},e.prototype.render=function(n){var r=n.frameState;r?this.viewState_=r.viewState:this.viewState_=null,this.updateElement_()},e}(r2);function mUe(t){var e=t||{},n=new Xa,r=e.zoom!==void 0?e.zoom:!0;r&&n.push(new fUe(e.zoomOptions));var i=e.rotate!==void 0?e.rotate:!0;i&&n.push(new lUe(e.rotateOptions));var o=e.attribution!==void 0?e.attribution:!0;return o&&n.push(new oUe(e.attributionOptions)),n}const l$={ACTIVE:"active"};var gUe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),vUe=function(t){gUe(e,t);function e(n){var r=t.call(this)||this;return r.on,r.once,r.un,n&&n.handleEvent&&(r.handleEvent=n.handleEvent),r.map_=null,r.setActive(!0),r}return e.prototype.getActive=function(){return this.get(l$.ACTIVE)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(n){return!0},e.prototype.setActive=function(n){this.set(l$.ACTIVE,n)},e.prototype.setMap=function(n){this.map_=n},e}(ic);function yUe(t,e,n){var r=t.getCenterInternal();if(r){var i=[r[0]+e[0],r[1]+e[1]];t.animateInternal({duration:n!==void 0?n:250,easing:d4e,center:t.getConstrainedCenter(i)})}}function vB(t,e,n,r){var i=t.getZoom();if(i!==void 0){var o=t.getConstrainedZoom(i+e),a=t.getResolutionForZoom(o);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:a,anchor:n,duration:r!==void 0?r:250,easing:sy})}}const G1=vUe;var xUe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),bUe=function(t){xUe(e,t);function e(n){var r=t.call(this)||this,i=n||{};return r.delta_=i.delta?i.delta:1,r.duration_=i.duration!==void 0?i.duration:250,r}return e.prototype.handleEvent=function(n){var r=!1;if(n.type==wn.DBLCLICK){var i=n.originalEvent,o=n.map,a=n.coordinate,s=i.shiftKey?-this.delta_:this.delta_,l=o.getView();vB(l,s,a,this.duration_),i.preventDefault(),r=!0}return!r},e}(G1);const _Ue=bUe;var wUe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),SUe=function(t){wUe(e,t);function e(n){var r=this,i=n||{};return r=t.call(this,i)||this,i.handleDownEvent&&(r.handleDownEvent=i.handleDownEvent),i.handleDragEvent&&(r.handleDragEvent=i.handleDragEvent),i.handleMoveEvent&&(r.handleMoveEvent=i.handleMoveEvent),i.handleUpEvent&&(r.handleUpEvent=i.handleUpEvent),i.stopDown&&(r.stopDown=i.stopDown),r.handlingDownUpSequence=!1,r.targetPointers=[],r}return e.prototype.getPointerCount=function(){return this.targetPointers.length},e.prototype.handleDownEvent=function(n){return!1},e.prototype.handleDragEvent=function(n){},e.prototype.handleEvent=function(n){if(!n.originalEvent)return!0;var r=!1;if(this.updateTrackedPointers_(n),this.handlingDownUpSequence){if(n.type==wn.POINTERDRAG)this.handleDragEvent(n),n.originalEvent.preventDefault();else if(n.type==wn.POINTERUP){var i=this.handleUpEvent(n);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(n.type==wn.POINTERDOWN){var o=this.handleDownEvent(n);this.handlingDownUpSequence=o,r=this.stopDown(o)}else n.type==wn.POINTERMOVE&&this.handleMoveEvent(n);return!r},e.prototype.handleMoveEvent=function(n){},e.prototype.handleUpEvent=function(n){return!1},e.prototype.stopDown=function(n){return n},e.prototype.updateTrackedPointers_=function(n){n.activePointers&&(this.targetPointers=n.activePointers)},e}(G1);function yB(t){for(var e=t.length,n=0,r=0,i=0;i0&&this.condition_(n)){var r=n.map,i=r.getView();return this.lastCentroid=null,i.getAnimating()&&i.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}else return!1},e}(ly);const MUe=PUe;var kUe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),AUe=function(t){kUe(e,t);function e(n){var r=this,i=n||{};return r=t.call(this,{stopDown:R1})||this,r.condition_=i.condition?i.condition:OUe,r.lastAngle_=void 0,r.duration_=i.duration!==void 0?i.duration:250,r}return e.prototype.handleDragEvent=function(n){if(NA(n)){var r=n.map,i=r.getView();if(i.getConstraints().rotation!==gB){var o=r.getSize(),a=n.pixel,s=Math.atan2(o[1]/2-a[1],a[0]-o[0]/2);if(this.lastAngle_!==void 0){var l=s-this.lastAngle_;i.adjustRotationInternal(-l)}this.lastAngle_=s}}},e.prototype.handleUpEvent=function(n){if(!NA(n))return!0;var r=n.map,i=r.getView();return i.endInteraction(this.duration_),!1},e.prototype.handleDownEvent=function(n){if(!NA(n))return!1;if(qoe(n)&&this.condition_(n)){var r=n.map;return r.getView().beginInteraction(),this.lastAngle_=void 0,!0}else return!1},e}(ly),RUe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),IUe=function(t){RUe(e,t);function e(n){var r=t.call(this)||this;return r.geometry_=null,r.element_=document.createElement("div"),r.element_.style.position="absolute",r.element_.style.pointerEvents="auto",r.element_.className="ol-box "+n,r.map_=null,r.startPixel_=null,r.endPixel_=null,r}return e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var n=this.startPixel_,r=this.endPixel_,i="px",o=this.element_.style;o.left=Math.min(n[0],r[0])+i,o.top=Math.min(n[1],r[1])+i,o.width=Math.abs(r[0]-n[0])+i,o.height=Math.abs(r[1]-n[1])+i},e.prototype.setMap=function(n){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var r=this.element_.style;r.left="inherit",r.top="inherit",r.width="inherit",r.height="inherit"}this.map_=n,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},e.prototype.setPixels=function(n,r){this.startPixel_=n,this.endPixel_=r,this.createOrUpdateGeometry(),this.render_()},e.prototype.createOrUpdateGeometry=function(){var n=this.startPixel_,r=this.endPixel_,i=[n,[n[0],r[1]],r,[r[0],n[1]]],o=i.map(this.map_.getCoordinateFromPixelInternal,this.map_);o[4]=o[0].slice(),this.geometry_?this.geometry_.setCoordinates([o]):this.geometry_=new Jg([o])},e.prototype.getGeometry=function(){return this.geometry_},e}($5);const DUe=IUe;var Yoe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),xS={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"},FA=function(t){Yoe(e,t);function e(n,r,i){var o=t.call(this,n)||this;return o.coordinate=r,o.mapBrowserEvent=i,o}return e}(rc),LUe=function(t){Yoe(e,t);function e(n){var r=t.call(this)||this;r.on,r.once,r.un;var i=n||{};return r.box_=new DUe(i.className||"ol-dragbox"),r.minArea_=i.minArea!==void 0?i.minArea:64,i.onBoxEnd&&(r.onBoxEnd=i.onBoxEnd),r.startPixel_=null,r.condition_=i.condition?i.condition:qoe,r.boxEndCondition_=i.boxEndCondition?i.boxEndCondition:r.defaultBoxEndCondition,r}return e.prototype.defaultBoxEndCondition=function(n,r,i){var o=i[0]-r[0],a=i[1]-r[1];return o*o+a*a>=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(n){this.box_.setPixels(this.startPixel_,n.pixel),this.dispatchEvent(new FA(xS.BOXDRAG,n.coordinate,n))},e.prototype.handleUpEvent=function(n){this.box_.setMap(null);var r=this.boxEndCondition_(n,this.startPixel_,n.pixel);return r&&this.onBoxEnd(n),this.dispatchEvent(new FA(r?xS.BOXEND:xS.BOXCANCEL,n.coordinate,n)),!1},e.prototype.handleDownEvent=function(n){return this.condition_(n)?(this.startPixel_=n.pixel,this.box_.setMap(n.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new FA(xS.BOXSTART,n.coordinate,n)),!0):!1},e.prototype.onBoxEnd=function(n){},e}(ly);const $Ue=LUe;var NUe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),FUe=function(t){NUe(e,t);function e(n){var r=this,i=n||{},o=i.condition?i.condition:Xoe;return r=t.call(this,{condition:o,className:i.className||"ol-dragzoom",minArea:i.minArea})||this,r.duration_=i.duration!==void 0?i.duration:200,r.out_=i.out!==void 0?i.out:!1,r}return e.prototype.onBoxEnd=function(n){var r=this.getMap(),i=r.getView(),o=this.getGeometry();if(this.out_){var a=i.rotatedExtentForGeometry(o),s=i.getResolutionForExtentInternal(a),l=i.getResolution()/s;o=o.clone(),o.scale(l*l)}i.fitInternal(o,{duration:this.duration_,easing:sy})},e}($Ue);const jUe=FUe,Dd={LEFT:37,UP:38,RIGHT:39,DOWN:40};var BUe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),zUe=function(t){BUe(e,t);function e(n){var r=t.call(this)||this,i=n||{};return r.defaultCondition_=function(o){return xB(o)&&Qoe(o)},r.condition_=i.condition!==void 0?i.condition:r.defaultCondition_,r.duration_=i.duration!==void 0?i.duration:100,r.pixelDelta_=i.pixelDelta!==void 0?i.pixelDelta:128,r}return e.prototype.handleEvent=function(n){var r=!1;if(n.type==Mt.KEYDOWN){var i=n.originalEvent,o=i.keyCode;if(this.condition_(n)&&(o==Dd.DOWN||o==Dd.LEFT||o==Dd.RIGHT||o==Dd.UP)){var a=n.map,s=a.getView(),l=s.getResolution()*this.pixelDelta_,c=0,u=0;o==Dd.DOWN?u=-l:o==Dd.LEFT?c=-l:o==Dd.RIGHT?c=l:u=l;var f=[c,u];U5(f,s.getRotation()),yUe(s,f,this.duration_),i.preventDefault(),r=!0}}return!r},e}(G1),UUe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),WUe=function(t){UUe(e,t);function e(n){var r=t.call(this)||this,i=n||{};return r.condition_=i.condition?i.condition:Qoe,r.delta_=i.delta?i.delta:1,r.duration_=i.duration!==void 0?i.duration:100,r}return e.prototype.handleEvent=function(n){var r=!1;if(n.type==Mt.KEYDOWN||n.type==Mt.KEYPRESS){var i=n.originalEvent,o=i.charCode;if(this.condition_(n)&&(o==43||o==45)){var a=n.map,s=o==43?this.delta_:-this.delta_,l=a.getView();vB(l,s,void 0,this.duration_),i.preventDefault(),r=!0}}return!r},e}(G1);const VUe=WUe;var GUe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),jA={TRACKPAD:"trackpad",WHEEL:"wheel"},HUe=function(t){GUe(e,t);function e(n){var r=this,i=n||{};r=t.call(this,i)||this,r.totalDelta_=0,r.lastDelta_=0,r.maxDelta_=i.maxDelta!==void 0?i.maxDelta:1,r.duration_=i.duration!==void 0?i.duration:250,r.timeout_=i.timeout!==void 0?i.timeout:80,r.useAnchor_=i.useAnchor!==void 0?i.useAnchor:!0,r.constrainResolution_=i.constrainResolution!==void 0?i.constrainResolution:!1;var o=i.condition?i.condition:Hoe;return r.condition_=i.onFocusOnly?c$(Goe,o):o,r.lastAnchor_=null,r.startTime_=void 0,r.timeoutId_,r.mode_=void 0,r.trackpadEventGap_=400,r.trackpadTimeoutId_,r.deltaPerZoom_=300,r}return e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0;var n=this.getMap();if(n){var r=n.getView();r.endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)}},e.prototype.handleEvent=function(n){if(!this.condition_(n))return!0;var r=n.type;if(r!==Mt.WHEEL)return!0;var i=n.map,o=n.originalEvent;o.preventDefault(),this.useAnchor_&&(this.lastAnchor_=n.coordinate);var a;if(n.type==Mt.WHEEL&&(a=o.deltaY,SFe&&o.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(a/=Iie),o.deltaMode===WheelEvent.DOM_DELTA_LINE&&(a*=40)),a===0)return!1;this.lastDelta_=a;var s=Date.now();this.startTime_===void 0&&(this.startTime_=s),(!this.mode_||s-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(a)<4?jA.TRACKPAD:jA.WHEEL);var l=i.getView();if(this.mode_===jA.TRACKPAD&&!(l.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(l.getAnimating()&&l.cancelAnimations(),l.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),l.adjustZoom(-a/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=s,!1;this.totalDelta_+=a;var c=Math.max(this.timeout_-(s-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),c),!1},e.prototype.handleWheelZoom_=function(n){var r=n.getView();r.getAnimating()&&r.cancelAnimations();var i=-Fr(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(r.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),vB(r,i,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(n){this.useAnchor_=n,n||(this.lastAnchor_=null)},e}(G1);const qUe=HUe;var XUe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),QUe=function(t){XUe(e,t);function e(n){var r=this,i=n||{},o=i;return o.stopDown||(o.stopDown=R1),r=t.call(this,o)||this,r.anchor_=null,r.lastAngle_=void 0,r.rotating_=!1,r.rotationDelta_=0,r.threshold_=i.threshold!==void 0?i.threshold:.3,r.duration_=i.duration!==void 0?i.duration:250,r}return e.prototype.handleDragEvent=function(n){var r=0,i=this.targetPointers[0],o=this.targetPointers[1],a=Math.atan2(o.clientY-i.clientY,o.clientX-i.clientX);if(this.lastAngle_!==void 0){var s=a-this.lastAngle_;this.rotationDelta_+=s,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),r=s}this.lastAngle_=a;var l=n.map,c=l.getView();if(c.getConstraints().rotation!==gB){var u=l.getViewport().getBoundingClientRect(),f=yB(this.targetPointers);f[0]-=u.left,f[1]-=u.top,this.anchor_=l.getCoordinateFromPixelInternal(f),this.rotating_&&(l.render(),c.adjustRotationInternal(r,this.anchor_))}},e.prototype.handleUpEvent=function(n){if(this.targetPointers.length<2){var r=n.map,i=r.getView();return i.endInteraction(this.duration_),!1}else return!0},e.prototype.handleDownEvent=function(n){if(this.targetPointers.length>=2){var r=n.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||r.getView().beginInteraction(),!0}else return!1},e}(ly),YUe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),KUe=function(t){YUe(e,t);function e(n){var r=this,i=n||{},o=i;return o.stopDown||(o.stopDown=R1),r=t.call(this,o)||this,r.anchor_=null,r.duration_=i.duration!==void 0?i.duration:400,r.lastDistance_=void 0,r.lastScaleDelta_=1,r}return e.prototype.handleDragEvent=function(n){var r=1,i=this.targetPointers[0],o=this.targetPointers[1],a=i.clientX-o.clientX,s=i.clientY-o.clientY,l=Math.sqrt(a*a+s*s);this.lastDistance_!==void 0&&(r=this.lastDistance_/l),this.lastDistance_=l;var c=n.map,u=c.getView();r!=1&&(this.lastScaleDelta_=r);var f=c.getViewport().getBoundingClientRect(),d=yB(this.targetPointers);d[0]-=f.left,d[1]-=f.top,this.anchor_=c.getCoordinateFromPixelInternal(d),c.render(),u.adjustResolutionInternal(r,this.anchor_)},e.prototype.handleUpEvent=function(n){if(this.targetPointers.length<2){var r=n.map,i=r.getView(),o=this.lastScaleDelta_>1?1:-1;return i.endInteraction(this.duration_,o),!1}else return!0},e.prototype.handleDownEvent=function(n){if(this.targetPointers.length>=2){var r=n.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||r.getView().beginInteraction(),!0}else return!1},e}(ly);const ZUe=KUe;var JUe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Koe=function(t){JUe(e,t);function e(n,r,i){var o=t.call(this)||this;if(i!==void 0&&r===void 0)o.setFlatCoordinates(i,n);else{var a=r||0;o.setCenterAndRadius(n,a,i)}return o}return e.prototype.clone=function(){var n=new e(this.flatCoordinates.slice(),void 0,this.layout);return n.applyProperties(this),n},e.prototype.closestPointXY=function(n,r,i,o){var a=this.flatCoordinates,s=n-a[0],l=r-a[1],c=s*s+l*l;if(c=i[0]||n[1]<=i[1]&&n[3]>=i[1]?!0:B5(n,this.intersectsCoordinate.bind(this))}return!1},e.prototype.setCenter=function(n){var r=this.stride,i=this.flatCoordinates[r]-this.flatCoordinates[0],o=n.slice();o[r]=o[0]+i;for(var a=1;a=this.dragVertexDelay_?(this.downPx_=n.pixel,this.shouldHandle_=!this.freehand_,r=!0):this.lastDragTime_=void 0,this.shouldHandle_&&this.downTimeout_!==void 0&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0)}return this.freehand_&&n.type===wn.POINTERDRAG&&this.sketchFeature_!==null?(this.addToDrawing_(n.coordinate),i=!1):this.freehand_&&n.type===wn.POINTERDOWN?i=!1:r&&this.getPointerCount()<2?(i=n.type===wn.POINTERMOVE,i&&this.freehand_?(this.handlePointerMove_(n),this.shouldHandle_&&n.originalEvent.preventDefault()):(n.originalEvent.pointerType==="mouse"||n.type===wn.POINTERDRAG&&this.downTimeout_===void 0)&&this.handlePointerMove_(n)):n.type===wn.DBLCLICK&&(i=!1),t.prototype.handleEvent.call(this,n)&&i},e.prototype.handleDownEvent=function(n){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=n.pixel,this.finishCoordinate_||this.startDrawing_(n.coordinate),!0):this.condition_(n)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout((function(){this.handlePointerMove_(new Pc(wn.POINTERMOVE,n.map,n.originalEvent,!1,n.frameState))}).bind(this),this.dragVertexDelay_),this.downPx_=n.pixel,!0):(this.lastDragTime_=void 0,!1)},e.prototype.handleUpEvent=function(n){var r=!0;if(this.getPointerCount()===0)if(this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(n),this.shouldHandle_){var i=!this.finishCoordinate_;i&&this.startDrawing_(n.coordinate),!i&&this.freehand_?this.finishDrawing():!this.freehand_&&(!i||this.mode_===an.POINT)&&(this.atFinish_(n.pixel)?this.finishCondition_(n)&&this.finishDrawing():this.addToDrawing_(n.coordinate)),r=!1}else this.freehand_&&this.abortDrawing();return!r&&this.stopClick_&&n.preventDefault(),r},e.prototype.handlePointerMove_=function(n){if(this.pointerType_=n.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var r=this.downPx_,i=n.pixel,o=r[0]-i[0],a=r[1]-i[1],s=o*o+a*a;if(this.shouldHandle_=this.freehand_?s>this.squaredClickTolerance_:s<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?this.modifyDrawing_(n.coordinate):this.createOrUpdateSketchPoint_(n.coordinate.slice())},e.prototype.atFinish_=function(n){var r=!1;if(this.sketchFeature_){var i=!1,o=[this.finishCoordinate_],a=this.mode_;if(a===an.POINT)r=!0;else if(a===an.CIRCLE)r=this.sketchCoords_.length===2;else if(a===an.LINE_STRING)i=this.sketchCoords_.length>this.minPoints_;else if(a===an.POLYGON){var s=this.sketchCoords_;i=s[0].length>this.minPoints_,o=[s[0][0],s[0][s[0].length-2]]}if(i)for(var l=this.getMap(),c=0,u=o.length;c=this.maxPoints_&&(this.freehand_?a.pop():o=!0),a.push(n.slice()),this.geometryFunction_(a,r,i)):s===an.POLYGON&&(a=this.sketchCoords_[0],a.length>=this.maxPoints_&&(this.freehand_?a.pop():o=!0),a.push(n.slice()),o&&(this.finishCoordinate_=a[0]),this.geometryFunction_(this.sketchCoords_,r,i)),this.createOrUpdateSketchPoint_(n.slice()),this.updateSketchFeatures_(),o&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(this.sketchFeature_){var n=this.sketchFeature_.getGeometry(),r=this.getMap().getView().getProjection(),i,o=this.mode_;if(o===an.LINE_STRING||o===an.CIRCLE){if(i=this.sketchCoords_,i.splice(-2,1),i.length>=2){this.finishCoordinate_=i[i.length-2].slice();var a=this.finishCoordinate_.slice();i[i.length-1]=a,this.createOrUpdateSketchPoint_(a)}this.geometryFunction_(i,n,r),n.getType()==="Polygon"&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(n)}else if(o===an.POLYGON){i=this.sketchCoords_[0],i.splice(-2,1);var s=this.sketchLine_.getGeometry();if(i.length>=2){var a=i[i.length-2].slice();i[i.length-1]=a,this.createOrUpdateSketchPoint_(a)}s.setCoordinates(i),this.geometryFunction_(this.sketchCoords_,n,r)}i.length===1&&this.abortDrawing(),this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var n=this.abortDrawing_();if(n){var r=this.sketchCoords_,i=n.getGeometry(),o=this.getMap().getView().getProjection();this.mode_===an.LINE_STRING?(r.pop(),this.geometryFunction_(r,i,o)):this.mode_===an.POLYGON&&(r[0].pop(),this.geometryFunction_(r,i,o),r=i.getCoordinates()),this.type_==="MultiPoint"?n.setGeometry(new KM([r])):this.type_==="MultiLineString"?n.setGeometry(new eB([r])):this.type_==="MultiPolygon"&&n.setGeometry(new nB([r])),this.dispatchEvent(new _S(bS.DRAWEND,n)),this.features_&&this.features_.push(n),this.source_&&this.source_.addFeature(n)}},e.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var n=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),n},e.prototype.abortDrawing=function(){var n=this.abortDrawing_();n&&this.dispatchEvent(new _S(bS.DRAWABORT,n))},e.prototype.appendCoordinates=function(n){var r=this.mode_,i=!this.sketchFeature_;i&&this.startDrawing_(n[0]);var o;if(r===an.LINE_STRING||r===an.CIRCLE)o=this.sketchCoords_;else if(r===an.POLYGON)o=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[];else return;i&&o.shift(),o.pop();for(var a=0;a0&&this.getCount()>this.highWaterMark},t.prototype.expireCache=function(e){for(;this.canExpireCache();)this.pop()},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},t.prototype.containsKey=function(e){return this.entries_.hasOwnProperty(e)},t.prototype.forEach=function(e){for(var n=this.oldest_;n;)e(n.value_,n.key_,this),n=n.newer},t.prototype.get=function(e,n){var r=this.entries_[e];return Ut(r!==void 0,15),r===this.newest_||(r===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(r.newer.older=r.older,r.older.newer=r.newer),r.newer=null,r.older=this.newest_,this.newest_.newer=r,this.newest_=r),r.value_},t.prototype.remove=function(e){var n=this.entries_[e];return Ut(n!==void 0,15),n===this.newest_?(this.newest_=n.older,this.newest_&&(this.newest_.newer=null)):n===this.oldest_?(this.oldest_=n.newer,this.oldest_&&(this.oldest_.older=null)):(n.newer.older=n.older,n.older.newer=n.newer),delete this.entries_[e],--this.count_,n.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var e=new Array(this.count_),n=0,r;for(r=this.newest_;r;r=r.older)e[n++]=r.key_;return e},t.prototype.getValues=function(){var e=new Array(this.count_),n=0,r;for(r=this.newest_;r;r=r.older)e[n++]=r.value_;return e},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.peek=function(e){if(this.containsKey(e))return this.entries_[e].value_},t.prototype.pop=function(){var e=this.oldest_;return delete this.entries_[e.key_],e.newer&&(e.newer.older=null),this.oldest_=e.newer,this.oldest_||(this.newest_=null),--this.count_,e.value_},t.prototype.replace=function(e,n){this.get(e),this.entries_[e].value_=n},t.prototype.set=function(e,n){Ut(!(e in this.entries_),16);var r={key_:e,newer:null,older:this.newest_,value_:n};this.newest_?this.newest_.newer=r:this.oldest_=r,this.newest_=r,this.entries_[e]=r,++this.count_},t.prototype.setSize=function(e){this.highWaterMark=e},t}();const a6e=o6e;function WG(t,e,n,r){return r!==void 0?(r[0]=t,r[1]=e,r[2]=n,r):[t,e,n]}function i2(t,e,n){return t+"/"+e+"/"+n}function eae(t){return i2(t[0],t[1],t[2])}function s6e(t){return t.split("/").map(Number)}function tae(t){return(t[1]<n||n>e.getMaxZoom())return!1;var o=e.getFullTileRange(n);return o?o.containsXY(r,i):!0}var c6e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),u6e=function(t){c6e(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.expireCache=function(n){for(;this.canExpireCache();){var r=this.peekLast();if(r.getKey()in n)break;this.pop().release()}},e.prototype.pruneExceptNewestZ=function(){if(this.getCount()!==0){var n=this.peekFirstKey(),r=s6e(n),i=r[0];this.forEach((function(o){o.tileCoord[0]!==i&&(this.remove(eae(o.tileCoord)),o.release())}).bind(this))}},e}(a6e);const nae=u6e;var bB=function(){function t(e,n,r,i){this.minX=e,this.maxX=n,this.minY=r,this.maxY=i}return t.prototype.contains=function(e){return this.containsXY(e[1],e[2])},t.prototype.containsTileRange=function(e){return this.minX<=e.minX&&e.maxX<=this.maxX&&this.minY<=e.minY&&e.maxY<=this.maxY},t.prototype.containsXY=function(e,n){return this.minX<=e&&e<=this.maxX&&this.minY<=n&&n<=this.maxY},t.prototype.equals=function(e){return this.minX==e.minX&&this.minY==e.minY&&this.maxX==e.maxX&&this.maxY==e.maxY},t.prototype.extend=function(e){e.minXthis.maxX&&(this.maxX=e.maxX),e.minYthis.maxY&&(this.maxY=e.maxY)},t.prototype.getHeight=function(){return this.maxY-this.minY+1},t.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},t.prototype.getWidth=function(){return this.maxX-this.minX+1},t.prototype.intersects=function(e){return this.minX<=e.maxX&&this.maxX>=e.minX&&this.minY<=e.maxY&&this.maxY>=e.minY},t}();function Kp(t,e,n,r,i){return i!==void 0?(i.minX=t,i.maxX=e,i.minY=n,i.maxY=r,i):new bB(t,e,n,r)}var f6e=.5,d6e=10,VG=.25,h6e=function(){function t(e,n,r,i,o,a){this.sourceProj_=e,this.targetProj_=n;var s={},l=$b(this.targetProj_,this.sourceProj_);this.transformInv_=function(x){var b=x[0]+"/"+x[1];return s[b]||(s[b]=l(x)),s[b]},this.maxSourceExtent_=i,this.errorThresholdSquared_=o*o,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!i&&!!this.sourceProj_.getExtent()&&Yn(i)==Yn(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Yn(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Yn(this.targetProj_.getExtent()):null;var c=Cp(r),u=qM(r),f=HM(r),d=GM(r),h=this.transformInv_(c),p=this.transformInv_(u),m=this.transformInv_(f),g=this.transformInv_(d),v=d6e+(a?Math.max(0,Math.ceil(UFe(WL(r)/(a*a*256*256)))):0);if(this.addQuad_(c,u,f,d,h,p,m,g,v),this.wrapsXInSource_){var y=1/0;this.triangles_.forEach(function(x,b,_){y=Math.min(y,x.source[0][0],x.source[1][0],x.source[2][0])}),this.triangles_.forEach((function(x){if(Math.max(x.source[0][0],x.source[1][0],x.source[2][0])-y>this.sourceWorldWidth_/2){var b=[[x.source[0][0],x.source[0][1]],[x.source[1][0],x.source[1][1]],[x.source[2][0],x.source[2][1]]];b[0][0]-y>this.sourceWorldWidth_/2&&(b[0][0]-=this.sourceWorldWidth_),b[1][0]-y>this.sourceWorldWidth_/2&&(b[1][0]-=this.sourceWorldWidth_),b[2][0]-y>this.sourceWorldWidth_/2&&(b[2][0]-=this.sourceWorldWidth_);var _=Math.min(b[0][0],b[1][0],b[2][0]),S=Math.max(b[0][0],b[1][0],b[2][0]);S-_.5&&f<1,p=!1;if(c>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){var m=rG([e,n,r,i]),g=Yn(m)/this.targetWorldWidth_;p=g>VG||p}!h&&this.sourceProj_.isGlobal()&&f&&(p=f>VG||p)}if(!(!p&&this.maxSourceExtent_&&isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(u[3])&&!so(u,this.maxSourceExtent_))){var v=0;if(!p&&(!isFinite(o[0])||!isFinite(o[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(s[0])||!isFinite(s[1])||!isFinite(l[0])||!isFinite(l[1]))){if(c>0)p=!0;else if(v=(!isFinite(o[0])||!isFinite(o[1])?8:0)+(!isFinite(a[0])||!isFinite(a[1])?4:0)+(!isFinite(s[0])||!isFinite(s[1])?2:0)+(!isFinite(l[0])||!isFinite(l[1])?1:0),v!=1&&v!=2&&v!=4&&v!=8)return}if(c>0){if(!p){var y=[(e[0]+r[0])/2,(e[1]+r[1])/2],x=this.transformInv_(y),b=void 0;if(h){var _=(Df(o[0],d)+Df(s[0],d))/2;b=_-Df(x[0],d)}else b=(o[0]+s[0])/2-x[0];var S=(o[1]+s[1])/2-x[1],O=b*b+S*S;p=O>this.errorThresholdSquared_}if(p){if(Math.abs(e[0]-r[0])<=Math.abs(e[1]-r[1])){var C=[(n[0]+r[0])/2,(n[1]+r[1])/2],E=this.transformInv_(C),k=[(i[0]+e[0])/2,(i[1]+e[1])/2],I=this.transformInv_(k);this.addQuad_(e,n,C,k,o,a,E,I,c-1),this.addQuad_(k,C,r,i,I,E,s,l,c-1)}else{var P=[(e[0]+n[0])/2,(e[1]+n[1])/2],R=this.transformInv_(P),T=[(r[0]+i[0])/2,(r[1]+i[1])/2],L=this.transformInv_(T);this.addQuad_(e,P,T,i,o,R,L,l,c-1),this.addQuad_(P,n,r,T,R,a,s,L,c-1)}return}}if(h){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}v&11||this.addTriangle_(e,r,i,o,s,l),v&14||this.addTriangle_(e,r,n,o,s,a),v&&(v&13||this.addTriangle_(n,i,e,a,l,o),v&7||this.addTriangle_(n,i,r,a,l,s))}},t.prototype.calculateSourceExtent=function(){var e=Oa();return this.triangles_.forEach(function(n,r,i){var o=n.source;zx(e,o[0]),zx(e,o[1]),zx(e,o[2])}),e},t.prototype.getTriangles=function(){return this.triangles_},t}(),u$={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1},p6e={imageSmoothingEnabled:!0,msImageSmoothingEnabled:!0},BA,rae=[];function GG(t,e,n,r,i){t.beginPath(),t.moveTo(0,0),t.lineTo(e,n),t.lineTo(r,i),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,r)+1,Math.max(n,i)),t.restore()}function zA(t,e){return Math.abs(t[e*4]-210)>2||Math.abs(t[e*4+3]-.75*255)>2}function m6e(){if(BA===void 0){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",GG(t,4,5,4,0),GG(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;BA=zA(e,0)||zA(e,4)||zA(e,8)}return BA}function f$(t,e,n,r){var i=XM(n,e,t),o=IT(e,r,n),a=e.getMetersPerUnit();a!==void 0&&(o*=a);var s=t.getMetersPerUnit();s!==void 0&&(o/=s);var l=t.getExtent();if(!l||D1(l,i)){var c=IT(t,o,i)/o;isFinite(c)&&c>0&&(o/=c)}return o}function g6e(t,e,n,r){var i=Yf(n),o=f$(t,e,i,r);return(!isFinite(o)||o<=0)&&B5(n,function(a){return o=f$(t,e,a,r),isFinite(o)&&o>0}),o}function v6e(t,e,n,r,i,o,a,s,l,c,u,f){var d=Ca(Math.round(n*t),Math.round(n*e),rae);if(f||cr(d,u$),l.length===0)return d.canvas;d.scale(n,n);function h(b){return Math.round(b*n)/n}d.globalCompositeOperation="lighter";var p=Oa();l.forEach(function(b,_,S){Fie(p,b.extent)});var m=Yn(p),g=hs(p),v=Ca(Math.round(n*m/r),Math.round(n*g/r));f||cr(v,u$);var y=n/r;l.forEach(function(b,_,S){var O=b.extent[0]-p[0],C=-(b.extent[3]-p[3]),E=Yn(b.extent),k=hs(b.extent);b.image.width>0&&b.image.height>0&&v.drawImage(b.image,c,c,b.image.width-2*c,b.image.height-2*c,O*y,C*y,E*y,k*y)});var x=Cp(a);return s.getTriangles().forEach(function(b,_,S){var O=b.source,C=b.target,E=O[0][0],k=O[0][1],I=O[1][0],P=O[1][1],R=O[2][0],T=O[2][1],L=h((C[0][0]-x[0])/o),z=h(-(C[0][1]-x[1])/o),B=h((C[1][0]-x[0])/o),W=h(-(C[1][1]-x[1])/o),U=h((C[2][0]-x[0])/o),N=h(-(C[2][1]-x[1])/o),$=E,D=k;E=0,k=0,I-=$,P-=D,R-=$,T-=D;var A=[[I,P,0,0,B-L],[R,T,0,0,U-L],[0,0,I,P,W-z],[0,0,R,T,N-z]],q=VFe(A);if(q){if(d.save(),d.beginPath(),m6e()||!f){d.moveTo(B,W);for(var Y=4,K=L-B,se=z-W,te=0;te=this.minZoom;){if(this.zoomFactor_===2?(a=Math.floor(a/2),s=Math.floor(s/2),o=Kp(a,a,s,s,r)):o=this.getTileRangeForExtentAndZ(l,c,r),n(c,o))return!0;--c}return!1},t.prototype.getExtent=function(){return this.extent_},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(e){return this.origin_?this.origin_:this.origins_[e]},t.prototype.getResolution=function(e){return this.resolutions_[e]},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getTileCoordChildTileRange=function(e,n,r){if(e[0]this.maxZoom||n0?r:Math.max(a/s[0],o/s[1]),c=i+1,u=new Array(c),f=0;fi.highWaterMark&&(i.highWaterMark=n)},e.prototype.useTile=function(n,r,i,o){},e}(Foe),E6e=function(t){sae(e,t);function e(n,r){var i=t.call(this,n)||this;return i.tile=r,i}return e}(rc);const P6e=T6e;function M6e(t,e){var n=/\{z\}/g,r=/\{x\}/g,i=/\{y\}/g,o=/\{-y\}/g;return function(a,s,l){if(a)return t.replace(n,a[0].toString()).replace(r,a[1].toString()).replace(i,a[2].toString()).replace(o,function(){var c=a[0],u=e.getFullTileRange(c);Ut(u,55);var f=u.getHeight()-a[2]-1;return f.toString()})}}function k6e(t,e){for(var n=t.length,r=new Array(n),i=0;i=0},e.prototype.tileUrlFunction=function(n,r,i){var o=this.getTileGrid();if(o||(o=this.getTileGridForProjection(i)),!(o.getResolutions().length<=n[0])){r!=1&&(!this.hidpi_||this.serverType_===void 0)&&(r=1);var a=o.getResolution(n[0]),s=o.getTileCoordExtent(n,this.tmpExtent_),l=ua(o.getTileSize(n[0]),this.tmpSize),c=this.gutter_;c!==0&&(l=vG(l,c,this.tmpSize),s=Db(s,a*c,s)),r!=1&&(l=woe(l,r,this.tmpSize));var u={SERVICE:"WMS",VERSION:wS,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};return cr(u,this.params_),this.getRequestUrl_(n,l,s,r,i,u)}},e}(lae);const B6e=j6e;function cae(t){return w.jsx(M.Fragment,{children:t.children})}const SS={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};var z6e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),U6e=function(t){z6e(e,t);function e(n){var r=this,i=n||{},o=cr({},i);return delete o.preload,delete o.useInterimTilesOnError,r=t.call(this,o)||this,r.on,r.once,r.un,r.setPreload(i.preload!==void 0?i.preload:0),r.setUseInterimTilesOnError(i.useInterimTilesOnError!==void 0?i.useInterimTilesOnError:!0),r}return e.prototype.getPreload=function(){return this.get(SS.PRELOAD)},e.prototype.setPreload=function(n){this.set(SS.PRELOAD,n)},e.prototype.getUseInterimTilesOnError=function(){return this.get(SS.USE_INTERIM_TILES_ON_ERROR)},e.prototype.setUseInterimTilesOnError=function(n){this.set(SS.USE_INTERIM_TILES_ON_ERROR,n)},e.prototype.getData=function(n){return t.prototype.getData.call(this,n)},e}(e2);const W6e=U6e;var V6e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),G6e=function(t){V6e(e,t);function e(n){var r=t.call(this,n)||this;return r.extentChanged=!0,r.renderedExtent_=null,r.renderedPixelRatio,r.renderedProjection=null,r.renderedRevision,r.renderedTiles=[],r.newTiles_=!1,r.tmpExtent=Oa(),r.tmpTileRange_=new bB(0,0,0,0),r}return e.prototype.isDrawableTile=function(n){var r=this.getLayer(),i=n.getState(),o=r.getUseInterimTilesOnError();return i==St.LOADED||i==St.EMPTY||i==St.ERROR&&!o},e.prototype.getTile=function(n,r,i,o){var a=o.pixelRatio,s=o.viewState.projection,l=this.getLayer(),c=l.getSource(),u=c.getTile(n,r,i,a,s);return u.getState()==St.ERROR&&(l.getUseInterimTilesOnError()?l.getPreload()>0&&(this.newTiles_=!0):u.setState(St.LOADED)),this.isDrawableTile(u)||(u=u.getInterimTile()),u},e.prototype.getData=function(n){var r=this.frameState;if(!r)return null;var i=this.getLayer(),o=Or(r.pixelToCoordinateTransform,n.slice()),a=i.getExtent();if(a&&!D1(a,o))return null;for(var s=r.pixelRatio,l=r.viewState.projection,c=r.viewState,u=i.getRenderSource(),f=u.getTileGridForProjection(c.projection),d=u.getTilePixelRatio(r.pixelRatio),h=f.getZForResolution(c.resolution);h>=f.getMinZoom();--h){var p=f.getTileCoordForCoordAndZ(o,h),m=u.getTile(h,p[1],p[2],s,l);if(!(m instanceof dB||m instanceof iae))return null;if(m.getState()===St.LOADED){var g=f.getOrigin(h),v=ua(f.getTileSize(h)),y=f.getResolution(h),x=Math.floor(d*((o[0]-g[0])/y-p[1]*v[0])),b=Math.floor(d*((g[1]-o[1])/y-p[2]*v[1])),_=Math.round(d*u.getGutterForProjection(c.projection));return this.getImageData(m.getImage(),x+_,b+_)}}return null},e.prototype.loadedTileCallback=function(n,r,i){return this.isDrawableTile(i)?t.prototype.loadedTileCallback.call(this,n,r,i):!1},e.prototype.prepareFrame=function(n){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(n,r){var i=n.layerStatesArray[n.layerIndex],o=n.viewState,a=o.projection,s=o.resolution,l=o.center,c=o.rotation,u=n.pixelRatio,f=this.getLayer(),d=f.getSource(),h=d.getRevision(),p=d.getTileGridForProjection(a),m=p.getZForResolution(s,d.zDirection),g=p.getResolution(m),v=n.extent,y=n.viewState.resolution,x=d.getTilePixelRatio(u),b=Math.round(Yn(v)/y*u),_=Math.round(hs(v)/y*u),S=i.extent&&hh(i.extent);S&&(v=Ux(v,hh(i.extent)));var O=g*b/2/x,C=g*_/2/x,E=[l[0]-O,l[1]-C,l[0]+O,l[1]+C],k=p.getTileRangeForExtentAndZ(v,m),I={};I[m]={};var P=this.createLoadedTileFinder(d,a,I),R=this.tmpExtent,T=this.tmpTileRange_;this.newTiles_=!1;for(var L=c?GL(o.center,y,c,n.size):void 0,z=k.minX;z<=k.maxX;++z)for(var B=k.minY;B<=k.maxY;++B)if(!(c&&!p.tileCoordIntersectsViewport([m,z,B],L))){var W=this.getTile(m,z,B,n);if(this.isDrawableTile(W)){var U=vn(this);if(W.getState()==St.LOADED){I[m][W.tileCoord.toString()]=W;var N=W.inTransition(U);N&&i.opacity!==1&&(W.endTransition(U),N=!1),!this.newTiles_&&(N||this.renderedTiles.indexOf(W)===-1)&&(this.newTiles_=!0)}if(W.getAlpha(U,n.time)===1)continue}var $=p.getTileCoordChildTileRange(W.tileCoord,T,R),D=!1;$&&(D=P(m+1,$)),D||p.forEachTileCoordParentTileRange(W.tileCoord,P,T,R)}var A=g/s*u/x;cu(this.pixelTransform,n.size[0]/2,n.size[1]/2,1/u,1/u,c,-b/2,-_/2);var q=Lie(this.pixelTransform);this.useContainer(r,q,this.getBackground(n));var Y=this.context,K=Y.canvas;F5(this.inversePixelTransform,this.pixelTransform),cu(this.tempTransform,b/2,_/2,A,A,0,-b/2,-_/2),K.width!=b||K.height!=_?(K.width=b,K.height=_):this.containerReused||Y.clearRect(0,0,b,_),S&&this.clipUnrotated(Y,n,S),d.getInterpolate()||cr(Y,u$),this.preRender(Y,n),this.renderedTiles.length=0;var se=Object.keys(I).map(Number);se.sort(Yh);var te,J,pe;i.opacity===1&&(!this.containerReused||d.getOpaque(n.viewState.projection))?se=se.reverse():(te=[],J=[]);for(var be=se.length-1;be>=0;--be){var re=se[be],ve=d.getTilePixelSize(re,u,a),F=p.getResolution(re),ce=F/g,le=ve[0]*ce*A,Q=ve[1]*ce*A,X=p.getTileCoordForCoordAndZ(Cp(E),re),ee=p.getTileCoordExtent(X),ge=Or(this.tempTransform,[x*(ee[0]-E[0])/g,x*(E[3]-ee[3])/g]),ye=x*d.getGutterForProjection(a),H=I[re];for(var G in H){var W=H[G],ie=W.tileCoord,he=X[1]-ie[1],_e=Math.round(ge[0]-(he-1)*le),oe=X[2]-ie[2],Z=Math.round(ge[1]-(oe-1)*Q),z=Math.round(ge[0]-he*le),B=Math.round(ge[1]-oe*Q),V=_e-z,de=Z-B,xe=m===re,N=xe&&W.getAlpha(vn(this),n.time)!==1,Me=!1;if(!N)if(te){pe=[z,B,z+V,B,z+V,B+de,z,B+de];for(var me=0,Ne=te.length;me{const r=this.props.onClick;r&&r(n)});Yt(this,"handleDrop",n=>{if(this.props.onDropFiles){n.preventDefault();const r=[];if(n.dataTransfer.items)for(let i=0;i{this.props.onDropFiles&&n.preventDefault()});Yt(this,"handleRef",n=>{this.contextValue.mapDiv=n});Yt(this,"handleResize",()=>{const n=this.contextValue.mapDiv,r=this.contextValue.map;if(n&&r){r.updateSize();const i=r.getView(),o=this.getMinZoom(n);o!==i.getMinZoom()&&i.setMinZoom(o)}});Yt(this,"getMinZoom",n=>{const r=n.clientWidth,i=Math.LOG2E*Math.log(r/256);return i>=0?i:0});const{id:r,mapObjects:i}=n;i?this.contextValue={map:i[r]||void 0,mapObjects:i}:this.contextValue={mapObjects:{}}}componentDidMount(){const{id:n}=this.props,r=this.contextValue.mapDiv;let i=null;if(this.props.isStale){const a=this.contextValue.mapObjects[n];a instanceof UG&&(i=a,i.setTarget(r),this.clickEventsKey&&i.un("click",this.clickEventsKey.listener))}if(!i){const a=this.getMinZoom(r),s=new jc({projection:fae,center:[0,0],minZoom:a,zoom:a});i=new UG({view:s,...this.getMapOptions(),target:r})}this.contextValue.map=i,this.contextValue.mapObjects[n]=i,this.clickEventsKey=i.on("click",this.handleClick),i.updateSize(),this.forceUpdate(),window.addEventListener("resize",this.handleResize);const o=this.props.onMapRef;o&&o(i)}componentDidUpdate(n){const r=this.contextValue.map,i=this.contextValue.mapDiv,o=this.getMapOptions();r.setProperties({...o}),r.setTarget(i),r.updateSize()}componentWillUnmount(){window.removeEventListener("resize",this.handleResize);const n=this.props.onMapRef;n&&n(null)}render(){let n;return this.contextValue.map&&(n=w.jsx(dae.Provider,{value:this.contextValue,children:this.props.children})),w.jsx("div",{ref:this.handleRef,style:K6e,onDragOver:this.handleDragOver,onDrop:this.handleDrop,children:n})}getMapOptions(){const n={...this.props};return delete n.children,delete n.onClick,delete n.onDropFiles,n}};class fy extends M.PureComponent{constructor(){super(...arguments);Yt(this,"context",{});Yt(this,"object",null)}getMapObject(n){return this.context.mapObjects&&this.context.mapObjects[n]||null}getOptions(){const n={...this.props};return delete n.id,n}componentDidMount(){this._updateMapObject(this.addMapObject(this.context.map))}componentDidUpdate(n){this._updateMapObject(this.updateMapObject(this.context.map,this.object,n))}componentWillUnmount(){const n=this.context.map;this.removeMapObject(n,this.object),this.props.id&&delete this.context.mapObjects[this.props.id],this.object=null}_updateMapObject(n){n!=null&&this.props.id&&(n.set("objectId",this.props.id),this.context.mapObjects[this.props.id]=n),this.object=n}render(){return null}}Yt(fy,"contextType",dae);function hae(t,e,n){Zp(t,e,n,"visible",!0),Zp(t,e,n,"opacity",1),Zp(t,e,n,"zIndex",void 0),Zp(t,e,n,"extent",void 0),Zp(t,e,n,"minResolution",void 0),Zp(t,e,n,"maxResolution",void 0)}function Zp(t,e,n,r,i){const o=qG(e[r],i),a=qG(n[r],i);o!==a&&t.set(r,a)}function qG(t,e){return t===void 0?e:t}let So;So=()=>{};class pae extends fy{addMapObject(e){const n=new uae(this.props);return n.set("id",this.props.id),e.getLayers().push(n),n}updateMapObject(e,n,r){const i=n.getSource(),o=this.props.source||null;if(i===o)return n;if(o!==null&&i!==o){let a=!0;if(i instanceof d$&&o instanceof d$){const c=i,u=o,f=c.getTileGrid(),d=u.getTileGrid();if(J6e(f,d)){So("--> Equal tile grids!");const h=c.getUrls(),p=u.getUrls();h!==p&&p&&(h===null||h[0]!==p[0])&&(c.setUrls(p),a=!1);const m=c.getTileLoadFunction(),g=u.getTileLoadFunction();m!==g&&(c.setTileLoadFunction(g),a=!1);const v=c.getTileUrlFunction(),y=u.getTileUrlFunction();v!==y&&(c.setTileUrlFunction(y),a=!1)}else So("--> Tile grids are not equal!")}const s=i==null?void 0:i.getInterpolate(),l=o==null?void 0:o.getInterpolate();s!==l&&(a=!0),a?(n.setSource(o),So("--> Replaced source (expect flickering!)")):So("--> Updated source (check, is it still flickering?)")}return hae(n,r,this.props),n}removeMapObject(e,n){e.getLayers().remove(n)}}new cy({url:"https://a.tiles.mapbox.com/v3/mapbox.natural-earth-2/{z}/{x}/{y}.png",attributions:["© MapBox","© MapBox and contributors"]});new cy({url:"https://gis.ngdc.noaa.gov/arcgis/rest/services/web_mercator/gebco_2014_contours/MapServer/tile/{z}/{y}/{x}",attributions:["© GEBCO","© NOAHH and contributors"]});new Y6e;new cy({url:"https://tiles.wmflabs.org/bw-mapnik/{z}/{x}/{y}.png",attributions:["© OpenStreetMap contributors"]});function J6e(t,e){if(t===e)return!0;if(t===null||e===null||(So("tile grid:",t,e),So("min zoom:",t.getMinZoom(),e.getMinZoom()),So("max zoom:",t.getMaxZoom(),e.getMaxZoom()),t.getMinZoom()!==e.getMinZoom()||t.getMaxZoom()!==e.getMaxZoom()))return!1;const n=t.getExtent(),r=e.getExtent();So("extent:",n,r);for(let s=0;s=t[i])return i;let o=Math.floor(n/2),a;for(let s=0;sa)[r,o]=[o,Math.floor((o+i)/2)];else return o;if(r===o||o===i)return Math.abs(t[r]-e)<=Math.abs(t[i]-e)?r:i}return-1}function On(t){if(t===null||t===!0||t===!1)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function tt(t,e){if(e.length1?"s":"")+" required, but only "+e.length+" present")}function nt(t){tt(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||au(t)==="object"&&e==="[object Date]"?new Date(t.getTime()):typeof t=="number"||e==="[object Number]"?new Date(t):((typeof t=="string"||e==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function h$(t,e){tt(2,arguments);var n=nt(t),r=On(e);return isNaN(r)?new Date(NaN):(r&&n.setDate(n.getDate()+r),n)}function TC(t,e){tt(2,arguments);var n=nt(t),r=On(e);if(isNaN(r))return new Date(NaN);if(!r)return n;var i=n.getDate(),o=new Date(n.getTime());o.setMonth(n.getMonth()+r+1,0);var a=o.getDate();return i>=a?o:(n.setFullYear(o.getFullYear(),o.getMonth(),i),n)}function a2(t,e){tt(2,arguments);var n=nt(t).getTime(),r=On(e);return new Date(n+r)}var eWe=36e5;function tWe(t,e){tt(2,arguments);var n=On(e);return a2(t,n*eWe)}var nWe={};function pd(){return nWe}function WA(t,e){var n,r,i,o,a,s,l,c;tt(1,arguments);var u=pd(),f=On((n=(r=(i=(o=e==null?void 0:e.weekStartsOn)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.weekStartsOn)!==null&&i!==void 0?i:u.weekStartsOn)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=nt(t),h=d.getDay(),p=(h0?1:i}var s2=6e4,l2=36e5,cWe=1e3;function uWe(t,e){tt(2,arguments);var n=tv(t),r=tv(e);return n.getTime()===r.getTime()}function fWe(t){return tt(1,arguments),t instanceof Date||au(t)==="object"&&Object.prototype.toString.call(t)==="[object Date]"}function gae(t){if(tt(1,arguments),!fWe(t)&&typeof t!="number")return!1;var e=nt(t);return!isNaN(Number(e))}function dWe(t,e){tt(2,arguments);var n=nt(t),r=nt(e),i=n.getFullYear()-r.getFullYear(),o=n.getMonth()-r.getMonth();return i*12+o}function hWe(t,e){tt(2,arguments);var n=nt(t),r=nt(e);return n.getFullYear()-r.getFullYear()}function QG(t,e){var n=t.getFullYear()-e.getFullYear()||t.getMonth()-e.getMonth()||t.getDate()-e.getDate()||t.getHours()-e.getHours()||t.getMinutes()-e.getMinutes()||t.getSeconds()-e.getSeconds()||t.getMilliseconds()-e.getMilliseconds();return n<0?-1:n>0?1:n}function vae(t,e){tt(2,arguments);var n=nt(t),r=nt(e),i=QG(n,r),o=Math.abs(iWe(n,r));n.setDate(n.getDate()-i*o);var a=+(QG(n,r)===-i),s=i*(o-a);return s===0?0:s}function c2(t,e){return tt(2,arguments),nt(t).getTime()-nt(e).getTime()}var YG={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}},pWe="trunc";function H1(t){return t?YG[t]:YG[pWe]}function mWe(t,e,n){tt(2,arguments);var r=c2(t,e)/l2;return H1(n==null?void 0:n.roundingMethod)(r)}function gWe(t,e,n){tt(2,arguments);var r=c2(t,e)/s2;return H1(n==null?void 0:n.roundingMethod)(r)}function p$(t){tt(1,arguments);var e=nt(t);return e.setHours(23,59,59,999),e}function m$(t){tt(1,arguments);var e=nt(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(23,59,59,999),e}function vWe(t){tt(1,arguments);var e=nt(t);return p$(e).getTime()===m$(e).getTime()}function yae(t,e){tt(2,arguments);var n=nt(t),r=nt(e),i=Vx(n,r),o=Math.abs(dWe(n,r)),a;if(o<1)a=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-i*o);var s=Vx(n,r)===-i;vWe(nt(t))&&o===1&&Vx(t,r)===1&&(s=!1),a=i*(o-Number(s))}return a===0?0:a}function yWe(t,e,n){tt(2,arguments);var r=yae(t,e)/3;return H1(n==null?void 0:n.roundingMethod)(r)}function xWe(t,e,n){tt(2,arguments);var r=c2(t,e)/1e3;return H1(n==null?void 0:n.roundingMethod)(r)}function bWe(t,e,n){tt(2,arguments);var r=vae(t,e)/7;return H1(n==null?void 0:n.roundingMethod)(r)}function _We(t,e){tt(2,arguments);var n=nt(t),r=nt(e),i=Vx(n,r),o=Math.abs(hWe(n,r));n.setFullYear(1584),r.setFullYear(1584);var a=Vx(n,r)===-i,s=i*(o-Number(a));return s===0?0:s}function wWe(t,e){var n;tt(1,arguments);var r=t||{},i=nt(r.start),o=nt(r.end),a=o.getTime();if(!(i.getTime()<=a))throw new RangeError("Invalid interval");var s=[],l=i;l.setHours(0,0,0,0);var c=Number((n=e==null?void 0:e.step)!==null&&n!==void 0?n:1);if(c<1||isNaN(c))throw new RangeError("`options.step` must be a number greater than 1");for(;l.getTime()<=a;)s.push(nt(l)),l.setDate(l.getDate()+c),l.setHours(0,0,0,0);return s}function OS(t){tt(1,arguments);var e=nt(t);return e.setDate(1),e.setHours(0,0,0,0),e}function VA(t){tt(1,arguments);var e=nt(t),n=e.getFullYear();return e.setFullYear(n+1,0,0),e.setHours(23,59,59,999),e}function CS(t){tt(1,arguments);var e=nt(t),n=new Date(0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}function GA(t,e){var n,r,i,o,a,s,l,c;tt(1,arguments);var u=pd(),f=On((n=(r=(i=(o=e==null?void 0:e.weekStartsOn)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.weekStartsOn)!==null&&i!==void 0?i:u.weekStartsOn)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=nt(t),h=d.getDay(),p=(h=i.getTime()?n+1:e.getTime()>=a.getTime()?n:n-1}function CWe(t){tt(1,arguments);var e=bae(t),n=new Date(0);n.setUTCFullYear(e,0,4),n.setUTCHours(0,0,0,0);var r=nv(n);return r}var TWe=6048e5;function _ae(t){tt(1,arguments);var e=nt(t),n=nv(e).getTime()-CWe(e).getTime();return Math.round(n/TWe)+1}function Jh(t,e){var n,r,i,o,a,s,l,c;tt(1,arguments);var u=pd(),f=On((n=(r=(i=(o=e==null?void 0:e.weekStartsOn)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.weekStartsOn)!==null&&i!==void 0?i:u.weekStartsOn)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=nt(t),h=d.getUTCDay(),p=(h=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setUTCFullYear(f+1,0,h),p.setUTCHours(0,0,0,0);var m=Jh(p,e),g=new Date(0);g.setUTCFullYear(f,0,h),g.setUTCHours(0,0,0,0);var v=Jh(g,e);return u.getTime()>=m.getTime()?f+1:u.getTime()>=v.getTime()?f:f-1}function EWe(t,e){var n,r,i,o,a,s,l,c;tt(1,arguments);var u=pd(),f=On((n=(r=(i=(o=e==null?void 0:e.firstWeekContainsDate)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&i!==void 0?i:u.firstWeekContainsDate)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1),d=OB(t,e),h=new Date(0);h.setUTCFullYear(d,0,f),h.setUTCHours(0,0,0,0);var p=Jh(h,e);return p}var PWe=6048e5;function wae(t,e){tt(1,arguments);var n=nt(t),r=Jh(n,e).getTime()-EWe(n,e).getTime();return Math.round(r/PWe)+1}function Gt(t,e){for(var n=t<0?"-":"",r=Math.abs(t).toString();r.length0?r:1-r;return Gt(n==="yy"?i%100:i,n.length)},M:function(e,n){var r=e.getUTCMonth();return n==="M"?String(r+1):Gt(r+1,2)},d:function(e,n){return Gt(e.getUTCDate(),n.length)},a:function(e,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h:function(e,n){return Gt(e.getUTCHours()%12||12,n.length)},H:function(e,n){return Gt(e.getUTCHours(),n.length)},m:function(e,n){return Gt(e.getUTCMinutes(),n.length)},s:function(e,n){return Gt(e.getUTCSeconds(),n.length)},S:function(e,n){var r=n.length,i=e.getUTCMilliseconds(),o=Math.floor(i*Math.pow(10,r-3));return Gt(o,n.length)}};const Iu=MWe;var Jp={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},kWe={G:function(e,n,r){var i=e.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return r.era(i,{width:"abbreviated"});case"GGGGG":return r.era(i,{width:"narrow"});case"GGGG":default:return r.era(i,{width:"wide"})}},y:function(e,n,r){if(n==="yo"){var i=e.getUTCFullYear(),o=i>0?i:1-i;return r.ordinalNumber(o,{unit:"year"})}return Iu.y(e,n)},Y:function(e,n,r,i){var o=OB(e,i),a=o>0?o:1-o;if(n==="YY"){var s=a%100;return Gt(s,2)}return n==="Yo"?r.ordinalNumber(a,{unit:"year"}):Gt(a,n.length)},R:function(e,n){var r=bae(e);return Gt(r,n.length)},u:function(e,n){var r=e.getUTCFullYear();return Gt(r,n.length)},Q:function(e,n,r){var i=Math.ceil((e.getUTCMonth()+1)/3);switch(n){case"Q":return String(i);case"QQ":return Gt(i,2);case"Qo":return r.ordinalNumber(i,{unit:"quarter"});case"QQQ":return r.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,n,r){var i=Math.ceil((e.getUTCMonth()+1)/3);switch(n){case"q":return String(i);case"qq":return Gt(i,2);case"qo":return r.ordinalNumber(i,{unit:"quarter"});case"qqq":return r.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,n,r){var i=e.getUTCMonth();switch(n){case"M":case"MM":return Iu.M(e,n);case"Mo":return r.ordinalNumber(i+1,{unit:"month"});case"MMM":return r.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(i,{width:"wide",context:"formatting"})}},L:function(e,n,r){var i=e.getUTCMonth();switch(n){case"L":return String(i+1);case"LL":return Gt(i+1,2);case"Lo":return r.ordinalNumber(i+1,{unit:"month"});case"LLL":return r.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(i,{width:"wide",context:"standalone"})}},w:function(e,n,r,i){var o=wae(e,i);return n==="wo"?r.ordinalNumber(o,{unit:"week"}):Gt(o,n.length)},I:function(e,n,r){var i=_ae(e);return n==="Io"?r.ordinalNumber(i,{unit:"week"}):Gt(i,n.length)},d:function(e,n,r){return n==="do"?r.ordinalNumber(e.getUTCDate(),{unit:"date"}):Iu.d(e,n)},D:function(e,n,r){var i=OWe(e);return n==="Do"?r.ordinalNumber(i,{unit:"dayOfYear"}):Gt(i,n.length)},E:function(e,n,r){var i=e.getUTCDay();switch(n){case"E":case"EE":case"EEE":return r.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(i,{width:"short",context:"formatting"});case"EEEE":default:return r.day(i,{width:"wide",context:"formatting"})}},e:function(e,n,r,i){var o=e.getUTCDay(),a=(o-i.weekStartsOn+8)%7||7;switch(n){case"e":return String(a);case"ee":return Gt(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(o,{width:"short",context:"formatting"});case"eeee":default:return r.day(o,{width:"wide",context:"formatting"})}},c:function(e,n,r,i){var o=e.getUTCDay(),a=(o-i.weekStartsOn+8)%7||7;switch(n){case"c":return String(a);case"cc":return Gt(a,n.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(o,{width:"narrow",context:"standalone"});case"cccccc":return r.day(o,{width:"short",context:"standalone"});case"cccc":default:return r.day(o,{width:"wide",context:"standalone"})}},i:function(e,n,r){var i=e.getUTCDay(),o=i===0?7:i;switch(n){case"i":return String(o);case"ii":return Gt(o,n.length);case"io":return r.ordinalNumber(o,{unit:"day"});case"iii":return r.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(i,{width:"short",context:"formatting"});case"iiii":default:return r.day(i,{width:"wide",context:"formatting"})}},a:function(e,n,r){var i=e.getUTCHours(),o=i/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,n,r){var i=e.getUTCHours(),o;switch(i===12?o=Jp.noon:i===0?o=Jp.midnight:o=i/12>=1?"pm":"am",n){case"b":case"bb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,n,r){var i=e.getUTCHours(),o;switch(i>=17?o=Jp.evening:i>=12?o=Jp.afternoon:i>=4?o=Jp.morning:o=Jp.night,n){case"B":case"BB":case"BBB":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,n,r){if(n==="ho"){var i=e.getUTCHours()%12;return i===0&&(i=12),r.ordinalNumber(i,{unit:"hour"})}return Iu.h(e,n)},H:function(e,n,r){return n==="Ho"?r.ordinalNumber(e.getUTCHours(),{unit:"hour"}):Iu.H(e,n)},K:function(e,n,r){var i=e.getUTCHours()%12;return n==="Ko"?r.ordinalNumber(i,{unit:"hour"}):Gt(i,n.length)},k:function(e,n,r){var i=e.getUTCHours();return i===0&&(i=24),n==="ko"?r.ordinalNumber(i,{unit:"hour"}):Gt(i,n.length)},m:function(e,n,r){return n==="mo"?r.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):Iu.m(e,n)},s:function(e,n,r){return n==="so"?r.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):Iu.s(e,n)},S:function(e,n){return Iu.S(e,n)},X:function(e,n,r,i){var o=i._originalDate||e,a=o.getTimezoneOffset();if(a===0)return"Z";switch(n){case"X":return ZG(a);case"XXXX":case"XX":return qd(a);case"XXXXX":case"XXX":default:return qd(a,":")}},x:function(e,n,r,i){var o=i._originalDate||e,a=o.getTimezoneOffset();switch(n){case"x":return ZG(a);case"xxxx":case"xx":return qd(a);case"xxxxx":case"xxx":default:return qd(a,":")}},O:function(e,n,r,i){var o=i._originalDate||e,a=o.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+KG(a,":");case"OOOO":default:return"GMT"+qd(a,":")}},z:function(e,n,r,i){var o=i._originalDate||e,a=o.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+KG(a,":");case"zzzz":default:return"GMT"+qd(a,":")}},t:function(e,n,r,i){var o=i._originalDate||e,a=Math.floor(o.getTime()/1e3);return Gt(a,n.length)},T:function(e,n,r,i){var o=i._originalDate||e,a=o.getTime();return Gt(a,n.length)}};function KG(t,e){var n=t>0?"-":"+",r=Math.abs(t),i=Math.floor(r/60),o=r%60;if(o===0)return n+String(i);var a=e||"";return n+String(i)+a+Gt(o,2)}function ZG(t,e){if(t%60===0){var n=t>0?"-":"+";return n+Gt(Math.abs(t)/60,2)}return qd(t,e)}function qd(t,e){var n=e||"",r=t>0?"-":"+",i=Math.abs(t),o=Gt(Math.floor(i/60),2),a=Gt(i%60,2);return r+o+n+a}var JG=function(e,n){switch(e){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},Sae=function(e,n){switch(e){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},AWe=function(e,n){var r=e.match(/(P+)(p+)?/)||[],i=r[1],o=r[2];if(!o)return JG(e,n);var a;switch(i){case"P":a=n.dateTime({width:"short"});break;case"PP":a=n.dateTime({width:"medium"});break;case"PPP":a=n.dateTime({width:"long"});break;case"PPPP":default:a=n.dateTime({width:"full"});break}return a.replace("{{date}}",JG(i,n)).replace("{{time}}",Sae(o,n))},g$={p:Sae,P:AWe},RWe=["D","DD"],IWe=["YY","YYYY"];function Oae(t){return RWe.indexOf(t)!==-1}function Cae(t){return IWe.indexOf(t)!==-1}function qT(t,e,n){if(t==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var DWe={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},LWe=function(e,n,r){var i,o=DWe[e];return typeof o=="string"?i=o:n===1?i=o.one:i=o.other.replace("{{count}}",n.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+i:i+" ago":i};const $We=LWe;function HA(t){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.width?String(e.width):t.defaultWidth,r=t.formats[n]||t.formats[t.defaultWidth];return r}}var NWe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},FWe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},jWe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},BWe={date:HA({formats:NWe,defaultWidth:"full"}),time:HA({formats:FWe,defaultWidth:"full"}),dateTime:HA({formats:jWe,defaultWidth:"full"})};const zWe=BWe;var UWe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},WWe=function(e,n,r,i){return UWe[e]};const VWe=WWe;function x0(t){return function(e,n){var r=n!=null&&n.context?String(n.context):"standalone",i;if(r==="formatting"&&t.formattingValues){var o=t.defaultFormattingWidth||t.defaultWidth,a=n!=null&&n.width?String(n.width):o;i=t.formattingValues[a]||t.formattingValues[o]}else{var s=t.defaultWidth,l=n!=null&&n.width?String(n.width):t.defaultWidth;i=t.values[l]||t.values[s]}var c=t.argumentCallback?t.argumentCallback(e):e;return i[c]}}var GWe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},HWe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},qWe={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},XWe={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},QWe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},YWe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},KWe=function(e,n){var r=Number(e),i=r%100;if(i>20||i<10)switch(i%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},ZWe={ordinalNumber:KWe,era:x0({values:GWe,defaultWidth:"wide"}),quarter:x0({values:HWe,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:x0({values:qWe,defaultWidth:"wide"}),day:x0({values:XWe,defaultWidth:"wide"}),dayPeriod:x0({values:QWe,defaultWidth:"wide",formattingValues:YWe,defaultFormattingWidth:"wide"})};const JWe=ZWe;function b0(t){return function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.width,i=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=e.match(i);if(!o)return null;var a=o[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(s)?tVe(s,function(f){return f.test(a)}):eVe(s,function(f){return f.test(a)}),c;c=t.valueCallback?t.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;var u=e.slice(a.length);return{value:c,rest:u}}}function eVe(t,e){for(var n in t)if(t.hasOwnProperty(n)&&e(t[n]))return n}function tVe(t,e){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{},r=e.match(t.matchPattern);if(!r)return null;var i=r[0],o=e.match(t.parsePattern);if(!o)return null;var a=t.valueCallback?t.valueCallback(o[0]):o[0];a=n.valueCallback?n.valueCallback(a):a;var s=e.slice(i.length);return{value:a,rest:s}}}var rVe=/^(\d+)(th|st|nd|rd)?/i,iVe=/\d+/i,oVe={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},aVe={any:[/^b/i,/^(a|c)/i]},sVe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},lVe={any:[/1/i,/2/i,/3/i,/4/i]},cVe={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},uVe={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},fVe={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},dVe={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},hVe={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},pVe={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},mVe={ordinalNumber:nVe({matchPattern:rVe,parsePattern:iVe,valueCallback:function(e){return parseInt(e,10)}}),era:b0({matchPatterns:oVe,defaultMatchWidth:"wide",parsePatterns:aVe,defaultParseWidth:"any"}),quarter:b0({matchPatterns:sVe,defaultMatchWidth:"wide",parsePatterns:lVe,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:b0({matchPatterns:cVe,defaultMatchWidth:"wide",parsePatterns:uVe,defaultParseWidth:"any"}),day:b0({matchPatterns:fVe,defaultMatchWidth:"wide",parsePatterns:dVe,defaultParseWidth:"any"}),dayPeriod:b0({matchPatterns:hVe,defaultMatchWidth:"any",parsePatterns:pVe,defaultParseWidth:"any"})};const gVe=mVe;var u2={code:"en-US",formatDistance:$We,formatLong:zWe,formatRelative:VWe,localize:JWe,match:gVe,options:{weekStartsOn:0,firstWeekContainsDate:1}},vVe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,yVe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,xVe=/^'([^]*?)'?$/,bVe=/''/g,_Ve=/[a-zA-Z]/;function wVe(t,e,n){var r,i,o,a,s,l,c,u,f,d,h,p,m,g,v,y,x,b;tt(2,arguments);var _=String(e),S=pd(),O=(r=(i=n==null?void 0:n.locale)!==null&&i!==void 0?i:S.locale)!==null&&r!==void 0?r:u2,C=On((o=(a=(s=(l=n==null?void 0:n.firstWeekContainsDate)!==null&&l!==void 0?l:n==null||(c=n.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&s!==void 0?s:S.firstWeekContainsDate)!==null&&a!==void 0?a:(f=S.locale)===null||f===void 0||(d=f.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&o!==void 0?o:1);if(!(C>=1&&C<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var E=On((h=(p=(m=(g=n==null?void 0:n.weekStartsOn)!==null&&g!==void 0?g:n==null||(v=n.locale)===null||v===void 0||(y=v.options)===null||y===void 0?void 0:y.weekStartsOn)!==null&&m!==void 0?m:S.weekStartsOn)!==null&&p!==void 0?p:(x=S.locale)===null||x===void 0||(b=x.options)===null||b===void 0?void 0:b.weekStartsOn)!==null&&h!==void 0?h:0);if(!(E>=0&&E<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!O.localize)throw new RangeError("locale must contain localize property");if(!O.formatLong)throw new RangeError("locale must contain formatLong property");var k=nt(t);if(!gae(k))throw new RangeError("Invalid time value");var I=HT(k),P=xae(k,I),R={firstWeekContainsDate:C,weekStartsOn:E,locale:O,_originalDate:k},T=_.match(yVe).map(function(L){var z=L[0];if(z==="p"||z==="P"){var B=g$[z];return B(L,O.formatLong)}return L}).join("").match(vVe).map(function(L){if(L==="''")return"'";var z=L[0];if(z==="'")return SVe(L);var B=kWe[z];if(B)return!(n!=null&&n.useAdditionalWeekYearTokens)&&Cae(L)&&qT(L,e,String(t)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&Oae(L)&&qT(L,e,String(t)),B(P,L,O.localize,R);if(z.match(_Ve))throw new RangeError("Format string contains an unescaped latin alphabet character `"+z+"`");return L}).join("");return T}function SVe(t){var e=t.match(xVe);return e?e[1].replace(bVe,"'"):t}function OVe(t,e){if(t==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}function CVe(t,e){var n,r;tt(1,arguments);var i=nt(t);if(isNaN(i.getTime()))throw new RangeError("Invalid time value");var o=String((n=e==null?void 0:e.format)!==null&&n!==void 0?n:"extended"),a=String((r=e==null?void 0:e.representation)!==null&&r!==void 0?r:"complete");if(o!=="extended"&&o!=="basic")throw new RangeError("format must be 'extended' or 'basic'");if(a!=="date"&&a!=="time"&&a!=="complete")throw new RangeError("representation must be 'date', 'time', or 'complete'");var s="",l="",c=o==="extended"?"-":"",u=o==="extended"?":":"";if(a!=="time"){var f=Gt(i.getDate(),2),d=Gt(i.getMonth()+1,2),h=Gt(i.getFullYear(),4);s="".concat(h).concat(c).concat(d).concat(c).concat(f)}if(a!=="date"){var p=i.getTimezoneOffset();if(p!==0){var m=Math.abs(p),g=Gt(Math.floor(m/60),2),v=Gt(m%60,2),y=p<0?"+":"-";l="".concat(y).concat(g,":").concat(v)}else l="Z";var x=Gt(i.getHours(),2),b=Gt(i.getMinutes(),2),_=Gt(i.getSeconds(),2),S=s===""?"":"T",O=[x,b,_].join(u);s="".concat(s).concat(S).concat(O).concat(l)}return s}function TVe(t){tt(1,arguments);var e=nt(t),n=e.getDate();return n}function EVe(t){tt(1,arguments);var e=nt(t),n=e.getDay();return n}function Tae(t){tt(1,arguments);var e=nt(t),n=e.getFullYear(),r=e.getMonth(),i=new Date(0);return i.setFullYear(n,r+1,0),i.setHours(0,0,0,0),i.getDate()}function PVe(t){tt(1,arguments);var e=nt(t),n=e.getHours();return n}function MVe(t){tt(1,arguments);var e=nt(t),n=e.getMinutes();return n}function kVe(t){tt(1,arguments);var e=nt(t),n=e.getMonth();return n}function AVe(t){tt(1,arguments);var e=nt(t),n=e.getSeconds();return n}function RVe(t){return tt(1,arguments),nt(t).getFullYear()}function TS(t,e){tt(2,arguments);var n=nt(t),r=nt(e);return n.getTime()>r.getTime()}function em(t,e){tt(2,arguments);var n=nt(t),r=nt(e);return n.getTime()t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(c){throw c},f:i}}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 o=!0,a=!1,s;return{s:function(){n=n.call(t)},n:function(){var c=n.next();return o=c.done,c},e:function(c){a=!0,s=c},f:function(){try{!o&&n.return!=null&&n.return()}finally{if(a)throw s}}}}function cn(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_T(t,e)}function XT(t){return XT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},XT(t)}function Pae(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Pae=function(){return!!t})()}function DVe(t,e){if(e&&(au(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return lt(t)}function un(t){var e=Pae();return function(){var r=XT(t),i;if(e){var o=XT(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return DVe(this,i)}}function tn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function tH(t,e){for(var n=0;n0,r=n?e:1-e,i;if(r<=50)i=t||100;else{var o=r+50,a=Math.floor(o/100)*100,s=t>=o%100;i=t+a-(s?100:0)}return n?i:1-i}function Rae(t){return t%400===0||t%4===0&&t%100!==0}var jVe=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a0}},{key:"set",value:function(i,o,a){var s=i.getUTCFullYear();if(a.isTwoDigitYear){var l=Aae(a.year,s);return i.setUTCFullYear(l,0,1),i.setUTCHours(0,0,0,0),i}var c=!("era"in o)||o.era===1?a.year:1-a.year;return i.setUTCFullYear(c,0,1),i.setUTCHours(0,0,0,0),i}}]),n}(bn),BVe=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a0}},{key:"set",value:function(i,o,a,s){var l=OB(i,s);if(a.isTwoDigitYear){var c=Aae(a.year,l);return i.setUTCFullYear(c,0,s.firstWeekContainsDate),i.setUTCHours(0,0,0,0),Jh(i,s)}var u=!("era"in o)||o.era===1?a.year:1-a.year;return i.setUTCFullYear(u,0,s.firstWeekContainsDate),i.setUTCHours(0,0,0,0),Jh(i,s)}}]),n}(bn),zVe=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a=1&&o<=4}},{key:"set",value:function(i,o,a){return i.setUTCMonth((a-1)*3,1),i.setUTCHours(0,0,0,0),i}}]),n}(bn),VVe=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a=1&&o<=4}},{key:"set",value:function(i,o,a){return i.setUTCMonth((a-1)*3,1),i.setUTCHours(0,0,0,0),i}}]),n}(bn),GVe=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a=0&&o<=11}},{key:"set",value:function(i,o,a){return i.setUTCMonth(a,1),i.setUTCHours(0,0,0,0),i}}]),n}(bn),HVe=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a=0&&o<=11}},{key:"set",value:function(i,o,a){return i.setUTCMonth(a,1),i.setUTCHours(0,0,0,0),i}}]),n}(bn);function qVe(t,e,n){tt(2,arguments);var r=nt(t),i=On(e),o=wae(r,n)-i;return r.setUTCDate(r.getUTCDate()-o*7),r}var XVe=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a=1&&o<=53}},{key:"set",value:function(i,o,a,s){return Jh(qVe(i,a,s),s)}}]),n}(bn);function QVe(t,e){tt(2,arguments);var n=nt(t),r=On(e),i=_ae(n)-r;return n.setUTCDate(n.getUTCDate()-i*7),n}var YVe=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a=1&&o<=53}},{key:"set",value:function(i,o,a){return nv(QVe(i,a))}}]),n}(bn),KVe=[31,28,31,30,31,30,31,31,30,31,30,31],ZVe=[31,29,31,30,31,30,31,31,30,31,30,31],JVe=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a=1&&o<=ZVe[l]:o>=1&&o<=KVe[l]}},{key:"set",value:function(i,o,a){return i.setUTCDate(a),i.setUTCHours(0,0,0,0),i}}]),n}(bn),e8e=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a=1&&o<=366:o>=1&&o<=365}},{key:"set",value:function(i,o,a){return i.setUTCMonth(0,a),i.setUTCHours(0,0,0,0),i}}]),n}(bn);function TB(t,e,n){var r,i,o,a,s,l,c,u;tt(2,arguments);var f=pd(),d=On((r=(i=(o=(a=n==null?void 0:n.weekStartsOn)!==null&&a!==void 0?a:n==null||(s=n.locale)===null||s===void 0||(l=s.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&o!==void 0?o:f.weekStartsOn)!==null&&i!==void 0?i:(c=f.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&r!==void 0?r:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=nt(t),p=On(e),m=h.getUTCDay(),g=p%7,v=(g+7)%7,y=(v=0&&o<=6}},{key:"set",value:function(i,o,a,s){return i=TB(i,a,s),i.setUTCHours(0,0,0,0),i}}]),n}(bn),n8e=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a=0&&o<=6}},{key:"set",value:function(i,o,a,s){return i=TB(i,a,s),i.setUTCHours(0,0,0,0),i}}]),n}(bn),r8e=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a=0&&o<=6}},{key:"set",value:function(i,o,a,s){return i=TB(i,a,s),i.setUTCHours(0,0,0,0),i}}]),n}(bn);function i8e(t,e){tt(2,arguments);var n=On(e);n%7===0&&(n=n-7);var r=1,i=nt(t),o=i.getUTCDay(),a=n%7,s=(a+7)%7,l=(s=1&&o<=7}},{key:"set",value:function(i,o,a){return i=i8e(i,a),i.setUTCHours(0,0,0,0),i}}]),n}(bn),a8e=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a=1&&o<=12}},{key:"set",value:function(i,o,a){var s=i.getUTCHours()>=12;return s&&a<12?i.setUTCHours(a+12,0,0,0):!s&&a===12?i.setUTCHours(0,0,0,0):i.setUTCHours(a,0,0,0),i}}]),n}(bn),u8e=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a=0&&o<=23}},{key:"set",value:function(i,o,a){return i.setUTCHours(a,0,0,0),i}}]),n}(bn),f8e=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a=0&&o<=11}},{key:"set",value:function(i,o,a){var s=i.getUTCHours()>=12;return s&&a<12?i.setUTCHours(a+12,0,0,0):i.setUTCHours(a,0,0,0),i}}]),n}(bn),d8e=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a=1&&o<=24}},{key:"set",value:function(i,o,a){var s=a<=24?a%24:a;return i.setUTCHours(s,0,0,0),i}}]),n}(bn),h8e=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a=0&&o<=59}},{key:"set",value:function(i,o,a){return i.setUTCMinutes(a,0,0),i}}]),n}(bn),p8e=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a=0&&o<=59}},{key:"set",value:function(i,o,a){return i.setUTCSeconds(a,0),i}}]),n}(bn),m8e=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a=1&&k<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var I=On((p=(m=(g=(v=r==null?void 0:r.weekStartsOn)!==null&&v!==void 0?v:r==null||(y=r.locale)===null||y===void 0||(x=y.options)===null||x===void 0?void 0:x.weekStartsOn)!==null&&g!==void 0?g:C.weekStartsOn)!==null&&m!==void 0?m:(b=C.locale)===null||b===void 0||(_=b.options)===null||_===void 0?void 0:_.weekStartsOn)!==null&&p!==void 0?p:0);if(!(I>=0&&I<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(O==="")return S===""?nt(n):new Date(NaN);var P={firstWeekContainsDate:k,weekStartsOn:I,locale:E},R=[new NVe],T=O.match(w8e).map(function(te){var J=te[0];if(J in g$){var pe=g$[J];return pe(te,E.formatLong)}return te}).join("").match(_8e),L=[],z=eH(T),B;try{var W=function(){var J=B.value;!(r!=null&&r.useAdditionalWeekYearTokens)&&Cae(J)&&qT(J,O,t),!(r!=null&&r.useAdditionalDayOfYearTokens)&&Oae(J)&&qT(J,O,t);var pe=J[0],be=b8e[pe];if(be){var re=be.incompatibleTokens;if(Array.isArray(re)){var ve=L.find(function(ce){return re.includes(ce.token)||ce.token===pe});if(ve)throw new RangeError("The format string mustn't contain `".concat(ve.fullToken,"` and `").concat(J,"` at the same time"))}else if(be.incompatibleTokens==="*"&&L.length>0)throw new RangeError("The format string mustn't contain `".concat(J,"` and any other token at the same time"));L.push({token:pe,fullToken:J});var F=be.run(S,J,E.match,P);if(!F)return{v:new Date(NaN)};R.push(F.setter),S=F.rest}else{if(pe.match(T8e))throw new RangeError("Format string contains an unescaped latin alphabet character `"+pe+"`");if(J==="''"?J="'":pe==="'"&&(J=P8e(J)),S.indexOf(J)===0)S=S.slice(J.length);else return{v:new Date(NaN)}}};for(z.s();!(B=z.n()).done;){var U=W();if(au(U)==="object")return U.v}}catch(te){z.e(te)}finally{z.f()}if(S.length>0&&C8e.test(S))return new Date(NaN);var N=R.map(function(te){return te.priority}).sort(function(te,J){return J-te}).filter(function(te,J,pe){return pe.indexOf(te)===J}).map(function(te){return R.filter(function(J){return J.priority===te}).sort(function(J,pe){return pe.subPriority-J.subPriority})}).map(function(te){return te[0]}),$=nt(n);if(isNaN($.getTime()))return new Date(NaN);var D=xae($,HT($)),A={},q=eH(N),Y;try{for(q.s();!(Y=q.n()).done;){var K=Y.value;if(!K.validate(D,P))return new Date(NaN);var se=K.set(D,A,P);Array.isArray(se)?(D=se[0],OVe(A,se[1])):D=se}}catch(te){q.e(te)}finally{q.f()}return D}function P8e(t){return t.match(S8e)[1].replace(O8e,"'")}function nH(t){tt(1,arguments);var e=nt(t);return e.setMinutes(0,0,0),e}function M8e(t,e){tt(2,arguments);var n=nH(t),r=nH(e);return n.getTime()===r.getTime()}function k8e(t,e){tt(2,arguments);var n=nt(t),r=nt(e);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function A8e(t,e){tt(2,arguments);var n=nt(t),r=nt(e);return n.getFullYear()===r.getFullYear()}function R8e(t,e){tt(2,arguments);var n=nt(t).getTime(),r=nt(e.start).getTime(),i=nt(e.end).getTime();if(!(r<=i))throw new RangeError("Invalid interval");return n>=r&&n<=i}function Iae(t,e){var n;tt(1,arguments);var r=On((n=e==null?void 0:e.additionalDigits)!==null&&n!==void 0?n:2);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof t=="string"||Object.prototype.toString.call(t)==="[object String]"))return new Date(NaN);var i=$8e(t),o;if(i.date){var a=N8e(i.date,r);o=F8e(a.restDateString,a.year)}if(!o||isNaN(o.getTime()))return new Date(NaN);var s=o.getTime(),l=0,c;if(i.time&&(l=j8e(i.time),isNaN(l)))return new Date(NaN);if(i.timezone){if(c=B8e(i.timezone),isNaN(c))return new Date(NaN)}else{var u=new Date(s+l),f=new Date(0);return f.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),f.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),f}return new Date(s+l+c)}var ES={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},I8e=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,D8e=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,L8e=/^([+-])(\d{2})(?::?(\d{2}))?$/;function $8e(t){var e={},n=t.split(ES.dateTimeDelimiter),r;if(n.length>2)return e;if(/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],ES.timeZoneDelimiter.test(e.date)&&(e.date=t.split(ES.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length))),r){var i=ES.timezone.exec(r);i?(e.time=r.replace(i[1],""),e.timezone=i[1]):e.time=r}return e}function N8e(t,e){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=t.match(n);if(!r)return{year:NaN,restDateString:""};var i=r[1]?parseInt(r[1]):null,o=r[2]?parseInt(r[2]):null;return{year:o===null?i:o*100,restDateString:t.slice((r[1]||r[2]).length)}}function F8e(t,e){if(e===null)return new Date(NaN);var n=t.match(I8e);if(!n)return new Date(NaN);var r=!!n[4],i=_0(n[1]),o=_0(n[2])-1,a=_0(n[3]),s=_0(n[4]),l=_0(n[5])-1;if(r)return G8e(e,s,l)?z8e(e,s,l):new Date(NaN);var c=new Date(0);return!W8e(e,o,a)||!V8e(e,i)?new Date(NaN):(c.setUTCFullYear(e,o,Math.max(i,a)),c)}function _0(t){return t?parseInt(t):1}function j8e(t){var e=t.match(D8e);if(!e)return NaN;var n=qA(e[1]),r=qA(e[2]),i=qA(e[3]);return H8e(n,r,i)?n*l2+r*s2+i*1e3:NaN}function qA(t){return t&&parseFloat(t.replace(",","."))||0}function B8e(t){if(t==="Z")return 0;var e=t.match(L8e);if(!e)return 0;var n=e[1]==="+"?-1:1,r=parseInt(e[2]),i=e[3]&&parseInt(e[3])||0;return q8e(r,i)?n*(r*l2+i*s2):NaN}function z8e(t,e,n){var r=new Date(0);r.setUTCFullYear(t,0,4);var i=r.getUTCDay()||7,o=(e-1)*7+n+1-i;return r.setUTCDate(r.getUTCDate()+o),r}var U8e=[31,null,31,30,31,30,31,31,30,31,30,31];function Dae(t){return t%400===0||t%4===0&&t%100!==0}function W8e(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(U8e[e]||(Dae(t)?29:28))}function V8e(t,e){return e>=1&&e<=(Dae(t)?366:365)}function G8e(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}function H8e(t,e,n){return t===24?e===0&&n===0:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}function q8e(t,e){return e>=0&&e<=59}function X8e(t,e){tt(2,arguments);var n=nt(t),r=On(e),i=n.getFullYear(),o=n.getDate(),a=new Date(0);a.setFullYear(i,r,15),a.setHours(0,0,0,0);var s=Tae(a);return n.setMonth(r,Math.min(o,s)),n}function Q8e(t,e){tt(2,arguments);var n=nt(t),r=On(e);return n.setDate(r),n}function Y8e(t,e){tt(2,arguments);var n=nt(t),r=On(e);return n.setHours(r),n}function K8e(t,e){tt(2,arguments);var n=nt(t),r=On(e);return n.setMinutes(r),n}function Z8e(t,e){tt(2,arguments);var n=nt(t),r=On(e);return n.setSeconds(r),n}function J8e(t,e){tt(2,arguments);var n=nt(t),r=On(e);return isNaN(n.getTime())?new Date(NaN):(n.setFullYear(r),n)}function Lae(t){return t.getTimezoneOffset()*6e4}function eGe(t){return t.getTime()-Lae(t)}function XA(t){const e=new Date(t);return new Date(e.getTime()+Lae(e))}function Gb(t){return new Date(t).toISOString().substring(0,10)}function dy(t){return $ae(new Date(t).toISOString())}function $ae(t){return t.substring(0,19).replace("T"," ")}const Nae={seconds:1e3,minutes:1e3*60,hours:1e3*60*60,days:1e3*60*60*24,weeks:1e3*60*60*24*7,years:1e3*60*60*24*365};function tGe(t,e){return t===e?!0:t!==null&&e!=null?t[0]===e[0]&&t[1]===e[1]:!1}function nGe(t,e){const n=new Set,r=new Set,i={};for(const l of t)for(const c of l.timeSeriesArray){const{placeId:u,datasetId:f,variableName:d,valueDataKey:h,errorDataKey:p}=c.source;u!==null&&r.add(u);const m=`${f}.${d}.${h}`;n.add(m);let g=null;p&&(g=`${f}.${d}.${p}`,n.add(g)),c.data.forEach(v=>{const y=dy(v.time),x=`${u!==null?u:f}-${y}`,b=i[x];b?i[x]={...b,[m]:v[h]}:i[x]={placeId:u,time:y,[m]:v[h]},g!==null&&(i[x][g]=v[p])})}const o=["placeId","time"].concat(Array.from(n).sort()),a=[];Object.keys(i).forEach(l=>{const c=i[l],u=new Array(o.length);o.forEach((f,d)=>{u[d]=c[f]}),a.push(u)}),a.sort((l,c)=>{const u=l[1],f=c[1],d=u.localeCompare(f);if(d!==0)return d;const h=l[0],p=c[0];return h.localeCompare(p)});const s={};return r.forEach(l=>{s[l]=sB(e,l)}),{colNames:o,dataRows:a,referencedPlaces:s}}function rGe(t){let e=null;const n=t.features||[];for(const r of n){if(!r.properties)continue;const i=r.properties.time;if(typeof i!="string")continue;const a=Iae(i).getTime();if(!Number.isNaN(a))for(const s of Object.getOwnPropertyNames(r.properties)){let l=r.properties[s];const c=typeof l;if(c==="boolean"?l=l?1:0:c!=="number"&&(l=Number.NaN),Number.isNaN(l))continue;const u={time:a,countTot:1,mean:l};e===null&&(e={});const f=e[s];f?f.data.push(u):e[s]={source:{datasetId:t.id,datasetTitle:t.title,variableName:s,placeId:null,geometry:null,valueDataKey:"mean",errorDataKey:null},data:[u],dataProgress:1}}}return e===null?null:{placeGroup:t,timeSeries:e}}const q1=t=>t.dataState.datasets||[],iGe=t=>t.dataState.colorBars,Fae=t=>t.dataState.timeSeriesGroups,X1=t=>t.dataState.userPlaceGroups,jae=t=>t.dataState.userServers||[],oGe=t=>t.dataState.expressionCapabilities,aGe=t=>t.dataState.statistics.loading,sGe=t=>t.dataState.statistics.records,Bae=at(q1,X1,(t,e)=>{const n={},r=[];return t.forEach(i=>{i.placeGroups&&i.placeGroups.forEach(o=>{n[o.id]||(n[o.id]=o,r.push(o))})}),[...r,...e]}),lGe=at(Bae,t=>{const e=[];return t.forEach(n=>{const r=rGe(n);r!==null&&e.push(r)}),e}),cGe=[{name:"OpenStreetMap",link:"https://openstreetmap.org",datasets:[{name:"OSM Mapnik",endpoint:"https://a.tile.osm.org/{z}/{x}/{y}.png"},{name:"OSM Humanitarian",endpoint:"https://a.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png"},{name:"OSM Landscape",endpoint:"https://a.tile3.opencyclemap.org/landscape/{z}/{x}/{y}.png"}],overlays:[]},{name:"ESRI",link:"https://services.arcgisonline.com/arcgis/rest/services",datasets:[{name:"Dark Gray Base",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Canvas/World_Dark_Gray_Base/MapServer/tile/{z}/{y}/{x}"},{name:"Light Gray Base",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}"},{name:"World Hillshade",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer/tile/{z}/{y}/{x}"},{name:"World Ocean Base",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer/tile/{z}/{y}/{x}"},{name:"DeLorme World Base Map",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Specialty/DeLorme_World_Base_Map/MapServer/tile/{z}/{y}/{x}"},{name:"World Street Map",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}"},{name:"World Navigation Charts",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Specialty/World_Navigation_Charts/MapServer/tile/{z}/{y}/{x}"},{name:"National Geographic",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}"},{name:"World Imagery",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"},{name:"World Physical Map",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/World_Physical_Map/MapServer/tile/{z}/{y}/{x}"},{name:"World Shaded Relief",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/World_Shaded_Relief/MapServer/tile/{z}/{y}/{x}"},{name:"World Terrain",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/World_Terrain_Base/MapServer/tile/{z}/{y}/{x}"},{name:"World Topo Map",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}"}],overlays:[{name:"Dark Gray Reference",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Canvas/World_Dark_Gray_Reference/MapServer/tile/{z}/{y}/{x}"},{name:"Light Gray Reference",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Canvas/World_Light_Gray_Reference/MapServer/tile/{z}/{y}/{x}"},{name:"World Ocean Reference",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer/tile/{z}/{y}/{x}"},{name:"World Boundaries & Places",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Reference/World_Boundaries_and_Places/MapServer/tile/{z}/{y}/{x}"},{name:"World Reference Overlay",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Reference/World_Reference_Overlay/MapServer/tile/{z}/{y}/{x}"},{name:"World Transportation",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Reference/World_Transportation/MapServer/tile/{z}/{y}/{x}"}]},{name:"CartoDB",link:"https://cartodb.com/basemaps/",datasets:[{name:"Positron",endpoint:"https://a.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png"},{name:"Dark Matter",endpoint:"https://a.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png"},{name:"Positron (No Labels)",endpoint:"https://a.basemaps.cartocdn.com/light_nolabels/{z}/{x}/{y}.png"},{name:"Dark Matter (No Labels)",endpoint:"https://a.basemaps.cartocdn.com/dark_nolabels/{z}/{x}/{y}.png"}],overlays:[{name:"Positron Labels",endpoint:"https://a.basemaps.cartocdn.com/light_only_labels/{z}/{x}/{y}.png"},{name:"Dark Matter Labels",endpoint:"https://a.basemaps.cartocdn.com/dark_only_labels/{z}/{x}/{y}.png"}]},{name:"Stamen",link:"https://maps.stamen.com",datasets:[{name:"Toner",endpoint:"https://tile.stamen.com/toner/{z}/{x}/{y}.png",attribution:'Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL.'},{name:"Terrain",endpoint:"https://tile.stamen.com/terrain/{z}/{x}/{y}.png"},{name:"Watercolor",endpoint:"https://tile.stamen.com/watercolor/{z}/{x}/{y}.png"}],overlays:[]},{name:"Mapbox",link:"https://a.tiles.mapbox.com/v3/mapbox/maps.html",datasets:[{name:"Blue Marble (January)",endpoint:"https://a.tiles.mapbox.com/v3/mapbox.blue-marble-topo-bathy-jan/{z}/{x}/{y}.png"},{name:"Blue Marble (July)",endpoint:"https://a.tiles.mapbox.com/v3/mapbox.blue-marble-topo-bathy-jul/{z}/{x}/{y}.png"},{name:"Blue Marble Topo & Bathy B/W (July)",endpoint:"https://a.tiles.mapbox.com/v3/mapbox.blue-marble-topo-bathy-jul-bw/{z}/{x}/{y}.png"},{name:"Control Room",endpoint:"https://a.tiles.mapbox.com/v3/mapbox.control-room/{z}/{x}/{y}.png"},{name:"Geography Class",endpoint:"https://a.tiles.mapbox.com/v3/mapbox.geography-class/{z}/{x}/{y}.png"},{name:"World Dark",endpoint:"https://a.tiles.mapbox.com/v3/mapbox.world-dark/{z}/{x}/{y}.png"},{name:"World Light",endpoint:"https:a.tiles.mapbox.com/v3/mapbox.world-light/{z}/{x}/{y}.png"},{name:"World Glass",endpoint:"https:a.tiles.mapbox.com/v3/mapbox.world-glass/{z}/{x}/{y}.png"},{name:"World Print",endpoint:"https:a.tiles.mapbox.com/v3/mapbox.world-print/{z}/{x}/{y}.png"},{name:"World Blue",endpoint:"https:a.tiles.mapbox.com/v3/mapbox.world-blue/{z}/{x}/{y}.png"}],overlays:[]}],uGe=cGe,EB="User";function YT(t){return t?`${t.group}: ${t.title}`:"-"}function KT(t,e){return t.find(n=>n.id===e)||null}function zae(t="datasets"){const e=[];return uGe.forEach(n=>{n[t].forEach(r=>{e.push({id:`${n.name}-${r.name}`,group:n.name,attribution:n.link,title:r.name,url:r.endpoint})})}),e}const Uae=zae("datasets"),fGe=zae("overlays"),dGe=Uae[0].id;var hGe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),pGe=function(t){hGe(e,t);function e(){return t.call(this)||this}return e.prototype.getType=function(){return"text"},e.prototype.readFeature=function(n,r){return this.readFeatureFromText(PS(n),this.adaptOptions(r))},e.prototype.readFeatureFromText=function(n,r){return vt()},e.prototype.readFeatures=function(n,r){return this.readFeaturesFromText(PS(n),this.adaptOptions(r))},e.prototype.readFeaturesFromText=function(n,r){return vt()},e.prototype.readGeometry=function(n,r){return this.readGeometryFromText(PS(n),this.adaptOptions(r))},e.prototype.readGeometryFromText=function(n,r){return vt()},e.prototype.readProjection=function(n){return this.readProjectionFromText(PS(n))},e.prototype.readProjectionFromText=function(n){return this.dataProjection},e.prototype.writeFeature=function(n,r){return this.writeFeatureText(n,this.adaptOptions(r))},e.prototype.writeFeatureText=function(n,r){return vt()},e.prototype.writeFeatures=function(n,r){return this.writeFeaturesText(n,this.adaptOptions(r))},e.prototype.writeFeaturesText=function(n,r){return vt()},e.prototype.writeGeometry=function(n,r){return this.writeGeometryText(n,this.adaptOptions(r))},e.prototype.writeGeometryText=function(n,r){return vt()},e}(Qie);function PS(t){return typeof t=="string"?t:""}const mGe=pGe;var gGe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),vGe={POINT:Vl,LINESTRING:Lh,POLYGON:Jg,MULTIPOINT:KM,MULTILINESTRING:eB,MULTIPOLYGON:nB},Wae="EMPTY",Vae="Z",Gae="M",yGe="ZM",mn={START:0,TEXT:1,LEFT_PAREN:2,RIGHT_PAREN:3,NUMBER:4,COMMA:5,EOF:6},xGe={Point:"POINT",LineString:"LINESTRING",Polygon:"POLYGON",MultiPoint:"MULTIPOINT",MultiLineString:"MULTILINESTRING",MultiPolygon:"MULTIPOLYGON",GeometryCollection:"GEOMETRYCOLLECTION",Circle:"CIRCLE"},bGe=function(){function t(e){this.wkt=e,this.index_=-1}return t.prototype.isAlpha_=function(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"},t.prototype.isNumeric_=function(e,n){var r=n!==void 0?n:!1;return e>="0"&&e<="9"||e=="."&&!r},t.prototype.isWhiteSpace_=function(e){return e==" "||e==" "||e=="\r"||e==` +`},t.prototype.nextChar_=function(){return this.wkt.charAt(++this.index_)},t.prototype.nextToken=function(){var e=this.nextChar_(),n=this.index_,r=e,i;if(e=="(")i=mn.LEFT_PAREN;else if(e==",")i=mn.COMMA;else if(e==")")i=mn.RIGHT_PAREN;else if(this.isNumeric_(e)||e=="-")i=mn.NUMBER,r=this.readNumber_();else if(this.isAlpha_(e))i=mn.TEXT,r=this.readText_();else{if(this.isWhiteSpace_(e))return this.nextToken();if(e==="")i=mn.EOF;else throw new Error("Unexpected character: "+e)}return{position:n,value:r,type:i}},t.prototype.readNumber_=function(){var e,n=this.index_,r=!1,i=!1;do e=="."?r=!0:(e=="e"||e=="E")&&(i=!0),e=this.nextChar_();while(this.isNumeric_(e,r)||!i&&(e=="e"||e=="E")||i&&(e=="-"||e=="+"));return parseFloat(this.wkt.substring(n,this.index_--))},t.prototype.readText_=function(){var e,n=this.index_;do e=this.nextChar_();while(this.isAlpha_(e));return this.wkt.substring(n,this.index_--).toUpperCase()},t}(),_Ge=function(){function t(e){this.lexer_=e,this.token_={position:0,type:mn.START},this.layout_=dn.XY}return t.prototype.consume_=function(){this.token_=this.lexer_.nextToken()},t.prototype.isTokenType=function(e){return this.token_.type==e},t.prototype.match=function(e){var n=this.isTokenType(e);return n&&this.consume_(),n},t.prototype.parse=function(){return this.consume_(),this.parseGeometry_()},t.prototype.parseGeometryLayout_=function(){var e=dn.XY,n=this.token_;if(this.isTokenType(mn.TEXT)){var r=n.value;r===Vae?e=dn.XYZ:r===Gae?e=dn.XYM:r===yGe&&(e=dn.XYZM),e!==dn.XY&&this.consume_()}return e},t.prototype.parseGeometryCollectionText_=function(){if(this.match(mn.LEFT_PAREN)){var e=[];do e.push(this.parseGeometry_());while(this.match(mn.COMMA));if(this.match(mn.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())},t.prototype.parsePointText_=function(){if(this.match(mn.LEFT_PAREN)){var e=this.parsePoint_();if(this.match(mn.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())},t.prototype.parseLineStringText_=function(){if(this.match(mn.LEFT_PAREN)){var e=this.parsePointList_();if(this.match(mn.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())},t.prototype.parsePolygonText_=function(){if(this.match(mn.LEFT_PAREN)){var e=this.parseLineStringTextList_();if(this.match(mn.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())},t.prototype.parseMultiPointText_=function(){if(this.match(mn.LEFT_PAREN)){var e=void 0;if(this.token_.type==mn.LEFT_PAREN?e=this.parsePointTextList_():e=this.parsePointList_(),this.match(mn.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())},t.prototype.parseMultiLineStringText_=function(){if(this.match(mn.LEFT_PAREN)){var e=this.parseLineStringTextList_();if(this.match(mn.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())},t.prototype.parseMultiPolygonText_=function(){if(this.match(mn.LEFT_PAREN)){var e=this.parsePolygonTextList_();if(this.match(mn.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())},t.prototype.parsePoint_=function(){for(var e=[],n=this.layout_.length,r=0;r0&&(i+=" "+o)}return r.length===0?i+" "+Wae:i+"("+r+")"}class PGe extends Error{}const Yae={separator:",",comment:"#",quote:'"',escape:"\\",trim:!0,nanToken:"NaN",trueToken:"true",falseToken:"false"};function Kae(t,e){return new MGe(e).parse(t)}let MGe=class{constructor(e){Yt(this,"options");this.options={...Yae,...e},this.parseLine=this.parseLine.bind(this)}parse(e){return this.parseText(e).map(this.parseLine)}parseText(e){const{comment:n,trim:r}=this.options;return e.split(` +`).map((i,o)=>(r&&(i=i.trim()),[i,o])).filter(([i,o])=>i.trim()!==""&&!i.startsWith(n))}parseLine([e,n]){const{separator:r,quote:i,escape:o}=this.options;let a=!1;const s=[];let l=0,c=0;for(;ct.toLowerCase());function rH(t){if(t=t.trim(),t==="")return"csv";if(t[0]==="{")return"geojson";const e=t.substring(0,20).toLowerCase();return RGe.find(r=>e.startsWith(r)&&(e.length===r.length||` + (`.indexOf(e[r.length])>=0))?"wkt":"csv"}function EC(t){return t.split(",").map(e=>e.trim().toLowerCase()).filter(e=>e!=="")}const IGe=t=>{if(t.trim()!=="")try{Kae(t)}catch(e){return console.error(e),`${e}`}return null},Zae={name:"Text/CSV",fileExt:".txt,.csv",checkError:IGe},y$={...Yae,xNames:"longitude, lon, x",yNames:"latitude, lat, y",forceGeometry:!1,geometryNames:"geometry, geom",timeNames:"time, date, datetime, date-time",groupNames:"group, cruise, station, type",groupPrefix:"Group-",labelNames:"label, name, title, id",labelPrefix:"Place-"};let DGe=0,LGe=0;function $Ge(t,e){const n=Kae(t,e);if(n.length<2)throw new Error(fe.get("Missing header line in CSV"));for(const S of n[0])if(typeof S!="string"||S==="")throw new Error(fe.get("Invalid header line in CSV"));const r=n[0].map(S=>S),i=r.map(S=>S.toLowerCase()),o=r.length;for(const S of n)if(S.length!==o)throw new Error(fe.get("All rows must have same length"));const a=NGe(i),s=tm(a,e.groupNames),l=tm(a,e.labelNames),c=tm(a,e.timeNames),u=tm(a,e.xNames),f=tm(a,e.yNames);let d=tm(a,e.geometryNames);if(e.forceGeometry||u<0||f<0||u===f){if(d<0)throw new Error(fe.get("No geometry column(s) found"))}else d=-1;let p=e.groupPrefix.trim();p===""&&(p=y$.groupPrefix);let m=e.labelPrefix.trim();m===""&&(m=y$.labelPrefix);let g="";if(s===-1){const S=++DGe;g=`${p}${S}`}const v=new Hae,y={};let x=1,b=0,_=Xh(0);for(;x=0&&(O=`${S[c]}`),s>=0&&(g=`${S[s]}`);let C=y[g];C||(C=iB(g,[]),y[g]=C,_=Xh(b),b++);let E=null;if(d>=0){if(typeof S[d]=="string")try{E=v.readGeometry(t)}catch{}}else{const P=S[u],R=S[f];typeof P=="number"&&Number.isFinite(P)&&typeof R=="number"&&Number.isFinite(R)&&(E=new Vl([P,R]))}if(E===null)throw new Error(fe.get(`Invalid geometry in data row ${x}`));const k={};S.forEach((P,R)=>{if(R!==u&&R!==f&&R!==d){const T=r[R];k[T]=P}});let I;if(l>=0)I=`${S[l]}`;else{const P=++LGe;I=`${m}${P}`}O!==""&&(k.time=O),k.color||(k.color=_),k.label||(k.label=I),k.source||(k.source="CSV"),C.features.push(oB(E,k))}return Object.getOwnPropertyNames(y).map(S=>y[S])}function NGe(t){const e={};for(let n=0;n{if(t.trim()!=="")try{JSON.parse(t)}catch(e){return console.error(e),`${e}`}return null},Jae={name:"GeoJSON",fileExt:".json,.geojson",checkError:FGe},x$={groupNames:"group, cruise, station, type",groupPrefix:"Group-",labelNames:"label, name, title, id",labelPrefix:"Place-",timeNames:"time, date, datetime, date-time"};let jGe=0,BGe=0;function zGe(t,e){const n=EC(e.groupNames||"");let r=e.groupPrefix.trim();r===""&&(r=x$.groupPrefix);const i=EC(e.labelNames||"");let o=e.labelPrefix.trim();o===""&&(o=x$.labelPrefix);const a=EC(e.timeNames||""),s=new Tp;let l;try{l=s.readFeatures(t)}catch{try{const d=s.readGeometry(t);l=[new Fc(d)]}catch{throw new Error(fe.get("Invalid GeoJSON"))}}const c={};let u=0;return l.forEach(f=>{const d=f.getProperties(),h=f.getGeometry();if(h){let p="",m="",g="",v=Xh(0);if(d){const b={};Object.getOwnPropertyNames(d).forEach(_=>{b[_.toLowerCase()]=d[_]}),p=QA(b,a,p),g=QA(b,i,g),m=QA(b,n,m)}if(m===""){const b=++jGe;m=`${r}-${b}`}if(g===""){const b=++BGe;g=`${o}-${b}`}let y=c[m];y||(y=iB(m,[]),c[m]=y,v=Xh(u),u++);const x={...d};p!==""&&(x.time=p),x.color||(x.color=v),x.label||(x.label=g),x.source||(x.source="GeoJSON"),y.features.push(oB(h,x))}}),Object.getOwnPropertyNames(c).map(f=>c[f])}function QA(t,e,n){if(n===""){for(const r of e)if(t[r]==="string")return t[r]}return n}const UGe=t=>null,ese={name:"WKT",fileExt:".txt,.wkt",checkError:UGe},b$={group:"",groupPrefix:"Group-",label:"",labelPrefix:"Place-",time:dy(new Date().getTime())};let WGe=0,VGe=0;function GGe(t,e){let n=e.groupPrefix.trim();n===""&&(n=b$.groupPrefix);let r=e.group.trim();if(r===""){const s=++WGe;r=`${n}${s}`}let i=e.labelPrefix.trim();i===""&&(i=b$.labelPrefix);let o=e.label.trim();if(o===""){const s=++VGe;o=`${i}${s}`}const a=e.time.trim();try{const s=new Hae().readGeometry(t);let l={color:Xh(Math.floor(1e3*Math.random())),label:o,source:"WKT"};a!==""&&(l={time:a,...l});const c=[oB(s,l)];return[iB(r,c)]}catch{throw new Error(fe.get("Invalid Geometry WKT"))}}function hy(t){return HGe("localStorage",t)}function HGe(t,e){try{const n=window[t],r="__storage_test__";return n.setItem(r,r),n.removeItem(r),new qGe(n,e)}catch{return null}}class qGe{constructor(e,n){Yt(this,"nativeStorage");Yt(this,"brandingName");this.nativeStorage=e,this.brandingName=n}getItem(e,n,r,i){const o=this.nativeStorage.getItem(this.makeKey(e));if(o!==null)try{const a=r?r(o):o;return i?i(a):a}catch(a){console.error(`Failed parsing user setting "${e}": ${a}`)}return typeof n>"u"?null:n}getObjectItem(e,n){return this.getItem(e,n,r=>JSON.parse(r))}getBooleanProperty(e,n,r){this.getProperty(e,n,r,i=>i==="true")}getIntProperty(e,n,r){this.getProperty(e,n,r,parseInt)}getStringProperty(e,n,r){this.getProperty(e,n,r,i=>i)}getArrayProperty(e,n,r,i){this.getProperty(e,n,r,o=>{const a=JSON.parse(o);if(Array.isArray(a))return a;const s=r[e];return Array.isArray(s)?s:[]},i)}getObjectProperty(e,n,r){this.getProperty(e,n,r,i=>{const o=JSON.parse(i),a=r[e],s={...a,...o};return Object.getOwnPropertyNames(o).forEach(l=>{const c=a[l],u=o[l];U8(c)&&U8(u)&&(s[l]={...c,...u})}),s})}getProperty(e,n,r,i,o){n[e]=this.getItem(e,r[e],i,o)}setItem(e,n,r){if(typeof n>"u"||n===null)this.nativeStorage.removeItem(this.makeKey(e));else{const i=r?r(n):n+"";this.nativeStorage.setItem(this.makeKey(e),i)}}setObjectItem(e,n){this.setItem(e,n,r=>JSON.stringify(r))}setPrimitiveProperty(e,n){this.setItem(e,n[e])}setArrayProperty(e,n){this.setObjectItem(e,n[e])}setObjectProperty(e,n){this.setObjectItem(e,n[e])}makeKey(e){return`xcube.${this.brandingName}.${e}`}}function XGe(t){const e=hy(Kt.instance.name);if(e)try{e.setObjectItem("userServers",t)}catch(n){console.warn(`failed to store user servers: ${n}`)}}function QGe(){const t=hy(Kt.instance.name);if(t)try{return t.getObjectItem("userServers",[])}catch(e){console.warn(`failed to load user servers: ${e}`)}return[]}function YGe(t){const e=hy(Kt.instance.name);if(e)try{e.setObjectItem("userVariables",t)}catch(n){console.warn(`failed to store user variables: ${n}`)}}function KGe(){const t=hy(Kt.instance.name);if(t)try{return t.getObjectItem("userVariables",{})}catch(e){console.warn(`failed to load user variables: ${e}`)}return{}}function ol(t){const e=hy(Kt.instance.name);if(e)try{e.setPrimitiveProperty("locale",t),e.setPrimitiveProperty("privacyNoticeAccepted",t),e.setPrimitiveProperty("autoShowTimeSeries",t),e.setPrimitiveProperty("timeSeriesIncludeStdev",t),e.setPrimitiveProperty("timeSeriesChartTypeDefault",t),e.setPrimitiveProperty("timeSeriesUseMedian",t),e.setPrimitiveProperty("timeAnimationInterval",t),e.setPrimitiveProperty("timeChunkSize",t),e.setPrimitiveProperty("sidebarOpen",t),e.setPrimitiveProperty("sidebarPanelId",t),e.setPrimitiveProperty("volumeRenderMode",t),e.setObjectProperty("infoCardElementStates",t),e.setPrimitiveProperty("imageSmoothingEnabled",t),e.setPrimitiveProperty("mapProjection",t),e.setPrimitiveProperty("selectedBaseMapId",t),e.setPrimitiveProperty("selectedOverlayId",t),e.setArrayProperty("userBaseMaps",t),e.setArrayProperty("userOverlays",t),e.setArrayProperty("userColorBars",t),e.setPrimitiveProperty("userDrawnPlaceGroupName",t),e.setPrimitiveProperty("datasetLocateMode",t),e.setPrimitiveProperty("placeLocateMode",t),e.setPrimitiveProperty("exportTimeSeries",t),e.setPrimitiveProperty("exportTimeSeriesSeparator",t),e.setPrimitiveProperty("exportPlaces",t),e.setPrimitiveProperty("exportPlacesAsCollection",t),e.setPrimitiveProperty("exportZipArchive",t),e.setPrimitiveProperty("exportFileName",t),e.setPrimitiveProperty("userPlacesFormatName",t),e.setObjectProperty("userPlacesFormatOptions",t)}catch(n){console.warn(`failed to store user settings: ${n}`)}}function ZGe(t){const e=hy(Kt.instance.name);if(e){const n={...t};try{e.getStringProperty("locale",n,t),e.getBooleanProperty("privacyNoticeAccepted",n,t),e.getBooleanProperty("autoShowTimeSeries",n,t),e.getBooleanProperty("timeSeriesIncludeStdev",n,t),e.getStringProperty("timeSeriesChartTypeDefault",n,t),e.getBooleanProperty("timeSeriesUseMedian",n,t),e.getIntProperty("timeAnimationInterval",n,t),e.getIntProperty("timeChunkSize",n,t),e.getBooleanProperty("sidebarOpen",n,t),e.getStringProperty("sidebarPanelId",n,t),e.getStringProperty("volumeRenderMode",n,t),e.getObjectProperty("infoCardElementStates",n,t),e.getBooleanProperty("imageSmoothingEnabled",n,t),e.getStringProperty("mapProjection",n,t),e.getStringProperty("selectedBaseMapId",n,t),e.getStringProperty("selectedOverlayId",n,t),e.getArrayProperty("userBaseMaps",n,t),e.getArrayProperty("userOverlays",n,t),e.getArrayProperty("userColorBars",n,t,JGe),e.getStringProperty("userDrawnPlaceGroupName",n,t),e.getStringProperty("datasetLocateMode",n,t),e.getStringProperty("placeLocateMode",n,t),e.getBooleanProperty("exportTimeSeries",n,t),e.getStringProperty("exportTimeSeriesSeparator",n,t),e.getBooleanProperty("exportPlaces",n,t),e.getBooleanProperty("exportPlacesAsCollection",n,t),e.getBooleanProperty("exportZipArchive",n,t),e.getStringProperty("exportFileName",n,t),e.getStringProperty("userPlacesFormatName",n,t),e.getObjectProperty("userPlacesFormatOptions",n,t)}catch(r){console.warn(`Failed to load user settings: ${r}`)}return n}else console.warn("User settings not found or access denied");return t}const iH={node:"continuous",continuous:"continuous",bound:"stepwise",stepwise:"stepwise",key:"categorical",categorical:"categorical"};function JGe(t){if(Array.isArray(t))return t.map(e=>({...e,type:eHe(e.type)}))}function eHe(t){return ey(t)&&t in iH?iH[t]:"continuous"}const tHe=[250,500,1e3,2500],nHe=["info","timeSeries","stats","volume"];function rHe(){const t=Kt.instance.branding,e={selectedDatasetId:null,selectedVariableName:null,selectedDataset2Id:null,selectedVariable2Name:null,selectedPlaceGroupIds:[],selectedPlaceId:null,selectedUserPlaceId:null,selectedServerId:Kt.instance.server.id,selectedTime:null,selectedTimeRange:null,timeSeriesUpdateMode:"add",timeAnimationActive:!1,timeAnimationInterval:1e3,timeChunkSize:20,autoShowTimeSeries:!0,timeSeriesChartTypeDefault:"line",timeSeriesIncludeStdev:!0,timeSeriesUseMedian:t.defaultAgg==="median",userDrawnPlaceGroupName:"",userPlacesFormatName:"csv",userPlacesFormatOptions:{csv:{...y$},geojson:{...x$},wkt:{...b$}},flyTo:null,activities:{},locale:"en",dialogOpen:{},privacyNoticeAccepted:!1,mapInteraction:"Select",lastMapInteraction:"Select",layerVisibilities:{baseMap:!0,datasetRgb:!1,datasetVariable:!0,datasetVariable2:!0,datasetBoundary:!1,datasetPlaces:!0,userPlaces:!0,overlay:!0},variableCompareMode:!1,mapPointInfoBoxEnabled:!1,datasetLocateMode:"panAndZoom",placeLocateMode:"panAndZoom",layerMenuOpen:!1,sidebarPosition:2*Math.max(window.innerWidth,window.innerHeight)/3,sidebarOpen:!1,sidebarPanelId:"info",volumeRenderMode:"mip",volumeStates:{},infoCardElementStates:{dataset:{visible:!0,viewMode:"text"},variable:{visible:!0,viewMode:"text"},place:{visible:!0,viewMode:"text"}},mapProjection:t.mapProjection||fae,imageSmoothingEnabled:!1,selectedBaseMapId:dGe,selectedOverlayId:null,userBaseMaps:[],userOverlays:[],userColorBars:[],exportTimeSeries:!0,exportTimeSeriesSeparator:"TAB",exportPlaces:!0,exportPlacesAsCollection:!0,exportZipArchive:!0,exportFileName:"export"};return ZGe(e)}const Va={},iHe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAGUExURcDAwP///ytph7QAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAUSURBVBjTYwABQSCglEENMxgYGAAynwRB8BEAgQAAAABJRU5ErkJggg==",tse=new Image;tse.src=iHe;const _$="_alpha",w$="_r";function oHe(t){let e=t;const n=e.endsWith(_$);n&&(e=e.slice(0,e.length-_$.length));const r=e.endsWith(w$);return r&&(e=e.slice(0,e.length-w$.length)),{baseName:e,isAlpha:n,isReversed:r}}function ZT(t){let e=t.baseName;return t.isReversed&&(e+=w$),t.isAlpha&&(e+=_$),e}function aHe(t,e,n){lHe(t,e).then(r=>{Promise.resolve(createImageBitmap(r)).then(i=>{const o=n.getContext("2d");if(o!==null){const a=o.createPattern(tse,"repeat");a!==null?o.fillStyle=a:o.fillStyle="#ffffff",o.fillRect(0,0,n.width,n.height),o.drawImage(i,0,0,n.width,n.height)}})})}function sHe(t,e){return new Promise((n,r)=>{const i=e||new Image,o=t.imageData;if(!o){n(i);return}i.onload=()=>{n(i)},i.onerror=(a,s,l,c,u)=>{r(u)},i.src=`data:image/png;base64,${o}`})}function lHe(t,e){return sHe(t).then(n=>{const r=cHe(t,e,n);if(r!==null)return r;throw new Error("failed to retrieve 2d context")})}function cHe(t,e,n){const r=document.createElement("canvas");r.width=n.width||1,r.height=n.height||1;const i=r.getContext("2d");if(i===null)return null;i.drawImage(n,0,0);let a=i.getImageData(0,0,r.width,r.height).data;if(t.isReversed){const s=new Uint8ClampedArray(a.length);for(let l=0;lt.controlState.selectedDatasetId,py=t=>t.controlState.selectedVariableName,uHe=t=>t.controlState.selectedDataset2Id,nse=t=>t.controlState.selectedVariable2Name,MB=t=>t.controlState.selectedPlaceGroupIds,my=t=>t.controlState.selectedPlaceId,gy=t=>t.controlState.selectedTime,fHe=t=>t.controlState.selectedServerId,dHe=t=>t.controlState.activities,f2=t=>t.controlState.timeAnimationActive,Y1=t=>t.controlState.imageSmoothingEnabled,hHe=t=>t.controlState.userBaseMaps,pHe=t=>t.controlState.userOverlays,kB=t=>t.controlState.selectedBaseMapId,AB=t=>t.controlState.selectedOverlayId,mHe=t=>!!t.controlState.layerVisibilities.baseMap,gHe=t=>!!t.controlState.layerVisibilities.datasetBoundary,vHe=t=>!!t.controlState.layerVisibilities.datasetVariable,yHe=t=>!!t.controlState.layerVisibilities.datasetVariable2,xHe=t=>!!t.controlState.layerVisibilities.datasetRgb,bHe=t=>!!t.controlState.layerVisibilities.datasetRgb2,_He=t=>!!t.controlState.layerVisibilities.datasetPlaces,rse=t=>!!t.controlState.layerVisibilities.userPlaces,wHe=t=>!!t.controlState.layerVisibilities.overlay,SHe=t=>t.controlState.layerVisibilities,ise=t=>t.controlState.infoCardElementStates,md=t=>t.controlState.mapProjection,OHe=t=>t.controlState.timeChunkSize,CHe=t=>t.controlState.userPlacesFormatName,THe=t=>t.controlState.userPlacesFormatOptions.csv,EHe=t=>t.controlState.userPlacesFormatOptions.geojson,PHe=t=>t.controlState.userPlacesFormatOptions.wkt,Ep=t=>t.controlState.userColorBars,MHe=t=>Kt.instance.branding.allowUserVariables,kHe=()=>"variable",AHe=()=>"variable2",RHe=()=>"rgb",IHe=()=>"rgb2",DHe=()=>13,LHe=()=>12,$He=()=>11,NHe=()=>10,Gr=at(q1,Q1,Fb),gd=at(q1,uHe,Fb),FHe=at(Gr,t=>t&&t.variables||[]),jHe=at(Gr,t=>t?rB(t)[1]:[]),ose=(t,e)=>!t||!e?null:t$(t,e),vo=at(Gr,py,ose),bu=at(gd,nse,ose),ase=t=>t&&(t.title||t.name),BHe=at(vo,ase),zHe=at(bu,ase),sse=t=>t&&t.units||"-",UHe=at(vo,sse),WHe=at(bu,sse),lse=t=>t&&t.colorBarName||"viridis",d2=at(vo,lse),h2=at(bu,lse),cse=t=>t?[t.colorBarMin,t.colorBarMax]:[0,1],use=at(vo,cse),fse=at(bu,cse),dse=t=>(t&&t.colorBarNorm)==="log"?"log":"lin",hse=at(vo,dse),pse=at(bu,dse),p2=at(Ep,iGe,(t,e)=>{const n={title:moe,description:"User-defined color bars.",names:t.map(i=>i.id)},r={};return t.forEach(({id:i,imageData:o})=>{o&&(r[i]=o)}),e?{...e,groups:[n,...e.groups],images:{...e.images,...r}}:{groups:[n],images:r}}),mse=(t,e,n)=>{const r=oHe(t),i=e.images[r.baseName],{baseName:o}=r,a=n.find(s=>s.id===o);if(a){const s=a.type,l=voe(a.code);return{...r,imageData:i,type:s,colorRecords:l}}return{...r,imageData:i}},RB=at(d2,p2,Ep,mse),gse=at(h2,p2,Ep,mse),vse=(t,e,n)=>{const{baseName:r}=t,i=n.find(o=>o.id===r);if(i){const o=voe(i.code);if(o)return JSON.stringify({name:e,type:i.type,colors:o.map(a=>[a.value,a.color])})}return null},VHe=at(RB,d2,Ep,vse),GHe=at(gse,h2,Ep,vse),yse=t=>!t||typeof t.opacity!="number"?1:t.opacity,xse=at(vo,yse),bse=at(bu,yse),HHe=at(Gr,t=>t!==null?foe(t):null),qHe=at(Gr,t=>t!==null&&t.rgbSchema||null),XHe=at(gd,t=>t!==null&&t.rgbSchema||null),_se=at(Gr,t=>t&&t.placeGroups||[]),m2=at(_se,X1,(t,e)=>t.concat(e));function wse(t,e){const n=[];return e!==null&&e.length>0&&t.forEach(r=>{e.indexOf(r.id)>-1&&n.push(r)}),n}const QHe=at(X1,MB,rse,(t,e)=>{const n={},r=new Set(e||[]);return t.forEach(i=>{n[i.id]=r.has(i.id)}),n}),Sse=at(_se,MB,wse),vy=at(m2,MB,wse),YHe=at(vy,t=>t.map(e=>e.title||e.id).join(", ")),K1=at(vy,t=>{const e=t.map(n=>ay(n)?n.features:[]);return[].concat(...e)}),Ose=at(K1,my,(t,e)=>t.find(n=>n.id===e)||null),Z1=at(vy,my,(t,e)=>t.length===0||e===null?null:X5e(t,e)),KHe=at(Q1,py,Ose,(t,e,n)=>{if(t&&e){if(!n)return`${t}-${e}-all`;if(n.geometry.type==="Polygon"||n.geometry.type==="MultiPolygon")return`${t}-${e}-${n.id}`}return null}),Cse=at(Fae,Q1,py,my,(t,e,n,r)=>{if(!e||!n||!r)return!1;for(const i of t)for(const o of i.timeSeriesArray){const a=o.source;if(a.datasetId===e&&a.variableName===n&&a.placeId===r)return!1}return!0}),ZHe=at(Fae,m2,(t,e)=>{const n={};return aB(e,(r,i)=>{for(const o of t)if(o.timeSeriesArray.find(a=>a.source.placeId===i.id)){n[i.id]=ZM(r,i);break}}),n}),Tse=at(Q1,py,gy,my,(t,e,n,r)=>!!(t&&e&&n&&r)),JHe=at(sGe,m2,(t,e)=>{const n=[];return t.forEach(r=>{const i=r.source.placeInfo.place.id;aB(e,(o,a)=>{if(a.id===i){const s=ZM(o,a);n.push({...r,source:{...r.source,placeInfo:s}})}})}),n}),e9e=at(vy,t=>{const e=[];return aB(t,(n,r)=>{e.push(ZM(n,r).label)}),e}),t9e=at(vo,OHe,(t,e)=>{if(t&&t.timeChunkSize){const n=t.timeChunkSize;return n*Math.ceil(e/n)}return e}),Ese=t=>t&&uoe(t)||null,yy=at(Gr,Ese),n9e=at(gd,Ese),Pse=t=>t&&t.attributions||null,IB=at(Gr,Pse),r9e=at(gd,Pse),Mse=t=>t===null||t.coordinates.length===0?null:t.coordinates,S$=at(yy,Mse),i9e=at(yy,Mse),kse=(t,e)=>t===null||e===null?-1:mae(e,t),Ase=at(gy,S$,kse),o9e=at(gy,i9e,kse),Rse=(t,e,n)=>t===null?null:n&&e>-1?n.labels[e]:new Date(t).toISOString(),xy=at(gy,Ase,yy,Rse),a9e=at(gy,o9e,n9e,Rse);function s9e(t,e){if(t!==SB){const n=typeof e=="number"?e+1:20;return new _B({tileSize:[256,256],origin:[-180,90],extent:[-180,-90,180,90],resolutions:Array.from({length:n},(r,i)=>180/256/Math.pow(2,i))})}}function l9e(t,e,n,r,i,o,a,s,l){return new cy({url:t,projection:e,tileGrid:n,attributions:r||void 0,transition:i?0:250,imageSmoothing:o,tileLoadFunction:a,maxZoom:l})}function c9e(t){if(t)return(e,n)=>{e instanceof dB&&(t.getView().getInteracting()?t.once("moveend",function(){e.getImage().src=n}):e.getImage().src=n)}}const u9e=pBe(c9e,{serializer:t=>{const e=t[0];if(e){const n=e.getTarget();return typeof n=="string"?n:n&&n.id||"map"}return""}});function f9e(){const t=Va.map;return u9e(t)}function Ise(t,e,n,r,i,o,a,s,l,c,u,f,d=10){s!==null&&(o=[...o,["time",s]]);const h=ry(e,o);typeof i=="number"&&(i+=3);const p=s9e(c,i),m=l9e(h,c,p,u,l,f,f9e(),r,i),g=c===uy?n:Gie(n,"EPSG:4326",c);return console.log("extent:",n,g),w.jsx(pae,{id:t,source:m,extent:g,zIndex:d,opacity:a})}const d9e=at(Gr,md,gHe,(t,e,n)=>{if(!t||!n)return null;let r=t.geometry;if(!r)if(t.bbox){const[a,s,l,c]=t.bbox;r={type:"Polygon",coordinates:[[[a,s],[l,s],[l,c],[a,c],[a,s]]]}}else return console.warn(`Dataset ${t.id} has no bbox!`),null;const i=new V1({features:new Tp({dataProjection:uy,featureProjection:e}).readFeatures({type:"Feature",geometry:r})}),o=new U1({stroke:new Gl({color:"orange",width:3,lineDash:[2,4]})});return w.jsx(o2,{id:`${t.id}.bbox`,source:i,style:o,zIndex:16,opacity:.5})}),hi=at(jae,fHe,(t,e)=>{if(t.length===0)throw new Error("internal error: no servers configured");const n=t.find(r=>r.id===e);if(!n)throw new Error(`internal error: server with ID "${e}" not found`);return n}),Dse=(t,e,n,r,i,o,a,s,l,c,u,f,d,h,p,m)=>{if(!e||!i||!u)return null;const g=[["crs",p],["vmin",`${a[0]}`],["vmax",`${a[1]}`],["cmap",l||o]];return s==="log"&&g.push(["norm",s]),Ise(f,$se(t.url,e,i),e.bbox,i.tileLevelMin,i.tileLevelMax,g,c,n,h,p,r,m,d)},h9e=at(hi,Gr,xy,IB,vo,d2,use,hse,VHe,xse,vHe,kHe,DHe,f2,md,Y1,Dse),p9e=at(hi,gd,a9e,r9e,bu,h2,fse,pse,GHe,bse,yHe,AHe,LHe,f2,md,Y1,Dse),Lse=(t,e,n,r,i,o,a,s,l,c,u)=>{if(!e||!n||!r)return null;const f=[["crs",l]];return Ise(i,$se(t.url,e,"rgb"),e.bbox,n.tileLevelMin,n.tileLevelMax,f,1,a,s,l,c,u,o)},m9e=at(hi,Gr,qHe,xHe,RHe,$He,xy,f2,md,IB,Y1,Lse),g9e=at(hi,gd,XHe,bHe,IHe,NHe,xy,f2,md,IB,Y1,Lse);function $se(t,e,n){return`${t}/tiles/${iy(e)}/${F1(n)}/{z}/{y}/{x}`}function v9e(){return w5()}function y9e(){return new z1({fill:Fse(),stroke:Nse(),radius:6})}function Nse(){return new Gl({color:[200,0,0,.75],width:1.25})}function Fse(){return new Zh({color:[255,0,0,v9e()]})}function x9e(){return new U1({image:y9e(),stroke:Nse(),fill:Fse()})}const b9e=at(Sse,md,_He,(t,e,n)=>{if(!n||t.length===0)return null;const r=[];return t.forEach((i,o)=>{ay(i)&&r.push(w.jsx(o2,{id:`placeGroup.${i.id}`,style:x9e(),zIndex:100,source:new V1({features:new Tp({dataProjection:uy,featureProjection:e}).readFeatures(i)})},o))}),w.jsx(cae,{children:r})}),_9e=at(ise,t=>{const e=[];return Object.getOwnPropertyNames(t).forEach(n=>{t[n].visible&&e.push(n)}),e}),w9e=at(ise,t=>{const e={};return Object.getOwnPropertyNames(t).forEach(n=>{e[n]=t[n].viewMode||"text"}),e}),S9e=at(dHe,t=>Object.keys(t).map(e=>t[e])),DB=at(hHe,t=>[...t,...Uae]),LB=at(pHe,t=>[...t,...fGe]),jse=(t,e,n,r)=>{if(!n||!e)return null;const i=KT(t,e);if(!i)return null;let o=i.attribution;o&&(o.startsWith("http://")||o.startsWith("https://"))&&(o=`© ${i.group}`);let a;if(i.wms){const{layerName:s,styleName:l}=i.wms;a=new B6e({url:i.url,params:{...l?{STYLES:l}:{},LAYERS:s},attributions:o,attributionsCollapsible:!0})}else{const s=$3e(i.group);a=new cy({url:i.url+(s?`?${s.param}=${s.token}`:""),attributions:o,attributionsCollapsible:!0})}return w.jsx(pae,{id:i.id,source:a,zIndex:r})},O9e=at(DB,kB,mHe,()=>0,jse),C9e=at(LB,AB,wHe,()=>20,jse),Bse=(t,e)=>{const n=KT(t,e);return n?YT(n):null},T9e=at(DB,kB,Bse),E9e=at(LB,AB,Bse),P9e=at(T9e,E9e,kB,AB,Gr,gd,vo,bu,SHe,(t,e,n,r,i,o,a,s,l)=>({baseMap:{title:"Base Map",subTitle:t||void 0,visible:l.baseMap,disabled:!n},overlay:{title:"Overlay",subTitle:e||void 0,visible:l.overlay,disabled:!r},datasetRgb:{title:"Dataset RGB",subTitle:i?i.title:void 0,visible:l.datasetRgb,disabled:!i},datasetRgb2:{title:"Dataset RGB",subTitle:o?o.title:void 0,visible:l.datasetRgb2,disabled:!o,pinned:!0},datasetVariable:{title:"Dataset Variable",subTitle:i&&a?`${i.title} / ${a.title||a.name}`:void 0,visible:l.datasetVariable,disabled:!(i&&a)},datasetVariable2:{title:"Dataset Variable",subTitle:o&&s?`${o.title} / ${s.title||s.name}`:void 0,visible:l.datasetVariable2,disabled:!(o&&s),pinned:!0},datasetBoundary:{title:"Dataset Boundary",subTitle:i?i.title:void 0,visible:l.datasetBoundary,disabled:!i},datasetPlaces:{title:"Dataset Places",visible:l.datasetPlaces},userPlaces:{title:"User Places",visible:l.userPlaces}}));var zse={exports:{}};/*! JSZip v3.10.1 - A JavaScript class for generating and reading zip files @@ -212,104 +212,104 @@ Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/js JSZip uses the library pako released under the MIT license : https://github.com/nodeca/pako/blob/main/LICENSE */(function(t,e){(function(n){t.exports=n()})(function(){return function n(r,i,o){function a(c,u){if(!i[c]){if(!r[c]){var f=typeof ox=="function"&&ox;if(!u&&f)return f(c,!0);if(s)return s(c,!0);var d=new Error("Cannot find module '"+c+"'");throw d.code="MODULE_NOT_FOUND",d}var h=i[c]={exports:{}};r[c][0].call(h.exports,function(p){var m=r[c][1][p];return a(m||p)},h,h.exports,n,r,i,o)}return i[c].exports}for(var s=typeof ox=="function"&&ox,l=0;l>2,h=(3&c)<<4|u>>4,p=1>6:64,m=2>4,u=(15&d)<<4|(h=s.indexOf(l.charAt(m++)))>>2,f=(3&h)<<6|(p=s.indexOf(l.charAt(m++))),y[g++]=c,h!==64&&(y[g++]=u),p!==64&&(y[g++]=f);return y}},{"./support":30,"./utils":32}],2:[function(n,r,i){var o=n("./external"),a=n("./stream/DataWorker"),s=n("./stream/Crc32Probe"),l=n("./stream/DataLengthProbe");function c(u,f,d,h,p){this.compressedSize=u,this.uncompressedSize=f,this.crc32=d,this.compression=h,this.compressedContent=p}c.prototype={getContentWorker:function(){var u=new a(o.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),f=this;return u.on("end",function(){if(this.streamInfo.data_length!==f.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),u},getCompressedWorker:function(){return new a(o.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},c.createWorkerFrom=function(u,f,d){return u.pipe(new s).pipe(new l("uncompressedSize")).pipe(f.compressWorker(d)).pipe(new l("compressedSize")).withStreamInfo("compression",f)},r.exports=c},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(n,r,i){var o=n("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(){return new o("STORE compression")},uncompressWorker:function(){return new o("STORE decompression")}},i.DEFLATE=n("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(n,r,i){var o=n("./utils"),a=function(){for(var s,l=[],c=0;c<256;c++){s=c;for(var u=0;u<8;u++)s=1&s?3988292384^s>>>1:s>>>1;l[c]=s}return l}();r.exports=function(s,l){return s!==void 0&&s.length?o.getTypeOf(s)!=="string"?function(c,u,f,d){var h=a,p=d+f;c^=-1;for(var m=d;m>>8^h[255&(c^u[m])];return-1^c}(0|l,s,s.length,0):function(c,u,f,d){var h=a,p=d+f;c^=-1;for(var m=d;m>>8^h[255&(c^u.charCodeAt(m))];return-1^c}(0|l,s,s.length,0):0}},{"./utils":32}],5:[function(n,r,i){i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(n,r,i){var o=null;o=typeof Promise<"u"?Promise:n("lie"),r.exports={Promise:o}},{lie:37}],7:[function(n,r,i){var o=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",a=n("pako"),s=n("./utils"),l=n("./stream/GenericWorker"),c=o?"uint8array":"array";function u(f,d){l.call(this,"FlateWorker/"+f),this._pako=null,this._pakoAction=f,this._pakoOptions=d,this.meta={}}i.magic="\b\0",s.inherits(u,l),u.prototype.processChunk=function(f){this.meta=f.meta,this._pako===null&&this._createPako(),this._pako.push(s.transformTo(c,f.data),!1)},u.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new a[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var f=this;this._pako.onData=function(d){f.push({data:d,meta:f.meta})}},i.compressWorker=function(f){return new u("Deflate",f)},i.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(n,r,i){function o(h,p){var m,g="";for(m=0;m>>=8;return g}function a(h,p,m,g,v,y){var x,b,_=h.file,S=h.compression,O=y!==c.utf8encode,C=s.transformTo("string",y(_.name)),E=s.transformTo("string",c.utf8encode(_.name)),k=_.comment,I=s.transformTo("string",y(k)),P=s.transformTo("string",c.utf8encode(k)),R=E.length!==_.name.length,T=P.length!==k.length,L="",z="",B="",W=_.dir,U=_.date,N={crc32:0,compressedSize:0,uncompressedSize:0};p&&!m||(N.crc32=h.crc32,N.compressedSize=h.compressedSize,N.uncompressedSize=h.uncompressedSize);var $=0;p&&($|=8),O||!R&&!T||($|=2048);var D=0,A=0;W&&(D|=16),v==="UNIX"?(A=798,D|=function(Y,K){var se=Y;return Y||(se=K?16893:33204),(65535&se)<<16}(_.unixPermissions,W)):(A=20,D|=function(Y){return 63&(Y||0)}(_.dosPermissions)),x=U.getUTCHours(),x<<=6,x|=U.getUTCMinutes(),x<<=5,x|=U.getUTCSeconds()/2,b=U.getUTCFullYear()-1980,b<<=4,b|=U.getUTCMonth()+1,b<<=5,b|=U.getUTCDate(),R&&(z=o(1,1)+o(u(C),4)+E,L+="up"+o(z.length,2)+z),T&&(B=o(1,1)+o(u(I),4)+P,L+="uc"+o(B.length,2)+B);var q="";return q+=` -\0`,q+=o($,2),q+=S.magic,q+=o(x,2),q+=o(b,2),q+=o(N.crc32,4),q+=o(N.compressedSize,4),q+=o(N.uncompressedSize,4),q+=o(C.length,2),q+=o(L.length,2),{fileRecord:f.LOCAL_FILE_HEADER+q+C+L,dirRecord:f.CENTRAL_FILE_HEADER+o(A,2)+q+o(I.length,2)+"\0\0\0\0"+o(D,4)+o(g,4)+C+L+I}}var s=n("../utils"),l=n("../stream/GenericWorker"),c=n("../utf8"),u=n("../crc32"),f=n("../signature");function d(h,p,m,g){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=p,this.zipPlatform=m,this.encodeFileName=g,this.streamFiles=h,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}s.inherits(d,l),d.prototype.push=function(h){var p=h.meta.percent||0,m=this.entriesCount,g=this._sources.length;this.accumulate?this.contentBuffer.push(h):(this.bytesWritten+=h.data.length,l.prototype.push.call(this,{data:h.data,meta:{currentFile:this.currentFile,percent:m?(p+100*(m-g-1))/m:100}}))},d.prototype.openedSource=function(h){this.currentSourceOffset=this.bytesWritten,this.currentFile=h.file.name;var p=this.streamFiles&&!h.file.dir;if(p){var m=a(h,p,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:m.fileRecord,meta:{percent:0}})}else this.accumulate=!0},d.prototype.closedSource=function(h){this.accumulate=!1;var p=this.streamFiles&&!h.file.dir,m=a(h,p,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(m.dirRecord),p)this.push({data:function(g){return f.DATA_DESCRIPTOR+o(g.crc32,4)+o(g.compressedSize,4)+o(g.uncompressedSize,4)}(h),meta:{percent:100}});else for(this.push({data:m.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},d.prototype.flush=function(){for(var h=this.bytesWritten,p=0;p=this.index;l--)c=(c<<8)+this.byteAt(l);return this.index+=s,c},readString:function(s){return o.transformTo("string",this.readData(s))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var s=this.readInt(4);return new Date(Date.UTC(1980+(s>>25&127),(s>>21&15)-1,s>>16&31,s>>11&31,s>>5&63,(31&s)<<1))}},r.exports=a},{"../utils":32}],19:[function(n,r,i){var o=n("./Uint8ArrayReader");function a(s){o.call(this,s)}n("../utils").inherits(a,o),a.prototype.readData=function(s){this.checkOffset(s);var l=this.data.slice(this.zero+this.index,this.zero+this.index+s);return this.index+=s,l},r.exports=a},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(n,r,i){var o=n("./DataReader");function a(s){o.call(this,s)}n("../utils").inherits(a,o),a.prototype.byteAt=function(s){return this.data.charCodeAt(this.zero+s)},a.prototype.lastIndexOfSignature=function(s){return this.data.lastIndexOf(s)-this.zero},a.prototype.readAndCheckSignature=function(s){return s===this.readData(4)},a.prototype.readData=function(s){this.checkOffset(s);var l=this.data.slice(this.zero+this.index,this.zero+this.index+s);return this.index+=s,l},r.exports=a},{"../utils":32,"./DataReader":18}],21:[function(n,r,i){var o=n("./ArrayReader");function a(s){o.call(this,s)}n("../utils").inherits(a,o),a.prototype.readData=function(s){if(this.checkOffset(s),s===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+s);return this.index+=s,l},r.exports=a},{"../utils":32,"./ArrayReader":17}],22:[function(n,r,i){var o=n("../utils"),a=n("../support"),s=n("./ArrayReader"),l=n("./StringReader"),c=n("./NodeBufferReader"),u=n("./Uint8ArrayReader");r.exports=function(f){var d=o.getTypeOf(f);return o.checkSupport(d),d!=="string"||a.uint8array?d==="nodebuffer"?new c(f):a.uint8array?new u(o.transformTo("uint8array",f)):new s(o.transformTo("array",f)):new l(f)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(n,r,i){i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(n,r,i){var o=n("./GenericWorker"),a=n("../utils");function s(l){o.call(this,"ConvertWorker to "+l),this.destType=l}a.inherits(s,o),s.prototype.processChunk=function(l){this.push({data:a.transformTo(this.destType,l.data),meta:l.meta})},r.exports=s},{"../utils":32,"./GenericWorker":28}],25:[function(n,r,i){var o=n("./GenericWorker"),a=n("../crc32");function s(){o.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}n("../utils").inherits(s,o),s.prototype.processChunk=function(l){this.streamInfo.crc32=a(l.data,this.streamInfo.crc32||0),this.push(l)},r.exports=s},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(n,r,i){var o=n("../utils"),a=n("./GenericWorker");function s(l){a.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}o.inherits(s,a),s.prototype.processChunk=function(l){if(l){var c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+l.data.length}a.prototype.processChunk.call(this,l)},r.exports=s},{"../utils":32,"./GenericWorker":28}],27:[function(n,r,i){var o=n("../utils"),a=n("./GenericWorker");function s(l){a.call(this,"DataWorker");var c=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(u){c.dataIsReady=!0,c.data=u,c.max=u&&u.length||0,c.type=o.getTypeOf(u),c.isPaused||c._tickAndRepeat()},function(u){c.error(u)})}o.inherits(s,a),s.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,o.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(o.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,c=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,c);break;case"uint8array":l=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":l=this.data.slice(this.index,c)}return this.index=c,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=s},{"../utils":32,"./GenericWorker":28}],28:[function(n,r,i){function o(a){this.name=a||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}o.prototype={push:function(a){this.emit("data",a)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(a){this.emit("error",a)}return!0},error:function(a){return!this.isFinished&&(this.isPaused?this.generatedError=a:(this.isFinished=!0,this.emit("error",a),this.previous&&this.previous.error(a),this.cleanUp()),!0)},on:function(a,s){return this._listeners[a].push(s),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(a,s){if(this._listeners[a])for(var l=0;l "+a:a}},r.exports=o},{}],29:[function(n,r,i){var o=n("../utils"),a=n("./ConvertWorker"),s=n("./GenericWorker"),l=n("../base64"),c=n("../support"),u=n("../external"),f=null;if(c.nodestream)try{f=n("../nodejs/NodejsStreamOutputAdapter")}catch{}function d(p,m){return new u.Promise(function(g,v){var y=[],x=p._internalType,b=p._outputType,_=p._mimeType;p.on("data",function(S,O){y.push(S),m&&m(O)}).on("error",function(S){y=[],v(S)}).on("end",function(){try{var S=function(O,C,E){switch(O){case"blob":return o.newBlob(o.transformTo("arraybuffer",C),E);case"base64":return l.encode(C);default:return o.transformTo(O,C)}}(b,function(O,C){var E,k=0,I=null,P=0;for(E=0;E"u")i.blob=!1;else{var o=new ArrayBuffer(0);try{i.blob=new Blob([o],{type:"application/zip"}).size===0}catch{try{var a=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);a.append(o),i.blob=a.getBlob("application/zip").size===0}catch{i.blob=!1}}}try{i.nodestream=!!n("readable-stream").Readable}catch{i.nodestream=!1}},{"readable-stream":16}],31:[function(n,r,i){for(var o=n("./utils"),a=n("./support"),s=n("./nodejsUtils"),l=n("./stream/GenericWorker"),c=new Array(256),u=0;u<256;u++)c[u]=252<=u?6:248<=u?5:240<=u?4:224<=u?3:192<=u?2:1;c[254]=c[254]=1;function f(){l.call(this,"utf-8 decode"),this.leftOver=null}function d(){l.call(this,"utf-8 encode")}i.utf8encode=function(h){return a.nodebuffer?s.newBufferFrom(h,"utf-8"):function(p){var m,g,v,y,x,b=p.length,_=0;for(y=0;y>>6:(g<65536?m[x++]=224|g>>>12:(m[x++]=240|g>>>18,m[x++]=128|g>>>12&63),m[x++]=128|g>>>6&63),m[x++]=128|63&g);return m}(h)},i.utf8decode=function(h){return a.nodebuffer?o.transformTo("nodebuffer",h).toString("utf-8"):function(p){var m,g,v,y,x=p.length,b=new Array(2*x);for(m=g=0;m>10&1023,b[g++]=56320|1023&v)}return b.length!==g&&(b.subarray?b=b.subarray(0,g):b.length=g),o.applyFromCharCode(b)}(h=o.transformTo(a.uint8array?"uint8array":"array",h))},o.inherits(f,l),f.prototype.processChunk=function(h){var p=o.transformTo(a.uint8array?"uint8array":"array",h.data);if(this.leftOver&&this.leftOver.length){if(a.uint8array){var m=p;(p=new Uint8Array(m.length+this.leftOver.length)).set(this.leftOver,0),p.set(m,this.leftOver.length)}else p=this.leftOver.concat(p);this.leftOver=null}var g=function(y,x){var b;for((x=x||y.length)>y.length&&(x=y.length),b=x-1;0<=b&&(192&y[b])==128;)b--;return b<0||b===0?x:b+c[y[b]]>x?b:x}(p),v=p;g!==p.length&&(a.uint8array?(v=p.subarray(0,g),this.leftOver=p.subarray(g,p.length)):(v=p.slice(0,g),this.leftOver=p.slice(g,p.length))),this.push({data:i.utf8decode(v),meta:h.meta})},f.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=f,o.inherits(d,l),d.prototype.processChunk=function(h){this.push({data:i.utf8encode(h.data),meta:h.meta})},i.Utf8EncodeWorker=d},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(n,r,i){var o=n("./support"),a=n("./base64"),s=n("./nodejsUtils"),l=n("./external");function c(m){return m}function u(m,g){for(var v=0;v>8;this.dir=!!(16&this.externalFileAttributes),h==0&&(this.dosPermissions=63&this.externalFileAttributes),h==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var h=o(this.extraFields[1].value);this.uncompressedSize===a.MAX_VALUE_32BITS&&(this.uncompressedSize=h.readInt(8)),this.compressedSize===a.MAX_VALUE_32BITS&&(this.compressedSize=h.readInt(8)),this.localHeaderOffset===a.MAX_VALUE_32BITS&&(this.localHeaderOffset=h.readInt(8)),this.diskNumberStart===a.MAX_VALUE_32BITS&&(this.diskNumberStart=h.readInt(4))}},readExtraFields:function(h){var p,m,g,v=h.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});h.index+4>>6:(h<65536?d[g++]=224|h>>>12:(d[g++]=240|h>>>18,d[g++]=128|h>>>12&63),d[g++]=128|h>>>6&63),d[g++]=128|63&h);return d},i.buf2binstring=function(f){return u(f,f.length)},i.binstring2buf=function(f){for(var d=new o.Buf8(f.length),h=0,p=d.length;h>10&1023,y[p++]=56320|1023&m)}return u(y,p)},i.utf8border=function(f,d){var h;for((d=d||f.length)>f.length&&(d=f.length),h=d-1;0<=h&&(192&f[h])==128;)h--;return h<0||h===0?d:h+l[f[h]]>d?h:d}},{"./common":41}],43:[function(n,r,i){r.exports=function(o,a,s,l){for(var c=65535&o|0,u=o>>>16&65535|0,f=0;s!==0;){for(s-=f=2e3>>1:a>>>1;s[l]=a}return s}();r.exports=function(a,s,l,c){var u=o,f=c+l;a^=-1;for(var d=c;d>>8^u[255&(a^s[d])];return-1^a}},{}],46:[function(n,r,i){var o,a=n("../utils/common"),s=n("./trees"),l=n("./adler32"),c=n("./crc32"),u=n("./messages"),f=0,d=4,h=0,p=-2,m=-1,g=4,v=2,y=8,x=9,b=286,_=30,S=19,O=2*b+1,C=15,E=3,k=258,I=k+E+1,P=42,R=113,T=1,L=2,z=3,B=4;function W(F,ce){return F.msg=u[ce],ce}function U(F){return(F<<1)-(4F.avail_out&&(le=F.avail_out),le!==0&&(a.arraySet(F.output,ce.pending_buf,ce.pending_out,le,F.next_out),F.next_out+=le,ce.pending_out+=le,F.total_out+=le,F.avail_out-=le,ce.pending-=le,ce.pending===0&&(ce.pending_out=0))}function D(F,ce){s._tr_flush_block(F,0<=F.block_start?F.block_start:-1,F.strstart-F.block_start,ce),F.block_start=F.strstart,$(F.strm)}function A(F,ce){F.pending_buf[F.pending++]=ce}function q(F,ce){F.pending_buf[F.pending++]=ce>>>8&255,F.pending_buf[F.pending++]=255&ce}function Y(F,ce){var le,Q,X=F.max_chain_length,ee=F.strstart,ge=F.prev_length,ye=F.nice_match,H=F.strstart>F.w_size-I?F.strstart-(F.w_size-I):0,G=F.window,ie=F.w_mask,he=F.prev,_e=F.strstart+k,oe=G[ee+ge-1],Z=G[ee+ge];F.prev_length>=F.good_match&&(X>>=2),ye>F.lookahead&&(ye=F.lookahead);do if(G[(le=ce)+ge]===Z&&G[le+ge-1]===oe&&G[le]===G[ee]&&G[++le]===G[ee+1]){ee+=2,le++;do;while(G[++ee]===G[++le]&&G[++ee]===G[++le]&&G[++ee]===G[++le]&&G[++ee]===G[++le]&&G[++ee]===G[++le]&&G[++ee]===G[++le]&&G[++ee]===G[++le]&&G[++ee]===G[++le]&&ee<_e);if(Q=k-(_e-ee),ee=_e-k,geH&&--X!=0);return ge<=F.lookahead?ge:F.lookahead}function K(F){var ce,le,Q,X,ee,ge,ye,H,G,ie,he=F.w_size;do{if(X=F.window_size-F.lookahead-F.strstart,F.strstart>=he+(he-I)){for(a.arraySet(F.window,F.window,he,he,0),F.match_start-=he,F.strstart-=he,F.block_start-=he,ce=le=F.hash_size;Q=F.head[--ce],F.head[ce]=he<=Q?Q-he:0,--le;);for(ce=le=he;Q=F.prev[--ce],F.prev[ce]=he<=Q?Q-he:0,--le;);X+=he}if(F.strm.avail_in===0)break;if(ge=F.strm,ye=F.window,H=F.strstart+F.lookahead,G=X,ie=void 0,ie=ge.avail_in,G=E)for(ee=F.strstart-F.insert,F.ins_h=F.window[ee],F.ins_h=(F.ins_h<=E&&(F.ins_h=(F.ins_h<=E)if(Q=s._tr_tally(F,F.strstart-F.match_start,F.match_length-E),F.lookahead-=F.match_length,F.match_length<=F.max_lazy_match&&F.lookahead>=E){for(F.match_length--;F.strstart++,F.ins_h=(F.ins_h<=E&&(F.ins_h=(F.ins_h<=E&&F.match_length<=F.prev_length){for(X=F.strstart+F.lookahead-E,Q=s._tr_tally(F,F.strstart-1-F.prev_match,F.prev_length-E),F.lookahead-=F.prev_length-1,F.prev_length-=2;++F.strstart<=X&&(F.ins_h=(F.ins_h<F.pending_buf_size-5&&(le=F.pending_buf_size-5);;){if(F.lookahead<=1){if(K(F),F.lookahead===0&&ce===f)return T;if(F.lookahead===0)break}F.strstart+=F.lookahead,F.lookahead=0;var Q=F.block_start+le;if((F.strstart===0||F.strstart>=Q)&&(F.lookahead=F.strstart-Q,F.strstart=Q,D(F,!1),F.strm.avail_out===0)||F.strstart-F.block_start>=F.w_size-I&&(D(F,!1),F.strm.avail_out===0))return T}return F.insert=0,ce===d?(D(F,!0),F.strm.avail_out===0?z:B):(F.strstart>F.block_start&&(D(F,!1),F.strm.avail_out),T)}),new J(4,4,8,4,se),new J(4,5,16,8,se),new J(4,6,32,32,se),new J(4,4,16,16,te),new J(8,16,32,32,te),new J(8,16,128,128,te),new J(8,32,128,256,te),new J(32,128,258,1024,te),new J(32,258,258,4096,te)],i.deflateInit=function(F,ce){return ve(F,ce,y,15,8,0)},i.deflateInit2=ve,i.deflateReset=re,i.deflateResetKeep=be,i.deflateSetHeader=function(F,ce){return F&&F.state?F.state.wrap!==2?p:(F.state.gzhead=ce,h):p},i.deflate=function(F,ce){var le,Q,X,ee;if(!F||!F.state||5>8&255),A(Q,Q.gzhead.time>>16&255),A(Q,Q.gzhead.time>>24&255),A(Q,Q.level===9?2:2<=Q.strategy||Q.level<2?4:0),A(Q,255&Q.gzhead.os),Q.gzhead.extra&&Q.gzhead.extra.length&&(A(Q,255&Q.gzhead.extra.length),A(Q,Q.gzhead.extra.length>>8&255)),Q.gzhead.hcrc&&(F.adler=c(F.adler,Q.pending_buf,Q.pending,0)),Q.gzindex=0,Q.status=69):(A(Q,0),A(Q,0),A(Q,0),A(Q,0),A(Q,0),A(Q,Q.level===9?2:2<=Q.strategy||Q.level<2?4:0),A(Q,3),Q.status=R);else{var ge=y+(Q.w_bits-8<<4)<<8;ge|=(2<=Q.strategy||Q.level<2?0:Q.level<6?1:Q.level===6?2:3)<<6,Q.strstart!==0&&(ge|=32),ge+=31-ge%31,Q.status=R,q(Q,ge),Q.strstart!==0&&(q(Q,F.adler>>>16),q(Q,65535&F.adler)),F.adler=1}if(Q.status===69)if(Q.gzhead.extra){for(X=Q.pending;Q.gzindex<(65535&Q.gzhead.extra.length)&&(Q.pending!==Q.pending_buf_size||(Q.gzhead.hcrc&&Q.pending>X&&(F.adler=c(F.adler,Q.pending_buf,Q.pending-X,X)),$(F),X=Q.pending,Q.pending!==Q.pending_buf_size));)A(Q,255&Q.gzhead.extra[Q.gzindex]),Q.gzindex++;Q.gzhead.hcrc&&Q.pending>X&&(F.adler=c(F.adler,Q.pending_buf,Q.pending-X,X)),Q.gzindex===Q.gzhead.extra.length&&(Q.gzindex=0,Q.status=73)}else Q.status=73;if(Q.status===73)if(Q.gzhead.name){X=Q.pending;do{if(Q.pending===Q.pending_buf_size&&(Q.gzhead.hcrc&&Q.pending>X&&(F.adler=c(F.adler,Q.pending_buf,Q.pending-X,X)),$(F),X=Q.pending,Q.pending===Q.pending_buf_size)){ee=1;break}ee=Q.gzindexX&&(F.adler=c(F.adler,Q.pending_buf,Q.pending-X,X)),ee===0&&(Q.gzindex=0,Q.status=91)}else Q.status=91;if(Q.status===91)if(Q.gzhead.comment){X=Q.pending;do{if(Q.pending===Q.pending_buf_size&&(Q.gzhead.hcrc&&Q.pending>X&&(F.adler=c(F.adler,Q.pending_buf,Q.pending-X,X)),$(F),X=Q.pending,Q.pending===Q.pending_buf_size)){ee=1;break}ee=Q.gzindexX&&(F.adler=c(F.adler,Q.pending_buf,Q.pending-X,X)),ee===0&&(Q.status=103)}else Q.status=103;if(Q.status===103&&(Q.gzhead.hcrc?(Q.pending+2>Q.pending_buf_size&&$(F),Q.pending+2<=Q.pending_buf_size&&(A(Q,255&F.adler),A(Q,F.adler>>8&255),F.adler=0,Q.status=R)):Q.status=R),Q.pending!==0){if($(F),F.avail_out===0)return Q.last_flush=-1,h}else if(F.avail_in===0&&U(ce)<=U(le)&&ce!==d)return W(F,-5);if(Q.status===666&&F.avail_in!==0)return W(F,-5);if(F.avail_in!==0||Q.lookahead!==0||ce!==f&&Q.status!==666){var ye=Q.strategy===2?function(H,G){for(var ie;;){if(H.lookahead===0&&(K(H),H.lookahead===0)){if(G===f)return T;break}if(H.match_length=0,ie=s._tr_tally(H,0,H.window[H.strstart]),H.lookahead--,H.strstart++,ie&&(D(H,!1),H.strm.avail_out===0))return T}return H.insert=0,G===d?(D(H,!0),H.strm.avail_out===0?z:B):H.last_lit&&(D(H,!1),H.strm.avail_out===0)?T:L}(Q,ce):Q.strategy===3?function(H,G){for(var ie,he,_e,oe,Z=H.window;;){if(H.lookahead<=k){if(K(H),H.lookahead<=k&&G===f)return T;if(H.lookahead===0)break}if(H.match_length=0,H.lookahead>=E&&0H.lookahead&&(H.match_length=H.lookahead)}if(H.match_length>=E?(ie=s._tr_tally(H,1,H.match_length-E),H.lookahead-=H.match_length,H.strstart+=H.match_length,H.match_length=0):(ie=s._tr_tally(H,0,H.window[H.strstart]),H.lookahead--,H.strstart++),ie&&(D(H,!1),H.strm.avail_out===0))return T}return H.insert=0,G===d?(D(H,!0),H.strm.avail_out===0?z:B):H.last_lit&&(D(H,!1),H.strm.avail_out===0)?T:L}(Q,ce):o[Q.level].func(Q,ce);if(ye!==z&&ye!==B||(Q.status=666),ye===T||ye===z)return F.avail_out===0&&(Q.last_flush=-1),h;if(ye===L&&(ce===1?s._tr_align(Q):ce!==5&&(s._tr_stored_block(Q,0,0,!1),ce===3&&(N(Q.head),Q.lookahead===0&&(Q.strstart=0,Q.block_start=0,Q.insert=0))),$(F),F.avail_out===0))return Q.last_flush=-1,h}return ce!==d?h:Q.wrap<=0?1:(Q.wrap===2?(A(Q,255&F.adler),A(Q,F.adler>>8&255),A(Q,F.adler>>16&255),A(Q,F.adler>>24&255),A(Q,255&F.total_in),A(Q,F.total_in>>8&255),A(Q,F.total_in>>16&255),A(Q,F.total_in>>24&255)):(q(Q,F.adler>>>16),q(Q,65535&F.adler)),$(F),0=le.w_size&&(ee===0&&(N(le.head),le.strstart=0,le.block_start=0,le.insert=0),G=new a.Buf8(le.w_size),a.arraySet(G,ce,ie-le.w_size,le.w_size,0),ce=G,ie=le.w_size),ge=F.avail_in,ye=F.next_in,H=F.input,F.avail_in=ie,F.next_in=0,F.input=ce,K(le);le.lookahead>=E;){for(Q=le.strstart,X=le.lookahead-(E-1);le.ins_h=(le.ins_h<>>=E=C>>>24,x-=E,(E=C>>>16&255)===0)L[u++]=65535&C;else{if(!(16&E)){if(!(64&E)){C=b[(65535&C)+(y&(1<>>=E,x-=E),x<15&&(y+=T[l++]<>>=E=C>>>24,x-=E,!(16&(E=C>>>16&255))){if(!(64&E)){C=_[(65535&C)+(y&(1<>>=E,x-=E,(E=u-f)>3,y&=(1<<(x-=k<<3))-1,o.next_in=l,o.next_out=u,o.avail_in=l>>24&255)+(P>>>8&65280)+((65280&P)<<8)+((255&P)<<24)}function y(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new o.Buf16(320),this.work=new o.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function x(P){var R;return P&&P.state?(R=P.state,P.total_in=P.total_out=R.total=0,P.msg="",R.wrap&&(P.adler=1&R.wrap),R.mode=p,R.last=0,R.havedict=0,R.dmax=32768,R.head=null,R.hold=0,R.bits=0,R.lencode=R.lendyn=new o.Buf32(m),R.distcode=R.distdyn=new o.Buf32(g),R.sane=1,R.back=-1,d):h}function b(P){var R;return P&&P.state?((R=P.state).wsize=0,R.whave=0,R.wnext=0,x(P)):h}function _(P,R){var T,L;return P&&P.state?(L=P.state,R<0?(T=0,R=-R):(T=1+(R>>4),R<48&&(R&=15)),R&&(R<8||15=B.wsize?(o.arraySet(B.window,R,T-B.wsize,B.wsize,0),B.wnext=0,B.whave=B.wsize):(L<(z=B.wsize-B.wnext)&&(z=L),o.arraySet(B.window,R,T-L,z,B.wnext),(L-=z)?(o.arraySet(B.window,R,T-L,L,0),B.wnext=L,B.whave=B.wsize):(B.wnext+=z,B.wnext===B.wsize&&(B.wnext=0),B.whave>>8&255,T.check=s(T.check,ee,2,0),D=$=0,T.mode=2;break}if(T.flags=0,T.head&&(T.head.done=!1),!(1&T.wrap)||(((255&$)<<8)+($>>8))%31){P.msg="incorrect header check",T.mode=30;break}if((15&$)!=8){P.msg="unknown compression method",T.mode=30;break}if(D-=4,F=8+(15&($>>>=4)),T.wbits===0)T.wbits=F;else if(F>T.wbits){P.msg="invalid window size",T.mode=30;break}T.dmax=1<>8&1),512&T.flags&&(ee[0]=255&$,ee[1]=$>>>8&255,T.check=s(T.check,ee,2,0)),D=$=0,T.mode=3;case 3:for(;D<32;){if(U===0)break e;U--,$+=L[B++]<>>8&255,ee[2]=$>>>16&255,ee[3]=$>>>24&255,T.check=s(T.check,ee,4,0)),D=$=0,T.mode=4;case 4:for(;D<16;){if(U===0)break e;U--,$+=L[B++]<>8),512&T.flags&&(ee[0]=255&$,ee[1]=$>>>8&255,T.check=s(T.check,ee,2,0)),D=$=0,T.mode=5;case 5:if(1024&T.flags){for(;D<16;){if(U===0)break e;U--,$+=L[B++]<>>8&255,T.check=s(T.check,ee,2,0)),D=$=0}else T.head&&(T.head.extra=null);T.mode=6;case 6:if(1024&T.flags&&(U<(Y=T.length)&&(Y=U),Y&&(T.head&&(F=T.head.extra_len-T.length,T.head.extra||(T.head.extra=new Array(T.head.extra_len)),o.arraySet(T.head.extra,L,B,Y,F)),512&T.flags&&(T.check=s(T.check,L,Y,B)),U-=Y,B+=Y,T.length-=Y),T.length))break e;T.length=0,T.mode=7;case 7:if(2048&T.flags){if(U===0)break e;for(Y=0;F=L[B+Y++],T.head&&F&&T.length<65536&&(T.head.name+=String.fromCharCode(F)),F&&Y>9&1,T.head.done=!0),P.adler=T.check=0,T.mode=12;break;case 10:for(;D<32;){if(U===0)break e;U--,$+=L[B++]<>>=7&D,D-=7&D,T.mode=27;break}for(;D<3;){if(U===0)break e;U--,$+=L[B++]<>>=1)){case 0:T.mode=14;break;case 1:if(k(T),T.mode=20,R!==6)break;$>>>=2,D-=2;break e;case 2:T.mode=17;break;case 3:P.msg="invalid block type",T.mode=30}$>>>=2,D-=2;break;case 14:for($>>>=7&D,D-=7&D;D<32;){if(U===0)break e;U--,$+=L[B++]<>>16^65535)){P.msg="invalid stored block lengths",T.mode=30;break}if(T.length=65535&$,D=$=0,T.mode=15,R===6)break e;case 15:T.mode=16;case 16:if(Y=T.length){if(U>>=5,D-=5,T.ndist=1+(31&$),$>>>=5,D-=5,T.ncode=4+(15&$),$>>>=4,D-=4,286>>=3,D-=3}for(;T.have<19;)T.lens[ge[T.have++]]=0;if(T.lencode=T.lendyn,T.lenbits=7,le={bits:T.lenbits},ce=c(0,T.lens,0,19,T.lencode,0,T.work,le),T.lenbits=le.bits,ce){P.msg="invalid code lengths set",T.mode=30;break}T.have=0,T.mode=19;case 19:for(;T.have>>16&255,pe=65535&X,!((te=X>>>24)<=D);){if(U===0)break e;U--,$+=L[B++]<>>=te,D-=te,T.lens[T.have++]=pe;else{if(pe===16){for(Q=te+2;D>>=te,D-=te,T.have===0){P.msg="invalid bit length repeat",T.mode=30;break}F=T.lens[T.have-1],Y=3+(3&$),$>>>=2,D-=2}else if(pe===17){for(Q=te+3;D>>=te)),$>>>=3,D-=3}else{for(Q=te+7;D>>=te)),$>>>=7,D-=7}if(T.have+Y>T.nlen+T.ndist){P.msg="invalid bit length repeat",T.mode=30;break}for(;Y--;)T.lens[T.have++]=F}}if(T.mode===30)break;if(T.lens[256]===0){P.msg="invalid code -- missing end-of-block",T.mode=30;break}if(T.lenbits=9,le={bits:T.lenbits},ce=c(u,T.lens,0,T.nlen,T.lencode,0,T.work,le),T.lenbits=le.bits,ce){P.msg="invalid literal/lengths set",T.mode=30;break}if(T.distbits=6,T.distcode=T.distdyn,le={bits:T.distbits},ce=c(f,T.lens,T.nlen,T.ndist,T.distcode,0,T.work,le),T.distbits=le.bits,ce){P.msg="invalid distances set",T.mode=30;break}if(T.mode=20,R===6)break e;case 20:T.mode=21;case 21:if(6<=U&&258<=N){P.next_out=W,P.avail_out=N,P.next_in=B,P.avail_in=U,T.hold=$,T.bits=D,l(P,q),W=P.next_out,z=P.output,N=P.avail_out,B=P.next_in,L=P.input,U=P.avail_in,$=T.hold,D=T.bits,T.mode===12&&(T.back=-1);break}for(T.back=0;J=(X=T.lencode[$&(1<>>16&255,pe=65535&X,!((te=X>>>24)<=D);){if(U===0)break e;U--,$+=L[B++]<>be)])>>>16&255,pe=65535&X,!(be+(te=X>>>24)<=D);){if(U===0)break e;U--,$+=L[B++]<>>=be,D-=be,T.back+=be}if($>>>=te,D-=te,T.back+=te,T.length=pe,J===0){T.mode=26;break}if(32&J){T.back=-1,T.mode=12;break}if(64&J){P.msg="invalid literal/length code",T.mode=30;break}T.extra=15&J,T.mode=22;case 22:if(T.extra){for(Q=T.extra;D>>=T.extra,D-=T.extra,T.back+=T.extra}T.was=T.length,T.mode=23;case 23:for(;J=(X=T.distcode[$&(1<>>16&255,pe=65535&X,!((te=X>>>24)<=D);){if(U===0)break e;U--,$+=L[B++]<>be)])>>>16&255,pe=65535&X,!(be+(te=X>>>24)<=D);){if(U===0)break e;U--,$+=L[B++]<>>=be,D-=be,T.back+=be}if($>>>=te,D-=te,T.back+=te,64&J){P.msg="invalid distance code",T.mode=30;break}T.offset=pe,T.extra=15&J,T.mode=24;case 24:if(T.extra){for(Q=T.extra;D>>=T.extra,D-=T.extra,T.back+=T.extra}if(T.offset>T.dmax){P.msg="invalid distance too far back",T.mode=30;break}T.mode=25;case 25:if(N===0)break e;if(Y=q-N,T.offset>Y){if((Y=T.offset-Y)>T.whave&&T.sane){P.msg="invalid distance too far back",T.mode=30;break}K=Y>T.wnext?(Y-=T.wnext,T.wsize-Y):T.wnext-Y,Y>T.length&&(Y=T.length),se=T.window}else se=z,K=W-T.offset,Y=T.length;for(NO?(E=K[se+g[R]],D[A+g[R]]):(E=96,0),y=1<>W)+(x-=y)]=C<<24|E<<16|k|0,x!==0;);for(y=1<>=1;if(y!==0?($&=y-1,$+=y):$=0,R++,--q[P]==0){if(P===L)break;P=f[d+g[R]]}if(z>>7)]}function A(X,ee){X.pending_buf[X.pending++]=255&ee,X.pending_buf[X.pending++]=ee>>>8&255}function q(X,ee,ge){X.bi_valid>v-ge?(X.bi_buf|=ee<>v-X.bi_valid,X.bi_valid+=ge-v):(X.bi_buf|=ee<>>=1,ge<<=1,0<--ee;);return ge>>>1}function se(X,ee,ge){var ye,H,G=new Array(g+1),ie=0;for(ye=1;ye<=g;ye++)G[ye]=ie=ie+ge[ye-1]<<1;for(H=0;H<=ee;H++){var he=X[2*H+1];he!==0&&(X[2*H]=K(G[he]++,he))}}function te(X){var ee;for(ee=0;ee>1;1<=ge;ge--)be(X,G,ge);for(H=_e;ge=X.heap[1],X.heap[1]=X.heap[X.heap_len--],be(X,G,1),ye=X.heap[1],X.heap[--X.heap_max]=ge,X.heap[--X.heap_max]=ye,G[2*H]=G[2*ge]+G[2*ye],X.depth[H]=(X.depth[ge]>=X.depth[ye]?X.depth[ge]:X.depth[ye])+1,G[2*ge+1]=G[2*ye+1]=H,X.heap[1]=H++,be(X,G,1),2<=X.heap_len;);X.heap[--X.heap_max]=X.heap[1],function(Z,V){var de,xe,Me,me,Ne,Ce,Re=V.dyn_tree,ae=V.max_code,Le=V.stat_desc.static_tree,Ee=V.stat_desc.has_stree,ze=V.stat_desc.extra_bits,He=V.stat_desc.extra_base,xt=V.stat_desc.max_length,Dt=0;for(me=0;me<=g;me++)Z.bl_count[me]=0;for(Re[2*Z.heap[Z.heap_max]+1]=0,de=Z.heap_max+1;de>=7;H>>=1)if(1&oe&&he.dyn_ltree[2*_e]!==0)return a;if(he.dyn_ltree[18]!==0||he.dyn_ltree[20]!==0||he.dyn_ltree[26]!==0)return s;for(_e=32;_e>>3,(G=X.static_len+3+7>>>3)<=H&&(H=G)):H=G=ge+5,ge+4<=H&&ee!==-1?Q(X,ee,ge,ye):X.strategy===4||G===H?(q(X,2+(ye?1:0),3),re(X,I,P)):(q(X,4+(ye?1:0),3),function(he,_e,oe,Z){var V;for(q(he,_e-257,5),q(he,oe-1,5),q(he,Z-4,4),V=0;V>>8&255,X.pending_buf[X.d_buf+2*X.last_lit+1]=255&ee,X.pending_buf[X.l_buf+X.last_lit]=255&ge,X.last_lit++,ee===0?X.dyn_ltree[2*ge]++:(X.matches++,ee--,X.dyn_ltree[2*(T[ge]+f+1)]++,X.dyn_dtree[2*D(ee)]++),X.last_lit===X.lit_bufsize-1},i._tr_align=function(X){q(X,2,3),Y(X,x,I),function(ee){ee.bi_valid===16?(A(ee,ee.bi_buf),ee.bi_buf=0,ee.bi_valid=0):8<=ee.bi_valid&&(ee.pending_buf[ee.pending++]=255&ee.bi_buf,ee.bi_buf>>=8,ee.bi_valid-=8)}(X)}},{"../utils/common":41}],53:[function(n,r,i){r.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(n,r,i){(function(o){(function(a,s){if(!a.setImmediate){var l,c,u,f,d=1,h={},p=!1,m=a.document,g=Object.getPrototypeOf&&Object.getPrototypeOf(a);g=g&&g.setTimeout?g:a,l={}.toString.call(a.process)==="[object process]"?function(b){process.nextTick(function(){y(b)})}:function(){if(a.postMessage&&!a.importScripts){var b=!0,_=a.onmessage;return a.onmessage=function(){b=!1},a.postMessage("","*"),a.onmessage=_,b}}()?(f="setImmediate$"+Math.random()+"$",a.addEventListener?a.addEventListener("message",x,!1):a.attachEvent("onmessage",x),function(b){a.postMessage(f+b,"*")}):a.MessageChannel?((u=new MessageChannel).port1.onmessage=function(b){y(b.data)},function(b){u.port2.postMessage(b)}):m&&"onreadystatechange"in m.createElement("script")?(c=m.documentElement,function(b){var _=m.createElement("script");_.onreadystatechange=function(){y(b),_.onreadystatechange=null,c.removeChild(_),_=null},c.appendChild(_)}):function(b){setTimeout(y,0,b)},g.setImmediate=function(b){typeof b!="function"&&(b=new Function(""+b));for(var _=new Array(arguments.length-1),S=0;S<_.length;S++)_[S]=arguments[S+1];var O={callback:b,args:_};return h[d]=O,l(d),d++},g.clearImmediate=v}function v(b){delete h[b]}function y(b){if(p)setTimeout(y,0,b);else{var _=h[b];if(_){p=!0;try{(function(S){var O=S.callback,C=S.args;switch(C.length){case 0:O();break;case 1:O(C[0]);break;case 2:O(C[0],C[1]);break;case 3:O(C[0],C[1],C[2]);break;default:O.apply(s,C)}})(_)}finally{v(b),p=!1}}}}function x(b){b.source===a&&typeof b.data=="string"&&b.data.indexOf(f)===0&&y(+b.data.slice(f.length))}})(typeof self>"u"?o===void 0?this:o:self)}).call(this,typeof Kn<"u"?Kn:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(Bse);var E9e=Bse.exports;const P9e=Nt(E9e);var zse={exports:{}};(function(t,e){(function(n,r){r()})(Kn,function(){function n(c,u){return typeof u>"u"?u={autoBom:!1}:typeof u!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),u={autoBom:!u}),u.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function r(c,u,f){var d=new XMLHttpRequest;d.open("GET",c),d.responseType="blob",d.onload=function(){l(d.response,u,f)},d.onerror=function(){console.error("could not download file")},d.send()}function i(c){var u=new XMLHttpRequest;u.open("HEAD",c,!1);try{u.send()}catch{}return 200<=u.status&&299>=u.status}function o(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var u=document.createEvent("MouseEvents");u.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(u)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Kn=="object"&&Kn.global===Kn?Kn:void 0,s=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!s?function(c,u,f){var d=a.URL||a.webkitURL,h=document.createElement("a");u=u||c.name||"download",h.download=u,h.rel="noopener",typeof c=="string"?(h.href=c,h.origin===location.origin?o(h):i(h.href)?r(c,u,f):o(h,h.target="_blank")):(h.href=d.createObjectURL(c),setTimeout(function(){d.revokeObjectURL(h.href)},4e4),setTimeout(function(){o(h)},0))}:"msSaveOrOpenBlob"in navigator?function(c,u,f){if(u=u||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(n(c,f),u);else if(i(c))r(c,u,f);else{var d=document.createElement("a");d.href=c,d.target="_blank",setTimeout(function(){o(d)})}}:function(c,u,f,d){if(d=d||open("","_blank"),d&&(d.document.title=d.document.body.innerText="downloading..."),typeof c=="string")return r(c,u,f);var h=c.type==="application/octet-stream",p=/constructor/i.test(a.HTMLElement)||a.safari,m=/CriOS\/[\d]+/.test(navigator.userAgent);if((m||h&&p||s)&&typeof FileReader<"u"){var g=new FileReader;g.onloadend=function(){var x=g.result;x=m?x:x.replace(/^data:[^;]*;/,"data:attachment/file;"),d?d.location.href=x:location=x,d=null},g.readAsDataURL(c)}else{var v=a.URL||a.webkitURL,y=v.createObjectURL(c);d?d.location=y:location.href=y,d=null,setTimeout(function(){v.revokeObjectURL(y)},4e4)}});a.saveAs=l.saveAs=l,t.exports=l})})(zse);var Use=zse.exports;const Wse="POST_MESSAGE";function ba(t,e){return{type:Wse,messageType:t,messageText:typeof e=="string"?e:e.message}}const Vse="HIDE_MESSAGE";function M9e(t){return{type:Vse,messageId:t}}var k9e={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};const rH=Nt(k9e);var iH={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function A9e(t){var e,n=[],r=1,i;if(typeof t=="string")if(t=t.toLowerCase(),rH[t])n=rH[t].slice(),i="rgb";else if(t==="transparent")r=0,i="rgb",n=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var o=t.slice(1),a=o.length,s=a<=4;r=1,s?(n=[parseInt(o[0]+o[0],16),parseInt(o[1]+o[1],16),parseInt(o[2]+o[2],16)],a===4&&(r=parseInt(o[3]+o[3],16)/255)):(n=[parseInt(o[0]+o[1],16),parseInt(o[2]+o[3],16),parseInt(o[4]+o[5],16)],a===8&&(r=parseInt(o[6]+o[7],16)/255)),n[0]||(n[0]=0),n[1]||(n[1]=0),n[2]||(n[2]=0),i="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var l=e[1],c=l==="rgb",o=l.replace(/a$/,"");i=o;var a=o==="cmyk"?4:o==="gray"?1:3;n=e[2].trim().split(/\s*[,\/]\s*|\s+/).map(function(d,h){if(/%$/.test(d))return h===a?parseFloat(d)/100:o==="rgb"?parseFloat(d)*255/100:parseFloat(d);if(o[h]==="h"){if(/deg$/.test(d))return parseFloat(d);if(iH[d]!==void 0)return iH[d]}return parseFloat(d)}),l===o&&n.push(1),r=c||n[a]===void 0?1:n[a],n=n.slice(0,a)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(n=t.match(/([0-9]+)/g).map(function(u){return parseFloat(u)}),i=t.match(/([a-z])/ig).join("").toLowerCase());else isNaN(t)?Array.isArray(t)||t.length?(n=[t[0],t[1],t[2]],i="rgb",r=t.length===4?t[3]:1):t instanceof Object&&(t.r!=null||t.red!=null||t.R!=null?(i="rgb",n=[t.r||t.red||t.R||0,t.g||t.green||t.G||0,t.b||t.blue||t.B||0]):(i="hsl",n=[t.h||t.hue||t.H||0,t.s||t.saturation||t.S||0,t.l||t.lightness||t.L||t.b||t.brightness]),r=t.a||t.alpha||t.opacity||1,t.opacity!=null&&(r/=100)):(i="rgb",n=[t>>>16,(t&65280)>>>8,t&255]);return{space:i,values:n,alpha:r}}const S$={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]},QA={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e=t[0]/360,n=t[1]/100,r=t[2]/100,i,o,a,s,l,c=0;if(n===0)return l=r*255,[l,l,l];for(o=r<.5?r*(1+n):r+n-r*n,i=2*r-o,s=[0,0,0];c<3;)a=e+1/3*-(c-1),a<0?a++:a>1&&a--,l=6*a<1?i+(o-i)*6*a:2*a<1?o:3*a<2?i+(o-i)*(2/3-a)*6:i,s[c++]=l*255;return s}};S$.hsl=function(t){var e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=o-i,s,l,c;return o===i?s=0:e===o?s=(n-r)/a:n===o?s=2+(r-e)/a:r===o&&(s=4+(e-n)/a),s=Math.min(s*60,360),s<0&&(s+=360),c=(i+o)/2,o===i?l=0:c<=.5?l=a/(o+i):l=a/(2-o-i),[s,l*100,c*100]};function R9e(t){Array.isArray(t)&&t.raw&&(t=String.raw(...arguments));var e,n=A9e(t);if(!n.space)return[];const r=n.space[0]==="h"?QA.min:S$.min,i=n.space[0]==="h"?QA.max:S$.max;return e=Array(3),e[0]=Math.min(Math.max(n.values[0],r[0]),i[0]),e[1]=Math.min(Math.max(n.values[1],r[1]),i[1]),e[2]=Math.min(Math.max(n.values[2],r[2]),i[2]),n.space[0]==="h"&&(e=QA.rgb(e)),e.push(Math.min(Math.max(n.alpha,0),1)),e}function LB(t,e,n,r="circle"){if(t.getGeometry()instanceof Vl)t.setStyle(I9e(7,e,"white",2,r));else{n=typeof n=="number"?n:.25;let i=R9e(e);Array.isArray(i)?i=[i[0],i[1],i[2],n]:i=[255,255,255,n],t.setStyle(L9e(i,e,2))}}function I9e(t,e,n,r,i="circle"){return new U1({image:D9e(t,e,n,r,i)})}function D9e(t,e,n,r,i){const o=new Zh({color:e}),a=new Gl({color:n,width:r});switch(i){case"square":return new i$({fill:o,stroke:a,radius:t,points:4,angle:Math.PI/4,rotation:0});case"diamond":return new i$({fill:o,stroke:a,radius:t,points:4,angle:Math.PI/4,rotation:Math.PI/4});default:return new z1({fill:o,stroke:a,radius:t})}}function L9e(t,e,n){const r=new Zh({color:t}),i=new Gl({color:e,width:n});return new U1({fill:r,stroke:i})}function $9e(t,e,n){Va[t]}function N9e(t,e,n){if(Va[t]){const i=Va[t].getSource(),o=i==null?void 0:i.getFeatureById(e);o&&LB(o,n.color,n.opacity)}}function F9e(t,e,n){if(Va[t]){const r=Va[t],i=r.getView().getProjection(),a=(Array.isArray(e)?KL(e):e).transform(uy,i);a.getType()==="Point"?r.getView().setCenter(a.getFirstCoordinate()):n?r.getView().fit(a,{size:r.getSize()}):r.getView().setCenter(Yf(a.getExtent()))}}const JT="UPDATE_SERVER_INFO";function j9e(){return(t,e)=>{const n=hi(e());t(x2(JT,fe.get("Connecting to server"))),O5e(n.url).then(r=>{t(B9e(r))}).catch(r=>{t(ba("error",r))}).then(()=>{t(b2(JT))})}}function B9e(t){return{type:JT,serverInfo:t}}const oH="UPDATE_RESOURCES";function Gse(){return(t,e)=>{const n=hi(e());t(x2(oH,fe.get("Updating resources"))),P5e(n.url,e().userAuthState.accessToken).then(r=>{r&&window.location.reload()}).finally(()=>t(b2(oH)))}}const Hb="UPDATE_DATASETS";function Hse(){return(t,e)=>{const n=hi(e());t(x2(Hb,fe.get("Loading data"))),x5e(n.url,e().userAuthState.accessToken).then(r=>{const i=QGe();if(r=r.map(o=>({...o,variables:[...o.variables,...i[o.id]||[]]})),t(aH(r)),r.length>0){const o=e().controlState.selectedDatasetId||r[0].id;t(hle(o,r,!0))}}).catch(r=>{t(ba("error",r)),t(aH([]))}).then(()=>{t(b2(Hb))})}}function aH(t){return{type:Hb,datasets:t}}function z9e(t,e){return(n,r)=>{n(U9e(t,e));const i={};r().dataState.datasets.forEach(o=>{const[a,s]=nB(o);s.length>=0&&(i[o.id]=s)}),XGe(i)}}const qse="UPDATE_DATASET_USER_VARIABLES";function U9e(t,e){return{type:qse,datasetId:t,userVariables:e}}const $B="UPDATE_DATASET_PLACE_GROUP";function W9e(t,e){return{type:$B,datasetId:t,placeGroup:e}}const NB="ADD_DRAWN_USER_PLACE";function V9e(t,e,n,r,i){return(o,a)=>{o(G9e(t,e,n,r,i)),a().controlState.autoShowTimeSeries&&a().controlState.selectedPlaceId===e&&o(g2())}}function G9e(t,e,n,r,i){return{type:NB,placeGroupTitle:t,id:e,properties:n,geometry:r,selected:i}}const FB="ADD_IMPORTED_USER_PLACES";function H9e(t,e,n){return{type:FB,placeGroups:t,mapProjection:e,selected:n}}function Xse(t){return(e,n)=>{const r=SHe(n());let i;try{if(r==="csv"){const o=OHe(n());i=DGe(t,o)}else if(r==="geojson"){const o=CHe(n());i=jGe(t,o)}else if(r==="wkt"){const o=THe(n());i=WGe(t,o)}else i=[]}catch(o){e(ba("error",o)),e(Pp("addUserPlacesFromText")),i=[]}if(i.length>0){if(e(H9e(i,md(n()),!0)),i.length===1&&i[0].features.length===1){const a=i[0].features[0];e(v2(a.id,K1(n()),!0)),n().controlState.autoShowTimeSeries&&e(g2())}let o=0;i.forEach(a=>{o+=a.features?a.features.length:0}),e(ba("info",fe.get(`Imported ${o} place(s) in ${i.length} groups(s), 1 selected`)))}else e(ba("warning",fe.get("No places imported")))}}const jB="RENAME_USER_PLACE_GROUP";function q9e(t,e){return{type:jB,placeGroupId:t,newName:e}}const Qse="RENAME_USER_PLACE";function X9e(t,e,n){return r=>{r(Q9e(t,e,n)),$9e(t)}}function Q9e(t,e,n){return{type:Qse,placeGroupId:t,placeId:e,newName:n}}const Yse="RESTYLE_USER_PLACE";function Y9e(t,e,n){return r=>{r(K9e(t,e,n)),N9e(t,e,n)}}function K9e(t,e,n){return{type:Yse,placeGroupId:t,placeId:e,placeStyle:n}}const BB="REMOVE_USER_PLACE";function Z9e(t,e,n){return{type:BB,placeGroupId:t,placeId:e,places:n}}const Kse="REMOVE_USER_PLACE_GROUP";function J9e(t){return{type:Kse,placeGroupId:t}}function Zse(){return(t,e)=>{const n=hi(e()),r=Gr(e()),i=vo(e()),o=Z1(e()),a=xy(e()),s=e().controlState.sidebarOpen,l=e().controlState.sidebarPanelId;r&&i&&o&&a&&(l!=="stats"&&t(HB("stats")),s||t(GB(!0)),t(sH(null)),T5e(n.url,r,i,o,a,e().userAuthState.accessToken).then(c=>t(sH(c))).catch(c=>{t(ba("error",c))}))}}const Jse="ADD_STATISTICS";function sH(t){return{type:Jse,statistics:t}}const ele="REMOVE_STATISTICS";function e7e(t){return{type:ele,index:t}}function g2(){return(t,e)=>{const n=hi(e()),r=Gr(e()),i=yy(e()),o=vo(e()),a=my(e()),s=Sse(e()),l=e().controlState.timeSeriesUpdateMode,c=e().controlState.timeSeriesUseMedian,u=e().controlState.timeSeriesIncludeStdev;let f=JHe(e());const d=e().controlState.sidebarOpen,h=e().controlState.sidebarPanelId,p=jae(e());if(r&&o&&a&&i){h!=="timeSeries"&&t(HB("timeSeries")),d||t(GB(!0));const m=i.labels,g=m.length;f=f>0?f:g;let v=g-1,y=v-f+1;const x=()=>{const _=y>=0?m[y]:null,S=m[v];return C5e(n.url,r,o,s.id,s.geometry,_,S,c,u,e().userAuthState.accessToken)},b=_=>{if(_!==null&&lH(p,s.id)){const S=y>0,O=S?(g-y)/g:1;t(t7e({..._,dataProgress:O},l,v===g-1?"new":"append")),S&&lH(p,s.id)&&(y-=f,v-=f,x().then(b))}else t(ba("info","No data found here"))};x().then(b).catch(_=>{t(ba("error",_))})}}}function lH(t,e){return aB(t,e)!==null}const tle="UPDATE_TIME_SERIES";function t7e(t,e,n){return{type:tle,timeSeries:t,updateMode:e,dataMode:n}}const nle="ADD_PLACE_GROUP_TIME_SERIES";function n7e(t,e){return{type:nle,timeSeriesGroupId:t,timeSeries:e}}const rle="REMOVE_TIME_SERIES";function r7e(t,e){return{type:rle,groupId:t,index:e}}const ile="REMOVE_TIME_SERIES_GROUP";function i7e(t){return{type:ile,id:t}}const ole="REMOVE_ALL_TIME_SERIES";function o7e(){return{type:ole}}const zB="CONFIGURE_SERVERS";function a7e(t,e){return(n,r)=>{r().controlState.selectedServerId!==e?(n(o7e()),n(cH(t,e)),n(UB())):r().dataState.userServers!==t&&n(cH(t,e))}}function cH(t,e){return{type:zB,servers:t,selectedServerId:e}}function UB(){return t=>{t(j9e()),t(Hse()),t(s7e()),t(c7e())}}const ale="UPDATE_EXPRESSION_CAPABILITIES";function s7e(){return(t,e)=>{const n=hi(e());S5e(n.url).then(r=>{t(l7e(r))}).catch(r=>{t(ba("error",r))})}}function l7e(t){return{type:ale,expressionCapabilities:t}}const sle="UPDATE_COLOR_BARS";function c7e(){return(t,e)=>{const n=hi(e());v5e(n.url).then(r=>{t(u7e(r))}).catch(r=>{t(ba("error",r))})}}function u7e(t){return{type:sle,colorBars:t}}const lle="UPDATE_VARIABLE_COLOR_BAR";function f7e(t,e,n,r){return(i,o)=>{const a=o().controlState.selectedDatasetId,s=o().controlState.selectedVariableName;a&&s&&i(cle(a,s,t,e,n,r))}}function d7e(t,e,n,r){return(i,o)=>{const a=o().controlState.selectedDatasetId,s=o().controlState.selectedVariable2Name;a&&s&&i(cle(a,s,t,e,n,r))}}function cle(t,e,n,r,i,o){if(i==="log"){let[a,s]=r;a<=0&&(a=.001),s<=a&&(s=1),r=[a,s]}return{type:lle,datasetId:t,variableName:e,colorBarName:n,colorBarMinMax:r,colorBarNorm:i,opacity:o}}const ule="UPDATE_VARIABLE_VOLUME";function h7e(t,e,n,r,i){return{type:ule,datasetId:t,variableName:e,variableColorBar:n,volumeRenderMode:r,volumeIsoThreshold:i}}function p7e(){return(t,e)=>{const{exportTimeSeries:n,exportTimeSeriesSeparator:r,exportPlaces:i,exportPlacesAsCollection:o,exportZipArchive:a,exportFileName:s}=e().controlState;let l=[];n?(l=[],q1(e()).forEach(u=>{u.placeGroups&&(l=l.concat(u.placeGroups))}),l=[...l,...X1(e())]):i&&(l=vy(e())),v7e(e().dataState.timeSeriesGroups,l,{includeTimeSeries:n,includePlaces:i,separator:r,placesAsCollection:o,zip:a,fileName:s})}}class fle{}class m7e extends fle{constructor(n){super();Yt(this,"fileName");Yt(this,"zipArchive");this.fileName=n,this.zipArchive=new P9e}write(n,r){this.zipArchive.file(n,r)}close(){this.zipArchive.generateAsync({type:"blob"}).then(n=>Use.saveAs(n,this.fileName))}}class g7e extends fle{write(e,n){const r=new Blob([n],{type:"text/plain;charset=utf-8"});Use.saveAs(r,e)}close(){}}function v7e(t,e,n){const{includeTimeSeries:r,includePlaces:i,placesAsCollection:o,zip:a}=n;let{separator:s,fileName:l}=n;if(s=s||"TAB",s.toUpperCase()==="TAB"&&(s=" "),l=l||"export",!r&&!i)return;let c;a?c=new m7e(`${l}.zip`):c=new g7e;let u;if(r){const{colNames:f,dataRows:d,referencedPlaces:h}=eGe(t,e),p={number:!0,string:!0},m=f.join(s),g=d.map(y=>y.map(x=>p[typeof x]?x+"":"").join(s)),v=[m].concat(g).join(` -`);c.write(`${l}.txt`,v),u=h}else u={},e.forEach(f=>{f.features&&f.features.forEach(d=>{u[d.id]=d})});if(i)if(o){const f={type:"FeatureCollection",features:Object.keys(u).map(d=>u[d])};c.write(`${l}.geojson`,JSON.stringify(f,null,2))}else Object.keys(u).forEach(f=>{c.write(`${f}.geojson`,JSON.stringify(u[f],null,2))});c.close()}const dle="SELECT_DATASET";function hle(t,e,n){return(r,i)=>{r(y7e(t,e));const o=i().controlState.datasetLocateMode;t&&n&&o!=="doNothing"&&r(ple(t,i().controlState.datasetLocateMode==="panAndZoom"))}}function y7e(t,e){return{type:dle,selectedDatasetId:t,datasets:e}}function x7e(){return(t,e)=>{const n=Q1(e());n&&t(ple(n,!0))}}function b7e(){return(t,e)=>{const n=my(e());n&&t(mle(n,!0))}}function ple(t,e){return(n,r)=>{const i=q1(r()),o=Fb(i,t);o&&o.bbox&&n(O$(o.bbox,e))}}const _7e=["Point","LineString","LinearRing","Polygon","MultiPoint","MultiLineString","MultiPolygon","Circle"];function mle(t,e){return(n,r)=>{const i=vy(r()),o=aB(i,t);o&&(o.bbox&&o.bbox.length===4?n(O$(o.bbox,e)):o.geometry&&_7e.includes(o.geometry.type)&&n(O$(new Tp().readGeometry(o.geometry),e)))}}function O$(t,e){return n=>{if(t!==null){const r="map";n(w7e(r,t)),F9e(r,t,e)}}}const gle="FLY_TO";function w7e(t,e){return{type:gle,mapId:t,location:e}}const vle="SELECT_PLACE_GROUPS";function S7e(t){return(e,n)=>{const r=hi(n());e(O7e(t));const i=Gr(n()),o=wse(n());if(i!==null&&o.length>0){for(const a of o)if(!ay(a)){const s=i.id,l=a.id,c=`${$B}-${s}-${l}`;e(x2(c,fe.get("Loading places"))),w5e(r.url,s,l,n().userAuthState.accessToken).then(u=>{e(W9e(i.id,u))}).catch(u=>{e(ba("error",u))}).finally(()=>{e(b2(c))})}}}}function O7e(t){return{type:vle,selectedPlaceGroupIds:t}}const yle="SELECT_PLACE";function v2(t,e,n){return(r,i)=>{r(C7e(t,e));const o=i().controlState.placeLocateMode;n&&t&&o!=="doNothing"&&r(mle(t,i().controlState.placeLocateMode==="panAndZoom"))}}function C7e(t,e){return{type:yle,placeId:t,places:e}}const xle="SET_LAYER_VISIBILITY";function T7e(t,e){return{type:xle,layerId:t,visible:e}}const ble="SET_MAP_POINT_INFO_BOX_ENABLED";function E7e(t){return{type:ble,mapPointInfoBoxEnabled:t}}const _le="SET_VARIABLE_COMPARE_MODE";function P7e(t){return{type:_le,variableCompareMode:t}}const WB="SET_VARIABLE_SPLIT_POS";function M7e(t){return{type:WB,variableSplitPos:t}}const wle="SELECT_VARIABLE";function Sle(t){return{type:wle,selectedVariableName:t}}const Ole="SELECT_VARIABLE_2";function k7e(t,e){return{type:Ole,selectedDataset2Id:t,selectedVariable2Name:e}}const Cle="SELECT_TIME";function y2(t){return{type:Cle,selectedTime:t}}const Tle="INC_SELECTED_TIME";function A7e(t){return{type:Tle,increment:t}}const VB="SELECT_TIME_RANGE";function Ele(t,e,n){return{type:VB,selectedTimeRange:t,selectedGroupId:e,selectedValueRange:n}}const R7e="SELECT_TIME_SERIES_UPDATE_MODE",Ple="UPDATE_TIME_ANIMATION";function I7e(t,e){return{type:Ple,timeAnimationActive:t,timeAnimationInterval:e}}const Mle="SET_MAP_INTERACTION";function kle(t){return{type:Mle,mapInteraction:t}}const Ale="SET_LAYER_MENU_OPEN";function Rle(t){return{type:Ale,layerMenuOpen:t}}const Ile="SET_SIDEBAR_POSITION";function D7e(t){return{type:Ile,sidebarPosition:t}}const Dle="SET_SIDEBAR_OPEN";function GB(t){return{type:Dle,sidebarOpen:t}}const Lle="SET_SIDEBAR_PANEL_ID";function HB(t){return{type:Lle,sidebarPanelId:t}}const $le="SET_VOLUME_RENDER_MODE";function L7e(t){return{type:$le,volumeRenderMode:t}}const Nle="UPDATE_VOLUME_STATE";function $7e(t,e){return{type:Nle,volumeId:t,volumeState:e}}const Fle="SET_VISIBLE_INFO_CARD_ELEMENTS";function N7e(t){return{type:Fle,visibleElements:t}}const jle="UPDATE_INFO_CARD_ELEMENT_VIEW_MODE";function F7e(t,e){return{type:jle,elementType:t,viewMode:e}}const Ble="ADD_ACTIVITY";function x2(t,e){return{type:Ble,id:t,message:e}}const zle="REMOVE_ACTIVITY";function b2(t){return{type:zle,id:t}}const Ule="CHANGE_LOCALE";function Wle(t){return{type:Ule,locale:t}}const Vle="OPEN_DIALOG";function Pp(t){return{type:Vle,dialogId:t}}const Gle="CLOSE_DIALOG";function by(t){return{type:Gle,dialogId:t}}const qB="UPDATE_SETTINGS";function J1(t){return{type:qB,settings:t}}const Hle="STORE_SETTINGS";function qle(){return{type:Hle}}function Xle(t){return e=>{e(j7e(t)),e(B7e(t))}}const Qle="ADD_USER_COLOR_BAR";function j7e(t){return{type:Qle,colorBarId:t}}const Yle="REMOVE_USER_COLOR_BAR";function Kle(t){return{type:Yle,colorBarId:t}}function Zle(t){return e=>{e(ece(t)),e(XB(t))}}const Jle="UPDATE_USER_COLOR_BAR";function ece(t){return{type:Jle,userColorBar:t}}function B7e(t){return(e,n)=>{const r=n().controlState.userColorBars.find(i=>i.id===t);r&&e(XB(r))}}function XB(t){return e=>{nBe(t).then(({imageData:n,errorMessage:r})=>{e(ece({...t,imageData:n,errorMessage:r}))})}}function z7e(){return(t,e)=>{e().controlState.userColorBars.forEach(n=>{n.imageData||t(XB(n))})}}function tce(t){return{type:qB,settings:{userColorBars:t}}}const uH=["http","https","mailto","tel"];function U7e(t){const e=(t||"").trim(),n=e.charAt(0);if(n==="#"||n==="/")return e;const r=e.indexOf(":");if(r===-1)return e;let i=-1;for(;++ii||(i=e.indexOf("#"),i!==-1&&r>i)?e:"javascript:void(0)"}/*! +\0`,q+=o($,2),q+=S.magic,q+=o(x,2),q+=o(b,2),q+=o(N.crc32,4),q+=o(N.compressedSize,4),q+=o(N.uncompressedSize,4),q+=o(C.length,2),q+=o(L.length,2),{fileRecord:f.LOCAL_FILE_HEADER+q+C+L,dirRecord:f.CENTRAL_FILE_HEADER+o(A,2)+q+o(I.length,2)+"\0\0\0\0"+o(D,4)+o(g,4)+C+L+I}}var s=n("../utils"),l=n("../stream/GenericWorker"),c=n("../utf8"),u=n("../crc32"),f=n("../signature");function d(h,p,m,g){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=p,this.zipPlatform=m,this.encodeFileName=g,this.streamFiles=h,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}s.inherits(d,l),d.prototype.push=function(h){var p=h.meta.percent||0,m=this.entriesCount,g=this._sources.length;this.accumulate?this.contentBuffer.push(h):(this.bytesWritten+=h.data.length,l.prototype.push.call(this,{data:h.data,meta:{currentFile:this.currentFile,percent:m?(p+100*(m-g-1))/m:100}}))},d.prototype.openedSource=function(h){this.currentSourceOffset=this.bytesWritten,this.currentFile=h.file.name;var p=this.streamFiles&&!h.file.dir;if(p){var m=a(h,p,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:m.fileRecord,meta:{percent:0}})}else this.accumulate=!0},d.prototype.closedSource=function(h){this.accumulate=!1;var p=this.streamFiles&&!h.file.dir,m=a(h,p,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(m.dirRecord),p)this.push({data:function(g){return f.DATA_DESCRIPTOR+o(g.crc32,4)+o(g.compressedSize,4)+o(g.uncompressedSize,4)}(h),meta:{percent:100}});else for(this.push({data:m.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},d.prototype.flush=function(){for(var h=this.bytesWritten,p=0;p=this.index;l--)c=(c<<8)+this.byteAt(l);return this.index+=s,c},readString:function(s){return o.transformTo("string",this.readData(s))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var s=this.readInt(4);return new Date(Date.UTC(1980+(s>>25&127),(s>>21&15)-1,s>>16&31,s>>11&31,s>>5&63,(31&s)<<1))}},r.exports=a},{"../utils":32}],19:[function(n,r,i){var o=n("./Uint8ArrayReader");function a(s){o.call(this,s)}n("../utils").inherits(a,o),a.prototype.readData=function(s){this.checkOffset(s);var l=this.data.slice(this.zero+this.index,this.zero+this.index+s);return this.index+=s,l},r.exports=a},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(n,r,i){var o=n("./DataReader");function a(s){o.call(this,s)}n("../utils").inherits(a,o),a.prototype.byteAt=function(s){return this.data.charCodeAt(this.zero+s)},a.prototype.lastIndexOfSignature=function(s){return this.data.lastIndexOf(s)-this.zero},a.prototype.readAndCheckSignature=function(s){return s===this.readData(4)},a.prototype.readData=function(s){this.checkOffset(s);var l=this.data.slice(this.zero+this.index,this.zero+this.index+s);return this.index+=s,l},r.exports=a},{"../utils":32,"./DataReader":18}],21:[function(n,r,i){var o=n("./ArrayReader");function a(s){o.call(this,s)}n("../utils").inherits(a,o),a.prototype.readData=function(s){if(this.checkOffset(s),s===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+s);return this.index+=s,l},r.exports=a},{"../utils":32,"./ArrayReader":17}],22:[function(n,r,i){var o=n("../utils"),a=n("../support"),s=n("./ArrayReader"),l=n("./StringReader"),c=n("./NodeBufferReader"),u=n("./Uint8ArrayReader");r.exports=function(f){var d=o.getTypeOf(f);return o.checkSupport(d),d!=="string"||a.uint8array?d==="nodebuffer"?new c(f):a.uint8array?new u(o.transformTo("uint8array",f)):new s(o.transformTo("array",f)):new l(f)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(n,r,i){i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(n,r,i){var o=n("./GenericWorker"),a=n("../utils");function s(l){o.call(this,"ConvertWorker to "+l),this.destType=l}a.inherits(s,o),s.prototype.processChunk=function(l){this.push({data:a.transformTo(this.destType,l.data),meta:l.meta})},r.exports=s},{"../utils":32,"./GenericWorker":28}],25:[function(n,r,i){var o=n("./GenericWorker"),a=n("../crc32");function s(){o.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}n("../utils").inherits(s,o),s.prototype.processChunk=function(l){this.streamInfo.crc32=a(l.data,this.streamInfo.crc32||0),this.push(l)},r.exports=s},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(n,r,i){var o=n("../utils"),a=n("./GenericWorker");function s(l){a.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}o.inherits(s,a),s.prototype.processChunk=function(l){if(l){var c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+l.data.length}a.prototype.processChunk.call(this,l)},r.exports=s},{"../utils":32,"./GenericWorker":28}],27:[function(n,r,i){var o=n("../utils"),a=n("./GenericWorker");function s(l){a.call(this,"DataWorker");var c=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(u){c.dataIsReady=!0,c.data=u,c.max=u&&u.length||0,c.type=o.getTypeOf(u),c.isPaused||c._tickAndRepeat()},function(u){c.error(u)})}o.inherits(s,a),s.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,o.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(o.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,c=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,c);break;case"uint8array":l=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":l=this.data.slice(this.index,c)}return this.index=c,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=s},{"../utils":32,"./GenericWorker":28}],28:[function(n,r,i){function o(a){this.name=a||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}o.prototype={push:function(a){this.emit("data",a)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(a){this.emit("error",a)}return!0},error:function(a){return!this.isFinished&&(this.isPaused?this.generatedError=a:(this.isFinished=!0,this.emit("error",a),this.previous&&this.previous.error(a),this.cleanUp()),!0)},on:function(a,s){return this._listeners[a].push(s),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(a,s){if(this._listeners[a])for(var l=0;l "+a:a}},r.exports=o},{}],29:[function(n,r,i){var o=n("../utils"),a=n("./ConvertWorker"),s=n("./GenericWorker"),l=n("../base64"),c=n("../support"),u=n("../external"),f=null;if(c.nodestream)try{f=n("../nodejs/NodejsStreamOutputAdapter")}catch{}function d(p,m){return new u.Promise(function(g,v){var y=[],x=p._internalType,b=p._outputType,_=p._mimeType;p.on("data",function(S,O){y.push(S),m&&m(O)}).on("error",function(S){y=[],v(S)}).on("end",function(){try{var S=function(O,C,E){switch(O){case"blob":return o.newBlob(o.transformTo("arraybuffer",C),E);case"base64":return l.encode(C);default:return o.transformTo(O,C)}}(b,function(O,C){var E,k=0,I=null,P=0;for(E=0;E"u")i.blob=!1;else{var o=new ArrayBuffer(0);try{i.blob=new Blob([o],{type:"application/zip"}).size===0}catch{try{var a=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);a.append(o),i.blob=a.getBlob("application/zip").size===0}catch{i.blob=!1}}}try{i.nodestream=!!n("readable-stream").Readable}catch{i.nodestream=!1}},{"readable-stream":16}],31:[function(n,r,i){for(var o=n("./utils"),a=n("./support"),s=n("./nodejsUtils"),l=n("./stream/GenericWorker"),c=new Array(256),u=0;u<256;u++)c[u]=252<=u?6:248<=u?5:240<=u?4:224<=u?3:192<=u?2:1;c[254]=c[254]=1;function f(){l.call(this,"utf-8 decode"),this.leftOver=null}function d(){l.call(this,"utf-8 encode")}i.utf8encode=function(h){return a.nodebuffer?s.newBufferFrom(h,"utf-8"):function(p){var m,g,v,y,x,b=p.length,_=0;for(y=0;y>>6:(g<65536?m[x++]=224|g>>>12:(m[x++]=240|g>>>18,m[x++]=128|g>>>12&63),m[x++]=128|g>>>6&63),m[x++]=128|63&g);return m}(h)},i.utf8decode=function(h){return a.nodebuffer?o.transformTo("nodebuffer",h).toString("utf-8"):function(p){var m,g,v,y,x=p.length,b=new Array(2*x);for(m=g=0;m>10&1023,b[g++]=56320|1023&v)}return b.length!==g&&(b.subarray?b=b.subarray(0,g):b.length=g),o.applyFromCharCode(b)}(h=o.transformTo(a.uint8array?"uint8array":"array",h))},o.inherits(f,l),f.prototype.processChunk=function(h){var p=o.transformTo(a.uint8array?"uint8array":"array",h.data);if(this.leftOver&&this.leftOver.length){if(a.uint8array){var m=p;(p=new Uint8Array(m.length+this.leftOver.length)).set(this.leftOver,0),p.set(m,this.leftOver.length)}else p=this.leftOver.concat(p);this.leftOver=null}var g=function(y,x){var b;for((x=x||y.length)>y.length&&(x=y.length),b=x-1;0<=b&&(192&y[b])==128;)b--;return b<0||b===0?x:b+c[y[b]]>x?b:x}(p),v=p;g!==p.length&&(a.uint8array?(v=p.subarray(0,g),this.leftOver=p.subarray(g,p.length)):(v=p.slice(0,g),this.leftOver=p.slice(g,p.length))),this.push({data:i.utf8decode(v),meta:h.meta})},f.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=f,o.inherits(d,l),d.prototype.processChunk=function(h){this.push({data:i.utf8encode(h.data),meta:h.meta})},i.Utf8EncodeWorker=d},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(n,r,i){var o=n("./support"),a=n("./base64"),s=n("./nodejsUtils"),l=n("./external");function c(m){return m}function u(m,g){for(var v=0;v>8;this.dir=!!(16&this.externalFileAttributes),h==0&&(this.dosPermissions=63&this.externalFileAttributes),h==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var h=o(this.extraFields[1].value);this.uncompressedSize===a.MAX_VALUE_32BITS&&(this.uncompressedSize=h.readInt(8)),this.compressedSize===a.MAX_VALUE_32BITS&&(this.compressedSize=h.readInt(8)),this.localHeaderOffset===a.MAX_VALUE_32BITS&&(this.localHeaderOffset=h.readInt(8)),this.diskNumberStart===a.MAX_VALUE_32BITS&&(this.diskNumberStart=h.readInt(4))}},readExtraFields:function(h){var p,m,g,v=h.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});h.index+4>>6:(h<65536?d[g++]=224|h>>>12:(d[g++]=240|h>>>18,d[g++]=128|h>>>12&63),d[g++]=128|h>>>6&63),d[g++]=128|63&h);return d},i.buf2binstring=function(f){return u(f,f.length)},i.binstring2buf=function(f){for(var d=new o.Buf8(f.length),h=0,p=d.length;h>10&1023,y[p++]=56320|1023&m)}return u(y,p)},i.utf8border=function(f,d){var h;for((d=d||f.length)>f.length&&(d=f.length),h=d-1;0<=h&&(192&f[h])==128;)h--;return h<0||h===0?d:h+l[f[h]]>d?h:d}},{"./common":41}],43:[function(n,r,i){r.exports=function(o,a,s,l){for(var c=65535&o|0,u=o>>>16&65535|0,f=0;s!==0;){for(s-=f=2e3>>1:a>>>1;s[l]=a}return s}();r.exports=function(a,s,l,c){var u=o,f=c+l;a^=-1;for(var d=c;d>>8^u[255&(a^s[d])];return-1^a}},{}],46:[function(n,r,i){var o,a=n("../utils/common"),s=n("./trees"),l=n("./adler32"),c=n("./crc32"),u=n("./messages"),f=0,d=4,h=0,p=-2,m=-1,g=4,v=2,y=8,x=9,b=286,_=30,S=19,O=2*b+1,C=15,E=3,k=258,I=k+E+1,P=42,R=113,T=1,L=2,z=3,B=4;function W(F,ce){return F.msg=u[ce],ce}function U(F){return(F<<1)-(4F.avail_out&&(le=F.avail_out),le!==0&&(a.arraySet(F.output,ce.pending_buf,ce.pending_out,le,F.next_out),F.next_out+=le,ce.pending_out+=le,F.total_out+=le,F.avail_out-=le,ce.pending-=le,ce.pending===0&&(ce.pending_out=0))}function D(F,ce){s._tr_flush_block(F,0<=F.block_start?F.block_start:-1,F.strstart-F.block_start,ce),F.block_start=F.strstart,$(F.strm)}function A(F,ce){F.pending_buf[F.pending++]=ce}function q(F,ce){F.pending_buf[F.pending++]=ce>>>8&255,F.pending_buf[F.pending++]=255&ce}function Y(F,ce){var le,Q,X=F.max_chain_length,ee=F.strstart,ge=F.prev_length,ye=F.nice_match,H=F.strstart>F.w_size-I?F.strstart-(F.w_size-I):0,G=F.window,ie=F.w_mask,he=F.prev,_e=F.strstart+k,oe=G[ee+ge-1],Z=G[ee+ge];F.prev_length>=F.good_match&&(X>>=2),ye>F.lookahead&&(ye=F.lookahead);do if(G[(le=ce)+ge]===Z&&G[le+ge-1]===oe&&G[le]===G[ee]&&G[++le]===G[ee+1]){ee+=2,le++;do;while(G[++ee]===G[++le]&&G[++ee]===G[++le]&&G[++ee]===G[++le]&&G[++ee]===G[++le]&&G[++ee]===G[++le]&&G[++ee]===G[++le]&&G[++ee]===G[++le]&&G[++ee]===G[++le]&&ee<_e);if(Q=k-(_e-ee),ee=_e-k,geH&&--X!=0);return ge<=F.lookahead?ge:F.lookahead}function K(F){var ce,le,Q,X,ee,ge,ye,H,G,ie,he=F.w_size;do{if(X=F.window_size-F.lookahead-F.strstart,F.strstart>=he+(he-I)){for(a.arraySet(F.window,F.window,he,he,0),F.match_start-=he,F.strstart-=he,F.block_start-=he,ce=le=F.hash_size;Q=F.head[--ce],F.head[ce]=he<=Q?Q-he:0,--le;);for(ce=le=he;Q=F.prev[--ce],F.prev[ce]=he<=Q?Q-he:0,--le;);X+=he}if(F.strm.avail_in===0)break;if(ge=F.strm,ye=F.window,H=F.strstart+F.lookahead,G=X,ie=void 0,ie=ge.avail_in,G=E)for(ee=F.strstart-F.insert,F.ins_h=F.window[ee],F.ins_h=(F.ins_h<=E&&(F.ins_h=(F.ins_h<=E)if(Q=s._tr_tally(F,F.strstart-F.match_start,F.match_length-E),F.lookahead-=F.match_length,F.match_length<=F.max_lazy_match&&F.lookahead>=E){for(F.match_length--;F.strstart++,F.ins_h=(F.ins_h<=E&&(F.ins_h=(F.ins_h<=E&&F.match_length<=F.prev_length){for(X=F.strstart+F.lookahead-E,Q=s._tr_tally(F,F.strstart-1-F.prev_match,F.prev_length-E),F.lookahead-=F.prev_length-1,F.prev_length-=2;++F.strstart<=X&&(F.ins_h=(F.ins_h<F.pending_buf_size-5&&(le=F.pending_buf_size-5);;){if(F.lookahead<=1){if(K(F),F.lookahead===0&&ce===f)return T;if(F.lookahead===0)break}F.strstart+=F.lookahead,F.lookahead=0;var Q=F.block_start+le;if((F.strstart===0||F.strstart>=Q)&&(F.lookahead=F.strstart-Q,F.strstart=Q,D(F,!1),F.strm.avail_out===0)||F.strstart-F.block_start>=F.w_size-I&&(D(F,!1),F.strm.avail_out===0))return T}return F.insert=0,ce===d?(D(F,!0),F.strm.avail_out===0?z:B):(F.strstart>F.block_start&&(D(F,!1),F.strm.avail_out),T)}),new J(4,4,8,4,se),new J(4,5,16,8,se),new J(4,6,32,32,se),new J(4,4,16,16,te),new J(8,16,32,32,te),new J(8,16,128,128,te),new J(8,32,128,256,te),new J(32,128,258,1024,te),new J(32,258,258,4096,te)],i.deflateInit=function(F,ce){return ve(F,ce,y,15,8,0)},i.deflateInit2=ve,i.deflateReset=re,i.deflateResetKeep=be,i.deflateSetHeader=function(F,ce){return F&&F.state?F.state.wrap!==2?p:(F.state.gzhead=ce,h):p},i.deflate=function(F,ce){var le,Q,X,ee;if(!F||!F.state||5>8&255),A(Q,Q.gzhead.time>>16&255),A(Q,Q.gzhead.time>>24&255),A(Q,Q.level===9?2:2<=Q.strategy||Q.level<2?4:0),A(Q,255&Q.gzhead.os),Q.gzhead.extra&&Q.gzhead.extra.length&&(A(Q,255&Q.gzhead.extra.length),A(Q,Q.gzhead.extra.length>>8&255)),Q.gzhead.hcrc&&(F.adler=c(F.adler,Q.pending_buf,Q.pending,0)),Q.gzindex=0,Q.status=69):(A(Q,0),A(Q,0),A(Q,0),A(Q,0),A(Q,0),A(Q,Q.level===9?2:2<=Q.strategy||Q.level<2?4:0),A(Q,3),Q.status=R);else{var ge=y+(Q.w_bits-8<<4)<<8;ge|=(2<=Q.strategy||Q.level<2?0:Q.level<6?1:Q.level===6?2:3)<<6,Q.strstart!==0&&(ge|=32),ge+=31-ge%31,Q.status=R,q(Q,ge),Q.strstart!==0&&(q(Q,F.adler>>>16),q(Q,65535&F.adler)),F.adler=1}if(Q.status===69)if(Q.gzhead.extra){for(X=Q.pending;Q.gzindex<(65535&Q.gzhead.extra.length)&&(Q.pending!==Q.pending_buf_size||(Q.gzhead.hcrc&&Q.pending>X&&(F.adler=c(F.adler,Q.pending_buf,Q.pending-X,X)),$(F),X=Q.pending,Q.pending!==Q.pending_buf_size));)A(Q,255&Q.gzhead.extra[Q.gzindex]),Q.gzindex++;Q.gzhead.hcrc&&Q.pending>X&&(F.adler=c(F.adler,Q.pending_buf,Q.pending-X,X)),Q.gzindex===Q.gzhead.extra.length&&(Q.gzindex=0,Q.status=73)}else Q.status=73;if(Q.status===73)if(Q.gzhead.name){X=Q.pending;do{if(Q.pending===Q.pending_buf_size&&(Q.gzhead.hcrc&&Q.pending>X&&(F.adler=c(F.adler,Q.pending_buf,Q.pending-X,X)),$(F),X=Q.pending,Q.pending===Q.pending_buf_size)){ee=1;break}ee=Q.gzindexX&&(F.adler=c(F.adler,Q.pending_buf,Q.pending-X,X)),ee===0&&(Q.gzindex=0,Q.status=91)}else Q.status=91;if(Q.status===91)if(Q.gzhead.comment){X=Q.pending;do{if(Q.pending===Q.pending_buf_size&&(Q.gzhead.hcrc&&Q.pending>X&&(F.adler=c(F.adler,Q.pending_buf,Q.pending-X,X)),$(F),X=Q.pending,Q.pending===Q.pending_buf_size)){ee=1;break}ee=Q.gzindexX&&(F.adler=c(F.adler,Q.pending_buf,Q.pending-X,X)),ee===0&&(Q.status=103)}else Q.status=103;if(Q.status===103&&(Q.gzhead.hcrc?(Q.pending+2>Q.pending_buf_size&&$(F),Q.pending+2<=Q.pending_buf_size&&(A(Q,255&F.adler),A(Q,F.adler>>8&255),F.adler=0,Q.status=R)):Q.status=R),Q.pending!==0){if($(F),F.avail_out===0)return Q.last_flush=-1,h}else if(F.avail_in===0&&U(ce)<=U(le)&&ce!==d)return W(F,-5);if(Q.status===666&&F.avail_in!==0)return W(F,-5);if(F.avail_in!==0||Q.lookahead!==0||ce!==f&&Q.status!==666){var ye=Q.strategy===2?function(H,G){for(var ie;;){if(H.lookahead===0&&(K(H),H.lookahead===0)){if(G===f)return T;break}if(H.match_length=0,ie=s._tr_tally(H,0,H.window[H.strstart]),H.lookahead--,H.strstart++,ie&&(D(H,!1),H.strm.avail_out===0))return T}return H.insert=0,G===d?(D(H,!0),H.strm.avail_out===0?z:B):H.last_lit&&(D(H,!1),H.strm.avail_out===0)?T:L}(Q,ce):Q.strategy===3?function(H,G){for(var ie,he,_e,oe,Z=H.window;;){if(H.lookahead<=k){if(K(H),H.lookahead<=k&&G===f)return T;if(H.lookahead===0)break}if(H.match_length=0,H.lookahead>=E&&0H.lookahead&&(H.match_length=H.lookahead)}if(H.match_length>=E?(ie=s._tr_tally(H,1,H.match_length-E),H.lookahead-=H.match_length,H.strstart+=H.match_length,H.match_length=0):(ie=s._tr_tally(H,0,H.window[H.strstart]),H.lookahead--,H.strstart++),ie&&(D(H,!1),H.strm.avail_out===0))return T}return H.insert=0,G===d?(D(H,!0),H.strm.avail_out===0?z:B):H.last_lit&&(D(H,!1),H.strm.avail_out===0)?T:L}(Q,ce):o[Q.level].func(Q,ce);if(ye!==z&&ye!==B||(Q.status=666),ye===T||ye===z)return F.avail_out===0&&(Q.last_flush=-1),h;if(ye===L&&(ce===1?s._tr_align(Q):ce!==5&&(s._tr_stored_block(Q,0,0,!1),ce===3&&(N(Q.head),Q.lookahead===0&&(Q.strstart=0,Q.block_start=0,Q.insert=0))),$(F),F.avail_out===0))return Q.last_flush=-1,h}return ce!==d?h:Q.wrap<=0?1:(Q.wrap===2?(A(Q,255&F.adler),A(Q,F.adler>>8&255),A(Q,F.adler>>16&255),A(Q,F.adler>>24&255),A(Q,255&F.total_in),A(Q,F.total_in>>8&255),A(Q,F.total_in>>16&255),A(Q,F.total_in>>24&255)):(q(Q,F.adler>>>16),q(Q,65535&F.adler)),$(F),0=le.w_size&&(ee===0&&(N(le.head),le.strstart=0,le.block_start=0,le.insert=0),G=new a.Buf8(le.w_size),a.arraySet(G,ce,ie-le.w_size,le.w_size,0),ce=G,ie=le.w_size),ge=F.avail_in,ye=F.next_in,H=F.input,F.avail_in=ie,F.next_in=0,F.input=ce,K(le);le.lookahead>=E;){for(Q=le.strstart,X=le.lookahead-(E-1);le.ins_h=(le.ins_h<>>=E=C>>>24,x-=E,(E=C>>>16&255)===0)L[u++]=65535&C;else{if(!(16&E)){if(!(64&E)){C=b[(65535&C)+(y&(1<>>=E,x-=E),x<15&&(y+=T[l++]<>>=E=C>>>24,x-=E,!(16&(E=C>>>16&255))){if(!(64&E)){C=_[(65535&C)+(y&(1<>>=E,x-=E,(E=u-f)>3,y&=(1<<(x-=k<<3))-1,o.next_in=l,o.next_out=u,o.avail_in=l>>24&255)+(P>>>8&65280)+((65280&P)<<8)+((255&P)<<24)}function y(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new o.Buf16(320),this.work=new o.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function x(P){var R;return P&&P.state?(R=P.state,P.total_in=P.total_out=R.total=0,P.msg="",R.wrap&&(P.adler=1&R.wrap),R.mode=p,R.last=0,R.havedict=0,R.dmax=32768,R.head=null,R.hold=0,R.bits=0,R.lencode=R.lendyn=new o.Buf32(m),R.distcode=R.distdyn=new o.Buf32(g),R.sane=1,R.back=-1,d):h}function b(P){var R;return P&&P.state?((R=P.state).wsize=0,R.whave=0,R.wnext=0,x(P)):h}function _(P,R){var T,L;return P&&P.state?(L=P.state,R<0?(T=0,R=-R):(T=1+(R>>4),R<48&&(R&=15)),R&&(R<8||15=B.wsize?(o.arraySet(B.window,R,T-B.wsize,B.wsize,0),B.wnext=0,B.whave=B.wsize):(L<(z=B.wsize-B.wnext)&&(z=L),o.arraySet(B.window,R,T-L,z,B.wnext),(L-=z)?(o.arraySet(B.window,R,T-L,L,0),B.wnext=L,B.whave=B.wsize):(B.wnext+=z,B.wnext===B.wsize&&(B.wnext=0),B.whave>>8&255,T.check=s(T.check,ee,2,0),D=$=0,T.mode=2;break}if(T.flags=0,T.head&&(T.head.done=!1),!(1&T.wrap)||(((255&$)<<8)+($>>8))%31){P.msg="incorrect header check",T.mode=30;break}if((15&$)!=8){P.msg="unknown compression method",T.mode=30;break}if(D-=4,F=8+(15&($>>>=4)),T.wbits===0)T.wbits=F;else if(F>T.wbits){P.msg="invalid window size",T.mode=30;break}T.dmax=1<>8&1),512&T.flags&&(ee[0]=255&$,ee[1]=$>>>8&255,T.check=s(T.check,ee,2,0)),D=$=0,T.mode=3;case 3:for(;D<32;){if(U===0)break e;U--,$+=L[B++]<>>8&255,ee[2]=$>>>16&255,ee[3]=$>>>24&255,T.check=s(T.check,ee,4,0)),D=$=0,T.mode=4;case 4:for(;D<16;){if(U===0)break e;U--,$+=L[B++]<>8),512&T.flags&&(ee[0]=255&$,ee[1]=$>>>8&255,T.check=s(T.check,ee,2,0)),D=$=0,T.mode=5;case 5:if(1024&T.flags){for(;D<16;){if(U===0)break e;U--,$+=L[B++]<>>8&255,T.check=s(T.check,ee,2,0)),D=$=0}else T.head&&(T.head.extra=null);T.mode=6;case 6:if(1024&T.flags&&(U<(Y=T.length)&&(Y=U),Y&&(T.head&&(F=T.head.extra_len-T.length,T.head.extra||(T.head.extra=new Array(T.head.extra_len)),o.arraySet(T.head.extra,L,B,Y,F)),512&T.flags&&(T.check=s(T.check,L,Y,B)),U-=Y,B+=Y,T.length-=Y),T.length))break e;T.length=0,T.mode=7;case 7:if(2048&T.flags){if(U===0)break e;for(Y=0;F=L[B+Y++],T.head&&F&&T.length<65536&&(T.head.name+=String.fromCharCode(F)),F&&Y>9&1,T.head.done=!0),P.adler=T.check=0,T.mode=12;break;case 10:for(;D<32;){if(U===0)break e;U--,$+=L[B++]<>>=7&D,D-=7&D,T.mode=27;break}for(;D<3;){if(U===0)break e;U--,$+=L[B++]<>>=1)){case 0:T.mode=14;break;case 1:if(k(T),T.mode=20,R!==6)break;$>>>=2,D-=2;break e;case 2:T.mode=17;break;case 3:P.msg="invalid block type",T.mode=30}$>>>=2,D-=2;break;case 14:for($>>>=7&D,D-=7&D;D<32;){if(U===0)break e;U--,$+=L[B++]<>>16^65535)){P.msg="invalid stored block lengths",T.mode=30;break}if(T.length=65535&$,D=$=0,T.mode=15,R===6)break e;case 15:T.mode=16;case 16:if(Y=T.length){if(U>>=5,D-=5,T.ndist=1+(31&$),$>>>=5,D-=5,T.ncode=4+(15&$),$>>>=4,D-=4,286>>=3,D-=3}for(;T.have<19;)T.lens[ge[T.have++]]=0;if(T.lencode=T.lendyn,T.lenbits=7,le={bits:T.lenbits},ce=c(0,T.lens,0,19,T.lencode,0,T.work,le),T.lenbits=le.bits,ce){P.msg="invalid code lengths set",T.mode=30;break}T.have=0,T.mode=19;case 19:for(;T.have>>16&255,pe=65535&X,!((te=X>>>24)<=D);){if(U===0)break e;U--,$+=L[B++]<>>=te,D-=te,T.lens[T.have++]=pe;else{if(pe===16){for(Q=te+2;D>>=te,D-=te,T.have===0){P.msg="invalid bit length repeat",T.mode=30;break}F=T.lens[T.have-1],Y=3+(3&$),$>>>=2,D-=2}else if(pe===17){for(Q=te+3;D>>=te)),$>>>=3,D-=3}else{for(Q=te+7;D>>=te)),$>>>=7,D-=7}if(T.have+Y>T.nlen+T.ndist){P.msg="invalid bit length repeat",T.mode=30;break}for(;Y--;)T.lens[T.have++]=F}}if(T.mode===30)break;if(T.lens[256]===0){P.msg="invalid code -- missing end-of-block",T.mode=30;break}if(T.lenbits=9,le={bits:T.lenbits},ce=c(u,T.lens,0,T.nlen,T.lencode,0,T.work,le),T.lenbits=le.bits,ce){P.msg="invalid literal/lengths set",T.mode=30;break}if(T.distbits=6,T.distcode=T.distdyn,le={bits:T.distbits},ce=c(f,T.lens,T.nlen,T.ndist,T.distcode,0,T.work,le),T.distbits=le.bits,ce){P.msg="invalid distances set",T.mode=30;break}if(T.mode=20,R===6)break e;case 20:T.mode=21;case 21:if(6<=U&&258<=N){P.next_out=W,P.avail_out=N,P.next_in=B,P.avail_in=U,T.hold=$,T.bits=D,l(P,q),W=P.next_out,z=P.output,N=P.avail_out,B=P.next_in,L=P.input,U=P.avail_in,$=T.hold,D=T.bits,T.mode===12&&(T.back=-1);break}for(T.back=0;J=(X=T.lencode[$&(1<>>16&255,pe=65535&X,!((te=X>>>24)<=D);){if(U===0)break e;U--,$+=L[B++]<>be)])>>>16&255,pe=65535&X,!(be+(te=X>>>24)<=D);){if(U===0)break e;U--,$+=L[B++]<>>=be,D-=be,T.back+=be}if($>>>=te,D-=te,T.back+=te,T.length=pe,J===0){T.mode=26;break}if(32&J){T.back=-1,T.mode=12;break}if(64&J){P.msg="invalid literal/length code",T.mode=30;break}T.extra=15&J,T.mode=22;case 22:if(T.extra){for(Q=T.extra;D>>=T.extra,D-=T.extra,T.back+=T.extra}T.was=T.length,T.mode=23;case 23:for(;J=(X=T.distcode[$&(1<>>16&255,pe=65535&X,!((te=X>>>24)<=D);){if(U===0)break e;U--,$+=L[B++]<>be)])>>>16&255,pe=65535&X,!(be+(te=X>>>24)<=D);){if(U===0)break e;U--,$+=L[B++]<>>=be,D-=be,T.back+=be}if($>>>=te,D-=te,T.back+=te,64&J){P.msg="invalid distance code",T.mode=30;break}T.offset=pe,T.extra=15&J,T.mode=24;case 24:if(T.extra){for(Q=T.extra;D>>=T.extra,D-=T.extra,T.back+=T.extra}if(T.offset>T.dmax){P.msg="invalid distance too far back",T.mode=30;break}T.mode=25;case 25:if(N===0)break e;if(Y=q-N,T.offset>Y){if((Y=T.offset-Y)>T.whave&&T.sane){P.msg="invalid distance too far back",T.mode=30;break}K=Y>T.wnext?(Y-=T.wnext,T.wsize-Y):T.wnext-Y,Y>T.length&&(Y=T.length),se=T.window}else se=z,K=W-T.offset,Y=T.length;for(NO?(E=K[se+g[R]],D[A+g[R]]):(E=96,0),y=1<>W)+(x-=y)]=C<<24|E<<16|k|0,x!==0;);for(y=1<>=1;if(y!==0?($&=y-1,$+=y):$=0,R++,--q[P]==0){if(P===L)break;P=f[d+g[R]]}if(z>>7)]}function A(X,ee){X.pending_buf[X.pending++]=255&ee,X.pending_buf[X.pending++]=ee>>>8&255}function q(X,ee,ge){X.bi_valid>v-ge?(X.bi_buf|=ee<>v-X.bi_valid,X.bi_valid+=ge-v):(X.bi_buf|=ee<>>=1,ge<<=1,0<--ee;);return ge>>>1}function se(X,ee,ge){var ye,H,G=new Array(g+1),ie=0;for(ye=1;ye<=g;ye++)G[ye]=ie=ie+ge[ye-1]<<1;for(H=0;H<=ee;H++){var he=X[2*H+1];he!==0&&(X[2*H]=K(G[he]++,he))}}function te(X){var ee;for(ee=0;ee>1;1<=ge;ge--)be(X,G,ge);for(H=_e;ge=X.heap[1],X.heap[1]=X.heap[X.heap_len--],be(X,G,1),ye=X.heap[1],X.heap[--X.heap_max]=ge,X.heap[--X.heap_max]=ye,G[2*H]=G[2*ge]+G[2*ye],X.depth[H]=(X.depth[ge]>=X.depth[ye]?X.depth[ge]:X.depth[ye])+1,G[2*ge+1]=G[2*ye+1]=H,X.heap[1]=H++,be(X,G,1),2<=X.heap_len;);X.heap[--X.heap_max]=X.heap[1],function(Z,V){var de,xe,Me,me,Ne,Ce,Re=V.dyn_tree,ae=V.max_code,Le=V.stat_desc.static_tree,Ee=V.stat_desc.has_stree,ze=V.stat_desc.extra_bits,He=V.stat_desc.extra_base,xt=V.stat_desc.max_length,Dt=0;for(me=0;me<=g;me++)Z.bl_count[me]=0;for(Re[2*Z.heap[Z.heap_max]+1]=0,de=Z.heap_max+1;de>=7;H>>=1)if(1&oe&&he.dyn_ltree[2*_e]!==0)return a;if(he.dyn_ltree[18]!==0||he.dyn_ltree[20]!==0||he.dyn_ltree[26]!==0)return s;for(_e=32;_e>>3,(G=X.static_len+3+7>>>3)<=H&&(H=G)):H=G=ge+5,ge+4<=H&&ee!==-1?Q(X,ee,ge,ye):X.strategy===4||G===H?(q(X,2+(ye?1:0),3),re(X,I,P)):(q(X,4+(ye?1:0),3),function(he,_e,oe,Z){var V;for(q(he,_e-257,5),q(he,oe-1,5),q(he,Z-4,4),V=0;V>>8&255,X.pending_buf[X.d_buf+2*X.last_lit+1]=255&ee,X.pending_buf[X.l_buf+X.last_lit]=255&ge,X.last_lit++,ee===0?X.dyn_ltree[2*ge]++:(X.matches++,ee--,X.dyn_ltree[2*(T[ge]+f+1)]++,X.dyn_dtree[2*D(ee)]++),X.last_lit===X.lit_bufsize-1},i._tr_align=function(X){q(X,2,3),Y(X,x,I),function(ee){ee.bi_valid===16?(A(ee,ee.bi_buf),ee.bi_buf=0,ee.bi_valid=0):8<=ee.bi_valid&&(ee.pending_buf[ee.pending++]=255&ee.bi_buf,ee.bi_buf>>=8,ee.bi_valid-=8)}(X)}},{"../utils/common":41}],53:[function(n,r,i){r.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(n,r,i){(function(o){(function(a,s){if(!a.setImmediate){var l,c,u,f,d=1,h={},p=!1,m=a.document,g=Object.getPrototypeOf&&Object.getPrototypeOf(a);g=g&&g.setTimeout?g:a,l={}.toString.call(a.process)==="[object process]"?function(b){process.nextTick(function(){y(b)})}:function(){if(a.postMessage&&!a.importScripts){var b=!0,_=a.onmessage;return a.onmessage=function(){b=!1},a.postMessage("","*"),a.onmessage=_,b}}()?(f="setImmediate$"+Math.random()+"$",a.addEventListener?a.addEventListener("message",x,!1):a.attachEvent("onmessage",x),function(b){a.postMessage(f+b,"*")}):a.MessageChannel?((u=new MessageChannel).port1.onmessage=function(b){y(b.data)},function(b){u.port2.postMessage(b)}):m&&"onreadystatechange"in m.createElement("script")?(c=m.documentElement,function(b){var _=m.createElement("script");_.onreadystatechange=function(){y(b),_.onreadystatechange=null,c.removeChild(_),_=null},c.appendChild(_)}):function(b){setTimeout(y,0,b)},g.setImmediate=function(b){typeof b!="function"&&(b=new Function(""+b));for(var _=new Array(arguments.length-1),S=0;S<_.length;S++)_[S]=arguments[S+1];var O={callback:b,args:_};return h[d]=O,l(d),d++},g.clearImmediate=v}function v(b){delete h[b]}function y(b){if(p)setTimeout(y,0,b);else{var _=h[b];if(_){p=!0;try{(function(S){var O=S.callback,C=S.args;switch(C.length){case 0:O();break;case 1:O(C[0]);break;case 2:O(C[0],C[1]);break;case 3:O(C[0],C[1],C[2]);break;default:O.apply(s,C)}})(_)}finally{v(b),p=!1}}}}function x(b){b.source===a&&typeof b.data=="string"&&b.data.indexOf(f)===0&&y(+b.data.slice(f.length))}})(typeof self>"u"?o===void 0?this:o:self)}).call(this,typeof Kn<"u"?Kn:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(zse);var M9e=zse.exports;const k9e=Nt(M9e);var Use={exports:{}};(function(t,e){(function(n,r){r()})(Kn,function(){function n(c,u){return typeof u>"u"?u={autoBom:!1}:typeof u!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),u={autoBom:!u}),u.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function r(c,u,f){var d=new XMLHttpRequest;d.open("GET",c),d.responseType="blob",d.onload=function(){l(d.response,u,f)},d.onerror=function(){console.error("could not download file")},d.send()}function i(c){var u=new XMLHttpRequest;u.open("HEAD",c,!1);try{u.send()}catch{}return 200<=u.status&&299>=u.status}function o(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var u=document.createEvent("MouseEvents");u.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(u)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Kn=="object"&&Kn.global===Kn?Kn:void 0,s=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!s?function(c,u,f){var d=a.URL||a.webkitURL,h=document.createElement("a");u=u||c.name||"download",h.download=u,h.rel="noopener",typeof c=="string"?(h.href=c,h.origin===location.origin?o(h):i(h.href)?r(c,u,f):o(h,h.target="_blank")):(h.href=d.createObjectURL(c),setTimeout(function(){d.revokeObjectURL(h.href)},4e4),setTimeout(function(){o(h)},0))}:"msSaveOrOpenBlob"in navigator?function(c,u,f){if(u=u||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(n(c,f),u);else if(i(c))r(c,u,f);else{var d=document.createElement("a");d.href=c,d.target="_blank",setTimeout(function(){o(d)})}}:function(c,u,f,d){if(d=d||open("","_blank"),d&&(d.document.title=d.document.body.innerText="downloading..."),typeof c=="string")return r(c,u,f);var h=c.type==="application/octet-stream",p=/constructor/i.test(a.HTMLElement)||a.safari,m=/CriOS\/[\d]+/.test(navigator.userAgent);if((m||h&&p||s)&&typeof FileReader<"u"){var g=new FileReader;g.onloadend=function(){var x=g.result;x=m?x:x.replace(/^data:[^;]*;/,"data:attachment/file;"),d?d.location.href=x:location=x,d=null},g.readAsDataURL(c)}else{var v=a.URL||a.webkitURL,y=v.createObjectURL(c);d?d.location=y:location.href=y,d=null,setTimeout(function(){v.revokeObjectURL(y)},4e4)}});a.saveAs=l.saveAs=l,t.exports=l})})(Use);var Wse=Use.exports;const Vse="POST_MESSAGE";function ba(t,e){return{type:Vse,messageType:t,messageText:typeof e=="string"?e:e.message}}const Gse="HIDE_MESSAGE";function A9e(t){return{type:Gse,messageId:t}}var R9e={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};const oH=Nt(R9e);var aH={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function I9e(t){var e,n=[],r=1,i;if(typeof t=="string")if(t=t.toLowerCase(),oH[t])n=oH[t].slice(),i="rgb";else if(t==="transparent")r=0,i="rgb",n=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var o=t.slice(1),a=o.length,s=a<=4;r=1,s?(n=[parseInt(o[0]+o[0],16),parseInt(o[1]+o[1],16),parseInt(o[2]+o[2],16)],a===4&&(r=parseInt(o[3]+o[3],16)/255)):(n=[parseInt(o[0]+o[1],16),parseInt(o[2]+o[3],16),parseInt(o[4]+o[5],16)],a===8&&(r=parseInt(o[6]+o[7],16)/255)),n[0]||(n[0]=0),n[1]||(n[1]=0),n[2]||(n[2]=0),i="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var l=e[1],c=l==="rgb",o=l.replace(/a$/,"");i=o;var a=o==="cmyk"?4:o==="gray"?1:3;n=e[2].trim().split(/\s*[,\/]\s*|\s+/).map(function(d,h){if(/%$/.test(d))return h===a?parseFloat(d)/100:o==="rgb"?parseFloat(d)*255/100:parseFloat(d);if(o[h]==="h"){if(/deg$/.test(d))return parseFloat(d);if(aH[d]!==void 0)return aH[d]}return parseFloat(d)}),l===o&&n.push(1),r=c||n[a]===void 0?1:n[a],n=n.slice(0,a)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(n=t.match(/([0-9]+)/g).map(function(u){return parseFloat(u)}),i=t.match(/([a-z])/ig).join("").toLowerCase());else isNaN(t)?Array.isArray(t)||t.length?(n=[t[0],t[1],t[2]],i="rgb",r=t.length===4?t[3]:1):t instanceof Object&&(t.r!=null||t.red!=null||t.R!=null?(i="rgb",n=[t.r||t.red||t.R||0,t.g||t.green||t.G||0,t.b||t.blue||t.B||0]):(i="hsl",n=[t.h||t.hue||t.H||0,t.s||t.saturation||t.S||0,t.l||t.lightness||t.L||t.b||t.brightness]),r=t.a||t.alpha||t.opacity||1,t.opacity!=null&&(r/=100)):(i="rgb",n=[t>>>16,(t&65280)>>>8,t&255]);return{space:i,values:n,alpha:r}}const O$={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]},YA={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e=t[0]/360,n=t[1]/100,r=t[2]/100,i,o,a,s,l,c=0;if(n===0)return l=r*255,[l,l,l];for(o=r<.5?r*(1+n):r+n-r*n,i=2*r-o,s=[0,0,0];c<3;)a=e+1/3*-(c-1),a<0?a++:a>1&&a--,l=6*a<1?i+(o-i)*6*a:2*a<1?o:3*a<2?i+(o-i)*(2/3-a)*6:i,s[c++]=l*255;return s}};O$.hsl=function(t){var e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=o-i,s,l,c;return o===i?s=0:e===o?s=(n-r)/a:n===o?s=2+(r-e)/a:r===o&&(s=4+(e-n)/a),s=Math.min(s*60,360),s<0&&(s+=360),c=(i+o)/2,o===i?l=0:c<=.5?l=a/(o+i):l=a/(2-o-i),[s,l*100,c*100]};function D9e(t){Array.isArray(t)&&t.raw&&(t=String.raw(...arguments));var e,n=I9e(t);if(!n.space)return[];const r=n.space[0]==="h"?YA.min:O$.min,i=n.space[0]==="h"?YA.max:O$.max;return e=Array(3),e[0]=Math.min(Math.max(n.values[0],r[0]),i[0]),e[1]=Math.min(Math.max(n.values[1],r[1]),i[1]),e[2]=Math.min(Math.max(n.values[2],r[2]),i[2]),n.space[0]==="h"&&(e=YA.rgb(e)),e.push(Math.min(Math.max(n.alpha,0),1)),e}function $B(t,e,n,r="circle"){if(t.getGeometry()instanceof Vl)t.setStyle(L9e(7,e,"white",2,r));else{n=typeof n=="number"?n:.25;let i=D9e(e);Array.isArray(i)?i=[i[0],i[1],i[2],n]:i=[255,255,255,n],t.setStyle(N9e(i,e,2))}}function L9e(t,e,n,r,i="circle"){return new U1({image:$9e(t,e,n,r,i)})}function $9e(t,e,n,r,i){const o=new Zh({color:e}),a=new Gl({color:n,width:r});switch(i){case"square":return new o$({fill:o,stroke:a,radius:t,points:4,angle:Math.PI/4,rotation:0});case"diamond":return new o$({fill:o,stroke:a,radius:t,points:4,angle:Math.PI/4,rotation:Math.PI/4});default:return new z1({fill:o,stroke:a,radius:t})}}function N9e(t,e,n){const r=new Zh({color:t}),i=new Gl({color:e,width:n});return new U1({fill:r,stroke:i})}function F9e(t,e,n){Va[t]}function j9e(t,e,n){if(Va[t]){const i=Va[t].getSource(),o=i==null?void 0:i.getFeatureById(e);o&&$B(o,n.color,n.opacity)}}function B9e(t,e,n){if(Va[t]){const r=Va[t],i=r.getView().getProjection(),a=(Array.isArray(e)?ZL(e):e).transform(uy,i);a.getType()==="Point"?r.getView().setCenter(a.getFirstCoordinate()):n?r.getView().fit(a,{size:r.getSize()}):r.getView().setCenter(Yf(a.getExtent()))}}const JT="UPDATE_SERVER_INFO";function z9e(){return(t,e)=>{const n=hi(e());t(x2(JT,fe.get("Connecting to server"))),T5e(n.url).then(r=>{t(U9e(r))}).catch(r=>{t(ba("error",r))}).then(()=>{t(b2(JT))})}}function U9e(t){return{type:JT,serverInfo:t}}const sH="UPDATE_RESOURCES";function Hse(){return(t,e)=>{const n=hi(e());t(x2(sH,fe.get("Updating resources"))),k5e(n.url,e().userAuthState.accessToken).then(r=>{r&&window.location.reload()}).finally(()=>t(b2(sH)))}}const Hb="UPDATE_DATASETS";function qse(){return(t,e)=>{const n=hi(e());t(x2(Hb,fe.get("Loading data"))),_5e(n.url,e().userAuthState.accessToken).then(r=>{const i=KGe();if(r=r.map(o=>({...o,variables:[...o.variables,...i[o.id]||[]]})),t(lH(r)),r.length>0){const o=e().controlState.selectedDatasetId||r[0].id;t(ple(o,r,!0))}}).catch(r=>{t(ba("error",r)),t(lH([]))}).then(()=>{t(b2(Hb))})}}function lH(t){return{type:Hb,datasets:t}}function W9e(t,e){return(n,r)=>{n(V9e(t,e));const i={};r().dataState.datasets.forEach(o=>{const[a,s]=rB(o);s.length>=0&&(i[o.id]=s)}),YGe(i)}}const Xse="UPDATE_DATASET_USER_VARIABLES";function V9e(t,e){return{type:Xse,datasetId:t,userVariables:e}}const NB="UPDATE_DATASET_PLACE_GROUP";function G9e(t,e){return{type:NB,datasetId:t,placeGroup:e}}const FB="ADD_DRAWN_USER_PLACE";function H9e(t,e,n,r,i){return(o,a)=>{o(q9e(t,e,n,r,i)),a().controlState.autoShowTimeSeries&&a().controlState.selectedPlaceId===e&&o(g2())}}function q9e(t,e,n,r,i){return{type:FB,placeGroupTitle:t,id:e,properties:n,geometry:r,selected:i}}const jB="ADD_IMPORTED_USER_PLACES";function X9e(t,e,n){return{type:jB,placeGroups:t,mapProjection:e,selected:n}}function Qse(t){return(e,n)=>{const r=CHe(n());let i;try{if(r==="csv"){const o=THe(n());i=$Ge(t,o)}else if(r==="geojson"){const o=EHe(n());i=zGe(t,o)}else if(r==="wkt"){const o=PHe(n());i=GGe(t,o)}else i=[]}catch(o){e(ba("error",o)),e(Pp("addUserPlacesFromText")),i=[]}if(i.length>0){if(e(X9e(i,md(n()),!0)),i.length===1&&i[0].features.length===1){const a=i[0].features[0];e(v2(a.id,K1(n()),!0)),n().controlState.autoShowTimeSeries&&e(g2())}let o=0;i.forEach(a=>{o+=a.features?a.features.length:0}),e(ba("info",fe.get(`Imported ${o} place(s) in ${i.length} groups(s), 1 selected`)))}else e(ba("warning",fe.get("No places imported")))}}const BB="RENAME_USER_PLACE_GROUP";function Q9e(t,e){return{type:BB,placeGroupId:t,newName:e}}const Yse="RENAME_USER_PLACE";function Y9e(t,e,n){return r=>{r(K9e(t,e,n)),F9e(t)}}function K9e(t,e,n){return{type:Yse,placeGroupId:t,placeId:e,newName:n}}const Kse="RESTYLE_USER_PLACE";function Z9e(t,e,n){return r=>{r(J9e(t,e,n)),j9e(t,e,n)}}function J9e(t,e,n){return{type:Kse,placeGroupId:t,placeId:e,placeStyle:n}}const zB="REMOVE_USER_PLACE";function e7e(t,e,n){return{type:zB,placeGroupId:t,placeId:e,places:n}}const Zse="REMOVE_USER_PLACE_GROUP";function t7e(t){return{type:Zse,placeGroupId:t}}function Jse(){return(t,e)=>{const n=hi(e()),r=Gr(e()),i=vo(e()),o=Z1(e()),a=xy(e()),s=e().controlState.sidebarOpen,l=e().controlState.sidebarPanelId;r&&i&&o&&a&&(l!=="stats"&&t(qB("stats")),s||t(HB(!0)),t(cH(null)),P5e(n.url,r,i,o,a,e().userAuthState.accessToken).then(c=>t(cH(c))).catch(c=>{t(ba("error",c))}))}}const ele="ADD_STATISTICS";function cH(t){return{type:ele,statistics:t}}const tle="REMOVE_STATISTICS";function n7e(t){return{type:tle,index:t}}function g2(){return(t,e)=>{const n=hi(e()),r=Gr(e()),i=yy(e()),o=vo(e()),a=my(e()),s=Ose(e()),l=e().controlState.timeSeriesUpdateMode,c=e().controlState.timeSeriesUseMedian,u=e().controlState.timeSeriesIncludeStdev;let f=t9e(e());const d=e().controlState.sidebarOpen,h=e().controlState.sidebarPanelId,p=Bae(e());if(r&&o&&a&&i){h!=="timeSeries"&&t(qB("timeSeries")),d||t(HB(!0));const m=i.labels,g=m.length;f=f>0?f:g;let v=g-1,y=v-f+1;const x=()=>{const _=y>=0?m[y]:null,S=m[v];return E5e(n.url,r,o,s.id,s.geometry,_,S,c,u,e().userAuthState.accessToken)},b=_=>{if(_!==null&&uH(p,s.id)){const S=y>0,O=S?(g-y)/g:1;t(r7e({..._,dataProgress:O},l,v===g-1?"new":"append")),S&&uH(p,s.id)&&(y-=f,v-=f,x().then(b))}else t(ba("info","No data found here"))};x().then(b).catch(_=>{t(ba("error",_))})}}}function uH(t,e){return sB(t,e)!==null}const nle="UPDATE_TIME_SERIES";function r7e(t,e,n){return{type:nle,timeSeries:t,updateMode:e,dataMode:n}}const rle="ADD_PLACE_GROUP_TIME_SERIES";function i7e(t,e){return{type:rle,timeSeriesGroupId:t,timeSeries:e}}const ile="REMOVE_TIME_SERIES";function o7e(t,e){return{type:ile,groupId:t,index:e}}const ole="REMOVE_TIME_SERIES_GROUP";function a7e(t){return{type:ole,id:t}}const ale="REMOVE_ALL_TIME_SERIES";function s7e(){return{type:ale}}const UB="CONFIGURE_SERVERS";function l7e(t,e){return(n,r)=>{r().controlState.selectedServerId!==e?(n(s7e()),n(fH(t,e)),n(WB())):r().dataState.userServers!==t&&n(fH(t,e))}}function fH(t,e){return{type:UB,servers:t,selectedServerId:e}}function WB(){return t=>{t(z9e()),t(qse()),t(c7e()),t(f7e())}}const sle="UPDATE_EXPRESSION_CAPABILITIES";function c7e(){return(t,e)=>{const n=hi(e());C5e(n.url).then(r=>{t(u7e(r))}).catch(r=>{t(ba("error",r))})}}function u7e(t){return{type:sle,expressionCapabilities:t}}const lle="UPDATE_COLOR_BARS";function f7e(){return(t,e)=>{const n=hi(e());x5e(n.url).then(r=>{t(d7e(r))}).catch(r=>{t(ba("error",r))})}}function d7e(t){return{type:lle,colorBars:t}}const cle="UPDATE_VARIABLE_COLOR_BAR";function h7e(t,e,n,r){return(i,o)=>{const a=o().controlState.selectedDatasetId,s=o().controlState.selectedVariableName;a&&s&&i(ule(a,s,t,e,n,r))}}function p7e(t,e,n,r){return(i,o)=>{const a=o().controlState.selectedDatasetId,s=o().controlState.selectedVariable2Name;a&&s&&i(ule(a,s,t,e,n,r))}}function ule(t,e,n,r,i,o){if(i==="log"){let[a,s]=r;a<=0&&(a=.001),s<=a&&(s=1),r=[a,s]}return{type:cle,datasetId:t,variableName:e,colorBarName:n,colorBarMinMax:r,colorBarNorm:i,opacity:o}}const fle="UPDATE_VARIABLE_VOLUME";function m7e(t,e,n,r,i){return{type:fle,datasetId:t,variableName:e,variableColorBar:n,volumeRenderMode:r,volumeIsoThreshold:i}}function g7e(){return(t,e)=>{const{exportTimeSeries:n,exportTimeSeriesSeparator:r,exportPlaces:i,exportPlacesAsCollection:o,exportZipArchive:a,exportFileName:s}=e().controlState;let l=[];n?(l=[],q1(e()).forEach(u=>{u.placeGroups&&(l=l.concat(u.placeGroups))}),l=[...l,...X1(e())]):i&&(l=vy(e())),x7e(e().dataState.timeSeriesGroups,l,{includeTimeSeries:n,includePlaces:i,separator:r,placesAsCollection:o,zip:a,fileName:s})}}class dle{}class v7e extends dle{constructor(n){super();Yt(this,"fileName");Yt(this,"zipArchive");this.fileName=n,this.zipArchive=new k9e}write(n,r){this.zipArchive.file(n,r)}close(){this.zipArchive.generateAsync({type:"blob"}).then(n=>Wse.saveAs(n,this.fileName))}}class y7e extends dle{write(e,n){const r=new Blob([n],{type:"text/plain;charset=utf-8"});Wse.saveAs(r,e)}close(){}}function x7e(t,e,n){const{includeTimeSeries:r,includePlaces:i,placesAsCollection:o,zip:a}=n;let{separator:s,fileName:l}=n;if(s=s||"TAB",s.toUpperCase()==="TAB"&&(s=" "),l=l||"export",!r&&!i)return;let c;a?c=new v7e(`${l}.zip`):c=new y7e;let u;if(r){const{colNames:f,dataRows:d,referencedPlaces:h}=nGe(t,e),p={number:!0,string:!0},m=f.join(s),g=d.map(y=>y.map(x=>p[typeof x]?x+"":"").join(s)),v=[m].concat(g).join(` +`);c.write(`${l}.txt`,v),u=h}else u={},e.forEach(f=>{f.features&&f.features.forEach(d=>{u[d.id]=d})});if(i)if(o){const f={type:"FeatureCollection",features:Object.keys(u).map(d=>u[d])};c.write(`${l}.geojson`,JSON.stringify(f,null,2))}else Object.keys(u).forEach(f=>{c.write(`${f}.geojson`,JSON.stringify(u[f],null,2))});c.close()}const hle="SELECT_DATASET";function ple(t,e,n){return(r,i)=>{r(b7e(t,e));const o=i().controlState.datasetLocateMode;t&&n&&o!=="doNothing"&&r(mle(t,i().controlState.datasetLocateMode==="panAndZoom"))}}function b7e(t,e){return{type:hle,selectedDatasetId:t,datasets:e}}function _7e(){return(t,e)=>{const n=Q1(e());n&&t(mle(n,!0))}}function w7e(){return(t,e)=>{const n=my(e());n&&t(gle(n,!0))}}function mle(t,e){return(n,r)=>{const i=q1(r()),o=Fb(i,t);o&&o.bbox&&n(C$(o.bbox,e))}}const S7e=["Point","LineString","LinearRing","Polygon","MultiPoint","MultiLineString","MultiPolygon","Circle"];function gle(t,e){return(n,r)=>{const i=vy(r()),o=sB(i,t);o&&(o.bbox&&o.bbox.length===4?n(C$(o.bbox,e)):o.geometry&&S7e.includes(o.geometry.type)&&n(C$(new Tp().readGeometry(o.geometry),e)))}}function C$(t,e){return n=>{if(t!==null){const r="map";n(O7e(r,t)),B9e(r,t,e)}}}const vle="FLY_TO";function O7e(t,e){return{type:vle,mapId:t,location:e}}const yle="SELECT_PLACE_GROUPS";function C7e(t){return(e,n)=>{const r=hi(n());e(T7e(t));const i=Gr(n()),o=Sse(n());if(i!==null&&o.length>0){for(const a of o)if(!ay(a)){const s=i.id,l=a.id,c=`${NB}-${s}-${l}`;e(x2(c,fe.get("Loading places"))),O5e(r.url,s,l,n().userAuthState.accessToken).then(u=>{e(G9e(i.id,u))}).catch(u=>{e(ba("error",u))}).finally(()=>{e(b2(c))})}}}}function T7e(t){return{type:yle,selectedPlaceGroupIds:t}}const xle="SELECT_PLACE";function v2(t,e,n){return(r,i)=>{r(E7e(t,e));const o=i().controlState.placeLocateMode;n&&t&&o!=="doNothing"&&r(gle(t,i().controlState.placeLocateMode==="panAndZoom"))}}function E7e(t,e){return{type:xle,placeId:t,places:e}}const ble="SET_LAYER_VISIBILITY";function P7e(t,e){return{type:ble,layerId:t,visible:e}}const _le="SET_MAP_POINT_INFO_BOX_ENABLED";function M7e(t){return{type:_le,mapPointInfoBoxEnabled:t}}const wle="SET_VARIABLE_COMPARE_MODE";function k7e(t){return{type:wle,variableCompareMode:t}}const VB="SET_VARIABLE_SPLIT_POS";function A7e(t){return{type:VB,variableSplitPos:t}}const Sle="SELECT_VARIABLE";function Ole(t){return{type:Sle,selectedVariableName:t}}const Cle="SELECT_VARIABLE_2";function R7e(t,e){return{type:Cle,selectedDataset2Id:t,selectedVariable2Name:e}}const Tle="SELECT_TIME";function y2(t){return{type:Tle,selectedTime:t}}const Ele="INC_SELECTED_TIME";function I7e(t){return{type:Ele,increment:t}}const GB="SELECT_TIME_RANGE";function Ple(t,e,n){return{type:GB,selectedTimeRange:t,selectedGroupId:e,selectedValueRange:n}}const D7e="SELECT_TIME_SERIES_UPDATE_MODE",Mle="UPDATE_TIME_ANIMATION";function L7e(t,e){return{type:Mle,timeAnimationActive:t,timeAnimationInterval:e}}const kle="SET_MAP_INTERACTION";function Ale(t){return{type:kle,mapInteraction:t}}const Rle="SET_LAYER_MENU_OPEN";function Ile(t){return{type:Rle,layerMenuOpen:t}}const Dle="SET_SIDEBAR_POSITION";function $7e(t){return{type:Dle,sidebarPosition:t}}const Lle="SET_SIDEBAR_OPEN";function HB(t){return{type:Lle,sidebarOpen:t}}const $le="SET_SIDEBAR_PANEL_ID";function qB(t){return{type:$le,sidebarPanelId:t}}const Nle="SET_VOLUME_RENDER_MODE";function N7e(t){return{type:Nle,volumeRenderMode:t}}const Fle="UPDATE_VOLUME_STATE";function F7e(t,e){return{type:Fle,volumeId:t,volumeState:e}}const jle="SET_VISIBLE_INFO_CARD_ELEMENTS";function j7e(t){return{type:jle,visibleElements:t}}const Ble="UPDATE_INFO_CARD_ELEMENT_VIEW_MODE";function B7e(t,e){return{type:Ble,elementType:t,viewMode:e}}const zle="ADD_ACTIVITY";function x2(t,e){return{type:zle,id:t,message:e}}const Ule="REMOVE_ACTIVITY";function b2(t){return{type:Ule,id:t}}const Wle="CHANGE_LOCALE";function Vle(t){return{type:Wle,locale:t}}const Gle="OPEN_DIALOG";function Pp(t){return{type:Gle,dialogId:t}}const Hle="CLOSE_DIALOG";function by(t){return{type:Hle,dialogId:t}}const XB="UPDATE_SETTINGS";function J1(t){return{type:XB,settings:t}}const qle="STORE_SETTINGS";function Xle(){return{type:qle}}function Qle(t){return e=>{e(z7e(t)),e(U7e(t))}}const Yle="ADD_USER_COLOR_BAR";function z7e(t){return{type:Yle,colorBarId:t}}const Kle="REMOVE_USER_COLOR_BAR";function Zle(t){return{type:Kle,colorBarId:t}}function Jle(t){return e=>{e(tce(t)),e(QB(t))}}const ece="UPDATE_USER_COLOR_BAR";function tce(t){return{type:ece,userColorBar:t}}function U7e(t){return(e,n)=>{const r=n().controlState.userColorBars.find(i=>i.id===t);r&&e(QB(r))}}function QB(t){return e=>{iBe(t).then(({imageData:n,errorMessage:r})=>{e(tce({...t,imageData:n,errorMessage:r}))})}}function W7e(){return(t,e)=>{e().controlState.userColorBars.forEach(n=>{n.imageData||t(QB(n))})}}function nce(t){return{type:XB,settings:{userColorBars:t}}}const dH=["http","https","mailto","tel"];function V7e(t){const e=(t||"").trim(),n=e.charAt(0);if(n==="#"||n==="/")return e;const r=e.indexOf(":");if(r===-1)return e;let i=-1;for(;++ii||(i=e.indexOf("#"),i!==-1&&r>i)?e:"javascript:void(0)"}/*! * Determine if an object is a Buffer * * @author Feross Aboukhadijeh * @license MIT - */var W7e=function(e){return e!=null&&e.constructor!=null&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)};const nce=Nt(W7e);function Gx(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?fH(t.position):"start"in t||"end"in t?fH(t):"line"in t||"column"in t?C$(t):""}function C$(t){return dH(t&&t.line)+":"+dH(t&&t.column)}function fH(t){return C$(t&&t.start)+"-"+C$(t&&t.end)}function dH(t){return t&&typeof t=="number"?t:1}class xs extends Error{constructor(e,n,r){const i=[null,null];let o={start:{line:null,column:null},end:{line:null,column:null}};if(super(),typeof n=="string"&&(r=n,n=void 0),typeof r=="string"){const a=r.indexOf(":");a===-1?i[1]=r:(i[0]=r.slice(0,a),i[1]=r.slice(a+1))}n&&("type"in n||"position"in n?n.position&&(o=n.position):"start"in n||"end"in n?o=n:("line"in n||"column"in n)&&(o.start=n)),this.name=Gx(n)||"1:1",this.message=typeof e=="object"?e.message:e,this.stack="",typeof e=="object"&&e.stack&&(this.stack=e.stack),this.reason=this.message,this.fatal,this.line=o.start.line,this.column=o.start.column,this.position=o,this.source=i[0],this.ruleId=i[1],this.file,this.actual,this.expected,this.url,this.note}}xs.prototype.file="";xs.prototype.name="";xs.prototype.reason="";xs.prototype.message="";xs.prototype.stack="";xs.prototype.fatal=null;xs.prototype.column=null;xs.prototype.line=null;xs.prototype.source=null;xs.prototype.ruleId=null;xs.prototype.position=null;const hl={basename:V7e,dirname:G7e,extname:H7e,join:q7e,sep:"/"};function V7e(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');ew(t);let n=0,r=-1,i=t.length,o;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.charCodeAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let a=-1,s=e.length-1;for(;i--;)if(t.charCodeAt(i)===47){if(o){n=i+1;break}}else a<0&&(o=!0,a=i+1),s>-1&&(t.charCodeAt(i)===e.charCodeAt(s--)?s<0&&(r=i):(s=-1,r=a));return n===r?r=a:r<0&&(r=t.length),t.slice(n,r)}function G7e(t){if(ew(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.charCodeAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.charCodeAt(0)===47?"/":".":e===1&&t.charCodeAt(0)===47?"//":t.slice(0,e)}function H7e(t){ew(t);let e=t.length,n=-1,r=0,i=-1,o=0,a;for(;e--;){const s=t.charCodeAt(e);if(s===47){if(a){r=e+1;break}continue}n<0&&(a=!0,n=e+1),s===46?i<0?i=e:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":t.slice(i,n)}function q7e(...t){let e=-1,n;for(;++e0&&t.charCodeAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function Q7e(t,e){let n="",r=0,i=-1,o=0,a=-1,s,l;for(;++a<=t.length;){if(a2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=a,o=0;continue}}else if(n.length>0){n="",r=0,i=a,o=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,a):n=t.slice(i+1,a),r=a-i-1;i=a,o=0}else s===46&&o>-1?o++:o=-1}return n}function ew(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const Y7e={cwd:K7e};function K7e(){return"/"}function T$(t){return t!==null&&typeof t=="object"&&t.href&&t.origin}function Z7e(t){if(typeof t=="string")t=new URL(t);else if(!T$(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return J7e(t)}function J7e(t){if(t.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 e=t.pathname;let n=-1;for(;++n"u"||PC.call(e,i)},xH=function(e,n){mH&&n.name==="__proto__"?mH(e,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):e[n.name]=n.newValue},bH=function(e,n){if(n==="__proto__")if(PC.call(e,n)){if(gH)return gH(e,n).value}else return;return e[n]},tqe=function t(){var e,n,r,i,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for(typeof s=="boolean"&&(u=s,s=arguments[1]||{},l=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});la.length;let l;s&&a.push(i);try{l=t.apply(this,a)}catch(c){const u=c;if(s&&n)throw u;return i(u)}s||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(a,...s){n||(n=!0,e(a,...s))}function o(a){i(null,a)}}const iqe=ace().freeze(),oce={}.hasOwnProperty;function ace(){const t=nqe(),e=[];let n={},r,i=-1;return o.data=a,o.Parser=void 0,o.Compiler=void 0,o.freeze=s,o.attachers=e,o.use=l,o.parse=c,o.stringify=u,o.run=f,o.runSync=d,o.process=h,o.processSync=p,o;function o(){const m=ace();let g=-1;for(;++g{if(S||!O||!C)_(S);else{const E=o.stringify(O,C);E==null||(sqe(E)?C.value=E:C.result=E),_(S,C)}});function _(S,O){S||!O?x(S):y?y(O):g(null,O)}}}function p(m){let g;o.freeze(),JA("processSync",o.Parser),eR("processSync",o.Compiler);const v=w0(m);return o.process(v,y),OH("processSync","process",g),v;function y(x){g=!0,pH(x)}}}function wH(t,e){return typeof t=="function"&&t.prototype&&(oqe(t.prototype)||e in t.prototype)}function oqe(t){let e;for(e in t)if(oce.call(t,e))return!0;return!1}function JA(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `Parser`")}function eR(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `Compiler`")}function tR(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function SH(t){if(!E$(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function OH(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function w0(t){return aqe(t)?t:new rce(t)}function aqe(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function sqe(t){return typeof t=="string"||nce(t)}const lqe={};function cqe(t,e){const n=e||lqe,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return sce(t,r,i)}function sce(t,e,n){if(uqe(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return CH(t.children,e,n)}return Array.isArray(t)?CH(t,e,n):""}function CH(t,e,n){const r=[];let i=-1;for(;++ii?0:i+e:e=e>i?i:e,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(e,n),t.splice(...a);else for(n&&t.splice(e,n);o0?(Kl(t,t.length,0,e),t):e}const TH={}.hasOwnProperty;function fqe(t){const e={};let n=-1;for(;++na))return;const O=e.events.length;let C=O,E,k;for(;C--;)if(e.events[C][0]==="exit"&&e.events[C][1].type==="chunkFlow"){if(E){k=e.events[C][1].end;break}E=!0}for(v(r),S=O;Sx;){const _=n[b];e.containerState=_[1],_[0].exit.call(e,t)}n.length=x}function y(){i.write([null]),o=void 0,i=void 0,e.containerState._closeFlow=void 0}}function Oqe(t,e,n){return Wn(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function PH(t){if(t===null||No(t)||xqe(t))return 1;if(yqe(t))return 2}function QB(t,e,n){const r=[];let i=-1;for(;++i1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const f=Object.assign({},t[r][1].end),d=Object.assign({},t[n][1].start);MH(f,-l),MH(d,l),a={type:l>1?"strongSequence":"emphasisSequence",start:f,end:Object.assign({},t[r][1].end)},s={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},t[n][1].start),end:d},o={type:l>1?"strongText":"emphasisText",start:Object.assign({},t[r][1].end),end:Object.assign({},t[n][1].start)},i={type:l>1?"strong":"emphasis",start:Object.assign({},a.start),end:Object.assign({},s.end)},t[r][1].end=Object.assign({},a.start),t[n][1].start=Object.assign({},s.end),c=[],t[r][1].end.offset-t[r][1].start.offset&&(c=Ba(c,[["enter",t[r][1],e],["exit",t[r][1],e]])),c=Ba(c,[["enter",i,e],["enter",a,e],["exit",a,e],["enter",o,e]]),c=Ba(c,QB(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),c=Ba(c,[["exit",o,e],["enter",s,e],["exit",s,e],["exit",i,e]]),t[n][1].end.offset-t[n][1].start.offset?(u=2,c=Ba(c,[["enter",t[n][1],e],["exit",t[n][1],e]])):u=0,Kl(t,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n0&&yn(S)?Wn(t,y,"linePrefix",o+1)(S):y(S)}function y(S){return S===null||Tt(S)?t.check(AH,m,b)(S):(t.enter("codeFlowValue"),x(S))}function x(S){return S===null||Tt(S)?(t.exit("codeFlowValue"),y(S)):(t.consume(S),x)}function b(S){return t.exit("codeFenced"),e(S)}function _(S,O,C){let E=0;return k;function k(L){return S.enter("lineEnding"),S.consume(L),S.exit("lineEnding"),I}function I(L){return S.enter("codeFencedFence"),yn(L)?Wn(S,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):P(L)}function P(L){return L===s?(S.enter("codeFencedFenceSequence"),R(L)):C(L)}function R(L){return L===s?(E++,S.consume(L),R):E>=a?(S.exit("codeFencedFenceSequence"),yn(L)?Wn(S,T,"whitespace")(L):T(L)):C(L)}function T(L){return L===null||Tt(L)?(S.exit("codeFencedFence"),O(L)):C(L)}}}function $qe(t,e,n){const r=this;return i;function i(a){return a===null?n(a):(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}const nR={name:"codeIndented",tokenize:Fqe},Nqe={tokenize:jqe,partial:!0};function Fqe(t,e,n){const r=this;return i;function i(c){return t.enter("codeIndented"),Wn(t,o,"linePrefix",5)(c)}function o(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?a(c):n(c)}function a(c){return c===null?l(c):Tt(c)?t.attempt(Nqe,a,l)(c):(t.enter("codeFlowValue"),s(c))}function s(c){return c===null||Tt(c)?(t.exit("codeFlowValue"),a(c)):(t.consume(c),s)}function l(c){return t.exit("codeIndented"),e(c)}}function jqe(t,e,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):Tt(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i):Wn(t,o,"linePrefix",5)(a)}function o(a){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?e(a):Tt(a)?i(a):n(a)}}const Bqe={name:"codeText",tokenize:Wqe,resolve:zqe,previous:Uqe};function zqe(t){let e=t.length-4,n=3,r,i;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r=4?e(a):t.interrupt(r.parser.constructs.flow,n,e)(a)}}function dce(t,e,n,r,i,o,a,s,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return f;function f(v){return v===60?(t.enter(r),t.enter(i),t.enter(o),t.consume(v),t.exit(o),d):v===null||v===32||v===41||P$(v)?n(v):(t.enter(r),t.enter(a),t.enter(s),t.enter("chunkString",{contentType:"string"}),m(v))}function d(v){return v===62?(t.enter(o),t.consume(v),t.exit(o),t.exit(i),t.exit(r),e):(t.enter(s),t.enter("chunkString",{contentType:"string"}),h(v))}function h(v){return v===62?(t.exit("chunkString"),t.exit(s),d(v)):v===null||v===60||Tt(v)?n(v):(t.consume(v),v===92?p:h)}function p(v){return v===60||v===62||v===92?(t.consume(v),h):h(v)}function m(v){return!u&&(v===null||v===41||No(v))?(t.exit("chunkString"),t.exit(s),t.exit(a),t.exit(r),e(v)):u999||h===null||h===91||h===93&&!l||h===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs?n(h):h===93?(t.exit(o),t.enter(i),t.consume(h),t.exit(i),t.exit(r),e):Tt(h)?(t.enter("lineEnding"),t.consume(h),t.exit("lineEnding"),u):(t.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===null||h===91||h===93||Tt(h)||s++>999?(t.exit("chunkString"),u(h)):(t.consume(h),l||(l=!yn(h)),h===92?d:f)}function d(h){return h===91||h===92||h===93?(t.consume(h),s++,f):f(h)}}function pce(t,e,n,r,i,o){let a;return s;function s(d){return d===34||d===39||d===40?(t.enter(r),t.enter(i),t.consume(d),t.exit(i),a=d===40?41:d,l):n(d)}function l(d){return d===a?(t.enter(i),t.consume(d),t.exit(i),t.exit(r),e):(t.enter(o),c(d))}function c(d){return d===a?(t.exit(o),l(a)):d===null?n(d):Tt(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),Wn(t,c,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),u(d))}function u(d){return d===a||d===null||Tt(d)?(t.exit("chunkString"),c(d)):(t.consume(d),d===92?f:u)}function f(d){return d===a||d===92?(t.consume(d),u):u(d)}}function Hx(t,e){let n;return r;function r(i){return Tt(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):yn(i)?Wn(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}function wg(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Yqe={name:"definition",tokenize:Zqe},Kqe={tokenize:Jqe,partial:!0};function Zqe(t,e,n){const r=this;let i;return o;function o(h){return t.enter("definition"),a(h)}function a(h){return hce.call(r,t,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function s(h){return i=wg(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(t.enter("definitionMarker"),t.consume(h),t.exit("definitionMarker"),l):n(h)}function l(h){return No(h)?Hx(t,c)(h):c(h)}function c(h){return dce(t,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function u(h){return t.attempt(Kqe,f,f)(h)}function f(h){return yn(h)?Wn(t,d,"whitespace")(h):d(h)}function d(h){return h===null||Tt(h)?(t.exit("definition"),r.parser.defined.push(i),e(h)):n(h)}}function Jqe(t,e,n){return r;function r(s){return No(s)?Hx(t,i)(s):n(s)}function i(s){return pce(t,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return yn(s)?Wn(t,a,"whitespace")(s):a(s)}function a(s){return s===null||Tt(s)?e(s):n(s)}}const eXe={name:"hardBreakEscape",tokenize:tXe};function tXe(t,e,n){return r;function r(o){return t.enter("hardBreakEscape"),t.consume(o),i}function i(o){return Tt(o)?(t.exit("hardBreakEscape"),e(o)):n(o)}}const nXe={name:"headingAtx",tokenize:iXe,resolve:rXe};function rXe(t,e){let n=t.length-2,r=3,i,o;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},o={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},Kl(t,r,n-r+1,[["enter",i,e],["enter",o,e],["exit",o,e],["exit",i,e]])),t}function iXe(t,e,n){let r=0;return i;function i(u){return t.enter("atxHeading"),o(u)}function o(u){return t.enter("atxHeadingSequence"),a(u)}function a(u){return u===35&&r++<6?(t.consume(u),a):u===null||No(u)?(t.exit("atxHeadingSequence"),s(u)):n(u)}function s(u){return u===35?(t.enter("atxHeadingSequence"),l(u)):u===null||Tt(u)?(t.exit("atxHeading"),e(u)):yn(u)?Wn(t,s,"whitespace")(u):(t.enter("atxHeadingText"),c(u))}function l(u){return u===35?(t.consume(u),l):(t.exit("atxHeadingSequence"),s(u))}function c(u){return u===null||u===35||No(u)?(t.exit("atxHeadingText"),s(u)):(t.consume(u),c)}}const oXe=["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"],IH=["pre","script","style","textarea"],aXe={name:"htmlFlow",tokenize:uXe,resolveTo:cXe,concrete:!0},sXe={tokenize:dXe,partial:!0},lXe={tokenize:fXe,partial:!0};function cXe(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function uXe(t,e,n){const r=this;let i,o,a,s,l;return c;function c(A){return u(A)}function u(A){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(A),f}function f(A){return A===33?(t.consume(A),d):A===47?(t.consume(A),o=!0,m):A===63?(t.consume(A),i=3,r.interrupt?e:N):Sl(A)?(t.consume(A),a=String.fromCharCode(A),g):n(A)}function d(A){return A===45?(t.consume(A),i=2,h):A===91?(t.consume(A),i=5,s=0,p):Sl(A)?(t.consume(A),i=4,r.interrupt?e:N):n(A)}function h(A){return A===45?(t.consume(A),r.interrupt?e:N):n(A)}function p(A){const q="CDATA[";return A===q.charCodeAt(s++)?(t.consume(A),s===q.length?r.interrupt?e:P:p):n(A)}function m(A){return Sl(A)?(t.consume(A),a=String.fromCharCode(A),g):n(A)}function g(A){if(A===null||A===47||A===62||No(A)){const q=A===47,Y=a.toLowerCase();return!q&&!o&&IH.includes(Y)?(i=1,r.interrupt?e(A):P(A)):oXe.includes(a.toLowerCase())?(i=6,q?(t.consume(A),v):r.interrupt?e(A):P(A)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(A):o?y(A):x(A))}return A===45||ma(A)?(t.consume(A),a+=String.fromCharCode(A),g):n(A)}function v(A){return A===62?(t.consume(A),r.interrupt?e:P):n(A)}function y(A){return yn(A)?(t.consume(A),y):k(A)}function x(A){return A===47?(t.consume(A),k):A===58||A===95||Sl(A)?(t.consume(A),b):yn(A)?(t.consume(A),x):k(A)}function b(A){return A===45||A===46||A===58||A===95||ma(A)?(t.consume(A),b):_(A)}function _(A){return A===61?(t.consume(A),S):yn(A)?(t.consume(A),_):x(A)}function S(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(t.consume(A),l=A,O):yn(A)?(t.consume(A),S):C(A)}function O(A){return A===l?(t.consume(A),l=null,E):A===null||Tt(A)?n(A):(t.consume(A),O)}function C(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||No(A)?_(A):(t.consume(A),C)}function E(A){return A===47||A===62||yn(A)?x(A):n(A)}function k(A){return A===62?(t.consume(A),I):n(A)}function I(A){return A===null||Tt(A)?P(A):yn(A)?(t.consume(A),I):n(A)}function P(A){return A===45&&i===2?(t.consume(A),z):A===60&&i===1?(t.consume(A),B):A===62&&i===4?(t.consume(A),$):A===63&&i===3?(t.consume(A),N):A===93&&i===5?(t.consume(A),U):Tt(A)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(sXe,D,R)(A)):A===null||Tt(A)?(t.exit("htmlFlowData"),R(A)):(t.consume(A),P)}function R(A){return t.check(lXe,T,D)(A)}function T(A){return t.enter("lineEnding"),t.consume(A),t.exit("lineEnding"),L}function L(A){return A===null||Tt(A)?R(A):(t.enter("htmlFlowData"),P(A))}function z(A){return A===45?(t.consume(A),N):P(A)}function B(A){return A===47?(t.consume(A),a="",W):P(A)}function W(A){if(A===62){const q=a.toLowerCase();return IH.includes(q)?(t.consume(A),$):P(A)}return Sl(A)&&a.length<8?(t.consume(A),a+=String.fromCharCode(A),W):P(A)}function U(A){return A===93?(t.consume(A),N):P(A)}function N(A){return A===62?(t.consume(A),$):A===45&&i===2?(t.consume(A),N):P(A)}function $(A){return A===null||Tt(A)?(t.exit("htmlFlowData"),D(A)):(t.consume(A),$)}function D(A){return t.exit("htmlFlow"),e(A)}}function fXe(t,e,n){const r=this;return i;function i(a){return Tt(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),o):n(a)}function o(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}function dXe(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(_2,e,n)}}const hXe={name:"htmlText",tokenize:pXe};function pXe(t,e,n){const r=this;let i,o,a;return s;function s(N){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(N),l}function l(N){return N===33?(t.consume(N),c):N===47?(t.consume(N),_):N===63?(t.consume(N),x):Sl(N)?(t.consume(N),C):n(N)}function c(N){return N===45?(t.consume(N),u):N===91?(t.consume(N),o=0,p):Sl(N)?(t.consume(N),y):n(N)}function u(N){return N===45?(t.consume(N),h):n(N)}function f(N){return N===null?n(N):N===45?(t.consume(N),d):Tt(N)?(a=f,B(N)):(t.consume(N),f)}function d(N){return N===45?(t.consume(N),h):f(N)}function h(N){return N===62?z(N):N===45?d(N):f(N)}function p(N){const $="CDATA[";return N===$.charCodeAt(o++)?(t.consume(N),o===$.length?m:p):n(N)}function m(N){return N===null?n(N):N===93?(t.consume(N),g):Tt(N)?(a=m,B(N)):(t.consume(N),m)}function g(N){return N===93?(t.consume(N),v):m(N)}function v(N){return N===62?z(N):N===93?(t.consume(N),v):m(N)}function y(N){return N===null||N===62?z(N):Tt(N)?(a=y,B(N)):(t.consume(N),y)}function x(N){return N===null?n(N):N===63?(t.consume(N),b):Tt(N)?(a=x,B(N)):(t.consume(N),x)}function b(N){return N===62?z(N):x(N)}function _(N){return Sl(N)?(t.consume(N),S):n(N)}function S(N){return N===45||ma(N)?(t.consume(N),S):O(N)}function O(N){return Tt(N)?(a=O,B(N)):yn(N)?(t.consume(N),O):z(N)}function C(N){return N===45||ma(N)?(t.consume(N),C):N===47||N===62||No(N)?E(N):n(N)}function E(N){return N===47?(t.consume(N),z):N===58||N===95||Sl(N)?(t.consume(N),k):Tt(N)?(a=E,B(N)):yn(N)?(t.consume(N),E):z(N)}function k(N){return N===45||N===46||N===58||N===95||ma(N)?(t.consume(N),k):I(N)}function I(N){return N===61?(t.consume(N),P):Tt(N)?(a=I,B(N)):yn(N)?(t.consume(N),I):E(N)}function P(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(t.consume(N),i=N,R):Tt(N)?(a=P,B(N)):yn(N)?(t.consume(N),P):(t.consume(N),T)}function R(N){return N===i?(t.consume(N),i=void 0,L):N===null?n(N):Tt(N)?(a=R,B(N)):(t.consume(N),R)}function T(N){return N===null||N===34||N===39||N===60||N===61||N===96?n(N):N===47||N===62||No(N)?E(N):(t.consume(N),T)}function L(N){return N===47||N===62||No(N)?E(N):n(N)}function z(N){return N===62?(t.consume(N),t.exit("htmlTextData"),t.exit("htmlText"),e):n(N)}function B(N){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(N),t.exit("lineEnding"),W}function W(N){return yn(N)?Wn(t,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):U(N)}function U(N){return t.enter("htmlTextData"),a(N)}}const KB={name:"labelEnd",tokenize:bXe,resolveTo:xXe,resolveAll:yXe},mXe={tokenize:_Xe},gXe={tokenize:wXe},vXe={tokenize:SXe};function yXe(t){let e=-1;for(;++e=3&&(c===null||Tt(c))?(t.exit("thematicBreak"),e(c)):n(c)}function l(c){return c===i?(t.consume(c),r++,l):(t.exit("thematicBreakSequence"),yn(c)?Wn(t,s,"whitespace")(c):s(c))}}const _o={name:"list",tokenize:RXe,continuation:{tokenize:IXe},exit:LXe},kXe={tokenize:$Xe,partial:!0},AXe={tokenize:DXe,partial:!0};function RXe(t,e,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return s;function s(h){const p=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:M$(h)){if(r.containerState.type||(r.containerState.type=p,t.enter(p,{_container:!0})),p==="listUnordered")return t.enter("listItemPrefix"),h===42||h===45?t.check(MC,n,c)(h):c(h);if(!r.interrupt||h===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),l(h)}return n(h)}function l(h){return M$(h)&&++a<10?(t.consume(h),l):(!r.interrupt||a<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(t.exit("listItemValue"),c(h)):n(h)}function c(h){return t.enter("listItemMarker"),t.consume(h),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,t.check(_2,r.interrupt?n:u,t.attempt(kXe,d,f))}function u(h){return r.containerState.initialBlankLine=!0,o++,d(h)}function f(h){return yn(h)?(t.enter("listItemPrefixWhitespace"),t.consume(h),t.exit("listItemPrefixWhitespace"),d):n(h)}function d(h){return r.containerState.size=o+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(h)}}function IXe(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(_2,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Wn(t,e,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!yn(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(AXe,e,a)(s))}function a(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,Wn(t,t.attempt(_o,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function DXe(t,e,n){const r=this;return Wn(t,i,"listItemIndent",r.containerState.size+1);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?e(o):n(o)}}function LXe(t){t.exit(this.containerState.type)}function $Xe(t,e,n){const r=this;return Wn(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const a=r.events[r.events.length-1];return!yn(o)&&a&&a[1].type==="listItemPrefixWhitespace"?e(o):n(o)}}const DH={name:"setextUnderline",tokenize:FXe,resolveTo:NXe};function NXe(t,e){let n=t.length,r,i,o;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(i=n)}else t[n][1].type==="content"&&t.splice(n,1),!o&&t[n][1].type==="definition"&&(o=n);const a={type:"setextHeading",start:Object.assign({},t[i][1].start),end:Object.assign({},t[t.length-1][1].end)};return t[i][1].type="setextHeadingText",o?(t.splice(i,0,["enter",a,e]),t.splice(o+1,0,["exit",t[r][1],e]),t[r][1].end=Object.assign({},t[o][1].end)):t[r][1]=a,t.push(["exit",a,e]),t}function FXe(t,e,n){const r=this;let i;return o;function o(c){let u=r.events.length,f;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){f=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(t.enter("setextHeadingLine"),i=c,a(c)):n(c)}function a(c){return t.enter("setextHeadingLineSequence"),s(c)}function s(c){return c===i?(t.consume(c),s):(t.exit("setextHeadingLineSequence"),yn(c)?Wn(t,l,"lineSuffix")(c):l(c))}function l(c){return c===null||Tt(c)?(t.exit("setextHeadingLine"),e(c)):n(c)}}const jXe={tokenize:BXe};function BXe(t){const e=this,n=t.attempt(_2,r,t.attempt(this.parser.constructs.flowInitial,i,Wn(t,t.attempt(this.parser.constructs.flow,i,t.attempt(Gqe,i)),"linePrefix")));return n;function r(o){if(o===null){t.consume(o);return}return t.enter("lineEndingBlank"),t.consume(o),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function i(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const zXe={resolveAll:gce()},UXe=mce("string"),WXe=mce("text");function mce(t){return{tokenize:e,resolveAll:gce(t==="text"?VXe:void 0)};function e(n){const r=this,i=this.parser.constructs[t],o=n.attempt(i,a,s);return a;function a(u){return c(u)?o(u):s(u)}function s(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),o(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const f=i[u];let d=-1;if(f)for(;++d-1){const s=a[0];typeof s=="string"?a[0]=s.slice(r):a.shift()}o>0&&a.push(t[i].slice(0,o))}return a}function qXe(t,e){let n=-1;const r=[];let i;for(;++nt.length){for(;i--;)if(t.charCodeAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let a=-1,s=e.length-1;for(;i--;)if(t.charCodeAt(i)===47){if(o){n=i+1;break}}else a<0&&(o=!0,a=i+1),s>-1&&(t.charCodeAt(i)===e.charCodeAt(s--)?s<0&&(r=i):(s=-1,r=a));return n===r?r=a:r<0&&(r=t.length),t.slice(n,r)}function q7e(t){if(ew(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.charCodeAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.charCodeAt(0)===47?"/":".":e===1&&t.charCodeAt(0)===47?"//":t.slice(0,e)}function X7e(t){ew(t);let e=t.length,n=-1,r=0,i=-1,o=0,a;for(;e--;){const s=t.charCodeAt(e);if(s===47){if(a){r=e+1;break}continue}n<0&&(a=!0,n=e+1),s===46?i<0?i=e:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":t.slice(i,n)}function Q7e(...t){let e=-1,n;for(;++e0&&t.charCodeAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function K7e(t,e){let n="",r=0,i=-1,o=0,a=-1,s,l;for(;++a<=t.length;){if(a2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=a,o=0;continue}}else if(n.length>0){n="",r=0,i=a,o=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,a):n=t.slice(i+1,a),r=a-i-1;i=a,o=0}else s===46&&o>-1?o++:o=-1}return n}function ew(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const Z7e={cwd:J7e};function J7e(){return"/"}function E$(t){return t!==null&&typeof t=="object"&&t.href&&t.origin}function eqe(t){if(typeof t=="string")t=new URL(t);else if(!E$(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return tqe(t)}function tqe(t){if(t.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 e=t.pathname;let n=-1;for(;++n"u"||PC.call(e,i)},_H=function(e,n){vH&&n.name==="__proto__"?vH(e,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):e[n.name]=n.newValue},wH=function(e,n){if(n==="__proto__")if(PC.call(e,n)){if(yH)return yH(e,n).value}else return;return e[n]},rqe=function t(){var e,n,r,i,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for(typeof s=="boolean"&&(u=s,s=arguments[1]||{},l=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});la.length;let l;s&&a.push(i);try{l=t.apply(this,a)}catch(c){const u=c;if(s&&n)throw u;return i(u)}s||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(a,...s){n||(n=!0,e(a,...s))}function o(a){i(null,a)}}const aqe=sce().freeze(),ace={}.hasOwnProperty;function sce(){const t=iqe(),e=[];let n={},r,i=-1;return o.data=a,o.Parser=void 0,o.Compiler=void 0,o.freeze=s,o.attachers=e,o.use=l,o.parse=c,o.stringify=u,o.run=f,o.runSync=d,o.process=h,o.processSync=p,o;function o(){const m=sce();let g=-1;for(;++g{if(S||!O||!C)_(S);else{const E=o.stringify(O,C);E==null||(cqe(E)?C.value=E:C.result=E),_(S,C)}});function _(S,O){S||!O?x(S):y?y(O):g(null,O)}}}function p(m){let g;o.freeze(),eR("processSync",o.Parser),tR("processSync",o.Compiler);const v=w0(m);return o.process(v,y),TH("processSync","process",g),v;function y(x){g=!0,gH(x)}}}function OH(t,e){return typeof t=="function"&&t.prototype&&(sqe(t.prototype)||e in t.prototype)}function sqe(t){let e;for(e in t)if(ace.call(t,e))return!0;return!1}function eR(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `Parser`")}function tR(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `Compiler`")}function nR(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function CH(t){if(!P$(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function TH(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function w0(t){return lqe(t)?t:new ice(t)}function lqe(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function cqe(t){return typeof t=="string"||rce(t)}const uqe={};function fqe(t,e){const n=e||uqe,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return lce(t,r,i)}function lce(t,e,n){if(dqe(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return EH(t.children,e,n)}return Array.isArray(t)?EH(t,e,n):""}function EH(t,e,n){const r=[];let i=-1;for(;++ii?0:i+e:e=e>i?i:e,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(e,n),t.splice(...a);else for(n&&t.splice(e,n);o0?(Kl(t,t.length,0,e),t):e}const PH={}.hasOwnProperty;function hqe(t){const e={};let n=-1;for(;++na))return;const O=e.events.length;let C=O,E,k;for(;C--;)if(e.events[C][0]==="exit"&&e.events[C][1].type==="chunkFlow"){if(E){k=e.events[C][1].end;break}E=!0}for(v(r),S=O;Sx;){const _=n[b];e.containerState=_[1],_[0].exit.call(e,t)}n.length=x}function y(){i.write([null]),o=void 0,i=void 0,e.containerState._closeFlow=void 0}}function Tqe(t,e,n){return Wn(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function kH(t){if(t===null||No(t)||_qe(t))return 1;if(bqe(t))return 2}function YB(t,e,n){const r=[];let i=-1;for(;++i1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const f=Object.assign({},t[r][1].end),d=Object.assign({},t[n][1].start);AH(f,-l),AH(d,l),a={type:l>1?"strongSequence":"emphasisSequence",start:f,end:Object.assign({},t[r][1].end)},s={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},t[n][1].start),end:d},o={type:l>1?"strongText":"emphasisText",start:Object.assign({},t[r][1].end),end:Object.assign({},t[n][1].start)},i={type:l>1?"strong":"emphasis",start:Object.assign({},a.start),end:Object.assign({},s.end)},t[r][1].end=Object.assign({},a.start),t[n][1].start=Object.assign({},s.end),c=[],t[r][1].end.offset-t[r][1].start.offset&&(c=Ba(c,[["enter",t[r][1],e],["exit",t[r][1],e]])),c=Ba(c,[["enter",i,e],["enter",a,e],["exit",a,e],["enter",o,e]]),c=Ba(c,YB(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),c=Ba(c,[["exit",o,e],["enter",s,e],["exit",s,e],["exit",i,e]]),t[n][1].end.offset-t[n][1].start.offset?(u=2,c=Ba(c,[["enter",t[n][1],e],["exit",t[n][1],e]])):u=0,Kl(t,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n0&&yn(S)?Wn(t,y,"linePrefix",o+1)(S):y(S)}function y(S){return S===null||Tt(S)?t.check(IH,m,b)(S):(t.enter("codeFlowValue"),x(S))}function x(S){return S===null||Tt(S)?(t.exit("codeFlowValue"),y(S)):(t.consume(S),x)}function b(S){return t.exit("codeFenced"),e(S)}function _(S,O,C){let E=0;return k;function k(L){return S.enter("lineEnding"),S.consume(L),S.exit("lineEnding"),I}function I(L){return S.enter("codeFencedFence"),yn(L)?Wn(S,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):P(L)}function P(L){return L===s?(S.enter("codeFencedFenceSequence"),R(L)):C(L)}function R(L){return L===s?(E++,S.consume(L),R):E>=a?(S.exit("codeFencedFenceSequence"),yn(L)?Wn(S,T,"whitespace")(L):T(L)):C(L)}function T(L){return L===null||Tt(L)?(S.exit("codeFencedFence"),O(L)):C(L)}}}function Fqe(t,e,n){const r=this;return i;function i(a){return a===null?n(a):(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}const rR={name:"codeIndented",tokenize:Bqe},jqe={tokenize:zqe,partial:!0};function Bqe(t,e,n){const r=this;return i;function i(c){return t.enter("codeIndented"),Wn(t,o,"linePrefix",5)(c)}function o(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?a(c):n(c)}function a(c){return c===null?l(c):Tt(c)?t.attempt(jqe,a,l)(c):(t.enter("codeFlowValue"),s(c))}function s(c){return c===null||Tt(c)?(t.exit("codeFlowValue"),a(c)):(t.consume(c),s)}function l(c){return t.exit("codeIndented"),e(c)}}function zqe(t,e,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):Tt(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i):Wn(t,o,"linePrefix",5)(a)}function o(a){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?e(a):Tt(a)?i(a):n(a)}}const Uqe={name:"codeText",tokenize:Gqe,resolve:Wqe,previous:Vqe};function Wqe(t){let e=t.length-4,n=3,r,i;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r=4?e(a):t.interrupt(r.parser.constructs.flow,n,e)(a)}}function hce(t,e,n,r,i,o,a,s,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return f;function f(v){return v===60?(t.enter(r),t.enter(i),t.enter(o),t.consume(v),t.exit(o),d):v===null||v===32||v===41||M$(v)?n(v):(t.enter(r),t.enter(a),t.enter(s),t.enter("chunkString",{contentType:"string"}),m(v))}function d(v){return v===62?(t.enter(o),t.consume(v),t.exit(o),t.exit(i),t.exit(r),e):(t.enter(s),t.enter("chunkString",{contentType:"string"}),h(v))}function h(v){return v===62?(t.exit("chunkString"),t.exit(s),d(v)):v===null||v===60||Tt(v)?n(v):(t.consume(v),v===92?p:h)}function p(v){return v===60||v===62||v===92?(t.consume(v),h):h(v)}function m(v){return!u&&(v===null||v===41||No(v))?(t.exit("chunkString"),t.exit(s),t.exit(a),t.exit(r),e(v)):u999||h===null||h===91||h===93&&!l||h===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs?n(h):h===93?(t.exit(o),t.enter(i),t.consume(h),t.exit(i),t.exit(r),e):Tt(h)?(t.enter("lineEnding"),t.consume(h),t.exit("lineEnding"),u):(t.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===null||h===91||h===93||Tt(h)||s++>999?(t.exit("chunkString"),u(h)):(t.consume(h),l||(l=!yn(h)),h===92?d:f)}function d(h){return h===91||h===92||h===93?(t.consume(h),s++,f):f(h)}}function mce(t,e,n,r,i,o){let a;return s;function s(d){return d===34||d===39||d===40?(t.enter(r),t.enter(i),t.consume(d),t.exit(i),a=d===40?41:d,l):n(d)}function l(d){return d===a?(t.enter(i),t.consume(d),t.exit(i),t.exit(r),e):(t.enter(o),c(d))}function c(d){return d===a?(t.exit(o),l(a)):d===null?n(d):Tt(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),Wn(t,c,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),u(d))}function u(d){return d===a||d===null||Tt(d)?(t.exit("chunkString"),c(d)):(t.consume(d),d===92?f:u)}function f(d){return d===a||d===92?(t.consume(d),u):u(d)}}function Hx(t,e){let n;return r;function r(i){return Tt(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):yn(i)?Wn(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}function wg(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Zqe={name:"definition",tokenize:eXe},Jqe={tokenize:tXe,partial:!0};function eXe(t,e,n){const r=this;let i;return o;function o(h){return t.enter("definition"),a(h)}function a(h){return pce.call(r,t,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function s(h){return i=wg(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(t.enter("definitionMarker"),t.consume(h),t.exit("definitionMarker"),l):n(h)}function l(h){return No(h)?Hx(t,c)(h):c(h)}function c(h){return hce(t,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function u(h){return t.attempt(Jqe,f,f)(h)}function f(h){return yn(h)?Wn(t,d,"whitespace")(h):d(h)}function d(h){return h===null||Tt(h)?(t.exit("definition"),r.parser.defined.push(i),e(h)):n(h)}}function tXe(t,e,n){return r;function r(s){return No(s)?Hx(t,i)(s):n(s)}function i(s){return mce(t,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return yn(s)?Wn(t,a,"whitespace")(s):a(s)}function a(s){return s===null||Tt(s)?e(s):n(s)}}const nXe={name:"hardBreakEscape",tokenize:rXe};function rXe(t,e,n){return r;function r(o){return t.enter("hardBreakEscape"),t.consume(o),i}function i(o){return Tt(o)?(t.exit("hardBreakEscape"),e(o)):n(o)}}const iXe={name:"headingAtx",tokenize:aXe,resolve:oXe};function oXe(t,e){let n=t.length-2,r=3,i,o;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},o={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},Kl(t,r,n-r+1,[["enter",i,e],["enter",o,e],["exit",o,e],["exit",i,e]])),t}function aXe(t,e,n){let r=0;return i;function i(u){return t.enter("atxHeading"),o(u)}function o(u){return t.enter("atxHeadingSequence"),a(u)}function a(u){return u===35&&r++<6?(t.consume(u),a):u===null||No(u)?(t.exit("atxHeadingSequence"),s(u)):n(u)}function s(u){return u===35?(t.enter("atxHeadingSequence"),l(u)):u===null||Tt(u)?(t.exit("atxHeading"),e(u)):yn(u)?Wn(t,s,"whitespace")(u):(t.enter("atxHeadingText"),c(u))}function l(u){return u===35?(t.consume(u),l):(t.exit("atxHeadingSequence"),s(u))}function c(u){return u===null||u===35||No(u)?(t.exit("atxHeadingText"),s(u)):(t.consume(u),c)}}const sXe=["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"],LH=["pre","script","style","textarea"],lXe={name:"htmlFlow",tokenize:dXe,resolveTo:fXe,concrete:!0},cXe={tokenize:pXe,partial:!0},uXe={tokenize:hXe,partial:!0};function fXe(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function dXe(t,e,n){const r=this;let i,o,a,s,l;return c;function c(A){return u(A)}function u(A){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(A),f}function f(A){return A===33?(t.consume(A),d):A===47?(t.consume(A),o=!0,m):A===63?(t.consume(A),i=3,r.interrupt?e:N):Sl(A)?(t.consume(A),a=String.fromCharCode(A),g):n(A)}function d(A){return A===45?(t.consume(A),i=2,h):A===91?(t.consume(A),i=5,s=0,p):Sl(A)?(t.consume(A),i=4,r.interrupt?e:N):n(A)}function h(A){return A===45?(t.consume(A),r.interrupt?e:N):n(A)}function p(A){const q="CDATA[";return A===q.charCodeAt(s++)?(t.consume(A),s===q.length?r.interrupt?e:P:p):n(A)}function m(A){return Sl(A)?(t.consume(A),a=String.fromCharCode(A),g):n(A)}function g(A){if(A===null||A===47||A===62||No(A)){const q=A===47,Y=a.toLowerCase();return!q&&!o&&LH.includes(Y)?(i=1,r.interrupt?e(A):P(A)):sXe.includes(a.toLowerCase())?(i=6,q?(t.consume(A),v):r.interrupt?e(A):P(A)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(A):o?y(A):x(A))}return A===45||ma(A)?(t.consume(A),a+=String.fromCharCode(A),g):n(A)}function v(A){return A===62?(t.consume(A),r.interrupt?e:P):n(A)}function y(A){return yn(A)?(t.consume(A),y):k(A)}function x(A){return A===47?(t.consume(A),k):A===58||A===95||Sl(A)?(t.consume(A),b):yn(A)?(t.consume(A),x):k(A)}function b(A){return A===45||A===46||A===58||A===95||ma(A)?(t.consume(A),b):_(A)}function _(A){return A===61?(t.consume(A),S):yn(A)?(t.consume(A),_):x(A)}function S(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(t.consume(A),l=A,O):yn(A)?(t.consume(A),S):C(A)}function O(A){return A===l?(t.consume(A),l=null,E):A===null||Tt(A)?n(A):(t.consume(A),O)}function C(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||No(A)?_(A):(t.consume(A),C)}function E(A){return A===47||A===62||yn(A)?x(A):n(A)}function k(A){return A===62?(t.consume(A),I):n(A)}function I(A){return A===null||Tt(A)?P(A):yn(A)?(t.consume(A),I):n(A)}function P(A){return A===45&&i===2?(t.consume(A),z):A===60&&i===1?(t.consume(A),B):A===62&&i===4?(t.consume(A),$):A===63&&i===3?(t.consume(A),N):A===93&&i===5?(t.consume(A),U):Tt(A)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(cXe,D,R)(A)):A===null||Tt(A)?(t.exit("htmlFlowData"),R(A)):(t.consume(A),P)}function R(A){return t.check(uXe,T,D)(A)}function T(A){return t.enter("lineEnding"),t.consume(A),t.exit("lineEnding"),L}function L(A){return A===null||Tt(A)?R(A):(t.enter("htmlFlowData"),P(A))}function z(A){return A===45?(t.consume(A),N):P(A)}function B(A){return A===47?(t.consume(A),a="",W):P(A)}function W(A){if(A===62){const q=a.toLowerCase();return LH.includes(q)?(t.consume(A),$):P(A)}return Sl(A)&&a.length<8?(t.consume(A),a+=String.fromCharCode(A),W):P(A)}function U(A){return A===93?(t.consume(A),N):P(A)}function N(A){return A===62?(t.consume(A),$):A===45&&i===2?(t.consume(A),N):P(A)}function $(A){return A===null||Tt(A)?(t.exit("htmlFlowData"),D(A)):(t.consume(A),$)}function D(A){return t.exit("htmlFlow"),e(A)}}function hXe(t,e,n){const r=this;return i;function i(a){return Tt(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),o):n(a)}function o(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}function pXe(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(_2,e,n)}}const mXe={name:"htmlText",tokenize:gXe};function gXe(t,e,n){const r=this;let i,o,a;return s;function s(N){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(N),l}function l(N){return N===33?(t.consume(N),c):N===47?(t.consume(N),_):N===63?(t.consume(N),x):Sl(N)?(t.consume(N),C):n(N)}function c(N){return N===45?(t.consume(N),u):N===91?(t.consume(N),o=0,p):Sl(N)?(t.consume(N),y):n(N)}function u(N){return N===45?(t.consume(N),h):n(N)}function f(N){return N===null?n(N):N===45?(t.consume(N),d):Tt(N)?(a=f,B(N)):(t.consume(N),f)}function d(N){return N===45?(t.consume(N),h):f(N)}function h(N){return N===62?z(N):N===45?d(N):f(N)}function p(N){const $="CDATA[";return N===$.charCodeAt(o++)?(t.consume(N),o===$.length?m:p):n(N)}function m(N){return N===null?n(N):N===93?(t.consume(N),g):Tt(N)?(a=m,B(N)):(t.consume(N),m)}function g(N){return N===93?(t.consume(N),v):m(N)}function v(N){return N===62?z(N):N===93?(t.consume(N),v):m(N)}function y(N){return N===null||N===62?z(N):Tt(N)?(a=y,B(N)):(t.consume(N),y)}function x(N){return N===null?n(N):N===63?(t.consume(N),b):Tt(N)?(a=x,B(N)):(t.consume(N),x)}function b(N){return N===62?z(N):x(N)}function _(N){return Sl(N)?(t.consume(N),S):n(N)}function S(N){return N===45||ma(N)?(t.consume(N),S):O(N)}function O(N){return Tt(N)?(a=O,B(N)):yn(N)?(t.consume(N),O):z(N)}function C(N){return N===45||ma(N)?(t.consume(N),C):N===47||N===62||No(N)?E(N):n(N)}function E(N){return N===47?(t.consume(N),z):N===58||N===95||Sl(N)?(t.consume(N),k):Tt(N)?(a=E,B(N)):yn(N)?(t.consume(N),E):z(N)}function k(N){return N===45||N===46||N===58||N===95||ma(N)?(t.consume(N),k):I(N)}function I(N){return N===61?(t.consume(N),P):Tt(N)?(a=I,B(N)):yn(N)?(t.consume(N),I):E(N)}function P(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(t.consume(N),i=N,R):Tt(N)?(a=P,B(N)):yn(N)?(t.consume(N),P):(t.consume(N),T)}function R(N){return N===i?(t.consume(N),i=void 0,L):N===null?n(N):Tt(N)?(a=R,B(N)):(t.consume(N),R)}function T(N){return N===null||N===34||N===39||N===60||N===61||N===96?n(N):N===47||N===62||No(N)?E(N):(t.consume(N),T)}function L(N){return N===47||N===62||No(N)?E(N):n(N)}function z(N){return N===62?(t.consume(N),t.exit("htmlTextData"),t.exit("htmlText"),e):n(N)}function B(N){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(N),t.exit("lineEnding"),W}function W(N){return yn(N)?Wn(t,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):U(N)}function U(N){return t.enter("htmlTextData"),a(N)}}const ZB={name:"labelEnd",tokenize:wXe,resolveTo:_Xe,resolveAll:bXe},vXe={tokenize:SXe},yXe={tokenize:OXe},xXe={tokenize:CXe};function bXe(t){let e=-1;for(;++e=3&&(c===null||Tt(c))?(t.exit("thematicBreak"),e(c)):n(c)}function l(c){return c===i?(t.consume(c),r++,l):(t.exit("thematicBreakSequence"),yn(c)?Wn(t,s,"whitespace")(c):s(c))}}const _o={name:"list",tokenize:DXe,continuation:{tokenize:LXe},exit:NXe},RXe={tokenize:FXe,partial:!0},IXe={tokenize:$Xe,partial:!0};function DXe(t,e,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return s;function s(h){const p=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:k$(h)){if(r.containerState.type||(r.containerState.type=p,t.enter(p,{_container:!0})),p==="listUnordered")return t.enter("listItemPrefix"),h===42||h===45?t.check(MC,n,c)(h):c(h);if(!r.interrupt||h===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),l(h)}return n(h)}function l(h){return k$(h)&&++a<10?(t.consume(h),l):(!r.interrupt||a<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(t.exit("listItemValue"),c(h)):n(h)}function c(h){return t.enter("listItemMarker"),t.consume(h),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,t.check(_2,r.interrupt?n:u,t.attempt(RXe,d,f))}function u(h){return r.containerState.initialBlankLine=!0,o++,d(h)}function f(h){return yn(h)?(t.enter("listItemPrefixWhitespace"),t.consume(h),t.exit("listItemPrefixWhitespace"),d):n(h)}function d(h){return r.containerState.size=o+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(h)}}function LXe(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(_2,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Wn(t,e,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!yn(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(IXe,e,a)(s))}function a(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,Wn(t,t.attempt(_o,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function $Xe(t,e,n){const r=this;return Wn(t,i,"listItemIndent",r.containerState.size+1);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?e(o):n(o)}}function NXe(t){t.exit(this.containerState.type)}function FXe(t,e,n){const r=this;return Wn(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const a=r.events[r.events.length-1];return!yn(o)&&a&&a[1].type==="listItemPrefixWhitespace"?e(o):n(o)}}const $H={name:"setextUnderline",tokenize:BXe,resolveTo:jXe};function jXe(t,e){let n=t.length,r,i,o;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(i=n)}else t[n][1].type==="content"&&t.splice(n,1),!o&&t[n][1].type==="definition"&&(o=n);const a={type:"setextHeading",start:Object.assign({},t[i][1].start),end:Object.assign({},t[t.length-1][1].end)};return t[i][1].type="setextHeadingText",o?(t.splice(i,0,["enter",a,e]),t.splice(o+1,0,["exit",t[r][1],e]),t[r][1].end=Object.assign({},t[o][1].end)):t[r][1]=a,t.push(["exit",a,e]),t}function BXe(t,e,n){const r=this;let i;return o;function o(c){let u=r.events.length,f;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){f=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(t.enter("setextHeadingLine"),i=c,a(c)):n(c)}function a(c){return t.enter("setextHeadingLineSequence"),s(c)}function s(c){return c===i?(t.consume(c),s):(t.exit("setextHeadingLineSequence"),yn(c)?Wn(t,l,"lineSuffix")(c):l(c))}function l(c){return c===null||Tt(c)?(t.exit("setextHeadingLine"),e(c)):n(c)}}const zXe={tokenize:UXe};function UXe(t){const e=this,n=t.attempt(_2,r,t.attempt(this.parser.constructs.flowInitial,i,Wn(t,t.attempt(this.parser.constructs.flow,i,t.attempt(qqe,i)),"linePrefix")));return n;function r(o){if(o===null){t.consume(o);return}return t.enter("lineEndingBlank"),t.consume(o),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function i(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const WXe={resolveAll:vce()},VXe=gce("string"),GXe=gce("text");function gce(t){return{tokenize:e,resolveAll:vce(t==="text"?HXe:void 0)};function e(n){const r=this,i=this.parser.constructs[t],o=n.attempt(i,a,s);return a;function a(u){return c(u)?o(u):s(u)}function s(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),o(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const f=i[u];let d=-1;if(f)for(;++d-1){const s=a[0];typeof s=="string"?a[0]=s.slice(r):a.shift()}o>0&&a.push(t[i].slice(0,o))}return a}function QXe(t,e){let n=-1;const r=[];let i;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCharCode(n)}const sQe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function lQe(t){return t.replace(sQe,cQe)}function cQe(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return vce(n.slice(o?2:1),o?16:10)}return YB(n)||t}const yce={}.hasOwnProperty,uQe=function(t,e,n){return typeof e!="string"&&(n=e,e=void 0),fQe(n)(aQe(iQe(n).document().write(oQe()(t,e,!0))))};function fQe(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(ge),autolinkProtocol:I,autolinkEmail:I,atxHeading:s(le),blockQuote:s(be),characterEscape:I,characterReference:I,codeFenced:s(re),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:s(re,l),codeText:s(ve,l),codeTextData:I,data:I,codeFlowValue:I,definition:s(F),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:s(ce),hardBreakEscape:s(Q),hardBreakTrailing:s(Q),htmlFlow:s(X,l),htmlFlowData:I,htmlText:s(X,l),htmlTextData:I,image:s(ee),label:l,link:s(ge),listItem:s(H),listItemValue:p,listOrdered:s(ye,h),listUnordered:s(ye),paragraph:s(G),reference:Y,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:s(le),strong:s(ie),thematicBreak:s(_e)},exit:{atxHeading:u(),atxHeadingSequence:O,autolink:u(),autolinkEmail:pe,autolinkProtocol:J,blockQuote:u(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:se,characterReferenceMarkerNumeric:se,characterReferenceValue:te,codeFenced:u(y),codeFencedFence:v,codeFencedFenceInfo:m,codeFencedFenceMeta:g,codeFlowValue:P,codeIndented:u(x),codeText:u(B),codeTextData:P,data:P,definition:u(),definitionDestinationString:S,definitionLabelString:b,definitionTitleString:_,emphasis:u(),hardBreakEscape:u(T),hardBreakTrailing:u(T),htmlFlow:u(L),htmlFlowData:P,htmlText:u(z),htmlTextData:P,image:u(U),label:$,labelText:N,lineEnding:R,link:u(W),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:K,resourceDestinationString:D,resourceTitleString:A,resource:q,setextHeading:u(k),setextHeadingLineSequence:E,setextHeadingText:C,strong:u(),thematicBreak:u()}};xce(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(oe){let Z={type:"root",children:[]};const V={stack:[Z],tokenStack:[],config:e,enter:c,exit:f,buffer:l,resume:d,setData:o,getData:a},de=[];let xe=-1;for(;++xe0){const Me=V.tokenStack[V.tokenStack.length-1];(Me[1]||$H).call(V,void 0,Me[0])}for(Z.position={start:Du(oe.length>0?oe[0][1].start:{line:1,column:1,offset:0}),end:Du(oe.length>0?oe[oe.length-2][1].end:{line:1,column:1,offset:0})},xe=-1;++xe{const r=this.data("settings");return uQe(n,Object.assign({},r,t,{extensions:this.data("micromarkExtensions")||[],mdastExtensions:this.data("fromMarkdownExtensions")||[]}))}})}function pQe(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function mQe(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:` -`}]}function gQe(t,e){const n=e.value?e.value+` -`:"",r=e.lang?e.lang.match(/^[^ \t]+(?=[ \t]|$)/):null,i={};r&&(i.className=["language-"+r]);let o={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return e.meta&&(o.data={meta:e.meta}),t.patch(e,o),o=t.applyData(e,o),o={type:"element",tagName:"pre",properties:{},children:[o]},t.patch(e,o),o}function vQe(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function yQe(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function _y(t){const e=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const s=t.charCodeAt(n+1);o<56320&&s>56319&&s<57344?(a=String.fromCharCode(o,s),i=1):a="�"}else a=String.fromCharCode(o);a&&(e.push(t.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return e.join("")+t.slice(r)}function bce(t,e){const n=String(e.identifier).toUpperCase(),r=_y(n.toLowerCase()),i=t.footnoteOrder.indexOf(n);let o;i===-1?(t.footnoteOrder.push(n),t.footnoteCounts[n]=1,o=t.footnoteOrder.length):(t.footnoteCounts[n]++,o=i+1);const a=t.footnoteCounts[n],s={type:"element",tagName:"a",properties:{href:"#"+t.clobberPrefix+"fn-"+r,id:t.clobberPrefix+"fnref-"+r+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};t.patch(e,s);const l={type:"element",tagName:"sup",properties:{},children:[s]};return t.patch(e,l),t.applyData(e,l)}function xQe(t,e){const n=t.footnoteById;let r=1;for(;r in n;)r++;const i=String(r);return n[i]={type:"footnoteDefinition",identifier:i,children:[{type:"paragraph",children:e.children}],position:e.position},bce(t,{type:"footnoteReference",identifier:i,position:e.position})}function bQe(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function _Qe(t,e){if(t.dangerous){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}return null}function _ce(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return{type:"text",value:"!["+e.alt+r};const i=t.all(e),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function wQe(t,e){const n=t.definition(e.identifier);if(!n)return _ce(t,e);const r={src:_y(n.url||""),alt:e.alt};n.title!==null&&n.title!==void 0&&(r.title=n.title);const i={type:"element",tagName:"img",properties:r,children:[]};return t.patch(e,i),t.applyData(e,i)}function SQe(t,e){const n={src:_y(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function OQe(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function CQe(t,e){const n=t.definition(e.identifier);if(!n)return _ce(t,e);const r={href:_y(n.url||"")};n.title!==null&&n.title!==void 0&&(r.title=n.title);const i={type:"element",tagName:"a",properties:r,children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function TQe(t,e){const n={href:_y(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function EQe(t,e,n){const r=t.all(e),i=n?PQe(n):wce(e),o={},a=[];if(typeof e.checked=="boolean"){const u=r[0];let f;u&&u.type==="element"&&u.tagName==="p"?f=u:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let s=-1;for(;++s13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCharCode(n)}const cQe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function uQe(t){return t.replace(cQe,fQe)}function fQe(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return yce(n.slice(o?2:1),o?16:10)}return KB(n)||t}const xce={}.hasOwnProperty,dQe=function(t,e,n){return typeof e!="string"&&(n=e,e=void 0),hQe(n)(lQe(aQe(n).document().write(sQe()(t,e,!0))))};function hQe(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(ge),autolinkProtocol:I,autolinkEmail:I,atxHeading:s(le),blockQuote:s(be),characterEscape:I,characterReference:I,codeFenced:s(re),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:s(re,l),codeText:s(ve,l),codeTextData:I,data:I,codeFlowValue:I,definition:s(F),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:s(ce),hardBreakEscape:s(Q),hardBreakTrailing:s(Q),htmlFlow:s(X,l),htmlFlowData:I,htmlText:s(X,l),htmlTextData:I,image:s(ee),label:l,link:s(ge),listItem:s(H),listItemValue:p,listOrdered:s(ye,h),listUnordered:s(ye),paragraph:s(G),reference:Y,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:s(le),strong:s(ie),thematicBreak:s(_e)},exit:{atxHeading:u(),atxHeadingSequence:O,autolink:u(),autolinkEmail:pe,autolinkProtocol:J,blockQuote:u(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:se,characterReferenceMarkerNumeric:se,characterReferenceValue:te,codeFenced:u(y),codeFencedFence:v,codeFencedFenceInfo:m,codeFencedFenceMeta:g,codeFlowValue:P,codeIndented:u(x),codeText:u(B),codeTextData:P,data:P,definition:u(),definitionDestinationString:S,definitionLabelString:b,definitionTitleString:_,emphasis:u(),hardBreakEscape:u(T),hardBreakTrailing:u(T),htmlFlow:u(L),htmlFlowData:P,htmlText:u(z),htmlTextData:P,image:u(U),label:$,labelText:N,lineEnding:R,link:u(W),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:K,resourceDestinationString:D,resourceTitleString:A,resource:q,setextHeading:u(k),setextHeadingLineSequence:E,setextHeadingText:C,strong:u(),thematicBreak:u()}};bce(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(oe){let Z={type:"root",children:[]};const V={stack:[Z],tokenStack:[],config:e,enter:c,exit:f,buffer:l,resume:d,setData:o,getData:a},de=[];let xe=-1;for(;++xe0){const Me=V.tokenStack[V.tokenStack.length-1];(Me[1]||FH).call(V,void 0,Me[0])}for(Z.position={start:Du(oe.length>0?oe[0][1].start:{line:1,column:1,offset:0}),end:Du(oe.length>0?oe[oe.length-2][1].end:{line:1,column:1,offset:0})},xe=-1;++xe{const r=this.data("settings");return dQe(n,Object.assign({},r,t,{extensions:this.data("micromarkExtensions")||[],mdastExtensions:this.data("fromMarkdownExtensions")||[]}))}})}function gQe(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function vQe(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:` +`}]}function yQe(t,e){const n=e.value?e.value+` +`:"",r=e.lang?e.lang.match(/^[^ \t]+(?=[ \t]|$)/):null,i={};r&&(i.className=["language-"+r]);let o={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return e.meta&&(o.data={meta:e.meta}),t.patch(e,o),o=t.applyData(e,o),o={type:"element",tagName:"pre",properties:{},children:[o]},t.patch(e,o),o}function xQe(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function bQe(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function _y(t){const e=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const s=t.charCodeAt(n+1);o<56320&&s>56319&&s<57344?(a=String.fromCharCode(o,s),i=1):a="�"}else a=String.fromCharCode(o);a&&(e.push(t.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return e.join("")+t.slice(r)}function _ce(t,e){const n=String(e.identifier).toUpperCase(),r=_y(n.toLowerCase()),i=t.footnoteOrder.indexOf(n);let o;i===-1?(t.footnoteOrder.push(n),t.footnoteCounts[n]=1,o=t.footnoteOrder.length):(t.footnoteCounts[n]++,o=i+1);const a=t.footnoteCounts[n],s={type:"element",tagName:"a",properties:{href:"#"+t.clobberPrefix+"fn-"+r,id:t.clobberPrefix+"fnref-"+r+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};t.patch(e,s);const l={type:"element",tagName:"sup",properties:{},children:[s]};return t.patch(e,l),t.applyData(e,l)}function _Qe(t,e){const n=t.footnoteById;let r=1;for(;r in n;)r++;const i=String(r);return n[i]={type:"footnoteDefinition",identifier:i,children:[{type:"paragraph",children:e.children}],position:e.position},_ce(t,{type:"footnoteReference",identifier:i,position:e.position})}function wQe(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function SQe(t,e){if(t.dangerous){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}return null}function wce(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return{type:"text",value:"!["+e.alt+r};const i=t.all(e),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function OQe(t,e){const n=t.definition(e.identifier);if(!n)return wce(t,e);const r={src:_y(n.url||""),alt:e.alt};n.title!==null&&n.title!==void 0&&(r.title=n.title);const i={type:"element",tagName:"img",properties:r,children:[]};return t.patch(e,i),t.applyData(e,i)}function CQe(t,e){const n={src:_y(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function TQe(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function EQe(t,e){const n=t.definition(e.identifier);if(!n)return wce(t,e);const r={href:_y(n.url||"")};n.title!==null&&n.title!==void 0&&(r.title=n.title);const i={type:"element",tagName:"a",properties:r,children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function PQe(t,e){const n={href:_y(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function MQe(t,e,n){const r=t.all(e),i=n?kQe(n):Sce(e),o={},a=[];if(typeof e.checked=="boolean"){const u=r[0];let f;u&&u.type==="element"&&u.tagName==="p"?f=u:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let s=-1;for(;++s1}function MQe(t,e){const n={},r=t.all(e);let i=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++i-1?r.offset:null}}}function DQe(t,e){const n=t.all(e),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},s=ZB(e.children[1]),l=JB(e.children[e.children.length-1]);s.line&&l.line&&(a.position={start:s,end:l}),i.push(a)}const o={type:"element",tagName:"table",properties:{},children:t.wrap(i,!0)};return t.patch(e,o),t.applyData(e,o)}function LQe(t,e,n){const r=n?n.children:void 0,o=(r?r.indexOf(e):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,s=a?a.length:e.children.length;let l=-1;const c=[];for(;++l0,!0),r[0]),i=r.index+r[0].length,r=n.exec(e);return o.push(jH(e.slice(i),i>0,!1)),o.join("")}function jH(t,e,n){let r=0,i=t.length;if(e){let o=t.codePointAt(r);for(;o===NH||o===FH;)r++,o=t.codePointAt(r)}if(n){let o=t.codePointAt(i-1);for(;o===NH||o===FH;)i--,o=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function FQe(t,e){const n={type:"text",value:NQe(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function jQe(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const BQe={blockquote:pQe,break:mQe,code:gQe,delete:vQe,emphasis:yQe,footnoteReference:bce,footnote:xQe,heading:bQe,html:_Qe,imageReference:wQe,image:SQe,inlineCode:OQe,linkReference:CQe,link:TQe,listItem:EQe,list:MQe,paragraph:kQe,root:AQe,strong:RQe,table:DQe,tableCell:$Qe,tableRow:LQe,text:FQe,thematicBreak:jQe,toml:MS,yaml:MS,definition:MS,footnoteDefinition:MS};function MS(){return null}const Oce=function(t){if(t==null)return VQe;if(typeof t=="string")return WQe(t);if(typeof t=="object")return Array.isArray(t)?zQe(t):UQe(t);if(typeof t=="function")return w2(t);throw new Error("Expected function, string, or object as test")};function zQe(t){const e=[];let n=-1;for(;++n":""))+")"})}return f;function f(){let d=[],h,p,m;if((!e||i(s,l,c[c.length-1]||null))&&(d=XQe(n(s,c)),d[0]===BH))return d;if(s.children&&d[0]!==HQe)for(p=(r?s.children.length:-1)+o,m=c.concat(s);p>-1&&p{const i=UH(r.identifier);i&&!zH.call(e,i)&&(e[i]=r)}),n;function n(r){const i=UH(r);return i&&zH.call(e,i)?e[i]:null}}function UH(t){return String(t||"").toUpperCase()}const eE={}.hasOwnProperty;function KQe(t,e){const n=e||{},r=n.allowDangerousHtml||!1,i={};return a.dangerous=r,a.clobberPrefix=n.clobberPrefix===void 0||n.clobberPrefix===null?"user-content-":n.clobberPrefix,a.footnoteLabel=n.footnoteLabel||"Footnotes",a.footnoteLabelTagName=n.footnoteLabelTagName||"h2",a.footnoteLabelProperties=n.footnoteLabelProperties||{className:["sr-only"]},a.footnoteBackLabel=n.footnoteBackLabel||"Back to content",a.unknownHandler=n.unknownHandler,a.passThrough=n.passThrough,a.handlers={...BQe,...n.handlers},a.definition=YQe(t),a.footnoteById=i,a.footnoteOrder=[],a.footnoteCounts={},a.patch=ZQe,a.applyData=JQe,a.one=s,a.all=l,a.wrap=tYe,a.augment=o,ez(t,"footnoteDefinition",c=>{const u=String(c.identifier).toUpperCase();eE.call(i,u)||(i[u]=c)}),a;function o(c,u){if(c&&"data"in c&&c.data){const f=c.data;f.hName&&(u.type!=="element"&&(u={type:"element",tagName:"",properties:{},children:[]}),u.tagName=f.hName),u.type==="element"&&f.hProperties&&(u.properties={...u.properties,...f.hProperties}),"children"in u&&u.children&&f.hChildren&&(u.children=f.hChildren)}if(c){const f="type"in c?c:{position:c};QQe(f)||(u.position={start:ZB(f),end:JB(f)})}return u}function a(c,u,f,d){return Array.isArray(f)&&(d=f,f={}),o(c,{type:"element",tagName:u,properties:f||{},children:d||[]})}function s(c,u){return Cce(a,c,u)}function l(c){return tz(a,c)}}function ZQe(t,e){t.position&&(e.position=IQe(t))}function JQe(t,e){let n=e;if(t&&t.data){const r=t.data.hName,i=t.data.hChildren,o=t.data.hProperties;typeof r=="string"&&(n.type==="element"?n.tagName=r:n={type:"element",tagName:r,properties:{},children:[]}),n.type==="element"&&o&&(n.properties={...n.properties,...o}),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Cce(t,e,n){const r=e&&e.type;if(!r)throw new Error("Expected node, got `"+e+"`");return eE.call(t.handlers,r)?t.handlers[r](t,e,n):t.passThrough&&t.passThrough.includes(r)?"children"in e?{...e,children:tz(t,e)}:e:t.unknownHandler?t.unknownHandler(t,e,n):eYe(t,e)}function tz(t,e){const n=[];if("children"in e){const r=e.children;let i=-1;for(;++i1}function AQe(t,e){const n={},r=t.all(e);let i=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++i-1?r.offset:null}}}function $Qe(t,e){const n=t.all(e),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},s=JB(e.children[1]),l=ez(e.children[e.children.length-1]);s.line&&l.line&&(a.position={start:s,end:l}),i.push(a)}const o={type:"element",tagName:"table",properties:{},children:t.wrap(i,!0)};return t.patch(e,o),t.applyData(e,o)}function NQe(t,e,n){const r=n?n.children:void 0,o=(r?r.indexOf(e):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,s=a?a.length:e.children.length;let l=-1;const c=[];for(;++l0,!0),r[0]),i=r.index+r[0].length,r=n.exec(e);return o.push(zH(e.slice(i),i>0,!1)),o.join("")}function zH(t,e,n){let r=0,i=t.length;if(e){let o=t.codePointAt(r);for(;o===jH||o===BH;)r++,o=t.codePointAt(r)}if(n){let o=t.codePointAt(i-1);for(;o===jH||o===BH;)i--,o=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function BQe(t,e){const n={type:"text",value:jQe(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function zQe(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const UQe={blockquote:gQe,break:vQe,code:yQe,delete:xQe,emphasis:bQe,footnoteReference:_ce,footnote:_Qe,heading:wQe,html:SQe,imageReference:OQe,image:CQe,inlineCode:TQe,linkReference:EQe,link:PQe,listItem:MQe,list:AQe,paragraph:RQe,root:IQe,strong:DQe,table:$Qe,tableCell:FQe,tableRow:NQe,text:BQe,thematicBreak:zQe,toml:MS,yaml:MS,definition:MS,footnoteDefinition:MS};function MS(){return null}const Cce=function(t){if(t==null)return HQe;if(typeof t=="string")return GQe(t);if(typeof t=="object")return Array.isArray(t)?WQe(t):VQe(t);if(typeof t=="function")return w2(t);throw new Error("Expected function, string, or object as test")};function WQe(t){const e=[];let n=-1;for(;++n":""))+")"})}return f;function f(){let d=[],h,p,m;if((!e||i(s,l,c[c.length-1]||null))&&(d=YQe(n(s,c)),d[0]===UH))return d;if(s.children&&d[0]!==XQe)for(p=(r?s.children.length:-1)+o,m=c.concat(s);p>-1&&p{const i=VH(r.identifier);i&&!WH.call(e,i)&&(e[i]=r)}),n;function n(r){const i=VH(r);return i&&WH.call(e,i)?e[i]:null}}function VH(t){return String(t||"").toUpperCase()}const eE={}.hasOwnProperty;function JQe(t,e){const n=e||{},r=n.allowDangerousHtml||!1,i={};return a.dangerous=r,a.clobberPrefix=n.clobberPrefix===void 0||n.clobberPrefix===null?"user-content-":n.clobberPrefix,a.footnoteLabel=n.footnoteLabel||"Footnotes",a.footnoteLabelTagName=n.footnoteLabelTagName||"h2",a.footnoteLabelProperties=n.footnoteLabelProperties||{className:["sr-only"]},a.footnoteBackLabel=n.footnoteBackLabel||"Back to content",a.unknownHandler=n.unknownHandler,a.passThrough=n.passThrough,a.handlers={...UQe,...n.handlers},a.definition=ZQe(t),a.footnoteById=i,a.footnoteOrder=[],a.footnoteCounts={},a.patch=eYe,a.applyData=tYe,a.one=s,a.all=l,a.wrap=rYe,a.augment=o,tz(t,"footnoteDefinition",c=>{const u=String(c.identifier).toUpperCase();eE.call(i,u)||(i[u]=c)}),a;function o(c,u){if(c&&"data"in c&&c.data){const f=c.data;f.hName&&(u.type!=="element"&&(u={type:"element",tagName:"",properties:{},children:[]}),u.tagName=f.hName),u.type==="element"&&f.hProperties&&(u.properties={...u.properties,...f.hProperties}),"children"in u&&u.children&&f.hChildren&&(u.children=f.hChildren)}if(c){const f="type"in c?c:{position:c};KQe(f)||(u.position={start:JB(f),end:ez(f)})}return u}function a(c,u,f,d){return Array.isArray(f)&&(d=f,f={}),o(c,{type:"element",tagName:u,properties:f||{},children:d||[]})}function s(c,u){return Tce(a,c,u)}function l(c){return nz(a,c)}}function eYe(t,e){t.position&&(e.position=LQe(t))}function tYe(t,e){let n=e;if(t&&t.data){const r=t.data.hName,i=t.data.hChildren,o=t.data.hProperties;typeof r=="string"&&(n.type==="element"?n.tagName=r:n={type:"element",tagName:r,properties:{},children:[]}),n.type==="element"&&o&&(n.properties={...n.properties,...o}),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Tce(t,e,n){const r=e&&e.type;if(!r)throw new Error("Expected node, got `"+e+"`");return eE.call(t.handlers,r)?t.handlers[r](t,e,n):t.passThrough&&t.passThrough.includes(r)?"children"in e?{...e,children:nz(t,e)}:e:t.unknownHandler?t.unknownHandler(t,e,n):nYe(t,e)}function nz(t,e){const n=[];if("children"in e){const r=e.children;let i=-1;for(;++i0&&n.push({type:"text",value:` -`}),n}function nYe(t){const e=[];let n=-1;for(;++n1?"-"+s:""),dataFootnoteBackref:!0,className:["data-footnote-backref"],ariaLabel:t.footnoteBackLabel},children:[{type:"text",value:"↩"}]};s>1&&f.children.push({type:"element",tagName:"sup",children:[{type:"text",value:String(s)}]}),l.length>0&&l.push({type:"text",value:" "}),l.push(f)}const c=i[i.length-1];if(c&&c.type==="element"&&c.tagName==="p"){const f=c.children[c.children.length-1];f&&f.type==="text"?f.value+=" ":c.children.push({type:"text",value:" "}),c.children.push(...l)}else i.push(...l);const u={type:"element",tagName:"li",properties:{id:t.clobberPrefix+"fn-"+a},children:t.wrap(i,!0)};t.patch(r,u),e.push(u)}if(e.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:t.footnoteLabelTagName,properties:{...JSON.parse(JSON.stringify(t.footnoteLabelProperties)),id:"footnote-label"},children:[{type:"text",value:t.footnoteLabel}]},{type:"text",value:` +`}),n}function iYe(t){const e=[];let n=-1;for(;++n1?"-"+s:""),dataFootnoteBackref:!0,className:["data-footnote-backref"],ariaLabel:t.footnoteBackLabel},children:[{type:"text",value:"↩"}]};s>1&&f.children.push({type:"element",tagName:"sup",children:[{type:"text",value:String(s)}]}),l.length>0&&l.push({type:"text",value:" "}),l.push(f)}const c=i[i.length-1];if(c&&c.type==="element"&&c.tagName==="p"){const f=c.children[c.children.length-1];f&&f.type==="text"?f.value+=" ":c.children.push({type:"text",value:" "}),c.children.push(...l)}else i.push(...l);const u={type:"element",tagName:"li",properties:{id:t.clobberPrefix+"fn-"+a},children:t.wrap(i,!0)};t.patch(r,u),e.push(u)}if(e.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:t.footnoteLabelTagName,properties:{...JSON.parse(JSON.stringify(t.footnoteLabelProperties)),id:"footnote-label"},children:[{type:"text",value:t.footnoteLabel}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:t.wrap(e,!0)},{type:"text",value:` -`}]}}function Tce(t,e){const n=KQe(t,e),r=n.one(t,null),i=nYe(n);return i&&r.children.push({type:"text",value:` -`},i),Array.isArray(r)?{type:"root",children:r}:r}const rYe=function(t,e){return t&&"run"in t?oYe(t,e):aYe(t||e)},iYe=rYe;function oYe(t,e){return(n,r,i)=>{t.run(Tce(n,e),r,o=>{i(o)})}}function aYe(t){return e=>Tce(e,t)}class tw{constructor(e,n,r){this.property=e,this.normal=n,r&&(this.space=r)}}tw.prototype.property={};tw.prototype.normal={};tw.prototype.space=null;function Ece(t,e){const n={},r={};let i=-1;for(;++i4&&n.slice(0,4)==="data"&&fYe.test(e)){if(e.charAt(4)==="-"){const o=e.slice(5).replace(VH,mYe);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=e.slice(4);if(!VH.test(o)){let a=o.replace(dYe,pYe);a.charAt(0)!=="-"&&(a="-"+a),e="data"+a}}i=nz}return new i(r,e)}function pYe(t){return"-"+t.toLowerCase()}function mYe(t){return t.charAt(1).toUpperCase()}const GH={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"},gYe=Ece([kce,Mce,Ice,Dce,cYe],"html"),vYe=Ece([kce,Mce,Ice,Dce,uYe],"svg");function yYe(t){if(t.allowedElements&&t.disallowedElements)throw new TypeError("Only one of `allowedElements` and `disallowedElements` should be defined");if(t.allowedElements||t.disallowedElements||t.allowElement)return e=>{ez(e,"element",(n,r,i)=>{const o=i;let a;if(t.allowedElements?a=!t.allowedElements.includes(n.tagName):t.disallowedElements&&(a=t.disallowedElements.includes(n.tagName)),!a&&t.allowElement&&typeof r=="number"&&(a=!t.allowElement(n,r,o)),a&&typeof r=="number")return t.unwrapDisallowed&&n.children?o.children.splice(r,1,...n.children):o.children.splice(r,1),r})}}function xYe(t){const e=t&&typeof t=="object"&&t.type==="text"?t.value||"":t;return typeof e=="string"&&e.replace(/[ \t\n\f\r]/g,"")===""}function bYe(t){return t.join(" ").trim()}function _Ye(t,e){const n=e||{};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}var rz={exports:{}},HH=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,wYe=/\n/g,SYe=/^\s*/,OYe=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,CYe=/^:\s*/,TYe=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,EYe=/^[;\s]*/,PYe=/^\s+|\s+$/g,MYe=` -`,qH="/",XH="*",nh="",kYe="comment",AYe="declaration",RYe=function(t,e){if(typeof t!="string")throw new TypeError("First argument must be a string");if(!t)return[];e=e||{};var n=1,r=1;function i(p){var m=p.match(wYe);m&&(n+=m.length);var g=p.lastIndexOf(MYe);r=~g?p.length-g:r+p.length}function o(){var p={line:n,column:r};return function(m){return m.position=new a(p),c(),m}}function a(p){this.start=p,this.end={line:n,column:r},this.source=e.source}a.prototype.content=t;function s(p){var m=new Error(e.source+":"+n+":"+r+": "+p);if(m.reason=p,m.filename=e.source,m.line=n,m.column=r,m.source=t,!e.silent)throw m}function l(p){var m=p.exec(t);if(m){var g=m[0];return i(g),t=t.slice(g.length),m}}function c(){l(SYe)}function u(p){var m;for(p=p||[];m=f();)m!==!1&&p.push(m);return p}function f(){var p=o();if(!(qH!=t.charAt(0)||XH!=t.charAt(1))){for(var m=2;nh!=t.charAt(m)&&(XH!=t.charAt(m)||qH!=t.charAt(m+1));)++m;if(m+=2,nh===t.charAt(m-1))return s("End of comment missing");var g=t.slice(2,m-2);return r+=2,i(g),t=t.slice(m),r+=2,p({type:kYe,comment:g})}}function d(){var p=o(),m=l(OYe);if(m){if(f(),!l(CYe))return s("property missing ':'");var g=l(TYe),v=p({type:AYe,property:QH(m[0].replace(HH,nh)),value:g?QH(g[0].replace(HH,nh)):nh});return l(EYe),v}}function h(){var p=[];u(p);for(var m;m=d();)m!==!1&&(p.push(m),u(p));return p}return c(),h()};function QH(t){return t?t.replace(PYe,nh):nh}var IYe=RYe;function Lce(t,e){var n=null;if(!t||typeof t!="string")return n;for(var r,i=IYe(t),o=typeof e=="function",a,s,l=0,c=i.length;l0?ue.createElement(h,l,f):ue.createElement(h,l)}function FYe(t){let e=-1;for(;++e for more info)`),delete kS[o]}const e=iqe().use(hQe).use(t.remarkPlugins||[]).use(iYe,{...t.remarkRehypeOptions,allowDangerousHtml:!0}).use(t.rehypePlugins||[]).use(yYe,t),n=new rce;typeof t.children=="string"?n.value=t.children:t.children!==void 0&&t.children!==null&&console.warn(`[react-markdown] Warning: please pass a string as \`children\` (not: \`${t.children}\`)`);const r=e.runSync(e.parse(n),n);if(r.type!=="root")throw new TypeError("Expected a `root` node");let i=ue.createElement(ue.Fragment,{},$ce({options:t,schema:gYe,listDepth:0},r));return t.className&&(i=ue.createElement("div",{className:t.className},i)),i}S2.propTypes={children:Qe.string,className:Qe.string,allowElement:Qe.func,allowedElements:Qe.arrayOf(Qe.string),disallowedElements:Qe.arrayOf(Qe.string),unwrapDisallowed:Qe.bool,remarkPlugins:Qe.arrayOf(Qe.oneOfType([Qe.object,Qe.func,Qe.arrayOf(Qe.oneOfType([Qe.bool,Qe.string,Qe.object,Qe.func,Qe.arrayOf(Qe.any)]))])),rehypePlugins:Qe.arrayOf(Qe.oneOfType([Qe.object,Qe.func,Qe.arrayOf(Qe.oneOfType([Qe.bool,Qe.string,Qe.object,Qe.func,Qe.arrayOf(Qe.any)]))])),sourcePos:Qe.bool,rawSourcePos:Qe.bool,skipHtml:Qe.bool,includeElementIndex:Qe.bool,transformLinkUri:Qe.oneOfType([Qe.func,Qe.bool]),linkTarget:Qe.oneOfType([Qe.func,Qe.string]),transformImageUri:Qe.func,components:Qe.object};var iz={},VYe=ct;Object.defineProperty(iz,"__esModule",{value:!0});var kp=iz.default=void 0,GYe=VYe(pt()),HYe=w;kp=iz.default=(0,GYe.default)((0,HYe.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");function Nce(t){const[e,n]=M.useState();return M.useEffect(()=>{t?fetch(t).then(r=>r.text()).then(r=>n(r)).catch(r=>{console.error(r)}):n(void 0)},[t]),e}const aR={dialog:t=>({backgroundColor:t.palette.grey[200]}),appBar:{position:"relative"},title:t=>({marginLeft:t.spacing(2),flex:1})},qYe=Li("div")(({theme:t})=>({marginTop:t.spacing(4),marginLeft:t.spacing(40),marginRight:t.spacing(40)})),XYe=ue.forwardRef(function(e,n){return w.jsx(lAe,{direction:"up",ref:n,...e})}),QYe=({title:t,href:e,open:n,onClose:r})=>{const i=Nce(e);return w.jsxs(el,{fullScreen:!0,open:n,onClose:r,TransitionComponent:XYe,PaperProps:{tabIndex:-1},children:[w.jsx(pre,{sx:aR.appBar,children:w.jsxs(BM,{children:[w.jsx(Ot,{edge:"start",color:"inherit",onClick:r,"aria-label":"close",size:"large",children:w.jsx(kp,{})}),w.jsx(At,{variant:"h6",sx:aR.title,children:t})]})}),w.jsx(qs,{sx:aR.dialog,children:w.jsx(qYe,{children:w.jsx(S2,{children:i||"",linkTarget:"_blank"})})})]})};var oz={},YYe=ct;Object.defineProperty(oz,"__esModule",{value:!0});var D$=oz.default=void 0,KYe=YYe(pt()),ZYe=w;D$=oz.default=(0,KYe.default)((0,ZYe.jsx)("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4"}),"Person");const JYe=({userInfo:t})=>w.jsxs(wC,{container:!0,justifyContent:"center",spacing:1,children:[w.jsx(wC,{item:!0,children:w.jsx("img",{src:t.picture,width:84,alt:fe.get("User Profile")})}),w.jsx(wC,{item:!0,children:w.jsx(Go,{elevation:3,children:w.jsxs(FM,{children:[w.jsx(jx,{children:w.jsx(es,{primary:t.name,secondary:fe.get("User name")})}),w.jsx(Qg,{light:!0}),w.jsx(jx,{children:w.jsx(es,{primary:`${t.email} (${t.email_verified?fe.get("verified"):fe.get("not verified")})`,secondary:fe.get("E-mail")})}),w.jsx(Qg,{light:!0}),w.jsx(jx,{children:w.jsx(es,{primary:t.nickname,secondary:fe.get("Nickname")})})]})})})]}),S0={imageAvatar:{width:32,height:32,color:"#fff",backgroundColor:Ph[300]},letterAvatar:{width:32,height:32,color:"#fff",backgroundColor:Ph[300]},signInProgress:{color:Ph[300],position:"absolute",top:"50%",left:"50%",zIndex:1,marginTop:-12,marginLeft:-12},iconButton:{padding:0}},eKe=Li("div")(({theme:t})=>({margin:t.spacing(1),position:"relative"})),tKe=({updateAccessToken:t})=>{const e=$Ne(),[n,r]=M.useState(null),[i,o]=M.useState(!1);M.useEffect(()=>{e.user&&e.user.access_token?t(e.user.access_token):t(null)},[e.user,t]);const a=()=>{c(),o(!0)},s=()=>{o(!1)},l=d=>{r(d.currentTarget)},c=()=>{r(null)},u=()=>{e.signinRedirect().then(()=>{}).catch(d=>{console.error(d)})},f=()=>{c(),e.signoutRedirect().then(()=>{}).catch(d=>{console.error(d)})};if(e.user){const d=e.user.profile;let h,p=w.jsx(D$,{});if(!d)h=w.jsx(yA,{sx:S0.letterAvatar,children:"?"});else if(d.picture)h=w.jsx(yA,{sx:S0.imageAvatar,src:d.picture,alt:d.name});else{const m=d.given_name||d.name||d.nickname,g=d.family_name;let v=null;m&&g?v=m[0]+g[0]:m?v=m[0]:g&&(v=g[0]),v!==null&&(p=v.toUpperCase()),h=w.jsx(yA,{sx:S0.letterAvatar,children:p})}return w.jsxs(M.Fragment,{children:[w.jsx(Ot,{onClick:l,"aria-controls":"user-menu","aria-haspopup":"true",size:"small",sx:S0.iconButton,children:h}),w.jsxs(_p,{id:"user-menu",anchorEl:n,keepMounted:!0,open:!!n,onClose:c,children:[w.jsx(Nr,{onClick:a,children:fe.get("Profile")}),w.jsx(Nr,{onClick:f,children:fe.get("Log out")})]}),w.jsxs(el,{open:i,keepMounted:!0,onClose:s,"aria-labelledby":"alert-dialog-slide-title","aria-describedby":"alert-dialog-slide-description",children:[w.jsx(dd,{id:"alert-dialog-slide-title",children:fe.get("User Profile")}),w.jsx(qs,{children:w.jsx(JYe,{userInfo:e.user.profile})}),w.jsx(yp,{children:w.jsx(er,{onClick:s,children:"OK"})})]})]})}else{let d=w.jsx(Ot,{onClick:e.isLoading?void 0:u,size:"small",children:w.jsx(D$,{})});return e.isLoading&&(d=w.jsxs(eKe,{children:[d,w.jsx(Qv,{size:24,sx:S0.signInProgress})]})),d}},nKe=t=>Kt.instance.authClient?w.jsx(tKe,{...t}):null,rKe=nKe,Fce="UPDATE_ACCESS_TOKEN";function iKe(t){return(e,n)=>{const r=n().userAuthState.accessToken;r!==t&&(e(oKe(t)),(t===null||r===null)&&e(Hse()))}}function oKe(t){return{type:Fce,accessToken:t}}const aKe=t=>({}),sKe={updateAccessToken:iKe},lKe=Jt(aKe,sKe)(rKe),cKe=t=>({locale:t.controlState.locale,appName:Kt.instance.branding.appBarTitle,allowRefresh:Kt.instance.branding.allowRefresh}),uKe={openDialog:Pp,updateResources:Gse},fKe={appBar:t=>({zIndex:t.zIndex.drawer+1,transition:t.transitions.create(["width","margin"],{easing:t.transitions.easing.sharp,duration:t.transitions.duration.leavingScreen})})},dKe=we("a")(()=>({display:"flex",alignItems:"center"})),hKe=we("img")(({theme:t})=>({marginLeft:t.spacing(1)})),Ld={toolbar:t=>({backgroundColor:Kt.instance.branding.headerBackgroundColor,paddingRight:t.spacing(1)}),logo:t=>({marginLeft:t.spacing(1)}),title:t=>({flexGrow:1,marginLeft:t.spacing(1),...Kt.instance.branding.headerTitleStyle}),imageAvatar:{width:24,height:24,color:"#fff",backgroundColor:Ph[300]},letterAvatar:{width:24,height:24,color:"#fff",backgroundColor:Ph[300]},signInWrapper:t=>({margin:t.spacing(1),position:"relative"}),signInProgress:{color:Ph[300],position:"absolute",top:"50%",left:"50%",zIndex:1,marginTop:"-12px",marginLeft:"-12px"},iconButton:t=>({marginLeft:t.spacing(2),...Kt.instance.branding.headerIconStyle})},pKe=({appName:t,openDialog:e,allowRefresh:n,updateResources:r})=>{const[i,o]=M.useState(!1),a=()=>{e("settings")},s=()=>{window.open("https://xcube.readthedocs.io/en/latest/viewer.html","Manual")},l=()=>{o(!0)},c=()=>{o(!1)};return w.jsxs(pre,{position:"absolute",sx:fKe.appBar,elevation:0,children:[w.jsxs(BM,{disableGutters:!0,sx:Ld.toolbar,variant:"dense",children:[w.jsx(dKe,{href:Kt.instance.branding.organisationUrl||"",target:"_blank",rel:"noreferrer",children:w.jsx(hKe,{src:Kt.instance.branding.logoImage,width:Kt.instance.branding.logoWidth,alt:"xcube logo"})}),w.jsx(At,{component:"h1",variant:"h6",color:"inherit",noWrap:!0,sx:Ld.title,children:t}),w.jsx(lKe,{}),n&&w.jsx(_t,{arrow:!0,title:fe.get("Refresh"),children:w.jsx(Ot,{onClick:r,size:"small",sx:Ld.iconButton,children:w.jsx(A5,{})})}),Kt.instance.branding.allowDownloads&&w.jsx(_t,{arrow:!0,title:fe.get("Export data"),children:w.jsx(Ot,{onClick:()=>e("export"),size:"small",sx:Ld.iconButton,children:w.jsx(D5,{})})}),w.jsx(_t,{arrow:!0,title:fe.get("Help"),children:w.jsx(Ot,{onClick:s,size:"small",sx:Ld.iconButton,children:w.jsx(E5,{})})}),w.jsx(_t,{arrow:!0,title:fe.get("Imprint"),children:w.jsx(Ot,{onClick:l,size:"small",sx:Ld.iconButton,children:w.jsx(Eie,{})})}),w.jsx(_t,{arrow:!0,title:fe.get("Settings"),children:w.jsx(Ot,{onClick:a,size:"small",sx:Ld.iconButton,children:w.jsx(M5,{})})})]}),w.jsx(QYe,{title:fe.get("Imprint"),href:"docs/imprint.md",open:i,onClose:c})]})},mKe=Jt(cKe,uKe)(pKe),gKe=Li("form")(({theme:t})=>({display:"flex",flexWrap:"wrap",paddingTop:t.spacing(1),paddingLeft:t.spacing(1),paddingRight:t.spacing(1),flexGrow:0}));function vKe({children:t}){return w.jsx(gKe,{autoComplete:"off",children:t})}var az={},yKe=ct;Object.defineProperty(az,"__esModule",{value:!0});var sz=az.default=void 0,xKe=yKe(pt()),bKe=w;sz=az.default=(0,xKe.default)((0,bKe.jsx)("path",{d:"M19.3 16.9c.4-.7.7-1.5.7-2.4 0-2.5-2-4.5-4.5-4.5S11 12 11 14.5s2 4.5 4.5 4.5c.9 0 1.7-.3 2.4-.7l3.2 3.2 1.4-1.4zm-3.8.1c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5M12 20v2C6.48 22 2 17.52 2 12S6.48 2 12 2c4.84 0 8.87 3.44 9.8 8h-2.07c-.64-2.46-2.4-4.47-4.73-5.41V5c0 1.1-.9 2-2 2h-2v2c0 .55-.45 1-1 1H8v2h2v3H9l-4.79-4.79C4.08 10.79 4 11.38 4 12c0 4.41 3.59 8 8 8"}),"TravelExplore");const Qa=({sx:t,className:e,disabled:n,onClick:r,icon:i,tooltipText:o,toggle:a,value:s,selected:l})=>{const c=f=>{a?r(f,s):r(f)},u=o?w.jsx(_t,{arrow:!0,title:o,children:i}):i;return a?w.jsx(Pn,{sx:{padding:.3,...t},className:e,disabled:n,size:"small",onClick:c,value:s||"",selected:l,children:u}):w.jsx(Ot,{sx:t,className:e,disabled:n,size:"small",onClick:c,children:u})},_Ke=Li(Yv)(({theme:t})=>({marginRight:t.spacing(1)}));function qb({label:t,control:e,actions:n}){return w.jsx(_Ke,{variant:"standard",children:w.jsxs(Ke,{children:[t,e,n]})})}function wKe({selectedDatasetId:t,datasets:e,selectDataset:n,locateSelectedDataset:r}){const i=M.useMemo(()=>e.sort((d,h)=>{const p=d.groupTitle||"zzz",m=h.groupTitle||"zzz",g=p.localeCompare(m);return g!==0?g:d.title.localeCompare(h.title)}),[e]),o=i.length>0&&!!i[0].groupTitle,a=d=>{const h=d.target.value||null;n(h,e,!0)};t=t||"",e=e||[];const s=w.jsx(Kv,{shrink:!0,htmlFor:"dataset-select",children:fe.get("Dataset")}),l=[];let c;i.forEach(d=>{if(o){const h=d.groupTitle||fe.get("Others");h!==c&&l.push(w.jsx(Qg,{children:w.jsx(At,{fontSize:"small",color:"text.secondary",children:h})},h)),c=h}l.push(w.jsx(Nr,{value:d.id,selected:d.id===t,children:d.title},d.id))});const u=w.jsx(wp,{variant:"standard",value:t,onChange:a,input:w.jsx(xp,{name:"dataset",id:"dataset-select"}),displayEmpty:!0,name:"dataset",children:l}),f=w.jsx(Qa,{onClick:r,tooltipText:fe.get("Locate dataset in map"),icon:w.jsx(sz,{})});return w.jsx(qb,{label:s,control:u,actions:f})}const SKe=t=>({locale:t.controlState.locale,selectedDatasetId:t.controlState.selectedDatasetId,datasets:t.dataState.datasets}),OKe={selectDataset:hle,locateSelectedDataset:x7e},CKe=Jt(SKe,OKe)(wKe);var lz={},TKe=ct;Object.defineProperty(lz,"__esModule",{value:!0});var tE=lz.default=void 0,EKe=TKe(pt()),PKe=w;tE=lz.default=(0,EKe.default)((0,PKe.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-5.97 4.06L14.09 6l1.41 1.41L16.91 6l1.06 1.06-1.41 1.41 1.41 1.41-1.06 1.06-1.41-1.4-1.41 1.41-1.06-1.06 1.41-1.41zm-6.78.66h5v1.5h-5zM11.5 16h-2v2H8v-2H6v-1.5h2v-2h1.5v2h2zm6.5 1.25h-5v-1.5h5zm0-2.5h-5v-1.5h5z"}),"Calculate");var cz={},MKe=ct;Object.defineProperty(cz,"__esModule",{value:!0});var uz=cz.default=void 0,kKe=MKe(pt()),AKe=w;uz=cz.default=(0,kKe.default)((0,AKe.jsx)("path",{d:"M18 4H6v2l6.5 6L6 18v2h12v-3h-7l5-5-5-5h7z"}),"Functions");var fz={},RKe=ct;Object.defineProperty(fz,"__esModule",{value:!0});var nE=fz.default=void 0,IKe=RKe(pt()),DKe=w;nE=fz.default=(0,IKe.default)((0,DKe.jsx)("path",{fillRule:"evenodd",d:"M16 9V4h1c.55 0 1-.45 1-1s-.45-1-1-1H7c-.55 0-1 .45-1 1s.45 1 1 1h1v5c0 1.66-1.34 3-3 3v2h5.97v7l1 1 1-1v-7H19v-2c-1.66 0-3-1.34-3-3"}),"PushPin");var dz={},LKe=ct;Object.defineProperty(dz,"__esModule",{value:!0});var jce=dz.default=void 0,$Ke=LKe(pt()),NKe=w;jce=dz.default=(0,$Ke.default)((0,NKe.jsx)("path",{d:"M23 8c0 1.1-.9 2-2 2-.18 0-.35-.02-.51-.07l-3.56 3.55c.05.16.07.34.07.52 0 1.1-.9 2-2 2s-2-.9-2-2c0-.18.02-.36.07-.52l-2.55-2.55c-.16.05-.34.07-.52.07s-.36-.02-.52-.07l-4.55 4.56c.05.16.07.33.07.51 0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2c.18 0 .35.02.51.07l4.56-4.55C8.02 9.36 8 9.18 8 9c0-1.1.9-2 2-2s2 .9 2 2c0 .18-.02.36-.07.52l2.55 2.55c.16-.05.34-.07.52-.07s.36.02.52.07l3.55-3.56C19.02 8.35 19 8.18 19 8c0-1.1.9-2 2-2s2 .9 2 2"}),"Timeline");const Mo={toggleButton:{padding:.3}},rE="userVariablesDialog";function FKe(){return{id:Ys("user"),name:"",title:"",units:"",expression:"",colorBarName:"bone",colorBarMin:0,colorBarMax:1,shape:[],dims:[],dtype:"float64",timeChunkSize:null,attrs:{}}}function jKe(t){return{...t,id:Ys("user"),name:`${t.name}_copy`,title:t.title?`${t.title} Copy`:""}}const BKe={variables:!0,constants:!1,arrayOperators:!1,otherOperators:!1,arrayFunctions:!1,otherFunctions:!1},Bce=["variables","constants","arrayOperators","otherOperators","arrayFunctions","otherFunctions"],zKe={variables:"Variables",constants:"Constants",arrayOperators:"Array operators",otherOperators:"Other operators",arrayFunctions:"Array functions",otherFunctions:"Other functions"};function UKe({selectedDatasetId:t,selectedVariableName:e,selectedDataset2Id:n,selectedVariable2Name:r,variables:i,userVariablesAllowed:o,canAddTimeSeries:a,addTimeSeries:s,canAddStatistics:l,addStatistics:c,selectVariable:u,selectVariable2:f,openDialog:d}){const h=C=>{u(C.target.value||null)},p=()=>{d(rE)},m=()=>{s()},g=()=>{c()},v=t===n&&e===r,y=w.jsx(Kv,{shrink:!0,htmlFor:"variable-select",children:fe.get("Variable")}),x=w.jsx(wp,{variant:"standard",value:e||"",onChange:h,input:w.jsx(xp,{name:"variable",id:"variable-select"}),displayEmpty:!0,name:"variable",renderValue:()=>KH(i.find(C=>C.name===e)),children:(i||[]).map(C=>w.jsxs(Nr,{value:C.name,selected:C.name===e,children:[N1(C)&&w.jsx(Yre,{children:w.jsx(tE,{fontSize:"small"})}),w.jsx(es,{children:KH(C)}),t===n&&C.name===r&&w.jsx(nE,{fontSize:"small",color:"secondary"})]},C.name))}),b=o&&w.jsx(Qa,{onClick:p,tooltipText:fe.get("Create and manage user variables"),icon:w.jsx(tE,{})},"userVariables"),_=w.jsx(Qa,{disabled:!a,onClick:m,tooltipText:fe.get("Show time-series diagram"),icon:w.jsx(jce,{})},"timeSeries"),S=w.jsx(Qa,{disabled:!l,onClick:g,tooltipText:fe.get("Add statistics"),icon:w.jsx(uz,{})},"statistics"),O=w.jsx(Pn,{selected:v,value:"comparison",size:"small",sx:{...Mo.toggleButton,marginLeft:.4},onClick:()=>f(t,e),children:w.jsx(_t,{arrow:!0,title:fe.get("Make it 2nd variable for comparison"),children:w.jsx(nE,{fontSize:"small"})})},"variable2");return w.jsx(qb,{label:y,control:x,actions:[O,b,_,S]})}function KH(t){return t?t.title||t.name:"?"}const WKe=t=>({locale:t.controlState.locale,selectedDatasetId:t.controlState.selectedDatasetId,selectedVariableName:t.controlState.selectedVariableName,selectedDataset2Id:t.controlState.selectedDataset2Id,selectedVariable2Name:t.controlState.selectedVariable2Name,userVariablesAllowed:EHe(),canAddTimeSeries:Ose(t),canAddStatistics:Cse(t),variables:$He(t)}),VKe={openDialog:Pp,selectVariable:Sle,selectVariable2:k7e,addTimeSeries:g2,addStatistics:Zse},GKe=Jt(WKe,VKe)(UKe);var hz={},HKe=ct;Object.defineProperty(hz,"__esModule",{value:!0});var Ap=hz.default=void 0,qKe=HKe(pt()),XKe=w;Ap=hz.default=(0,qKe.default)((0,XKe.jsx)("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}),"Edit");var pz={},QKe=ct;Object.defineProperty(pz,"__esModule",{value:!0});var nw=pz.default=void 0,YKe=QKe(pt()),KKe=w;nw=pz.default=(0,YKe.default)((0,KKe.jsx)("path",{d:"M7 11v2h10v-2zm5-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"RemoveCircleOutline");const zce=({itemValue:t,setItemValue:e,validateItemValue:n,editMode:r,setEditMode:i,labelText:o,select:a,actions:s})=>{const l=M.useRef(null),[c,u]=M.useState("");M.useEffect(()=>{r&&u(t)},[r,t,u]),M.useEffect(()=>{if(r){const p=l.current;p!==null&&(p.focus(),p.select())}},[r]);const f=w.jsx(Kv,{shrink:!0,htmlFor:"place-select",children:o});if(!r)return w.jsx(qb,{label:f,control:a,actions:s});const d=n?n(c):!0,h=w.jsx(xp,{value:c,error:!d,inputRef:l,onBlur:()=>i(!1),onKeyUp:p=>{p.code==="Escape"?i(!1):p.code==="Enter"&&d&&(i(!1),e(c))},onChange:p=>{u(p.currentTarget.value)}});return w.jsx(qb,{label:f,control:h})},ZKe={select:{minWidth:"5em"}};function JKe({placeGroups:t,selectPlaceGroups:e,renameUserPlaceGroup:n,removeUserPlaceGroup:r,selectedPlaceGroupIds:i,selectedPlaceGroupsTitle:o}){const[a,s]=M.useState(!1);if(t=t||[],i=i||[],t.length===0)return null;const l=i.length===1?i[0]:null,c=m=>{n(l,m)},u=m=>{e(m.target.value||null)},f=()=>o,d=w.jsx(wp,{variant:"standard",multiple:!0,displayEmpty:!0,onChange:u,input:w.jsx(xp,{name:"place-groups",id:"place-groups-select"}),value:i,renderValue:f,name:"place-groups",sx:ZKe.select,children:t.map(m=>w.jsxs(Nr,{value:m.id,children:[w.jsx(IL,{checked:i.indexOf(m.id)>-1}),w.jsx(es,{primary:m.title})]},m.id))});let h=!1;l!==null&&l.startsWith(oy)&&(h=!!t.find(m=>m.id===l&&m.features&&m.features.length>=0));let p;if(h){const m=()=>{s(!0)},g=()=>{r(l)};p=[w.jsx(Qa,{onClick:m,tooltipText:fe.get("Rename place group"),icon:w.jsx(Ap,{})},"editPlaceGroup"),w.jsx(Qa,{onClick:g,tooltipText:fe.get("Remove places"),icon:w.jsx(nw,{})},"removePlaceGroup")]}return w.jsx(zce,{itemValue:o,setItemValue:c,validateItemValue:m=>m.trim().length>0,editMode:a,setEditMode:s,labelText:fe.get("Places"),select:d,actions:p})}const eZe=t=>({locale:t.controlState.locale,selectedPlaceGroupIds:t.controlState.selectedPlaceGroupIds,placeGroups:m2(t),selectedPlaceGroupsTitle:XHe(t)}),tZe={selectPlaceGroups:S7e,renameUserPlaceGroup:q9e,removeUserPlaceGroup:J9e},nZe=Jt(eZe,tZe)(JKe);var mz={},rZe=ct;Object.defineProperty(mz,"__esModule",{value:!0});var Uce=mz.default=void 0,iZe=rZe(pt()),oZe=w;Uce=mz.default=(0,iZe.default)((0,oZe.jsx)("path",{d:"M16.56 8.94 7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.59-.59 1.54 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.58.59-1.53 0-2.12M5.21 10 10 5.21 14.79 10zM19 11.5s-2 2.17-2 3.5c0 1.1.9 2 2 2s2-.9 2-2c0-1.33-2-3.5-2-3.5M2 20h20v4H2z"}),"FormatColorFill");const $d={container:{display:"grid",gridTemplateColumns:"auto 120px",gridTemplateRows:"auto",gridTemplateAreas:"'colorLabel colorValue' 'opacityLabel opacityValue'",rowGap:1,columnGap:2.5,padding:1},colorLabel:{gridArea:"colorLabel",alignSelf:"center"},colorValue:{gridArea:"colorValue",alignSelf:"center",width:"100%",height:"22px",borderWidth:1,borderStyle:"solid",borderColor:"black"},opacityLabel:{gridArea:"opacityLabel",alignSelf:"center"},opacityValue:{gridArea:"opacityValue",alignSelf:"center",width:"100%"},colorMenuItem:{padding:"4px 8px 4px 8px"},colorMenuItemBox:{width:"104px",height:"18px"}},aZe=({anchorEl:t,setAnchorEl:e,isPoint:n,placeStyle:r,updatePlaceStyle:i})=>{const[o,a]=M.useState(null);function s(l){a(l.currentTarget)}return w.jsxs(w.Fragment,{children:[w.jsx(bp,{open:t!==null,anchorEl:t,onClose:()=>e(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:w.jsxs(Ke,{sx:$d.container,children:[w.jsx(At,{sx:$d.colorLabel,children:fe.get("Color")}),w.jsx(At,{sx:$d.opacityLabel,color:n?"text.secondary":"text.primary",children:fe.get("Opacity")}),w.jsx(Ke,{sx:$d.colorValue,style:{backgroundColor:r.color},onClick:s}),w.jsx(Zv,{sx:$d.opacityValue,disabled:n,size:"small",min:0,max:1,step:.05,value:r.opacity,onChange:(l,c)=>i({...r,opacity:c})})]})}),w.jsx(_p,{open:!!o,anchorEl:o,onClose:()=>a(null),children:b5.map(([l,c])=>w.jsx(Nr,{selected:r.color===l,sx:$d.colorMenuItem,onClick:()=>i({...r,color:l}),children:w.jsx(_t,{title:l,children:w.jsx(Ke,{sx:{...$d.colorMenuItemBox,backgroundColor:l}})})},l))})]})},sZe={select:{minWidth:"5em"}};function lZe({selectPlace:t,placeLabels:e,selectedPlaceId:n,selectedPlaceGroupIds:r,selectedPlaceInfo:i,renameUserPlace:o,restyleUserPlace:a,removeUserPlace:s,places:l,locateSelectedPlace:c}){const[u,f]=M.useState(!1),[d,h]=M.useState(null);l=l||[],e=e||[],n=n||"",r=r||[];const p=r.length===1?r[0]:null,m=l.findIndex(O=>O.id===n),g=m>=0?e[m]:"",v=O=>{o(p,n,O)},y=O=>{a(p,n,O)},x=O=>{t(O.target.value||null,l,!0)},b=w.jsx(wp,{variant:"standard",value:n,onChange:x,input:w.jsx(xp,{name:"place",id:"place-select"}),displayEmpty:!0,name:"place",sx:sZe.select,disabled:l.length===0,children:l.map((O,C)=>w.jsx(Nr,{value:O.id,selected:O.id===n,children:e[C]},O.id))}),_=p!==null&&p.startsWith(oy)&&n!=="";let S=[w.jsx(Qa,{onClick:c,tooltipText:fe.get("Locate place in map"),icon:w.jsx(sz,{})},"locatePlace")];if(!u&&_){const O=()=>{f(!0)},C=k=>{h(k.currentTarget)},E=()=>{s(p,n,l)};S=[w.jsx(Qa,{onClick:O,tooltipText:fe.get("Rename place"),icon:w.jsx(Ap,{})},"editButton"),w.jsx(Qa,{onClick:C,tooltipText:fe.get("Style place"),icon:w.jsx(Uce,{})},"styleButton"),w.jsx(Qa,{onClick:E,tooltipText:fe.get("Remove place"),icon:w.jsx(nw,{})},"removeButton")].concat(S)}return w.jsxs(w.Fragment,{children:[w.jsx(zce,{itemValue:g,setItemValue:v,validateItemValue:O=>O.trim().length>0,editMode:u,setEditMode:f,labelText:fe.get("Place"),select:b,actions:S}),i&&w.jsx(aZe,{anchorEl:d,setAnchorEl:h,isPoint:i.place.geometry.type==="Point",placeStyle:i,updatePlaceStyle:y})]})}const cZe=t=>({locale:t.controlState.locale,datasets:t.dataState.datasets,selectedPlaceGroupIds:t.controlState.selectedPlaceGroupIds,selectedPlaceId:t.controlState.selectedPlaceId,selectedPlaceInfo:Z1(t),places:K1(t),placeLabels:ZHe(t)}),uZe={selectPlace:v2,renameUserPlace:X9e,restyleUserPlace:Y9e,removeUserPlace:Z9e,locateSelectedPlace:b7e,openDialog:Pp},fZe=Jt(cZe,uZe)(lZe);var gz={},dZe=ct;Object.defineProperty(gz,"__esModule",{value:!0});var Wce=gz.default=void 0,hZe=dZe(pt()),pZe=w;Wce=gz.default=(0,hZe.default)((0,pZe.jsx)("path",{d:"M12 2C8.14 2 5 5.14 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.86-3.14-7-7-7m4 8h-3v3h-2v-3H8V8h3V5h2v3h3z"}),"AddLocation");var vz={},mZe=ct;Object.defineProperty(vz,"__esModule",{value:!0});var Vce=vz.default=void 0,gZe=mZe(pt()),vZe=w;Vce=vz.default=(0,gZe.default)((0,vZe.jsx)("path",{d:"M11.71 17.99C8.53 17.84 6 15.22 6 12c0-3.31 2.69-6 6-6 3.22 0 5.84 2.53 5.99 5.71l-2.1-.63C15.48 9.31 13.89 8 12 8c-2.21 0-4 1.79-4 4 0 1.89 1.31 3.48 3.08 3.89zM22 12c0 .3-.01.6-.04.9l-1.97-.59c.01-.1.01-.21.01-.31 0-4.42-3.58-8-8-8s-8 3.58-8 8 3.58 8 8 8c.1 0 .21 0 .31-.01l.59 1.97c-.3.03-.6.04-.9.04-5.52 0-10-4.48-10-10S6.48 2 12 2s10 4.48 10 10m-3.77 4.26L22 15l-10-3 3 10 1.26-3.77 4.27 4.27 1.98-1.98z"}),"AdsClick");var yz={},yZe=ct;Object.defineProperty(yz,"__esModule",{value:!0});var Gce=yz.default=void 0,xZe=yZe(pt()),sR=w;Gce=yz.default=(0,xZe.default)([(0,sR.jsx)("path",{d:"m12 2-5.5 9h11z"},"0"),(0,sR.jsx)("circle",{cx:"17.5",cy:"17.5",r:"4.5"},"1"),(0,sR.jsx)("path",{d:"M3 13.5h8v8H3z"},"2")],"Category");var xz={},bZe=ct;Object.defineProperty(xz,"__esModule",{value:!0});var Hce=xz.default=void 0,_Ze=bZe(pt()),wZe=w;Hce=xz.default=(0,_Ze.default)((0,wZe.jsx)("circle",{cx:"12",cy:"12",r:"8"}),"FiberManualRecord");var bz={},SZe=ct;Object.defineProperty(bz,"__esModule",{value:!0});var qce=bz.default=void 0,OZe=SZe(pt()),CZe=w;qce=bz.default=(0,OZe.default)((0,CZe.jsx)("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M14 13v4h-4v-4H7l5-5 5 5z"}),"CloudUpload");const TZe=Li(Yv)(({theme:t})=>({marginTop:t.spacing(2),marginLeft:t.spacing(1),marginRight:t.spacing(2)}));function EZe({mapInteraction:t,setMapInteraction:e}){function n(r,i){e(i!==null?i:"Select")}return w.jsx(TZe,{variant:"standard",children:w.jsxs(Jv,{size:"small",value:t,exclusive:!0,onChange:n,children:[w.jsx(Pn,{value:"Select",size:"small",sx:Mo.toggleButton,children:w.jsx(_t,{arrow:!0,title:fe.get("Select a place in map"),children:w.jsx(Vce,{})})},0),w.jsx(Pn,{value:"Point",size:"small",sx:Mo.toggleButton,children:w.jsx(_t,{arrow:!0,title:fe.get("Add a point location in map"),children:w.jsx(Wce,{})})},1),w.jsx(Pn,{value:"Polygon",size:"small",sx:Mo.toggleButton,children:w.jsx(_t,{arrow:!0,title:fe.get("Draw a polygon area in map"),children:w.jsx(Gce,{})})},2),w.jsx(Pn,{value:"Circle",size:"small",sx:Mo.toggleButton,children:w.jsx(_t,{arrow:!0,title:fe.get("Draw a circular area in map"),children:w.jsx(Hce,{})})},3),w.jsx(Pn,{value:"Geometry",size:"small",sx:Mo.toggleButton,children:w.jsx(_t,{arrow:!0,title:fe.get("Import places"),children:w.jsx(qce,{})})},4)]})})}const PZe=t=>({mapInteraction:t.controlState.mapInteraction}),MZe={setMapInteraction:kle},kZe=Jt(PZe,MZe)(EZe);var ZH=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rw=(typeof window>"u"?"undefined":ZH(window))==="object"&&(typeof document>"u"?"undefined":ZH(document))==="object"&&document.nodeType===9,AZe={}.constructor;function L$(t){if(t==null||typeof t!="object")return t;if(Array.isArray(t))return t.map(L$);if(t.constructor!==AZe)return t;var e={};for(var n in t)e[n]=L$(t[n]);return e}function _z(t,e,n){t===void 0&&(t="unnamed");var r=n.jss,i=L$(e),o=r.plugins.onCreateRule(t,i,n);return o||(t[0],null)}var JH=function(e,n){for(var r="",i=0;i<+~=|^:(),"'`\s])/g,e9=typeof CSS<"u"&&CSS.escape,wz=function(t){return e9?e9(t):t.replace(RZe,"\\$1")},Xce=function(){function t(n,r,i){this.type="style",this.isProcessed=!1;var o=i.sheet,a=i.Renderer;this.key=n,this.options=i,this.style=r,o?this.renderer=o.renderer:a&&(this.renderer=new a)}var e=t.prototype;return e.prop=function(r,i,o){if(i===void 0)return this.style[r];var a=o?o.force:!1;if(!a&&this.style[r]===i)return this;var s=i;(!o||o.process!==!1)&&(s=this.options.jss.plugins.onChangeValue(i,r,this));var l=s==null||s===!1,c=r in this.style;if(l&&!c&&!a)return this;var u=l&&c;if(u?delete this.style[r]:this.style[r]=s,this.renderable&&this.renderer)return u?this.renderer.removeProperty(this.renderable,r):this.renderer.setProperty(this.renderable,r,s),this;var f=this.options.sheet;return f&&f.attached,this},t}(),$$=function(t){P1(e,t);function e(r,i,o){var a;a=t.call(this,r,i,o)||this;var s=o.selector,l=o.scoped,c=o.sheet,u=o.generateId;return s?a.selectorText=s:l!==!1&&(a.id=u(lt(lt(a)),c),a.selectorText="."+wz(a.id)),a}var n=e.prototype;return n.applyTo=function(i){var o=this.renderer;if(o){var a=this.toJSON();for(var s in a)o.setProperty(i,s,a[s])}return this},n.toJSON=function(){var i={};for(var o in this.style){var a=this.style[o];typeof a!="object"?i[o]=a:Array.isArray(a)&&(i[o]=$h(a))}return i},n.toString=function(i){var o=this.options.sheet,a=o?o.options.link:!1,s=a?j({},i,{allowEmpty:!0}):i;return Xb(this.selectorText,this.style,s)},Xt(e,[{key:"selector",set:function(i){if(i!==this.selectorText){this.selectorText=i;var o=this.renderer,a=this.renderable;if(!(!a||!o)){var s=o.setSelector(a,i);s||o.replaceRule(a,this)}}},get:function(){return this.selectorText}}]),e}(Xce),IZe={onCreateRule:function(e,n,r){return e[0]==="@"||r.parent&&r.parent.type==="keyframes"?null:new $$(e,n,r)}},lR={indent:1,children:!0},DZe=/@([\w-]+)/,LZe=function(){function t(n,r,i){this.type="conditional",this.isProcessed=!1,this.key=n;var o=n.match(DZe);this.at=o?o[1]:"unknown",this.query=i.name||"@"+this.at,this.options=i,this.rules=new O2(j({},i,{parent:this}));for(var a in r)this.rules.add(a,r[a]);this.rules.process()}var e=t.prototype;return e.getRule=function(r){return this.rules.get(r)},e.indexOf=function(r){return this.rules.indexOf(r)},e.addRule=function(r,i,o){var a=this.rules.add(r,i,o);return a?(this.options.jss.plugins.onProcessRule(a),a):null},e.replaceRule=function(r,i,o){var a=this.rules.replace(r,i,o);return a&&this.options.jss.plugins.onProcessRule(a),a},e.toString=function(r){r===void 0&&(r=lR);var i=Sy(r),o=i.linebreak;if(r.indent==null&&(r.indent=lR.indent),r.children==null&&(r.children=lR.children),r.children===!1)return this.query+" {}";var a=this.rules.toString(r);return a?this.query+" {"+o+a+o+"}":""},t}(),$Ze=/@container|@media|@supports\s+/,NZe={onCreateRule:function(e,n,r){return $Ze.test(e)?new LZe(e,n,r):null}},cR={indent:1,children:!0},FZe=/@keyframes\s+([\w-]+)/,N$=function(){function t(n,r,i){this.type="keyframes",this.at="@keyframes",this.isProcessed=!1;var o=n.match(FZe);o&&o[1]?this.name=o[1]:this.name="noname",this.key=this.type+"-"+this.name,this.options=i;var a=i.scoped,s=i.sheet,l=i.generateId;this.id=a===!1?this.name:wz(l(this,s)),this.rules=new O2(j({},i,{parent:this}));for(var c in r)this.rules.add(c,r[c],j({},i,{parent:this}));this.rules.process()}var e=t.prototype;return e.toString=function(r){r===void 0&&(r=cR);var i=Sy(r),o=i.linebreak;if(r.indent==null&&(r.indent=cR.indent),r.children==null&&(r.children=cR.children),r.children===!1)return this.at+" "+this.id+" {}";var a=this.rules.toString(r);return a&&(a=""+o+a+o),this.at+" "+this.id+" {"+a+"}"},t}(),jZe=/@keyframes\s+/,BZe=/\$([\w-]+)/g,F$=function(e,n){return typeof e=="string"?e.replace(BZe,function(r,i){return i in n?n[i]:r}):e},t9=function(e,n,r){var i=e[n],o=F$(i,r);o!==i&&(e[n]=o)},zZe={onCreateRule:function(e,n,r){return typeof e=="string"&&jZe.test(e)?new N$(e,n,r):null},onProcessStyle:function(e,n,r){return n.type!=="style"||!r||("animation-name"in e&&t9(e,"animation-name",r.keyframes),"animation"in e&&t9(e,"animation",r.keyframes)),e},onChangeValue:function(e,n,r){var i=r.options.sheet;if(!i)return e;switch(n){case"animation":return F$(e,i.keyframes);case"animation-name":return F$(e,i.keyframes);default:return e}}},UZe=function(t){P1(e,t);function e(){return t.apply(this,arguments)||this}var n=e.prototype;return n.toString=function(i){var o=this.options.sheet,a=o?o.options.link:!1,s=a?j({},i,{allowEmpty:!0}):i;return Xb(this.key,this.style,s)},e}(Xce),WZe={onCreateRule:function(e,n,r){return r.parent&&r.parent.type==="keyframes"?new UZe(e,n,r):null}},VZe=function(){function t(n,r,i){this.type="font-face",this.at="@font-face",this.isProcessed=!1,this.key=n,this.style=r,this.options=i}var e=t.prototype;return e.toString=function(r){var i=Sy(r),o=i.linebreak;if(Array.isArray(this.style)){for(var a="",s=0;s=this.index){i.push(r);return}for(var a=0;ao){i.splice(a,0,r);return}}},e.reset=function(){this.registry=[]},e.remove=function(r){var i=this.registry.indexOf(r);this.registry.splice(i,1)},e.toString=function(r){for(var i=r===void 0?{}:r,o=i.attached,a=Ae(i,["attached"]),s=Sy(a),l=s.linebreak,c="",u=0;u-1?i.substr(0,o-1):i;e.style.setProperty(n,a,o>-1?"important":"")}}catch{return!1}return!0},rJe=function(e,n){try{e.attributeStyleMap?e.attributeStyleMap.delete(n):e.style.removeProperty(n)}catch{}},iJe=function(e,n){return e.selectorText=n,e.selectorText===n},Kce=Yce(function(){return document.querySelector("head")});function oJe(t,e){for(var n=0;ne.index&&r.options.insertionPoint===e.insertionPoint)return r}return null}function aJe(t,e){for(var n=t.length-1;n>=0;n--){var r=t[n];if(r.attached&&r.options.insertionPoint===e.insertionPoint)return r}return null}function sJe(t){for(var e=Kce(),n=0;n0){var n=oJe(e,t);if(n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element};if(n=aJe(e,t),n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element.nextSibling}}var r=t.insertionPoint;if(r&&typeof r=="string"){var i=sJe(r);if(i)return{parent:i.parentNode,node:i.nextSibling}}return!1}function cJe(t,e){var n=e.insertionPoint,r=lJe(e);if(r!==!1&&r.parent){r.parent.insertBefore(t,r.node);return}if(n&&typeof n.nodeType=="number"){var i=n,o=i.parentNode;o&&o.insertBefore(t,i.nextSibling);return}Kce().appendChild(t)}var uJe=Yce(function(){var t=document.querySelector('meta[property="csp-nonce"]');return t?t.getAttribute("content"):null}),a9=function(e,n,r){try{"insertRule"in e?e.insertRule(n,r):"appendRule"in e&&e.appendRule(n)}catch{return!1}return e.cssRules[r]},s9=function(e,n){var r=e.cssRules.length;return n===void 0||n>r?r:n},fJe=function(){var e=document.createElement("style");return e.textContent=` -`,e},dJe=function(){function t(n){this.getPropertyValue=tJe,this.setProperty=nJe,this.removeProperty=rJe,this.setSelector=iJe,this.hasInsertedRules=!1,this.cssRules=[],n&&qx.add(n),this.sheet=n;var r=this.sheet?this.sheet.options:{},i=r.media,o=r.meta,a=r.element;this.element=a||fJe(),this.element.setAttribute("data-jss",""),i&&this.element.setAttribute("media",i),o&&this.element.setAttribute("data-meta",o);var s=uJe();s&&this.element.setAttribute("nonce",s)}var e=t.prototype;return e.attach=function(){if(!(this.element.parentNode||!this.sheet)){cJe(this.element,this.sheet.options);var r=!!(this.sheet&&this.sheet.deployed);this.hasInsertedRules&&r&&(this.hasInsertedRules=!1,this.deploy())}},e.detach=function(){if(this.sheet){var r=this.element.parentNode;r&&r.removeChild(this.element),this.sheet.options.link&&(this.cssRules=[],this.element.textContent=` +`}]}}function Ece(t,e){const n=JQe(t,e),r=n.one(t,null),i=iYe(n);return i&&r.children.push({type:"text",value:` +`},i),Array.isArray(r)?{type:"root",children:r}:r}const oYe=function(t,e){return t&&"run"in t?sYe(t,e):lYe(t||e)},aYe=oYe;function sYe(t,e){return(n,r,i)=>{t.run(Ece(n,e),r,o=>{i(o)})}}function lYe(t){return e=>Ece(e,t)}class tw{constructor(e,n,r){this.property=e,this.normal=n,r&&(this.space=r)}}tw.prototype.property={};tw.prototype.normal={};tw.prototype.space=null;function Pce(t,e){const n={},r={};let i=-1;for(;++i4&&n.slice(0,4)==="data"&&hYe.test(e)){if(e.charAt(4)==="-"){const o=e.slice(5).replace(HH,vYe);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=e.slice(4);if(!HH.test(o)){let a=o.replace(pYe,gYe);a.charAt(0)!=="-"&&(a="-"+a),e="data"+a}}i=rz}return new i(r,e)}function gYe(t){return"-"+t.toLowerCase()}function vYe(t){return t.charAt(1).toUpperCase()}const qH={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"},yYe=Pce([Ace,kce,Dce,Lce,fYe],"html"),xYe=Pce([Ace,kce,Dce,Lce,dYe],"svg");function bYe(t){if(t.allowedElements&&t.disallowedElements)throw new TypeError("Only one of `allowedElements` and `disallowedElements` should be defined");if(t.allowedElements||t.disallowedElements||t.allowElement)return e=>{tz(e,"element",(n,r,i)=>{const o=i;let a;if(t.allowedElements?a=!t.allowedElements.includes(n.tagName):t.disallowedElements&&(a=t.disallowedElements.includes(n.tagName)),!a&&t.allowElement&&typeof r=="number"&&(a=!t.allowElement(n,r,o)),a&&typeof r=="number")return t.unwrapDisallowed&&n.children?o.children.splice(r,1,...n.children):o.children.splice(r,1),r})}}function _Ye(t){const e=t&&typeof t=="object"&&t.type==="text"?t.value||"":t;return typeof e=="string"&&e.replace(/[ \t\n\f\r]/g,"")===""}function wYe(t){return t.join(" ").trim()}function SYe(t,e){const n=e||{};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}var iz={exports:{}},XH=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,OYe=/\n/g,CYe=/^\s*/,TYe=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,EYe=/^:\s*/,PYe=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,MYe=/^[;\s]*/,kYe=/^\s+|\s+$/g,AYe=` +`,QH="/",YH="*",nh="",RYe="comment",IYe="declaration",DYe=function(t,e){if(typeof t!="string")throw new TypeError("First argument must be a string");if(!t)return[];e=e||{};var n=1,r=1;function i(p){var m=p.match(OYe);m&&(n+=m.length);var g=p.lastIndexOf(AYe);r=~g?p.length-g:r+p.length}function o(){var p={line:n,column:r};return function(m){return m.position=new a(p),c(),m}}function a(p){this.start=p,this.end={line:n,column:r},this.source=e.source}a.prototype.content=t;function s(p){var m=new Error(e.source+":"+n+":"+r+": "+p);if(m.reason=p,m.filename=e.source,m.line=n,m.column=r,m.source=t,!e.silent)throw m}function l(p){var m=p.exec(t);if(m){var g=m[0];return i(g),t=t.slice(g.length),m}}function c(){l(CYe)}function u(p){var m;for(p=p||[];m=f();)m!==!1&&p.push(m);return p}function f(){var p=o();if(!(QH!=t.charAt(0)||YH!=t.charAt(1))){for(var m=2;nh!=t.charAt(m)&&(YH!=t.charAt(m)||QH!=t.charAt(m+1));)++m;if(m+=2,nh===t.charAt(m-1))return s("End of comment missing");var g=t.slice(2,m-2);return r+=2,i(g),t=t.slice(m),r+=2,p({type:RYe,comment:g})}}function d(){var p=o(),m=l(TYe);if(m){if(f(),!l(EYe))return s("property missing ':'");var g=l(PYe),v=p({type:IYe,property:KH(m[0].replace(XH,nh)),value:g?KH(g[0].replace(XH,nh)):nh});return l(MYe),v}}function h(){var p=[];u(p);for(var m;m=d();)m!==!1&&(p.push(m),u(p));return p}return c(),h()};function KH(t){return t?t.replace(kYe,nh):nh}var LYe=DYe;function $ce(t,e){var n=null;if(!t||typeof t!="string")return n;for(var r,i=LYe(t),o=typeof e=="function",a,s,l=0,c=i.length;l0?ue.createElement(h,l,f):ue.createElement(h,l)}function BYe(t){let e=-1;for(;++e for more info)`),delete kS[o]}const e=aqe().use(mQe).use(t.remarkPlugins||[]).use(aYe,{...t.remarkRehypeOptions,allowDangerousHtml:!0}).use(t.rehypePlugins||[]).use(bYe,t),n=new ice;typeof t.children=="string"?n.value=t.children:t.children!==void 0&&t.children!==null&&console.warn(`[react-markdown] Warning: please pass a string as \`children\` (not: \`${t.children}\`)`);const r=e.runSync(e.parse(n),n);if(r.type!=="root")throw new TypeError("Expected a `root` node");let i=ue.createElement(ue.Fragment,{},Nce({options:t,schema:yYe,listDepth:0},r));return t.className&&(i=ue.createElement("div",{className:t.className},i)),i}S2.propTypes={children:Qe.string,className:Qe.string,allowElement:Qe.func,allowedElements:Qe.arrayOf(Qe.string),disallowedElements:Qe.arrayOf(Qe.string),unwrapDisallowed:Qe.bool,remarkPlugins:Qe.arrayOf(Qe.oneOfType([Qe.object,Qe.func,Qe.arrayOf(Qe.oneOfType([Qe.bool,Qe.string,Qe.object,Qe.func,Qe.arrayOf(Qe.any)]))])),rehypePlugins:Qe.arrayOf(Qe.oneOfType([Qe.object,Qe.func,Qe.arrayOf(Qe.oneOfType([Qe.bool,Qe.string,Qe.object,Qe.func,Qe.arrayOf(Qe.any)]))])),sourcePos:Qe.bool,rawSourcePos:Qe.bool,skipHtml:Qe.bool,includeElementIndex:Qe.bool,transformLinkUri:Qe.oneOfType([Qe.func,Qe.bool]),linkTarget:Qe.oneOfType([Qe.func,Qe.string]),transformImageUri:Qe.func,components:Qe.object};var oz={},HYe=ct;Object.defineProperty(oz,"__esModule",{value:!0});var kp=oz.default=void 0,qYe=HYe(pt()),XYe=w;kp=oz.default=(0,qYe.default)((0,XYe.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");function Fce(t){const[e,n]=M.useState();return M.useEffect(()=>{t?fetch(t).then(r=>r.text()).then(r=>n(r)).catch(r=>{console.error(r)}):n(void 0)},[t]),e}const sR={dialog:t=>({backgroundColor:t.palette.grey[200]}),appBar:{position:"relative"},title:t=>({marginLeft:t.spacing(2),flex:1})},QYe=Li("div")(({theme:t})=>({marginTop:t.spacing(4),marginLeft:t.spacing(40),marginRight:t.spacing(40)})),YYe=ue.forwardRef(function(e,n){return w.jsx(cAe,{direction:"up",ref:n,...e})}),KYe=({title:t,href:e,open:n,onClose:r})=>{const i=Fce(e);return w.jsxs(el,{fullScreen:!0,open:n,onClose:r,TransitionComponent:YYe,PaperProps:{tabIndex:-1},children:[w.jsx(gre,{sx:sR.appBar,children:w.jsxs(BM,{children:[w.jsx(Ot,{edge:"start",color:"inherit",onClick:r,"aria-label":"close",size:"large",children:w.jsx(kp,{})}),w.jsx(At,{variant:"h6",sx:sR.title,children:t})]})}),w.jsx(qs,{sx:sR.dialog,children:w.jsx(QYe,{children:w.jsx(S2,{children:i||"",linkTarget:"_blank"})})})]})};var az={},ZYe=ct;Object.defineProperty(az,"__esModule",{value:!0});var L$=az.default=void 0,JYe=ZYe(pt()),eKe=w;L$=az.default=(0,JYe.default)((0,eKe.jsx)("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4"}),"Person");const tKe=({userInfo:t})=>w.jsxs(wC,{container:!0,justifyContent:"center",spacing:1,children:[w.jsx(wC,{item:!0,children:w.jsx("img",{src:t.picture,width:84,alt:fe.get("User Profile")})}),w.jsx(wC,{item:!0,children:w.jsx(Go,{elevation:3,children:w.jsxs(FM,{children:[w.jsx(jx,{children:w.jsx(es,{primary:t.name,secondary:fe.get("User name")})}),w.jsx(Qg,{light:!0}),w.jsx(jx,{children:w.jsx(es,{primary:`${t.email} (${t.email_verified?fe.get("verified"):fe.get("not verified")})`,secondary:fe.get("E-mail")})}),w.jsx(Qg,{light:!0}),w.jsx(jx,{children:w.jsx(es,{primary:t.nickname,secondary:fe.get("Nickname")})})]})})})]}),S0={imageAvatar:{width:32,height:32,color:"#fff",backgroundColor:Ph[300]},letterAvatar:{width:32,height:32,color:"#fff",backgroundColor:Ph[300]},signInProgress:{color:Ph[300],position:"absolute",top:"50%",left:"50%",zIndex:1,marginTop:-12,marginLeft:-12},iconButton:{padding:0}},nKe=Li("div")(({theme:t})=>({margin:t.spacing(1),position:"relative"})),rKe=({updateAccessToken:t})=>{const e=FNe(),[n,r]=M.useState(null),[i,o]=M.useState(!1);M.useEffect(()=>{e.user&&e.user.access_token?t(e.user.access_token):t(null)},[e.user,t]);const a=()=>{c(),o(!0)},s=()=>{o(!1)},l=d=>{r(d.currentTarget)},c=()=>{r(null)},u=()=>{e.signinRedirect().then(()=>{}).catch(d=>{console.error(d)})},f=()=>{c(),e.signoutRedirect().then(()=>{}).catch(d=>{console.error(d)})};if(e.user){const d=e.user.profile;let h,p=w.jsx(L$,{});if(!d)h=w.jsx(yA,{sx:S0.letterAvatar,children:"?"});else if(d.picture)h=w.jsx(yA,{sx:S0.imageAvatar,src:d.picture,alt:d.name});else{const m=d.given_name||d.name||d.nickname,g=d.family_name;let v=null;m&&g?v=m[0]+g[0]:m?v=m[0]:g&&(v=g[0]),v!==null&&(p=v.toUpperCase()),h=w.jsx(yA,{sx:S0.letterAvatar,children:p})}return w.jsxs(M.Fragment,{children:[w.jsx(Ot,{onClick:l,"aria-controls":"user-menu","aria-haspopup":"true",size:"small",sx:S0.iconButton,children:h}),w.jsxs(_p,{id:"user-menu",anchorEl:n,keepMounted:!0,open:!!n,onClose:c,children:[w.jsx(Nr,{onClick:a,children:fe.get("Profile")}),w.jsx(Nr,{onClick:f,children:fe.get("Log out")})]}),w.jsxs(el,{open:i,keepMounted:!0,onClose:s,"aria-labelledby":"alert-dialog-slide-title","aria-describedby":"alert-dialog-slide-description",children:[w.jsx(dd,{id:"alert-dialog-slide-title",children:fe.get("User Profile")}),w.jsx(qs,{children:w.jsx(tKe,{userInfo:e.user.profile})}),w.jsx(yp,{children:w.jsx(er,{onClick:s,children:"OK"})})]})]})}else{let d=w.jsx(Ot,{onClick:e.isLoading?void 0:u,size:"small",children:w.jsx(L$,{})});return e.isLoading&&(d=w.jsxs(nKe,{children:[d,w.jsx(Qv,{size:24,sx:S0.signInProgress})]})),d}},iKe=t=>Kt.instance.authClient?w.jsx(rKe,{...t}):null,oKe=iKe,jce="UPDATE_ACCESS_TOKEN";function aKe(t){return(e,n)=>{const r=n().userAuthState.accessToken;r!==t&&(e(sKe(t)),(t===null||r===null)&&e(qse()))}}function sKe(t){return{type:jce,accessToken:t}}const lKe=t=>({}),cKe={updateAccessToken:aKe},uKe=Jt(lKe,cKe)(oKe),fKe=t=>({locale:t.controlState.locale,appName:Kt.instance.branding.appBarTitle,allowRefresh:Kt.instance.branding.allowRefresh}),dKe={openDialog:Pp,updateResources:Hse},hKe={appBar:t=>({zIndex:t.zIndex.drawer+1,transition:t.transitions.create(["width","margin"],{easing:t.transitions.easing.sharp,duration:t.transitions.duration.leavingScreen})})},pKe=we("a")(()=>({display:"flex",alignItems:"center"})),mKe=we("img")(({theme:t})=>({marginLeft:t.spacing(1)})),Ld={toolbar:t=>({backgroundColor:Kt.instance.branding.headerBackgroundColor,paddingRight:t.spacing(1)}),logo:t=>({marginLeft:t.spacing(1)}),title:t=>({flexGrow:1,marginLeft:t.spacing(1),...Kt.instance.branding.headerTitleStyle}),imageAvatar:{width:24,height:24,color:"#fff",backgroundColor:Ph[300]},letterAvatar:{width:24,height:24,color:"#fff",backgroundColor:Ph[300]},signInWrapper:t=>({margin:t.spacing(1),position:"relative"}),signInProgress:{color:Ph[300],position:"absolute",top:"50%",left:"50%",zIndex:1,marginTop:"-12px",marginLeft:"-12px"},iconButton:t=>({marginLeft:t.spacing(2),...Kt.instance.branding.headerIconStyle})},gKe=({appName:t,openDialog:e,allowRefresh:n,updateResources:r})=>{const[i,o]=M.useState(!1),a=()=>{e("settings")},s=()=>{window.open("https://xcube.readthedocs.io/en/latest/viewer.html","Manual")},l=()=>{o(!0)},c=()=>{o(!1)};return w.jsxs(gre,{position:"absolute",sx:hKe.appBar,elevation:0,children:[w.jsxs(BM,{disableGutters:!0,sx:Ld.toolbar,variant:"dense",children:[w.jsx(pKe,{href:Kt.instance.branding.organisationUrl||"",target:"_blank",rel:"noreferrer",children:w.jsx(mKe,{src:Kt.instance.branding.logoImage,width:Kt.instance.branding.logoWidth,alt:"xcube logo"})}),w.jsx(At,{component:"h1",variant:"h6",color:"inherit",noWrap:!0,sx:Ld.title,children:t}),w.jsx(uKe,{}),n&&w.jsx(_t,{arrow:!0,title:fe.get("Refresh"),children:w.jsx(Ot,{onClick:r,size:"small",sx:Ld.iconButton,children:w.jsx(R5,{})})}),Kt.instance.branding.allowDownloads&&w.jsx(_t,{arrow:!0,title:fe.get("Export data"),children:w.jsx(Ot,{onClick:()=>e("export"),size:"small",sx:Ld.iconButton,children:w.jsx(L5,{})})}),w.jsx(_t,{arrow:!0,title:fe.get("Help"),children:w.jsx(Ot,{onClick:s,size:"small",sx:Ld.iconButton,children:w.jsx(P5,{})})}),w.jsx(_t,{arrow:!0,title:fe.get("Imprint"),children:w.jsx(Ot,{onClick:l,size:"small",sx:Ld.iconButton,children:w.jsx(Pie,{})})}),w.jsx(_t,{arrow:!0,title:fe.get("Settings"),children:w.jsx(Ot,{onClick:a,size:"small",sx:Ld.iconButton,children:w.jsx(k5,{})})})]}),w.jsx(KYe,{title:fe.get("Imprint"),href:"docs/imprint.md",open:i,onClose:c})]})},vKe=Jt(fKe,dKe)(gKe),yKe=Li("form")(({theme:t})=>({display:"flex",flexWrap:"wrap",paddingTop:t.spacing(1),paddingLeft:t.spacing(1),paddingRight:t.spacing(1),flexGrow:0}));function xKe({children:t}){return w.jsx(yKe,{autoComplete:"off",children:t})}var sz={},bKe=ct;Object.defineProperty(sz,"__esModule",{value:!0});var lz=sz.default=void 0,_Ke=bKe(pt()),wKe=w;lz=sz.default=(0,_Ke.default)((0,wKe.jsx)("path",{d:"M19.3 16.9c.4-.7.7-1.5.7-2.4 0-2.5-2-4.5-4.5-4.5S11 12 11 14.5s2 4.5 4.5 4.5c.9 0 1.7-.3 2.4-.7l3.2 3.2 1.4-1.4zm-3.8.1c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5M12 20v2C6.48 22 2 17.52 2 12S6.48 2 12 2c4.84 0 8.87 3.44 9.8 8h-2.07c-.64-2.46-2.4-4.47-4.73-5.41V5c0 1.1-.9 2-2 2h-2v2c0 .55-.45 1-1 1H8v2h2v3H9l-4.79-4.79C4.08 10.79 4 11.38 4 12c0 4.41 3.59 8 8 8"}),"TravelExplore");const Qa=({sx:t,className:e,disabled:n,onClick:r,icon:i,tooltipText:o,toggle:a,value:s,selected:l})=>{const c=f=>{a?r(f,s):r(f)},u=o?w.jsx(_t,{arrow:!0,title:o,children:i}):i;return a?w.jsx(Pn,{sx:{padding:.3,...t},className:e,disabled:n,size:"small",onClick:c,value:s||"",selected:l,children:u}):w.jsx(Ot,{sx:t,className:e,disabled:n,size:"small",onClick:c,children:u})},SKe=Li(Yv)(({theme:t})=>({marginRight:t.spacing(1)}));function qb({label:t,control:e,actions:n}){return w.jsx(SKe,{variant:"standard",children:w.jsxs(Ke,{children:[t,e,n]})})}function OKe({selectedDatasetId:t,datasets:e,selectDataset:n,locateSelectedDataset:r}){const i=M.useMemo(()=>e.sort((d,h)=>{const p=d.groupTitle||"zzz",m=h.groupTitle||"zzz",g=p.localeCompare(m);return g!==0?g:d.title.localeCompare(h.title)}),[e]),o=i.length>0&&!!i[0].groupTitle,a=d=>{const h=d.target.value||null;n(h,e,!0)};t=t||"",e=e||[];const s=w.jsx(Kv,{shrink:!0,htmlFor:"dataset-select",children:fe.get("Dataset")}),l=[];let c;i.forEach(d=>{if(o){const h=d.groupTitle||fe.get("Others");h!==c&&l.push(w.jsx(Qg,{children:w.jsx(At,{fontSize:"small",color:"text.secondary",children:h})},h)),c=h}l.push(w.jsx(Nr,{value:d.id,selected:d.id===t,children:d.title},d.id))});const u=w.jsx(wp,{variant:"standard",value:t,onChange:a,input:w.jsx(xp,{name:"dataset",id:"dataset-select"}),displayEmpty:!0,name:"dataset",children:l}),f=w.jsx(Qa,{onClick:r,tooltipText:fe.get("Locate dataset in map"),icon:w.jsx(lz,{})});return w.jsx(qb,{label:s,control:u,actions:f})}const CKe=t=>({locale:t.controlState.locale,selectedDatasetId:t.controlState.selectedDatasetId,datasets:t.dataState.datasets}),TKe={selectDataset:ple,locateSelectedDataset:_7e},EKe=Jt(CKe,TKe)(OKe);var cz={},PKe=ct;Object.defineProperty(cz,"__esModule",{value:!0});var tE=cz.default=void 0,MKe=PKe(pt()),kKe=w;tE=cz.default=(0,MKe.default)((0,kKe.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-5.97 4.06L14.09 6l1.41 1.41L16.91 6l1.06 1.06-1.41 1.41 1.41 1.41-1.06 1.06-1.41-1.4-1.41 1.41-1.06-1.06 1.41-1.41zm-6.78.66h5v1.5h-5zM11.5 16h-2v2H8v-2H6v-1.5h2v-2h1.5v2h2zm6.5 1.25h-5v-1.5h5zm0-2.5h-5v-1.5h5z"}),"Calculate");var uz={},AKe=ct;Object.defineProperty(uz,"__esModule",{value:!0});var fz=uz.default=void 0,RKe=AKe(pt()),IKe=w;fz=uz.default=(0,RKe.default)((0,IKe.jsx)("path",{d:"M18 4H6v2l6.5 6L6 18v2h12v-3h-7l5-5-5-5h7z"}),"Functions");var dz={},DKe=ct;Object.defineProperty(dz,"__esModule",{value:!0});var nE=dz.default=void 0,LKe=DKe(pt()),$Ke=w;nE=dz.default=(0,LKe.default)((0,$Ke.jsx)("path",{fillRule:"evenodd",d:"M16 9V4h1c.55 0 1-.45 1-1s-.45-1-1-1H7c-.55 0-1 .45-1 1s.45 1 1 1h1v5c0 1.66-1.34 3-3 3v2h5.97v7l1 1 1-1v-7H19v-2c-1.66 0-3-1.34-3-3"}),"PushPin");var hz={},NKe=ct;Object.defineProperty(hz,"__esModule",{value:!0});var Bce=hz.default=void 0,FKe=NKe(pt()),jKe=w;Bce=hz.default=(0,FKe.default)((0,jKe.jsx)("path",{d:"M23 8c0 1.1-.9 2-2 2-.18 0-.35-.02-.51-.07l-3.56 3.55c.05.16.07.34.07.52 0 1.1-.9 2-2 2s-2-.9-2-2c0-.18.02-.36.07-.52l-2.55-2.55c-.16.05-.34.07-.52.07s-.36-.02-.52-.07l-4.55 4.56c.05.16.07.33.07.51 0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2c.18 0 .35.02.51.07l4.56-4.55C8.02 9.36 8 9.18 8 9c0-1.1.9-2 2-2s2 .9 2 2c0 .18-.02.36-.07.52l2.55 2.55c.16-.05.34-.07.52-.07s.36.02.52.07l3.55-3.56C19.02 8.35 19 8.18 19 8c0-1.1.9-2 2-2s2 .9 2 2"}),"Timeline");const Mo={toggleButton:{padding:.3}},rE="userVariablesDialog";function BKe(){return{id:Ys("user"),name:"",title:"",units:"",expression:"",colorBarName:"bone",colorBarMin:0,colorBarMax:1,shape:[],dims:[],dtype:"float64",timeChunkSize:null,attrs:{}}}function zKe(t){return{...t,id:Ys("user"),name:`${t.name}_copy`,title:t.title?`${t.title} Copy`:""}}const UKe={variables:!0,constants:!1,arrayOperators:!1,otherOperators:!1,arrayFunctions:!1,otherFunctions:!1},zce=["variables","constants","arrayOperators","otherOperators","arrayFunctions","otherFunctions"],WKe={variables:"Variables",constants:"Constants",arrayOperators:"Array operators",otherOperators:"Other operators",arrayFunctions:"Array functions",otherFunctions:"Other functions"};function VKe({selectedDatasetId:t,selectedVariableName:e,selectedDataset2Id:n,selectedVariable2Name:r,variables:i,userVariablesAllowed:o,canAddTimeSeries:a,addTimeSeries:s,canAddStatistics:l,addStatistics:c,selectVariable:u,selectVariable2:f,openDialog:d}){const h=C=>{u(C.target.value||null)},p=()=>{d(rE)},m=()=>{s()},g=()=>{c()},v=t===n&&e===r,y=w.jsx(Kv,{shrink:!0,htmlFor:"variable-select",children:fe.get("Variable")}),x=w.jsx(wp,{variant:"standard",value:e||"",onChange:h,input:w.jsx(xp,{name:"variable",id:"variable-select"}),displayEmpty:!0,name:"variable",renderValue:()=>JH(i.find(C=>C.name===e)),children:(i||[]).map(C=>w.jsxs(Nr,{value:C.name,selected:C.name===e,children:[N1(C)&&w.jsx(Zre,{children:w.jsx(tE,{fontSize:"small"})}),w.jsx(es,{children:JH(C)}),t===n&&C.name===r&&w.jsx(nE,{fontSize:"small",color:"secondary"})]},C.name))}),b=o&&w.jsx(Qa,{onClick:p,tooltipText:fe.get("Create and manage user variables"),icon:w.jsx(tE,{})},"userVariables"),_=w.jsx(Qa,{disabled:!a,onClick:m,tooltipText:fe.get("Show time-series diagram"),icon:w.jsx(Bce,{})},"timeSeries"),S=w.jsx(Qa,{disabled:!l,onClick:g,tooltipText:fe.get("Add statistics"),icon:w.jsx(fz,{})},"statistics"),O=w.jsx(Pn,{selected:v,value:"comparison",size:"small",sx:{...Mo.toggleButton,marginLeft:.4},onClick:()=>f(t,e),children:w.jsx(_t,{arrow:!0,title:fe.get("Make it 2nd variable for comparison"),children:w.jsx(nE,{fontSize:"small"})})},"variable2");return w.jsx(qb,{label:y,control:x,actions:[O,b,_,S]})}function JH(t){return t?t.title||t.name:"?"}const GKe=t=>({locale:t.controlState.locale,selectedDatasetId:t.controlState.selectedDatasetId,selectedVariableName:t.controlState.selectedVariableName,selectedDataset2Id:t.controlState.selectedDataset2Id,selectedVariable2Name:t.controlState.selectedVariable2Name,userVariablesAllowed:MHe(),canAddTimeSeries:Cse(t),canAddStatistics:Tse(t),variables:FHe(t)}),HKe={openDialog:Pp,selectVariable:Ole,selectVariable2:R7e,addTimeSeries:g2,addStatistics:Jse},qKe=Jt(GKe,HKe)(VKe);var pz={},XKe=ct;Object.defineProperty(pz,"__esModule",{value:!0});var Ap=pz.default=void 0,QKe=XKe(pt()),YKe=w;Ap=pz.default=(0,QKe.default)((0,YKe.jsx)("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}),"Edit");var mz={},KKe=ct;Object.defineProperty(mz,"__esModule",{value:!0});var nw=mz.default=void 0,ZKe=KKe(pt()),JKe=w;nw=mz.default=(0,ZKe.default)((0,JKe.jsx)("path",{d:"M7 11v2h10v-2zm5-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"RemoveCircleOutline");const Uce=({itemValue:t,setItemValue:e,validateItemValue:n,editMode:r,setEditMode:i,labelText:o,select:a,actions:s})=>{const l=M.useRef(null),[c,u]=M.useState("");M.useEffect(()=>{r&&u(t)},[r,t,u]),M.useEffect(()=>{if(r){const p=l.current;p!==null&&(p.focus(),p.select())}},[r]);const f=w.jsx(Kv,{shrink:!0,htmlFor:"place-select",children:o});if(!r)return w.jsx(qb,{label:f,control:a,actions:s});const d=n?n(c):!0,h=w.jsx(xp,{value:c,error:!d,inputRef:l,onBlur:()=>i(!1),onKeyUp:p=>{p.code==="Escape"?i(!1):p.code==="Enter"&&d&&(i(!1),e(c))},onChange:p=>{u(p.currentTarget.value)}});return w.jsx(qb,{label:f,control:h})},eZe={select:{minWidth:"5em"}};function tZe({placeGroups:t,selectPlaceGroups:e,renameUserPlaceGroup:n,removeUserPlaceGroup:r,selectedPlaceGroupIds:i,selectedPlaceGroupsTitle:o}){const[a,s]=M.useState(!1);if(t=t||[],i=i||[],t.length===0)return null;const l=i.length===1?i[0]:null,c=m=>{n(l,m)},u=m=>{e(m.target.value||null)},f=()=>o,d=w.jsx(wp,{variant:"standard",multiple:!0,displayEmpty:!0,onChange:u,input:w.jsx(xp,{name:"place-groups",id:"place-groups-select"}),value:i,renderValue:f,name:"place-groups",sx:eZe.select,children:t.map(m=>w.jsxs(Nr,{value:m.id,children:[w.jsx(DL,{checked:i.indexOf(m.id)>-1}),w.jsx(es,{primary:m.title})]},m.id))});let h=!1;l!==null&&l.startsWith(oy)&&(h=!!t.find(m=>m.id===l&&m.features&&m.features.length>=0));let p;if(h){const m=()=>{s(!0)},g=()=>{r(l)};p=[w.jsx(Qa,{onClick:m,tooltipText:fe.get("Rename place group"),icon:w.jsx(Ap,{})},"editPlaceGroup"),w.jsx(Qa,{onClick:g,tooltipText:fe.get("Remove places"),icon:w.jsx(nw,{})},"removePlaceGroup")]}return w.jsx(Uce,{itemValue:o,setItemValue:c,validateItemValue:m=>m.trim().length>0,editMode:a,setEditMode:s,labelText:fe.get("Places"),select:d,actions:p})}const nZe=t=>({locale:t.controlState.locale,selectedPlaceGroupIds:t.controlState.selectedPlaceGroupIds,placeGroups:m2(t),selectedPlaceGroupsTitle:YHe(t)}),rZe={selectPlaceGroups:C7e,renameUserPlaceGroup:Q9e,removeUserPlaceGroup:t7e},iZe=Jt(nZe,rZe)(tZe);var gz={},oZe=ct;Object.defineProperty(gz,"__esModule",{value:!0});var Wce=gz.default=void 0,aZe=oZe(pt()),sZe=w;Wce=gz.default=(0,aZe.default)((0,sZe.jsx)("path",{d:"M16.56 8.94 7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.59-.59 1.54 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.58.59-1.53 0-2.12M5.21 10 10 5.21 14.79 10zM19 11.5s-2 2.17-2 3.5c0 1.1.9 2 2 2s2-.9 2-2c0-1.33-2-3.5-2-3.5M2 20h20v4H2z"}),"FormatColorFill");const $d={container:{display:"grid",gridTemplateColumns:"auto 120px",gridTemplateRows:"auto",gridTemplateAreas:"'colorLabel colorValue' 'opacityLabel opacityValue'",rowGap:1,columnGap:2.5,padding:1},colorLabel:{gridArea:"colorLabel",alignSelf:"center"},colorValue:{gridArea:"colorValue",alignSelf:"center",width:"100%",height:"22px",borderWidth:1,borderStyle:"solid",borderColor:"black"},opacityLabel:{gridArea:"opacityLabel",alignSelf:"center"},opacityValue:{gridArea:"opacityValue",alignSelf:"center",width:"100%"},colorMenuItem:{padding:"4px 8px 4px 8px"},colorMenuItemBox:{width:"104px",height:"18px"}},lZe=({anchorEl:t,setAnchorEl:e,isPoint:n,placeStyle:r,updatePlaceStyle:i})=>{const[o,a]=M.useState(null);function s(l){a(l.currentTarget)}return w.jsxs(w.Fragment,{children:[w.jsx(bp,{open:t!==null,anchorEl:t,onClose:()=>e(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:w.jsxs(Ke,{sx:$d.container,children:[w.jsx(At,{sx:$d.colorLabel,children:fe.get("Color")}),w.jsx(At,{sx:$d.opacityLabel,color:n?"text.secondary":"text.primary",children:fe.get("Opacity")}),w.jsx(Ke,{sx:$d.colorValue,style:{backgroundColor:r.color},onClick:s}),w.jsx(Zv,{sx:$d.opacityValue,disabled:n,size:"small",min:0,max:1,step:.05,value:r.opacity,onChange:(l,c)=>i({...r,opacity:c})})]})}),w.jsx(_p,{open:!!o,anchorEl:o,onClose:()=>a(null),children:_5.map(([l,c])=>w.jsx(Nr,{selected:r.color===l,sx:$d.colorMenuItem,onClick:()=>i({...r,color:l}),children:w.jsx(_t,{title:l,children:w.jsx(Ke,{sx:{...$d.colorMenuItemBox,backgroundColor:l}})})},l))})]})},cZe={select:{minWidth:"5em"}};function uZe({selectPlace:t,placeLabels:e,selectedPlaceId:n,selectedPlaceGroupIds:r,selectedPlaceInfo:i,renameUserPlace:o,restyleUserPlace:a,removeUserPlace:s,places:l,locateSelectedPlace:c}){const[u,f]=M.useState(!1),[d,h]=M.useState(null);l=l||[],e=e||[],n=n||"",r=r||[];const p=r.length===1?r[0]:null,m=l.findIndex(O=>O.id===n),g=m>=0?e[m]:"",v=O=>{o(p,n,O)},y=O=>{a(p,n,O)},x=O=>{t(O.target.value||null,l,!0)},b=w.jsx(wp,{variant:"standard",value:n,onChange:x,input:w.jsx(xp,{name:"place",id:"place-select"}),displayEmpty:!0,name:"place",sx:cZe.select,disabled:l.length===0,children:l.map((O,C)=>w.jsx(Nr,{value:O.id,selected:O.id===n,children:e[C]},O.id))}),_=p!==null&&p.startsWith(oy)&&n!=="";let S=[w.jsx(Qa,{onClick:c,tooltipText:fe.get("Locate place in map"),icon:w.jsx(lz,{})},"locatePlace")];if(!u&&_){const O=()=>{f(!0)},C=k=>{h(k.currentTarget)},E=()=>{s(p,n,l)};S=[w.jsx(Qa,{onClick:O,tooltipText:fe.get("Rename place"),icon:w.jsx(Ap,{})},"editButton"),w.jsx(Qa,{onClick:C,tooltipText:fe.get("Style place"),icon:w.jsx(Wce,{})},"styleButton"),w.jsx(Qa,{onClick:E,tooltipText:fe.get("Remove place"),icon:w.jsx(nw,{})},"removeButton")].concat(S)}return w.jsxs(w.Fragment,{children:[w.jsx(Uce,{itemValue:g,setItemValue:v,validateItemValue:O=>O.trim().length>0,editMode:u,setEditMode:f,labelText:fe.get("Place"),select:b,actions:S}),i&&w.jsx(lZe,{anchorEl:d,setAnchorEl:h,isPoint:i.place.geometry.type==="Point",placeStyle:i,updatePlaceStyle:y})]})}const fZe=t=>({locale:t.controlState.locale,datasets:t.dataState.datasets,selectedPlaceGroupIds:t.controlState.selectedPlaceGroupIds,selectedPlaceId:t.controlState.selectedPlaceId,selectedPlaceInfo:Z1(t),places:K1(t),placeLabels:e9e(t)}),dZe={selectPlace:v2,renameUserPlace:Y9e,restyleUserPlace:Z9e,removeUserPlace:e7e,locateSelectedPlace:w7e,openDialog:Pp},hZe=Jt(fZe,dZe)(uZe);var vz={},pZe=ct;Object.defineProperty(vz,"__esModule",{value:!0});var Vce=vz.default=void 0,mZe=pZe(pt()),gZe=w;Vce=vz.default=(0,mZe.default)((0,gZe.jsx)("path",{d:"M12 2C8.14 2 5 5.14 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.86-3.14-7-7-7m4 8h-3v3h-2v-3H8V8h3V5h2v3h3z"}),"AddLocation");var yz={},vZe=ct;Object.defineProperty(yz,"__esModule",{value:!0});var Gce=yz.default=void 0,yZe=vZe(pt()),xZe=w;Gce=yz.default=(0,yZe.default)((0,xZe.jsx)("path",{d:"M11.71 17.99C8.53 17.84 6 15.22 6 12c0-3.31 2.69-6 6-6 3.22 0 5.84 2.53 5.99 5.71l-2.1-.63C15.48 9.31 13.89 8 12 8c-2.21 0-4 1.79-4 4 0 1.89 1.31 3.48 3.08 3.89zM22 12c0 .3-.01.6-.04.9l-1.97-.59c.01-.1.01-.21.01-.31 0-4.42-3.58-8-8-8s-8 3.58-8 8 3.58 8 8 8c.1 0 .21 0 .31-.01l.59 1.97c-.3.03-.6.04-.9.04-5.52 0-10-4.48-10-10S6.48 2 12 2s10 4.48 10 10m-3.77 4.26L22 15l-10-3 3 10 1.26-3.77 4.27 4.27 1.98-1.98z"}),"AdsClick");var xz={},bZe=ct;Object.defineProperty(xz,"__esModule",{value:!0});var Hce=xz.default=void 0,_Ze=bZe(pt()),lR=w;Hce=xz.default=(0,_Ze.default)([(0,lR.jsx)("path",{d:"m12 2-5.5 9h11z"},"0"),(0,lR.jsx)("circle",{cx:"17.5",cy:"17.5",r:"4.5"},"1"),(0,lR.jsx)("path",{d:"M3 13.5h8v8H3z"},"2")],"Category");var bz={},wZe=ct;Object.defineProperty(bz,"__esModule",{value:!0});var qce=bz.default=void 0,SZe=wZe(pt()),OZe=w;qce=bz.default=(0,SZe.default)((0,OZe.jsx)("circle",{cx:"12",cy:"12",r:"8"}),"FiberManualRecord");var _z={},CZe=ct;Object.defineProperty(_z,"__esModule",{value:!0});var Xce=_z.default=void 0,TZe=CZe(pt()),EZe=w;Xce=_z.default=(0,TZe.default)((0,EZe.jsx)("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M14 13v4h-4v-4H7l5-5 5 5z"}),"CloudUpload");const PZe=Li(Yv)(({theme:t})=>({marginTop:t.spacing(2),marginLeft:t.spacing(1),marginRight:t.spacing(2)}));function MZe({mapInteraction:t,setMapInteraction:e}){function n(r,i){e(i!==null?i:"Select")}return w.jsx(PZe,{variant:"standard",children:w.jsxs(Jv,{size:"small",value:t,exclusive:!0,onChange:n,children:[w.jsx(Pn,{value:"Select",size:"small",sx:Mo.toggleButton,children:w.jsx(_t,{arrow:!0,title:fe.get("Select a place in map"),children:w.jsx(Gce,{})})},0),w.jsx(Pn,{value:"Point",size:"small",sx:Mo.toggleButton,children:w.jsx(_t,{arrow:!0,title:fe.get("Add a point location in map"),children:w.jsx(Vce,{})})},1),w.jsx(Pn,{value:"Polygon",size:"small",sx:Mo.toggleButton,children:w.jsx(_t,{arrow:!0,title:fe.get("Draw a polygon area in map"),children:w.jsx(Hce,{})})},2),w.jsx(Pn,{value:"Circle",size:"small",sx:Mo.toggleButton,children:w.jsx(_t,{arrow:!0,title:fe.get("Draw a circular area in map"),children:w.jsx(qce,{})})},3),w.jsx(Pn,{value:"Geometry",size:"small",sx:Mo.toggleButton,children:w.jsx(_t,{arrow:!0,title:fe.get("Import places"),children:w.jsx(Xce,{})})},4)]})})}const kZe=t=>({mapInteraction:t.controlState.mapInteraction}),AZe={setMapInteraction:Ale},RZe=Jt(kZe,AZe)(MZe);var e9=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rw=(typeof window>"u"?"undefined":e9(window))==="object"&&(typeof document>"u"?"undefined":e9(document))==="object"&&document.nodeType===9,IZe={}.constructor;function $$(t){if(t==null||typeof t!="object")return t;if(Array.isArray(t))return t.map($$);if(t.constructor!==IZe)return t;var e={};for(var n in t)e[n]=$$(t[n]);return e}function wz(t,e,n){t===void 0&&(t="unnamed");var r=n.jss,i=$$(e),o=r.plugins.onCreateRule(t,i,n);return o||(t[0],null)}var t9=function(e,n){for(var r="",i=0;i<+~=|^:(),"'`\s])/g,n9=typeof CSS<"u"&&CSS.escape,Sz=function(t){return n9?n9(t):t.replace(DZe,"\\$1")},Qce=function(){function t(n,r,i){this.type="style",this.isProcessed=!1;var o=i.sheet,a=i.Renderer;this.key=n,this.options=i,this.style=r,o?this.renderer=o.renderer:a&&(this.renderer=new a)}var e=t.prototype;return e.prop=function(r,i,o){if(i===void 0)return this.style[r];var a=o?o.force:!1;if(!a&&this.style[r]===i)return this;var s=i;(!o||o.process!==!1)&&(s=this.options.jss.plugins.onChangeValue(i,r,this));var l=s==null||s===!1,c=r in this.style;if(l&&!c&&!a)return this;var u=l&&c;if(u?delete this.style[r]:this.style[r]=s,this.renderable&&this.renderer)return u?this.renderer.removeProperty(this.renderable,r):this.renderer.setProperty(this.renderable,r,s),this;var f=this.options.sheet;return f&&f.attached,this},t}(),N$=function(t){P1(e,t);function e(r,i,o){var a;a=t.call(this,r,i,o)||this;var s=o.selector,l=o.scoped,c=o.sheet,u=o.generateId;return s?a.selectorText=s:l!==!1&&(a.id=u(lt(lt(a)),c),a.selectorText="."+Sz(a.id)),a}var n=e.prototype;return n.applyTo=function(i){var o=this.renderer;if(o){var a=this.toJSON();for(var s in a)o.setProperty(i,s,a[s])}return this},n.toJSON=function(){var i={};for(var o in this.style){var a=this.style[o];typeof a!="object"?i[o]=a:Array.isArray(a)&&(i[o]=$h(a))}return i},n.toString=function(i){var o=this.options.sheet,a=o?o.options.link:!1,s=a?j({},i,{allowEmpty:!0}):i;return Xb(this.selectorText,this.style,s)},Xt(e,[{key:"selector",set:function(i){if(i!==this.selectorText){this.selectorText=i;var o=this.renderer,a=this.renderable;if(!(!a||!o)){var s=o.setSelector(a,i);s||o.replaceRule(a,this)}}},get:function(){return this.selectorText}}]),e}(Qce),LZe={onCreateRule:function(e,n,r){return e[0]==="@"||r.parent&&r.parent.type==="keyframes"?null:new N$(e,n,r)}},cR={indent:1,children:!0},$Ze=/@([\w-]+)/,NZe=function(){function t(n,r,i){this.type="conditional",this.isProcessed=!1,this.key=n;var o=n.match($Ze);this.at=o?o[1]:"unknown",this.query=i.name||"@"+this.at,this.options=i,this.rules=new O2(j({},i,{parent:this}));for(var a in r)this.rules.add(a,r[a]);this.rules.process()}var e=t.prototype;return e.getRule=function(r){return this.rules.get(r)},e.indexOf=function(r){return this.rules.indexOf(r)},e.addRule=function(r,i,o){var a=this.rules.add(r,i,o);return a?(this.options.jss.plugins.onProcessRule(a),a):null},e.replaceRule=function(r,i,o){var a=this.rules.replace(r,i,o);return a&&this.options.jss.plugins.onProcessRule(a),a},e.toString=function(r){r===void 0&&(r=cR);var i=Sy(r),o=i.linebreak;if(r.indent==null&&(r.indent=cR.indent),r.children==null&&(r.children=cR.children),r.children===!1)return this.query+" {}";var a=this.rules.toString(r);return a?this.query+" {"+o+a+o+"}":""},t}(),FZe=/@container|@media|@supports\s+/,jZe={onCreateRule:function(e,n,r){return FZe.test(e)?new NZe(e,n,r):null}},uR={indent:1,children:!0},BZe=/@keyframes\s+([\w-]+)/,F$=function(){function t(n,r,i){this.type="keyframes",this.at="@keyframes",this.isProcessed=!1;var o=n.match(BZe);o&&o[1]?this.name=o[1]:this.name="noname",this.key=this.type+"-"+this.name,this.options=i;var a=i.scoped,s=i.sheet,l=i.generateId;this.id=a===!1?this.name:Sz(l(this,s)),this.rules=new O2(j({},i,{parent:this}));for(var c in r)this.rules.add(c,r[c],j({},i,{parent:this}));this.rules.process()}var e=t.prototype;return e.toString=function(r){r===void 0&&(r=uR);var i=Sy(r),o=i.linebreak;if(r.indent==null&&(r.indent=uR.indent),r.children==null&&(r.children=uR.children),r.children===!1)return this.at+" "+this.id+" {}";var a=this.rules.toString(r);return a&&(a=""+o+a+o),this.at+" "+this.id+" {"+a+"}"},t}(),zZe=/@keyframes\s+/,UZe=/\$([\w-]+)/g,j$=function(e,n){return typeof e=="string"?e.replace(UZe,function(r,i){return i in n?n[i]:r}):e},r9=function(e,n,r){var i=e[n],o=j$(i,r);o!==i&&(e[n]=o)},WZe={onCreateRule:function(e,n,r){return typeof e=="string"&&zZe.test(e)?new F$(e,n,r):null},onProcessStyle:function(e,n,r){return n.type!=="style"||!r||("animation-name"in e&&r9(e,"animation-name",r.keyframes),"animation"in e&&r9(e,"animation",r.keyframes)),e},onChangeValue:function(e,n,r){var i=r.options.sheet;if(!i)return e;switch(n){case"animation":return j$(e,i.keyframes);case"animation-name":return j$(e,i.keyframes);default:return e}}},VZe=function(t){P1(e,t);function e(){return t.apply(this,arguments)||this}var n=e.prototype;return n.toString=function(i){var o=this.options.sheet,a=o?o.options.link:!1,s=a?j({},i,{allowEmpty:!0}):i;return Xb(this.key,this.style,s)},e}(Qce),GZe={onCreateRule:function(e,n,r){return r.parent&&r.parent.type==="keyframes"?new VZe(e,n,r):null}},HZe=function(){function t(n,r,i){this.type="font-face",this.at="@font-face",this.isProcessed=!1,this.key=n,this.style=r,this.options=i}var e=t.prototype;return e.toString=function(r){var i=Sy(r),o=i.linebreak;if(Array.isArray(this.style)){for(var a="",s=0;s=this.index){i.push(r);return}for(var a=0;ao){i.splice(a,0,r);return}}},e.reset=function(){this.registry=[]},e.remove=function(r){var i=this.registry.indexOf(r);this.registry.splice(i,1)},e.toString=function(r){for(var i=r===void 0?{}:r,o=i.attached,a=Ae(i,["attached"]),s=Sy(a),l=s.linebreak,c="",u=0;u-1?i.substr(0,o-1):i;e.style.setProperty(n,a,o>-1?"important":"")}}catch{return!1}return!0},oJe=function(e,n){try{e.attributeStyleMap?e.attributeStyleMap.delete(n):e.style.removeProperty(n)}catch{}},aJe=function(e,n){return e.selectorText=n,e.selectorText===n},Zce=Kce(function(){return document.querySelector("head")});function sJe(t,e){for(var n=0;ne.index&&r.options.insertionPoint===e.insertionPoint)return r}return null}function lJe(t,e){for(var n=t.length-1;n>=0;n--){var r=t[n];if(r.attached&&r.options.insertionPoint===e.insertionPoint)return r}return null}function cJe(t){for(var e=Zce(),n=0;n0){var n=sJe(e,t);if(n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element};if(n=lJe(e,t),n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element.nextSibling}}var r=t.insertionPoint;if(r&&typeof r=="string"){var i=cJe(r);if(i)return{parent:i.parentNode,node:i.nextSibling}}return!1}function fJe(t,e){var n=e.insertionPoint,r=uJe(e);if(r!==!1&&r.parent){r.parent.insertBefore(t,r.node);return}if(n&&typeof n.nodeType=="number"){var i=n,o=i.parentNode;o&&o.insertBefore(t,i.nextSibling);return}Zce().appendChild(t)}var dJe=Kce(function(){var t=document.querySelector('meta[property="csp-nonce"]');return t?t.getAttribute("content"):null}),l9=function(e,n,r){try{"insertRule"in e?e.insertRule(n,r):"appendRule"in e&&e.appendRule(n)}catch{return!1}return e.cssRules[r]},c9=function(e,n){var r=e.cssRules.length;return n===void 0||n>r?r:n},hJe=function(){var e=document.createElement("style");return e.textContent=` +`,e},pJe=function(){function t(n){this.getPropertyValue=rJe,this.setProperty=iJe,this.removeProperty=oJe,this.setSelector=aJe,this.hasInsertedRules=!1,this.cssRules=[],n&&qx.add(n),this.sheet=n;var r=this.sheet?this.sheet.options:{},i=r.media,o=r.meta,a=r.element;this.element=a||hJe(),this.element.setAttribute("data-jss",""),i&&this.element.setAttribute("media",i),o&&this.element.setAttribute("data-meta",o);var s=dJe();s&&this.element.setAttribute("nonce",s)}var e=t.prototype;return e.attach=function(){if(!(this.element.parentNode||!this.sheet)){fJe(this.element,this.sheet.options);var r=!!(this.sheet&&this.sheet.deployed);this.hasInsertedRules&&r&&(this.hasInsertedRules=!1,this.deploy())}},e.detach=function(){if(this.sheet){var r=this.element.parentNode;r&&r.removeChild(this.element),this.sheet.options.link&&(this.cssRules=[],this.element.textContent=` `)}},e.deploy=function(){var r=this.sheet;if(r){if(r.options.link){this.insertRules(r.rules);return}this.element.textContent=` `+r.toString()+` -`}},e.insertRules=function(r,i){for(var o=0;o{n[o]&&(i[o]=`${e[o]} ${n[o]}`)}),i}const mJe={set:(t,e,n,r)=>{let i=t.get(e);i||(i=new Map,t.set(e,i)),i.set(n,r)},get:(t,e,n)=>{const r=t.get(e);return r?r.get(n):void 0},delete:(t,e,n)=>{t.get(e).delete(n)}},Km=mJe;function tue(){var t;const e=Hj();return(t=e==null?void 0:e.$$material)!=null?t:e}const gJe=["checked","disabled","error","focused","focusVisible","required","expanded","selected"];function vJe(t={}){const{disableGlobal:e=!1,productionPrefix:n="jss",seed:r=""}=t,i=r===""?"":`${r}-`;let o=0;const a=()=>(o+=1,o);return(s,l)=>{const c=l.options.name;if(c&&c.indexOf("Mui")===0&&!l.options.link&&!e){if(gJe.indexOf(s.key)!==-1)return`Mui-${s.key}`;const u=`${i}${c}-${s.key}`;return!l.options.theme[Kne]||r!==""?u:`${u}-${a()}`}return`${i}${n}${a()}`}}var nue=Date.now(),uR="fnValues"+nue,fR="fnStyle"+ ++nue,yJe=function(){return{onCreateRule:function(n,r,i){if(typeof r!="function")return null;var o=_z(n,{},i);return o[fR]=r,o},onProcessStyle:function(n,r){if(uR in r||fR in r)return n;var i={};for(var o in n){var a=n[o];typeof a=="function"&&(delete n[o],i[o]=a)}return r[uR]=i,n},onUpdate:function(n,r,i,o){var a=r,s=a[fR];s&&(a.style=s(n)||{});var l=a[uR];if(l)for(var c in l)a.prop(c,l[c](n),o)}}},$f="@global",z$="@global ",xJe=function(){function t(n,r,i){this.type="global",this.at=$f,this.isProcessed=!1,this.key=n,this.options=i,this.rules=new O2(j({},i,{parent:this}));for(var o in r)this.rules.add(o,r[o]);this.rules.process()}var e=t.prototype;return e.getRule=function(r){return this.rules.get(r)},e.addRule=function(r,i,o){var a=this.rules.add(r,i,o);return a&&this.options.jss.plugins.onProcessRule(a),a},e.replaceRule=function(r,i,o){var a=this.rules.replace(r,i,o);return a&&this.options.jss.plugins.onProcessRule(a),a},e.indexOf=function(r){return this.rules.indexOf(r)},e.toString=function(r){return this.rules.toString(r)},t}(),bJe=function(){function t(n,r,i){this.type="global",this.at=$f,this.isProcessed=!1,this.key=n,this.options=i;var o=n.substr(z$.length);this.rule=i.jss.createRule(o,r,j({},i,{parent:this}))}var e=t.prototype;return e.toString=function(r){return this.rule?this.rule.toString(r):""},t}(),_Je=/\s*,\s*/g;function rue(t,e){for(var n=t.split(_Je),r="",i=0;i-1){var o=lue[e];if(!Array.isArray(o))return $t.js+Kf(o)in n?$t.css+o:!1;if(!i)return!1;for(var a=0;ar?1:-1:n.length-r.length};return{onProcessStyle:function(n,r){if(r.type!=="style")return n;for(var i={},o=Object.keys(n).sort(t),a=0;a"u"?null:met(),get()]}}const yet=Zce(vet()),xet=vJe(),bet=new Map,_et={disableGeneration:!1,generateClassName:xet,jss:yet,sheetsCache:null,sheetsManager:bet,sheetsRegistry:null},wet=M.createContext(_et);let f9=-1e9;function Oet(){return f9+=1,f9}const Cet=["variant"];function d9(t){return t.length===0}function Tet(t){const{variant:e}=t,n=Ae(t,Cet);let r=e||"";return Object.keys(n).sort().forEach(i=>{i==="color"?r+=d9(r)?t[i]:De(t[i]):r+=`${d9(r)?i:De(i)}${De(t[i].toString())}`}),r}const Eet={},Pet=Eet;function Met(t){const e=typeof t=="function";return{create:(n,r)=>{let i;try{i=e?t(n):t}catch(l){throw l}if(!r||!n.components||!n.components[r]||!n.components[r].styleOverrides&&!n.components[r].variants)return i;const o=n.components[r].styleOverrides||{},a=n.components[r].variants||[],s=j({},i);return Object.keys(o).forEach(l=>{s[l]=Ii(s[l]||{},o[l])}),a.forEach(l=>{const c=Tet(l.props);s[c]=Ii(s[c]||{},l.style)}),s},options:{}}}const ket=["name","classNamePrefix","Component","defaultTheme"];function Aet({state:t,stylesOptions:e},n,r){if(e.disableGeneration)return n||{};t.cacheClasses||(t.cacheClasses={value:null,lastProp:null,lastJSS:{}});let i=!1;return t.classes!==t.cacheClasses.lastJSS&&(t.cacheClasses.lastJSS=t.classes,i=!0),n!==t.cacheClasses.lastProp&&(t.cacheClasses.lastProp=n,i=!0),i&&(t.cacheClasses.value=eue({baseClasses:t.cacheClasses.lastJSS,newClasses:n,Component:r})),t.cacheClasses.value}function Ret({state:t,theme:e,stylesOptions:n,stylesCreator:r,name:i},o){if(n.disableGeneration)return;let a=Km.get(n.sheetsManager,r,e);a||(a={refs:0,staticSheet:null,dynamicStyles:null},Km.set(n.sheetsManager,r,e,a));const s=j({},r.options,n,{theme:e,flip:typeof n.flip=="boolean"?n.flip:e.direction==="rtl"});s.generateId=s.serverGenerateClassName||s.generateClassName;const l=n.sheetsRegistry;if(a.refs===0){let c;n.sheetsCache&&(c=Km.get(n.sheetsCache,r,e));const u=r.create(e,i);c||(c=n.jss.createStyleSheet(u,j({link:!1},s)),c.attach(),n.sheetsCache&&Km.set(n.sheetsCache,r,e,c)),l&&l.add(c),a.staticSheet=c,a.dynamicStyles=Jce(u)}if(a.dynamicStyles){const c=n.jss.createStyleSheet(a.dynamicStyles,j({link:!0},s));c.update(o),c.attach(),t.dynamicSheet=c,t.classes=eue({baseClasses:a.staticSheet.classes,newClasses:c.classes}),l&&l.add(c)}else t.classes=a.staticSheet.classes;a.refs+=1}function Iet({state:t},e){t.dynamicSheet&&t.dynamicSheet.update(e)}function Det({state:t,theme:e,stylesOptions:n,stylesCreator:r}){if(n.disableGeneration)return;const i=Km.get(n.sheetsManager,r,e);i.refs-=1;const o=n.sheetsRegistry;i.refs===0&&(Km.delete(n.sheetsManager,r,e),n.jss.removeStyleSheet(i.staticSheet),o&&o.remove(i.staticSheet)),t.dynamicSheet&&(n.jss.removeStyleSheet(t.dynamicSheet),o&&o.remove(t.dynamicSheet))}function Let(t,e){const n=M.useRef([]);let r;const i=M.useMemo(()=>({}),e);n.current!==i&&(n.current=i,r=t()),M.useEffect(()=>()=>{r&&r()},[i])}function $et(t,e={}){const{name:n,classNamePrefix:r,Component:i,defaultTheme:o=Pet}=e,a=Ae(e,ket),s=Met(t),l=n||r||"makeStyles";return s.options={index:Oet(),name:n,meta:l,classNamePrefix:l},(u={})=>{const f=tue()||o,d=j({},M.useContext(wet),a),h=M.useRef(),p=M.useRef();return Let(()=>{const g={name:n,state:{},stylesCreator:s,stylesOptions:d,theme:f};return Ret(g,u),p.current=!1,h.current=g,()=>{Det(g)}},[f,s]),M.useEffect(()=>{p.current&&Iet(h.current,u),p.current=!0}),Aet(h.current,u.classes,i)}}function Net(t){const{theme:e,name:n,props:r}=t;if(!e||!e.components||!e.components[n]||!e.components[n].defaultProps)return r;const i=j({},r),o=e.components[n].defaultProps;let a;for(a in o)i[a]===void 0&&(i[a]=o[a]);return i}const Fet=["defaultTheme","withTheme","name"],jet=["classes"],Bet=(t,e={})=>n=>{const{defaultTheme:r,withTheme:i=!1,name:o}=e,a=Ae(e,Fet);let s=o;const l=$et(t,j({defaultTheme:r,Component:n,name:o||n.displayName,classNamePrefix:s},a)),c=M.forwardRef(function(f,d){const h=Ae(f,jet),p=l(j({},n.defaultProps,f));let m,g=h;return(typeof o=="string"||i)&&(m=tue()||r,o&&(g=Net({theme:m,name:o,props:h})),i&&!g.theme&&(g.theme=m)),w.jsx(n,j({ref:d,classes:p},g))});return yL(c,n),c},zet=t=>({components:{MuiLocalizationProvider:{defaultProps:{localeText:j({},t)}}}}),uue={previousMonth:"Previous month",nextMonth:"Next month",openPreviousView:"open previous view",openNextView:"open next view",calendarViewSwitchingButtonAriaLabel:t=>t==="year"?"year view is open, switch to calendar view":"calendar view is open, switch to year view",inputModeToggleButtonAriaLabel:(t,e)=>t?`text input view is open, go to ${e} view`:`${e} view is open, go to text input view`,start:"Start",end:"End",cancelButtonLabel:"Cancel",clearButtonLabel:"Clear",okButtonLabel:"OK",todayButtonLabel:"Today",datePickerDefaultToolbarTitle:"Select date",dateTimePickerDefaultToolbarTitle:"Select date & time",timePickerDefaultToolbarTitle:"Select time",dateRangePickerDefaultToolbarTitle:"Select date range",clockLabelText:(t,e,n)=>`Select ${t}. ${e===null?"No time selected":`Selected time is ${n.format(e,"fullTime")}`}`,hoursClockNumberText:t=>`${t} hours`,minutesClockNumberText:t=>`${t} minutes`,secondsClockNumberText:t=>`${t} seconds`,openDatePickerDialogue:(t,e)=>t&&e.isValid(e.date(t))?`Choose date, selected date is ${e.format(e.date(t),"fullDate")}`:"Choose date",openTimePickerDialogue:(t,e)=>t&&e.isValid(e.date(t))?`Choose time, selected time is ${e.format(e.date(t),"fullTime")}`:"Choose time",timeTableLabel:"pick time",dateTableLabel:"pick date"},Uet=uue;zet(uue);const fue=M.createContext(null);function Wet(t){const e=qe({props:t,name:"MuiLocalizationProvider"}),{children:n,dateAdapter:r,dateFormats:i,dateLibInstance:o,locale:a,adapterLocale:s,localeText:l}=e,c=M.useMemo(()=>new r({locale:s??a,formats:i,instance:o}),[r,a,s,i,o]),u=M.useMemo(()=>({minDate:c.date("1900-01-01T00:00:00.000"),maxDate:c.date("2099-12-31T00:00:00.000")}),[c]),f=M.useMemo(()=>({utils:c,defaultDates:u,localeText:j({},Uet,l??{})}),[u,c,l]);return w.jsx(fue.Provider,{value:f,children:n})}var V$={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=function(l,c){switch(l){case"P":return c.date({width:"short"});case"PP":return c.date({width:"medium"});case"PPP":return c.date({width:"long"});case"PPPP":default:return c.date({width:"full"})}},r=function(l,c){switch(l){case"p":return c.time({width:"short"});case"pp":return c.time({width:"medium"});case"ppp":return c.time({width:"long"});case"pppp":default:return c.time({width:"full"})}},i=function(l,c){var u=l.match(/(P+)(p+)?/)||[],f=u[1],d=u[2];if(!d)return n(l,c);var h;switch(f){case"P":h=c.dateTime({width:"short"});break;case"PP":h=c.dateTime({width:"medium"});break;case"PPP":h=c.dateTime({width:"long"});break;case"PPPP":default:h=c.dateTime({width:"full"});break}return h.replace("{{date}}",n(f,c)).replace("{{time}}",r(d,c))},o={p:r,P:i},a=o;e.default=a,t.exports=e.default})(V$,V$.exports);var Vet=V$.exports;const due=Nt(Vet),Get={dayOfMonth:"d",fullDate:"PP",fullDateWithWeekday:"PPPP",fullDateTime:"PP p",fullDateTime12h:"PP hh:mm aaa",fullDateTime24h:"PP HH:mm",fullTime:"p",fullTime12h:"hh:mm aaa",fullTime24h:"HH:mm",hours12h:"hh",hours24h:"HH",keyboardDate:"P",keyboardDateTime:"P p",keyboardDateTime12h:"P hh:mm aaa",keyboardDateTime24h:"P HH:mm",minutes:"mm",month:"LLLL",monthAndDate:"MMMM d",monthAndYear:"LLLL yyyy",monthShort:"MMM",weekday:"EEEE",weekdayShort:"EEE",normalDate:"d MMMM",normalDateWithWeekday:"EEE, MMM d",seconds:"ss",shortDate:"MMM d",year:"yyyy"};class Het{constructor({locale:e,formats:n}={}){this.lib="date-fns",this.is12HourCycleInCurrentLocale=()=>{var r;return this.locale?/a/.test((r=this.locale.formatLong)===null||r===void 0?void 0:r.time()):!0},this.getFormatHelperText=r=>{var i,o;const a=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,s=this.locale||u2;return(o=(i=r.match(a))===null||i===void 0?void 0:i.map(l=>{const c=l[0];if(c==="p"||c==="P"){const u=due[c];return u(l,s.formatLong,{})}return l}).join("").replace(/(aaa|aa|a)/g,"(a|p)m").toLocaleLowerCase())!==null&&o!==void 0?o:r},this.parseISO=r=>Rae(r),this.toISO=r=>SVe(r,{format:"extended"}),this.getCurrentLocaleCode=()=>{var r;return((r=this.locale)===null||r===void 0?void 0:r.code)||"en-US"},this.addSeconds=(r,i)=>oWe(r,i),this.addMinutes=(r,i)=>iWe(r,i),this.addHours=(r,i)=>J6e(r,i),this.addDays=(r,i)=>d$(r,i),this.addWeeks=(r,i)=>aWe(r,i),this.addMonths=(r,i)=>TC(r,i),this.addYears=(r,i)=>HG(r,i),this.isValid=r=>mae(this.date(r)),this.getDiff=(r,i,o)=>{var a;const s=(a=this.date(i))!==null&&a!==void 0?a:r;if(!this.isValid(s))return 0;switch(o){case"years":return xWe(r,s);case"quarters":return gWe(r,s);case"months":return vae(r,s);case"weeks":return yWe(r,s);case"days":return gae(r,s);case"hours":return hWe(r,s);case"minutes":return pWe(r,s);case"seconds":return vWe(r,s);default:return c2(r,s)}},this.isAfter=(r,i)=>TS(r,i),this.isBefore=(r,i)=>em(r,i),this.startOfDay=r=>tv(r),this.endOfDay=r=>h$(r),this.getHours=r=>TVe(r),this.setHours=(r,i)=>X8e(r,i),this.setMinutes=(r,i)=>Q8e(r,i),this.getSeconds=r=>MVe(r),this.setSeconds=(r,i)=>Y8e(r,i),this.isSameDay=(r,i)=>lWe(r,i),this.isSameMonth=(r,i)=>P8e(r,i),this.isSameYear=(r,i)=>M8e(r,i),this.isSameHour=(r,i)=>E8e(r,i),this.startOfYear=r=>CS(r),this.endOfYear=r=>WA(r),this.startOfMonth=r=>OS(r),this.endOfMonth=r=>p$(r),this.startOfWeek=r=>UA(r,{locale:this.locale}),this.endOfWeek=r=>VA(r,{locale:this.locale}),this.getYear=r=>kVe(r),this.setYear=(r,i)=>K8e(r,i),this.date=r=>typeof r>"u"?new Date:r===null?null:new Date(r),this.toJsDate=r=>r,this.parse=(r,i)=>r===""?null:C8e(r,i,new Date,{locale:this.locale}),this.format=(r,i)=>this.formatByString(r,this.formats[i]),this.formatByString=(r,i)=>bVe(r,i,{locale:this.locale}),this.isEqual=(r,i)=>r===null&&i===null?!0:AVe(r,i),this.isNull=r=>r===null,this.isAfterDay=(r,i)=>TS(r,h$(i)),this.isBeforeDay=(r,i)=>em(r,tv(i)),this.isBeforeYear=(r,i)=>em(r,CS(i)),this.isAfterYear=(r,i)=>TS(r,WA(i)),this.isWithinRange=(r,[i,o])=>k8e(r,{start:i,end:o}),this.formatNumber=r=>r,this.getMinutes=r=>EVe(r),this.getDate=r=>OVe(r),this.setDate=(r,i)=>q8e(r,i),this.getMonth=r=>PVe(r),this.getDaysInMonth=r=>Cae(r),this.setMonth=(r,i)=>H8e(r,i),this.getMeridiemText=r=>r==="am"?"AM":"PM",this.getNextMonth=r=>TC(r,1),this.getPreviousMonth=r=>TC(r,-1),this.getMonthArray=r=>{const o=[CS(r)];for(;o.length<12;){const a=o[o.length-1];o.push(this.getNextMonth(a))}return o},this.mergeDateAndTime=(r,i)=>this.setSeconds(this.setMinutes(this.setHours(r,this.getHours(i)),this.getMinutes(i)),this.getSeconds(i)),this.getWeekdays=()=>{const r=new Date;return bWe({start:UA(r,{locale:this.locale}),end:VA(r,{locale:this.locale})}).map(i=>this.formatByString(i,"EEEEEE"))},this.getWeekArray=r=>{const i=UA(OS(r),{locale:this.locale}),o=VA(p$(r),{locale:this.locale});let a=0,s=i;const l=[];let c=null;for(;em(s,o);){const u=Math.floor(a/7);l[u]=l[u]||[];const f=CVe(s);c!==f&&(c=f,l[u].push(s),a+=1),s=d$(s,1)}return l},this.getYearRange=(r,i)=>{const o=CS(r),a=WA(i),s=[];let l=o;for(;em(l,a);)s.push(l),l=HG(l,1);return s},this.locale=e,this.formats=Object.assign({},Get,n)}isBeforeMonth(e,n){return em(e,OS(n))}isAfterMonth(e,n){return TS(e,OS(n))}}const qet={y:"year",yy:"year",yyy:"year",yyyy:"year",MMMM:"month",MM:"month",DD:"day",d:"day",dd:"day",H:"hour",HH:"hour",h:"hour",hh:"hour",mm:"minute",ss:"second",a:"am-pm",aa:"am-pm",aaa:"am-pm"};class Xet extends Het{constructor(...e){super(...e),this.formatTokenMap=qet,this.expandFormat=n=>{const r=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;return n.match(r).map(i=>{const o=i[0];if(o==="p"||o==="P"){const a=due[o],s=this.locale||u2;return a(i,s.formatLong,{})}return i}).join("")},this.getFormatHelperText=n=>this.expandFormat(n).replace(/(aaa|aa|a)/g,"(a|p)m").toLocaleLowerCase()}}const iw=()=>{const t=M.useContext(fue);if(t===null)throw new Error("MUI: Can not find utils in context. It looks like you forgot to wrap your component in LocalizationProvider, or pass dateAdapter prop directly.");return t},wr=()=>iw().utils,C2=()=>iw().defaultDates,yd=()=>iw().localeText,ow=()=>{const t=wr();return M.useRef(t.date()).current},Qx=({date:t,disableFuture:e,disablePast:n,maxDate:r,minDate:i,isDateDisabled:o,utils:a})=>{const s=a.startOfDay(a.date());n&&a.isBefore(i,s)&&(i=s),e&&a.isAfter(r,s)&&(r=s);let l=t,c=t;for(a.isBefore(t,i)&&(l=a.date(i),c=null),a.isAfter(t,r)&&(c&&(c=a.date(r)),l=null);l||c;){if(l&&a.isAfter(l,r)&&(l=null),c&&a.isBefore(c,i)&&(c=null),l){if(!o(l))return l;l=a.addDays(l,1)}if(c){if(!o(c))return c;c=a.addDays(c,-1)}}return null},Qet=(t,e)=>{const n=t.date(e);return t.isValid(n)?n:null},Zl=(t,e,n)=>{if(e==null)return n;const r=t.date(e);return t.isValid(r)?r:n};function hue(t,e){var n,r,i,o,a;const s=qe({props:t,name:e}),l=wr(),c=C2(),u=(n=s.ampm)!=null?n:l.is12HourCycleInCurrentLocale();if(s.orientation!=null&&s.orientation!=="portrait")throw new Error("We are not supporting custom orientation for DateTimePicker yet :(");return j({ampm:u,orientation:"portrait",openTo:"day",views:["year","day","hours","minutes"],ampmInClock:!0,acceptRegex:u?/[\dap]/gi:/\d/gi,disableMaskedInput:!1,inputFormat:u?l.formats.keyboardDateTime12h:l.formats.keyboardDateTime24h,disableIgnoringDatePartForTimeValidation:!!(s.minDateTime||s.maxDateTime),disablePast:!1,disableFuture:!1},s,{minDate:Zl(l,(r=s.minDateTime)!=null?r:s.minDate,c.minDate),maxDate:Zl(l,(i=s.maxDateTime)!=null?i:s.maxDate,c.maxDate),minTime:(o=s.minDateTime)!=null?o:s.minTime,maxTime:(a=s.maxDateTime)!=null?a:s.maxTime})}const pue={emptyValue:null,getTodayValue:t=>t.date(),parseInput:Qet,areValuesEqual:(t,e,n)=>t.isEqual(e,n)},Yet=t=>{switch(t){case"year":case"month":case"day":return"calendar";default:return"clock"}};function mue(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e{const{classes:e,selected:n}=t;return Ue({root:["root",n&&"selected"]},Ket,e)},ett=we(At,{name:"PrivatePickersToolbarText",slot:"Root",overridesResolver:(t,e)=>[e.root,{[`&.${h9.selected}`]:e.selected}]})(({theme:t})=>({transition:t.transitions.create("color"),color:t.palette.text.secondary,[`&.${h9.selected}`]:{color:t.palette.text.primary}})),gue=M.forwardRef(function(e,n){const{className:r,value:i}=e,o=Ae(e,Zet),a=Jet(e);return w.jsx(ett,j({ref:n,className:Ur(r,a.root),component:"span"},o,{children:i}))}),ttt=ti(w.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),ntt=ti(w.jsx("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}),"ArrowLeft"),rtt=ti(w.jsx("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"ArrowRight"),vue=ti(w.jsx("path",{d:"M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z"}),"Calendar"),itt=ti(w.jsxs(M.Fragment,{children:[w.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),w.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Clock"),ott=ti(w.jsx("path",{d:"M9 11H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm2-7h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11z"}),"DateRange"),att=ti(w.jsx("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 00-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"}),"Pen"),stt=ti(w.jsxs(M.Fragment,{children:[w.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),w.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Time");function yue(t){return We("MuiPickersToolbar",t)}const xue=Ve("MuiPickersToolbar",["root","content","penIconButton","penIconButtonLandscape"]),ltt=t=>{const{classes:e,isLandscape:n}=t;return Ue({root:["root"],content:["content"],penIconButton:["penIconButton",n&&"penIconButtonLandscape"]},yue,e)},ctt=we("div",{name:"MuiPickersToolbar",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t,ownerState:e})=>j({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"space-between",padding:t.spacing(2,3)},e.isLandscape&&{height:"auto",maxWidth:160,padding:16,justifyContent:"flex-start",flexWrap:"wrap"})),utt=we(wC,{name:"MuiPickersToolbar",slot:"Content",overridesResolver:(t,e)=>e.content})(({ownerState:t})=>j({flex:1},!t.isLandscape&&{alignItems:"center"})),ftt=we(Ot,{name:"MuiPickersToolbar",slot:"PenIconButton",overridesResolver:(t,e)=>[{[`&.${xue.penIconButtonLandscape}`]:e.penIconButtonLandscape},e.penIconButton]})({}),dtt=t=>t==="clock"?w.jsx(itt,{color:"inherit"}):w.jsx(vue,{color:"inherit"}),htt=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiPickersToolbar"}),{children:i,className:o,getMobileKeyboardInputViewButtonText:a,isLandscape:s,isMobileKeyboardViewOpen:l,landscapeDirection:c="column",toggleMobileKeyboardView:u,toolbarTitle:f,viewType:d="calendar"}=r,h=r,p=yd(),m=ltt(h);return w.jsxs(ctt,{ref:n,className:Ur(m.root,o),ownerState:h,children:[w.jsx(At,{color:"text.secondary",variant:"overline",children:f}),w.jsxs(utt,{container:!0,justifyContent:"space-between",className:m.content,ownerState:h,direction:s?c:"row",alignItems:s?"flex-start":"flex-end",children:[i,w.jsx(ftt,{onClick:u,className:m.penIconButton,ownerState:h,color:"inherit","aria-label":a?a(l,d):p.inputModeToggleButtonAriaLabel(l,d),children:l?dtt(d):w.jsx(att,{color:"inherit"})})]})]})}),ptt=["align","className","selected","typographyClassName","value","variant"],mtt=t=>{const{classes:e}=t;return Ue({root:["root"]},yue,e)},gtt=we(er,{name:"MuiPickersToolbarButton",slot:"Root",overridesResolver:(t,e)=>e.root})({padding:0,minWidth:16,textTransform:"none"}),C0=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiPickersToolbarButton"}),{align:i,className:o,selected:a,typographyClassName:s,value:l,variant:c}=r,u=Ae(r,ptt),f=mtt(r);return w.jsx(gtt,j({variant:"text",ref:n,className:Ur(o,f.root)},u,{children:w.jsx(gue,{align:i,className:s,variant:c,value:l,selected:a})}))});function vtt(t){return We("MuiDateTimePickerToolbar",t)}Ve("MuiDateTimePickerToolbar",["root","dateContainer","timeContainer","separator"]);const ytt=["ampm","parsedValue","isMobileKeyboardViewOpen","onChange","openView","setOpenView","toggleMobileKeyboardView","toolbarFormat","toolbarPlaceholder","toolbarTitle","views"],xtt=t=>{const{classes:e}=t;return Ue({root:["root"],dateContainer:["dateContainer"],timeContainer:["timeContainer"],separator:["separator"]},vtt,e)},btt=we(htt,{name:"MuiDateTimePickerToolbar",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({paddingLeft:16,paddingRight:16,justifyContent:"space-around",position:"relative",[`& .${xue.penIconButton}`]:j({position:"absolute",top:8},t.direction==="rtl"?{left:8}:{right:8})})),_tt=we("div",{name:"MuiDateTimePickerToolbar",slot:"DateContainer",overridesResolver:(t,e)=>e.dateContainer})({display:"flex",flexDirection:"column",alignItems:"flex-start"}),wtt=we("div",{name:"MuiDateTimePickerToolbar",slot:"TimeContainer",overridesResolver:(t,e)=>e.timeContainer})({display:"flex"}),p9=we(gue,{name:"MuiDateTimePickerToolbar",slot:"Separator",overridesResolver:(t,e)=>e.separator})({margin:"0 4px 0 2px",cursor:"default"});function bue(t){const e=qe({props:t,name:"MuiDateTimePickerToolbar"}),{ampm:n,parsedValue:r,isMobileKeyboardViewOpen:i,openView:o,setOpenView:a,toggleMobileKeyboardView:s,toolbarFormat:l,toolbarPlaceholder:c="––",toolbarTitle:u,views:f}=e,d=Ae(e,ytt),h=e,p=wr(),m=yd(),g=xtt(h),v=u??m.dateTimePickerDefaultToolbarTitle,y=b=>n?p.format(b,"hours12h"):p.format(b,"hours24h"),x=M.useMemo(()=>r?l?p.formatByString(r,l):p.format(r,"shortDate"):c,[r,l,c,p]);return w.jsxs(btt,j({toolbarTitle:v,isMobileKeyboardViewOpen:i,toggleMobileKeyboardView:s,className:g.root,viewType:Yet(o)},d,{isLandscape:!1,ownerState:h,children:[w.jsxs(_tt,{className:g.dateContainer,ownerState:h,children:[f.includes("year")&&w.jsx(C0,{tabIndex:-1,variant:"subtitle1",onClick:()=>a("year"),selected:o==="year",value:r?p.format(r,"year"):"–"}),f.includes("day")&&w.jsx(C0,{tabIndex:-1,variant:"h4",onClick:()=>a("day"),selected:o==="day",value:x})]}),w.jsxs(wtt,{className:g.timeContainer,ownerState:h,children:[f.includes("hours")&&w.jsx(C0,{variant:"h3",onClick:()=>a("hours"),selected:o==="hours",value:r?y(r):"--"}),f.includes("minutes")&&w.jsxs(M.Fragment,{children:[w.jsx(p9,{variant:"h3",value:":",className:g.separator,ownerState:h}),w.jsx(C0,{variant:"h3",onClick:()=>a("minutes"),selected:o==="minutes",value:r?p.format(r,"minutes"):"--"})]}),f.includes("seconds")&&w.jsxs(M.Fragment,{children:[w.jsx(p9,{variant:"h3",value:":",className:g.separator,ownerState:h}),w.jsx(C0,{variant:"h3",onClick:()=>a("seconds"),selected:o==="seconds",value:r?p.format(r,"seconds"):"--"})]})]})]}))}const xd=M.createContext(null),Stt=["onAccept","onClear","onCancel","onSetToday","actions"],_ue=t=>{const{onAccept:e,onClear:n,onCancel:r,onSetToday:i,actions:o}=t,a=Ae(t,Stt),s=M.useContext(xd),l=yd(),c=typeof o=="function"?o(s):o;if(c==null||c.length===0)return null;const u=c==null?void 0:c.map(f=>{switch(f){case"clear":return w.jsx(er,{onClick:n,children:l.clearButtonLabel},f);case"cancel":return w.jsx(er,{onClick:r,children:l.cancelButtonLabel},f);case"accept":return w.jsx(er,{onClick:e,children:l.okButtonLabel},f);case"today":return w.jsx(er,{onClick:i,children:l.todayButtonLabel},f);default:return null}});return w.jsx(yp,j({},a,{children:u}))};function Ott(t){return We("MuiPickersPopper",t)}Ve("MuiPickersPopper",["root","paper"]);function wue(t,e){return Array.isArray(e)?e.every(n=>t.indexOf(n)!==-1):t.indexOf(e)!==-1}const Sue=(t,e)=>n=>{(n.key==="Enter"||n.key===" ")&&(t(n),n.preventDefault(),n.stopPropagation()),e&&e(n)},Oue=(t=document)=>{const e=t.activeElement;return e?e.shadowRoot?Oue(e.shadowRoot):e:null},Ctt=["onClick","onTouchStart"],Ttt=t=>{const{classes:e}=t;return Ue({root:["root"],paper:["paper"]},Ott,e)},Ett=we(f5,{name:"MuiPickersPopper",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({zIndex:t.zIndex.modal})),Ptt=we(Go,{name:"MuiPickersPopper",slot:"Paper",overridesResolver:(t,e)=>e.paper})(({ownerState:t})=>j({transformOrigin:"top center",outline:0},t.placement==="top"&&{transformOrigin:"bottom center"}));function Mtt(t,e){return e.documentElement.clientWidth{if(!t)return;function l(){o.current=!0}return document.addEventListener("mousedown",l,!0),document.addEventListener("touchstart",l,!0),()=>{document.removeEventListener("mousedown",l,!0),document.removeEventListener("touchstart",l,!0),o.current=!1}},[t]);const a=br(l=>{if(!o.current)return;const c=r.current;r.current=!1;const u=$n(i.current);if(!i.current||"clientX"in l&&Mtt(l,u))return;if(n.current){n.current=!1;return}let f;l.composedPath?f=l.composedPath().indexOf(i.current)>-1:f=!u.documentElement.contains(l.target)||i.current.contains(l.target),!f&&!c&&e(l)}),s=()=>{r.current=!0};return M.useEffect(()=>{if(t){const l=$n(i.current),c=()=>{n.current=!0};return l.addEventListener("touchstart",a),l.addEventListener("touchmove",c),()=>{l.removeEventListener("touchstart",a),l.removeEventListener("touchmove",c)}}},[t,a]),M.useEffect(()=>{if(t){const l=$n(i.current);return l.addEventListener("click",a),()=>{l.removeEventListener("click",a),r.current=!1}}},[t,a]),[i,s,s]}function Att(t){var e;const n=qe({props:t,name:"MuiPickersPopper"}),{anchorEl:r,children:i,containerRef:o=null,onBlur:a,onClose:s,onClear:l,onAccept:c,onCancel:u,onSetToday:f,open:d,PopperProps:h,role:p,TransitionComponent:m=Rb,TrapFocusProps:g,PaperProps:v={},components:y,componentsProps:x}=n;M.useEffect(()=>{function U(N){d&&(N.key==="Escape"||N.key==="Esc")&&s()}return document.addEventListener("keydown",U),()=>{document.removeEventListener("keydown",U)}},[s,d]);const b=M.useRef(null);M.useEffect(()=>{p!=="tooltip"&&(d?b.current=Oue(document):b.current&&b.current instanceof HTMLElement&&setTimeout(()=>{b.current instanceof HTMLElement&&b.current.focus()}))},[d,p]);const[_,S,O]=ktt(d,a??s),C=M.useRef(null),E=Zt(C,o),k=Zt(E,_),I=n,P=Ttt(I),{onClick:R,onTouchStart:T}=v,L=Ae(v,Ctt),z=U=>{U.key==="Escape"&&(U.stopPropagation(),s())},B=(e=y==null?void 0:y.ActionBar)!=null?e:_ue,W=(y==null?void 0:y.PaperContent)||M.Fragment;return w.jsx(Ett,j({transition:!0,role:p,open:d,anchorEl:r,onKeyDown:z,className:P.root},h,{children:({TransitionProps:U,placement:N})=>w.jsx(vre,j({open:d,disableAutoFocus:!0,disableRestoreFocus:!0,disableEnforceFocus:p==="tooltip",isEnabled:()=>!0},g,{children:w.jsx(m,j({},U,{children:w.jsx(Ptt,j({tabIndex:-1,elevation:8,ref:k,onClick:$=>{S($),R&&R($)},onTouchStart:$=>{O($),T&&T($)},ownerState:j({},I,{placement:N}),className:P.paper},L,{children:w.jsxs(W,j({},x==null?void 0:x.paperContent,{children:[i,w.jsx(B,j({onAccept:c,onClear:l,onCancel:u,onSetToday:f,actions:[]},x==null?void 0:x.actionBar))]}))}))}))}))}))}function Rtt(t){const{children:e,DateInputProps:n,KeyboardDateInputComponent:r,onClear:i,onDismiss:o,onCancel:a,onAccept:s,onSetToday:l,open:c,PopperProps:u,PaperProps:f,TransitionComponent:d,components:h,componentsProps:p}=t,m=M.useRef(null),g=Zt(n.inputRef,m);return w.jsxs(xd.Provider,{value:"desktop",children:[w.jsx(r,j({},n,{inputRef:g})),w.jsx(Att,{role:"dialog",open:c,anchorEl:m.current,TransitionComponent:d,PopperProps:u,PaperProps:f,onClose:o,onCancel:a,onClear:i,onAccept:s,onSetToday:l,components:h,componentsProps:p,children:e})]})}function Cz({onChange:t,onViewChange:e,openTo:n,view:r,views:i}){var o,a;const[s,l]=Hs({name:"Picker",state:"view",controlled:r,default:n&&wue(i,n)?n:i[0]}),c=(o=i[i.indexOf(s)-1])!=null?o:null,u=(a=i[i.indexOf(s)+1])!=null?a:null,f=M.useCallback(p=>{l(p),e&&e(p)},[l,e]),d=M.useCallback(()=>{u&&f(u)},[u,f]);return{handleChangeAndOpenNext:M.useCallback((p,m)=>{const g=m==="finish";t(p,g&&u?"partial":m),g&&d()},[u,t,d]),nextView:u,previousView:c,openNext:d,openView:s,setOpenView:f}}const rv=220,Nf=36,Qb={x:rv/2,y:rv/2},Cue={x:Qb.x,y:0},Itt=Cue.x-Qb.x,Dtt=Cue.y-Qb.y,Ltt=t=>t*(180/Math.PI),Tue=(t,e,n)=>{const r=e-Qb.x,i=n-Qb.y,o=Math.atan2(Itt,Dtt)-Math.atan2(r,i);let a=Ltt(o);a=Math.round(a/t)*t,a%=360;const s=Math.floor(a/t)||0,l=r**2+i**2,c=Math.sqrt(l);return{value:s,distance:c}},$tt=(t,e,n=1)=>{const r=n*6;let{value:i}=Tue(r,t,e);return i=i*n%60,i},Ntt=(t,e,n)=>{const{value:r,distance:i}=Tue(30,t,e);let o=r||12;return n?o%=12:i{const{classes:e}=t;return Ue({root:["root"],thumb:["thumb"]},Ftt,e)},ztt=we("div",{name:"MuiClockPointer",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t,ownerState:e})=>j({width:2,backgroundColor:t.palette.primary.main,position:"absolute",left:"calc(50% - 1px)",bottom:"50%",transformOrigin:"center bottom 0px"},e.shouldAnimate&&{transition:t.transitions.create(["transform","height"])})),Utt=we("div",{name:"MuiClockPointer",slot:"Thumb",overridesResolver:(t,e)=>e.thumb})(({theme:t,ownerState:e})=>j({width:4,height:4,backgroundColor:t.palette.primary.contrastText,borderRadius:"50%",position:"absolute",top:-21,left:`calc(50% - ${Nf/2}px)`,border:`${(Nf-4)/2}px solid ${t.palette.primary.main}`,boxSizing:"content-box"},e.hasSelected&&{backgroundColor:t.palette.primary.main}));function Wtt(t){const e=qe({props:t,name:"MuiClockPointer"}),{className:n,isInner:r,type:i,value:o}=e,a=Ae(e,jtt),s=M.useRef(i);M.useEffect(()=>{s.current=i},[i]);const l=j({},e,{shouldAnimate:s.current!==i}),c=Btt(l),u=()=>{let d=360/(i==="hours"?12:60)*o;return i==="hours"&&o>12&&(d-=360),{height:Math.round((r?.26:.4)*rv),transform:`rotateZ(${d}deg)`}};return w.jsx(ztt,j({style:u(),className:Ur(n,c.root),ownerState:l},a,{children:w.jsx(Utt,{ownerState:l,className:c.thumb})}))}function Vtt(t){return We("MuiClock",t)}Ve("MuiClock",["root","clock","wrapper","squareMask","pin","amButton","pmButton"]);const Gtt=t=>{const{classes:e}=t;return Ue({root:["root"],clock:["clock"],wrapper:["wrapper"],squareMask:["squareMask"],pin:["pin"],amButton:["amButton"],pmButton:["pmButton"]},Vtt,e)},Htt=we("div",{name:"MuiClock",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({display:"flex",justifyContent:"center",alignItems:"center",margin:t.spacing(2)})),qtt=we("div",{name:"MuiClock",slot:"Clock",overridesResolver:(t,e)=>e.clock})({backgroundColor:"rgba(0,0,0,.07)",borderRadius:"50%",height:220,width:220,flexShrink:0,position:"relative",pointerEvents:"none"}),Xtt=we("div",{name:"MuiClock",slot:"Wrapper",overridesResolver:(t,e)=>e.wrapper})({"&:focus":{outline:"none"}}),Qtt=we("div",{name:"MuiClock",slot:"SquareMask",overridesResolver:(t,e)=>e.squareMask})(({ownerState:t})=>j({width:"100%",height:"100%",position:"absolute",pointerEvents:"auto",outline:0,touchAction:"none",userSelect:"none"},t.disabled?{}:{"@media (pointer: fine)":{cursor:"pointer",borderRadius:"50%"},"&:active":{cursor:"move"}})),Ytt=we("div",{name:"MuiClock",slot:"Pin",overridesResolver:(t,e)=>e.pin})(({theme:t})=>({width:6,height:6,borderRadius:"50%",backgroundColor:t.palette.primary.main,position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"})),Ktt=we(Ot,{name:"MuiClock",slot:"AmButton",overridesResolver:(t,e)=>e.amButton})(({theme:t,ownerState:e})=>j({zIndex:1,position:"absolute",bottom:e.ampmInClock?64:8,left:8},e.meridiemMode==="am"&&{backgroundColor:t.palette.primary.main,color:t.palette.primary.contrastText,"&:hover":{backgroundColor:t.palette.primary.light}})),Ztt=we(Ot,{name:"MuiClock",slot:"PmButton",overridesResolver:(t,e)=>e.pmButton})(({theme:t,ownerState:e})=>j({zIndex:1,position:"absolute",bottom:e.ampmInClock?64:8,right:8},e.meridiemMode==="pm"&&{backgroundColor:t.palette.primary.main,color:t.palette.primary.contrastText,"&:hover":{backgroundColor:t.palette.primary.light}}));function Jtt(t){const e=qe({props:t,name:"MuiClock"}),{ampm:n,ampmInClock:r,autoFocus:i,children:o,date:a,getClockLabelText:s,handleMeridiemChange:l,isTimeDisabled:c,meridiemMode:u,minutesStep:f=1,onChange:d,selectedId:h,type:p,value:m,disabled:g,readOnly:v,className:y}=e,x=e,b=wr(),_=M.useContext(xd),S=M.useRef(!1),O=Gtt(x),C=c(m,p),E=!n&&p==="hours"&&(m<1||m>12),k=(N,$)=>{g||v||c(N,p)||d(N,$)},I=(N,$)=>{let{offsetX:D,offsetY:A}=N;if(D===void 0){const Y=N.target.getBoundingClientRect();D=N.changedTouches[0].clientX-Y.left,A=N.changedTouches[0].clientY-Y.top}const q=p==="seconds"||p==="minutes"?$tt(D,A,f):Ntt(D,A,!!n);k(q,$)},P=N=>{S.current=!0,I(N,"shallow")},R=N=>{S.current&&(I(N,"finish"),S.current=!1)},T=N=>{N.buttons>0&&I(N.nativeEvent,"shallow")},L=N=>{S.current&&(S.current=!1),I(N.nativeEvent,"finish")},z=M.useMemo(()=>p==="hours"?!0:m%5===0,[p,m]),B=p==="minutes"?f:1,W=M.useRef(null);Vr(()=>{i&&W.current.focus()},[i]);const U=N=>{if(!S.current)switch(N.key){case"Home":k(0,"partial"),N.preventDefault();break;case"End":k(p==="minutes"?59:23,"partial"),N.preventDefault();break;case"ArrowUp":k(m+B,"partial"),N.preventDefault();break;case"ArrowDown":k(m-B,"partial"),N.preventDefault();break}};return w.jsxs(Htt,{className:Ur(y,O.root),children:[w.jsxs(qtt,{className:O.clock,children:[w.jsx(Qtt,{onTouchMove:P,onTouchEnd:R,onMouseUp:L,onMouseMove:T,ownerState:{disabled:g},className:O.squareMask}),!C&&w.jsxs(M.Fragment,{children:[w.jsx(Ytt,{className:O.pin}),a&&w.jsx(Wtt,{type:p,value:m,isInner:E,hasSelected:z})]}),w.jsx(Xtt,{"aria-activedescendant":h,"aria-label":s(p,a,b),ref:W,role:"listbox",onKeyDown:U,tabIndex:0,className:O.wrapper,children:o})]}),n&&(_==="desktop"||r)&&w.jsxs(M.Fragment,{children:[w.jsx(Ktt,{onClick:v?void 0:()=>l("am"),disabled:g||u===null,ownerState:x,className:O.amButton,children:w.jsx(At,{variant:"caption",children:"AM"})}),w.jsx(Ztt,{disabled:g||u===null,onClick:v?void 0:()=>l("pm"),ownerState:x,className:O.pmButton,children:w.jsx(At,{variant:"caption",children:"PM"})})]})]})}const Eue=t=>()=>{};function ent(t){return We("MuiClockNumber",t)}const RS=Ve("MuiClockNumber",["root","selected","disabled"]),tnt=["className","disabled","index","inner","label","selected"],nnt=t=>{const{classes:e,selected:n,disabled:r}=t;return Ue({root:["root",n&&"selected",r&&"disabled"]},ent,e)},rnt=we("span",{name:"MuiClockNumber",slot:"Root",overridesResolver:(t,e)=>[e.root,{[`&.${RS.disabled}`]:e.disabled},{[`&.${RS.selected}`]:e.selected}]})(({theme:t,ownerState:e})=>j({height:Nf,width:Nf,position:"absolute",left:`calc((100% - ${Nf}px) / 2)`,display:"inline-flex",justifyContent:"center",alignItems:"center",borderRadius:"50%",color:t.palette.text.primary,fontFamily:t.typography.fontFamily,"&:focused":{backgroundColor:t.palette.background.paper},[`&.${RS.selected}`]:{color:t.palette.primary.contrastText},[`&.${RS.disabled}`]:{pointerEvents:"none",color:t.palette.text.disabled}},e.inner&&j({},t.typography.body2,{color:t.palette.text.secondary})));function Pue(t){const e=qe({props:t,name:"MuiClockNumber"}),{className:n,disabled:r,index:i,inner:o,label:a,selected:s}=e,l=Ae(e,tnt),c=e,u=nnt(c),f=i%12/12*Math.PI*2-Math.PI/2,d=(rv-Nf-2)/2*(o?.65:1),h=Math.round(Math.cos(f)*d),p=Math.round(Math.sin(f)*d);return w.jsx(rnt,j({className:Ur(n,u.root),"aria-disabled":r?!0:void 0,"aria-selected":s?!0:void 0,role:"option",style:{transform:`translate(${h}px, ${p+(rv-Nf)/2}px`},ownerState:c},l,{children:a}))}const int=({ampm:t,date:e,getClockNumberText:n,isDisabled:r,selectedId:i,utils:o})=>{const a=e?o.getHours(e):null,s=[],l=t?1:0,c=t?12:23,u=f=>a===null?!1:t?f===12?a===12||a===0:a===f||a-12===f:a===f;for(let f=l;f<=c;f+=1){let d=f.toString();f===0&&(d="00");const h=!t&&(f===0||f>12);d=o.formatNumber(d);const p=u(f);s.push(w.jsx(Pue,{id:p?i:void 0,index:f,inner:h,selected:p,disabled:r(f),label:d,"aria-label":n(d)},f))}return s},m9=({utils:t,value:e,isDisabled:n,getClockNumberText:r,selectedId:i})=>{const o=t.formatNumber;return[[5,o("05")],[10,o("10")],[15,o("15")],[20,o("20")],[25,o("25")],[30,o("30")],[35,o("35")],[40,o("40")],[45,o("45")],[50,o("50")],[55,o("55")],[0,o("00")]].map(([a,s],l)=>{const c=a===e;return w.jsx(Pue,{label:s,id:c?i:void 0,index:l+1,inner:!1,disabled:n(a),selected:c,"aria-label":r(s)},a)})};function ont(t){return We("MuiPickersArrowSwitcher",t)}Ve("MuiPickersArrowSwitcher",["root","spacer","button"]);const ant=["children","className","components","componentsProps","isLeftDisabled","isLeftHidden","isRightDisabled","isRightHidden","leftArrowButtonText","onLeftClick","onRightClick","rightArrowButtonText"],snt=t=>{const{classes:e}=t;return Ue({root:["root"],spacer:["spacer"],button:["button"]},ont,e)},lnt=we("div",{name:"MuiPickersArrowSwitcher",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex"}),cnt=we("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer",overridesResolver:(t,e)=>e.spacer})(({theme:t})=>({width:t.spacing(3)})),g9=we(Ot,{name:"MuiPickersArrowSwitcher",slot:"Button",overridesResolver:(t,e)=>e.button})(({ownerState:t})=>j({},t.hidden&&{visibility:"hidden"})),Mue=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiPickersArrowSwitcher"}),{children:i,className:o,components:a,componentsProps:s,isLeftDisabled:l,isLeftHidden:c,isRightDisabled:u,isRightHidden:f,leftArrowButtonText:d,onLeftClick:h,onRightClick:p,rightArrowButtonText:m}=r,g=Ae(r,ant),y=Vo().direction==="rtl",x=(s==null?void 0:s.leftArrowButton)||{},b=(a==null?void 0:a.LeftArrowIcon)||ntt,_=(s==null?void 0:s.rightArrowButton)||{},S=(a==null?void 0:a.RightArrowIcon)||rtt,O=r,C=snt(O);return w.jsxs(lnt,j({ref:n,className:Ur(C.root,o),ownerState:O},g,{children:[w.jsx(g9,j({as:a==null?void 0:a.LeftArrowButton,size:"small","aria-label":d,title:d,disabled:l,edge:"end",onClick:h},x,{className:Ur(C.button,x.className),ownerState:j({},O,x,{hidden:c}),children:y?w.jsx(S,{}):w.jsx(b,{})})),i?w.jsx(At,{variant:"subtitle1",component:"span",children:i}):w.jsx(cnt,{className:C.spacer,ownerState:O}),w.jsx(g9,j({as:a==null?void 0:a.RightArrowButton,size:"small","aria-label":m,title:m,edge:"start",disabled:u,onClick:p},_,{className:Ur(C.button,_.className),ownerState:j({},O,_,{hidden:f}),children:y?w.jsx(b,{}):w.jsx(S,{})}))]}))}),unt=(t,e)=>t?e.getHours(t)>=12?"pm":"am":null,G$=(t,e,n)=>n&&(t>=12?"pm":"am")!==e?e==="am"?t-12:t+12:t,fnt=(t,e,n,r)=>{const i=G$(r.getHours(t),e,n);return r.setHours(t,i)},v9=(t,e)=>e.getHours(t)*3600+e.getMinutes(t)*60+e.getSeconds(t),kue=(t=!1,e)=>(n,r)=>t?e.isAfter(n,r):v9(n,e)>v9(r,e);function dnt(t,{disableFuture:e,maxDate:n}){const r=wr();return M.useMemo(()=>{const i=r.date(),o=r.startOfMonth(e&&r.isBefore(i,n)?i:n);return!r.isAfter(o,t)},[e,n,t,r])}function hnt(t,{disablePast:e,minDate:n}){const r=wr();return M.useMemo(()=>{const i=r.date(),o=r.startOfMonth(e&&r.isAfter(i,n)?i:n);return!r.isBefore(o,t)},[e,n,t,r])}function pnt(t,e,n){const r=wr(),i=unt(t,r),o=M.useCallback(a=>{const s=t==null?null:fnt(t,a,!!e,r);n(s,"partial")},[e,t,n,r]);return{meridiemMode:i,handleMeridiemChange:o}}function mnt(t){return We("MuiClockPicker",t)}Ve("MuiClockPicker",["root","arrowSwitcher"]);const H$=36,Tz=2,Aue=320,gnt=358,Ez=we("div")({overflowX:"hidden",width:Aue,maxHeight:gnt,display:"flex",flexDirection:"column",margin:"0 auto"}),vnt=t=>{const{classes:e}=t;return Ue({root:["root"],arrowSwitcher:["arrowSwitcher"]},mnt,e)},ynt=we(Ez,{name:"MuiClockPicker",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexDirection:"column"}),xnt=we(Mue,{name:"MuiClockPicker",slot:"ArrowSwitcher",overridesResolver:(t,e)=>e.arrowSwitcher})({position:"absolute",right:12,top:15}),bnt=Eue(),_nt=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiClockPicker"}),{ampm:i=!1,ampmInClock:o=!1,autoFocus:a,components:s,componentsProps:l,date:c,disableIgnoringDatePartForTimeValidation:u,getClockLabelText:f,getHoursClockNumberText:d,getMinutesClockNumberText:h,getSecondsClockNumberText:p,leftArrowButtonText:m,maxTime:g,minTime:v,minutesStep:y=1,rightArrowButtonText:x,shouldDisableTime:b,showViewSwitcher:_,onChange:S,view:O,views:C=["hours","minutes"],openTo:E,onViewChange:k,className:I,disabled:P,readOnly:R}=r;bnt({leftArrowButtonText:m,rightArrowButtonText:x,getClockLabelText:f,getHoursClockNumberText:d,getMinutesClockNumberText:h,getSecondsClockNumberText:p});const T=yd(),L=m??T.openPreviousView,z=x??T.openNextView,B=f??T.clockLabelText,W=d??T.hoursClockNumberText,U=h??T.minutesClockNumberText,N=p??T.secondsClockNumberText,{openView:$,setOpenView:D,nextView:A,previousView:q,handleChangeAndOpenNext:Y}=Cz({view:O,views:C,openTo:E,onViewChange:k,onChange:S}),K=ow(),se=wr(),te=M.useMemo(()=>c||se.setSeconds(se.setMinutes(se.setHours(K,0),0),0),[c,K,se]),{meridiemMode:J,handleMeridiemChange:pe}=pnt(te,i,Y),be=M.useCallback((le,Q)=>{const X=kue(u,se),ee=({start:ye,end:H})=>!(v&&X(v,H)||g&&X(ye,g)),ge=(ye,H=1)=>ye%H!==0?!1:b?!b(ye,Q):!0;switch(Q){case"hours":{const ye=G$(le,J,i),H=se.setHours(te,ye),G=se.setSeconds(se.setMinutes(H,0),0),ie=se.setSeconds(se.setMinutes(H,59),59);return!ee({start:G,end:ie})||!ge(ye)}case"minutes":{const ye=se.setMinutes(te,le),H=se.setSeconds(ye,0),G=se.setSeconds(ye,59);return!ee({start:H,end:G})||!ge(le,y)}case"seconds":{const ye=se.setSeconds(te,le);return!ee({start:ye,end:ye})||!ge(le)}default:throw new Error("not supported")}},[i,te,u,g,J,v,y,b,se]),re=cd(),ve=M.useMemo(()=>{switch($){case"hours":{const le=(Q,X)=>{const ee=G$(Q,J,i);Y(se.setHours(te,ee),X)};return{onChange:le,value:se.getHours(te),children:int({date:c,utils:se,ampm:i,onChange:le,getClockNumberText:W,isDisabled:Q=>P||be(Q,"hours"),selectedId:re})}}case"minutes":{const le=se.getMinutes(te),Q=(X,ee)=>{Y(se.setMinutes(te,X),ee)};return{value:le,onChange:Q,children:m9({utils:se,value:le,onChange:Q,getClockNumberText:U,isDisabled:X=>P||be(X,"minutes"),selectedId:re})}}case"seconds":{const le=se.getSeconds(te),Q=(X,ee)=>{Y(se.setSeconds(te,X),ee)};return{value:le,onChange:Q,children:m9({utils:se,value:le,onChange:Q,getClockNumberText:N,isDisabled:X=>P||be(X,"seconds"),selectedId:re})}}default:throw new Error("You must provide the type for ClockView")}},[$,se,c,i,W,U,N,J,Y,te,be,re,P]),F=r,ce=vnt(F);return w.jsxs(ynt,{ref:n,className:Ur(ce.root,I),ownerState:F,children:[_&&w.jsx(xnt,{className:ce.arrowSwitcher,leftArrowButtonText:L,rightArrowButtonText:z,components:s,componentsProps:l,onLeftClick:()=>D(q),onRightClick:()=>D(A),isLeftDisabled:!q,isRightDisabled:!A,ownerState:F}),w.jsx(Jtt,j({autoFocus:a,date:c,ampmInClock:o,type:$,ampm:i,getClockLabelText:B,minutesStep:y,isTimeDisabled:be,meridiemMode:J,handleMeridiemChange:pe,selectedId:re,disabled:P,readOnly:R},ve))]})});function wnt(t){return We("PrivatePickersMonth",t)}const y9=Ve("PrivatePickersMonth",["root","selected"]),Snt=["disabled","onSelect","selected","value","tabIndex","hasFocus","onFocus","onBlur"],Ont=t=>{const{classes:e,selected:n}=t;return Ue({root:["root",n&&"selected"]},wnt,e)},Cnt=we(At,{name:"PrivatePickersMonth",slot:"Root",overridesResolver:(t,e)=>[e.root,{[`&.${y9.selected}`]:e.selected}]})(({theme:t})=>j({flex:"1 0 33.33%",display:"flex",alignItems:"center",justifyContent:"center",color:"unset",backgroundColor:"transparent",border:0,outline:0},t.typography.subtitle1,{margin:"8px 0",height:36,borderRadius:18,cursor:"pointer","&:focus, &:hover":{backgroundColor:Wc(t.palette.action.active,t.palette.action.hoverOpacity)},"&:disabled":{pointerEvents:"none",color:t.palette.text.secondary},[`&.${y9.selected}`]:{color:t.palette.primary.contrastText,backgroundColor:t.palette.primary.main,"&:focus, &:hover":{backgroundColor:t.palette.primary.dark}}})),x9=()=>{},Tnt=t=>{const{disabled:e,onSelect:n,selected:r,value:i,tabIndex:o,hasFocus:a,onFocus:s=x9,onBlur:l=x9}=t,c=Ae(t,Snt),u=Ont(t),f=()=>{n(i)},d=M.useRef(null);return Vr(()=>{if(a){var h;(h=d.current)==null||h.focus()}},[a]),w.jsx(Cnt,j({ref:d,component:"button",type:"button",className:u.root,tabIndex:o,onClick:f,onKeyDown:Sue(f),color:r?"primary":void 0,variant:r?"h5":"subtitle1",disabled:e,onFocus:h=>s(h,i),onBlur:h=>l(h,i)},c))};function Ent(t){return We("MuiMonthPicker",t)}Ve("MuiMonthPicker",["root"]);const Pnt=["className","date","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","autoFocus","onMonthFocus","hasFocus","onFocusedViewChange"],Mnt=t=>{const{classes:e}=t;return Ue({root:["root"]},Ent,e)};function knt(t,e){const n=wr(),r=C2(),i=qe({props:t,name:e});return j({disableFuture:!1,disablePast:!1},i,{minDate:Zl(n,i.minDate,r.minDate),maxDate:Zl(n,i.maxDate,r.maxDate)})}const Ant=we("div",{name:"MuiMonthPicker",slot:"Root",overridesResolver:(t,e)=>e.root})({width:310,display:"flex",flexWrap:"wrap",alignContent:"stretch",margin:"0 4px"}),Rnt=M.forwardRef(function(e,n){const r=wr(),i=ow(),o=knt(e,"MuiMonthPicker"),{className:a,date:s,disabled:l,disableFuture:c,disablePast:u,maxDate:f,minDate:d,onChange:h,shouldDisableMonth:p,readOnly:m,disableHighlightToday:g,autoFocus:v=!1,onMonthFocus:y,hasFocus:x,onFocusedViewChange:b}=o,_=Ae(o,Pnt),S=o,O=Mnt(S),C=ld(),E=M.useMemo(()=>s??r.startOfMonth(i),[i,r,s]),k=M.useMemo(()=>s!=null?r.getMonth(s):g?null:r.getMonth(i),[i,s,r,g]),[I,P]=M.useState(()=>k||r.getMonth(i)),R=M.useCallback(A=>{const q=r.startOfMonth(u&&r.isAfter(i,d)?i:d),Y=r.startOfMonth(c&&r.isBefore(i,f)?i:f);return r.isBefore(A,q)||r.isAfter(A,Y)?!0:p?p(A):!1},[c,u,f,d,i,p,r]),T=A=>{if(m)return;const q=r.setMonth(E,A);h(q,"finish")},[L,z]=Hs({name:"MonthPicker",state:"hasFocus",controlled:x,default:v}),B=M.useCallback(A=>{z(A),b&&b(A)},[z,b]),W=M.useCallback(A=>{R(r.setMonth(E,A))||(P(A),B(!0),y&&y(A))},[R,r,E,B,y]);M.useEffect(()=>{P(A=>k!==null&&A!==k?k:A)},[k]);const U=br(A=>{switch(A.key){case"ArrowUp":W((12+I-3)%12),A.preventDefault();break;case"ArrowDown":W((12+I+3)%12),A.preventDefault();break;case"ArrowLeft":W((12+I+(C.direction==="ltr"?-1:1))%12),A.preventDefault();break;case"ArrowRight":W((12+I+(C.direction==="ltr"?1:-1))%12),A.preventDefault();break}}),N=M.useCallback((A,q)=>{W(q)},[W]),$=M.useCallback(()=>{B(!1)},[B]),D=r.getMonth(i);return w.jsx(Ant,j({ref:n,className:Ur(O.root,a),ownerState:S,onKeyDown:U},_,{children:r.getMonthArray(E).map(A=>{const q=r.getMonth(A),Y=r.format(A,"monthShort"),K=l||R(A);return w.jsx(Tnt,{value:q,selected:q===k,tabIndex:q===I&&!K?0:-1,hasFocus:L&&q===I,onSelect:T,onFocus:N,onBlur:$,disabled:K,"aria-current":D===q?"date":void 0,children:Y},Y)})}))});function Int(t,e,n){const{value:r,onError:i}=t,o=iw(),a=M.useRef(null),s=e({adapter:o,value:r,props:t});return M.useEffect(()=>{i&&!n(s,a.current)&&i(s,r),a.current=s},[n,i,a,s,r]),s}const Rue=({props:t,value:e,adapter:n})=>{const r=n.utils.date(),i=n.utils.date(e),o=Zl(n.utils,t.minDate,n.defaultDates.minDate),a=Zl(n.utils,t.maxDate,n.defaultDates.maxDate);if(i===null)return null;switch(!0){case!n.utils.isValid(e):return"invalidDate";case!!(t.shouldDisableDate&&t.shouldDisableDate(i)):return"shouldDisableDate";case!!(t.disableFuture&&n.utils.isAfterDay(i,r)):return"disableFuture";case!!(t.disablePast&&n.utils.isBeforeDay(i,r)):return"disablePast";case!!(o&&n.utils.isBeforeDay(i,o)):return"minDate";case!!(a&&n.utils.isAfterDay(i,a)):return"maxDate";default:return null}},Iue=({shouldDisableDate:t,minDate:e,maxDate:n,disableFuture:r,disablePast:i})=>{const o=iw();return M.useCallback(a=>Rue({adapter:o,value:a,props:{shouldDisableDate:t,minDate:e,maxDate:n,disableFuture:r,disablePast:i}})!==null,[o,t,e,n,r,i])},Dnt=(t,e,n)=>(r,i)=>{switch(i.type){case"changeMonth":return j({},r,{slideDirection:i.direction,currentMonth:i.newMonth,isMonthSwitchingAnimating:!t});case"finishMonthSwitchingAnimation":return j({},r,{isMonthSwitchingAnimating:!1});case"changeFocusedDay":{if(r.focusedDay!=null&&i.focusedDay!=null&&n.isSameDay(i.focusedDay,r.focusedDay))return r;const o=i.focusedDay!=null&&!e&&!n.isSameMonth(r.currentMonth,i.focusedDay);return j({},r,{focusedDay:i.focusedDay,isMonthSwitchingAnimating:o&&!t&&!i.withoutMonthSwitchingAnimation,currentMonth:o?n.startOfMonth(i.focusedDay):r.currentMonth,slideDirection:i.focusedDay!=null&&n.isAfterDay(i.focusedDay,r.currentMonth)?"left":"right"})}default:throw new Error("missing support")}},Lnt=({date:t,defaultCalendarMonth:e,disableFuture:n,disablePast:r,disableSwitchToMonthOnDayFocus:i=!1,maxDate:o,minDate:a,onMonthChange:s,reduceAnimations:l,shouldDisableDate:c})=>{var u;const f=ow(),d=wr(),h=M.useRef(Dnt(!!l,i,d)).current,[p,m]=M.useReducer(h,{isMonthSwitchingAnimating:!1,focusedDay:t||f,currentMonth:d.startOfMonth((u=t??e)!=null?u:f),slideDirection:"left"}),g=M.useCallback(_=>{m(j({type:"changeMonth"},_)),s&&s(_.newMonth)},[s]),v=M.useCallback(_=>{const S=_??f;d.isSameMonth(S,p.currentMonth)||g({newMonth:d.startOfMonth(S),direction:d.isAfterDay(S,p.currentMonth)?"left":"right"})},[p.currentMonth,g,f,d]),y=Iue({shouldDisableDate:c,minDate:a,maxDate:o,disableFuture:n,disablePast:r}),x=M.useCallback(()=>{m({type:"finishMonthSwitchingAnimation"})},[]),b=M.useCallback((_,S)=>{y(_)||m({type:"changeFocusedDay",focusedDay:_,withoutMonthSwitchingAnimation:S})},[y]);return{calendarState:p,changeMonth:v,changeFocusedDay:b,isDateDisabled:y,onMonthSwitchingAnimationEnd:x,handleChangeMonth:g}},$nt=t=>We("MuiPickersFadeTransitionGroup",t);Ve("MuiPickersFadeTransitionGroup",["root"]);const Nnt=t=>{const{classes:e}=t;return Ue({root:["root"]},$nt,e)},b9=500,Fnt=we(t5,{name:"MuiPickersFadeTransitionGroup",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"block",position:"relative"});function Due(t){const e=qe({props:t,name:"MuiPickersFadeTransitionGroup"}),{children:n,className:r,reduceAnimations:i,transKey:o}=e,a=Nnt(e);return i?n:w.jsx(Fnt,{className:Ur(a.root,r),children:w.jsx($M,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:b9,enter:b9/2,exit:0},children:n},o)})}function jnt(t){return We("MuiPickersDay",t)}const IS=Ve("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),Bnt=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDaySelect","onFocus","onBlur","onKeyDown","onMouseDown","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today"],znt=t=>{const{selected:e,disableMargin:n,disableHighlightToday:r,today:i,disabled:o,outsideCurrentMonth:a,showDaysOutsideCurrentMonth:s,classes:l}=t;return Ue({root:["root",e&&"selected",o&&"disabled",!n&&"dayWithMargin",!r&&i&&"today",a&&s&&"dayOutsideMonth",a&&!s&&"hiddenDaySpacingFiller"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},jnt,l)},Lue=({theme:t,ownerState:e})=>j({},t.typography.caption,{width:H$,height:H$,borderRadius:"50%",padding:0,backgroundColor:t.palette.background.paper,color:t.palette.text.primary,"&:hover":{backgroundColor:Wc(t.palette.action.active,t.palette.action.hoverOpacity)},"&:focus":{backgroundColor:Wc(t.palette.action.active,t.palette.action.hoverOpacity),[`&.${IS.selected}`]:{willChange:"background-color",backgroundColor:t.palette.primary.dark}},[`&.${IS.selected}`]:{color:t.palette.primary.contrastText,backgroundColor:t.palette.primary.main,fontWeight:t.typography.fontWeightMedium,transition:t.transitions.create("background-color",{duration:t.transitions.duration.short}),"&:hover":{willChange:"background-color",backgroundColor:t.palette.primary.dark}},[`&.${IS.disabled}`]:{color:t.palette.text.disabled}},!e.disableMargin&&{margin:`0 ${Tz}px`},e.outsideCurrentMonth&&e.showDaysOutsideCurrentMonth&&{color:t.palette.text.secondary},!e.disableHighlightToday&&e.today&&{[`&:not(.${IS.selected})`]:{border:`1px solid ${t.palette.text.secondary}`}}),$ue=(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disableMargin&&e.dayWithMargin,!n.disableHighlightToday&&n.today&&e.today,!n.outsideCurrentMonth&&n.showDaysOutsideCurrentMonth&&e.dayOutsideMonth,n.outsideCurrentMonth&&!n.showDaysOutsideCurrentMonth&&e.hiddenDaySpacingFiller]},Unt=we(us,{name:"MuiPickersDay",slot:"Root",overridesResolver:$ue})(Lue),Wnt=we("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:$ue})(({theme:t,ownerState:e})=>j({},Lue({theme:t,ownerState:e}),{opacity:0,pointerEvents:"none"})),yR=()=>{},Vnt=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiPickersDay"}),{autoFocus:i=!1,className:o,day:a,disabled:s=!1,disableHighlightToday:l=!1,disableMargin:c=!1,isAnimating:u,onClick:f,onDaySelect:d,onFocus:h=yR,onBlur:p=yR,onKeyDown:m=yR,onMouseDown:g,outsideCurrentMonth:v,selected:y=!1,showDaysOutsideCurrentMonth:x=!1,children:b,today:_=!1}=r,S=Ae(r,Bnt),O=j({},r,{autoFocus:i,disabled:s,disableHighlightToday:l,disableMargin:c,selected:y,showDaysOutsideCurrentMonth:x,today:_}),C=znt(O),E=wr(),k=M.useRef(null),I=Zt(k,n);Vr(()=>{i&&!s&&!u&&!v&&k.current.focus()},[i,s,u,v]);const P=T=>{g&&g(T),v&&T.preventDefault()},R=T=>{s||d(a,"finish"),v&&T.currentTarget.focus(),f&&f(T)};return v&&!x?w.jsx(Wnt,{className:Ur(C.root,C.hiddenDaySpacingFiller,o),ownerState:O,role:S.role}):w.jsx(Unt,j({className:Ur(C.root,o),ownerState:O,ref:I,centerRipple:!0,disabled:s,tabIndex:y?0:-1,onKeyDown:T=>m(T,a),onFocus:T=>h(T,a),onBlur:T=>p(T,a),onClick:R,onMouseDown:P},S,{children:b||E.format(a,"dayOfMonth")}))}),Gnt=(t,e)=>t.autoFocus===e.autoFocus&&t.isAnimating===e.isAnimating&&t.today===e.today&&t.disabled===e.disabled&&t.selected===e.selected&&t.disableMargin===e.disableMargin&&t.showDaysOutsideCurrentMonth===e.showDaysOutsideCurrentMonth&&t.disableHighlightToday===e.disableHighlightToday&&t.className===e.className&&t.sx===e.sx&&t.outsideCurrentMonth===e.outsideCurrentMonth&&t.onFocus===e.onFocus&&t.onBlur===e.onBlur&&t.onDaySelect===e.onDaySelect,Hnt=M.memo(Vnt,Gnt),qnt=t=>We("PrivatePickersSlideTransition",t),Wi=Ve("PrivatePickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),Xnt=["children","className","reduceAnimations","slideDirection","transKey"],Qnt=t=>{const{classes:e}=t;return Ue({root:["root"]},qnt,e)},Nue=350,Ynt=we(t5,{name:"PrivatePickersSlideTransition",slot:"Root",overridesResolver:(t,e)=>[e.root,{[`.${Wi["slideEnter-left"]}`]:e["slideEnter-left"]},{[`.${Wi["slideEnter-right"]}`]:e["slideEnter-right"]},{[`.${Wi.slideEnterActive}`]:e.slideEnterActive},{[`.${Wi.slideExit}`]:e.slideExit},{[`.${Wi["slideExitActiveLeft-left"]}`]:e["slideExitActiveLeft-left"]},{[`.${Wi["slideExitActiveLeft-right"]}`]:e["slideExitActiveLeft-right"]}]})(({theme:t})=>{const e=t.transitions.create("transform",{duration:Nue,easing:"cubic-bezier(0.35, 0.8, 0.4, 1)"});return{display:"block",position:"relative",overflowX:"hidden","& > *":{position:"absolute",top:0,right:0,left:0},[`& .${Wi["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${Wi["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${Wi.slideEnterActive}`]:{transform:"translate(0%)",transition:e},[`& .${Wi.slideExit}`]:{transform:"translate(0%)"},[`& .${Wi["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:e,zIndex:0},[`& .${Wi["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:e,zIndex:0}}}),Knt=t=>{const{children:e,className:n,reduceAnimations:r,slideDirection:i,transKey:o}=t,a=Ae(t,Xnt),s=Qnt(t);if(r)return w.jsx("div",{className:Ur(s.root,n),children:e});const l={exit:Wi.slideExit,enterActive:Wi.slideEnterActive,enter:Wi[`slideEnter-${i}`],exitActive:Wi[`slideExitActiveLeft-${i}`]};return w.jsx(Ynt,{className:Ur(s.root,n),childFactory:c=>M.cloneElement(c,{classNames:l}),role:"presentation",children:w.jsx(GCe,j({mountOnEnter:!0,unmountOnExit:!0,timeout:Nue,classNames:l},a,{children:e}),o)})},Znt=t=>We("MuiDayPicker",t);Ve("MuiDayPicker",["header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer"]);const Jnt=t=>{const{classes:e}=t;return Ue({header:["header"],weekDayLabel:["weekDayLabel"],loadingContainer:["loadingContainer"],slideTransition:["slideTransition"],monthContainer:["monthContainer"],weekContainer:["weekContainer"]},Znt,e)},ert=t=>t.charAt(0).toUpperCase(),Fue=(H$+Tz*2)*6,trt=we("div",{name:"MuiDayPicker",slot:"Header",overridesResolver:(t,e)=>e.header})({display:"flex",justifyContent:"center",alignItems:"center"}),nrt=we(At,{name:"MuiDayPicker",slot:"WeekDayLabel",overridesResolver:(t,e)=>e.weekDayLabel})(({theme:t})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:t.palette.text.secondary})),rrt=we("div",{name:"MuiDayPicker",slot:"LoadingContainer",overridesResolver:(t,e)=>e.loadingContainer})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:Fue}),irt=we(Knt,{name:"MuiDayPicker",slot:"SlideTransition",overridesResolver:(t,e)=>e.slideTransition})({minHeight:Fue}),ort=we("div",{name:"MuiDayPicker",slot:"MonthContainer",overridesResolver:(t,e)=>e.monthContainer})({overflow:"hidden"}),art=we("div",{name:"MuiDayPicker",slot:"WeekContainer",overridesResolver:(t,e)=>e.weekContainer})({margin:`${Tz}px 0`,display:"flex",justifyContent:"center"});function srt(t){const e=ow(),n=wr(),r=qe({props:t,name:"MuiDayPicker"}),i=Jnt(r),{onFocusedDayChange:o,className:a,currentMonth:s,selectedDays:l,disabled:c,disableHighlightToday:u,focusedDay:f,isMonthSwitchingAnimating:d,loading:h,onSelectedDaysChange:p,onMonthSwitchingAnimationEnd:m,readOnly:g,reduceAnimations:v,renderDay:y,renderLoading:x=()=>w.jsx("span",{children:"..."}),showDaysOutsideCurrentMonth:b,slideDirection:_,TransitionProps:S,disablePast:O,disableFuture:C,minDate:E,maxDate:k,shouldDisableDate:I,dayOfWeekFormatter:P=ert,hasFocus:R,onFocusedViewChange:T,gridLabelId:L}=r,z=Iue({shouldDisableDate:I,minDate:E,maxDate:k,disablePast:O,disableFuture:C}),[B,W]=M.useState(()=>f||e),U=M.useCallback(re=>{T&&T(re)},[T]),N=M.useCallback((re,ve="finish")=>{g||p(re,ve)},[p,g]),$=M.useCallback(re=>{z(re)||(o(re),W(re),U(!0))},[z,o,U]),D=Vo();function A(re,ve){switch(re.key){case"ArrowUp":$(n.addDays(ve,-7)),re.preventDefault();break;case"ArrowDown":$(n.addDays(ve,7)),re.preventDefault();break;case"ArrowLeft":{const F=n.addDays(ve,D.direction==="ltr"?-1:1),ce=D.direction==="ltr"?n.getPreviousMonth(ve):n.getNextMonth(ve),le=Qx({utils:n,date:F,minDate:D.direction==="ltr"?n.startOfMonth(ce):F,maxDate:D.direction==="ltr"?F:n.endOfMonth(ce),isDateDisabled:z});$(le||F),re.preventDefault();break}case"ArrowRight":{const F=n.addDays(ve,D.direction==="ltr"?1:-1),ce=D.direction==="ltr"?n.getNextMonth(ve):n.getPreviousMonth(ve),le=Qx({utils:n,date:F,minDate:D.direction==="ltr"?F:n.startOfMonth(ce),maxDate:D.direction==="ltr"?n.endOfMonth(ce):F,isDateDisabled:z});$(le||F),re.preventDefault();break}case"Home":$(n.startOfWeek(ve)),re.preventDefault();break;case"End":$(n.endOfWeek(ve)),re.preventDefault();break;case"PageUp":$(n.getNextMonth(ve)),re.preventDefault();break;case"PageDown":$(n.getPreviousMonth(ve)),re.preventDefault();break}}function q(re,ve){$(ve)}function Y(re,ve){R&&n.isSameDay(B,ve)&&U(!1)}const K=n.getMonth(s),se=l.filter(re=>!!re).map(re=>n.startOfDay(re)),te=K,J=M.useMemo(()=>M.createRef(),[te]),pe=n.startOfWeek(e),be=M.useMemo(()=>{const re=n.startOfMonth(s),ve=n.endOfMonth(s);return z(B)||n.isAfterDay(B,ve)||n.isBeforeDay(B,re)?Qx({utils:n,date:B,minDate:re,maxDate:ve,disablePast:O,disableFuture:C,isDateDisabled:z}):B},[s,C,O,B,z,n]);return w.jsxs("div",{role:"grid","aria-labelledby":L,children:[w.jsx(trt,{role:"row",className:i.header,children:n.getWeekdays().map((re,ve)=>{var F;return w.jsx(nrt,{variant:"caption",role:"columnheader","aria-label":n.format(n.addDays(pe,ve),"weekday"),className:i.weekDayLabel,children:(F=P==null?void 0:P(re))!=null?F:re},re+ve.toString())})}),h?w.jsx(rrt,{className:i.loadingContainer,children:x()}):w.jsx(irt,j({transKey:te,onExited:m,reduceAnimations:v,slideDirection:_,className:Ur(a,i.slideTransition)},S,{nodeRef:J,children:w.jsx(ort,{ref:J,role:"rowgroup",className:i.monthContainer,children:n.getWeekArray(s).map(re=>w.jsx(art,{role:"row",className:i.weekContainer,children:re.map(ve=>{const F=be!==null&&n.isSameDay(ve,be),ce=se.some(X=>n.isSameDay(X,ve)),le=n.isSameDay(ve,e),Q={key:ve==null?void 0:ve.toString(),day:ve,isAnimating:d,disabled:c||z(ve),autoFocus:R&&F,today:le,outsideCurrentMonth:n.getMonth(ve)!==K,selected:ce,disableHighlightToday:u,showDaysOutsideCurrentMonth:b,onKeyDown:A,onFocus:q,onBlur:Y,onDaySelect:N,tabIndex:F?0:-1,role:"gridcell","aria-selected":ce};return le&&(Q["aria-current"]="date"),y?y(ve,se,Q):M.createElement(Hnt,j({},Q,{key:Q.key}))})},`week-${re[0]}`))})}))]})}const lrt=t=>We("MuiPickersCalendarHeader",t);Ve("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]);const crt=t=>{const{classes:e}=t;return Ue({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},lrt,e)},urt=we("div",{name:"MuiPickersCalendarHeader",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",alignItems:"center",marginTop:16,marginBottom:8,paddingLeft:24,paddingRight:12,maxHeight:30,minHeight:30}),frt=we("div",{name:"MuiPickersCalendarHeader",slot:"LabelContainer",overridesResolver:(t,e)=>e.labelContainer})(({theme:t})=>j({display:"flex",maxHeight:30,overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},t.typography.body1,{fontWeight:t.typography.fontWeightMedium})),drt=we("div",{name:"MuiPickersCalendarHeader",slot:"Label",overridesResolver:(t,e)=>e.label})({marginRight:6}),hrt=we(Ot,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton",overridesResolver:(t,e)=>e.switchViewButton})({marginRight:"auto"}),prt=we(ttt,{name:"MuiPickersCalendarHeader",slot:"SwitchViewIcon",overridesResolver:(t,e)=>e.switchViewIcon})(({theme:t,ownerState:e})=>j({willChange:"transform",transition:t.transitions.create("transform"),transform:"rotate(0deg)"},e.openView==="year"&&{transform:"rotate(180deg)"})),mrt=Eue();function grt(t){const e=qe({props:t,name:"MuiPickersCalendarHeader"}),{components:n={},componentsProps:r={},currentMonth:i,disabled:o,disableFuture:a,disablePast:s,getViewSwitchingButtonText:l,leftArrowButtonText:c,maxDate:u,minDate:f,onMonthChange:d,onViewChange:h,openView:p,reduceAnimations:m,rightArrowButtonText:g,views:v,labelId:y}=e;mrt({leftArrowButtonText:c,rightArrowButtonText:g,getViewSwitchingButtonText:l});const x=yd(),b=c??x.previousMonth,_=g??x.nextMonth,S=l??x.calendarViewSwitchingButtonAriaLabel,O=wr(),C=crt(e),E=r.switchViewButton||{},k=()=>d(O.getNextMonth(i),"left"),I=()=>d(O.getPreviousMonth(i),"right"),P=dnt(i,{disableFuture:a,maxDate:u}),R=hnt(i,{disablePast:s,minDate:f}),T=()=>{if(!(v.length===1||!h||o))if(v.length===2)h(v.find(z=>z!==p)||v[0]);else{const z=v.indexOf(p)!==0?0:1;h(v[z])}};if(v.length===1&&v[0]==="year")return null;const L=e;return w.jsxs(urt,{ownerState:L,className:C.root,children:[w.jsxs(frt,{role:"presentation",onClick:T,ownerState:L,"aria-live":"polite",className:C.labelContainer,children:[w.jsx(Due,{reduceAnimations:m,transKey:O.format(i,"monthAndYear"),children:w.jsx(drt,{id:y,ownerState:L,className:C.label,children:O.format(i,"monthAndYear")})}),v.length>1&&!o&&w.jsx(hrt,j({size:"small",as:n.SwitchViewButton,"aria-label":S(p),className:C.switchViewButton},E,{children:w.jsx(prt,{as:n.SwitchViewIcon,ownerState:L,className:C.switchViewIcon})}))]}),w.jsx($M,{in:p==="day",children:w.jsx(Mue,{leftArrowButtonText:b,rightArrowButtonText:_,components:n,componentsProps:r,onLeftClick:I,onRightClick:k,isLeftDisabled:R,isRightDisabled:P})})]})}function vrt(t){return We("PrivatePickersYear",t)}const Zm=Ve("PrivatePickersYear",["root","modeDesktop","modeMobile","yearButton","selected","disabled"]),yrt=["autoFocus","className","children","disabled","onClick","onKeyDown","value","tabIndex","onFocus","onBlur"],xrt=t=>{const{wrapperVariant:e,disabled:n,selected:r,classes:i}=t,o={root:["root",e&&`mode${De(e)}`],yearButton:["yearButton",n&&"disabled",r&&"selected"]};return Ue(o,vrt,i)},brt=we("div",{name:"PrivatePickersYear",slot:"Root",overridesResolver:(t,e)=>[e.root,{[`&.${Zm.modeDesktop}`]:e.modeDesktop},{[`&.${Zm.modeMobile}`]:e.modeMobile}]})(({ownerState:t})=>j({flexBasis:"33.3%",display:"flex",alignItems:"center",justifyContent:"center"},(t==null?void 0:t.wrapperVariant)==="desktop"&&{flexBasis:"25%"})),_rt=we("button",{name:"PrivatePickersYear",slot:"Button",overridesResolver:(t,e)=>[e.button,{[`&.${Zm.disabled}`]:e.disabled},{[`&.${Zm.selected}`]:e.selected}]})(({theme:t})=>j({color:"unset",backgroundColor:"transparent",border:0,outline:0},t.typography.subtitle1,{margin:"8px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus, &:hover":{backgroundColor:Wc(t.palette.action.active,t.palette.action.hoverOpacity)},[`&.${Zm.disabled}`]:{color:t.palette.text.secondary},[`&.${Zm.selected}`]:{color:t.palette.primary.contrastText,backgroundColor:t.palette.primary.main,"&:focus, &:hover":{backgroundColor:t.palette.primary.dark}}})),_9=()=>{},wrt=M.forwardRef(function(e,n){const{autoFocus:r,className:i,children:o,disabled:a,onClick:s,onKeyDown:l,value:c,tabIndex:u,onFocus:f=_9,onBlur:d=_9}=e,h=Ae(e,yrt),p=M.useRef(null),m=Zt(p,n),g=M.useContext(xd),v=j({},e,{wrapperVariant:g}),y=xrt(v);return M.useEffect(()=>{r&&p.current.focus()},[r]),w.jsx(brt,{className:Ur(y.root,i),ownerState:v,children:w.jsx(_rt,j({ref:m,disabled:a,type:"button",tabIndex:a?-1:u,onClick:x=>s(x,c),onKeyDown:x=>l(x,c),onFocus:x=>f(x,c),onBlur:x=>d(x,c),className:y.yearButton,ownerState:v},h,{children:o}))})});function Srt(t){return We("MuiYearPicker",t)}Ve("MuiYearPicker",["root"]);const Ort=t=>{const{classes:e}=t;return Ue({root:["root"]},Srt,e)};function Crt(t,e){const n=wr(),r=C2(),i=qe({props:t,name:e});return j({disablePast:!1,disableFuture:!1},i,{minDate:Zl(n,i.minDate,r.minDate),maxDate:Zl(n,i.maxDate,r.maxDate)})}const Trt=we("div",{name:"MuiYearPicker",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexDirection:"row",flexWrap:"wrap",overflowY:"auto",height:"100%",padding:"0 4px",maxHeight:"304px"}),Ert=M.forwardRef(function(e,n){const r=ow(),i=Vo(),o=wr(),a=Crt(e,"MuiYearPicker"),{autoFocus:s,className:l,date:c,disabled:u,disableFuture:f,disablePast:d,maxDate:h,minDate:p,onChange:m,readOnly:g,shouldDisableYear:v,disableHighlightToday:y,onYearFocus:x,hasFocus:b,onFocusedViewChange:_}=a,S=a,O=Ort(S),C=M.useMemo(()=>c??o.startOfYear(r),[r,o,c]),E=M.useMemo(()=>c!=null?o.getYear(c):y?null:o.getYear(r),[r,c,o,y]),k=M.useContext(xd),I=M.useRef(null),[P,R]=M.useState(()=>E||o.getYear(r)),[T,L]=Hs({name:"YearPicker",state:"hasFocus",controlled:b,default:s}),z=M.useCallback(se=>{L(se),_&&_(se)},[L,_]),B=M.useCallback(se=>!!(d&&o.isBeforeYear(se,r)||f&&o.isAfterYear(se,r)||p&&o.isBeforeYear(se,p)||h&&o.isAfterYear(se,h)||v&&v(se)),[f,d,h,p,r,v,o]),W=(se,te,J="finish")=>{if(g)return;const pe=o.setYear(C,te);m(pe,J)},U=M.useCallback(se=>{B(o.setYear(C,se))||(R(se),z(!0),x==null||x(se))},[B,o,C,z,x]);M.useEffect(()=>{R(se=>E!==null&&se!==E?E:se)},[E]);const N=k==="desktop"?4:3,$=M.useCallback((se,te)=>{switch(se.key){case"ArrowUp":U(te-N),se.preventDefault();break;case"ArrowDown":U(te+N),se.preventDefault();break;case"ArrowLeft":U(te+(i.direction==="ltr"?-1:1)),se.preventDefault();break;case"ArrowRight":U(te+(i.direction==="ltr"?1:-1)),se.preventDefault();break}},[U,i.direction,N]),D=M.useCallback((se,te)=>{U(te)},[U]),A=M.useCallback((se,te)=>{P===te&&z(!1)},[P,z]),q=o.getYear(r),Y=M.useRef(null),K=Zt(n,Y);return M.useEffect(()=>{if(s||Y.current===null)return;const se=Y.current.querySelector('[tabindex="0"]');if(!se)return;const te=se.offsetHeight,J=se.offsetTop,pe=Y.current.clientHeight,be=Y.current.scrollTop,re=J+te;te>pe||J{const te=o.getYear(se),J=te===E;return w.jsx(wrt,{selected:J,value:te,onClick:W,onKeyDown:$,autoFocus:T&&te===P,ref:J?I:void 0,disabled:u||B(se),tabIndex:te===P?0:-1,onFocus:D,onBlur:A,"aria-current":q===te?"date":void 0,children:o.format(se,"year")},o.format(se,"year"))})})}),Prt=typeof navigator<"u"&&/(android)/i.test(navigator.userAgent),Mrt=t=>We("MuiCalendarPicker",t);Ve("MuiCalendarPicker",["root","viewTransitionContainer"]);const krt=["autoFocus","onViewChange","date","disableFuture","disablePast","defaultCalendarMonth","onChange","onYearChange","onMonthChange","reduceAnimations","shouldDisableDate","shouldDisableMonth","shouldDisableYear","view","views","openTo","className","disabled","readOnly","minDate","maxDate","disableHighlightToday","focusedView","onFocusedViewChange","classes"],Art=t=>{const{classes:e}=t;return Ue({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},Mrt,e)};function Rrt(t,e){const n=wr(),r=C2(),i=qe({props:t,name:e});return j({loading:!1,disablePast:!1,disableFuture:!1,openTo:"day",views:["year","day"],reduceAnimations:Prt,renderLoading:()=>w.jsx("span",{children:"..."})},i,{minDate:Zl(n,i.minDate,r.minDate),maxDate:Zl(n,i.maxDate,r.maxDate)})}const Irt=we(Ez,{name:"MuiCalendarPicker",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexDirection:"column"}),Drt=we(Due,{name:"MuiCalendarPicker",slot:"ViewTransitionContainer",overridesResolver:(t,e)=>e.viewTransitionContainer})({}),Lrt=M.forwardRef(function(e,n){const r=wr(),i=cd(),o=Rrt(e,"MuiCalendarPicker"),{autoFocus:a,onViewChange:s,date:l,disableFuture:c,disablePast:u,defaultCalendarMonth:f,onChange:d,onYearChange:h,onMonthChange:p,reduceAnimations:m,shouldDisableDate:g,shouldDisableMonth:v,shouldDisableYear:y,view:x,views:b,openTo:_,className:S,disabled:O,readOnly:C,minDate:E,maxDate:k,disableHighlightToday:I,focusedView:P,onFocusedViewChange:R}=o,T=Ae(o,krt),{openView:L,setOpenView:z,openNext:B}=Cz({view:x,views:b,openTo:_,onChange:d,onViewChange:s}),{calendarState:W,changeFocusedDay:U,changeMonth:N,handleChangeMonth:$,isDateDisabled:D,onMonthSwitchingAnimationEnd:A}=Lnt({date:l,defaultCalendarMonth:f,reduceAnimations:m,onMonthChange:p,minDate:E,maxDate:k,shouldDisableDate:g,disablePast:u,disableFuture:c}),q=M.useCallback((ee,ge)=>{const ye=r.startOfMonth(ee),H=r.endOfMonth(ee),G=D(ee)?Qx({utils:r,date:ee,minDate:r.isBefore(E,ye)?ye:E,maxDate:r.isAfter(k,H)?H:k,disablePast:u,disableFuture:c,isDateDisabled:D}):ee;G?(d(G,ge),p==null||p(ye)):(B(),N(ye)),U(G,!0)},[U,c,u,D,k,E,d,p,N,B,r]),Y=M.useCallback((ee,ge)=>{const ye=r.startOfYear(ee),H=r.endOfYear(ee),G=D(ee)?Qx({utils:r,date:ee,minDate:r.isBefore(E,ye)?ye:E,maxDate:r.isAfter(k,H)?H:k,disablePast:u,disableFuture:c,isDateDisabled:D}):ee;G?(d(G,ge),h==null||h(G)):(B(),N(ye)),U(G,!0)},[U,c,u,D,k,E,d,h,B,r,N]),K=M.useCallback((ee,ge)=>d(l&&ee?r.mergeDateAndTime(ee,l):ee,ge),[r,l,d]);M.useEffect(()=>{l&&N(l)},[l]);const se=o,te=Art(se),J={disablePast:u,disableFuture:c,maxDate:k,minDate:E},pe=O&&l||E,be=O&&l||k,re={disableHighlightToday:I,readOnly:C,disabled:O},ve=`${i}-grid-label`,[F,ce]=Hs({name:"DayPicker",state:"focusedView",controlled:P,default:a?L:null}),le=F!==null,Q=br(ee=>ge=>{if(R){R(ee)(ge);return}ce(ge?ee:ye=>ye===ee?null:ye)}),X=M.useRef(L);return M.useEffect(()=>{X.current!==L&&(X.current=L,Q(L)(!0))},[L,Q]),w.jsxs(Irt,{ref:n,className:Ur(te.root,S),ownerState:se,children:[w.jsx(grt,j({},T,{views:b,openView:L,currentMonth:W.currentMonth,onViewChange:z,onMonthChange:(ee,ge)=>$({newMonth:ee,direction:ge}),minDate:pe,maxDate:be,disabled:O,disablePast:u,disableFuture:c,reduceAnimations:m,labelId:ve})),w.jsx(Drt,{reduceAnimations:m,className:te.viewTransitionContainer,transKey:L,ownerState:se,children:w.jsxs("div",{children:[L==="year"&&w.jsx(Ert,j({},T,J,re,{autoFocus:a,date:l,onChange:Y,shouldDisableYear:y,hasFocus:le,onFocusedViewChange:Q("year")})),L==="month"&&w.jsx(Rnt,j({},J,re,{autoFocus:a,hasFocus:le,className:S,date:l,onChange:q,shouldDisableMonth:v,onFocusedViewChange:Q("month")})),L==="day"&&w.jsx(srt,j({},T,W,J,re,{autoFocus:a,onMonthSwitchingAnimationEnd:A,onFocusedDayChange:U,reduceAnimations:m,selectedDays:[l],onSelectedDaysChange:K,shouldDisableDate:g,hasFocus:le,onFocusedViewChange:Q("day"),gridLabelId:ve}))]})})]})}),$rt=t=>{const[,e]=M.useReducer(l=>l+1,0),n=M.useRef(null),{replace:r,append:i}=t,o=r?r(t.format(t.value)):t.format(t.value),a=M.useRef(!1),s=l=>{const c=l.target.value;n.current=[c,l.target,c.length>o.length,a.current,o===t.format(c)],e()};return M.useLayoutEffect(()=>{if(n.current==null)return;let[l,c,u,f,d]=n.current;n.current=null;const h=f&&d,m=l.slice(c.selectionStart).search(t.accept||/\d/g),g=m!==-1?m:0,v=S=>(S.match(t.accept||/\d/g)||[]).join(""),y=v(l.substr(0,c.selectionStart)),x=S=>{let O=0,C=0;for(let E=0;E!==y.length;++E){let k=S.indexOf(y[E],O)+1,I=v(S).indexOf(y[E],C)+1;I-C>1&&(k=O,I=C),C=Math.max(I,C),O=Math.max(O,k)}return O};if(t.mask===!0&&u&&!d){let S=x(l);const O=v(l.substr(S))[0];S=l.indexOf(O,S),l=`${l.substr(0,S)}${l.substr(S+1)}`}let b=t.format(l);i!=null&&c.selectionStart===l.length&&!d&&(u?b=i(b):v(b.slice(-1))===""&&(b=b.slice(0,-1)));const _=r?r(b):b;return o===_?e():t.onChange(_),()=>{let S=x(b);if(t.mask!=null&&(u||f&&!h))for(;b[S]&&v(b[S])==="";)S+=1;c.selectionStart=c.selectionEnd=S+(h?1+g:0)}}),M.useEffect(()=>{const l=u=>{u.code==="Delete"&&(a.current=!0)},c=u=>{u.code==="Delete"&&(a.current=!1)};return document.addEventListener("keydown",l),document.addEventListener("keyup",c),()=>{document.removeEventListener("keydown",l),document.removeEventListener("keyup",c)}},[]),{value:n.current!=null?n.current[0]:o,onChange:s}},q$=(t,e,n)=>{const r=t.date(e);return e===null?"":t.isValid(r)?t.formatByString(r,n):""},oE="_",jue="2019-11-21T22:30:00.000",Bue="2019-01-01T09:00:00.000";function Nrt(t,e,n,r){if(t)return t;const o=r.formatByString(r.date(Bue),e).replace(n,oE),a=r.formatByString(r.date(jue),e).replace(n,"_");return o===a?o:""}function Frt(t,e,n,r){if(!t)return!1;const o=r.formatByString(r.date(Bue),e).replace(n,oE),a=r.formatByString(r.date(jue),e).replace(n,"_"),s=a===o&&t===a;return!s&&r.lib,s}const jrt=(t,e)=>n=>{let r=0;return n.split("").map((i,o)=>{if(e.lastIndex=0,r>t.length-1)return"";const a=t[r],s=t[r+1],l=e.test(i)?i:"",c=a===oE?l:a+l;return r+=c.length,o===n.length-1&&s&&s!==oE?c?c+s:"":c}).join("")},Brt=({acceptRegex:t=/[\d]/gi,disabled:e,disableMaskedInput:n,ignoreInvalidInputs:r,inputFormat:i,inputProps:o,label:a,mask:s,onChange:l,rawValue:c,readOnly:u,rifmFormatter:f,TextFieldProps:d,validationError:h})=>{const p=wr(),m=p.getFormatHelperText(i),{shouldUseMaskedInput:g,maskToUse:v}=M.useMemo(()=>{if(n)return{shouldUseMaskedInput:!1,maskToUse:""};const T=Nrt(s,i,t,p);return{shouldUseMaskedInput:Frt(T,i,t,p),maskToUse:T}},[t,n,i,s,p]),y=M.useMemo(()=>g&&v?jrt(v,t):T=>T,[t,v,g]),x=c===null?null:p.date(c),[b,_]=M.useState(x),[S,O]=M.useState(q$(p,c,i)),C=M.useRef(),E=M.useRef(p.locale),k=M.useRef(i);M.useEffect(()=>{const T=c!==C.current,L=p.locale!==E.current,z=i!==k.current;if(C.current=c,E.current=p.locale,k.current=i,!T&&!L&&!z)return;const B=c===null?null:p.date(c),W=c===null||p.isValid(B);let U=b===null&&B===null;if(b!==null&&B!==null){const $=p.isEqual(b,B);if($)U=!0;else{const D=Math.abs(p.getDiff(b,B));U=D===0?$:D<1e3}}if(!L&&!z&&(!W||U))return;const N=q$(p,c,i);_(B),O(N)},[p,c,i,b]);const I=T=>{const L=T===""||T===s?"":T;O(L);const z=L===null?null:p.parse(L,i);r&&!p.isValid(z)||(_(z),l(z,L||void 0))},P=$rt({value:S,onChange:I,format:f||y});return j({label:a,disabled:e,error:h,inputProps:j({},g?P:{value:S,onChange:T=>{I(T.currentTarget.value)}},{disabled:e,placeholder:m,readOnly:u,type:g?"tel":"text"},o)},d)},zrt=["className","components","disableOpenPicker","getOpenDialogAriaText","InputAdornmentProps","InputProps","inputRef","openPicker","OpenPickerButtonProps","renderInput"],zue=M.forwardRef(function(e,n){const{className:r,components:i={},disableOpenPicker:o,getOpenDialogAriaText:a,InputAdornmentProps:s,InputProps:l,inputRef:c,openPicker:u,OpenPickerButtonProps:f,renderInput:d}=e,h=Ae(e,zrt),p=yd(),m=a??p.openDatePickerDialogue,g=wr(),v=Brt(h),y=(s==null?void 0:s.position)||"end",x=i.OpenPickerIcon||vue;return d(j({ref:n,inputRef:c,className:r},v,{InputProps:j({},l,{[`${y}Adornment`]:o?void 0:w.jsx(_Re,j({position:y},s,{children:w.jsx(Ot,j({edge:y,disabled:h.disabled||h.readOnly,"aria-label":m(h.rawValue,g)},f,{onClick:u,children:w.jsx(x,{})}))}))})}))});function w9(){return typeof window>"u"?"portrait":window.screen&&window.screen.orientation&&window.screen.orientation.angle?Math.abs(window.screen.orientation.angle)===90?"landscape":"portrait":window.orientation&&Math.abs(Number(window.orientation))===90?"landscape":"portrait"}const Urt=(t,e)=>{const[n,r]=M.useState(w9);return Vr(()=>{const o=()=>{r(w9())};return window.addEventListener("orientationchange",o),()=>{window.removeEventListener("orientationchange",o)}},[]),wue(t,["hours","minutes","seconds"])?!1:(e||n)==="landscape"},Wrt=({autoFocus:t,openView:e})=>{const[n,r]=M.useState(t?e:null),i=M.useCallback(o=>a=>{r(a?o:s=>o===s?null:s)},[]);return{focusedView:n,setFocusedView:i}};function Vrt(t){return We("MuiCalendarOrClockPicker",t)}Ve("MuiCalendarOrClockPicker",["root","mobileKeyboardInputView"]);const Grt=["autoFocus","className","parsedValue","DateInputProps","isMobileKeyboardViewOpen","onDateChange","onViewChange","openTo","orientation","showToolbar","toggleMobileKeyboardView","ToolbarComponent","toolbarFormat","toolbarPlaceholder","toolbarTitle","views","dateRangeIcon","timeIcon","hideTabs","classes"],Hrt=t=>{const{classes:e}=t;return Ue({root:["root"],mobileKeyboardInputView:["mobileKeyboardInputView"]},Vrt,e)},qrt=we("div",{name:"MuiCalendarOrClockPicker",slot:"MobileKeyboardInputView",overridesResolver:(t,e)=>e.mobileKeyboardInputView})({padding:"16px 24px"}),Xrt=we("div",{name:"MuiCalendarOrClockPicker",slot:"Root",overridesResolver:(t,e)=>e.root})(({ownerState:t})=>j({display:"flex",flexDirection:"column"},t.isLandscape&&{flexDirection:"row"})),Qrt={fullWidth:!0},S9=t=>t==="year"||t==="month"||t==="day",O9=t=>t==="hours"||t==="minutes"||t==="seconds";function Uue(t){var e,n;const r=qe({props:t,name:"MuiCalendarOrClockPicker"}),{autoFocus:i,parsedValue:o,DateInputProps:a,isMobileKeyboardViewOpen:s,onDateChange:l,onViewChange:c,openTo:u,orientation:f,showToolbar:d,toggleMobileKeyboardView:h,ToolbarComponent:p=()=>null,toolbarFormat:m,toolbarPlaceholder:g,toolbarTitle:v,views:y,dateRangeIcon:x,timeIcon:b,hideTabs:_}=r,S=Ae(r,Grt),O=(e=S.components)==null?void 0:e.Tabs,C=Urt(y,f),E=M.useContext(xd),k=Hrt(r),I=d??E!=="desktop",P=!_&&typeof window<"u"&&window.innerHeight>667,R=M.useCallback((N,$)=>{l(N,E,$)},[l,E]),T=M.useCallback(N=>{s&&h(),c&&c(N)},[s,c,h]),{openView:L,setOpenView:z,handleChangeAndOpenNext:B}=Cz({view:void 0,views:y,openTo:u,onChange:R,onViewChange:T}),{focusedView:W,setFocusedView:U}=Wrt({autoFocus:i,openView:L});return w.jsxs(Xrt,{ownerState:{isLandscape:C},className:k.root,children:[I&&w.jsx(p,j({},S,{views:y,isLandscape:C,parsedValue:o,onChange:R,setOpenView:z,openView:L,toolbarTitle:v,toolbarFormat:m,toolbarPlaceholder:g,isMobileKeyboardViewOpen:s,toggleMobileKeyboardView:h})),P&&!!O&&w.jsx(O,j({dateRangeIcon:x,timeIcon:b,view:L,onChange:z},(n=S.componentsProps)==null?void 0:n.tabs)),w.jsx(Ez,{children:s?w.jsx(qrt,{className:k.mobileKeyboardInputView,children:w.jsx(zue,j({},a,{ignoreInvalidInputs:!0,disableOpenPicker:!0,TextFieldProps:Qrt}))}):w.jsxs(M.Fragment,{children:[S9(L)&&w.jsx(Lrt,j({autoFocus:i,date:o,onViewChange:z,onChange:B,view:L,views:y.filter(S9),focusedView:W,onFocusedViewChange:U},S)),O9(L)&&w.jsx(_nt,j({},S,{autoFocus:i,date:o,view:L,views:y.filter(O9),onChange:B,onViewChange:z,showViewSwitcher:E==="desktop"}))]})})]})}const Yrt=({adapter:t,value:e,props:n})=>{const{minTime:r,maxTime:i,minutesStep:o,shouldDisableTime:a,disableIgnoringDatePartForTimeValidation:s}=n,l=t.utils.date(e),c=kue(s,t.utils);if(e===null)return null;switch(!0){case!t.utils.isValid(e):return"invalidDate";case!!(r&&c(r,l)):return"minTime";case!!(i&&c(l,i)):return"maxTime";case!!(a&&a(t.utils.getHours(l),"hours")):return"shouldDisableTime-hours";case!!(a&&a(t.utils.getMinutes(l),"minutes")):return"shouldDisableTime-minutes";case!!(a&&a(t.utils.getSeconds(l),"seconds")):return"shouldDisableTime-seconds";case!!(o&&t.utils.getMinutes(l)%o!==0):return"minutesStep";default:return null}},Krt=["minDate","maxDate","disableFuture","shouldDisableDate","disablePast"],Zrt=({props:t,value:e,adapter:n})=>{const{minDate:r,maxDate:i,disableFuture:o,shouldDisableDate:a,disablePast:s}=t,l=Ae(t,Krt),c=Rue({adapter:n,value:e,props:{minDate:r,maxDate:i,disableFuture:o,shouldDisableDate:a,disablePast:s}});return c!==null?c:Yrt({adapter:n,value:e,props:l})},Jrt=(t,e)=>t===e;function Wue(t){return Int(t,Zrt,Jrt)}const eit=({open:t,onOpen:e,onClose:n})=>{const r=M.useRef(typeof t=="boolean").current,[i,o]=M.useState(!1);M.useEffect(()=>{if(r){if(typeof t!="boolean")throw new Error("You must not mix controlling and uncontrolled mode for `open` prop");o(t)}},[r,t]);const a=M.useCallback(s=>{r||o(s),s&&e&&e(),!s&&n&&n()},[r,e,n]);return{isOpen:i,setIsOpen:a}},Vue=(t,e)=>{const{onAccept:n,onChange:r,value:i,closeOnSelect:o}=t,a=wr(),{isOpen:s,setIsOpen:l}=eit(t),c=M.useMemo(()=>e.parseInput(a,i),[e,a,i]),[u,f]=M.useState(c),[d,h]=M.useState(()=>({committed:c,draft:c,resetFallback:c})),p=M.useCallback(S=>{h(O=>{switch(S.action){case"setAll":case"acceptAndClose":return{draft:S.value,committed:S.value,resetFallback:S.value};case"setCommitted":return j({},O,{draft:S.value,committed:S.value});case"setDraft":return j({},O,{draft:S.value});default:return O}}),(S.forceOnChangeCall||!S.skipOnChangeCall&&!e.areValuesEqual(a,d.committed,S.value))&&r(S.value),S.action==="acceptAndClose"&&(l(!1),n&&!e.areValuesEqual(a,d.resetFallback,S.value)&&n(S.value))},[n,r,l,d,a,e]);M.useEffect(()=>{a.isValid(c)&&f(c)},[a,c]),M.useEffect(()=>{s&&p({action:"setAll",value:c,skipOnChangeCall:!0})},[s]),e.areValuesEqual(a,d.committed,c)||p({action:"setCommitted",value:c,skipOnChangeCall:!0});const m=M.useMemo(()=>({open:s,onClear:()=>{p({value:e.emptyValue,action:"acceptAndClose",forceOnChangeCall:!e.areValuesEqual(a,i,e.emptyValue)})},onAccept:()=>{p({value:d.draft,action:"acceptAndClose",forceOnChangeCall:!e.areValuesEqual(a,i,c)})},onDismiss:()=>{p({value:d.committed,action:"acceptAndClose"})},onCancel:()=>{p({value:d.resetFallback,action:"acceptAndClose"})},onSetToday:()=>{p({value:e.getTodayValue(a),action:"acceptAndClose"})}}),[p,s,a,d,e,i,c]),[g,v]=M.useState(!1),y=M.useMemo(()=>({parsedValue:d.draft,isMobileKeyboardViewOpen:g,toggleMobileKeyboardView:()=>v(!g),onDateChange:(S,O,C="partial")=>{switch(C){case"shallow":return p({action:"setDraft",value:S,skipOnChangeCall:!0});case"partial":return p({action:"setDraft",value:S});case"finish":return p(o??O==="desktop"?{value:S,action:"acceptAndClose"}:{value:S,action:"setCommitted"});default:throw new Error("MUI: Invalid selectionState passed to `onDateChange`")}}}),[p,g,d.draft,o]),x=M.useCallback((S,O)=>{const C=e.valueReducer?e.valueReducer(a,u,S):S;r(C,O)},[r,e,u,a]),b=M.useMemo(()=>({onChange:x,open:s,rawValue:i,openPicker:()=>l(!0)}),[x,s,i,l]),_={pickerProps:y,inputProps:b,wrapperProps:m};return M.useDebugValue(_,()=>({MuiPickerState:{dateState:d,other:_}})),_};function tit(t){return We("MuiDateTimePickerTabs",t)}Ve("MuiDateTimePickerTabs",["root"]);const nit=t=>["day","month","year"].includes(t)?"date":"time",rit=t=>t==="date"?"day":"hours",iit=t=>{const{classes:e}=t;return Ue({root:["root"]},tit,e)},oit=we(x5,{name:"MuiDateTimePickerTabs",slot:"Root",overridesResolver:(t,e)=>e.root})(({ownerState:t,theme:e})=>j({boxShadow:`0 -1px 0 0 inset ${e.palette.divider}`},t.wrapperVariant==="desktop"&&{order:1,boxShadow:`0 1px 0 0 inset ${e.palette.divider}`,[`& .${SC.indicator}`]:{bottom:"auto",top:0}})),Gue=function(e){const n=qe({props:e,name:"MuiDateTimePickerTabs"}),{dateRangeIcon:r=w.jsx(ott,{}),onChange:i,timeIcon:o=w.jsx(stt,{}),view:a}=n,s=yd(),l=M.useContext(xd),c=j({},n,{wrapperVariant:l}),u=iit(c),f=(d,h)=>{i(rit(h))};return w.jsxs(oit,{ownerState:c,variant:"fullWidth",value:nit(a),onChange:f,className:u.root,children:[w.jsx(Ib,{value:"date","aria-label":s.dateTableLabel,icon:w.jsx(M.Fragment,{children:r})}),w.jsx(Ib,{value:"time","aria-label":s.timeTableLabel,icon:w.jsx(M.Fragment,{children:o})})]})},ait=["onChange","PaperProps","PopperProps","ToolbarComponent","TransitionComponent","value","components","componentsProps","hideTabs"],sit=M.forwardRef(function(e,n){const r=hue(e,"MuiDesktopDateTimePicker"),i=Wue(r)!==null,{pickerProps:o,inputProps:a,wrapperProps:s}=Vue(r,pue),{PaperProps:l,PopperProps:c,ToolbarComponent:u=bue,TransitionComponent:f,components:d,componentsProps:h,hideTabs:p=!0}=r,m=Ae(r,ait),g=M.useMemo(()=>j({Tabs:Gue},d),[d]),v=j({},a,m,{components:g,componentsProps:h,ref:n,validationError:i});return w.jsx(Rtt,j({},s,{DateInputProps:v,KeyboardDateInputComponent:zue,PopperProps:c,PaperProps:l,TransitionComponent:f,components:g,componentsProps:h,children:w.jsx(Uue,j({},o,{autoFocus:!0,toolbarTitle:r.label||r.toolbarTitle,ToolbarComponent:u,DateInputProps:v,components:g,componentsProps:h,hideTabs:p},m))}))}),lit=we(el)({[`& .${Nx.container}`]:{outline:0},[`& .${Nx.paper}`]:{outline:0,minWidth:Aue}}),cit=we(qs)({"&:first-of-type":{padding:0}}),uit=t=>{var e;const{children:n,DialogProps:r={},onAccept:i,onClear:o,onDismiss:a,onCancel:s,onSetToday:l,open:c,components:u,componentsProps:f}=t,d=(e=u==null?void 0:u.ActionBar)!=null?e:_ue;return w.jsxs(lit,j({open:c,onClose:a},r,{children:[w.jsx(cit,{children:n}),w.jsx(d,j({onAccept:i,onClear:o,onCancel:s,onSetToday:l,actions:["cancel","accept"]},f==null?void 0:f.actionBar))]}))},fit=["children","DateInputProps","DialogProps","onAccept","onClear","onDismiss","onCancel","onSetToday","open","PureDateInputComponent","components","componentsProps"];function dit(t){const{children:e,DateInputProps:n,DialogProps:r,onAccept:i,onClear:o,onDismiss:a,onCancel:s,onSetToday:l,open:c,PureDateInputComponent:u,components:f,componentsProps:d}=t,h=Ae(t,fit);return w.jsxs(xd.Provider,{value:"mobile",children:[w.jsx(u,j({components:f},h,n)),w.jsx(uit,{DialogProps:r,onAccept:i,onClear:o,onDismiss:a,onCancel:s,onSetToday:l,open:c,components:f,componentsProps:d,children:e})]})}const hit=M.forwardRef(function(e,n){const{disabled:r,getOpenDialogAriaText:i,inputFormat:o,InputProps:a,inputRef:s,label:l,openPicker:c,rawValue:u,renderInput:f,TextFieldProps:d={},validationError:h,className:p}=e,m=yd(),g=i??m.openDatePickerDialogue,v=wr(),y=M.useMemo(()=>j({},a,{readOnly:!0}),[a]),x=q$(v,u,o),b=br(_=>{_.stopPropagation(),c()});return f(j({label:l,disabled:r,ref:n,inputRef:s,error:h,InputProps:y,className:p},!e.readOnly&&!e.disabled&&{onClick:b},{inputProps:j({disabled:r,readOnly:!0,"aria-readonly":!0,"aria-label":g(u,v),value:x},!e.readOnly&&{onClick:b},{onKeyDown:Sue(c)})},d))}),pit=["ToolbarComponent","value","onChange","components","componentsProps","hideTabs"],mit=M.forwardRef(function(e,n){const r=hue(e,"MuiMobileDateTimePicker"),i=Wue(r)!==null,{pickerProps:o,inputProps:a,wrapperProps:s}=Vue(r,pue),{ToolbarComponent:l=bue,components:c,componentsProps:u,hideTabs:f=!1}=r,d=Ae(r,pit),h=M.useMemo(()=>j({Tabs:Gue},c),[c]),p=j({},a,d,{components:h,componentsProps:u,ref:n,validationError:i});return w.jsx(dit,j({},d,s,{DateInputProps:p,PureDateInputComponent:hit,components:h,componentsProps:u,children:w.jsx(Uue,j({},o,{autoFocus:!0,toolbarTitle:r.label||r.toolbarTitle,ToolbarComponent:l,DateInputProps:p,components:h,componentsProps:u,hideTabs:f},d))}))}),git=["desktopModeMediaQuery","DialogProps","PopperProps","TransitionComponent"],vit=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiDateTimePicker"}),{desktopModeMediaQuery:i="@media (pointer: fine)",DialogProps:o,PopperProps:a,TransitionComponent:s}=r,l=Ae(r,git);return GSe(i,{defaultMatches:!0})?w.jsx(sit,j({ref:n,PopperProps:a,TransitionComponent:s},l)):w.jsx(mit,j({ref:n,DialogProps:o},l))}),yit=t=>({dateTimePicker:{marginTop:t.spacing(2.5)}}),xit=({classes:t,hasTimeDimension:e,selectedTime:n,selectedTimeRange:r,selectTime:i})=>{const o=d=>{i(d!==null?Z8e(d):null)},a=w.jsx(Kv,{shrink:!0,htmlFor:"time-select",children:`${fe.get("Time")} (UTC)`}),l=typeof n=="number"?qA(n):null;let c,u;Array.isArray(r)&&(c=qA(r[0]),u=qA(r[1]));const f=w.jsx(Wet,{dateAdapter:Xet,children:w.jsx(vit,{disabled:!e,className:t.dateTimePicker,inputFormat:"yyyy-MM-dd hh:mm:ss",value:l,minDateTime:c,maxDateTime:u,onChange:o,ampm:!1,renderInput:d=>w.jsx(lr,{...d,variant:"standard",size:"small"})})});return w.jsx(qb,{label:a,control:f})},bit=Bet(yit)(xit),_it=t=>({locale:t.controlState.locale,hasTimeDimension:!!yy(t),selectedTime:t.controlState.selectedTime,selectedTimeRange:t.controlState.selectedTimeRange}),wit={selectTime:y2},Sit=Jt(_it,wit)(bit),C9=5,Oit={box:t=>({marginTop:t.spacing(1),marginLeft:t.spacing(C9),marginRight:t.spacing(C9),minWidth:200}),label:{color:"grey",fontSize:"1em"}};function Cit({hasTimeDimension:t,selectedTime:e,selectTime:n,selectedTimeRange:r}){const[i,o]=M.useState(e);if(M.useEffect(()=>{o(e||(r?r[0]:0))},[e,r]),!t)return null;const a=(f,d)=>{typeof d=="number"&&o(d)},s=(f,d)=>{n&&typeof d=="number"&&n(d)},l=Array.isArray(r);l||(r=[Date.now()-2*$ae.years,Date.now()]);const c=[{value:r[0],label:Gb(r[0])},{value:r[1],label:Gb(r[1])}];function u(f){return dy(f)}return w.jsx(Ke,{sx:Oit.box,children:w.jsx(_t,{arrow:!0,title:fe.get("Select time in dataset"),children:w.jsx(Zv,{disabled:!l,min:r[0],max:r[1],value:i||0,valueLabelDisplay:"off",valueLabelFormat:u,marks:c,onChange:a,onChangeCommitted:s,size:"small"})})})}const Tit=t=>({locale:t.controlState.locale,hasTimeDimension:!!yy(t),selectedTime:t.controlState.selectedTime,selectedTimeRange:t.controlState.selectedTimeRange}),Eit={selectTime:y2,selectTimeRange:Ele},Pit=Jt(Tit,Eit)(Cit);var Pz={},Mit=ct;Object.defineProperty(Pz,"__esModule",{value:!0});var Hue=Pz.default=void 0,kit=Mit(pt()),Ait=w;Hue=Pz.default=(0,kit.default)((0,Ait.jsx)("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft");var Mz={},Rit=ct;Object.defineProperty(Mz,"__esModule",{value:!0});var que=Mz.default=void 0,Iit=Rit(pt()),Dit=w;que=Mz.default=(0,Iit.default)((0,Dit.jsx)("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight");var kz={},Lit=ct;Object.defineProperty(kz,"__esModule",{value:!0});var Xue=kz.default=void 0,$it=Lit(pt()),Nit=w;Xue=kz.default=(0,$it.default)((0,Nit.jsx)("path",{d:"M18.41 16.59 13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),"FirstPage");var Az={},Fit=ct;Object.defineProperty(Az,"__esModule",{value:!0});var Que=Az.default=void 0,jit=Fit(pt()),Bit=w;Que=Az.default=(0,jit.default)((0,Bit.jsx)("path",{d:"M5.59 7.41 10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),"LastPage");var Rz={},zit=ct;Object.defineProperty(Rz,"__esModule",{value:!0});var Yue=Rz.default=void 0,Uit=zit(pt()),Wit=w;Yue=Rz.default=(0,Uit.default)((0,Wit.jsx)("path",{d:"M9 16h2V8H9zm3-14C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m1-4h2V8h-2z"}),"PauseCircleOutline");var Iz={},Vit=ct;Object.defineProperty(Iz,"__esModule",{value:!0});var Kue=Iz.default=void 0,Git=Vit(pt()),Hit=w;Kue=Iz.default=(0,Git.default)((0,Hit.jsx)("path",{d:"m10 16.5 6-4.5-6-4.5zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"PlayCircleOutline");const im={formControl:t=>({marginTop:t.spacing(2.5),marginLeft:t.spacing(1),marginRight:t.spacing(1)}),iconButton:{padding:"2px"}};function qit({timeAnimationActive:t,timeAnimationInterval:e,updateTimeAnimation:n,selectedTime:r,selectedTimeRange:i,selectTime:o,incSelectedTime:a}){const s=M.useRef(null);M.useEffect(()=>(p(),g));const l=()=>{a(1)},c=()=>{n(!t,e)},u=()=>{a(1)},f=()=>{a(-1)},d=()=>{o(i?i[0]:null)},h=()=>{o(i?i[1]:null)},p=()=>{t?m():g()},m=()=>{g(),s.current=window.setInterval(l,e)},g=()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},v=typeof r=="number",y=t?w.jsx(Yue,{}):w.jsx(Kue,{}),x=w.jsx(Ot,{disabled:!v,onClick:c,size:"small",sx:im.iconButton,children:w.jsx(_t,{arrow:!0,title:fe.get("Auto-step through times in the dataset"),children:y})}),b=w.jsx(Ot,{disabled:!v||t,onClick:d,size:"small",sx:im.iconButton,children:w.jsx(Xue,{})}),_=w.jsx(Ot,{disabled:!v||t,onClick:f,size:"small",sx:im.iconButton,children:w.jsx(Hue,{})}),S=w.jsx(Ot,{disabled:!v||t,onClick:u,size:"small",sx:im.iconButton,children:w.jsx(que,{})}),O=w.jsx(Ot,{disabled:!v||t,onClick:h,size:"small",sx:im.iconButton,children:w.jsx(Que,{})});return w.jsx(Yv,{sx:im.formControl,variant:"standard",children:w.jsxs(Ke,{children:[b,_,x,S,O]})})}const Xit=t=>({locale:t.controlState.locale,selectedTime:t.controlState.selectedTime,selectedTimeRange:t.controlState.selectedTimeRange,timeAnimationActive:t.controlState.timeAnimationActive,timeAnimationInterval:t.controlState.timeAnimationInterval}),Qit={selectTime:y2,incSelectedTime:A7e,updateTimeAnimation:I7e},Yit=Jt(Xit,Qit)(qit);var Dz={},Kit=ct;Object.defineProperty(Dz,"__esModule",{value:!0});var Zue=Dz.default=void 0,Zit=Kit(pt()),Jit=w;Zue=Dz.default=(0,Zit.default)((0,Jit.jsx)("path",{d:"M16 20H2V4h14zm2-12h4V4h-4zm0 12h4v-4h-4zm0-6h4v-4h-4z"}),"ViewSidebar");const eot=Li(Yv)(({theme:t})=>({marginTop:t.spacing(2),marginRight:t.spacing(.5),marginLeft:"auto"}));function tot({visible:t,sidebarOpen:e,setSidebarOpen:n,openDialog:r,allowRefresh:i,updateResources:o,compact:a}){if(!t)return null;const s=w.jsx(Pn,{value:"sidebar",selected:e,onClick:()=>n(!e),size:"small",sx:Mo.toggleButton,children:w.jsx(_t,{arrow:!0,title:fe.get("Show or hide sidebar"),children:w.jsx(Zue,{})})});let l,c,u;return a&&(l=i&&w.jsx(Ot,{onClick:o,size:"small",children:w.jsx(_t,{arrow:!0,title:fe.get("Refresh"),children:w.jsx(A5,{})})}),c=Kt.instance.branding.allowDownloads&&w.jsx(Ot,{onClick:()=>r("export"),size:"small",children:w.jsx(_t,{arrow:!0,title:fe.get("Export data"),children:w.jsx(D5,{})})}),u=w.jsx(Ot,{onClick:()=>r("settings"),size:"small",children:w.jsx(_t,{arrow:!0,title:fe.get("Settings"),children:w.jsx(M5,{})})})),w.jsx(eot,{variant:"standard",children:w.jsxs(Ke,{children:[l,c,u,s]})})}const not=t=>({locale:t.controlState.locale,visible:!!(t.controlState.selectedDatasetId||t.controlState.selectedPlaceId),sidebarOpen:t.controlState.sidebarOpen,compact:Kt.instance.branding.compact,allowRefresh:Kt.instance.branding.allowRefresh}),rot={setSidebarOpen:GB,openDialog:Pp,updateResources:Gse},iot=Jt(not,rot)(tot),oot=t=>({locale:t.controlState.locale,show:t.dataState.datasets.length>0}),aot={},sot=({show:t})=>t?w.jsxs(vKe,{children:[w.jsx(CKe,{}),w.jsx(GKe,{}),w.jsx(nZe,{}),w.jsx(fZe,{}),w.jsx(kZe,{}),w.jsx(Sit,{}),w.jsx(Yit,{}),w.jsx(Pit,{}),w.jsx(iot,{})]}):null,lot=Jt(oot,aot)(sot);function Jue(t){const e=M.useRef(null),n=M.useRef(o=>{if(o.buttons===1&&e.current!==null){o.preventDefault();const{screenX:a,screenY:s}=o,[l,c]=e.current,u=[a-l,s-c];e.current=[a,s],t(u)}}),r=M.useRef(o=>{o.buttons===1&&(o.preventDefault(),document.body.addEventListener("mousemove",n.current),document.body.addEventListener("mouseup",i.current),document.body.addEventListener("onmouseleave",i.current),e.current=[o.screenX,o.screenY])}),i=M.useRef(o=>{e.current!==null&&(o.preventDefault(),e.current=null,document.body.removeEventListener("mousemove",n.current),document.body.removeEventListener("mouseup",i.current),document.body.removeEventListener("onmouseleave",i.current))});return r.current}const T9={hor:t=>({flex:"none",border:"none",outline:"none",width:"8px",minHeight:"100%",maxHeight:"100%",cursor:"col-resize",backgroundColor:t.palette.mode==="dark"?"white":"black",opacity:0}),ver:t=>({flex:"none",border:"none",outline:"none",height:"8px",minWidth:"100%",maxWidth:"100%",cursor:"row-resize",backgroundColor:t.palette.mode==="dark"?"white":"black",opacity:0})};function cot({dir:t,onChange:e}){const r=Jue(([i,o])=>{e(i)});return w.jsx(Ke,{sx:t==="hor"?T9.hor:T9.ver,onMouseDown:r})}const DS={hor:{display:"flex",flexFlow:"row nowrap",flex:"auto"},ver:{height:"100%",display:"flex",flexFlow:"column nowrap",flex:"auto"},childHor:{flex:"none"},childVer:{flex:"none"}};function uot({dir:t,splitPosition:e,setSplitPosition:n,children:r,style:i,child1Style:o,child2Style:a}){const s=M.useRef(null);if(!r||!Array.isArray(r)||r.length!==2)return null;const l=t==="hor"?DS.childHor:DS.childVer,c=t==="hor"?{width:e}:{height:e},u=f=>{s.current&&En(s.current.clientWidth)&&n(s.current.clientWidth+f)};return w.jsxs("div",{id:"SplitPane",style:{...i,...t==="hor"?DS.hor:DS.ver},children:[w.jsx("div",{ref:s,id:"SplitPane-Child-1",style:{...l,...o,...c},children:r[0]}),w.jsx(cot,{dir:t,onChange:u}),w.jsx("div",{id:"SplitPane-Child-2",style:{...l,...a},children:r[1]})]})}const fot=({placeGroup:t,mapProjection:e,visible:n})=>{const r=M.useRef(new V1);return M.useEffect(()=>{const i=r.current,o=t.features;if(o.length===0)i.clear();else{const a=i.getFeatures(),s=new Set(a.map(f=>f.getId())),l=new Set(o.map(f=>f.id)),c=o.filter(f=>!s.has(f.id));a.filter(f=>!l.has(f.getId()+"")).forEach(f=>i.removeFeature(f)),c.forEach(f=>{const d=new Tp().readFeature(f,{dataProjection:"EPSG:4326",featureProjection:e});d.getId()!==f.id&&d.setId(f.id);const h=(f.properties||{}).color||"red",p=(f.properties||{}).opacity,m=(f.properties||{}).source?"diamond":"circle";LB(d,h,_5(p),m),i.addFeature(d)})}},[t,e]),w.jsx(o2,{id:t.id,opacity:t.id===Bs?1:.8,visible:n,zIndex:501,source:r.current})};class dot extends fy{addMapObject(e){const n=new dUe(this.getOptions());return e.addControl(n),n}updateMapObject(e,n,r){return n.setProperties(this.getOptions()),n}removeMapObject(e,n){e.removeControl(n)}}class xR extends fy{addMapObject(e){const n=new ZUe(this.getOptions()),r=!!this.props.active;return n.setActive(r),e.addInteraction(n),r&&this.listen(n,this.props),n}updateMapObject(e,n,r){n.setProperties(this.getOptions());const i=!!this.props.active;return n.setActive(i),this.unlisten(n,r),i&&this.listen(n,this.props),n}removeMapObject(e,n){this.unlisten(n,this.props),e.removeInteraction(n)}getOptions(){const e=super.getOptions();delete e.layerId,delete e.active,delete e.onDrawStart,delete e.onDrawEnd;const n=this.props.layerId;if(n&&!e.source){const r=this.getMapObject(n);r&&(e.source=r.getSource())}return e}listen(e,n){const{onDrawStart:r,onDrawEnd:i}=n;r&&e.on("drawstart",r),i&&e.on("drawend",i)}unlisten(e,n){const{onDrawStart:r,onDrawEnd:i}=n;r&&e.un("drawstart",r),i&&e.un("drawend",i)}}class hot extends fy{addMapObject(e){return this.updateView(e)}removeMapObject(e,n){}updateMapObject(e,n){return this.updateView(e)}updateView(e){const n=this.props.projection;let r=e.getView().getProjection();if(typeof n=="string"&&r&&(r=r.getCode()),n&&n!==r){const i=e.getView(),o=new jc({...this.props,center:XM(i.getCenter()||[0,0],r,n),minZoom:i.getMinZoom(),zoom:i.getZoom()});e.getLayers().forEach(a=>{a instanceof t2&&a.getSource().forEachFeature(s=>{var l;(l=s.getGeometry())==null||l.transform(r,n)})}),e.setView(o)}else e.getView().setProperties(this.props);return e.getView()}}function LS(t,e){const n=t.getLayers();for(let r=0;r{if(R){const $=C||null;if($!==L&&Va[bR]){const A=Va[bR].getSource();if(A.clear(),$){const q=yot(R,$);if(q){const Y=q.clone();Y.setId("select-"+q.getId()),Y.setStyle(void 0),A.addFeature(Y)}}z($)}}},[R,C,L]),M.useEffect(()=>{R&&R.getLayers().forEach($=>{$ instanceof cae?$.getSource().changed():$.changed()})},[R,k]),M.useEffect(()=>{if(R===null||!En(I))return;const $=J=>{P9(R,J,I,0)},D=J=>{P9(R,J,I,1)},A=J=>{J.context.restore()},q=LS(R,"rgb2"),Y=LS(R,"variable2"),K=LS(R,"rgb"),se=LS(R,"variable"),te=[[q,$],[Y,$],[K,D],[se,D]];for(const[J,pe]of te)J&&(J.on("prerender",pe),J.on("postrender",A));return()=>{for(const[J,pe]of te)J&&(J.un("prerender",pe),J.un("postrender",A))}});const B=$=>{if(n==="Select"){const D=$.map;let A=null;const q=D.getFeaturesAtPixel($.pixel);if(q){for(const Y of q)if(typeof Y.getId=="function"){A=Y.getId()+"";break}}O&&O(A,E,!1)}},W=$=>{var D;if(R!==null&&y&&n!=="Select"){const A=$.feature;let q=A.getGeometry();if(!q)return;const Y=Ys(oy+n.toLowerCase()+"-"),K=R.getView().getProjection();if(q instanceof Koe){const re=Kje(q);A.setGeometry(re)}q=A.clone().getGeometry().transform(K,uy);const se=new Tp().writeGeometryObject(q);A.setId(Y);let te=0;if(Va[Bs]){const re=Va[Bs],ve=(D=re==null?void 0:re.getSource())==null?void 0:D.getFeatures();ve&&(te=ve.length)}const J=xot(b,n),pe=Xh(te),be=pie(pe,t.palette.mode);LB(A,be,_5()),y(v,Y,{label:J,color:pe},se,!0)}return!0};function U($){P&&P($),T($)}const N=$=>{x&&$.forEach(D=>{const A=new FileReader;A.onloadend=()=>{typeof A.result=="string"&&x(A.result)},A.readAsText(D,"UTF-8")})};return w.jsx(Tie,{children:w.jsxs(Y6e,{id:e,onClick:$=>B($),onMapRef:U,mapObjects:Va,isStale:!0,onDropFiles:N,children:[w.jsx(hot,{id:"view",projection:r}),w.jsxs(lae,{children:[i,o,a,s,l,f,c,w.jsx(o2,{id:bR,opacity:.7,zIndex:500,style:got,source:pot}),w.jsx(w.Fragment,{children:b.map($=>w.jsx(fot,{placeGroup:$,mapProjection:r,visible:S&&_[$.id]},$.id))})]}),u,w.jsx(xR,{id:"drawPoint",layerId:Bs,active:n==="Point",type:"Point",wrapX:!0,stopClick:!0,onDrawEnd:W}),w.jsx(xR,{id:"drawPolygon",layerId:Bs,active:n==="Polygon",type:"Polygon",wrapX:!0,stopClick:!0,onDrawEnd:W}),w.jsx(xR,{id:"drawCircle",layerId:Bs,active:n==="Circle",type:"Circle",wrapX:!0,stopClick:!0,onDrawEnd:W}),d,h,m,g,p,w.jsx(dot,{bar:!1})]})})}function yot(t,e){var n;for(const r of t.getLayers().getArray())if(r instanceof t2){const o=(n=r.getSource())==null?void 0:n.getFeatureById(e);if(o)return o}return null}function xot(t,e){const n=fe.get(e),r=t.find(i=>i.id===Bs);if(r)for(let i=1;;i++){const o=`${n} ${i}`;if(!!!r.features.find(s=>s.properties?s.properties.label===o:!1))return o}return`${n} 1`}function P9(t,e,n,r){const i=t.getSize();if(!i)return;const o=i[0],a=i[1];let s,l,c,u;r===0?(s=Au(e,[0,0]),l=Au(e,[n,0]),c=Au(e,[0,a]),u=Au(e,[n,a])):(s=Au(e,[n,0]),l=Au(e,[o,0]),c=Au(e,[n,a]),u=Au(e,[o,a]));const f=e.context;f.save(),f.beginPath(),f.moveTo(s[0],s[1]),f.lineTo(c[0],c[1]),f.lineTo(u[0],u[1]),f.lineTo(l[0],l[1]),f.closePath(),f.clip()}const $S=1,Yb=.2,Oy=240,tfe=20,NS={container:{width:Oy},itemContainer:{display:"flex",alignItems:"center",justifyContent:"flex-start"},itemLabelBox:{paddingLeft:1,fontSize:"small"},itemColorBox:t=>({width:"48px",height:"16px",borderStyle:"solid",borderColor:t.palette.mode==="dark"?"lightgray":"darkgray",borderWidth:1})};function bot({categories:t,onOpenColorBarEditor:e}){return!t||t.length===0?null:w.jsx(Ke,{sx:NS.container,children:t.map((n,r)=>w.jsxs(Ke,{onClick:e,sx:NS.itemContainer,children:[w.jsx(Ke,{sx:NS.itemColorBox,style:{backgroundColor:n.color}}),w.jsx(Ke,{component:"span",sx:NS.itemLabelBox,children:`${n.label||`Category ${r+1}`} (${n.value})`})]},r))})}const M9={nominal:{cursor:"pointer"},error:{cursor:"pointer",border:"0.5px solid red"}};function _ot({colorBar:t,opacity:e,width:n,height:r,onClick:i}){const o=M.useRef(null);M.useEffect(()=>{const c=o.current;c!==null&&iHe(t,e,c)},[t,e]);const{baseName:a,imageData:s}=t,l=s?a:fe.get("Unknown color bar")+`: ${a}`;return w.jsx(_t,{title:l,children:w.jsx("canvas",{ref:o,width:n||Oy,height:r||tfe+4,onClick:i,style:s?M9.nominal:M9.error})})}function wot(t,e,n=5,r=!1,i=!1){return X$(Oot(t,e,n,r),i)}function X$(t,e=!1){return t.map(n=>Zf(n,void 0,e))}function Zf(t,e,n){if(e===void 0&&(e=n?2:Sot(t)),n)return t.toExponential(e);const r=Math.round(t);if(r===t||Math.abs(r-t)<1e-8)return r+"";{let i=t.toFixed(e);if(i.includes("."))for(;i.endsWith("0")&&!i.endsWith(".0");)i=i.substring(0,i.length-1);return i}}function Sot(t){if(t===0||t===Math.floor(t))return 0;const e=Math.floor(Math.log10(Math.abs(t)));return Math.min(16,Math.max(2,e<0?1-e:0))}function Oot(t,e,n,r){const i=new Array(n);if(r){const o=Math.log10(t),s=(Math.log10(e)-o)/(n-1);for(let l=1;lwot(t,e,n,r),[t,e,n,r]);return w.jsx(Ke,{sx:Cot.container,onClick:i,children:o.map((a,s)=>w.jsx("span",{children:a},s))})}var Lz={},Eot=ct;Object.defineProperty(Lz,"__esModule",{value:!0});var nfe=Lz.default=void 0,Pot=Eot(pt()),Mot=w;nfe=Lz.default=(0,Pot.default)((0,Mot.jsx)("path",{d:"M8 19h3v3h2v-3h3l-4-4zm8-15h-3V1h-2v3H8l4 4zM4 9v2h16V9zm0 3h16v2H4z"}),"Compress");const k9=t=>t,kot=t=>Math.pow(10,t),Aot=Math.log10,A9=(t,e)=>typeof t=="number"?e(t):t.map(e);class Rot{constructor(e){Yt(this,"_fn");Yt(this,"_invFn");e?(this._fn=Aot,this._invFn=kot):(this._fn=k9,this._invFn=k9)}scale(e){return A9(e,this._fn)}scaleInv(e){return A9(e,this._invFn)}}function Iot({variableColorBarName:t,variableColorBarMinMax:e,variableColorBarNorm:n,variableOpacity:r,updateVariableColorBar:i,originalColorBarMinMax:o}){const a=M.useMemo(()=>new Rot(n==="log"),[n]),[s,l]=M.useState(()=>a.scale(e));M.useEffect(()=>{l(a.scale(e))},[a,e]);const c=(E,k)=>{Array.isArray(k)&&l(k)},u=(E,k)=>{if(Array.isArray(k)){const P=X$(a.scaleInv(k)).map(R=>Number.parseFloat(R));i(t,P,n,r)}},[f,d]=a.scale(o),h=f=2?v=Math.max(2,Math.round(g/2)):(v=4,g=8);const y=f({value:O[k],label:E}));return w.jsx(Zv,{min:b,max:_,value:s,marks:C,step:S,valueLabelFormat:E=>Zf(a.scaleInv(E)),onChange:c,onChangeCommitted:u,valueLabelDisplay:"auto",size:"small"})}const _R=5,Lu={container:t=>({marginTop:t.spacing(2),marginBottom:t.spacing(2),display:"flex",flexDirection:"column",gap:1}),header:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{paddingLeft:2,fontWeight:"bold"},sliderBox:t=>({marginTop:t.spacing(1),marginLeft:t.spacing(_R),marginRight:t.spacing(_R),minWidth:320,width:`calc(100% - ${t.spacing(2*(_R+1))}px)`}),logLabel:{margin:0,paddingRight:2,fontWeight:"bold"},minMaxBox:{display:"flex",justifyContent:"center"},minTextField:{maxWidth:"8em",marginRight:2},maxTextField:{maxWidth:"8em",marginLeft:2}};function Dot({variableColorBar:t,variableColorBarName:e,variableColorBarMinMax:n,variableColorBarNorm:r,variableOpacity:i,updateVariableColorBar:o}){const[a,s]=M.useState(n),[l,c]=M.useState(n),[u,f]=M.useState(R9(n)),[d,h]=M.useState([!1,!1]);M.useEffect(()=>{f(R9(n))},[n]);const p=y=>{const x=y.target.value;f([x,u[1]]);const b=Number.parseFloat(x);let _=!1;if(!Number.isNaN(b)&&b{const x=y.target.value;f([u[0],x]);const b=Number.parseFloat(x);let _=!1;if(!Number.isNaN(b)&&b>a[0]){if(b!==a[1]){const S=[a[0],b];s(S),c(S),o(e,S,r,i)}}else _=!0;h([d[0],_])},g=()=>{const y=t.colorRecords,x=y[0].value,b=y[y.length-1].value,_=[x,b];s(_),c(_),o(e,_,r,i),h([!1,!1])},v=(y,x)=>{o(e,n,x?"log":"lin",i)};return w.jsxs(Ke,{sx:Lu.container,children:[w.jsxs(Ke,{sx:Lu.header,children:[w.jsx(At,{sx:Lu.title,children:fe.get("Value Range")}),w.jsx("span",{style:{flexGrow:1}}),t.colorRecords&&w.jsx(Qa,{sx:{marginRight:1},icon:w.jsx(nfe,{}),onClick:g,tooltipText:fe.get("Set min/max from color mapping values")}),w.jsx(xg,{sx:Lu.logLabel,control:w.jsx(_t,{title:fe.get("Logarithmic scaling"),children:w.jsx(lie,{checked:r==="log",onChange:v,size:"small"})}),label:w.jsx(At,{variant:"body2",children:fe.get("Log-scaled")}),labelPlacement:"start"})]}),w.jsx(Ke,{sx:Lu.sliderBox,children:w.jsx(Iot,{variableColorBarName:e,variableColorBarMinMax:n,variableColorBarNorm:r,updateVariableColorBar:o,originalColorBarMinMax:l,variableOpacity:i})}),w.jsxs(Ke,{component:"form",sx:Lu.minMaxBox,children:[w.jsx(lr,{sx:Lu.minTextField,label:"Minimum",variant:"filled",size:"small",value:u[0],error:d[0],onChange:y=>p(y)}),w.jsx(lr,{sx:Lu.maxTextField,label:"Maximum",variant:"filled",size:"small",value:u[1],error:d[1],onChange:y=>m(y)})]})]})}function R9(t){return[t[0]+"",t[1]+""]}function Lot({variableColorBar:t,variableColorBarName:e,variableColorBarMinMax:n,variableColorBarNorm:r,variableOpacity:i,updateVariableColorBar:o,onOpenColorBarEditor:a}){const[s,l]=M.useState(null),c=f=>{l(f.currentTarget)},u=()=>{l(null)};return w.jsxs(w.Fragment,{children:[w.jsx(_ot,{colorBar:t,opacity:i,onClick:a}),w.jsx(Tot,{minValue:n[0],maxValue:n[1],numTicks:5,logScaled:r==="log",onClick:c}),w.jsx(bp,{anchorEl:s,open:!!s,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"center"},children:w.jsx(Dot,{variableColorBar:t,variableColorBarName:e,variableColorBarMinMax:n,variableColorBarNorm:r,variableOpacity:i,updateVariableColorBar:o})})]})}var $z={},$ot=ct;Object.defineProperty($z,"__esModule",{value:!0});var rfe=$z.default=void 0,Not=$ot(pt()),Fot=w;rfe=$z.default=(0,Not.default)((0,Fot.jsx)("path",{d:"M12 4.81V19c-3.31 0-6-2.63-6-5.87 0-1.56.62-3.03 1.75-4.14zM6.35 7.56C4.9 8.99 4 10.96 4 13.13 4 17.48 7.58 21 12 21s8-3.52 8-7.87c0-2.17-.9-4.14-2.35-5.57L12 2z"}),"InvertColors");var Nz={},jot=ct;Object.defineProperty(Nz,"__esModule",{value:!0});var ife=Nz.default=void 0,Bot=jot(pt()),zot=w;ife=Nz.default=(0,Bot.default)((0,zot.jsx)("path",{d:"M17.66 8 12 2.35 6.34 8C4.78 9.56 4 11.64 4 13.64s.78 4.11 2.34 5.67 3.61 2.35 5.66 2.35 4.1-.79 5.66-2.35S20 15.64 20 13.64 19.22 9.56 17.66 8M6 14c.01-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 17.99 12 18 14z"}),"Opacity");const T0={container:{display:"flex",alignItems:"center",justifyContent:"space-between"},settingsBar:{display:"flex",gap:"1px"},toggleButton:{paddingTop:"2px",paddingBottom:"2px"},opacityContainer:{display:"flex",alignItems:"center"},opacityLabel:t=>({color:t.palette.text.secondary}),opacitySlider:{flexGrow:"1px",marginLeft:"10px",marginRight:"10px"}};function Uot({variableColorBarName:t,variableColorBarMinMax:e,variableColorBarNorm:n,variableColorBar:r,variableOpacity:i,updateVariableColorBar:o}){const a=()=>{const c=!r.isAlpha;t=ZT({...r,isAlpha:c}),o(t,e,n,i)},s=()=>{const c=!r.isReversed;t=ZT({...r,isReversed:c}),o(t,e,n,i)},l=(c,u)=>{o(t,e,n,u)};return w.jsxs(w.Fragment,{children:[w.jsx(Ke,{sx:T0.container,children:w.jsxs(Ke,{sx:T0.settingsBar,children:[w.jsx(_t,{arrow:!0,title:fe.get("Hide small values"),children:w.jsx(Pn,{value:"alpha",selected:r.isAlpha,onChange:a,size:"small",children:w.jsx(ife,{fontSize:"inherit"})})}),w.jsx(_t,{arrow:!0,title:fe.get("Reverse"),children:w.jsx(Pn,{value:"reverse",selected:r.isReversed,onChange:s,size:"small",children:w.jsx(rfe,{fontSize:"inherit"})})})]})}),w.jsxs(Ke,{component:"div",sx:T0.opacityContainer,children:[w.jsx(Ke,{component:"span",fontSize:"small",sx:T0.opacityLabel,children:fe.get("Opacity")}),w.jsx(Zv,{min:0,max:1,value:i,step:.01,sx:T0.opacitySlider,onChange:l,size:"small"})]})]})}const Wot={colorBarGroupTitle:t=>({marginTop:t.spacing(2*Yb),fontSize:"small",color:t.palette.text.secondary})};function ofe({title:t,description:e}){return w.jsx(_t,{arrow:!0,title:e,placement:"left",children:w.jsx(Ke,{sx:Wot.colorBarGroupTitle,children:t})})}const I9=t=>({marginTop:t.spacing(Yb),height:20,borderWidth:1,borderStyle:"solid",cursor:"pointer"}),D9={colorBarItem:t=>({...I9(t),borderColor:t.palette.mode==="dark"?"lightgray":"darkgray"}),colorBarItemSelected:t=>({...I9(t),borderColor:"blue"})};function Fz({imageData:t,selected:e,onSelect:n,width:r,title:i}){let o=w.jsx("img",{src:t?`data:image/png;base64,${t}`:void 0,alt:t?"color bar":"error",width:"100%",height:"100%",onClick:n});return i&&(o=w.jsx(_t,{arrow:!0,title:i,placement:"left",children:o})),w.jsx(Ke,{width:r||Oy,sx:e?D9.colorBarItemSelected:D9.colorBarItem,children:o})}function Vot({colorBarGroup:t,selectedColorBarName:e,onSelectColorBar:n,images:r}){return w.jsxs(w.Fragment,{children:[w.jsx(ofe,{title:t.title,description:t.description}),t.names.map(i=>w.jsx(Fz,{title:i,imageData:r[i],selected:i===e,onSelect:()=>n(i)},i))]})}var jz={},Got=ct;Object.defineProperty(jz,"__esModule",{value:!0});var aw=jz.default=void 0,Hot=Got(pt()),qot=w;aw=jz.default=(0,Hot.default)((0,qot.jsx)("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"AddCircleOutline");function afe(){const t=M.useRef(),e=M.useRef(()=>{t.current&&(t.current(),t.current=void 0)}),n=M.useRef(r=>{t.current=r});return M.useEffect(()=>e.current,[]),[e.current,n.current]}var Bz={},Xot=ct;Object.defineProperty(Bz,"__esModule",{value:!0});var sfe=Bz.default=void 0,Qot=Xot(pt()),Yot=w;sfe=Bz.default=(0,Qot.default)((0,Yot.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12z"}),"Cancel");var zz={},Kot=ct;Object.defineProperty(zz,"__esModule",{value:!0});var lfe=zz.default=void 0,Zot=Kot(pt()),Jot=w;lfe=zz.default=(0,Zot.default)((0,Jot.jsx)("path",{d:"M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"}),"Done");function eat({anchorEl:t,markdownText:e,open:n,onClose:r}){if(!e)return null;const i={code:o=>{const{node:a,...s}=o;return w.jsx("code",{...s,style:{color:"green"}})}};return w.jsx(bp,{anchorEl:t,open:n,onClose:r,children:w.jsx(Go,{sx:{width:"32em",overflowY:"auto",fontSize:"smaller",paddingLeft:2,paddingRight:2},children:w.jsx(S2,{children:e,components:i,linkTarget:"_blank"})})})}function cfe({size:t,helpUrl:e}){const[n,r]=M.useState(null),i=M.useRef(null),o=Nce(e),a=()=>{r(i.current)},s=()=>{r(null)};return w.jsxs(w.Fragment,{children:[w.jsx(Ot,{onClick:a,size:t,ref:i,children:w.jsx(E5,{fontSize:"inherit"})}),w.jsx(eat,{anchorEl:n,open:!!n,onClose:s,markdownText:o})]})}const L9={container:{display:"flex",justifyContent:"space-between",gap:.2},doneCancel:{display:"flex",gap:.2}};function sw({onDone:t,onCancel:e,doneDisabled:n,cancelDisabled:r,size:i,helpUrl:o}){return w.jsxs(Ke,{sx:L9.container,children:[w.jsx(Ke,{children:o&&w.jsx(cfe,{size:i,helpUrl:o})}),w.jsxs(Ke,{sx:L9.doneCancel,children:[w.jsx(Ot,{onClick:t,color:"primary",disabled:n,size:i,children:w.jsx(lfe,{fontSize:"inherit"})}),w.jsx(Ot,{onClick:e,color:"primary",disabled:r,size:i,children:w.jsx(sfe,{fontSize:"inherit"})})]})]})}const wR={radioGroup:{marginLeft:1},radio:{padding:"4px"},label:{fontSize:"small"}},tat=[["continuous","Contin.","Continuous color assignment, where each value represents a support point of a color gradient"],["stepwise","Stepwise","Stepwise color mapping where values are bounds of value ranges mapped to the same single color"],["categorical","Categ.","Values represent unique categories or indexes that are mapped to a color"]];function nat({colorMapType:t,setColorMapType:e}){return w.jsx(m5,{row:!0,value:t,onChange:(n,r)=>{e(r)},sx:wR.radioGroup,children:tat.map(([n,r,i])=>w.jsx(_t,{arrow:!0,title:fe.get(i),children:w.jsx(xg,{value:n,control:w.jsx(Bx,{size:"small",sx:wR.radio}),label:w.jsx(Ke,{component:"span",sx:wR.label,children:fe.get(r)})})},n))})}function rat({userColorBar:t,updateUserColorBar:e,selected:n,onSelect:r,onDone:i,onCancel:o}){const a=l=>{e({...t,code:l.currentTarget.value})},s=l=>{e({...t,type:l})};return w.jsxs(Ke,{children:[w.jsx(Fz,{imageData:t.imageData,title:t.errorMessage,selected:n,onSelect:r}),w.jsx(nat,{colorMapType:t.type,setColorMapType:s}),w.jsx(lr,{label:"Color mapping",placeholder:moe,multiline:!0,fullWidth:!0,size:"small",minRows:3,sx:{marginTop:1,fontFamily:"monospace"},value:t.code,onChange:a,color:t.errorMessage?"error":"primary",inputProps:{style:{fontFamily:"monospace",fontSize:12}}}),w.jsx(sw,{onDone:i,onCancel:o,doneDisabled:!!t.errorMessage,size:"small",helpUrl:fe.get("docs/color-mappings.en.md")})]})}var Uz={},iat=ct;Object.defineProperty(Uz,"__esModule",{value:!0});var ufe=Uz.default=void 0,oat=iat(pt()),aat=w;ufe=Uz.default=(0,oat.default)((0,aat.jsx)("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreHoriz");const sat={container:{display:"flex",alignItems:"center",width:Oy,height:tfe,gap:Yb,marginTop:Yb}};function lat({imageData:t,title:e,selected:n,onEdit:r,onRemove:i,onSelect:o,disabled:a}){const[s,l]=M.useState(null),c=p=>{l(p.currentTarget)},u=()=>{l(null)},f=()=>{l(null),r()},d=()=>{l(null),i()},h=!!s;return w.jsxs(w.Fragment,{children:[w.jsxs(Ke,{sx:sat.container,children:[w.jsx(Fz,{imageData:t,selected:n,onSelect:o,width:Oy-20,title:e}),w.jsx(Ot,{size:"small",onClick:c,children:w.jsx(ufe,{fontSize:"inherit"})})]}),w.jsx(bp,{anchorOrigin:{vertical:"center",horizontal:"center"},transformOrigin:{vertical:"center",horizontal:"center"},open:h,anchorEl:s,onClose:u,children:w.jsxs(Ke,{children:[w.jsx(Ot,{onClick:f,size:"small",disabled:a,children:w.jsx(Ap,{fontSize:"inherit"})}),w.jsx(Ot,{onClick:d,size:"small",disabled:a,children:w.jsx(nw,{fontSize:"inherit"})})]})})]})}const cat={container:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:1}};function uat({colorBarGroup:t,selectedColorBarName:e,onSelectColorBar:n,userColorBars:r,addUserColorBar:i,removeUserColorBar:o,updateUserColorBar:a,updateUserColorBars:s,storeSettings:l}){const[c,u]=M.useState({}),[f,d]=afe(),h=M.useMemo(()=>r.findIndex(x=>x.id===c.colorBarId),[r,c.colorBarId]),p=()=>{d(()=>s(r));const x=Ys("ucb");i(x),u({action:"add",colorBarId:x})},m=x=>{d(()=>s(r)),u({action:"edit",colorBarId:x})},g=x=>{d(void 0),o(x)},v=()=>{d(void 0),u({}),l()},y=()=>{f(),u({})};return w.jsxs(w.Fragment,{children:[w.jsxs(Ke,{sx:cat.container,children:[w.jsx(ofe,{title:fe.get(t.title),description:fe.get(t.description)}),w.jsx(Ot,{onClick:p,size:"small",color:"primary",disabled:!!c.action,children:w.jsx(aw,{fontSize:"inherit"})})]}),r.map(x=>x.id===c.colorBarId&&h>=0?w.jsx(rat,{userColorBar:x,updateUserColorBar:a,selected:x.id===e,onSelect:()=>n(x.id),onDone:v,onCancel:y},x.id):w.jsx(lat,{imageData:x.imageData,title:x.errorMessage,disabled:!!c.action,selected:x.id===e,onSelect:()=>n(x.id),onEdit:()=>m(x.id),onRemove:()=>g(x.id)},x.id))]})}function fat({variableColorBarName:t,variableColorBarMinMax:e,variableColorBarNorm:n,variableColorBar:r,variableOpacity:i,updateVariableColorBar:o,colorBars:a,userColorBars:s,addUserColorBar:l,removeUserColorBar:c,updateUserColorBar:u,updateUserColorBars:f,storeSettings:d}){const h=p=>{t=ZT({...r,baseName:p}),o(t,e,n,i)};return w.jsx(w.Fragment,{children:a.groups.map(p=>p.title===poe?w.jsx(uat,{colorBarGroup:p,selectedColorBarName:r.baseName,onSelectColorBar:h,userColorBars:s,addUserColorBar:l,removeUserColorBar:c,updateUserColorBar:u,updateUserColorBars:f,storeSettings:d},p.title):w.jsx(Vot,{colorBarGroup:p,selectedColorBarName:r.baseName,onSelectColorBar:h,images:a.images},p.title))})}const dat={colorBarBox:t=>({marginTop:t.spacing($S-2*Yb),marginLeft:t.spacing($S),marginRight:t.spacing($S),marginBottom:t.spacing($S)})};function hat(t){const{colorBars:e,userColorBars:n,addUserColorBar:r,removeUserColorBar:i,updateUserColorBar:o,updateUserColorBars:a,...s}=t;return w.jsxs(Ke,{sx:dat.colorBarBox,children:[w.jsx(Uot,{...s}),w.jsx(fat,{...s,colorBars:e,userColorBars:n,addUserColorBar:r,removeUserColorBar:i,updateUserColorBar:o,updateUserColorBars:a})]})}const $9={container:t=>({position:"absolute",zIndex:1e3,top:10,borderRadius:"5px",borderWidth:"1px",borderStyle:"solid",borderColor:"#00000020",backgroundColor:"#FFFFFFAA",color:"black",maxWidth:`${Oy+20}px`,paddingLeft:t.spacing(1.5),paddingRight:t.spacing(1.5),paddingBottom:t.spacing(.5),paddingTop:t.spacing(.5)}),title:t=>({fontSize:"small",fontWeight:"bold",width:"100%",display:"flex",wordBreak:"break-word",wordWrap:"break-word",justifyContent:"center",paddingBottom:t.spacing(.5)})};function ffe(t){const{variableName:e,variableTitle:n,variableUnits:r,variableColorBar:i,style:o}=t,a=M.useRef(null),[s,l]=M.useState(null),c=()=>{l(a.current)},u=()=>{l(null)};if(!e)return null;const f=i.type==="categorical"?n||e:`${n||e} (${r||"-"})`;return w.jsxs(Ke,{sx:$9.container,style:o,ref:a,children:[w.jsx(At,{sx:$9.title,children:f}),i.type==="categorical"?w.jsx(bot,{categories:i.colorRecords,onOpenColorBarEditor:c,...t}):w.jsx(Lot,{onOpenColorBarEditor:c,...t}),w.jsx(bp,{anchorEl:s,open:!!s,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:w.jsx(hat,{...t})})]})}const pat=t=>({variableName:py(t),variableTitle:FHe(t),variableUnits:BHe(t),variableColorBarName:d2(t),variableColorBarMinMax:cse(t),variableColorBarNorm:dse(t),variableColorBar:AB(t),variableOpacity:yse(t),userColorBars:Ep(t),colorBars:p2(t),style:{right:10}}),mat={updateVariableColorBar:f7e,addUserColorBar:Xle,removeUserColorBar:Kle,updateUserColorBar:Zle,updateUserColorBars:tce,storeSettings:qle},gat=Jt(pat,mat)(ffe),vat=t=>{const e=t.controlState.variableSplitPos;return{variableName:e?tse(t):null,variableTitle:jHe(t),variableUnits:zHe(t),variableColorBarName:h2(t),variableColorBarMinMax:use(t),variableColorBarNorm:hse(t),variableColorBar:mse(t),variableOpacity:xse(t),userColorBars:Ep(t),colorBars:p2(t),style:{left:e?e-280:0}}},yat={updateVariableColorBar:d7e,addUserColorBar:Xle,removeUserColorBar:Kle,updateUserColorBar:Zle,updateUserColorBars:tce,storeSettings:qle},xat=Jt(vat,yat)(ffe),bat={splitter:{position:"absolute",top:0,left:"50%",width:"6px",height:"100%",backgroundColor:"#ffffff60",zIndex:999,borderLeft:"0.5px solid #ffffffd0",borderRight:"0.5px solid #ffffffd0",cursor:"col-resize",boxShadow:"0px 0px 1px 0px black"}};function _at({hidden:t,position:e,onPositionChange:n}){const r=M.useRef(null),i=M.useRef(([a,s])=>{r.current!==null&&n(r.current.offsetLeft+a)}),o=Jue(i.current);return M.useEffect(()=>{!t&&!En(e)&&r.current!==null&&r.current.parentElement!==null&&n(Math.round(r.current.parentElement.clientWidth/2))},[t,e,n]),t?null:w.jsx(Ke,{id:"MapSplitter",ref:r,sx:bat.splitter,style:{left:En(e)?e:"50%"},onMouseDown:o})}const wat=t=>({hidden:!t.controlState.variableCompareMode,position:t.controlState.variableSplitPos}),Sat={onPositionChange:M7e},Oat=Jt(wat,Sat)(_at);function Cat(t,e,n,r,i,o,a){const s=M.useRef(0),[l,c]=M.useState(),[u,f]=M.useState(),[d,h]=M.useState(),p=M.useCallback(async(v,y,x,b,_)=>{_({dataset:v,variable:y,result:{fetching:!0}});try{const S=await E5e(e,v,y,x,b,a,null);console.info(y.name,"=",S),_({dataset:v,variable:y,result:{value:S.value}})}catch(S){_({dataset:v,variable:y,result:{error:S}})}},[e,a]),m=M.useCallback(v=>{const y=v.map;if(!t||!n||!r||!y){f(void 0),h(void 0);return}const x=v.pixel[0],b=v.pixel[1],_=XM(v.coordinate,y.getView().getProjection().getCode(),"EPSG:4326"),S=_[0],O=_[1];c({pixelX:x,pixelY:b,lon:S,lat:O});const C=new Date().getTime();C-s.current>=500&&(s.current=C,p(n,r,S,O,f).finally(()=>{i&&o&&p(i,o,S,O,h)}))},[p,t,n,r,i,o]),g=Va.map;return M.useEffect(()=>{if(t&&g){const v=y=>{y.dragging?c(void 0):m(y)};return g.on("pointermove",v),()=>{g.un("pointermove",v)}}else c(void 0)},[t,g,m]),M.useMemo(()=>l&&u?{location:l,payload:u,payload2:d}:null,[l,u,d])}const pc={container:{display:"grid",gridTemplateColumns:"auto minmax(60px, auto)",gap:0,padding:1,fontSize:"small"},labelItem:{paddingRight:1},valueItem:{textAlign:"right",fontFamily:"monospace"}};function Tat({location:t,payload:e,payload2:n}){return w.jsxs(Ke,{sx:pc.container,children:[w.jsx(Ke,{sx:pc.labelItem,children:"Longitude"}),w.jsx(Ke,{sx:pc.valueItem,children:Zf(t.lon,4)}),w.jsx(Ke,{sx:pc.labelItem,children:"Latitude"}),w.jsx(Ke,{sx:pc.valueItem,children:Zf(t.lat,4)}),w.jsx(Ke,{sx:pc.labelItem,children:N9(e)}),w.jsx(Ke,{sx:pc.valueItem,children:F9(e)}),n&&w.jsx(Ke,{sx:pc.labelItem,children:N9(n)}),n&&w.jsx(Ke,{sx:pc.valueItem,children:F9(n)})]})}function N9(t){const e=t.variable;return e.title||e.name}function F9(t){const e=t.result;return e.error?`${e.error}`:e.fetching?"...":En(e.value)?Zf(e.value,4):"---"}const Eat={container:{position:"absolute",zIndex:1e3,backgroundColor:"#000000A0",color:"#fff",border:"1px solid #FFFFFF50",borderRadius:"4px",transform:"translateX(3%)",pointerEvents:"none"}};function Pat({enabled:t,serverUrl:e,dataset1:n,variable1:r,dataset2:i,variable2:o,time:a}){const s=Cat(t,e,n,r,i,o,a);if(!s)return null;const{pixelX:l,pixelY:c}=s.location;return w.jsx(Ke,{sx:{...Eat.container,left:l,top:c},children:w.jsx(Tat,{...s})})}const Mat=t=>({enabled:t.controlState.mapPointInfoBoxEnabled,serverUrl:hi(t).url,dataset1:Gr(t),variable1:vo(t),dataset2:gd(t),variable2:bu(t),time:xy(t)}),kat={},Aat=Jt(Mat,kat)(Pat);var Wz={},Rat=ct;Object.defineProperty(Wz,"__esModule",{value:!0});var dfe=Wz.default=void 0,Iat=Rat(pt()),Dat=w;dfe=Wz.default=(0,Iat.default)((0,Dat.jsx)("path",{d:"M10 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h5v2h2V1h-2zm0 15H5l5-6zm9-15h-5v2h5v13l-5-6v9h5c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"}),"Compare");var Vz={},Lat=ct;Object.defineProperty(Vz,"__esModule",{value:!0});var Gz=Vz.default=void 0,$at=Lat(pt()),Nat=w;Gz=Vz.default=(0,$at.default)((0,Nat.jsx)("path",{d:"m11.99 18.54-7.37-5.73L3 14.07l9 7 9-7-1.63-1.27zM12 16l7.36-5.73L21 9l-9-7-9 7 1.63 1.27z"}),"Layers");var Hz={},Fat=ct;Object.defineProperty(Hz,"__esModule",{value:!0});var hfe=Hz.default=void 0,jat=Fat(pt()),Bat=w;hfe=Hz.default=(0,jat.default)((0,Bat.jsx)("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-2 12H6v-2h12zm0-3H6V9h12zm0-3H6V6h12z"}),"Message");const j9={position:"absolute",display:"flex",flexDirection:"column",zIndex:1e3};function zat({style:t,sx:e,children:n}){return w.jsx(Ke,{className:"ol-unselectable ol-control",sx:e,style:t?{...j9,...t}:j9,children:n})}const pfe={width:"1.375em",height:"1.375em"},Uat={...pfe,backgroundColor:"rgba(0,80,180,0.9)"},Wat={tooltip:{sx:{backgroundColor:"#4A4A4A",border:"1px solid white",borderRadius:0}}};function SR({icon:t,tooltipTitle:e,onClick:n,selected:r,onSelect:i}){const o=a=>{i&&i(a,!r),n&&n(a)};return e&&(t=w.jsx(_t,{title:e,componentsProps:Wat,children:t})),w.jsx(Ot,{onClick:o,style:r?Uat:pfe,children:t})}const Vat={left:"0.5em",top:65};function Gat({layerMenuOpen:t,setLayerMenuOpen:e,variableCompareMode:n,setVariableCompareMode:r,mapPointInfoBoxEnabled:i,setMapPointInfoBoxEnabled:o}){return w.jsxs(zat,{style:Vat,children:[w.jsx(SR,{icon:w.jsx(Gz,{fontSize:"small"}),tooltipTitle:fe.get("Show or hide layers panel"),selected:t,onSelect:(a,s)=>void e(s)}),w.jsx(SR,{icon:w.jsx(dfe,{fontSize:"small"}),tooltipTitle:fe.get("Turn layer split mode on or off"),selected:n,onSelect:(a,s)=>void r(s)}),w.jsx(SR,{icon:w.jsx(hfe,{fontSize:"small"}),tooltipTitle:fe.get("Turn info box on or off"),selected:i,onSelect:(a,s)=>void o(s)})]})}const Hat=t=>({layerMenuOpen:t.controlState.layerMenuOpen,variableCompareMode:t.controlState.variableCompareMode,mapPointInfoBoxEnabled:t.controlState.mapPointInfoBoxEnabled}),qat={setLayerMenuOpen:Rle,setVariableCompareMode:P7e,setMapPointInfoBoxEnabled:E7e},Xat=Jt(Hat,qat)(Gat),Qat=(t,e)=>({mapId:"map",locale:t.controlState.locale,variableLayer:f9e(t),variable2Layer:d9e(t),rgbLayer:h9e(t),rgb2Layer:p9e(t),datasetBoundaryLayer:u9e(t),placeGroupLayers:y9e(t),colorBarLegend:w.jsx(gat,{}),colorBarLegend2:w.jsx(xat,{}),mapSplitter:w.jsx(Oat,{}),mapPointInfoBox:w.jsx(Aat,{}),mapControlActions:w.jsx(Xat,{}),userDrawnPlaceGroupName:t.controlState.userDrawnPlaceGroupName,userPlaceGroups:X1(t),userPlaceGroupsVisibility:qHe(t),showUserPlaces:nse(t),mapInteraction:t.controlState.mapInteraction,mapProjection:md(t),selectedPlaceId:t.controlState.selectedPlaceId,places:K1(t),baseMapLayer:w9e(t),overlayLayer:S9e(t),imageSmoothing:Y1(t),variableSplitPos:t.controlState.variableSplitPos,onMapRef:e.onMapRef}),Yat={addDrawnUserPlace:V9e,importUserPlacesFromText:Xse,selectPlace:v2},B9=Jt(Qat,Yat)(vot);var qz={},Kat=ct;Object.defineProperty(qz,"__esModule",{value:!0});var Xz=qz.default=void 0,Zat=Kat(pt()),Jat=w;Xz=qz.default=(0,Zat.default)((0,Jat.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z"}),"Info");var Qz={},est=ct;Object.defineProperty(Qz,"__esModule",{value:!0});var mfe=Qz.default=void 0,tst=est(pt()),nst=w;mfe=Qz.default=(0,tst.default)((0,nst.jsx)("path",{d:"m2 19.99 7.5-7.51 4 4 7.09-7.97L22 9.92l-8.5 9.56-4-4-6 6.01zm1.5-4.5 6-6.01 4 4L22 3.92l-1.41-1.41-7.09 7.97-4-4L2 13.99z"}),"StackedLineChart");var Yz={},rst=ct;Object.defineProperty(Yz,"__esModule",{value:!0});var gfe=Yz.default=void 0,ist=rst(pt()),ost=w;gfe=Yz.default=(0,ist.default)((0,ost.jsx)("path",{d:"M7.52 21.48C4.25 19.94 1.91 16.76 1.55 13H.05C.56 19.16 5.71 24 12 24l.66-.03-3.81-3.81zm.89-6.52c-.19 0-.37-.03-.52-.08-.16-.06-.29-.13-.4-.24-.11-.1-.2-.22-.26-.37-.06-.14-.09-.3-.09-.47h-1.3c0 .36.07.68.21.95.14.27.33.5.56.69.24.18.51.32.82.41.3.1.62.15.96.15.37 0 .72-.05 1.03-.15.32-.1.6-.25.83-.44s.42-.43.55-.72c.13-.29.2-.61.2-.97 0-.19-.02-.38-.07-.56-.05-.18-.12-.35-.23-.51-.1-.16-.24-.3-.4-.43-.17-.13-.37-.23-.61-.31.2-.09.37-.2.52-.33.15-.13.27-.27.37-.42.1-.15.17-.3.22-.46.05-.16.07-.32.07-.48 0-.36-.06-.68-.18-.96-.12-.28-.29-.51-.51-.69-.2-.19-.47-.33-.77-.43C9.1 8.05 8.76 8 8.39 8c-.36 0-.69.05-1 .16-.3.11-.57.26-.79.45-.21.19-.38.41-.51.67-.12.26-.18.54-.18.85h1.3c0-.17.03-.32.09-.45s.14-.25.25-.34c.11-.09.23-.17.38-.22.15-.05.3-.08.48-.08.4 0 .7.1.89.31.19.2.29.49.29.86 0 .18-.03.34-.08.49-.05.15-.14.27-.25.37-.11.1-.25.18-.41.24-.16.06-.36.09-.58.09H7.5v1.03h.77c.22 0 .42.02.6.07s.33.13.45.23c.12.11.22.24.29.4.07.16.1.35.1.57 0 .41-.12.72-.35.93-.23.23-.55.33-.95.33m8.55-5.92c-.32-.33-.7-.59-1.14-.77-.43-.18-.92-.27-1.46-.27H12v8h2.3c.55 0 1.06-.09 1.51-.27.45-.18.84-.43 1.16-.76.32-.33.57-.73.74-1.19.17-.47.26-.99.26-1.57v-.4c0-.58-.09-1.1-.26-1.57-.18-.47-.43-.87-.75-1.2m-.39 3.16c0 .42-.05.79-.14 1.13-.1.33-.24.62-.43.85-.19.23-.43.41-.71.53-.29.12-.62.18-.99.18h-.91V9.12h.97c.72 0 1.27.23 1.64.69.38.46.57 1.12.57 1.99zM12 0l-.66.03 3.81 3.81 1.33-1.33c3.27 1.55 5.61 4.72 5.96 8.48h1.5C23.44 4.84 18.29 0 12 0"}),"ThreeDRotation");var Kz={},ast=ct;Object.defineProperty(Kz,"__esModule",{value:!0});var vfe=Kz.default=void 0,sst=ast(pt()),lst=w;vfe=Kz.default=(0,sst.default)((0,lst.jsx)("path",{d:"M4 7v2c0 .55-.45 1-1 1H2v4h1c.55 0 1 .45 1 1v2c0 1.65 1.35 3 3 3h3v-2H7c-.55 0-1-.45-1-1v-2c0-1.3-.84-2.42-2-2.83v-.34C5.16 11.42 6 10.3 6 9V7c0-.55.45-1 1-1h3V4H7C5.35 4 4 5.35 4 7m17 3c-.55 0-1-.45-1-1V7c0-1.65-1.35-3-3-3h-3v2h3c.55 0 1 .45 1 1v2c0 1.3.84 2.42 2 2.83v.34c-1.16.41-2 1.52-2 2.83v2c0 .55-.45 1-1 1h-3v2h3c1.65 0 3-1.35 3-3v-2c0-.55.45-1 1-1h1v-4z"}),"DataObject");var Zz={},cst=ct;Object.defineProperty(Zz,"__esModule",{value:!0});var yfe=Zz.default=void 0,ust=cst(pt()),fst=w;yfe=Zz.default=(0,ust.default)((0,fst.jsx)("path",{d:"M19 5v14H5V5zm1.1-2H3.9c-.5 0-.9.4-.9.9v16.2c0 .4.4.9.9.9h16.2c.4 0 .9-.5.9-.9V3.9c0-.5-.5-.9-.9-.9M11 7h6v2h-6zm0 4h6v2h-6zm0 4h6v2h-6zM7 7h2v2H7zm0 4h2v2H7zm0 4h2v2H7z"}),"ListAlt");var Jz={},dst=ct;Object.defineProperty(Jz,"__esModule",{value:!0});var xfe=Jz.default=void 0,hst=dst(pt()),pst=w;xfe=Jz.default=(0,hst.default)((0,pst.jsx)("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7m0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5"}),"Place");var e4={},mst=ct;Object.defineProperty(e4,"__esModule",{value:!0});var bfe=e4.default=void 0,gst=mst(pt()),vst=w;bfe=e4.default=(0,gst.default)((0,vst.jsx)("path",{d:"M2.5 4v3h5v12h3V7h5V4zm19 5h-9v3h3v7h3v-7h3z"}),"TextFields");var t4={},yst=ct;Object.defineProperty(t4,"__esModule",{value:!0});var _fe=t4.default=void 0,xst=yst(pt()),bst=w;_fe=t4.default=(0,xst.default)((0,bst.jsx)("path",{d:"M13 13v8h8v-8zM3 21h8v-8H3zM3 3v8h8V3zm13.66-1.31L11 7.34 16.66 13l5.66-5.66z"}),"Widgets");let Sn=class wfe{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,r){[e,n]=iv(this,e,n);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),Ol.from(i,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=iv(this,e,n);let r=[];return this.decompose(e,n,r,0),Ol.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new Yx(this),o=new Yx(e);for(let a=n,s=n;;){if(i.next(a),o.next(a),a=0,i.lineBreak!=o.lineBreak||i.done!=o.done||i.value!=o.value)return!1;if(s+=i.value.length,i.done||s>=r)return!0}}iter(e=1){return new Yx(this,e)}iterRange(e,n=this.length){return new Sfe(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new Ofe(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?wfe.empty:e.length<=32?new Cr(e):Ol.from(Cr.split(e,[]))}};class Cr extends Sn{constructor(e,n=_st(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,i){for(let o=0;;o++){let a=this.text[o],s=i+a.length;if((n?r:s)>=e)return new wst(i,s,r,a);i=s+1,r++}}decompose(e,n,r,i){let o=e<=0&&n>=this.length?this:new Cr(z9(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(i&1){let a=r.pop(),s=kC(o.text,a.text.slice(),0,o.length);if(s.length<=32)r.push(new Cr(s,a.length+o.length));else{let l=s.length>>1;r.push(new Cr(s.slice(0,l)),new Cr(s.slice(l)))}}else r.push(o)}replace(e,n,r){if(!(r instanceof Cr))return super.replace(e,n,r);[e,n]=iv(this,e,n);let i=kC(this.text,kC(r.text,z9(this.text,0,e)),n),o=this.length+r.length-(n-e);return i.length<=32?new Cr(i,o):Ol.from(Cr.split(i,[]),o)}sliceString(e,n=this.length,r=` + */Jce();function tue(t={}){const{baseClasses:e,newClasses:n,Component:r}=t;if(!n)return e;const i=j({},e);return Object.keys(n).forEach(o=>{n[o]&&(i[o]=`${e[o]} ${n[o]}`)}),i}const vJe={set:(t,e,n,r)=>{let i=t.get(e);i||(i=new Map,t.set(e,i)),i.set(n,r)},get:(t,e,n)=>{const r=t.get(e);return r?r.get(n):void 0},delete:(t,e,n)=>{t.get(e).delete(n)}},Km=vJe;function nue(){var t;const e=qj();return(t=e==null?void 0:e.$$material)!=null?t:e}const yJe=["checked","disabled","error","focused","focusVisible","required","expanded","selected"];function xJe(t={}){const{disableGlobal:e=!1,productionPrefix:n="jss",seed:r=""}=t,i=r===""?"":`${r}-`;let o=0;const a=()=>(o+=1,o);return(s,l)=>{const c=l.options.name;if(c&&c.indexOf("Mui")===0&&!l.options.link&&!e){if(yJe.indexOf(s.key)!==-1)return`Mui-${s.key}`;const u=`${i}${c}-${s.key}`;return!l.options.theme[Jne]||r!==""?u:`${u}-${a()}`}return`${i}${n}${a()}`}}var rue=Date.now(),fR="fnValues"+rue,dR="fnStyle"+ ++rue,bJe=function(){return{onCreateRule:function(n,r,i){if(typeof r!="function")return null;var o=wz(n,{},i);return o[dR]=r,o},onProcessStyle:function(n,r){if(fR in r||dR in r)return n;var i={};for(var o in n){var a=n[o];typeof a=="function"&&(delete n[o],i[o]=a)}return r[fR]=i,n},onUpdate:function(n,r,i,o){var a=r,s=a[dR];s&&(a.style=s(n)||{});var l=a[fR];if(l)for(var c in l)a.prop(c,l[c](n),o)}}},$f="@global",U$="@global ",_Je=function(){function t(n,r,i){this.type="global",this.at=$f,this.isProcessed=!1,this.key=n,this.options=i,this.rules=new O2(j({},i,{parent:this}));for(var o in r)this.rules.add(o,r[o]);this.rules.process()}var e=t.prototype;return e.getRule=function(r){return this.rules.get(r)},e.addRule=function(r,i,o){var a=this.rules.add(r,i,o);return a&&this.options.jss.plugins.onProcessRule(a),a},e.replaceRule=function(r,i,o){var a=this.rules.replace(r,i,o);return a&&this.options.jss.plugins.onProcessRule(a),a},e.indexOf=function(r){return this.rules.indexOf(r)},e.toString=function(r){return this.rules.toString(r)},t}(),wJe=function(){function t(n,r,i){this.type="global",this.at=$f,this.isProcessed=!1,this.key=n,this.options=i;var o=n.substr(U$.length);this.rule=i.jss.createRule(o,r,j({},i,{parent:this}))}var e=t.prototype;return e.toString=function(r){return this.rule?this.rule.toString(r):""},t}(),SJe=/\s*,\s*/g;function iue(t,e){for(var n=t.split(SJe),r="",i=0;i-1){var o=cue[e];if(!Array.isArray(o))return $t.js+Kf(o)in n?$t.css+o:!1;if(!i)return!1;for(var a=0;ar?1:-1:n.length-r.length};return{onProcessStyle:function(n,r){if(r.type!=="style")return n;for(var i={},o=Object.keys(n).sort(t),a=0;a"u"?null:vet(),yet()]}}const bet=Jce(xet()),_et=xJe(),wet=new Map,Oet={disableGeneration:!1,generateClassName:_et,jss:bet,sheetsCache:null,sheetsManager:wet,sheetsRegistry:null},Cet=M.createContext(Oet);let h9=-1e9;function Tet(){return h9+=1,h9}const Eet=["variant"];function p9(t){return t.length===0}function Pet(t){const{variant:e}=t,n=Ae(t,Eet);let r=e||"";return Object.keys(n).sort().forEach(i=>{i==="color"?r+=p9(r)?t[i]:De(t[i]):r+=`${p9(r)?i:De(i)}${De(t[i].toString())}`}),r}const Met={},ket=Met;function Aet(t){const e=typeof t=="function";return{create:(n,r)=>{let i;try{i=e?t(n):t}catch(l){throw l}if(!r||!n.components||!n.components[r]||!n.components[r].styleOverrides&&!n.components[r].variants)return i;const o=n.components[r].styleOverrides||{},a=n.components[r].variants||[],s=j({},i);return Object.keys(o).forEach(l=>{s[l]=Ii(s[l]||{},o[l])}),a.forEach(l=>{const c=Pet(l.props);s[c]=Ii(s[c]||{},l.style)}),s},options:{}}}const Ret=["name","classNamePrefix","Component","defaultTheme"];function Iet({state:t,stylesOptions:e},n,r){if(e.disableGeneration)return n||{};t.cacheClasses||(t.cacheClasses={value:null,lastProp:null,lastJSS:{}});let i=!1;return t.classes!==t.cacheClasses.lastJSS&&(t.cacheClasses.lastJSS=t.classes,i=!0),n!==t.cacheClasses.lastProp&&(t.cacheClasses.lastProp=n,i=!0),i&&(t.cacheClasses.value=tue({baseClasses:t.cacheClasses.lastJSS,newClasses:n,Component:r})),t.cacheClasses.value}function Det({state:t,theme:e,stylesOptions:n,stylesCreator:r,name:i},o){if(n.disableGeneration)return;let a=Km.get(n.sheetsManager,r,e);a||(a={refs:0,staticSheet:null,dynamicStyles:null},Km.set(n.sheetsManager,r,e,a));const s=j({},r.options,n,{theme:e,flip:typeof n.flip=="boolean"?n.flip:e.direction==="rtl"});s.generateId=s.serverGenerateClassName||s.generateClassName;const l=n.sheetsRegistry;if(a.refs===0){let c;n.sheetsCache&&(c=Km.get(n.sheetsCache,r,e));const u=r.create(e,i);c||(c=n.jss.createStyleSheet(u,j({link:!1},s)),c.attach(),n.sheetsCache&&Km.set(n.sheetsCache,r,e,c)),l&&l.add(c),a.staticSheet=c,a.dynamicStyles=eue(u)}if(a.dynamicStyles){const c=n.jss.createStyleSheet(a.dynamicStyles,j({link:!0},s));c.update(o),c.attach(),t.dynamicSheet=c,t.classes=tue({baseClasses:a.staticSheet.classes,newClasses:c.classes}),l&&l.add(c)}else t.classes=a.staticSheet.classes;a.refs+=1}function Let({state:t},e){t.dynamicSheet&&t.dynamicSheet.update(e)}function $et({state:t,theme:e,stylesOptions:n,stylesCreator:r}){if(n.disableGeneration)return;const i=Km.get(n.sheetsManager,r,e);i.refs-=1;const o=n.sheetsRegistry;i.refs===0&&(Km.delete(n.sheetsManager,r,e),n.jss.removeStyleSheet(i.staticSheet),o&&o.remove(i.staticSheet)),t.dynamicSheet&&(n.jss.removeStyleSheet(t.dynamicSheet),o&&o.remove(t.dynamicSheet))}function Net(t,e){const n=M.useRef([]);let r;const i=M.useMemo(()=>({}),e);n.current!==i&&(n.current=i,r=t()),M.useEffect(()=>()=>{r&&r()},[i])}function Fet(t,e={}){const{name:n,classNamePrefix:r,Component:i,defaultTheme:o=ket}=e,a=Ae(e,Ret),s=Aet(t),l=n||r||"makeStyles";return s.options={index:Tet(),name:n,meta:l,classNamePrefix:l},(u={})=>{const f=nue()||o,d=j({},M.useContext(Cet),a),h=M.useRef(),p=M.useRef();return Net(()=>{const g={name:n,state:{},stylesCreator:s,stylesOptions:d,theme:f};return Det(g,u),p.current=!1,h.current=g,()=>{$et(g)}},[f,s]),M.useEffect(()=>{p.current&&Let(h.current,u),p.current=!0}),Iet(h.current,u.classes,i)}}function jet(t){const{theme:e,name:n,props:r}=t;if(!e||!e.components||!e.components[n]||!e.components[n].defaultProps)return r;const i=j({},r),o=e.components[n].defaultProps;let a;for(a in o)i[a]===void 0&&(i[a]=o[a]);return i}const Bet=["defaultTheme","withTheme","name"],zet=["classes"],Uet=(t,e={})=>n=>{const{defaultTheme:r,withTheme:i=!1,name:o}=e,a=Ae(e,Bet);let s=o;const l=Fet(t,j({defaultTheme:r,Component:n,name:o||n.displayName,classNamePrefix:s},a)),c=M.forwardRef(function(f,d){const h=Ae(f,zet),p=l(j({},n.defaultProps,f));let m,g=h;return(typeof o=="string"||i)&&(m=nue()||r,o&&(g=jet({theme:m,name:o,props:h})),i&&!g.theme&&(g.theme=m)),w.jsx(n,j({ref:d,classes:p},g))});return xL(c,n),c},Wet=t=>({components:{MuiLocalizationProvider:{defaultProps:{localeText:j({},t)}}}}),fue={previousMonth:"Previous month",nextMonth:"Next month",openPreviousView:"open previous view",openNextView:"open next view",calendarViewSwitchingButtonAriaLabel:t=>t==="year"?"year view is open, switch to calendar view":"calendar view is open, switch to year view",inputModeToggleButtonAriaLabel:(t,e)=>t?`text input view is open, go to ${e} view`:`${e} view is open, go to text input view`,start:"Start",end:"End",cancelButtonLabel:"Cancel",clearButtonLabel:"Clear",okButtonLabel:"OK",todayButtonLabel:"Today",datePickerDefaultToolbarTitle:"Select date",dateTimePickerDefaultToolbarTitle:"Select date & time",timePickerDefaultToolbarTitle:"Select time",dateRangePickerDefaultToolbarTitle:"Select date range",clockLabelText:(t,e,n)=>`Select ${t}. ${e===null?"No time selected":`Selected time is ${n.format(e,"fullTime")}`}`,hoursClockNumberText:t=>`${t} hours`,minutesClockNumberText:t=>`${t} minutes`,secondsClockNumberText:t=>`${t} seconds`,openDatePickerDialogue:(t,e)=>t&&e.isValid(e.date(t))?`Choose date, selected date is ${e.format(e.date(t),"fullDate")}`:"Choose date",openTimePickerDialogue:(t,e)=>t&&e.isValid(e.date(t))?`Choose time, selected time is ${e.format(e.date(t),"fullTime")}`:"Choose time",timeTableLabel:"pick time",dateTableLabel:"pick date"},Vet=fue;Wet(fue);const due=M.createContext(null);function Get(t){const e=qe({props:t,name:"MuiLocalizationProvider"}),{children:n,dateAdapter:r,dateFormats:i,dateLibInstance:o,locale:a,adapterLocale:s,localeText:l}=e,c=M.useMemo(()=>new r({locale:s??a,formats:i,instance:o}),[r,a,s,i,o]),u=M.useMemo(()=>({minDate:c.date("1900-01-01T00:00:00.000"),maxDate:c.date("2099-12-31T00:00:00.000")}),[c]),f=M.useMemo(()=>({utils:c,defaultDates:u,localeText:j({},Vet,l??{})}),[u,c,l]);return w.jsx(due.Provider,{value:f,children:n})}var G$={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=function(l,c){switch(l){case"P":return c.date({width:"short"});case"PP":return c.date({width:"medium"});case"PPP":return c.date({width:"long"});case"PPPP":default:return c.date({width:"full"})}},r=function(l,c){switch(l){case"p":return c.time({width:"short"});case"pp":return c.time({width:"medium"});case"ppp":return c.time({width:"long"});case"pppp":default:return c.time({width:"full"})}},i=function(l,c){var u=l.match(/(P+)(p+)?/)||[],f=u[1],d=u[2];if(!d)return n(l,c);var h;switch(f){case"P":h=c.dateTime({width:"short"});break;case"PP":h=c.dateTime({width:"medium"});break;case"PPP":h=c.dateTime({width:"long"});break;case"PPPP":default:h=c.dateTime({width:"full"});break}return h.replace("{{date}}",n(f,c)).replace("{{time}}",r(d,c))},o={p:r,P:i},a=o;e.default=a,t.exports=e.default})(G$,G$.exports);var Het=G$.exports;const hue=Nt(Het),qet={dayOfMonth:"d",fullDate:"PP",fullDateWithWeekday:"PPPP",fullDateTime:"PP p",fullDateTime12h:"PP hh:mm aaa",fullDateTime24h:"PP HH:mm",fullTime:"p",fullTime12h:"hh:mm aaa",fullTime24h:"HH:mm",hours12h:"hh",hours24h:"HH",keyboardDate:"P",keyboardDateTime:"P p",keyboardDateTime12h:"P hh:mm aaa",keyboardDateTime24h:"P HH:mm",minutes:"mm",month:"LLLL",monthAndDate:"MMMM d",monthAndYear:"LLLL yyyy",monthShort:"MMM",weekday:"EEEE",weekdayShort:"EEE",normalDate:"d MMMM",normalDateWithWeekday:"EEE, MMM d",seconds:"ss",shortDate:"MMM d",year:"yyyy"};class Xet{constructor({locale:e,formats:n}={}){this.lib="date-fns",this.is12HourCycleInCurrentLocale=()=>{var r;return this.locale?/a/.test((r=this.locale.formatLong)===null||r===void 0?void 0:r.time()):!0},this.getFormatHelperText=r=>{var i,o;const a=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,s=this.locale||u2;return(o=(i=r.match(a))===null||i===void 0?void 0:i.map(l=>{const c=l[0];if(c==="p"||c==="P"){const u=hue[c];return u(l,s.formatLong,{})}return l}).join("").replace(/(aaa|aa|a)/g,"(a|p)m").toLocaleLowerCase())!==null&&o!==void 0?o:r},this.parseISO=r=>Iae(r),this.toISO=r=>CVe(r,{format:"extended"}),this.getCurrentLocaleCode=()=>{var r;return((r=this.locale)===null||r===void 0?void 0:r.code)||"en-US"},this.addSeconds=(r,i)=>sWe(r,i),this.addMinutes=(r,i)=>aWe(r,i),this.addHours=(r,i)=>tWe(r,i),this.addDays=(r,i)=>h$(r,i),this.addWeeks=(r,i)=>lWe(r,i),this.addMonths=(r,i)=>TC(r,i),this.addYears=(r,i)=>XG(r,i),this.isValid=r=>gae(this.date(r)),this.getDiff=(r,i,o)=>{var a;const s=(a=this.date(i))!==null&&a!==void 0?a:r;if(!this.isValid(s))return 0;switch(o){case"years":return _We(r,s);case"quarters":return yWe(r,s);case"months":return yae(r,s);case"weeks":return bWe(r,s);case"days":return vae(r,s);case"hours":return mWe(r,s);case"minutes":return gWe(r,s);case"seconds":return xWe(r,s);default:return c2(r,s)}},this.isAfter=(r,i)=>TS(r,i),this.isBefore=(r,i)=>em(r,i),this.startOfDay=r=>tv(r),this.endOfDay=r=>p$(r),this.getHours=r=>PVe(r),this.setHours=(r,i)=>Y8e(r,i),this.setMinutes=(r,i)=>K8e(r,i),this.getSeconds=r=>AVe(r),this.setSeconds=(r,i)=>Z8e(r,i),this.isSameDay=(r,i)=>uWe(r,i),this.isSameMonth=(r,i)=>k8e(r,i),this.isSameYear=(r,i)=>A8e(r,i),this.isSameHour=(r,i)=>M8e(r,i),this.startOfYear=r=>CS(r),this.endOfYear=r=>VA(r),this.startOfMonth=r=>OS(r),this.endOfMonth=r=>m$(r),this.startOfWeek=r=>WA(r,{locale:this.locale}),this.endOfWeek=r=>GA(r,{locale:this.locale}),this.getYear=r=>RVe(r),this.setYear=(r,i)=>J8e(r,i),this.date=r=>typeof r>"u"?new Date:r===null?null:new Date(r),this.toJsDate=r=>r,this.parse=(r,i)=>r===""?null:E8e(r,i,new Date,{locale:this.locale}),this.format=(r,i)=>this.formatByString(r,this.formats[i]),this.formatByString=(r,i)=>wVe(r,i,{locale:this.locale}),this.isEqual=(r,i)=>r===null&&i===null?!0:IVe(r,i),this.isNull=r=>r===null,this.isAfterDay=(r,i)=>TS(r,p$(i)),this.isBeforeDay=(r,i)=>em(r,tv(i)),this.isBeforeYear=(r,i)=>em(r,CS(i)),this.isAfterYear=(r,i)=>TS(r,VA(i)),this.isWithinRange=(r,[i,o])=>R8e(r,{start:i,end:o}),this.formatNumber=r=>r,this.getMinutes=r=>MVe(r),this.getDate=r=>TVe(r),this.setDate=(r,i)=>Q8e(r,i),this.getMonth=r=>kVe(r),this.getDaysInMonth=r=>Tae(r),this.setMonth=(r,i)=>X8e(r,i),this.getMeridiemText=r=>r==="am"?"AM":"PM",this.getNextMonth=r=>TC(r,1),this.getPreviousMonth=r=>TC(r,-1),this.getMonthArray=r=>{const o=[CS(r)];for(;o.length<12;){const a=o[o.length-1];o.push(this.getNextMonth(a))}return o},this.mergeDateAndTime=(r,i)=>this.setSeconds(this.setMinutes(this.setHours(r,this.getHours(i)),this.getMinutes(i)),this.getSeconds(i)),this.getWeekdays=()=>{const r=new Date;return wWe({start:WA(r,{locale:this.locale}),end:GA(r,{locale:this.locale})}).map(i=>this.formatByString(i,"EEEEEE"))},this.getWeekArray=r=>{const i=WA(OS(r),{locale:this.locale}),o=GA(m$(r),{locale:this.locale});let a=0,s=i;const l=[];let c=null;for(;em(s,o);){const u=Math.floor(a/7);l[u]=l[u]||[];const f=EVe(s);c!==f&&(c=f,l[u].push(s),a+=1),s=h$(s,1)}return l},this.getYearRange=(r,i)=>{const o=CS(r),a=VA(i),s=[];let l=o;for(;em(l,a);)s.push(l),l=XG(l,1);return s},this.locale=e,this.formats=Object.assign({},qet,n)}isBeforeMonth(e,n){return em(e,OS(n))}isAfterMonth(e,n){return TS(e,OS(n))}}const Qet={y:"year",yy:"year",yyy:"year",yyyy:"year",MMMM:"month",MM:"month",DD:"day",d:"day",dd:"day",H:"hour",HH:"hour",h:"hour",hh:"hour",mm:"minute",ss:"second",a:"am-pm",aa:"am-pm",aaa:"am-pm"};class Yet extends Xet{constructor(...e){super(...e),this.formatTokenMap=Qet,this.expandFormat=n=>{const r=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;return n.match(r).map(i=>{const o=i[0];if(o==="p"||o==="P"){const a=hue[o],s=this.locale||u2;return a(i,s.formatLong,{})}return i}).join("")},this.getFormatHelperText=n=>this.expandFormat(n).replace(/(aaa|aa|a)/g,"(a|p)m").toLocaleLowerCase()}}const iw=()=>{const t=M.useContext(due);if(t===null)throw new Error("MUI: Can not find utils in context. It looks like you forgot to wrap your component in LocalizationProvider, or pass dateAdapter prop directly.");return t},wr=()=>iw().utils,C2=()=>iw().defaultDates,yd=()=>iw().localeText,ow=()=>{const t=wr();return M.useRef(t.date()).current},Qx=({date:t,disableFuture:e,disablePast:n,maxDate:r,minDate:i,isDateDisabled:o,utils:a})=>{const s=a.startOfDay(a.date());n&&a.isBefore(i,s)&&(i=s),e&&a.isAfter(r,s)&&(r=s);let l=t,c=t;for(a.isBefore(t,i)&&(l=a.date(i),c=null),a.isAfter(t,r)&&(c&&(c=a.date(r)),l=null);l||c;){if(l&&a.isAfter(l,r)&&(l=null),c&&a.isBefore(c,i)&&(c=null),l){if(!o(l))return l;l=a.addDays(l,1)}if(c){if(!o(c))return c;c=a.addDays(c,-1)}}return null},Ket=(t,e)=>{const n=t.date(e);return t.isValid(n)?n:null},Zl=(t,e,n)=>{if(e==null)return n;const r=t.date(e);return t.isValid(r)?r:n};function pue(t,e){var n,r,i,o,a;const s=qe({props:t,name:e}),l=wr(),c=C2(),u=(n=s.ampm)!=null?n:l.is12HourCycleInCurrentLocale();if(s.orientation!=null&&s.orientation!=="portrait")throw new Error("We are not supporting custom orientation for DateTimePicker yet :(");return j({ampm:u,orientation:"portrait",openTo:"day",views:["year","day","hours","minutes"],ampmInClock:!0,acceptRegex:u?/[\dap]/gi:/\d/gi,disableMaskedInput:!1,inputFormat:u?l.formats.keyboardDateTime12h:l.formats.keyboardDateTime24h,disableIgnoringDatePartForTimeValidation:!!(s.minDateTime||s.maxDateTime),disablePast:!1,disableFuture:!1},s,{minDate:Zl(l,(r=s.minDateTime)!=null?r:s.minDate,c.minDate),maxDate:Zl(l,(i=s.maxDateTime)!=null?i:s.maxDate,c.maxDate),minTime:(o=s.minDateTime)!=null?o:s.minTime,maxTime:(a=s.maxDateTime)!=null?a:s.maxTime})}const mue={emptyValue:null,getTodayValue:t=>t.date(),parseInput:Ket,areValuesEqual:(t,e,n)=>t.isEqual(e,n)},Zet=t=>{switch(t){case"year":case"month":case"day":return"calendar";default:return"clock"}};function gue(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e{const{classes:e,selected:n}=t;return Ue({root:["root",n&&"selected"]},Jet,e)},ntt=we(At,{name:"PrivatePickersToolbarText",slot:"Root",overridesResolver:(t,e)=>[e.root,{[`&.${m9.selected}`]:e.selected}]})(({theme:t})=>({transition:t.transitions.create("color"),color:t.palette.text.secondary,[`&.${m9.selected}`]:{color:t.palette.text.primary}})),vue=M.forwardRef(function(e,n){const{className:r,value:i}=e,o=Ae(e,ett),a=ttt(e);return w.jsx(ntt,j({ref:n,className:Ur(r,a.root),component:"span"},o,{children:i}))}),rtt=ti(w.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),itt=ti(w.jsx("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}),"ArrowLeft"),ott=ti(w.jsx("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"ArrowRight"),yue=ti(w.jsx("path",{d:"M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z"}),"Calendar"),att=ti(w.jsxs(M.Fragment,{children:[w.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),w.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Clock"),stt=ti(w.jsx("path",{d:"M9 11H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm2-7h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11z"}),"DateRange"),ltt=ti(w.jsx("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 00-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"}),"Pen"),ctt=ti(w.jsxs(M.Fragment,{children:[w.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),w.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Time");function xue(t){return We("MuiPickersToolbar",t)}const bue=Ve("MuiPickersToolbar",["root","content","penIconButton","penIconButtonLandscape"]),utt=t=>{const{classes:e,isLandscape:n}=t;return Ue({root:["root"],content:["content"],penIconButton:["penIconButton",n&&"penIconButtonLandscape"]},xue,e)},ftt=we("div",{name:"MuiPickersToolbar",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t,ownerState:e})=>j({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"space-between",padding:t.spacing(2,3)},e.isLandscape&&{height:"auto",maxWidth:160,padding:16,justifyContent:"flex-start",flexWrap:"wrap"})),dtt=we(wC,{name:"MuiPickersToolbar",slot:"Content",overridesResolver:(t,e)=>e.content})(({ownerState:t})=>j({flex:1},!t.isLandscape&&{alignItems:"center"})),htt=we(Ot,{name:"MuiPickersToolbar",slot:"PenIconButton",overridesResolver:(t,e)=>[{[`&.${bue.penIconButtonLandscape}`]:e.penIconButtonLandscape},e.penIconButton]})({}),ptt=t=>t==="clock"?w.jsx(att,{color:"inherit"}):w.jsx(yue,{color:"inherit"}),mtt=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiPickersToolbar"}),{children:i,className:o,getMobileKeyboardInputViewButtonText:a,isLandscape:s,isMobileKeyboardViewOpen:l,landscapeDirection:c="column",toggleMobileKeyboardView:u,toolbarTitle:f,viewType:d="calendar"}=r,h=r,p=yd(),m=utt(h);return w.jsxs(ftt,{ref:n,className:Ur(m.root,o),ownerState:h,children:[w.jsx(At,{color:"text.secondary",variant:"overline",children:f}),w.jsxs(dtt,{container:!0,justifyContent:"space-between",className:m.content,ownerState:h,direction:s?c:"row",alignItems:s?"flex-start":"flex-end",children:[i,w.jsx(htt,{onClick:u,className:m.penIconButton,ownerState:h,color:"inherit","aria-label":a?a(l,d):p.inputModeToggleButtonAriaLabel(l,d),children:l?ptt(d):w.jsx(ltt,{color:"inherit"})})]})]})}),gtt=["align","className","selected","typographyClassName","value","variant"],vtt=t=>{const{classes:e}=t;return Ue({root:["root"]},xue,e)},ytt=we(er,{name:"MuiPickersToolbarButton",slot:"Root",overridesResolver:(t,e)=>e.root})({padding:0,minWidth:16,textTransform:"none"}),C0=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiPickersToolbarButton"}),{align:i,className:o,selected:a,typographyClassName:s,value:l,variant:c}=r,u=Ae(r,gtt),f=vtt(r);return w.jsx(ytt,j({variant:"text",ref:n,className:Ur(o,f.root)},u,{children:w.jsx(vue,{align:i,className:s,variant:c,value:l,selected:a})}))});function xtt(t){return We("MuiDateTimePickerToolbar",t)}Ve("MuiDateTimePickerToolbar",["root","dateContainer","timeContainer","separator"]);const btt=["ampm","parsedValue","isMobileKeyboardViewOpen","onChange","openView","setOpenView","toggleMobileKeyboardView","toolbarFormat","toolbarPlaceholder","toolbarTitle","views"],_tt=t=>{const{classes:e}=t;return Ue({root:["root"],dateContainer:["dateContainer"],timeContainer:["timeContainer"],separator:["separator"]},xtt,e)},wtt=we(mtt,{name:"MuiDateTimePickerToolbar",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({paddingLeft:16,paddingRight:16,justifyContent:"space-around",position:"relative",[`& .${bue.penIconButton}`]:j({position:"absolute",top:8},t.direction==="rtl"?{left:8}:{right:8})})),Stt=we("div",{name:"MuiDateTimePickerToolbar",slot:"DateContainer",overridesResolver:(t,e)=>e.dateContainer})({display:"flex",flexDirection:"column",alignItems:"flex-start"}),Ott=we("div",{name:"MuiDateTimePickerToolbar",slot:"TimeContainer",overridesResolver:(t,e)=>e.timeContainer})({display:"flex"}),g9=we(vue,{name:"MuiDateTimePickerToolbar",slot:"Separator",overridesResolver:(t,e)=>e.separator})({margin:"0 4px 0 2px",cursor:"default"});function _ue(t){const e=qe({props:t,name:"MuiDateTimePickerToolbar"}),{ampm:n,parsedValue:r,isMobileKeyboardViewOpen:i,openView:o,setOpenView:a,toggleMobileKeyboardView:s,toolbarFormat:l,toolbarPlaceholder:c="––",toolbarTitle:u,views:f}=e,d=Ae(e,btt),h=e,p=wr(),m=yd(),g=_tt(h),v=u??m.dateTimePickerDefaultToolbarTitle,y=b=>n?p.format(b,"hours12h"):p.format(b,"hours24h"),x=M.useMemo(()=>r?l?p.formatByString(r,l):p.format(r,"shortDate"):c,[r,l,c,p]);return w.jsxs(wtt,j({toolbarTitle:v,isMobileKeyboardViewOpen:i,toggleMobileKeyboardView:s,className:g.root,viewType:Zet(o)},d,{isLandscape:!1,ownerState:h,children:[w.jsxs(Stt,{className:g.dateContainer,ownerState:h,children:[f.includes("year")&&w.jsx(C0,{tabIndex:-1,variant:"subtitle1",onClick:()=>a("year"),selected:o==="year",value:r?p.format(r,"year"):"–"}),f.includes("day")&&w.jsx(C0,{tabIndex:-1,variant:"h4",onClick:()=>a("day"),selected:o==="day",value:x})]}),w.jsxs(Ott,{className:g.timeContainer,ownerState:h,children:[f.includes("hours")&&w.jsx(C0,{variant:"h3",onClick:()=>a("hours"),selected:o==="hours",value:r?y(r):"--"}),f.includes("minutes")&&w.jsxs(M.Fragment,{children:[w.jsx(g9,{variant:"h3",value:":",className:g.separator,ownerState:h}),w.jsx(C0,{variant:"h3",onClick:()=>a("minutes"),selected:o==="minutes",value:r?p.format(r,"minutes"):"--"})]}),f.includes("seconds")&&w.jsxs(M.Fragment,{children:[w.jsx(g9,{variant:"h3",value:":",className:g.separator,ownerState:h}),w.jsx(C0,{variant:"h3",onClick:()=>a("seconds"),selected:o==="seconds",value:r?p.format(r,"seconds"):"--"})]})]})]}))}const xd=M.createContext(null),Ctt=["onAccept","onClear","onCancel","onSetToday","actions"],wue=t=>{const{onAccept:e,onClear:n,onCancel:r,onSetToday:i,actions:o}=t,a=Ae(t,Ctt),s=M.useContext(xd),l=yd(),c=typeof o=="function"?o(s):o;if(c==null||c.length===0)return null;const u=c==null?void 0:c.map(f=>{switch(f){case"clear":return w.jsx(er,{onClick:n,children:l.clearButtonLabel},f);case"cancel":return w.jsx(er,{onClick:r,children:l.cancelButtonLabel},f);case"accept":return w.jsx(er,{onClick:e,children:l.okButtonLabel},f);case"today":return w.jsx(er,{onClick:i,children:l.todayButtonLabel},f);default:return null}});return w.jsx(yp,j({},a,{children:u}))};function Ttt(t){return We("MuiPickersPopper",t)}Ve("MuiPickersPopper",["root","paper"]);function Sue(t,e){return Array.isArray(e)?e.every(n=>t.indexOf(n)!==-1):t.indexOf(e)!==-1}const Oue=(t,e)=>n=>{(n.key==="Enter"||n.key===" ")&&(t(n),n.preventDefault(),n.stopPropagation()),e&&e(n)},Cue=(t=document)=>{const e=t.activeElement;return e?e.shadowRoot?Cue(e.shadowRoot):e:null},Ett=["onClick","onTouchStart"],Ptt=t=>{const{classes:e}=t;return Ue({root:["root"],paper:["paper"]},Ttt,e)},Mtt=we(d5,{name:"MuiPickersPopper",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({zIndex:t.zIndex.modal})),ktt=we(Go,{name:"MuiPickersPopper",slot:"Paper",overridesResolver:(t,e)=>e.paper})(({ownerState:t})=>j({transformOrigin:"top center",outline:0},t.placement==="top"&&{transformOrigin:"bottom center"}));function Att(t,e){return e.documentElement.clientWidth{if(!t)return;function l(){o.current=!0}return document.addEventListener("mousedown",l,!0),document.addEventListener("touchstart",l,!0),()=>{document.removeEventListener("mousedown",l,!0),document.removeEventListener("touchstart",l,!0),o.current=!1}},[t]);const a=br(l=>{if(!o.current)return;const c=r.current;r.current=!1;const u=$n(i.current);if(!i.current||"clientX"in l&&Att(l,u))return;if(n.current){n.current=!1;return}let f;l.composedPath?f=l.composedPath().indexOf(i.current)>-1:f=!u.documentElement.contains(l.target)||i.current.contains(l.target),!f&&!c&&e(l)}),s=()=>{r.current=!0};return M.useEffect(()=>{if(t){const l=$n(i.current),c=()=>{n.current=!0};return l.addEventListener("touchstart",a),l.addEventListener("touchmove",c),()=>{l.removeEventListener("touchstart",a),l.removeEventListener("touchmove",c)}}},[t,a]),M.useEffect(()=>{if(t){const l=$n(i.current);return l.addEventListener("click",a),()=>{l.removeEventListener("click",a),r.current=!1}}},[t,a]),[i,s,s]}function Itt(t){var e;const n=qe({props:t,name:"MuiPickersPopper"}),{anchorEl:r,children:i,containerRef:o=null,onBlur:a,onClose:s,onClear:l,onAccept:c,onCancel:u,onSetToday:f,open:d,PopperProps:h,role:p,TransitionComponent:m=Rb,TrapFocusProps:g,PaperProps:v={},components:y,componentsProps:x}=n;M.useEffect(()=>{function U(N){d&&(N.key==="Escape"||N.key==="Esc")&&s()}return document.addEventListener("keydown",U),()=>{document.removeEventListener("keydown",U)}},[s,d]);const b=M.useRef(null);M.useEffect(()=>{p!=="tooltip"&&(d?b.current=Cue(document):b.current&&b.current instanceof HTMLElement&&setTimeout(()=>{b.current instanceof HTMLElement&&b.current.focus()}))},[d,p]);const[_,S,O]=Rtt(d,a??s),C=M.useRef(null),E=Zt(C,o),k=Zt(E,_),I=n,P=Ptt(I),{onClick:R,onTouchStart:T}=v,L=Ae(v,Ett),z=U=>{U.key==="Escape"&&(U.stopPropagation(),s())},B=(e=y==null?void 0:y.ActionBar)!=null?e:wue,W=(y==null?void 0:y.PaperContent)||M.Fragment;return w.jsx(Mtt,j({transition:!0,role:p,open:d,anchorEl:r,onKeyDown:z,className:P.root},h,{children:({TransitionProps:U,placement:N})=>w.jsx(xre,j({open:d,disableAutoFocus:!0,disableRestoreFocus:!0,disableEnforceFocus:p==="tooltip",isEnabled:()=>!0},g,{children:w.jsx(m,j({},U,{children:w.jsx(ktt,j({tabIndex:-1,elevation:8,ref:k,onClick:$=>{S($),R&&R($)},onTouchStart:$=>{O($),T&&T($)},ownerState:j({},I,{placement:N}),className:P.paper},L,{children:w.jsxs(W,j({},x==null?void 0:x.paperContent,{children:[i,w.jsx(B,j({onAccept:c,onClear:l,onCancel:u,onSetToday:f,actions:[]},x==null?void 0:x.actionBar))]}))}))}))}))}))}function Dtt(t){const{children:e,DateInputProps:n,KeyboardDateInputComponent:r,onClear:i,onDismiss:o,onCancel:a,onAccept:s,onSetToday:l,open:c,PopperProps:u,PaperProps:f,TransitionComponent:d,components:h,componentsProps:p}=t,m=M.useRef(null),g=Zt(n.inputRef,m);return w.jsxs(xd.Provider,{value:"desktop",children:[w.jsx(r,j({},n,{inputRef:g})),w.jsx(Itt,{role:"dialog",open:c,anchorEl:m.current,TransitionComponent:d,PopperProps:u,PaperProps:f,onClose:o,onCancel:a,onClear:i,onAccept:s,onSetToday:l,components:h,componentsProps:p,children:e})]})}function Tz({onChange:t,onViewChange:e,openTo:n,view:r,views:i}){var o,a;const[s,l]=Hs({name:"Picker",state:"view",controlled:r,default:n&&Sue(i,n)?n:i[0]}),c=(o=i[i.indexOf(s)-1])!=null?o:null,u=(a=i[i.indexOf(s)+1])!=null?a:null,f=M.useCallback(p=>{l(p),e&&e(p)},[l,e]),d=M.useCallback(()=>{u&&f(u)},[u,f]);return{handleChangeAndOpenNext:M.useCallback((p,m)=>{const g=m==="finish";t(p,g&&u?"partial":m),g&&d()},[u,t,d]),nextView:u,previousView:c,openNext:d,openView:s,setOpenView:f}}const rv=220,Nf=36,Qb={x:rv/2,y:rv/2},Tue={x:Qb.x,y:0},Ltt=Tue.x-Qb.x,$tt=Tue.y-Qb.y,Ntt=t=>t*(180/Math.PI),Eue=(t,e,n)=>{const r=e-Qb.x,i=n-Qb.y,o=Math.atan2(Ltt,$tt)-Math.atan2(r,i);let a=Ntt(o);a=Math.round(a/t)*t,a%=360;const s=Math.floor(a/t)||0,l=r**2+i**2,c=Math.sqrt(l);return{value:s,distance:c}},Ftt=(t,e,n=1)=>{const r=n*6;let{value:i}=Eue(r,t,e);return i=i*n%60,i},jtt=(t,e,n)=>{const{value:r,distance:i}=Eue(30,t,e);let o=r||12;return n?o%=12:i{const{classes:e}=t;return Ue({root:["root"],thumb:["thumb"]},Btt,e)},Wtt=we("div",{name:"MuiClockPointer",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t,ownerState:e})=>j({width:2,backgroundColor:t.palette.primary.main,position:"absolute",left:"calc(50% - 1px)",bottom:"50%",transformOrigin:"center bottom 0px"},e.shouldAnimate&&{transition:t.transitions.create(["transform","height"])})),Vtt=we("div",{name:"MuiClockPointer",slot:"Thumb",overridesResolver:(t,e)=>e.thumb})(({theme:t,ownerState:e})=>j({width:4,height:4,backgroundColor:t.palette.primary.contrastText,borderRadius:"50%",position:"absolute",top:-21,left:`calc(50% - ${Nf/2}px)`,border:`${(Nf-4)/2}px solid ${t.palette.primary.main}`,boxSizing:"content-box"},e.hasSelected&&{backgroundColor:t.palette.primary.main}));function Gtt(t){const e=qe({props:t,name:"MuiClockPointer"}),{className:n,isInner:r,type:i,value:o}=e,a=Ae(e,ztt),s=M.useRef(i);M.useEffect(()=>{s.current=i},[i]);const l=j({},e,{shouldAnimate:s.current!==i}),c=Utt(l),u=()=>{let d=360/(i==="hours"?12:60)*o;return i==="hours"&&o>12&&(d-=360),{height:Math.round((r?.26:.4)*rv),transform:`rotateZ(${d}deg)`}};return w.jsx(Wtt,j({style:u(),className:Ur(n,c.root),ownerState:l},a,{children:w.jsx(Vtt,{ownerState:l,className:c.thumb})}))}function Htt(t){return We("MuiClock",t)}Ve("MuiClock",["root","clock","wrapper","squareMask","pin","amButton","pmButton"]);const qtt=t=>{const{classes:e}=t;return Ue({root:["root"],clock:["clock"],wrapper:["wrapper"],squareMask:["squareMask"],pin:["pin"],amButton:["amButton"],pmButton:["pmButton"]},Htt,e)},Xtt=we("div",{name:"MuiClock",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({display:"flex",justifyContent:"center",alignItems:"center",margin:t.spacing(2)})),Qtt=we("div",{name:"MuiClock",slot:"Clock",overridesResolver:(t,e)=>e.clock})({backgroundColor:"rgba(0,0,0,.07)",borderRadius:"50%",height:220,width:220,flexShrink:0,position:"relative",pointerEvents:"none"}),Ytt=we("div",{name:"MuiClock",slot:"Wrapper",overridesResolver:(t,e)=>e.wrapper})({"&:focus":{outline:"none"}}),Ktt=we("div",{name:"MuiClock",slot:"SquareMask",overridesResolver:(t,e)=>e.squareMask})(({ownerState:t})=>j({width:"100%",height:"100%",position:"absolute",pointerEvents:"auto",outline:0,touchAction:"none",userSelect:"none"},t.disabled?{}:{"@media (pointer: fine)":{cursor:"pointer",borderRadius:"50%"},"&:active":{cursor:"move"}})),Ztt=we("div",{name:"MuiClock",slot:"Pin",overridesResolver:(t,e)=>e.pin})(({theme:t})=>({width:6,height:6,borderRadius:"50%",backgroundColor:t.palette.primary.main,position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"})),Jtt=we(Ot,{name:"MuiClock",slot:"AmButton",overridesResolver:(t,e)=>e.amButton})(({theme:t,ownerState:e})=>j({zIndex:1,position:"absolute",bottom:e.ampmInClock?64:8,left:8},e.meridiemMode==="am"&&{backgroundColor:t.palette.primary.main,color:t.palette.primary.contrastText,"&:hover":{backgroundColor:t.palette.primary.light}})),ent=we(Ot,{name:"MuiClock",slot:"PmButton",overridesResolver:(t,e)=>e.pmButton})(({theme:t,ownerState:e})=>j({zIndex:1,position:"absolute",bottom:e.ampmInClock?64:8,right:8},e.meridiemMode==="pm"&&{backgroundColor:t.palette.primary.main,color:t.palette.primary.contrastText,"&:hover":{backgroundColor:t.palette.primary.light}}));function tnt(t){const e=qe({props:t,name:"MuiClock"}),{ampm:n,ampmInClock:r,autoFocus:i,children:o,date:a,getClockLabelText:s,handleMeridiemChange:l,isTimeDisabled:c,meridiemMode:u,minutesStep:f=1,onChange:d,selectedId:h,type:p,value:m,disabled:g,readOnly:v,className:y}=e,x=e,b=wr(),_=M.useContext(xd),S=M.useRef(!1),O=qtt(x),C=c(m,p),E=!n&&p==="hours"&&(m<1||m>12),k=(N,$)=>{g||v||c(N,p)||d(N,$)},I=(N,$)=>{let{offsetX:D,offsetY:A}=N;if(D===void 0){const Y=N.target.getBoundingClientRect();D=N.changedTouches[0].clientX-Y.left,A=N.changedTouches[0].clientY-Y.top}const q=p==="seconds"||p==="minutes"?Ftt(D,A,f):jtt(D,A,!!n);k(q,$)},P=N=>{S.current=!0,I(N,"shallow")},R=N=>{S.current&&(I(N,"finish"),S.current=!1)},T=N=>{N.buttons>0&&I(N.nativeEvent,"shallow")},L=N=>{S.current&&(S.current=!1),I(N.nativeEvent,"finish")},z=M.useMemo(()=>p==="hours"?!0:m%5===0,[p,m]),B=p==="minutes"?f:1,W=M.useRef(null);Vr(()=>{i&&W.current.focus()},[i]);const U=N=>{if(!S.current)switch(N.key){case"Home":k(0,"partial"),N.preventDefault();break;case"End":k(p==="minutes"?59:23,"partial"),N.preventDefault();break;case"ArrowUp":k(m+B,"partial"),N.preventDefault();break;case"ArrowDown":k(m-B,"partial"),N.preventDefault();break}};return w.jsxs(Xtt,{className:Ur(y,O.root),children:[w.jsxs(Qtt,{className:O.clock,children:[w.jsx(Ktt,{onTouchMove:P,onTouchEnd:R,onMouseUp:L,onMouseMove:T,ownerState:{disabled:g},className:O.squareMask}),!C&&w.jsxs(M.Fragment,{children:[w.jsx(Ztt,{className:O.pin}),a&&w.jsx(Gtt,{type:p,value:m,isInner:E,hasSelected:z})]}),w.jsx(Ytt,{"aria-activedescendant":h,"aria-label":s(p,a,b),ref:W,role:"listbox",onKeyDown:U,tabIndex:0,className:O.wrapper,children:o})]}),n&&(_==="desktop"||r)&&w.jsxs(M.Fragment,{children:[w.jsx(Jtt,{onClick:v?void 0:()=>l("am"),disabled:g||u===null,ownerState:x,className:O.amButton,children:w.jsx(At,{variant:"caption",children:"AM"})}),w.jsx(ent,{disabled:g||u===null,onClick:v?void 0:()=>l("pm"),ownerState:x,className:O.pmButton,children:w.jsx(At,{variant:"caption",children:"PM"})})]})]})}const Pue=t=>()=>{};function nnt(t){return We("MuiClockNumber",t)}const RS=Ve("MuiClockNumber",["root","selected","disabled"]),rnt=["className","disabled","index","inner","label","selected"],int=t=>{const{classes:e,selected:n,disabled:r}=t;return Ue({root:["root",n&&"selected",r&&"disabled"]},nnt,e)},ont=we("span",{name:"MuiClockNumber",slot:"Root",overridesResolver:(t,e)=>[e.root,{[`&.${RS.disabled}`]:e.disabled},{[`&.${RS.selected}`]:e.selected}]})(({theme:t,ownerState:e})=>j({height:Nf,width:Nf,position:"absolute",left:`calc((100% - ${Nf}px) / 2)`,display:"inline-flex",justifyContent:"center",alignItems:"center",borderRadius:"50%",color:t.palette.text.primary,fontFamily:t.typography.fontFamily,"&:focused":{backgroundColor:t.palette.background.paper},[`&.${RS.selected}`]:{color:t.palette.primary.contrastText},[`&.${RS.disabled}`]:{pointerEvents:"none",color:t.palette.text.disabled}},e.inner&&j({},t.typography.body2,{color:t.palette.text.secondary})));function Mue(t){const e=qe({props:t,name:"MuiClockNumber"}),{className:n,disabled:r,index:i,inner:o,label:a,selected:s}=e,l=Ae(e,rnt),c=e,u=int(c),f=i%12/12*Math.PI*2-Math.PI/2,d=(rv-Nf-2)/2*(o?.65:1),h=Math.round(Math.cos(f)*d),p=Math.round(Math.sin(f)*d);return w.jsx(ont,j({className:Ur(n,u.root),"aria-disabled":r?!0:void 0,"aria-selected":s?!0:void 0,role:"option",style:{transform:`translate(${h}px, ${p+(rv-Nf)/2}px`},ownerState:c},l,{children:a}))}const ant=({ampm:t,date:e,getClockNumberText:n,isDisabled:r,selectedId:i,utils:o})=>{const a=e?o.getHours(e):null,s=[],l=t?1:0,c=t?12:23,u=f=>a===null?!1:t?f===12?a===12||a===0:a===f||a-12===f:a===f;for(let f=l;f<=c;f+=1){let d=f.toString();f===0&&(d="00");const h=!t&&(f===0||f>12);d=o.formatNumber(d);const p=u(f);s.push(w.jsx(Mue,{id:p?i:void 0,index:f,inner:h,selected:p,disabled:r(f),label:d,"aria-label":n(d)},f))}return s},v9=({utils:t,value:e,isDisabled:n,getClockNumberText:r,selectedId:i})=>{const o=t.formatNumber;return[[5,o("05")],[10,o("10")],[15,o("15")],[20,o("20")],[25,o("25")],[30,o("30")],[35,o("35")],[40,o("40")],[45,o("45")],[50,o("50")],[55,o("55")],[0,o("00")]].map(([a,s],l)=>{const c=a===e;return w.jsx(Mue,{label:s,id:c?i:void 0,index:l+1,inner:!1,disabled:n(a),selected:c,"aria-label":r(s)},a)})};function snt(t){return We("MuiPickersArrowSwitcher",t)}Ve("MuiPickersArrowSwitcher",["root","spacer","button"]);const lnt=["children","className","components","componentsProps","isLeftDisabled","isLeftHidden","isRightDisabled","isRightHidden","leftArrowButtonText","onLeftClick","onRightClick","rightArrowButtonText"],cnt=t=>{const{classes:e}=t;return Ue({root:["root"],spacer:["spacer"],button:["button"]},snt,e)},unt=we("div",{name:"MuiPickersArrowSwitcher",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex"}),fnt=we("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer",overridesResolver:(t,e)=>e.spacer})(({theme:t})=>({width:t.spacing(3)})),y9=we(Ot,{name:"MuiPickersArrowSwitcher",slot:"Button",overridesResolver:(t,e)=>e.button})(({ownerState:t})=>j({},t.hidden&&{visibility:"hidden"})),kue=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiPickersArrowSwitcher"}),{children:i,className:o,components:a,componentsProps:s,isLeftDisabled:l,isLeftHidden:c,isRightDisabled:u,isRightHidden:f,leftArrowButtonText:d,onLeftClick:h,onRightClick:p,rightArrowButtonText:m}=r,g=Ae(r,lnt),y=Vo().direction==="rtl",x=(s==null?void 0:s.leftArrowButton)||{},b=(a==null?void 0:a.LeftArrowIcon)||itt,_=(s==null?void 0:s.rightArrowButton)||{},S=(a==null?void 0:a.RightArrowIcon)||ott,O=r,C=cnt(O);return w.jsxs(unt,j({ref:n,className:Ur(C.root,o),ownerState:O},g,{children:[w.jsx(y9,j({as:a==null?void 0:a.LeftArrowButton,size:"small","aria-label":d,title:d,disabled:l,edge:"end",onClick:h},x,{className:Ur(C.button,x.className),ownerState:j({},O,x,{hidden:c}),children:y?w.jsx(S,{}):w.jsx(b,{})})),i?w.jsx(At,{variant:"subtitle1",component:"span",children:i}):w.jsx(fnt,{className:C.spacer,ownerState:O}),w.jsx(y9,j({as:a==null?void 0:a.RightArrowButton,size:"small","aria-label":m,title:m,edge:"start",disabled:u,onClick:p},_,{className:Ur(C.button,_.className),ownerState:j({},O,_,{hidden:f}),children:y?w.jsx(b,{}):w.jsx(S,{})}))]}))}),dnt=(t,e)=>t?e.getHours(t)>=12?"pm":"am":null,H$=(t,e,n)=>n&&(t>=12?"pm":"am")!==e?e==="am"?t-12:t+12:t,hnt=(t,e,n,r)=>{const i=H$(r.getHours(t),e,n);return r.setHours(t,i)},x9=(t,e)=>e.getHours(t)*3600+e.getMinutes(t)*60+e.getSeconds(t),Aue=(t=!1,e)=>(n,r)=>t?e.isAfter(n,r):x9(n,e)>x9(r,e);function pnt(t,{disableFuture:e,maxDate:n}){const r=wr();return M.useMemo(()=>{const i=r.date(),o=r.startOfMonth(e&&r.isBefore(i,n)?i:n);return!r.isAfter(o,t)},[e,n,t,r])}function mnt(t,{disablePast:e,minDate:n}){const r=wr();return M.useMemo(()=>{const i=r.date(),o=r.startOfMonth(e&&r.isAfter(i,n)?i:n);return!r.isBefore(o,t)},[e,n,t,r])}function gnt(t,e,n){const r=wr(),i=dnt(t,r),o=M.useCallback(a=>{const s=t==null?null:hnt(t,a,!!e,r);n(s,"partial")},[e,t,n,r]);return{meridiemMode:i,handleMeridiemChange:o}}function vnt(t){return We("MuiClockPicker",t)}Ve("MuiClockPicker",["root","arrowSwitcher"]);const q$=36,Ez=2,Rue=320,ynt=358,Pz=we("div")({overflowX:"hidden",width:Rue,maxHeight:ynt,display:"flex",flexDirection:"column",margin:"0 auto"}),xnt=t=>{const{classes:e}=t;return Ue({root:["root"],arrowSwitcher:["arrowSwitcher"]},vnt,e)},bnt=we(Pz,{name:"MuiClockPicker",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexDirection:"column"}),_nt=we(kue,{name:"MuiClockPicker",slot:"ArrowSwitcher",overridesResolver:(t,e)=>e.arrowSwitcher})({position:"absolute",right:12,top:15}),wnt=Pue(),Snt=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiClockPicker"}),{ampm:i=!1,ampmInClock:o=!1,autoFocus:a,components:s,componentsProps:l,date:c,disableIgnoringDatePartForTimeValidation:u,getClockLabelText:f,getHoursClockNumberText:d,getMinutesClockNumberText:h,getSecondsClockNumberText:p,leftArrowButtonText:m,maxTime:g,minTime:v,minutesStep:y=1,rightArrowButtonText:x,shouldDisableTime:b,showViewSwitcher:_,onChange:S,view:O,views:C=["hours","minutes"],openTo:E,onViewChange:k,className:I,disabled:P,readOnly:R}=r;wnt({leftArrowButtonText:m,rightArrowButtonText:x,getClockLabelText:f,getHoursClockNumberText:d,getMinutesClockNumberText:h,getSecondsClockNumberText:p});const T=yd(),L=m??T.openPreviousView,z=x??T.openNextView,B=f??T.clockLabelText,W=d??T.hoursClockNumberText,U=h??T.minutesClockNumberText,N=p??T.secondsClockNumberText,{openView:$,setOpenView:D,nextView:A,previousView:q,handleChangeAndOpenNext:Y}=Tz({view:O,views:C,openTo:E,onViewChange:k,onChange:S}),K=ow(),se=wr(),te=M.useMemo(()=>c||se.setSeconds(se.setMinutes(se.setHours(K,0),0),0),[c,K,se]),{meridiemMode:J,handleMeridiemChange:pe}=gnt(te,i,Y),be=M.useCallback((le,Q)=>{const X=Aue(u,se),ee=({start:ye,end:H})=>!(v&&X(v,H)||g&&X(ye,g)),ge=(ye,H=1)=>ye%H!==0?!1:b?!b(ye,Q):!0;switch(Q){case"hours":{const ye=H$(le,J,i),H=se.setHours(te,ye),G=se.setSeconds(se.setMinutes(H,0),0),ie=se.setSeconds(se.setMinutes(H,59),59);return!ee({start:G,end:ie})||!ge(ye)}case"minutes":{const ye=se.setMinutes(te,le),H=se.setSeconds(ye,0),G=se.setSeconds(ye,59);return!ee({start:H,end:G})||!ge(le,y)}case"seconds":{const ye=se.setSeconds(te,le);return!ee({start:ye,end:ye})||!ge(le)}default:throw new Error("not supported")}},[i,te,u,g,J,v,y,b,se]),re=cd(),ve=M.useMemo(()=>{switch($){case"hours":{const le=(Q,X)=>{const ee=H$(Q,J,i);Y(se.setHours(te,ee),X)};return{onChange:le,value:se.getHours(te),children:ant({date:c,utils:se,ampm:i,onChange:le,getClockNumberText:W,isDisabled:Q=>P||be(Q,"hours"),selectedId:re})}}case"minutes":{const le=se.getMinutes(te),Q=(X,ee)=>{Y(se.setMinutes(te,X),ee)};return{value:le,onChange:Q,children:v9({utils:se,value:le,onChange:Q,getClockNumberText:U,isDisabled:X=>P||be(X,"minutes"),selectedId:re})}}case"seconds":{const le=se.getSeconds(te),Q=(X,ee)=>{Y(se.setSeconds(te,X),ee)};return{value:le,onChange:Q,children:v9({utils:se,value:le,onChange:Q,getClockNumberText:N,isDisabled:X=>P||be(X,"seconds"),selectedId:re})}}default:throw new Error("You must provide the type for ClockView")}},[$,se,c,i,W,U,N,J,Y,te,be,re,P]),F=r,ce=xnt(F);return w.jsxs(bnt,{ref:n,className:Ur(ce.root,I),ownerState:F,children:[_&&w.jsx(_nt,{className:ce.arrowSwitcher,leftArrowButtonText:L,rightArrowButtonText:z,components:s,componentsProps:l,onLeftClick:()=>D(q),onRightClick:()=>D(A),isLeftDisabled:!q,isRightDisabled:!A,ownerState:F}),w.jsx(tnt,j({autoFocus:a,date:c,ampmInClock:o,type:$,ampm:i,getClockLabelText:B,minutesStep:y,isTimeDisabled:be,meridiemMode:J,handleMeridiemChange:pe,selectedId:re,disabled:P,readOnly:R},ve))]})});function Ont(t){return We("PrivatePickersMonth",t)}const b9=Ve("PrivatePickersMonth",["root","selected"]),Cnt=["disabled","onSelect","selected","value","tabIndex","hasFocus","onFocus","onBlur"],Tnt=t=>{const{classes:e,selected:n}=t;return Ue({root:["root",n&&"selected"]},Ont,e)},Ent=we(At,{name:"PrivatePickersMonth",slot:"Root",overridesResolver:(t,e)=>[e.root,{[`&.${b9.selected}`]:e.selected}]})(({theme:t})=>j({flex:"1 0 33.33%",display:"flex",alignItems:"center",justifyContent:"center",color:"unset",backgroundColor:"transparent",border:0,outline:0},t.typography.subtitle1,{margin:"8px 0",height:36,borderRadius:18,cursor:"pointer","&:focus, &:hover":{backgroundColor:Wc(t.palette.action.active,t.palette.action.hoverOpacity)},"&:disabled":{pointerEvents:"none",color:t.palette.text.secondary},[`&.${b9.selected}`]:{color:t.palette.primary.contrastText,backgroundColor:t.palette.primary.main,"&:focus, &:hover":{backgroundColor:t.palette.primary.dark}}})),_9=()=>{},Pnt=t=>{const{disabled:e,onSelect:n,selected:r,value:i,tabIndex:o,hasFocus:a,onFocus:s=_9,onBlur:l=_9}=t,c=Ae(t,Cnt),u=Tnt(t),f=()=>{n(i)},d=M.useRef(null);return Vr(()=>{if(a){var h;(h=d.current)==null||h.focus()}},[a]),w.jsx(Ent,j({ref:d,component:"button",type:"button",className:u.root,tabIndex:o,onClick:f,onKeyDown:Oue(f),color:r?"primary":void 0,variant:r?"h5":"subtitle1",disabled:e,onFocus:h=>s(h,i),onBlur:h=>l(h,i)},c))};function Mnt(t){return We("MuiMonthPicker",t)}Ve("MuiMonthPicker",["root"]);const knt=["className","date","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","autoFocus","onMonthFocus","hasFocus","onFocusedViewChange"],Ant=t=>{const{classes:e}=t;return Ue({root:["root"]},Mnt,e)};function Rnt(t,e){const n=wr(),r=C2(),i=qe({props:t,name:e});return j({disableFuture:!1,disablePast:!1},i,{minDate:Zl(n,i.minDate,r.minDate),maxDate:Zl(n,i.maxDate,r.maxDate)})}const Int=we("div",{name:"MuiMonthPicker",slot:"Root",overridesResolver:(t,e)=>e.root})({width:310,display:"flex",flexWrap:"wrap",alignContent:"stretch",margin:"0 4px"}),Dnt=M.forwardRef(function(e,n){const r=wr(),i=ow(),o=Rnt(e,"MuiMonthPicker"),{className:a,date:s,disabled:l,disableFuture:c,disablePast:u,maxDate:f,minDate:d,onChange:h,shouldDisableMonth:p,readOnly:m,disableHighlightToday:g,autoFocus:v=!1,onMonthFocus:y,hasFocus:x,onFocusedViewChange:b}=o,_=Ae(o,knt),S=o,O=Ant(S),C=ld(),E=M.useMemo(()=>s??r.startOfMonth(i),[i,r,s]),k=M.useMemo(()=>s!=null?r.getMonth(s):g?null:r.getMonth(i),[i,s,r,g]),[I,P]=M.useState(()=>k||r.getMonth(i)),R=M.useCallback(A=>{const q=r.startOfMonth(u&&r.isAfter(i,d)?i:d),Y=r.startOfMonth(c&&r.isBefore(i,f)?i:f);return r.isBefore(A,q)||r.isAfter(A,Y)?!0:p?p(A):!1},[c,u,f,d,i,p,r]),T=A=>{if(m)return;const q=r.setMonth(E,A);h(q,"finish")},[L,z]=Hs({name:"MonthPicker",state:"hasFocus",controlled:x,default:v}),B=M.useCallback(A=>{z(A),b&&b(A)},[z,b]),W=M.useCallback(A=>{R(r.setMonth(E,A))||(P(A),B(!0),y&&y(A))},[R,r,E,B,y]);M.useEffect(()=>{P(A=>k!==null&&A!==k?k:A)},[k]);const U=br(A=>{switch(A.key){case"ArrowUp":W((12+I-3)%12),A.preventDefault();break;case"ArrowDown":W((12+I+3)%12),A.preventDefault();break;case"ArrowLeft":W((12+I+(C.direction==="ltr"?-1:1))%12),A.preventDefault();break;case"ArrowRight":W((12+I+(C.direction==="ltr"?1:-1))%12),A.preventDefault();break}}),N=M.useCallback((A,q)=>{W(q)},[W]),$=M.useCallback(()=>{B(!1)},[B]),D=r.getMonth(i);return w.jsx(Int,j({ref:n,className:Ur(O.root,a),ownerState:S,onKeyDown:U},_,{children:r.getMonthArray(E).map(A=>{const q=r.getMonth(A),Y=r.format(A,"monthShort"),K=l||R(A);return w.jsx(Pnt,{value:q,selected:q===k,tabIndex:q===I&&!K?0:-1,hasFocus:L&&q===I,onSelect:T,onFocus:N,onBlur:$,disabled:K,"aria-current":D===q?"date":void 0,children:Y},Y)})}))});function Lnt(t,e,n){const{value:r,onError:i}=t,o=iw(),a=M.useRef(null),s=e({adapter:o,value:r,props:t});return M.useEffect(()=>{i&&!n(s,a.current)&&i(s,r),a.current=s},[n,i,a,s,r]),s}const Iue=({props:t,value:e,adapter:n})=>{const r=n.utils.date(),i=n.utils.date(e),o=Zl(n.utils,t.minDate,n.defaultDates.minDate),a=Zl(n.utils,t.maxDate,n.defaultDates.maxDate);if(i===null)return null;switch(!0){case!n.utils.isValid(e):return"invalidDate";case!!(t.shouldDisableDate&&t.shouldDisableDate(i)):return"shouldDisableDate";case!!(t.disableFuture&&n.utils.isAfterDay(i,r)):return"disableFuture";case!!(t.disablePast&&n.utils.isBeforeDay(i,r)):return"disablePast";case!!(o&&n.utils.isBeforeDay(i,o)):return"minDate";case!!(a&&n.utils.isAfterDay(i,a)):return"maxDate";default:return null}},Due=({shouldDisableDate:t,minDate:e,maxDate:n,disableFuture:r,disablePast:i})=>{const o=iw();return M.useCallback(a=>Iue({adapter:o,value:a,props:{shouldDisableDate:t,minDate:e,maxDate:n,disableFuture:r,disablePast:i}})!==null,[o,t,e,n,r,i])},$nt=(t,e,n)=>(r,i)=>{switch(i.type){case"changeMonth":return j({},r,{slideDirection:i.direction,currentMonth:i.newMonth,isMonthSwitchingAnimating:!t});case"finishMonthSwitchingAnimation":return j({},r,{isMonthSwitchingAnimating:!1});case"changeFocusedDay":{if(r.focusedDay!=null&&i.focusedDay!=null&&n.isSameDay(i.focusedDay,r.focusedDay))return r;const o=i.focusedDay!=null&&!e&&!n.isSameMonth(r.currentMonth,i.focusedDay);return j({},r,{focusedDay:i.focusedDay,isMonthSwitchingAnimating:o&&!t&&!i.withoutMonthSwitchingAnimation,currentMonth:o?n.startOfMonth(i.focusedDay):r.currentMonth,slideDirection:i.focusedDay!=null&&n.isAfterDay(i.focusedDay,r.currentMonth)?"left":"right"})}default:throw new Error("missing support")}},Nnt=({date:t,defaultCalendarMonth:e,disableFuture:n,disablePast:r,disableSwitchToMonthOnDayFocus:i=!1,maxDate:o,minDate:a,onMonthChange:s,reduceAnimations:l,shouldDisableDate:c})=>{var u;const f=ow(),d=wr(),h=M.useRef($nt(!!l,i,d)).current,[p,m]=M.useReducer(h,{isMonthSwitchingAnimating:!1,focusedDay:t||f,currentMonth:d.startOfMonth((u=t??e)!=null?u:f),slideDirection:"left"}),g=M.useCallback(_=>{m(j({type:"changeMonth"},_)),s&&s(_.newMonth)},[s]),v=M.useCallback(_=>{const S=_??f;d.isSameMonth(S,p.currentMonth)||g({newMonth:d.startOfMonth(S),direction:d.isAfterDay(S,p.currentMonth)?"left":"right"})},[p.currentMonth,g,f,d]),y=Due({shouldDisableDate:c,minDate:a,maxDate:o,disableFuture:n,disablePast:r}),x=M.useCallback(()=>{m({type:"finishMonthSwitchingAnimation"})},[]),b=M.useCallback((_,S)=>{y(_)||m({type:"changeFocusedDay",focusedDay:_,withoutMonthSwitchingAnimation:S})},[y]);return{calendarState:p,changeMonth:v,changeFocusedDay:b,isDateDisabled:y,onMonthSwitchingAnimationEnd:x,handleChangeMonth:g}},Fnt=t=>We("MuiPickersFadeTransitionGroup",t);Ve("MuiPickersFadeTransitionGroup",["root"]);const jnt=t=>{const{classes:e}=t;return Ue({root:["root"]},Fnt,e)},w9=500,Bnt=we(n5,{name:"MuiPickersFadeTransitionGroup",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"block",position:"relative"});function Lue(t){const e=qe({props:t,name:"MuiPickersFadeTransitionGroup"}),{children:n,className:r,reduceAnimations:i,transKey:o}=e,a=jnt(e);return i?n:w.jsx(Bnt,{className:Ur(a.root,r),children:w.jsx($M,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:w9,enter:w9/2,exit:0},children:n},o)})}function znt(t){return We("MuiPickersDay",t)}const IS=Ve("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),Unt=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDaySelect","onFocus","onBlur","onKeyDown","onMouseDown","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today"],Wnt=t=>{const{selected:e,disableMargin:n,disableHighlightToday:r,today:i,disabled:o,outsideCurrentMonth:a,showDaysOutsideCurrentMonth:s,classes:l}=t;return Ue({root:["root",e&&"selected",o&&"disabled",!n&&"dayWithMargin",!r&&i&&"today",a&&s&&"dayOutsideMonth",a&&!s&&"hiddenDaySpacingFiller"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},znt,l)},$ue=({theme:t,ownerState:e})=>j({},t.typography.caption,{width:q$,height:q$,borderRadius:"50%",padding:0,backgroundColor:t.palette.background.paper,color:t.palette.text.primary,"&:hover":{backgroundColor:Wc(t.palette.action.active,t.palette.action.hoverOpacity)},"&:focus":{backgroundColor:Wc(t.palette.action.active,t.palette.action.hoverOpacity),[`&.${IS.selected}`]:{willChange:"background-color",backgroundColor:t.palette.primary.dark}},[`&.${IS.selected}`]:{color:t.palette.primary.contrastText,backgroundColor:t.palette.primary.main,fontWeight:t.typography.fontWeightMedium,transition:t.transitions.create("background-color",{duration:t.transitions.duration.short}),"&:hover":{willChange:"background-color",backgroundColor:t.palette.primary.dark}},[`&.${IS.disabled}`]:{color:t.palette.text.disabled}},!e.disableMargin&&{margin:`0 ${Ez}px`},e.outsideCurrentMonth&&e.showDaysOutsideCurrentMonth&&{color:t.palette.text.secondary},!e.disableHighlightToday&&e.today&&{[`&:not(.${IS.selected})`]:{border:`1px solid ${t.palette.text.secondary}`}}),Nue=(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disableMargin&&e.dayWithMargin,!n.disableHighlightToday&&n.today&&e.today,!n.outsideCurrentMonth&&n.showDaysOutsideCurrentMonth&&e.dayOutsideMonth,n.outsideCurrentMonth&&!n.showDaysOutsideCurrentMonth&&e.hiddenDaySpacingFiller]},Vnt=we(us,{name:"MuiPickersDay",slot:"Root",overridesResolver:Nue})($ue),Gnt=we("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:Nue})(({theme:t,ownerState:e})=>j({},$ue({theme:t,ownerState:e}),{opacity:0,pointerEvents:"none"})),xR=()=>{},Hnt=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiPickersDay"}),{autoFocus:i=!1,className:o,day:a,disabled:s=!1,disableHighlightToday:l=!1,disableMargin:c=!1,isAnimating:u,onClick:f,onDaySelect:d,onFocus:h=xR,onBlur:p=xR,onKeyDown:m=xR,onMouseDown:g,outsideCurrentMonth:v,selected:y=!1,showDaysOutsideCurrentMonth:x=!1,children:b,today:_=!1}=r,S=Ae(r,Unt),O=j({},r,{autoFocus:i,disabled:s,disableHighlightToday:l,disableMargin:c,selected:y,showDaysOutsideCurrentMonth:x,today:_}),C=Wnt(O),E=wr(),k=M.useRef(null),I=Zt(k,n);Vr(()=>{i&&!s&&!u&&!v&&k.current.focus()},[i,s,u,v]);const P=T=>{g&&g(T),v&&T.preventDefault()},R=T=>{s||d(a,"finish"),v&&T.currentTarget.focus(),f&&f(T)};return v&&!x?w.jsx(Gnt,{className:Ur(C.root,C.hiddenDaySpacingFiller,o),ownerState:O,role:S.role}):w.jsx(Vnt,j({className:Ur(C.root,o),ownerState:O,ref:I,centerRipple:!0,disabled:s,tabIndex:y?0:-1,onKeyDown:T=>m(T,a),onFocus:T=>h(T,a),onBlur:T=>p(T,a),onClick:R,onMouseDown:P},S,{children:b||E.format(a,"dayOfMonth")}))}),qnt=(t,e)=>t.autoFocus===e.autoFocus&&t.isAnimating===e.isAnimating&&t.today===e.today&&t.disabled===e.disabled&&t.selected===e.selected&&t.disableMargin===e.disableMargin&&t.showDaysOutsideCurrentMonth===e.showDaysOutsideCurrentMonth&&t.disableHighlightToday===e.disableHighlightToday&&t.className===e.className&&t.sx===e.sx&&t.outsideCurrentMonth===e.outsideCurrentMonth&&t.onFocus===e.onFocus&&t.onBlur===e.onBlur&&t.onDaySelect===e.onDaySelect,Xnt=M.memo(Hnt,qnt),Qnt=t=>We("PrivatePickersSlideTransition",t),Wi=Ve("PrivatePickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),Ynt=["children","className","reduceAnimations","slideDirection","transKey"],Knt=t=>{const{classes:e}=t;return Ue({root:["root"]},Qnt,e)},Fue=350,Znt=we(n5,{name:"PrivatePickersSlideTransition",slot:"Root",overridesResolver:(t,e)=>[e.root,{[`.${Wi["slideEnter-left"]}`]:e["slideEnter-left"]},{[`.${Wi["slideEnter-right"]}`]:e["slideEnter-right"]},{[`.${Wi.slideEnterActive}`]:e.slideEnterActive},{[`.${Wi.slideExit}`]:e.slideExit},{[`.${Wi["slideExitActiveLeft-left"]}`]:e["slideExitActiveLeft-left"]},{[`.${Wi["slideExitActiveLeft-right"]}`]:e["slideExitActiveLeft-right"]}]})(({theme:t})=>{const e=t.transitions.create("transform",{duration:Fue,easing:"cubic-bezier(0.35, 0.8, 0.4, 1)"});return{display:"block",position:"relative",overflowX:"hidden","& > *":{position:"absolute",top:0,right:0,left:0},[`& .${Wi["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${Wi["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${Wi.slideEnterActive}`]:{transform:"translate(0%)",transition:e},[`& .${Wi.slideExit}`]:{transform:"translate(0%)"},[`& .${Wi["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:e,zIndex:0},[`& .${Wi["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:e,zIndex:0}}}),Jnt=t=>{const{children:e,className:n,reduceAnimations:r,slideDirection:i,transKey:o}=t,a=Ae(t,Ynt),s=Knt(t);if(r)return w.jsx("div",{className:Ur(s.root,n),children:e});const l={exit:Wi.slideExit,enterActive:Wi.slideEnterActive,enter:Wi[`slideEnter-${i}`],exitActive:Wi[`slideExitActiveLeft-${i}`]};return w.jsx(Znt,{className:Ur(s.root,n),childFactory:c=>M.cloneElement(c,{classNames:l}),role:"presentation",children:w.jsx(HCe,j({mountOnEnter:!0,unmountOnExit:!0,timeout:Fue,classNames:l},a,{children:e}),o)})},ert=t=>We("MuiDayPicker",t);Ve("MuiDayPicker",["header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer"]);const trt=t=>{const{classes:e}=t;return Ue({header:["header"],weekDayLabel:["weekDayLabel"],loadingContainer:["loadingContainer"],slideTransition:["slideTransition"],monthContainer:["monthContainer"],weekContainer:["weekContainer"]},ert,e)},nrt=t=>t.charAt(0).toUpperCase(),jue=(q$+Ez*2)*6,rrt=we("div",{name:"MuiDayPicker",slot:"Header",overridesResolver:(t,e)=>e.header})({display:"flex",justifyContent:"center",alignItems:"center"}),irt=we(At,{name:"MuiDayPicker",slot:"WeekDayLabel",overridesResolver:(t,e)=>e.weekDayLabel})(({theme:t})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:t.palette.text.secondary})),ort=we("div",{name:"MuiDayPicker",slot:"LoadingContainer",overridesResolver:(t,e)=>e.loadingContainer})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:jue}),art=we(Jnt,{name:"MuiDayPicker",slot:"SlideTransition",overridesResolver:(t,e)=>e.slideTransition})({minHeight:jue}),srt=we("div",{name:"MuiDayPicker",slot:"MonthContainer",overridesResolver:(t,e)=>e.monthContainer})({overflow:"hidden"}),lrt=we("div",{name:"MuiDayPicker",slot:"WeekContainer",overridesResolver:(t,e)=>e.weekContainer})({margin:`${Ez}px 0`,display:"flex",justifyContent:"center"});function crt(t){const e=ow(),n=wr(),r=qe({props:t,name:"MuiDayPicker"}),i=trt(r),{onFocusedDayChange:o,className:a,currentMonth:s,selectedDays:l,disabled:c,disableHighlightToday:u,focusedDay:f,isMonthSwitchingAnimating:d,loading:h,onSelectedDaysChange:p,onMonthSwitchingAnimationEnd:m,readOnly:g,reduceAnimations:v,renderDay:y,renderLoading:x=()=>w.jsx("span",{children:"..."}),showDaysOutsideCurrentMonth:b,slideDirection:_,TransitionProps:S,disablePast:O,disableFuture:C,minDate:E,maxDate:k,shouldDisableDate:I,dayOfWeekFormatter:P=nrt,hasFocus:R,onFocusedViewChange:T,gridLabelId:L}=r,z=Due({shouldDisableDate:I,minDate:E,maxDate:k,disablePast:O,disableFuture:C}),[B,W]=M.useState(()=>f||e),U=M.useCallback(re=>{T&&T(re)},[T]),N=M.useCallback((re,ve="finish")=>{g||p(re,ve)},[p,g]),$=M.useCallback(re=>{z(re)||(o(re),W(re),U(!0))},[z,o,U]),D=Vo();function A(re,ve){switch(re.key){case"ArrowUp":$(n.addDays(ve,-7)),re.preventDefault();break;case"ArrowDown":$(n.addDays(ve,7)),re.preventDefault();break;case"ArrowLeft":{const F=n.addDays(ve,D.direction==="ltr"?-1:1),ce=D.direction==="ltr"?n.getPreviousMonth(ve):n.getNextMonth(ve),le=Qx({utils:n,date:F,minDate:D.direction==="ltr"?n.startOfMonth(ce):F,maxDate:D.direction==="ltr"?F:n.endOfMonth(ce),isDateDisabled:z});$(le||F),re.preventDefault();break}case"ArrowRight":{const F=n.addDays(ve,D.direction==="ltr"?1:-1),ce=D.direction==="ltr"?n.getNextMonth(ve):n.getPreviousMonth(ve),le=Qx({utils:n,date:F,minDate:D.direction==="ltr"?F:n.startOfMonth(ce),maxDate:D.direction==="ltr"?n.endOfMonth(ce):F,isDateDisabled:z});$(le||F),re.preventDefault();break}case"Home":$(n.startOfWeek(ve)),re.preventDefault();break;case"End":$(n.endOfWeek(ve)),re.preventDefault();break;case"PageUp":$(n.getNextMonth(ve)),re.preventDefault();break;case"PageDown":$(n.getPreviousMonth(ve)),re.preventDefault();break}}function q(re,ve){$(ve)}function Y(re,ve){R&&n.isSameDay(B,ve)&&U(!1)}const K=n.getMonth(s),se=l.filter(re=>!!re).map(re=>n.startOfDay(re)),te=K,J=M.useMemo(()=>M.createRef(),[te]),pe=n.startOfWeek(e),be=M.useMemo(()=>{const re=n.startOfMonth(s),ve=n.endOfMonth(s);return z(B)||n.isAfterDay(B,ve)||n.isBeforeDay(B,re)?Qx({utils:n,date:B,minDate:re,maxDate:ve,disablePast:O,disableFuture:C,isDateDisabled:z}):B},[s,C,O,B,z,n]);return w.jsxs("div",{role:"grid","aria-labelledby":L,children:[w.jsx(rrt,{role:"row",className:i.header,children:n.getWeekdays().map((re,ve)=>{var F;return w.jsx(irt,{variant:"caption",role:"columnheader","aria-label":n.format(n.addDays(pe,ve),"weekday"),className:i.weekDayLabel,children:(F=P==null?void 0:P(re))!=null?F:re},re+ve.toString())})}),h?w.jsx(ort,{className:i.loadingContainer,children:x()}):w.jsx(art,j({transKey:te,onExited:m,reduceAnimations:v,slideDirection:_,className:Ur(a,i.slideTransition)},S,{nodeRef:J,children:w.jsx(srt,{ref:J,role:"rowgroup",className:i.monthContainer,children:n.getWeekArray(s).map(re=>w.jsx(lrt,{role:"row",className:i.weekContainer,children:re.map(ve=>{const F=be!==null&&n.isSameDay(ve,be),ce=se.some(X=>n.isSameDay(X,ve)),le=n.isSameDay(ve,e),Q={key:ve==null?void 0:ve.toString(),day:ve,isAnimating:d,disabled:c||z(ve),autoFocus:R&&F,today:le,outsideCurrentMonth:n.getMonth(ve)!==K,selected:ce,disableHighlightToday:u,showDaysOutsideCurrentMonth:b,onKeyDown:A,onFocus:q,onBlur:Y,onDaySelect:N,tabIndex:F?0:-1,role:"gridcell","aria-selected":ce};return le&&(Q["aria-current"]="date"),y?y(ve,se,Q):M.createElement(Xnt,j({},Q,{key:Q.key}))})},`week-${re[0]}`))})}))]})}const urt=t=>We("MuiPickersCalendarHeader",t);Ve("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]);const frt=t=>{const{classes:e}=t;return Ue({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},urt,e)},drt=we("div",{name:"MuiPickersCalendarHeader",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",alignItems:"center",marginTop:16,marginBottom:8,paddingLeft:24,paddingRight:12,maxHeight:30,minHeight:30}),hrt=we("div",{name:"MuiPickersCalendarHeader",slot:"LabelContainer",overridesResolver:(t,e)=>e.labelContainer})(({theme:t})=>j({display:"flex",maxHeight:30,overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},t.typography.body1,{fontWeight:t.typography.fontWeightMedium})),prt=we("div",{name:"MuiPickersCalendarHeader",slot:"Label",overridesResolver:(t,e)=>e.label})({marginRight:6}),mrt=we(Ot,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton",overridesResolver:(t,e)=>e.switchViewButton})({marginRight:"auto"}),grt=we(rtt,{name:"MuiPickersCalendarHeader",slot:"SwitchViewIcon",overridesResolver:(t,e)=>e.switchViewIcon})(({theme:t,ownerState:e})=>j({willChange:"transform",transition:t.transitions.create("transform"),transform:"rotate(0deg)"},e.openView==="year"&&{transform:"rotate(180deg)"})),vrt=Pue();function yrt(t){const e=qe({props:t,name:"MuiPickersCalendarHeader"}),{components:n={},componentsProps:r={},currentMonth:i,disabled:o,disableFuture:a,disablePast:s,getViewSwitchingButtonText:l,leftArrowButtonText:c,maxDate:u,minDate:f,onMonthChange:d,onViewChange:h,openView:p,reduceAnimations:m,rightArrowButtonText:g,views:v,labelId:y}=e;vrt({leftArrowButtonText:c,rightArrowButtonText:g,getViewSwitchingButtonText:l});const x=yd(),b=c??x.previousMonth,_=g??x.nextMonth,S=l??x.calendarViewSwitchingButtonAriaLabel,O=wr(),C=frt(e),E=r.switchViewButton||{},k=()=>d(O.getNextMonth(i),"left"),I=()=>d(O.getPreviousMonth(i),"right"),P=pnt(i,{disableFuture:a,maxDate:u}),R=mnt(i,{disablePast:s,minDate:f}),T=()=>{if(!(v.length===1||!h||o))if(v.length===2)h(v.find(z=>z!==p)||v[0]);else{const z=v.indexOf(p)!==0?0:1;h(v[z])}};if(v.length===1&&v[0]==="year")return null;const L=e;return w.jsxs(drt,{ownerState:L,className:C.root,children:[w.jsxs(hrt,{role:"presentation",onClick:T,ownerState:L,"aria-live":"polite",className:C.labelContainer,children:[w.jsx(Lue,{reduceAnimations:m,transKey:O.format(i,"monthAndYear"),children:w.jsx(prt,{id:y,ownerState:L,className:C.label,children:O.format(i,"monthAndYear")})}),v.length>1&&!o&&w.jsx(mrt,j({size:"small",as:n.SwitchViewButton,"aria-label":S(p),className:C.switchViewButton},E,{children:w.jsx(grt,{as:n.SwitchViewIcon,ownerState:L,className:C.switchViewIcon})}))]}),w.jsx($M,{in:p==="day",children:w.jsx(kue,{leftArrowButtonText:b,rightArrowButtonText:_,components:n,componentsProps:r,onLeftClick:I,onRightClick:k,isLeftDisabled:R,isRightDisabled:P})})]})}function xrt(t){return We("PrivatePickersYear",t)}const Zm=Ve("PrivatePickersYear",["root","modeDesktop","modeMobile","yearButton","selected","disabled"]),brt=["autoFocus","className","children","disabled","onClick","onKeyDown","value","tabIndex","onFocus","onBlur"],_rt=t=>{const{wrapperVariant:e,disabled:n,selected:r,classes:i}=t,o={root:["root",e&&`mode${De(e)}`],yearButton:["yearButton",n&&"disabled",r&&"selected"]};return Ue(o,xrt,i)},wrt=we("div",{name:"PrivatePickersYear",slot:"Root",overridesResolver:(t,e)=>[e.root,{[`&.${Zm.modeDesktop}`]:e.modeDesktop},{[`&.${Zm.modeMobile}`]:e.modeMobile}]})(({ownerState:t})=>j({flexBasis:"33.3%",display:"flex",alignItems:"center",justifyContent:"center"},(t==null?void 0:t.wrapperVariant)==="desktop"&&{flexBasis:"25%"})),Srt=we("button",{name:"PrivatePickersYear",slot:"Button",overridesResolver:(t,e)=>[e.button,{[`&.${Zm.disabled}`]:e.disabled},{[`&.${Zm.selected}`]:e.selected}]})(({theme:t})=>j({color:"unset",backgroundColor:"transparent",border:0,outline:0},t.typography.subtitle1,{margin:"8px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus, &:hover":{backgroundColor:Wc(t.palette.action.active,t.palette.action.hoverOpacity)},[`&.${Zm.disabled}`]:{color:t.palette.text.secondary},[`&.${Zm.selected}`]:{color:t.palette.primary.contrastText,backgroundColor:t.palette.primary.main,"&:focus, &:hover":{backgroundColor:t.palette.primary.dark}}})),S9=()=>{},Ort=M.forwardRef(function(e,n){const{autoFocus:r,className:i,children:o,disabled:a,onClick:s,onKeyDown:l,value:c,tabIndex:u,onFocus:f=S9,onBlur:d=S9}=e,h=Ae(e,brt),p=M.useRef(null),m=Zt(p,n),g=M.useContext(xd),v=j({},e,{wrapperVariant:g}),y=_rt(v);return M.useEffect(()=>{r&&p.current.focus()},[r]),w.jsx(wrt,{className:Ur(y.root,i),ownerState:v,children:w.jsx(Srt,j({ref:m,disabled:a,type:"button",tabIndex:a?-1:u,onClick:x=>s(x,c),onKeyDown:x=>l(x,c),onFocus:x=>f(x,c),onBlur:x=>d(x,c),className:y.yearButton,ownerState:v},h,{children:o}))})});function Crt(t){return We("MuiYearPicker",t)}Ve("MuiYearPicker",["root"]);const Trt=t=>{const{classes:e}=t;return Ue({root:["root"]},Crt,e)};function Ert(t,e){const n=wr(),r=C2(),i=qe({props:t,name:e});return j({disablePast:!1,disableFuture:!1},i,{minDate:Zl(n,i.minDate,r.minDate),maxDate:Zl(n,i.maxDate,r.maxDate)})}const Prt=we("div",{name:"MuiYearPicker",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexDirection:"row",flexWrap:"wrap",overflowY:"auto",height:"100%",padding:"0 4px",maxHeight:"304px"}),Mrt=M.forwardRef(function(e,n){const r=ow(),i=Vo(),o=wr(),a=Ert(e,"MuiYearPicker"),{autoFocus:s,className:l,date:c,disabled:u,disableFuture:f,disablePast:d,maxDate:h,minDate:p,onChange:m,readOnly:g,shouldDisableYear:v,disableHighlightToday:y,onYearFocus:x,hasFocus:b,onFocusedViewChange:_}=a,S=a,O=Trt(S),C=M.useMemo(()=>c??o.startOfYear(r),[r,o,c]),E=M.useMemo(()=>c!=null?o.getYear(c):y?null:o.getYear(r),[r,c,o,y]),k=M.useContext(xd),I=M.useRef(null),[P,R]=M.useState(()=>E||o.getYear(r)),[T,L]=Hs({name:"YearPicker",state:"hasFocus",controlled:b,default:s}),z=M.useCallback(se=>{L(se),_&&_(se)},[L,_]),B=M.useCallback(se=>!!(d&&o.isBeforeYear(se,r)||f&&o.isAfterYear(se,r)||p&&o.isBeforeYear(se,p)||h&&o.isAfterYear(se,h)||v&&v(se)),[f,d,h,p,r,v,o]),W=(se,te,J="finish")=>{if(g)return;const pe=o.setYear(C,te);m(pe,J)},U=M.useCallback(se=>{B(o.setYear(C,se))||(R(se),z(!0),x==null||x(se))},[B,o,C,z,x]);M.useEffect(()=>{R(se=>E!==null&&se!==E?E:se)},[E]);const N=k==="desktop"?4:3,$=M.useCallback((se,te)=>{switch(se.key){case"ArrowUp":U(te-N),se.preventDefault();break;case"ArrowDown":U(te+N),se.preventDefault();break;case"ArrowLeft":U(te+(i.direction==="ltr"?-1:1)),se.preventDefault();break;case"ArrowRight":U(te+(i.direction==="ltr"?1:-1)),se.preventDefault();break}},[U,i.direction,N]),D=M.useCallback((se,te)=>{U(te)},[U]),A=M.useCallback((se,te)=>{P===te&&z(!1)},[P,z]),q=o.getYear(r),Y=M.useRef(null),K=Zt(n,Y);return M.useEffect(()=>{if(s||Y.current===null)return;const se=Y.current.querySelector('[tabindex="0"]');if(!se)return;const te=se.offsetHeight,J=se.offsetTop,pe=Y.current.clientHeight,be=Y.current.scrollTop,re=J+te;te>pe||J{const te=o.getYear(se),J=te===E;return w.jsx(Ort,{selected:J,value:te,onClick:W,onKeyDown:$,autoFocus:T&&te===P,ref:J?I:void 0,disabled:u||B(se),tabIndex:te===P?0:-1,onFocus:D,onBlur:A,"aria-current":q===te?"date":void 0,children:o.format(se,"year")},o.format(se,"year"))})})}),krt=typeof navigator<"u"&&/(android)/i.test(navigator.userAgent),Art=t=>We("MuiCalendarPicker",t);Ve("MuiCalendarPicker",["root","viewTransitionContainer"]);const Rrt=["autoFocus","onViewChange","date","disableFuture","disablePast","defaultCalendarMonth","onChange","onYearChange","onMonthChange","reduceAnimations","shouldDisableDate","shouldDisableMonth","shouldDisableYear","view","views","openTo","className","disabled","readOnly","minDate","maxDate","disableHighlightToday","focusedView","onFocusedViewChange","classes"],Irt=t=>{const{classes:e}=t;return Ue({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},Art,e)};function Drt(t,e){const n=wr(),r=C2(),i=qe({props:t,name:e});return j({loading:!1,disablePast:!1,disableFuture:!1,openTo:"day",views:["year","day"],reduceAnimations:krt,renderLoading:()=>w.jsx("span",{children:"..."})},i,{minDate:Zl(n,i.minDate,r.minDate),maxDate:Zl(n,i.maxDate,r.maxDate)})}const Lrt=we(Pz,{name:"MuiCalendarPicker",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexDirection:"column"}),$rt=we(Lue,{name:"MuiCalendarPicker",slot:"ViewTransitionContainer",overridesResolver:(t,e)=>e.viewTransitionContainer})({}),Nrt=M.forwardRef(function(e,n){const r=wr(),i=cd(),o=Drt(e,"MuiCalendarPicker"),{autoFocus:a,onViewChange:s,date:l,disableFuture:c,disablePast:u,defaultCalendarMonth:f,onChange:d,onYearChange:h,onMonthChange:p,reduceAnimations:m,shouldDisableDate:g,shouldDisableMonth:v,shouldDisableYear:y,view:x,views:b,openTo:_,className:S,disabled:O,readOnly:C,minDate:E,maxDate:k,disableHighlightToday:I,focusedView:P,onFocusedViewChange:R}=o,T=Ae(o,Rrt),{openView:L,setOpenView:z,openNext:B}=Tz({view:x,views:b,openTo:_,onChange:d,onViewChange:s}),{calendarState:W,changeFocusedDay:U,changeMonth:N,handleChangeMonth:$,isDateDisabled:D,onMonthSwitchingAnimationEnd:A}=Nnt({date:l,defaultCalendarMonth:f,reduceAnimations:m,onMonthChange:p,minDate:E,maxDate:k,shouldDisableDate:g,disablePast:u,disableFuture:c}),q=M.useCallback((ee,ge)=>{const ye=r.startOfMonth(ee),H=r.endOfMonth(ee),G=D(ee)?Qx({utils:r,date:ee,minDate:r.isBefore(E,ye)?ye:E,maxDate:r.isAfter(k,H)?H:k,disablePast:u,disableFuture:c,isDateDisabled:D}):ee;G?(d(G,ge),p==null||p(ye)):(B(),N(ye)),U(G,!0)},[U,c,u,D,k,E,d,p,N,B,r]),Y=M.useCallback((ee,ge)=>{const ye=r.startOfYear(ee),H=r.endOfYear(ee),G=D(ee)?Qx({utils:r,date:ee,minDate:r.isBefore(E,ye)?ye:E,maxDate:r.isAfter(k,H)?H:k,disablePast:u,disableFuture:c,isDateDisabled:D}):ee;G?(d(G,ge),h==null||h(G)):(B(),N(ye)),U(G,!0)},[U,c,u,D,k,E,d,h,B,r,N]),K=M.useCallback((ee,ge)=>d(l&&ee?r.mergeDateAndTime(ee,l):ee,ge),[r,l,d]);M.useEffect(()=>{l&&N(l)},[l]);const se=o,te=Irt(se),J={disablePast:u,disableFuture:c,maxDate:k,minDate:E},pe=O&&l||E,be=O&&l||k,re={disableHighlightToday:I,readOnly:C,disabled:O},ve=`${i}-grid-label`,[F,ce]=Hs({name:"DayPicker",state:"focusedView",controlled:P,default:a?L:null}),le=F!==null,Q=br(ee=>ge=>{if(R){R(ee)(ge);return}ce(ge?ee:ye=>ye===ee?null:ye)}),X=M.useRef(L);return M.useEffect(()=>{X.current!==L&&(X.current=L,Q(L)(!0))},[L,Q]),w.jsxs(Lrt,{ref:n,className:Ur(te.root,S),ownerState:se,children:[w.jsx(yrt,j({},T,{views:b,openView:L,currentMonth:W.currentMonth,onViewChange:z,onMonthChange:(ee,ge)=>$({newMonth:ee,direction:ge}),minDate:pe,maxDate:be,disabled:O,disablePast:u,disableFuture:c,reduceAnimations:m,labelId:ve})),w.jsx($rt,{reduceAnimations:m,className:te.viewTransitionContainer,transKey:L,ownerState:se,children:w.jsxs("div",{children:[L==="year"&&w.jsx(Mrt,j({},T,J,re,{autoFocus:a,date:l,onChange:Y,shouldDisableYear:y,hasFocus:le,onFocusedViewChange:Q("year")})),L==="month"&&w.jsx(Dnt,j({},J,re,{autoFocus:a,hasFocus:le,className:S,date:l,onChange:q,shouldDisableMonth:v,onFocusedViewChange:Q("month")})),L==="day"&&w.jsx(crt,j({},T,W,J,re,{autoFocus:a,onMonthSwitchingAnimationEnd:A,onFocusedDayChange:U,reduceAnimations:m,selectedDays:[l],onSelectedDaysChange:K,shouldDisableDate:g,hasFocus:le,onFocusedViewChange:Q("day"),gridLabelId:ve}))]})})]})}),Frt=t=>{const[,e]=M.useReducer(l=>l+1,0),n=M.useRef(null),{replace:r,append:i}=t,o=r?r(t.format(t.value)):t.format(t.value),a=M.useRef(!1),s=l=>{const c=l.target.value;n.current=[c,l.target,c.length>o.length,a.current,o===t.format(c)],e()};return M.useLayoutEffect(()=>{if(n.current==null)return;let[l,c,u,f,d]=n.current;n.current=null;const h=f&&d,m=l.slice(c.selectionStart).search(t.accept||/\d/g),g=m!==-1?m:0,v=S=>(S.match(t.accept||/\d/g)||[]).join(""),y=v(l.substr(0,c.selectionStart)),x=S=>{let O=0,C=0;for(let E=0;E!==y.length;++E){let k=S.indexOf(y[E],O)+1,I=v(S).indexOf(y[E],C)+1;I-C>1&&(k=O,I=C),C=Math.max(I,C),O=Math.max(O,k)}return O};if(t.mask===!0&&u&&!d){let S=x(l);const O=v(l.substr(S))[0];S=l.indexOf(O,S),l=`${l.substr(0,S)}${l.substr(S+1)}`}let b=t.format(l);i!=null&&c.selectionStart===l.length&&!d&&(u?b=i(b):v(b.slice(-1))===""&&(b=b.slice(0,-1)));const _=r?r(b):b;return o===_?e():t.onChange(_),()=>{let S=x(b);if(t.mask!=null&&(u||f&&!h))for(;b[S]&&v(b[S])==="";)S+=1;c.selectionStart=c.selectionEnd=S+(h?1+g:0)}}),M.useEffect(()=>{const l=u=>{u.code==="Delete"&&(a.current=!0)},c=u=>{u.code==="Delete"&&(a.current=!1)};return document.addEventListener("keydown",l),document.addEventListener("keyup",c),()=>{document.removeEventListener("keydown",l),document.removeEventListener("keyup",c)}},[]),{value:n.current!=null?n.current[0]:o,onChange:s}},X$=(t,e,n)=>{const r=t.date(e);return e===null?"":t.isValid(r)?t.formatByString(r,n):""},oE="_",Bue="2019-11-21T22:30:00.000",zue="2019-01-01T09:00:00.000";function jrt(t,e,n,r){if(t)return t;const o=r.formatByString(r.date(zue),e).replace(n,oE),a=r.formatByString(r.date(Bue),e).replace(n,"_");return o===a?o:""}function Brt(t,e,n,r){if(!t)return!1;const o=r.formatByString(r.date(zue),e).replace(n,oE),a=r.formatByString(r.date(Bue),e).replace(n,"_"),s=a===o&&t===a;return!s&&r.lib,s}const zrt=(t,e)=>n=>{let r=0;return n.split("").map((i,o)=>{if(e.lastIndex=0,r>t.length-1)return"";const a=t[r],s=t[r+1],l=e.test(i)?i:"",c=a===oE?l:a+l;return r+=c.length,o===n.length-1&&s&&s!==oE?c?c+s:"":c}).join("")},Urt=({acceptRegex:t=/[\d]/gi,disabled:e,disableMaskedInput:n,ignoreInvalidInputs:r,inputFormat:i,inputProps:o,label:a,mask:s,onChange:l,rawValue:c,readOnly:u,rifmFormatter:f,TextFieldProps:d,validationError:h})=>{const p=wr(),m=p.getFormatHelperText(i),{shouldUseMaskedInput:g,maskToUse:v}=M.useMemo(()=>{if(n)return{shouldUseMaskedInput:!1,maskToUse:""};const T=jrt(s,i,t,p);return{shouldUseMaskedInput:Brt(T,i,t,p),maskToUse:T}},[t,n,i,s,p]),y=M.useMemo(()=>g&&v?zrt(v,t):T=>T,[t,v,g]),x=c===null?null:p.date(c),[b,_]=M.useState(x),[S,O]=M.useState(X$(p,c,i)),C=M.useRef(),E=M.useRef(p.locale),k=M.useRef(i);M.useEffect(()=>{const T=c!==C.current,L=p.locale!==E.current,z=i!==k.current;if(C.current=c,E.current=p.locale,k.current=i,!T&&!L&&!z)return;const B=c===null?null:p.date(c),W=c===null||p.isValid(B);let U=b===null&&B===null;if(b!==null&&B!==null){const $=p.isEqual(b,B);if($)U=!0;else{const D=Math.abs(p.getDiff(b,B));U=D===0?$:D<1e3}}if(!L&&!z&&(!W||U))return;const N=X$(p,c,i);_(B),O(N)},[p,c,i,b]);const I=T=>{const L=T===""||T===s?"":T;O(L);const z=L===null?null:p.parse(L,i);r&&!p.isValid(z)||(_(z),l(z,L||void 0))},P=Frt({value:S,onChange:I,format:f||y});return j({label:a,disabled:e,error:h,inputProps:j({},g?P:{value:S,onChange:T=>{I(T.currentTarget.value)}},{disabled:e,placeholder:m,readOnly:u,type:g?"tel":"text"},o)},d)},Wrt=["className","components","disableOpenPicker","getOpenDialogAriaText","InputAdornmentProps","InputProps","inputRef","openPicker","OpenPickerButtonProps","renderInput"],Uue=M.forwardRef(function(e,n){const{className:r,components:i={},disableOpenPicker:o,getOpenDialogAriaText:a,InputAdornmentProps:s,InputProps:l,inputRef:c,openPicker:u,OpenPickerButtonProps:f,renderInput:d}=e,h=Ae(e,Wrt),p=yd(),m=a??p.openDatePickerDialogue,g=wr(),v=Urt(h),y=(s==null?void 0:s.position)||"end",x=i.OpenPickerIcon||yue;return d(j({ref:n,inputRef:c,className:r},v,{InputProps:j({},l,{[`${y}Adornment`]:o?void 0:w.jsx(wRe,j({position:y},s,{children:w.jsx(Ot,j({edge:y,disabled:h.disabled||h.readOnly,"aria-label":m(h.rawValue,g)},f,{onClick:u,children:w.jsx(x,{})}))}))})}))});function O9(){return typeof window>"u"?"portrait":window.screen&&window.screen.orientation&&window.screen.orientation.angle?Math.abs(window.screen.orientation.angle)===90?"landscape":"portrait":window.orientation&&Math.abs(Number(window.orientation))===90?"landscape":"portrait"}const Vrt=(t,e)=>{const[n,r]=M.useState(O9);return Vr(()=>{const o=()=>{r(O9())};return window.addEventListener("orientationchange",o),()=>{window.removeEventListener("orientationchange",o)}},[]),Sue(t,["hours","minutes","seconds"])?!1:(e||n)==="landscape"},Grt=({autoFocus:t,openView:e})=>{const[n,r]=M.useState(t?e:null),i=M.useCallback(o=>a=>{r(a?o:s=>o===s?null:s)},[]);return{focusedView:n,setFocusedView:i}};function Hrt(t){return We("MuiCalendarOrClockPicker",t)}Ve("MuiCalendarOrClockPicker",["root","mobileKeyboardInputView"]);const qrt=["autoFocus","className","parsedValue","DateInputProps","isMobileKeyboardViewOpen","onDateChange","onViewChange","openTo","orientation","showToolbar","toggleMobileKeyboardView","ToolbarComponent","toolbarFormat","toolbarPlaceholder","toolbarTitle","views","dateRangeIcon","timeIcon","hideTabs","classes"],Xrt=t=>{const{classes:e}=t;return Ue({root:["root"],mobileKeyboardInputView:["mobileKeyboardInputView"]},Hrt,e)},Qrt=we("div",{name:"MuiCalendarOrClockPicker",slot:"MobileKeyboardInputView",overridesResolver:(t,e)=>e.mobileKeyboardInputView})({padding:"16px 24px"}),Yrt=we("div",{name:"MuiCalendarOrClockPicker",slot:"Root",overridesResolver:(t,e)=>e.root})(({ownerState:t})=>j({display:"flex",flexDirection:"column"},t.isLandscape&&{flexDirection:"row"})),Krt={fullWidth:!0},C9=t=>t==="year"||t==="month"||t==="day",T9=t=>t==="hours"||t==="minutes"||t==="seconds";function Wue(t){var e,n;const r=qe({props:t,name:"MuiCalendarOrClockPicker"}),{autoFocus:i,parsedValue:o,DateInputProps:a,isMobileKeyboardViewOpen:s,onDateChange:l,onViewChange:c,openTo:u,orientation:f,showToolbar:d,toggleMobileKeyboardView:h,ToolbarComponent:p=()=>null,toolbarFormat:m,toolbarPlaceholder:g,toolbarTitle:v,views:y,dateRangeIcon:x,timeIcon:b,hideTabs:_}=r,S=Ae(r,qrt),O=(e=S.components)==null?void 0:e.Tabs,C=Vrt(y,f),E=M.useContext(xd),k=Xrt(r),I=d??E!=="desktop",P=!_&&typeof window<"u"&&window.innerHeight>667,R=M.useCallback((N,$)=>{l(N,E,$)},[l,E]),T=M.useCallback(N=>{s&&h(),c&&c(N)},[s,c,h]),{openView:L,setOpenView:z,handleChangeAndOpenNext:B}=Tz({view:void 0,views:y,openTo:u,onChange:R,onViewChange:T}),{focusedView:W,setFocusedView:U}=Grt({autoFocus:i,openView:L});return w.jsxs(Yrt,{ownerState:{isLandscape:C},className:k.root,children:[I&&w.jsx(p,j({},S,{views:y,isLandscape:C,parsedValue:o,onChange:R,setOpenView:z,openView:L,toolbarTitle:v,toolbarFormat:m,toolbarPlaceholder:g,isMobileKeyboardViewOpen:s,toggleMobileKeyboardView:h})),P&&!!O&&w.jsx(O,j({dateRangeIcon:x,timeIcon:b,view:L,onChange:z},(n=S.componentsProps)==null?void 0:n.tabs)),w.jsx(Pz,{children:s?w.jsx(Qrt,{className:k.mobileKeyboardInputView,children:w.jsx(Uue,j({},a,{ignoreInvalidInputs:!0,disableOpenPicker:!0,TextFieldProps:Krt}))}):w.jsxs(M.Fragment,{children:[C9(L)&&w.jsx(Nrt,j({autoFocus:i,date:o,onViewChange:z,onChange:B,view:L,views:y.filter(C9),focusedView:W,onFocusedViewChange:U},S)),T9(L)&&w.jsx(Snt,j({},S,{autoFocus:i,date:o,view:L,views:y.filter(T9),onChange:B,onViewChange:z,showViewSwitcher:E==="desktop"}))]})})]})}const Zrt=({adapter:t,value:e,props:n})=>{const{minTime:r,maxTime:i,minutesStep:o,shouldDisableTime:a,disableIgnoringDatePartForTimeValidation:s}=n,l=t.utils.date(e),c=Aue(s,t.utils);if(e===null)return null;switch(!0){case!t.utils.isValid(e):return"invalidDate";case!!(r&&c(r,l)):return"minTime";case!!(i&&c(l,i)):return"maxTime";case!!(a&&a(t.utils.getHours(l),"hours")):return"shouldDisableTime-hours";case!!(a&&a(t.utils.getMinutes(l),"minutes")):return"shouldDisableTime-minutes";case!!(a&&a(t.utils.getSeconds(l),"seconds")):return"shouldDisableTime-seconds";case!!(o&&t.utils.getMinutes(l)%o!==0):return"minutesStep";default:return null}},Jrt=["minDate","maxDate","disableFuture","shouldDisableDate","disablePast"],eit=({props:t,value:e,adapter:n})=>{const{minDate:r,maxDate:i,disableFuture:o,shouldDisableDate:a,disablePast:s}=t,l=Ae(t,Jrt),c=Iue({adapter:n,value:e,props:{minDate:r,maxDate:i,disableFuture:o,shouldDisableDate:a,disablePast:s}});return c!==null?c:Zrt({adapter:n,value:e,props:l})},tit=(t,e)=>t===e;function Vue(t){return Lnt(t,eit,tit)}const nit=({open:t,onOpen:e,onClose:n})=>{const r=M.useRef(typeof t=="boolean").current,[i,o]=M.useState(!1);M.useEffect(()=>{if(r){if(typeof t!="boolean")throw new Error("You must not mix controlling and uncontrolled mode for `open` prop");o(t)}},[r,t]);const a=M.useCallback(s=>{r||o(s),s&&e&&e(),!s&&n&&n()},[r,e,n]);return{isOpen:i,setIsOpen:a}},Gue=(t,e)=>{const{onAccept:n,onChange:r,value:i,closeOnSelect:o}=t,a=wr(),{isOpen:s,setIsOpen:l}=nit(t),c=M.useMemo(()=>e.parseInput(a,i),[e,a,i]),[u,f]=M.useState(c),[d,h]=M.useState(()=>({committed:c,draft:c,resetFallback:c})),p=M.useCallback(S=>{h(O=>{switch(S.action){case"setAll":case"acceptAndClose":return{draft:S.value,committed:S.value,resetFallback:S.value};case"setCommitted":return j({},O,{draft:S.value,committed:S.value});case"setDraft":return j({},O,{draft:S.value});default:return O}}),(S.forceOnChangeCall||!S.skipOnChangeCall&&!e.areValuesEqual(a,d.committed,S.value))&&r(S.value),S.action==="acceptAndClose"&&(l(!1),n&&!e.areValuesEqual(a,d.resetFallback,S.value)&&n(S.value))},[n,r,l,d,a,e]);M.useEffect(()=>{a.isValid(c)&&f(c)},[a,c]),M.useEffect(()=>{s&&p({action:"setAll",value:c,skipOnChangeCall:!0})},[s]),e.areValuesEqual(a,d.committed,c)||p({action:"setCommitted",value:c,skipOnChangeCall:!0});const m=M.useMemo(()=>({open:s,onClear:()=>{p({value:e.emptyValue,action:"acceptAndClose",forceOnChangeCall:!e.areValuesEqual(a,i,e.emptyValue)})},onAccept:()=>{p({value:d.draft,action:"acceptAndClose",forceOnChangeCall:!e.areValuesEqual(a,i,c)})},onDismiss:()=>{p({value:d.committed,action:"acceptAndClose"})},onCancel:()=>{p({value:d.resetFallback,action:"acceptAndClose"})},onSetToday:()=>{p({value:e.getTodayValue(a),action:"acceptAndClose"})}}),[p,s,a,d,e,i,c]),[g,v]=M.useState(!1),y=M.useMemo(()=>({parsedValue:d.draft,isMobileKeyboardViewOpen:g,toggleMobileKeyboardView:()=>v(!g),onDateChange:(S,O,C="partial")=>{switch(C){case"shallow":return p({action:"setDraft",value:S,skipOnChangeCall:!0});case"partial":return p({action:"setDraft",value:S});case"finish":return p(o??O==="desktop"?{value:S,action:"acceptAndClose"}:{value:S,action:"setCommitted"});default:throw new Error("MUI: Invalid selectionState passed to `onDateChange`")}}}),[p,g,d.draft,o]),x=M.useCallback((S,O)=>{const C=e.valueReducer?e.valueReducer(a,u,S):S;r(C,O)},[r,e,u,a]),b=M.useMemo(()=>({onChange:x,open:s,rawValue:i,openPicker:()=>l(!0)}),[x,s,i,l]),_={pickerProps:y,inputProps:b,wrapperProps:m};return M.useDebugValue(_,()=>({MuiPickerState:{dateState:d,other:_}})),_};function rit(t){return We("MuiDateTimePickerTabs",t)}Ve("MuiDateTimePickerTabs",["root"]);const iit=t=>["day","month","year"].includes(t)?"date":"time",oit=t=>t==="date"?"day":"hours",ait=t=>{const{classes:e}=t;return Ue({root:["root"]},rit,e)},sit=we(b5,{name:"MuiDateTimePickerTabs",slot:"Root",overridesResolver:(t,e)=>e.root})(({ownerState:t,theme:e})=>j({boxShadow:`0 -1px 0 0 inset ${e.palette.divider}`},t.wrapperVariant==="desktop"&&{order:1,boxShadow:`0 1px 0 0 inset ${e.palette.divider}`,[`& .${SC.indicator}`]:{bottom:"auto",top:0}})),Hue=function(e){const n=qe({props:e,name:"MuiDateTimePickerTabs"}),{dateRangeIcon:r=w.jsx(stt,{}),onChange:i,timeIcon:o=w.jsx(ctt,{}),view:a}=n,s=yd(),l=M.useContext(xd),c=j({},n,{wrapperVariant:l}),u=ait(c),f=(d,h)=>{i(oit(h))};return w.jsxs(sit,{ownerState:c,variant:"fullWidth",value:iit(a),onChange:f,className:u.root,children:[w.jsx(Ib,{value:"date","aria-label":s.dateTableLabel,icon:w.jsx(M.Fragment,{children:r})}),w.jsx(Ib,{value:"time","aria-label":s.timeTableLabel,icon:w.jsx(M.Fragment,{children:o})})]})},lit=["onChange","PaperProps","PopperProps","ToolbarComponent","TransitionComponent","value","components","componentsProps","hideTabs"],cit=M.forwardRef(function(e,n){const r=pue(e,"MuiDesktopDateTimePicker"),i=Vue(r)!==null,{pickerProps:o,inputProps:a,wrapperProps:s}=Gue(r,mue),{PaperProps:l,PopperProps:c,ToolbarComponent:u=_ue,TransitionComponent:f,components:d,componentsProps:h,hideTabs:p=!0}=r,m=Ae(r,lit),g=M.useMemo(()=>j({Tabs:Hue},d),[d]),v=j({},a,m,{components:g,componentsProps:h,ref:n,validationError:i});return w.jsx(Dtt,j({},s,{DateInputProps:v,KeyboardDateInputComponent:Uue,PopperProps:c,PaperProps:l,TransitionComponent:f,components:g,componentsProps:h,children:w.jsx(Wue,j({},o,{autoFocus:!0,toolbarTitle:r.label||r.toolbarTitle,ToolbarComponent:u,DateInputProps:v,components:g,componentsProps:h,hideTabs:p},m))}))}),uit=we(el)({[`& .${Nx.container}`]:{outline:0},[`& .${Nx.paper}`]:{outline:0,minWidth:Rue}}),fit=we(qs)({"&:first-of-type":{padding:0}}),dit=t=>{var e;const{children:n,DialogProps:r={},onAccept:i,onClear:o,onDismiss:a,onCancel:s,onSetToday:l,open:c,components:u,componentsProps:f}=t,d=(e=u==null?void 0:u.ActionBar)!=null?e:wue;return w.jsxs(uit,j({open:c,onClose:a},r,{children:[w.jsx(fit,{children:n}),w.jsx(d,j({onAccept:i,onClear:o,onCancel:s,onSetToday:l,actions:["cancel","accept"]},f==null?void 0:f.actionBar))]}))},hit=["children","DateInputProps","DialogProps","onAccept","onClear","onDismiss","onCancel","onSetToday","open","PureDateInputComponent","components","componentsProps"];function pit(t){const{children:e,DateInputProps:n,DialogProps:r,onAccept:i,onClear:o,onDismiss:a,onCancel:s,onSetToday:l,open:c,PureDateInputComponent:u,components:f,componentsProps:d}=t,h=Ae(t,hit);return w.jsxs(xd.Provider,{value:"mobile",children:[w.jsx(u,j({components:f},h,n)),w.jsx(dit,{DialogProps:r,onAccept:i,onClear:o,onDismiss:a,onCancel:s,onSetToday:l,open:c,components:f,componentsProps:d,children:e})]})}const mit=M.forwardRef(function(e,n){const{disabled:r,getOpenDialogAriaText:i,inputFormat:o,InputProps:a,inputRef:s,label:l,openPicker:c,rawValue:u,renderInput:f,TextFieldProps:d={},validationError:h,className:p}=e,m=yd(),g=i??m.openDatePickerDialogue,v=wr(),y=M.useMemo(()=>j({},a,{readOnly:!0}),[a]),x=X$(v,u,o),b=br(_=>{_.stopPropagation(),c()});return f(j({label:l,disabled:r,ref:n,inputRef:s,error:h,InputProps:y,className:p},!e.readOnly&&!e.disabled&&{onClick:b},{inputProps:j({disabled:r,readOnly:!0,"aria-readonly":!0,"aria-label":g(u,v),value:x},!e.readOnly&&{onClick:b},{onKeyDown:Oue(c)})},d))}),git=["ToolbarComponent","value","onChange","components","componentsProps","hideTabs"],vit=M.forwardRef(function(e,n){const r=pue(e,"MuiMobileDateTimePicker"),i=Vue(r)!==null,{pickerProps:o,inputProps:a,wrapperProps:s}=Gue(r,mue),{ToolbarComponent:l=_ue,components:c,componentsProps:u,hideTabs:f=!1}=r,d=Ae(r,git),h=M.useMemo(()=>j({Tabs:Hue},c),[c]),p=j({},a,d,{components:h,componentsProps:u,ref:n,validationError:i});return w.jsx(pit,j({},d,s,{DateInputProps:p,PureDateInputComponent:mit,components:h,componentsProps:u,children:w.jsx(Wue,j({},o,{autoFocus:!0,toolbarTitle:r.label||r.toolbarTitle,ToolbarComponent:l,DateInputProps:p,components:h,componentsProps:u,hideTabs:f},d))}))}),yit=["desktopModeMediaQuery","DialogProps","PopperProps","TransitionComponent"],xit=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiDateTimePicker"}),{desktopModeMediaQuery:i="@media (pointer: fine)",DialogProps:o,PopperProps:a,TransitionComponent:s}=r,l=Ae(r,yit);return HSe(i,{defaultMatches:!0})?w.jsx(cit,j({ref:n,PopperProps:a,TransitionComponent:s},l)):w.jsx(vit,j({ref:n,DialogProps:o},l))}),bit=t=>({dateTimePicker:{marginTop:t.spacing(2.5)}}),_it=({classes:t,hasTimeDimension:e,selectedTime:n,selectedTimeRange:r,selectTime:i})=>{const o=d=>{i(d!==null?eGe(d):null)},a=w.jsx(Kv,{shrink:!0,htmlFor:"time-select",children:`${fe.get("Time")} (UTC)`}),l=typeof n=="number"?XA(n):null;let c,u;Array.isArray(r)&&(c=XA(r[0]),u=XA(r[1]));const f=w.jsx(Get,{dateAdapter:Yet,children:w.jsx(xit,{disabled:!e,className:t.dateTimePicker,inputFormat:"yyyy-MM-dd hh:mm:ss",value:l,minDateTime:c,maxDateTime:u,onChange:o,ampm:!1,renderInput:d=>w.jsx(lr,{...d,variant:"standard",size:"small"})})});return w.jsx(qb,{label:a,control:f})},wit=Uet(bit)(_it),Sit=t=>({locale:t.controlState.locale,hasTimeDimension:!!yy(t),selectedTime:t.controlState.selectedTime,selectedTimeRange:t.controlState.selectedTimeRange}),Oit={selectTime:y2},Cit=Jt(Sit,Oit)(wit),E9=5,Tit={box:t=>({marginTop:t.spacing(1),marginLeft:t.spacing(E9),marginRight:t.spacing(E9),minWidth:200}),label:{color:"grey",fontSize:"1em"}};function Eit({hasTimeDimension:t,selectedTime:e,selectTime:n,selectedTimeRange:r}){const[i,o]=M.useState(e);if(M.useEffect(()=>{o(e||(r?r[0]:0))},[e,r]),!t)return null;const a=(f,d)=>{typeof d=="number"&&o(d)},s=(f,d)=>{n&&typeof d=="number"&&n(d)},l=Array.isArray(r);l||(r=[Date.now()-2*Nae.years,Date.now()]);const c=[{value:r[0],label:Gb(r[0])},{value:r[1],label:Gb(r[1])}];function u(f){return dy(f)}return w.jsx(Ke,{sx:Tit.box,children:w.jsx(_t,{arrow:!0,title:fe.get("Select time in dataset"),children:w.jsx(Zv,{disabled:!l,min:r[0],max:r[1],value:i||0,valueLabelDisplay:"off",valueLabelFormat:u,marks:c,onChange:a,onChangeCommitted:s,size:"small"})})})}const Pit=t=>({locale:t.controlState.locale,hasTimeDimension:!!yy(t),selectedTime:t.controlState.selectedTime,selectedTimeRange:t.controlState.selectedTimeRange}),Mit={selectTime:y2,selectTimeRange:Ple},kit=Jt(Pit,Mit)(Eit);var Mz={},Ait=ct;Object.defineProperty(Mz,"__esModule",{value:!0});var que=Mz.default=void 0,Rit=Ait(pt()),Iit=w;que=Mz.default=(0,Rit.default)((0,Iit.jsx)("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft");var kz={},Dit=ct;Object.defineProperty(kz,"__esModule",{value:!0});var Xue=kz.default=void 0,Lit=Dit(pt()),$it=w;Xue=kz.default=(0,Lit.default)((0,$it.jsx)("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight");var Az={},Nit=ct;Object.defineProperty(Az,"__esModule",{value:!0});var Que=Az.default=void 0,Fit=Nit(pt()),jit=w;Que=Az.default=(0,Fit.default)((0,jit.jsx)("path",{d:"M18.41 16.59 13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),"FirstPage");var Rz={},Bit=ct;Object.defineProperty(Rz,"__esModule",{value:!0});var Yue=Rz.default=void 0,zit=Bit(pt()),Uit=w;Yue=Rz.default=(0,zit.default)((0,Uit.jsx)("path",{d:"M5.59 7.41 10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),"LastPage");var Iz={},Wit=ct;Object.defineProperty(Iz,"__esModule",{value:!0});var Kue=Iz.default=void 0,Vit=Wit(pt()),Git=w;Kue=Iz.default=(0,Vit.default)((0,Git.jsx)("path",{d:"M9 16h2V8H9zm3-14C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m1-4h2V8h-2z"}),"PauseCircleOutline");var Dz={},Hit=ct;Object.defineProperty(Dz,"__esModule",{value:!0});var Zue=Dz.default=void 0,qit=Hit(pt()),Xit=w;Zue=Dz.default=(0,qit.default)((0,Xit.jsx)("path",{d:"m10 16.5 6-4.5-6-4.5zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"PlayCircleOutline");const im={formControl:t=>({marginTop:t.spacing(2.5),marginLeft:t.spacing(1),marginRight:t.spacing(1)}),iconButton:{padding:"2px"}};function Qit({timeAnimationActive:t,timeAnimationInterval:e,updateTimeAnimation:n,selectedTime:r,selectedTimeRange:i,selectTime:o,incSelectedTime:a}){const s=M.useRef(null);M.useEffect(()=>(p(),g));const l=()=>{a(1)},c=()=>{n(!t,e)},u=()=>{a(1)},f=()=>{a(-1)},d=()=>{o(i?i[0]:null)},h=()=>{o(i?i[1]:null)},p=()=>{t?m():g()},m=()=>{g(),s.current=window.setInterval(l,e)},g=()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},v=typeof r=="number",y=t?w.jsx(Kue,{}):w.jsx(Zue,{}),x=w.jsx(Ot,{disabled:!v,onClick:c,size:"small",sx:im.iconButton,children:w.jsx(_t,{arrow:!0,title:fe.get("Auto-step through times in the dataset"),children:y})}),b=w.jsx(Ot,{disabled:!v||t,onClick:d,size:"small",sx:im.iconButton,children:w.jsx(Que,{})}),_=w.jsx(Ot,{disabled:!v||t,onClick:f,size:"small",sx:im.iconButton,children:w.jsx(que,{})}),S=w.jsx(Ot,{disabled:!v||t,onClick:u,size:"small",sx:im.iconButton,children:w.jsx(Xue,{})}),O=w.jsx(Ot,{disabled:!v||t,onClick:h,size:"small",sx:im.iconButton,children:w.jsx(Yue,{})});return w.jsx(Yv,{sx:im.formControl,variant:"standard",children:w.jsxs(Ke,{children:[b,_,x,S,O]})})}const Yit=t=>({locale:t.controlState.locale,selectedTime:t.controlState.selectedTime,selectedTimeRange:t.controlState.selectedTimeRange,timeAnimationActive:t.controlState.timeAnimationActive,timeAnimationInterval:t.controlState.timeAnimationInterval}),Kit={selectTime:y2,incSelectedTime:I7e,updateTimeAnimation:L7e},Zit=Jt(Yit,Kit)(Qit);var Lz={},Jit=ct;Object.defineProperty(Lz,"__esModule",{value:!0});var Jue=Lz.default=void 0,eot=Jit(pt()),tot=w;Jue=Lz.default=(0,eot.default)((0,tot.jsx)("path",{d:"M16 20H2V4h14zm2-12h4V4h-4zm0 12h4v-4h-4zm0-6h4v-4h-4z"}),"ViewSidebar");const not=Li(Yv)(({theme:t})=>({marginTop:t.spacing(2),marginRight:t.spacing(.5),marginLeft:"auto"}));function rot({visible:t,sidebarOpen:e,setSidebarOpen:n,openDialog:r,allowRefresh:i,updateResources:o,compact:a}){if(!t)return null;const s=w.jsx(Pn,{value:"sidebar",selected:e,onClick:()=>n(!e),size:"small",sx:Mo.toggleButton,children:w.jsx(_t,{arrow:!0,title:fe.get("Show or hide sidebar"),children:w.jsx(Jue,{})})});let l,c,u;return a&&(l=i&&w.jsx(Ot,{onClick:o,size:"small",children:w.jsx(_t,{arrow:!0,title:fe.get("Refresh"),children:w.jsx(R5,{})})}),c=Kt.instance.branding.allowDownloads&&w.jsx(Ot,{onClick:()=>r("export"),size:"small",children:w.jsx(_t,{arrow:!0,title:fe.get("Export data"),children:w.jsx(L5,{})})}),u=w.jsx(Ot,{onClick:()=>r("settings"),size:"small",children:w.jsx(_t,{arrow:!0,title:fe.get("Settings"),children:w.jsx(k5,{})})})),w.jsx(not,{variant:"standard",children:w.jsxs(Ke,{children:[l,c,u,s]})})}const iot=t=>({locale:t.controlState.locale,visible:!!(t.controlState.selectedDatasetId||t.controlState.selectedPlaceId),sidebarOpen:t.controlState.sidebarOpen,compact:Kt.instance.branding.compact,allowRefresh:Kt.instance.branding.allowRefresh}),oot={setSidebarOpen:HB,openDialog:Pp,updateResources:Hse},aot=Jt(iot,oot)(rot),sot=t=>({locale:t.controlState.locale,show:t.dataState.datasets.length>0}),lot={},cot=({show:t})=>t?w.jsxs(xKe,{children:[w.jsx(EKe,{}),w.jsx(qKe,{}),w.jsx(iZe,{}),w.jsx(hZe,{}),w.jsx(RZe,{}),w.jsx(Cit,{}),w.jsx(Zit,{}),w.jsx(kit,{}),w.jsx(aot,{})]}):null,uot=Jt(sot,lot)(cot);function efe(t){const e=M.useRef(null),n=M.useRef(o=>{if(o.buttons===1&&e.current!==null){o.preventDefault();const{screenX:a,screenY:s}=o,[l,c]=e.current,u=[a-l,s-c];e.current=[a,s],t(u)}}),r=M.useRef(o=>{o.buttons===1&&(o.preventDefault(),document.body.addEventListener("mousemove",n.current),document.body.addEventListener("mouseup",i.current),document.body.addEventListener("onmouseleave",i.current),e.current=[o.screenX,o.screenY])}),i=M.useRef(o=>{e.current!==null&&(o.preventDefault(),e.current=null,document.body.removeEventListener("mousemove",n.current),document.body.removeEventListener("mouseup",i.current),document.body.removeEventListener("onmouseleave",i.current))});return r.current}const P9={hor:t=>({flex:"none",border:"none",outline:"none",width:"8px",minHeight:"100%",maxHeight:"100%",cursor:"col-resize",backgroundColor:t.palette.mode==="dark"?"white":"black",opacity:0}),ver:t=>({flex:"none",border:"none",outline:"none",height:"8px",minWidth:"100%",maxWidth:"100%",cursor:"row-resize",backgroundColor:t.palette.mode==="dark"?"white":"black",opacity:0})};function fot({dir:t,onChange:e}){const r=efe(([i,o])=>{e(i)});return w.jsx(Ke,{sx:t==="hor"?P9.hor:P9.ver,onMouseDown:r})}const DS={hor:{display:"flex",flexFlow:"row nowrap",flex:"auto"},ver:{height:"100%",display:"flex",flexFlow:"column nowrap",flex:"auto"},childHor:{flex:"none"},childVer:{flex:"none"}};function dot({dir:t,splitPosition:e,setSplitPosition:n,children:r,style:i,child1Style:o,child2Style:a}){const s=M.useRef(null);if(!r||!Array.isArray(r)||r.length!==2)return null;const l=t==="hor"?DS.childHor:DS.childVer,c=t==="hor"?{width:e}:{height:e},u=f=>{s.current&&En(s.current.clientWidth)&&n(s.current.clientWidth+f)};return w.jsxs("div",{id:"SplitPane",style:{...i,...t==="hor"?DS.hor:DS.ver},children:[w.jsx("div",{ref:s,id:"SplitPane-Child-1",style:{...l,...o,...c},children:r[0]}),w.jsx(fot,{dir:t,onChange:u}),w.jsx("div",{id:"SplitPane-Child-2",style:{...l,...a},children:r[1]})]})}const hot=({placeGroup:t,mapProjection:e,visible:n})=>{const r=M.useRef(new V1);return M.useEffect(()=>{const i=r.current,o=t.features;if(o.length===0)i.clear();else{const a=i.getFeatures(),s=new Set(a.map(f=>f.getId())),l=new Set(o.map(f=>f.id)),c=o.filter(f=>!s.has(f.id));a.filter(f=>!l.has(f.getId()+"")).forEach(f=>i.removeFeature(f)),c.forEach(f=>{const d=new Tp().readFeature(f,{dataProjection:"EPSG:4326",featureProjection:e});d.getId()!==f.id&&d.setId(f.id);const h=(f.properties||{}).color||"red",p=(f.properties||{}).opacity,m=(f.properties||{}).source?"diamond":"circle";$B(d,h,w5(p),m),i.addFeature(d)})}},[t,e]),w.jsx(o2,{id:t.id,opacity:t.id===Bs?1:.8,visible:n,zIndex:501,source:r.current})};class pot extends fy{addMapObject(e){const n=new pUe(this.getOptions());return e.addControl(n),n}updateMapObject(e,n,r){return n.setProperties(this.getOptions()),n}removeMapObject(e,n){e.removeControl(n)}}class bR extends fy{addMapObject(e){const n=new e6e(this.getOptions()),r=!!this.props.active;return n.setActive(r),e.addInteraction(n),r&&this.listen(n,this.props),n}updateMapObject(e,n,r){n.setProperties(this.getOptions());const i=!!this.props.active;return n.setActive(i),this.unlisten(n,r),i&&this.listen(n,this.props),n}removeMapObject(e,n){this.unlisten(n,this.props),e.removeInteraction(n)}getOptions(){const e=super.getOptions();delete e.layerId,delete e.active,delete e.onDrawStart,delete e.onDrawEnd;const n=this.props.layerId;if(n&&!e.source){const r=this.getMapObject(n);r&&(e.source=r.getSource())}return e}listen(e,n){const{onDrawStart:r,onDrawEnd:i}=n;r&&e.on("drawstart",r),i&&e.on("drawend",i)}unlisten(e,n){const{onDrawStart:r,onDrawEnd:i}=n;r&&e.un("drawstart",r),i&&e.un("drawend",i)}}class mot extends fy{addMapObject(e){return this.updateView(e)}removeMapObject(e,n){}updateMapObject(e,n){return this.updateView(e)}updateView(e){const n=this.props.projection;let r=e.getView().getProjection();if(typeof n=="string"&&r&&(r=r.getCode()),n&&n!==r){const i=e.getView(),o=new jc({...this.props,center:XM(i.getCenter()||[0,0],r,n),minZoom:i.getMinZoom(),zoom:i.getZoom()});e.getLayers().forEach(a=>{a instanceof t2&&a.getSource().forEachFeature(s=>{var l;(l=s.getGeometry())==null||l.transform(r,n)})}),e.setView(o)}else e.getView().setProperties(this.props);return e.getView()}}function LS(t,e){const n=t.getLayers();for(let r=0;r{if(R){const $=C||null;if($!==L&&Va[_R]){const A=Va[_R].getSource();if(A.clear(),$){const q=bot(R,$);if(q){const Y=q.clone();Y.setId("select-"+q.getId()),Y.setStyle(void 0),A.addFeature(Y)}}z($)}}},[R,C,L]),M.useEffect(()=>{R&&R.getLayers().forEach($=>{$ instanceof uae?$.getSource().changed():$.changed()})},[R,k]),M.useEffect(()=>{if(R===null||!En(I))return;const $=J=>{k9(R,J,I,0)},D=J=>{k9(R,J,I,1)},A=J=>{J.context.restore()},q=LS(R,"rgb2"),Y=LS(R,"variable2"),K=LS(R,"rgb"),se=LS(R,"variable"),te=[[q,$],[Y,$],[K,D],[se,D]];for(const[J,pe]of te)J&&(J.on("prerender",pe),J.on("postrender",A));return()=>{for(const[J,pe]of te)J&&(J.un("prerender",pe),J.un("postrender",A))}});const B=$=>{if(n==="Select"){const D=$.map;let A=null;const q=D.getFeaturesAtPixel($.pixel);if(q){for(const Y of q)if(typeof Y.getId=="function"){A=Y.getId()+"";break}}O&&O(A,E,!1)}},W=$=>{var D;if(R!==null&&y&&n!=="Select"){const A=$.feature;let q=A.getGeometry();if(!q)return;const Y=Ys(oy+n.toLowerCase()+"-"),K=R.getView().getProjection();if(q instanceof Zoe){const re=Jje(q);A.setGeometry(re)}q=A.clone().getGeometry().transform(K,uy);const se=new Tp().writeGeometryObject(q);A.setId(Y);let te=0;if(Va[Bs]){const re=Va[Bs],ve=(D=re==null?void 0:re.getSource())==null?void 0:D.getFeatures();ve&&(te=ve.length)}const J=_ot(b,n),pe=Xh(te),be=gie(pe,t.palette.mode);$B(A,be,w5()),y(v,Y,{label:J,color:pe},se,!0)}return!0};function U($){P&&P($),T($)}const N=$=>{x&&$.forEach(D=>{const A=new FileReader;A.onloadend=()=>{typeof A.result=="string"&&x(A.result)},A.readAsText(D,"UTF-8")})};return w.jsx(Eie,{children:w.jsxs(Z6e,{id:e,onClick:$=>B($),onMapRef:U,mapObjects:Va,isStale:!0,onDropFiles:N,children:[w.jsx(mot,{id:"view",projection:r}),w.jsxs(cae,{children:[i,o,a,s,l,f,c,w.jsx(o2,{id:_R,opacity:.7,zIndex:500,style:yot,source:got}),w.jsx(w.Fragment,{children:b.map($=>w.jsx(hot,{placeGroup:$,mapProjection:r,visible:S&&_[$.id]},$.id))})]}),u,w.jsx(bR,{id:"drawPoint",layerId:Bs,active:n==="Point",type:"Point",wrapX:!0,stopClick:!0,onDrawEnd:W}),w.jsx(bR,{id:"drawPolygon",layerId:Bs,active:n==="Polygon",type:"Polygon",wrapX:!0,stopClick:!0,onDrawEnd:W}),w.jsx(bR,{id:"drawCircle",layerId:Bs,active:n==="Circle",type:"Circle",wrapX:!0,stopClick:!0,onDrawEnd:W}),d,h,m,g,p,w.jsx(pot,{bar:!1})]})})}function bot(t,e){var n;for(const r of t.getLayers().getArray())if(r instanceof t2){const o=(n=r.getSource())==null?void 0:n.getFeatureById(e);if(o)return o}return null}function _ot(t,e){const n=fe.get(e),r=t.find(i=>i.id===Bs);if(r)for(let i=1;;i++){const o=`${n} ${i}`;if(!!!r.features.find(s=>s.properties?s.properties.label===o:!1))return o}return`${n} 1`}function k9(t,e,n,r){const i=t.getSize();if(!i)return;const o=i[0],a=i[1];let s,l,c,u;r===0?(s=Au(e,[0,0]),l=Au(e,[n,0]),c=Au(e,[0,a]),u=Au(e,[n,a])):(s=Au(e,[n,0]),l=Au(e,[o,0]),c=Au(e,[n,a]),u=Au(e,[o,a]));const f=e.context;f.save(),f.beginPath(),f.moveTo(s[0],s[1]),f.lineTo(c[0],c[1]),f.lineTo(u[0],u[1]),f.lineTo(l[0],l[1]),f.closePath(),f.clip()}const $S=1,Yb=.2,Oy=240,nfe=20,NS={container:{width:Oy},itemContainer:{display:"flex",alignItems:"center",justifyContent:"flex-start"},itemLabelBox:{paddingLeft:1,fontSize:"small"},itemColorBox:t=>({width:"48px",height:"16px",borderStyle:"solid",borderColor:t.palette.mode==="dark"?"lightgray":"darkgray",borderWidth:1})};function wot({categories:t,onOpenColorBarEditor:e}){return!t||t.length===0?null:w.jsx(Ke,{sx:NS.container,children:t.map((n,r)=>w.jsxs(Ke,{onClick:e,sx:NS.itemContainer,children:[w.jsx(Ke,{sx:NS.itemColorBox,style:{backgroundColor:n.color}}),w.jsx(Ke,{component:"span",sx:NS.itemLabelBox,children:`${n.label||`Category ${r+1}`} (${n.value})`})]},r))})}const A9={nominal:{cursor:"pointer"},error:{cursor:"pointer",border:"0.5px solid red"}};function Sot({colorBar:t,opacity:e,width:n,height:r,onClick:i}){const o=M.useRef(null);M.useEffect(()=>{const c=o.current;c!==null&&aHe(t,e,c)},[t,e]);const{baseName:a,imageData:s}=t,l=s?a:fe.get("Unknown color bar")+`: ${a}`;return w.jsx(_t,{title:l,children:w.jsx("canvas",{ref:o,width:n||Oy,height:r||nfe+4,onClick:i,style:s?A9.nominal:A9.error})})}function Oot(t,e,n=5,r=!1,i=!1){return Q$(Tot(t,e,n,r),i)}function Q$(t,e=!1){return t.map(n=>Zf(n,void 0,e))}function Zf(t,e,n){if(e===void 0&&(e=n?2:Cot(t)),n)return t.toExponential(e);const r=Math.round(t);if(r===t||Math.abs(r-t)<1e-8)return r+"";{let i=t.toFixed(e);if(i.includes("."))for(;i.endsWith("0")&&!i.endsWith(".0");)i=i.substring(0,i.length-1);return i}}function Cot(t){if(t===0||t===Math.floor(t))return 0;const e=Math.floor(Math.log10(Math.abs(t)));return Math.min(16,Math.max(2,e<0?1-e:0))}function Tot(t,e,n,r){const i=new Array(n);if(r){const o=Math.log10(t),s=(Math.log10(e)-o)/(n-1);for(let l=1;lOot(t,e,n,r),[t,e,n,r]);return w.jsx(Ke,{sx:Eot.container,onClick:i,children:o.map((a,s)=>w.jsx("span",{children:a},s))})}var $z={},Mot=ct;Object.defineProperty($z,"__esModule",{value:!0});var rfe=$z.default=void 0,kot=Mot(pt()),Aot=w;rfe=$z.default=(0,kot.default)((0,Aot.jsx)("path",{d:"M8 19h3v3h2v-3h3l-4-4zm8-15h-3V1h-2v3H8l4 4zM4 9v2h16V9zm0 3h16v2H4z"}),"Compress");const R9=t=>t,Rot=t=>Math.pow(10,t),Iot=Math.log10,I9=(t,e)=>typeof t=="number"?e(t):t.map(e);class Dot{constructor(e){Yt(this,"_fn");Yt(this,"_invFn");e?(this._fn=Iot,this._invFn=Rot):(this._fn=R9,this._invFn=R9)}scale(e){return I9(e,this._fn)}scaleInv(e){return I9(e,this._invFn)}}function Lot({variableColorBarName:t,variableColorBarMinMax:e,variableColorBarNorm:n,variableOpacity:r,updateVariableColorBar:i,originalColorBarMinMax:o}){const a=M.useMemo(()=>new Dot(n==="log"),[n]),[s,l]=M.useState(()=>a.scale(e));M.useEffect(()=>{l(a.scale(e))},[a,e]);const c=(E,k)=>{Array.isArray(k)&&l(k)},u=(E,k)=>{if(Array.isArray(k)){const P=Q$(a.scaleInv(k)).map(R=>Number.parseFloat(R));i(t,P,n,r)}},[f,d]=a.scale(o),h=f=2?v=Math.max(2,Math.round(g/2)):(v=4,g=8);const y=f({value:O[k],label:E}));return w.jsx(Zv,{min:b,max:_,value:s,marks:C,step:S,valueLabelFormat:E=>Zf(a.scaleInv(E)),onChange:c,onChangeCommitted:u,valueLabelDisplay:"auto",size:"small"})}const wR=5,Lu={container:t=>({marginTop:t.spacing(2),marginBottom:t.spacing(2),display:"flex",flexDirection:"column",gap:1}),header:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{paddingLeft:2,fontWeight:"bold"},sliderBox:t=>({marginTop:t.spacing(1),marginLeft:t.spacing(wR),marginRight:t.spacing(wR),minWidth:320,width:`calc(100% - ${t.spacing(2*(wR+1))}px)`}),logLabel:{margin:0,paddingRight:2,fontWeight:"bold"},minMaxBox:{display:"flex",justifyContent:"center"},minTextField:{maxWidth:"8em",marginRight:2},maxTextField:{maxWidth:"8em",marginLeft:2}};function $ot({variableColorBar:t,variableColorBarName:e,variableColorBarMinMax:n,variableColorBarNorm:r,variableOpacity:i,updateVariableColorBar:o}){const[a,s]=M.useState(n),[l,c]=M.useState(n),[u,f]=M.useState(D9(n)),[d,h]=M.useState([!1,!1]);M.useEffect(()=>{f(D9(n))},[n]);const p=y=>{const x=y.target.value;f([x,u[1]]);const b=Number.parseFloat(x);let _=!1;if(!Number.isNaN(b)&&b{const x=y.target.value;f([u[0],x]);const b=Number.parseFloat(x);let _=!1;if(!Number.isNaN(b)&&b>a[0]){if(b!==a[1]){const S=[a[0],b];s(S),c(S),o(e,S,r,i)}}else _=!0;h([d[0],_])},g=()=>{const y=t.colorRecords,x=y[0].value,b=y[y.length-1].value,_=[x,b];s(_),c(_),o(e,_,r,i),h([!1,!1])},v=(y,x)=>{o(e,n,x?"log":"lin",i)};return w.jsxs(Ke,{sx:Lu.container,children:[w.jsxs(Ke,{sx:Lu.header,children:[w.jsx(At,{sx:Lu.title,children:fe.get("Value Range")}),w.jsx("span",{style:{flexGrow:1}}),t.colorRecords&&w.jsx(Qa,{sx:{marginRight:1},icon:w.jsx(rfe,{}),onClick:g,tooltipText:fe.get("Set min/max from color mapping values")}),w.jsx(xg,{sx:Lu.logLabel,control:w.jsx(_t,{title:fe.get("Logarithmic scaling"),children:w.jsx(uie,{checked:r==="log",onChange:v,size:"small"})}),label:w.jsx(At,{variant:"body2",children:fe.get("Log-scaled")}),labelPlacement:"start"})]}),w.jsx(Ke,{sx:Lu.sliderBox,children:w.jsx(Lot,{variableColorBarName:e,variableColorBarMinMax:n,variableColorBarNorm:r,updateVariableColorBar:o,originalColorBarMinMax:l,variableOpacity:i})}),w.jsxs(Ke,{component:"form",sx:Lu.minMaxBox,children:[w.jsx(lr,{sx:Lu.minTextField,label:"Minimum",variant:"filled",size:"small",value:u[0],error:d[0],onChange:y=>p(y)}),w.jsx(lr,{sx:Lu.maxTextField,label:"Maximum",variant:"filled",size:"small",value:u[1],error:d[1],onChange:y=>m(y)})]})]})}function D9(t){return[t[0]+"",t[1]+""]}function Not({variableColorBar:t,variableColorBarName:e,variableColorBarMinMax:n,variableColorBarNorm:r,variableOpacity:i,updateVariableColorBar:o,onOpenColorBarEditor:a}){const[s,l]=M.useState(null),c=f=>{l(f.currentTarget)},u=()=>{l(null)};return w.jsxs(w.Fragment,{children:[w.jsx(Sot,{colorBar:t,opacity:i,onClick:a}),w.jsx(Pot,{minValue:n[0],maxValue:n[1],numTicks:5,logScaled:r==="log",onClick:c}),w.jsx(bp,{anchorEl:s,open:!!s,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"center"},children:w.jsx($ot,{variableColorBar:t,variableColorBarName:e,variableColorBarMinMax:n,variableColorBarNorm:r,variableOpacity:i,updateVariableColorBar:o})})]})}var Nz={},Fot=ct;Object.defineProperty(Nz,"__esModule",{value:!0});var ife=Nz.default=void 0,jot=Fot(pt()),Bot=w;ife=Nz.default=(0,jot.default)((0,Bot.jsx)("path",{d:"M12 4.81V19c-3.31 0-6-2.63-6-5.87 0-1.56.62-3.03 1.75-4.14zM6.35 7.56C4.9 8.99 4 10.96 4 13.13 4 17.48 7.58 21 12 21s8-3.52 8-7.87c0-2.17-.9-4.14-2.35-5.57L12 2z"}),"InvertColors");var Fz={},zot=ct;Object.defineProperty(Fz,"__esModule",{value:!0});var ofe=Fz.default=void 0,Uot=zot(pt()),Wot=w;ofe=Fz.default=(0,Uot.default)((0,Wot.jsx)("path",{d:"M17.66 8 12 2.35 6.34 8C4.78 9.56 4 11.64 4 13.64s.78 4.11 2.34 5.67 3.61 2.35 5.66 2.35 4.1-.79 5.66-2.35S20 15.64 20 13.64 19.22 9.56 17.66 8M6 14c.01-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 17.99 12 18 14z"}),"Opacity");const T0={container:{display:"flex",alignItems:"center",justifyContent:"space-between"},settingsBar:{display:"flex",gap:"1px"},toggleButton:{paddingTop:"2px",paddingBottom:"2px"},opacityContainer:{display:"flex",alignItems:"center"},opacityLabel:t=>({color:t.palette.text.secondary}),opacitySlider:{flexGrow:"1px",marginLeft:"10px",marginRight:"10px"}};function Vot({variableColorBarName:t,variableColorBarMinMax:e,variableColorBarNorm:n,variableColorBar:r,variableOpacity:i,updateVariableColorBar:o}){const a=()=>{const c=!r.isAlpha;t=ZT({...r,isAlpha:c}),o(t,e,n,i)},s=()=>{const c=!r.isReversed;t=ZT({...r,isReversed:c}),o(t,e,n,i)},l=(c,u)=>{o(t,e,n,u)};return w.jsxs(w.Fragment,{children:[w.jsx(Ke,{sx:T0.container,children:w.jsxs(Ke,{sx:T0.settingsBar,children:[w.jsx(_t,{arrow:!0,title:fe.get("Hide small values"),children:w.jsx(Pn,{value:"alpha",selected:r.isAlpha,onChange:a,size:"small",children:w.jsx(ofe,{fontSize:"inherit"})})}),w.jsx(_t,{arrow:!0,title:fe.get("Reverse"),children:w.jsx(Pn,{value:"reverse",selected:r.isReversed,onChange:s,size:"small",children:w.jsx(ife,{fontSize:"inherit"})})})]})}),w.jsxs(Ke,{component:"div",sx:T0.opacityContainer,children:[w.jsx(Ke,{component:"span",fontSize:"small",sx:T0.opacityLabel,children:fe.get("Opacity")}),w.jsx(Zv,{min:0,max:1,value:i,step:.01,sx:T0.opacitySlider,onChange:l,size:"small"})]})]})}const Got={colorBarGroupTitle:t=>({marginTop:t.spacing(2*Yb),fontSize:"small",color:t.palette.text.secondary})};function afe({title:t,description:e}){return w.jsx(_t,{arrow:!0,title:e,placement:"left",children:w.jsx(Ke,{sx:Got.colorBarGroupTitle,children:t})})}const L9=t=>({marginTop:t.spacing(Yb),height:20,borderWidth:1,borderStyle:"solid",cursor:"pointer"}),$9={colorBarItem:t=>({...L9(t),borderColor:t.palette.mode==="dark"?"lightgray":"darkgray"}),colorBarItemSelected:t=>({...L9(t),borderColor:"blue"})};function jz({imageData:t,selected:e,onSelect:n,width:r,title:i}){let o=w.jsx("img",{src:t?`data:image/png;base64,${t}`:void 0,alt:t?"color bar":"error",width:"100%",height:"100%",onClick:n});return i&&(o=w.jsx(_t,{arrow:!0,title:i,placement:"left",children:o})),w.jsx(Ke,{width:r||Oy,sx:e?$9.colorBarItemSelected:$9.colorBarItem,children:o})}function Hot({colorBarGroup:t,selectedColorBarName:e,onSelectColorBar:n,images:r}){return w.jsxs(w.Fragment,{children:[w.jsx(afe,{title:t.title,description:t.description}),t.names.map(i=>w.jsx(jz,{title:i,imageData:r[i],selected:i===e,onSelect:()=>n(i)},i))]})}var Bz={},qot=ct;Object.defineProperty(Bz,"__esModule",{value:!0});var aw=Bz.default=void 0,Xot=qot(pt()),Qot=w;aw=Bz.default=(0,Xot.default)((0,Qot.jsx)("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"AddCircleOutline");function sfe(){const t=M.useRef(),e=M.useRef(()=>{t.current&&(t.current(),t.current=void 0)}),n=M.useRef(r=>{t.current=r});return M.useEffect(()=>e.current,[]),[e.current,n.current]}var zz={},Yot=ct;Object.defineProperty(zz,"__esModule",{value:!0});var lfe=zz.default=void 0,Kot=Yot(pt()),Zot=w;lfe=zz.default=(0,Kot.default)((0,Zot.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12z"}),"Cancel");var Uz={},Jot=ct;Object.defineProperty(Uz,"__esModule",{value:!0});var cfe=Uz.default=void 0,eat=Jot(pt()),tat=w;cfe=Uz.default=(0,eat.default)((0,tat.jsx)("path",{d:"M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"}),"Done");function nat({anchorEl:t,markdownText:e,open:n,onClose:r}){if(!e)return null;const i={code:o=>{const{node:a,...s}=o;return w.jsx("code",{...s,style:{color:"green"}})}};return w.jsx(bp,{anchorEl:t,open:n,onClose:r,children:w.jsx(Go,{sx:{width:"32em",overflowY:"auto",fontSize:"smaller",paddingLeft:2,paddingRight:2},children:w.jsx(S2,{children:e,components:i,linkTarget:"_blank"})})})}function ufe({size:t,helpUrl:e}){const[n,r]=M.useState(null),i=M.useRef(null),o=Fce(e),a=()=>{r(i.current)},s=()=>{r(null)};return w.jsxs(w.Fragment,{children:[w.jsx(Ot,{onClick:a,size:t,ref:i,children:w.jsx(P5,{fontSize:"inherit"})}),w.jsx(nat,{anchorEl:n,open:!!n,onClose:s,markdownText:o})]})}const N9={container:{display:"flex",justifyContent:"space-between",gap:.2},doneCancel:{display:"flex",gap:.2}};function sw({onDone:t,onCancel:e,doneDisabled:n,cancelDisabled:r,size:i,helpUrl:o}){return w.jsxs(Ke,{sx:N9.container,children:[w.jsx(Ke,{children:o&&w.jsx(ufe,{size:i,helpUrl:o})}),w.jsxs(Ke,{sx:N9.doneCancel,children:[w.jsx(Ot,{onClick:t,color:"primary",disabled:n,size:i,children:w.jsx(cfe,{fontSize:"inherit"})}),w.jsx(Ot,{onClick:e,color:"primary",disabled:r,size:i,children:w.jsx(lfe,{fontSize:"inherit"})})]})]})}const SR={radioGroup:{marginLeft:1},radio:{padding:"4px"},label:{fontSize:"small"}},rat=[["continuous","Contin.","Continuous color assignment, where each value represents a support point of a color gradient"],["stepwise","Stepwise","Stepwise color mapping where values are bounds of value ranges mapped to the same single color"],["categorical","Categ.","Values represent unique categories or indexes that are mapped to a color"]];function iat({colorMapType:t,setColorMapType:e}){return w.jsx(g5,{row:!0,value:t,onChange:(n,r)=>{e(r)},sx:SR.radioGroup,children:rat.map(([n,r,i])=>w.jsx(_t,{arrow:!0,title:fe.get(i),children:w.jsx(xg,{value:n,control:w.jsx(Bx,{size:"small",sx:SR.radio}),label:w.jsx(Ke,{component:"span",sx:SR.label,children:fe.get(r)})})},n))})}function oat({userColorBar:t,updateUserColorBar:e,selected:n,onSelect:r,onDone:i,onCancel:o}){const a=l=>{e({...t,code:l.currentTarget.value})},s=l=>{e({...t,type:l})};return w.jsxs(Ke,{children:[w.jsx(jz,{imageData:t.imageData,title:t.errorMessage,selected:n,onSelect:r}),w.jsx(iat,{colorMapType:t.type,setColorMapType:s}),w.jsx(lr,{label:"Color mapping",placeholder:goe,multiline:!0,fullWidth:!0,size:"small",minRows:3,sx:{marginTop:1,fontFamily:"monospace"},value:t.code,onChange:a,color:t.errorMessage?"error":"primary",inputProps:{style:{fontFamily:"monospace",fontSize:12}}}),w.jsx(sw,{onDone:i,onCancel:o,doneDisabled:!!t.errorMessage,size:"small",helpUrl:fe.get("docs/color-mappings.en.md")})]})}var Wz={},aat=ct;Object.defineProperty(Wz,"__esModule",{value:!0});var ffe=Wz.default=void 0,sat=aat(pt()),lat=w;ffe=Wz.default=(0,sat.default)((0,lat.jsx)("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreHoriz");const cat={container:{display:"flex",alignItems:"center",width:Oy,height:nfe,gap:Yb,marginTop:Yb}};function uat({imageData:t,title:e,selected:n,onEdit:r,onRemove:i,onSelect:o,disabled:a}){const[s,l]=M.useState(null),c=p=>{l(p.currentTarget)},u=()=>{l(null)},f=()=>{l(null),r()},d=()=>{l(null),i()},h=!!s;return w.jsxs(w.Fragment,{children:[w.jsxs(Ke,{sx:cat.container,children:[w.jsx(jz,{imageData:t,selected:n,onSelect:o,width:Oy-20,title:e}),w.jsx(Ot,{size:"small",onClick:c,children:w.jsx(ffe,{fontSize:"inherit"})})]}),w.jsx(bp,{anchorOrigin:{vertical:"center",horizontal:"center"},transformOrigin:{vertical:"center",horizontal:"center"},open:h,anchorEl:s,onClose:u,children:w.jsxs(Ke,{children:[w.jsx(Ot,{onClick:f,size:"small",disabled:a,children:w.jsx(Ap,{fontSize:"inherit"})}),w.jsx(Ot,{onClick:d,size:"small",disabled:a,children:w.jsx(nw,{fontSize:"inherit"})})]})})]})}const fat={container:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:1}};function dat({colorBarGroup:t,selectedColorBarName:e,onSelectColorBar:n,userColorBars:r,addUserColorBar:i,removeUserColorBar:o,updateUserColorBar:a,updateUserColorBars:s,storeSettings:l}){const[c,u]=M.useState({}),[f,d]=sfe(),h=M.useMemo(()=>r.findIndex(x=>x.id===c.colorBarId),[r,c.colorBarId]),p=()=>{d(()=>s(r));const x=Ys("ucb");i(x),u({action:"add",colorBarId:x})},m=x=>{d(()=>s(r)),u({action:"edit",colorBarId:x})},g=x=>{d(void 0),o(x)},v=()=>{d(void 0),u({}),l()},y=()=>{f(),u({})};return w.jsxs(w.Fragment,{children:[w.jsxs(Ke,{sx:fat.container,children:[w.jsx(afe,{title:fe.get(t.title),description:fe.get(t.description)}),w.jsx(Ot,{onClick:p,size:"small",color:"primary",disabled:!!c.action,children:w.jsx(aw,{fontSize:"inherit"})})]}),r.map(x=>x.id===c.colorBarId&&h>=0?w.jsx(oat,{userColorBar:x,updateUserColorBar:a,selected:x.id===e,onSelect:()=>n(x.id),onDone:v,onCancel:y},x.id):w.jsx(uat,{imageData:x.imageData,title:x.errorMessage,disabled:!!c.action,selected:x.id===e,onSelect:()=>n(x.id),onEdit:()=>m(x.id),onRemove:()=>g(x.id)},x.id))]})}function hat({variableColorBarName:t,variableColorBarMinMax:e,variableColorBarNorm:n,variableColorBar:r,variableOpacity:i,updateVariableColorBar:o,colorBars:a,userColorBars:s,addUserColorBar:l,removeUserColorBar:c,updateUserColorBar:u,updateUserColorBars:f,storeSettings:d}){const h=p=>{t=ZT({...r,baseName:p}),o(t,e,n,i)};return w.jsx(w.Fragment,{children:a.groups.map(p=>p.title===moe?w.jsx(dat,{colorBarGroup:p,selectedColorBarName:r.baseName,onSelectColorBar:h,userColorBars:s,addUserColorBar:l,removeUserColorBar:c,updateUserColorBar:u,updateUserColorBars:f,storeSettings:d},p.title):w.jsx(Hot,{colorBarGroup:p,selectedColorBarName:r.baseName,onSelectColorBar:h,images:a.images},p.title))})}const pat={colorBarBox:t=>({marginTop:t.spacing($S-2*Yb),marginLeft:t.spacing($S),marginRight:t.spacing($S),marginBottom:t.spacing($S)})};function mat(t){const{colorBars:e,userColorBars:n,addUserColorBar:r,removeUserColorBar:i,updateUserColorBar:o,updateUserColorBars:a,...s}=t;return w.jsxs(Ke,{sx:pat.colorBarBox,children:[w.jsx(Vot,{...s}),w.jsx(hat,{...s,colorBars:e,userColorBars:n,addUserColorBar:r,removeUserColorBar:i,updateUserColorBar:o,updateUserColorBars:a})]})}const F9={container:t=>({position:"absolute",zIndex:1e3,top:10,borderRadius:"5px",borderWidth:"1px",borderStyle:"solid",borderColor:"#00000020",backgroundColor:"#FFFFFFAA",color:"black",maxWidth:`${Oy+20}px`,paddingLeft:t.spacing(1.5),paddingRight:t.spacing(1.5),paddingBottom:t.spacing(.5),paddingTop:t.spacing(.5)}),title:t=>({fontSize:"small",fontWeight:"bold",width:"100%",display:"flex",wordBreak:"break-word",wordWrap:"break-word",justifyContent:"center",paddingBottom:t.spacing(.5)})};function dfe(t){const{variableName:e,variableTitle:n,variableUnits:r,variableColorBar:i,style:o}=t,a=M.useRef(null),[s,l]=M.useState(null),c=()=>{l(a.current)},u=()=>{l(null)};if(!e)return null;const f=i.type==="categorical"?n||e:`${n||e} (${r||"-"})`;return w.jsxs(Ke,{sx:F9.container,style:o,ref:a,children:[w.jsx(At,{sx:F9.title,children:f}),i.type==="categorical"?w.jsx(wot,{categories:i.colorRecords,onOpenColorBarEditor:c,...t}):w.jsx(Not,{onOpenColorBarEditor:c,...t}),w.jsx(bp,{anchorEl:s,open:!!s,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:w.jsx(mat,{...t})})]})}const gat=t=>({variableName:py(t),variableTitle:BHe(t),variableUnits:UHe(t),variableColorBarName:d2(t),variableColorBarMinMax:use(t),variableColorBarNorm:hse(t),variableColorBar:RB(t),variableOpacity:xse(t),userColorBars:Ep(t),colorBars:p2(t),style:{right:10}}),vat={updateVariableColorBar:h7e,addUserColorBar:Qle,removeUserColorBar:Zle,updateUserColorBar:Jle,updateUserColorBars:nce,storeSettings:Xle},yat=Jt(gat,vat)(dfe),xat=t=>{const e=t.controlState.variableSplitPos;return{variableName:e?nse(t):null,variableTitle:zHe(t),variableUnits:WHe(t),variableColorBarName:h2(t),variableColorBarMinMax:fse(t),variableColorBarNorm:pse(t),variableColorBar:gse(t),variableOpacity:bse(t),userColorBars:Ep(t),colorBars:p2(t),style:{left:e?e-280:0}}},bat={updateVariableColorBar:p7e,addUserColorBar:Qle,removeUserColorBar:Zle,updateUserColorBar:Jle,updateUserColorBars:nce,storeSettings:Xle},_at=Jt(xat,bat)(dfe),wat={splitter:{position:"absolute",top:0,left:"50%",width:"6px",height:"100%",backgroundColor:"#ffffff60",zIndex:999,borderLeft:"0.5px solid #ffffffd0",borderRight:"0.5px solid #ffffffd0",cursor:"col-resize",boxShadow:"0px 0px 1px 0px black"}};function Sat({hidden:t,position:e,onPositionChange:n}){const r=M.useRef(null),i=M.useRef(([a,s])=>{r.current!==null&&n(r.current.offsetLeft+a)}),o=efe(i.current);return M.useEffect(()=>{!t&&!En(e)&&r.current!==null&&r.current.parentElement!==null&&n(Math.round(r.current.parentElement.clientWidth/2))},[t,e,n]),t?null:w.jsx(Ke,{id:"MapSplitter",ref:r,sx:wat.splitter,style:{left:En(e)?e:"50%"},onMouseDown:o})}const Oat=t=>({hidden:!t.controlState.variableCompareMode,position:t.controlState.variableSplitPos}),Cat={onPositionChange:A7e},Tat=Jt(Oat,Cat)(Sat);function Eat(t,e,n,r,i,o,a){const s=M.useRef(0),[l,c]=M.useState(),[u,f]=M.useState(),[d,h]=M.useState(),p=M.useCallback(async(v,y,x,b,_)=>{_({dataset:v,variable:y,result:{fetching:!0}});try{const S=await M5e(e,v,y,x,b,a,null);console.info(y.name,"=",S),_({dataset:v,variable:y,result:{value:S.value}})}catch(S){_({dataset:v,variable:y,result:{error:S}})}},[e,a]),m=M.useCallback(v=>{const y=v.map;if(!t||!n||!r||!y){f(void 0),h(void 0);return}const x=v.pixel[0],b=v.pixel[1],_=XM(v.coordinate,y.getView().getProjection().getCode(),"EPSG:4326"),S=_[0],O=_[1];c({pixelX:x,pixelY:b,lon:S,lat:O});const C=new Date().getTime();C-s.current>=500&&(s.current=C,p(n,r,S,O,f).finally(()=>{i&&o&&p(i,o,S,O,h)}))},[p,t,n,r,i,o]),g=Va.map;return M.useEffect(()=>{if(t&&g){const v=y=>{y.dragging?c(void 0):m(y)};return g.on("pointermove",v),()=>{g.un("pointermove",v)}}else c(void 0)},[t,g,m]),M.useMemo(()=>l&&u?{location:l,payload:u,payload2:d}:null,[l,u,d])}const pc={container:{display:"grid",gridTemplateColumns:"auto minmax(60px, auto)",gap:0,padding:1,fontSize:"small"},labelItem:{paddingRight:1},valueItem:{textAlign:"right",fontFamily:"monospace"}};function Pat({location:t,payload:e,payload2:n}){return w.jsxs(Ke,{sx:pc.container,children:[w.jsx(Ke,{sx:pc.labelItem,children:"Longitude"}),w.jsx(Ke,{sx:pc.valueItem,children:Zf(t.lon,4)}),w.jsx(Ke,{sx:pc.labelItem,children:"Latitude"}),w.jsx(Ke,{sx:pc.valueItem,children:Zf(t.lat,4)}),w.jsx(Ke,{sx:pc.labelItem,children:j9(e)}),w.jsx(Ke,{sx:pc.valueItem,children:B9(e)}),n&&w.jsx(Ke,{sx:pc.labelItem,children:j9(n)}),n&&w.jsx(Ke,{sx:pc.valueItem,children:B9(n)})]})}function j9(t){const e=t.variable;return e.title||e.name}function B9(t){const e=t.result;return e.error?`${e.error}`:e.fetching?"...":En(e.value)?Zf(e.value,4):"---"}const Mat={container:{position:"absolute",zIndex:1e3,backgroundColor:"#000000A0",color:"#fff",border:"1px solid #FFFFFF50",borderRadius:"4px",transform:"translateX(3%)",pointerEvents:"none"}};function kat({enabled:t,serverUrl:e,dataset1:n,variable1:r,dataset2:i,variable2:o,time:a}){const s=Eat(t,e,n,r,i,o,a);if(!s)return null;const{pixelX:l,pixelY:c}=s.location;return w.jsx(Ke,{sx:{...Mat.container,left:l,top:c},children:w.jsx(Pat,{...s})})}const Aat=t=>({enabled:t.controlState.mapPointInfoBoxEnabled,serverUrl:hi(t).url,dataset1:Gr(t),variable1:vo(t),dataset2:gd(t),variable2:bu(t),time:xy(t)}),Rat={},Iat=Jt(Aat,Rat)(kat);var Vz={},Dat=ct;Object.defineProperty(Vz,"__esModule",{value:!0});var hfe=Vz.default=void 0,Lat=Dat(pt()),$at=w;hfe=Vz.default=(0,Lat.default)((0,$at.jsx)("path",{d:"M10 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h5v2h2V1h-2zm0 15H5l5-6zm9-15h-5v2h5v13l-5-6v9h5c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"}),"Compare");var Gz={},Nat=ct;Object.defineProperty(Gz,"__esModule",{value:!0});var Hz=Gz.default=void 0,Fat=Nat(pt()),jat=w;Hz=Gz.default=(0,Fat.default)((0,jat.jsx)("path",{d:"m11.99 18.54-7.37-5.73L3 14.07l9 7 9-7-1.63-1.27zM12 16l7.36-5.73L21 9l-9-7-9 7 1.63 1.27z"}),"Layers");var qz={},Bat=ct;Object.defineProperty(qz,"__esModule",{value:!0});var pfe=qz.default=void 0,zat=Bat(pt()),Uat=w;pfe=qz.default=(0,zat.default)((0,Uat.jsx)("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-2 12H6v-2h12zm0-3H6V9h12zm0-3H6V6h12z"}),"Message");const z9={position:"absolute",display:"flex",flexDirection:"column",zIndex:1e3};function Wat({style:t,sx:e,children:n}){return w.jsx(Ke,{className:"ol-unselectable ol-control",sx:e,style:t?{...z9,...t}:z9,children:n})}const mfe={width:"1.375em",height:"1.375em"},Vat={...mfe,backgroundColor:"rgba(0,80,180,0.9)"},Gat={tooltip:{sx:{backgroundColor:"#4A4A4A",border:"1px solid white",borderRadius:0}}};function OR({icon:t,tooltipTitle:e,onClick:n,selected:r,onSelect:i}){const o=a=>{i&&i(a,!r),n&&n(a)};return e&&(t=w.jsx(_t,{title:e,componentsProps:Gat,children:t})),w.jsx(Ot,{onClick:o,style:r?Vat:mfe,children:t})}const Hat={left:"0.5em",top:65};function qat({layerMenuOpen:t,setLayerMenuOpen:e,variableCompareMode:n,setVariableCompareMode:r,mapPointInfoBoxEnabled:i,setMapPointInfoBoxEnabled:o}){return w.jsxs(Wat,{style:Hat,children:[w.jsx(OR,{icon:w.jsx(Hz,{fontSize:"small"}),tooltipTitle:fe.get("Show or hide layers panel"),selected:t,onSelect:(a,s)=>void e(s)}),w.jsx(OR,{icon:w.jsx(hfe,{fontSize:"small"}),tooltipTitle:fe.get("Turn layer split mode on or off"),selected:n,onSelect:(a,s)=>void r(s)}),w.jsx(OR,{icon:w.jsx(pfe,{fontSize:"small"}),tooltipTitle:fe.get("Turn info box on or off"),selected:i,onSelect:(a,s)=>void o(s)})]})}const Xat=t=>({layerMenuOpen:t.controlState.layerMenuOpen,variableCompareMode:t.controlState.variableCompareMode,mapPointInfoBoxEnabled:t.controlState.mapPointInfoBoxEnabled}),Qat={setLayerMenuOpen:Ile,setVariableCompareMode:k7e,setMapPointInfoBoxEnabled:M7e},Yat=Jt(Xat,Qat)(qat),Kat=(t,e)=>({mapId:"map",locale:t.controlState.locale,variableLayer:h9e(t),variable2Layer:p9e(t),rgbLayer:m9e(t),rgb2Layer:g9e(t),datasetBoundaryLayer:d9e(t),placeGroupLayers:b9e(t),colorBarLegend:w.jsx(yat,{}),colorBarLegend2:w.jsx(_at,{}),mapSplitter:w.jsx(Tat,{}),mapPointInfoBox:w.jsx(Iat,{}),mapControlActions:w.jsx(Yat,{}),userDrawnPlaceGroupName:t.controlState.userDrawnPlaceGroupName,userPlaceGroups:X1(t),userPlaceGroupsVisibility:QHe(t),showUserPlaces:rse(t),mapInteraction:t.controlState.mapInteraction,mapProjection:md(t),selectedPlaceId:t.controlState.selectedPlaceId,places:K1(t),baseMapLayer:O9e(t),overlayLayer:C9e(t),imageSmoothing:Y1(t),variableSplitPos:t.controlState.variableSplitPos,onMapRef:e.onMapRef}),Zat={addDrawnUserPlace:H9e,importUserPlacesFromText:Qse,selectPlace:v2},U9=Jt(Kat,Zat)(xot);var Xz={},Jat=ct;Object.defineProperty(Xz,"__esModule",{value:!0});var Qz=Xz.default=void 0,est=Jat(pt()),tst=w;Qz=Xz.default=(0,est.default)((0,tst.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z"}),"Info");var Yz={},nst=ct;Object.defineProperty(Yz,"__esModule",{value:!0});var gfe=Yz.default=void 0,rst=nst(pt()),ist=w;gfe=Yz.default=(0,rst.default)((0,ist.jsx)("path",{d:"m2 19.99 7.5-7.51 4 4 7.09-7.97L22 9.92l-8.5 9.56-4-4-6 6.01zm1.5-4.5 6-6.01 4 4L22 3.92l-1.41-1.41-7.09 7.97-4-4L2 13.99z"}),"StackedLineChart");var Kz={},ost=ct;Object.defineProperty(Kz,"__esModule",{value:!0});var vfe=Kz.default=void 0,ast=ost(pt()),sst=w;vfe=Kz.default=(0,ast.default)((0,sst.jsx)("path",{d:"M7.52 21.48C4.25 19.94 1.91 16.76 1.55 13H.05C.56 19.16 5.71 24 12 24l.66-.03-3.81-3.81zm.89-6.52c-.19 0-.37-.03-.52-.08-.16-.06-.29-.13-.4-.24-.11-.1-.2-.22-.26-.37-.06-.14-.09-.3-.09-.47h-1.3c0 .36.07.68.21.95.14.27.33.5.56.69.24.18.51.32.82.41.3.1.62.15.96.15.37 0 .72-.05 1.03-.15.32-.1.6-.25.83-.44s.42-.43.55-.72c.13-.29.2-.61.2-.97 0-.19-.02-.38-.07-.56-.05-.18-.12-.35-.23-.51-.1-.16-.24-.3-.4-.43-.17-.13-.37-.23-.61-.31.2-.09.37-.2.52-.33.15-.13.27-.27.37-.42.1-.15.17-.3.22-.46.05-.16.07-.32.07-.48 0-.36-.06-.68-.18-.96-.12-.28-.29-.51-.51-.69-.2-.19-.47-.33-.77-.43C9.1 8.05 8.76 8 8.39 8c-.36 0-.69.05-1 .16-.3.11-.57.26-.79.45-.21.19-.38.41-.51.67-.12.26-.18.54-.18.85h1.3c0-.17.03-.32.09-.45s.14-.25.25-.34c.11-.09.23-.17.38-.22.15-.05.3-.08.48-.08.4 0 .7.1.89.31.19.2.29.49.29.86 0 .18-.03.34-.08.49-.05.15-.14.27-.25.37-.11.1-.25.18-.41.24-.16.06-.36.09-.58.09H7.5v1.03h.77c.22 0 .42.02.6.07s.33.13.45.23c.12.11.22.24.29.4.07.16.1.35.1.57 0 .41-.12.72-.35.93-.23.23-.55.33-.95.33m8.55-5.92c-.32-.33-.7-.59-1.14-.77-.43-.18-.92-.27-1.46-.27H12v8h2.3c.55 0 1.06-.09 1.51-.27.45-.18.84-.43 1.16-.76.32-.33.57-.73.74-1.19.17-.47.26-.99.26-1.57v-.4c0-.58-.09-1.1-.26-1.57-.18-.47-.43-.87-.75-1.2m-.39 3.16c0 .42-.05.79-.14 1.13-.1.33-.24.62-.43.85-.19.23-.43.41-.71.53-.29.12-.62.18-.99.18h-.91V9.12h.97c.72 0 1.27.23 1.64.69.38.46.57 1.12.57 1.99zM12 0l-.66.03 3.81 3.81 1.33-1.33c3.27 1.55 5.61 4.72 5.96 8.48h1.5C23.44 4.84 18.29 0 12 0"}),"ThreeDRotation");var Zz={},lst=ct;Object.defineProperty(Zz,"__esModule",{value:!0});var yfe=Zz.default=void 0,cst=lst(pt()),ust=w;yfe=Zz.default=(0,cst.default)((0,ust.jsx)("path",{d:"M4 7v2c0 .55-.45 1-1 1H2v4h1c.55 0 1 .45 1 1v2c0 1.65 1.35 3 3 3h3v-2H7c-.55 0-1-.45-1-1v-2c0-1.3-.84-2.42-2-2.83v-.34C5.16 11.42 6 10.3 6 9V7c0-.55.45-1 1-1h3V4H7C5.35 4 4 5.35 4 7m17 3c-.55 0-1-.45-1-1V7c0-1.65-1.35-3-3-3h-3v2h3c.55 0 1 .45 1 1v2c0 1.3.84 2.42 2 2.83v.34c-1.16.41-2 1.52-2 2.83v2c0 .55-.45 1-1 1h-3v2h3c1.65 0 3-1.35 3-3v-2c0-.55.45-1 1-1h1v-4z"}),"DataObject");var Jz={},fst=ct;Object.defineProperty(Jz,"__esModule",{value:!0});var xfe=Jz.default=void 0,dst=fst(pt()),hst=w;xfe=Jz.default=(0,dst.default)((0,hst.jsx)("path",{d:"M19 5v14H5V5zm1.1-2H3.9c-.5 0-.9.4-.9.9v16.2c0 .4.4.9.9.9h16.2c.4 0 .9-.5.9-.9V3.9c0-.5-.5-.9-.9-.9M11 7h6v2h-6zm0 4h6v2h-6zm0 4h6v2h-6zM7 7h2v2H7zm0 4h2v2H7zm0 4h2v2H7z"}),"ListAlt");var e4={},pst=ct;Object.defineProperty(e4,"__esModule",{value:!0});var bfe=e4.default=void 0,mst=pst(pt()),gst=w;bfe=e4.default=(0,mst.default)((0,gst.jsx)("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7m0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5"}),"Place");var t4={},vst=ct;Object.defineProperty(t4,"__esModule",{value:!0});var _fe=t4.default=void 0,yst=vst(pt()),xst=w;_fe=t4.default=(0,yst.default)((0,xst.jsx)("path",{d:"M2.5 4v3h5v12h3V7h5V4zm19 5h-9v3h3v7h3v-7h3z"}),"TextFields");var n4={},bst=ct;Object.defineProperty(n4,"__esModule",{value:!0});var wfe=n4.default=void 0,_st=bst(pt()),wst=w;wfe=n4.default=(0,_st.default)((0,wst.jsx)("path",{d:"M13 13v8h8v-8zM3 21h8v-8H3zM3 3v8h8V3zm13.66-1.31L11 7.34 16.66 13l5.66-5.66z"}),"Widgets");let Sn=class Sfe{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,r){[e,n]=iv(this,e,n);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),Ol.from(i,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=iv(this,e,n);let r=[];return this.decompose(e,n,r,0),Ol.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new Yx(this),o=new Yx(e);for(let a=n,s=n;;){if(i.next(a),o.next(a),a=0,i.lineBreak!=o.lineBreak||i.done!=o.done||i.value!=o.value)return!1;if(s+=i.value.length,i.done||s>=r)return!0}}iter(e=1){return new Yx(this,e)}iterRange(e,n=this.length){return new Ofe(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new Cfe(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?Sfe.empty:e.length<=32?new Cr(e):Ol.from(Cr.split(e,[]))}};class Cr extends Sn{constructor(e,n=Sst(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,i){for(let o=0;;o++){let a=this.text[o],s=i+a.length;if((n?r:s)>=e)return new Ost(i,s,r,a);i=s+1,r++}}decompose(e,n,r,i){let o=e<=0&&n>=this.length?this:new Cr(W9(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(i&1){let a=r.pop(),s=kC(o.text,a.text.slice(),0,o.length);if(s.length<=32)r.push(new Cr(s,a.length+o.length));else{let l=s.length>>1;r.push(new Cr(s.slice(0,l)),new Cr(s.slice(l)))}}else r.push(o)}replace(e,n,r){if(!(r instanceof Cr))return super.replace(e,n,r);[e,n]=iv(this,e,n);let i=kC(this.text,kC(r.text,W9(this.text,0,e)),n),o=this.length+r.length-(n-e);return i.length<=32?new Cr(i,o):Ol.from(Cr.split(i,[]),o)}sliceString(e,n=this.length,r=` `){[e,n]=iv(this,e,n);let i="";for(let o=0,a=0;o<=n&&ae&&a&&(i+=r),eo&&(i+=s.slice(Math.max(0,e-o),n-o)),o=l+1}return i}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let r=[],i=-1;for(let o of e)r.push(o),i+=o.length+1,r.length==32&&(n.push(new Cr(r,i)),r=[],i=-1);return i>-1&&n.push(new Cr(r,i)),n}}class Ol extends Sn{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,n,r,i){for(let o=0;;o++){let a=this.children[o],s=i+a.length,l=r+a.lines-1;if((n?l:s)>=e)return a.lineInner(e,n,r,i);i=s+1,r=l+1}}decompose(e,n,r,i){for(let o=0,a=0;a<=n&&o=a){let c=i&((a<=e?1:0)|(l>=n?2:0));a>=e&&l<=n&&!c?r.push(s):s.decompose(e-a,n-a,r,c)}a=l+1}}replace(e,n,r){if([e,n]=iv(this,e,n),r.lines=o&&n<=s){let l=a.replace(e-o,n-o,r),c=this.lines-a.lines+l.lines;if(l.lines>4&&l.lines>c>>6){let u=this.children.slice();return u[i]=l,new Ol(u,this.length-(n-e)+r.length)}return super.replace(o,s,l)}o=s+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=` -`){[e,n]=iv(this,e,n);let i="";for(let o=0,a=0;oe&&o&&(i+=r),ea&&(i+=s.sliceString(e-a,n-a,r)),a=l+1}return i}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof Ol))return 0;let r=0,[i,o,a,s]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=n,o+=n){if(i==a||o==s)return r;let l=this.children[i],c=e.children[o];if(l!=c)return r+l.scanIdentical(c,n);r+=l.length+1}}static from(e,n=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let h of e)r+=h.lines;if(r<32){let h=[];for(let p of e)p.flatten(h);return new Cr(h,n)}let i=Math.max(32,r>>5),o=i<<1,a=i>>1,s=[],l=0,c=-1,u=[];function f(h){let p;if(h.lines>o&&h instanceof Ol)for(let m of h.children)f(m);else h.lines>a&&(l>a||!l)?(d(),s.push(h)):h instanceof Cr&&l&&(p=u[u.length-1])instanceof Cr&&h.lines+p.lines<=32?(l+=h.lines,c+=h.length+1,u[u.length-1]=new Cr(p.text.concat(h.text),p.length+1+h.length)):(l+h.lines>i&&d(),l+=h.lines,c+=h.length+1,u.push(h))}function d(){l!=0&&(s.push(u.length==1?u[0]:Ol.from(u,c)),c=-1,l=u.length=0)}for(let h of e)f(h);return d(),s.length==1?s[0]:new Ol(s,n)}}Sn.empty=new Cr([""],0);function _st(t){let e=-1;for(let n of t)e+=n.length+1;return e}function kC(t,e,n=0,r=1e9){for(let i=0,o=0,a=!0;o=n&&(l>r&&(s=s.slice(0,r-i)),i0?1:(e instanceof Cr?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],o=this.offsets[r],a=o>>1,s=i instanceof Cr?i.text.length:i.children.length;if(a==(n>0?s:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((o&1)==(n>0?0:1)){if(this.offsets[r]+=n,e==0)return this.lineBreak=!0,this.value=` -`,this;e--}else if(i instanceof Cr){let l=i.text[a+(n<0?-1:0)];if(this.offsets[r]+=n,l.length>Math.max(0,e))return this.value=e==0?l:n>0?l.slice(e):l.slice(0,l.length-e),this;e-=l.length}else{let l=i.children[a+(n<0?-1:0)];e>l.length?(e-=l.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(l),this.offsets.push(n>0?1:(l instanceof Cr?l.text.length:l.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Sfe{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new Yx(e,n>r?-1:1),this.pos=n>r?e.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*n,this.value=i.length<=r?i:n<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Ofe{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:r,value:i}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Sn.prototype[Symbol.iterator]=function(){return this.iter()},Yx.prototype[Symbol.iterator]=Sfe.prototype[Symbol.iterator]=Ofe.prototype[Symbol.iterator]=function(){return this});let wst=class{constructor(e,n,r,i){this.from=e,this.to=n,this.number=r,this.text=i}get length(){return this.to-this.from}};function iv(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}let Og="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(t=>t?parseInt(t,36):1);for(let t=1;tt)return Og[e-1]<=t;return!1}function U9(t){return t>=127462&&t<=127487}const W9=8205;function ki(t,e,n=!0,r=!0){return(n?Cfe:Ost)(t,e,r)}function Cfe(t,e,n){if(e==t.length)return e;e&&Tfe(t.charCodeAt(e))&&Efe(t.charCodeAt(e-1))&&e--;let r=Ci(t,e);for(e+=Ga(r);e=0&&U9(Ci(t,a));)o++,a-=2;if(o%2==0)break;e+=2}else break}return e}function Ost(t,e,n){for(;e>0;){let r=Cfe(t,e-2,n);if(r=56320&&t<57344}function Efe(t){return t>=55296&&t<56320}function Ci(t,e){let n=t.charCodeAt(e);if(!Efe(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return Tfe(r)?(n-55296<<10)+(r-56320)+65536:n}function n4(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function Ga(t){return t<65536?1:2}const Q$=/\r\n?|\n/;var Pi=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(Pi||(Pi={}));class Hl{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;ne)return o+(e-i);o+=s}else{if(r!=Pi.Simple&&c>=e&&(r==Pi.TrackDel&&ie||r==Pi.TrackBefore&&ie))return null;if(c>e||c==e&&n<0&&!s)return e==i||n<0?o:o+l;o+=l}i=c}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return o}touchesRange(e,n=e){for(let r=0,i=0;r=0&&i<=n&&s>=e)return in?"cover":!0;i=s}return!1}toString(){let e="";for(let n=0;n=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Hl(e)}static create(e){return new Hl(e)}}class Kr extends Hl{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Y$(this,(n,r,i,o,a)=>e=e.replace(i,i+(r-n),a),!1),e}mapDesc(e,n=!1){return K$(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let i=0,o=0;i=0){n[i]=s,n[i+1]=a;let l=i>>1;for(;r.length0&&xf(r,n,o.text),o.forward(u),s+=u}let c=e[a++];for(;s>1].toJSON()))}return e}static of(e,n,r){let i=[],o=[],a=0,s=null;function l(u=!1){if(!u&&!i.length)return;ad||f<0||d>n)throw new RangeError(`Invalid change range ${f} to ${d} (in doc of length ${n})`);let p=h?typeof h=="string"?Sn.of(h.split(r||Q$)):h:Sn.empty,m=p.length;if(f==d&&m==0)return;fa&&qi(i,f-a,-1),qi(i,d-f,m),xf(o,i,p),a=d}}return c(e),l(!s),s}static empty(e){return new Kr(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let i=0;is&&typeof a!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(o.length==1)n.push(o[0],0);else{for(;r.length=0&&n<=0&&n==t[i+1]?t[i]+=e:e==0&&t[i]==0?t[i+1]+=n:r?(t[i]+=e,t[i+1]+=n):t.push(e,n)}function xf(t,e,n){if(n.length==0)return;let r=e.length-2>>1;if(r>1])),!(n||a==t.sections.length||t.sections[a+1]<0);)s=t.sections[a++],l=t.sections[a++];e(i,c,o,u,f),i=c,o=u}}}function K$(t,e,n,r=!1){let i=[],o=r?[]:null,a=new Kb(t),s=new Kb(e);for(let l=-1;;)if(a.ins==-1&&s.ins==-1){let c=Math.min(a.len,s.len);qi(i,c,-1),a.forward(c),s.forward(c)}else if(s.ins>=0&&(a.ins<0||l==a.i||a.off==0&&(s.len=0&&l=0){let c=0,u=a.len;for(;u;)if(s.ins==-1){let f=Math.min(u,s.len);c+=f,u-=f,s.forward(f)}else if(s.ins==0&&s.lenl||a.ins>=0&&a.len>l)&&(s||r.length>c),o.forward2(l),a.forward(l)}}}}class Kb{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return n>=e.length?Sn.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?Sn.empty:n[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class vh{constructor(e,n,r){this.from=e,this.to=n,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,n=-1){let r,i;return this.empty?r=i=e.mapPos(this.from,n):(r=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new vh(r,i,this.flags)}extend(e,n=e){if(e<=this.anchor&&n>=this.anchor)return je.range(e,n);let r=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return je.range(this.anchor,r)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return je.range(e.anchor,e.head)}static create(e,n,r){return new vh(e,n,r)}}class je{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:je.create(this.ranges.map(r=>r.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;re.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new je(e.ranges.map(n=>vh.fromJSON(n)),e.main)}static single(e,n=e){return new je([je.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;ie?8:0)|o)}static normalized(e,n=0){let r=e[n];e.sort((i,o)=>i.from-o.from),n=e.indexOf(r);for(let i=1;io.head?je.range(l,s):je.range(s,l))}}return new je(e,n)}}function Mfe(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let r4=0;class ft{constructor(e,n,r,i,o){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=r4++,this.default=e([]),this.extensions=typeof o=="function"?o(this):o}get reader(){return this}static define(e={}){return new ft(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:i4),!!e.static,e.enables)}of(e){return new AC([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new AC(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new AC(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function i4(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class AC{constructor(e,n,r,i){this.dependencies=e,this.facet=n,this.type=r,this.value=i,this.id=r4++}dynamicSlot(e){var n;let r=this.value,i=this.facet.compareInput,o=this.id,a=e[o]>>1,s=this.type==2,l=!1,c=!1,u=[];for(let f of this.dependencies)f=="doc"?l=!0:f=="selection"?c=!0:((n=e[f.id])!==null&&n!==void 0?n:1)&1||u.push(e[f.id]);return{create(f){return f.values[a]=r(f),1},update(f,d){if(l&&d.docChanged||c&&(d.docChanged||d.selection)||Z$(f,u)){let h=r(f);if(s?!V9(h,f.values[a],i):!i(h,f.values[a]))return f.values[a]=h,1}return 0},reconfigure:(f,d)=>{let h,p=d.config.address[o];if(p!=null){let m=sE(d,p);if(this.dependencies.every(g=>g instanceof ft?d.facet(g)===f.facet(g):g instanceof pi?d.field(g,!1)==f.field(g,!1):!0)||(s?V9(h=r(f),m,i):i(h=r(f),m)))return f.values[a]=m,0}else h=r(f);return f.values[a]=h,1}}}}function V9(t,e,n){if(t.length!=e.length)return!1;for(let r=0;rt[l.id]),i=n.map(l=>l.type),o=r.filter(l=>!(l&1)),a=t[e.id]>>1;function s(l){let c=[];for(let u=0;ur===i),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(G9).find(r=>r.field==this);return((n==null?void 0:n.create)||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,i)=>{let o=r.values[n],a=this.updateF(o,i);return this.compareF(o,a)?0:(r.values[n]=a,1)},reconfigure:(r,i)=>i.config.address[this.id]!=null?(r.values[n]=i.field(this),0):(r.values[n]=this.create(r),1)}}init(e){return[this,G9.of({field:this,create:e})]}get extension(){return this}}const ih={lowest:4,low:3,default:2,high:1,highest:0};function E0(t){return e=>new kfe(e,t)}const bd={highest:E0(ih.highest),high:E0(ih.high),default:E0(ih.default),low:E0(ih.low),lowest:E0(ih.lowest)};class kfe{constructor(e,n){this.inner=e,this.prec=n}}class T2{of(e){return new J$(this,e)}reconfigure(e){return T2.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class J${constructor(e,n){this.compartment=e,this.inner=n}}class aE{constructor(e,n,r,i,o,a){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=o,this.facets=a,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,n,r){let i=[],o=Object.create(null),a=new Map;for(let d of Tst(e,n,a))d instanceof pi?i.push(d):(o[d.facet.id]||(o[d.facet.id]=[])).push(d);let s=Object.create(null),l=[],c=[];for(let d of i)s[d.id]=c.length<<1,c.push(h=>d.slot(h));let u=r==null?void 0:r.config.facets;for(let d in o){let h=o[d],p=h[0].facet,m=u&&u[d]||[];if(h.every(g=>g.type==0))if(s[p.id]=l.length<<1|1,i4(m,h))l.push(r.facet(p));else{let g=p.combine(h.map(v=>v.value));l.push(r&&p.compare(g,r.facet(p))?r.facet(p):g)}else{for(let g of h)g.type==0?(s[g.id]=l.length<<1|1,l.push(g.value)):(s[g.id]=c.length<<1,c.push(v=>g.dynamicSlot(v)));s[p.id]=c.length<<1,c.push(g=>Cst(g,p,h))}}let f=c.map(d=>d(s));return new aE(e,a,f,s,l,o)}}function Tst(t,e,n){let r=[[],[],[],[],[]],i=new Map;function o(a,s){let l=i.get(a);if(l!=null){if(l<=s)return;let c=r[l].indexOf(a);c>-1&&r[l].splice(c,1),a instanceof J$&&n.delete(a.compartment)}if(i.set(a,s),Array.isArray(a))for(let c of a)o(c,s);else if(a instanceof J$){if(n.has(a.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(a.compartment)||a.inner;n.set(a.compartment,c),o(c,s)}else if(a instanceof kfe)o(a.inner,a.prec);else if(a instanceof pi)r[s].push(a),a.provides&&o(a.provides,s);else if(a instanceof AC)r[s].push(a),a.facet.extensions&&o(a.facet.extensions,ih.default);else{let c=a.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${a}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);o(c,s)}}return o(t,ih.default),r.reduce((a,s)=>a.concat(s))}function Kx(t,e){if(e&1)return 2;let n=e>>1,r=t.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;t.status[n]=4;let i=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|i}function sE(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const Afe=ft.define(),e3=ft.define({combine:t=>t.some(e=>e),static:!0}),Rfe=ft.define({combine:t=>t.length?t[0]:void 0,static:!0}),Ife=ft.define(),Dfe=ft.define(),Lfe=ft.define(),$fe=ft.define({combine:t=>t.length?t[0]:!1});class oc{constructor(e,n){this.type=e,this.value=n}static define(){return new Est}}class Est{of(e){return new oc(this,e)}}class Pst{constructor(e){this.map=e}of(e){return new It(this,e)}}class It{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new It(this.type,n)}is(e){return this.type==e}static define(e={}){return new Pst(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let r=[];for(let i of e){let o=i.map(n);o&&r.push(o)}return r}}It.reconfigure=It.define();It.appendConfig=It.define();class Br{constructor(e,n,r,i,o,a){this.startState=e,this.changes=n,this.selection=r,this.effects=i,this.annotations=o,this.scrollIntoView=a,this._doc=null,this._state=null,r&&Mfe(r,n.newLength),o.some(s=>s.type==Br.time)||(this.annotations=o.concat(Br.time.of(Date.now())))}static create(e,n,r,i,o,a){return new Br(e,n,r,i,o,a)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(Br.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}Br.time=oc.define();Br.userEvent=oc.define();Br.addToHistory=oc.define();Br.remote=oc.define();function Mst(t,e){let n=[];for(let r=0,i=0;;){let o,a;if(r=t[r]))o=t[r++],a=t[r++];else if(i=0;i--){let o=r[i](t);o instanceof Br?t=o:Array.isArray(o)&&o.length==1&&o[0]instanceof Br?t=o[0]:t=Ffe(e,Cg(o),!1)}return t}function Ast(t){let e=t.startState,n=e.facet(Lfe),r=t;for(let i=n.length-1;i>=0;i--){let o=n[i](t);o&&Object.keys(o).length&&(r=Nfe(r,t3(e,o,t.changes.newLength),!0))}return r==t?t:Br.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const Rst=[];function Cg(t){return t==null?Rst:Array.isArray(t)?t:[t]}var ur=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(ur||(ur={}));const Ist=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let n3;try{n3=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function Dst(t){if(n3)return n3.test(t);for(let e=0;e"€"&&(n.toUpperCase()!=n.toLowerCase()||Ist.test(n)))return!0}return!1}function Lst(t){return e=>{if(!/\S/.test(e))return ur.Space;if(Dst(e))return ur.Word;for(let n=0;n-1)return ur.Word;return ur.Other}}class en{constructor(e,n,r,i,o,a){this.config=e,this.doc=n,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=o,a&&(a._state=this);for(let s=0;si.set(c,l)),n=null),i.set(s.value.compartment,s.value.extension)):s.is(It.reconfigure)?(n=null,r=s.value):s.is(It.appendConfig)&&(n=null,r=Cg(r).concat(s.value));let o;n?o=e.startState.values.slice():(n=aE.resolve(r,i,this),o=new en(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(l,c)=>c.reconfigure(l,this),null).values);let a=e.startState.facet(e3)?e.newSelection:e.newSelection.asSingle();new en(n,e.newDoc,a,o,(s,l)=>l.update(s,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:je.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,r=e(n.ranges[0]),i=this.changes(r.changes),o=[r.range],a=Cg(r.effects);for(let s=1;sa.spec.fromJSON(s,l)))}}return en.create({doc:e.doc,selection:je.fromJSON(e.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(e={}){let n=aE.resolve(e.extensions||[],new Map),r=e.doc instanceof Sn?e.doc:Sn.of((e.doc||"").split(n.staticFacet(en.lineSeparator)||Q$)),i=e.selection?e.selection instanceof je?e.selection:je.single(e.selection.anchor,e.selection.head):je.single(0);return Mfe(i,r.length),n.staticFacet(e3)||(i=i.asSingle()),new en(n,r,i,n.dynamicSlots.map(()=>null),(o,a)=>a.create(o),null)}get tabSize(){return this.facet(en.tabSize)}get lineBreak(){return this.facet(en.lineSeparator)||` -`}get readOnly(){return this.facet($fe)}phrase(e,...n){for(let r of this.facet(en.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let o=+(i||1);return!o||o>n.length?r:n[o-1]})),e}languageDataAt(e,n,r=-1){let i=[];for(let o of this.facet(Afe))for(let a of o(this,n,r))Object.prototype.hasOwnProperty.call(a,e)&&i.push(a[e]);return i}charCategorizer(e){return Lst(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:n,from:r,length:i}=this.doc.lineAt(e),o=this.charCategorizer(e),a=e-r,s=e-r;for(;a>0;){let l=ki(n,a,!1);if(o(n.slice(l,a))!=ur.Word)break;a=l}for(;st.length?t[0]:4});en.lineSeparator=Rfe;en.readOnly=$fe;en.phrases=ft.define({compare(t,e){let n=Object.keys(t),r=Object.keys(e);return n.length==r.length&&n.every(i=>t[i]==e[i])}});en.languageData=Afe;en.changeFilter=Ife;en.transactionFilter=Dfe;en.transactionExtender=Lfe;T2.reconfigure=It.define();function ac(t,e,n={}){let r={};for(let i of t)for(let o of Object.keys(i)){let a=i[o],s=r[o];if(s===void 0)r[o]=a;else if(!(s===a||a===void 0))if(Object.hasOwnProperty.call(n,o))r[o]=n[o](s,a);else throw new Error("Config merge conflict for field "+o)}for(let i in e)r[i]===void 0&&(r[i]=e[i]);return r}class ep{eq(e){return this==e}range(e,n=e){return r3.create(e,n,this)}}ep.prototype.startSide=ep.prototype.endSide=0;ep.prototype.point=!1;ep.prototype.mapMode=Pi.TrackDel;let r3=class jfe{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new jfe(e,n,r)}};function i3(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class o4{constructor(e,n,r,i){this.from=e,this.to=n,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,n,r,i=0){let o=r?this.to:this.from;for(let a=i,s=o.length;;){if(a==s)return a;let l=a+s>>1,c=o[l]-e||(r?this.value[l].endSide:this.value[l].startSide)-n;if(l==a)return c>=0?a:s;c>=0?s=l:a=l+1}}between(e,n,r,i){for(let o=this.findIndex(n,-1e9,!0),a=this.findIndex(r,1e9,!1,o);oh||d==h&&c.startSide>0&&c.endSide<=0)continue;(h-d||c.endSide-c.startSide)<0||(a<0&&(a=d),c.point&&(s=Math.max(s,h-d)),r.push(c),i.push(d-a),o.push(h-a))}return{mapped:r.length?new o4(i,o,r,s):null,pos:a}}}class sn{constructor(e,n,r,i){this.chunkPos=e,this.chunk=n,this.nextLayer=r,this.maxPoint=i}static create(e,n,r,i){return new sn(e,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:o=this.length}=e,a=e.filter;if(n.length==0&&!a)return this;if(r&&(n=n.slice().sort(i3)),this.isEmpty)return n.length?sn.of(n):this;let s=new Bfe(this,null,-1).goto(0),l=0,c=[],u=new Jf;for(;s.value||l=0){let f=n[l++];u.addInner(f.from,f.to,f.value)||c.push(f)}else s.rangeIndex==1&&s.chunkIndexthis.chunkEnd(s.chunkIndex)||os.to||o=o&&e<=o+a.length&&a.between(o,e-o,n-o,r)===!1)return}this.nextLayer.between(e,n,r)}}iter(e=0){return Zb.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return Zb.from(e).goto(n)}static compare(e,n,r,i,o=-1){let a=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=o),s=n.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=o),l=H9(a,s,r),c=new P0(a,l,o),u=new P0(s,l,o);r.iterGaps((f,d,h)=>q9(c,f,u,d,h,i)),r.empty&&r.length==0&&q9(c,0,u,0,0,i)}static eq(e,n,r=0,i){i==null&&(i=999999999);let o=e.filter(u=>!u.isEmpty&&n.indexOf(u)<0),a=n.filter(u=>!u.isEmpty&&e.indexOf(u)<0);if(o.length!=a.length)return!1;if(!o.length)return!0;let s=H9(o,a),l=new P0(o,s,0).goto(r),c=new P0(a,s,0).goto(r);for(;;){if(l.to!=c.to||!o3(l.active,c.active)||l.point&&(!c.point||!l.point.eq(c.point)))return!1;if(l.to>i)return!0;l.next(),c.next()}}static spans(e,n,r,i,o=-1){let a=new P0(e,null,o).goto(n),s=n,l=a.openStart;for(;;){let c=Math.min(a.to,r);if(a.point){let u=a.activeForPoint(a.to),f=a.pointFroms&&(i.span(s,c,a.active,l),l=a.openEnd(c));if(a.to>r)return l+(a.point&&a.to>r?1:0);s=a.to,a.next()}}static of(e,n=!1){let r=new Jf;for(let i of e instanceof r3?[e]:n?$st(e):e)r.add(i.from,i.to,i.value);return r.finish()}static join(e){if(!e.length)return sn.empty;let n=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let i=e[r];i!=sn.empty;i=i.nextLayer)n=new sn(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}}sn.empty=new sn([],[],null,-1);function $st(t){if(t.length>1)for(let e=t[0],n=1;n0)return t.slice().sort(i3);e=r}return t}sn.empty.nextLayer=sn.empty;class Jf{finishChunk(e){this.chunks.push(new o4(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,n,r){this.addInner(e,n,r)||(this.nextLayer||(this.nextLayer=new Jf)).add(e,n,r)}addInner(e,n,r){let i=e-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(e);let r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+e,this.lastTo=n.to[r]+e,!0}finish(){return this.finishInner(sn.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=sn.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function H9(t,e,n){let r=new Map;for(let o of t)for(let a=0;a=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=r&&i.push(new Bfe(a,n,r,o));return i.length==1?i[0]:new Zb(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let r of this.heap)r.goto(e,n);for(let r=this.heap.length>>1;r>=0;r--)OR(this.heap,r);return this.next(),this}forward(e,n){for(let r of this.heap)r.forward(e,n);for(let r=this.heap.length>>1;r>=0;r--)OR(this.heap,r);(this.to-e||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),OR(this.heap,0)}}}function OR(t,e){for(let n=t[e];;){let r=(e<<1)+1;if(r>=t.length)break;let i=t[r];if(r+1=0&&(i=t[r+1],r++),n.compare(i)<0)break;t[r]=n,t[e]=i,e=r}}class P0{constructor(e,n,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Zb.from(e,n,r)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){FS(this.active,e),FS(this.activeTo,e),FS(this.activeRank,e),this.minActive=X9(this.active,this.activeTo)}addActive(e){let n=0,{value:r,to:i,rank:o}=this.cursor;for(;n0;)n++;jS(this.active,n,r),jS(this.activeTo,n,i),jS(this.activeRank,n,o),e&&jS(e,n,this.cursor.from),this.minActive=X9(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&FS(r,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let o=this.cursor.value;if(!o.point)this.addActive(r),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from=0&&r[i]=0&&!(this.activeRank[r]e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(e){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)n++;return n}}function q9(t,e,n,r,i,o){t.goto(e),n.goto(r);let a=r+i,s=r,l=r-e;for(;;){let c=t.to+l-n.to||t.endSide-n.endSide,u=c<0?t.to+l:n.to,f=Math.min(u,a);if(t.point||n.point?t.point&&n.point&&(t.point==n.point||t.point.eq(n.point))&&o3(t.activeForPoint(t.to),n.activeForPoint(n.to))||o.comparePoint(s,f,t.point,n.point):f>s&&!o3(t.active,n.active)&&o.compareRange(s,f,t.active,n.active),u>a)break;s=u,c<=0&&t.next(),c>=0&&n.next()}}function o3(t,e){if(t.length!=e.length)return!1;for(let n=0;n=e;r--)t[r+1]=t[r];t[e]=n}function X9(t,e){let n=-1,r=1e9;for(let i=0;i=e)return i;if(i==t.length)break;o+=t.charCodeAt(i)==9?n-o%n:1,i=ki(t,i)}return r===!0?-1:t.length}const s3="ͼ",Q9=typeof Symbol>"u"?"__"+s3:Symbol.for(s3),l3=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Y9=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class ed{constructor(e,n){this.rules=[];let{finish:r}=n||{};function i(a){return/^@/.test(a)?[a]:a.split(/,\s*/)}function o(a,s,l,c){let u=[],f=/^@(\w+)\b/.exec(a[0]),d=f&&f[1]=="keyframes";if(f&&s==null)return l.push(a[0]+";");for(let h in s){let p=s[h];if(/&/.test(h))o(h.split(/,\s*/).map(m=>a.map(g=>m.replace(/&/,g))).reduce((m,g)=>m.concat(g)),p,l);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+h+") should be a primitive value.");o(i(h),p,u,d)}else p!=null&&u.push(h.replace(/_.*/,"").replace(/[A-Z]/g,m=>"-"+m.toLowerCase())+": "+p+";")}(u.length||d)&&l.push((r&&!f&&!c?a.map(r):a).join(", ")+" {"+u.join(" ")+"}")}for(let a in e)o(i(a),e[a],this.rules)}getRules(){return this.rules.join(` -`)}static newName(){let e=Y9[Q9]||1;return Y9[Q9]=e+1,s3+e.toString(36)}static mount(e,n,r){let i=e[l3],o=r&&r.nonce;i?o&&i.setNonce(o):i=new Nst(e,o),i.mount(Array.isArray(n)?n:[n],e)}}let K9=new Map;class Nst{constructor(e,n){let r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let o=K9.get(r);if(o)return e[l3]=o;this.sheet=new i.CSSStyleSheet,K9.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[l3]=this}mount(e,n){let r=this.sheet,i=0,o=0;for(let a=0;a-1&&(this.modules.splice(l,1),o--,l=-1),l==-1){if(this.modules.splice(o++,0,s),r)for(let c=0;c",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Fst=typeof navigator<"u"&&/Mac/.test(navigator.platform),jst=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Ti=0;Ti<10;Ti++)td[48+Ti]=td[96+Ti]=String(Ti);for(var Ti=1;Ti<=24;Ti++)td[Ti+111]="F"+Ti;for(var Ti=65;Ti<=90;Ti++)td[Ti]=String.fromCharCode(Ti+32),Jb[Ti]=String.fromCharCode(Ti);for(var CR in td)Jb.hasOwnProperty(CR)||(Jb[CR]=td[CR]);function Bst(t){var e=Fst&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||jst&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Jb:td)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function lE(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function c3(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function zst(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function RC(t,e){if(!e.anchorNode)return!1;try{return c3(t,e.anchorNode)}catch{return!1}}function ov(t){return t.nodeType==3?np(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function Zx(t,e,n,r){return n?Z9(t,e,n,r,-1)||Z9(t,e,n,r,1):!1}function tp(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function cE(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function Z9(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:uu(t))){if(t.nodeName=="DIV")return!1;let o=t.parentNode;if(!o||o.nodeType!=1)return!1;e=tp(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=i<0?uu(t):0}else return!1}}function uu(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function E2(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function Ust(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function zfe(t,e){let n=e.width/t.offsetWidth,r=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-t.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function Wst(t,e,n,r,i,o,a,s){let l=t.ownerDocument,c=l.defaultView||window;for(let u=t,f=!1;u&&!f;)if(u.nodeType==1){let d,h=u==l.body,p=1,m=1;if(h)d=Ust(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(f=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let y=u.getBoundingClientRect();({scaleX:p,scaleY:m}=zfe(u,y)),d={left:y.left,right:y.left+u.clientWidth*p,top:y.top,bottom:y.top+u.clientHeight*m}}let g=0,v=0;if(i=="nearest")e.top0&&e.bottom>d.bottom+v&&(v=e.bottom-d.bottom+v+a)):e.bottom>d.bottom&&(v=e.bottom-d.bottom+a,n<0&&e.top-v0&&e.right>d.right+g&&(g=e.right-d.right+g+o)):e.right>d.right&&(g=e.right-d.right+o,n<0&&e.leftn.clientHeight||n.scrollWidth>n.clientWidth)return n;n=n.assignedSlot||n.parentNode}else if(n.nodeType==11)n=n.host;else break;return null}class Gst{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:n,focusNode:r}=e;this.set(n,Math.min(e.anchorOffset,n?uu(n):0),r,Math.min(e.focusOffset,r?uu(r):0))}set(e,n,r,i){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}let om=null;function Ufe(t){if(t.setActive)return t.setActive();if(om)return t.focus(om);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(om==null?{get preventScroll(){return om={preventScroll:!0},!0}}:void 0),!om){om=!1;for(let n=0;nMath.max(1,t.scrollHeight-t.clientHeight-4)}function Gfe(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r>0)return{node:n,offset:r};if(n.nodeType==1&&r>0){if(n.contentEditable=="false")return null;n=n.childNodes[r-1],r=uu(n)}else if(n.parentNode&&!cE(n))r=tp(n),n=n.parentNode;else return null}}function Hfe(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&rn)return f.domBoundsAround(e,n,c);if(d>=e&&i==-1&&(i=l,o=c),c>n&&f.dom.parentNode==this.dom){a=l,s=u;break}u=d,c=d+f.breakAfter}return{from:o,to:s<0?r+this.length:s,startDOM:(i?this.children[i-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:a=0?this.children[a].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let n=this.parent;n;n=n.parent){if(e&&(n.flags|=2),n.flags&1)return;n.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let n=e.parent;if(!n)return e;e=n}}replaceChildren(e,n,r=a4){this.markDirty();for(let i=e;ithis.pos||e==this.pos&&(n>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let r=this.children[--this.i];this.pos-=r.length+r.breakAfter}}}function Xfe(t,e,n,r,i,o,a,s,l){let{children:c}=t,u=c.length?c[e]:null,f=o.length?o[o.length-1]:null,d=f?f.breakAfter:a;if(!(e==r&&u&&!a&&!d&&o.length<2&&u.merge(n,i,o.length?f:null,n==0,s,l))){if(r0&&(!a&&o.length&&u.merge(n,u.length,o[0],!1,s,0)?u.breakAfter=o.shift().breakAfter:(n2);var ht={mac:r7||/Mac/.test(fa.platform),windows:/Win/.test(fa.platform),linux:/Linux|X11/.test(fa.platform),ie:P2,ie_version:Yfe?u3.documentMode||6:d3?+d3[1]:f3?+f3[1]:0,gecko:t7,gecko_version:t7?+(/Firefox\/(\d+)/.exec(fa.userAgent)||[0,0])[1]:0,chrome:!!TR,chrome_version:TR?+TR[1]:0,ios:r7,android:/Android\b/.test(fa.userAgent),webkit:n7,safari:Kfe,webkit_version:n7?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:u3.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const Xst=256;class Ks extends Dn{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,n){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(n&&n.node==this.dom&&(n.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,n,r){return this.flags&8||r&&(!(r instanceof Ks)||this.length-(n-e)+r.length>Xst||r.flags&8)?!1:(this.text=this.text.slice(0,e)+(r?r.text:"")+this.text.slice(n),this.markDirty(),!0)}split(e){let n=new Ks(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),n.flags|=this.flags&8,n}localPosFromDOM(e,n){return e==this.dom?n:n?this.text.length:0}domAtPos(e){return new Yi(this.dom,e)}domBoundsAround(e,n,r){return{from:r,to:r+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,n){return Qst(this.dom,e,n)}}class fu extends Dn{constructor(e,n=[],r=0){super(),this.mark=e,this.children=n,this.length=r;for(let i of n)i.setParent(this)}setAttrs(e){if(Wfe(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let n in this.mark.attrs)e.setAttribute(n,this.mark.attrs[n]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,n){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,n)}merge(e,n,r,i,o,a){return r&&(!(r instanceof fu&&r.mark.eq(this.mark))||e&&o<=0||ne&&n.push(r=e&&(i=o),r=l,o++}let a=this.length-e;return this.length=e,i>-1&&(this.children.length=i,this.markDirty()),new fu(this.mark,n,a)}domAtPos(e){return Zfe(this,e)}coordsAt(e,n){return ede(this,e,n)}}function Qst(t,e,n){let r=t.nodeValue.length;e>r&&(e=r);let i=e,o=e,a=0;e==0&&n<0||e==r&&n>=0?ht.chrome||ht.gecko||(e?(i--,a=1):o=0)?0:s.length-1];return ht.safari&&!a&&l.width==0&&(l=Array.prototype.find.call(s,c=>c.width)||l),a?E2(l,a<0):l||null}class bf extends Dn{static create(e,n,r){return new bf(e,n,r)}constructor(e,n,r){super(),this.widget=e,this.length=n,this.side=r,this.prevWidget=null}split(e){let n=bf.create(this.widget,this.length-e,this.side);return this.length-=e,n}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,n,r,i,o,a){return r&&(!(r instanceof bf)||!this.widget.compare(r.widget)||e>0&&o<=0||n0)?Yi.before(this.dom):Yi.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,n){let r=this.widget.coordsAt(this.dom,e,n);if(r)return r;let i=this.dom.getClientRects(),o=null;if(!i.length)return null;let a=this.side?this.side<0:e>0;for(let s=a?i.length-1:0;o=i[s],!(e>0?s==0:s==i.length-1||o.top0?Yi.before(this.dom):Yi.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return Sn.empty}get isHidden(){return!0}}Ks.prototype.children=bf.prototype.children=av.prototype.children=a4;function Zfe(t,e){let n=t.dom,{children:r}=t,i=0;for(let o=0;io&&e0;o--){let a=r[o-1];if(a.dom.parentNode==n)return a.domAtPos(a.length)}for(let o=i;o0&&e instanceof fu&&i.length&&(r=i[i.length-1])instanceof fu&&r.mark.eq(e.mark)?Jfe(r,e.children[0],n-1):(i.push(e),e.setParent(t)),t.length+=e.length}function ede(t,e,n){let r=null,i=-1,o=null,a=-1;function s(c,u){for(let f=0,d=0;f=u&&(h.children.length?s(h,u-d):(!o||o.isHidden&&n>0)&&(p>u||d==p&&h.getSide()>0)?(o=h,a=u-d):(d-1?1:0)!=i.length-(n&&i.indexOf(n)>-1?1:0))return!1;for(let o of r)if(o!=n&&(i.indexOf(o)==-1||t[o]!==e[o]))return!1;return!0}function p3(t,e,n){let r=!1;if(e)for(let i in e)n&&i in n||(r=!0,i=="style"?t.style.cssText="":t.removeAttribute(i));if(n)for(let i in n)e&&e[i]==n[i]||(r=!0,i=="style"?t.style.cssText=n[i]:t.setAttribute(i,n[i]));return r}function Kst(t){let e=Object.create(null);for(let n=0;n0&&this.children[r-1].length==0;)this.children[--r].destroy();return this.children.length=r,this.markDirty(),this.length=e,n}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){s4(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,n){Jfe(this,e,n)}addLineDeco(e){let n=e.spec.attributes,r=e.spec.class;n&&(this.attrs=h3(n,this.attrs||{})),r&&(this.attrs=h3({class:r},this.attrs||{}))}domAtPos(e){return Zfe(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,n){var r;this.dom?this.flags&4&&(Wfe(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(p3(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,n);let i=this.dom.lastChild;for(;i&&Dn.get(i)instanceof fu;)i=i.lastChild;if(!i||!this.length||i.nodeName!="BR"&&((r=Dn.get(i))===null||r===void 0?void 0:r.isEditable)==!1&&(!ht.ios||!this.children.some(o=>o instanceof Ks))){let o=document.createElement("BR");o.cmIgnore=!0,this.dom.appendChild(o)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,n;for(let r of this.children){if(!(r instanceof Ks)||/[^ -~]/.test(r.text))return null;let i=ov(r.dom);if(i.length!=1)return null;e+=i[0].width,n=i[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:n}:null}coordsAt(e,n){let r=ede(this,e,n);if(!this.children.length&&r&&this.parent){let{heightOracle:i}=this.parent.view.viewState,o=r.bottom-r.top;if(Math.abs(o-i.lineHeight)<2&&i.textHeight=n){if(o instanceof Yr)return o;if(a>n)break}i=a+o.breakAfter}return null}}class Ff extends Dn{constructor(e,n,r){super(),this.widget=e,this.length=n,this.deco=r,this.breakAfter=0,this.prevWidget=null}merge(e,n,r,i,o,a){return r&&(!(r instanceof Ff)||!this.widget.compare(r.widget)||e>0&&o<=0||n0}}class sc{eq(e){return!1}updateDOM(e,n){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,n,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var uo=function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t}(uo||(uo={}));class yt extends ep{constructor(e,n,r,i){super(),this.startSide=e,this.endSide=n,this.widget=r,this.spec=i}get heightRelevant(){return!1}static mark(e){return new lw(e)}static widget(e){let n=Math.max(-1e4,Math.min(1e4,e.side||0)),r=!!e.block;return n+=r&&!e.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new nd(e,n,n,r,e.widget||null,!1)}static replace(e){let n=!!e.block,r,i;if(e.isBlockGap)r=-5e8,i=4e8;else{let{start:o,end:a}=tde(e,n);r=(o?n?-3e8:-1:5e8)-1,i=(a?n?2e8:1:-6e8)+1}return new nd(e,r,i,n,e.widget||null,!0)}static line(e){return new cw(e)}static set(e,n=!1){return sn.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}yt.none=sn.empty;class lw extends yt{constructor(e){let{start:n,end:r}=tde(e);super(n?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var n,r;return this==e||e instanceof lw&&this.tagName==e.tagName&&(this.class||((n=this.attrs)===null||n===void 0?void 0:n.class))==(e.class||((r=e.attrs)===null||r===void 0?void 0:r.class))&&s4(this.attrs,e.attrs,"class")}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}}lw.prototype.point=!1;class cw extends yt{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof cw&&this.spec.class==e.spec.class&&s4(this.spec.attributes,e.spec.attributes)}range(e,n=e){if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,n)}}cw.prototype.mapMode=Pi.TrackBefore;cw.prototype.point=!0;class nd extends yt{constructor(e,n,r,i,o,a){super(n,r,o,e),this.block=i,this.isReplace=a,this.mapMode=i?n<=0?Pi.TrackBefore:Pi.TrackAfter:Pi.TrackDel}get type(){return this.startSide!=this.endSide?uo.WidgetRange:this.startSide<=0?uo.WidgetBefore:uo.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof nd&&Zst(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,n=e){if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,n)}}nd.prototype.point=!0;function tde(t,e=!1){let{inclusiveStart:n,inclusiveEnd:r}=t;return n==null&&(n=t.inclusive),r==null&&(r=t.inclusive),{start:n??e,end:r??e}}function Zst(t,e){return t==e||!!(t&&e&&t.compare(e))}function m3(t,e,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=t?n[i]=Math.max(n[i],e):n.push(t,e)}class Jx{constructor(e,n,r,i){this.doc=e,this.pos=n,this.end=r,this.disallowBlockEffectsFor=i,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=n}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof Ff&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new Yr),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(BS(new av(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof Ff)&&this.getLine()}buildText(e,n,r){for(;e>0;){if(this.textOff==this.text.length){let{value:o,lineBreak:a,done:s}=this.cursor.next(this.skip);if(this.skip=0,s)throw new Error("Ran out of text content when drawing inline views");if(a){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=o,this.textOff=0}let i=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(n.slice(n.length-r)),this.getLine().append(BS(new Ks(this.text.slice(this.textOff,this.textOff+i)),n),r),this.atCursorPos=!0,this.textOff+=i,e-=i,r=0}}span(e,n,r,i){this.buildText(n-e,r,i),this.pos=n,this.openStart<0&&(this.openStart=i)}point(e,n,r,i,o,a){if(this.disallowBlockEffectsFor[a]&&r instanceof nd){if(r.block)throw new RangeError("Block decorations may not be specified via plugins");if(n>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let s=n-e;if(r instanceof nd)if(r.block)r.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new Ff(r.widget||sv.block,s,r));else{let l=bf.create(r.widget||sv.inline,s,s?0:r.startSide),c=this.atCursorPos&&!l.isEditable&&o<=i.length&&(e0),u=!l.isEditable&&(ei.length||r.startSide<=0),f=this.getLine();this.pendingBuffer==2&&!c&&!l.isEditable&&(this.pendingBuffer=0),this.flushBuffer(i),c&&(f.append(BS(new av(1),i),o),o=i.length+Math.max(0,o-i.length)),f.append(BS(l,i),o),this.atCursorPos=u,this.pendingBuffer=u?ei.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=i.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(r);s&&(this.textOff+s<=this.text.length?this.textOff+=s:(this.skip+=s-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=n),this.openStart<0&&(this.openStart=o)}static build(e,n,r,i,o){let a=new Jx(e,n,r,o);return a.openEnd=sn.spans(i,n,r,a),a.openStart<0&&(a.openStart=a.openEnd),a.finish(a.openEnd),a}}function BS(t,e){for(let n of e)t=new fu(n,[t],t.length);return t}class sv extends sc{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}sv.inline=new sv("span");sv.block=new sv("div");var nr=function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t}(nr||(nr={}));const rp=nr.LTR,l4=nr.RTL;function nde(t){let e=[];for(let n=0;n=n){if(s.level==r)return a;(o<0||(i!=0?i<0?s.fromn:e[o].level>s.level))&&(o=a)}}if(o<0)throw new RangeError("Index out of range");return o}}function ide(t,e){if(t.length!=e.length)return!1;for(let n=0;n=0;m-=3)if(al[m+1]==-h){let g=al[m+2],v=g&2?i:g&4?g&1?o:i:0;v&&(In[f]=In[al[m]]=v),s=m;break}}else{if(al.length==189)break;al[s++]=f,al[s++]=d,al[s++]=l}else if((p=In[f])==2||p==1){let m=p==i;l=m?0:1;for(let g=s-3;g>=0;g-=3){let v=al[g+2];if(v&2)break;if(m)al[g+2]|=2;else{if(v&4)break;al[g+2]|=4}}}}}function ilt(t,e,n,r){for(let i=0,o=r;i<=n.length;i++){let a=i?n[i-1].to:t,s=il;)p==g&&(p=n[--m].from,g=m?n[m-1].to:t),In[--p]=h;l=u}else o=c,l++}}}function v3(t,e,n,r,i,o,a){let s=r%2?2:1;if(r%2==i%2)for(let l=e,c=0;ll&&a.push(new _f(l,m.from,h));let g=m.direction==rp!=!(h%2);y3(t,g?r+1:r,i,m.inner,m.from,m.to,a),l=m.to}p=m.to}else{if(p==n||(u?In[p]!=s:In[p]==s))break;p++}d?v3(t,l,p,r+1,i,d,a):le;){let u=!0,f=!1;if(!c||l>o[c-1].to){let m=In[l-1];m!=s&&(u=!1,f=m==16)}let d=!u&&s==1?[]:null,h=u?r:r+1,p=l;e:for(;;)if(c&&p==o[c-1].to){if(f)break e;let m=o[--c];if(!u)for(let g=m.from,v=c;;){if(g==e)break e;if(v&&o[v-1].to==g)g=o[--v].from;else{if(In[g-1]==s)break e;break}}if(d)d.push(m);else{m.toIn.length;)In[In.length]=256;let r=[],i=e==rp?0:1;return y3(t,i,i,n,0,t.length,r),r}function ode(t){return[new _f(0,t,0)]}let ade="";function alt(t,e,n,r,i){var o;let a=r.head-t.from,s=_f.find(e,a,(o=r.bidiLevel)!==null&&o!==void 0?o:-1,r.assoc),l=e[s],c=l.side(i,n);if(a==c){let d=s+=i?1:-1;if(d<0||d>=e.length)return null;l=e[s=d],a=l.side(!i,n),c=l.side(i,n)}let u=ki(t.text,a,l.forward(i,n));(ul.to)&&(u=c),ade=t.text.slice(Math.min(a,u),Math.max(a,u));let f=s==(i?e.length-1:0)?null:e[s+(i?1:-1)];return f&&u==c&&f.level+(i?0:1)t.some(e=>e)}),pde=ft.define({combine:t=>t.some(e=>e)}),mde=ft.define();class Eg{constructor(e,n="nearest",r="nearest",i=5,o=5,a=!1){this.range=e,this.y=n,this.x=r,this.yMargin=i,this.xMargin=o,this.isSnapshot=a}map(e){return e.empty?this:new Eg(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new Eg(je.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const zS=It.define({map:(t,e)=>t.map(e)});function ko(t,e,n){let r=t.facet(ude);r.length?r[0](e):window.onerror?window.onerror(String(e),n,void 0,void 0,e):n?console.error(n+":",e):console.error(e)}const M2=ft.define({combine:t=>t.length?t[0]:!0});let llt=0;const ux=ft.define();class Mr{constructor(e,n,r,i,o){this.id=e,this.create=n,this.domEventHandlers=r,this.domEventObservers=i,this.extension=o(this)}static define(e,n){const{eventHandlers:r,eventObservers:i,provide:o,decorations:a}=n||{};return new Mr(llt++,e,r,i,s=>{let l=[ux.of(s)];return a&&l.push(e_.of(c=>{let u=c.plugin(s);return u?a(u):yt.none})),o&&l.push(o(s)),l})}static fromClass(e,n){return Mr.define(r=>new e(r),n)}}class ER{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(r){if(ko(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(n){ko(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){ko(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const gde=ft.define(),c4=ft.define(),e_=ft.define(),vde=ft.define(),u4=ft.define(),yde=ft.define();function o7(t,e){let n=t.state.facet(yde);if(!n.length)return n;let r=n.map(o=>o instanceof Function?o(t):o),i=[];return sn.spans(r,e.from,e.to,{point(){},span(o,a,s,l){let c=o-e.from,u=a-e.from,f=i;for(let d=s.length-1;d>=0;d--,l--){let h=s[d].spec.bidiIsolate,p;if(h==null&&(h=slt(e.text,c,u)),l>0&&f.length&&(p=f[f.length-1]).to==c&&p.direction==h)p.to=u,f=p.inner;else{let m={from:c,to:u,direction:h,inner:[]};f.push(m),f=m.inner}}}}),i}const xde=ft.define();function bde(t){let e=0,n=0,r=0,i=0;for(let o of t.state.facet(xde)){let a=o(t);a&&(a.left!=null&&(e=Math.max(e,a.left)),a.right!=null&&(n=Math.max(n,a.right)),a.top!=null&&(r=Math.max(r,a.top)),a.bottom!=null&&(i=Math.max(i,a.bottom)))}return{left:e,right:n,top:r,bottom:i}}const fx=ft.define();class ns{constructor(e,n,r,i){this.fromA=e,this.toA=n,this.fromB=r,this.toB=i}join(e){return new ns(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let n=e.length,r=this;for(;n>0;n--){let i=e[n-1];if(!(i.fromA>r.toA)){if(i.toAu)break;o+=2}if(!l)return r;new ns(l.fromA,l.toA,l.fromB,l.toB).addToSet(r),a=l.toA,s=l.toB}}}class uE{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=Kr.empty(this.startState.doc.length);for(let o of r)this.changes=this.changes.compose(o.changes);let i=[];this.changes.iterChangedRanges((o,a,s,l)=>i.push(new ns(o,a,s,l))),this.changedRanges=i}static create(e,n,r){return new uE(e,n,r)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class a7 extends Dn{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new Yr],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new ns(0,0,0,e.state.doc.length)],0,null)}update(e){var n;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:c,toA:u})=>uthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0);let i=-1;this.view.inputState.composing>=0&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?i=this.domChanged.newSel.head:!mlt(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let o=i>-1?ult(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:u}=this.hasComposition;r=new ns(c,u,e.changes.mapPos(c,-1),e.changes.mapPos(u,1)).addToSet(r.slice())}this.hasComposition=o?{from:o.range.fromB,to:o.range.toB}:null,(ht.ie||ht.chrome)&&!o&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let a=this.decorations,s=this.updateDeco(),l=hlt(a,s,e.changes);return r=ns.extendWithRanges(r,l),!(this.flags&7)&&r.length==0?!1:(this.updateInner(r,e.startState.doc.length,o),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n,r){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,n,r);let{observer:i}=this.view;i.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let a=ht.chrome||ht.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,a),this.flags&=-8,a&&(a.written||i.selectionRange.focusNode!=a.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(a=>a.flags&=-9);let o=[];if(this.view.viewport.from||this.view.viewport.to=0?i[a]:null;if(!s)break;let{fromA:l,toA:c,fromB:u,toB:f}=s,d,h,p,m;if(r&&r.range.fromBu){let b=Jx.build(this.view.state.doc,u,r.range.fromB,this.decorations,this.dynamicDecorationMap),_=Jx.build(this.view.state.doc,r.range.toB,f,this.decorations,this.dynamicDecorationMap);h=b.breakAtStart,p=b.openStart,m=_.openEnd;let S=this.compositionView(r);_.breakAtStart?S.breakAfter=1:_.content.length&&S.merge(S.length,S.length,_.content[0],!1,_.openStart,0)&&(S.breakAfter=_.content[0].breakAfter,_.content.shift()),b.content.length&&S.merge(0,0,b.content[b.content.length-1],!0,0,b.openEnd)&&b.content.pop(),d=b.content.concat(S).concat(_.content)}else({content:d,breakAtStart:h,openStart:p,openEnd:m}=Jx.build(this.view.state.doc,u,f,this.decorations,this.dynamicDecorationMap));let{i:g,off:v}=o.findPos(c,1),{i:y,off:x}=o.findPos(l,-1);Xfe(this,y,x,g,v,d,h,p,m)}r&&this.fixCompositionDOM(r)}compositionView(e){let n=new Ks(e.text.nodeValue);n.flags|=8;for(let{deco:i}of e.marks)n=new fu(i,[n],n.length);let r=new Yr;return r.append(n,0),r}fixCompositionDOM(e){let n=(o,a)=>{a.flags|=8|(a.children.some(l=>l.flags&7)?1:0),this.markedForComposition.add(a);let s=Dn.get(o);s&&s!=a&&(s.dom=null),a.setDOM(o)},r=this.childPos(e.range.fromB,1),i=this.children[r.i];n(e.line,i);for(let o=e.marks.length-1;o>=-1;o--)r=i.childPos(r.off,1),i=i.children[r.i],n(o>=0?e.marks[o].node:e.text,i)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let r=this.view.root.activeElement,i=r==this.dom,o=!i&&RC(this.dom,this.view.observer.selectionRange)&&!(r&&this.dom.contains(r));if(!(i||n||o))return;let a=this.forceSelection;this.forceSelection=!1;let s=this.view.state.selection.main,l=this.moveToLine(this.domAtPos(s.anchor)),c=s.empty?l:this.moveToLine(this.domAtPos(s.head));if(ht.gecko&&s.empty&&!this.hasComposition&&clt(l)){let f=document.createTextNode("");this.view.observer.ignore(()=>l.node.insertBefore(f,l.node.childNodes[l.offset]||null)),l=c=new Yi(f,0),a=!0}let u=this.view.observer.selectionRange;(a||!u.focusNode||(!Zx(l.node,l.offset,u.anchorNode,u.anchorOffset)||!Zx(c.node,c.offset,u.focusNode,u.focusOffset))&&!this.suppressWidgetCursorChange(u,s))&&(this.view.observer.ignore(()=>{ht.android&&ht.chrome&&this.dom.contains(u.focusNode)&&plt(u.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=lE(this.view.root);if(f)if(s.empty){if(ht.gecko){let d=flt(l.node,l.offset);if(d&&d!=3){let h=(d==1?Gfe:Hfe)(l.node,l.offset);h&&(l=new Yi(h.node,h.offset))}}f.collapse(l.node,l.offset),s.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=s.bidiLevel)}else if(f.extend){f.collapse(l.node,l.offset);try{f.extend(c.node,c.offset)}catch{}}else{let d=document.createRange();s.anchor>s.head&&([l,c]=[c,l]),d.setEnd(c.node,c.offset),d.setStart(l.node,l.offset),f.removeAllRanges(),f.addRange(d)}o&&this.view.root.activeElement==this.dom&&(this.dom.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(l,c)),this.impreciseAnchor=l.precise?null:new Yi(u.anchorNode,u.anchorOffset),this.impreciseHead=c.precise?null:new Yi(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&Zx(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,r=lE(e.root),{anchorNode:i,anchorOffset:o}=e.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let a=Yr.find(this,n.head);if(!a)return;let s=a.posAtStart;if(n.head==s||n.head==s+a.length)return;let l=this.coordsAt(n.head,-1),c=this.coordsAt(n.head,1);if(!l||!c||l.bottom>c.top)return;let u=this.domAtPos(n.head+n.assoc);r.collapse(u.node,u.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=n.from&&r.collapse(i,o)}moveToLine(e){let n=this.dom,r;if(e.node!=n)return e;for(let i=e.offset;!r&&i=0;i--){let o=Dn.get(n.childNodes[i]);o instanceof Yr&&(r=o.domAtPos(o.length))}return r?new Yi(r.node,r.offset,!0):e}nearest(e){for(let n=e;n;){let r=Dn.get(n);if(r&&r.rootView==this)return r;n=n.parentNode}return null}posFromDOM(e,n){let r=this.nearest(e);if(!r)throw new RangeError("Trying to find position for a DOM position outside of the document");return r.localPosFromDOM(e,n)+r.posAtStart}domAtPos(e){let{i:n,off:r}=this.childCursor().findPos(e,-1);for(;n=0;a--){let s=this.children[a],l=o-s.breakAfter,c=l-s.length;if(le||s.covers(1))&&(!r||s instanceof Yr&&!(r instanceof Yr&&n>=0))&&(r=s,i=c),o=c}return r?r.coordsAt(e-i,n):null}coordsForChar(e){let{i:n,off:r}=this.childPos(e,1),i=this.children[n];if(!(i instanceof Yr))return null;for(;i.children.length;){let{i:s,off:l}=i.childPos(r,1);for(;;s++){if(s==i.children.length)return null;if((i=i.children[s]).length)break}r=l}if(!(i instanceof Ks))return null;let o=ki(i.text,r);if(o==r)return null;let a=np(i.dom,r,o).getClientRects();for(let s=0;sMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,s=-1,l=this.view.textDirection==nr.LTR;for(let c=0,u=0;ui)break;if(c>=r){let h=f.dom.getBoundingClientRect();if(n.push(h.height),a){let p=f.dom.lastChild,m=p?ov(p):[];if(m.length){let g=m[m.length-1],v=l?g.right-h.left:h.right-g.left;v>s&&(s=v,this.minWidth=o,this.minWidthFrom=c,this.minWidthTo=d)}}}c=d+f.breakAfter}return n}textDirectionAt(e){let{i:n}=this.childPos(e,1);return getComputedStyle(this.children[n].dom).direction=="rtl"?nr.RTL:nr.LTR}measureTextSize(){for(let o of this.children)if(o instanceof Yr){let a=o.measureTextSize();if(a)return a}let e=document.createElement("div"),n,r,i;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let o=ov(e.firstChild)[0];n=e.getBoundingClientRect().height,r=o?o.width/27:7,i=o?o.height:n,e.remove()}),{lineHeight:n,charWidth:r,textHeight:i}}childCursor(e=this.length){let n=this.children.length;return n&&(e-=this.children[--n].length),new qfe(this.children,e,n)}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let r=0,i=0;;i++){let o=i==n.viewports.length?null:n.viewports[i],a=o?o.from-1:this.length;if(a>r){let s=(n.lineBlockAt(a).bottom-n.lineBlockAt(r).top)/this.view.scaleY;e.push(yt.replace({widget:new s7(s),block:!0,inclusive:!0,isBlockGap:!0}).range(r,a))}if(!o)break;r=o.to+1}return yt.set(e)}updateDeco(){let e=0,n=this.view.state.facet(e_).map(o=>(this.dynamicDecorationMap[e++]=typeof o=="function")?o(this.view):o),r=!1,i=this.view.state.facet(vde).map((o,a)=>{let s=typeof o=="function";return s&&(r=!0),s?o(this.view):o});for(i.length&&(this.dynamicDecorationMap[e++]=r,n.push(sn.join(i))),this.decorations=[...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];en.anchor?-1:1),i;if(!r)return;!n.empty&&(i=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(r={left:Math.min(r.left,i.left),top:Math.min(r.top,i.top),right:Math.max(r.right,i.right),bottom:Math.max(r.bottom,i.bottom)});let o=bde(this.view),a={left:r.left-o.left,top:r.top-o.top,right:r.right+o.right,bottom:r.bottom+o.bottom},{offsetWidth:s,offsetHeight:l}=this.view.scrollDOM;Wst(this.view.scrollDOM,a,n.head{re.from&&(n=!0)}),n}function glt(t,e,n=1){let r=t.charCategorizer(e),i=t.doc.lineAt(e),o=e-i.from;if(i.length==0)return je.cursor(e);o==0?n=1:o==i.length&&(n=-1);let a=o,s=o;n<0?a=ki(i.text,o,!1):s=ki(i.text,o);let l=r(i.text.slice(a,s));for(;a>0;){let c=ki(i.text,a,!1);if(r(i.text.slice(c,a))!=l)break;a=c}for(;st?e.left-t:Math.max(0,t-e.right)}function ylt(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom)}function PR(t,e){return t.tope.top+1}function l7(t,e){return et.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function b3(t,e,n){let r,i,o,a,s=!1,l,c,u,f;for(let p=t.firstChild;p;p=p.nextSibling){let m=ov(p);for(let g=0;gx||a==x&&o>y){r=p,i=v,o=y,a=x;let b=x?n0?g0)}y==0?n>v.bottom&&(!u||u.bottomv.top)&&(c=p,f=v):u&&PR(u,v)?u=c7(u,v.bottom):f&&PR(f,v)&&(f=l7(f,v.top))}}if(u&&u.bottom>=n?(r=l,i=u):f&&f.top<=n&&(r=c,i=f),!r)return{node:t,offset:0};let d=Math.max(i.left,Math.min(i.right,e));if(r.nodeType==3)return u7(r,d,n);if(s&&r.contentEditable!="false")return b3(r,d,n);let h=Array.prototype.indexOf.call(t.childNodes,r)+(e>=(i.left+i.right)/2?1:0);return{node:t,offset:h}}function u7(t,e,n){let r=t.nodeValue.length,i=-1,o=1e9,a=0;for(let s=0;sn?u.top-n:n-u.bottom)-1;if(u.left-1<=e&&u.right+1>=e&&f=(u.left+u.right)/2,h=d;if((ht.chrome||ht.gecko)&&np(t,s).getBoundingClientRect().left==u.right&&(h=!d),f<=0)return{node:t,offset:s+(h?1:0)};i=s+(h?1:0),o=f}}}return{node:t,offset:i>-1?i:a>0?t.nodeValue.length:0}}function wde(t,e,n,r=-1){var i,o;let a=t.contentDOM.getBoundingClientRect(),s=a.top+t.viewState.paddingTop,l,{docHeight:c}=t.viewState,{x:u,y:f}=e,d=f-s;if(d<0)return 0;if(d>c)return t.state.doc.length;for(let b=t.viewState.heightOracle.textHeight/2,_=!1;l=t.elementAtHeight(d),l.type!=uo.Text;)for(;d=r>0?l.bottom+b:l.top-b,!(d>=0&&d<=c);){if(_)return n?null:0;_=!0,r=-r}f=s+d;let h=l.from;if(ht.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:n?null:f7(t,a,l,u,f);let p=t.dom.ownerDocument,m=t.root.elementFromPoint?t.root:p,g=m.elementFromPoint(u,f);g&&!t.contentDOM.contains(g)&&(g=null),g||(u=Math.max(a.left+1,Math.min(a.right-1,u)),g=m.elementFromPoint(u,f),g&&!t.contentDOM.contains(g)&&(g=null));let v,y=-1;if(g&&((i=t.docView.nearest(g))===null||i===void 0?void 0:i.isEditable)!=!1){if(p.caretPositionFromPoint){let b=p.caretPositionFromPoint(u,f);b&&({offsetNode:v,offset:y}=b)}else if(p.caretRangeFromPoint){let b=p.caretRangeFromPoint(u,f);b&&({startContainer:v,startOffset:y}=b,(!t.contentDOM.contains(v)||ht.safari&&xlt(v,y,u)||ht.chrome&&blt(v,y,u))&&(v=void 0))}}if(!v||!t.docView.dom.contains(v)){let b=Yr.find(t.docView,h);if(!b)return d>l.top+l.height/2?l.to:l.from;({node:v,offset:y}=b3(b.dom,u,f))}let x=t.docView.nearest(v);if(!x)return null;if(x.isWidget&&((o=x.dom)===null||o===void 0?void 0:o.nodeType)==1){let b=x.dom.getBoundingClientRect();return e.yt.defaultLineHeight*1.5){let s=t.viewState.heightOracle.textHeight,l=Math.floor((i-n.top-(t.defaultLineHeight-s)*.5)/s);o+=l*t.viewState.heightOracle.lineLength}let a=t.state.sliceDoc(n.from,n.to);return n.from+a3(a,o,t.state.tabSize)}function xlt(t,e,n){let r;if(t.nodeType!=3||e!=(r=t.nodeValue.length))return!1;for(let i=t.nextSibling;i;i=i.nextSibling)if(i.nodeType!=1||i.nodeName!="BR")return!1;return np(t,r-1,r).getBoundingClientRect().left>n}function blt(t,e,n){if(e!=0)return!1;for(let i=t;;){let o=i.parentNode;if(!o||o.nodeType!=1||o.firstChild!=i)return!1;if(o.classList.contains("cm-line"))break;i=o}let r=t.nodeType==1?t.getBoundingClientRect():np(t,0,Math.max(t.nodeValue.length,1)).getBoundingClientRect();return n-r.left>5}function _3(t,e){let n=t.lineBlockAt(e);if(Array.isArray(n.type)){for(let r of n.type)if(r.to>e||r.to==e&&(r.to==n.to||r.type==uo.Text))return r}return n}function _lt(t,e,n,r){let i=_3(t,e.head),o=!r||i.type!=uo.Text||!(t.lineWrapping||i.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(o){let a=t.dom.getBoundingClientRect(),s=t.textDirectionAt(i.from),l=t.posAtCoords({x:n==(s==nr.LTR)?a.right-1:a.left+1,y:(o.top+o.bottom)/2});if(l!=null)return je.cursor(l,n?-1:1)}return je.cursor(n?i.to:i.from,n?-1:1)}function d7(t,e,n,r){let i=t.state.doc.lineAt(e.head),o=t.bidiSpans(i),a=t.textDirectionAt(i.from);for(let s=e,l=null;;){let c=alt(i,o,a,s,n),u=ade;if(!c){if(i.number==(n?t.state.doc.lines:1))return s;u=` -`,i=t.state.doc.line(i.number+(n?1:-1)),o=t.bidiSpans(i),c=t.visualLineSide(i,!n)}if(l){if(!l(u))return s}else{if(!r)return c;l=r(u)}s=c}}function wlt(t,e,n){let r=t.state.charCategorizer(e),i=r(n);return o=>{let a=r(o);return i==ur.Space&&(i=a),i==a}}function Slt(t,e,n,r){let i=e.head,o=n?1:-1;if(i==(n?t.state.doc.length:0))return je.cursor(i,e.assoc);let a=e.goalColumn,s,l=t.contentDOM.getBoundingClientRect(),c=t.coordsAtPos(i,e.assoc||-1),u=t.documentTop;if(c)a==null&&(a=c.left-l.left),s=o<0?c.top:c.bottom;else{let h=t.viewState.lineBlockAt(i);a==null&&(a=Math.min(l.right-l.left,t.defaultCharacterWidth*(i-h.from))),s=(o<0?h.top:h.bottom)+u}let f=l.left+a,d=r??t.viewState.heightOracle.textHeight>>1;for(let h=0;;h+=10){let p=s+(d+h)*o,m=wde(t,{x:f,y:p},!1,o);if(pl.bottom||(o<0?mi)){let g=t.docView.coordsForChar(m),v=!g||p{if(e>o&&ei(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:je.cursor(r,rnull),ht.gecko&&Blt(e.contentDOM.ownerDocument)}handleEvent(e){!Rlt(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||this.runHandlers(e.type,e)}runHandlers(e,n){let r=this.handlers[e];if(r){for(let i of r.observers)i(this.view,n);for(let i of r.handlers){if(n.defaultPrevented)break;if(i(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=Clt(e),r=this.handlers,i=this.view.contentDOM;for(let o in n)if(o!="scroll"){let a=!n[o].handlers.length,s=r[o];s&&a!=!s.handlers.length&&(i.removeEventListener(o,this.handleEvent),s=null),s||i.addEventListener(o,this.handleEvent,{passive:a})}for(let o in r)o!="scroll"&&!n[o]&&i.removeEventListener(o,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&Date.now()r.keyCode==e.keyCode))&&!e.ctrlKey||Tlt.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=n||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from0?!0:ht.safari&&!ht.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function h7(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(i){ko(n.state,i)}}}function Clt(t){let e=Object.create(null);function n(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of t){let i=r.spec;if(i&&i.domEventHandlers)for(let o in i.domEventHandlers){let a=i.domEventHandlers[o];a&&n(o).handlers.push(h7(r.value,a))}if(i&&i.domEventObservers)for(let o in i.domEventObservers){let a=i.domEventObservers[o];a&&n(o).observers.push(h7(r.value,a))}}for(let r in Zs)n(r).handlers.push(Zs[r]);for(let r in ps)n(r).observers.push(ps[r]);return e}const Sde=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Tlt="dthko",Ode=[16,17,18,20,91,92,224,225],US=6;function WS(t){return Math.max(0,t)*.7+8}function Elt(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class Plt{constructor(e,n,r,i){this.view=e,this.startEvent=n,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParent=Vst(e.contentDOM),this.atoms=e.state.facet(u4).map(a=>a(e));let o=e.contentDOM.ownerDocument;o.addEventListener("mousemove",this.move=this.move.bind(this)),o.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(en.allowMultipleSelections)&&Mlt(e,n),this.dragging=Alt(e,n)&&Pde(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){var n;if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Elt(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let r=0,i=0,o=((n=this.scrollParent)===null||n===void 0?void 0:n.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},a=bde(this.view);e.clientX-a.left<=o.left+US?r=-WS(o.left-e.clientX):e.clientX+a.right>=o.right-US&&(r=WS(e.clientX-o.right)),e.clientY-a.top<=o.top+US?i=-WS(o.top-e.clientY):e.clientY+a.bottom>=o.bottom-US&&(i=WS(e.clientY-o.bottom)),this.setScrollSpeed(r,i)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let n=null;for(let r=0;rthis.select(this.lastEvent),20)}}function Mlt(t,e){let n=t.state.facet(sde);return n.length?n[0](e):ht.mac?e.metaKey:e.ctrlKey}function klt(t,e){let n=t.state.facet(lde);return n.length?n[0](e):ht.mac?!e.altKey:!e.ctrlKey}function Alt(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=lE(t.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let o=0;o=e.clientX&&a.top<=e.clientY&&a.bottom>=e.clientY)return!0}return!1}function Rlt(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,r;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=Dn.get(n))&&r.ignoreEvent(e))return!1;return!0}const Zs=Object.create(null),ps=Object.create(null),Cde=ht.ie&&ht.ie_version<15||ht.ios&&ht.webkit_version<604;function Ilt(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),Tde(t,n.value)},50)}function Tde(t,e){let{state:n}=t,r,i=1,o=n.toText(e),a=o.lines==n.selection.ranges.length;if(w3!=null&&n.selection.ranges.every(l=>l.empty)&&w3==o.toString()){let l=-1;r=n.changeByRange(c=>{let u=n.doc.lineAt(c.from);if(u.from==l)return{range:c};l=u.from;let f=n.toText((a?o.line(i++).text:e)+n.lineBreak);return{changes:{from:u.from,insert:f},range:je.cursor(c.from+f.length)}})}else a?r=n.changeByRange(l=>{let c=o.line(i++);return{changes:{from:l.from,to:l.to,insert:c.text},range:je.cursor(l.from+c.length)}}):r=n.replaceSelection(o);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}ps.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};Zs.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&(t.inputState.lastEscPress=Date.now()),!1);ps.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")};ps.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};Zs.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of t.state.facet(cde))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=$lt(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new Plt(t,e,n,r)),r&&t.observer.ignore(()=>Ufe(t.contentDOM));let i=t.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}return!1};function p7(t,e,n,r){if(r==1)return je.cursor(e,n);if(r==2)return glt(t.state,e,n);{let i=Yr.find(t.docView,e),o=t.state.doc.lineAt(i?i.posAtEnd:e),a=i?i.posAtStart:o.from,s=i?i.posAtEnd:o.to;return st>=e.top&&t<=e.bottom,m7=(t,e,n)=>Ede(e,n)&&t>=n.left&&t<=n.right;function Dlt(t,e,n,r){let i=Yr.find(t.docView,e);if(!i)return 1;let o=e-i.posAtStart;if(o==0)return 1;if(o==i.length)return-1;let a=i.coordsAt(o,-1);if(a&&m7(n,r,a))return-1;let s=i.coordsAt(o,1);return s&&m7(n,r,s)?1:a&&Ede(r,a)?-1:1}function g7(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:n,bias:Dlt(t,n,e.clientX,e.clientY)}}const Llt=ht.ie&&ht.ie_version<=11;let v7=null,y7=0,x7=0;function Pde(t){if(!Llt)return t.detail;let e=v7,n=x7;return v7=t,x7=Date.now(),y7=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(y7+1)%3:1}function $lt(t,e){let n=g7(t,e),r=Pde(e),i=t.state.selection;return{update(o){o.docChanged&&(n.pos=o.changes.mapPos(n.pos),i=i.map(o.changes))},get(o,a,s){let l=g7(t,o),c,u=p7(t,l.pos,l.bias,r);if(n.pos!=l.pos&&!a){let f=p7(t,n.pos,n.bias,r),d=Math.min(f.from,u.from),h=Math.max(f.to,u.to);u=d1&&(c=Nlt(i,l.pos))?c:s?i.addRange(u):je.create([u])}}}function Nlt(t,e){for(let n=0;n=e)return je.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}Zs.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let i=t.docView.nearest(e.target);if(i&&i.isWidget){let o=i.posAtStart,a=o+i.length;(o>=n.to||a<=n.from)&&(n=je.range(o,a))}}let{inputState:r}=t;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",t.state.sliceDoc(n.from,n.to)),e.dataTransfer.effectAllowed="copyMove"),!1};Zs.dragend=t=>(t.inputState.draggedContent=null,!1);function b7(t,e,n,r){if(!n)return;let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:o}=t.inputState,a=r&&o&&klt(t,e)?{from:o.from,to:o.to}:null,s={from:i,insert:n},l=t.state.changes(a?[a,s]:s);t.focus(),t.dispatch({changes:l,selection:{anchor:l.mapPos(i,-1),head:l.mapPos(i,1)},userEvent:a?"move.drop":"input.drop"}),t.inputState.draggedContent=null}Zs.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,o=()=>{++i==n.length&&b7(t,e,r.filter(a=>a!=null).join(t.state.lineBreak),!1)};for(let a=0;a{/[\x00-\x08\x0e-\x1f]{2}/.test(s.result)||(r[a]=s.result),o()},s.readAsText(n[a])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return b7(t,e,r,!0),!0}return!1};Zs.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=Cde?null:e.clipboardData;return n?(Tde(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(Ilt(t),!1)};function Flt(t,e){let n=t.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),t.focus()},50)}function jlt(t){let e=[],n=[],r=!1;for(let i of t.selection.ranges)i.empty||(e.push(t.sliceDoc(i.from,i.to)),n.push(i));if(!e.length){let i=-1;for(let{from:o}of t.selection.ranges){let a=t.doc.lineAt(o);a.number>i&&(e.push(a.text),n.push({from:a.from,to:Math.min(t.doc.length,a.to+1)})),i=a.number}r=!0}return{text:e.join(t.lineBreak),ranges:n,linewise:r}}let w3=null;Zs.copy=Zs.cut=(t,e)=>{let{text:n,ranges:r,linewise:i}=jlt(t.state);if(!n&&!i)return!1;w3=i?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let o=Cde?null:e.clipboardData;return o?(o.clearData(),o.setData("text/plain",n),!0):(Flt(t,n),!1)};const Mde=oc.define();function kde(t,e){let n=[];for(let r of t.facet(dde)){let i=r(t,e);i&&n.push(i)}return n?t.update({effects:n,annotations:Mde.of(!0)}):null}function Ade(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=kde(t.state,e);n?t.dispatch(n):t.update([])}},10)}ps.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),Ade(t)};ps.blur=t=>{t.observer.clearSelectionRange(),Ade(t)};ps.compositionstart=ps.compositionupdate=t=>{t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0)};ps.compositionend=t=>{t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,ht.chrome&&ht.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50)};ps.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};Zs.beforeinput=(t,e)=>{var n;let r;if(ht.chrome&&ht.android&&(r=Sde.find(i=>i.inputType==e.inputType))&&(t.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let i=((n=window.visualViewport)===null||n===void 0?void 0:n.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>i+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return ht.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),ht.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>ps.compositionend(t,e),20),!1};const _7=new Set;function Blt(t){_7.has(t)||(_7.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const w7=["pre-wrap","normal","pre-line","break-spaces"];class zlt{constructor(e){this.lineWrapping=e,this.doc=Sn.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}heightForGap(e,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return w7.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let r=0;r-1,l=Math.round(n)!=Math.round(this.lineHeight)||this.lineWrapping!=s;if(this.lineWrapping=s,this.lineHeight=n,this.charWidth=r,this.textHeight=i,this.lineLength=o,l){this.heightSamples={};for(let c=0;c0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e,n){this.height!=n&&(Math.abs(this.height-n)>DC&&(e.heightChanged=!0),this.height=n)}replace(e,n,r){return fo.of(r)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,r,i){let o=this,a=r.doc;for(let s=i.length-1;s>=0;s--){let{fromA:l,toA:c,fromB:u,toB:f}=i[s],d=o.lineAt(l,Xn.ByPosNoHeight,r.setDoc(n),0,0),h=d.to>=c?d:o.lineAt(c,Xn.ByPosNoHeight,r,0,0);for(f+=h.to-c,c=h.to;s>0&&d.from<=i[s-1].toA;)l=i[s-1].fromA,u=i[s-1].fromB,s--,lo*2){let s=e[n-1];s.break?e.splice(--n,1,s.left,null,s.right):e.splice(--n,1,s.left,s.right),r+=1+s.break,i-=s.size}else if(o>i*2){let s=e[r];s.break?e.splice(r,1,s.left,null,s.right):e.splice(r,1,s.left,s.right),r+=2+s.break,o-=s.size}else break;else if(i=o&&a(this.blockAt(0,r,i,o))}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more&&this.setHeight(e,i.heights[i.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class sa extends Rde{constructor(e,n){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,n,r,i){return new Cl(i,this.length,r,this.height,this.breaks)}replace(e,n,r){let i=r[0];return r.length==1&&(i instanceof sa||i instanceof _i&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof _i?i=new sa(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):fo.of(r)}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more?this.setHeight(e,i.heights[i.index++]):(r||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class _i extends fo{constructor(e){super(e,0)}heightMetrics(e,n){let r=e.doc.lineAt(n).number,i=e.doc.lineAt(n+this.length).number,o=i-r+1,a,s=0;if(e.lineWrapping){let l=Math.min(this.height,e.lineHeight*o);a=l/o,this.length>o+1&&(s=(this.height-l)/(this.length-o-1))}else a=this.height/o;return{firstLine:r,lastLine:i,perLine:a,perChar:s}}blockAt(e,n,r,i){let{firstLine:o,lastLine:a,perLine:s,perChar:l}=this.heightMetrics(n,i);if(n.lineWrapping){let c=i+(e0){let o=r[r.length-1];o instanceof _i?r[r.length-1]=new _i(o.length+i):r.push(null,new _i(i-1))}if(e>0){let o=r[0];o instanceof _i?r[0]=new _i(e+o.length):r.unshift(new _i(e-1),null)}return fo.of(r)}decomposeLeft(e,n){n.push(new _i(e-1),null)}decomposeRight(e,n){n.push(null,new _i(this.length-e-1))}updateHeight(e,n=0,r=!1,i){let o=n+this.length;if(i&&i.from<=n+this.length&&i.more){let a=[],s=Math.max(n,i.from),l=-1;for(i.from>n&&a.push(new _i(i.from-n-1).updateHeight(e,n));s<=o&&i.more;){let u=e.doc.lineAt(s).length;a.length&&a.push(null);let f=i.heights[i.index++];l==-1?l=f:Math.abs(f-l)>=DC&&(l=-2);let d=new sa(u,f);d.outdated=!1,a.push(d),s+=u+1}s<=o&&a.push(null,new _i(o-s).updateHeight(e,s));let c=fo.of(a);return(l<0||Math.abs(c.height-this.height)>=DC||Math.abs(l-this.heightMetrics(e,n).perLine)>=DC)&&(e.heightChanged=!0),c}else(r||this.outdated)&&(this.setHeight(e,e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class Wlt extends fo{constructor(e,n,r){super(e.length+n+r.length,e.height+r.height,n|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,n,r,i){let o=r+this.left.height;return es))return c;let u=n==Xn.ByPosNoHeight?Xn.ByPosNoHeight:Xn.ByPos;return l?c.join(this.right.lineAt(s,u,r,a,s)):this.left.lineAt(s,u,r,i,o).join(c)}forEachLine(e,n,r,i,o,a){let s=i+this.left.height,l=o+this.left.length+this.break;if(this.break)e=l&&this.right.forEachLine(e,n,r,s,l,a);else{let c=this.lineAt(l,Xn.ByPos,r,i,o);e=e&&c.from<=n&&a(c),n>c.to&&this.right.forEachLine(c.to+1,n,r,s,l,a)}}replace(e,n,r){let i=this.left.length+this.break;if(nthis.left.length)return this.balanced(this.left,this.right.replace(e-i,n-i,r));let o=[];e>0&&this.decomposeLeft(e,o);let a=o.length;for(let s of r)o.push(s);if(e>0&&S7(o,a-1),n=r&&n.push(null)),e>r&&this.right.decomposeLeft(e-r,n)}decomposeRight(e,n){let r=this.left.length,i=r+this.break;if(e>=i)return this.right.decomposeRight(e-i,n);e2*n.size||n.size>2*e.size?fo.of(this.break?[e,null,n]:[e,n]):(this.left=e,this.right=n,this.height=e.height+n.height,this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,r=!1,i){let{left:o,right:a}=this,s=n+o.length+this.break,l=null;return i&&i.from<=n+o.length&&i.more?l=o=o.updateHeight(e,n,r,i):o.updateHeight(e,n,r),i&&i.from<=s+a.length&&i.more?l=a=a.updateHeight(e,s,r,i):a.updateHeight(e,s,r),l?this.balanced(o,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function S7(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof _i&&(r=t[e+1])instanceof _i&&t.splice(e-1,3,new _i(n.length+1+r.length))}const Vlt=5;class f4{constructor(e,n){this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof sa?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new sa(r-this.pos,-1)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,r){if(e=Vlt)&&this.addLineDeco(i,o,a)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenToe&&this.nodes.push(new sa(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,n){let r=new _i(n-e);return this.oracle.doc.lineAt(e).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof sa)return e;let n=new sa(0,-1);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof sa)&&!this.isCovered?this.nodes.push(new sa(0,-1)):(this.writtenTou.clientHeight||u.scrollWidth>u.clientWidth)&&f.overflow!="visible"){let d=u.getBoundingClientRect();o=Math.max(o,d.left),a=Math.min(a,d.right),s=Math.max(s,d.top),l=c==t.parentNode?d.bottom:Math.min(l,d.bottom)}c=f.position=="absolute"||f.position=="fixed"?u.offsetParent:u.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:o-n.left,right:Math.max(o,a)-n.left,top:s-(n.top+e),bottom:Math.max(s,l)-(n.top+e)}}function Xlt(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class kR{constructor(e,n,r){this.from=e,this.to=n,this.size=r}static same(e,n){if(e.length!=n.length)return!1;for(let r=0;rtypeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new zlt(n),this.stateDeco=e.facet(e_).filter(r=>typeof r!="function"),this.heightMap=fo.empty().applyChanges(this.stateDeco,Sn.empty,this.heightOracle.setDoc(e.doc),[new ns(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=yt.set(this.lineGaps.map(r=>r.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let i=r?n.head:n.anchor;if(!e.some(({from:o,to:a})=>i>=o&&i<=a)){let{from:o,to:a}=this.lineBlockAt(i);e.push(new VS(o,a))}}this.viewports=e.sort((r,i)=>r.from-i.from),this.scaler=this.heightMap.height<=7e6?C7:new Zlt(this.heightOracle,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(this.scaler.scale==1?e:dx(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=this.state.facet(e_).filter(u=>typeof u!="function");let i=e.changedRanges,o=ns.extendWithRanges(i,Glt(r,this.stateDeco,e?e.changes:Kr.empty(this.state.doc.length))),a=this.heightMap.height,s=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),o),this.heightMap.height!=a&&(e.flags|=2),s?(this.scrollAnchorPos=e.changes.mapPos(s.from,-1),this.scrollAnchorHeight=s.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let l=o.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.headl.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,n));let c=!e.changes.empty||e.flags&2||l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,this.updateForViewport(),c&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(pde)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let n=e.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,o=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?nr.RTL:nr.LTR;let a=this.heightOracle.mustRefreshForWrapping(o),s=n.getBoundingClientRect(),l=a||this.mustMeasureContent||this.contentDOMHeight!=s.height;this.contentDOMHeight=s.height,this.mustMeasureContent=!1;let c=0,u=0;if(s.width&&s.height){let{scaleX:b,scaleY:_}=zfe(n,s);(b>.005&&Math.abs(this.scaleX-b)>.005||_>.005&&Math.abs(this.scaleY-_)>.005)&&(this.scaleX=b,this.scaleY=_,c|=8,a=l=!0)}let f=(parseInt(r.paddingTop)||0)*this.scaleY,d=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=d)&&(this.paddingTop=f,this.paddingBottom=d,c|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(l=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=8);let h=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=h&&(this.scrollAnchorHeight=-1,this.scrollTop=h),this.scrolledToBottom=Vfe(e.scrollDOM);let p=(this.printing?Xlt:qlt)(n,this.paddingTop),m=p.top-this.pixelViewport.top,g=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let v=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(v!=this.inView&&(this.inView=v,v&&(l=!0)),!this.inView&&!this.scrollTarget)return 0;let y=s.width;if((this.contentDOMWidth!=y||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=s.width,this.editorHeight=e.scrollDOM.clientHeight,c|=8),l){let b=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(b)&&(a=!0),a||i.lineWrapping&&Math.abs(y-this.contentDOMWidth)>i.charWidth){let{lineHeight:_,charWidth:S,textHeight:O}=e.docView.measureTextSize();a=_>0&&i.refresh(o,_,S,O,y/S,b),a&&(e.docView.minWidth=0,c|=8)}m>0&&g>0?u=Math.max(m,g):m<0&&g<0&&(u=Math.min(m,g)),i.heightChanged=!1;for(let _ of this.viewports){let S=_.from==this.viewport.from?b:e.docView.measureVisibleLineHeights(_);this.heightMap=(a?fo.empty().applyChanges(this.stateDeco,Sn.empty,this.heightOracle,[new ns(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,a,new Ult(_.from,S))}i.heightChanged&&(c|=2)}let x=!this.viewportIsAppropriate(this.viewport,u)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return x&&(this.viewport=this.getViewport(u,this.scrollTarget)),this.updateForViewport(),(c&2||x)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,o=this.heightOracle,{visibleTop:a,visibleBottom:s}=this,l=new VS(i.lineAt(a-r*1e3,Xn.ByHeight,o,0,0).from,i.lineAt(s+(1-r)*1e3,Xn.ByHeight,o,0,0).to);if(n){let{head:c}=n.range;if(cl.to){let u=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=i.lineAt(c,Xn.ByPos,o,0,0),d;n.y=="center"?d=(f.top+f.bottom)/2-u/2:n.y=="start"||n.y=="nearest"&&c=s+Math.max(10,Math.min(r,250)))&&i>a-2*1e3&&o>1,a=i<<1;if(this.defaultTextDirection!=nr.LTR&&!r)return[];let s=[],l=(c,u,f,d)=>{if(u-cc&&gg.from>=f.from&&g.to<=f.to&&Math.abs(g.from-c)g.fromv));if(!m){if(ug.from<=u&&g.to>=u)){let g=n.moveToLineBoundary(je.cursor(u),!1,!0).head;g>c&&(u=g)}m=new kR(c,u,this.gapSize(f,c,u,d))}s.push(m)};for(let c of this.viewportLines){if(c.lengthc.from&&l(c.from,d,c,u),hn.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let n=[];sn.spans(e,this.viewport.from,this.viewport.to,{span(i,o){n.push({from:i,to:o})},point(){}},20);let r=n.length!=this.visibleRanges.length||this.visibleRanges.some((i,o)=>i.from!=n[o].from||i.to!=n[o].to);return this.visibleRanges=n,r?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||dx(this.heightMap.lineAt(e,Xn.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return dx(this.heightMap.lineAt(this.scaler.fromDOM(e),Xn.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return dx(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class VS{constructor(e,n){this.from=e,this.to=n}}function Ylt(t,e,n){let r=[],i=t,o=0;return sn.spans(n,t,e,{span(){},point(a,s){a>i&&(r.push({from:i,to:a}),o+=a-i),i=s}},20),i=1)return e[e.length-1].to;let r=Math.floor(t*n);for(let i=0;;i++){let{from:o,to:a}=e[i],s=a-o;if(r<=s)return o+r;r-=s}}function HS(t,e){let n=0;for(let{from:r,to:i}of t.ranges){if(e<=i){n+=e-r;break}n+=i-r}return n/t.total}function Klt(t,e){for(let n of t)if(e(n))return n}const C7={toDOM(t){return t},fromDOM(t){return t},scale:1};class Zlt{constructor(e,n,r){let i=0,o=0,a=0;this.viewports=r.map(({from:s,to:l})=>{let c=n.lineAt(s,Xn.ByPos,e,0,0).top,u=n.lineAt(l,Xn.ByPos,e,0,0).bottom;return i+=u-c,{from:s,to:l,top:c,bottom:u,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(n.height-i);for(let s of this.viewports)s.domTop=a+(s.top-o)*this.scale,a=s.domBottom=s.domTop+(s.bottom-s.top),o=s.bottom}toDOM(e){for(let n=0,r=0,i=0;;n++){let o=ndx(i,e)):t._content)}const qS=ft.define({combine:t=>t.join(" ")}),S3=ft.define({combine:t=>t.indexOf(!0)>-1}),O3=ed.newName(),Ide=ed.newName(),Dde=ed.newName(),Lde={"&light":"."+Ide,"&dark":"."+Dde};function C3(t,e,n){return new ed(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return t;if(!n||!n[i])throw new RangeError(`Unsupported selector: ${i}`);return n[i]}):t+" "+r}})}const Jlt=C3("."+O3,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Lde),hx="￿";class ect{constructor(e,n){this.points=e,this.text="",this.lineSeparator=n.facet(en.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=hx}readRange(e,n){if(!e)return this;let r=e.parentNode;for(let i=e;;){this.findPointBefore(r,i);let o=this.text.length;this.readNode(i);let a=i.nextSibling;if(a==n)break;let s=Dn.get(i),l=Dn.get(a);(s&&l?s.breakAfter:(s?s.breakAfter:cE(i))||cE(a)&&(i.nodeName!="BR"||i.cmIgnore)&&this.text.length>o)&&this.lineBreak(),i=a}return this.findPointBefore(r,n),this}readTextNode(e){let n=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let o=-1,a=1,s;if(this.lineSeparator?(o=n.indexOf(this.lineSeparator,r),a=this.lineSeparator.length):(s=i.exec(n))&&(o=s.index,a=s[0].length),this.append(n.slice(r,o<0?n.length:o)),o<0)break;if(this.lineBreak(),a>1)for(let l of this.points)l.node==e&&l.pos>this.text.length&&(l.pos-=a-1);r=o+a}}readNode(e){if(e.cmIgnore)return;let n=Dn.get(e),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(e,n){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(tct(e,r.node,r.offset)?n:0))}}function tct(t,e,n){for(;;){if(!e||n-1)this.newSel=null;else if(n>-1&&(this.bounds=e.docView.domBoundsAround(n,r,0))){let s=o||a?[]:oct(e),l=new ect(s,e.state);l.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=l.text,this.newSel=act(s,this.bounds.from)}else{let s=e.observer.selectionRange,l=o&&o.node==s.focusNode&&o.offset==s.focusOffset||!c3(e.contentDOM,s.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(s.focusNode,s.focusOffset),c=a&&a.node==s.anchorNode&&a.offset==s.anchorOffset||!c3(e.contentDOM,s.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(s.anchorNode,s.anchorOffset),u=e.viewport;if((ht.ios||ht.chrome)&&e.state.selection.main.empty&&l!=c&&(u.from>0||u.toDate.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:a,to:s}=e.bounds,l=i.from,c=null;(o===8||ht.android&&e.text.length=i.from&&n.to<=i.to&&(n.from!=i.from||n.to!=i.to)&&i.to-i.from-(n.to-n.from)<=4?n={from:i.from,to:i.to,insert:t.state.doc.slice(i.from,n.from).append(n.insert).append(t.state.doc.slice(n.to,i.to))}:(ht.mac||ht.android)&&n&&n.from==n.to&&n.from==i.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(r&&n.insert.length==2&&(r=je.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:Sn.of([" "])}):ht.chrome&&n&&n.from==n.to&&n.from==i.head&&n.insert.toString()==` - `&&t.lineWrapping&&(r&&(r=je.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:Sn.of([" "])}),n){if(ht.ios&&t.inputState.flushIOSKey(n)||ht.android&&(n.to==i.to&&(n.from==i.from||n.from==i.from-1&&t.state.sliceDoc(n.from,i.from)==" ")&&n.insert.length==1&&n.insert.lines==2&&Tg(t.contentDOM,"Enter",13)||(n.from==i.from-1&&n.to==i.to&&n.insert.length==0||o==8&&n.insert.lengthi.head)&&Tg(t.contentDOM,"Backspace",8)||n.from==i.from&&n.to==i.to+1&&n.insert.length==0&&Tg(t.contentDOM,"Delete",46)))return!0;let a=n.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let s,l=()=>s||(s=rct(t,n,r));return t.state.facet(fde).some(c=>c(t,n.from,n.to,a,l))||t.dispatch(l()),!0}else if(r&&!r.main.eq(i)){let a=!1,s="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(a=!0),s=t.inputState.lastSelectionOrigin),t.dispatch({selection:r,scrollIntoView:a,userEvent:s}),!0}else return!1}function rct(t,e,n){let r,i=t.state,o=i.selection.main;if(e.from>=o.from&&e.to<=o.to&&e.to-e.from>=(o.to-o.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let s=o.frome.to?i.sliceDoc(e.to,o.to):"";r=i.replaceSelection(t.state.toText(s+e.insert.sliceString(0,void 0,t.state.lineBreak)+l))}else{let s=i.changes(e),l=n&&n.main.to<=s.newLength?n.main:void 0;if(i.selection.ranges.length>1&&t.inputState.composing>=0&&e.to<=o.to&&e.to>=o.to-10){let c=t.state.sliceDoc(e.from,e.to),u,f=n&&_de(t,n.main.head);if(f){let p=e.insert.length-(e.to-e.from);u={from:f.from,to:f.to-p}}else u=t.state.doc.lineAt(o.head);let d=o.to-e.to,h=o.to-o.from;r=i.changeByRange(p=>{if(p.from==o.from&&p.to==o.to)return{changes:s,range:l||p.map(s)};let m=p.to-d,g=m-c.length;if(p.to-p.from!=h||t.state.sliceDoc(g,m)!=c||p.to>=u.from&&p.from<=u.to)return{range:p};let v=i.changes({from:g,to:m,insert:e.insert}),y=p.to-o.to;return{changes:v,range:l?je.range(Math.max(0,l.anchor+y),Math.max(0,l.head+y)):p.map(v)}})}else r={changes:s,selection:l&&i.selection.replaceRange(l)}}let a="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,a+=".compose",t.inputState.compositionFirstChange&&(a+=".start",t.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:a,scrollIntoView:!0})}function ict(t,e,n,r){let i=Math.min(t.length,e.length),o=0;for(;o0&&s>0&&t.charCodeAt(a-1)==e.charCodeAt(s-1);)a--,s--;if(r=="end"){let l=Math.max(0,o-Math.min(a,s));n-=a+l-o}if(a=a?o-n:0;o-=l,s=o+(s-a),a=o}else if(s=s?o-n:0;o-=l,a=o+(a-s),s=o}return{from:o,toA:a,toB:s}}function oct(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}=t.observer.selectionRange;return n&&(e.push(new T7(n,r)),(i!=n||o!=r)&&e.push(new T7(i,o))),e}function act(t,e){if(t.length==0)return null;let n=t[0].pos,r=t.length==2?t[1].pos:n;return n>-1&&r>-1?je.single(n+e,r+e):null}const sct={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},AR=ht.ie&&ht.ie_version<=11;class lct{constructor(e){this.view=e,this.active=!1,this.selectionRange=new Gst,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let r of n)this.queue.push(r);(ht.ie&&ht.ie_version<=11||ht.ios&&e.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),AR&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){e.type=="change"&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((n,r)=>n!=e[r]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(M2)?r.root.activeElement!=this.dom:!RC(r.dom,i))return;let o=i.anchorNode&&r.docView.nearest(i.anchorNode);if(o&&o.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(ht.ie&&ht.ie_version<=11||ht.android&&ht.chrome)&&!r.state.selection.main.empty&&i.focusNode&&Zx(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=lE(e.root);if(!n)return!1;let r=ht.safari&&e.root.nodeType==11&&zst(this.dom.ownerDocument)==this.dom&&cct(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let i=RC(this.dom,r);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let o=this.delayedAndroidKey;o&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=o.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&o.force&&Tg(this.dom,o.key,o.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,r=-1,i=!1;for(let o of e){let a=this.readMutation(o);a&&(a.typeOver&&(i=!0),n==-1?{from:n,to:r}=a:(n=Math.min(a.from,n),r=Math.max(a.to,r)))}return{from:n,to:r,typeOver:i}}readChange(){let{from:e,to:n,typeOver:r}=this.processRecords(),i=this.selectionChanged&&RC(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let o=new nct(this.view,e,n,r);return this.view.docView.domChanged={newSel:o.newSel?o.newSel.main:null},o}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,i=$de(this.view,n);return this.view.state==r&&this.view.update([]),i}readMutation(e){let n=this.view.docView.nearest(e.target);if(!n||n.ignoreMutation(e))return null;if(n.markDirty(e.type=="attributes"),e.type=="attributes"&&(n.flags|=4),e.type=="childList"){let r=E7(n,e.previousSibling||e.target.previousSibling,-1),i=E7(n,e.nextSibling||e.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:i?n.posBefore(i):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener("change",this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener("change",this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}destroy(){var e,n,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}}function E7(t,e,n){for(;e;){let r=Dn.get(e);if(r&&r.parent==t)return r;let i=e.parentNode;e=i!=t.dom?i:n>0?e.nextSibling:e.previousSibling}return null}function P7(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset,a=t.docView.domAtPos(t.state.selection.main.anchor);return Zx(a.node,a.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function cct(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return P7(t,i)}let n=null;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",r,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",r,!0),n?P7(t,n):null}class rt{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:n}=e;this.dispatchTransactions=e.dispatchTransactions||n&&(r=>r.forEach(i=>n(i,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||Hst(e.parent)||document,this.viewState=new O7(e.state||en.create(e)),e.scrollTo&&e.scrollTo.is(zS)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(ux).map(r=>new ER(r));for(let r of this.plugins)r.update(this);this.observer=new lct(this),this.inputState=new Olt(this),this.inputState.ensureHandlers(this.plugins),this.docView=new a7(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure()}dispatch(...e){let n=e.length==1&&e[0]instanceof Br?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,i,o=this.state;for(let d of e){if(d.startState!=o)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");o=d.state}if(this.destroyed){this.viewState.state=o;return}let a=this.hasFocus,s=0,l=null;e.some(d=>d.annotation(Mde))?(this.inputState.notifiedFocused=a,s=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,l=kde(o,a),l||(s=1));let c=this.observer.delayedAndroidKey,u=null;if(c?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(o.doc)||!this.state.selection.eq(o.selection))&&(u=null)):this.observer.clear(),o.facet(en.phrases)!=this.state.facet(en.phrases))return this.setState(o);i=uE.create(this,o,e),i.flags|=s;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let d of e){if(f&&(f=f.map(d.changes)),d.scrollIntoView){let{main:h}=d.state.selection;f=new Eg(h.empty?h:je.cursor(h.head,h.head>h.anchor?-1:1))}for(let h of d.effects)h.is(zS)&&(f=h.value.clip(this.state))}this.viewState.update(i,f),this.bidiCache=fE.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(fx)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(d=>d.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(qS)!=i.state.facet(qS)&&(this.viewState.mustMeasureContent=!0),(n||r||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let d of this.state.facet(x3))try{d(i)}catch(h){ko(this.state,h,"update listener")}(l||u)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),u&&!$de(this,u)&&c.force&&Tg(this.contentDOM,c.key,c.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new O7(e),this.plugins=e.facet(ux).map(r=>new ER(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new a7(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(ux),r=e.state.facet(ux);if(n!=r){let i=[];for(let o of r){let a=n.indexOf(o);if(a<0)i.push(new ER(o));else{let s=this.plugins[a];s.mustUpdate=e,i.push(s)}}for(let o of this.plugins)o.mustUpdate!=e&&o.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,r=this.scrollDOM,i=r.scrollTop*this.scaleY,{scrollAnchorPos:o,scrollAnchorHeight:a}=this.viewState;Math.abs(i-this.viewState.scrollTop)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let s=0;;s++){if(a<0)if(Vfe(r))o=-1,a=this.viewState.heightMap.height;else{let h=this.viewState.scrollAnchorAt(i);o=h.from,a=h.top}this.updateState=1;let l=this.viewState.measure(this);if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(s>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];l&4||([this.measureRequests,c]=[c,this.measureRequests]);let u=c.map(h=>{try{return h.read(this)}catch(p){return ko(this.state,p),M7}}),f=uE.create(this,this.state,[]),d=!1;f.flags|=l,n?n.flags|=l:n=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),d=this.docView.update(f),d&&this.docViewUpdate());for(let h=0;h1||p<-1){i=i+p,r.scrollTop=i/this.scaleY,a=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let s of this.state.facet(x3))s(n)}get themeClasses(){return O3+" "+(this.state.facet(S3)?Dde:Ide)+" "+this.state.facet(qS)}updateAttrs(){let e=k7(this,gde,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(M2)?"true":"false",class:"cm-content",style:`${ht.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),k7(this,c4,n);let r=this.observer.ignore(()=>{let i=p3(this.contentDOM,this.contentAttrs,n),o=p3(this.dom,this.editorAttrs,e);return i||o});return this.editorAttrs=e,this.contentAttrs=n,r}showAnnouncements(e){let n=!0;for(let r of e)for(let i of r.effects)if(i.is(rt.announce)){n&&(this.announceDOM.textContent=""),n=!1;let o=this.announceDOM.appendChild(document.createElement("div"));o.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(fx);let e=this.state.facet(rt.cspNonce);ed.mount(this.root,this.styleModules.concat(Jlt).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let n=0;nr.spec==e)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,n,r){return MR(this,e,d7(this,e,n,r))}moveByGroup(e,n){return MR(this,e,d7(this,e,n,r=>wlt(this,e.head,r)))}visualLineSide(e,n){let r=this.bidiSpans(e),i=this.textDirectionAt(e.from),o=r[n?r.length-1:0];return je.cursor(o.side(n,i)+e.from,o.forward(!n,i)?1:-1)}moveToLineBoundary(e,n,r=!0){return _lt(this,e,n,r)}moveVertically(e,n,r){return MR(this,e,Slt(this,e,n,r))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){return this.readMeasured(),wde(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let r=this.docView.coordsAt(e,n);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(e),o=this.bidiSpans(i),a=o[_f.find(o,e-i.from,-1,n)];return E2(r,a.dir==nr.LTR==n>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(hde)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>uct)return ode(e.length);let n=this.textDirectionAt(e.from),r;for(let o of this.bidiCache)if(o.from==e.from&&o.dir==n&&(o.fresh||ide(o.isolates,r=o7(this,e))))return o.order;r||(r=o7(this,e));let i=olt(e.text,n,r);return this.bidiCache.push(new fE(e.from,e.to,n,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||ht.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Ufe(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,n={}){return zS.of(new Eg(typeof e=="number"?je.cursor(e):e,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return zS.of(new Eg(je.cursor(r.from),"start","start",r.top-e,n,!0))}static domEventHandlers(e){return Mr.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Mr.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=ed.newName(),i=[qS.of(r),fx.of(C3(`.${r}`,e))];return n&&n.dark&&i.push(S3.of(!0)),i}static baseTheme(e){return bd.lowest(fx.of(C3("."+O3,e,Lde)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),i=r&&Dn.get(r)||Dn.get(e);return((n=i==null?void 0:i.rootView)===null||n===void 0?void 0:n.view)||null}}rt.styleModule=fx;rt.inputHandler=fde;rt.scrollHandler=mde;rt.focusChangeEffect=dde;rt.perLineTextDirection=hde;rt.exceptionSink=ude;rt.updateListener=x3;rt.editable=M2;rt.mouseSelectionStyle=cde;rt.dragMovesSelection=lde;rt.clickAddsSelectionRange=sde;rt.decorations=e_;rt.outerDecorations=vde;rt.atomicRanges=u4;rt.bidiIsolatedRanges=yde;rt.scrollMargins=xde;rt.darkTheme=S3;rt.cspNonce=ft.define({combine:t=>t.length?t[0]:""});rt.contentAttributes=c4;rt.editorAttributes=gde;rt.lineWrapping=rt.contentAttributes.of({class:"cm-lineWrapping"});rt.announce=It.define();const uct=4096,M7={};class fE{constructor(e,n,r,i,o,a){this.from=e,this.to=n,this.dir=r,this.isolates=i,this.fresh=o,this.order=a}static update(e,n){if(n.empty&&!e.some(o=>o.fresh))return e;let r=[],i=e.length?e[e.length-1].dir:nr.LTR;for(let o=Math.max(0,e.length-10);o=0;i--){let o=r[i],a=typeof o=="function"?o(t):o;a&&h3(a,n)}return n}const fct=ht.mac?"mac":ht.windows?"win":ht.linux?"linux":"key";function dct(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let i,o,a,s;for(let l=0;lr.concat(i),[]))),n}function pct(t,e,n){return Fde(Nde(t.state),e,t,n)}let uf=null;const mct=4e3;function gct(t,e=fct){let n=Object.create(null),r=Object.create(null),i=(a,s)=>{let l=r[a];if(l==null)r[a]=s;else if(l!=s)throw new Error("Key binding "+a+" is used both as a regular binding and as a multi-stroke prefix")},o=(a,s,l,c,u)=>{var f,d;let h=n[a]||(n[a]=Object.create(null)),p=s.split(/ (?!$)/).map(v=>dct(v,e));for(let v=1;v{let b=uf={view:x,prefix:y,scope:a};return setTimeout(()=>{uf==b&&(uf=null)},mct),!0}]})}let m=p.join(" ");i(m,!1);let g=h[m]||(h[m]={preventDefault:!1,stopPropagation:!1,run:((d=(f=h._any)===null||f===void 0?void 0:f.run)===null||d===void 0?void 0:d.slice())||[]});l&&g.run.push(l),c&&(g.preventDefault=!0),u&&(g.stopPropagation=!0)};for(let a of t){let s=a.scope?a.scope.split(" "):["editor"];if(a.any)for(let c of s){let u=n[c]||(n[c]=Object.create(null));u._any||(u._any={preventDefault:!1,stopPropagation:!1,run:[]});for(let f in u)u[f].run.push(a.any)}let l=a[e]||a.key;if(l)for(let c of s)o(c,l,a.run,a.preventDefault,a.stopPropagation),a.shift&&o(c,"Shift-"+l,a.shift,a.preventDefault,a.stopPropagation)}return n}function Fde(t,e,n,r){let i=Bst(e),o=Ci(i,0),a=Ga(o)==i.length&&i!=" ",s="",l=!1,c=!1,u=!1;uf&&uf.view==n&&uf.scope==r&&(s=uf.prefix+" ",Ode.indexOf(e.keyCode)<0&&(c=!0,uf=null));let f=new Set,d=g=>{if(g){for(let v of g.run)if(!f.has(v)&&(f.add(v),v(n,e)))return g.stopPropagation&&(u=!0),!0;g.preventDefault&&(g.stopPropagation&&(u=!0),c=!0)}return!1},h=t[r],p,m;return h&&(d(h[s+XS(i,e,!a)])?l=!0:a&&(e.altKey||e.metaKey||e.ctrlKey)&&!(ht.windows&&e.ctrlKey&&e.altKey)&&(p=td[e.keyCode])&&p!=i?(d(h[s+XS(p,e,!0)])||e.shiftKey&&(m=Jb[e.keyCode])!=i&&m!=p&&d(h[s+XS(m,e,!1)]))&&(l=!0):a&&e.shiftKey&&d(h[s+XS(i,e,!0)])&&(l=!0),!l&&d(h._any)&&(l=!0)),c&&(l=!0),l&&u&&e.stopPropagation(),l}class fw{constructor(e,n,r,i,o){this.className=e,this.left=n,this.top=r,this.width=i,this.height=o}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,n){return n.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,n,r){if(r.empty){let i=e.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let o=jde(e);return[new fw(n,i.left-o.left,i.top-o.top,null,i.bottom-i.top)]}else return vct(e,n,r)}}function jde(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==nr.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function R7(t,e,n){let r=je.cursor(e);return{from:Math.max(n.from,t.moveToLineBoundary(r,!1,!0).from),to:Math.min(n.to,t.moveToLineBoundary(r,!0,!0).from),type:uo.Text}}function vct(t,e,n){if(n.to<=t.viewport.from||n.from>=t.viewport.to)return[];let r=Math.max(n.from,t.viewport.from),i=Math.min(n.to,t.viewport.to),o=t.textDirection==nr.LTR,a=t.contentDOM,s=a.getBoundingClientRect(),l=jde(t),c=a.querySelector(".cm-line"),u=c&&window.getComputedStyle(c),f=s.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),d=s.right-(u?parseInt(u.paddingRight):0),h=_3(t,r),p=_3(t,i),m=h.type==uo.Text?h:null,g=p.type==uo.Text?p:null;if(m&&(t.lineWrapping||h.widgetLineBreaks)&&(m=R7(t,r,m)),g&&(t.lineWrapping||p.widgetLineBreaks)&&(g=R7(t,i,g)),m&&g&&m.from==g.from)return y(x(n.from,n.to,m));{let _=m?x(n.from,null,m):b(h,!1),S=g?x(null,n.to,g):b(p,!0),O=[];return(m||h).to<(g||p).from-(m&&g?1:0)||h.widgetLineBreaks>1&&_.bottom+t.defaultLineHeight/2P&&T.from=z)break;N>L&&I(Math.max(U,L),_==null&&U<=P,Math.min(N,z),S==null&&N>=R,W.dir)}if(L=B.to+1,L>=z)break}return k.length==0&&I(P,_==null,R,S==null,t.textDirection),{top:C,bottom:E,horizontal:k}}function b(_,S){let O=s.top+(S?_.top:_.bottom);return{top:O,bottom:O,horizontal:[]}}}function yct(t,e){return t.constructor==e.constructor&&t.eq(e)}class xct{constructor(e,n){this.view=e,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,e)}update(e){e.startState.facet(LC)!=e.state.facet(LC)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let n=0,r=e.facet(LC);for(;n!yct(n,this.drawn[r]))){let n=this.dom.firstChild,r=0;for(let i of e)i.update&&n&&i.constructor&&this.drawn[r].constructor&&i.update(n,this.drawn[r])?(n=n.nextSibling,r++):this.dom.insertBefore(i.draw(),n);for(;n;){let i=n.nextSibling;n.remove(),n=i}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const LC=ft.define();function Bde(t){return[Mr.define(e=>new xct(e,t)),LC.of(t)]}const zde=!ht.ios,t_=ft.define({combine(t){return ac(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,n)=>Math.min(e,n),drawRangeCursor:(e,n)=>e||n})}});function bct(t={}){return[t_.of(t),_ct,wct,Sct,pde.of(!0)]}function Ude(t){return t.startState.facet(t_)!=t.state.facet(t_)}const _ct=Bde({above:!0,markers(t){let{state:e}=t,n=e.facet(t_),r=[];for(let i of e.selection.ranges){let o=i==e.selection.main;if(i.empty?!o||zde:n.drawRangeCursor){let a=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",s=i.empty?i:je.cursor(i.head,i.head>i.anchor?-1:1);for(let l of fw.forRange(t,a,s))r.push(l)}}return r},update(t,e){t.transactions.some(r=>r.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=Ude(t);return n&&I7(t.state,e),t.docChanged||t.selectionSet||n},mount(t,e){I7(e.state,t)},class:"cm-cursorLayer"});function I7(t,e){e.style.animationDuration=t.facet(t_).cursorBlinkRate+"ms"}const wct=Bde({above:!1,markers(t){return t.state.selection.ranges.map(e=>e.empty?[]:fw.forRange(t,"cm-selectionBackground",e)).reduce((e,n)=>e.concat(n))},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||Ude(t)},class:"cm-selectionLayer"}),T3={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};zde&&(T3[".cm-line"].caretColor="transparent !important",T3[".cm-content"]={caretColor:"transparent !important"});const Sct=bd.highest(rt.theme(T3)),Wde=It.define({map(t,e){return t==null?null:e.mapPos(t)}}),px=pi.define({create(){return null},update(t,e){return t!=null&&(t=e.changes.mapPos(t)),e.effects.reduce((n,r)=>r.is(Wde)?r.value:n,t)}}),Oct=Mr.fromClass(class{constructor(t){this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(t){var e;let n=t.state.field(px);n==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(t.startState.field(px)!=n||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(px),n=e!=null&&t.coordsAtPos(e);if(!n)return null;let r=t.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+t.scrollDOM.scrollLeft*t.scaleX,top:n.top-r.top+t.scrollDOM.scrollTop*t.scaleY,height:n.bottom-n.top}}drawCursor(t){if(this.cursor){let{scaleX:e,scaleY:n}=this.view;t?(this.cursor.style.left=t.left/e+"px",this.cursor.style.top=t.top/n+"px",this.cursor.style.height=t.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(t){this.view.state.field(px)!=t&&this.view.dispatch({effects:Wde.of(t)})}},{eventObservers:{dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}))},dragleave(t){(t.target==this.view.contentDOM||!this.view.contentDOM.contains(t.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function Cct(){return[px,Oct]}function D7(t,e,n,r,i){e.lastIndex=0;for(let o=t.iterRange(n,r),a=n,s;!o.next().done;a+=o.value.length)if(!o.lineBreak)for(;s=e.exec(o.value);)i(a+s.index,s)}function Tct(t,e){let n=t.visibleRanges;if(n.length==1&&n[0].from==t.viewport.from&&n[0].to==t.viewport.to)return n;let r=[];for(let{from:i,to:o}of n)i=Math.max(t.state.doc.lineAt(i).from,i-e),o=Math.min(t.state.doc.lineAt(o).to,o+e),r.length&&r[r.length-1].to>=i?r[r.length-1].to=o:r.push({from:i,to:o});return r}class Ect{constructor(e){const{regexp:n,decoration:r,decorate:i,boundary:o,maxLength:a=1e3}=e;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,i)this.addMatch=(s,l,c,u)=>i(u,c,c+s[0].length,s,l);else if(typeof r=="function")this.addMatch=(s,l,c,u)=>{let f=r(s,l,c);f&&u(c,c+s[0].length,f)};else if(r)this.addMatch=(s,l,c,u)=>u(c,c+s[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=o,this.maxLength=a}createDeco(e){let n=new Jf,r=n.add.bind(n);for(let{from:i,to:o}of Tct(e,this.maxLength))D7(e.state.doc,this.regexp,i,o,(a,s)=>this.addMatch(s,e,a,r));return n.finish()}updateDeco(e,n){let r=1e9,i=-1;return e.docChanged&&e.changes.iterChanges((o,a,s,l)=>{l>e.view.viewport.from&&s1e3?this.createDeco(e.view):i>-1?this.updateRange(e.view,n.map(e.changes),r,i):n}updateRange(e,n,r,i){for(let o of e.visibleRanges){let a=Math.max(o.from,r),s=Math.min(o.to,i);if(s>a){let l=e.state.doc.lineAt(a),c=l.tol.from;a--)if(this.boundary.test(l.text[a-1-l.from])){u=a;break}for(;sd.push(v.range(m,g));if(l==c)for(this.regexp.lastIndex=u-l.from;(h=this.regexp.exec(l.text))&&h.indexthis.addMatch(g,e,m,p));n=n.update({filterFrom:u,filterTo:f,filter:(m,g)=>mf,add:d})}}return n}}const E3=/x/.unicode!=null?"gu":"g",Pct=new RegExp(`[\0-\b ---Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,E3),Mct={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let RR=null;function kct(){var t;if(RR==null&&typeof document<"u"&&document.body){let e=document.body.style;RR=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return RR||!1}const $C=ft.define({combine(t){let e=ac(t,{render:null,specialChars:Pct,addSpecialChars:null});return(e.replaceTabs=!kct())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,E3)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,E3)),e}});function Act(t={}){return[$C.of(t),Rct()]}let L7=null;function Rct(){return L7||(L7=Mr.fromClass(class{constructor(t){this.view=t,this.decorations=yt.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet($C)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new Ect({regexp:t.specialChars,decoration:(e,n,r)=>{let{doc:i}=n.state,o=Ci(e[0],0);if(o==9){let a=i.lineAt(r),s=n.state.tabSize,l=Cy(a.text,s,r-a.from);return yt.replace({widget:new $ct((s-l%s)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=yt.replace({widget:new Lct(t,o)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet($C);t.startState.facet($C)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))}const Ict="•";function Dct(t){return t>=32?Ict:t==10?"␤":String.fromCharCode(9216+t)}class Lct extends sc{constructor(e,n){super(),this.options=e,this.code=n}eq(e){return e.code==this.code}toDOM(e){let n=Dct(this.code),r=e.state.phrase("Control character")+" "+(Mct[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,n);if(i)return i;let o=document.createElement("span");return o.textContent=n,o.title=r,o.setAttribute("aria-label",r),o.className="cm-specialChar",o}ignoreEvent(){return!1}}class $ct extends sc{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function Nct(){return jct}const Fct=yt.line({class:"cm-activeLine"}),jct=Mr.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,n=[];for(let r of t.state.selection.ranges){let i=t.lineBlockAt(r.head);i.from>e&&(n.push(Fct.range(i.from)),e=i.from)}return yt.set(n)}},{decorations:t=>t.decorations});class Bct extends sc{constructor(e){super(),this.content=e}toDOM(){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild(typeof this.content=="string"?document.createTextNode(this.content):this.content),typeof this.content=="string"?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}coordsAt(e){let n=e.firstChild?ov(e.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(e.parentNode),i=E2(n[0],r.direction!="rtl"),o=parseInt(r.lineHeight);return i.bottom-i.top>o*1.5?{left:i.left,right:i.right,top:i.top,bottom:i.top+o}:i}ignoreEvent(){return!1}}function zct(t){return Mr.fromClass(class{constructor(e){this.view=e,this.placeholder=t?yt.set([yt.widget({widget:new Bct(t),side:1}).range(0)]):yt.none}get decorations(){return this.view.state.doc.length?yt.none:this.placeholder}},{decorations:e=>e.decorations})}const P3=2e3;function Uct(t,e,n){let r=Math.min(e.line,n.line),i=Math.max(e.line,n.line),o=[];if(e.off>P3||n.off>P3||e.col<0||n.col<0){let a=Math.min(e.off,n.off),s=Math.max(e.off,n.off);for(let l=r;l<=i;l++){let c=t.doc.line(l);c.length<=s&&o.push(je.range(c.from+a,c.to+s))}}else{let a=Math.min(e.col,n.col),s=Math.max(e.col,n.col);for(let l=r;l<=i;l++){let c=t.doc.line(l),u=a3(c.text,a,t.tabSize,!0);if(u<0)o.push(je.cursor(c.to));else{let f=a3(c.text,s,t.tabSize);o.push(je.range(c.from+u,c.from+f))}}}return o}function Wct(t,e){let n=t.coordsAtPos(t.viewport.from);return n?Math.round(Math.abs((n.left-e)/t.defaultCharacterWidth)):-1}function $7(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1),r=t.state.doc.lineAt(n),i=n-r.from,o=i>P3?-1:i==r.length?Wct(t,e.clientX):Cy(r.text,t.state.tabSize,n-r.from);return{line:r.number,col:o,off:i}}function Vct(t,e){let n=$7(t,e),r=t.state.selection;return n?{update(i){if(i.docChanged){let o=i.changes.mapPos(i.startState.doc.line(n.line).from),a=i.state.doc.lineAt(o);n={line:a.number,col:n.col,off:Math.min(n.off,a.length)},r=r.map(i.changes)}},get(i,o,a){let s=$7(t,i);if(!s)return r;let l=Uct(t.state,n,s);return l.length?a?je.create(l.concat(r.ranges)):je.create(l):r}}:null}function Gct(t){let e=(t==null?void 0:t.eventFilter)||(n=>n.altKey&&n.button==0);return rt.mouseSelectionStyle.of((n,r)=>e(r)?Vct(n,r):null)}const Hct={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},qct={style:"cursor: crosshair"};function Xct(t={}){let[e,n]=Hct[t.key||"Alt"],r=Mr.fromClass(class{constructor(i){this.view=i,this.isDown=!1}set(i){this.isDown!=i&&(this.isDown=i,this.view.update([]))}},{eventObservers:{keydown(i){this.set(i.keyCode==e||n(i))},keyup(i){(i.keyCode==e||!n(i))&&this.set(!1)},mousemove(i){this.set(n(i))}}});return[r,rt.contentAttributes.of(i=>{var o;return!((o=i.plugin(r))===null||o===void 0)&&o.isDown?qct:null})]}const M0="-10000px";class Vde{constructor(e,n,r,i){this.facet=n,this.createTooltipView=r,this.removeTooltipView=i,this.input=e.state.facet(n),this.tooltips=this.input.filter(a=>a);let o=null;this.tooltipViews=this.tooltips.map(a=>o=r(a,o))}update(e,n){var r;let i=e.state.facet(this.facet),o=i.filter(l=>l);if(i===this.input){for(let l of this.tooltipViews)l.update&&l.update(e);return!1}let a=[],s=n?[]:null;for(let l=0;ln[c]=l),n.length=s.length),this.input=i,this.tooltips=o,this.tooltipViews=a,!0}}function Qct(t){let{win:e}=t;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const IR=ft.define({combine:t=>{var e,n,r;return{position:ht.ios?"absolute":((e=t.find(i=>i.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((n=t.find(i=>i.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((r=t.find(i=>i.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||Qct}}}),N7=new WeakMap,d4=Mr.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(IR);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new Vde(t,h4,(n,r)=>this.createTooltip(n,r),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let n=e||t.geometryChanged,r=t.state.facet(IR);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let i of this.manager.tooltipViews)this.container.appendChild(i.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(t,e){let n=t.create(this.view),r=e?e.dom:null;if(n.dom.classList.add("cm-tooltip"),t.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let i=document.createElement("div");i.className="cm-tooltip-arrow",n.dom.insertBefore(i,r)}return n.dom.style.position=this.position,n.dom.style.top=M0,n.dom.style.left="0px",this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var t,e,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(t=r.destroy)===null||t===void 0||t.call(r);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=this.view.dom.getBoundingClientRect(),e=1,n=1,r=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:i}=this.manager.tooltipViews[0];if(ht.gecko)r=i.offsetParent!=this.container.ownerDocument.body;else if(i.style.top==M0&&i.style.left=="0px"){let o=i.getBoundingClientRect();r=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}}if(r||this.position=="absolute")if(this.parent){let i=this.parent.getBoundingClientRect();i.width&&i.height&&(e=i.width/this.parent.offsetWidth,n=i.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:n}=this.view.viewState);return{editor:t,parent:this.parent?this.container.getBoundingClientRect():t,pos:this.manager.tooltips.map((i,o)=>{let a=this.manager.tooltipViews[o];return a.getCoords?a.getCoords(i.pos):this.view.coordsAtPos(i.pos)}),size:this.manager.tooltipViews.map(({dom:i})=>i.getBoundingClientRect()),space:this.view.state.facet(IR).tooltipSpace(this.view),scaleX:e,scaleY:n,makeAbsolute:r}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let s of this.manager.tooltipViews)s.dom.style.position="absolute"}let{editor:n,space:r,scaleX:i,scaleY:o}=t,a=[];for(let s=0;s=Math.min(n.bottom,r.bottom)||f.rightMath.min(n.right,r.right)+.1){u.style.top=M0;continue}let h=l.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,p=h?7:0,m=d.right-d.left,g=(e=N7.get(c))!==null&&e!==void 0?e:d.bottom-d.top,v=c.offset||Kct,y=this.view.textDirection==nr.LTR,x=d.width>r.right-r.left?y?r.left:r.right-d.width:y?Math.min(f.left-(h?14:0)+v.x,r.right-m):Math.max(r.left,f.left-m+(h?14:0)-v.x),b=this.above[s];!l.strictSide&&(b?f.top-(d.bottom-d.top)-v.yr.bottom)&&b==r.bottom-f.bottom>f.top-r.top&&(b=this.above[s]=!b);let _=(b?f.top-r.top:r.bottom-f.bottom)-p;if(_x&&C.topS&&(S=b?C.top-g-2-p:C.bottom+p+2);if(this.position=="absolute"?(u.style.top=(S-t.parent.top)/o+"px",u.style.left=(x-t.parent.left)/i+"px"):(u.style.top=S/o+"px",u.style.left=x/i+"px"),h){let C=f.left+(y?v.x:-v.x)-(x+14-7);h.style.left=C/i+"px"}c.overlap!==!0&&a.push({left:x,top:S,right:O,bottom:S+g}),u.classList.toggle("cm-tooltip-above",b),u.classList.toggle("cm-tooltip-below",!b),c.positioned&&c.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=M0}},{eventObservers:{scroll(){this.maybeMeasure()}}}),Yct=rt.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),Kct={x:0,y:0},h4=ft.define({enables:[d4,Yct]}),dE=ft.define({combine:t=>t.reduce((e,n)=>e.concat(n),[])});class k2{static create(e){return new k2(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new Vde(e,dE,(n,r)=>this.createHostedView(n,r),n=>n.dom.remove())}createHostedView(e,n){let r=e.create(this.view);return r.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(r.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&r.mount&&r.mount(this.view),r}mount(e){for(let n of this.manager.tooltipViews)n.mount&&n.mount(e);this.mounted=!0}positioned(e){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let n of this.manager.tooltipViews)(e=n.destroy)===null||e===void 0||e.call(n)}passProp(e){let n;for(let r of this.manager.tooltipViews){let i=r[e];if(i!==void 0){if(n===void 0)n=i;else if(n!==i)return}}return n}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const Zct=h4.compute([dE],t=>{let e=t.facet(dE);return e.length===0?null:{pos:Math.min(...e.map(n=>n.pos)),end:Math.max(...e.map(n=>{var r;return(r=n.end)!==null&&r!==void 0?r:n.pos})),create:k2.create,above:e[0].above,arrow:e.some(n=>n.arrow)}});class Jct{constructor(e,n,r,i,o){this.view=e,this.source=n,this.field=r,this.setHover=i,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;es.bottom||n.xs.right+e.defaultCharacterWidth)return;let l=e.bidiSpans(e.state.doc.lineAt(i)).find(u=>u.from<=i&&u.to>=i),c=l&&l.dir==nr.RTL?-1:1;o=n.x{this.pending==s&&(this.pending=null,l&&!(Array.isArray(l)&&!l.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(l)?l:[l])}))},l=>ko(e.state,l,"hover tooltip"))}else a&&!(Array.isArray(a)&&!a.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(a)?a:[a])})}get tooltip(){let e=this.view.plugin(d4),n=e?e.manager.tooltips.findIndex(r=>r.create==k2.create):-1;return n>-1?e.manager.tooltipViews[n]:null}mousemove(e){var n,r;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:i,tooltip:o}=this;if(i.length&&o&&!eut(o.dom,e)||this.pending){let{pos:a}=i[0]||this.pending,s=(r=(n=i[0])===null||n===void 0?void 0:n.end)!==null&&r!==void 0?r:a;(a==s?this.view.posAtCoords(this.lastMove)!=a:!tut(this.view,a,s,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length){let{tooltip:r}=this;r&&r.dom.contains(e.relatedTarget)?this.watchTooltipLeave(r.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let n=r=>{e.removeEventListener("mouseleave",n),this.active.length&&!this.view.dom.contains(r.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const QS=4;function eut(t,e){let n=t.getBoundingClientRect();return e.clientX>=n.left-QS&&e.clientX<=n.right+QS&&e.clientY>=n.top-QS&&e.clientY<=n.bottom+QS}function tut(t,e,n,r,i,o){let a=t.scrollDOM.getBoundingClientRect(),s=t.documentTop+t.documentPadding.top+t.contentHeight;if(a.left>r||a.righti||Math.min(a.bottom,s)=e&&l<=n}function nut(t,e={}){let n=It.define(),r=pi.define({create(){return[]},update(i,o){if(i.length&&(e.hideOnChange&&(o.docChanged||o.selection)?i=[]:e.hideOn&&(i=i.filter(a=>!e.hideOn(o,a))),o.docChanged)){let a=[];for(let s of i){let l=o.changes.mapPos(s.pos,-1,Pi.TrackDel);if(l!=null){let c=Object.assign(Object.create(null),s);c.pos=l,c.end!=null&&(c.end=o.changes.mapPos(c.end)),a.push(c)}}i=a}for(let a of o.effects)a.is(n)&&(i=a.value),a.is(rut)&&(i=[]);return i},provide:i=>dE.from(i)});return[r,Mr.define(i=>new Jct(i,t,r,n,e.hoverTime||300)),Zct]}function Gde(t,e){let n=t.plugin(d4);if(!n)return null;let r=n.manager.tooltips.indexOf(e);return r<0?null:n.manager.tooltipViews[r]}const rut=It.define(),F7=ft.define({combine(t){let e,n;for(let r of t)e=e||r.topContainer,n=n||r.bottomContainer;return{topContainer:e,bottomContainer:n}}});function n_(t,e){let n=t.plugin(Hde),r=n?n.specs.indexOf(e):-1;return r>-1?n.panels[r]:null}const Hde=Mr.fromClass(class{constructor(t){this.input=t.state.facet(r_),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(F7);this.top=new YS(t,!0,e.topContainer),this.bottom=new YS(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(t){let e=t.state.facet(F7);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new YS(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new YS(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(r_);if(n!=this.input){let r=n.filter(l=>l),i=[],o=[],a=[],s=[];for(let l of r){let c=this.specs.indexOf(l),u;c<0?(u=l(t.view),s.push(u)):(u=this.panels[c],u.update&&u.update(t)),i.push(u),(u.top?o:a).push(u)}this.specs=r,this.panels=i,this.top.sync(o),this.bottom.sync(a);for(let l of s)l.dom.classList.add("cm-panel"),l.mount&&l.mount()}else for(let r of this.panels)r.update&&r.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>rt.scrollMargins.of(e=>{let n=e.plugin(t);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class YS{constructor(e,n,r){this.view=e,this.top=n,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let n of this.panels)n.destroy&&e.indexOf(n)<0&&n.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let e=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;e!=n.dom;)e=j7(e);e=e.nextSibling}else this.dom.insertBefore(n.dom,e);for(;e;)e=j7(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function j7(t){let e=t.nextSibling;return t.remove(),e}const r_=ft.define({enables:Hde});class du extends ep{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}du.prototype.elementClass="";du.prototype.toDOM=void 0;du.prototype.mapMode=Pi.TrackBefore;du.prototype.startSide=du.prototype.endSide=-1;du.prototype.point=!0;const NC=ft.define(),iut={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>sn.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},eb=ft.define();function out(t){return[qde(),eb.of(Object.assign(Object.assign({},iut),t))]}const M3=ft.define({combine:t=>t.some(e=>e)});function qde(t){let e=[aut];return t&&t.fixed===!1&&e.push(M3.of(!0)),e}const aut=Mr.fromClass(class{constructor(t){this.view=t,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(eb).map(e=>new z7(t,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!t.state.facet(M3),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}update(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,r=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}t.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(M3)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&this.dom.remove();let n=sn.iter(this.view.state.facet(NC),this.view.viewport.from),r=[],i=this.gutters.map(o=>new sut(o,this.view.viewport,-this.view.documentPadding.top));for(let o of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(o.type)){let a=!0;for(let s of o.type)if(s.type==uo.Text&&a){k3(n,r,s.from);for(let l of i)l.line(this.view,s,r);a=!1}else if(s.widget)for(let l of i)l.widget(this.view,s)}else if(o.type==uo.Text){k3(n,r,o.from);for(let a of i)a.line(this.view,o,r)}else if(o.widget)for(let a of i)a.widget(this.view,o);for(let o of i)o.finish();t&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(t){let e=t.startState.facet(eb),n=t.state.facet(eb),r=t.docChanged||t.heightChanged||t.viewportChanged||!sn.eq(t.startState.facet(NC),t.state.facet(NC),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let i of this.gutters)i.update(t)&&(r=!0);else{r=!0;let i=[];for(let o of n){let a=e.indexOf(o);a<0?i.push(new z7(this.view,o)):(this.gutters[a].update(t),i.push(this.gutters[a]))}for(let o of this.gutters)o.dom.remove(),i.indexOf(o)<0&&o.destroy();for(let o of i)this.dom.appendChild(o.dom);this.gutters=i}return r}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove()}},{provide:t=>rt.scrollMargins.of(e=>{let n=e.plugin(t);return!n||n.gutters.length==0||!n.fixed?null:e.textDirection==nr.LTR?{left:n.dom.offsetWidth*e.scaleX}:{right:n.dom.offsetWidth*e.scaleX}})});function B7(t){return Array.isArray(t)?t:[t]}function k3(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class sut{constructor(e,n,r){this.gutter=e,this.height=r,this.i=0,this.cursor=sn.iter(e.markers,n.from)}addElement(e,n,r){let{gutter:i}=this,o=(n.top-this.height)/e.scaleY,a=n.height/e.scaleY;if(this.i==i.elements.length){let s=new Xde(e,a,o,r);i.elements.push(s),i.dom.appendChild(s.dom)}else i.elements[this.i].update(e,a,o,r);this.height=n.bottom,this.i++}line(e,n,r){let i=[];k3(this.cursor,i,n.from),r.length&&(i=i.concat(r));let o=this.gutter.config.lineMarker(e,n,i);o&&i.unshift(o);let a=this.gutter;i.length==0&&!a.config.renderEmptyElements||this.addElement(e,n,i)}widget(e,n){let r=this.gutter.config.widgetMarker(e,n.widget,n);r&&this.addElement(e,n,[r])}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}}class z7{constructor(e,n){this.view=e,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in n.domEventHandlers)this.dom.addEventListener(r,i=>{let o=i.target,a;if(o!=this.dom&&this.dom.contains(o)){for(;o.parentNode!=this.dom;)o=o.parentNode;let l=o.getBoundingClientRect();a=(l.top+l.bottom)/2}else a=i.clientY;let s=e.lineBlockAtHeight(a-e.documentTop);n.domEventHandlers[r](e,s,i)&&i.preventDefault()});this.markers=B7(n.markers(e)),n.initialSpacer&&(this.spacer=new Xde(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let n=this.markers;if(this.markers=B7(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],e);i!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[i])}let r=e.view.viewport;return!sn.eq(this.markers,n,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class Xde{constructor(e,n,r,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,r,i)}update(e,n,r,i){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),lut(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,n){let r="cm-gutterElement",i=this.dom.firstChild;for(let o=0,a=0;;){let s=a,l=oo(s,l,c)||a(s,l,c):a}return r}})}});class DR extends du{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function LR(t,e){return t.state.facet(Jm).formatNumber(e,t.state)}const uut=eb.compute([Jm],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(cut)},lineMarker(e,n,r){return r.some(i=>i.toDOM)?null:new DR(LR(e,e.state.doc.lineAt(n.from).number))},widgetMarker:()=>null,lineMarkerChange:e=>e.startState.facet(Jm)!=e.state.facet(Jm),initialSpacer(e){return new DR(LR(e,U7(e.state.doc.lines)))},updateSpacer(e,n){let r=LR(n.view,U7(n.view.state.doc.lines));return r==e.number?e:new DR(r)},domEventHandlers:t.facet(Jm).domEventHandlers}));function fut(t={}){return[Jm.of(t),qde(),uut]}function U7(t){let e=9;for(;e{let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.head).from;i>n&&(n=i,e.push(dut.range(i)))}return sn.of(e)});function put(){return hut}const Qde=1024;let mut=0;class $R{constructor(e,n){this.from=e,this.to=n}}class Wt{constructor(e={}){this.id=mut++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Wo.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}Wt.closedBy=new Wt({deserialize:t=>t.split(" ")});Wt.openedBy=new Wt({deserialize:t=>t.split(" ")});Wt.group=new Wt({deserialize:t=>t.split(" ")});Wt.isolate=new Wt({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});Wt.contextHash=new Wt({perNode:!0});Wt.lookAhead=new Wt({perNode:!0});Wt.mounted=new Wt({perNode:!0});class hE{constructor(e,n,r){this.tree=e,this.overlay=n,this.parser=r}static get(e){return e&&e.props&&e.props[Wt.mounted.id]}}const gut=Object.create(null);class Wo{constructor(e,n,r,i=0){this.name=e,this.props=n,this.id=r,this.flags=i}static define(e){let n=e.props&&e.props.length?Object.create(null):gut,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new Wo(e.name||"",n,e.id,r);if(e.props){for(let o of e.props)if(Array.isArray(o)||(o=o(i)),o){if(o[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[o[0].id]=o[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(Wt.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let i of r.split(" "))n[i]=e[r];return r=>{for(let i=r.prop(Wt.group),o=-1;o<(i?i.length:0);o++){let a=n[o<0?r.name:i[o]];if(a)return a}}}}Wo.none=new Wo("",Object.create(null),0,8);class p4{constructor(e){this.types=e;for(let n=0;n0;for(let l=this.cursor(a|Zr.IncludeAnonymous);;){let c=!1;if(l.from<=o&&l.to>=i&&(!s&&l.type.isAnonymous||n(l)!==!1)){if(l.firstChild())continue;c=!0}for(;c&&r&&(s||!l.type.isAnonymous)&&r(l),!l.nextSibling();){if(!l.parent())return;c=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:v4(Wo.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new zr(this.type,n,r,i,this.propValues),e.makeTree||((n,r,i)=>new zr(Wo.none,n,r,i)))}static build(e){return but(e)}}zr.empty=new zr(Wo.none,[],[],0);class m4{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new m4(this.buffer,this.index)}}class rd{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return Wo.none}toString(){let e=[];for(let n=0;n0));l=a[l+3]);return s}slice(e,n,r){let i=this.buffer,o=new Uint16Array(n-e),a=0;for(let s=e,l=0;s=e&&ne;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}function i_(t,e,n,r){for(var i;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to0?s.length:-1;e!=c;e+=n){let u=s[e],f=l[e]+a.from;if(Yde(i,r,f,f+u.length)){if(u instanceof rd){if(o&Zr.ExcludeBuffers)continue;let d=u.findChild(0,u.buffer.length,n,r-f,i);if(d>-1)return new Al(new vut(a,u,e,f),null,d)}else if(o&Zr.IncludeAnonymous||!u.type.isAnonymous||g4(u)){let d;if(!(o&Zr.IgnoreMounts)&&(d=hE.get(u))&&!d.overlay)return new Fo(d.tree,f,e,a);let h=new Fo(u,f,e,a);return o&Zr.IncludeAnonymous||!h.type.isAnonymous?h:h.nextChild(n<0?u.children.length-1:0,n,r,i)}}}if(o&Zr.IncludeAnonymous||!a.type.isAnonymous||(a.index>=0?e=a.index+n:e=n<0?-1:a._parent._tree.children.length,a=a._parent,!a))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,n,r=0){let i;if(!(r&Zr.IgnoreOverlays)&&(i=hE.get(this._tree))&&i.overlay){let o=e-this.from;for(let{from:a,to:s}of i.overlay)if((n>0?a<=o:a=o:s>o))return new Fo(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function V7(t,e,n,r){let i=t.cursor(),o=[];if(!i.firstChild())return o;if(n!=null){for(let a=!1;!a;)if(a=i.type.is(n),!i.nextSibling())return o}for(;;){if(r!=null&&i.type.is(r))return o;if(i.type.is(e)&&o.push(i.node),!i.nextSibling())return r==null?o:[]}}function A3(t,e,n=e.length-1){for(let r=t.parent;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}class vut{constructor(e,n,r,i){this.parent=e,this.buffer=n,this.index=r,this.start=i}}class Al extends Kde{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,r){super(),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,n,r){let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.context.start,r);return o<0?null:new Al(this.context,this,o)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,n,r=0){if(r&Zr.ExcludeBuffers)return null;let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return o<0?null:new Al(this.context,this,o)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Al(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new Al(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,i=this.index+4,o=r.buffer[this.index+3];if(o>i){let a=r.buffer[this.index+1];e.push(r.slice(i,o,a)),n.push(0)}return new zr(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Zde(t){if(!t.length)return null;let e=0,n=t[0];for(let o=1;on.from||a.to=e){let s=new Fo(a.tree,a.overlay[0].from+o.from,-1,o);(i||(i=[r])).push(i_(s,e,n,!1))}}return i?Zde(i):r}class R3{get name(){return this.type.name}constructor(e,n=0){if(this.mode=n,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Fo)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof Fo?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:i}=this.buffer,o=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.buffer.start,r);return o<0?!1:(this.stack.push(this.index),this.yieldBuf(o))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,r=this.mode){return this.buffer?r&Zr.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Zr.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Zr.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,r,{buffer:i}=this;if(i){if(e>0){if(this.index-1)for(let o=n+e,a=e<0?-1:r._tree.children.length;o!=a;o+=e){let s=r._tree.children[o];if(this.mode&Zr.IncludeAnonymous||s instanceof rd||!s.type.isAnonymous||g4(s))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to=0;){for(let a=e;a;a=a._parent)if(a.index==i){if(i==this.index)return a;n=a,r=o+1;break e}i=this.stack[--o]}for(let i=r;i=0;o--){if(o<0)return A3(this.node,e,i);let a=r[n.buffer[this.stack[o]]];if(!a.isAnonymous){if(e[i]&&e[i]!=a.name)return!1;i--}}return!0}}function g4(t){return t.children.some(e=>e instanceof rd||!e.type.isAnonymous||g4(e))}function but(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:i=Qde,reused:o=[],minRepeatType:a=r.types.length}=t,s=Array.isArray(n)?new m4(n,n.length):n,l=r.types,c=0,u=0;function f(_,S,O,C,E,k){let{id:I,start:P,end:R,size:T}=s,L=u;for(;T<0;)if(s.next(),T==-1){let N=o[I];O.push(N),C.push(P-_);return}else if(T==-3){c=I;return}else if(T==-4){u=I;return}else throw new RangeError(`Unrecognized record size: ${T}`);let z=l[I],B,W,U=P-_;if(R-P<=i&&(W=g(s.pos-S,E))){let N=new Uint16Array(W.size-W.skip),$=s.pos-W.size,D=N.length;for(;s.pos>$;)D=v(W.start,N,D);B=new rd(N,R-W.start,r),U=W.start-_}else{let N=s.pos-T;s.next();let $=[],D=[],A=I>=a?I:-1,q=0,Y=R;for(;s.pos>N;)A>=0&&s.id==A&&s.size>=0?(s.end<=Y-i&&(p($,D,P,q,s.end,Y,A,L),q=$.length,Y=s.end),s.next()):k>2500?d(P,N,$,D):f(P,N,$,D,A,k+1);if(A>=0&&q>0&&q<$.length&&p($,D,P,q,P,Y,A,L),$.reverse(),D.reverse(),A>-1&&q>0){let K=h(z);B=v4(z,$,D,0,$.length,0,R-P,K,K)}else B=m(z,$,D,R-P,L-R)}O.push(B),C.push(U)}function d(_,S,O,C){let E=[],k=0,I=-1;for(;s.pos>S;){let{id:P,start:R,end:T,size:L}=s;if(L>4)s.next();else{if(I>-1&&R=0;T-=3)P[L++]=E[T],P[L++]=E[T+1]-R,P[L++]=E[T+2]-R,P[L++]=L;O.push(new rd(P,E[2]-R,r)),C.push(R-_)}}function h(_){return(S,O,C)=>{let E=0,k=S.length-1,I,P;if(k>=0&&(I=S[k])instanceof zr){if(!k&&I.type==_&&I.length==C)return I;(P=I.prop(Wt.lookAhead))&&(E=O[k]+I.length+P)}return m(_,S,O,C,E)}}function p(_,S,O,C,E,k,I,P){let R=[],T=[];for(;_.length>C;)R.push(_.pop()),T.push(S.pop()+O-E);_.push(m(r.types[I],R,T,k-E,P-k)),S.push(E-O)}function m(_,S,O,C,E=0,k){if(c){let I=[Wt.contextHash,c];k=k?[I].concat(k):[I]}if(E>25){let I=[Wt.lookAhead,E];k=k?[I].concat(k):[I]}return new zr(_,S,O,C,k)}function g(_,S){let O=s.fork(),C=0,E=0,k=0,I=O.end-i,P={size:0,start:0,skip:0};e:for(let R=O.pos-_;O.pos>R;){let T=O.size;if(O.id==S&&T>=0){P.size=C,P.start=E,P.skip=k,k+=4,C+=4,O.next();continue}let L=O.pos-T;if(T<0||L=a?4:0,B=O.start;for(O.next();O.pos>L;){if(O.size<0)if(O.size==-3)z+=4;else break e;else O.id>=a&&(z+=4);O.next()}E=B,C+=T,k+=z}return(S<0||C==_)&&(P.size=C,P.start=E,P.skip=k),P.size>4?P:void 0}function v(_,S,O){let{id:C,start:E,end:k,size:I}=s;if(s.next(),I>=0&&C4){let R=s.pos-(I-4);for(;s.pos>R;)O=v(_,S,O)}S[--O]=P,S[--O]=k-_,S[--O]=E-_,S[--O]=C}else I==-3?c=C:I==-4&&(u=C);return O}let y=[],x=[];for(;s.pos>0;)f(t.start||0,t.bufferStart||0,y,x,-1,0);let b=(e=t.length)!==null&&e!==void 0?e:y.length?x[0]+y[0].length:0;return new zr(l[t.topID],y.reverse(),x.reverse(),b)}const G7=new WeakMap;function FC(t,e){if(!t.isAnonymous||e instanceof rd||e.type!=t)return 1;let n=G7.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof zr)){n=1;break}n+=FC(t,r)}G7.set(e,n)}return n}function v4(t,e,n,r,i,o,a,s,l){let c=0;for(let p=r;p=u)break;S+=O}if(x==b+1){if(S>u){let O=p[b];h(O.children,O.positions,0,O.children.length,m[b]+y);continue}f.push(p[b])}else{let O=m[x-1]+p[x-1].length-_;f.push(v4(t,p,m,b,x,_,O,null,l))}d.push(_+y-o)}}return h(e,n,r,i,0),(s||l)(f,d,a)}class _ut{constructor(){this.map=new WeakMap}setBuffer(e,n,r){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(n,r)}getBuffer(e,n){let r=this.map.get(e);return r&&r.get(n)}set(e,n){e instanceof Al?this.setBuffer(e.context.buffer,e.index,n):e instanceof Fo&&this.map.set(e.tree,n)}get(e){return e instanceof Al?this.getBuffer(e.context.buffer,e.index):e instanceof Fo?this.map.get(e.tree):void 0}cursorSet(e,n){e.buffer?this.setBuffer(e.buffer.buffer,e.index,n):this.map.set(e.tree,n)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Nh{constructor(e,n,r,i,o=!1,a=!1){this.from=e,this.to=n,this.tree=r,this.offset=i,this.open=(o?1:0)|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let i=[new Nh(0,e.length,e,0,!1,r)];for(let o of n)o.to>e.length&&i.push(o);return i}static applyChanges(e,n,r=128){if(!n.length)return e;let i=[],o=1,a=e.length?e[0]:null;for(let s=0,l=0,c=0;;s++){let u=s=r)for(;a&&a.from=d.from||f<=d.to||c){let h=Math.max(d.from,l)-c,p=Math.min(d.to,f)-c;d=h>=p?null:new Nh(h,p,d.tree,d.offset+c,s>0,!!u)}if(d&&i.push(d),a.to>f)break;a=onew $R(i.from,i.to)):[new $R(0,0)]:[new $R(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let i=this.startParse(e,n,r);for(;;){let o=i.advance();if(o)return o}}}class wut{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}new Wt({perNode:!0});let Sut=0;class yl{constructor(e,n,r){this.set=e,this.base=n,this.modified=r,this.id=Sut++}static define(e){if(e!=null&&e.base)throw new Error("Can not derive from a modified tag");let n=new yl([],null,[]);if(n.set.push(n),e)for(let r of e.set)n.set.push(r);return n}static defineModifier(){let e=new pE;return n=>n.modified.indexOf(e)>-1?n:pE.get(n.base||n,n.modified.concat(e).sort((r,i)=>r.id-i.id))}}let Out=0;class pE{constructor(){this.instances=[],this.id=Out++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(s=>s.base==e&&Cut(n,s.modified));if(r)return r;let i=[],o=new yl(i,e,n);for(let s of n)s.instances.push(o);let a=Tut(n);for(let s of e.set)if(!s.modified.length)for(let l of a)i.push(pE.get(s,l));return o}}function Cut(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function Tut(t){let e=[[]];for(let n=0;nr.length-n.length)}function y4(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let o=[],a=2,s=i;for(let f=0;;){if(s=="..."&&f>0&&f+3==i.length){a=1;break}let d=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(s);if(!d)throw new RangeError("Invalid path: "+i);if(o.push(d[0]=="*"?"":d[0][0]=='"'?JSON.parse(d[0]):d[0]),f+=d[0].length,f==i.length)break;let h=i[f++];if(f==i.length&&h=="!"){a=0;break}if(h!="/")throw new RangeError("Invalid path: "+i);s=i.slice(f)}let l=o.length-1,c=o[l];if(!c)throw new RangeError("Invalid path: "+i);let u=new mE(r,a,l>0?o.slice(0,l):null);e[c]=u.sort(e[c])}}return ehe.add(e)}const ehe=new Wt;class mE{constructor(e,n,r,i){this.tags=e,this.mode=n,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let a=i;for(let s of o)for(let l of s.set){let c=n[l.id];if(c){a=a?a+" "+c:c;break}}return a},scope:r}}function Eut(t,e){let n=null;for(let r of t){let i=r.style(e);i&&(n=n?n+" "+i:i)}return n}function Put(t,e,n,r=0,i=t.length){let o=new Mut(r,Array.isArray(e)?e:[e],n);o.highlightRange(t.cursor(),r,i,"",o.highlighters),o.flush(i)}class Mut{constructor(e,n,r){this.at=e,this.highlighters=n,this.span=r,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,r,i,o){let{type:a,from:s,to:l}=e;if(s>=r||l<=n)return;a.isTop&&(o=this.highlighters.filter(h=>!h.scope||h.scope(a)));let c=i,u=kut(e)||mE.empty,f=Eut(o,u.tags);if(f&&(c&&(c+=" "),c+=f,u.mode==1&&(i+=(i?" ":"")+f)),this.startSpan(Math.max(n,s),c),u.opaque)return;let d=e.tree&&e.tree.prop(Wt.mounted);if(d&&d.overlay){let h=e.node.enter(d.overlay[0].from+s,1),p=this.highlighters.filter(g=>!g.scope||g.scope(d.tree.type)),m=e.firstChild();for(let g=0,v=s;;g++){let y=g=x||!e.nextSibling())););if(!y||x>r)break;v=y.to+s,v>n&&(this.highlightRange(h.cursor(),Math.max(n,y.from+s),Math.min(r,v),"",p),this.startSpan(Math.min(r,v),c))}m&&e.parent()}else if(e.firstChild()){d&&(i="");do if(!(e.to<=n)){if(e.from>=r)break;this.highlightRange(e,n,r,i,o),this.startSpan(Math.min(r,e.to),c)}while(e.nextSibling());e.parent()}}}function kut(t){let e=t.type.prop(ehe);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const et=yl.define,ZS=et(),of=et(),H7=et(of),q7=et(of),af=et(),JS=et(af),NR=et(af),cl=et(),Nd=et(cl),sl=et(),ll=et(),I3=et(),k0=et(I3),eO=et(),Te={comment:ZS,lineComment:et(ZS),blockComment:et(ZS),docComment:et(ZS),name:of,variableName:et(of),typeName:H7,tagName:et(H7),propertyName:q7,attributeName:et(q7),className:et(of),labelName:et(of),namespace:et(of),macroName:et(of),literal:af,string:JS,docString:et(JS),character:et(JS),attributeValue:et(JS),number:NR,integer:et(NR),float:et(NR),bool:et(af),regexp:et(af),escape:et(af),color:et(af),url:et(af),keyword:sl,self:et(sl),null:et(sl),atom:et(sl),unit:et(sl),modifier:et(sl),operatorKeyword:et(sl),controlKeyword:et(sl),definitionKeyword:et(sl),moduleKeyword:et(sl),operator:ll,derefOperator:et(ll),arithmeticOperator:et(ll),logicOperator:et(ll),bitwiseOperator:et(ll),compareOperator:et(ll),updateOperator:et(ll),definitionOperator:et(ll),typeOperator:et(ll),controlOperator:et(ll),punctuation:I3,separator:et(I3),bracket:k0,angleBracket:et(k0),squareBracket:et(k0),paren:et(k0),brace:et(k0),content:cl,heading:Nd,heading1:et(Nd),heading2:et(Nd),heading3:et(Nd),heading4:et(Nd),heading5:et(Nd),heading6:et(Nd),contentSeparator:et(cl),list:et(cl),quote:et(cl),emphasis:et(cl),strong:et(cl),link:et(cl),monospace:et(cl),strikethrough:et(cl),inserted:et(),deleted:et(),changed:et(),invalid:et(),meta:eO,documentMeta:et(eO),annotation:et(eO),processingInstruction:et(eO),definition:yl.defineModifier(),constant:yl.defineModifier(),function:yl.defineModifier(),standard:yl.defineModifier(),local:yl.defineModifier(),special:yl.defineModifier()};the([{tag:Te.link,class:"tok-link"},{tag:Te.heading,class:"tok-heading"},{tag:Te.emphasis,class:"tok-emphasis"},{tag:Te.strong,class:"tok-strong"},{tag:Te.keyword,class:"tok-keyword"},{tag:Te.atom,class:"tok-atom"},{tag:Te.bool,class:"tok-bool"},{tag:Te.url,class:"tok-url"},{tag:Te.labelName,class:"tok-labelName"},{tag:Te.inserted,class:"tok-inserted"},{tag:Te.deleted,class:"tok-deleted"},{tag:Te.literal,class:"tok-literal"},{tag:Te.string,class:"tok-string"},{tag:Te.number,class:"tok-number"},{tag:[Te.regexp,Te.escape,Te.special(Te.string)],class:"tok-string2"},{tag:Te.variableName,class:"tok-variableName"},{tag:Te.local(Te.variableName),class:"tok-variableName tok-local"},{tag:Te.definition(Te.variableName),class:"tok-variableName tok-definition"},{tag:Te.special(Te.variableName),class:"tok-variableName2"},{tag:Te.definition(Te.propertyName),class:"tok-propertyName tok-definition"},{tag:Te.typeName,class:"tok-typeName"},{tag:Te.namespace,class:"tok-namespace"},{tag:Te.className,class:"tok-className"},{tag:Te.macroName,class:"tok-macroName"},{tag:Te.propertyName,class:"tok-propertyName"},{tag:Te.operator,class:"tok-operator"},{tag:Te.comment,class:"tok-comment"},{tag:Te.meta,class:"tok-meta"},{tag:Te.invalid,class:"tok-invalid"},{tag:Te.punctuation,class:"tok-punctuation"}]);var FR;const eg=new Wt;function Aut(t){return ft.define({combine:t?e=>e.concat(t):void 0})}const Rut=new Wt;class Ws{constructor(e,n,r=[],i=""){this.data=e,this.name=i,en.prototype.hasOwnProperty("tree")||Object.defineProperty(en.prototype,"tree",{get(){return ui(this)}}),this.parser=n,this.extension=[id.of(this),en.languageData.of((o,a,s)=>{let l=X7(o,a,s),c=l.type.prop(eg);if(!c)return[];let u=o.facet(c),f=l.type.prop(Rut);if(f){let d=l.resolve(a-l.from,s);for(let h of f)if(h.test(d,o)){let p=o.facet(h.facet);return h.type=="replace"?p:p.concat(u)}}return u})].concat(r)}isActiveAt(e,n,r=-1){return X7(e,n,r).type.prop(eg)==this.data}findRegions(e){let n=e.facet(id);if((n==null?void 0:n.data)==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],i=(o,a)=>{if(o.prop(eg)==this.data){r.push({from:a,to:a+o.length});return}let s=o.prop(Wt.mounted);if(s){if(s.tree.prop(eg)==this.data){if(s.overlay)for(let l of s.overlay)r.push({from:l.from+a,to:l.to+a});else r.push({from:a,to:a+o.length});return}else if(s.overlay){let l=r.length;if(i(s.tree,s.overlay[0].from+a),r.length>l)return}}for(let l=0;lr.isTop?n:void 0)]}),e.name)}configure(e,n){return new o_(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function ui(t){let e=t.field(Ws.state,!1);return e?e.tree:zr.empty}class Iut{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let r=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-r,n-r)}}let A0=null;class gE{constructor(e,n,r=[],i,o,a,s,l){this.parser=e,this.state=n,this.fragments=r,this.tree=i,this.treeLen=o,this.viewport=a,this.skipped=s,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new gE(e,n,[],zr.empty,0,r,[],null)}startParse(){return this.parser.startParse(new Iut(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=zr.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(Nh.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=A0;A0=this;try{return e()}finally{A0=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=Q7(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:i,treeLen:o,viewport:a,skipped:s}=this;if(this.takeTree(),!e.empty){let l=[];if(e.iterChangedRanges((c,u,f,d)=>l.push({fromA:c,toA:u,fromB:f,toB:d})),r=Nh.applyChanges(r,l),i=zr.empty,o=0,a={from:e.mapPos(a.from,-1),to:e.mapPos(a.to,1)},this.skipped.length){s=[];for(let c of this.skipped){let u=e.mapPos(c.from,1),f=e.mapPos(c.to,-1);ue.from&&(this.fragments=Q7(this.fragments,i,o),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends Jde{createParse(n,r,i){let o=i[0].from,a=i[i.length-1].to;return{parsedPos:o,advance(){let l=A0;if(l){for(let c of i)l.tempSkipped.push(c);e&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,e]):e)}return this.parsedPos=a,new zr(Wo.none,[],[],a-o)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return A0}}function Q7(t,e,n){return Nh.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class lv{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new lv(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=gE.create(e.facet(id).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new lv(r)}}Ws.state=pi.define({create:lv.init,update(t,e){for(let n of e.effects)if(n.is(Ws.setState))return n.value;return e.startState.facet(id)!=e.state.facet(id)?lv.init(e.state):t.apply(e)}});let nhe=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(nhe=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const jR=typeof navigator<"u"&&(!((FR=navigator.scheduling)===null||FR===void 0)&&FR.isInputPending)?()=>navigator.scheduling.isInputPending():null,Dut=Mr.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(Ws.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(Ws.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=nhe(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEndi+1e3,l=o.context.work(()=>jR&&jR()||Date.now()>a,i+(s?0:1e5));this.chunkBudget-=Date.now()-n,(l||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:Ws.setState.of(new lv(o.context))})),this.chunkBudget>0&&!(l&&!s)&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>ko(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),id=ft.define({combine(t){return t.length?t[0]:null},enables:t=>[Ws.state,Dut,rt.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class rhe{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}const Lut=ft.define(),dw=ft.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function vE(t){let e=t.facet(dw);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function a_(t,e){let n="",r=t.tabSize,i=t.facet(dw)[0];if(i==" "){for(;e>=r;)n+=" ",e-=r;i=" "}for(let o=0;o=e?$ut(t,n,e):null}class A2{constructor(e,n={}){this.state=e,this.options=n,this.unit=vE(e)}lineAt(e,n=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:o}=this.options;return i!=null&&i>=r.from&&i<=r.to?o&&i==e?{text:"",from:e}:(n<0?i-1&&(o+=a-this.countColumn(r,r.search(/\S|$/))),o}countColumn(e,n=e.length){return Cy(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:r,from:i}=this.lineAt(e,n),o=this.options.overrideIndentation;if(o){let a=o(i);if(a>-1)return a}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const b4=new Wt;function $ut(t,e,n){let r=e.resolveStack(n),i=r.node.enterUnfinishedNodesBefore(n);if(i!=r.node){let o=[];for(let a=i;a!=r.node;a=a.parent)o.push(a);for(let a=o.length-1;a>=0;a--)r={node:o[a],next:r}}return ihe(r,t,n)}function ihe(t,e,n){for(let r=t;r;r=r.next){let i=Fut(r.node);if(i)return i(_4.create(e,n,r))}return 0}function Nut(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function Fut(t){let e=t.type.prop(b4);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(Wt.closedBy))){let i=t.lastChild,o=i&&r.indexOf(i.name)>-1;return a=>ohe(a,!0,1,void 0,o&&!Nut(a)?i.from:void 0)}return t.parent==null?jut:null}function jut(){return 0}class _4 extends A2{constructor(e,n,r){super(e.state,e.options),this.base=e,this.pos=n,this.context=r}get node(){return this.context.node}static create(e,n,r){return new _4(e,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(But(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return ihe(this.context.next,this.base,this.pos)}}function But(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function zut(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let i=t.options.simulateBreak,o=t.state.doc.lineAt(n.from),a=i==null||i<=o.from?o.to:Math.min(o.to,i);for(let s=n.to;;){let l=e.childAfter(s);if(!l||l==r)return null;if(!l.type.isSkipped)return l.fromohe(r,e,n,t)}function ohe(t,e,n,r,i){let o=t.textAfter,a=o.match(/^\s*/)[0].length,s=r&&o.slice(a,a+r.length)==r||i==t.pos+a,l=e?zut(t):null;return l?s?t.column(l.from):t.column(l.to):t.baseIndent+(s?0:t.unit*n)}function Y7({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const Uut=200;function Wut(){return en.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let n=t.newDoc,{head:r}=t.newSelection.main,i=n.lineAt(r);if(r>i.from+Uut)return t;let o=n.sliceString(i.from,r);if(!e.some(c=>c.test(o)))return t;let{state:a}=t,s=-1,l=[];for(let{head:c}of a.selection.ranges){let u=a.doc.lineAt(c);if(u.from==s)continue;s=u.from;let f=x4(a,u.from);if(f==null)continue;let d=/^\s*/.exec(u.text)[0],h=a_(a,f);d!=h&&l.push({from:u.from,to:u.from+d.length,insert:h})}return l.length?[t,{changes:l,sequential:!0}]:t})}const Vut=ft.define(),w4=new Wt;function ahe(t){let e=t.firstChild,n=t.lastChild;return e&&e.ton)continue;if(o&&s.from=e&&c.to>n&&(o=c)}}return o}function Hut(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function yE(t,e,n){for(let r of t.facet(Vut)){let i=r(t,e,n);if(i)return i}return Gut(t,e,n)}function she(t,e){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);return n>=r?void 0:{from:n,to:r}}const R2=It.define({map:she}),hw=It.define({map:she});function lhe(t){let e=[];for(let{head:n}of t.state.selection.ranges)e.some(r=>r.from<=n&&r.to>=n)||e.push(t.lineBlockAt(n));return e}const ip=pi.define({create(){return yt.none},update(t,e){t=t.map(e.changes);for(let n of e.effects)if(n.is(R2)&&!qut(t,n.value.from,n.value.to)){let{preparePlaceholder:r}=e.state.facet(S4),i=r?yt.replace({widget:new eft(r(e.state,n.value))}):K7;t=t.update({add:[i.range(n.value.from,n.value.to)]})}else n.is(hw)&&(t=t.update({filter:(r,i)=>n.value.from!=r||n.value.to!=i,filterFrom:n.value.from,filterTo:n.value.to}));if(e.selection){let n=!1,{head:r}=e.selection.main;t.between(r,r,(i,o)=>{ir&&(n=!0)}),n&&(t=t.update({filterFrom:r,filterTo:r,filter:(i,o)=>o<=r||i>=r}))}return t},provide:t=>rt.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,(r,i)=>{n.push(r,i)}),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n{(!i||i.from>o)&&(i={from:o,to:a})}),i}function qut(t,e,n){let r=!1;return t.between(e,e,(i,o)=>{i==e&&o==n&&(r=!0)}),r}function che(t,e){return t.field(ip,!1)?e:e.concat(It.appendConfig.of(fhe()))}const Xut=t=>{for(let e of lhe(t)){let n=yE(t.state,e.from,e.to);if(n)return t.dispatch({effects:che(t.state,[R2.of(n),uhe(t,n)])}),!0}return!1},Qut=t=>{if(!t.state.field(ip,!1))return!1;let e=[];for(let n of lhe(t)){let r=xE(t.state,n.from,n.to);r&&e.push(hw.of(r),uhe(t,r,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function uhe(t,e,n=!0){let r=t.state.doc.lineAt(e.from).number,i=t.state.doc.lineAt(e.to).number;return rt.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${t.state.phrase("to")} ${i}.`)}const Yut=t=>{let{state:e}=t,n=[];for(let r=0;r{let e=t.state.field(ip,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,(r,i)=>{n.push(hw.of({from:r,to:i}))}),t.dispatch({effects:n}),!0},Zut=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:Xut},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:Qut},{key:"Ctrl-Alt-[",run:Yut},{key:"Ctrl-Alt-]",run:Kut}],Jut={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},S4=ft.define({combine(t){return ac(t,Jut)}});function fhe(t){let e=[ip,rft];return t&&e.push(S4.of(t)),e}function dhe(t,e){let{state:n}=t,r=n.facet(S4),i=a=>{let s=t.lineBlockAt(t.posAtDOM(a.target)),l=xE(t.state,s.from,s.to);l&&t.dispatch({effects:hw.of(l)}),a.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(t,i,e);let o=document.createElement("span");return o.textContent=r.placeholderText,o.setAttribute("aria-label",n.phrase("folded code")),o.title=n.phrase("unfold"),o.className="cm-foldPlaceholder",o.onclick=i,o}const K7=yt.replace({widget:new class extends sc{toDOM(t){return dhe(t,null)}}});class eft extends sc{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return dhe(e,this.value)}}const tft={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class zR extends du{constructor(e,n){super(),this.config=e,this.open=n}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=e.state.phrase(this.open?"Fold line":"Unfold line"),n}}function nft(t={}){let e=Object.assign(Object.assign({},tft),t),n=new zR(e,!0),r=new zR(e,!1),i=Mr.fromClass(class{constructor(a){this.from=a.viewport.from,this.markers=this.buildMarkers(a)}update(a){(a.docChanged||a.viewportChanged||a.startState.facet(id)!=a.state.facet(id)||a.startState.field(ip,!1)!=a.state.field(ip,!1)||ui(a.startState)!=ui(a.state)||e.foldingChanged(a))&&(this.markers=this.buildMarkers(a.view))}buildMarkers(a){let s=new Jf;for(let l of a.viewportLineBlocks){let c=xE(a.state,l.from,l.to)?r:yE(a.state,l.from,l.to)?n:null;c&&s.add(l.from,l.from,c)}return s.finish()}}),{domEventHandlers:o}=e;return[i,out({class:"cm-foldGutter",markers(a){var s;return((s=a.plugin(i))===null||s===void 0?void 0:s.markers)||sn.empty},initialSpacer(){return new zR(e,!1)},domEventHandlers:Object.assign(Object.assign({},o),{click:(a,s,l)=>{if(o.click&&o.click(a,s,l))return!0;let c=xE(a.state,s.from,s.to);if(c)return a.dispatch({effects:hw.of(c)}),!0;let u=yE(a.state,s.from,s.to);return u?(a.dispatch({effects:R2.of(u)}),!0):!1}})}),fhe()]}const rft=rt.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class pw{constructor(e,n){this.specs=e;let r;function i(s){let l=ed.newName();return(r||(r=Object.create(null)))["."+l]=s,l}const o=typeof n.all=="string"?n.all:n.all?i(n.all):void 0,a=n.scope;this.scope=a instanceof Ws?s=>s.prop(eg)==a.data:a?s=>s==a:void 0,this.style=the(e.map(s=>({tag:s.tag,class:s.class||i(Object.assign({},s,{tag:null}))})),{all:o}).style,this.module=r?new ed(r):null,this.themeType=n.themeType}static define(e,n){return new pw(e,n||{})}}const D3=ft.define(),hhe=ft.define({combine(t){return t.length?[t[0]]:null}});function UR(t){let e=t.facet(D3);return e.length?e:t.facet(hhe)}function phe(t,e){let n=[oft],r;return t instanceof pw&&(t.module&&n.push(rt.styleModule.of(t.module)),r=t.themeType),e!=null&&e.fallback?n.push(hhe.of(t)):r?n.push(D3.computeN([rt.darkTheme],i=>i.facet(rt.darkTheme)==(r=="dark")?[t]:[])):n.push(D3.of(t)),n}class ift{constructor(e){this.markCache=Object.create(null),this.tree=ui(e.state),this.decorations=this.buildDeco(e,UR(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=ui(e.state),r=UR(e.state),i=r!=UR(e.startState),{viewport:o}=e.view,a=e.changes.mapPos(this.decoratedTo,1);n.length=o.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=a):(n!=this.tree||e.viewportChanged||i)&&(this.tree=n,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=o.to)}buildDeco(e,n){if(!n||!this.tree.length)return yt.none;let r=new Jf;for(let{from:i,to:o}of e.visibleRanges)Put(this.tree,n,(a,s,l)=>{r.add(a,s,this.markCache[l]||(this.markCache[l]=yt.mark({class:l})))},i,o);return r.finish()}}const oft=bd.high(Mr.fromClass(ift,{decorations:t=>t.decorations})),aft=pw.define([{tag:Te.meta,color:"#404740"},{tag:Te.link,textDecoration:"underline"},{tag:Te.heading,textDecoration:"underline",fontWeight:"bold"},{tag:Te.emphasis,fontStyle:"italic"},{tag:Te.strong,fontWeight:"bold"},{tag:Te.strikethrough,textDecoration:"line-through"},{tag:Te.keyword,color:"#708"},{tag:[Te.atom,Te.bool,Te.url,Te.contentSeparator,Te.labelName],color:"#219"},{tag:[Te.literal,Te.inserted],color:"#164"},{tag:[Te.string,Te.deleted],color:"#a11"},{tag:[Te.regexp,Te.escape,Te.special(Te.string)],color:"#e40"},{tag:Te.definition(Te.variableName),color:"#00f"},{tag:Te.local(Te.variableName),color:"#30a"},{tag:[Te.typeName,Te.namespace],color:"#085"},{tag:Te.className,color:"#167"},{tag:[Te.special(Te.variableName),Te.macroName],color:"#256"},{tag:Te.definition(Te.propertyName),color:"#00c"},{tag:Te.comment,color:"#940"},{tag:Te.invalid,color:"#f00"}]),sft=rt.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),mhe=1e4,ghe="()[]{}",vhe=ft.define({combine(t){return ac(t,{afterCursor:!0,brackets:ghe,maxScanDistance:mhe,renderMatch:uft})}}),lft=yt.mark({class:"cm-matchingBracket"}),cft=yt.mark({class:"cm-nonmatchingBracket"});function uft(t){let e=[],n=t.matched?lft:cft;return e.push(n.range(t.start.from,t.start.to)),t.end&&e.push(n.range(t.end.from,t.end.to)),e}const fft=pi.define({create(){return yt.none},update(t,e){if(!e.docChanged&&!e.selection)return t;let n=[],r=e.state.facet(vhe);for(let i of e.state.selection.ranges){if(!i.empty)continue;let o=Rl(e.state,i.head,-1,r)||i.head>0&&Rl(e.state,i.head-1,1,r)||r.afterCursor&&(Rl(e.state,i.head,1,r)||i.headrt.decorations.from(t)}),dft=[fft,sft];function hft(t={}){return[vhe.of(t),dft]}const pft=new Wt;function L3(t,e,n){let r=t.prop(e<0?Wt.openedBy:Wt.closedBy);if(r)return r;if(t.name.length==1){let i=n.indexOf(t.name);if(i>-1&&i%2==(e<0?1:0))return[n[i+e]]}return null}function $3(t){let e=t.type.prop(pft);return e?e(t.node):t}function Rl(t,e,n,r={}){let i=r.maxScanDistance||mhe,o=r.brackets||ghe,a=ui(t),s=a.resolveInner(e,n);for(let l=s;l;l=l.parent){let c=L3(l.type,n,o);if(c&&l.from0?e>=u.from&&eu.from&&e<=u.to))return mft(t,e,n,l,u,c,o)}}return gft(t,e,n,a,s.type,i,o)}function mft(t,e,n,r,i,o,a){let s=r.parent,l={from:i.from,to:i.to},c=0,u=s==null?void 0:s.cursor();if(u&&(n<0?u.childBefore(r.from):u.childAfter(r.to)))do if(n<0?u.to<=r.from:u.from>=r.to){if(c==0&&o.indexOf(u.type.name)>-1&&u.from0)return null;let c={from:n<0?e-1:e,to:n>0?e+1:e},u=t.doc.iterRange(e,n>0?t.doc.length:0),f=0;for(let d=0;!u.next().done&&d<=o;){let h=u.value;n<0&&(d+=h.length);let p=e+d*n;for(let m=n>0?0:h.length-1,g=n>0?h.length:-1;m!=g;m+=n){let v=a.indexOf(h[m]);if(!(v<0||r.resolveInner(p+m,1).type!=i))if(v%2==0==n>0)f++;else{if(f==1)return{start:c,end:{from:p+m,to:p+m+1},matched:v>>1==l>>1};f--}}n>0&&(d+=h.length)}return u.done?{start:c,matched:!1}:null}const vft=Object.create(null),Z7=[Wo.none],J7=[],eq=Object.create(null),yft=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])yft[t]=xft(vft,e);function WR(t,e){J7.indexOf(t)>-1||(J7.push(t),console.warn(e))}function xft(t,e){let n=[];for(let s of e.split(" ")){let l=[];for(let c of s.split(".")){let u=t[c]||Te[c];u?typeof u=="function"?l.length?l=l.map(u):WR(c,`Modifier ${c} used at start of tag`):l.length?WR(c,`Tag ${c} used as modifier`):l=Array.isArray(u)?u:[u]:WR(c,`Unknown highlighting tag ${c}`)}for(let c of l)n.push(c)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+n.map(s=>s.id),o=eq[i];if(o)return o.id;let a=eq[i]=Wo.define({id:Z7.length,name:r,props:[y4({[r]:n})]});return Z7.push(a),a.id}nr.RTL,nr.LTR;const bft=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=C4(t.state,n.from);return r.line?_ft(t):r.block?Sft(t):!1};function O4(t,e){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=t(e,n);return i?(r(n.update(i)),!0):!1}}const _ft=O4(Tft,0),wft=O4(yhe,0),Sft=O4((t,e)=>yhe(t,e,Cft(e)),0);function C4(t,e){let n=t.languageDataAt("commentTokens",e);return n.length?n[0]:{}}const R0=50;function Oft(t,{open:e,close:n},r,i){let o=t.sliceDoc(r-R0,r),a=t.sliceDoc(i,i+R0),s=/\s*$/.exec(o)[0].length,l=/^\s*/.exec(a)[0].length,c=o.length-s;if(o.slice(c-e.length,c)==e&&a.slice(l,l+n.length)==n)return{open:{pos:r-s,margin:s&&1},close:{pos:i+l,margin:l&&1}};let u,f;i-r<=2*R0?u=f=t.sliceDoc(r,i):(u=t.sliceDoc(r,r+R0),f=t.sliceDoc(i-R0,i));let d=/^\s*/.exec(u)[0].length,h=/\s*$/.exec(f)[0].length,p=f.length-h-n.length;return u.slice(d,d+e.length)==e&&f.slice(p,p+n.length)==n?{open:{pos:r+d+e.length,margin:/\s/.test(u.charAt(d+e.length))?1:0},close:{pos:i-h-n.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function Cft(t){let e=[];for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),i=n.to<=r.to?r:t.doc.lineAt(n.to),o=e.length-1;o>=0&&e[o].to>r.from?e[o].to=i.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return e}function yhe(t,e,n=e.selection.ranges){let r=n.map(o=>C4(e,o.from).block);if(!r.every(o=>o))return null;let i=n.map((o,a)=>Oft(e,r[a],o.from,o.to));if(t!=2&&!i.every(o=>o))return{changes:e.changes(n.map((o,a)=>i[a]?[]:[{from:o.from,insert:r[a].open+" "},{from:o.to,insert:" "+r[a].close}]))};if(t!=1&&i.some(o=>o)){let o=[];for(let a=0,s;ai&&(o==a||a>f.from)){i=f.from;let d=/^\s*/.exec(f.text)[0].length,h=d==f.length,p=f.text.slice(d,d+c.length)==c?d:-1;do.comment<0&&(!o.empty||o.single))){let o=[];for(let{line:s,token:l,indent:c,empty:u,single:f}of r)(f||!u)&&o.push({from:s.from+c,insert:l+" "});let a=e.changes(o);return{changes:a,selection:e.selection.map(a,1)}}else if(t!=1&&r.some(o=>o.comment>=0)){let o=[];for(let{line:a,comment:s,token:l}of r)if(s>=0){let c=a.from+s,u=c+l.length;a.text[u-a.from]==" "&&u++,o.push({from:c,to:u})}return{changes:o}}return null}const N3=oc.define(),Eft=oc.define(),Pft=ft.define(),xhe=ft.define({combine(t){return ac(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(r,i)=>e(r,i)||n(r,i)})}}),bhe=pi.define({create(){return Il.empty},update(t,e){let n=e.state.facet(xhe),r=e.annotation(N3);if(r){let l=Ao.fromTransaction(e,r.selection),c=r.side,u=c==0?t.undone:t.done;return l?u=bE(u,u.length,n.minDepth,l):u=She(u,e.startState.selection),new Il(c==0?r.rest:u,c==0?u:r.rest)}let i=e.annotation(Eft);if((i=="full"||i=="before")&&(t=t.isolate()),e.annotation(Br.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let o=Ao.fromTransaction(e),a=e.annotation(Br.time),s=e.annotation(Br.userEvent);return o?t=t.addChanges(o,a,s,n,e):e.selection&&(t=t.addSelection(e.startState.selection,a,s,n.newGroupDelay)),(i=="full"||i=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new Il(t.done.map(Ao.fromJSON),t.undone.map(Ao.fromJSON))}});function Mft(t={}){return[bhe,xhe.of(t),rt.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?_he:e.inputType=="historyRedo"?F3:null;return r?(e.preventDefault(),r(n)):!1}})]}function I2(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let i=n.field(bhe,!1);if(!i)return!1;let o=i.pop(t,n,e);return o?(r(o),!0):!1}}const _he=I2(0,!1),F3=I2(1,!1),kft=I2(0,!0),Aft=I2(1,!0);class Ao{constructor(e,n,r,i,o){this.changes=e,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=o}setSelAfter(e){return new Ao(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new Ao(e.changes&&Kr.fromJSON(e.changes),[],e.mapped&&Hl.fromJSON(e.mapped),e.startSelection&&je.fromJSON(e.startSelection),e.selectionsAfter.map(je.fromJSON))}static fromTransaction(e,n){let r=Ya;for(let i of e.startState.facet(Pft)){let o=i(e);o.length&&(r=r.concat(o))}return!r.length&&e.changes.empty?null:new Ao(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,Ya)}static selection(e){return new Ao(void 0,Ya,void 0,void 0,e)}}function bE(t,e,n,r){let i=e+1>n+20?e-n-1:0,o=t.slice(i,e);return o.push(r),o}function Rft(t,e){let n=[],r=!1;return t.iterChangedRanges((i,o)=>n.push(i,o)),e.iterChangedRanges((i,o,a,s)=>{for(let l=0;l=c&&a<=u&&(r=!0)}}),r}function Ift(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function whe(t,e){return t.length?e.length?t.concat(e):t:e}const Ya=[],Dft=200;function She(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-Dft));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),bE(t,t.length-1,1e9,n.setSelAfter(r)))}else return[Ao.selection([e])]}function Lft(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function VR(t,e){if(!t.length)return t;let n=t.length,r=Ya;for(;n;){let i=$ft(t[n-1],e,r);if(i.changes&&!i.changes.empty||i.effects.length){let o=t.slice(0,n);return o[n-1]=i,o}else e=i.mapped,n--,r=i.selectionsAfter}return r.length?[Ao.selection(r)]:Ya}function $ft(t,e,n){let r=whe(t.selectionsAfter.length?t.selectionsAfter.map(s=>s.map(e)):Ya,n);if(!t.changes)return Ao.selection(r);let i=t.changes.map(e),o=e.mapDesc(t.changes,!0),a=t.mapped?t.mapped.composeDesc(o):o;return new Ao(i,It.mapEffects(t.effects,e),a,t.startSelection.map(o),r)}const Nft=/^(input\.type|delete)($|\.)/;class Il{constructor(e,n,r=0,i=void 0){this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new Il(this.done,this.undone):this}addChanges(e,n,r,i,o){let a=this.done,s=a[a.length-1];return s&&s.changes&&!s.changes.empty&&e.changes&&(!r||Nft.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime0&&n-this.prevTimen.empty?t.moveByChar(n,e):D2(n,e))}function eo(t){return t.textDirectionAt(t.state.selection.main.head)==nr.LTR}const Che=t=>Ohe(t,!eo(t)),The=t=>Ohe(t,eo(t));function Ehe(t,e){return tl(t,n=>n.empty?t.moveByGroup(n,e):D2(n,e))}const jft=t=>Ehe(t,!eo(t)),Bft=t=>Ehe(t,eo(t));function zft(t,e,n){if(e.type.prop(n))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function L2(t,e,n){let r=ui(t).resolveInner(e.head),i=n?Wt.closedBy:Wt.openedBy;for(let l=e.head;;){let c=n?r.childAfter(l):r.childBefore(l);if(!c)break;zft(t,c,i)?r=c:l=n?c.to:c.from}let o=r.type.prop(i),a,s;return o&&(a=n?Rl(t,r.from,1):Rl(t,r.to,-1))&&a.matched?s=n?a.end.to:a.end.from:s=n?r.to:r.from,je.cursor(s,n?-1:1)}const Uft=t=>tl(t,e=>L2(t.state,e,!eo(t))),Wft=t=>tl(t,e=>L2(t.state,e,eo(t)));function Phe(t,e){return tl(t,n=>{if(!n.empty)return D2(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const Mhe=t=>Phe(t,!1),khe=t=>Phe(t,!0);function Ahe(t){let e=t.scrollDOM.clientHeighta.empty?t.moveVertically(a,e,n.height):D2(a,e));if(i.eq(r.selection))return!1;let o;if(n.selfScroll){let a=t.coordsAtPos(r.selection.main.head),s=t.scrollDOM.getBoundingClientRect(),l=s.top+n.marginTop,c=s.bottom-n.marginBottom;a&&a.top>l&&a.bottomRhe(t,!1),j3=t=>Rhe(t,!0);function _d(t,e,n){let r=t.lineBlockAt(e.head),i=t.moveToLineBoundary(e,n);if(i.head==e.head&&i.head!=(n?r.to:r.from)&&(i=t.moveToLineBoundary(e,n,!1)),!n&&i.head==r.from&&r.length){let o=/^\s*/.exec(t.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;o&&e.head!=r.from+o&&(i=je.cursor(r.from+o))}return i}const Vft=t=>tl(t,e=>_d(t,e,!0)),Gft=t=>tl(t,e=>_d(t,e,!1)),Hft=t=>tl(t,e=>_d(t,e,!eo(t))),qft=t=>tl(t,e=>_d(t,e,eo(t))),Xft=t=>tl(t,e=>je.cursor(t.lineBlockAt(e.head).from,1)),Qft=t=>tl(t,e=>je.cursor(t.lineBlockAt(e.head).to,-1));function Yft(t,e,n){let r=!1,i=Ty(t.selection,o=>{let a=Rl(t,o.head,-1)||Rl(t,o.head,1)||o.head>0&&Rl(t,o.head-1,1)||o.headYft(t,e,!1);function _s(t,e){let n=Ty(t.state.selection,r=>{let i=e(r);return je.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)});return n.eq(t.state.selection)?!1:(t.dispatch(lc(t.state,n)),!0)}function Ihe(t,e){return _s(t,n=>t.moveByChar(n,e))}const Dhe=t=>Ihe(t,!eo(t)),Lhe=t=>Ihe(t,eo(t));function $he(t,e){return _s(t,n=>t.moveByGroup(n,e))}const Zft=t=>$he(t,!eo(t)),Jft=t=>$he(t,eo(t)),edt=t=>_s(t,e=>L2(t.state,e,!eo(t))),tdt=t=>_s(t,e=>L2(t.state,e,eo(t)));function Nhe(t,e){return _s(t,n=>t.moveVertically(n,e))}const Fhe=t=>Nhe(t,!1),jhe=t=>Nhe(t,!0);function Bhe(t,e){return _s(t,n=>t.moveVertically(n,e,Ahe(t).height))}const nq=t=>Bhe(t,!1),rq=t=>Bhe(t,!0),ndt=t=>_s(t,e=>_d(t,e,!0)),rdt=t=>_s(t,e=>_d(t,e,!1)),idt=t=>_s(t,e=>_d(t,e,!eo(t))),odt=t=>_s(t,e=>_d(t,e,eo(t))),adt=t=>_s(t,e=>je.cursor(t.lineBlockAt(e.head).from)),sdt=t=>_s(t,e=>je.cursor(t.lineBlockAt(e.head).to)),iq=({state:t,dispatch:e})=>(e(lc(t,{anchor:0})),!0),oq=({state:t,dispatch:e})=>(e(lc(t,{anchor:t.doc.length})),!0),aq=({state:t,dispatch:e})=>(e(lc(t,{anchor:t.selection.main.anchor,head:0})),!0),sq=({state:t,dispatch:e})=>(e(lc(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),ldt=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),cdt=({state:t,dispatch:e})=>{let n=$2(t).map(({from:r,to:i})=>je.range(r,Math.min(i+1,t.doc.length)));return e(t.update({selection:je.create(n),userEvent:"select"})),!0},udt=({state:t,dispatch:e})=>{let n=Ty(t.selection,r=>{var i;let o=ui(t).resolveStack(r.from,1);for(let a=o;a;a=a.next){let{node:s}=a;if((s.from=r.to||s.to>r.to&&s.from<=r.from)&&(!((i=s.parent)===null||i===void 0)&&i.parent))return je.range(s.to,s.from)}return r});return e(lc(t,n)),!0},fdt=({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=je.create([n.main]):n.main.empty||(r=je.create([je.cursor(n.main.head)])),r?(e(lc(t,r)),!0):!1};function mw(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,i=r.changeByRange(o=>{let{from:a,to:s}=o;if(a==s){let l=e(o);la&&(n="delete.forward",l=tO(t,l,!0)),a=Math.min(a,l),s=Math.max(s,l)}else a=tO(t,a,!1),s=tO(t,s,!0);return a==s?{range:o}:{changes:{from:a,to:s},range:je.cursor(a,ai(t)))r.between(e,e,(i,o)=>{ie&&(e=n?o:i)});return e}const zhe=(t,e)=>mw(t,n=>{let r=n.from,{state:i}=t,o=i.doc.lineAt(r),a,s;if(!e&&r>o.from&&rzhe(t,!1),Uhe=t=>zhe(t,!0),Whe=(t,e)=>mw(t,n=>{let r=n.head,{state:i}=t,o=i.doc.lineAt(r),a=i.charCategorizer(r);for(let s=null;;){if(r==(e?o.to:o.from)){r==n.head&&o.number!=(e?i.doc.lines:1)&&(r+=e?1:-1);break}let l=ki(o.text,r-o.from,e)+o.from,c=o.text.slice(Math.min(r,l)-o.from,Math.max(r,l)-o.from),u=a(c);if(s!=null&&u!=s)break;(c!=" "||r!=n.head)&&(s=u),r=l}return r}),Vhe=t=>Whe(t,!1),ddt=t=>Whe(t,!0),hdt=t=>mw(t,e=>{let n=t.lineBlockAt(e.head).to;return e.headmw(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),mdt=t=>mw(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head{if(t.readOnly)return!1;let n=t.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:Sn.of(["",""])},range:je.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},vdt=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>{if(!r.empty||r.from==0||r.from==t.doc.length)return{range:r};let i=r.from,o=t.doc.lineAt(i),a=i==o.from?i-1:ki(o.text,i-o.from,!1)+o.from,s=i==o.to?i+1:ki(o.text,i-o.from,!0)+o.from;return{changes:{from:a,to:s,insert:t.doc.slice(i,s).append(t.doc.slice(a,i))},range:je.cursor(s)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function $2(t){let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.from),o=t.doc.lineAt(r.to);if(!r.empty&&r.to==o.from&&(o=t.doc.lineAt(r.to-1)),n>=i.number){let a=e[e.length-1];a.to=o.to,a.ranges.push(r)}else e.push({from:i.from,to:o.to,ranges:[r]});n=o.number+1}return e}function Ghe(t,e,n){if(t.readOnly)return!1;let r=[],i=[];for(let o of $2(t)){if(n?o.to==t.doc.length:o.from==0)continue;let a=t.doc.lineAt(n?o.to+1:o.from-1),s=a.length+1;if(n){r.push({from:o.to,to:a.to},{from:o.from,insert:a.text+t.lineBreak});for(let l of o.ranges)i.push(je.range(Math.min(t.doc.length,l.anchor+s),Math.min(t.doc.length,l.head+s)))}else{r.push({from:a.from,to:o.from},{from:o.to,insert:t.lineBreak+a.text});for(let l of o.ranges)i.push(je.range(l.anchor-s,l.head-s))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:je.create(i,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const ydt=({state:t,dispatch:e})=>Ghe(t,e,!1),xdt=({state:t,dispatch:e})=>Ghe(t,e,!0);function Hhe(t,e,n){if(t.readOnly)return!1;let r=[];for(let i of $2(t))n?r.push({from:i.from,insert:t.doc.slice(i.from,i.to)+t.lineBreak}):r.push({from:i.to,insert:t.lineBreak+t.doc.slice(i.from,i.to)});return e(t.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const bdt=({state:t,dispatch:e})=>Hhe(t,e,!1),_dt=({state:t,dispatch:e})=>Hhe(t,e,!0),wdt=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes($2(e).map(({from:i,to:o})=>(i>0?i--:ot.moveVertically(i,!0)).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Sdt(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=ui(t).resolveInner(e),r=n.childBefore(e),i=n.childAfter(e),o;return r&&i&&r.to<=e&&i.from>=e&&(o=r.type.prop(Wt.closedBy))&&o.indexOf(i.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(i.from).from&&!/\S/.test(t.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const Odt=qhe(!1),Cdt=qhe(!0);function qhe(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(i=>{let{from:o,to:a}=i,s=e.doc.lineAt(o),l=!t&&o==a&&Sdt(e,o);t&&(o=a=(a<=s.to?s:e.doc.lineAt(a)).to);let c=new A2(e,{simulateBreak:o,simulateDoubleBreak:!!l}),u=x4(c,o);for(u==null&&(u=Cy(/^\s*/.exec(e.doc.lineAt(o).text)[0],e.tabSize));as.from&&o{let i=[];for(let a=r.from;a<=r.to;){let s=t.doc.lineAt(a);s.number>n&&(r.empty||r.to>s.from)&&(e(s,i,r),n=s.number),a=s.to+1}let o=t.changes(i);return{changes:i,range:je.range(o.mapPos(r.anchor,1),o.mapPos(r.head,1))}})}const Tdt=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new A2(t,{overrideIndentation:o=>{let a=n[o];return a??-1}}),i=T4(t,(o,a,s)=>{let l=x4(r,o.from);if(l==null)return;/\S/.test(o.text)||(l=0);let c=/^\s*/.exec(o.text)[0],u=a_(t,l);(c!=u||s.fromt.readOnly?!1:(e(t.update(T4(t,(n,r)=>{r.push({from:n.from,insert:t.facet(dw)})}),{userEvent:"input.indent"})),!0),Qhe=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(T4(t,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let o=Cy(i,t.tabSize),a=0,s=a_(t,Math.max(0,o-vE(t)));for(;a({mac:t.key,run:t.run,shift:t.shift}))),Mdt=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Uft,shift:edt},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Wft,shift:tdt},{key:"Alt-ArrowUp",run:ydt},{key:"Shift-Alt-ArrowUp",run:bdt},{key:"Alt-ArrowDown",run:xdt},{key:"Shift-Alt-ArrowDown",run:_dt},{key:"Escape",run:fdt},{key:"Mod-Enter",run:Cdt},{key:"Alt-l",mac:"Ctrl-l",run:cdt},{key:"Mod-i",run:udt,preventDefault:!0},{key:"Mod-[",run:Qhe},{key:"Mod-]",run:Xhe},{key:"Mod-Alt-\\",run:Tdt},{key:"Shift-Mod-k",run:wdt},{key:"Shift-Mod-\\",run:Kft},{key:"Mod-/",run:bft},{key:"Alt-A",run:wft}].concat(Pdt),kdt={key:"Tab",run:Xhe,shift:Qhe};function Bn(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];typeof i=="string"?t.setAttribute(r,i):i!=null&&(t[r]=i)}e++}for(;et.normalize("NFKD"):t=>t;class cv{constructor(e,n,r=0,i=e.length,o,a){this.test=a,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,i),this.bufferStart=r,this.normalize=o?s=>o(lq(s)):lq,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Ci(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let n=n4(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=Ga(e);let i=this.normalize(n);for(let o=0,a=r;;o++){let s=i.charCodeAt(o),l=this.match(s,a,this.bufferPos+this.bufferStart);if(o==i.length-1){if(l)return this.value=l,this;break}a==r&&othis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,i=r+n[0].length;if(this.matchPos=_E(this.text,i+(r==i?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(rthis.value.to)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,match:n},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=r||i.to<=n){let s=new Pg(n,e.sliceString(n,r));return GR.set(e,s),s}if(i.from==n&&i.to==r)return i;let{text:o,from:a}=i;return a>n&&(o=e.sliceString(n,a)+o,a=n),i.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==e&&(this.re.lastIndex=e+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,i=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,match:n},this.matchPos=_E(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Pg.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(Zhe.prototype[Symbol.iterator]=Jhe.prototype[Symbol.iterator]=function(){return this});function Adt(t){try{return new RegExp(t,E4),!0}catch{return!1}}function _E(t,e){if(e>=t.length)return e;let n=t.lineAt(e),r;for(;e=56320&&r<57344;)e++;return e}function z3(t){let e=String(t.state.doc.lineAt(t.state.selection.main.head).number),n=Bn("input",{class:"cm-textfield",name:"line",value:e}),r=Bn("form",{class:"cm-gotoLine",onkeydown:o=>{o.keyCode==27?(o.preventDefault(),t.dispatch({effects:wE.of(!1)}),t.focus()):o.keyCode==13&&(o.preventDefault(),i())},onsubmit:o=>{o.preventDefault(),i()}},Bn("label",t.state.phrase("Go to line"),": ",n)," ",Bn("button",{class:"cm-button",type:"submit"},t.state.phrase("go")));function i(){let o=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.value);if(!o)return;let{state:a}=t,s=a.doc.lineAt(a.selection.main.head),[,l,c,u,f]=o,d=u?+u.slice(1):0,h=c?+c:s.number;if(c&&f){let g=h/100;l&&(g=g*(l=="-"?-1:1)+s.number/a.doc.lines),h=Math.round(a.doc.lines*g)}else c&&l&&(h=h*(l=="-"?-1:1)+s.number);let p=a.doc.line(Math.max(1,Math.min(a.doc.lines,h))),m=je.cursor(p.from+Math.max(0,Math.min(d,p.length)));t.dispatch({effects:[wE.of(!1),rt.scrollIntoView(m.from,{y:"center"})],selection:m}),t.focus()}return{dom:r}}const wE=It.define(),cq=pi.define({create(){return!0},update(t,e){for(let n of e.effects)n.is(wE)&&(t=n.value);return t},provide:t=>r_.from(t,e=>e?z3:null)}),Rdt=t=>{let e=n_(t,z3);if(!e){let n=[wE.of(!0)];t.state.field(cq,!1)==null&&n.push(It.appendConfig.of([cq,Idt])),t.dispatch({effects:n}),e=n_(t,z3)}return e&&e.dom.querySelector("input").select(),!0},Idt=rt.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),Ddt={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},epe=ft.define({combine(t){return ac(t,Ddt,{highlightWordAroundCursor:(e,n)=>e||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function Ldt(t){let e=[Bdt,jdt];return t&&e.push(epe.of(t)),e}const $dt=yt.mark({class:"cm-selectionMatch"}),Ndt=yt.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function uq(t,e,n,r){return(n==0||t(e.sliceDoc(n-1,n))!=ur.Word)&&(r==e.doc.length||t(e.sliceDoc(r,r+1))!=ur.Word)}function Fdt(t,e,n,r){return t(e.sliceDoc(n,n+1))==ur.Word&&t(e.sliceDoc(r-1,r))==ur.Word}const jdt=Mr.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(epe),{state:n}=t,r=n.selection;if(r.ranges.length>1)return yt.none;let i=r.main,o,a=null;if(i.empty){if(!e.highlightWordAroundCursor)return yt.none;let l=n.wordAt(i.head);if(!l)return yt.none;a=n.charCategorizer(i.head),o=n.sliceDoc(l.from,l.to)}else{let l=i.to-i.from;if(l200)return yt.none;if(e.wholeWords){if(o=n.sliceDoc(i.from,i.to),a=n.charCategorizer(i.head),!(uq(a,n,i.from,i.to)&&Fdt(a,n,i.from,i.to)))return yt.none}else if(o=n.sliceDoc(i.from,i.to),!o)return yt.none}let s=[];for(let l of t.visibleRanges){let c=new cv(n.doc,o,l.from,l.to);for(;!c.next().done;){let{from:u,to:f}=c.value;if((!a||uq(a,n,u,f))&&(i.empty&&u<=i.from&&f>=i.to?s.push(Ndt.range(u,f)):(u>=i.to||f<=i.from)&&s.push($dt.range(u,f)),s.length>e.maxMatches))return yt.none}}return yt.set(s)}},{decorations:t=>t.decorations}),Bdt=rt.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),zdt=({state:t,dispatch:e})=>{let{selection:n}=t,r=je.create(n.ranges.map(i=>t.wordAt(i.head)||je.cursor(i.head)),n.mainIndex);return r.eq(n)?!1:(e(t.update({selection:r})),!0)};function Udt(t,e){let{main:n,ranges:r}=t.selection,i=t.wordAt(n.head),o=i&&i.from==n.from&&i.to==n.to;for(let a=!1,s=new cv(t.doc,e,r[r.length-1].to);;)if(s.next(),s.done){if(a)return null;s=new cv(t.doc,e,0,Math.max(0,r[r.length-1].from-1)),a=!0}else{if(a&&r.some(l=>l.from==s.value.from))continue;if(o){let l=t.wordAt(s.value.from);if(!l||l.from!=s.value.from||l.to!=s.value.to)continue}return s.value}}const Wdt=({state:t,dispatch:e})=>{let{ranges:n}=t.selection;if(n.some(o=>o.from===o.to))return zdt({state:t,dispatch:e});let r=t.sliceDoc(n[0].from,n[0].to);if(t.selection.ranges.some(o=>t.sliceDoc(o.from,o.to)!=r))return!1;let i=Udt(t,r);return i?(e(t.update({selection:t.selection.addRange(je.range(i.from,i.to),!1),effects:rt.scrollIntoView(i.to)})),!0):!1},Ey=ft.define({combine(t){return ac(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new tht(e),scrollToMatch:e=>rt.scrollIntoView(e)})}});class tpe{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||Adt(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(n,r)=>r=="n"?` -`:r=="r"?"\r":r=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new qdt(this):new Gdt(this)}getCursor(e,n=0,r){let i=e.doc?e:en.create({doc:e});return r==null&&(r=i.doc.length),this.regexp?Nm(this,i,n,r):$m(this,i,n,r)}}class npe{constructor(e){this.spec=e}}function $m(t,e,n,r){return new cv(e.doc,t.unquoted,n,r,t.caseSensitive?void 0:i=>i.toLowerCase(),t.wholeWord?Vdt(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function Vdt(t,e){return(n,r,i,o)=>((o>n||o+i.length=n)return null;i.push(r.value)}return i}highlight(e,n,r,i){let o=$m(this.spec,e,Math.max(0,n-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!o.next().done;)i(o.value.from,o.value.to)}}function Nm(t,e,n,r){return new Zhe(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:t.wholeWord?Hdt(e.charCategorizer(e.selection.main.head)):void 0},n,r)}function SE(t,e){return t.slice(ki(t,e,!1),e)}function OE(t,e){return t.slice(e,ki(t,e))}function Hdt(t){return(e,n,r)=>!r[0].length||(t(SE(r.input,r.index))!=ur.Word||t(OE(r.input,r.index))!=ur.Word)&&(t(OE(r.input,r.index+r[0].length))!=ur.Word||t(SE(r.input,r.index+r[0].length))!=ur.Word)}class qdt extends npe{nextMatch(e,n,r){let i=Nm(this.spec,e,r,e.doc.length).next();return i.done&&(i=Nm(this.spec,e,0,n).next()),i.done?null:i.value}prevMatchInRange(e,n,r){for(let i=1;;i++){let o=Math.max(n,r-i*1e4),a=Nm(this.spec,e,o,r),s=null;for(;!a.next().done;)s=a.value;if(s&&(o==n||s.from>o+10))return s;if(o==n)return null}}prevMatch(e,n,r){return this.prevMatchInRange(e,0,n)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(n,r)=>r=="$"?"$":r=="&"?e.match[0]:r!="0"&&+r=n)return null;i.push(r.value)}return i}highlight(e,n,r,i){let o=Nm(this.spec,e,Math.max(0,n-250),Math.min(r+250,e.doc.length));for(;!o.next().done;)i(o.value.from,o.value.to)}}const s_=It.define(),P4=It.define(),jf=pi.define({create(t){return new HR(U3(t).create(),null)},update(t,e){for(let n of e.effects)n.is(s_)?t=new HR(n.value.create(),t.panel):n.is(P4)&&(t=new HR(t.query,n.value?M4:null));return t},provide:t=>r_.from(t,e=>e.panel)});class HR{constructor(e,n){this.query=e,this.panel=n}}const Xdt=yt.mark({class:"cm-searchMatch"}),Qdt=yt.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Ydt=Mr.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(jf))}update(t){let e=t.state.field(jf);(e!=t.startState.field(jf)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return yt.none;let{view:n}=this,r=new Jf;for(let i=0,o=n.visibleRanges,a=o.length;io[i+1].from-2*250;)l=o[++i].to;t.highlight(n.state,s,l,(c,u)=>{let f=n.state.selection.ranges.some(d=>d.from==c&&d.to==u);r.add(c,u,f?Qdt:Xdt)})}return r.finish()}},{decorations:t=>t.decorations});function gw(t){return e=>{let n=e.state.field(jf,!1);return n&&n.query.spec.valid?t(e,n):ope(e)}}const CE=gw((t,{query:e})=>{let{to:n}=t.state.selection.main,r=e.nextMatch(t.state,n,n);if(!r)return!1;let i=je.single(r.from,r.to),o=t.state.facet(Ey);return t.dispatch({selection:i,effects:[k4(t,r),o.scrollToMatch(i.main,t)],userEvent:"select.search"}),ipe(t),!0}),TE=gw((t,{query:e})=>{let{state:n}=t,{from:r}=n.selection.main,i=e.prevMatch(n,r,r);if(!i)return!1;let o=je.single(i.from,i.to),a=t.state.facet(Ey);return t.dispatch({selection:o,effects:[k4(t,i),a.scrollToMatch(o.main,t)],userEvent:"select.search"}),ipe(t),!0}),Kdt=gw((t,{query:e})=>{let n=e.matchAll(t.state,1e3);return!n||!n.length?!1:(t.dispatch({selection:je.create(n.map(r=>je.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),Zdt=({state:t,dispatch:e})=>{let n=t.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,o=[],a=0;for(let s=new cv(t.doc,t.sliceDoc(r,i));!s.next().done;){if(o.length>1e3)return!1;s.value.from==r&&(a=o.length),o.push(je.range(s.value.from,s.value.to))}return e(t.update({selection:je.create(o,a),userEvent:"select.search.matches"})),!0},fq=gw((t,{query:e})=>{let{state:n}=t,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let o=e.nextMatch(n,r,r);if(!o)return!1;let a=[],s,l,c=[];if(o.from==r&&o.to==i&&(l=n.toText(e.getReplacement(o)),a.push({from:o.from,to:o.to,insert:l}),o=e.nextMatch(n,o.from,o.to),c.push(rt.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+"."))),o){let u=a.length==0||a[0].from>=o.to?0:o.to-o.from-l.length;s=je.single(o.from-u,o.to-u),c.push(k4(t,o)),c.push(n.facet(Ey).scrollToMatch(s.main,t))}return t.dispatch({changes:a,selection:s,effects:c,userEvent:"input.replace"}),!0}),Jdt=gw((t,{query:e})=>{if(t.state.readOnly)return!1;let n=e.matchAll(t.state,1e9).map(i=>{let{from:o,to:a}=i;return{from:o,to:a,insert:e.getReplacement(i)}});if(!n.length)return!1;let r=t.state.phrase("replaced $ matches",n.length)+".";return t.dispatch({changes:n,effects:rt.announce.of(r),userEvent:"input.replace.all"}),!0});function M4(t){return t.state.facet(Ey).createPanel(t)}function U3(t,e){var n,r,i,o,a;let s=t.selection.main,l=s.empty||s.to>s.from+100?"":t.sliceDoc(s.from,s.to);if(e&&!l)return e;let c=t.facet(Ey);return new tpe({search:((n=e==null?void 0:e.literal)!==null&&n!==void 0?n:c.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(r=e==null?void 0:e.caseSensitive)!==null&&r!==void 0?r:c.caseSensitive,literal:(i=e==null?void 0:e.literal)!==null&&i!==void 0?i:c.literal,regexp:(o=e==null?void 0:e.regexp)!==null&&o!==void 0?o:c.regexp,wholeWord:(a=e==null?void 0:e.wholeWord)!==null&&a!==void 0?a:c.wholeWord})}function rpe(t){let e=n_(t,M4);return e&&e.dom.querySelector("[main-field]")}function ipe(t){let e=rpe(t);e&&e==t.root.activeElement&&e.select()}const ope=t=>{let e=t.state.field(jf,!1);if(e&&e.panel){let n=rpe(t);if(n&&n!=t.root.activeElement){let r=U3(t.state,e.query.spec);r.valid&&t.dispatch({effects:s_.of(r)}),n.focus(),n.select()}}else t.dispatch({effects:[P4.of(!0),e?s_.of(U3(t.state,e.query.spec)):It.appendConfig.of(rht)]});return!0},ape=t=>{let e=t.state.field(jf,!1);if(!e||!e.panel)return!1;let n=n_(t,M4);return n&&n.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:P4.of(!1)}),!0},eht=[{key:"Mod-f",run:ope,scope:"editor search-panel"},{key:"F3",run:CE,shift:TE,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:CE,shift:TE,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:ape,scope:"editor search-panel"},{key:"Mod-Shift-l",run:Zdt},{key:"Mod-Alt-g",run:Rdt},{key:"Mod-d",run:Wdt,preventDefault:!0}];class tht{constructor(e){this.view=e;let n=this.query=e.state.field(jf).query.spec;this.commit=this.commit.bind(this),this.searchField=Bn("input",{value:n.search,placeholder:Qo(e,"Find"),"aria-label":Qo(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Bn("input",{value:n.replace,placeholder:Qo(e,"Replace"),"aria-label":Qo(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Bn("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=Bn("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=Bn("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(i,o,a){return Bn("button",{class:"cm-button",name:i,onclick:o,type:"button"},a)}this.dom=Bn("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>CE(e),[Qo(e,"next")]),r("prev",()=>TE(e),[Qo(e,"previous")]),r("select",()=>Kdt(e),[Qo(e,"all")]),Bn("label",null,[this.caseField,Qo(e,"match case")]),Bn("label",null,[this.reField,Qo(e,"regexp")]),Bn("label",null,[this.wordField,Qo(e,"by word")]),...e.state.readOnly?[]:[Bn("br"),this.replaceField,r("replace",()=>fq(e),[Qo(e,"replace")]),r("replaceAll",()=>Jdt(e),[Qo(e,"replace all")])],Bn("button",{name:"close",onclick:()=>ape(e),"aria-label":Qo(e,"close"),type:"button"},["×"])])}commit(){let e=new tpe({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:s_.of(e)}))}keydown(e){pct(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?TE:CE)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),fq(this.view))}update(e){for(let n of e.transactions)for(let r of n.effects)r.is(s_)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Ey).top}}function Qo(t,e){return t.state.phrase(e)}const nO=30,rO=/[\s\.,:;?!]/;function k4(t,{from:e,to:n}){let r=t.state.doc.lineAt(e),i=t.state.doc.lineAt(n).to,o=Math.max(r.from,e-nO),a=Math.min(i,n+nO),s=t.state.sliceDoc(o,a);if(o!=r.from){for(let l=0;ls.length-nO;l--)if(!rO.test(s[l-1])&&rO.test(s[l])){s=s.slice(0,l);break}}return rt.announce.of(`${t.state.phrase("current match")}. ${s} ${t.state.phrase("on line")} ${r.number}.`)}const nht=rt.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),rht=[jf,bd.low(Ydt),nht];class spe{constructor(e,n,r,i){this.state=e,this.pos=n,this.explicit=r,this.view=i,this.abortListeners=[]}tokenBefore(e){let n=ui(this.state).resolveInner(this.pos,-1);for(;n&&e.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(e){let n=this.state.doc.lineAt(this.pos),r=Math.max(n.from,this.pos-250),i=n.text.slice(r-n.from,this.pos-n.from),o=i.search(cpe(e,!1));return o<0?null:{from:r+o,to:this.pos,text:i.slice(o)}}get aborted(){return this.abortListeners==null}addEventListener(e,n){e=="abort"&&this.abortListeners&&this.abortListeners.push(n)}}function dq(t){let e=Object.keys(t).join(""),n=/\w/.test(e);return n&&(e=e.replace(/\w/g,"")),`[${n?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function iht(t){let e=Object.create(null),n=Object.create(null);for(let{label:i}of t){e[i[0]]=!0;for(let o=1;otypeof i=="string"?{label:i}:i),[n,r]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:iht(e);return i=>{let o=i.matchBefore(r);return o||i.explicit?{from:o?o.from:i.pos,options:e,validFor:n}:null}}function oht(t,e){return n=>{for(let r=ui(n.state).resolveInner(n.pos,-1);r;r=r.parent){if(t.indexOf(r.name)>-1)return null;if(r.type.isTop)break}return e(n)}}class hq{constructor(e,n,r,i){this.completion=e,this.source=n,this.match=r,this.score=i}}function Bf(t){return t.selection.main.from}function cpe(t,e){var n;let{source:r}=t,i=e&&r[0]!="^",o=r[r.length-1]!="$";return!i&&!o?t:new RegExp(`${i?"^":""}(?:${r})${o?"$":""}`,(n=t.flags)!==null&&n!==void 0?n:t.ignoreCase?"i":"")}const A4=oc.define();function aht(t,e,n,r){let{main:i}=t.selection,o=n-i.from,a=r-i.from;return Object.assign(Object.assign({},t.changeByRange(s=>s!=i&&n!=r&&t.sliceDoc(s.from+o,s.from+a)!=t.sliceDoc(n,r)?{range:s}:{changes:{from:s.from+o,to:r==i.from?s.to:s.from+a,insert:e},range:je.cursor(s.from+o+e.length)})),{scrollIntoView:!0,userEvent:"input.complete"})}const pq=new WeakMap;function sht(t){if(!Array.isArray(t))return t;let e=pq.get(t);return e||pq.set(t,e=lpe(t)),e}const EE=It.define(),l_=It.define();class lht{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n=48&&_<=57||_>=97&&_<=122?2:_>=65&&_<=90?1:0:(S=n4(_))!=S.toLowerCase()?1:S!=S.toUpperCase()?2:0;(!y||O==1&&g||b==0&&O!=0)&&(n[f]==_||r[f]==_&&(d=!0)?a[f++]=y:a.length&&(v=!1)),b=O,y+=Ga(_)}return f==l&&a[0]==0&&v?this.result(-100+(d?-200:0),a,e):h==l&&p==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):s>-1?this.ret(-700-e.length,[s,s+this.pattern.length]):h==l?this.ret(-900-e.length,[p,m]):f==l?this.result(-100+(d?-200:0)+-700+(v?0:-1100),a,e):n.length==2?null:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,n,r){let i=[],o=0;for(let a of n){let s=a+(this.astral?Ga(Ci(r,a)):1);o&&i[o-1]==a?i[o-1]=s:(i[o++]=a,i[o++]=s)}return this.ret(e-r.length,i)}}class cht{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:uht,filterStrict:!1,compareCompletions:(e,n)=>e.label.localeCompare(n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,n)=>e&&n,closeOnBlur:(e,n)=>e&&n,icons:(e,n)=>e&&n,tooltipClass:(e,n)=>r=>mq(e(r),n(r)),optionClass:(e,n)=>r=>mq(e(r),n(r)),addToOptions:(e,n)=>e.concat(n),filterStrict:(e,n)=>e||n})}});function mq(t,e){return t?e?t+" "+e:t:e}function uht(t,e,n,r,i,o){let a=t.textDirection==nr.RTL,s=a,l=!1,c="top",u,f,d=e.left-i.left,h=i.right-e.right,p=r.right-r.left,m=r.bottom-r.top;if(s&&d=m||y>e.top?u=n.bottom-e.top:(c="bottom",u=e.bottom-n.top)}let g=(e.bottom-e.top)/o.offsetHeight,v=(e.right-e.left)/o.offsetWidth;return{style:`${c}: ${u/g}px; max-width: ${f/v}px`,class:"cm-completionInfo-"+(l?a?"left-narrow":"right-narrow":s?"left":"right")}}function fht(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(n){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),n.type&&r.classList.add(...n.type.split(/\s+/g).map(i=>"cm-completionIcon-"+i)),r.setAttribute("aria-hidden","true"),r},position:20}),e.push({render(n,r,i,o){let a=document.createElement("span");a.className="cm-completionLabel";let s=n.displayLabel||n.label,l=0;for(let c=0;cl&&a.appendChild(document.createTextNode(s.slice(l,u)));let d=a.appendChild(document.createElement("span"));d.appendChild(document.createTextNode(s.slice(u,f))),d.className="cm-completionMatchedText",l=f}return ln.position-r.position).map(n=>n.render)}function qR(t,e,n){if(t<=n)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let i=Math.floor(e/n);return{from:i*n,to:(i+1)*n}}let r=Math.floor((t-e)/n);return{from:t-(r+1)*n,to:t-r*n}}class dht{constructor(e,n,r){this.view=e,this.stateField=n,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:l=>this.placeInfo(l),key:this},this.space=null,this.currentClass="";let i=e.state.field(n),{options:o,selected:a}=i.open,s=e.state.facet(Mi);this.optionContent=fht(s),this.optionClass=s.optionClass,this.tooltipClass=s.tooltipClass,this.range=qR(o.length,a,s.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",l=>{let{options:c}=e.state.field(n).open;for(let u=l.target,f;u&&u!=this.dom;u=u.parentNode)if(u.nodeName=="LI"&&(f=/-(\d+)$/.exec(u.id))&&+f[1]{let c=e.state.field(this.stateField,!1);c&&c.tooltip&&e.state.facet(Mi).closeOnBlur&&l.relatedTarget!=e.contentDOM&&e.dispatch({effects:l_.of(null)})}),this.showOptions(o,i.id)}mount(){this.updateSel()}showOptions(e,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var n;let r=e.state.field(this.stateField),i=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),r!=i){let{options:o,selected:a,disabled:s}=r.open;(!i.open||i.open.options!=o)&&(this.range=qR(o.length,a,e.state.facet(Mi).maxRenderedOptions),this.showOptions(o,r.id)),this.updateSel(),s!=((n=i.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!s)}}updateTooltipClass(e){let n=this.tooltipClass(e);if(n!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of n.split(" "))r&&this.dom.classList.add(r);this.currentClass=n}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),n=e.open;if((n.selected>-1&&n.selected=this.range.to)&&(this.range=qR(n.options.length,n.selected,this.view.state.facet(Mi).maxRenderedOptions),this.showOptions(n.options,e.id)),this.updateSelectedOption(n.selected)){this.destroyInfo();let{completion:r}=n.options[n.selected],{info:i}=r;if(!i)return;let o=typeof i=="string"?document.createTextNode(i):i(r);if(!o)return;"then"in o?o.then(a=>{a&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(a,r)}).catch(a=>ko(this.view.state,a,"completion info")):this.addInfoPane(o,r)}}addInfoPane(e,n){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",e.nodeType!=null)r.appendChild(e),this.infoDestroy=null;else{let{dom:i,destroy:o}=e;r.appendChild(i),this.infoDestroy=o||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let n=null;for(let r=this.list.firstChild,i=this.range.from;r;r=r.nextSibling,i++)r.nodeName!="LI"||!r.id?i--:i==e?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),n=r):r.hasAttribute("aria-selected")&&r.removeAttribute("aria-selected");return n&&pht(this.list,n),n}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let n=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),i=e.getBoundingClientRect(),o=this.space;if(!o){let a=this.dom.ownerDocument.defaultView||window;o={left:0,top:0,right:a.innerWidth,bottom:a.innerHeight}}return i.top>Math.min(o.bottom,n.bottom)-10||i.bottomr.from||r.from==0))if(o=d,typeof c!="string"&&c.header)i.appendChild(c.header(c));else{let h=i.appendChild(document.createElement("completion-section"));h.textContent=d}}const u=i.appendChild(document.createElement("li"));u.id=n+"-"+a,u.setAttribute("role","option");let f=this.optionClass(s);f&&(u.className=f);for(let d of this.optionContent){let h=d(s,this.view.state,this.view,l);h&&u.appendChild(h)}}return r.from&&i.classList.add("cm-completionListIncompleteTop"),r.tonew dht(n,t,e)}function pht(t,e){let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=n.height/t.offsetHeight;r.topn.bottom&&(t.scrollTop+=(r.bottom-n.bottom)/i)}function gq(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function mht(t,e){let n=[],r=null,i=c=>{n.push(c);let{section:u}=c.completion;if(u){r||(r=[]);let f=typeof u=="string"?u:u.name;r.some(d=>d.name==f)||r.push(typeof u=="string"?{name:f}:u)}},o=e.facet(Mi);for(let c of t)if(c.hasResult()){let u=c.result.getMatch;if(c.result.filter===!1)for(let f of c.result.options)i(new hq(f,c.source,u?u(f):[],1e9-n.length));else{let f=e.sliceDoc(c.from,c.to),d,h=o.filterStrict?new cht(f):new lht(f);for(let p of c.result.options)if(d=h.match(p.label)){let m=p.displayLabel?u?u(p,d.matched):[]:d.matched;i(new hq(p,c.source,m,d.score+(p.boost||0)))}}}if(r){let c=Object.create(null),u=0,f=(d,h)=>{var p,m;return((p=d.rank)!==null&&p!==void 0?p:1e9)-((m=h.rank)!==null&&m!==void 0?m:1e9)||(d.namef.score-u.score||l(u.completion,f.completion))){let u=c.completion;!s||s.label!=u.label||s.detail!=u.detail||s.type!=null&&u.type!=null&&s.type!=u.type||s.apply!=u.apply||s.boost!=u.boost?a.push(c):gq(c.completion)>gq(s)&&(a[a.length-1]=c),s=c.completion}return a}class tg{constructor(e,n,r,i,o,a){this.options=e,this.attrs=n,this.tooltip=r,this.timestamp=i,this.selected=o,this.disabled=a}setSelected(e,n){return e==this.selected||e>=this.options.length?this:new tg(this.options,vq(n,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,n,r,i,o){let a=mht(e,n);if(!a.length)return i&&e.some(l=>l.state==1)?new tg(i.options,i.attrs,i.tooltip,i.timestamp,i.selected,!0):null;let s=n.facet(Mi).selectOnOpen?0:-1;if(i&&i.selected!=s&&i.selected!=-1){let l=i.options[i.selected].completion;for(let c=0;cc.hasResult()?Math.min(l,c.from):l,1e8),create:_ht,above:o.aboveCursor},i?i.timestamp:Date.now(),s,!1)}map(e){return new tg(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class PE{constructor(e,n,r){this.active=e,this.id=n,this.open=r}static start(){return new PE(xht,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:n}=e,r=n.facet(Mi),o=(r.override||n.languageDataAt("autocomplete",Bf(n)).map(sht)).map(s=>(this.active.find(c=>c.source==s)||new da(s,this.active.some(c=>c.state!=0)?1:0)).update(e,r));o.length==this.active.length&&o.every((s,l)=>s==this.active[l])&&(o=this.active);let a=this.open;a&&e.docChanged&&(a=a.map(e.changes)),e.selection||o.some(s=>s.hasResult()&&e.changes.touchesRange(s.from,s.to))||!ght(o,this.active)?a=tg.build(o,n,this.id,a,r):a&&a.disabled&&!o.some(s=>s.state==1)&&(a=null),!a&&o.every(s=>s.state!=1)&&o.some(s=>s.hasResult())&&(o=o.map(s=>s.hasResult()?new da(s.source,0):s));for(let s of e.effects)s.is(dpe)&&(a=a&&a.setSelected(s.value,this.id));return o==this.active&&a==this.open?this:new PE(o,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?vht:yht}}function ght(t,e){if(t==e)return!0;for(let n=0,r=0;;){for(;n-1&&(n["aria-activedescendant"]=t+"-"+e),n}const xht=[];function upe(t,e){if(t.isUserEvent("input.complete")){let r=t.annotation(A4);if(r&&e.activateOnCompletion(r))return 12}let n=t.isUserEvent("input.type");return n&&e.activateOnTyping?5:n?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}class da{constructor(e,n,r=-1){this.source=e,this.state=n,this.explicitPos=r}hasResult(){return!1}update(e,n){let r=upe(e,n),i=this;(r&8||r&16&&this.touches(e))&&(i=new da(i.source,0)),r&4&&i.state==0&&(i=new da(this.source,1)),i=i.updateFor(e,r);for(let o of e.effects)if(o.is(EE))i=new da(i.source,1,o.value?Bf(e.state):-1);else if(o.is(l_))i=new da(i.source,0);else if(o.is(fpe))for(let a of o.value)a.source==i.source&&(i=a);return i}updateFor(e,n){return this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new da(this.source,this.state,e.mapPos(this.explicitPos))}touches(e){return e.changes.touchesRange(Bf(e.state))}}class Mg extends da{constructor(e,n,r,i,o){super(e,2,n),this.result=r,this.from=i,this.to=o}hasResult(){return!0}updateFor(e,n){var r;if(!(n&3))return this.map(e.changes);let i=this.result;i.map&&!e.changes.empty&&(i=i.map(i,e.changes));let o=e.changes.mapPos(this.from),a=e.changes.mapPos(this.to,1),s=Bf(e.state);if((this.explicitPos<0?s<=o:sa||!i||n&2&&Bf(e.startState)==this.from)return new da(this.source,n&4?1:0);let l=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos);return bht(i.validFor,e.state,o,a)?new Mg(this.source,l,i,o,a):i.update&&(i=i.update(i,o,a,new spe(e.state,s,l>=0)))?new Mg(this.source,l,i,i.from,(r=i.to)!==null&&r!==void 0?r:Bf(e.state)):new da(this.source,1,l)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new Mg(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new da(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function bht(t,e,n,r){if(!t)return!1;let i=e.sliceDoc(n,r);return typeof t=="function"?t(i,n,r,e):cpe(t,!0).test(i)}const fpe=It.define({map(t,e){return t.map(n=>n.map(e))}}),dpe=It.define(),Co=pi.define({create(){return PE.start()},update(t,e){return t.update(e)},provide:t=>[h4.from(t,e=>e.tooltip),rt.contentAttributes.from(t,e=>e.attrs)]});function R4(t,e){const n=e.completion.apply||e.completion.label;let r=t.state.field(Co).active.find(i=>i.source==e.source);return r instanceof Mg?(typeof n=="string"?t.dispatch(Object.assign(Object.assign({},aht(t.state,n,r.from,r.to)),{annotations:A4.of(e.completion)})):n(t,e.completion,r.from,r.to),!0):!1}const _ht=hht(Co,R4);function iO(t,e="option"){return n=>{let r=n.state.field(Co,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp-1?r.open.selected+i*(t?1:-1):t?0:a-1;return s<0?s=e=="page"?0:a-1:s>=a&&(s=e=="page"?a-1:0),n.dispatch({effects:dpe.of(s)}),!0}}const wht=t=>{let e=t.state.field(Co,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampt.state.field(Co,!1)?(t.dispatch({effects:EE.of(!0)}),!0):!1,Oht=t=>{let e=t.state.field(Co,!1);return!e||!e.active.some(n=>n.state!=0)?!1:(t.dispatch({effects:l_.of(null)}),!0)};class Cht{constructor(e,n){this.active=e,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const Tht=50,Eht=1e3,Pht=Mr.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field(Co).active)e.state==1&&this.startQuery(e)}update(t){let e=t.state.field(Co),n=t.state.facet(Mi);if(!t.selectionSet&&!t.docChanged&&t.startState.field(Co)==e)return;let r=t.transactions.some(o=>{let a=upe(o,n);return a&8||(o.selection||o.docChanged)&&!(a&3)});for(let o=0;oTht&&Date.now()-a.time>Eht){for(let s of a.context.abortListeners)try{s()}catch(l){ko(this.view.state,l)}a.context.abortListeners=null,this.running.splice(o--,1)}else a.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(o=>o.effects.some(a=>a.is(EE)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(o=>o.state==1&&!this.running.some(a=>a.active.source==o.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let o of t.transactions)o.isUserEvent("input.type")?this.composing=2:this.composing==2&&o.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field(Co);for(let n of e.active)n.state==1&&!this.running.some(r=>r.active.source==n.source)&&this.startQuery(n)}startQuery(t){let{state:e}=this.view,n=Bf(e),r=new spe(e,n,t.explicitPos==n,this.view),i=new Cht(t,r);this.running.push(i),Promise.resolve(t.source(r)).then(o=>{i.context.aborted||(i.done=o||null,this.scheduleAccept())},o=>{this.view.dispatch({effects:l_.of(null)}),ko(this.view.state,o)})}scheduleAccept(){this.running.every(t=>t.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Mi).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],n=this.view.state.facet(Mi);for(let r=0;ra.source==i.active.source);if(o&&o.state==1)if(i.done==null){let a=new da(i.active.source,0);for(let s of i.updates)a=a.update(s,n);a.state!=1&&e.push(a)}else this.startQuery(o)}e.length&&this.view.dispatch({effects:fpe.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(Co,!1);if(e&&e.tooltip&&this.view.state.facet(Mi).closeOnBlur){let n=e.open&&Gde(this.view,e.open.tooltip);(!n||!n.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:l_.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:EE.of(!1)}),20),this.composing=0}}}),Mht=typeof navigator=="object"&&/Win/.test(navigator.platform),kht=bd.highest(rt.domEventHandlers({keydown(t,e){let n=e.state.field(Co,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||t.key.length>1||t.ctrlKey&&!(Mht&&t.altKey)||t.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(a=>a.source==r.source),o=r.completion.commitCharacters||i.result.commitCharacters;return o&&o.indexOf(t.key)>-1&&R4(e,r),!1}})),hpe=rt.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class Aht{constructor(e,n,r,i){this.field=e,this.line=n,this.from=r,this.to=i}}class I4{constructor(e,n,r){this.field=e,this.from=n,this.to=r}map(e){let n=e.mapPos(this.from,-1,Pi.TrackDel),r=e.mapPos(this.to,1,Pi.TrackDel);return n==null||r==null?null:new I4(this.field,n,r)}}class D4{constructor(e,n){this.lines=e,this.fieldPositions=n}instantiate(e,n){let r=[],i=[n],o=e.doc.lineAt(n),a=/^\s*/.exec(o.text)[0];for(let l of this.lines){if(r.length){let c=a,u=/^\t*/.exec(l)[0].length;for(let f=0;fnew I4(l.field,i[l.line]+l.from,i[l.line]+l.to));return{text:r,ranges:s}}static parse(e){let n=[],r=[],i=[],o;for(let a of e.split(/\r\n?|\n/)){for(;o=/[#$]\{(?:(\d+)(?::([^}]*))?|((?:\\[{}]|[^}])*))\}/.exec(a);){let s=o[1]?+o[1]:null,l=o[2]||o[3]||"",c=-1,u=l.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f=c&&d.field++}i.push(new Aht(c,r.length,o.index,o.index+u.length)),a=a.slice(0,o.index)+l+a.slice(o.index+o[0].length)}a=a.replace(/\\([{}])/g,(s,l,c)=>{for(let u of i)u.line==r.length&&u.from>c&&(u.from--,u.to--);return l}),r.push(a)}return new D4(r,i)}}let Rht=yt.widget({widget:new class extends sc{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),Iht=yt.mark({class:"cm-snippetField"});class Py{constructor(e,n){this.ranges=e,this.active=n,this.deco=yt.set(e.map(r=>(r.from==r.to?Rht:Iht).range(r.from,r.to)))}map(e){let n=[];for(let r of this.ranges){let i=r.map(e);if(!i)return null;n.push(i)}return new Py(n,this.active)}selectionInsideField(e){return e.ranges.every(n=>this.ranges.some(r=>r.field==this.active&&r.from<=n.from&&r.to>=n.to))}}const vw=It.define({map(t,e){return t&&t.map(e)}}),Dht=It.define(),c_=pi.define({create(){return null},update(t,e){for(let n of e.effects){if(n.is(vw))return n.value;if(n.is(Dht)&&t)return new Py(t.ranges,n.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>rt.decorations.from(t,e=>e?e.deco:yt.none)});function L4(t,e){return je.create(t.filter(n=>n.field==e).map(n=>je.range(n.from,n.to)))}function Lht(t){let e=D4.parse(t);return(n,r,i,o)=>{let{text:a,ranges:s}=e.instantiate(n.state,i),l={changes:{from:i,to:o,insert:Sn.of(a)},scrollIntoView:!0,annotations:r?[A4.of(r),Br.userEvent.of("input.complete")]:void 0};if(s.length&&(l.selection=L4(s,0)),s.some(c=>c.field>0)){let c=new Py(s,0),u=l.effects=[vw.of(c)];n.state.field(c_,!1)===void 0&&u.push(It.appendConfig.of([c_,Bht,zht,hpe]))}n.dispatch(n.state.update(l))}}function ppe(t){return({state:e,dispatch:n})=>{let r=e.field(c_,!1);if(!r||t<0&&r.active==0)return!1;let i=r.active+t,o=t>0&&!r.ranges.some(a=>a.field==i+t);return n(e.update({selection:L4(r.ranges,i),effects:vw.of(o?null:new Py(r.ranges,i)),scrollIntoView:!0})),!0}}const $ht=({state:t,dispatch:e})=>t.field(c_,!1)?(e(t.update({effects:vw.of(null)})),!0):!1,Nht=ppe(1),Fht=ppe(-1),jht=[{key:"Tab",run:Nht,shift:Fht},{key:"Escape",run:$ht}],yq=ft.define({combine(t){return t.length?t[0]:jht}}),Bht=bd.highest(uw.compute([yq],t=>t.facet(yq)));function mc(t,e){return Object.assign(Object.assign({},e),{apply:Lht(t)})}const zht=rt.domEventHandlers({mousedown(t,e){let n=e.state.field(c_,!1),r;if(!n||(r=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let i=n.ranges.find(o=>o.from<=r&&o.to>=r);return!i||i.field==n.active?!1:(e.dispatch({selection:L4(n.ranges,i.field),effects:vw.of(n.ranges.some(o=>o.field>i.field)?new Py(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),u_={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},yh=It.define({map(t,e){let n=e.mapPos(t,-1,Pi.TrackAfter);return n??void 0}}),$4=new class extends ep{};$4.startSide=1;$4.endSide=-1;const mpe=pi.define({create(){return sn.empty},update(t,e){if(t=t.map(e.changes),e.selection){let n=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:r=>r>=n.from&&r<=n.to})}for(let n of e.effects)n.is(yh)&&(t=t.update({add:[$4.range(n.value,n.value+1)]}));return t}});function Uht(){return[Vht,mpe]}const XR="()[]{}<>";function gpe(t){for(let e=0;e{if((Wht?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let i=t.state.selection.main;if(r.length>2||r.length==2&&Ga(Ci(r,0))==1||e!=i.from||n!=i.to)return!1;let o=qht(t.state,r);return o?(t.dispatch(o),!0):!1}),Ght=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=vpe(t,t.selection.main.head).brackets||u_.brackets,i=null,o=t.changeByRange(a=>{if(a.empty){let s=Xht(t.doc,a.head);for(let l of r)if(l==s&&N2(t.doc,a.head)==gpe(Ci(l,0)))return{changes:{from:a.head-l.length,to:a.head+l.length},range:je.cursor(a.head-l.length)}}return{range:i=a}});return i||e(t.update(o,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},Hht=[{key:"Backspace",run:Ght}];function qht(t,e){let n=vpe(t,t.selection.main.head),r=n.brackets||u_.brackets;for(let i of r){let o=gpe(Ci(i,0));if(e==i)return o==i?Kht(t,i,r.indexOf(i+i+i)>-1,n):Qht(t,i,o,n.before||u_.before);if(e==o&&ype(t,t.selection.main.from))return Yht(t,i,o)}return null}function ype(t,e){let n=!1;return t.field(mpe).between(0,t.doc.length,r=>{r==e&&(n=!0)}),n}function N2(t,e){let n=t.sliceString(e,e+2);return n.slice(0,Ga(Ci(n,0)))}function Xht(t,e){let n=t.sliceString(e-2,e);return Ga(Ci(n,0))==n.length?n:n.slice(1)}function Qht(t,e,n,r){let i=null,o=t.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:n,from:a.to}],effects:yh.of(a.to+e.length),range:je.range(a.anchor+e.length,a.head+e.length)};let s=N2(t.doc,a.head);return!s||/\s/.test(s)||r.indexOf(s)>-1?{changes:{insert:e+n,from:a.head},effects:yh.of(a.head+e.length),range:je.cursor(a.head+e.length)}:{range:i=a}});return i?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function Yht(t,e,n){let r=null,i=t.changeByRange(o=>o.empty&&N2(t.doc,o.head)==n?{changes:{from:o.head,to:o.head+n.length,insert:n},range:je.cursor(o.head+n.length)}:r={range:o});return r?null:t.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function Kht(t,e,n,r){let i=r.stringPrefixes||u_.stringPrefixes,o=null,a=t.changeByRange(s=>{if(!s.empty)return{changes:[{insert:e,from:s.from},{insert:e,from:s.to}],effects:yh.of(s.to+e.length),range:je.range(s.anchor+e.length,s.head+e.length)};let l=s.head,c=N2(t.doc,l),u;if(c==e){if(xq(t,l))return{changes:{insert:e+e,from:l},effects:yh.of(l+e.length),range:je.cursor(l+e.length)};if(ype(t,l)){let d=n&&t.sliceDoc(l,l+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:l,to:l+d.length,insert:d},range:je.cursor(l+d.length)}}}else{if(n&&t.sliceDoc(l-2*e.length,l)==e+e&&(u=bq(t,l-2*e.length,i))>-1&&xq(t,u))return{changes:{insert:e+e+e+e,from:l},effects:yh.of(l+e.length),range:je.cursor(l+e.length)};if(t.charCategorizer(l)(c)!=ur.Word&&bq(t,l,i)>-1&&!Zht(t,l,e,i))return{changes:{insert:e+e,from:l},effects:yh.of(l+e.length),range:je.cursor(l+e.length)}}return{range:o=s}});return o?null:t.update(a,{scrollIntoView:!0,userEvent:"input.type"})}function xq(t,e){let n=ui(t).resolveInner(e+1);return n.parent&&n.from==e}function Zht(t,e,n,r){let i=ui(t).resolveInner(e,-1),o=r.reduce((a,s)=>Math.max(a,s.length),0);for(let a=0;a<5;a++){let s=t.sliceDoc(i.from,Math.min(i.to,i.from+n.length+o)),l=s.indexOf(n);if(!l||l>-1&&r.indexOf(s.slice(0,l))>-1){let u=i.firstChild;for(;u&&u.from==i.from&&u.to-u.from>n.length+l;){if(t.sliceDoc(u.to-n.length,u.to)==n)return!1;u=u.firstChild}return!0}let c=i.to==e&&i.parent;if(!c)break;i=c}return!1}function bq(t,e,n){let r=t.charCategorizer(e);if(r(t.sliceDoc(e-1,e))!=ur.Word)return e;for(let i of n){let o=e-i.length;if(t.sliceDoc(o,e)==i&&r(t.sliceDoc(o-1,o))!=ur.Word)return o}return-1}function xpe(t={}){return[kht,Co,Mi.of(t),Pht,Jht,hpe]}const bpe=[{key:"Ctrl-Space",run:Sht},{key:"Escape",run:Oht},{key:"ArrowDown",run:iO(!0)},{key:"ArrowUp",run:iO(!1)},{key:"PageDown",run:iO(!0,"page")},{key:"PageUp",run:iO(!1,"page")},{key:"Enter",run:wht}],Jht=bd.highest(uw.computeN([Mi],t=>t.facet(Mi).defaultKeymap?[bpe]:[]));class ept{constructor(e,n,r){this.from=e,this.to=n,this.diagnostic=r}}class oh{constructor(e,n,r){this.diagnostics=e,this.panel=n,this.selected=r}static init(e,n,r){let i=e,o=r.facet(Spe).markerFilter;o&&(i=o(i,r));let a=yt.set(i.map(s=>s.from==s.to||s.from==s.to-1&&r.doc.lineAt(s.from).to==s.from?yt.widget({widget:new cpt(s),diagnostic:s}).range(s.from):yt.mark({attributes:{class:"cm-lintRange cm-lintRange-"+s.severity+(s.markClass?" "+s.markClass:"")},diagnostic:s,inclusive:!0}).range(s.from,s.to)),!0);return new oh(a,n,uv(a))}}function uv(t,e=null,n=0){let r=null;return t.between(n,1e9,(i,o,{spec:a})=>{if(!(e&&a.diagnostic!=e))return r=new ept(i,o,a.diagnostic),!1}),r}function tpt(t,e){let n=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(r=>r.is(_pe))||t.changes.touchesRange(n.from,n.to))}function npt(t,e){return t.field(ga,!1)?e:e.concat(It.appendConfig.of(dpt))}const _pe=It.define(),N4=It.define(),wpe=It.define(),ga=pi.define({create(){return new oh(yt.none,null,null)},update(t,e){if(e.docChanged){let n=t.diagnostics.map(e.changes),r=null;if(t.selected){let i=e.changes.mapPos(t.selected.from,1);r=uv(n,t.selected.diagnostic,i)||uv(n,null,i)}t=new oh(n,t.panel,r)}for(let n of e.effects)n.is(_pe)?t=oh.init(n.value,t.panel,e.state):n.is(N4)?t=new oh(t.diagnostics,n.value?F2.open:null,t.selected):n.is(wpe)&&(t=new oh(t.diagnostics,t.panel,n.value));return t},provide:t=>[r_.from(t,e=>e.panel),rt.decorations.from(t,e=>e.diagnostics)]}),rpt=yt.mark({class:"cm-lintRange cm-lintRange-active",inclusive:!0});function ipt(t,e,n){let{diagnostics:r}=t.state.field(ga),i=[],o=2e8,a=0;r.between(e-(n<0?1:0),e+(n>0?1:0),(l,c,{spec:u})=>{e>=l&&e<=c&&(l==c||(e>l||n>0)&&(eCpe(t,n,!1)))}const apt=t=>{let e=t.state.field(ga,!1);(!e||!e.panel)&&t.dispatch({effects:npt(t.state,[N4.of(!0)])});let n=n_(t,F2.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},_q=t=>{let e=t.state.field(ga,!1);return!e||!e.panel?!1:(t.dispatch({effects:N4.of(!1)}),!0)},spt=t=>{let e=t.state.field(ga,!1);if(!e)return!1;let n=t.state.selection.main,r=e.diagnostics.iter(n.to+1);return!r.value&&(r=e.diagnostics.iter(0),!r.value||r.from==n.from&&r.to==n.to)?!1:(t.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},lpt=[{key:"Mod-Shift-m",run:apt,preventDefault:!0},{key:"F8",run:spt}],Spe=ft.define({combine(t){return Object.assign({sources:t.map(e=>e.source).filter(e=>e!=null)},ac(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null},{needsRefresh:(e,n)=>e?n?r=>e(r)||n(r):e:n}))}});function Ope(t){let e=[];if(t)e:for(let{name:n}of t){for(let r=0;ro.toLowerCase()==i.toLowerCase())){e.push(i);continue e}}e.push("")}return e}function Cpe(t,e,n){var r;let i=n?Ope(e.actions):[];return Bn("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},Bn("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage():e.message),(r=e.actions)===null||r===void 0?void 0:r.map((o,a)=>{let s=!1,l=d=>{if(d.preventDefault(),s)return;s=!0;let h=uv(t.state.field(ga).diagnostics,e);h&&o.apply(t,h.from,h.to)},{name:c}=o,u=i[a]?c.indexOf(i[a]):-1,f=u<0?c:[c.slice(0,u),Bn("u",c.slice(u,u+1)),c.slice(u+1)];return Bn("button",{type:"button",class:"cm-diagnosticAction",onclick:l,onmousedown:l,"aria-label":` Action: ${c}${u<0?"":` (access key "${i[a]})"`}.`},f)}),e.source&&Bn("div",{class:"cm-diagnosticSource"},e.source))}class cpt extends sc{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return Bn("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class wq{constructor(e,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=Cpe(e,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class F2{constructor(e){this.view=e,this.items=[];let n=i=>{if(i.keyCode==27)_q(this.view),this.view.focus();else if(i.keyCode==38||i.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(i.keyCode==40||i.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(i.keyCode==36)this.moveSelection(0);else if(i.keyCode==35)this.moveSelection(this.items.length-1);else if(i.keyCode==13)this.view.focus();else if(i.keyCode>=65&&i.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:o}=this.items[this.selectedIndex],a=Ope(o.actions);for(let s=0;s{for(let o=0;o_q(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(ga).selected;if(!e)return-1;for(let n=0;n{let c=-1,u;for(let f=r;fr&&(this.items.splice(r,c-r),i=!0)),n&&u.diagnostic==n.diagnostic?u.dom.hasAttribute("aria-selected")||(u.dom.setAttribute("aria-selected","true"),o=u):u.dom.hasAttribute("aria-selected")&&u.dom.removeAttribute("aria-selected"),r++});r({sel:o.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:a,panel:s})=>{let l=s.height/this.list.offsetHeight;a.tops.bottom&&(this.list.scrollTop+=(a.bottom-s.bottom)/l)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let e=this.list.firstChild;function n(){let r=e;e=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;e!=r.dom;)n();e=r.dom.nextSibling}else this.list.insertBefore(r.dom,e);for(;e;)n()}moveSelection(e){if(this.selectedIndex<0)return;let n=this.view.state.field(ga),r=uv(n.diagnostics,this.items[e].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:wpe.of(r)})}static open(e){return new F2(e)}}function upt(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(t)}')`}function oO(t){return upt(``,'width="6" height="3"')}const fpt=rt.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:oO("#d11")},".cm-lintRange-warning":{backgroundImage:oO("orange")},".cm-lintRange-info":{backgroundImage:oO("#999")},".cm-lintRange-hint":{backgroundImage:oO("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}}),dpt=[ga,rt.decorations.compute([ga],t=>{let{selected:e,panel:n}=t.field(ga);return!e||!n||e.from==e.to?yt.none:yt.set([rpt.range(e.from,e.to)])}),nut(ipt,{hideOn:tpt}),fpt];var Sq=function(e){e===void 0&&(e={});var{crosshairCursor:n=!1}=e,r=[];e.closeBracketsKeymap!==!1&&(r=r.concat(Hht)),e.defaultKeymap!==!1&&(r=r.concat(Mdt)),e.searchKeymap!==!1&&(r=r.concat(eht)),e.historyKeymap!==!1&&(r=r.concat(Fft)),e.foldKeymap!==!1&&(r=r.concat(Zut)),e.completionKeymap!==!1&&(r=r.concat(bpe)),e.lintKeymap!==!1&&(r=r.concat(lpt));var i=[];return e.lineNumbers!==!1&&i.push(fut()),e.highlightActiveLineGutter!==!1&&i.push(put()),e.highlightSpecialChars!==!1&&i.push(Act()),e.history!==!1&&i.push(Mft()),e.foldGutter!==!1&&i.push(nft()),e.drawSelection!==!1&&i.push(bct()),e.dropCursor!==!1&&i.push(Cct()),e.allowMultipleSelections!==!1&&i.push(en.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&i.push(Wut()),e.syntaxHighlighting!==!1&&i.push(phe(aft,{fallback:!0})),e.bracketMatching!==!1&&i.push(hft()),e.closeBrackets!==!1&&i.push(Uht()),e.autocompletion!==!1&&i.push(xpe()),e.rectangularSelection!==!1&&i.push(Gct()),n!==!1&&i.push(Xct()),e.highlightActiveLine!==!1&&i.push(Nct()),e.highlightSelectionMatches!==!1&&i.push(Ldt()),e.tabSize&&typeof e.tabSize=="number"&&i.push(dw.of(" ".repeat(e.tabSize))),i.concat([uw.of(r.flat())]).filter(Boolean)};const hpt="#e5c07b",Oq="#e06c75",ppt="#56b6c2",mpt="#ffffff",jC="#abb2bf",W3="#7d8799",gpt="#61afef",vpt="#98c379",Cq="#d19a66",ypt="#c678dd",xpt="#21252b",Tq="#2c313a",Eq="#282c34",QR="#353a42",bpt="#3E4451",Pq="#528bff",_pt=rt.theme({"&":{color:jC,backgroundColor:Eq},".cm-content":{caretColor:Pq},".cm-cursor, .cm-dropCursor":{borderLeftColor:Pq},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:bpt},".cm-panels":{backgroundColor:xpt,color:jC},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:Eq,color:W3,border:"none"},".cm-activeLineGutter":{backgroundColor:Tq},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:QR},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:QR,borderBottomColor:QR},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Tq,color:jC}}},{dark:!0}),wpt=pw.define([{tag:Te.keyword,color:ypt},{tag:[Te.name,Te.deleted,Te.character,Te.propertyName,Te.macroName],color:Oq},{tag:[Te.function(Te.variableName),Te.labelName],color:gpt},{tag:[Te.color,Te.constant(Te.name),Te.standard(Te.name)],color:Cq},{tag:[Te.definition(Te.name),Te.separator],color:jC},{tag:[Te.typeName,Te.className,Te.number,Te.changed,Te.annotation,Te.modifier,Te.self,Te.namespace],color:hpt},{tag:[Te.operator,Te.operatorKeyword,Te.url,Te.escape,Te.regexp,Te.link,Te.special(Te.string)],color:ppt},{tag:[Te.meta,Te.comment],color:W3},{tag:Te.strong,fontWeight:"bold"},{tag:Te.emphasis,fontStyle:"italic"},{tag:Te.strikethrough,textDecoration:"line-through"},{tag:Te.link,color:W3,textDecoration:"underline"},{tag:Te.heading,fontWeight:"bold",color:Oq},{tag:[Te.atom,Te.bool,Te.special(Te.variableName)],color:Cq},{tag:[Te.processingInstruction,Te.string,Te.inserted],color:vpt},{tag:Te.invalid,color:mpt}]),Spt=[_pt,phe(wpt)];var Opt=rt.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),Cpt=function(e){e===void 0&&(e={});var{indentWithTab:n=!0,editable:r=!0,readOnly:i=!1,theme:o="light",placeholder:a="",basicSetup:s=!0}=e,l=[];switch(n&&l.unshift(uw.of([kdt])),s&&(typeof s=="boolean"?l.unshift(Sq()):l.unshift(Sq(s))),a&&l.unshift(zct(a)),o){case"light":l.push(Opt);break;case"dark":l.push(Spt);break;case"none":break;default:l.push(o);break}return r===!1&&l.push(rt.editable.of(!1)),i&&l.push(en.readOnly.of(!0)),[...l]},Tpt=t=>({line:t.state.doc.lineAt(t.state.selection.main.from),lineCount:t.state.doc.lines,lineBreak:t.state.lineBreak,length:t.state.doc.length,readOnly:t.state.readOnly,tabSize:t.state.tabSize,selection:t.state.selection,selectionAsSingle:t.state.selection.asSingle().main,ranges:t.state.selection.ranges,selectionCode:t.state.sliceDoc(t.state.selection.main.from,t.state.selection.main.to),selections:t.state.selection.ranges.map(e=>t.state.sliceDoc(e.from,e.to)),selectedText:t.state.selection.ranges.some(e=>!e.empty)}),Mq=oc.define(),Ept=[];function Ppt(t){var{value:e,selection:n,onChange:r,onStatistics:i,onCreateEditor:o,onUpdate:a,extensions:s=Ept,autoFocus:l,theme:c="light",height:u=null,minHeight:f=null,maxHeight:d=null,width:h=null,minWidth:p=null,maxWidth:m=null,placeholder:g="",editable:v=!0,readOnly:y=!1,indentWithTab:x=!0,basicSetup:b=!0,root:_,initialState:S}=t,[O,C]=M.useState(),[E,k]=M.useState(),[I,P]=M.useState(),R=rt.theme({"&":{height:u,minHeight:f,maxHeight:d,width:h,minWidth:p,maxWidth:m},"& .cm-scroller":{height:"100% !important"}}),T=rt.updateListener.of(B=>{if(B.docChanged&&typeof r=="function"&&!B.transactions.some(N=>N.annotation(Mq))){var W=B.state.doc,U=W.toString();r(U,B)}i&&i(Tpt(B))}),L=Cpt({theme:c,editable:v,readOnly:y,placeholder:g,indentWithTab:x,basicSetup:b}),z=[T,R,...L];return a&&typeof a=="function"&&z.push(rt.updateListener.of(a)),z=z.concat(s),M.useEffect(()=>{if(O&&!I){var B={doc:e,selection:n,extensions:z},W=S?en.fromJSON(S.json,B,S.fields):en.create(B);if(P(W),!E){var U=new rt({state:W,parent:O,root:_});k(U),o&&o(U,W)}}return()=>{E&&(P(void 0),k(void 0))}},[O,I]),M.useEffect(()=>C(t.container),[t.container]),M.useEffect(()=>()=>{E&&(E.destroy(),k(void 0))},[E]),M.useEffect(()=>{l&&E&&E.focus()},[l,E]),M.useEffect(()=>{E&&E.dispatch({effects:It.reconfigure.of(z)})},[c,s,u,f,d,h,p,m,g,v,y,x,b,r,a]),M.useEffect(()=>{if(e!==void 0){var B=E?E.state.doc.toString():"";E&&e!==B&&E.dispatch({changes:{from:0,to:B.length,insert:e||""},annotations:[Mq.of(!0)]})}},[e,E]),{state:I,setState:P,view:E,setView:k,container:O,setContainer:C}}var Mpt=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],j2=M.forwardRef((t,e)=>{var{className:n,value:r="",selection:i,extensions:o=[],onChange:a,onStatistics:s,onCreateEditor:l,onUpdate:c,autoFocus:u,theme:f="light",height:d,minHeight:h,maxHeight:p,width:m,minWidth:g,maxWidth:v,basicSetup:y,placeholder:x,indentWithTab:b,editable:_,readOnly:S,root:O,initialState:C}=t,E=Ae(t,Mpt),k=M.useRef(null),{state:I,view:P,container:R}=Ppt({container:k.current,root:O,value:r,autoFocus:u,theme:f,height:d,minHeight:h,maxHeight:p,width:m,minWidth:g,maxWidth:v,basicSetup:y,placeholder:x,indentWithTab:b,editable:_,readOnly:S,selection:i,onChange:a,onStatistics:s,onCreateEditor:l,onUpdate:c,extensions:o,initialState:C});if(M.useImperativeHandle(e,()=>({editor:k.current,state:I,view:P}),[k,R,I,P]),typeof r!="string")throw new Error("value must be typeof string but got "+typeof r);var T=typeof f=="string"?"cm-theme-"+f:"cm-theme";return w.jsx("div",j({ref:k,className:""+T+(n?" "+n:"")},E))});j2.displayName="CodeMirror";var kq={};let kpt=class V3{constructor(e,n,r,i,o,a,s,l,c,u=0,f){this.p=e,this.stack=n,this.state=r,this.reducePos=i,this.pos=o,this.score=a,this.buffer=s,this.bufferBase=l,this.curContext=c,this.lookAhead=u,this.parent=f}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,r=0){let i=e.parser.context;return new V3(e,[],n,r,r,0,[],0,i?new Aq(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var n;let r=e>>19,i=e&65535,{parser:o}=this.p,a=o.dynamicPrecedence(i);if(a&&(this.score+=a),r==0){this.pushState(o.getGoto(this.state,i,!0),this.reducePos),i=2e3&&!(!((n=this.p.parser.nodeSet.types[i])===null||n===void 0)&&n.isAnonymous)&&(l==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSizes;)this.stack.pop();this.reduceContext(i,l)}storeNode(e,n,r,i=4,o=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&a.buffer[s-4]==0&&a.buffer[s-1]>-1){if(n==r)return;if(a.buffer[s-2]>=n){a.buffer[s-2]=r;return}}}if(!o||this.pos==r)this.buffer.push(e,n,r,i);else{let a=this.buffer.length;if(a>0&&this.buffer[a-4]!=0)for(;a>0&&this.buffer[a-2]>r;)this.buffer[a]=this.buffer[a-4],this.buffer[a+1]=this.buffer[a-3],this.buffer[a+2]=this.buffer[a-2],this.buffer[a+3]=this.buffer[a-1],a-=4,i>4&&(i-=4);this.buffer[a]=e,this.buffer[a+1]=n,this.buffer[a+2]=r,this.buffer[a+3]=i}}shift(e,n,r,i){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=i,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,i,4);else{let o=e,{parser:a}=this.p;(i>this.pos||n<=a.maxNode)&&(this.pos=i,a.stateFlag(o,1)||(this.reducePos=i)),this.pushState(o,r),this.shiftContext(n,r),n<=a.maxNode&&this.buffer.push(n,r,i,4)}}apply(e,n,r,i){e&65536?this.reduce(e):this.shift(e,n,r,i)}useNode(e,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(n,i),this.buffer.push(r,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,n=e.buffer.length;for(;n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let r=e.buffer.slice(n),i=e.bufferBase+n;for(;e&&i==e.bufferBase;)e=e.parent;return new V3(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new Apt(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(r==0)return!1;if(!(r&65536))return!0;n.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let i=[];for(let o=0,a;ol&1&&s==a)||i.push(n[o],a)}n=i}let r=[];for(let i=0;i>19,i=n&65535,o=this.stack.length-r*3;if(o<0||e.getGoto(this.stack[o],i,!1)<0){let a=this.findForcedReduction();if(a==null)return!1;n=a}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:e}=this.p,n=[],r=(i,o)=>{if(!n.includes(i))return n.push(i),e.allActions(i,a=>{if(!(a&393216))if(a&65536){let s=(a>>19)-o;if(s>1){let l=a&65535,c=this.stack.length-s*3;if(c>=0&&e.getGoto(this.stack[c],l,!1)>=0)return s<<19|65536|l}}else{let s=r(a,o+1);if(s!=null)return s}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let n=0;nthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}};class Aq{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class Apt{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=i}}class ME{constructor(e,n,r){this.stack=e,this.pos=n,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new ME(e,n,n-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new ME(this.stack,this.pos,this.index)}}function aO(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let r=0,i=0;r=92&&a--,a>=34&&a--;let l=a-32;if(l>=46&&(l-=46,s=!0),o+=l,s)break;o*=46}n?n[i++]=o:n=new e(o)}return n}class BC{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Rq=new BC;class Rpt{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Rq,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(e,n){let r=this.range,i=this.rangeIndex,o=this.pos+e;for(;or.to:o>=r.to;){if(i==this.ranges.length-1)return null;let a=this.ranges[++i];o+=a.from-r.to,r=a}return o}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,r,i;if(n>=0&&n=this.chunk2Pos&&rs.to&&(this.chunk2=this.chunk2.slice(0,s.to-r)),i=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),i}acceptToken(e,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,n){if(n?(this.token=n,n.start=e,n.lookAhead=e+1,n.value=n.extended=-1):this.token=Rq,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,n-this.chunkPos);if(e>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,n-this.chunk2Pos);if(e>=this.range.from&&n<=this.range.to)return this.input.read(e,n);let r="";for(let i of this.ranges){if(i.from>=n)break;i.to>e&&(r+=this.input.read(Math.max(i.from,e),Math.min(i.to,n)))}return r}}class kg{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:r}=n.p;Ipt(this.data,e,n,this.id,r.data,r.tokenPrecTable)}}kg.prototype.contextual=kg.prototype.fallback=kg.prototype.extend=!1;kg.prototype.fallback=kg.prototype.extend=!1;class B2{constructor(e,n={}){this.token=e,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function Ipt(t,e,n,r,i,o){let a=0,s=1<0){let p=t[h];if(l.allows(p)&&(e.token.value==-1||e.token.value==p||Dpt(p,e.token.value,i,o))){e.acceptToken(p);break}}let u=e.next,f=0,d=t[a+2];if(e.next<0&&d>f&&t[c+d*3-3]==65535){a=t[c+d*3-1];continue e}for(;f>1,p=c+h+(h<<1),m=t[p],g=t[p+1]||65536;if(u=g)f=h+1;else{a=t[p+2],e.advance();continue e}}break}}function Iq(t,e,n){for(let r=e,i;(i=t[r])!=65535;r++)if(i==n)return r-e;return-1}function Dpt(t,e,n,r){let i=Iq(n,r,e);return i<0||Iq(n,r,t)e)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(t.length,Math.max(r.from+1,e+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:t.length}}class Lpt{constructor(e,n){this.fragments=e,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?Dq(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Dq(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=a,null;if(o instanceof zr){if(a==e){if(a=Math.max(this.safeFrom,e)&&(this.trees.push(o),this.start.push(a),this.index.push(0))}else this.index[n]++,this.nextStart=a+o.length}}}class $pt{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new BC)}getActions(e){let n=0,r=null,{parser:i}=e.p,{tokenizers:o}=i,a=i.stateSlot(e.state,3),s=e.curContext?e.curContext.hash:0,l=0;for(let c=0;cf.end+25&&(l=Math.max(f.lookAhead,l)),f.value!=0)){let d=n;if(f.extended>-1&&(n=this.addActions(e,f.extended,f.end,n)),n=this.addActions(e,f.value,f.end,n),!u.extend&&(r=f,n>d))break}}for(;this.actions.length>n;)this.actions.pop();return l&&e.setLookAhead(l),!r&&e.pos==this.stream.end&&(r=new BC,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,n=this.addActions(e,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new BC,{pos:r,p:i}=e;return n.start=r,n.end=Math.min(r+1,i.stream.end),n.value=r==i.stream.end?i.parser.eofTerm:0,n}updateCachedToken(e,n,r){let i=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(i,e),r),e.value>-1){let{parser:o}=r.p;for(let a=0;a=0&&r.p.parser.dialect.allows(s>>1)){s&1?e.extended=s>>1:e.value=s>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,n,r,i){for(let o=0;oe.bufferLength*4?new Lpt(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,r=this.stacks=[],i,o;if(this.bigReductionCount>300&&e.length==1){let[a]=e;for(;a.forceReduce()&&a.stack.length&&a.stack[a.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;an)r.push(s);else{if(this.advanceStack(s,r,e))continue;{i||(i=[],o=[]),i.push(s);let l=this.tokens.getMainToken(s);o.push(l.value,l.end)}}break}}if(!r.length){let a=i&&Bpt(i);if(a)return Yo&&console.log("Finish with "+this.stackID(a)),this.stackToTree(a);if(this.parser.strict)throw Yo&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&i){let a=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,o,r);if(a)return Yo&&console.log("Force-finish "+this.stackID(a)),this.stackToTree(a.forceAll())}if(this.recovering){let a=this.recovering==1?1:this.recovering*3;if(r.length>a)for(r.sort((s,l)=>l.score-s.score);r.length>a;)r.pop();r.some(s=>s.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let a=0;a500&&c.buffer.length>500)if((s.score-c.score||s.buffer.length-c.buffer.length)>0)r.splice(l--,1);else{r.splice(a--,1);continue e}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let a=1;a ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,u=c?e.curContext.hash:0;for(let f=this.fragments.nodeAt(i);f;){let d=this.parser.nodeSet.types[f.type.id]==f.type?o.getGoto(e.state,f.type.id):-1;if(d>-1&&f.length&&(!c||(f.prop(Wt.contextHash)||0)==u))return e.useNode(f,d),Yo&&console.log(a+this.stackID(e)+` (via reuse of ${o.getName(f.type.id)})`),!0;if(!(f instanceof zr)||f.children.length==0||f.positions[0]>0)break;let h=f.children[0];if(h instanceof zr&&f.positions[0]==0)f=h;else break}}let s=o.stateSlot(e.state,4);if(s>0)return e.reduce(s),Yo&&console.log(a+this.stackID(e)+` (via always-reduce ${o.getName(s&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let c=0;ci?n.push(p):r.push(p)}return!1}advanceFully(e,n){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return Lq(e,n),!0}}runRecovery(e,n,r){let i=null,o=!1;for(let a=0;a ":"";if(s.deadEnd&&(o||(o=!0,s.restart(),Yo&&console.log(u+this.stackID(s)+" (restarted)"),this.advanceFully(s,r))))continue;let f=s.split(),d=u;for(let h=0;f.forceReduce()&&h<10&&(Yo&&console.log(d+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,r));h++)Yo&&(d=this.stackID(f)+" -> ");for(let h of s.recoverByInsert(l))Yo&&console.log(u+this.stackID(h)+" (via recover-insert)"),this.advanceFully(h,r);this.stream.end>s.pos?(c==s.pos&&(c++,l=0),s.recoverByDelete(l,c),Yo&&console.log(u+this.stackID(s)+` (via recover-delete ${this.parser.getName(l)})`),Lq(s,r)):(!i||i.scoret;class jpt{constructor(e){this.start=e.start,this.shift=e.shift||KR,this.reduce=e.reduce||KR,this.reuse=e.reuse||KR,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class f_ extends Jde{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let n=e.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let s=0;se.topRules[s][1]),i=[];for(let s=0;s=0)o(u,l,s[c++]);else{let f=s[c+-u];for(let d=-u;d>0;d--)o(s[c++],l,f);c++}}}this.nodeSet=new p4(n.map((s,l)=>Wo.define({name:l>=this.minRepeatTerm?void 0:s,id:l,props:i[l],top:r.indexOf(l)>-1,error:l==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(l)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Qde;let a=aO(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let s=0;stypeof s=="number"?new kg(a,s):s),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,n,r){let i=new Npt(this,e,n,r);for(let o of this.wrappers)i=o(i,e,n,r);return i}getGoto(e,n,r=!1){let i=this.goto;if(n>=i[0])return-1;for(let o=i[n+1];;){let a=i[o++],s=a&1,l=i[o++];if(s&&r)return l;for(let c=o+(a>>1);o0}validAction(e,n){return!!this.allActions(e,r=>r==n?!0:null)}allActions(e,n){let r=this.stateSlot(e,4),i=r?n(r):void 0;for(let o=this.stateSlot(e,1);i==null;o+=3){if(this.data[o]==65535)if(this.data[o+1]==1)o=Dc(this.data,o+2);else break;i=n(Dc(this.data,o+1))}return i}nextStates(e){let n=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=Dc(this.data,r+2);else break;if(!(this.data[r+2]&1)){let i=this.data[r+1];n.some((o,a)=>a&1&&o==i)||n.push(this.data[r],i)}}return n}configure(e){let n=Object.assign(Object.create(f_.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=r}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let i=e.tokenizers.find(o=>o.from==r);return i?i.to:r})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,i)=>{let o=e.specializers.find(s=>s.from==r.external);if(!o)return r;let a=Object.assign(Object.assign({},r),{external:o.to});return n.specializers[i]=$q(a),a})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let n=this.dynamicPrecedences;return n==null?0:n[e]||0}parseDialect(e){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(e)for(let o of e.split(" ")){let a=n.indexOf(o);a>=0&&(r[a]=!0)}let i=null;for(let o=0;or)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.scoret.external(n,r)<<1|e}return t.get}const zpt=y4({String:Te.string,Number:Te.number,"True False":Te.bool,PropertyName:Te.propertyName,Null:Te.null,",":Te.separator,"[ ]":Te.squareBracket,"{ }":Te.brace}),Upt=f_.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[zpt],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zOh~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yOg~~'OO]~~'TO[~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),Wpt=o_.define({name:"json",parser:Upt.configure({props:[b4.add({Object:Y7({except:/^\s*\}/}),Array:Y7({except:/^\s*\]/})}),w4.add({"Object Array":ahe})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function Tpe(){return new rhe(Wpt)}const Vpt=1,Epe=194,Ppe=195,Gpt=196,Nq=197,Hpt=198,qpt=199,Xpt=200,Qpt=2,Mpe=3,Fq=201,Ypt=24,Kpt=25,Zpt=49,Jpt=50,emt=55,tmt=56,nmt=57,rmt=59,imt=60,omt=61,amt=62,smt=63,lmt=65,cmt=238,umt=71,fmt=241,dmt=242,hmt=243,pmt=244,mmt=245,gmt=246,vmt=247,ymt=248,kpe=72,xmt=249,bmt=250,_mt=251,wmt=252,Smt=253,Omt=254,Cmt=255,Tmt=256,Emt=73,Pmt=77,Mmt=264,kmt=112,Amt=130,Rmt=151,Imt=152,Dmt=155,op=10,d_=13,F4=32,z2=9,j4=35,Lmt=40,$mt=46,G3=123,jq=125,Ape=39,Rpe=34,Nmt=92,Fmt=111,jmt=120,Bmt=78,zmt=117,Umt=85,Wmt=new Set([Kpt,Zpt,Jpt,Mmt,lmt,Amt,tmt,nmt,cmt,amt,smt,kpe,Emt,Pmt,imt,omt,Rmt,Imt,Dmt,kmt]);function ZR(t){return t==op||t==d_}function JR(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}const Vmt=new B2((t,e)=>{let n;if(t.next<0)t.acceptToken(qpt);else if(e.context.flags&zC)ZR(t.next)&&t.acceptToken(Hpt,1);else if(((n=t.peek(-1))<0||ZR(n))&&e.canShift(Nq)){let r=0;for(;t.next==F4||t.next==z2;)t.advance(),r++;(t.next==op||t.next==d_||t.next==j4)&&t.acceptToken(Nq,-r)}else ZR(t.next)&&t.acceptToken(Gpt,1)},{contextual:!0}),Gmt=new B2((t,e)=>{let n=e.context;if(n.flags)return;let r=t.peek(-1);if(r==op||r==d_){let i=0,o=0;for(;;){if(t.next==F4)i++;else if(t.next==z2)i+=8-i%8;else break;t.advance(),o++}i!=n.indent&&t.next!=op&&t.next!=d_&&t.next!=j4&&(i[t,e|Ipe])),Xmt=new jpt({start:Hmt,reduce(t,e,n,r){return t.flags&zC&&Wmt.has(e)||(e==umt||e==kpe)&&t.flags&Ipe?t.parent:t},shift(t,e,n,r){return e==Epe?new UC(t,qmt(r.read(r.pos,n.pos)),0):e==Ppe?t.parent:e==Ypt||e==emt||e==rmt||e==Mpe?new UC(t,0,zC):Bq.has(e)?new UC(t,0,Bq.get(e)|t.flags&zC):t},hash(t){return t.hash}}),Qmt=new B2(t=>{for(let e=0;e<5;e++){if(t.next!="print".charCodeAt(e))return;t.advance()}if(!/\w/.test(String.fromCharCode(t.next)))for(let e=0;;e++){let n=t.peek(e);if(!(n==F4||n==z2)){n!=Lmt&&n!=$mt&&n!=op&&n!=d_&&n!=j4&&t.acceptToken(Vpt);return}}}),Ymt=new B2((t,e)=>{let{flags:n}=e.context,r=n&Oc?Rpe:Ape,i=(n&Cc)>0,o=!(n&Tc),a=(n&Ec)>0,s=t.pos;for(;!(t.next<0);)if(a&&t.next==G3)if(t.peek(1)==G3)t.advance(2);else{if(t.pos==s){t.acceptToken(Mpe,1);return}break}else if(o&&t.next==Nmt){if(t.pos==s){t.advance();let l=t.next;l>=0&&(t.advance(),Kmt(t,l)),t.acceptToken(Qpt);return}break}else if(t.next==r&&(!i||t.peek(1)==r&&t.peek(2)==r)){if(t.pos==s){t.acceptToken(Fq,i?3:1);return}break}else if(t.next==op){if(i)t.advance();else if(t.pos==s){t.acceptToken(Fq);return}break}else t.advance();t.pos>s&&t.acceptToken(Xpt)});function Kmt(t,e){if(e==Fmt)for(let n=0;n<2&&t.next>=48&&t.next<=55;n++)t.advance();else if(e==jmt)for(let n=0;n<2&&JR(t.next);n++)t.advance();else if(e==zmt)for(let n=0;n<4&&JR(t.next);n++)t.advance();else if(e==Umt)for(let n=0;n<8&&JR(t.next);n++)t.advance();else if(e==Bmt&&t.next==G3){for(t.advance();t.next>=0&&t.next!=jq&&t.next!=Ape&&t.next!=Rpe&&t.next!=op;)t.advance();t.next==jq&&t.advance()}}const Zmt=y4({'async "*" "**" FormatConversion FormatSpec':Te.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":Te.controlKeyword,"in not and or is del":Te.operatorKeyword,"from def class global nonlocal lambda":Te.definitionKeyword,import:Te.moduleKeyword,"with as print":Te.keyword,Boolean:Te.bool,None:Te.null,VariableName:Te.variableName,"CallExpression/VariableName":Te.function(Te.variableName),"FunctionDefinition/VariableName":Te.function(Te.definition(Te.variableName)),"ClassDefinition/VariableName":Te.definition(Te.className),PropertyName:Te.propertyName,"CallExpression/MemberExpression/PropertyName":Te.function(Te.propertyName),Comment:Te.lineComment,Number:Te.number,String:Te.string,FormatString:Te.special(Te.string),Escape:Te.escape,UpdateOp:Te.updateOperator,"ArithOp!":Te.arithmeticOperator,BitOp:Te.bitwiseOperator,CompareOp:Te.compareOperator,AssignOp:Te.definitionOperator,Ellipsis:Te.punctuation,At:Te.meta,"( )":Te.paren,"[ ]":Te.squareBracket,"{ }":Te.brace,".":Te.derefOperator,", ;":Te.separator}),Jmt={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285},egt=f_.deserialize({version:14,states:"##pO`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E[OOQS'#E^'#E^O2wQdO'#E`O3_QdO'#EdO1XQdO'#EfO3rQtO'#EfO1XQdO'#EiO0rQdO'#ElO1XQdO'#EnO0rQdO'#EtO0rQdO'#EwO3}QdO'#EyO4UQdO'#FOO4aQdO'#EzO0rQdO'#FOO1XQdO'#FQO1XQdO'#FVO4fQdO'#F[P4mOdO'#GpPOOO)CBd)CBdOOQS'#Ce'#CeOOQS'#Cf'#CfOOQS'#Cg'#CgOOQS'#Ch'#ChOOQS'#Ci'#CiOOQS'#Cj'#CjOOQS'#Cl'#ClO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO4xQdO'#DoOOQS,5:Y,5:YO5]QdO'#HdOOQS,5:],5:]O5jQ!fO,5:]O5oQtO,59YO1lQdO,59bO1lQdO,59bO1lQdO,59bO8_QdO,59bO8dQdO,59bO8kQdO,59jO8rQdO'#HTO9xQdO'#HSOOQS'#HS'#HSOOQS'#D['#D[O:aQdO,59aO'vQdO,59aO:oQdO,59aOOQS,59y,59yO:tQdO,5:RO'vQdO,5:ROOQS,5:Q,5:QO;SQdO,5:QO;XQdO,5:XO'vQdO,5:XO'vQdO,5:VOOQS,5:U,5:UO;jQdO,5:UO;oQdO,5:WOOOW'#Fy'#FyO;tOWO,5:aOOQS,5:a,5:aOOOOQS'#Ds'#DsOOQS1G/w1G/wOOQS1G.|1G.|O!.mQtO1G.|O!.tQtO1G.|O1lQdO1G.|O!/aQdO1G/UOOQS'#DZ'#DZO0rQdO,59tOOQS1G.{1G.{O!/hQdO1G/eO!/xQdO1G/eO!0QQdO1G/fO'vQdO'#H[O!0VQdO'#H[O!0[QtO1G.{O!0lQdO,59iO!1rQdO,5=zO!2SQdO,5=zO!2[QdO1G/mO!2aQtO1G/mOOQS1G/l1G/lO!2qQdO,5=uO!3hQdO,5=uO0rQdO1G/qO!4VQdO1G/sO!4[QtO1G/sO!4lQtO1G/qOOQS1G/p1G/pOOQS1G/r1G/rOOOW-E9w-E9wOOQS1G/{1G/{O!4|QdO'#HxO0rQdO'#HxO!5_QdO,5>cOOOW-E9x-E9xOOQS1G/|1G/|OOQS-E9{-E9{O!5mQ#xO1G2zO!6^QtO1G2zO'vQdO,5iOOQS1G1`1G1`O!7^QdO1G1`OOQS'#DV'#DVO0rQdO,5=qOOQS,5=q,5=qO!7cQdO'#FrO!7nQdO,59oO!7vQdO1G/XO!8QQtO,5=uOOQS1G3`1G3`OOQS,5:m,5:mO!8qQdO'#GtOOQS,5lO!:sQdO,5>lO!;RQdO,5>hO!;iQdO,5>hO!;zQdO'#EpO0rQdO1G0tO!oO!D_QdO,5>oO!DgQtO,5>oO0rQdO1G1PO!DqQdO1G1PO4aQdO1G1UO!!_QdO1G1WOOQV,5;a,5;aO!DvQfO,5;aO!D{QgO1G1QO!H|QdO'#GZO4aQdO1G1QO4aQdO1G1QO!I^QdO,5>pO!IkQdO,5>pO1XQdO,5>pOOQV1G1U1G1UO!IsQdO'#FSO!JUQ!fO1G1WO!J^QdO1G1WOOQV1G1]1G1]O4aQdO1G1]O!JcQdO1G1]O!JkQdO'#F^OOQV1G1b1G1bO!!rQtO1G1bPOOO1G2v1G2vP!JpOSO1G2vOOQS,5=},5=}OOQS'#Dp'#DpO0rQdO,5=}O!JuQdO,5=|O!KYQdO,5=|OOQS1G/u1G/uO!KbQdO,5>PO!KrQdO,5>PO!KzQdO,5>PO!L_QdO,5>PO!LoQdO,5>POOQS1G3j1G3jOOQS7+$h7+$hO!7vQdO7+$pO!NbQdO1G.|O!NiQdO1G.|OOQS1G/`1G/`OOQS,5<`,5<`O'vQdO,5<`OOQS7+%P7+%PO!NpQdO7+%POOQS-E9r-E9rOOQS7+%Q7+%QO# QQdO,5=vO'vQdO,5=vOOQS7+$g7+$gO# VQdO7+%PO# _QdO7+%QO# dQdO1G3fOOQS7+%X7+%XO# tQdO1G3fO# |QdO7+%XOOQS,5<_,5<_O'vQdO,5<_O#!RQdO1G3aOOQS-E9q-E9qO#!xQdO7+%]OOQS7+%_7+%_O##WQdO1G3aO##uQdO7+%_O##zQdO1G3gO#$[QdO1G3gO#$dQdO7+%]O#$iQdO,5>dO#%SQdO,5>dO#%SQdO,5>dOOQS'#Dx'#DxO#%eO&jO'#DzO#%pO`O'#HyOOOW1G3}1G3}O#%uQdO1G3}O#%}QdO1G3}O#&YQ#xO7+(fO#&yQtO1G2UP#'dQdO'#GOOOQS,5e,5>eOOOW7+)i7+)iO#=gQdO7+)iO#=oQdO1G2zO#>YQdO1G2zP'vQdO'#FuO0rQdO<kQdO,5>kO#>|QdO,5>kO1XQdO,5>kO#?_QdO,5>jOOQS<mO#?rQdO,5>mOOQS1G0v1G0vOOQS<rO#IXQdO,5>rOOQS,5>r,5>rO#IdQdO,5>qO#IuQdO,5>qOOQS1G1Y1G1YOOQS,5;p,5;pOOQV<VAN>VO#MUQdO<cAN>cO0rQdO1G1|O#MfQtO1G1|P#MpQdO'#FvOOQS1G2R1G2RP#M}QdO'#F{O#N[QdO7+)jO#NuQdO,5>gOOOO-E9z-E9zOOOW<tO$4^QdO,5>tO1XQdO,5vO$'zQdO,5>vOOQS1G1p1G1pO$8UQtO,5<[OOQU7+'P7+'PO$*WQdO1G/iO$'zQdO,5wO$8dQdO,5>wOOQS1G1s1G1sOOQS7+'S7+'SP$'zQdO'#GdO$8lQdO1G4bO$8vQdO1G4bO$9OQdO1G4bOOQS7+%T7+%TO$9^QdO1G1tO$9lQtO'#FaO$9sQdO,5<}OOQS,5<},5<}O$:RQdO1G4cOOQS-E:a-E:aO$'zQdO,5<|O$:YQdO,5<|O$:_QdO7+)|OOQS-E:`-E:`O$:iQdO7+)|O$'zQdO,5PPP>S>t>wPP'Z'ZPP?WPP'Z'ZPP'Z'Z'Z'Z'Z?[@U'ZP@XP@_DfHSHWPHZHeHi'ZPPPHlHu'RP'R'RP'RP'RP'RP'RP'R'R'RP'RPP'RPP'RP'RPH{IXIaPIhInPIhPIhIhPPPIhPK|PLVLaLgK|PIhLpPIhPLwL}PMRMgNUNoMRMRNu! SMRMRMRMR! h! n! q! v! y!!T!!Z!!g!!y!#P!#Z!#a!#}!$T!$Z!$e!$k!$q!%T!%_!%e!%k!%q!%{!&R!&X!&_!&e!&o!&u!'P!'V!'`!'f!'u!'}!(X!(`PPPPPPPPPPP!(f!(i!(o!(x!)S!)_PPPPPPPPPPPP!.R!/g!3g!6wPP!7P!7`!7i!8b!8X!8k!8q!8t!8w!8z!9S!9sPPPPPPPPPPPPPPPPP!9v!9z!:QP!:f!:j!:v!;S!;Y!;c!;f!;i!;o!;u!;{!_![!]Do!]!^Es!^!_FZ!_!`Gk!`!aHX!a!b%T!b!cIf!c!dJU!d!eK^!e!hJU!h!i!#f!i!tJU!t!u!,|!u!wJU!w!x!.t!x!}JU!}#O!0S#O#P&o#P#Q!0j#Q#R!1Q#R#SJU#S#T%T#T#UJU#U#VK^#V#YJU#Y#Z!#f#Z#fJU#f#g!,|#g#iJU#i#j!.t#j#oJU#o#p!1n#p#q!1s#q#r!2a#r#s!2f#s$g%T$g;'SJU;'S;=`KW<%lOJU`%YT&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T`%lP;=`<%l%To%v]&n`%c_OX%TXY%oY[%T[]%o]p%Tpq%oq#O%T#O#P&o#P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To&tX&n`OY%TYZ%oZ]%T]^%o^#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc'f[&n`O!_%T!_!`([!`#T%T#T#U(r#U#f%T#f#g(r#g#h(r#h#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(cTmR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(yT!mR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk)aV&n`&[ZOr%Trs)vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk){V&n`Or%Trs*bs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk*iT&n`&^ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To+PZS_&n`OY*xYZ%TZ]*x]^%T^#o*x#o#p+r#p#q*x#q#r+r#r;'S*x;'S;=`,^<%lO*x_+wTS_OY+rZ]+r^;'S+r;'S;=`,W<%lO+r_,ZP;=`<%l+ro,aP;=`<%l*xj,kV%rQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-XT!xY&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-oV%lQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.]V&n`&ZZOw%Twx.rx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.wV&n`Ow%Twx/^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/eT&n`&]ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/{ThZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc0cTgR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk0yXVZ&n`Oz%Tz{1f{!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk1mVaR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk2ZV%oZ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc2wTzR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To3_W%pZ&n`O!_%T!_!`-Q!`!a3w!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Td4OT&{S&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk4fX!fQ&n`O!O%T!O!P5R!P!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5WV&n`O!O%T!O!P5m!P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5tT!rZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti6[a!hX&n`O!Q%T!Q![6T![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S6T#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti7fZ&n`O{%T{|8X|}%T}!O8X!O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8^V&n`O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8z]!hX&n`O!Q%T!Q![8s![!l%T!l!m9s!m#R%T#R#S8s#S#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti9zT!hX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk:bX%qR&n`O!P%T!P!Q:}!Q!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj;UV%sQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti;ro!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!d%T!d!e?q!e!g%T!g!h7a!h!l%T!l!m9s!m!q%T!q!rA]!r!z%T!z!{Bq!{#R%T#R#S>_#S#U%T#U#V?q#V#X%T#X#Y7a#Y#^%T#^#_9s#_#c%T#c#dA]#d#l%T#l#mBq#m#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti=xV&n`O!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti>fc!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S>_#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti?vY&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti@mY!hX&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiAbX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBUX!hX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBv]&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiCv]!hX&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToDvV{_&n`O!_%T!_!`E]!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TcEdT%{R&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkEzT#gZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkFbXmR&n`O!^%T!^!_F}!_!`([!`!a([!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjGUV%mQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkGrV%zZ&n`O!_%T!_!`([!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkH`WmR&n`O!_%T!_!`([!`!aHx!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjIPV%nQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkIoV_Q#}P&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToJ_]&n`&YS%uZO!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoKZP;=`<%lJUoKge&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!tJU!t!uLx!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#gLx#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoMRa&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUkN_V&n`&`ZOr%TrsNts#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkNyV&n`Or%Trs! `s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! gT&n`&bZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! }V&n`&_ZOw%Twx!!dx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!!iV&n`Ow%Twx!#Ox#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!#VT&n`&aZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!#oe&n`&YS%uZOr%Trs!%Qsw%Twx!&px!Q%T!Q![JU![!c%T!c!tJU!t!u!(`!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#g!(`#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!%XV&n`&dZOr%Trs!%ns#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!%sV&n`Or%Trs!&Ys#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&aT&n`&fZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&wV&n`&cZOw%Twx!'^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!'cV&n`Ow%Twx!'xx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!(PT&n`&eZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!(ia&n`&YS%uZOr%Trs!)nsw%Twx!+^x!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!)uV&n`&hZOr%Trs!*[s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*aV&n`Or%Trs!*vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*}T&n`&jZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!+eV&n`&gZOw%Twx!+zx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,PV&n`Ow%Twx!,fx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,mT&n`&iZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!-Vi&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!dJU!d!eLx!e!hJU!h!i!(`!i!}JU!}#R%T#R#SJU#S#T%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[Qmt,Gmt,Vmt,Ymt,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:t=>Jmt[t]||-1}],tokenPrec:7646}),zq=new _ut,Dpe=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function sO(t){return(e,n,r)=>{if(r)return!1;let i=e.node.getChild("VariableName");return i&&n(i,t),!0}}const tgt={FunctionDefinition:sO("function"),ClassDefinition:sO("class"),ForStatement(t,e,n){if(n){for(let r=t.node.firstChild;r;r=r.nextSibling)if(r.name=="VariableName")e(r,"variable");else if(r.name=="in")break}},ImportStatement(t,e){var n,r;let{node:i}=t,o=((n=i.firstChild)===null||n===void 0?void 0:n.name)=="from";for(let a=i.getChild("import");a;a=a.nextSibling)a.name=="VariableName"&&((r=a.nextSibling)===null||r===void 0?void 0:r.name)!="as"&&e(a,o?"variable":"namespace")},AssignStatement(t,e){for(let n=t.node.firstChild;n;n=n.nextSibling)if(n.name=="VariableName")e(n,"variable");else if(n.name==":"||n.name=="AssignOp")break},ParamList(t,e){for(let n=null,r=t.node.firstChild;r;r=r.nextSibling)r.name=="VariableName"&&(!n||!/\*|AssignOp/.test(n.name))&&e(r,"variable"),n=r},CapturePattern:sO("variable"),AsPattern:sO("variable"),__proto__:null};function Lpe(t,e){let n=zq.get(e);if(n)return n;let r=[],i=!0;function o(a,s){let l=t.sliceString(a.from,a.to);r.push({label:l,type:s})}return e.cursor(Zr.IncludeAnonymous).iterate(a=>{if(a.name){let s=tgt[a.name];if(s&&s(a,o,i)||!i&&Dpe.has(a.name))return!1;i=!1}else if(a.to-a.from>8192){for(let s of Lpe(t,a.node))r.push(s);return!1}}),zq.set(e,r),r}const Uq=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,$pe=["String","FormatString","Comment","PropertyName"];function ngt(t){let e=ui(t.state).resolveInner(t.pos,-1);if($pe.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&Uq.test(t.state.sliceDoc(e.from,e.to));if(!n&&!t.explicit)return null;let r=[];for(let i=e;i;i=i.parent)Dpe.has(i.name)&&(r=r.concat(Lpe(t.state.doc,i)));return{options:r,from:n?e.from:t.pos,validFor:Uq}}const rgt=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(t=>({label:t,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(t=>({label:t,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(t=>({label:t,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(t=>({label:t,type:"function"}))),igt=[mc("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),mc("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),mc("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),mc("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),mc(`if \${}: +`){[e,n]=iv(this,e,n);let i="";for(let o=0,a=0;oe&&o&&(i+=r),ea&&(i+=s.sliceString(e-a,n-a,r)),a=l+1}return i}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof Ol))return 0;let r=0,[i,o,a,s]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=n,o+=n){if(i==a||o==s)return r;let l=this.children[i],c=e.children[o];if(l!=c)return r+l.scanIdentical(c,n);r+=l.length+1}}static from(e,n=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let h of e)r+=h.lines;if(r<32){let h=[];for(let p of e)p.flatten(h);return new Cr(h,n)}let i=Math.max(32,r>>5),o=i<<1,a=i>>1,s=[],l=0,c=-1,u=[];function f(h){let p;if(h.lines>o&&h instanceof Ol)for(let m of h.children)f(m);else h.lines>a&&(l>a||!l)?(d(),s.push(h)):h instanceof Cr&&l&&(p=u[u.length-1])instanceof Cr&&h.lines+p.lines<=32?(l+=h.lines,c+=h.length+1,u[u.length-1]=new Cr(p.text.concat(h.text),p.length+1+h.length)):(l+h.lines>i&&d(),l+=h.lines,c+=h.length+1,u.push(h))}function d(){l!=0&&(s.push(u.length==1?u[0]:Ol.from(u,c)),c=-1,l=u.length=0)}for(let h of e)f(h);return d(),s.length==1?s[0]:new Ol(s,n)}}Sn.empty=new Cr([""],0);function Sst(t){let e=-1;for(let n of t)e+=n.length+1;return e}function kC(t,e,n=0,r=1e9){for(let i=0,o=0,a=!0;o=n&&(l>r&&(s=s.slice(0,r-i)),i0?1:(e instanceof Cr?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],o=this.offsets[r],a=o>>1,s=i instanceof Cr?i.text.length:i.children.length;if(a==(n>0?s:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((o&1)==(n>0?0:1)){if(this.offsets[r]+=n,e==0)return this.lineBreak=!0,this.value=` +`,this;e--}else if(i instanceof Cr){let l=i.text[a+(n<0?-1:0)];if(this.offsets[r]+=n,l.length>Math.max(0,e))return this.value=e==0?l:n>0?l.slice(e):l.slice(0,l.length-e),this;e-=l.length}else{let l=i.children[a+(n<0?-1:0)];e>l.length?(e-=l.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(l),this.offsets.push(n>0?1:(l instanceof Cr?l.text.length:l.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Ofe{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new Yx(e,n>r?-1:1),this.pos=n>r?e.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*n,this.value=i.length<=r?i:n<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Cfe{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:r,value:i}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Sn.prototype[Symbol.iterator]=function(){return this.iter()},Yx.prototype[Symbol.iterator]=Ofe.prototype[Symbol.iterator]=Cfe.prototype[Symbol.iterator]=function(){return this});let Ost=class{constructor(e,n,r,i){this.from=e,this.to=n,this.number=r,this.text=i}get length(){return this.to-this.from}};function iv(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}let Og="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(t=>t?parseInt(t,36):1);for(let t=1;tt)return Og[e-1]<=t;return!1}function V9(t){return t>=127462&&t<=127487}const G9=8205;function ki(t,e,n=!0,r=!0){return(n?Tfe:Tst)(t,e,r)}function Tfe(t,e,n){if(e==t.length)return e;e&&Efe(t.charCodeAt(e))&&Pfe(t.charCodeAt(e-1))&&e--;let r=Ci(t,e);for(e+=Ga(r);e=0&&V9(Ci(t,a));)o++,a-=2;if(o%2==0)break;e+=2}else break}return e}function Tst(t,e,n){for(;e>0;){let r=Tfe(t,e-2,n);if(r=56320&&t<57344}function Pfe(t){return t>=55296&&t<56320}function Ci(t,e){let n=t.charCodeAt(e);if(!Pfe(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return Efe(r)?(n-55296<<10)+(r-56320)+65536:n}function r4(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function Ga(t){return t<65536?1:2}const Y$=/\r\n?|\n/;var Pi=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(Pi||(Pi={}));class Hl{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;ne)return o+(e-i);o+=s}else{if(r!=Pi.Simple&&c>=e&&(r==Pi.TrackDel&&ie||r==Pi.TrackBefore&&ie))return null;if(c>e||c==e&&n<0&&!s)return e==i||n<0?o:o+l;o+=l}i=c}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return o}touchesRange(e,n=e){for(let r=0,i=0;r=0&&i<=n&&s>=e)return in?"cover":!0;i=s}return!1}toString(){let e="";for(let n=0;n=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Hl(e)}static create(e){return new Hl(e)}}class Kr extends Hl{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return K$(this,(n,r,i,o,a)=>e=e.replace(i,i+(r-n),a),!1),e}mapDesc(e,n=!1){return Z$(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let i=0,o=0;i=0){n[i]=s,n[i+1]=a;let l=i>>1;for(;r.length0&&xf(r,n,o.text),o.forward(u),s+=u}let c=e[a++];for(;s>1].toJSON()))}return e}static of(e,n,r){let i=[],o=[],a=0,s=null;function l(u=!1){if(!u&&!i.length)return;ad||f<0||d>n)throw new RangeError(`Invalid change range ${f} to ${d} (in doc of length ${n})`);let p=h?typeof h=="string"?Sn.of(h.split(r||Y$)):h:Sn.empty,m=p.length;if(f==d&&m==0)return;fa&&qi(i,f-a,-1),qi(i,d-f,m),xf(o,i,p),a=d}}return c(e),l(!s),s}static empty(e){return new Kr(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let i=0;is&&typeof a!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(o.length==1)n.push(o[0],0);else{for(;r.length=0&&n<=0&&n==t[i+1]?t[i]+=e:e==0&&t[i]==0?t[i+1]+=n:r?(t[i]+=e,t[i+1]+=n):t.push(e,n)}function xf(t,e,n){if(n.length==0)return;let r=e.length-2>>1;if(r>1])),!(n||a==t.sections.length||t.sections[a+1]<0);)s=t.sections[a++],l=t.sections[a++];e(i,c,o,u,f),i=c,o=u}}}function Z$(t,e,n,r=!1){let i=[],o=r?[]:null,a=new Kb(t),s=new Kb(e);for(let l=-1;;)if(a.ins==-1&&s.ins==-1){let c=Math.min(a.len,s.len);qi(i,c,-1),a.forward(c),s.forward(c)}else if(s.ins>=0&&(a.ins<0||l==a.i||a.off==0&&(s.len=0&&l=0){let c=0,u=a.len;for(;u;)if(s.ins==-1){let f=Math.min(u,s.len);c+=f,u-=f,s.forward(f)}else if(s.ins==0&&s.lenl||a.ins>=0&&a.len>l)&&(s||r.length>c),o.forward2(l),a.forward(l)}}}}class Kb{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return n>=e.length?Sn.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?Sn.empty:n[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class vh{constructor(e,n,r){this.from=e,this.to=n,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,n=-1){let r,i;return this.empty?r=i=e.mapPos(this.from,n):(r=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new vh(r,i,this.flags)}extend(e,n=e){if(e<=this.anchor&&n>=this.anchor)return je.range(e,n);let r=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return je.range(this.anchor,r)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return je.range(e.anchor,e.head)}static create(e,n,r){return new vh(e,n,r)}}class je{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:je.create(this.ranges.map(r=>r.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;re.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new je(e.ranges.map(n=>vh.fromJSON(n)),e.main)}static single(e,n=e){return new je([je.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;ie?8:0)|o)}static normalized(e,n=0){let r=e[n];e.sort((i,o)=>i.from-o.from),n=e.indexOf(r);for(let i=1;io.head?je.range(l,s):je.range(s,l))}}return new je(e,n)}}function kfe(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let i4=0;class ft{constructor(e,n,r,i,o){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=i4++,this.default=e([]),this.extensions=typeof o=="function"?o(this):o}get reader(){return this}static define(e={}){return new ft(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:o4),!!e.static,e.enables)}of(e){return new AC([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new AC(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new AC(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function o4(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class AC{constructor(e,n,r,i){this.dependencies=e,this.facet=n,this.type=r,this.value=i,this.id=i4++}dynamicSlot(e){var n;let r=this.value,i=this.facet.compareInput,o=this.id,a=e[o]>>1,s=this.type==2,l=!1,c=!1,u=[];for(let f of this.dependencies)f=="doc"?l=!0:f=="selection"?c=!0:((n=e[f.id])!==null&&n!==void 0?n:1)&1||u.push(e[f.id]);return{create(f){return f.values[a]=r(f),1},update(f,d){if(l&&d.docChanged||c&&(d.docChanged||d.selection)||J$(f,u)){let h=r(f);if(s?!H9(h,f.values[a],i):!i(h,f.values[a]))return f.values[a]=h,1}return 0},reconfigure:(f,d)=>{let h,p=d.config.address[o];if(p!=null){let m=sE(d,p);if(this.dependencies.every(g=>g instanceof ft?d.facet(g)===f.facet(g):g instanceof pi?d.field(g,!1)==f.field(g,!1):!0)||(s?H9(h=r(f),m,i):i(h=r(f),m)))return f.values[a]=m,0}else h=r(f);return f.values[a]=h,1}}}}function H9(t,e,n){if(t.length!=e.length)return!1;for(let r=0;rt[l.id]),i=n.map(l=>l.type),o=r.filter(l=>!(l&1)),a=t[e.id]>>1;function s(l){let c=[];for(let u=0;ur===i),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(q9).find(r=>r.field==this);return((n==null?void 0:n.create)||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,i)=>{let o=r.values[n],a=this.updateF(o,i);return this.compareF(o,a)?0:(r.values[n]=a,1)},reconfigure:(r,i)=>i.config.address[this.id]!=null?(r.values[n]=i.field(this),0):(r.values[n]=this.create(r),1)}}init(e){return[this,q9.of({field:this,create:e})]}get extension(){return this}}const ih={lowest:4,low:3,default:2,high:1,highest:0};function E0(t){return e=>new Afe(e,t)}const bd={highest:E0(ih.highest),high:E0(ih.high),default:E0(ih.default),low:E0(ih.low),lowest:E0(ih.lowest)};class Afe{constructor(e,n){this.inner=e,this.prec=n}}class T2{of(e){return new e3(this,e)}reconfigure(e){return T2.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class e3{constructor(e,n){this.compartment=e,this.inner=n}}class aE{constructor(e,n,r,i,o,a){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=o,this.facets=a,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,n,r){let i=[],o=Object.create(null),a=new Map;for(let d of Pst(e,n,a))d instanceof pi?i.push(d):(o[d.facet.id]||(o[d.facet.id]=[])).push(d);let s=Object.create(null),l=[],c=[];for(let d of i)s[d.id]=c.length<<1,c.push(h=>d.slot(h));let u=r==null?void 0:r.config.facets;for(let d in o){let h=o[d],p=h[0].facet,m=u&&u[d]||[];if(h.every(g=>g.type==0))if(s[p.id]=l.length<<1|1,o4(m,h))l.push(r.facet(p));else{let g=p.combine(h.map(v=>v.value));l.push(r&&p.compare(g,r.facet(p))?r.facet(p):g)}else{for(let g of h)g.type==0?(s[g.id]=l.length<<1|1,l.push(g.value)):(s[g.id]=c.length<<1,c.push(v=>g.dynamicSlot(v)));s[p.id]=c.length<<1,c.push(g=>Est(g,p,h))}}let f=c.map(d=>d(s));return new aE(e,a,f,s,l,o)}}function Pst(t,e,n){let r=[[],[],[],[],[]],i=new Map;function o(a,s){let l=i.get(a);if(l!=null){if(l<=s)return;let c=r[l].indexOf(a);c>-1&&r[l].splice(c,1),a instanceof e3&&n.delete(a.compartment)}if(i.set(a,s),Array.isArray(a))for(let c of a)o(c,s);else if(a instanceof e3){if(n.has(a.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(a.compartment)||a.inner;n.set(a.compartment,c),o(c,s)}else if(a instanceof Afe)o(a.inner,a.prec);else if(a instanceof pi)r[s].push(a),a.provides&&o(a.provides,s);else if(a instanceof AC)r[s].push(a),a.facet.extensions&&o(a.facet.extensions,ih.default);else{let c=a.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${a}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);o(c,s)}}return o(t,ih.default),r.reduce((a,s)=>a.concat(s))}function Kx(t,e){if(e&1)return 2;let n=e>>1,r=t.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;t.status[n]=4;let i=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|i}function sE(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const Rfe=ft.define(),t3=ft.define({combine:t=>t.some(e=>e),static:!0}),Ife=ft.define({combine:t=>t.length?t[0]:void 0,static:!0}),Dfe=ft.define(),Lfe=ft.define(),$fe=ft.define(),Nfe=ft.define({combine:t=>t.length?t[0]:!1});class oc{constructor(e,n){this.type=e,this.value=n}static define(){return new Mst}}class Mst{of(e){return new oc(this,e)}}class kst{constructor(e){this.map=e}of(e){return new It(this,e)}}class It{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new It(this.type,n)}is(e){return this.type==e}static define(e={}){return new kst(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let r=[];for(let i of e){let o=i.map(n);o&&r.push(o)}return r}}It.reconfigure=It.define();It.appendConfig=It.define();class Br{constructor(e,n,r,i,o,a){this.startState=e,this.changes=n,this.selection=r,this.effects=i,this.annotations=o,this.scrollIntoView=a,this._doc=null,this._state=null,r&&kfe(r,n.newLength),o.some(s=>s.type==Br.time)||(this.annotations=o.concat(Br.time.of(Date.now())))}static create(e,n,r,i,o,a){return new Br(e,n,r,i,o,a)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(Br.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}Br.time=oc.define();Br.userEvent=oc.define();Br.addToHistory=oc.define();Br.remote=oc.define();function Ast(t,e){let n=[];for(let r=0,i=0;;){let o,a;if(r=t[r]))o=t[r++],a=t[r++];else if(i=0;i--){let o=r[i](t);o instanceof Br?t=o:Array.isArray(o)&&o.length==1&&o[0]instanceof Br?t=o[0]:t=jfe(e,Cg(o),!1)}return t}function Ist(t){let e=t.startState,n=e.facet($fe),r=t;for(let i=n.length-1;i>=0;i--){let o=n[i](t);o&&Object.keys(o).length&&(r=Ffe(r,n3(e,o,t.changes.newLength),!0))}return r==t?t:Br.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const Dst=[];function Cg(t){return t==null?Dst:Array.isArray(t)?t:[t]}var ur=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(ur||(ur={}));const Lst=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let r3;try{r3=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function $st(t){if(r3)return r3.test(t);for(let e=0;e"€"&&(n.toUpperCase()!=n.toLowerCase()||Lst.test(n)))return!0}return!1}function Nst(t){return e=>{if(!/\S/.test(e))return ur.Space;if($st(e))return ur.Word;for(let n=0;n-1)return ur.Word;return ur.Other}}class en{constructor(e,n,r,i,o,a){this.config=e,this.doc=n,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=o,a&&(a._state=this);for(let s=0;si.set(c,l)),n=null),i.set(s.value.compartment,s.value.extension)):s.is(It.reconfigure)?(n=null,r=s.value):s.is(It.appendConfig)&&(n=null,r=Cg(r).concat(s.value));let o;n?o=e.startState.values.slice():(n=aE.resolve(r,i,this),o=new en(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(l,c)=>c.reconfigure(l,this),null).values);let a=e.startState.facet(t3)?e.newSelection:e.newSelection.asSingle();new en(n,e.newDoc,a,o,(s,l)=>l.update(s,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:je.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,r=e(n.ranges[0]),i=this.changes(r.changes),o=[r.range],a=Cg(r.effects);for(let s=1;sa.spec.fromJSON(s,l)))}}return en.create({doc:e.doc,selection:je.fromJSON(e.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(e={}){let n=aE.resolve(e.extensions||[],new Map),r=e.doc instanceof Sn?e.doc:Sn.of((e.doc||"").split(n.staticFacet(en.lineSeparator)||Y$)),i=e.selection?e.selection instanceof je?e.selection:je.single(e.selection.anchor,e.selection.head):je.single(0);return kfe(i,r.length),n.staticFacet(t3)||(i=i.asSingle()),new en(n,r,i,n.dynamicSlots.map(()=>null),(o,a)=>a.create(o),null)}get tabSize(){return this.facet(en.tabSize)}get lineBreak(){return this.facet(en.lineSeparator)||` +`}get readOnly(){return this.facet(Nfe)}phrase(e,...n){for(let r of this.facet(en.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let o=+(i||1);return!o||o>n.length?r:n[o-1]})),e}languageDataAt(e,n,r=-1){let i=[];for(let o of this.facet(Rfe))for(let a of o(this,n,r))Object.prototype.hasOwnProperty.call(a,e)&&i.push(a[e]);return i}charCategorizer(e){return Nst(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:n,from:r,length:i}=this.doc.lineAt(e),o=this.charCategorizer(e),a=e-r,s=e-r;for(;a>0;){let l=ki(n,a,!1);if(o(n.slice(l,a))!=ur.Word)break;a=l}for(;st.length?t[0]:4});en.lineSeparator=Ife;en.readOnly=Nfe;en.phrases=ft.define({compare(t,e){let n=Object.keys(t),r=Object.keys(e);return n.length==r.length&&n.every(i=>t[i]==e[i])}});en.languageData=Rfe;en.changeFilter=Dfe;en.transactionFilter=Lfe;en.transactionExtender=$fe;T2.reconfigure=It.define();function ac(t,e,n={}){let r={};for(let i of t)for(let o of Object.keys(i)){let a=i[o],s=r[o];if(s===void 0)r[o]=a;else if(!(s===a||a===void 0))if(Object.hasOwnProperty.call(n,o))r[o]=n[o](s,a);else throw new Error("Config merge conflict for field "+o)}for(let i in e)r[i]===void 0&&(r[i]=e[i]);return r}class ep{eq(e){return this==e}range(e,n=e){return i3.create(e,n,this)}}ep.prototype.startSide=ep.prototype.endSide=0;ep.prototype.point=!1;ep.prototype.mapMode=Pi.TrackDel;let i3=class Bfe{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new Bfe(e,n,r)}};function o3(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class a4{constructor(e,n,r,i){this.from=e,this.to=n,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,n,r,i=0){let o=r?this.to:this.from;for(let a=i,s=o.length;;){if(a==s)return a;let l=a+s>>1,c=o[l]-e||(r?this.value[l].endSide:this.value[l].startSide)-n;if(l==a)return c>=0?a:s;c>=0?s=l:a=l+1}}between(e,n,r,i){for(let o=this.findIndex(n,-1e9,!0),a=this.findIndex(r,1e9,!1,o);oh||d==h&&c.startSide>0&&c.endSide<=0)continue;(h-d||c.endSide-c.startSide)<0||(a<0&&(a=d),c.point&&(s=Math.max(s,h-d)),r.push(c),i.push(d-a),o.push(h-a))}return{mapped:r.length?new a4(i,o,r,s):null,pos:a}}}class sn{constructor(e,n,r,i){this.chunkPos=e,this.chunk=n,this.nextLayer=r,this.maxPoint=i}static create(e,n,r,i){return new sn(e,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:o=this.length}=e,a=e.filter;if(n.length==0&&!a)return this;if(r&&(n=n.slice().sort(o3)),this.isEmpty)return n.length?sn.of(n):this;let s=new zfe(this,null,-1).goto(0),l=0,c=[],u=new Jf;for(;s.value||l=0){let f=n[l++];u.addInner(f.from,f.to,f.value)||c.push(f)}else s.rangeIndex==1&&s.chunkIndexthis.chunkEnd(s.chunkIndex)||os.to||o=o&&e<=o+a.length&&a.between(o,e-o,n-o,r)===!1)return}this.nextLayer.between(e,n,r)}}iter(e=0){return Zb.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return Zb.from(e).goto(n)}static compare(e,n,r,i,o=-1){let a=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=o),s=n.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=o),l=X9(a,s,r),c=new P0(a,l,o),u=new P0(s,l,o);r.iterGaps((f,d,h)=>Q9(c,f,u,d,h,i)),r.empty&&r.length==0&&Q9(c,0,u,0,0,i)}static eq(e,n,r=0,i){i==null&&(i=999999999);let o=e.filter(u=>!u.isEmpty&&n.indexOf(u)<0),a=n.filter(u=>!u.isEmpty&&e.indexOf(u)<0);if(o.length!=a.length)return!1;if(!o.length)return!0;let s=X9(o,a),l=new P0(o,s,0).goto(r),c=new P0(a,s,0).goto(r);for(;;){if(l.to!=c.to||!a3(l.active,c.active)||l.point&&(!c.point||!l.point.eq(c.point)))return!1;if(l.to>i)return!0;l.next(),c.next()}}static spans(e,n,r,i,o=-1){let a=new P0(e,null,o).goto(n),s=n,l=a.openStart;for(;;){let c=Math.min(a.to,r);if(a.point){let u=a.activeForPoint(a.to),f=a.pointFroms&&(i.span(s,c,a.active,l),l=a.openEnd(c));if(a.to>r)return l+(a.point&&a.to>r?1:0);s=a.to,a.next()}}static of(e,n=!1){let r=new Jf;for(let i of e instanceof i3?[e]:n?Fst(e):e)r.add(i.from,i.to,i.value);return r.finish()}static join(e){if(!e.length)return sn.empty;let n=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let i=e[r];i!=sn.empty;i=i.nextLayer)n=new sn(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}}sn.empty=new sn([],[],null,-1);function Fst(t){if(t.length>1)for(let e=t[0],n=1;n0)return t.slice().sort(o3);e=r}return t}sn.empty.nextLayer=sn.empty;class Jf{finishChunk(e){this.chunks.push(new a4(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,n,r){this.addInner(e,n,r)||(this.nextLayer||(this.nextLayer=new Jf)).add(e,n,r)}addInner(e,n,r){let i=e-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(e);let r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+e,this.lastTo=n.to[r]+e,!0}finish(){return this.finishInner(sn.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=sn.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function X9(t,e,n){let r=new Map;for(let o of t)for(let a=0;a=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=r&&i.push(new zfe(a,n,r,o));return i.length==1?i[0]:new Zb(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let r of this.heap)r.goto(e,n);for(let r=this.heap.length>>1;r>=0;r--)CR(this.heap,r);return this.next(),this}forward(e,n){for(let r of this.heap)r.forward(e,n);for(let r=this.heap.length>>1;r>=0;r--)CR(this.heap,r);(this.to-e||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),CR(this.heap,0)}}}function CR(t,e){for(let n=t[e];;){let r=(e<<1)+1;if(r>=t.length)break;let i=t[r];if(r+1=0&&(i=t[r+1],r++),n.compare(i)<0)break;t[r]=n,t[e]=i,e=r}}class P0{constructor(e,n,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Zb.from(e,n,r)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){FS(this.active,e),FS(this.activeTo,e),FS(this.activeRank,e),this.minActive=Y9(this.active,this.activeTo)}addActive(e){let n=0,{value:r,to:i,rank:o}=this.cursor;for(;n0;)n++;jS(this.active,n,r),jS(this.activeTo,n,i),jS(this.activeRank,n,o),e&&jS(e,n,this.cursor.from),this.minActive=Y9(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&FS(r,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let o=this.cursor.value;if(!o.point)this.addActive(r),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from=0&&r[i]=0&&!(this.activeRank[r]e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(e){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)n++;return n}}function Q9(t,e,n,r,i,o){t.goto(e),n.goto(r);let a=r+i,s=r,l=r-e;for(;;){let c=t.to+l-n.to||t.endSide-n.endSide,u=c<0?t.to+l:n.to,f=Math.min(u,a);if(t.point||n.point?t.point&&n.point&&(t.point==n.point||t.point.eq(n.point))&&a3(t.activeForPoint(t.to),n.activeForPoint(n.to))||o.comparePoint(s,f,t.point,n.point):f>s&&!a3(t.active,n.active)&&o.compareRange(s,f,t.active,n.active),u>a)break;s=u,c<=0&&t.next(),c>=0&&n.next()}}function a3(t,e){if(t.length!=e.length)return!1;for(let n=0;n=e;r--)t[r+1]=t[r];t[e]=n}function Y9(t,e){let n=-1,r=1e9;for(let i=0;i=e)return i;if(i==t.length)break;o+=t.charCodeAt(i)==9?n-o%n:1,i=ki(t,i)}return r===!0?-1:t.length}const l3="ͼ",K9=typeof Symbol>"u"?"__"+l3:Symbol.for(l3),c3=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Z9=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class ed{constructor(e,n){this.rules=[];let{finish:r}=n||{};function i(a){return/^@/.test(a)?[a]:a.split(/,\s*/)}function o(a,s,l,c){let u=[],f=/^@(\w+)\b/.exec(a[0]),d=f&&f[1]=="keyframes";if(f&&s==null)return l.push(a[0]+";");for(let h in s){let p=s[h];if(/&/.test(h))o(h.split(/,\s*/).map(m=>a.map(g=>m.replace(/&/,g))).reduce((m,g)=>m.concat(g)),p,l);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+h+") should be a primitive value.");o(i(h),p,u,d)}else p!=null&&u.push(h.replace(/_.*/,"").replace(/[A-Z]/g,m=>"-"+m.toLowerCase())+": "+p+";")}(u.length||d)&&l.push((r&&!f&&!c?a.map(r):a).join(", ")+" {"+u.join(" ")+"}")}for(let a in e)o(i(a),e[a],this.rules)}getRules(){return this.rules.join(` +`)}static newName(){let e=Z9[K9]||1;return Z9[K9]=e+1,l3+e.toString(36)}static mount(e,n,r){let i=e[c3],o=r&&r.nonce;i?o&&i.setNonce(o):i=new jst(e,o),i.mount(Array.isArray(n)?n:[n],e)}}let J9=new Map;class jst{constructor(e,n){let r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let o=J9.get(r);if(o)return e[c3]=o;this.sheet=new i.CSSStyleSheet,J9.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[c3]=this}mount(e,n){let r=this.sheet,i=0,o=0;for(let a=0;a-1&&(this.modules.splice(l,1),o--,l=-1),l==-1){if(this.modules.splice(o++,0,s),r)for(let c=0;c",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Bst=typeof navigator<"u"&&/Mac/.test(navigator.platform),zst=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Ti=0;Ti<10;Ti++)td[48+Ti]=td[96+Ti]=String(Ti);for(var Ti=1;Ti<=24;Ti++)td[Ti+111]="F"+Ti;for(var Ti=65;Ti<=90;Ti++)td[Ti]=String.fromCharCode(Ti+32),Jb[Ti]=String.fromCharCode(Ti);for(var TR in td)Jb.hasOwnProperty(TR)||(Jb[TR]=td[TR]);function Ust(t){var e=Bst&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||zst&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Jb:td)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function lE(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function u3(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function Wst(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function RC(t,e){if(!e.anchorNode)return!1;try{return u3(t,e.anchorNode)}catch{return!1}}function ov(t){return t.nodeType==3?np(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function Zx(t,e,n,r){return n?e7(t,e,n,r,-1)||e7(t,e,n,r,1):!1}function tp(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function cE(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function e7(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:uu(t))){if(t.nodeName=="DIV")return!1;let o=t.parentNode;if(!o||o.nodeType!=1)return!1;e=tp(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=i<0?uu(t):0}else return!1}}function uu(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function E2(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function Vst(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function Ufe(t,e){let n=e.width/t.offsetWidth,r=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-t.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function Gst(t,e,n,r,i,o,a,s){let l=t.ownerDocument,c=l.defaultView||window;for(let u=t,f=!1;u&&!f;)if(u.nodeType==1){let d,h=u==l.body,p=1,m=1;if(h)d=Vst(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(f=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let y=u.getBoundingClientRect();({scaleX:p,scaleY:m}=Ufe(u,y)),d={left:y.left,right:y.left+u.clientWidth*p,top:y.top,bottom:y.top+u.clientHeight*m}}let g=0,v=0;if(i=="nearest")e.top0&&e.bottom>d.bottom+v&&(v=e.bottom-d.bottom+v+a)):e.bottom>d.bottom&&(v=e.bottom-d.bottom+a,n<0&&e.top-v0&&e.right>d.right+g&&(g=e.right-d.right+g+o)):e.right>d.right&&(g=e.right-d.right+o,n<0&&e.leftn.clientHeight||n.scrollWidth>n.clientWidth)return n;n=n.assignedSlot||n.parentNode}else if(n.nodeType==11)n=n.host;else break;return null}class qst{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:n,focusNode:r}=e;this.set(n,Math.min(e.anchorOffset,n?uu(n):0),r,Math.min(e.focusOffset,r?uu(r):0))}set(e,n,r,i){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}let om=null;function Wfe(t){if(t.setActive)return t.setActive();if(om)return t.focus(om);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(om==null?{get preventScroll(){return om={preventScroll:!0},!0}}:void 0),!om){om=!1;for(let n=0;nMath.max(1,t.scrollHeight-t.clientHeight-4)}function Hfe(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r>0)return{node:n,offset:r};if(n.nodeType==1&&r>0){if(n.contentEditable=="false")return null;n=n.childNodes[r-1],r=uu(n)}else if(n.parentNode&&!cE(n))r=tp(n),n=n.parentNode;else return null}}function qfe(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&rn)return f.domBoundsAround(e,n,c);if(d>=e&&i==-1&&(i=l,o=c),c>n&&f.dom.parentNode==this.dom){a=l,s=u;break}u=d,c=d+f.breakAfter}return{from:o,to:s<0?r+this.length:s,startDOM:(i?this.children[i-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:a=0?this.children[a].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let n=this.parent;n;n=n.parent){if(e&&(n.flags|=2),n.flags&1)return;n.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let n=e.parent;if(!n)return e;e=n}}replaceChildren(e,n,r=s4){this.markDirty();for(let i=e;ithis.pos||e==this.pos&&(n>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let r=this.children[--this.i];this.pos-=r.length+r.breakAfter}}}function Qfe(t,e,n,r,i,o,a,s,l){let{children:c}=t,u=c.length?c[e]:null,f=o.length?o[o.length-1]:null,d=f?f.breakAfter:a;if(!(e==r&&u&&!a&&!d&&o.length<2&&u.merge(n,i,o.length?f:null,n==0,s,l))){if(r0&&(!a&&o.length&&u.merge(n,u.length,o[0],!1,s,0)?u.breakAfter=o.shift().breakAfter:(n2);var ht={mac:o7||/Mac/.test(fa.platform),windows:/Win/.test(fa.platform),linux:/Linux|X11/.test(fa.platform),ie:P2,ie_version:Kfe?f3.documentMode||6:h3?+h3[1]:d3?+d3[1]:0,gecko:r7,gecko_version:r7?+(/Firefox\/(\d+)/.exec(fa.userAgent)||[0,0])[1]:0,chrome:!!ER,chrome_version:ER?+ER[1]:0,ios:o7,android:/Android\b/.test(fa.userAgent),webkit:i7,safari:Zfe,webkit_version:i7?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:f3.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const Yst=256;class Ks extends Dn{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,n){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(n&&n.node==this.dom&&(n.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,n,r){return this.flags&8||r&&(!(r instanceof Ks)||this.length-(n-e)+r.length>Yst||r.flags&8)?!1:(this.text=this.text.slice(0,e)+(r?r.text:"")+this.text.slice(n),this.markDirty(),!0)}split(e){let n=new Ks(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),n.flags|=this.flags&8,n}localPosFromDOM(e,n){return e==this.dom?n:n?this.text.length:0}domAtPos(e){return new Yi(this.dom,e)}domBoundsAround(e,n,r){return{from:r,to:r+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,n){return Kst(this.dom,e,n)}}class fu extends Dn{constructor(e,n=[],r=0){super(),this.mark=e,this.children=n,this.length=r;for(let i of n)i.setParent(this)}setAttrs(e){if(Vfe(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let n in this.mark.attrs)e.setAttribute(n,this.mark.attrs[n]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,n){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,n)}merge(e,n,r,i,o,a){return r&&(!(r instanceof fu&&r.mark.eq(this.mark))||e&&o<=0||ne&&n.push(r=e&&(i=o),r=l,o++}let a=this.length-e;return this.length=e,i>-1&&(this.children.length=i,this.markDirty()),new fu(this.mark,n,a)}domAtPos(e){return Jfe(this,e)}coordsAt(e,n){return tde(this,e,n)}}function Kst(t,e,n){let r=t.nodeValue.length;e>r&&(e=r);let i=e,o=e,a=0;e==0&&n<0||e==r&&n>=0?ht.chrome||ht.gecko||(e?(i--,a=1):o=0)?0:s.length-1];return ht.safari&&!a&&l.width==0&&(l=Array.prototype.find.call(s,c=>c.width)||l),a?E2(l,a<0):l||null}class bf extends Dn{static create(e,n,r){return new bf(e,n,r)}constructor(e,n,r){super(),this.widget=e,this.length=n,this.side=r,this.prevWidget=null}split(e){let n=bf.create(this.widget,this.length-e,this.side);return this.length-=e,n}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,n,r,i,o,a){return r&&(!(r instanceof bf)||!this.widget.compare(r.widget)||e>0&&o<=0||n0)?Yi.before(this.dom):Yi.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,n){let r=this.widget.coordsAt(this.dom,e,n);if(r)return r;let i=this.dom.getClientRects(),o=null;if(!i.length)return null;let a=this.side?this.side<0:e>0;for(let s=a?i.length-1:0;o=i[s],!(e>0?s==0:s==i.length-1||o.top0?Yi.before(this.dom):Yi.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return Sn.empty}get isHidden(){return!0}}Ks.prototype.children=bf.prototype.children=av.prototype.children=s4;function Jfe(t,e){let n=t.dom,{children:r}=t,i=0;for(let o=0;io&&e0;o--){let a=r[o-1];if(a.dom.parentNode==n)return a.domAtPos(a.length)}for(let o=i;o0&&e instanceof fu&&i.length&&(r=i[i.length-1])instanceof fu&&r.mark.eq(e.mark)?ede(r,e.children[0],n-1):(i.push(e),e.setParent(t)),t.length+=e.length}function tde(t,e,n){let r=null,i=-1,o=null,a=-1;function s(c,u){for(let f=0,d=0;f=u&&(h.children.length?s(h,u-d):(!o||o.isHidden&&n>0)&&(p>u||d==p&&h.getSide()>0)?(o=h,a=u-d):(d-1?1:0)!=i.length-(n&&i.indexOf(n)>-1?1:0))return!1;for(let o of r)if(o!=n&&(i.indexOf(o)==-1||t[o]!==e[o]))return!1;return!0}function m3(t,e,n){let r=!1;if(e)for(let i in e)n&&i in n||(r=!0,i=="style"?t.style.cssText="":t.removeAttribute(i));if(n)for(let i in n)e&&e[i]==n[i]||(r=!0,i=="style"?t.style.cssText=n[i]:t.setAttribute(i,n[i]));return r}function Jst(t){let e=Object.create(null);for(let n=0;n0&&this.children[r-1].length==0;)this.children[--r].destroy();return this.children.length=r,this.markDirty(),this.length=e,n}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){l4(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,n){ede(this,e,n)}addLineDeco(e){let n=e.spec.attributes,r=e.spec.class;n&&(this.attrs=p3(n,this.attrs||{})),r&&(this.attrs=p3({class:r},this.attrs||{}))}domAtPos(e){return Jfe(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,n){var r;this.dom?this.flags&4&&(Vfe(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(m3(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,n);let i=this.dom.lastChild;for(;i&&Dn.get(i)instanceof fu;)i=i.lastChild;if(!i||!this.length||i.nodeName!="BR"&&((r=Dn.get(i))===null||r===void 0?void 0:r.isEditable)==!1&&(!ht.ios||!this.children.some(o=>o instanceof Ks))){let o=document.createElement("BR");o.cmIgnore=!0,this.dom.appendChild(o)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,n;for(let r of this.children){if(!(r instanceof Ks)||/[^ -~]/.test(r.text))return null;let i=ov(r.dom);if(i.length!=1)return null;e+=i[0].width,n=i[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:n}:null}coordsAt(e,n){let r=tde(this,e,n);if(!this.children.length&&r&&this.parent){let{heightOracle:i}=this.parent.view.viewState,o=r.bottom-r.top;if(Math.abs(o-i.lineHeight)<2&&i.textHeight=n){if(o instanceof Yr)return o;if(a>n)break}i=a+o.breakAfter}return null}}class Ff extends Dn{constructor(e,n,r){super(),this.widget=e,this.length=n,this.deco=r,this.breakAfter=0,this.prevWidget=null}merge(e,n,r,i,o,a){return r&&(!(r instanceof Ff)||!this.widget.compare(r.widget)||e>0&&o<=0||n0}}class sc{eq(e){return!1}updateDOM(e,n){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,n,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var uo=function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t}(uo||(uo={}));class yt extends ep{constructor(e,n,r,i){super(),this.startSide=e,this.endSide=n,this.widget=r,this.spec=i}get heightRelevant(){return!1}static mark(e){return new lw(e)}static widget(e){let n=Math.max(-1e4,Math.min(1e4,e.side||0)),r=!!e.block;return n+=r&&!e.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new nd(e,n,n,r,e.widget||null,!1)}static replace(e){let n=!!e.block,r,i;if(e.isBlockGap)r=-5e8,i=4e8;else{let{start:o,end:a}=nde(e,n);r=(o?n?-3e8:-1:5e8)-1,i=(a?n?2e8:1:-6e8)+1}return new nd(e,r,i,n,e.widget||null,!0)}static line(e){return new cw(e)}static set(e,n=!1){return sn.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}yt.none=sn.empty;class lw extends yt{constructor(e){let{start:n,end:r}=nde(e);super(n?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var n,r;return this==e||e instanceof lw&&this.tagName==e.tagName&&(this.class||((n=this.attrs)===null||n===void 0?void 0:n.class))==(e.class||((r=e.attrs)===null||r===void 0?void 0:r.class))&&l4(this.attrs,e.attrs,"class")}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}}lw.prototype.point=!1;class cw extends yt{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof cw&&this.spec.class==e.spec.class&&l4(this.spec.attributes,e.spec.attributes)}range(e,n=e){if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,n)}}cw.prototype.mapMode=Pi.TrackBefore;cw.prototype.point=!0;class nd extends yt{constructor(e,n,r,i,o,a){super(n,r,o,e),this.block=i,this.isReplace=a,this.mapMode=i?n<=0?Pi.TrackBefore:Pi.TrackAfter:Pi.TrackDel}get type(){return this.startSide!=this.endSide?uo.WidgetRange:this.startSide<=0?uo.WidgetBefore:uo.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof nd&&elt(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,n=e){if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,n)}}nd.prototype.point=!0;function nde(t,e=!1){let{inclusiveStart:n,inclusiveEnd:r}=t;return n==null&&(n=t.inclusive),r==null&&(r=t.inclusive),{start:n??e,end:r??e}}function elt(t,e){return t==e||!!(t&&e&&t.compare(e))}function g3(t,e,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=t?n[i]=Math.max(n[i],e):n.push(t,e)}class Jx{constructor(e,n,r,i){this.doc=e,this.pos=n,this.end=r,this.disallowBlockEffectsFor=i,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=n}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof Ff&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new Yr),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(BS(new av(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof Ff)&&this.getLine()}buildText(e,n,r){for(;e>0;){if(this.textOff==this.text.length){let{value:o,lineBreak:a,done:s}=this.cursor.next(this.skip);if(this.skip=0,s)throw new Error("Ran out of text content when drawing inline views");if(a){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=o,this.textOff=0}let i=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(n.slice(n.length-r)),this.getLine().append(BS(new Ks(this.text.slice(this.textOff,this.textOff+i)),n),r),this.atCursorPos=!0,this.textOff+=i,e-=i,r=0}}span(e,n,r,i){this.buildText(n-e,r,i),this.pos=n,this.openStart<0&&(this.openStart=i)}point(e,n,r,i,o,a){if(this.disallowBlockEffectsFor[a]&&r instanceof nd){if(r.block)throw new RangeError("Block decorations may not be specified via plugins");if(n>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let s=n-e;if(r instanceof nd)if(r.block)r.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new Ff(r.widget||sv.block,s,r));else{let l=bf.create(r.widget||sv.inline,s,s?0:r.startSide),c=this.atCursorPos&&!l.isEditable&&o<=i.length&&(e0),u=!l.isEditable&&(ei.length||r.startSide<=0),f=this.getLine();this.pendingBuffer==2&&!c&&!l.isEditable&&(this.pendingBuffer=0),this.flushBuffer(i),c&&(f.append(BS(new av(1),i),o),o=i.length+Math.max(0,o-i.length)),f.append(BS(l,i),o),this.atCursorPos=u,this.pendingBuffer=u?ei.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=i.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(r);s&&(this.textOff+s<=this.text.length?this.textOff+=s:(this.skip+=s-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=n),this.openStart<0&&(this.openStart=o)}static build(e,n,r,i,o){let a=new Jx(e,n,r,o);return a.openEnd=sn.spans(i,n,r,a),a.openStart<0&&(a.openStart=a.openEnd),a.finish(a.openEnd),a}}function BS(t,e){for(let n of e)t=new fu(n,[t],t.length);return t}class sv extends sc{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}sv.inline=new sv("span");sv.block=new sv("div");var nr=function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t}(nr||(nr={}));const rp=nr.LTR,c4=nr.RTL;function rde(t){let e=[];for(let n=0;n=n){if(s.level==r)return a;(o<0||(i!=0?i<0?s.fromn:e[o].level>s.level))&&(o=a)}}if(o<0)throw new RangeError("Index out of range");return o}}function ode(t,e){if(t.length!=e.length)return!1;for(let n=0;n=0;m-=3)if(al[m+1]==-h){let g=al[m+2],v=g&2?i:g&4?g&1?o:i:0;v&&(In[f]=In[al[m]]=v),s=m;break}}else{if(al.length==189)break;al[s++]=f,al[s++]=d,al[s++]=l}else if((p=In[f])==2||p==1){let m=p==i;l=m?0:1;for(let g=s-3;g>=0;g-=3){let v=al[g+2];if(v&2)break;if(m)al[g+2]|=2;else{if(v&4)break;al[g+2]|=4}}}}}function alt(t,e,n,r){for(let i=0,o=r;i<=n.length;i++){let a=i?n[i-1].to:t,s=il;)p==g&&(p=n[--m].from,g=m?n[m-1].to:t),In[--p]=h;l=u}else o=c,l++}}}function y3(t,e,n,r,i,o,a){let s=r%2?2:1;if(r%2==i%2)for(let l=e,c=0;ll&&a.push(new _f(l,m.from,h));let g=m.direction==rp!=!(h%2);x3(t,g?r+1:r,i,m.inner,m.from,m.to,a),l=m.to}p=m.to}else{if(p==n||(u?In[p]!=s:In[p]==s))break;p++}d?y3(t,l,p,r+1,i,d,a):le;){let u=!0,f=!1;if(!c||l>o[c-1].to){let m=In[l-1];m!=s&&(u=!1,f=m==16)}let d=!u&&s==1?[]:null,h=u?r:r+1,p=l;e:for(;;)if(c&&p==o[c-1].to){if(f)break e;let m=o[--c];if(!u)for(let g=m.from,v=c;;){if(g==e)break e;if(v&&o[v-1].to==g)g=o[--v].from;else{if(In[g-1]==s)break e;break}}if(d)d.push(m);else{m.toIn.length;)In[In.length]=256;let r=[],i=e==rp?0:1;return x3(t,i,i,n,0,t.length,r),r}function ade(t){return[new _f(0,t,0)]}let sde="";function llt(t,e,n,r,i){var o;let a=r.head-t.from,s=_f.find(e,a,(o=r.bidiLevel)!==null&&o!==void 0?o:-1,r.assoc),l=e[s],c=l.side(i,n);if(a==c){let d=s+=i?1:-1;if(d<0||d>=e.length)return null;l=e[s=d],a=l.side(!i,n),c=l.side(i,n)}let u=ki(t.text,a,l.forward(i,n));(ul.to)&&(u=c),sde=t.text.slice(Math.min(a,u),Math.max(a,u));let f=s==(i?e.length-1:0)?null:e[s+(i?1:-1)];return f&&u==c&&f.level+(i?0:1)t.some(e=>e)}),mde=ft.define({combine:t=>t.some(e=>e)}),gde=ft.define();class Eg{constructor(e,n="nearest",r="nearest",i=5,o=5,a=!1){this.range=e,this.y=n,this.x=r,this.yMargin=i,this.xMargin=o,this.isSnapshot=a}map(e){return e.empty?this:new Eg(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new Eg(je.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const zS=It.define({map:(t,e)=>t.map(e)});function ko(t,e,n){let r=t.facet(fde);r.length?r[0](e):window.onerror?window.onerror(String(e),n,void 0,void 0,e):n?console.error(n+":",e):console.error(e)}const M2=ft.define({combine:t=>t.length?t[0]:!0});let ult=0;const ux=ft.define();class Mr{constructor(e,n,r,i,o){this.id=e,this.create=n,this.domEventHandlers=r,this.domEventObservers=i,this.extension=o(this)}static define(e,n){const{eventHandlers:r,eventObservers:i,provide:o,decorations:a}=n||{};return new Mr(ult++,e,r,i,s=>{let l=[ux.of(s)];return a&&l.push(e_.of(c=>{let u=c.plugin(s);return u?a(u):yt.none})),o&&l.push(o(s)),l})}static fromClass(e,n){return Mr.define(r=>new e(r),n)}}class PR{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(r){if(ko(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(n){ko(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){ko(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const vde=ft.define(),u4=ft.define(),e_=ft.define(),yde=ft.define(),f4=ft.define(),xde=ft.define();function s7(t,e){let n=t.state.facet(xde);if(!n.length)return n;let r=n.map(o=>o instanceof Function?o(t):o),i=[];return sn.spans(r,e.from,e.to,{point(){},span(o,a,s,l){let c=o-e.from,u=a-e.from,f=i;for(let d=s.length-1;d>=0;d--,l--){let h=s[d].spec.bidiIsolate,p;if(h==null&&(h=clt(e.text,c,u)),l>0&&f.length&&(p=f[f.length-1]).to==c&&p.direction==h)p.to=u,f=p.inner;else{let m={from:c,to:u,direction:h,inner:[]};f.push(m),f=m.inner}}}}),i}const bde=ft.define();function _de(t){let e=0,n=0,r=0,i=0;for(let o of t.state.facet(bde)){let a=o(t);a&&(a.left!=null&&(e=Math.max(e,a.left)),a.right!=null&&(n=Math.max(n,a.right)),a.top!=null&&(r=Math.max(r,a.top)),a.bottom!=null&&(i=Math.max(i,a.bottom)))}return{left:e,right:n,top:r,bottom:i}}const fx=ft.define();class ns{constructor(e,n,r,i){this.fromA=e,this.toA=n,this.fromB=r,this.toB=i}join(e){return new ns(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let n=e.length,r=this;for(;n>0;n--){let i=e[n-1];if(!(i.fromA>r.toA)){if(i.toAu)break;o+=2}if(!l)return r;new ns(l.fromA,l.toA,l.fromB,l.toB).addToSet(r),a=l.toA,s=l.toB}}}class uE{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=Kr.empty(this.startState.doc.length);for(let o of r)this.changes=this.changes.compose(o.changes);let i=[];this.changes.iterChangedRanges((o,a,s,l)=>i.push(new ns(o,a,s,l))),this.changedRanges=i}static create(e,n,r){return new uE(e,n,r)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class l7 extends Dn{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new Yr],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new ns(0,0,0,e.state.doc.length)],0,null)}update(e){var n;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:c,toA:u})=>uthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0);let i=-1;this.view.inputState.composing>=0&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?i=this.domChanged.newSel.head:!vlt(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let o=i>-1?dlt(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:u}=this.hasComposition;r=new ns(c,u,e.changes.mapPos(c,-1),e.changes.mapPos(u,1)).addToSet(r.slice())}this.hasComposition=o?{from:o.range.fromB,to:o.range.toB}:null,(ht.ie||ht.chrome)&&!o&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let a=this.decorations,s=this.updateDeco(),l=mlt(a,s,e.changes);return r=ns.extendWithRanges(r,l),!(this.flags&7)&&r.length==0?!1:(this.updateInner(r,e.startState.doc.length,o),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n,r){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,n,r);let{observer:i}=this.view;i.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let a=ht.chrome||ht.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,a),this.flags&=-8,a&&(a.written||i.selectionRange.focusNode!=a.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(a=>a.flags&=-9);let o=[];if(this.view.viewport.from||this.view.viewport.to=0?i[a]:null;if(!s)break;let{fromA:l,toA:c,fromB:u,toB:f}=s,d,h,p,m;if(r&&r.range.fromBu){let b=Jx.build(this.view.state.doc,u,r.range.fromB,this.decorations,this.dynamicDecorationMap),_=Jx.build(this.view.state.doc,r.range.toB,f,this.decorations,this.dynamicDecorationMap);h=b.breakAtStart,p=b.openStart,m=_.openEnd;let S=this.compositionView(r);_.breakAtStart?S.breakAfter=1:_.content.length&&S.merge(S.length,S.length,_.content[0],!1,_.openStart,0)&&(S.breakAfter=_.content[0].breakAfter,_.content.shift()),b.content.length&&S.merge(0,0,b.content[b.content.length-1],!0,0,b.openEnd)&&b.content.pop(),d=b.content.concat(S).concat(_.content)}else({content:d,breakAtStart:h,openStart:p,openEnd:m}=Jx.build(this.view.state.doc,u,f,this.decorations,this.dynamicDecorationMap));let{i:g,off:v}=o.findPos(c,1),{i:y,off:x}=o.findPos(l,-1);Qfe(this,y,x,g,v,d,h,p,m)}r&&this.fixCompositionDOM(r)}compositionView(e){let n=new Ks(e.text.nodeValue);n.flags|=8;for(let{deco:i}of e.marks)n=new fu(i,[n],n.length);let r=new Yr;return r.append(n,0),r}fixCompositionDOM(e){let n=(o,a)=>{a.flags|=8|(a.children.some(l=>l.flags&7)?1:0),this.markedForComposition.add(a);let s=Dn.get(o);s&&s!=a&&(s.dom=null),a.setDOM(o)},r=this.childPos(e.range.fromB,1),i=this.children[r.i];n(e.line,i);for(let o=e.marks.length-1;o>=-1;o--)r=i.childPos(r.off,1),i=i.children[r.i],n(o>=0?e.marks[o].node:e.text,i)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let r=this.view.root.activeElement,i=r==this.dom,o=!i&&RC(this.dom,this.view.observer.selectionRange)&&!(r&&this.dom.contains(r));if(!(i||n||o))return;let a=this.forceSelection;this.forceSelection=!1;let s=this.view.state.selection.main,l=this.moveToLine(this.domAtPos(s.anchor)),c=s.empty?l:this.moveToLine(this.domAtPos(s.head));if(ht.gecko&&s.empty&&!this.hasComposition&&flt(l)){let f=document.createTextNode("");this.view.observer.ignore(()=>l.node.insertBefore(f,l.node.childNodes[l.offset]||null)),l=c=new Yi(f,0),a=!0}let u=this.view.observer.selectionRange;(a||!u.focusNode||(!Zx(l.node,l.offset,u.anchorNode,u.anchorOffset)||!Zx(c.node,c.offset,u.focusNode,u.focusOffset))&&!this.suppressWidgetCursorChange(u,s))&&(this.view.observer.ignore(()=>{ht.android&&ht.chrome&&this.dom.contains(u.focusNode)&&glt(u.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=lE(this.view.root);if(f)if(s.empty){if(ht.gecko){let d=hlt(l.node,l.offset);if(d&&d!=3){let h=(d==1?Hfe:qfe)(l.node,l.offset);h&&(l=new Yi(h.node,h.offset))}}f.collapse(l.node,l.offset),s.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=s.bidiLevel)}else if(f.extend){f.collapse(l.node,l.offset);try{f.extend(c.node,c.offset)}catch{}}else{let d=document.createRange();s.anchor>s.head&&([l,c]=[c,l]),d.setEnd(c.node,c.offset),d.setStart(l.node,l.offset),f.removeAllRanges(),f.addRange(d)}o&&this.view.root.activeElement==this.dom&&(this.dom.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(l,c)),this.impreciseAnchor=l.precise?null:new Yi(u.anchorNode,u.anchorOffset),this.impreciseHead=c.precise?null:new Yi(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&Zx(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,r=lE(e.root),{anchorNode:i,anchorOffset:o}=e.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let a=Yr.find(this,n.head);if(!a)return;let s=a.posAtStart;if(n.head==s||n.head==s+a.length)return;let l=this.coordsAt(n.head,-1),c=this.coordsAt(n.head,1);if(!l||!c||l.bottom>c.top)return;let u=this.domAtPos(n.head+n.assoc);r.collapse(u.node,u.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=n.from&&r.collapse(i,o)}moveToLine(e){let n=this.dom,r;if(e.node!=n)return e;for(let i=e.offset;!r&&i=0;i--){let o=Dn.get(n.childNodes[i]);o instanceof Yr&&(r=o.domAtPos(o.length))}return r?new Yi(r.node,r.offset,!0):e}nearest(e){for(let n=e;n;){let r=Dn.get(n);if(r&&r.rootView==this)return r;n=n.parentNode}return null}posFromDOM(e,n){let r=this.nearest(e);if(!r)throw new RangeError("Trying to find position for a DOM position outside of the document");return r.localPosFromDOM(e,n)+r.posAtStart}domAtPos(e){let{i:n,off:r}=this.childCursor().findPos(e,-1);for(;n=0;a--){let s=this.children[a],l=o-s.breakAfter,c=l-s.length;if(le||s.covers(1))&&(!r||s instanceof Yr&&!(r instanceof Yr&&n>=0))&&(r=s,i=c),o=c}return r?r.coordsAt(e-i,n):null}coordsForChar(e){let{i:n,off:r}=this.childPos(e,1),i=this.children[n];if(!(i instanceof Yr))return null;for(;i.children.length;){let{i:s,off:l}=i.childPos(r,1);for(;;s++){if(s==i.children.length)return null;if((i=i.children[s]).length)break}r=l}if(!(i instanceof Ks))return null;let o=ki(i.text,r);if(o==r)return null;let a=np(i.dom,r,o).getClientRects();for(let s=0;sMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,s=-1,l=this.view.textDirection==nr.LTR;for(let c=0,u=0;ui)break;if(c>=r){let h=f.dom.getBoundingClientRect();if(n.push(h.height),a){let p=f.dom.lastChild,m=p?ov(p):[];if(m.length){let g=m[m.length-1],v=l?g.right-h.left:h.right-g.left;v>s&&(s=v,this.minWidth=o,this.minWidthFrom=c,this.minWidthTo=d)}}}c=d+f.breakAfter}return n}textDirectionAt(e){let{i:n}=this.childPos(e,1);return getComputedStyle(this.children[n].dom).direction=="rtl"?nr.RTL:nr.LTR}measureTextSize(){for(let o of this.children)if(o instanceof Yr){let a=o.measureTextSize();if(a)return a}let e=document.createElement("div"),n,r,i;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let o=ov(e.firstChild)[0];n=e.getBoundingClientRect().height,r=o?o.width/27:7,i=o?o.height:n,e.remove()}),{lineHeight:n,charWidth:r,textHeight:i}}childCursor(e=this.length){let n=this.children.length;return n&&(e-=this.children[--n].length),new Xfe(this.children,e,n)}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let r=0,i=0;;i++){let o=i==n.viewports.length?null:n.viewports[i],a=o?o.from-1:this.length;if(a>r){let s=(n.lineBlockAt(a).bottom-n.lineBlockAt(r).top)/this.view.scaleY;e.push(yt.replace({widget:new c7(s),block:!0,inclusive:!0,isBlockGap:!0}).range(r,a))}if(!o)break;r=o.to+1}return yt.set(e)}updateDeco(){let e=0,n=this.view.state.facet(e_).map(o=>(this.dynamicDecorationMap[e++]=typeof o=="function")?o(this.view):o),r=!1,i=this.view.state.facet(yde).map((o,a)=>{let s=typeof o=="function";return s&&(r=!0),s?o(this.view):o});for(i.length&&(this.dynamicDecorationMap[e++]=r,n.push(sn.join(i))),this.decorations=[...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];en.anchor?-1:1),i;if(!r)return;!n.empty&&(i=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(r={left:Math.min(r.left,i.left),top:Math.min(r.top,i.top),right:Math.max(r.right,i.right),bottom:Math.max(r.bottom,i.bottom)});let o=_de(this.view),a={left:r.left-o.left,top:r.top-o.top,right:r.right+o.right,bottom:r.bottom+o.bottom},{offsetWidth:s,offsetHeight:l}=this.view.scrollDOM;Gst(this.view.scrollDOM,a,n.head{re.from&&(n=!0)}),n}function ylt(t,e,n=1){let r=t.charCategorizer(e),i=t.doc.lineAt(e),o=e-i.from;if(i.length==0)return je.cursor(e);o==0?n=1:o==i.length&&(n=-1);let a=o,s=o;n<0?a=ki(i.text,o,!1):s=ki(i.text,o);let l=r(i.text.slice(a,s));for(;a>0;){let c=ki(i.text,a,!1);if(r(i.text.slice(c,a))!=l)break;a=c}for(;st?e.left-t:Math.max(0,t-e.right)}function blt(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom)}function MR(t,e){return t.tope.top+1}function u7(t,e){return et.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function _3(t,e,n){let r,i,o,a,s=!1,l,c,u,f;for(let p=t.firstChild;p;p=p.nextSibling){let m=ov(p);for(let g=0;gx||a==x&&o>y){r=p,i=v,o=y,a=x;let b=x?n0?g0)}y==0?n>v.bottom&&(!u||u.bottomv.top)&&(c=p,f=v):u&&MR(u,v)?u=f7(u,v.bottom):f&&MR(f,v)&&(f=u7(f,v.top))}}if(u&&u.bottom>=n?(r=l,i=u):f&&f.top<=n&&(r=c,i=f),!r)return{node:t,offset:0};let d=Math.max(i.left,Math.min(i.right,e));if(r.nodeType==3)return d7(r,d,n);if(s&&r.contentEditable!="false")return _3(r,d,n);let h=Array.prototype.indexOf.call(t.childNodes,r)+(e>=(i.left+i.right)/2?1:0);return{node:t,offset:h}}function d7(t,e,n){let r=t.nodeValue.length,i=-1,o=1e9,a=0;for(let s=0;sn?u.top-n:n-u.bottom)-1;if(u.left-1<=e&&u.right+1>=e&&f=(u.left+u.right)/2,h=d;if((ht.chrome||ht.gecko)&&np(t,s).getBoundingClientRect().left==u.right&&(h=!d),f<=0)return{node:t,offset:s+(h?1:0)};i=s+(h?1:0),o=f}}}return{node:t,offset:i>-1?i:a>0?t.nodeValue.length:0}}function Sde(t,e,n,r=-1){var i,o;let a=t.contentDOM.getBoundingClientRect(),s=a.top+t.viewState.paddingTop,l,{docHeight:c}=t.viewState,{x:u,y:f}=e,d=f-s;if(d<0)return 0;if(d>c)return t.state.doc.length;for(let b=t.viewState.heightOracle.textHeight/2,_=!1;l=t.elementAtHeight(d),l.type!=uo.Text;)for(;d=r>0?l.bottom+b:l.top-b,!(d>=0&&d<=c);){if(_)return n?null:0;_=!0,r=-r}f=s+d;let h=l.from;if(ht.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:n?null:h7(t,a,l,u,f);let p=t.dom.ownerDocument,m=t.root.elementFromPoint?t.root:p,g=m.elementFromPoint(u,f);g&&!t.contentDOM.contains(g)&&(g=null),g||(u=Math.max(a.left+1,Math.min(a.right-1,u)),g=m.elementFromPoint(u,f),g&&!t.contentDOM.contains(g)&&(g=null));let v,y=-1;if(g&&((i=t.docView.nearest(g))===null||i===void 0?void 0:i.isEditable)!=!1){if(p.caretPositionFromPoint){let b=p.caretPositionFromPoint(u,f);b&&({offsetNode:v,offset:y}=b)}else if(p.caretRangeFromPoint){let b=p.caretRangeFromPoint(u,f);b&&({startContainer:v,startOffset:y}=b,(!t.contentDOM.contains(v)||ht.safari&&_lt(v,y,u)||ht.chrome&&wlt(v,y,u))&&(v=void 0))}}if(!v||!t.docView.dom.contains(v)){let b=Yr.find(t.docView,h);if(!b)return d>l.top+l.height/2?l.to:l.from;({node:v,offset:y}=_3(b.dom,u,f))}let x=t.docView.nearest(v);if(!x)return null;if(x.isWidget&&((o=x.dom)===null||o===void 0?void 0:o.nodeType)==1){let b=x.dom.getBoundingClientRect();return e.yt.defaultLineHeight*1.5){let s=t.viewState.heightOracle.textHeight,l=Math.floor((i-n.top-(t.defaultLineHeight-s)*.5)/s);o+=l*t.viewState.heightOracle.lineLength}let a=t.state.sliceDoc(n.from,n.to);return n.from+s3(a,o,t.state.tabSize)}function _lt(t,e,n){let r;if(t.nodeType!=3||e!=(r=t.nodeValue.length))return!1;for(let i=t.nextSibling;i;i=i.nextSibling)if(i.nodeType!=1||i.nodeName!="BR")return!1;return np(t,r-1,r).getBoundingClientRect().left>n}function wlt(t,e,n){if(e!=0)return!1;for(let i=t;;){let o=i.parentNode;if(!o||o.nodeType!=1||o.firstChild!=i)return!1;if(o.classList.contains("cm-line"))break;i=o}let r=t.nodeType==1?t.getBoundingClientRect():np(t,0,Math.max(t.nodeValue.length,1)).getBoundingClientRect();return n-r.left>5}function w3(t,e){let n=t.lineBlockAt(e);if(Array.isArray(n.type)){for(let r of n.type)if(r.to>e||r.to==e&&(r.to==n.to||r.type==uo.Text))return r}return n}function Slt(t,e,n,r){let i=w3(t,e.head),o=!r||i.type!=uo.Text||!(t.lineWrapping||i.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(o){let a=t.dom.getBoundingClientRect(),s=t.textDirectionAt(i.from),l=t.posAtCoords({x:n==(s==nr.LTR)?a.right-1:a.left+1,y:(o.top+o.bottom)/2});if(l!=null)return je.cursor(l,n?-1:1)}return je.cursor(n?i.to:i.from,n?-1:1)}function p7(t,e,n,r){let i=t.state.doc.lineAt(e.head),o=t.bidiSpans(i),a=t.textDirectionAt(i.from);for(let s=e,l=null;;){let c=llt(i,o,a,s,n),u=sde;if(!c){if(i.number==(n?t.state.doc.lines:1))return s;u=` +`,i=t.state.doc.line(i.number+(n?1:-1)),o=t.bidiSpans(i),c=t.visualLineSide(i,!n)}if(l){if(!l(u))return s}else{if(!r)return c;l=r(u)}s=c}}function Olt(t,e,n){let r=t.state.charCategorizer(e),i=r(n);return o=>{let a=r(o);return i==ur.Space&&(i=a),i==a}}function Clt(t,e,n,r){let i=e.head,o=n?1:-1;if(i==(n?t.state.doc.length:0))return je.cursor(i,e.assoc);let a=e.goalColumn,s,l=t.contentDOM.getBoundingClientRect(),c=t.coordsAtPos(i,e.assoc||-1),u=t.documentTop;if(c)a==null&&(a=c.left-l.left),s=o<0?c.top:c.bottom;else{let h=t.viewState.lineBlockAt(i);a==null&&(a=Math.min(l.right-l.left,t.defaultCharacterWidth*(i-h.from))),s=(o<0?h.top:h.bottom)+u}let f=l.left+a,d=r??t.viewState.heightOracle.textHeight>>1;for(let h=0;;h+=10){let p=s+(d+h)*o,m=Sde(t,{x:f,y:p},!1,o);if(pl.bottom||(o<0?mi)){let g=t.docView.coordsForChar(m),v=!g||p{if(e>o&&ei(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:je.cursor(r,rnull),ht.gecko&&Ult(e.contentDOM.ownerDocument)}handleEvent(e){!Dlt(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||this.runHandlers(e.type,e)}runHandlers(e,n){let r=this.handlers[e];if(r){for(let i of r.observers)i(this.view,n);for(let i of r.handlers){if(n.defaultPrevented)break;if(i(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=Elt(e),r=this.handlers,i=this.view.contentDOM;for(let o in n)if(o!="scroll"){let a=!n[o].handlers.length,s=r[o];s&&a!=!s.handlers.length&&(i.removeEventListener(o,this.handleEvent),s=null),s||i.addEventListener(o,this.handleEvent,{passive:a})}for(let o in r)o!="scroll"&&!n[o]&&i.removeEventListener(o,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&Date.now()r.keyCode==e.keyCode))&&!e.ctrlKey||Plt.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=n||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from0?!0:ht.safari&&!ht.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function m7(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(i){ko(n.state,i)}}}function Elt(t){let e=Object.create(null);function n(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of t){let i=r.spec;if(i&&i.domEventHandlers)for(let o in i.domEventHandlers){let a=i.domEventHandlers[o];a&&n(o).handlers.push(m7(r.value,a))}if(i&&i.domEventObservers)for(let o in i.domEventObservers){let a=i.domEventObservers[o];a&&n(o).observers.push(m7(r.value,a))}}for(let r in Zs)n(r).handlers.push(Zs[r]);for(let r in ps)n(r).observers.push(ps[r]);return e}const Ode=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Plt="dthko",Cde=[16,17,18,20,91,92,224,225],US=6;function WS(t){return Math.max(0,t)*.7+8}function Mlt(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class klt{constructor(e,n,r,i){this.view=e,this.startEvent=n,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParent=Hst(e.contentDOM),this.atoms=e.state.facet(f4).map(a=>a(e));let o=e.contentDOM.ownerDocument;o.addEventListener("mousemove",this.move=this.move.bind(this)),o.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(en.allowMultipleSelections)&&Alt(e,n),this.dragging=Ilt(e,n)&&Mde(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){var n;if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Mlt(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let r=0,i=0,o=((n=this.scrollParent)===null||n===void 0?void 0:n.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},a=_de(this.view);e.clientX-a.left<=o.left+US?r=-WS(o.left-e.clientX):e.clientX+a.right>=o.right-US&&(r=WS(e.clientX-o.right)),e.clientY-a.top<=o.top+US?i=-WS(o.top-e.clientY):e.clientY+a.bottom>=o.bottom-US&&(i=WS(e.clientY-o.bottom)),this.setScrollSpeed(r,i)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let n=null;for(let r=0;rthis.select(this.lastEvent),20)}}function Alt(t,e){let n=t.state.facet(lde);return n.length?n[0](e):ht.mac?e.metaKey:e.ctrlKey}function Rlt(t,e){let n=t.state.facet(cde);return n.length?n[0](e):ht.mac?!e.altKey:!e.ctrlKey}function Ilt(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=lE(t.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let o=0;o=e.clientX&&a.top<=e.clientY&&a.bottom>=e.clientY)return!0}return!1}function Dlt(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,r;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=Dn.get(n))&&r.ignoreEvent(e))return!1;return!0}const Zs=Object.create(null),ps=Object.create(null),Tde=ht.ie&&ht.ie_version<15||ht.ios&&ht.webkit_version<604;function Llt(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),Ede(t,n.value)},50)}function Ede(t,e){let{state:n}=t,r,i=1,o=n.toText(e),a=o.lines==n.selection.ranges.length;if(S3!=null&&n.selection.ranges.every(l=>l.empty)&&S3==o.toString()){let l=-1;r=n.changeByRange(c=>{let u=n.doc.lineAt(c.from);if(u.from==l)return{range:c};l=u.from;let f=n.toText((a?o.line(i++).text:e)+n.lineBreak);return{changes:{from:u.from,insert:f},range:je.cursor(c.from+f.length)}})}else a?r=n.changeByRange(l=>{let c=o.line(i++);return{changes:{from:l.from,to:l.to,insert:c.text},range:je.cursor(l.from+c.length)}}):r=n.replaceSelection(o);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}ps.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};Zs.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&(t.inputState.lastEscPress=Date.now()),!1);ps.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")};ps.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};Zs.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of t.state.facet(ude))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=Flt(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new klt(t,e,n,r)),r&&t.observer.ignore(()=>Wfe(t.contentDOM));let i=t.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}return!1};function g7(t,e,n,r){if(r==1)return je.cursor(e,n);if(r==2)return ylt(t.state,e,n);{let i=Yr.find(t.docView,e),o=t.state.doc.lineAt(i?i.posAtEnd:e),a=i?i.posAtStart:o.from,s=i?i.posAtEnd:o.to;return st>=e.top&&t<=e.bottom,v7=(t,e,n)=>Pde(e,n)&&t>=n.left&&t<=n.right;function $lt(t,e,n,r){let i=Yr.find(t.docView,e);if(!i)return 1;let o=e-i.posAtStart;if(o==0)return 1;if(o==i.length)return-1;let a=i.coordsAt(o,-1);if(a&&v7(n,r,a))return-1;let s=i.coordsAt(o,1);return s&&v7(n,r,s)?1:a&&Pde(r,a)?-1:1}function y7(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:n,bias:$lt(t,n,e.clientX,e.clientY)}}const Nlt=ht.ie&&ht.ie_version<=11;let x7=null,b7=0,_7=0;function Mde(t){if(!Nlt)return t.detail;let e=x7,n=_7;return x7=t,_7=Date.now(),b7=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(b7+1)%3:1}function Flt(t,e){let n=y7(t,e),r=Mde(e),i=t.state.selection;return{update(o){o.docChanged&&(n.pos=o.changes.mapPos(n.pos),i=i.map(o.changes))},get(o,a,s){let l=y7(t,o),c,u=g7(t,l.pos,l.bias,r);if(n.pos!=l.pos&&!a){let f=g7(t,n.pos,n.bias,r),d=Math.min(f.from,u.from),h=Math.max(f.to,u.to);u=d1&&(c=jlt(i,l.pos))?c:s?i.addRange(u):je.create([u])}}}function jlt(t,e){for(let n=0;n=e)return je.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}Zs.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let i=t.docView.nearest(e.target);if(i&&i.isWidget){let o=i.posAtStart,a=o+i.length;(o>=n.to||a<=n.from)&&(n=je.range(o,a))}}let{inputState:r}=t;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",t.state.sliceDoc(n.from,n.to)),e.dataTransfer.effectAllowed="copyMove"),!1};Zs.dragend=t=>(t.inputState.draggedContent=null,!1);function w7(t,e,n,r){if(!n)return;let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:o}=t.inputState,a=r&&o&&Rlt(t,e)?{from:o.from,to:o.to}:null,s={from:i,insert:n},l=t.state.changes(a?[a,s]:s);t.focus(),t.dispatch({changes:l,selection:{anchor:l.mapPos(i,-1),head:l.mapPos(i,1)},userEvent:a?"move.drop":"input.drop"}),t.inputState.draggedContent=null}Zs.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,o=()=>{++i==n.length&&w7(t,e,r.filter(a=>a!=null).join(t.state.lineBreak),!1)};for(let a=0;a{/[\x00-\x08\x0e-\x1f]{2}/.test(s.result)||(r[a]=s.result),o()},s.readAsText(n[a])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return w7(t,e,r,!0),!0}return!1};Zs.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=Tde?null:e.clipboardData;return n?(Ede(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(Llt(t),!1)};function Blt(t,e){let n=t.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),t.focus()},50)}function zlt(t){let e=[],n=[],r=!1;for(let i of t.selection.ranges)i.empty||(e.push(t.sliceDoc(i.from,i.to)),n.push(i));if(!e.length){let i=-1;for(let{from:o}of t.selection.ranges){let a=t.doc.lineAt(o);a.number>i&&(e.push(a.text),n.push({from:a.from,to:Math.min(t.doc.length,a.to+1)})),i=a.number}r=!0}return{text:e.join(t.lineBreak),ranges:n,linewise:r}}let S3=null;Zs.copy=Zs.cut=(t,e)=>{let{text:n,ranges:r,linewise:i}=zlt(t.state);if(!n&&!i)return!1;S3=i?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let o=Tde?null:e.clipboardData;return o?(o.clearData(),o.setData("text/plain",n),!0):(Blt(t,n),!1)};const kde=oc.define();function Ade(t,e){let n=[];for(let r of t.facet(hde)){let i=r(t,e);i&&n.push(i)}return n?t.update({effects:n,annotations:kde.of(!0)}):null}function Rde(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=Ade(t.state,e);n?t.dispatch(n):t.update([])}},10)}ps.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),Rde(t)};ps.blur=t=>{t.observer.clearSelectionRange(),Rde(t)};ps.compositionstart=ps.compositionupdate=t=>{t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0)};ps.compositionend=t=>{t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,ht.chrome&&ht.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50)};ps.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};Zs.beforeinput=(t,e)=>{var n;let r;if(ht.chrome&&ht.android&&(r=Ode.find(i=>i.inputType==e.inputType))&&(t.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let i=((n=window.visualViewport)===null||n===void 0?void 0:n.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>i+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return ht.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),ht.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>ps.compositionend(t,e),20),!1};const S7=new Set;function Ult(t){S7.has(t)||(S7.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const O7=["pre-wrap","normal","pre-line","break-spaces"];class Wlt{constructor(e){this.lineWrapping=e,this.doc=Sn.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}heightForGap(e,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return O7.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let r=0;r-1,l=Math.round(n)!=Math.round(this.lineHeight)||this.lineWrapping!=s;if(this.lineWrapping=s,this.lineHeight=n,this.charWidth=r,this.textHeight=i,this.lineLength=o,l){this.heightSamples={};for(let c=0;c0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e,n){this.height!=n&&(Math.abs(this.height-n)>DC&&(e.heightChanged=!0),this.height=n)}replace(e,n,r){return fo.of(r)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,r,i){let o=this,a=r.doc;for(let s=i.length-1;s>=0;s--){let{fromA:l,toA:c,fromB:u,toB:f}=i[s],d=o.lineAt(l,Xn.ByPosNoHeight,r.setDoc(n),0,0),h=d.to>=c?d:o.lineAt(c,Xn.ByPosNoHeight,r,0,0);for(f+=h.to-c,c=h.to;s>0&&d.from<=i[s-1].toA;)l=i[s-1].fromA,u=i[s-1].fromB,s--,lo*2){let s=e[n-1];s.break?e.splice(--n,1,s.left,null,s.right):e.splice(--n,1,s.left,s.right),r+=1+s.break,i-=s.size}else if(o>i*2){let s=e[r];s.break?e.splice(r,1,s.left,null,s.right):e.splice(r,1,s.left,s.right),r+=2+s.break,o-=s.size}else break;else if(i=o&&a(this.blockAt(0,r,i,o))}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more&&this.setHeight(e,i.heights[i.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class sa extends Ide{constructor(e,n){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,n,r,i){return new Cl(i,this.length,r,this.height,this.breaks)}replace(e,n,r){let i=r[0];return r.length==1&&(i instanceof sa||i instanceof _i&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof _i?i=new sa(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):fo.of(r)}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more?this.setHeight(e,i.heights[i.index++]):(r||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class _i extends fo{constructor(e){super(e,0)}heightMetrics(e,n){let r=e.doc.lineAt(n).number,i=e.doc.lineAt(n+this.length).number,o=i-r+1,a,s=0;if(e.lineWrapping){let l=Math.min(this.height,e.lineHeight*o);a=l/o,this.length>o+1&&(s=(this.height-l)/(this.length-o-1))}else a=this.height/o;return{firstLine:r,lastLine:i,perLine:a,perChar:s}}blockAt(e,n,r,i){let{firstLine:o,lastLine:a,perLine:s,perChar:l}=this.heightMetrics(n,i);if(n.lineWrapping){let c=i+(e0){let o=r[r.length-1];o instanceof _i?r[r.length-1]=new _i(o.length+i):r.push(null,new _i(i-1))}if(e>0){let o=r[0];o instanceof _i?r[0]=new _i(e+o.length):r.unshift(new _i(e-1),null)}return fo.of(r)}decomposeLeft(e,n){n.push(new _i(e-1),null)}decomposeRight(e,n){n.push(null,new _i(this.length-e-1))}updateHeight(e,n=0,r=!1,i){let o=n+this.length;if(i&&i.from<=n+this.length&&i.more){let a=[],s=Math.max(n,i.from),l=-1;for(i.from>n&&a.push(new _i(i.from-n-1).updateHeight(e,n));s<=o&&i.more;){let u=e.doc.lineAt(s).length;a.length&&a.push(null);let f=i.heights[i.index++];l==-1?l=f:Math.abs(f-l)>=DC&&(l=-2);let d=new sa(u,f);d.outdated=!1,a.push(d),s+=u+1}s<=o&&a.push(null,new _i(o-s).updateHeight(e,s));let c=fo.of(a);return(l<0||Math.abs(c.height-this.height)>=DC||Math.abs(l-this.heightMetrics(e,n).perLine)>=DC)&&(e.heightChanged=!0),c}else(r||this.outdated)&&(this.setHeight(e,e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class Glt extends fo{constructor(e,n,r){super(e.length+n+r.length,e.height+r.height,n|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,n,r,i){let o=r+this.left.height;return es))return c;let u=n==Xn.ByPosNoHeight?Xn.ByPosNoHeight:Xn.ByPos;return l?c.join(this.right.lineAt(s,u,r,a,s)):this.left.lineAt(s,u,r,i,o).join(c)}forEachLine(e,n,r,i,o,a){let s=i+this.left.height,l=o+this.left.length+this.break;if(this.break)e=l&&this.right.forEachLine(e,n,r,s,l,a);else{let c=this.lineAt(l,Xn.ByPos,r,i,o);e=e&&c.from<=n&&a(c),n>c.to&&this.right.forEachLine(c.to+1,n,r,s,l,a)}}replace(e,n,r){let i=this.left.length+this.break;if(nthis.left.length)return this.balanced(this.left,this.right.replace(e-i,n-i,r));let o=[];e>0&&this.decomposeLeft(e,o);let a=o.length;for(let s of r)o.push(s);if(e>0&&C7(o,a-1),n=r&&n.push(null)),e>r&&this.right.decomposeLeft(e-r,n)}decomposeRight(e,n){let r=this.left.length,i=r+this.break;if(e>=i)return this.right.decomposeRight(e-i,n);e2*n.size||n.size>2*e.size?fo.of(this.break?[e,null,n]:[e,n]):(this.left=e,this.right=n,this.height=e.height+n.height,this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,r=!1,i){let{left:o,right:a}=this,s=n+o.length+this.break,l=null;return i&&i.from<=n+o.length&&i.more?l=o=o.updateHeight(e,n,r,i):o.updateHeight(e,n,r),i&&i.from<=s+a.length&&i.more?l=a=a.updateHeight(e,s,r,i):a.updateHeight(e,s,r),l?this.balanced(o,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function C7(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof _i&&(r=t[e+1])instanceof _i&&t.splice(e-1,3,new _i(n.length+1+r.length))}const Hlt=5;class d4{constructor(e,n){this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof sa?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new sa(r-this.pos,-1)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,r){if(e=Hlt)&&this.addLineDeco(i,o,a)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenToe&&this.nodes.push(new sa(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,n){let r=new _i(n-e);return this.oracle.doc.lineAt(e).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof sa)return e;let n=new sa(0,-1);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof sa)&&!this.isCovered?this.nodes.push(new sa(0,-1)):(this.writtenTou.clientHeight||u.scrollWidth>u.clientWidth)&&f.overflow!="visible"){let d=u.getBoundingClientRect();o=Math.max(o,d.left),a=Math.min(a,d.right),s=Math.max(s,d.top),l=c==t.parentNode?d.bottom:Math.min(l,d.bottom)}c=f.position=="absolute"||f.position=="fixed"?u.offsetParent:u.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:o-n.left,right:Math.max(o,a)-n.left,top:s-(n.top+e),bottom:Math.max(s,l)-(n.top+e)}}function Ylt(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class AR{constructor(e,n,r){this.from=e,this.to=n,this.size=r}static same(e,n){if(e.length!=n.length)return!1;for(let r=0;rtypeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new Wlt(n),this.stateDeco=e.facet(e_).filter(r=>typeof r!="function"),this.heightMap=fo.empty().applyChanges(this.stateDeco,Sn.empty,this.heightOracle.setDoc(e.doc),[new ns(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=yt.set(this.lineGaps.map(r=>r.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let i=r?n.head:n.anchor;if(!e.some(({from:o,to:a})=>i>=o&&i<=a)){let{from:o,to:a}=this.lineBlockAt(i);e.push(new VS(o,a))}}this.viewports=e.sort((r,i)=>r.from-i.from),this.scaler=this.heightMap.height<=7e6?E7:new ect(this.heightOracle,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(this.scaler.scale==1?e:dx(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=this.state.facet(e_).filter(u=>typeof u!="function");let i=e.changedRanges,o=ns.extendWithRanges(i,qlt(r,this.stateDeco,e?e.changes:Kr.empty(this.state.doc.length))),a=this.heightMap.height,s=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),o),this.heightMap.height!=a&&(e.flags|=2),s?(this.scrollAnchorPos=e.changes.mapPos(s.from,-1),this.scrollAnchorHeight=s.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let l=o.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.headl.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,n));let c=!e.changes.empty||e.flags&2||l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,this.updateForViewport(),c&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(mde)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let n=e.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,o=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?nr.RTL:nr.LTR;let a=this.heightOracle.mustRefreshForWrapping(o),s=n.getBoundingClientRect(),l=a||this.mustMeasureContent||this.contentDOMHeight!=s.height;this.contentDOMHeight=s.height,this.mustMeasureContent=!1;let c=0,u=0;if(s.width&&s.height){let{scaleX:b,scaleY:_}=Ufe(n,s);(b>.005&&Math.abs(this.scaleX-b)>.005||_>.005&&Math.abs(this.scaleY-_)>.005)&&(this.scaleX=b,this.scaleY=_,c|=8,a=l=!0)}let f=(parseInt(r.paddingTop)||0)*this.scaleY,d=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=d)&&(this.paddingTop=f,this.paddingBottom=d,c|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(l=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=8);let h=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=h&&(this.scrollAnchorHeight=-1,this.scrollTop=h),this.scrolledToBottom=Gfe(e.scrollDOM);let p=(this.printing?Ylt:Qlt)(n,this.paddingTop),m=p.top-this.pixelViewport.top,g=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let v=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(v!=this.inView&&(this.inView=v,v&&(l=!0)),!this.inView&&!this.scrollTarget)return 0;let y=s.width;if((this.contentDOMWidth!=y||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=s.width,this.editorHeight=e.scrollDOM.clientHeight,c|=8),l){let b=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(b)&&(a=!0),a||i.lineWrapping&&Math.abs(y-this.contentDOMWidth)>i.charWidth){let{lineHeight:_,charWidth:S,textHeight:O}=e.docView.measureTextSize();a=_>0&&i.refresh(o,_,S,O,y/S,b),a&&(e.docView.minWidth=0,c|=8)}m>0&&g>0?u=Math.max(m,g):m<0&&g<0&&(u=Math.min(m,g)),i.heightChanged=!1;for(let _ of this.viewports){let S=_.from==this.viewport.from?b:e.docView.measureVisibleLineHeights(_);this.heightMap=(a?fo.empty().applyChanges(this.stateDeco,Sn.empty,this.heightOracle,[new ns(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,a,new Vlt(_.from,S))}i.heightChanged&&(c|=2)}let x=!this.viewportIsAppropriate(this.viewport,u)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return x&&(this.viewport=this.getViewport(u,this.scrollTarget)),this.updateForViewport(),(c&2||x)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,o=this.heightOracle,{visibleTop:a,visibleBottom:s}=this,l=new VS(i.lineAt(a-r*1e3,Xn.ByHeight,o,0,0).from,i.lineAt(s+(1-r)*1e3,Xn.ByHeight,o,0,0).to);if(n){let{head:c}=n.range;if(cl.to){let u=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=i.lineAt(c,Xn.ByPos,o,0,0),d;n.y=="center"?d=(f.top+f.bottom)/2-u/2:n.y=="start"||n.y=="nearest"&&c=s+Math.max(10,Math.min(r,250)))&&i>a-2*1e3&&o>1,a=i<<1;if(this.defaultTextDirection!=nr.LTR&&!r)return[];let s=[],l=(c,u,f,d)=>{if(u-cc&&gg.from>=f.from&&g.to<=f.to&&Math.abs(g.from-c)g.fromv));if(!m){if(ug.from<=u&&g.to>=u)){let g=n.moveToLineBoundary(je.cursor(u),!1,!0).head;g>c&&(u=g)}m=new AR(c,u,this.gapSize(f,c,u,d))}s.push(m)};for(let c of this.viewportLines){if(c.lengthc.from&&l(c.from,d,c,u),hn.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let n=[];sn.spans(e,this.viewport.from,this.viewport.to,{span(i,o){n.push({from:i,to:o})},point(){}},20);let r=n.length!=this.visibleRanges.length||this.visibleRanges.some((i,o)=>i.from!=n[o].from||i.to!=n[o].to);return this.visibleRanges=n,r?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||dx(this.heightMap.lineAt(e,Xn.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return dx(this.heightMap.lineAt(this.scaler.fromDOM(e),Xn.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return dx(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class VS{constructor(e,n){this.from=e,this.to=n}}function Zlt(t,e,n){let r=[],i=t,o=0;return sn.spans(n,t,e,{span(){},point(a,s){a>i&&(r.push({from:i,to:a}),o+=a-i),i=s}},20),i=1)return e[e.length-1].to;let r=Math.floor(t*n);for(let i=0;;i++){let{from:o,to:a}=e[i],s=a-o;if(r<=s)return o+r;r-=s}}function HS(t,e){let n=0;for(let{from:r,to:i}of t.ranges){if(e<=i){n+=e-r;break}n+=i-r}return n/t.total}function Jlt(t,e){for(let n of t)if(e(n))return n}const E7={toDOM(t){return t},fromDOM(t){return t},scale:1};class ect{constructor(e,n,r){let i=0,o=0,a=0;this.viewports=r.map(({from:s,to:l})=>{let c=n.lineAt(s,Xn.ByPos,e,0,0).top,u=n.lineAt(l,Xn.ByPos,e,0,0).bottom;return i+=u-c,{from:s,to:l,top:c,bottom:u,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(n.height-i);for(let s of this.viewports)s.domTop=a+(s.top-o)*this.scale,a=s.domBottom=s.domTop+(s.bottom-s.top),o=s.bottom}toDOM(e){for(let n=0,r=0,i=0;;n++){let o=ndx(i,e)):t._content)}const qS=ft.define({combine:t=>t.join(" ")}),O3=ft.define({combine:t=>t.indexOf(!0)>-1}),C3=ed.newName(),Dde=ed.newName(),Lde=ed.newName(),$de={"&light":"."+Dde,"&dark":"."+Lde};function T3(t,e,n){return new ed(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return t;if(!n||!n[i])throw new RangeError(`Unsupported selector: ${i}`);return n[i]}):t+" "+r}})}const tct=T3("."+C3,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},$de),hx="￿";class nct{constructor(e,n){this.points=e,this.text="",this.lineSeparator=n.facet(en.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=hx}readRange(e,n){if(!e)return this;let r=e.parentNode;for(let i=e;;){this.findPointBefore(r,i);let o=this.text.length;this.readNode(i);let a=i.nextSibling;if(a==n)break;let s=Dn.get(i),l=Dn.get(a);(s&&l?s.breakAfter:(s?s.breakAfter:cE(i))||cE(a)&&(i.nodeName!="BR"||i.cmIgnore)&&this.text.length>o)&&this.lineBreak(),i=a}return this.findPointBefore(r,n),this}readTextNode(e){let n=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let o=-1,a=1,s;if(this.lineSeparator?(o=n.indexOf(this.lineSeparator,r),a=this.lineSeparator.length):(s=i.exec(n))&&(o=s.index,a=s[0].length),this.append(n.slice(r,o<0?n.length:o)),o<0)break;if(this.lineBreak(),a>1)for(let l of this.points)l.node==e&&l.pos>this.text.length&&(l.pos-=a-1);r=o+a}}readNode(e){if(e.cmIgnore)return;let n=Dn.get(e),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(e,n){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(rct(e,r.node,r.offset)?n:0))}}function rct(t,e,n){for(;;){if(!e||n-1)this.newSel=null;else if(n>-1&&(this.bounds=e.docView.domBoundsAround(n,r,0))){let s=o||a?[]:sct(e),l=new nct(s,e.state);l.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=l.text,this.newSel=lct(s,this.bounds.from)}else{let s=e.observer.selectionRange,l=o&&o.node==s.focusNode&&o.offset==s.focusOffset||!u3(e.contentDOM,s.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(s.focusNode,s.focusOffset),c=a&&a.node==s.anchorNode&&a.offset==s.anchorOffset||!u3(e.contentDOM,s.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(s.anchorNode,s.anchorOffset),u=e.viewport;if((ht.ios||ht.chrome)&&e.state.selection.main.empty&&l!=c&&(u.from>0||u.toDate.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:a,to:s}=e.bounds,l=i.from,c=null;(o===8||ht.android&&e.text.length=i.from&&n.to<=i.to&&(n.from!=i.from||n.to!=i.to)&&i.to-i.from-(n.to-n.from)<=4?n={from:i.from,to:i.to,insert:t.state.doc.slice(i.from,n.from).append(n.insert).append(t.state.doc.slice(n.to,i.to))}:(ht.mac||ht.android)&&n&&n.from==n.to&&n.from==i.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(r&&n.insert.length==2&&(r=je.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:Sn.of([" "])}):ht.chrome&&n&&n.from==n.to&&n.from==i.head&&n.insert.toString()==` + `&&t.lineWrapping&&(r&&(r=je.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:Sn.of([" "])}),n){if(ht.ios&&t.inputState.flushIOSKey(n)||ht.android&&(n.to==i.to&&(n.from==i.from||n.from==i.from-1&&t.state.sliceDoc(n.from,i.from)==" ")&&n.insert.length==1&&n.insert.lines==2&&Tg(t.contentDOM,"Enter",13)||(n.from==i.from-1&&n.to==i.to&&n.insert.length==0||o==8&&n.insert.lengthi.head)&&Tg(t.contentDOM,"Backspace",8)||n.from==i.from&&n.to==i.to+1&&n.insert.length==0&&Tg(t.contentDOM,"Delete",46)))return!0;let a=n.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let s,l=()=>s||(s=oct(t,n,r));return t.state.facet(dde).some(c=>c(t,n.from,n.to,a,l))||t.dispatch(l()),!0}else if(r&&!r.main.eq(i)){let a=!1,s="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(a=!0),s=t.inputState.lastSelectionOrigin),t.dispatch({selection:r,scrollIntoView:a,userEvent:s}),!0}else return!1}function oct(t,e,n){let r,i=t.state,o=i.selection.main;if(e.from>=o.from&&e.to<=o.to&&e.to-e.from>=(o.to-o.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let s=o.frome.to?i.sliceDoc(e.to,o.to):"";r=i.replaceSelection(t.state.toText(s+e.insert.sliceString(0,void 0,t.state.lineBreak)+l))}else{let s=i.changes(e),l=n&&n.main.to<=s.newLength?n.main:void 0;if(i.selection.ranges.length>1&&t.inputState.composing>=0&&e.to<=o.to&&e.to>=o.to-10){let c=t.state.sliceDoc(e.from,e.to),u,f=n&&wde(t,n.main.head);if(f){let p=e.insert.length-(e.to-e.from);u={from:f.from,to:f.to-p}}else u=t.state.doc.lineAt(o.head);let d=o.to-e.to,h=o.to-o.from;r=i.changeByRange(p=>{if(p.from==o.from&&p.to==o.to)return{changes:s,range:l||p.map(s)};let m=p.to-d,g=m-c.length;if(p.to-p.from!=h||t.state.sliceDoc(g,m)!=c||p.to>=u.from&&p.from<=u.to)return{range:p};let v=i.changes({from:g,to:m,insert:e.insert}),y=p.to-o.to;return{changes:v,range:l?je.range(Math.max(0,l.anchor+y),Math.max(0,l.head+y)):p.map(v)}})}else r={changes:s,selection:l&&i.selection.replaceRange(l)}}let a="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,a+=".compose",t.inputState.compositionFirstChange&&(a+=".start",t.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:a,scrollIntoView:!0})}function act(t,e,n,r){let i=Math.min(t.length,e.length),o=0;for(;o0&&s>0&&t.charCodeAt(a-1)==e.charCodeAt(s-1);)a--,s--;if(r=="end"){let l=Math.max(0,o-Math.min(a,s));n-=a+l-o}if(a=a?o-n:0;o-=l,s=o+(s-a),a=o}else if(s=s?o-n:0;o-=l,a=o+(a-s),s=o}return{from:o,toA:a,toB:s}}function sct(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}=t.observer.selectionRange;return n&&(e.push(new P7(n,r)),(i!=n||o!=r)&&e.push(new P7(i,o))),e}function lct(t,e){if(t.length==0)return null;let n=t[0].pos,r=t.length==2?t[1].pos:n;return n>-1&&r>-1?je.single(n+e,r+e):null}const cct={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},RR=ht.ie&&ht.ie_version<=11;class uct{constructor(e){this.view=e,this.active=!1,this.selectionRange=new qst,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let r of n)this.queue.push(r);(ht.ie&&ht.ie_version<=11||ht.ios&&e.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),RR&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){e.type=="change"&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((n,r)=>n!=e[r]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(M2)?r.root.activeElement!=this.dom:!RC(r.dom,i))return;let o=i.anchorNode&&r.docView.nearest(i.anchorNode);if(o&&o.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(ht.ie&&ht.ie_version<=11||ht.android&&ht.chrome)&&!r.state.selection.main.empty&&i.focusNode&&Zx(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=lE(e.root);if(!n)return!1;let r=ht.safari&&e.root.nodeType==11&&Wst(this.dom.ownerDocument)==this.dom&&fct(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let i=RC(this.dom,r);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let o=this.delayedAndroidKey;o&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=o.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&o.force&&Tg(this.dom,o.key,o.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,r=-1,i=!1;for(let o of e){let a=this.readMutation(o);a&&(a.typeOver&&(i=!0),n==-1?{from:n,to:r}=a:(n=Math.min(a.from,n),r=Math.max(a.to,r)))}return{from:n,to:r,typeOver:i}}readChange(){let{from:e,to:n,typeOver:r}=this.processRecords(),i=this.selectionChanged&&RC(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let o=new ict(this.view,e,n,r);return this.view.docView.domChanged={newSel:o.newSel?o.newSel.main:null},o}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,i=Nde(this.view,n);return this.view.state==r&&this.view.update([]),i}readMutation(e){let n=this.view.docView.nearest(e.target);if(!n||n.ignoreMutation(e))return null;if(n.markDirty(e.type=="attributes"),e.type=="attributes"&&(n.flags|=4),e.type=="childList"){let r=M7(n,e.previousSibling||e.target.previousSibling,-1),i=M7(n,e.nextSibling||e.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:i?n.posBefore(i):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener("change",this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener("change",this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}destroy(){var e,n,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}}function M7(t,e,n){for(;e;){let r=Dn.get(e);if(r&&r.parent==t)return r;let i=e.parentNode;e=i!=t.dom?i:n>0?e.nextSibling:e.previousSibling}return null}function k7(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset,a=t.docView.domAtPos(t.state.selection.main.anchor);return Zx(a.node,a.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function fct(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return k7(t,i)}let n=null;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",r,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",r,!0),n?k7(t,n):null}class rt{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:n}=e;this.dispatchTransactions=e.dispatchTransactions||n&&(r=>r.forEach(i=>n(i,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||Xst(e.parent)||document,this.viewState=new T7(e.state||en.create(e)),e.scrollTo&&e.scrollTo.is(zS)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(ux).map(r=>new PR(r));for(let r of this.plugins)r.update(this);this.observer=new uct(this),this.inputState=new Tlt(this),this.inputState.ensureHandlers(this.plugins),this.docView=new l7(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure()}dispatch(...e){let n=e.length==1&&e[0]instanceof Br?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,i,o=this.state;for(let d of e){if(d.startState!=o)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");o=d.state}if(this.destroyed){this.viewState.state=o;return}let a=this.hasFocus,s=0,l=null;e.some(d=>d.annotation(kde))?(this.inputState.notifiedFocused=a,s=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,l=Ade(o,a),l||(s=1));let c=this.observer.delayedAndroidKey,u=null;if(c?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(o.doc)||!this.state.selection.eq(o.selection))&&(u=null)):this.observer.clear(),o.facet(en.phrases)!=this.state.facet(en.phrases))return this.setState(o);i=uE.create(this,o,e),i.flags|=s;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let d of e){if(f&&(f=f.map(d.changes)),d.scrollIntoView){let{main:h}=d.state.selection;f=new Eg(h.empty?h:je.cursor(h.head,h.head>h.anchor?-1:1))}for(let h of d.effects)h.is(zS)&&(f=h.value.clip(this.state))}this.viewState.update(i,f),this.bidiCache=fE.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(fx)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(d=>d.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(qS)!=i.state.facet(qS)&&(this.viewState.mustMeasureContent=!0),(n||r||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let d of this.state.facet(b3))try{d(i)}catch(h){ko(this.state,h,"update listener")}(l||u)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),u&&!Nde(this,u)&&c.force&&Tg(this.contentDOM,c.key,c.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new T7(e),this.plugins=e.facet(ux).map(r=>new PR(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new l7(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(ux),r=e.state.facet(ux);if(n!=r){let i=[];for(let o of r){let a=n.indexOf(o);if(a<0)i.push(new PR(o));else{let s=this.plugins[a];s.mustUpdate=e,i.push(s)}}for(let o of this.plugins)o.mustUpdate!=e&&o.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,r=this.scrollDOM,i=r.scrollTop*this.scaleY,{scrollAnchorPos:o,scrollAnchorHeight:a}=this.viewState;Math.abs(i-this.viewState.scrollTop)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let s=0;;s++){if(a<0)if(Gfe(r))o=-1,a=this.viewState.heightMap.height;else{let h=this.viewState.scrollAnchorAt(i);o=h.from,a=h.top}this.updateState=1;let l=this.viewState.measure(this);if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(s>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];l&4||([this.measureRequests,c]=[c,this.measureRequests]);let u=c.map(h=>{try{return h.read(this)}catch(p){return ko(this.state,p),A7}}),f=uE.create(this,this.state,[]),d=!1;f.flags|=l,n?n.flags|=l:n=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),d=this.docView.update(f),d&&this.docViewUpdate());for(let h=0;h1||p<-1){i=i+p,r.scrollTop=i/this.scaleY,a=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let s of this.state.facet(b3))s(n)}get themeClasses(){return C3+" "+(this.state.facet(O3)?Lde:Dde)+" "+this.state.facet(qS)}updateAttrs(){let e=R7(this,vde,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(M2)?"true":"false",class:"cm-content",style:`${ht.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),R7(this,u4,n);let r=this.observer.ignore(()=>{let i=m3(this.contentDOM,this.contentAttrs,n),o=m3(this.dom,this.editorAttrs,e);return i||o});return this.editorAttrs=e,this.contentAttrs=n,r}showAnnouncements(e){let n=!0;for(let r of e)for(let i of r.effects)if(i.is(rt.announce)){n&&(this.announceDOM.textContent=""),n=!1;let o=this.announceDOM.appendChild(document.createElement("div"));o.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(fx);let e=this.state.facet(rt.cspNonce);ed.mount(this.root,this.styleModules.concat(tct).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let n=0;nr.spec==e)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,n,r){return kR(this,e,p7(this,e,n,r))}moveByGroup(e,n){return kR(this,e,p7(this,e,n,r=>Olt(this,e.head,r)))}visualLineSide(e,n){let r=this.bidiSpans(e),i=this.textDirectionAt(e.from),o=r[n?r.length-1:0];return je.cursor(o.side(n,i)+e.from,o.forward(!n,i)?1:-1)}moveToLineBoundary(e,n,r=!0){return Slt(this,e,n,r)}moveVertically(e,n,r){return kR(this,e,Clt(this,e,n,r))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){return this.readMeasured(),Sde(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let r=this.docView.coordsAt(e,n);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(e),o=this.bidiSpans(i),a=o[_f.find(o,e-i.from,-1,n)];return E2(r,a.dir==nr.LTR==n>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(pde)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>dct)return ade(e.length);let n=this.textDirectionAt(e.from),r;for(let o of this.bidiCache)if(o.from==e.from&&o.dir==n&&(o.fresh||ode(o.isolates,r=s7(this,e))))return o.order;r||(r=s7(this,e));let i=slt(e.text,n,r);return this.bidiCache.push(new fE(e.from,e.to,n,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||ht.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Wfe(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,n={}){return zS.of(new Eg(typeof e=="number"?je.cursor(e):e,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return zS.of(new Eg(je.cursor(r.from),"start","start",r.top-e,n,!0))}static domEventHandlers(e){return Mr.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Mr.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=ed.newName(),i=[qS.of(r),fx.of(T3(`.${r}`,e))];return n&&n.dark&&i.push(O3.of(!0)),i}static baseTheme(e){return bd.lowest(fx.of(T3("."+C3,e,$de)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),i=r&&Dn.get(r)||Dn.get(e);return((n=i==null?void 0:i.rootView)===null||n===void 0?void 0:n.view)||null}}rt.styleModule=fx;rt.inputHandler=dde;rt.scrollHandler=gde;rt.focusChangeEffect=hde;rt.perLineTextDirection=pde;rt.exceptionSink=fde;rt.updateListener=b3;rt.editable=M2;rt.mouseSelectionStyle=ude;rt.dragMovesSelection=cde;rt.clickAddsSelectionRange=lde;rt.decorations=e_;rt.outerDecorations=yde;rt.atomicRanges=f4;rt.bidiIsolatedRanges=xde;rt.scrollMargins=bde;rt.darkTheme=O3;rt.cspNonce=ft.define({combine:t=>t.length?t[0]:""});rt.contentAttributes=u4;rt.editorAttributes=vde;rt.lineWrapping=rt.contentAttributes.of({class:"cm-lineWrapping"});rt.announce=It.define();const dct=4096,A7={};class fE{constructor(e,n,r,i,o,a){this.from=e,this.to=n,this.dir=r,this.isolates=i,this.fresh=o,this.order=a}static update(e,n){if(n.empty&&!e.some(o=>o.fresh))return e;let r=[],i=e.length?e[e.length-1].dir:nr.LTR;for(let o=Math.max(0,e.length-10);o=0;i--){let o=r[i],a=typeof o=="function"?o(t):o;a&&p3(a,n)}return n}const hct=ht.mac?"mac":ht.windows?"win":ht.linux?"linux":"key";function pct(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let i,o,a,s;for(let l=0;lr.concat(i),[]))),n}function gct(t,e,n){return jde(Fde(t.state),e,t,n)}let uf=null;const vct=4e3;function yct(t,e=hct){let n=Object.create(null),r=Object.create(null),i=(a,s)=>{let l=r[a];if(l==null)r[a]=s;else if(l!=s)throw new Error("Key binding "+a+" is used both as a regular binding and as a multi-stroke prefix")},o=(a,s,l,c,u)=>{var f,d;let h=n[a]||(n[a]=Object.create(null)),p=s.split(/ (?!$)/).map(v=>pct(v,e));for(let v=1;v{let b=uf={view:x,prefix:y,scope:a};return setTimeout(()=>{uf==b&&(uf=null)},vct),!0}]})}let m=p.join(" ");i(m,!1);let g=h[m]||(h[m]={preventDefault:!1,stopPropagation:!1,run:((d=(f=h._any)===null||f===void 0?void 0:f.run)===null||d===void 0?void 0:d.slice())||[]});l&&g.run.push(l),c&&(g.preventDefault=!0),u&&(g.stopPropagation=!0)};for(let a of t){let s=a.scope?a.scope.split(" "):["editor"];if(a.any)for(let c of s){let u=n[c]||(n[c]=Object.create(null));u._any||(u._any={preventDefault:!1,stopPropagation:!1,run:[]});for(let f in u)u[f].run.push(a.any)}let l=a[e]||a.key;if(l)for(let c of s)o(c,l,a.run,a.preventDefault,a.stopPropagation),a.shift&&o(c,"Shift-"+l,a.shift,a.preventDefault,a.stopPropagation)}return n}function jde(t,e,n,r){let i=Ust(e),o=Ci(i,0),a=Ga(o)==i.length&&i!=" ",s="",l=!1,c=!1,u=!1;uf&&uf.view==n&&uf.scope==r&&(s=uf.prefix+" ",Cde.indexOf(e.keyCode)<0&&(c=!0,uf=null));let f=new Set,d=g=>{if(g){for(let v of g.run)if(!f.has(v)&&(f.add(v),v(n,e)))return g.stopPropagation&&(u=!0),!0;g.preventDefault&&(g.stopPropagation&&(u=!0),c=!0)}return!1},h=t[r],p,m;return h&&(d(h[s+XS(i,e,!a)])?l=!0:a&&(e.altKey||e.metaKey||e.ctrlKey)&&!(ht.windows&&e.ctrlKey&&e.altKey)&&(p=td[e.keyCode])&&p!=i?(d(h[s+XS(p,e,!0)])||e.shiftKey&&(m=Jb[e.keyCode])!=i&&m!=p&&d(h[s+XS(m,e,!1)]))&&(l=!0):a&&e.shiftKey&&d(h[s+XS(i,e,!0)])&&(l=!0),!l&&d(h._any)&&(l=!0)),c&&(l=!0),l&&u&&e.stopPropagation(),l}class fw{constructor(e,n,r,i,o){this.className=e,this.left=n,this.top=r,this.width=i,this.height=o}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,n){return n.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,n,r){if(r.empty){let i=e.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let o=Bde(e);return[new fw(n,i.left-o.left,i.top-o.top,null,i.bottom-i.top)]}else return xct(e,n,r)}}function Bde(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==nr.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function D7(t,e,n){let r=je.cursor(e);return{from:Math.max(n.from,t.moveToLineBoundary(r,!1,!0).from),to:Math.min(n.to,t.moveToLineBoundary(r,!0,!0).from),type:uo.Text}}function xct(t,e,n){if(n.to<=t.viewport.from||n.from>=t.viewport.to)return[];let r=Math.max(n.from,t.viewport.from),i=Math.min(n.to,t.viewport.to),o=t.textDirection==nr.LTR,a=t.contentDOM,s=a.getBoundingClientRect(),l=Bde(t),c=a.querySelector(".cm-line"),u=c&&window.getComputedStyle(c),f=s.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),d=s.right-(u?parseInt(u.paddingRight):0),h=w3(t,r),p=w3(t,i),m=h.type==uo.Text?h:null,g=p.type==uo.Text?p:null;if(m&&(t.lineWrapping||h.widgetLineBreaks)&&(m=D7(t,r,m)),g&&(t.lineWrapping||p.widgetLineBreaks)&&(g=D7(t,i,g)),m&&g&&m.from==g.from)return y(x(n.from,n.to,m));{let _=m?x(n.from,null,m):b(h,!1),S=g?x(null,n.to,g):b(p,!0),O=[];return(m||h).to<(g||p).from-(m&&g?1:0)||h.widgetLineBreaks>1&&_.bottom+t.defaultLineHeight/2P&&T.from=z)break;N>L&&I(Math.max(U,L),_==null&&U<=P,Math.min(N,z),S==null&&N>=R,W.dir)}if(L=B.to+1,L>=z)break}return k.length==0&&I(P,_==null,R,S==null,t.textDirection),{top:C,bottom:E,horizontal:k}}function b(_,S){let O=s.top+(S?_.top:_.bottom);return{top:O,bottom:O,horizontal:[]}}}function bct(t,e){return t.constructor==e.constructor&&t.eq(e)}class _ct{constructor(e,n){this.view=e,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,e)}update(e){e.startState.facet(LC)!=e.state.facet(LC)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let n=0,r=e.facet(LC);for(;n!bct(n,this.drawn[r]))){let n=this.dom.firstChild,r=0;for(let i of e)i.update&&n&&i.constructor&&this.drawn[r].constructor&&i.update(n,this.drawn[r])?(n=n.nextSibling,r++):this.dom.insertBefore(i.draw(),n);for(;n;){let i=n.nextSibling;n.remove(),n=i}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const LC=ft.define();function zde(t){return[Mr.define(e=>new _ct(e,t)),LC.of(t)]}const Ude=!ht.ios,t_=ft.define({combine(t){return ac(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,n)=>Math.min(e,n),drawRangeCursor:(e,n)=>e||n})}});function wct(t={}){return[t_.of(t),Sct,Oct,Cct,mde.of(!0)]}function Wde(t){return t.startState.facet(t_)!=t.state.facet(t_)}const Sct=zde({above:!0,markers(t){let{state:e}=t,n=e.facet(t_),r=[];for(let i of e.selection.ranges){let o=i==e.selection.main;if(i.empty?!o||Ude:n.drawRangeCursor){let a=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",s=i.empty?i:je.cursor(i.head,i.head>i.anchor?-1:1);for(let l of fw.forRange(t,a,s))r.push(l)}}return r},update(t,e){t.transactions.some(r=>r.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=Wde(t);return n&&L7(t.state,e),t.docChanged||t.selectionSet||n},mount(t,e){L7(e.state,t)},class:"cm-cursorLayer"});function L7(t,e){e.style.animationDuration=t.facet(t_).cursorBlinkRate+"ms"}const Oct=zde({above:!1,markers(t){return t.state.selection.ranges.map(e=>e.empty?[]:fw.forRange(t,"cm-selectionBackground",e)).reduce((e,n)=>e.concat(n))},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||Wde(t)},class:"cm-selectionLayer"}),E3={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};Ude&&(E3[".cm-line"].caretColor="transparent !important",E3[".cm-content"]={caretColor:"transparent !important"});const Cct=bd.highest(rt.theme(E3)),Vde=It.define({map(t,e){return t==null?null:e.mapPos(t)}}),px=pi.define({create(){return null},update(t,e){return t!=null&&(t=e.changes.mapPos(t)),e.effects.reduce((n,r)=>r.is(Vde)?r.value:n,t)}}),Tct=Mr.fromClass(class{constructor(t){this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(t){var e;let n=t.state.field(px);n==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(t.startState.field(px)!=n||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(px),n=e!=null&&t.coordsAtPos(e);if(!n)return null;let r=t.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+t.scrollDOM.scrollLeft*t.scaleX,top:n.top-r.top+t.scrollDOM.scrollTop*t.scaleY,height:n.bottom-n.top}}drawCursor(t){if(this.cursor){let{scaleX:e,scaleY:n}=this.view;t?(this.cursor.style.left=t.left/e+"px",this.cursor.style.top=t.top/n+"px",this.cursor.style.height=t.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(t){this.view.state.field(px)!=t&&this.view.dispatch({effects:Vde.of(t)})}},{eventObservers:{dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}))},dragleave(t){(t.target==this.view.contentDOM||!this.view.contentDOM.contains(t.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function Ect(){return[px,Tct]}function $7(t,e,n,r,i){e.lastIndex=0;for(let o=t.iterRange(n,r),a=n,s;!o.next().done;a+=o.value.length)if(!o.lineBreak)for(;s=e.exec(o.value);)i(a+s.index,s)}function Pct(t,e){let n=t.visibleRanges;if(n.length==1&&n[0].from==t.viewport.from&&n[0].to==t.viewport.to)return n;let r=[];for(let{from:i,to:o}of n)i=Math.max(t.state.doc.lineAt(i).from,i-e),o=Math.min(t.state.doc.lineAt(o).to,o+e),r.length&&r[r.length-1].to>=i?r[r.length-1].to=o:r.push({from:i,to:o});return r}class Mct{constructor(e){const{regexp:n,decoration:r,decorate:i,boundary:o,maxLength:a=1e3}=e;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,i)this.addMatch=(s,l,c,u)=>i(u,c,c+s[0].length,s,l);else if(typeof r=="function")this.addMatch=(s,l,c,u)=>{let f=r(s,l,c);f&&u(c,c+s[0].length,f)};else if(r)this.addMatch=(s,l,c,u)=>u(c,c+s[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=o,this.maxLength=a}createDeco(e){let n=new Jf,r=n.add.bind(n);for(let{from:i,to:o}of Pct(e,this.maxLength))$7(e.state.doc,this.regexp,i,o,(a,s)=>this.addMatch(s,e,a,r));return n.finish()}updateDeco(e,n){let r=1e9,i=-1;return e.docChanged&&e.changes.iterChanges((o,a,s,l)=>{l>e.view.viewport.from&&s1e3?this.createDeco(e.view):i>-1?this.updateRange(e.view,n.map(e.changes),r,i):n}updateRange(e,n,r,i){for(let o of e.visibleRanges){let a=Math.max(o.from,r),s=Math.min(o.to,i);if(s>a){let l=e.state.doc.lineAt(a),c=l.tol.from;a--)if(this.boundary.test(l.text[a-1-l.from])){u=a;break}for(;sd.push(v.range(m,g));if(l==c)for(this.regexp.lastIndex=u-l.from;(h=this.regexp.exec(l.text))&&h.indexthis.addMatch(g,e,m,p));n=n.update({filterFrom:u,filterTo:f,filter:(m,g)=>mf,add:d})}}return n}}const P3=/x/.unicode!=null?"gu":"g",kct=new RegExp(`[\0-\b +--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,P3),Act={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let IR=null;function Rct(){var t;if(IR==null&&typeof document<"u"&&document.body){let e=document.body.style;IR=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return IR||!1}const $C=ft.define({combine(t){let e=ac(t,{render:null,specialChars:kct,addSpecialChars:null});return(e.replaceTabs=!Rct())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,P3)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,P3)),e}});function Ict(t={}){return[$C.of(t),Dct()]}let N7=null;function Dct(){return N7||(N7=Mr.fromClass(class{constructor(t){this.view=t,this.decorations=yt.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet($C)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new Mct({regexp:t.specialChars,decoration:(e,n,r)=>{let{doc:i}=n.state,o=Ci(e[0],0);if(o==9){let a=i.lineAt(r),s=n.state.tabSize,l=Cy(a.text,s,r-a.from);return yt.replace({widget:new Fct((s-l%s)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=yt.replace({widget:new Nct(t,o)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet($C);t.startState.facet($C)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))}const Lct="•";function $ct(t){return t>=32?Lct:t==10?"␤":String.fromCharCode(9216+t)}class Nct extends sc{constructor(e,n){super(),this.options=e,this.code=n}eq(e){return e.code==this.code}toDOM(e){let n=$ct(this.code),r=e.state.phrase("Control character")+" "+(Act[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,n);if(i)return i;let o=document.createElement("span");return o.textContent=n,o.title=r,o.setAttribute("aria-label",r),o.className="cm-specialChar",o}ignoreEvent(){return!1}}class Fct extends sc{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function jct(){return zct}const Bct=yt.line({class:"cm-activeLine"}),zct=Mr.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,n=[];for(let r of t.state.selection.ranges){let i=t.lineBlockAt(r.head);i.from>e&&(n.push(Bct.range(i.from)),e=i.from)}return yt.set(n)}},{decorations:t=>t.decorations});class Uct extends sc{constructor(e){super(),this.content=e}toDOM(){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild(typeof this.content=="string"?document.createTextNode(this.content):this.content),typeof this.content=="string"?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}coordsAt(e){let n=e.firstChild?ov(e.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(e.parentNode),i=E2(n[0],r.direction!="rtl"),o=parseInt(r.lineHeight);return i.bottom-i.top>o*1.5?{left:i.left,right:i.right,top:i.top,bottom:i.top+o}:i}ignoreEvent(){return!1}}function Wct(t){return Mr.fromClass(class{constructor(e){this.view=e,this.placeholder=t?yt.set([yt.widget({widget:new Uct(t),side:1}).range(0)]):yt.none}get decorations(){return this.view.state.doc.length?yt.none:this.placeholder}},{decorations:e=>e.decorations})}const M3=2e3;function Vct(t,e,n){let r=Math.min(e.line,n.line),i=Math.max(e.line,n.line),o=[];if(e.off>M3||n.off>M3||e.col<0||n.col<0){let a=Math.min(e.off,n.off),s=Math.max(e.off,n.off);for(let l=r;l<=i;l++){let c=t.doc.line(l);c.length<=s&&o.push(je.range(c.from+a,c.to+s))}}else{let a=Math.min(e.col,n.col),s=Math.max(e.col,n.col);for(let l=r;l<=i;l++){let c=t.doc.line(l),u=s3(c.text,a,t.tabSize,!0);if(u<0)o.push(je.cursor(c.to));else{let f=s3(c.text,s,t.tabSize);o.push(je.range(c.from+u,c.from+f))}}}return o}function Gct(t,e){let n=t.coordsAtPos(t.viewport.from);return n?Math.round(Math.abs((n.left-e)/t.defaultCharacterWidth)):-1}function F7(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1),r=t.state.doc.lineAt(n),i=n-r.from,o=i>M3?-1:i==r.length?Gct(t,e.clientX):Cy(r.text,t.state.tabSize,n-r.from);return{line:r.number,col:o,off:i}}function Hct(t,e){let n=F7(t,e),r=t.state.selection;return n?{update(i){if(i.docChanged){let o=i.changes.mapPos(i.startState.doc.line(n.line).from),a=i.state.doc.lineAt(o);n={line:a.number,col:n.col,off:Math.min(n.off,a.length)},r=r.map(i.changes)}},get(i,o,a){let s=F7(t,i);if(!s)return r;let l=Vct(t.state,n,s);return l.length?a?je.create(l.concat(r.ranges)):je.create(l):r}}:null}function qct(t){let e=(t==null?void 0:t.eventFilter)||(n=>n.altKey&&n.button==0);return rt.mouseSelectionStyle.of((n,r)=>e(r)?Hct(n,r):null)}const Xct={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},Qct={style:"cursor: crosshair"};function Yct(t={}){let[e,n]=Xct[t.key||"Alt"],r=Mr.fromClass(class{constructor(i){this.view=i,this.isDown=!1}set(i){this.isDown!=i&&(this.isDown=i,this.view.update([]))}},{eventObservers:{keydown(i){this.set(i.keyCode==e||n(i))},keyup(i){(i.keyCode==e||!n(i))&&this.set(!1)},mousemove(i){this.set(n(i))}}});return[r,rt.contentAttributes.of(i=>{var o;return!((o=i.plugin(r))===null||o===void 0)&&o.isDown?Qct:null})]}const M0="-10000px";class Gde{constructor(e,n,r,i){this.facet=n,this.createTooltipView=r,this.removeTooltipView=i,this.input=e.state.facet(n),this.tooltips=this.input.filter(a=>a);let o=null;this.tooltipViews=this.tooltips.map(a=>o=r(a,o))}update(e,n){var r;let i=e.state.facet(this.facet),o=i.filter(l=>l);if(i===this.input){for(let l of this.tooltipViews)l.update&&l.update(e);return!1}let a=[],s=n?[]:null;for(let l=0;ln[c]=l),n.length=s.length),this.input=i,this.tooltips=o,this.tooltipViews=a,!0}}function Kct(t){let{win:e}=t;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const DR=ft.define({combine:t=>{var e,n,r;return{position:ht.ios?"absolute":((e=t.find(i=>i.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((n=t.find(i=>i.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((r=t.find(i=>i.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||Kct}}}),j7=new WeakMap,h4=Mr.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(DR);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new Gde(t,p4,(n,r)=>this.createTooltip(n,r),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let n=e||t.geometryChanged,r=t.state.facet(DR);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let i of this.manager.tooltipViews)this.container.appendChild(i.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(t,e){let n=t.create(this.view),r=e?e.dom:null;if(n.dom.classList.add("cm-tooltip"),t.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let i=document.createElement("div");i.className="cm-tooltip-arrow",n.dom.insertBefore(i,r)}return n.dom.style.position=this.position,n.dom.style.top=M0,n.dom.style.left="0px",this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var t,e,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(t=r.destroy)===null||t===void 0||t.call(r);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=this.view.dom.getBoundingClientRect(),e=1,n=1,r=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:i}=this.manager.tooltipViews[0];if(ht.gecko)r=i.offsetParent!=this.container.ownerDocument.body;else if(i.style.top==M0&&i.style.left=="0px"){let o=i.getBoundingClientRect();r=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}}if(r||this.position=="absolute")if(this.parent){let i=this.parent.getBoundingClientRect();i.width&&i.height&&(e=i.width/this.parent.offsetWidth,n=i.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:n}=this.view.viewState);return{editor:t,parent:this.parent?this.container.getBoundingClientRect():t,pos:this.manager.tooltips.map((i,o)=>{let a=this.manager.tooltipViews[o];return a.getCoords?a.getCoords(i.pos):this.view.coordsAtPos(i.pos)}),size:this.manager.tooltipViews.map(({dom:i})=>i.getBoundingClientRect()),space:this.view.state.facet(DR).tooltipSpace(this.view),scaleX:e,scaleY:n,makeAbsolute:r}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let s of this.manager.tooltipViews)s.dom.style.position="absolute"}let{editor:n,space:r,scaleX:i,scaleY:o}=t,a=[];for(let s=0;s=Math.min(n.bottom,r.bottom)||f.rightMath.min(n.right,r.right)+.1){u.style.top=M0;continue}let h=l.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,p=h?7:0,m=d.right-d.left,g=(e=j7.get(c))!==null&&e!==void 0?e:d.bottom-d.top,v=c.offset||Jct,y=this.view.textDirection==nr.LTR,x=d.width>r.right-r.left?y?r.left:r.right-d.width:y?Math.min(f.left-(h?14:0)+v.x,r.right-m):Math.max(r.left,f.left-m+(h?14:0)-v.x),b=this.above[s];!l.strictSide&&(b?f.top-(d.bottom-d.top)-v.yr.bottom)&&b==r.bottom-f.bottom>f.top-r.top&&(b=this.above[s]=!b);let _=(b?f.top-r.top:r.bottom-f.bottom)-p;if(_x&&C.topS&&(S=b?C.top-g-2-p:C.bottom+p+2);if(this.position=="absolute"?(u.style.top=(S-t.parent.top)/o+"px",u.style.left=(x-t.parent.left)/i+"px"):(u.style.top=S/o+"px",u.style.left=x/i+"px"),h){let C=f.left+(y?v.x:-v.x)-(x+14-7);h.style.left=C/i+"px"}c.overlap!==!0&&a.push({left:x,top:S,right:O,bottom:S+g}),u.classList.toggle("cm-tooltip-above",b),u.classList.toggle("cm-tooltip-below",!b),c.positioned&&c.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=M0}},{eventObservers:{scroll(){this.maybeMeasure()}}}),Zct=rt.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),Jct={x:0,y:0},p4=ft.define({enables:[h4,Zct]}),dE=ft.define({combine:t=>t.reduce((e,n)=>e.concat(n),[])});class k2{static create(e){return new k2(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new Gde(e,dE,(n,r)=>this.createHostedView(n,r),n=>n.dom.remove())}createHostedView(e,n){let r=e.create(this.view);return r.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(r.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&r.mount&&r.mount(this.view),r}mount(e){for(let n of this.manager.tooltipViews)n.mount&&n.mount(e);this.mounted=!0}positioned(e){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let n of this.manager.tooltipViews)(e=n.destroy)===null||e===void 0||e.call(n)}passProp(e){let n;for(let r of this.manager.tooltipViews){let i=r[e];if(i!==void 0){if(n===void 0)n=i;else if(n!==i)return}}return n}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const eut=p4.compute([dE],t=>{let e=t.facet(dE);return e.length===0?null:{pos:Math.min(...e.map(n=>n.pos)),end:Math.max(...e.map(n=>{var r;return(r=n.end)!==null&&r!==void 0?r:n.pos})),create:k2.create,above:e[0].above,arrow:e.some(n=>n.arrow)}});class tut{constructor(e,n,r,i,o){this.view=e,this.source=n,this.field=r,this.setHover=i,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;es.bottom||n.xs.right+e.defaultCharacterWidth)return;let l=e.bidiSpans(e.state.doc.lineAt(i)).find(u=>u.from<=i&&u.to>=i),c=l&&l.dir==nr.RTL?-1:1;o=n.x{this.pending==s&&(this.pending=null,l&&!(Array.isArray(l)&&!l.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(l)?l:[l])}))},l=>ko(e.state,l,"hover tooltip"))}else a&&!(Array.isArray(a)&&!a.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(a)?a:[a])})}get tooltip(){let e=this.view.plugin(h4),n=e?e.manager.tooltips.findIndex(r=>r.create==k2.create):-1;return n>-1?e.manager.tooltipViews[n]:null}mousemove(e){var n,r;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:i,tooltip:o}=this;if(i.length&&o&&!nut(o.dom,e)||this.pending){let{pos:a}=i[0]||this.pending,s=(r=(n=i[0])===null||n===void 0?void 0:n.end)!==null&&r!==void 0?r:a;(a==s?this.view.posAtCoords(this.lastMove)!=a:!rut(this.view,a,s,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length){let{tooltip:r}=this;r&&r.dom.contains(e.relatedTarget)?this.watchTooltipLeave(r.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let n=r=>{e.removeEventListener("mouseleave",n),this.active.length&&!this.view.dom.contains(r.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const QS=4;function nut(t,e){let n=t.getBoundingClientRect();return e.clientX>=n.left-QS&&e.clientX<=n.right+QS&&e.clientY>=n.top-QS&&e.clientY<=n.bottom+QS}function rut(t,e,n,r,i,o){let a=t.scrollDOM.getBoundingClientRect(),s=t.documentTop+t.documentPadding.top+t.contentHeight;if(a.left>r||a.righti||Math.min(a.bottom,s)=e&&l<=n}function iut(t,e={}){let n=It.define(),r=pi.define({create(){return[]},update(i,o){if(i.length&&(e.hideOnChange&&(o.docChanged||o.selection)?i=[]:e.hideOn&&(i=i.filter(a=>!e.hideOn(o,a))),o.docChanged)){let a=[];for(let s of i){let l=o.changes.mapPos(s.pos,-1,Pi.TrackDel);if(l!=null){let c=Object.assign(Object.create(null),s);c.pos=l,c.end!=null&&(c.end=o.changes.mapPos(c.end)),a.push(c)}}i=a}for(let a of o.effects)a.is(n)&&(i=a.value),a.is(out)&&(i=[]);return i},provide:i=>dE.from(i)});return[r,Mr.define(i=>new tut(i,t,r,n,e.hoverTime||300)),eut]}function Hde(t,e){let n=t.plugin(h4);if(!n)return null;let r=n.manager.tooltips.indexOf(e);return r<0?null:n.manager.tooltipViews[r]}const out=It.define(),B7=ft.define({combine(t){let e,n;for(let r of t)e=e||r.topContainer,n=n||r.bottomContainer;return{topContainer:e,bottomContainer:n}}});function n_(t,e){let n=t.plugin(qde),r=n?n.specs.indexOf(e):-1;return r>-1?n.panels[r]:null}const qde=Mr.fromClass(class{constructor(t){this.input=t.state.facet(r_),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(B7);this.top=new YS(t,!0,e.topContainer),this.bottom=new YS(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(t){let e=t.state.facet(B7);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new YS(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new YS(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(r_);if(n!=this.input){let r=n.filter(l=>l),i=[],o=[],a=[],s=[];for(let l of r){let c=this.specs.indexOf(l),u;c<0?(u=l(t.view),s.push(u)):(u=this.panels[c],u.update&&u.update(t)),i.push(u),(u.top?o:a).push(u)}this.specs=r,this.panels=i,this.top.sync(o),this.bottom.sync(a);for(let l of s)l.dom.classList.add("cm-panel"),l.mount&&l.mount()}else for(let r of this.panels)r.update&&r.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>rt.scrollMargins.of(e=>{let n=e.plugin(t);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class YS{constructor(e,n,r){this.view=e,this.top=n,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let n of this.panels)n.destroy&&e.indexOf(n)<0&&n.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let e=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;e!=n.dom;)e=z7(e);e=e.nextSibling}else this.dom.insertBefore(n.dom,e);for(;e;)e=z7(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function z7(t){let e=t.nextSibling;return t.remove(),e}const r_=ft.define({enables:qde});class du extends ep{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}du.prototype.elementClass="";du.prototype.toDOM=void 0;du.prototype.mapMode=Pi.TrackBefore;du.prototype.startSide=du.prototype.endSide=-1;du.prototype.point=!0;const NC=ft.define(),aut={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>sn.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},eb=ft.define();function sut(t){return[Xde(),eb.of(Object.assign(Object.assign({},aut),t))]}const k3=ft.define({combine:t=>t.some(e=>e)});function Xde(t){let e=[lut];return t&&t.fixed===!1&&e.push(k3.of(!0)),e}const lut=Mr.fromClass(class{constructor(t){this.view=t,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(eb).map(e=>new W7(t,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!t.state.facet(k3),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}update(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,r=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}t.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(k3)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&this.dom.remove();let n=sn.iter(this.view.state.facet(NC),this.view.viewport.from),r=[],i=this.gutters.map(o=>new cut(o,this.view.viewport,-this.view.documentPadding.top));for(let o of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(o.type)){let a=!0;for(let s of o.type)if(s.type==uo.Text&&a){A3(n,r,s.from);for(let l of i)l.line(this.view,s,r);a=!1}else if(s.widget)for(let l of i)l.widget(this.view,s)}else if(o.type==uo.Text){A3(n,r,o.from);for(let a of i)a.line(this.view,o,r)}else if(o.widget)for(let a of i)a.widget(this.view,o);for(let o of i)o.finish();t&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(t){let e=t.startState.facet(eb),n=t.state.facet(eb),r=t.docChanged||t.heightChanged||t.viewportChanged||!sn.eq(t.startState.facet(NC),t.state.facet(NC),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let i of this.gutters)i.update(t)&&(r=!0);else{r=!0;let i=[];for(let o of n){let a=e.indexOf(o);a<0?i.push(new W7(this.view,o)):(this.gutters[a].update(t),i.push(this.gutters[a]))}for(let o of this.gutters)o.dom.remove(),i.indexOf(o)<0&&o.destroy();for(let o of i)this.dom.appendChild(o.dom);this.gutters=i}return r}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove()}},{provide:t=>rt.scrollMargins.of(e=>{let n=e.plugin(t);return!n||n.gutters.length==0||!n.fixed?null:e.textDirection==nr.LTR?{left:n.dom.offsetWidth*e.scaleX}:{right:n.dom.offsetWidth*e.scaleX}})});function U7(t){return Array.isArray(t)?t:[t]}function A3(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class cut{constructor(e,n,r){this.gutter=e,this.height=r,this.i=0,this.cursor=sn.iter(e.markers,n.from)}addElement(e,n,r){let{gutter:i}=this,o=(n.top-this.height)/e.scaleY,a=n.height/e.scaleY;if(this.i==i.elements.length){let s=new Qde(e,a,o,r);i.elements.push(s),i.dom.appendChild(s.dom)}else i.elements[this.i].update(e,a,o,r);this.height=n.bottom,this.i++}line(e,n,r){let i=[];A3(this.cursor,i,n.from),r.length&&(i=i.concat(r));let o=this.gutter.config.lineMarker(e,n,i);o&&i.unshift(o);let a=this.gutter;i.length==0&&!a.config.renderEmptyElements||this.addElement(e,n,i)}widget(e,n){let r=this.gutter.config.widgetMarker(e,n.widget,n);r&&this.addElement(e,n,[r])}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}}class W7{constructor(e,n){this.view=e,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in n.domEventHandlers)this.dom.addEventListener(r,i=>{let o=i.target,a;if(o!=this.dom&&this.dom.contains(o)){for(;o.parentNode!=this.dom;)o=o.parentNode;let l=o.getBoundingClientRect();a=(l.top+l.bottom)/2}else a=i.clientY;let s=e.lineBlockAtHeight(a-e.documentTop);n.domEventHandlers[r](e,s,i)&&i.preventDefault()});this.markers=U7(n.markers(e)),n.initialSpacer&&(this.spacer=new Qde(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let n=this.markers;if(this.markers=U7(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],e);i!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[i])}let r=e.view.viewport;return!sn.eq(this.markers,n,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class Qde{constructor(e,n,r,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,r,i)}update(e,n,r,i){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),uut(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,n){let r="cm-gutterElement",i=this.dom.firstChild;for(let o=0,a=0;;){let s=a,l=oo(s,l,c)||a(s,l,c):a}return r}})}});class LR extends du{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function $R(t,e){return t.state.facet(Jm).formatNumber(e,t.state)}const dut=eb.compute([Jm],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(fut)},lineMarker(e,n,r){return r.some(i=>i.toDOM)?null:new LR($R(e,e.state.doc.lineAt(n.from).number))},widgetMarker:()=>null,lineMarkerChange:e=>e.startState.facet(Jm)!=e.state.facet(Jm),initialSpacer(e){return new LR($R(e,V7(e.state.doc.lines)))},updateSpacer(e,n){let r=$R(n.view,V7(n.view.state.doc.lines));return r==e.number?e:new LR(r)},domEventHandlers:t.facet(Jm).domEventHandlers}));function hut(t={}){return[Jm.of(t),Xde(),dut]}function V7(t){let e=9;for(;e{let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.head).from;i>n&&(n=i,e.push(put.range(i)))}return sn.of(e)});function gut(){return mut}const Yde=1024;let vut=0;class NR{constructor(e,n){this.from=e,this.to=n}}class Wt{constructor(e={}){this.id=vut++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Wo.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}Wt.closedBy=new Wt({deserialize:t=>t.split(" ")});Wt.openedBy=new Wt({deserialize:t=>t.split(" ")});Wt.group=new Wt({deserialize:t=>t.split(" ")});Wt.isolate=new Wt({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});Wt.contextHash=new Wt({perNode:!0});Wt.lookAhead=new Wt({perNode:!0});Wt.mounted=new Wt({perNode:!0});class hE{constructor(e,n,r){this.tree=e,this.overlay=n,this.parser=r}static get(e){return e&&e.props&&e.props[Wt.mounted.id]}}const yut=Object.create(null);class Wo{constructor(e,n,r,i=0){this.name=e,this.props=n,this.id=r,this.flags=i}static define(e){let n=e.props&&e.props.length?Object.create(null):yut,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new Wo(e.name||"",n,e.id,r);if(e.props){for(let o of e.props)if(Array.isArray(o)||(o=o(i)),o){if(o[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[o[0].id]=o[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(Wt.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let i of r.split(" "))n[i]=e[r];return r=>{for(let i=r.prop(Wt.group),o=-1;o<(i?i.length:0);o++){let a=n[o<0?r.name:i[o]];if(a)return a}}}}Wo.none=new Wo("",Object.create(null),0,8);class m4{constructor(e){this.types=e;for(let n=0;n0;for(let l=this.cursor(a|Zr.IncludeAnonymous);;){let c=!1;if(l.from<=o&&l.to>=i&&(!s&&l.type.isAnonymous||n(l)!==!1)){if(l.firstChild())continue;c=!0}for(;c&&r&&(s||!l.type.isAnonymous)&&r(l),!l.nextSibling();){if(!l.parent())return;c=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:y4(Wo.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new zr(this.type,n,r,i,this.propValues),e.makeTree||((n,r,i)=>new zr(Wo.none,n,r,i)))}static build(e){return wut(e)}}zr.empty=new zr(Wo.none,[],[],0);class g4{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new g4(this.buffer,this.index)}}class rd{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return Wo.none}toString(){let e=[];for(let n=0;n0));l=a[l+3]);return s}slice(e,n,r){let i=this.buffer,o=new Uint16Array(n-e),a=0;for(let s=e,l=0;s=e&&ne;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}function i_(t,e,n,r){for(var i;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to0?s.length:-1;e!=c;e+=n){let u=s[e],f=l[e]+a.from;if(Kde(i,r,f,f+u.length)){if(u instanceof rd){if(o&Zr.ExcludeBuffers)continue;let d=u.findChild(0,u.buffer.length,n,r-f,i);if(d>-1)return new Al(new xut(a,u,e,f),null,d)}else if(o&Zr.IncludeAnonymous||!u.type.isAnonymous||v4(u)){let d;if(!(o&Zr.IgnoreMounts)&&(d=hE.get(u))&&!d.overlay)return new Fo(d.tree,f,e,a);let h=new Fo(u,f,e,a);return o&Zr.IncludeAnonymous||!h.type.isAnonymous?h:h.nextChild(n<0?u.children.length-1:0,n,r,i)}}}if(o&Zr.IncludeAnonymous||!a.type.isAnonymous||(a.index>=0?e=a.index+n:e=n<0?-1:a._parent._tree.children.length,a=a._parent,!a))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,n,r=0){let i;if(!(r&Zr.IgnoreOverlays)&&(i=hE.get(this._tree))&&i.overlay){let o=e-this.from;for(let{from:a,to:s}of i.overlay)if((n>0?a<=o:a=o:s>o))return new Fo(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function H7(t,e,n,r){let i=t.cursor(),o=[];if(!i.firstChild())return o;if(n!=null){for(let a=!1;!a;)if(a=i.type.is(n),!i.nextSibling())return o}for(;;){if(r!=null&&i.type.is(r))return o;if(i.type.is(e)&&o.push(i.node),!i.nextSibling())return r==null?o:[]}}function R3(t,e,n=e.length-1){for(let r=t.parent;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}class xut{constructor(e,n,r,i){this.parent=e,this.buffer=n,this.index=r,this.start=i}}class Al extends Zde{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,r){super(),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,n,r){let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.context.start,r);return o<0?null:new Al(this.context,this,o)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,n,r=0){if(r&Zr.ExcludeBuffers)return null;let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return o<0?null:new Al(this.context,this,o)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Al(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new Al(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,i=this.index+4,o=r.buffer[this.index+3];if(o>i){let a=r.buffer[this.index+1];e.push(r.slice(i,o,a)),n.push(0)}return new zr(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Jde(t){if(!t.length)return null;let e=0,n=t[0];for(let o=1;on.from||a.to=e){let s=new Fo(a.tree,a.overlay[0].from+o.from,-1,o);(i||(i=[r])).push(i_(s,e,n,!1))}}return i?Jde(i):r}class I3{get name(){return this.type.name}constructor(e,n=0){if(this.mode=n,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Fo)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof Fo?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:i}=this.buffer,o=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.buffer.start,r);return o<0?!1:(this.stack.push(this.index),this.yieldBuf(o))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,r=this.mode){return this.buffer?r&Zr.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Zr.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Zr.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,r,{buffer:i}=this;if(i){if(e>0){if(this.index-1)for(let o=n+e,a=e<0?-1:r._tree.children.length;o!=a;o+=e){let s=r._tree.children[o];if(this.mode&Zr.IncludeAnonymous||s instanceof rd||!s.type.isAnonymous||v4(s))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to=0;){for(let a=e;a;a=a._parent)if(a.index==i){if(i==this.index)return a;n=a,r=o+1;break e}i=this.stack[--o]}for(let i=r;i=0;o--){if(o<0)return R3(this.node,e,i);let a=r[n.buffer[this.stack[o]]];if(!a.isAnonymous){if(e[i]&&e[i]!=a.name)return!1;i--}}return!0}}function v4(t){return t.children.some(e=>e instanceof rd||!e.type.isAnonymous||v4(e))}function wut(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:i=Yde,reused:o=[],minRepeatType:a=r.types.length}=t,s=Array.isArray(n)?new g4(n,n.length):n,l=r.types,c=0,u=0;function f(_,S,O,C,E,k){let{id:I,start:P,end:R,size:T}=s,L=u;for(;T<0;)if(s.next(),T==-1){let N=o[I];O.push(N),C.push(P-_);return}else if(T==-3){c=I;return}else if(T==-4){u=I;return}else throw new RangeError(`Unrecognized record size: ${T}`);let z=l[I],B,W,U=P-_;if(R-P<=i&&(W=g(s.pos-S,E))){let N=new Uint16Array(W.size-W.skip),$=s.pos-W.size,D=N.length;for(;s.pos>$;)D=v(W.start,N,D);B=new rd(N,R-W.start,r),U=W.start-_}else{let N=s.pos-T;s.next();let $=[],D=[],A=I>=a?I:-1,q=0,Y=R;for(;s.pos>N;)A>=0&&s.id==A&&s.size>=0?(s.end<=Y-i&&(p($,D,P,q,s.end,Y,A,L),q=$.length,Y=s.end),s.next()):k>2500?d(P,N,$,D):f(P,N,$,D,A,k+1);if(A>=0&&q>0&&q<$.length&&p($,D,P,q,P,Y,A,L),$.reverse(),D.reverse(),A>-1&&q>0){let K=h(z);B=y4(z,$,D,0,$.length,0,R-P,K,K)}else B=m(z,$,D,R-P,L-R)}O.push(B),C.push(U)}function d(_,S,O,C){let E=[],k=0,I=-1;for(;s.pos>S;){let{id:P,start:R,end:T,size:L}=s;if(L>4)s.next();else{if(I>-1&&R=0;T-=3)P[L++]=E[T],P[L++]=E[T+1]-R,P[L++]=E[T+2]-R,P[L++]=L;O.push(new rd(P,E[2]-R,r)),C.push(R-_)}}function h(_){return(S,O,C)=>{let E=0,k=S.length-1,I,P;if(k>=0&&(I=S[k])instanceof zr){if(!k&&I.type==_&&I.length==C)return I;(P=I.prop(Wt.lookAhead))&&(E=O[k]+I.length+P)}return m(_,S,O,C,E)}}function p(_,S,O,C,E,k,I,P){let R=[],T=[];for(;_.length>C;)R.push(_.pop()),T.push(S.pop()+O-E);_.push(m(r.types[I],R,T,k-E,P-k)),S.push(E-O)}function m(_,S,O,C,E=0,k){if(c){let I=[Wt.contextHash,c];k=k?[I].concat(k):[I]}if(E>25){let I=[Wt.lookAhead,E];k=k?[I].concat(k):[I]}return new zr(_,S,O,C,k)}function g(_,S){let O=s.fork(),C=0,E=0,k=0,I=O.end-i,P={size:0,start:0,skip:0};e:for(let R=O.pos-_;O.pos>R;){let T=O.size;if(O.id==S&&T>=0){P.size=C,P.start=E,P.skip=k,k+=4,C+=4,O.next();continue}let L=O.pos-T;if(T<0||L=a?4:0,B=O.start;for(O.next();O.pos>L;){if(O.size<0)if(O.size==-3)z+=4;else break e;else O.id>=a&&(z+=4);O.next()}E=B,C+=T,k+=z}return(S<0||C==_)&&(P.size=C,P.start=E,P.skip=k),P.size>4?P:void 0}function v(_,S,O){let{id:C,start:E,end:k,size:I}=s;if(s.next(),I>=0&&C4){let R=s.pos-(I-4);for(;s.pos>R;)O=v(_,S,O)}S[--O]=P,S[--O]=k-_,S[--O]=E-_,S[--O]=C}else I==-3?c=C:I==-4&&(u=C);return O}let y=[],x=[];for(;s.pos>0;)f(t.start||0,t.bufferStart||0,y,x,-1,0);let b=(e=t.length)!==null&&e!==void 0?e:y.length?x[0]+y[0].length:0;return new zr(l[t.topID],y.reverse(),x.reverse(),b)}const q7=new WeakMap;function FC(t,e){if(!t.isAnonymous||e instanceof rd||e.type!=t)return 1;let n=q7.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof zr)){n=1;break}n+=FC(t,r)}q7.set(e,n)}return n}function y4(t,e,n,r,i,o,a,s,l){let c=0;for(let p=r;p=u)break;S+=O}if(x==b+1){if(S>u){let O=p[b];h(O.children,O.positions,0,O.children.length,m[b]+y);continue}f.push(p[b])}else{let O=m[x-1]+p[x-1].length-_;f.push(y4(t,p,m,b,x,_,O,null,l))}d.push(_+y-o)}}return h(e,n,r,i,0),(s||l)(f,d,a)}class Sut{constructor(){this.map=new WeakMap}setBuffer(e,n,r){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(n,r)}getBuffer(e,n){let r=this.map.get(e);return r&&r.get(n)}set(e,n){e instanceof Al?this.setBuffer(e.context.buffer,e.index,n):e instanceof Fo&&this.map.set(e.tree,n)}get(e){return e instanceof Al?this.getBuffer(e.context.buffer,e.index):e instanceof Fo?this.map.get(e.tree):void 0}cursorSet(e,n){e.buffer?this.setBuffer(e.buffer.buffer,e.index,n):this.map.set(e.tree,n)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Nh{constructor(e,n,r,i,o=!1,a=!1){this.from=e,this.to=n,this.tree=r,this.offset=i,this.open=(o?1:0)|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let i=[new Nh(0,e.length,e,0,!1,r)];for(let o of n)o.to>e.length&&i.push(o);return i}static applyChanges(e,n,r=128){if(!n.length)return e;let i=[],o=1,a=e.length?e[0]:null;for(let s=0,l=0,c=0;;s++){let u=s=r)for(;a&&a.from=d.from||f<=d.to||c){let h=Math.max(d.from,l)-c,p=Math.min(d.to,f)-c;d=h>=p?null:new Nh(h,p,d.tree,d.offset+c,s>0,!!u)}if(d&&i.push(d),a.to>f)break;a=onew NR(i.from,i.to)):[new NR(0,0)]:[new NR(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let i=this.startParse(e,n,r);for(;;){let o=i.advance();if(o)return o}}}class Out{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}new Wt({perNode:!0});let Cut=0;class yl{constructor(e,n,r){this.set=e,this.base=n,this.modified=r,this.id=Cut++}static define(e){if(e!=null&&e.base)throw new Error("Can not derive from a modified tag");let n=new yl([],null,[]);if(n.set.push(n),e)for(let r of e.set)n.set.push(r);return n}static defineModifier(){let e=new pE;return n=>n.modified.indexOf(e)>-1?n:pE.get(n.base||n,n.modified.concat(e).sort((r,i)=>r.id-i.id))}}let Tut=0;class pE{constructor(){this.instances=[],this.id=Tut++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(s=>s.base==e&&Eut(n,s.modified));if(r)return r;let i=[],o=new yl(i,e,n);for(let s of n)s.instances.push(o);let a=Put(n);for(let s of e.set)if(!s.modified.length)for(let l of a)i.push(pE.get(s,l));return o}}function Eut(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function Put(t){let e=[[]];for(let n=0;nr.length-n.length)}function x4(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let o=[],a=2,s=i;for(let f=0;;){if(s=="..."&&f>0&&f+3==i.length){a=1;break}let d=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(s);if(!d)throw new RangeError("Invalid path: "+i);if(o.push(d[0]=="*"?"":d[0][0]=='"'?JSON.parse(d[0]):d[0]),f+=d[0].length,f==i.length)break;let h=i[f++];if(f==i.length&&h=="!"){a=0;break}if(h!="/")throw new RangeError("Invalid path: "+i);s=i.slice(f)}let l=o.length-1,c=o[l];if(!c)throw new RangeError("Invalid path: "+i);let u=new mE(r,a,l>0?o.slice(0,l):null);e[c]=u.sort(e[c])}}return the.add(e)}const the=new Wt;class mE{constructor(e,n,r,i){this.tags=e,this.mode=n,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let a=i;for(let s of o)for(let l of s.set){let c=n[l.id];if(c){a=a?a+" "+c:c;break}}return a},scope:r}}function Mut(t,e){let n=null;for(let r of t){let i=r.style(e);i&&(n=n?n+" "+i:i)}return n}function kut(t,e,n,r=0,i=t.length){let o=new Aut(r,Array.isArray(e)?e:[e],n);o.highlightRange(t.cursor(),r,i,"",o.highlighters),o.flush(i)}class Aut{constructor(e,n,r){this.at=e,this.highlighters=n,this.span=r,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,r,i,o){let{type:a,from:s,to:l}=e;if(s>=r||l<=n)return;a.isTop&&(o=this.highlighters.filter(h=>!h.scope||h.scope(a)));let c=i,u=Rut(e)||mE.empty,f=Mut(o,u.tags);if(f&&(c&&(c+=" "),c+=f,u.mode==1&&(i+=(i?" ":"")+f)),this.startSpan(Math.max(n,s),c),u.opaque)return;let d=e.tree&&e.tree.prop(Wt.mounted);if(d&&d.overlay){let h=e.node.enter(d.overlay[0].from+s,1),p=this.highlighters.filter(g=>!g.scope||g.scope(d.tree.type)),m=e.firstChild();for(let g=0,v=s;;g++){let y=g=x||!e.nextSibling())););if(!y||x>r)break;v=y.to+s,v>n&&(this.highlightRange(h.cursor(),Math.max(n,y.from+s),Math.min(r,v),"",p),this.startSpan(Math.min(r,v),c))}m&&e.parent()}else if(e.firstChild()){d&&(i="");do if(!(e.to<=n)){if(e.from>=r)break;this.highlightRange(e,n,r,i,o),this.startSpan(Math.min(r,e.to),c)}while(e.nextSibling());e.parent()}}}function Rut(t){let e=t.type.prop(the);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const et=yl.define,ZS=et(),of=et(),X7=et(of),Q7=et(of),af=et(),JS=et(af),FR=et(af),cl=et(),Nd=et(cl),sl=et(),ll=et(),D3=et(),k0=et(D3),eO=et(),Te={comment:ZS,lineComment:et(ZS),blockComment:et(ZS),docComment:et(ZS),name:of,variableName:et(of),typeName:X7,tagName:et(X7),propertyName:Q7,attributeName:et(Q7),className:et(of),labelName:et(of),namespace:et(of),macroName:et(of),literal:af,string:JS,docString:et(JS),character:et(JS),attributeValue:et(JS),number:FR,integer:et(FR),float:et(FR),bool:et(af),regexp:et(af),escape:et(af),color:et(af),url:et(af),keyword:sl,self:et(sl),null:et(sl),atom:et(sl),unit:et(sl),modifier:et(sl),operatorKeyword:et(sl),controlKeyword:et(sl),definitionKeyword:et(sl),moduleKeyword:et(sl),operator:ll,derefOperator:et(ll),arithmeticOperator:et(ll),logicOperator:et(ll),bitwiseOperator:et(ll),compareOperator:et(ll),updateOperator:et(ll),definitionOperator:et(ll),typeOperator:et(ll),controlOperator:et(ll),punctuation:D3,separator:et(D3),bracket:k0,angleBracket:et(k0),squareBracket:et(k0),paren:et(k0),brace:et(k0),content:cl,heading:Nd,heading1:et(Nd),heading2:et(Nd),heading3:et(Nd),heading4:et(Nd),heading5:et(Nd),heading6:et(Nd),contentSeparator:et(cl),list:et(cl),quote:et(cl),emphasis:et(cl),strong:et(cl),link:et(cl),monospace:et(cl),strikethrough:et(cl),inserted:et(),deleted:et(),changed:et(),invalid:et(),meta:eO,documentMeta:et(eO),annotation:et(eO),processingInstruction:et(eO),definition:yl.defineModifier(),constant:yl.defineModifier(),function:yl.defineModifier(),standard:yl.defineModifier(),local:yl.defineModifier(),special:yl.defineModifier()};nhe([{tag:Te.link,class:"tok-link"},{tag:Te.heading,class:"tok-heading"},{tag:Te.emphasis,class:"tok-emphasis"},{tag:Te.strong,class:"tok-strong"},{tag:Te.keyword,class:"tok-keyword"},{tag:Te.atom,class:"tok-atom"},{tag:Te.bool,class:"tok-bool"},{tag:Te.url,class:"tok-url"},{tag:Te.labelName,class:"tok-labelName"},{tag:Te.inserted,class:"tok-inserted"},{tag:Te.deleted,class:"tok-deleted"},{tag:Te.literal,class:"tok-literal"},{tag:Te.string,class:"tok-string"},{tag:Te.number,class:"tok-number"},{tag:[Te.regexp,Te.escape,Te.special(Te.string)],class:"tok-string2"},{tag:Te.variableName,class:"tok-variableName"},{tag:Te.local(Te.variableName),class:"tok-variableName tok-local"},{tag:Te.definition(Te.variableName),class:"tok-variableName tok-definition"},{tag:Te.special(Te.variableName),class:"tok-variableName2"},{tag:Te.definition(Te.propertyName),class:"tok-propertyName tok-definition"},{tag:Te.typeName,class:"tok-typeName"},{tag:Te.namespace,class:"tok-namespace"},{tag:Te.className,class:"tok-className"},{tag:Te.macroName,class:"tok-macroName"},{tag:Te.propertyName,class:"tok-propertyName"},{tag:Te.operator,class:"tok-operator"},{tag:Te.comment,class:"tok-comment"},{tag:Te.meta,class:"tok-meta"},{tag:Te.invalid,class:"tok-invalid"},{tag:Te.punctuation,class:"tok-punctuation"}]);var jR;const eg=new Wt;function Iut(t){return ft.define({combine:t?e=>e.concat(t):void 0})}const Dut=new Wt;class Ws{constructor(e,n,r=[],i=""){this.data=e,this.name=i,en.prototype.hasOwnProperty("tree")||Object.defineProperty(en.prototype,"tree",{get(){return ui(this)}}),this.parser=n,this.extension=[id.of(this),en.languageData.of((o,a,s)=>{let l=Y7(o,a,s),c=l.type.prop(eg);if(!c)return[];let u=o.facet(c),f=l.type.prop(Dut);if(f){let d=l.resolve(a-l.from,s);for(let h of f)if(h.test(d,o)){let p=o.facet(h.facet);return h.type=="replace"?p:p.concat(u)}}return u})].concat(r)}isActiveAt(e,n,r=-1){return Y7(e,n,r).type.prop(eg)==this.data}findRegions(e){let n=e.facet(id);if((n==null?void 0:n.data)==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],i=(o,a)=>{if(o.prop(eg)==this.data){r.push({from:a,to:a+o.length});return}let s=o.prop(Wt.mounted);if(s){if(s.tree.prop(eg)==this.data){if(s.overlay)for(let l of s.overlay)r.push({from:l.from+a,to:l.to+a});else r.push({from:a,to:a+o.length});return}else if(s.overlay){let l=r.length;if(i(s.tree,s.overlay[0].from+a),r.length>l)return}}for(let l=0;lr.isTop?n:void 0)]}),e.name)}configure(e,n){return new o_(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function ui(t){let e=t.field(Ws.state,!1);return e?e.tree:zr.empty}class Lut{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let r=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-r,n-r)}}let A0=null;class gE{constructor(e,n,r=[],i,o,a,s,l){this.parser=e,this.state=n,this.fragments=r,this.tree=i,this.treeLen=o,this.viewport=a,this.skipped=s,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new gE(e,n,[],zr.empty,0,r,[],null)}startParse(){return this.parser.startParse(new Lut(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=zr.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(Nh.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=A0;A0=this;try{return e()}finally{A0=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=K7(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:i,treeLen:o,viewport:a,skipped:s}=this;if(this.takeTree(),!e.empty){let l=[];if(e.iterChangedRanges((c,u,f,d)=>l.push({fromA:c,toA:u,fromB:f,toB:d})),r=Nh.applyChanges(r,l),i=zr.empty,o=0,a={from:e.mapPos(a.from,-1),to:e.mapPos(a.to,1)},this.skipped.length){s=[];for(let c of this.skipped){let u=e.mapPos(c.from,1),f=e.mapPos(c.to,-1);ue.from&&(this.fragments=K7(this.fragments,i,o),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends ehe{createParse(n,r,i){let o=i[0].from,a=i[i.length-1].to;return{parsedPos:o,advance(){let l=A0;if(l){for(let c of i)l.tempSkipped.push(c);e&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,e]):e)}return this.parsedPos=a,new zr(Wo.none,[],[],a-o)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return A0}}function K7(t,e,n){return Nh.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class lv{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new lv(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=gE.create(e.facet(id).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new lv(r)}}Ws.state=pi.define({create:lv.init,update(t,e){for(let n of e.effects)if(n.is(Ws.setState))return n.value;return e.startState.facet(id)!=e.state.facet(id)?lv.init(e.state):t.apply(e)}});let rhe=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(rhe=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const BR=typeof navigator<"u"&&(!((jR=navigator.scheduling)===null||jR===void 0)&&jR.isInputPending)?()=>navigator.scheduling.isInputPending():null,$ut=Mr.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(Ws.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(Ws.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=rhe(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEndi+1e3,l=o.context.work(()=>BR&&BR()||Date.now()>a,i+(s?0:1e5));this.chunkBudget-=Date.now()-n,(l||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:Ws.setState.of(new lv(o.context))})),this.chunkBudget>0&&!(l&&!s)&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>ko(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),id=ft.define({combine(t){return t.length?t[0]:null},enables:t=>[Ws.state,$ut,rt.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class ihe{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}const Nut=ft.define(),dw=ft.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function vE(t){let e=t.facet(dw);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function a_(t,e){let n="",r=t.tabSize,i=t.facet(dw)[0];if(i==" "){for(;e>=r;)n+=" ",e-=r;i=" "}for(let o=0;o=e?Fut(t,n,e):null}class A2{constructor(e,n={}){this.state=e,this.options=n,this.unit=vE(e)}lineAt(e,n=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:o}=this.options;return i!=null&&i>=r.from&&i<=r.to?o&&i==e?{text:"",from:e}:(n<0?i-1&&(o+=a-this.countColumn(r,r.search(/\S|$/))),o}countColumn(e,n=e.length){return Cy(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:r,from:i}=this.lineAt(e,n),o=this.options.overrideIndentation;if(o){let a=o(i);if(a>-1)return a}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const _4=new Wt;function Fut(t,e,n){let r=e.resolveStack(n),i=r.node.enterUnfinishedNodesBefore(n);if(i!=r.node){let o=[];for(let a=i;a!=r.node;a=a.parent)o.push(a);for(let a=o.length-1;a>=0;a--)r={node:o[a],next:r}}return ohe(r,t,n)}function ohe(t,e,n){for(let r=t;r;r=r.next){let i=But(r.node);if(i)return i(w4.create(e,n,r))}return 0}function jut(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function But(t){let e=t.type.prop(_4);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(Wt.closedBy))){let i=t.lastChild,o=i&&r.indexOf(i.name)>-1;return a=>ahe(a,!0,1,void 0,o&&!jut(a)?i.from:void 0)}return t.parent==null?zut:null}function zut(){return 0}class w4 extends A2{constructor(e,n,r){super(e.state,e.options),this.base=e,this.pos=n,this.context=r}get node(){return this.context.node}static create(e,n,r){return new w4(e,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(Uut(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return ohe(this.context.next,this.base,this.pos)}}function Uut(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function Wut(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let i=t.options.simulateBreak,o=t.state.doc.lineAt(n.from),a=i==null||i<=o.from?o.to:Math.min(o.to,i);for(let s=n.to;;){let l=e.childAfter(s);if(!l||l==r)return null;if(!l.type.isSkipped)return l.fromahe(r,e,n,t)}function ahe(t,e,n,r,i){let o=t.textAfter,a=o.match(/^\s*/)[0].length,s=r&&o.slice(a,a+r.length)==r||i==t.pos+a,l=e?Wut(t):null;return l?s?t.column(l.from):t.column(l.to):t.baseIndent+(s?0:t.unit*n)}function Z7({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const Vut=200;function Gut(){return en.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let n=t.newDoc,{head:r}=t.newSelection.main,i=n.lineAt(r);if(r>i.from+Vut)return t;let o=n.sliceString(i.from,r);if(!e.some(c=>c.test(o)))return t;let{state:a}=t,s=-1,l=[];for(let{head:c}of a.selection.ranges){let u=a.doc.lineAt(c);if(u.from==s)continue;s=u.from;let f=b4(a,u.from);if(f==null)continue;let d=/^\s*/.exec(u.text)[0],h=a_(a,f);d!=h&&l.push({from:u.from,to:u.from+d.length,insert:h})}return l.length?[t,{changes:l,sequential:!0}]:t})}const Hut=ft.define(),S4=new Wt;function she(t){let e=t.firstChild,n=t.lastChild;return e&&e.ton)continue;if(o&&s.from=e&&c.to>n&&(o=c)}}return o}function Xut(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function yE(t,e,n){for(let r of t.facet(Hut)){let i=r(t,e,n);if(i)return i}return qut(t,e,n)}function lhe(t,e){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);return n>=r?void 0:{from:n,to:r}}const R2=It.define({map:lhe}),hw=It.define({map:lhe});function che(t){let e=[];for(let{head:n}of t.state.selection.ranges)e.some(r=>r.from<=n&&r.to>=n)||e.push(t.lineBlockAt(n));return e}const ip=pi.define({create(){return yt.none},update(t,e){t=t.map(e.changes);for(let n of e.effects)if(n.is(R2)&&!Qut(t,n.value.from,n.value.to)){let{preparePlaceholder:r}=e.state.facet(O4),i=r?yt.replace({widget:new nft(r(e.state,n.value))}):J7;t=t.update({add:[i.range(n.value.from,n.value.to)]})}else n.is(hw)&&(t=t.update({filter:(r,i)=>n.value.from!=r||n.value.to!=i,filterFrom:n.value.from,filterTo:n.value.to}));if(e.selection){let n=!1,{head:r}=e.selection.main;t.between(r,r,(i,o)=>{ir&&(n=!0)}),n&&(t=t.update({filterFrom:r,filterTo:r,filter:(i,o)=>o<=r||i>=r}))}return t},provide:t=>rt.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,(r,i)=>{n.push(r,i)}),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n{(!i||i.from>o)&&(i={from:o,to:a})}),i}function Qut(t,e,n){let r=!1;return t.between(e,e,(i,o)=>{i==e&&o==n&&(r=!0)}),r}function uhe(t,e){return t.field(ip,!1)?e:e.concat(It.appendConfig.of(dhe()))}const Yut=t=>{for(let e of che(t)){let n=yE(t.state,e.from,e.to);if(n)return t.dispatch({effects:uhe(t.state,[R2.of(n),fhe(t,n)])}),!0}return!1},Kut=t=>{if(!t.state.field(ip,!1))return!1;let e=[];for(let n of che(t)){let r=xE(t.state,n.from,n.to);r&&e.push(hw.of(r),fhe(t,r,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function fhe(t,e,n=!0){let r=t.state.doc.lineAt(e.from).number,i=t.state.doc.lineAt(e.to).number;return rt.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${t.state.phrase("to")} ${i}.`)}const Zut=t=>{let{state:e}=t,n=[];for(let r=0;r{let e=t.state.field(ip,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,(r,i)=>{n.push(hw.of({from:r,to:i}))}),t.dispatch({effects:n}),!0},eft=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:Yut},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:Kut},{key:"Ctrl-Alt-[",run:Zut},{key:"Ctrl-Alt-]",run:Jut}],tft={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},O4=ft.define({combine(t){return ac(t,tft)}});function dhe(t){let e=[ip,oft];return t&&e.push(O4.of(t)),e}function hhe(t,e){let{state:n}=t,r=n.facet(O4),i=a=>{let s=t.lineBlockAt(t.posAtDOM(a.target)),l=xE(t.state,s.from,s.to);l&&t.dispatch({effects:hw.of(l)}),a.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(t,i,e);let o=document.createElement("span");return o.textContent=r.placeholderText,o.setAttribute("aria-label",n.phrase("folded code")),o.title=n.phrase("unfold"),o.className="cm-foldPlaceholder",o.onclick=i,o}const J7=yt.replace({widget:new class extends sc{toDOM(t){return hhe(t,null)}}});class nft extends sc{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return hhe(e,this.value)}}const rft={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class UR extends du{constructor(e,n){super(),this.config=e,this.open=n}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=e.state.phrase(this.open?"Fold line":"Unfold line"),n}}function ift(t={}){let e=Object.assign(Object.assign({},rft),t),n=new UR(e,!0),r=new UR(e,!1),i=Mr.fromClass(class{constructor(a){this.from=a.viewport.from,this.markers=this.buildMarkers(a)}update(a){(a.docChanged||a.viewportChanged||a.startState.facet(id)!=a.state.facet(id)||a.startState.field(ip,!1)!=a.state.field(ip,!1)||ui(a.startState)!=ui(a.state)||e.foldingChanged(a))&&(this.markers=this.buildMarkers(a.view))}buildMarkers(a){let s=new Jf;for(let l of a.viewportLineBlocks){let c=xE(a.state,l.from,l.to)?r:yE(a.state,l.from,l.to)?n:null;c&&s.add(l.from,l.from,c)}return s.finish()}}),{domEventHandlers:o}=e;return[i,sut({class:"cm-foldGutter",markers(a){var s;return((s=a.plugin(i))===null||s===void 0?void 0:s.markers)||sn.empty},initialSpacer(){return new UR(e,!1)},domEventHandlers:Object.assign(Object.assign({},o),{click:(a,s,l)=>{if(o.click&&o.click(a,s,l))return!0;let c=xE(a.state,s.from,s.to);if(c)return a.dispatch({effects:hw.of(c)}),!0;let u=yE(a.state,s.from,s.to);return u?(a.dispatch({effects:R2.of(u)}),!0):!1}})}),dhe()]}const oft=rt.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class pw{constructor(e,n){this.specs=e;let r;function i(s){let l=ed.newName();return(r||(r=Object.create(null)))["."+l]=s,l}const o=typeof n.all=="string"?n.all:n.all?i(n.all):void 0,a=n.scope;this.scope=a instanceof Ws?s=>s.prop(eg)==a.data:a?s=>s==a:void 0,this.style=nhe(e.map(s=>({tag:s.tag,class:s.class||i(Object.assign({},s,{tag:null}))})),{all:o}).style,this.module=r?new ed(r):null,this.themeType=n.themeType}static define(e,n){return new pw(e,n||{})}}const L3=ft.define(),phe=ft.define({combine(t){return t.length?[t[0]]:null}});function WR(t){let e=t.facet(L3);return e.length?e:t.facet(phe)}function mhe(t,e){let n=[sft],r;return t instanceof pw&&(t.module&&n.push(rt.styleModule.of(t.module)),r=t.themeType),e!=null&&e.fallback?n.push(phe.of(t)):r?n.push(L3.computeN([rt.darkTheme],i=>i.facet(rt.darkTheme)==(r=="dark")?[t]:[])):n.push(L3.of(t)),n}class aft{constructor(e){this.markCache=Object.create(null),this.tree=ui(e.state),this.decorations=this.buildDeco(e,WR(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=ui(e.state),r=WR(e.state),i=r!=WR(e.startState),{viewport:o}=e.view,a=e.changes.mapPos(this.decoratedTo,1);n.length=o.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=a):(n!=this.tree||e.viewportChanged||i)&&(this.tree=n,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=o.to)}buildDeco(e,n){if(!n||!this.tree.length)return yt.none;let r=new Jf;for(let{from:i,to:o}of e.visibleRanges)kut(this.tree,n,(a,s,l)=>{r.add(a,s,this.markCache[l]||(this.markCache[l]=yt.mark({class:l})))},i,o);return r.finish()}}const sft=bd.high(Mr.fromClass(aft,{decorations:t=>t.decorations})),lft=pw.define([{tag:Te.meta,color:"#404740"},{tag:Te.link,textDecoration:"underline"},{tag:Te.heading,textDecoration:"underline",fontWeight:"bold"},{tag:Te.emphasis,fontStyle:"italic"},{tag:Te.strong,fontWeight:"bold"},{tag:Te.strikethrough,textDecoration:"line-through"},{tag:Te.keyword,color:"#708"},{tag:[Te.atom,Te.bool,Te.url,Te.contentSeparator,Te.labelName],color:"#219"},{tag:[Te.literal,Te.inserted],color:"#164"},{tag:[Te.string,Te.deleted],color:"#a11"},{tag:[Te.regexp,Te.escape,Te.special(Te.string)],color:"#e40"},{tag:Te.definition(Te.variableName),color:"#00f"},{tag:Te.local(Te.variableName),color:"#30a"},{tag:[Te.typeName,Te.namespace],color:"#085"},{tag:Te.className,color:"#167"},{tag:[Te.special(Te.variableName),Te.macroName],color:"#256"},{tag:Te.definition(Te.propertyName),color:"#00c"},{tag:Te.comment,color:"#940"},{tag:Te.invalid,color:"#f00"}]),cft=rt.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),ghe=1e4,vhe="()[]{}",yhe=ft.define({combine(t){return ac(t,{afterCursor:!0,brackets:vhe,maxScanDistance:ghe,renderMatch:dft})}}),uft=yt.mark({class:"cm-matchingBracket"}),fft=yt.mark({class:"cm-nonmatchingBracket"});function dft(t){let e=[],n=t.matched?uft:fft;return e.push(n.range(t.start.from,t.start.to)),t.end&&e.push(n.range(t.end.from,t.end.to)),e}const hft=pi.define({create(){return yt.none},update(t,e){if(!e.docChanged&&!e.selection)return t;let n=[],r=e.state.facet(yhe);for(let i of e.state.selection.ranges){if(!i.empty)continue;let o=Rl(e.state,i.head,-1,r)||i.head>0&&Rl(e.state,i.head-1,1,r)||r.afterCursor&&(Rl(e.state,i.head,1,r)||i.headrt.decorations.from(t)}),pft=[hft,cft];function mft(t={}){return[yhe.of(t),pft]}const gft=new Wt;function $3(t,e,n){let r=t.prop(e<0?Wt.openedBy:Wt.closedBy);if(r)return r;if(t.name.length==1){let i=n.indexOf(t.name);if(i>-1&&i%2==(e<0?1:0))return[n[i+e]]}return null}function N3(t){let e=t.type.prop(gft);return e?e(t.node):t}function Rl(t,e,n,r={}){let i=r.maxScanDistance||ghe,o=r.brackets||vhe,a=ui(t),s=a.resolveInner(e,n);for(let l=s;l;l=l.parent){let c=$3(l.type,n,o);if(c&&l.from0?e>=u.from&&eu.from&&e<=u.to))return vft(t,e,n,l,u,c,o)}}return yft(t,e,n,a,s.type,i,o)}function vft(t,e,n,r,i,o,a){let s=r.parent,l={from:i.from,to:i.to},c=0,u=s==null?void 0:s.cursor();if(u&&(n<0?u.childBefore(r.from):u.childAfter(r.to)))do if(n<0?u.to<=r.from:u.from>=r.to){if(c==0&&o.indexOf(u.type.name)>-1&&u.from0)return null;let c={from:n<0?e-1:e,to:n>0?e+1:e},u=t.doc.iterRange(e,n>0?t.doc.length:0),f=0;for(let d=0;!u.next().done&&d<=o;){let h=u.value;n<0&&(d+=h.length);let p=e+d*n;for(let m=n>0?0:h.length-1,g=n>0?h.length:-1;m!=g;m+=n){let v=a.indexOf(h[m]);if(!(v<0||r.resolveInner(p+m,1).type!=i))if(v%2==0==n>0)f++;else{if(f==1)return{start:c,end:{from:p+m,to:p+m+1},matched:v>>1==l>>1};f--}}n>0&&(d+=h.length)}return u.done?{start:c,matched:!1}:null}const xft=Object.create(null),eq=[Wo.none],tq=[],nq=Object.create(null),bft=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])bft[t]=_ft(xft,e);function VR(t,e){tq.indexOf(t)>-1||(tq.push(t),console.warn(e))}function _ft(t,e){let n=[];for(let s of e.split(" ")){let l=[];for(let c of s.split(".")){let u=t[c]||Te[c];u?typeof u=="function"?l.length?l=l.map(u):VR(c,`Modifier ${c} used at start of tag`):l.length?VR(c,`Tag ${c} used as modifier`):l=Array.isArray(u)?u:[u]:VR(c,`Unknown highlighting tag ${c}`)}for(let c of l)n.push(c)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+n.map(s=>s.id),o=nq[i];if(o)return o.id;let a=nq[i]=Wo.define({id:eq.length,name:r,props:[x4({[r]:n})]});return eq.push(a),a.id}nr.RTL,nr.LTR;const wft=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=T4(t.state,n.from);return r.line?Sft(t):r.block?Cft(t):!1};function C4(t,e){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=t(e,n);return i?(r(n.update(i)),!0):!1}}const Sft=C4(Pft,0),Oft=C4(xhe,0),Cft=C4((t,e)=>xhe(t,e,Eft(e)),0);function T4(t,e){let n=t.languageDataAt("commentTokens",e);return n.length?n[0]:{}}const R0=50;function Tft(t,{open:e,close:n},r,i){let o=t.sliceDoc(r-R0,r),a=t.sliceDoc(i,i+R0),s=/\s*$/.exec(o)[0].length,l=/^\s*/.exec(a)[0].length,c=o.length-s;if(o.slice(c-e.length,c)==e&&a.slice(l,l+n.length)==n)return{open:{pos:r-s,margin:s&&1},close:{pos:i+l,margin:l&&1}};let u,f;i-r<=2*R0?u=f=t.sliceDoc(r,i):(u=t.sliceDoc(r,r+R0),f=t.sliceDoc(i-R0,i));let d=/^\s*/.exec(u)[0].length,h=/\s*$/.exec(f)[0].length,p=f.length-h-n.length;return u.slice(d,d+e.length)==e&&f.slice(p,p+n.length)==n?{open:{pos:r+d+e.length,margin:/\s/.test(u.charAt(d+e.length))?1:0},close:{pos:i-h-n.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function Eft(t){let e=[];for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),i=n.to<=r.to?r:t.doc.lineAt(n.to),o=e.length-1;o>=0&&e[o].to>r.from?e[o].to=i.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return e}function xhe(t,e,n=e.selection.ranges){let r=n.map(o=>T4(e,o.from).block);if(!r.every(o=>o))return null;let i=n.map((o,a)=>Tft(e,r[a],o.from,o.to));if(t!=2&&!i.every(o=>o))return{changes:e.changes(n.map((o,a)=>i[a]?[]:[{from:o.from,insert:r[a].open+" "},{from:o.to,insert:" "+r[a].close}]))};if(t!=1&&i.some(o=>o)){let o=[];for(let a=0,s;ai&&(o==a||a>f.from)){i=f.from;let d=/^\s*/.exec(f.text)[0].length,h=d==f.length,p=f.text.slice(d,d+c.length)==c?d:-1;do.comment<0&&(!o.empty||o.single))){let o=[];for(let{line:s,token:l,indent:c,empty:u,single:f}of r)(f||!u)&&o.push({from:s.from+c,insert:l+" "});let a=e.changes(o);return{changes:a,selection:e.selection.map(a,1)}}else if(t!=1&&r.some(o=>o.comment>=0)){let o=[];for(let{line:a,comment:s,token:l}of r)if(s>=0){let c=a.from+s,u=c+l.length;a.text[u-a.from]==" "&&u++,o.push({from:c,to:u})}return{changes:o}}return null}const F3=oc.define(),Mft=oc.define(),kft=ft.define(),bhe=ft.define({combine(t){return ac(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(r,i)=>e(r,i)||n(r,i)})}}),_he=pi.define({create(){return Il.empty},update(t,e){let n=e.state.facet(bhe),r=e.annotation(F3);if(r){let l=Ao.fromTransaction(e,r.selection),c=r.side,u=c==0?t.undone:t.done;return l?u=bE(u,u.length,n.minDepth,l):u=Ohe(u,e.startState.selection),new Il(c==0?r.rest:u,c==0?u:r.rest)}let i=e.annotation(Mft);if((i=="full"||i=="before")&&(t=t.isolate()),e.annotation(Br.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let o=Ao.fromTransaction(e),a=e.annotation(Br.time),s=e.annotation(Br.userEvent);return o?t=t.addChanges(o,a,s,n,e):e.selection&&(t=t.addSelection(e.startState.selection,a,s,n.newGroupDelay)),(i=="full"||i=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new Il(t.done.map(Ao.fromJSON),t.undone.map(Ao.fromJSON))}});function Aft(t={}){return[_he,bhe.of(t),rt.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?whe:e.inputType=="historyRedo"?j3:null;return r?(e.preventDefault(),r(n)):!1}})]}function I2(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let i=n.field(_he,!1);if(!i)return!1;let o=i.pop(t,n,e);return o?(r(o),!0):!1}}const whe=I2(0,!1),j3=I2(1,!1),Rft=I2(0,!0),Ift=I2(1,!0);class Ao{constructor(e,n,r,i,o){this.changes=e,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=o}setSelAfter(e){return new Ao(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new Ao(e.changes&&Kr.fromJSON(e.changes),[],e.mapped&&Hl.fromJSON(e.mapped),e.startSelection&&je.fromJSON(e.startSelection),e.selectionsAfter.map(je.fromJSON))}static fromTransaction(e,n){let r=Ya;for(let i of e.startState.facet(kft)){let o=i(e);o.length&&(r=r.concat(o))}return!r.length&&e.changes.empty?null:new Ao(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,Ya)}static selection(e){return new Ao(void 0,Ya,void 0,void 0,e)}}function bE(t,e,n,r){let i=e+1>n+20?e-n-1:0,o=t.slice(i,e);return o.push(r),o}function Dft(t,e){let n=[],r=!1;return t.iterChangedRanges((i,o)=>n.push(i,o)),e.iterChangedRanges((i,o,a,s)=>{for(let l=0;l=c&&a<=u&&(r=!0)}}),r}function Lft(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function She(t,e){return t.length?e.length?t.concat(e):t:e}const Ya=[],$ft=200;function Ohe(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-$ft));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),bE(t,t.length-1,1e9,n.setSelAfter(r)))}else return[Ao.selection([e])]}function Nft(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function GR(t,e){if(!t.length)return t;let n=t.length,r=Ya;for(;n;){let i=Fft(t[n-1],e,r);if(i.changes&&!i.changes.empty||i.effects.length){let o=t.slice(0,n);return o[n-1]=i,o}else e=i.mapped,n--,r=i.selectionsAfter}return r.length?[Ao.selection(r)]:Ya}function Fft(t,e,n){let r=She(t.selectionsAfter.length?t.selectionsAfter.map(s=>s.map(e)):Ya,n);if(!t.changes)return Ao.selection(r);let i=t.changes.map(e),o=e.mapDesc(t.changes,!0),a=t.mapped?t.mapped.composeDesc(o):o;return new Ao(i,It.mapEffects(t.effects,e),a,t.startSelection.map(o),r)}const jft=/^(input\.type|delete)($|\.)/;class Il{constructor(e,n,r=0,i=void 0){this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new Il(this.done,this.undone):this}addChanges(e,n,r,i,o){let a=this.done,s=a[a.length-1];return s&&s.changes&&!s.changes.empty&&e.changes&&(!r||jft.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime0&&n-this.prevTimen.empty?t.moveByChar(n,e):D2(n,e))}function eo(t){return t.textDirectionAt(t.state.selection.main.head)==nr.LTR}const The=t=>Che(t,!eo(t)),Ehe=t=>Che(t,eo(t));function Phe(t,e){return tl(t,n=>n.empty?t.moveByGroup(n,e):D2(n,e))}const zft=t=>Phe(t,!eo(t)),Uft=t=>Phe(t,eo(t));function Wft(t,e,n){if(e.type.prop(n))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function L2(t,e,n){let r=ui(t).resolveInner(e.head),i=n?Wt.closedBy:Wt.openedBy;for(let l=e.head;;){let c=n?r.childAfter(l):r.childBefore(l);if(!c)break;Wft(t,c,i)?r=c:l=n?c.to:c.from}let o=r.type.prop(i),a,s;return o&&(a=n?Rl(t,r.from,1):Rl(t,r.to,-1))&&a.matched?s=n?a.end.to:a.end.from:s=n?r.to:r.from,je.cursor(s,n?-1:1)}const Vft=t=>tl(t,e=>L2(t.state,e,!eo(t))),Gft=t=>tl(t,e=>L2(t.state,e,eo(t)));function Mhe(t,e){return tl(t,n=>{if(!n.empty)return D2(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const khe=t=>Mhe(t,!1),Ahe=t=>Mhe(t,!0);function Rhe(t){let e=t.scrollDOM.clientHeighta.empty?t.moveVertically(a,e,n.height):D2(a,e));if(i.eq(r.selection))return!1;let o;if(n.selfScroll){let a=t.coordsAtPos(r.selection.main.head),s=t.scrollDOM.getBoundingClientRect(),l=s.top+n.marginTop,c=s.bottom-n.marginBottom;a&&a.top>l&&a.bottomIhe(t,!1),B3=t=>Ihe(t,!0);function _d(t,e,n){let r=t.lineBlockAt(e.head),i=t.moveToLineBoundary(e,n);if(i.head==e.head&&i.head!=(n?r.to:r.from)&&(i=t.moveToLineBoundary(e,n,!1)),!n&&i.head==r.from&&r.length){let o=/^\s*/.exec(t.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;o&&e.head!=r.from+o&&(i=je.cursor(r.from+o))}return i}const Hft=t=>tl(t,e=>_d(t,e,!0)),qft=t=>tl(t,e=>_d(t,e,!1)),Xft=t=>tl(t,e=>_d(t,e,!eo(t))),Qft=t=>tl(t,e=>_d(t,e,eo(t))),Yft=t=>tl(t,e=>je.cursor(t.lineBlockAt(e.head).from,1)),Kft=t=>tl(t,e=>je.cursor(t.lineBlockAt(e.head).to,-1));function Zft(t,e,n){let r=!1,i=Ty(t.selection,o=>{let a=Rl(t,o.head,-1)||Rl(t,o.head,1)||o.head>0&&Rl(t,o.head-1,1)||o.headZft(t,e,!1);function _s(t,e){let n=Ty(t.state.selection,r=>{let i=e(r);return je.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)});return n.eq(t.state.selection)?!1:(t.dispatch(lc(t.state,n)),!0)}function Dhe(t,e){return _s(t,n=>t.moveByChar(n,e))}const Lhe=t=>Dhe(t,!eo(t)),$he=t=>Dhe(t,eo(t));function Nhe(t,e){return _s(t,n=>t.moveByGroup(n,e))}const edt=t=>Nhe(t,!eo(t)),tdt=t=>Nhe(t,eo(t)),ndt=t=>_s(t,e=>L2(t.state,e,!eo(t))),rdt=t=>_s(t,e=>L2(t.state,e,eo(t)));function Fhe(t,e){return _s(t,n=>t.moveVertically(n,e))}const jhe=t=>Fhe(t,!1),Bhe=t=>Fhe(t,!0);function zhe(t,e){return _s(t,n=>t.moveVertically(n,e,Rhe(t).height))}const iq=t=>zhe(t,!1),oq=t=>zhe(t,!0),idt=t=>_s(t,e=>_d(t,e,!0)),odt=t=>_s(t,e=>_d(t,e,!1)),adt=t=>_s(t,e=>_d(t,e,!eo(t))),sdt=t=>_s(t,e=>_d(t,e,eo(t))),ldt=t=>_s(t,e=>je.cursor(t.lineBlockAt(e.head).from)),cdt=t=>_s(t,e=>je.cursor(t.lineBlockAt(e.head).to)),aq=({state:t,dispatch:e})=>(e(lc(t,{anchor:0})),!0),sq=({state:t,dispatch:e})=>(e(lc(t,{anchor:t.doc.length})),!0),lq=({state:t,dispatch:e})=>(e(lc(t,{anchor:t.selection.main.anchor,head:0})),!0),cq=({state:t,dispatch:e})=>(e(lc(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),udt=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),fdt=({state:t,dispatch:e})=>{let n=$2(t).map(({from:r,to:i})=>je.range(r,Math.min(i+1,t.doc.length)));return e(t.update({selection:je.create(n),userEvent:"select"})),!0},ddt=({state:t,dispatch:e})=>{let n=Ty(t.selection,r=>{var i;let o=ui(t).resolveStack(r.from,1);for(let a=o;a;a=a.next){let{node:s}=a;if((s.from=r.to||s.to>r.to&&s.from<=r.from)&&(!((i=s.parent)===null||i===void 0)&&i.parent))return je.range(s.to,s.from)}return r});return e(lc(t,n)),!0},hdt=({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=je.create([n.main]):n.main.empty||(r=je.create([je.cursor(n.main.head)])),r?(e(lc(t,r)),!0):!1};function mw(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,i=r.changeByRange(o=>{let{from:a,to:s}=o;if(a==s){let l=e(o);la&&(n="delete.forward",l=tO(t,l,!0)),a=Math.min(a,l),s=Math.max(s,l)}else a=tO(t,a,!1),s=tO(t,s,!0);return a==s?{range:o}:{changes:{from:a,to:s},range:je.cursor(a,ai(t)))r.between(e,e,(i,o)=>{ie&&(e=n?o:i)});return e}const Uhe=(t,e)=>mw(t,n=>{let r=n.from,{state:i}=t,o=i.doc.lineAt(r),a,s;if(!e&&r>o.from&&rUhe(t,!1),Whe=t=>Uhe(t,!0),Vhe=(t,e)=>mw(t,n=>{let r=n.head,{state:i}=t,o=i.doc.lineAt(r),a=i.charCategorizer(r);for(let s=null;;){if(r==(e?o.to:o.from)){r==n.head&&o.number!=(e?i.doc.lines:1)&&(r+=e?1:-1);break}let l=ki(o.text,r-o.from,e)+o.from,c=o.text.slice(Math.min(r,l)-o.from,Math.max(r,l)-o.from),u=a(c);if(s!=null&&u!=s)break;(c!=" "||r!=n.head)&&(s=u),r=l}return r}),Ghe=t=>Vhe(t,!1),pdt=t=>Vhe(t,!0),mdt=t=>mw(t,e=>{let n=t.lineBlockAt(e.head).to;return e.headmw(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),vdt=t=>mw(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head{if(t.readOnly)return!1;let n=t.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:Sn.of(["",""])},range:je.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},xdt=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>{if(!r.empty||r.from==0||r.from==t.doc.length)return{range:r};let i=r.from,o=t.doc.lineAt(i),a=i==o.from?i-1:ki(o.text,i-o.from,!1)+o.from,s=i==o.to?i+1:ki(o.text,i-o.from,!0)+o.from;return{changes:{from:a,to:s,insert:t.doc.slice(i,s).append(t.doc.slice(a,i))},range:je.cursor(s)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function $2(t){let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.from),o=t.doc.lineAt(r.to);if(!r.empty&&r.to==o.from&&(o=t.doc.lineAt(r.to-1)),n>=i.number){let a=e[e.length-1];a.to=o.to,a.ranges.push(r)}else e.push({from:i.from,to:o.to,ranges:[r]});n=o.number+1}return e}function Hhe(t,e,n){if(t.readOnly)return!1;let r=[],i=[];for(let o of $2(t)){if(n?o.to==t.doc.length:o.from==0)continue;let a=t.doc.lineAt(n?o.to+1:o.from-1),s=a.length+1;if(n){r.push({from:o.to,to:a.to},{from:o.from,insert:a.text+t.lineBreak});for(let l of o.ranges)i.push(je.range(Math.min(t.doc.length,l.anchor+s),Math.min(t.doc.length,l.head+s)))}else{r.push({from:a.from,to:o.from},{from:o.to,insert:t.lineBreak+a.text});for(let l of o.ranges)i.push(je.range(l.anchor-s,l.head-s))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:je.create(i,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const bdt=({state:t,dispatch:e})=>Hhe(t,e,!1),_dt=({state:t,dispatch:e})=>Hhe(t,e,!0);function qhe(t,e,n){if(t.readOnly)return!1;let r=[];for(let i of $2(t))n?r.push({from:i.from,insert:t.doc.slice(i.from,i.to)+t.lineBreak}):r.push({from:i.to,insert:t.lineBreak+t.doc.slice(i.from,i.to)});return e(t.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const wdt=({state:t,dispatch:e})=>qhe(t,e,!1),Sdt=({state:t,dispatch:e})=>qhe(t,e,!0),Odt=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes($2(e).map(({from:i,to:o})=>(i>0?i--:ot.moveVertically(i,!0)).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Cdt(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=ui(t).resolveInner(e),r=n.childBefore(e),i=n.childAfter(e),o;return r&&i&&r.to<=e&&i.from>=e&&(o=r.type.prop(Wt.closedBy))&&o.indexOf(i.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(i.from).from&&!/\S/.test(t.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const Tdt=Xhe(!1),Edt=Xhe(!0);function Xhe(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(i=>{let{from:o,to:a}=i,s=e.doc.lineAt(o),l=!t&&o==a&&Cdt(e,o);t&&(o=a=(a<=s.to?s:e.doc.lineAt(a)).to);let c=new A2(e,{simulateBreak:o,simulateDoubleBreak:!!l}),u=b4(c,o);for(u==null&&(u=Cy(/^\s*/.exec(e.doc.lineAt(o).text)[0],e.tabSize));as.from&&o{let i=[];for(let a=r.from;a<=r.to;){let s=t.doc.lineAt(a);s.number>n&&(r.empty||r.to>s.from)&&(e(s,i,r),n=s.number),a=s.to+1}let o=t.changes(i);return{changes:i,range:je.range(o.mapPos(r.anchor,1),o.mapPos(r.head,1))}})}const Pdt=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new A2(t,{overrideIndentation:o=>{let a=n[o];return a??-1}}),i=E4(t,(o,a,s)=>{let l=b4(r,o.from);if(l==null)return;/\S/.test(o.text)||(l=0);let c=/^\s*/.exec(o.text)[0],u=a_(t,l);(c!=u||s.fromt.readOnly?!1:(e(t.update(E4(t,(n,r)=>{r.push({from:n.from,insert:t.facet(dw)})}),{userEvent:"input.indent"})),!0),Yhe=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(E4(t,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let o=Cy(i,t.tabSize),a=0,s=a_(t,Math.max(0,o-vE(t)));for(;a({mac:t.key,run:t.run,shift:t.shift}))),Adt=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Vft,shift:ndt},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Gft,shift:rdt},{key:"Alt-ArrowUp",run:bdt},{key:"Shift-Alt-ArrowUp",run:wdt},{key:"Alt-ArrowDown",run:_dt},{key:"Shift-Alt-ArrowDown",run:Sdt},{key:"Escape",run:hdt},{key:"Mod-Enter",run:Edt},{key:"Alt-l",mac:"Ctrl-l",run:fdt},{key:"Mod-i",run:ddt,preventDefault:!0},{key:"Mod-[",run:Yhe},{key:"Mod-]",run:Qhe},{key:"Mod-Alt-\\",run:Pdt},{key:"Shift-Mod-k",run:Odt},{key:"Shift-Mod-\\",run:Jft},{key:"Mod-/",run:wft},{key:"Alt-A",run:Oft}].concat(kdt),Rdt={key:"Tab",run:Qhe,shift:Yhe};function Bn(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];typeof i=="string"?t.setAttribute(r,i):i!=null&&(t[r]=i)}e++}for(;et.normalize("NFKD"):t=>t;class cv{constructor(e,n,r=0,i=e.length,o,a){this.test=a,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,i),this.bufferStart=r,this.normalize=o?s=>o(uq(s)):uq,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Ci(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let n=r4(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=Ga(e);let i=this.normalize(n);for(let o=0,a=r;;o++){let s=i.charCodeAt(o),l=this.match(s,a,this.bufferPos+this.bufferStart);if(o==i.length-1){if(l)return this.value=l,this;break}a==r&&othis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,i=r+n[0].length;if(this.matchPos=_E(this.text,i+(r==i?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(rthis.value.to)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,match:n},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=r||i.to<=n){let s=new Pg(n,e.sliceString(n,r));return HR.set(e,s),s}if(i.from==n&&i.to==r)return i;let{text:o,from:a}=i;return a>n&&(o=e.sliceString(n,a)+o,a=n),i.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==e&&(this.re.lastIndex=e+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,i=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,match:n},this.matchPos=_E(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Pg.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(Jhe.prototype[Symbol.iterator]=epe.prototype[Symbol.iterator]=function(){return this});function Idt(t){try{return new RegExp(t,P4),!0}catch{return!1}}function _E(t,e){if(e>=t.length)return e;let n=t.lineAt(e),r;for(;e=56320&&r<57344;)e++;return e}function U3(t){let e=String(t.state.doc.lineAt(t.state.selection.main.head).number),n=Bn("input",{class:"cm-textfield",name:"line",value:e}),r=Bn("form",{class:"cm-gotoLine",onkeydown:o=>{o.keyCode==27?(o.preventDefault(),t.dispatch({effects:wE.of(!1)}),t.focus()):o.keyCode==13&&(o.preventDefault(),i())},onsubmit:o=>{o.preventDefault(),i()}},Bn("label",t.state.phrase("Go to line"),": ",n)," ",Bn("button",{class:"cm-button",type:"submit"},t.state.phrase("go")));function i(){let o=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.value);if(!o)return;let{state:a}=t,s=a.doc.lineAt(a.selection.main.head),[,l,c,u,f]=o,d=u?+u.slice(1):0,h=c?+c:s.number;if(c&&f){let g=h/100;l&&(g=g*(l=="-"?-1:1)+s.number/a.doc.lines),h=Math.round(a.doc.lines*g)}else c&&l&&(h=h*(l=="-"?-1:1)+s.number);let p=a.doc.line(Math.max(1,Math.min(a.doc.lines,h))),m=je.cursor(p.from+Math.max(0,Math.min(d,p.length)));t.dispatch({effects:[wE.of(!1),rt.scrollIntoView(m.from,{y:"center"})],selection:m}),t.focus()}return{dom:r}}const wE=It.define(),fq=pi.define({create(){return!0},update(t,e){for(let n of e.effects)n.is(wE)&&(t=n.value);return t},provide:t=>r_.from(t,e=>e?U3:null)}),Ddt=t=>{let e=n_(t,U3);if(!e){let n=[wE.of(!0)];t.state.field(fq,!1)==null&&n.push(It.appendConfig.of([fq,Ldt])),t.dispatch({effects:n}),e=n_(t,U3)}return e&&e.dom.querySelector("input").select(),!0},Ldt=rt.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),$dt={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},tpe=ft.define({combine(t){return ac(t,$dt,{highlightWordAroundCursor:(e,n)=>e||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function Ndt(t){let e=[Udt,zdt];return t&&e.push(tpe.of(t)),e}const Fdt=yt.mark({class:"cm-selectionMatch"}),jdt=yt.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function dq(t,e,n,r){return(n==0||t(e.sliceDoc(n-1,n))!=ur.Word)&&(r==e.doc.length||t(e.sliceDoc(r,r+1))!=ur.Word)}function Bdt(t,e,n,r){return t(e.sliceDoc(n,n+1))==ur.Word&&t(e.sliceDoc(r-1,r))==ur.Word}const zdt=Mr.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(tpe),{state:n}=t,r=n.selection;if(r.ranges.length>1)return yt.none;let i=r.main,o,a=null;if(i.empty){if(!e.highlightWordAroundCursor)return yt.none;let l=n.wordAt(i.head);if(!l)return yt.none;a=n.charCategorizer(i.head),o=n.sliceDoc(l.from,l.to)}else{let l=i.to-i.from;if(l200)return yt.none;if(e.wholeWords){if(o=n.sliceDoc(i.from,i.to),a=n.charCategorizer(i.head),!(dq(a,n,i.from,i.to)&&Bdt(a,n,i.from,i.to)))return yt.none}else if(o=n.sliceDoc(i.from,i.to),!o)return yt.none}let s=[];for(let l of t.visibleRanges){let c=new cv(n.doc,o,l.from,l.to);for(;!c.next().done;){let{from:u,to:f}=c.value;if((!a||dq(a,n,u,f))&&(i.empty&&u<=i.from&&f>=i.to?s.push(jdt.range(u,f)):(u>=i.to||f<=i.from)&&s.push(Fdt.range(u,f)),s.length>e.maxMatches))return yt.none}}return yt.set(s)}},{decorations:t=>t.decorations}),Udt=rt.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Wdt=({state:t,dispatch:e})=>{let{selection:n}=t,r=je.create(n.ranges.map(i=>t.wordAt(i.head)||je.cursor(i.head)),n.mainIndex);return r.eq(n)?!1:(e(t.update({selection:r})),!0)};function Vdt(t,e){let{main:n,ranges:r}=t.selection,i=t.wordAt(n.head),o=i&&i.from==n.from&&i.to==n.to;for(let a=!1,s=new cv(t.doc,e,r[r.length-1].to);;)if(s.next(),s.done){if(a)return null;s=new cv(t.doc,e,0,Math.max(0,r[r.length-1].from-1)),a=!0}else{if(a&&r.some(l=>l.from==s.value.from))continue;if(o){let l=t.wordAt(s.value.from);if(!l||l.from!=s.value.from||l.to!=s.value.to)continue}return s.value}}const Gdt=({state:t,dispatch:e})=>{let{ranges:n}=t.selection;if(n.some(o=>o.from===o.to))return Wdt({state:t,dispatch:e});let r=t.sliceDoc(n[0].from,n[0].to);if(t.selection.ranges.some(o=>t.sliceDoc(o.from,o.to)!=r))return!1;let i=Vdt(t,r);return i?(e(t.update({selection:t.selection.addRange(je.range(i.from,i.to),!1),effects:rt.scrollIntoView(i.to)})),!0):!1},Ey=ft.define({combine(t){return ac(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new rht(e),scrollToMatch:e=>rt.scrollIntoView(e)})}});class npe{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||Idt(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(n,r)=>r=="n"?` +`:r=="r"?"\r":r=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new Qdt(this):new qdt(this)}getCursor(e,n=0,r){let i=e.doc?e:en.create({doc:e});return r==null&&(r=i.doc.length),this.regexp?Nm(this,i,n,r):$m(this,i,n,r)}}class rpe{constructor(e){this.spec=e}}function $m(t,e,n,r){return new cv(e.doc,t.unquoted,n,r,t.caseSensitive?void 0:i=>i.toLowerCase(),t.wholeWord?Hdt(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function Hdt(t,e){return(n,r,i,o)=>((o>n||o+i.length=n)return null;i.push(r.value)}return i}highlight(e,n,r,i){let o=$m(this.spec,e,Math.max(0,n-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!o.next().done;)i(o.value.from,o.value.to)}}function Nm(t,e,n,r){return new Jhe(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:t.wholeWord?Xdt(e.charCategorizer(e.selection.main.head)):void 0},n,r)}function SE(t,e){return t.slice(ki(t,e,!1),e)}function OE(t,e){return t.slice(e,ki(t,e))}function Xdt(t){return(e,n,r)=>!r[0].length||(t(SE(r.input,r.index))!=ur.Word||t(OE(r.input,r.index))!=ur.Word)&&(t(OE(r.input,r.index+r[0].length))!=ur.Word||t(SE(r.input,r.index+r[0].length))!=ur.Word)}class Qdt extends rpe{nextMatch(e,n,r){let i=Nm(this.spec,e,r,e.doc.length).next();return i.done&&(i=Nm(this.spec,e,0,n).next()),i.done?null:i.value}prevMatchInRange(e,n,r){for(let i=1;;i++){let o=Math.max(n,r-i*1e4),a=Nm(this.spec,e,o,r),s=null;for(;!a.next().done;)s=a.value;if(s&&(o==n||s.from>o+10))return s;if(o==n)return null}}prevMatch(e,n,r){return this.prevMatchInRange(e,0,n)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(n,r)=>r=="$"?"$":r=="&"?e.match[0]:r!="0"&&+r=n)return null;i.push(r.value)}return i}highlight(e,n,r,i){let o=Nm(this.spec,e,Math.max(0,n-250),Math.min(r+250,e.doc.length));for(;!o.next().done;)i(o.value.from,o.value.to)}}const s_=It.define(),M4=It.define(),jf=pi.define({create(t){return new qR(W3(t).create(),null)},update(t,e){for(let n of e.effects)n.is(s_)?t=new qR(n.value.create(),t.panel):n.is(M4)&&(t=new qR(t.query,n.value?k4:null));return t},provide:t=>r_.from(t,e=>e.panel)});class qR{constructor(e,n){this.query=e,this.panel=n}}const Ydt=yt.mark({class:"cm-searchMatch"}),Kdt=yt.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Zdt=Mr.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(jf))}update(t){let e=t.state.field(jf);(e!=t.startState.field(jf)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return yt.none;let{view:n}=this,r=new Jf;for(let i=0,o=n.visibleRanges,a=o.length;io[i+1].from-2*250;)l=o[++i].to;t.highlight(n.state,s,l,(c,u)=>{let f=n.state.selection.ranges.some(d=>d.from==c&&d.to==u);r.add(c,u,f?Kdt:Ydt)})}return r.finish()}},{decorations:t=>t.decorations});function gw(t){return e=>{let n=e.state.field(jf,!1);return n&&n.query.spec.valid?t(e,n):ape(e)}}const CE=gw((t,{query:e})=>{let{to:n}=t.state.selection.main,r=e.nextMatch(t.state,n,n);if(!r)return!1;let i=je.single(r.from,r.to),o=t.state.facet(Ey);return t.dispatch({selection:i,effects:[A4(t,r),o.scrollToMatch(i.main,t)],userEvent:"select.search"}),ope(t),!0}),TE=gw((t,{query:e})=>{let{state:n}=t,{from:r}=n.selection.main,i=e.prevMatch(n,r,r);if(!i)return!1;let o=je.single(i.from,i.to),a=t.state.facet(Ey);return t.dispatch({selection:o,effects:[A4(t,i),a.scrollToMatch(o.main,t)],userEvent:"select.search"}),ope(t),!0}),Jdt=gw((t,{query:e})=>{let n=e.matchAll(t.state,1e3);return!n||!n.length?!1:(t.dispatch({selection:je.create(n.map(r=>je.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),eht=({state:t,dispatch:e})=>{let n=t.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,o=[],a=0;for(let s=new cv(t.doc,t.sliceDoc(r,i));!s.next().done;){if(o.length>1e3)return!1;s.value.from==r&&(a=o.length),o.push(je.range(s.value.from,s.value.to))}return e(t.update({selection:je.create(o,a),userEvent:"select.search.matches"})),!0},hq=gw((t,{query:e})=>{let{state:n}=t,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let o=e.nextMatch(n,r,r);if(!o)return!1;let a=[],s,l,c=[];if(o.from==r&&o.to==i&&(l=n.toText(e.getReplacement(o)),a.push({from:o.from,to:o.to,insert:l}),o=e.nextMatch(n,o.from,o.to),c.push(rt.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+"."))),o){let u=a.length==0||a[0].from>=o.to?0:o.to-o.from-l.length;s=je.single(o.from-u,o.to-u),c.push(A4(t,o)),c.push(n.facet(Ey).scrollToMatch(s.main,t))}return t.dispatch({changes:a,selection:s,effects:c,userEvent:"input.replace"}),!0}),tht=gw((t,{query:e})=>{if(t.state.readOnly)return!1;let n=e.matchAll(t.state,1e9).map(i=>{let{from:o,to:a}=i;return{from:o,to:a,insert:e.getReplacement(i)}});if(!n.length)return!1;let r=t.state.phrase("replaced $ matches",n.length)+".";return t.dispatch({changes:n,effects:rt.announce.of(r),userEvent:"input.replace.all"}),!0});function k4(t){return t.state.facet(Ey).createPanel(t)}function W3(t,e){var n,r,i,o,a;let s=t.selection.main,l=s.empty||s.to>s.from+100?"":t.sliceDoc(s.from,s.to);if(e&&!l)return e;let c=t.facet(Ey);return new npe({search:((n=e==null?void 0:e.literal)!==null&&n!==void 0?n:c.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(r=e==null?void 0:e.caseSensitive)!==null&&r!==void 0?r:c.caseSensitive,literal:(i=e==null?void 0:e.literal)!==null&&i!==void 0?i:c.literal,regexp:(o=e==null?void 0:e.regexp)!==null&&o!==void 0?o:c.regexp,wholeWord:(a=e==null?void 0:e.wholeWord)!==null&&a!==void 0?a:c.wholeWord})}function ipe(t){let e=n_(t,k4);return e&&e.dom.querySelector("[main-field]")}function ope(t){let e=ipe(t);e&&e==t.root.activeElement&&e.select()}const ape=t=>{let e=t.state.field(jf,!1);if(e&&e.panel){let n=ipe(t);if(n&&n!=t.root.activeElement){let r=W3(t.state,e.query.spec);r.valid&&t.dispatch({effects:s_.of(r)}),n.focus(),n.select()}}else t.dispatch({effects:[M4.of(!0),e?s_.of(W3(t.state,e.query.spec)):It.appendConfig.of(oht)]});return!0},spe=t=>{let e=t.state.field(jf,!1);if(!e||!e.panel)return!1;let n=n_(t,k4);return n&&n.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:M4.of(!1)}),!0},nht=[{key:"Mod-f",run:ape,scope:"editor search-panel"},{key:"F3",run:CE,shift:TE,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:CE,shift:TE,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:spe,scope:"editor search-panel"},{key:"Mod-Shift-l",run:eht},{key:"Mod-Alt-g",run:Ddt},{key:"Mod-d",run:Gdt,preventDefault:!0}];class rht{constructor(e){this.view=e;let n=this.query=e.state.field(jf).query.spec;this.commit=this.commit.bind(this),this.searchField=Bn("input",{value:n.search,placeholder:Qo(e,"Find"),"aria-label":Qo(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Bn("input",{value:n.replace,placeholder:Qo(e,"Replace"),"aria-label":Qo(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Bn("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=Bn("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=Bn("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(i,o,a){return Bn("button",{class:"cm-button",name:i,onclick:o,type:"button"},a)}this.dom=Bn("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>CE(e),[Qo(e,"next")]),r("prev",()=>TE(e),[Qo(e,"previous")]),r("select",()=>Jdt(e),[Qo(e,"all")]),Bn("label",null,[this.caseField,Qo(e,"match case")]),Bn("label",null,[this.reField,Qo(e,"regexp")]),Bn("label",null,[this.wordField,Qo(e,"by word")]),...e.state.readOnly?[]:[Bn("br"),this.replaceField,r("replace",()=>hq(e),[Qo(e,"replace")]),r("replaceAll",()=>tht(e),[Qo(e,"replace all")])],Bn("button",{name:"close",onclick:()=>spe(e),"aria-label":Qo(e,"close"),type:"button"},["×"])])}commit(){let e=new npe({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:s_.of(e)}))}keydown(e){gct(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?TE:CE)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),hq(this.view))}update(e){for(let n of e.transactions)for(let r of n.effects)r.is(s_)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Ey).top}}function Qo(t,e){return t.state.phrase(e)}const nO=30,rO=/[\s\.,:;?!]/;function A4(t,{from:e,to:n}){let r=t.state.doc.lineAt(e),i=t.state.doc.lineAt(n).to,o=Math.max(r.from,e-nO),a=Math.min(i,n+nO),s=t.state.sliceDoc(o,a);if(o!=r.from){for(let l=0;ls.length-nO;l--)if(!rO.test(s[l-1])&&rO.test(s[l])){s=s.slice(0,l);break}}return rt.announce.of(`${t.state.phrase("current match")}. ${s} ${t.state.phrase("on line")} ${r.number}.`)}const iht=rt.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),oht=[jf,bd.low(Zdt),iht];class lpe{constructor(e,n,r,i){this.state=e,this.pos=n,this.explicit=r,this.view=i,this.abortListeners=[]}tokenBefore(e){let n=ui(this.state).resolveInner(this.pos,-1);for(;n&&e.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(e){let n=this.state.doc.lineAt(this.pos),r=Math.max(n.from,this.pos-250),i=n.text.slice(r-n.from,this.pos-n.from),o=i.search(upe(e,!1));return o<0?null:{from:r+o,to:this.pos,text:i.slice(o)}}get aborted(){return this.abortListeners==null}addEventListener(e,n){e=="abort"&&this.abortListeners&&this.abortListeners.push(n)}}function pq(t){let e=Object.keys(t).join(""),n=/\w/.test(e);return n&&(e=e.replace(/\w/g,"")),`[${n?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function aht(t){let e=Object.create(null),n=Object.create(null);for(let{label:i}of t){e[i[0]]=!0;for(let o=1;otypeof i=="string"?{label:i}:i),[n,r]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:aht(e);return i=>{let o=i.matchBefore(r);return o||i.explicit?{from:o?o.from:i.pos,options:e,validFor:n}:null}}function sht(t,e){return n=>{for(let r=ui(n.state).resolveInner(n.pos,-1);r;r=r.parent){if(t.indexOf(r.name)>-1)return null;if(r.type.isTop)break}return e(n)}}class mq{constructor(e,n,r,i){this.completion=e,this.source=n,this.match=r,this.score=i}}function Bf(t){return t.selection.main.from}function upe(t,e){var n;let{source:r}=t,i=e&&r[0]!="^",o=r[r.length-1]!="$";return!i&&!o?t:new RegExp(`${i?"^":""}(?:${r})${o?"$":""}`,(n=t.flags)!==null&&n!==void 0?n:t.ignoreCase?"i":"")}const R4=oc.define();function lht(t,e,n,r){let{main:i}=t.selection,o=n-i.from,a=r-i.from;return Object.assign(Object.assign({},t.changeByRange(s=>s!=i&&n!=r&&t.sliceDoc(s.from+o,s.from+a)!=t.sliceDoc(n,r)?{range:s}:{changes:{from:s.from+o,to:r==i.from?s.to:s.from+a,insert:e},range:je.cursor(s.from+o+e.length)})),{scrollIntoView:!0,userEvent:"input.complete"})}const gq=new WeakMap;function cht(t){if(!Array.isArray(t))return t;let e=gq.get(t);return e||gq.set(t,e=cpe(t)),e}const EE=It.define(),l_=It.define();class uht{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n=48&&_<=57||_>=97&&_<=122?2:_>=65&&_<=90?1:0:(S=r4(_))!=S.toLowerCase()?1:S!=S.toUpperCase()?2:0;(!y||O==1&&g||b==0&&O!=0)&&(n[f]==_||r[f]==_&&(d=!0)?a[f++]=y:a.length&&(v=!1)),b=O,y+=Ga(_)}return f==l&&a[0]==0&&v?this.result(-100+(d?-200:0),a,e):h==l&&p==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):s>-1?this.ret(-700-e.length,[s,s+this.pattern.length]):h==l?this.ret(-900-e.length,[p,m]):f==l?this.result(-100+(d?-200:0)+-700+(v?0:-1100),a,e):n.length==2?null:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,n,r){let i=[],o=0;for(let a of n){let s=a+(this.astral?Ga(Ci(r,a)):1);o&&i[o-1]==a?i[o-1]=s:(i[o++]=a,i[o++]=s)}return this.ret(e-r.length,i)}}class fht{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:dht,filterStrict:!1,compareCompletions:(e,n)=>e.label.localeCompare(n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,n)=>e&&n,closeOnBlur:(e,n)=>e&&n,icons:(e,n)=>e&&n,tooltipClass:(e,n)=>r=>vq(e(r),n(r)),optionClass:(e,n)=>r=>vq(e(r),n(r)),addToOptions:(e,n)=>e.concat(n),filterStrict:(e,n)=>e||n})}});function vq(t,e){return t?e?t+" "+e:t:e}function dht(t,e,n,r,i,o){let a=t.textDirection==nr.RTL,s=a,l=!1,c="top",u,f,d=e.left-i.left,h=i.right-e.right,p=r.right-r.left,m=r.bottom-r.top;if(s&&d=m||y>e.top?u=n.bottom-e.top:(c="bottom",u=e.bottom-n.top)}let g=(e.bottom-e.top)/o.offsetHeight,v=(e.right-e.left)/o.offsetWidth;return{style:`${c}: ${u/g}px; max-width: ${f/v}px`,class:"cm-completionInfo-"+(l?a?"left-narrow":"right-narrow":s?"left":"right")}}function hht(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(n){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),n.type&&r.classList.add(...n.type.split(/\s+/g).map(i=>"cm-completionIcon-"+i)),r.setAttribute("aria-hidden","true"),r},position:20}),e.push({render(n,r,i,o){let a=document.createElement("span");a.className="cm-completionLabel";let s=n.displayLabel||n.label,l=0;for(let c=0;cl&&a.appendChild(document.createTextNode(s.slice(l,u)));let d=a.appendChild(document.createElement("span"));d.appendChild(document.createTextNode(s.slice(u,f))),d.className="cm-completionMatchedText",l=f}return ln.position-r.position).map(n=>n.render)}function XR(t,e,n){if(t<=n)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let i=Math.floor(e/n);return{from:i*n,to:(i+1)*n}}let r=Math.floor((t-e)/n);return{from:t-(r+1)*n,to:t-r*n}}class pht{constructor(e,n,r){this.view=e,this.stateField=n,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:l=>this.placeInfo(l),key:this},this.space=null,this.currentClass="";let i=e.state.field(n),{options:o,selected:a}=i.open,s=e.state.facet(Mi);this.optionContent=hht(s),this.optionClass=s.optionClass,this.tooltipClass=s.tooltipClass,this.range=XR(o.length,a,s.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",l=>{let{options:c}=e.state.field(n).open;for(let u=l.target,f;u&&u!=this.dom;u=u.parentNode)if(u.nodeName=="LI"&&(f=/-(\d+)$/.exec(u.id))&&+f[1]{let c=e.state.field(this.stateField,!1);c&&c.tooltip&&e.state.facet(Mi).closeOnBlur&&l.relatedTarget!=e.contentDOM&&e.dispatch({effects:l_.of(null)})}),this.showOptions(o,i.id)}mount(){this.updateSel()}showOptions(e,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var n;let r=e.state.field(this.stateField),i=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),r!=i){let{options:o,selected:a,disabled:s}=r.open;(!i.open||i.open.options!=o)&&(this.range=XR(o.length,a,e.state.facet(Mi).maxRenderedOptions),this.showOptions(o,r.id)),this.updateSel(),s!=((n=i.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!s)}}updateTooltipClass(e){let n=this.tooltipClass(e);if(n!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of n.split(" "))r&&this.dom.classList.add(r);this.currentClass=n}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),n=e.open;if((n.selected>-1&&n.selected=this.range.to)&&(this.range=XR(n.options.length,n.selected,this.view.state.facet(Mi).maxRenderedOptions),this.showOptions(n.options,e.id)),this.updateSelectedOption(n.selected)){this.destroyInfo();let{completion:r}=n.options[n.selected],{info:i}=r;if(!i)return;let o=typeof i=="string"?document.createTextNode(i):i(r);if(!o)return;"then"in o?o.then(a=>{a&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(a,r)}).catch(a=>ko(this.view.state,a,"completion info")):this.addInfoPane(o,r)}}addInfoPane(e,n){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",e.nodeType!=null)r.appendChild(e),this.infoDestroy=null;else{let{dom:i,destroy:o}=e;r.appendChild(i),this.infoDestroy=o||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let n=null;for(let r=this.list.firstChild,i=this.range.from;r;r=r.nextSibling,i++)r.nodeName!="LI"||!r.id?i--:i==e?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),n=r):r.hasAttribute("aria-selected")&&r.removeAttribute("aria-selected");return n&&ght(this.list,n),n}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let n=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),i=e.getBoundingClientRect(),o=this.space;if(!o){let a=this.dom.ownerDocument.defaultView||window;o={left:0,top:0,right:a.innerWidth,bottom:a.innerHeight}}return i.top>Math.min(o.bottom,n.bottom)-10||i.bottomr.from||r.from==0))if(o=d,typeof c!="string"&&c.header)i.appendChild(c.header(c));else{let h=i.appendChild(document.createElement("completion-section"));h.textContent=d}}const u=i.appendChild(document.createElement("li"));u.id=n+"-"+a,u.setAttribute("role","option");let f=this.optionClass(s);f&&(u.className=f);for(let d of this.optionContent){let h=d(s,this.view.state,this.view,l);h&&u.appendChild(h)}}return r.from&&i.classList.add("cm-completionListIncompleteTop"),r.tonew pht(n,t,e)}function ght(t,e){let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=n.height/t.offsetHeight;r.topn.bottom&&(t.scrollTop+=(r.bottom-n.bottom)/i)}function yq(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function vht(t,e){let n=[],r=null,i=c=>{n.push(c);let{section:u}=c.completion;if(u){r||(r=[]);let f=typeof u=="string"?u:u.name;r.some(d=>d.name==f)||r.push(typeof u=="string"?{name:f}:u)}},o=e.facet(Mi);for(let c of t)if(c.hasResult()){let u=c.result.getMatch;if(c.result.filter===!1)for(let f of c.result.options)i(new mq(f,c.source,u?u(f):[],1e9-n.length));else{let f=e.sliceDoc(c.from,c.to),d,h=o.filterStrict?new fht(f):new uht(f);for(let p of c.result.options)if(d=h.match(p.label)){let m=p.displayLabel?u?u(p,d.matched):[]:d.matched;i(new mq(p,c.source,m,d.score+(p.boost||0)))}}}if(r){let c=Object.create(null),u=0,f=(d,h)=>{var p,m;return((p=d.rank)!==null&&p!==void 0?p:1e9)-((m=h.rank)!==null&&m!==void 0?m:1e9)||(d.namef.score-u.score||l(u.completion,f.completion))){let u=c.completion;!s||s.label!=u.label||s.detail!=u.detail||s.type!=null&&u.type!=null&&s.type!=u.type||s.apply!=u.apply||s.boost!=u.boost?a.push(c):yq(c.completion)>yq(s)&&(a[a.length-1]=c),s=c.completion}return a}class tg{constructor(e,n,r,i,o,a){this.options=e,this.attrs=n,this.tooltip=r,this.timestamp=i,this.selected=o,this.disabled=a}setSelected(e,n){return e==this.selected||e>=this.options.length?this:new tg(this.options,xq(n,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,n,r,i,o){let a=vht(e,n);if(!a.length)return i&&e.some(l=>l.state==1)?new tg(i.options,i.attrs,i.tooltip,i.timestamp,i.selected,!0):null;let s=n.facet(Mi).selectOnOpen?0:-1;if(i&&i.selected!=s&&i.selected!=-1){let l=i.options[i.selected].completion;for(let c=0;cc.hasResult()?Math.min(l,c.from):l,1e8),create:Sht,above:o.aboveCursor},i?i.timestamp:Date.now(),s,!1)}map(e){return new tg(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class PE{constructor(e,n,r){this.active=e,this.id=n,this.open=r}static start(){return new PE(_ht,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:n}=e,r=n.facet(Mi),o=(r.override||n.languageDataAt("autocomplete",Bf(n)).map(cht)).map(s=>(this.active.find(c=>c.source==s)||new da(s,this.active.some(c=>c.state!=0)?1:0)).update(e,r));o.length==this.active.length&&o.every((s,l)=>s==this.active[l])&&(o=this.active);let a=this.open;a&&e.docChanged&&(a=a.map(e.changes)),e.selection||o.some(s=>s.hasResult()&&e.changes.touchesRange(s.from,s.to))||!yht(o,this.active)?a=tg.build(o,n,this.id,a,r):a&&a.disabled&&!o.some(s=>s.state==1)&&(a=null),!a&&o.every(s=>s.state!=1)&&o.some(s=>s.hasResult())&&(o=o.map(s=>s.hasResult()?new da(s.source,0):s));for(let s of e.effects)s.is(hpe)&&(a=a&&a.setSelected(s.value,this.id));return o==this.active&&a==this.open?this:new PE(o,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?xht:bht}}function yht(t,e){if(t==e)return!0;for(let n=0,r=0;;){for(;n-1&&(n["aria-activedescendant"]=t+"-"+e),n}const _ht=[];function fpe(t,e){if(t.isUserEvent("input.complete")){let r=t.annotation(R4);if(r&&e.activateOnCompletion(r))return 12}let n=t.isUserEvent("input.type");return n&&e.activateOnTyping?5:n?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}class da{constructor(e,n,r=-1){this.source=e,this.state=n,this.explicitPos=r}hasResult(){return!1}update(e,n){let r=fpe(e,n),i=this;(r&8||r&16&&this.touches(e))&&(i=new da(i.source,0)),r&4&&i.state==0&&(i=new da(this.source,1)),i=i.updateFor(e,r);for(let o of e.effects)if(o.is(EE))i=new da(i.source,1,o.value?Bf(e.state):-1);else if(o.is(l_))i=new da(i.source,0);else if(o.is(dpe))for(let a of o.value)a.source==i.source&&(i=a);return i}updateFor(e,n){return this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new da(this.source,this.state,e.mapPos(this.explicitPos))}touches(e){return e.changes.touchesRange(Bf(e.state))}}class Mg extends da{constructor(e,n,r,i,o){super(e,2,n),this.result=r,this.from=i,this.to=o}hasResult(){return!0}updateFor(e,n){var r;if(!(n&3))return this.map(e.changes);let i=this.result;i.map&&!e.changes.empty&&(i=i.map(i,e.changes));let o=e.changes.mapPos(this.from),a=e.changes.mapPos(this.to,1),s=Bf(e.state);if((this.explicitPos<0?s<=o:sa||!i||n&2&&Bf(e.startState)==this.from)return new da(this.source,n&4?1:0);let l=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos);return wht(i.validFor,e.state,o,a)?new Mg(this.source,l,i,o,a):i.update&&(i=i.update(i,o,a,new lpe(e.state,s,l>=0)))?new Mg(this.source,l,i,i.from,(r=i.to)!==null&&r!==void 0?r:Bf(e.state)):new da(this.source,1,l)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new Mg(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new da(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function wht(t,e,n,r){if(!t)return!1;let i=e.sliceDoc(n,r);return typeof t=="function"?t(i,n,r,e):upe(t,!0).test(i)}const dpe=It.define({map(t,e){return t.map(n=>n.map(e))}}),hpe=It.define(),Co=pi.define({create(){return PE.start()},update(t,e){return t.update(e)},provide:t=>[p4.from(t,e=>e.tooltip),rt.contentAttributes.from(t,e=>e.attrs)]});function I4(t,e){const n=e.completion.apply||e.completion.label;let r=t.state.field(Co).active.find(i=>i.source==e.source);return r instanceof Mg?(typeof n=="string"?t.dispatch(Object.assign(Object.assign({},lht(t.state,n,r.from,r.to)),{annotations:R4.of(e.completion)})):n(t,e.completion,r.from,r.to),!0):!1}const Sht=mht(Co,I4);function iO(t,e="option"){return n=>{let r=n.state.field(Co,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp-1?r.open.selected+i*(t?1:-1):t?0:a-1;return s<0?s=e=="page"?0:a-1:s>=a&&(s=e=="page"?a-1:0),n.dispatch({effects:hpe.of(s)}),!0}}const Oht=t=>{let e=t.state.field(Co,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampt.state.field(Co,!1)?(t.dispatch({effects:EE.of(!0)}),!0):!1,Tht=t=>{let e=t.state.field(Co,!1);return!e||!e.active.some(n=>n.state!=0)?!1:(t.dispatch({effects:l_.of(null)}),!0)};class Eht{constructor(e,n){this.active=e,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const Pht=50,Mht=1e3,kht=Mr.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field(Co).active)e.state==1&&this.startQuery(e)}update(t){let e=t.state.field(Co),n=t.state.facet(Mi);if(!t.selectionSet&&!t.docChanged&&t.startState.field(Co)==e)return;let r=t.transactions.some(o=>{let a=fpe(o,n);return a&8||(o.selection||o.docChanged)&&!(a&3)});for(let o=0;oPht&&Date.now()-a.time>Mht){for(let s of a.context.abortListeners)try{s()}catch(l){ko(this.view.state,l)}a.context.abortListeners=null,this.running.splice(o--,1)}else a.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(o=>o.effects.some(a=>a.is(EE)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(o=>o.state==1&&!this.running.some(a=>a.active.source==o.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let o of t.transactions)o.isUserEvent("input.type")?this.composing=2:this.composing==2&&o.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field(Co);for(let n of e.active)n.state==1&&!this.running.some(r=>r.active.source==n.source)&&this.startQuery(n)}startQuery(t){let{state:e}=this.view,n=Bf(e),r=new lpe(e,n,t.explicitPos==n,this.view),i=new Eht(t,r);this.running.push(i),Promise.resolve(t.source(r)).then(o=>{i.context.aborted||(i.done=o||null,this.scheduleAccept())},o=>{this.view.dispatch({effects:l_.of(null)}),ko(this.view.state,o)})}scheduleAccept(){this.running.every(t=>t.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Mi).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],n=this.view.state.facet(Mi);for(let r=0;ra.source==i.active.source);if(o&&o.state==1)if(i.done==null){let a=new da(i.active.source,0);for(let s of i.updates)a=a.update(s,n);a.state!=1&&e.push(a)}else this.startQuery(o)}e.length&&this.view.dispatch({effects:dpe.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(Co,!1);if(e&&e.tooltip&&this.view.state.facet(Mi).closeOnBlur){let n=e.open&&Hde(this.view,e.open.tooltip);(!n||!n.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:l_.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:EE.of(!1)}),20),this.composing=0}}}),Aht=typeof navigator=="object"&&/Win/.test(navigator.platform),Rht=bd.highest(rt.domEventHandlers({keydown(t,e){let n=e.state.field(Co,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||t.key.length>1||t.ctrlKey&&!(Aht&&t.altKey)||t.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(a=>a.source==r.source),o=r.completion.commitCharacters||i.result.commitCharacters;return o&&o.indexOf(t.key)>-1&&I4(e,r),!1}})),ppe=rt.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class Iht{constructor(e,n,r,i){this.field=e,this.line=n,this.from=r,this.to=i}}class D4{constructor(e,n,r){this.field=e,this.from=n,this.to=r}map(e){let n=e.mapPos(this.from,-1,Pi.TrackDel),r=e.mapPos(this.to,1,Pi.TrackDel);return n==null||r==null?null:new D4(this.field,n,r)}}class L4{constructor(e,n){this.lines=e,this.fieldPositions=n}instantiate(e,n){let r=[],i=[n],o=e.doc.lineAt(n),a=/^\s*/.exec(o.text)[0];for(let l of this.lines){if(r.length){let c=a,u=/^\t*/.exec(l)[0].length;for(let f=0;fnew D4(l.field,i[l.line]+l.from,i[l.line]+l.to));return{text:r,ranges:s}}static parse(e){let n=[],r=[],i=[],o;for(let a of e.split(/\r\n?|\n/)){for(;o=/[#$]\{(?:(\d+)(?::([^}]*))?|((?:\\[{}]|[^}])*))\}/.exec(a);){let s=o[1]?+o[1]:null,l=o[2]||o[3]||"",c=-1,u=l.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f=c&&d.field++}i.push(new Iht(c,r.length,o.index,o.index+u.length)),a=a.slice(0,o.index)+l+a.slice(o.index+o[0].length)}a=a.replace(/\\([{}])/g,(s,l,c)=>{for(let u of i)u.line==r.length&&u.from>c&&(u.from--,u.to--);return l}),r.push(a)}return new L4(r,i)}}let Dht=yt.widget({widget:new class extends sc{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),Lht=yt.mark({class:"cm-snippetField"});class Py{constructor(e,n){this.ranges=e,this.active=n,this.deco=yt.set(e.map(r=>(r.from==r.to?Dht:Lht).range(r.from,r.to)))}map(e){let n=[];for(let r of this.ranges){let i=r.map(e);if(!i)return null;n.push(i)}return new Py(n,this.active)}selectionInsideField(e){return e.ranges.every(n=>this.ranges.some(r=>r.field==this.active&&r.from<=n.from&&r.to>=n.to))}}const vw=It.define({map(t,e){return t&&t.map(e)}}),$ht=It.define(),c_=pi.define({create(){return null},update(t,e){for(let n of e.effects){if(n.is(vw))return n.value;if(n.is($ht)&&t)return new Py(t.ranges,n.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>rt.decorations.from(t,e=>e?e.deco:yt.none)});function $4(t,e){return je.create(t.filter(n=>n.field==e).map(n=>je.range(n.from,n.to)))}function Nht(t){let e=L4.parse(t);return(n,r,i,o)=>{let{text:a,ranges:s}=e.instantiate(n.state,i),l={changes:{from:i,to:o,insert:Sn.of(a)},scrollIntoView:!0,annotations:r?[R4.of(r),Br.userEvent.of("input.complete")]:void 0};if(s.length&&(l.selection=$4(s,0)),s.some(c=>c.field>0)){let c=new Py(s,0),u=l.effects=[vw.of(c)];n.state.field(c_,!1)===void 0&&u.push(It.appendConfig.of([c_,Uht,Wht,ppe]))}n.dispatch(n.state.update(l))}}function mpe(t){return({state:e,dispatch:n})=>{let r=e.field(c_,!1);if(!r||t<0&&r.active==0)return!1;let i=r.active+t,o=t>0&&!r.ranges.some(a=>a.field==i+t);return n(e.update({selection:$4(r.ranges,i),effects:vw.of(o?null:new Py(r.ranges,i)),scrollIntoView:!0})),!0}}const Fht=({state:t,dispatch:e})=>t.field(c_,!1)?(e(t.update({effects:vw.of(null)})),!0):!1,jht=mpe(1),Bht=mpe(-1),zht=[{key:"Tab",run:jht,shift:Bht},{key:"Escape",run:Fht}],bq=ft.define({combine(t){return t.length?t[0]:zht}}),Uht=bd.highest(uw.compute([bq],t=>t.facet(bq)));function mc(t,e){return Object.assign(Object.assign({},e),{apply:Nht(t)})}const Wht=rt.domEventHandlers({mousedown(t,e){let n=e.state.field(c_,!1),r;if(!n||(r=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let i=n.ranges.find(o=>o.from<=r&&o.to>=r);return!i||i.field==n.active?!1:(e.dispatch({selection:$4(n.ranges,i.field),effects:vw.of(n.ranges.some(o=>o.field>i.field)?new Py(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),u_={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},yh=It.define({map(t,e){let n=e.mapPos(t,-1,Pi.TrackAfter);return n??void 0}}),N4=new class extends ep{};N4.startSide=1;N4.endSide=-1;const gpe=pi.define({create(){return sn.empty},update(t,e){if(t=t.map(e.changes),e.selection){let n=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:r=>r>=n.from&&r<=n.to})}for(let n of e.effects)n.is(yh)&&(t=t.update({add:[N4.range(n.value,n.value+1)]}));return t}});function Vht(){return[Hht,gpe]}const QR="()[]{}<>";function vpe(t){for(let e=0;e{if((Ght?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let i=t.state.selection.main;if(r.length>2||r.length==2&&Ga(Ci(r,0))==1||e!=i.from||n!=i.to)return!1;let o=Qht(t.state,r);return o?(t.dispatch(o),!0):!1}),qht=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=ype(t,t.selection.main.head).brackets||u_.brackets,i=null,o=t.changeByRange(a=>{if(a.empty){let s=Yht(t.doc,a.head);for(let l of r)if(l==s&&N2(t.doc,a.head)==vpe(Ci(l,0)))return{changes:{from:a.head-l.length,to:a.head+l.length},range:je.cursor(a.head-l.length)}}return{range:i=a}});return i||e(t.update(o,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},Xht=[{key:"Backspace",run:qht}];function Qht(t,e){let n=ype(t,t.selection.main.head),r=n.brackets||u_.brackets;for(let i of r){let o=vpe(Ci(i,0));if(e==i)return o==i?Jht(t,i,r.indexOf(i+i+i)>-1,n):Kht(t,i,o,n.before||u_.before);if(e==o&&xpe(t,t.selection.main.from))return Zht(t,i,o)}return null}function xpe(t,e){let n=!1;return t.field(gpe).between(0,t.doc.length,r=>{r==e&&(n=!0)}),n}function N2(t,e){let n=t.sliceString(e,e+2);return n.slice(0,Ga(Ci(n,0)))}function Yht(t,e){let n=t.sliceString(e-2,e);return Ga(Ci(n,0))==n.length?n:n.slice(1)}function Kht(t,e,n,r){let i=null,o=t.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:n,from:a.to}],effects:yh.of(a.to+e.length),range:je.range(a.anchor+e.length,a.head+e.length)};let s=N2(t.doc,a.head);return!s||/\s/.test(s)||r.indexOf(s)>-1?{changes:{insert:e+n,from:a.head},effects:yh.of(a.head+e.length),range:je.cursor(a.head+e.length)}:{range:i=a}});return i?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function Zht(t,e,n){let r=null,i=t.changeByRange(o=>o.empty&&N2(t.doc,o.head)==n?{changes:{from:o.head,to:o.head+n.length,insert:n},range:je.cursor(o.head+n.length)}:r={range:o});return r?null:t.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function Jht(t,e,n,r){let i=r.stringPrefixes||u_.stringPrefixes,o=null,a=t.changeByRange(s=>{if(!s.empty)return{changes:[{insert:e,from:s.from},{insert:e,from:s.to}],effects:yh.of(s.to+e.length),range:je.range(s.anchor+e.length,s.head+e.length)};let l=s.head,c=N2(t.doc,l),u;if(c==e){if(_q(t,l))return{changes:{insert:e+e,from:l},effects:yh.of(l+e.length),range:je.cursor(l+e.length)};if(xpe(t,l)){let d=n&&t.sliceDoc(l,l+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:l,to:l+d.length,insert:d},range:je.cursor(l+d.length)}}}else{if(n&&t.sliceDoc(l-2*e.length,l)==e+e&&(u=wq(t,l-2*e.length,i))>-1&&_q(t,u))return{changes:{insert:e+e+e+e,from:l},effects:yh.of(l+e.length),range:je.cursor(l+e.length)};if(t.charCategorizer(l)(c)!=ur.Word&&wq(t,l,i)>-1&&!ept(t,l,e,i))return{changes:{insert:e+e,from:l},effects:yh.of(l+e.length),range:je.cursor(l+e.length)}}return{range:o=s}});return o?null:t.update(a,{scrollIntoView:!0,userEvent:"input.type"})}function _q(t,e){let n=ui(t).resolveInner(e+1);return n.parent&&n.from==e}function ept(t,e,n,r){let i=ui(t).resolveInner(e,-1),o=r.reduce((a,s)=>Math.max(a,s.length),0);for(let a=0;a<5;a++){let s=t.sliceDoc(i.from,Math.min(i.to,i.from+n.length+o)),l=s.indexOf(n);if(!l||l>-1&&r.indexOf(s.slice(0,l))>-1){let u=i.firstChild;for(;u&&u.from==i.from&&u.to-u.from>n.length+l;){if(t.sliceDoc(u.to-n.length,u.to)==n)return!1;u=u.firstChild}return!0}let c=i.to==e&&i.parent;if(!c)break;i=c}return!1}function wq(t,e,n){let r=t.charCategorizer(e);if(r(t.sliceDoc(e-1,e))!=ur.Word)return e;for(let i of n){let o=e-i.length;if(t.sliceDoc(o,e)==i&&r(t.sliceDoc(o-1,o))!=ur.Word)return o}return-1}function bpe(t={}){return[Rht,Co,Mi.of(t),kht,tpt,ppe]}const _pe=[{key:"Ctrl-Space",run:Cht},{key:"Escape",run:Tht},{key:"ArrowDown",run:iO(!0)},{key:"ArrowUp",run:iO(!1)},{key:"PageDown",run:iO(!0,"page")},{key:"PageUp",run:iO(!1,"page")},{key:"Enter",run:Oht}],tpt=bd.highest(uw.computeN([Mi],t=>t.facet(Mi).defaultKeymap?[_pe]:[]));class npt{constructor(e,n,r){this.from=e,this.to=n,this.diagnostic=r}}class oh{constructor(e,n,r){this.diagnostics=e,this.panel=n,this.selected=r}static init(e,n,r){let i=e,o=r.facet(Ope).markerFilter;o&&(i=o(i,r));let a=yt.set(i.map(s=>s.from==s.to||s.from==s.to-1&&r.doc.lineAt(s.from).to==s.from?yt.widget({widget:new fpt(s),diagnostic:s}).range(s.from):yt.mark({attributes:{class:"cm-lintRange cm-lintRange-"+s.severity+(s.markClass?" "+s.markClass:"")},diagnostic:s,inclusive:!0}).range(s.from,s.to)),!0);return new oh(a,n,uv(a))}}function uv(t,e=null,n=0){let r=null;return t.between(n,1e9,(i,o,{spec:a})=>{if(!(e&&a.diagnostic!=e))return r=new npt(i,o,a.diagnostic),!1}),r}function rpt(t,e){let n=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(r=>r.is(wpe))||t.changes.touchesRange(n.from,n.to))}function ipt(t,e){return t.field(ga,!1)?e:e.concat(It.appendConfig.of(ppt))}const wpe=It.define(),F4=It.define(),Spe=It.define(),ga=pi.define({create(){return new oh(yt.none,null,null)},update(t,e){if(e.docChanged){let n=t.diagnostics.map(e.changes),r=null;if(t.selected){let i=e.changes.mapPos(t.selected.from,1);r=uv(n,t.selected.diagnostic,i)||uv(n,null,i)}t=new oh(n,t.panel,r)}for(let n of e.effects)n.is(wpe)?t=oh.init(n.value,t.panel,e.state):n.is(F4)?t=new oh(t.diagnostics,n.value?F2.open:null,t.selected):n.is(Spe)&&(t=new oh(t.diagnostics,t.panel,n.value));return t},provide:t=>[r_.from(t,e=>e.panel),rt.decorations.from(t,e=>e.diagnostics)]}),opt=yt.mark({class:"cm-lintRange cm-lintRange-active",inclusive:!0});function apt(t,e,n){let{diagnostics:r}=t.state.field(ga),i=[],o=2e8,a=0;r.between(e-(n<0?1:0),e+(n>0?1:0),(l,c,{spec:u})=>{e>=l&&e<=c&&(l==c||(e>l||n>0)&&(eTpe(t,n,!1)))}const lpt=t=>{let e=t.state.field(ga,!1);(!e||!e.panel)&&t.dispatch({effects:ipt(t.state,[F4.of(!0)])});let n=n_(t,F2.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},Sq=t=>{let e=t.state.field(ga,!1);return!e||!e.panel?!1:(t.dispatch({effects:F4.of(!1)}),!0)},cpt=t=>{let e=t.state.field(ga,!1);if(!e)return!1;let n=t.state.selection.main,r=e.diagnostics.iter(n.to+1);return!r.value&&(r=e.diagnostics.iter(0),!r.value||r.from==n.from&&r.to==n.to)?!1:(t.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},upt=[{key:"Mod-Shift-m",run:lpt,preventDefault:!0},{key:"F8",run:cpt}],Ope=ft.define({combine(t){return Object.assign({sources:t.map(e=>e.source).filter(e=>e!=null)},ac(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null},{needsRefresh:(e,n)=>e?n?r=>e(r)||n(r):e:n}))}});function Cpe(t){let e=[];if(t)e:for(let{name:n}of t){for(let r=0;ro.toLowerCase()==i.toLowerCase())){e.push(i);continue e}}e.push("")}return e}function Tpe(t,e,n){var r;let i=n?Cpe(e.actions):[];return Bn("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},Bn("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage():e.message),(r=e.actions)===null||r===void 0?void 0:r.map((o,a)=>{let s=!1,l=d=>{if(d.preventDefault(),s)return;s=!0;let h=uv(t.state.field(ga).diagnostics,e);h&&o.apply(t,h.from,h.to)},{name:c}=o,u=i[a]?c.indexOf(i[a]):-1,f=u<0?c:[c.slice(0,u),Bn("u",c.slice(u,u+1)),c.slice(u+1)];return Bn("button",{type:"button",class:"cm-diagnosticAction",onclick:l,onmousedown:l,"aria-label":` Action: ${c}${u<0?"":` (access key "${i[a]})"`}.`},f)}),e.source&&Bn("div",{class:"cm-diagnosticSource"},e.source))}class fpt extends sc{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return Bn("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class Oq{constructor(e,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=Tpe(e,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class F2{constructor(e){this.view=e,this.items=[];let n=i=>{if(i.keyCode==27)Sq(this.view),this.view.focus();else if(i.keyCode==38||i.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(i.keyCode==40||i.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(i.keyCode==36)this.moveSelection(0);else if(i.keyCode==35)this.moveSelection(this.items.length-1);else if(i.keyCode==13)this.view.focus();else if(i.keyCode>=65&&i.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:o}=this.items[this.selectedIndex],a=Cpe(o.actions);for(let s=0;s{for(let o=0;oSq(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(ga).selected;if(!e)return-1;for(let n=0;n{let c=-1,u;for(let f=r;fr&&(this.items.splice(r,c-r),i=!0)),n&&u.diagnostic==n.diagnostic?u.dom.hasAttribute("aria-selected")||(u.dom.setAttribute("aria-selected","true"),o=u):u.dom.hasAttribute("aria-selected")&&u.dom.removeAttribute("aria-selected"),r++});r({sel:o.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:a,panel:s})=>{let l=s.height/this.list.offsetHeight;a.tops.bottom&&(this.list.scrollTop+=(a.bottom-s.bottom)/l)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let e=this.list.firstChild;function n(){let r=e;e=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;e!=r.dom;)n();e=r.dom.nextSibling}else this.list.insertBefore(r.dom,e);for(;e;)n()}moveSelection(e){if(this.selectedIndex<0)return;let n=this.view.state.field(ga),r=uv(n.diagnostics,this.items[e].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:Spe.of(r)})}static open(e){return new F2(e)}}function dpt(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(t)}')`}function oO(t){return dpt(``,'width="6" height="3"')}const hpt=rt.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:oO("#d11")},".cm-lintRange-warning":{backgroundImage:oO("orange")},".cm-lintRange-info":{backgroundImage:oO("#999")},".cm-lintRange-hint":{backgroundImage:oO("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}}),ppt=[ga,rt.decorations.compute([ga],t=>{let{selected:e,panel:n}=t.field(ga);return!e||!n||e.from==e.to?yt.none:yt.set([opt.range(e.from,e.to)])}),iut(apt,{hideOn:rpt}),hpt];var Cq=function(e){e===void 0&&(e={});var{crosshairCursor:n=!1}=e,r=[];e.closeBracketsKeymap!==!1&&(r=r.concat(Xht)),e.defaultKeymap!==!1&&(r=r.concat(Adt)),e.searchKeymap!==!1&&(r=r.concat(nht)),e.historyKeymap!==!1&&(r=r.concat(Bft)),e.foldKeymap!==!1&&(r=r.concat(eft)),e.completionKeymap!==!1&&(r=r.concat(_pe)),e.lintKeymap!==!1&&(r=r.concat(upt));var i=[];return e.lineNumbers!==!1&&i.push(hut()),e.highlightActiveLineGutter!==!1&&i.push(gut()),e.highlightSpecialChars!==!1&&i.push(Ict()),e.history!==!1&&i.push(Aft()),e.foldGutter!==!1&&i.push(ift()),e.drawSelection!==!1&&i.push(wct()),e.dropCursor!==!1&&i.push(Ect()),e.allowMultipleSelections!==!1&&i.push(en.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&i.push(Gut()),e.syntaxHighlighting!==!1&&i.push(mhe(lft,{fallback:!0})),e.bracketMatching!==!1&&i.push(mft()),e.closeBrackets!==!1&&i.push(Vht()),e.autocompletion!==!1&&i.push(bpe()),e.rectangularSelection!==!1&&i.push(qct()),n!==!1&&i.push(Yct()),e.highlightActiveLine!==!1&&i.push(jct()),e.highlightSelectionMatches!==!1&&i.push(Ndt()),e.tabSize&&typeof e.tabSize=="number"&&i.push(dw.of(" ".repeat(e.tabSize))),i.concat([uw.of(r.flat())]).filter(Boolean)};const mpt="#e5c07b",Tq="#e06c75",gpt="#56b6c2",vpt="#ffffff",jC="#abb2bf",V3="#7d8799",ypt="#61afef",xpt="#98c379",Eq="#d19a66",bpt="#c678dd",_pt="#21252b",Pq="#2c313a",Mq="#282c34",YR="#353a42",wpt="#3E4451",kq="#528bff",Spt=rt.theme({"&":{color:jC,backgroundColor:Mq},".cm-content":{caretColor:kq},".cm-cursor, .cm-dropCursor":{borderLeftColor:kq},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:wpt},".cm-panels":{backgroundColor:_pt,color:jC},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:Mq,color:V3,border:"none"},".cm-activeLineGutter":{backgroundColor:Pq},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:YR},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:YR,borderBottomColor:YR},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Pq,color:jC}}},{dark:!0}),Opt=pw.define([{tag:Te.keyword,color:bpt},{tag:[Te.name,Te.deleted,Te.character,Te.propertyName,Te.macroName],color:Tq},{tag:[Te.function(Te.variableName),Te.labelName],color:ypt},{tag:[Te.color,Te.constant(Te.name),Te.standard(Te.name)],color:Eq},{tag:[Te.definition(Te.name),Te.separator],color:jC},{tag:[Te.typeName,Te.className,Te.number,Te.changed,Te.annotation,Te.modifier,Te.self,Te.namespace],color:mpt},{tag:[Te.operator,Te.operatorKeyword,Te.url,Te.escape,Te.regexp,Te.link,Te.special(Te.string)],color:gpt},{tag:[Te.meta,Te.comment],color:V3},{tag:Te.strong,fontWeight:"bold"},{tag:Te.emphasis,fontStyle:"italic"},{tag:Te.strikethrough,textDecoration:"line-through"},{tag:Te.link,color:V3,textDecoration:"underline"},{tag:Te.heading,fontWeight:"bold",color:Tq},{tag:[Te.atom,Te.bool,Te.special(Te.variableName)],color:Eq},{tag:[Te.processingInstruction,Te.string,Te.inserted],color:xpt},{tag:Te.invalid,color:vpt}]),Cpt=[Spt,mhe(Opt)];var Tpt=rt.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),Ept=function(e){e===void 0&&(e={});var{indentWithTab:n=!0,editable:r=!0,readOnly:i=!1,theme:o="light",placeholder:a="",basicSetup:s=!0}=e,l=[];switch(n&&l.unshift(uw.of([Rdt])),s&&(typeof s=="boolean"?l.unshift(Cq()):l.unshift(Cq(s))),a&&l.unshift(Wct(a)),o){case"light":l.push(Tpt);break;case"dark":l.push(Cpt);break;case"none":break;default:l.push(o);break}return r===!1&&l.push(rt.editable.of(!1)),i&&l.push(en.readOnly.of(!0)),[...l]},Ppt=t=>({line:t.state.doc.lineAt(t.state.selection.main.from),lineCount:t.state.doc.lines,lineBreak:t.state.lineBreak,length:t.state.doc.length,readOnly:t.state.readOnly,tabSize:t.state.tabSize,selection:t.state.selection,selectionAsSingle:t.state.selection.asSingle().main,ranges:t.state.selection.ranges,selectionCode:t.state.sliceDoc(t.state.selection.main.from,t.state.selection.main.to),selections:t.state.selection.ranges.map(e=>t.state.sliceDoc(e.from,e.to)),selectedText:t.state.selection.ranges.some(e=>!e.empty)}),Aq=oc.define(),Mpt=[];function kpt(t){var{value:e,selection:n,onChange:r,onStatistics:i,onCreateEditor:o,onUpdate:a,extensions:s=Mpt,autoFocus:l,theme:c="light",height:u=null,minHeight:f=null,maxHeight:d=null,width:h=null,minWidth:p=null,maxWidth:m=null,placeholder:g="",editable:v=!0,readOnly:y=!1,indentWithTab:x=!0,basicSetup:b=!0,root:_,initialState:S}=t,[O,C]=M.useState(),[E,k]=M.useState(),[I,P]=M.useState(),R=rt.theme({"&":{height:u,minHeight:f,maxHeight:d,width:h,minWidth:p,maxWidth:m},"& .cm-scroller":{height:"100% !important"}}),T=rt.updateListener.of(B=>{if(B.docChanged&&typeof r=="function"&&!B.transactions.some(N=>N.annotation(Aq))){var W=B.state.doc,U=W.toString();r(U,B)}i&&i(Ppt(B))}),L=Ept({theme:c,editable:v,readOnly:y,placeholder:g,indentWithTab:x,basicSetup:b}),z=[T,R,...L];return a&&typeof a=="function"&&z.push(rt.updateListener.of(a)),z=z.concat(s),M.useEffect(()=>{if(O&&!I){var B={doc:e,selection:n,extensions:z},W=S?en.fromJSON(S.json,B,S.fields):en.create(B);if(P(W),!E){var U=new rt({state:W,parent:O,root:_});k(U),o&&o(U,W)}}return()=>{E&&(P(void 0),k(void 0))}},[O,I]),M.useEffect(()=>C(t.container),[t.container]),M.useEffect(()=>()=>{E&&(E.destroy(),k(void 0))},[E]),M.useEffect(()=>{l&&E&&E.focus()},[l,E]),M.useEffect(()=>{E&&E.dispatch({effects:It.reconfigure.of(z)})},[c,s,u,f,d,h,p,m,g,v,y,x,b,r,a]),M.useEffect(()=>{if(e!==void 0){var B=E?E.state.doc.toString():"";E&&e!==B&&E.dispatch({changes:{from:0,to:B.length,insert:e||""},annotations:[Aq.of(!0)]})}},[e,E]),{state:I,setState:P,view:E,setView:k,container:O,setContainer:C}}var Apt=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],j2=M.forwardRef((t,e)=>{var{className:n,value:r="",selection:i,extensions:o=[],onChange:a,onStatistics:s,onCreateEditor:l,onUpdate:c,autoFocus:u,theme:f="light",height:d,minHeight:h,maxHeight:p,width:m,minWidth:g,maxWidth:v,basicSetup:y,placeholder:x,indentWithTab:b,editable:_,readOnly:S,root:O,initialState:C}=t,E=Ae(t,Apt),k=M.useRef(null),{state:I,view:P,container:R}=kpt({container:k.current,root:O,value:r,autoFocus:u,theme:f,height:d,minHeight:h,maxHeight:p,width:m,minWidth:g,maxWidth:v,basicSetup:y,placeholder:x,indentWithTab:b,editable:_,readOnly:S,selection:i,onChange:a,onStatistics:s,onCreateEditor:l,onUpdate:c,extensions:o,initialState:C});if(M.useImperativeHandle(e,()=>({editor:k.current,state:I,view:P}),[k,R,I,P]),typeof r!="string")throw new Error("value must be typeof string but got "+typeof r);var T=typeof f=="string"?"cm-theme-"+f:"cm-theme";return w.jsx("div",j({ref:k,className:""+T+(n?" "+n:"")},E))});j2.displayName="CodeMirror";var Rq={};let Rpt=class G3{constructor(e,n,r,i,o,a,s,l,c,u=0,f){this.p=e,this.stack=n,this.state=r,this.reducePos=i,this.pos=o,this.score=a,this.buffer=s,this.bufferBase=l,this.curContext=c,this.lookAhead=u,this.parent=f}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,r=0){let i=e.parser.context;return new G3(e,[],n,r,r,0,[],0,i?new Iq(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var n;let r=e>>19,i=e&65535,{parser:o}=this.p,a=o.dynamicPrecedence(i);if(a&&(this.score+=a),r==0){this.pushState(o.getGoto(this.state,i,!0),this.reducePos),i=2e3&&!(!((n=this.p.parser.nodeSet.types[i])===null||n===void 0)&&n.isAnonymous)&&(l==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSizes;)this.stack.pop();this.reduceContext(i,l)}storeNode(e,n,r,i=4,o=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&a.buffer[s-4]==0&&a.buffer[s-1]>-1){if(n==r)return;if(a.buffer[s-2]>=n){a.buffer[s-2]=r;return}}}if(!o||this.pos==r)this.buffer.push(e,n,r,i);else{let a=this.buffer.length;if(a>0&&this.buffer[a-4]!=0)for(;a>0&&this.buffer[a-2]>r;)this.buffer[a]=this.buffer[a-4],this.buffer[a+1]=this.buffer[a-3],this.buffer[a+2]=this.buffer[a-2],this.buffer[a+3]=this.buffer[a-1],a-=4,i>4&&(i-=4);this.buffer[a]=e,this.buffer[a+1]=n,this.buffer[a+2]=r,this.buffer[a+3]=i}}shift(e,n,r,i){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=i,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,i,4);else{let o=e,{parser:a}=this.p;(i>this.pos||n<=a.maxNode)&&(this.pos=i,a.stateFlag(o,1)||(this.reducePos=i)),this.pushState(o,r),this.shiftContext(n,r),n<=a.maxNode&&this.buffer.push(n,r,i,4)}}apply(e,n,r,i){e&65536?this.reduce(e):this.shift(e,n,r,i)}useNode(e,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(n,i),this.buffer.push(r,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,n=e.buffer.length;for(;n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let r=e.buffer.slice(n),i=e.bufferBase+n;for(;e&&i==e.bufferBase;)e=e.parent;return new G3(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new Ipt(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(r==0)return!1;if(!(r&65536))return!0;n.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let i=[];for(let o=0,a;ol&1&&s==a)||i.push(n[o],a)}n=i}let r=[];for(let i=0;i>19,i=n&65535,o=this.stack.length-r*3;if(o<0||e.getGoto(this.stack[o],i,!1)<0){let a=this.findForcedReduction();if(a==null)return!1;n=a}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:e}=this.p,n=[],r=(i,o)=>{if(!n.includes(i))return n.push(i),e.allActions(i,a=>{if(!(a&393216))if(a&65536){let s=(a>>19)-o;if(s>1){let l=a&65535,c=this.stack.length-s*3;if(c>=0&&e.getGoto(this.stack[c],l,!1)>=0)return s<<19|65536|l}}else{let s=r(a,o+1);if(s!=null)return s}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let n=0;nthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}};class Iq{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class Ipt{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=i}}class ME{constructor(e,n,r){this.stack=e,this.pos=n,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new ME(e,n,n-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new ME(this.stack,this.pos,this.index)}}function aO(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let r=0,i=0;r=92&&a--,a>=34&&a--;let l=a-32;if(l>=46&&(l-=46,s=!0),o+=l,s)break;o*=46}n?n[i++]=o:n=new e(o)}return n}class BC{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Dq=new BC;class Dpt{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Dq,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(e,n){let r=this.range,i=this.rangeIndex,o=this.pos+e;for(;or.to:o>=r.to;){if(i==this.ranges.length-1)return null;let a=this.ranges[++i];o+=a.from-r.to,r=a}return o}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,r,i;if(n>=0&&n=this.chunk2Pos&&rs.to&&(this.chunk2=this.chunk2.slice(0,s.to-r)),i=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),i}acceptToken(e,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,n){if(n?(this.token=n,n.start=e,n.lookAhead=e+1,n.value=n.extended=-1):this.token=Dq,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,n-this.chunkPos);if(e>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,n-this.chunk2Pos);if(e>=this.range.from&&n<=this.range.to)return this.input.read(e,n);let r="";for(let i of this.ranges){if(i.from>=n)break;i.to>e&&(r+=this.input.read(Math.max(i.from,e),Math.min(i.to,n)))}return r}}class kg{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:r}=n.p;Lpt(this.data,e,n,this.id,r.data,r.tokenPrecTable)}}kg.prototype.contextual=kg.prototype.fallback=kg.prototype.extend=!1;kg.prototype.fallback=kg.prototype.extend=!1;class B2{constructor(e,n={}){this.token=e,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function Lpt(t,e,n,r,i,o){let a=0,s=1<0){let p=t[h];if(l.allows(p)&&(e.token.value==-1||e.token.value==p||$pt(p,e.token.value,i,o))){e.acceptToken(p);break}}let u=e.next,f=0,d=t[a+2];if(e.next<0&&d>f&&t[c+d*3-3]==65535){a=t[c+d*3-1];continue e}for(;f>1,p=c+h+(h<<1),m=t[p],g=t[p+1]||65536;if(u=g)f=h+1;else{a=t[p+2],e.advance();continue e}}break}}function Lq(t,e,n){for(let r=e,i;(i=t[r])!=65535;r++)if(i==n)return r-e;return-1}function $pt(t,e,n,r){let i=Lq(n,r,e);return i<0||Lq(n,r,t)e)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(t.length,Math.max(r.from+1,e+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:t.length}}class Npt{constructor(e,n){this.fragments=e,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?$q(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?$q(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=a,null;if(o instanceof zr){if(a==e){if(a=Math.max(this.safeFrom,e)&&(this.trees.push(o),this.start.push(a),this.index.push(0))}else this.index[n]++,this.nextStart=a+o.length}}}class Fpt{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new BC)}getActions(e){let n=0,r=null,{parser:i}=e.p,{tokenizers:o}=i,a=i.stateSlot(e.state,3),s=e.curContext?e.curContext.hash:0,l=0;for(let c=0;cf.end+25&&(l=Math.max(f.lookAhead,l)),f.value!=0)){let d=n;if(f.extended>-1&&(n=this.addActions(e,f.extended,f.end,n)),n=this.addActions(e,f.value,f.end,n),!u.extend&&(r=f,n>d))break}}for(;this.actions.length>n;)this.actions.pop();return l&&e.setLookAhead(l),!r&&e.pos==this.stream.end&&(r=new BC,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,n=this.addActions(e,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new BC,{pos:r,p:i}=e;return n.start=r,n.end=Math.min(r+1,i.stream.end),n.value=r==i.stream.end?i.parser.eofTerm:0,n}updateCachedToken(e,n,r){let i=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(i,e),r),e.value>-1){let{parser:o}=r.p;for(let a=0;a=0&&r.p.parser.dialect.allows(s>>1)){s&1?e.extended=s>>1:e.value=s>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,n,r,i){for(let o=0;oe.bufferLength*4?new Npt(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,r=this.stacks=[],i,o;if(this.bigReductionCount>300&&e.length==1){let[a]=e;for(;a.forceReduce()&&a.stack.length&&a.stack[a.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;an)r.push(s);else{if(this.advanceStack(s,r,e))continue;{i||(i=[],o=[]),i.push(s);let l=this.tokens.getMainToken(s);o.push(l.value,l.end)}}break}}if(!r.length){let a=i&&Upt(i);if(a)return Yo&&console.log("Finish with "+this.stackID(a)),this.stackToTree(a);if(this.parser.strict)throw Yo&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&i){let a=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,o,r);if(a)return Yo&&console.log("Force-finish "+this.stackID(a)),this.stackToTree(a.forceAll())}if(this.recovering){let a=this.recovering==1?1:this.recovering*3;if(r.length>a)for(r.sort((s,l)=>l.score-s.score);r.length>a;)r.pop();r.some(s=>s.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let a=0;a500&&c.buffer.length>500)if((s.score-c.score||s.buffer.length-c.buffer.length)>0)r.splice(l--,1);else{r.splice(a--,1);continue e}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let a=1;a ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,u=c?e.curContext.hash:0;for(let f=this.fragments.nodeAt(i);f;){let d=this.parser.nodeSet.types[f.type.id]==f.type?o.getGoto(e.state,f.type.id):-1;if(d>-1&&f.length&&(!c||(f.prop(Wt.contextHash)||0)==u))return e.useNode(f,d),Yo&&console.log(a+this.stackID(e)+` (via reuse of ${o.getName(f.type.id)})`),!0;if(!(f instanceof zr)||f.children.length==0||f.positions[0]>0)break;let h=f.children[0];if(h instanceof zr&&f.positions[0]==0)f=h;else break}}let s=o.stateSlot(e.state,4);if(s>0)return e.reduce(s),Yo&&console.log(a+this.stackID(e)+` (via always-reduce ${o.getName(s&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let c=0;ci?n.push(p):r.push(p)}return!1}advanceFully(e,n){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return Nq(e,n),!0}}runRecovery(e,n,r){let i=null,o=!1;for(let a=0;a ":"";if(s.deadEnd&&(o||(o=!0,s.restart(),Yo&&console.log(u+this.stackID(s)+" (restarted)"),this.advanceFully(s,r))))continue;let f=s.split(),d=u;for(let h=0;f.forceReduce()&&h<10&&(Yo&&console.log(d+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,r));h++)Yo&&(d=this.stackID(f)+" -> ");for(let h of s.recoverByInsert(l))Yo&&console.log(u+this.stackID(h)+" (via recover-insert)"),this.advanceFully(h,r);this.stream.end>s.pos?(c==s.pos&&(c++,l=0),s.recoverByDelete(l,c),Yo&&console.log(u+this.stackID(s)+` (via recover-delete ${this.parser.getName(l)})`),Nq(s,r)):(!i||i.scoret;class zpt{constructor(e){this.start=e.start,this.shift=e.shift||ZR,this.reduce=e.reduce||ZR,this.reuse=e.reuse||ZR,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class f_ extends ehe{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let n=e.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let s=0;se.topRules[s][1]),i=[];for(let s=0;s=0)o(u,l,s[c++]);else{let f=s[c+-u];for(let d=-u;d>0;d--)o(s[c++],l,f);c++}}}this.nodeSet=new m4(n.map((s,l)=>Wo.define({name:l>=this.minRepeatTerm?void 0:s,id:l,props:i[l],top:r.indexOf(l)>-1,error:l==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(l)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Yde;let a=aO(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let s=0;stypeof s=="number"?new kg(a,s):s),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,n,r){let i=new jpt(this,e,n,r);for(let o of this.wrappers)i=o(i,e,n,r);return i}getGoto(e,n,r=!1){let i=this.goto;if(n>=i[0])return-1;for(let o=i[n+1];;){let a=i[o++],s=a&1,l=i[o++];if(s&&r)return l;for(let c=o+(a>>1);o0}validAction(e,n){return!!this.allActions(e,r=>r==n?!0:null)}allActions(e,n){let r=this.stateSlot(e,4),i=r?n(r):void 0;for(let o=this.stateSlot(e,1);i==null;o+=3){if(this.data[o]==65535)if(this.data[o+1]==1)o=Dc(this.data,o+2);else break;i=n(Dc(this.data,o+1))}return i}nextStates(e){let n=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=Dc(this.data,r+2);else break;if(!(this.data[r+2]&1)){let i=this.data[r+1];n.some((o,a)=>a&1&&o==i)||n.push(this.data[r],i)}}return n}configure(e){let n=Object.assign(Object.create(f_.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=r}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let i=e.tokenizers.find(o=>o.from==r);return i?i.to:r})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,i)=>{let o=e.specializers.find(s=>s.from==r.external);if(!o)return r;let a=Object.assign(Object.assign({},r),{external:o.to});return n.specializers[i]=Fq(a),a})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let n=this.dynamicPrecedences;return n==null?0:n[e]||0}parseDialect(e){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(e)for(let o of e.split(" ")){let a=n.indexOf(o);a>=0&&(r[a]=!0)}let i=null;for(let o=0;or)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.scoret.external(n,r)<<1|e}return t.get}const Wpt=x4({String:Te.string,Number:Te.number,"True False":Te.bool,PropertyName:Te.propertyName,Null:Te.null,",":Te.separator,"[ ]":Te.squareBracket,"{ }":Te.brace}),Vpt=f_.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[Wpt],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zOh~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yOg~~'OO]~~'TO[~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),Gpt=o_.define({name:"json",parser:Vpt.configure({props:[_4.add({Object:Z7({except:/^\s*\}/}),Array:Z7({except:/^\s*\]/})}),S4.add({"Object Array":she})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function Epe(){return new ihe(Gpt)}const Hpt=1,Ppe=194,Mpe=195,qpt=196,jq=197,Xpt=198,Qpt=199,Ypt=200,Kpt=2,kpe=3,Bq=201,Zpt=24,Jpt=25,emt=49,tmt=50,nmt=55,rmt=56,imt=57,omt=59,amt=60,smt=61,lmt=62,cmt=63,umt=65,fmt=238,dmt=71,hmt=241,pmt=242,mmt=243,gmt=244,vmt=245,ymt=246,xmt=247,bmt=248,Ape=72,_mt=249,wmt=250,Smt=251,Omt=252,Cmt=253,Tmt=254,Emt=255,Pmt=256,Mmt=73,kmt=77,Amt=264,Rmt=112,Imt=130,Dmt=151,Lmt=152,$mt=155,op=10,d_=13,j4=32,z2=9,B4=35,Nmt=40,Fmt=46,H3=123,zq=125,Rpe=39,Ipe=34,jmt=92,Bmt=111,zmt=120,Umt=78,Wmt=117,Vmt=85,Gmt=new Set([Jpt,emt,tmt,Amt,umt,Imt,rmt,imt,fmt,lmt,cmt,Ape,Mmt,kmt,amt,smt,Dmt,Lmt,$mt,Rmt]);function JR(t){return t==op||t==d_}function eI(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}const Hmt=new B2((t,e)=>{let n;if(t.next<0)t.acceptToken(Qpt);else if(e.context.flags&zC)JR(t.next)&&t.acceptToken(Xpt,1);else if(((n=t.peek(-1))<0||JR(n))&&e.canShift(jq)){let r=0;for(;t.next==j4||t.next==z2;)t.advance(),r++;(t.next==op||t.next==d_||t.next==B4)&&t.acceptToken(jq,-r)}else JR(t.next)&&t.acceptToken(qpt,1)},{contextual:!0}),qmt=new B2((t,e)=>{let n=e.context;if(n.flags)return;let r=t.peek(-1);if(r==op||r==d_){let i=0,o=0;for(;;){if(t.next==j4)i++;else if(t.next==z2)i+=8-i%8;else break;t.advance(),o++}i!=n.indent&&t.next!=op&&t.next!=d_&&t.next!=B4&&(i[t,e|Dpe])),Ymt=new zpt({start:Xmt,reduce(t,e,n,r){return t.flags&zC&&Gmt.has(e)||(e==dmt||e==Ape)&&t.flags&Dpe?t.parent:t},shift(t,e,n,r){return e==Ppe?new UC(t,Qmt(r.read(r.pos,n.pos)),0):e==Mpe?t.parent:e==Zpt||e==nmt||e==omt||e==kpe?new UC(t,0,zC):Uq.has(e)?new UC(t,0,Uq.get(e)|t.flags&zC):t},hash(t){return t.hash}}),Kmt=new B2(t=>{for(let e=0;e<5;e++){if(t.next!="print".charCodeAt(e))return;t.advance()}if(!/\w/.test(String.fromCharCode(t.next)))for(let e=0;;e++){let n=t.peek(e);if(!(n==j4||n==z2)){n!=Nmt&&n!=Fmt&&n!=op&&n!=d_&&n!=B4&&t.acceptToken(Hpt);return}}}),Zmt=new B2((t,e)=>{let{flags:n}=e.context,r=n&Oc?Ipe:Rpe,i=(n&Cc)>0,o=!(n&Tc),a=(n&Ec)>0,s=t.pos;for(;!(t.next<0);)if(a&&t.next==H3)if(t.peek(1)==H3)t.advance(2);else{if(t.pos==s){t.acceptToken(kpe,1);return}break}else if(o&&t.next==jmt){if(t.pos==s){t.advance();let l=t.next;l>=0&&(t.advance(),Jmt(t,l)),t.acceptToken(Kpt);return}break}else if(t.next==r&&(!i||t.peek(1)==r&&t.peek(2)==r)){if(t.pos==s){t.acceptToken(Bq,i?3:1);return}break}else if(t.next==op){if(i)t.advance();else if(t.pos==s){t.acceptToken(Bq);return}break}else t.advance();t.pos>s&&t.acceptToken(Ypt)});function Jmt(t,e){if(e==Bmt)for(let n=0;n<2&&t.next>=48&&t.next<=55;n++)t.advance();else if(e==zmt)for(let n=0;n<2&&eI(t.next);n++)t.advance();else if(e==Wmt)for(let n=0;n<4&&eI(t.next);n++)t.advance();else if(e==Vmt)for(let n=0;n<8&&eI(t.next);n++)t.advance();else if(e==Umt&&t.next==H3){for(t.advance();t.next>=0&&t.next!=zq&&t.next!=Rpe&&t.next!=Ipe&&t.next!=op;)t.advance();t.next==zq&&t.advance()}}const egt=x4({'async "*" "**" FormatConversion FormatSpec':Te.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":Te.controlKeyword,"in not and or is del":Te.operatorKeyword,"from def class global nonlocal lambda":Te.definitionKeyword,import:Te.moduleKeyword,"with as print":Te.keyword,Boolean:Te.bool,None:Te.null,VariableName:Te.variableName,"CallExpression/VariableName":Te.function(Te.variableName),"FunctionDefinition/VariableName":Te.function(Te.definition(Te.variableName)),"ClassDefinition/VariableName":Te.definition(Te.className),PropertyName:Te.propertyName,"CallExpression/MemberExpression/PropertyName":Te.function(Te.propertyName),Comment:Te.lineComment,Number:Te.number,String:Te.string,FormatString:Te.special(Te.string),Escape:Te.escape,UpdateOp:Te.updateOperator,"ArithOp!":Te.arithmeticOperator,BitOp:Te.bitwiseOperator,CompareOp:Te.compareOperator,AssignOp:Te.definitionOperator,Ellipsis:Te.punctuation,At:Te.meta,"( )":Te.paren,"[ ]":Te.squareBracket,"{ }":Te.brace,".":Te.derefOperator,", ;":Te.separator}),tgt={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285},ngt=f_.deserialize({version:14,states:"##pO`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E[OOQS'#E^'#E^O2wQdO'#E`O3_QdO'#EdO1XQdO'#EfO3rQtO'#EfO1XQdO'#EiO0rQdO'#ElO1XQdO'#EnO0rQdO'#EtO0rQdO'#EwO3}QdO'#EyO4UQdO'#FOO4aQdO'#EzO0rQdO'#FOO1XQdO'#FQO1XQdO'#FVO4fQdO'#F[P4mOdO'#GpPOOO)CBd)CBdOOQS'#Ce'#CeOOQS'#Cf'#CfOOQS'#Cg'#CgOOQS'#Ch'#ChOOQS'#Ci'#CiOOQS'#Cj'#CjOOQS'#Cl'#ClO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO4xQdO'#DoOOQS,5:Y,5:YO5]QdO'#HdOOQS,5:],5:]O5jQ!fO,5:]O5oQtO,59YO1lQdO,59bO1lQdO,59bO1lQdO,59bO8_QdO,59bO8dQdO,59bO8kQdO,59jO8rQdO'#HTO9xQdO'#HSOOQS'#HS'#HSOOQS'#D['#D[O:aQdO,59aO'vQdO,59aO:oQdO,59aOOQS,59y,59yO:tQdO,5:RO'vQdO,5:ROOQS,5:Q,5:QO;SQdO,5:QO;XQdO,5:XO'vQdO,5:XO'vQdO,5:VOOQS,5:U,5:UO;jQdO,5:UO;oQdO,5:WOOOW'#Fy'#FyO;tOWO,5:aOOQS,5:a,5:aOOOOQS'#Ds'#DsOOQS1G/w1G/wOOQS1G.|1G.|O!.mQtO1G.|O!.tQtO1G.|O1lQdO1G.|O!/aQdO1G/UOOQS'#DZ'#DZO0rQdO,59tOOQS1G.{1G.{O!/hQdO1G/eO!/xQdO1G/eO!0QQdO1G/fO'vQdO'#H[O!0VQdO'#H[O!0[QtO1G.{O!0lQdO,59iO!1rQdO,5=zO!2SQdO,5=zO!2[QdO1G/mO!2aQtO1G/mOOQS1G/l1G/lO!2qQdO,5=uO!3hQdO,5=uO0rQdO1G/qO!4VQdO1G/sO!4[QtO1G/sO!4lQtO1G/qOOQS1G/p1G/pOOQS1G/r1G/rOOOW-E9w-E9wOOQS1G/{1G/{O!4|QdO'#HxO0rQdO'#HxO!5_QdO,5>cOOOW-E9x-E9xOOQS1G/|1G/|OOQS-E9{-E9{O!5mQ#xO1G2zO!6^QtO1G2zO'vQdO,5iOOQS1G1`1G1`O!7^QdO1G1`OOQS'#DV'#DVO0rQdO,5=qOOQS,5=q,5=qO!7cQdO'#FrO!7nQdO,59oO!7vQdO1G/XO!8QQtO,5=uOOQS1G3`1G3`OOQS,5:m,5:mO!8qQdO'#GtOOQS,5lO!:sQdO,5>lO!;RQdO,5>hO!;iQdO,5>hO!;zQdO'#EpO0rQdO1G0tO!oO!D_QdO,5>oO!DgQtO,5>oO0rQdO1G1PO!DqQdO1G1PO4aQdO1G1UO!!_QdO1G1WOOQV,5;a,5;aO!DvQfO,5;aO!D{QgO1G1QO!H|QdO'#GZO4aQdO1G1QO4aQdO1G1QO!I^QdO,5>pO!IkQdO,5>pO1XQdO,5>pOOQV1G1U1G1UO!IsQdO'#FSO!JUQ!fO1G1WO!J^QdO1G1WOOQV1G1]1G1]O4aQdO1G1]O!JcQdO1G1]O!JkQdO'#F^OOQV1G1b1G1bO!!rQtO1G1bPOOO1G2v1G2vP!JpOSO1G2vOOQS,5=},5=}OOQS'#Dp'#DpO0rQdO,5=}O!JuQdO,5=|O!KYQdO,5=|OOQS1G/u1G/uO!KbQdO,5>PO!KrQdO,5>PO!KzQdO,5>PO!L_QdO,5>PO!LoQdO,5>POOQS1G3j1G3jOOQS7+$h7+$hO!7vQdO7+$pO!NbQdO1G.|O!NiQdO1G.|OOQS1G/`1G/`OOQS,5<`,5<`O'vQdO,5<`OOQS7+%P7+%PO!NpQdO7+%POOQS-E9r-E9rOOQS7+%Q7+%QO# QQdO,5=vO'vQdO,5=vOOQS7+$g7+$gO# VQdO7+%PO# _QdO7+%QO# dQdO1G3fOOQS7+%X7+%XO# tQdO1G3fO# |QdO7+%XOOQS,5<_,5<_O'vQdO,5<_O#!RQdO1G3aOOQS-E9q-E9qO#!xQdO7+%]OOQS7+%_7+%_O##WQdO1G3aO##uQdO7+%_O##zQdO1G3gO#$[QdO1G3gO#$dQdO7+%]O#$iQdO,5>dO#%SQdO,5>dO#%SQdO,5>dOOQS'#Dx'#DxO#%eO&jO'#DzO#%pO`O'#HyOOOW1G3}1G3}O#%uQdO1G3}O#%}QdO1G3}O#&YQ#xO7+(fO#&yQtO1G2UP#'dQdO'#GOOOQS,5e,5>eOOOW7+)i7+)iO#=gQdO7+)iO#=oQdO1G2zO#>YQdO1G2zP'vQdO'#FuO0rQdO<kQdO,5>kO#>|QdO,5>kO1XQdO,5>kO#?_QdO,5>jOOQS<mO#?rQdO,5>mOOQS1G0v1G0vOOQS<rO#IXQdO,5>rOOQS,5>r,5>rO#IdQdO,5>qO#IuQdO,5>qOOQS1G1Y1G1YOOQS,5;p,5;pOOQV<VAN>VO#MUQdO<cAN>cO0rQdO1G1|O#MfQtO1G1|P#MpQdO'#FvOOQS1G2R1G2RP#M}QdO'#F{O#N[QdO7+)jO#NuQdO,5>gOOOO-E9z-E9zOOOW<tO$4^QdO,5>tO1XQdO,5vO$'zQdO,5>vOOQS1G1p1G1pO$8UQtO,5<[OOQU7+'P7+'PO$*WQdO1G/iO$'zQdO,5wO$8dQdO,5>wOOQS1G1s1G1sOOQS7+'S7+'SP$'zQdO'#GdO$8lQdO1G4bO$8vQdO1G4bO$9OQdO1G4bOOQS7+%T7+%TO$9^QdO1G1tO$9lQtO'#FaO$9sQdO,5<}OOQS,5<},5<}O$:RQdO1G4cOOQS-E:a-E:aO$'zQdO,5<|O$:YQdO,5<|O$:_QdO7+)|OOQS-E:`-E:`O$:iQdO7+)|O$'zQdO,5PPP>S>t>wPP'Z'ZPP?WPP'Z'ZPP'Z'Z'Z'Z'Z?[@U'ZP@XP@_DfHSHWPHZHeHi'ZPPPHlHu'RP'R'RP'RP'RP'RP'RP'R'R'RP'RPP'RPP'RP'RPH{IXIaPIhInPIhPIhIhPPPIhPK|PLVLaLgK|PIhLpPIhPLwL}PMRMgNUNoMRMRNu! SMRMRMRMR! h! n! q! v! y!!T!!Z!!g!!y!#P!#Z!#a!#}!$T!$Z!$e!$k!$q!%T!%_!%e!%k!%q!%{!&R!&X!&_!&e!&o!&u!'P!'V!'`!'f!'u!'}!(X!(`PPPPPPPPPPP!(f!(i!(o!(x!)S!)_PPPPPPPPPPPP!.R!/g!3g!6wPP!7P!7`!7i!8b!8X!8k!8q!8t!8w!8z!9S!9sPPPPPPPPPPPPPPPPP!9v!9z!:QP!:f!:j!:v!;S!;Y!;c!;f!;i!;o!;u!;{!_![!]Do!]!^Es!^!_FZ!_!`Gk!`!aHX!a!b%T!b!cIf!c!dJU!d!eK^!e!hJU!h!i!#f!i!tJU!t!u!,|!u!wJU!w!x!.t!x!}JU!}#O!0S#O#P&o#P#Q!0j#Q#R!1Q#R#SJU#S#T%T#T#UJU#U#VK^#V#YJU#Y#Z!#f#Z#fJU#f#g!,|#g#iJU#i#j!.t#j#oJU#o#p!1n#p#q!1s#q#r!2a#r#s!2f#s$g%T$g;'SJU;'S;=`KW<%lOJU`%YT&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T`%lP;=`<%l%To%v]&n`%c_OX%TXY%oY[%T[]%o]p%Tpq%oq#O%T#O#P&o#P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To&tX&n`OY%TYZ%oZ]%T]^%o^#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc'f[&n`O!_%T!_!`([!`#T%T#T#U(r#U#f%T#f#g(r#g#h(r#h#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(cTmR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(yT!mR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk)aV&n`&[ZOr%Trs)vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk){V&n`Or%Trs*bs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk*iT&n`&^ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To+PZS_&n`OY*xYZ%TZ]*x]^%T^#o*x#o#p+r#p#q*x#q#r+r#r;'S*x;'S;=`,^<%lO*x_+wTS_OY+rZ]+r^;'S+r;'S;=`,W<%lO+r_,ZP;=`<%l+ro,aP;=`<%l*xj,kV%rQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-XT!xY&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-oV%lQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.]V&n`&ZZOw%Twx.rx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.wV&n`Ow%Twx/^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/eT&n`&]ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/{ThZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc0cTgR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk0yXVZ&n`Oz%Tz{1f{!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk1mVaR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk2ZV%oZ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc2wTzR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To3_W%pZ&n`O!_%T!_!`-Q!`!a3w!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Td4OT&{S&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk4fX!fQ&n`O!O%T!O!P5R!P!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5WV&n`O!O%T!O!P5m!P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5tT!rZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti6[a!hX&n`O!Q%T!Q![6T![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S6T#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti7fZ&n`O{%T{|8X|}%T}!O8X!O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8^V&n`O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8z]!hX&n`O!Q%T!Q![8s![!l%T!l!m9s!m#R%T#R#S8s#S#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti9zT!hX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk:bX%qR&n`O!P%T!P!Q:}!Q!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj;UV%sQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti;ro!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!d%T!d!e?q!e!g%T!g!h7a!h!l%T!l!m9s!m!q%T!q!rA]!r!z%T!z!{Bq!{#R%T#R#S>_#S#U%T#U#V?q#V#X%T#X#Y7a#Y#^%T#^#_9s#_#c%T#c#dA]#d#l%T#l#mBq#m#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti=xV&n`O!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti>fc!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S>_#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti?vY&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti@mY!hX&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiAbX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBUX!hX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBv]&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiCv]!hX&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToDvV{_&n`O!_%T!_!`E]!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TcEdT%{R&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkEzT#gZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkFbXmR&n`O!^%T!^!_F}!_!`([!`!a([!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjGUV%mQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkGrV%zZ&n`O!_%T!_!`([!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkH`WmR&n`O!_%T!_!`([!`!aHx!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjIPV%nQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkIoV_Q#}P&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToJ_]&n`&YS%uZO!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoKZP;=`<%lJUoKge&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!tJU!t!uLx!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#gLx#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoMRa&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUkN_V&n`&`ZOr%TrsNts#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkNyV&n`Or%Trs! `s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! gT&n`&bZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! }V&n`&_ZOw%Twx!!dx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!!iV&n`Ow%Twx!#Ox#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!#VT&n`&aZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!#oe&n`&YS%uZOr%Trs!%Qsw%Twx!&px!Q%T!Q![JU![!c%T!c!tJU!t!u!(`!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#g!(`#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!%XV&n`&dZOr%Trs!%ns#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!%sV&n`Or%Trs!&Ys#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&aT&n`&fZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&wV&n`&cZOw%Twx!'^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!'cV&n`Ow%Twx!'xx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!(PT&n`&eZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!(ia&n`&YS%uZOr%Trs!)nsw%Twx!+^x!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!)uV&n`&hZOr%Trs!*[s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*aV&n`Or%Trs!*vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*}T&n`&jZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!+eV&n`&gZOw%Twx!+zx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,PV&n`Ow%Twx!,fx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,mT&n`&iZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!-Vi&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!dJU!d!eLx!e!hJU!h!i!(`!i!}JU!}#R%T#R#SJU#S#T%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[Kmt,qmt,Hmt,Zmt,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:t=>tgt[t]||-1}],tokenPrec:7646}),Wq=new Sut,Lpe=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function sO(t){return(e,n,r)=>{if(r)return!1;let i=e.node.getChild("VariableName");return i&&n(i,t),!0}}const rgt={FunctionDefinition:sO("function"),ClassDefinition:sO("class"),ForStatement(t,e,n){if(n){for(let r=t.node.firstChild;r;r=r.nextSibling)if(r.name=="VariableName")e(r,"variable");else if(r.name=="in")break}},ImportStatement(t,e){var n,r;let{node:i}=t,o=((n=i.firstChild)===null||n===void 0?void 0:n.name)=="from";for(let a=i.getChild("import");a;a=a.nextSibling)a.name=="VariableName"&&((r=a.nextSibling)===null||r===void 0?void 0:r.name)!="as"&&e(a,o?"variable":"namespace")},AssignStatement(t,e){for(let n=t.node.firstChild;n;n=n.nextSibling)if(n.name=="VariableName")e(n,"variable");else if(n.name==":"||n.name=="AssignOp")break},ParamList(t,e){for(let n=null,r=t.node.firstChild;r;r=r.nextSibling)r.name=="VariableName"&&(!n||!/\*|AssignOp/.test(n.name))&&e(r,"variable"),n=r},CapturePattern:sO("variable"),AsPattern:sO("variable"),__proto__:null};function $pe(t,e){let n=Wq.get(e);if(n)return n;let r=[],i=!0;function o(a,s){let l=t.sliceString(a.from,a.to);r.push({label:l,type:s})}return e.cursor(Zr.IncludeAnonymous).iterate(a=>{if(a.name){let s=rgt[a.name];if(s&&s(a,o,i)||!i&&Lpe.has(a.name))return!1;i=!1}else if(a.to-a.from>8192){for(let s of $pe(t,a.node))r.push(s);return!1}}),Wq.set(e,r),r}const Vq=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,Npe=["String","FormatString","Comment","PropertyName"];function igt(t){let e=ui(t.state).resolveInner(t.pos,-1);if(Npe.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&Vq.test(t.state.sliceDoc(e.from,e.to));if(!n&&!t.explicit)return null;let r=[];for(let i=e;i;i=i.parent)Lpe.has(i.name)&&(r=r.concat($pe(t.state.doc,i)));return{options:r,from:n?e.from:t.pos,validFor:Vq}}const ogt=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(t=>({label:t,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(t=>({label:t,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(t=>({label:t,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(t=>({label:t,type:"function"}))),agt=[mc("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),mc("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),mc("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),mc("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),mc(`if \${}: -`,{label:"if",detail:"block",type:"keyword"}),mc("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),mc("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),mc("import ${module}",{label:"import",detail:"statement",type:"keyword"}),mc("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],ogt=oht($pe,lpe(rgt.concat(igt)));function Wq(t,e){let n=t.baseIndentFor(e),r=t.lineAt(t.pos,-1),i=r.from+r.text.length;return/^\s*($|#)/.test(r.text)&&t.node.ton?null:n+t.unit}const eI=o_.define({name:"python",parser:egt.configure({props:[b4.add({Body:t=>{var e;return(e=Wq(t,t.node))!==null&&e!==void 0?e:t.continue()},IfStatement:t=>/^\s*(else:|elif )/.test(t.textAfter)?t.baseIndent:t.continue(),"ForStatement WhileStatement":t=>/^\s*else:/.test(t.textAfter)?t.baseIndent:t.continue(),TryStatement:t=>/^\s*(except |finally:|else:)/.test(t.textAfter)?t.baseIndent:t.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":BR({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":BR({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":BR({closing:"]"}),"String FormatString":()=>null,Script:t=>{if(t.pos+/\s*/.exec(t.textAfter)[0].length>=t.node.to){let e=null;for(let n=t.node,r=n.to;n=n.lastChild,!(!n||n.to!=r);)n.type.name=="Body"&&(e=n);if(e){let n=Wq(t,e);if(n!=null)return n}}return t.continue()}}),w4.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":ahe,Body:(t,e)=>({from:t.from+1,to:t.to-(t.to==e.doc.length?0:1)})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:)$/}});function agt(){return new rhe(eI,[eI.data.of({autocomplete:ngt}),eI.data.of({autocomplete:ogt})])}const sgt=""+new URL("python-bw-BV0FRHt1.png",import.meta.url).href,fv={card:t=>({maxWidth:"100%",marginBottom:t.spacing(1),marginRight:t.spacing(1)}),info:t=>({marginRight:t.spacing(1)}),close:{marginLeft:"auto"},table:{},keyValueTableContainer:t=>({background:t.palette.divider}),variableHtmlReprContainer:t=>({background:t.palette.divider,padding:t.spacing(1),marginTop:t.spacing(1),marginBottom:t.spacing(1)}),media:{height:200},cardContent:{padding:"8px"},code:{fontFamily:"Monospace"}},lgt=({visibleInfoCardElements:t,setVisibleInfoCardElements:e,infoCardElementViewModes:n,updateInfoCardElementViewMode:r,selectedDataset:i,selectedVariable:o,selectedPlaceInfo:a,selectedTime:s,serverConfig:l,allowViewModePython:c})=>{const u=(p,m)=>{e(m)};let f,d,h;if(i){const p="dataset",m=n[p],g=y=>r(p,y),v=t.includes(p);f=w.jsx(cgt,{isIn:v,viewMode:m,setViewMode:g,dataset:i,serverConfig:l,hasPython:c})}if(i&&o){const p="variable",m=n[p],g=y=>r(p,y),v=t.includes(p);d=w.jsx(ugt,{isIn:v,viewMode:m,setViewMode:g,variable:o,time:s,serverConfig:l,hasPython:c})}if(a){const p="place",m=n[p],g=y=>r(p,y),v=t.includes(p);h=w.jsx(fgt,{isIn:v,viewMode:m,setViewMode:g,placeInfo:a})}return w.jsxs(Lre,{sx:fv.card,children:[w.jsx($re,{disableSpacing:!0,children:w.jsxs(Jv,{size:"small",value:t,onChange:u,children:[w.jsx(Pn,{value:"dataset",disabled:i===null,size:"small",sx:Mo.toggleButton,children:w.jsx(_t,{arrow:!0,title:fe.get("Dataset information"),children:w.jsx(_fe,{})})},0),w.jsx(Pn,{value:"variable",disabled:o===null,size:"small",sx:Mo.toggleButton,children:w.jsx(_t,{arrow:!0,title:fe.get("Variable information"),children:w.jsx(Gz,{})})},1),w.jsx(Pn,{value:"place",disabled:a===null,size:"small",sx:Mo.toggleButton,children:w.jsx(_t,{arrow:!0,title:fe.get("Place information"),children:w.jsx(xfe,{})})},2)]},0)}),f,d,h]})},cgt=({isIn:t,viewMode:e,setViewMode:n,dataset:r,serverConfig:i,hasPython:o})=>{let a;if(e==="code"){const s=r.dimensions.map(c=>H3(c,["name","size","dtype"])),l=H3(r,["id","title","bbox","attrs"]);l.dimensions=s,a=w.jsx(z4,{code:JSON.stringify(l,null,2)})}else if(e==="list")a=w.jsx(Kc,{children:w.jsx(h_,{data:Object.getOwnPropertyNames(r.attrs||{}).map(s=>[s,r.attrs[s]])})});else if(e==="text"){const s=[[fe.get("Dimension names"),r.dimensions.map(l=>l.name).join(", ")],[fe.get("Dimension data types"),r.dimensions.map(l=>l.dtype).join(", ")],[fe.get("Dimension lengths"),r.dimensions.map(l=>l.size).join(", ")],[fe.get("Geographical extent")+" (x1, y1, x2, y2)",r.bbox.map(l=>l+"").join(", ")],[fe.get("Spatial reference system"),r.spatialRef]];a=w.jsx(Kc,{children:w.jsx(h_,{data:s})})}else e==="python"&&(a=w.jsx(Fpe,{code:dgt(i,r)}));return w.jsx(B4,{title:r.title||"?",subheader:r.title&&`ID: ${r.id}`,isIn:t,viewMode:e,setViewMode:n,hasPython:o,children:a})},ugt=({isIn:t,viewMode:e,setViewMode:n,variable:r,time:i,serverConfig:o,hasPython:a})=>{let s,l;if(e==="code"){const c=H3(r,["id","name","title","units","expression","shape","dtype","shape","timeChunkSize","colorBarMin","colorBarMax","colorBarName","attrs"]);s=w.jsx(z4,{code:JSON.stringify(c,null,2)})}else if(e==="list"){if(s=w.jsx(Kc,{children:w.jsx(h_,{data:Object.getOwnPropertyNames(r.attrs||{}).map(c=>[c,r.attrs[c]])})}),r.htmlRepr){const c=u=>{u&&r.htmlRepr&&(u.innerHTML=r.htmlRepr)};l=w.jsx(Kc,{children:w.jsx(Go,{ref:c,sx:fv.variableHtmlReprContainer})})}}else if(e==="text"){let c=[[fe.get("Name"),r.name],[fe.get("Title"),r.title],[fe.get("Units"),r.units]];N1(r)?c.push([fe.get("Expression"),r.expression]):c=[...c,[fe.get("Data type"),r.dtype],[fe.get("Dimension names"),r.dims.join(", ")],[fe.get("Dimension lengths"),r.shape.map(u=>u+"").join(", ")],[fe.get("Time chunk size"),r.timeChunkSize]],s=w.jsx(Kc,{children:w.jsx(h_,{data:c})})}else e==="python"&&(s=w.jsx(Fpe,{code:hgt(o,r,i)}));return w.jsxs(B4,{title:r.title||r.name,subheader:`${fe.get("Name")}: ${r.name}`,isIn:t,viewMode:e,setViewMode:n,hasPython:a,children:[l,s]})},fgt=({isIn:t,viewMode:e,setViewMode:n,placeInfo:r})=>{const i=r.place;let o,a,s;if(e==="code")o=w.jsx(z4,{code:JSON.stringify(i,null,2)});else if(e==="list")if(i.properties){const l=Object.getOwnPropertyNames(i.properties).map(c=>[c,i.properties[c]]);o=w.jsx(Kc,{children:w.jsx(h_,{data:l})})}else o=w.jsx(Kc,{children:w.jsx(At,{children:fe.get("There is no information available for this location.")})});else r.image&&r.image.startsWith("http")&&(a=w.jsx(L2e,{sx:fv.media,image:r.image,title:r.label})),r.description&&(s=w.jsx(Kc,{children:w.jsx(At,{children:r.description})}));return w.jsxs(B4,{title:r.label,subheader:`${fe.get("Geometry type")}: ${fe.get(i.geometry.type)}`,isIn:t,viewMode:e,setViewMode:n,children:[a,s,o]})},B4=({isIn:t,title:e,subheader:n,viewMode:r,setViewMode:i,hasPython:o,children:a})=>{const s=(l,c)=>{i(c)};return w.jsxs(fre,{in:t,timeout:"auto",unmountOnExit:!0,children:[w.jsx(E2e,{title:e,subheader:n,titleTypographyProps:{fontSize:"1.1em"},action:w.jsxs(Jv,{size:"small",value:r,exclusive:!0,onChange:s,children:[w.jsx(Pn,{value:"text",size:"small",sx:Mo.toggleButton,children:w.jsx(bfe,{})},0),w.jsx(Pn,{value:"list",size:"small",sx:Mo.toggleButton,children:w.jsx(yfe,{})},1),w.jsx(Pn,{value:"code",size:"small",sx:Mo.toggleButton,children:w.jsx(vfe,{})},2),o&&w.jsx(Pn,{value:"python",size:"small",sx:{...Mo.toggleButton,width:"30px"},children:w.jsx("img",{src:sgt,width:16,alt:"python logo"})},3)]},0)}),a]})},h_=({data:t})=>w.jsx(uie,{component:Go,sx:fv.keyValueTableContainer,children:w.jsx(v5,{sx:fv.table,size:"small",children:w.jsx(y5,{children:t.map((e,n)=>{const[r,i]=e;let o=i;return typeof i=="string"&&(i.startsWith("http://")||i.startsWith("https://"))?o=w.jsx($Re,{href:i,target:"_blank",rel:"noreferrer",children:i}):Array.isArray(i)&&(o="["+i.map(a=>a+"").join(", ")+"]"),w.jsxs(pl,{children:[w.jsx(ar,{children:r}),w.jsx(ar,{align:"right",children:o})]},n)})})})}),Kc=({children:t})=>w.jsx(Nre,{sx:fv.cardContent,children:t}),Npe=({code:t,extension:e})=>w.jsx(Kc,{children:w.jsx(j2,{theme:Kt.instance.branding.themeName||"light",height:"320px",extensions:[e],value:t,readOnly:!0})}),z4=({code:t})=>w.jsx(Npe,{code:t,extension:Tpe()}),Fpe=({code:t})=>w.jsx(Npe,{code:t,extension:agt()});function H3(t,e){const n={};for(const r of e)r in t&&(n[r]=t[r]);return n}function dgt(t,e){const n=pgt(e.id);return["from xcube.core.store import new_data_store","","store = new_data_store(",' "s3",',' root="datasets", # can also use "pyramids" here'," storage_options={",' "anon": True,',' "client_kwargs": {',` "endpoint_url": "${t.url}/s3"`," }"," }",")","# store.list_data_ids()",`dataset = store.open_data(data_id="${n}")`].join(` -`)}function hgt(t,e,n){const r=e.name,i=e.colorBarMin,o=e.colorBarMax,a=e.colorBarName;let s="";n!==null&&(s=`sel(time="${dy(n)}", method="nearest")`);const l=[];if(N1(e)){const c=e.expression;l.push("from xcube.util.expression import compute_array_expr"),l.push("from xcube.util.expression import new_dataset_namespace"),l.push(""),l.push("namespace = new_dataset_namespace(dataset)"),l.push(`${r} = compute_array_expr("${c}", namespace`),s&&l.push(`${r} = ${r}.${s}`)}else s?l.push(`${r} = dataset.${r}.${s}`):l.push(`${r} = dataset.${r}`);return l.push(`${r}.plot.imshow(vmin=${i}, vmax=${o}, cmap="${a}")`),l.join(` -`)}function pgt(t){return mgt(t)[0]+".zarr"}function mgt(t){const e=t.lastIndexOf(".");return e>=0?[t.substring(0,e),t.substring(e)]:[t,""]}const ggt=t=>({locale:t.controlState.locale,visibleInfoCardElements:x9e(t),infoCardElementViewModes:b9e(t),selectedDataset:Gr(t),selectedVariable:vo(t),selectedPlaceInfo:Z1(t),selectedTime:gy(t),serverConfig:hi(t),allowViewModePython:!!Kt.instance.branding.allowViewModePython}),vgt={setVisibleInfoCardElements:N7e,updateInfoCardElementViewMode:F7e},ygt=Jt(ggt,vgt)(lgt),tI=5,xgt={container:t=>({marginTop:t.spacing(1),marginLeft:t.spacing(tI),marginRight:t.spacing(tI),width:`calc(100% - ${t.spacing(3*(tI+1))})`,height:"5em",display:"flex",alignItems:"flex-end"})};function bgt({dataTimeRange:t,selectedTimeRange:e,selectTimeRange:n}){const[r,i]=M.useState(e);M.useEffect(()=>{i(e)},[e]);const o=(u,f)=>{Array.isArray(f)&&i([f[0],f[1]])},a=(u,f)=>{n&&Array.isArray(f)&&n([f[0],f[1]])};function s(u){return dy(u)}const l=Array.isArray(t);l||(t=[Date.now()-2*$ae.years,Date.now()]);const c=[{value:t[0],label:Gb(t[0])},{value:t[1],label:Gb(t[1])}];return w.jsx(Ke,{sx:xgt.container,children:w.jsx(Zv,{disabled:!l,min:t[0],max:t[1],value:r,marks:c,onChange:o,onChangeCommitted:a,size:"small",valueLabelDisplay:"on",valueLabelFormat:s})})}var _gt=Array.isArray,Ho=_gt,wgt=typeof Kn=="object"&&Kn&&Kn.Object===Object&&Kn,jpe=wgt,Sgt=jpe,Ogt=typeof self=="object"&&self&&self.Object===Object&&self,Cgt=Sgt||Ogt||Function("return this")(),cc=Cgt,Tgt=cc,Egt=Tgt.Symbol,yw=Egt,Vq=yw,Bpe=Object.prototype,Pgt=Bpe.hasOwnProperty,Mgt=Bpe.toString,I0=Vq?Vq.toStringTag:void 0;function kgt(t){var e=Pgt.call(t,I0),n=t[I0];try{t[I0]=void 0;var r=!0}catch{}var i=Mgt.call(t);return r&&(e?t[I0]=n:delete t[I0]),i}var Agt=kgt,Rgt=Object.prototype,Igt=Rgt.toString;function Dgt(t){return Igt.call(t)}var Lgt=Dgt,Gq=yw,$gt=Agt,Ngt=Lgt,Fgt="[object Null]",jgt="[object Undefined]",Hq=Gq?Gq.toStringTag:void 0;function Bgt(t){return t==null?t===void 0?jgt:Fgt:Hq&&Hq in Object(t)?$gt(t):Ngt(t)}var _u=Bgt;function zgt(t){return t!=null&&typeof t=="object"}var wu=zgt,Ugt=_u,Wgt=wu,Vgt="[object Symbol]";function Ggt(t){return typeof t=="symbol"||Wgt(t)&&Ugt(t)==Vgt}var My=Ggt,Hgt=Ho,qgt=My,Xgt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Qgt=/^\w*$/;function Ygt(t,e){if(Hgt(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||qgt(t)?!0:Qgt.test(t)||!Xgt.test(t)||e!=null&&t in Object(e)}var U4=Ygt;function Kgt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var wd=Kgt;const ky=Nt(wd);var Zgt=_u,Jgt=wd,evt="[object AsyncFunction]",tvt="[object Function]",nvt="[object GeneratorFunction]",rvt="[object Proxy]";function ivt(t){if(!Jgt(t))return!1;var e=Zgt(t);return e==tvt||e==nvt||e==evt||e==rvt}var W4=ivt;const Bt=Nt(W4);var ovt=cc,avt=ovt["__core-js_shared__"],svt=avt,nI=svt,qq=function(){var t=/[^.]+$/.exec(nI&&nI.keys&&nI.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function lvt(t){return!!qq&&qq in t}var cvt=lvt,uvt=Function.prototype,fvt=uvt.toString;function dvt(t){if(t!=null){try{return fvt.call(t)}catch{}try{return t+""}catch{}}return""}var zpe=dvt,hvt=W4,pvt=cvt,mvt=wd,gvt=zpe,vvt=/[\\^$.*+?()[\]{}|]/g,yvt=/^\[object .+?Constructor\]$/,xvt=Function.prototype,bvt=Object.prototype,_vt=xvt.toString,wvt=bvt.hasOwnProperty,Svt=RegExp("^"+_vt.call(wvt).replace(vvt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ovt(t){if(!mvt(t)||pvt(t))return!1;var e=hvt(t)?Svt:yvt;return e.test(gvt(t))}var Cvt=Ovt;function Tvt(t,e){return t==null?void 0:t[e]}var Evt=Tvt,Pvt=Cvt,Mvt=Evt;function kvt(t,e){var n=Mvt(t,e);return Pvt(n)?n:void 0}var Rp=kvt,Avt=Rp,Rvt=Avt(Object,"create"),U2=Rvt,Xq=U2;function Ivt(){this.__data__=Xq?Xq(null):{},this.size=0}var Dvt=Ivt;function Lvt(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var $vt=Lvt,Nvt=U2,Fvt="__lodash_hash_undefined__",jvt=Object.prototype,Bvt=jvt.hasOwnProperty;function zvt(t){var e=this.__data__;if(Nvt){var n=e[t];return n===Fvt?void 0:n}return Bvt.call(e,t)?e[t]:void 0}var Uvt=zvt,Wvt=U2,Vvt=Object.prototype,Gvt=Vvt.hasOwnProperty;function Hvt(t){var e=this.__data__;return Wvt?e[t]!==void 0:Gvt.call(e,t)}var qvt=Hvt,Xvt=U2,Qvt="__lodash_hash_undefined__";function Yvt(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Xvt&&e===void 0?Qvt:e,this}var Kvt=Yvt,Zvt=Dvt,Jvt=$vt,eyt=Uvt,tyt=qvt,nyt=Kvt;function Ay(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e-1}var xyt=yyt,byt=W2;function _yt(t,e){var n=this.__data__,r=byt(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var wyt=_yt,Syt=oyt,Oyt=hyt,Cyt=gyt,Tyt=xyt,Eyt=wyt;function Ry(t){var e=-1,n=t==null?0:t.length;for(this.clear();++en?null:n+t.unit}const tI=o_.define({name:"python",parser:ngt.configure({props:[_4.add({Body:t=>{var e;return(e=Gq(t,t.node))!==null&&e!==void 0?e:t.continue()},IfStatement:t=>/^\s*(else:|elif )/.test(t.textAfter)?t.baseIndent:t.continue(),"ForStatement WhileStatement":t=>/^\s*else:/.test(t.textAfter)?t.baseIndent:t.continue(),TryStatement:t=>/^\s*(except |finally:|else:)/.test(t.textAfter)?t.baseIndent:t.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":zR({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":zR({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":zR({closing:"]"}),"String FormatString":()=>null,Script:t=>{if(t.pos+/\s*/.exec(t.textAfter)[0].length>=t.node.to){let e=null;for(let n=t.node,r=n.to;n=n.lastChild,!(!n||n.to!=r);)n.type.name=="Body"&&(e=n);if(e){let n=Gq(t,e);if(n!=null)return n}}return t.continue()}}),S4.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":she,Body:(t,e)=>({from:t.from+1,to:t.to-(t.to==e.doc.length?0:1)})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:)$/}});function lgt(){return new ihe(tI,[tI.data.of({autocomplete:igt}),tI.data.of({autocomplete:sgt})])}const cgt=""+new URL("python-bw-BV0FRHt1.png",import.meta.url).href,fv={card:t=>({maxWidth:"100%",marginBottom:t.spacing(1),marginRight:t.spacing(1)}),info:t=>({marginRight:t.spacing(1)}),close:{marginLeft:"auto"},table:{},keyValueTableContainer:t=>({background:t.palette.divider}),variableHtmlReprContainer:t=>({background:t.palette.divider,padding:t.spacing(1),marginTop:t.spacing(1),marginBottom:t.spacing(1)}),media:{height:200},cardContent:{padding:"8px"},code:{fontFamily:"Monospace"}},ugt=({visibleInfoCardElements:t,setVisibleInfoCardElements:e,infoCardElementViewModes:n,updateInfoCardElementViewMode:r,selectedDataset:i,selectedVariable:o,selectedPlaceInfo:a,selectedTime:s,serverConfig:l,allowViewModePython:c})=>{const u=(p,m)=>{e(m)};let f,d,h;if(i){const p="dataset",m=n[p],g=y=>r(p,y),v=t.includes(p);f=w.jsx(fgt,{isIn:v,viewMode:m,setViewMode:g,dataset:i,serverConfig:l,hasPython:c})}if(i&&o){const p="variable",m=n[p],g=y=>r(p,y),v=t.includes(p);d=w.jsx(dgt,{isIn:v,viewMode:m,setViewMode:g,variable:o,time:s,serverConfig:l,hasPython:c})}if(a){const p="place",m=n[p],g=y=>r(p,y),v=t.includes(p);h=w.jsx(hgt,{isIn:v,viewMode:m,setViewMode:g,placeInfo:a})}return w.jsxs(Nre,{sx:fv.card,children:[w.jsx(Fre,{disableSpacing:!0,children:w.jsxs(Jv,{size:"small",value:t,onChange:u,children:[w.jsx(Pn,{value:"dataset",disabled:i===null,size:"small",sx:Mo.toggleButton,children:w.jsx(_t,{arrow:!0,title:fe.get("Dataset information"),children:w.jsx(wfe,{})})},0),w.jsx(Pn,{value:"variable",disabled:o===null,size:"small",sx:Mo.toggleButton,children:w.jsx(_t,{arrow:!0,title:fe.get("Variable information"),children:w.jsx(Hz,{})})},1),w.jsx(Pn,{value:"place",disabled:a===null,size:"small",sx:Mo.toggleButton,children:w.jsx(_t,{arrow:!0,title:fe.get("Place information"),children:w.jsx(bfe,{})})},2)]},0)}),f,d,h]})},fgt=({isIn:t,viewMode:e,setViewMode:n,dataset:r,serverConfig:i,hasPython:o})=>{let a;if(e==="code"){const s=r.dimensions.map(c=>q3(c,["name","size","dtype"])),l=q3(r,["id","title","bbox","attrs"]);l.dimensions=s,a=w.jsx(U4,{code:JSON.stringify(l,null,2)})}else if(e==="list")a=w.jsx(Kc,{children:w.jsx(h_,{data:Object.getOwnPropertyNames(r.attrs||{}).map(s=>[s,r.attrs[s]])})});else if(e==="text"){const s=[[fe.get("Dimension names"),r.dimensions.map(l=>l.name).join(", ")],[fe.get("Dimension data types"),r.dimensions.map(l=>l.dtype).join(", ")],[fe.get("Dimension lengths"),r.dimensions.map(l=>l.size).join(", ")],[fe.get("Geographical extent")+" (x1, y1, x2, y2)",r.bbox.map(l=>l+"").join(", ")],[fe.get("Spatial reference system"),r.spatialRef]];a=w.jsx(Kc,{children:w.jsx(h_,{data:s})})}else e==="python"&&(a=w.jsx(jpe,{code:pgt(i,r)}));return w.jsx(z4,{title:r.title||"?",subheader:r.title&&`ID: ${r.id}`,isIn:t,viewMode:e,setViewMode:n,hasPython:o,children:a})},dgt=({isIn:t,viewMode:e,setViewMode:n,variable:r,time:i,serverConfig:o,hasPython:a})=>{let s,l;if(e==="code"){const c=q3(r,["id","name","title","units","expression","shape","dtype","shape","timeChunkSize","colorBarMin","colorBarMax","colorBarName","attrs"]);s=w.jsx(U4,{code:JSON.stringify(c,null,2)})}else if(e==="list"){if(s=w.jsx(Kc,{children:w.jsx(h_,{data:Object.getOwnPropertyNames(r.attrs||{}).map(c=>[c,r.attrs[c]])})}),r.htmlRepr){const c=u=>{u&&r.htmlRepr&&(u.innerHTML=r.htmlRepr)};l=w.jsx(Kc,{children:w.jsx(Go,{ref:c,sx:fv.variableHtmlReprContainer})})}}else if(e==="text"){let c=[[fe.get("Name"),r.name],[fe.get("Title"),r.title],[fe.get("Units"),r.units]];N1(r)?c.push([fe.get("Expression"),r.expression]):c=[...c,[fe.get("Data type"),r.dtype],[fe.get("Dimension names"),r.dims.join(", ")],[fe.get("Dimension lengths"),r.shape.map(u=>u+"").join(", ")],[fe.get("Time chunk size"),r.timeChunkSize]],s=w.jsx(Kc,{children:w.jsx(h_,{data:c})})}else e==="python"&&(s=w.jsx(jpe,{code:mgt(o,r,i)}));return w.jsxs(z4,{title:r.title||r.name,subheader:`${fe.get("Name")}: ${r.name}`,isIn:t,viewMode:e,setViewMode:n,hasPython:a,children:[l,s]})},hgt=({isIn:t,viewMode:e,setViewMode:n,placeInfo:r})=>{const i=r.place;let o,a,s;if(e==="code")o=w.jsx(U4,{code:JSON.stringify(i,null,2)});else if(e==="list")if(i.properties){const l=Object.getOwnPropertyNames(i.properties).map(c=>[c,i.properties[c]]);o=w.jsx(Kc,{children:w.jsx(h_,{data:l})})}else o=w.jsx(Kc,{children:w.jsx(At,{children:fe.get("There is no information available for this location.")})});else r.image&&r.image.startsWith("http")&&(a=w.jsx($2e,{sx:fv.media,image:r.image,title:r.label})),r.description&&(s=w.jsx(Kc,{children:w.jsx(At,{children:r.description})}));return w.jsxs(z4,{title:r.label,subheader:`${fe.get("Geometry type")}: ${fe.get(i.geometry.type)}`,isIn:t,viewMode:e,setViewMode:n,children:[a,s,o]})},z4=({isIn:t,title:e,subheader:n,viewMode:r,setViewMode:i,hasPython:o,children:a})=>{const s=(l,c)=>{i(c)};return w.jsxs(hre,{in:t,timeout:"auto",unmountOnExit:!0,children:[w.jsx(P2e,{title:e,subheader:n,titleTypographyProps:{fontSize:"1.1em"},action:w.jsxs(Jv,{size:"small",value:r,exclusive:!0,onChange:s,children:[w.jsx(Pn,{value:"text",size:"small",sx:Mo.toggleButton,children:w.jsx(_fe,{})},0),w.jsx(Pn,{value:"list",size:"small",sx:Mo.toggleButton,children:w.jsx(xfe,{})},1),w.jsx(Pn,{value:"code",size:"small",sx:Mo.toggleButton,children:w.jsx(yfe,{})},2),o&&w.jsx(Pn,{value:"python",size:"small",sx:{...Mo.toggleButton,width:"30px"},children:w.jsx("img",{src:cgt,width:16,alt:"python logo"})},3)]},0)}),a]})},h_=({data:t})=>w.jsx(die,{component:Go,sx:fv.keyValueTableContainer,children:w.jsx(y5,{sx:fv.table,size:"small",children:w.jsx(x5,{children:t.map((e,n)=>{const[r,i]=e;let o=i;return typeof i=="string"&&(i.startsWith("http://")||i.startsWith("https://"))?o=w.jsx(NRe,{href:i,target:"_blank",rel:"noreferrer",children:i}):Array.isArray(i)&&(o="["+i.map(a=>a+"").join(", ")+"]"),w.jsxs(pl,{children:[w.jsx(ar,{children:r}),w.jsx(ar,{align:"right",children:o})]},n)})})})}),Kc=({children:t})=>w.jsx(jre,{sx:fv.cardContent,children:t}),Fpe=({code:t,extension:e})=>w.jsx(Kc,{children:w.jsx(j2,{theme:Kt.instance.branding.themeName||"light",height:"320px",extensions:[e],value:t,readOnly:!0})}),U4=({code:t})=>w.jsx(Fpe,{code:t,extension:Epe()}),jpe=({code:t})=>w.jsx(Fpe,{code:t,extension:lgt()});function q3(t,e){const n={};for(const r of e)r in t&&(n[r]=t[r]);return n}function pgt(t,e){const n=ggt(e.id);return["from xcube.core.store import new_data_store","","store = new_data_store(",' "s3",',' root="datasets", # can also use "pyramids" here'," storage_options={",' "anon": True,',' "client_kwargs": {',` "endpoint_url": "${t.url}/s3"`," }"," }",")","# store.list_data_ids()",`dataset = store.open_data(data_id="${n}")`].join(` +`)}function mgt(t,e,n){const r=e.name,i=e.colorBarMin,o=e.colorBarMax,a=e.colorBarName;let s="";n!==null&&(s=`sel(time="${dy(n)}", method="nearest")`);const l=[];if(N1(e)){const c=e.expression;l.push("from xcube.util.expression import compute_array_expr"),l.push("from xcube.util.expression import new_dataset_namespace"),l.push(""),l.push("namespace = new_dataset_namespace(dataset)"),l.push(`${r} = compute_array_expr("${c}", namespace`),s&&l.push(`${r} = ${r}.${s}`)}else s?l.push(`${r} = dataset.${r}.${s}`):l.push(`${r} = dataset.${r}`);return l.push(`${r}.plot.imshow(vmin=${i}, vmax=${o}, cmap="${a}")`),l.join(` +`)}function ggt(t){return vgt(t)[0]+".zarr"}function vgt(t){const e=t.lastIndexOf(".");return e>=0?[t.substring(0,e),t.substring(e)]:[t,""]}const ygt=t=>({locale:t.controlState.locale,visibleInfoCardElements:_9e(t),infoCardElementViewModes:w9e(t),selectedDataset:Gr(t),selectedVariable:vo(t),selectedPlaceInfo:Z1(t),selectedTime:gy(t),serverConfig:hi(t),allowViewModePython:!!Kt.instance.branding.allowViewModePython}),xgt={setVisibleInfoCardElements:j7e,updateInfoCardElementViewMode:B7e},bgt=Jt(ygt,xgt)(ugt),nI=5,_gt={container:t=>({marginTop:t.spacing(1),marginLeft:t.spacing(nI),marginRight:t.spacing(nI),width:`calc(100% - ${t.spacing(3*(nI+1))})`,height:"5em",display:"flex",alignItems:"flex-end"})};function wgt({dataTimeRange:t,selectedTimeRange:e,selectTimeRange:n}){const[r,i]=M.useState(e);M.useEffect(()=>{i(e)},[e]);const o=(u,f)=>{Array.isArray(f)&&i([f[0],f[1]])},a=(u,f)=>{n&&Array.isArray(f)&&n([f[0],f[1]])};function s(u){return dy(u)}const l=Array.isArray(t);l||(t=[Date.now()-2*Nae.years,Date.now()]);const c=[{value:t[0],label:Gb(t[0])},{value:t[1],label:Gb(t[1])}];return w.jsx(Ke,{sx:_gt.container,children:w.jsx(Zv,{disabled:!l,min:t[0],max:t[1],value:r,marks:c,onChange:o,onChangeCommitted:a,size:"small",valueLabelDisplay:"on",valueLabelFormat:s})})}var Sgt=Array.isArray,Ho=Sgt,Ogt=typeof Kn=="object"&&Kn&&Kn.Object===Object&&Kn,Bpe=Ogt,Cgt=Bpe,Tgt=typeof self=="object"&&self&&self.Object===Object&&self,Egt=Cgt||Tgt||Function("return this")(),cc=Egt,Pgt=cc,Mgt=Pgt.Symbol,yw=Mgt,Hq=yw,zpe=Object.prototype,kgt=zpe.hasOwnProperty,Agt=zpe.toString,I0=Hq?Hq.toStringTag:void 0;function Rgt(t){var e=kgt.call(t,I0),n=t[I0];try{t[I0]=void 0;var r=!0}catch{}var i=Agt.call(t);return r&&(e?t[I0]=n:delete t[I0]),i}var Igt=Rgt,Dgt=Object.prototype,Lgt=Dgt.toString;function $gt(t){return Lgt.call(t)}var Ngt=$gt,qq=yw,Fgt=Igt,jgt=Ngt,Bgt="[object Null]",zgt="[object Undefined]",Xq=qq?qq.toStringTag:void 0;function Ugt(t){return t==null?t===void 0?zgt:Bgt:Xq&&Xq in Object(t)?Fgt(t):jgt(t)}var _u=Ugt;function Wgt(t){return t!=null&&typeof t=="object"}var wu=Wgt,Vgt=_u,Ggt=wu,Hgt="[object Symbol]";function qgt(t){return typeof t=="symbol"||Ggt(t)&&Vgt(t)==Hgt}var My=qgt,Xgt=Ho,Qgt=My,Ygt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Kgt=/^\w*$/;function Zgt(t,e){if(Xgt(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||Qgt(t)?!0:Kgt.test(t)||!Ygt.test(t)||e!=null&&t in Object(e)}var W4=Zgt;function Jgt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var wd=Jgt;const ky=Nt(wd);var evt=_u,tvt=wd,nvt="[object AsyncFunction]",rvt="[object Function]",ivt="[object GeneratorFunction]",ovt="[object Proxy]";function avt(t){if(!tvt(t))return!1;var e=evt(t);return e==rvt||e==ivt||e==nvt||e==ovt}var V4=avt;const Bt=Nt(V4);var svt=cc,lvt=svt["__core-js_shared__"],cvt=lvt,rI=cvt,Qq=function(){var t=/[^.]+$/.exec(rI&&rI.keys&&rI.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function uvt(t){return!!Qq&&Qq in t}var fvt=uvt,dvt=Function.prototype,hvt=dvt.toString;function pvt(t){if(t!=null){try{return hvt.call(t)}catch{}try{return t+""}catch{}}return""}var Upe=pvt,mvt=V4,gvt=fvt,vvt=wd,yvt=Upe,xvt=/[\\^$.*+?()[\]{}|]/g,bvt=/^\[object .+?Constructor\]$/,_vt=Function.prototype,wvt=Object.prototype,Svt=_vt.toString,Ovt=wvt.hasOwnProperty,Cvt=RegExp("^"+Svt.call(Ovt).replace(xvt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Tvt(t){if(!vvt(t)||gvt(t))return!1;var e=mvt(t)?Cvt:bvt;return e.test(yvt(t))}var Evt=Tvt;function Pvt(t,e){return t==null?void 0:t[e]}var Mvt=Pvt,kvt=Evt,Avt=Mvt;function Rvt(t,e){var n=Avt(t,e);return kvt(n)?n:void 0}var Rp=Rvt,Ivt=Rp,Dvt=Ivt(Object,"create"),U2=Dvt,Yq=U2;function Lvt(){this.__data__=Yq?Yq(null):{},this.size=0}var $vt=Lvt;function Nvt(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Fvt=Nvt,jvt=U2,Bvt="__lodash_hash_undefined__",zvt=Object.prototype,Uvt=zvt.hasOwnProperty;function Wvt(t){var e=this.__data__;if(jvt){var n=e[t];return n===Bvt?void 0:n}return Uvt.call(e,t)?e[t]:void 0}var Vvt=Wvt,Gvt=U2,Hvt=Object.prototype,qvt=Hvt.hasOwnProperty;function Xvt(t){var e=this.__data__;return Gvt?e[t]!==void 0:qvt.call(e,t)}var Qvt=Xvt,Yvt=U2,Kvt="__lodash_hash_undefined__";function Zvt(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Yvt&&e===void 0?Kvt:e,this}var Jvt=Zvt,eyt=$vt,tyt=Fvt,nyt=Vvt,ryt=Qvt,iyt=Jvt;function Ay(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e-1}var _yt=byt,wyt=W2;function Syt(t,e){var n=this.__data__,r=wyt(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var Oyt=Syt,Cyt=syt,Tyt=myt,Eyt=yyt,Pyt=_yt,Myt=Oyt;function Ry(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e0?1:-1},xh=function(e){return xw(e)&&e.indexOf("%")===e.length-1},Ye=function(e){return K0t(e)&&!Dy(e)},ei=function(e){return Ye(e)||xw(e)},txt=0,Ly=function(e){var n=++txt;return"".concat(e||"").concat(n)},dv=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Ye(e)&&!xw(e))return r;var o;if(xh(e)){var a=e.indexOf("%");o=n*parseFloat(e.slice(0,a))/100}else o=+e;return Dy(o)&&(o=r),i&&o>n&&(o=n),o},ff=function(e){if(!e)return null;var n=Object.keys(e);return n&&n.length?e[n[0]]:null},nxt=function(e){if(!Array.isArray(e))return!1;for(var n=e.length,r={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function lxt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function Q3(t){"@babel/helpers - typeof";return Q3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Q3(t)}var tX={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"},Zc=function(e){return typeof e=="string"?e:e?e.displayName||e.name||"Component":""},nX=null,iI=null,eU=function t(e){if(e===nX&&Array.isArray(iI))return iI;var n=[];return M.Children.forEach(e,function(r){qt(r)||(q3.isFragment(r)?n=n.concat(t(r.props.children)):n.push(r))}),iI=n,nX=e,n};function is(t,e){var n=[],r=[];return Array.isArray(e)?r=e.map(function(i){return Zc(i)}):r=[Zc(e)],eU(t).forEach(function(i){var o=rs(i,"type.displayName")||rs(i,"type.name");r.indexOf(o)!==-1&&n.push(i)}),n}function la(t,e){var n=is(t,e);return n&&n[0]}var rX=function(e){if(!e||!e.props)return!1;var n=e.props,r=n.width,i=n.height;return!(!Ye(r)||r<=0||!Ye(i)||i<=0)},cxt=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],uxt=function(e){return e&&e.type&&xw(e.type)&&cxt.indexOf(e.type)>=0},Kpe=function(e){return e&&Q3(e)==="object"&&"cx"in e&&"cy"in e&&"r"in e},fxt=function(e,n,r,i){var o,a=(o=rI==null?void 0:rI[i])!==null&&o!==void 0?o:[];return!Bt(e)&&(i&&a.includes(n)||ixt.includes(n))||r&&J4.includes(n)},jt=function(e,n,r){if(!e||typeof e=="function"||typeof e=="boolean")return null;var i=e;if(M.isValidElement(e)&&(i=e.props),!ky(i))return null;var o={};return Object.keys(i).forEach(function(a){var s;fxt((s=i)===null||s===void 0?void 0:s[a],a,n,r)&&(o[a]=i[a])}),o},Y3=function t(e,n){if(e===n)return!0;var r=M.Children.count(e);if(r!==M.Children.count(n))return!1;if(r===0)return!0;if(r===1)return iX(Array.isArray(e)?e[0]:e,Array.isArray(n)?n[0]:n);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function gxt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function Z3(t){var e=t.children,n=t.width,r=t.height,i=t.viewBox,o=t.className,a=t.style,s=t.title,l=t.desc,c=mxt(t,pxt),u=i||{width:n,height:r,x:0,y:0},f=ke("recharts-surface",o);return ue.createElement("svg",K3({},jt(c,!0,"svg"),{className:f,width:n,height:r,style:a,viewBox:"".concat(u.x," ").concat(u.y," ").concat(u.width," ").concat(u.height)}),ue.createElement("title",null,s),ue.createElement("desc",null,l),e)}var vxt=["children","className"];function J3(){return J3=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function xxt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var Vn=ue.forwardRef(function(t,e){var n=t.children,r=t.className,i=yxt(t,vxt),o=ke("recharts-layer",r);return ue.createElement("g",J3({className:o},jt(i,!0),{ref:e}),n)}),Jc=function(e,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;oi?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r=r?t:wxt(t,e,n)}var Oxt=Sxt,Cxt="\\ud800-\\udfff",Txt="\\u0300-\\u036f",Ext="\\ufe20-\\ufe2f",Pxt="\\u20d0-\\u20ff",Mxt=Txt+Ext+Pxt,kxt="\\ufe0e\\ufe0f",Axt="\\u200d",Rxt=RegExp("["+Axt+Cxt+Mxt+kxt+"]");function Ixt(t){return Rxt.test(t)}var Zpe=Ixt;function Dxt(t){return t.split("")}var Lxt=Dxt,Jpe="\\ud800-\\udfff",$xt="\\u0300-\\u036f",Nxt="\\ufe20-\\ufe2f",Fxt="\\u20d0-\\u20ff",jxt=$xt+Nxt+Fxt,Bxt="\\ufe0e\\ufe0f",zxt="["+Jpe+"]",eN="["+jxt+"]",tN="\\ud83c[\\udffb-\\udfff]",Uxt="(?:"+eN+"|"+tN+")",eme="[^"+Jpe+"]",tme="(?:\\ud83c[\\udde6-\\uddff]){2}",nme="[\\ud800-\\udbff][\\udc00-\\udfff]",Wxt="\\u200d",rme=Uxt+"?",ime="["+Bxt+"]?",Vxt="(?:"+Wxt+"(?:"+[eme,tme,nme].join("|")+")"+ime+rme+")*",Gxt=ime+rme+Vxt,Hxt="(?:"+[eme+eN+"?",eN,tme,nme,zxt].join("|")+")",qxt=RegExp(tN+"(?="+tN+")|"+Hxt+Gxt,"g");function Xxt(t){return t.match(qxt)||[]}var Qxt=Xxt,Yxt=Lxt,Kxt=Zpe,Zxt=Qxt;function Jxt(t){return Kxt(t)?Zxt(t):Yxt(t)}var ebt=Jxt,tbt=Oxt,nbt=Zpe,rbt=ebt,ibt=Gpe;function obt(t){return function(e){e=ibt(e);var n=nbt(e)?rbt(e):void 0,r=n?n[0]:e.charAt(0),i=n?tbt(n,1).join(""):e.slice(1);return r[t]()+i}}var abt=obt,sbt=abt,lbt=sbt("toUpperCase"),cbt=lbt;const rk=Nt(cbt);function zn(t){return function(){return t}}const ome=Math.cos,IE=Math.sin,nl=Math.sqrt,DE=Math.PI,ik=2*DE,nN=Math.PI,rN=2*nN,Xd=1e-6,ubt=rN-Xd;function ame(t){this._+=t[0];for(let e=1,n=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return ame;const n=10**e;return function(r){this._+=r[0];for(let i=1,o=r.length;iXd)if(!(Math.abs(f*l-c*u)>Xd)||!o)this._append`L${this._x1=e},${this._y1=n}`;else{let h=r-a,p=i-s,m=l*l+c*c,g=h*h+p*p,v=Math.sqrt(m),y=Math.sqrt(d),x=o*Math.tan((nN-Math.acos((m+d-g)/(2*v*y)))/2),b=x/y,_=x/v;Math.abs(b-1)>Xd&&this._append`L${e+b*u},${n+b*f}`,this._append`A${o},${o},0,0,${+(f*h>u*p)},${this._x1=e+_*l},${this._y1=n+_*c}`}}arc(e,n,r,i,o,a){if(e=+e,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(i),l=r*Math.sin(i),c=e+s,u=n+l,f=1^a,d=a?i-o:o-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>Xd||Math.abs(this._y1-u)>Xd)&&this._append`L${c},${u}`,r&&(d<0&&(d=d%rN+rN),d>ubt?this._append`A${r},${r},0,1,${f},${e-s},${n-l}A${r},${r},0,1,${f},${this._x1=c},${this._y1=u}`:d>Xd&&this._append`A${r},${r},0,${+(d>=nN)},${f},${this._x1=e+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(e,n,r,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function tU(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);e=r}return t},()=>new dbt(e)}function nU(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function sme(t){this._context=t}sme.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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function ok(t){return new sme(t)}function lme(t){return t[0]}function cme(t){return t[1]}function ume(t,e){var n=zn(!0),r=null,i=ok,o=null,a=tU(s);t=typeof t=="function"?t:t===void 0?lme:zn(t),e=typeof e=="function"?e:e===void 0?cme:zn(e);function s(l){var c,u=(l=nU(l)).length,f,d=!1,h;for(r==null&&(o=i(h=a())),c=0;c<=u;++c)!(c=h;--p)s.point(x[p],b[p]);s.lineEnd(),s.areaEnd()}v&&(x[d]=+t(g,d,f),b[d]=+e(g,d,f),s.point(r?+r(g,d,f):x[d],n?+n(g,d,f):b[d]))}if(y)return s=null,y+""||null}function u(){return ume().defined(i).curve(a).context(o)}return c.x=function(f){return arguments.length?(t=typeof f=="function"?f:zn(+f),r=null,c):t},c.x0=function(f){return arguments.length?(t=typeof f=="function"?f:zn(+f),c):t},c.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:zn(+f),c):r},c.y=function(f){return arguments.length?(e=typeof f=="function"?f:zn(+f),n=null,c):e},c.y0=function(f){return arguments.length?(e=typeof f=="function"?f:zn(+f),c):e},c.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:zn(+f),c):n},c.lineX0=c.lineY0=function(){return u().x(t).y(e)},c.lineY1=function(){return u().x(t).y(n)},c.lineX1=function(){return u().x(r).y(e)},c.defined=function(f){return arguments.length?(i=typeof f=="function"?f:zn(!!f),c):i},c.curve=function(f){return arguments.length?(a=f,o!=null&&(s=a(o)),c):a},c.context=function(f){return arguments.length?(f==null?o=s=null:s=a(o=f),c):o},c}class fme{constructor(e,n){this._context=e,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,n){switch(e=+e,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,n):this._context.moveTo(e,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,n,e,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,e,this._y0,e,n);break}}this._x0=e,this._y0=n}}function hbt(t){return new fme(t,!0)}function pbt(t){return new fme(t,!1)}const rU={draw(t,e){const n=nl(e/DE);t.moveTo(n,0),t.arc(0,0,n,0,ik)}},mbt={draw(t,e){const n=nl(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},dme=nl(1/3),gbt=dme*2,vbt={draw(t,e){const n=nl(e/gbt),r=n*dme;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},ybt={draw(t,e){const n=nl(e),r=-n/2;t.rect(r,r,n,n)}},xbt=.8908130915292852,hme=IE(DE/10)/IE(7*DE/10),bbt=IE(ik/10)*hme,_bt=-ome(ik/10)*hme,wbt={draw(t,e){const n=nl(e*xbt),r=bbt*n,i=_bt*n;t.moveTo(0,-n),t.lineTo(r,i);for(let o=1;o<5;++o){const a=ik*o/5,s=ome(a),l=IE(a);t.lineTo(l*n,-s*n),t.lineTo(s*r-l*i,l*r+s*i)}t.closePath()}},oI=nl(3),Sbt={draw(t,e){const n=-nl(e/(oI*3));t.moveTo(0,n*2),t.lineTo(-oI*n,-n),t.lineTo(oI*n,-n),t.closePath()}},Ia=-.5,Da=nl(3)/2,iN=1/nl(12),Obt=(iN/2+1)*3,Cbt={draw(t,e){const n=nl(e/Obt),r=n/2,i=n*iN,o=r,a=n*iN+n,s=-o,l=a;t.moveTo(r,i),t.lineTo(o,a),t.lineTo(s,l),t.lineTo(Ia*r-Da*i,Da*r+Ia*i),t.lineTo(Ia*o-Da*a,Da*o+Ia*a),t.lineTo(Ia*s-Da*l,Da*s+Ia*l),t.lineTo(Ia*r+Da*i,Ia*i-Da*r),t.lineTo(Ia*o+Da*a,Ia*a-Da*o),t.lineTo(Ia*s+Da*l,Ia*l-Da*s),t.closePath()}};function Tbt(t,e){let n=null,r=tU(i);t=typeof t=="function"?t:zn(t||rU),e=typeof e=="function"?e:zn(e===void 0?64:+e);function i(){let o;if(n||(n=o=r()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),o)return n=null,o+""||null}return i.type=function(o){return arguments.length?(t=typeof o=="function"?o:zn(o),i):t},i.size=function(o){return arguments.length?(e=typeof o=="function"?o:zn(+o),i):e},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function LE(){}function $E(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function pme(t){this._context=t}pme.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:$E(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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);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:$E(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Ebt(t){return new pme(t)}function mme(t){this._context=t}mme.prototype={areaStart:LE,areaEnd:LE,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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:$E(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Pbt(t){return new mme(t)}function gme(t){this._context=t}gme.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(t,e){switch(t=+t,e=+e,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+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:$E(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Mbt(t){return new gme(t)}function vme(t){this._context=t}vme.prototype={areaStart:LE,areaEnd:LE,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function kbt(t){return new vme(t)}function aX(t){return t<0?-1:1}function sX(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(n-t._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(aX(o)+aX(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function lX(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function aI(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,s=(o-r)/3;t._context.bezierCurveTo(r+s,i+s*e,o-s,a-s*n,o,a)}function NE(t){this._context=t}NE.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:aI(this,this._t0,lX(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,aI(this,lX(this,n=sX(this,t,e)),n);break;default:aI(this,this._t0,n=sX(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function yme(t){this._context=new xme(t)}(yme.prototype=Object.create(NE.prototype)).point=function(t,e){NE.prototype.point.call(this,e,t)};function xme(t){this._context=t}xme.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,o){this._context.bezierCurveTo(e,t,r,n,o,i)}};function Abt(t){return new NE(t)}function Rbt(t){return new yme(t)}function bme(t){this._context=t}bme.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),n===2)this._context.lineTo(t[1],e[1]);else for(var r=cX(t),i=cX(e),o=0,a=1;a=0;--e)i[e]=(a[e]-i[e+1])/o[e];for(o[n-1]=(t[n]+i[n-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function Dbt(t){return new ak(t,.5)}function Lbt(t){return new ak(t,0)}function $bt(t){return new ak(t,1)}function hv(t,e){if((a=t.length)>1)for(var n=1,r,i,o=t[e[0]],a,s=o.length;n=0;)n[e]=e;return n}function Nbt(t,e){return t[e]}function Fbt(t){const e=[];return e.key=t,e}function jbt(){var t=zn([]),e=oN,n=hv,r=Nbt;function i(o){var a=Array.from(t.apply(this,arguments),Fbt),s,l=a.length,c=-1,u;for(const f of o)for(s=0,++c;s0){for(var n,r,i=0,o=t[0].length,a;i0){for(var n=0,r=t[e[0]],i,o=r.length;n0)||!((o=(i=t[e[0]]).length)>0))){for(var n=0,r=1,i,o,a;r=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Xbt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var _me={symbolCircle:rU,symbolCross:mbt,symbolDiamond:vbt,symbolSquare:ybt,symbolStar:wbt,symbolTriangle:Sbt,symbolWye:Cbt},Qbt=Math.PI/180,Ybt=function(e){var n="symbol".concat(rk(e));return _me[n]||rU},Kbt=function(e,n,r){if(n==="area")return e;switch(r){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var i=18*Qbt;return 1.25*e*e*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},Zbt=function(e,n){_me["symbol".concat(rk(e))]=n},iU=function(e){var n=e.type,r=n===void 0?"circle":n,i=e.size,o=i===void 0?64:i,a=e.sizeType,s=a===void 0?"area":a,l=qbt(e,Wbt),c=fX(fX({},l),{},{type:r,size:o,sizeType:s}),u=function(){var g=Ybt(r),v=Tbt().type(g).size(Kbt(o,s,r));return v()},f=c.className,d=c.cx,h=c.cy,p=jt(c,!0);return d===+d&&h===+h&&o===+o?ue.createElement("path",aN({},p,{className:ke("recharts-symbols",f),transform:"translate(".concat(d,", ").concat(h,")"),d:u()})):null};iU.registerSymbol=Zbt;function pv(t){"@babel/helpers - typeof";return pv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pv(t)}function sN(){return sN=Object.assign?Object.assign.bind():function(t){for(var e=1;e0?1:-1},xh=function(e){return xw(e)&&e.indexOf("%")===e.length-1},Ye=function(e){return J0t(e)&&!Dy(e)},ei=function(e){return Ye(e)||xw(e)},rxt=0,Ly=function(e){var n=++rxt;return"".concat(e||"").concat(n)},dv=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Ye(e)&&!xw(e))return r;var o;if(xh(e)){var a=e.indexOf("%");o=n*parseFloat(e.slice(0,a))/100}else o=+e;return Dy(o)&&(o=r),i&&o>n&&(o=n),o},ff=function(e){if(!e)return null;var n=Object.keys(e);return n&&n.length?e[n[0]]:null},ixt=function(e){if(!Array.isArray(e))return!1;for(var n=e.length,r={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function uxt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function Y3(t){"@babel/helpers - typeof";return Y3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Y3(t)}var rX={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"},Zc=function(e){return typeof e=="string"?e:e?e.displayName||e.name||"Component":""},iX=null,oI=null,tU=function t(e){if(e===iX&&Array.isArray(oI))return oI;var n=[];return M.Children.forEach(e,function(r){qt(r)||(X3.isFragment(r)?n=n.concat(t(r.props.children)):n.push(r))}),oI=n,iX=e,n};function is(t,e){var n=[],r=[];return Array.isArray(e)?r=e.map(function(i){return Zc(i)}):r=[Zc(e)],tU(t).forEach(function(i){var o=rs(i,"type.displayName")||rs(i,"type.name");r.indexOf(o)!==-1&&n.push(i)}),n}function la(t,e){var n=is(t,e);return n&&n[0]}var oX=function(e){if(!e||!e.props)return!1;var n=e.props,r=n.width,i=n.height;return!(!Ye(r)||r<=0||!Ye(i)||i<=0)},fxt=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],dxt=function(e){return e&&e.type&&xw(e.type)&&fxt.indexOf(e.type)>=0},Zpe=function(e){return e&&Y3(e)==="object"&&"cx"in e&&"cy"in e&&"r"in e},hxt=function(e,n,r,i){var o,a=(o=iI==null?void 0:iI[i])!==null&&o!==void 0?o:[];return!Bt(e)&&(i&&a.includes(n)||axt.includes(n))||r&&eU.includes(n)},jt=function(e,n,r){if(!e||typeof e=="function"||typeof e=="boolean")return null;var i=e;if(M.isValidElement(e)&&(i=e.props),!ky(i))return null;var o={};return Object.keys(i).forEach(function(a){var s;hxt((s=i)===null||s===void 0?void 0:s[a],a,n,r)&&(o[a]=i[a])}),o},K3=function t(e,n){if(e===n)return!0;var r=M.Children.count(e);if(r!==M.Children.count(n))return!1;if(r===0)return!0;if(r===1)return aX(Array.isArray(e)?e[0]:e,Array.isArray(n)?n[0]:n);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function yxt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function J3(t){var e=t.children,n=t.width,r=t.height,i=t.viewBox,o=t.className,a=t.style,s=t.title,l=t.desc,c=vxt(t,gxt),u=i||{width:n,height:r,x:0,y:0},f=ke("recharts-surface",o);return ue.createElement("svg",Z3({},jt(c,!0,"svg"),{className:f,width:n,height:r,style:a,viewBox:"".concat(u.x," ").concat(u.y," ").concat(u.width," ").concat(u.height)}),ue.createElement("title",null,s),ue.createElement("desc",null,l),e)}var xxt=["children","className"];function eN(){return eN=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function _xt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var Vn=ue.forwardRef(function(t,e){var n=t.children,r=t.className,i=bxt(t,xxt),o=ke("recharts-layer",r);return ue.createElement("g",eN({className:o},jt(i,!0),{ref:e}),n)}),Jc=function(e,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;oi?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r=r?t:Oxt(t,e,n)}var Txt=Cxt,Ext="\\ud800-\\udfff",Pxt="\\u0300-\\u036f",Mxt="\\ufe20-\\ufe2f",kxt="\\u20d0-\\u20ff",Axt=Pxt+Mxt+kxt,Rxt="\\ufe0e\\ufe0f",Ixt="\\u200d",Dxt=RegExp("["+Ixt+Ext+Axt+Rxt+"]");function Lxt(t){return Dxt.test(t)}var Jpe=Lxt;function $xt(t){return t.split("")}var Nxt=$xt,eme="\\ud800-\\udfff",Fxt="\\u0300-\\u036f",jxt="\\ufe20-\\ufe2f",Bxt="\\u20d0-\\u20ff",zxt=Fxt+jxt+Bxt,Uxt="\\ufe0e\\ufe0f",Wxt="["+eme+"]",tN="["+zxt+"]",nN="\\ud83c[\\udffb-\\udfff]",Vxt="(?:"+tN+"|"+nN+")",tme="[^"+eme+"]",nme="(?:\\ud83c[\\udde6-\\uddff]){2}",rme="[\\ud800-\\udbff][\\udc00-\\udfff]",Gxt="\\u200d",ime=Vxt+"?",ome="["+Uxt+"]?",Hxt="(?:"+Gxt+"(?:"+[tme,nme,rme].join("|")+")"+ome+ime+")*",qxt=ome+ime+Hxt,Xxt="(?:"+[tme+tN+"?",tN,nme,rme,Wxt].join("|")+")",Qxt=RegExp(nN+"(?="+nN+")|"+Xxt+qxt,"g");function Yxt(t){return t.match(Qxt)||[]}var Kxt=Yxt,Zxt=Nxt,Jxt=Jpe,ebt=Kxt;function tbt(t){return Jxt(t)?ebt(t):Zxt(t)}var nbt=tbt,rbt=Txt,ibt=Jpe,obt=nbt,abt=Hpe;function sbt(t){return function(e){e=abt(e);var n=ibt(e)?obt(e):void 0,r=n?n[0]:e.charAt(0),i=n?rbt(n,1).join(""):e.slice(1);return r[t]()+i}}var lbt=sbt,cbt=lbt,ubt=cbt("toUpperCase"),fbt=ubt;const rk=Nt(fbt);function zn(t){return function(){return t}}const ame=Math.cos,IE=Math.sin,nl=Math.sqrt,DE=Math.PI,ik=2*DE,rN=Math.PI,iN=2*rN,Xd=1e-6,dbt=iN-Xd;function sme(t){this._+=t[0];for(let e=1,n=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return sme;const n=10**e;return function(r){this._+=r[0];for(let i=1,o=r.length;iXd)if(!(Math.abs(f*l-c*u)>Xd)||!o)this._append`L${this._x1=e},${this._y1=n}`;else{let h=r-a,p=i-s,m=l*l+c*c,g=h*h+p*p,v=Math.sqrt(m),y=Math.sqrt(d),x=o*Math.tan((rN-Math.acos((m+d-g)/(2*v*y)))/2),b=x/y,_=x/v;Math.abs(b-1)>Xd&&this._append`L${e+b*u},${n+b*f}`,this._append`A${o},${o},0,0,${+(f*h>u*p)},${this._x1=e+_*l},${this._y1=n+_*c}`}}arc(e,n,r,i,o,a){if(e=+e,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(i),l=r*Math.sin(i),c=e+s,u=n+l,f=1^a,d=a?i-o:o-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>Xd||Math.abs(this._y1-u)>Xd)&&this._append`L${c},${u}`,r&&(d<0&&(d=d%iN+iN),d>dbt?this._append`A${r},${r},0,1,${f},${e-s},${n-l}A${r},${r},0,1,${f},${this._x1=c},${this._y1=u}`:d>Xd&&this._append`A${r},${r},0,${+(d>=rN)},${f},${this._x1=e+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(e,n,r,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function nU(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);e=r}return t},()=>new pbt(e)}function rU(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function lme(t){this._context=t}lme.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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function ok(t){return new lme(t)}function cme(t){return t[0]}function ume(t){return t[1]}function fme(t,e){var n=zn(!0),r=null,i=ok,o=null,a=nU(s);t=typeof t=="function"?t:t===void 0?cme:zn(t),e=typeof e=="function"?e:e===void 0?ume:zn(e);function s(l){var c,u=(l=rU(l)).length,f,d=!1,h;for(r==null&&(o=i(h=a())),c=0;c<=u;++c)!(c=h;--p)s.point(x[p],b[p]);s.lineEnd(),s.areaEnd()}v&&(x[d]=+t(g,d,f),b[d]=+e(g,d,f),s.point(r?+r(g,d,f):x[d],n?+n(g,d,f):b[d]))}if(y)return s=null,y+""||null}function u(){return fme().defined(i).curve(a).context(o)}return c.x=function(f){return arguments.length?(t=typeof f=="function"?f:zn(+f),r=null,c):t},c.x0=function(f){return arguments.length?(t=typeof f=="function"?f:zn(+f),c):t},c.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:zn(+f),c):r},c.y=function(f){return arguments.length?(e=typeof f=="function"?f:zn(+f),n=null,c):e},c.y0=function(f){return arguments.length?(e=typeof f=="function"?f:zn(+f),c):e},c.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:zn(+f),c):n},c.lineX0=c.lineY0=function(){return u().x(t).y(e)},c.lineY1=function(){return u().x(t).y(n)},c.lineX1=function(){return u().x(r).y(e)},c.defined=function(f){return arguments.length?(i=typeof f=="function"?f:zn(!!f),c):i},c.curve=function(f){return arguments.length?(a=f,o!=null&&(s=a(o)),c):a},c.context=function(f){return arguments.length?(f==null?o=s=null:s=a(o=f),c):o},c}class dme{constructor(e,n){this._context=e,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,n){switch(e=+e,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,n):this._context.moveTo(e,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,n,e,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,e,this._y0,e,n);break}}this._x0=e,this._y0=n}}function mbt(t){return new dme(t,!0)}function gbt(t){return new dme(t,!1)}const iU={draw(t,e){const n=nl(e/DE);t.moveTo(n,0),t.arc(0,0,n,0,ik)}},vbt={draw(t,e){const n=nl(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},hme=nl(1/3),ybt=hme*2,xbt={draw(t,e){const n=nl(e/ybt),r=n*hme;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},bbt={draw(t,e){const n=nl(e),r=-n/2;t.rect(r,r,n,n)}},_bt=.8908130915292852,pme=IE(DE/10)/IE(7*DE/10),wbt=IE(ik/10)*pme,Sbt=-ame(ik/10)*pme,Obt={draw(t,e){const n=nl(e*_bt),r=wbt*n,i=Sbt*n;t.moveTo(0,-n),t.lineTo(r,i);for(let o=1;o<5;++o){const a=ik*o/5,s=ame(a),l=IE(a);t.lineTo(l*n,-s*n),t.lineTo(s*r-l*i,l*r+s*i)}t.closePath()}},aI=nl(3),Cbt={draw(t,e){const n=-nl(e/(aI*3));t.moveTo(0,n*2),t.lineTo(-aI*n,-n),t.lineTo(aI*n,-n),t.closePath()}},Ia=-.5,Da=nl(3)/2,oN=1/nl(12),Tbt=(oN/2+1)*3,Ebt={draw(t,e){const n=nl(e/Tbt),r=n/2,i=n*oN,o=r,a=n*oN+n,s=-o,l=a;t.moveTo(r,i),t.lineTo(o,a),t.lineTo(s,l),t.lineTo(Ia*r-Da*i,Da*r+Ia*i),t.lineTo(Ia*o-Da*a,Da*o+Ia*a),t.lineTo(Ia*s-Da*l,Da*s+Ia*l),t.lineTo(Ia*r+Da*i,Ia*i-Da*r),t.lineTo(Ia*o+Da*a,Ia*a-Da*o),t.lineTo(Ia*s+Da*l,Ia*l-Da*s),t.closePath()}};function Pbt(t,e){let n=null,r=nU(i);t=typeof t=="function"?t:zn(t||iU),e=typeof e=="function"?e:zn(e===void 0?64:+e);function i(){let o;if(n||(n=o=r()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),o)return n=null,o+""||null}return i.type=function(o){return arguments.length?(t=typeof o=="function"?o:zn(o),i):t},i.size=function(o){return arguments.length?(e=typeof o=="function"?o:zn(+o),i):e},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function LE(){}function $E(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function mme(t){this._context=t}mme.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:$E(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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);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:$E(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Mbt(t){return new mme(t)}function gme(t){this._context=t}gme.prototype={areaStart:LE,areaEnd:LE,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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:$E(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function kbt(t){return new gme(t)}function vme(t){this._context=t}vme.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(t,e){switch(t=+t,e=+e,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+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:$E(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Abt(t){return new vme(t)}function yme(t){this._context=t}yme.prototype={areaStart:LE,areaEnd:LE,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function Rbt(t){return new yme(t)}function lX(t){return t<0?-1:1}function cX(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(n-t._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(lX(o)+lX(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function uX(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function sI(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,s=(o-r)/3;t._context.bezierCurveTo(r+s,i+s*e,o-s,a-s*n,o,a)}function NE(t){this._context=t}NE.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:sI(this,this._t0,uX(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,sI(this,uX(this,n=cX(this,t,e)),n);break;default:sI(this,this._t0,n=cX(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function xme(t){this._context=new bme(t)}(xme.prototype=Object.create(NE.prototype)).point=function(t,e){NE.prototype.point.call(this,e,t)};function bme(t){this._context=t}bme.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,o){this._context.bezierCurveTo(e,t,r,n,o,i)}};function Ibt(t){return new NE(t)}function Dbt(t){return new xme(t)}function _me(t){this._context=t}_me.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),n===2)this._context.lineTo(t[1],e[1]);else for(var r=fX(t),i=fX(e),o=0,a=1;a=0;--e)i[e]=(a[e]-i[e+1])/o[e];for(o[n-1]=(t[n]+i[n-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function $bt(t){return new ak(t,.5)}function Nbt(t){return new ak(t,0)}function Fbt(t){return new ak(t,1)}function hv(t,e){if((a=t.length)>1)for(var n=1,r,i,o=t[e[0]],a,s=o.length;n=0;)n[e]=e;return n}function jbt(t,e){return t[e]}function Bbt(t){const e=[];return e.key=t,e}function zbt(){var t=zn([]),e=aN,n=hv,r=jbt;function i(o){var a=Array.from(t.apply(this,arguments),Bbt),s,l=a.length,c=-1,u;for(const f of o)for(s=0,++c;s0){for(var n,r,i=0,o=t[0].length,a;i0){for(var n=0,r=t[e[0]],i,o=r.length;n0)||!((o=(i=t[e[0]]).length)>0))){for(var n=0,r=1,i,o,a;r=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Ybt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var wme={symbolCircle:iU,symbolCross:vbt,symbolDiamond:xbt,symbolSquare:bbt,symbolStar:Obt,symbolTriangle:Cbt,symbolWye:Ebt},Kbt=Math.PI/180,Zbt=function(e){var n="symbol".concat(rk(e));return wme[n]||iU},Jbt=function(e,n,r){if(n==="area")return e;switch(r){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var i=18*Kbt;return 1.25*e*e*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},e_t=function(e,n){wme["symbol".concat(rk(e))]=n},oU=function(e){var n=e.type,r=n===void 0?"circle":n,i=e.size,o=i===void 0?64:i,a=e.sizeType,s=a===void 0?"area":a,l=Qbt(e,Gbt),c=hX(hX({},l),{},{type:r,size:o,sizeType:s}),u=function(){var g=Zbt(r),v=Pbt().type(g).size(Jbt(o,s,r));return v()},f=c.className,d=c.cx,h=c.cy,p=jt(c,!0);return d===+d&&h===+h&&o===+o?ue.createElement("path",sN({},p,{className:ke("recharts-symbols",f),transform:"translate(".concat(d,", ").concat(h,")"),d:u()})):null};oU.registerSymbol=e_t;function pv(t){"@babel/helpers - typeof";return pv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pv(t)}function lN(){return lN=Object.assign?Object.assign.bind():function(t){for(var e=1;e`);var y=h.inactive?c:h.color;return ue.createElement("li",sN({className:g,style:f,key:"legend-item-".concat(p)},RE(r.props,h,p)),ue.createElement(Z3,{width:a,height:a,viewBox:u,style:d},r.renderIcon(h)),ue.createElement("span",{className:"recharts-legend-item-text",style:{color:y}},m?m(v,h,p):v))})}},{key:"render",value:function(){var r=this.props,i=r.payload,o=r.layout,a=r.align;if(!i||!i.length)return null;var s={padding:0,margin:0,textAlign:o==="horizontal"?a:"left"};return ue.createElement("ul",{className:"recharts-default-legend",style:s},this.renderItems())}}]),e}(M.PureComponent);m_(oU,"displayName","Legend");m_(oU,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var s_t=V2;function l_t(){this.__data__=new s_t,this.size=0}var c_t=l_t;function u_t(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var f_t=u_t;function d_t(t){return this.__data__.get(t)}var h_t=d_t;function p_t(t){return this.__data__.has(t)}var m_t=p_t,g_t=V2,v_t=G4,y_t=H4,x_t=200;function b_t(t,e){var n=this.__data__;if(n instanceof g_t){var r=n.__data__;if(!v_t||r.lengths))return!1;var c=o.get(t),u=o.get(e);if(c&&u)return c==e&&u==t;var f=-1,d=!0,h=n&U_t?new F_t:void 0;for(o.set(t,e),o.set(e,t);++f-1&&t%1==0&&t-1&&t%1==0&&t<=H1t}var cU=q1t,X1t=_u,Q1t=cU,Y1t=wu,K1t="[object Arguments]",Z1t="[object Array]",J1t="[object Boolean]",ewt="[object Date]",twt="[object Error]",nwt="[object Function]",rwt="[object Map]",iwt="[object Number]",owt="[object Object]",awt="[object RegExp]",swt="[object Set]",lwt="[object String]",cwt="[object WeakMap]",uwt="[object ArrayBuffer]",fwt="[object DataView]",dwt="[object Float32Array]",hwt="[object Float64Array]",pwt="[object Int8Array]",mwt="[object Int16Array]",gwt="[object Int32Array]",vwt="[object Uint8Array]",ywt="[object Uint8ClampedArray]",xwt="[object Uint16Array]",bwt="[object Uint32Array]",qn={};qn[dwt]=qn[hwt]=qn[pwt]=qn[mwt]=qn[gwt]=qn[vwt]=qn[ywt]=qn[xwt]=qn[bwt]=!0;qn[K1t]=qn[Z1t]=qn[uwt]=qn[J1t]=qn[fwt]=qn[ewt]=qn[twt]=qn[nwt]=qn[rwt]=qn[iwt]=qn[owt]=qn[awt]=qn[swt]=qn[lwt]=qn[cwt]=!1;function _wt(t){return Y1t(t)&&Q1t(t.length)&&!!qn[X1t(t)]}var wwt=_wt;function Swt(t){return function(e){return t(e)}}var Rme=Swt,zE={exports:{}};zE.exports;(function(t,e){var n=jpe,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===r,a=o&&n.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||a&&a.binding&&a.binding("util")}catch{}}();t.exports=s})(zE,zE.exports);var Owt=zE.exports,Cwt=wwt,Twt=Rme,xX=Owt,bX=xX&&xX.isTypedArray,Ewt=bX?Twt(bX):Cwt,Ime=Ewt,Pwt=A1t,Mwt=sU,kwt=Ho,Awt=Ame,Rwt=lU,Iwt=Ime,Dwt=Object.prototype,Lwt=Dwt.hasOwnProperty;function $wt(t,e){var n=kwt(t),r=!n&&Mwt(t),i=!n&&!r&&Awt(t),o=!n&&!r&&!i&&Iwt(t),a=n||r||i||o,s=a?Pwt(t.length,String):[],l=s.length;for(var c in t)(e||Lwt.call(t,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Rwt(c,l)))&&s.push(c);return s}var Nwt=$wt,Fwt=Object.prototype;function jwt(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||Fwt;return t===n}var Bwt=jwt;function zwt(t,e){return function(n){return t(e(n))}}var Dme=zwt,Uwt=Dme,Wwt=Uwt(Object.keys,Object),Vwt=Wwt,Gwt=Bwt,Hwt=Vwt,qwt=Object.prototype,Xwt=qwt.hasOwnProperty;function Qwt(t){if(!Gwt(t))return Hwt(t);var e=[];for(var n in Object(t))Xwt.call(t,n)&&n!="constructor"&&e.push(n);return e}var Ywt=Qwt,Kwt=W4,Zwt=cU;function Jwt(t){return t!=null&&Zwt(t.length)&&!Kwt(t)}var bw=Jwt,eSt=Nwt,tSt=Ywt,nSt=bw;function rSt(t){return nSt(t)?eSt(t):tSt(t)}var sk=rSt,iSt=x1t,oSt=M1t,aSt=sk;function sSt(t){return iSt(t,aSt,oSt)}var lSt=sSt,_X=lSt,cSt=1,uSt=Object.prototype,fSt=uSt.hasOwnProperty;function dSt(t,e,n,r,i,o){var a=n&cSt,s=_X(t),l=s.length,c=_X(e),u=c.length;if(l!=u&&!a)return!1;for(var f=l;f--;){var d=s[f];if(!(a?d in e:fSt.call(e,d)))return!1}var h=o.get(t),p=o.get(e);if(h&&p)return h==e&&p==t;var m=!0;o.set(t,e),o.set(e,t);for(var g=a;++f-1}var uCt=cCt;function fCt(t,e,n){for(var r=-1,i=t==null?0:t.length;++r=TCt){var c=e?null:OCt(t);if(c)return CCt(c);a=!1,i=SCt,l=new bCt}else l=e?[]:s;e:for(;++r=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function zCt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function UCt(t){return t.value}function WCt(t,e){if(ue.isValidElement(t))return ue.cloneElement(t,e);if(typeof t=="function")return ue.createElement(t,e);e.ref;var n=BCt(e,ICt);return ue.createElement(oU,n)}var NX=1,gv=function(t){FCt(e,t);function e(){var n;DCt(this,e);for(var r=arguments.length,i=new Array(r),o=0;oNX||Math.abs(i.height-this.lastBoundingBox.height)>NX)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,r&&r(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Fd({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,o=i.layout,a=i.align,s=i.verticalAlign,l=i.margin,c=i.chartWidth,u=i.chartHeight,f,d;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(a==="center"&&o==="vertical"){var h=this.getBBoxSnapshot();f={left:((c||0)-h.width)/2}}else f=a==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(s==="middle"){var p=this.getBBoxSnapshot();d={top:((u||0)-p.height)/2}}else d=s==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return Fd(Fd({},f),d)}},{key:"render",value:function(){var r=this,i=this.props,o=i.content,a=i.width,s=i.height,l=i.wrapperStyle,c=i.payloadUniqBy,u=i.payload,f=Fd(Fd({position:"absolute",width:a||"auto",height:s||"auto"},this.getDefaultPosition(l)),l);return ue.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(h){r.wrapperNode=h}},WCt(o,Fd(Fd({},this.props),{},{payload:zme(u,c,UCt)})))}}],[{key:"getWithHeight",value:function(r,i){var o=r.props.layout;return o==="vertical"&&Ye(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||i}:null}}]),e}(M.PureComponent);lk(gv,"displayName","Legend");lk(gv,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var FX=yw,VCt=sU,GCt=Ho,jX=FX?FX.isConcatSpreadable:void 0;function HCt(t){return GCt(t)||VCt(t)||!!(jX&&t&&t[jX])}var qCt=HCt,XCt=Mme,QCt=qCt;function Gme(t,e,n,r,i){var o=-1,a=t.length;for(n||(n=QCt),i||(i=[]);++o0&&n(s)?e>1?Gme(s,e-1,n,r,i):XCt(i,s):r||(i[i.length]=s)}return i}var Hme=Gme;function YCt(t){return function(e,n,r){for(var i=-1,o=Object(e),a=r(e),s=a.length;s--;){var l=a[t?s:++i];if(n(o[l],l,o)===!1)break}return e}}var KCt=YCt,ZCt=KCt,JCt=ZCt(),eTt=JCt,tTt=eTt,nTt=sk;function rTt(t,e){return t&&tTt(t,e,nTt)}var qme=rTt,iTt=bw;function oTt(t,e){return function(n,r){if(n==null)return n;if(!iTt(n))return t(n,r);for(var i=n.length,o=e?i:-1,a=Object(n);(e?o--:++oe||o&&a&&l&&!s&&!c||r&&a&&l||!n&&l||!i)return 1;if(!r&&!o&&!c&&t=s)return l;var c=n[r];return l*(c=="desc"?-1:1)}}return t.index-e.index}var xTt=yTt,uI=X4,bTt=Q4,_Tt=Sd,wTt=Xme,STt=pTt,OTt=Rme,CTt=xTt,TTt=Fy,ETt=Ho;function PTt(t,e,n){e.length?e=uI(e,function(o){return ETt(o)?function(a){return bTt(a,o.length===1?o[0]:o)}:o}):e=[TTt];var r=-1;e=uI(e,OTt(_Tt));var i=wTt(t,function(o,a,s){var l=uI(e,function(c){return c(o)});return{criteria:l,index:++r,value:o}});return STt(i,function(o,a){return CTt(o,a,n)})}var MTt=PTt;function kTt(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var ATt=kTt,RTt=ATt,zX=Math.max;function ITt(t,e,n){return e=zX(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=zX(r.length-e,0),a=Array(o);++i0){if(++e>=WTt)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var qTt=HTt,XTt=UTt,QTt=qTt,YTt=QTt(XTt),KTt=YTt,ZTt=Fy,JTt=DTt,eEt=KTt;function tEt(t,e){return eEt(JTt(t,e,ZTt),t+"")}var nEt=tEt,rEt=V4,iEt=bw,oEt=lU,aEt=wd;function sEt(t,e,n){if(!aEt(n))return!1;var r=typeof e;return(r=="number"?iEt(n)&&oEt(e,n.length):r=="string"&&e in n)?rEt(n[e],t):!1}var ck=sEt,lEt=Hme,cEt=MTt,uEt=nEt,WX=ck,fEt=uEt(function(t,e){if(t==null)return[];var n=e.length;return n>1&&WX(t,e[0],e[1])?e=[]:n>2&&WX(e[0],e[1],e[2])&&(e=[e[0]]),cEt(t,lEt(e,1),[])}),dEt=fEt;const dU=Nt(dEt);function g_(t){"@babel/helpers - typeof";return g_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},g_(t)}function mN(){return mN=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=e.x),"".concat(D0,"-left"),Ye(n)&&e&&Ye(e.x)&&n=e.y),"".concat(D0,"-top"),Ye(r)&&e&&Ye(e.y)&&rm?Math.max(u,l[r]):Math.max(f,l[r])}function EEt(t){var e=t.translateX,n=t.translateY,r=t.useTranslate3d;return{transform:r?"translate3d(".concat(e,"px, ").concat(n,"px, 0)"):"translate(".concat(e,"px, ").concat(n,"px)")}}function PEt(t){var e=t.allowEscapeViewBox,n=t.coordinate,r=t.offsetTopLeft,i=t.position,o=t.reverseDirection,a=t.tooltipBox,s=t.useTranslate3d,l=t.viewBox,c,u,f;return a.height>0&&a.width>0&&n?(u=HX({allowEscapeViewBox:e,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:a.width,viewBox:l,viewBoxDimension:l.width}),f=HX({allowEscapeViewBox:e,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:a.height,viewBox:l,viewBoxDimension:l.height}),c=EEt({translateX:u,translateY:f,useTranslate3d:s})):c=CEt,{cssProperties:c,cssClasses:TEt({translateX:u,translateY:f,coordinate:n})}}function vv(t){"@babel/helpers - typeof";return vv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vv(t)}function qX(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function XX(t){for(var e=1;eYX||Math.abs(r.height-this.lastBoundingBox.height)>YX)&&(this.lastBoundingBox.width=r.width,this.lastBoundingBox.height=r.height)}else(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1)}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,i=this.props,o=i.active,a=i.allowEscapeViewBox,s=i.animationDuration,l=i.animationEasing,c=i.children,u=i.coordinate,f=i.hasPayload,d=i.isAnimationActive,h=i.offset,p=i.position,m=i.reverseDirection,g=i.useTranslate3d,v=i.viewBox,y=i.wrapperStyle,x=PEt({allowEscapeViewBox:a,coordinate:u,offsetTopLeft:h,position:p,reverseDirection:m,tooltipBox:{height:this.lastBoundingBox.height,width:this.lastBoundingBox.width},useTranslate3d:g,viewBox:v}),b=x.cssClasses,_=x.cssProperties,S=XX(XX({transition:d&&o?"transform ".concat(s,"ms ").concat(l):void 0},_),{},{pointerEvents:"none",visibility:!this.state.dismissed&&o&&f?"visible":"hidden",position:"absolute",top:0,left:0},y);return ue.createElement("div",{tabIndex:-1,className:b,style:S,ref:function(C){r.wrapperNode=C}},c)}}]),e}(M.PureComponent),$Et=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},ql={isSsr:$Et(),get:function(e){return ql[e]},set:function(e,n){if(typeof e=="string")ql[e]=n;else{var r=Object.keys(e);r&&r.length&&r.forEach(function(i){ql[i]=e[i]})}}};function yv(t){"@babel/helpers - typeof";return yv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yv(t)}function KX(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function ZX(t){for(var e=1;e0;return ue.createElement(LEt,{allowEscapeViewBox:a,animationDuration:s,animationEasing:l,isAnimationActive:d,active:o,coordinate:u,hasPayload:S,offset:h,position:g,reverseDirection:v,useTranslate3d:y,viewBox:x,wrapperStyle:b},GEt(c,ZX(ZX({},this.props),{},{payload:_})))}}]),e}(M.PureComponent);hU(ml,"displayName","Tooltip");hU(ml,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!ql.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var HEt=cc,qEt=function(){return HEt.Date.now()},XEt=qEt,QEt=/\s/;function YEt(t){for(var e=t.length;e--&&QEt.test(t.charAt(e)););return e}var KEt=YEt,ZEt=KEt,JEt=/^\s+/;function ePt(t){return t&&t.slice(0,ZEt(t)+1).replace(JEt,"")}var tPt=ePt,nPt=tPt,eQ=wd,rPt=My,tQ=NaN,iPt=/^[-+]0x[0-9a-f]+$/i,oPt=/^0b[01]+$/i,aPt=/^0o[0-7]+$/i,sPt=parseInt;function lPt(t){if(typeof t=="number")return t;if(rPt(t))return tQ;if(eQ(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=eQ(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=nPt(t);var n=oPt.test(t);return n||aPt.test(t)?sPt(t.slice(2),n?2:8):iPt.test(t)?tQ:+t}var ege=lPt,cPt=wd,dI=XEt,nQ=ege,uPt="Expected a function",fPt=Math.max,dPt=Math.min;function hPt(t,e,n){var r,i,o,a,s,l,c=0,u=!1,f=!1,d=!0;if(typeof t!="function")throw new TypeError(uPt);e=nQ(e)||0,cPt(n)&&(u=!!n.leading,f="maxWait"in n,o=f?fPt(nQ(n.maxWait)||0,e):o,d="trailing"in n?!!n.trailing:d);function h(S){var O=r,C=i;return r=i=void 0,c=S,a=t.apply(C,O),a}function p(S){return c=S,s=setTimeout(v,e),u?h(S):a}function m(S){var O=S-l,C=S-c,E=e-O;return f?dPt(E,o-C):E}function g(S){var O=S-l,C=S-c;return l===void 0||O>=e||O<0||f&&C>=o}function v(){var S=dI();if(g(S))return y(S);s=setTimeout(v,m(S))}function y(S){return s=void 0,d&&r?h(S):(r=i=void 0,a)}function x(){s!==void 0&&clearTimeout(s),c=0,r=l=i=s=void 0}function b(){return s===void 0?a:y(dI())}function _(){var S=dI(),O=g(S);if(r=arguments,i=this,l=S,O){if(s===void 0)return p(l);if(f)return clearTimeout(s),s=setTimeout(v,e),h(l)}return s===void 0&&(s=setTimeout(v,e)),a}return _.cancel=x,_.flush=b,_}var pPt=hPt,mPt=pPt,gPt=wd,vPt="Expected a function";function yPt(t,e,n){var r=!0,i=!0;if(typeof t!="function")throw new TypeError(vPt);return gPt(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),mPt(t,e,{leading:r,maxWait:e,trailing:i})}var xPt=yPt;const tge=Nt(xPt);function y_(t){"@babel/helpers - typeof";return y_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y_(t)}function rQ(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function fO(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&(R=tge(R,m,{trailing:!0,leading:!1}));var T=new ResizeObserver(R),L=_.current.getBoundingClientRect(),z=L.width,B=L.height;return I(z,B),T.observe(_.current),function(){T.disconnect()}},[I,m]);var P=M.useMemo(function(){var R=E.containerWidth,T=E.containerHeight;if(R<0||T<0)return null;Jc(xh(a)||xh(l),`The width(%s) and height(%s) are both fixed numbers, + A`).concat(a,",").concat(a,",0,1,1,").concat(s,",").concat(o),className:"recharts-legend-icon"});if(r.type==="rect")return ue.createElement("path",{stroke:"none",fill:l,d:"M0,".concat(La/8,"h").concat(La,"v").concat(La*3/4,"h").concat(-La,"z"),className:"recharts-legend-icon"});if(ue.isValidElement(r.legendIcon)){var c=t_t({},r);return delete c.legendIcon,ue.cloneElement(r.legendIcon,c)}return ue.createElement(oU,{fill:l,cx:o,cy:o,size:La,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,i=this.props,o=i.payload,a=i.iconSize,s=i.layout,l=i.formatter,c=i.inactiveColor,u={x:0,y:0,width:La,height:La},f={display:s==="horizontal"?"inline-block":"block",marginRight:10},d={display:"inline-block",verticalAlign:"middle",marginRight:4};return o.map(function(h,p){var m=h.formatter||l,g=ke(m_(m_({"recharts-legend-item":!0},"legend-item-".concat(p),!0),"inactive",h.inactive));if(h.type==="none")return null;var v=Bt(h.value)?null:h.value;Jc(!Bt(h.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: `);var y=h.inactive?c:h.color;return ue.createElement("li",lN({className:g,style:f,key:"legend-item-".concat(p)},RE(r.props,h,p)),ue.createElement(J3,{width:a,height:a,viewBox:u,style:d},r.renderIcon(h)),ue.createElement("span",{className:"recharts-legend-item-text",style:{color:y}},m?m(v,h,p):v))})}},{key:"render",value:function(){var r=this.props,i=r.payload,o=r.layout,a=r.align;if(!i||!i.length)return null;var s={padding:0,margin:0,textAlign:o==="horizontal"?a:"left"};return ue.createElement("ul",{className:"recharts-default-legend",style:s},this.renderItems())}}]),e}(M.PureComponent);m_(aU,"displayName","Legend");m_(aU,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var c_t=V2;function u_t(){this.__data__=new c_t,this.size=0}var f_t=u_t;function d_t(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var h_t=d_t;function p_t(t){return this.__data__.get(t)}var m_t=p_t;function g_t(t){return this.__data__.has(t)}var v_t=g_t,y_t=V2,x_t=H4,b_t=q4,__t=200;function w_t(t,e){var n=this.__data__;if(n instanceof y_t){var r=n.__data__;if(!x_t||r.length<__t-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new b_t(r)}return n.set(t,e),this.size=n.size,this}var S_t=w_t,O_t=V2,C_t=f_t,T_t=h_t,E_t=m_t,P_t=v_t,M_t=S_t;function $y(t){var e=this.__data__=new O_t(t);this.size=e.size}$y.prototype.clear=C_t;$y.prototype.delete=T_t;$y.prototype.get=E_t;$y.prototype.has=P_t;$y.prototype.set=M_t;var Cme=$y,k_t="__lodash_hash_undefined__";function A_t(t){return this.__data__.set(t,k_t),this}var R_t=A_t;function I_t(t){return this.__data__.has(t)}var D_t=I_t,L_t=q4,$_t=R_t,N_t=D_t;function jE(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new L_t;++es))return!1;var c=o.get(t),u=o.get(e);if(c&&u)return c==e&&u==t;var f=-1,d=!0,h=n&V_t?new B_t:void 0;for(o.set(t,e),o.set(e,t);++f-1&&t%1==0&&t-1&&t%1==0&&t<=X1t}var uU=Q1t,Y1t=_u,K1t=uU,Z1t=wu,J1t="[object Arguments]",ewt="[object Array]",twt="[object Boolean]",nwt="[object Date]",rwt="[object Error]",iwt="[object Function]",owt="[object Map]",awt="[object Number]",swt="[object Object]",lwt="[object RegExp]",cwt="[object Set]",uwt="[object String]",fwt="[object WeakMap]",dwt="[object ArrayBuffer]",hwt="[object DataView]",pwt="[object Float32Array]",mwt="[object Float64Array]",gwt="[object Int8Array]",vwt="[object Int16Array]",ywt="[object Int32Array]",xwt="[object Uint8Array]",bwt="[object Uint8ClampedArray]",_wt="[object Uint16Array]",wwt="[object Uint32Array]",qn={};qn[pwt]=qn[mwt]=qn[gwt]=qn[vwt]=qn[ywt]=qn[xwt]=qn[bwt]=qn[_wt]=qn[wwt]=!0;qn[J1t]=qn[ewt]=qn[dwt]=qn[twt]=qn[hwt]=qn[nwt]=qn[rwt]=qn[iwt]=qn[owt]=qn[awt]=qn[swt]=qn[lwt]=qn[cwt]=qn[uwt]=qn[fwt]=!1;function Swt(t){return Z1t(t)&&K1t(t.length)&&!!qn[Y1t(t)]}var Owt=Swt;function Cwt(t){return function(e){return t(e)}}var Ime=Cwt,zE={exports:{}};zE.exports;(function(t,e){var n=Bpe,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===r,a=o&&n.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||a&&a.binding&&a.binding("util")}catch{}}();t.exports=s})(zE,zE.exports);var Twt=zE.exports,Ewt=Owt,Pwt=Ime,_X=Twt,wX=_X&&_X.isTypedArray,Mwt=wX?Pwt(wX):Ewt,Dme=Mwt,kwt=I1t,Awt=lU,Rwt=Ho,Iwt=Rme,Dwt=cU,Lwt=Dme,$wt=Object.prototype,Nwt=$wt.hasOwnProperty;function Fwt(t,e){var n=Rwt(t),r=!n&&Awt(t),i=!n&&!r&&Iwt(t),o=!n&&!r&&!i&&Lwt(t),a=n||r||i||o,s=a?kwt(t.length,String):[],l=s.length;for(var c in t)(e||Nwt.call(t,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Dwt(c,l)))&&s.push(c);return s}var jwt=Fwt,Bwt=Object.prototype;function zwt(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||Bwt;return t===n}var Uwt=zwt;function Wwt(t,e){return function(n){return t(e(n))}}var Lme=Wwt,Vwt=Lme,Gwt=Vwt(Object.keys,Object),Hwt=Gwt,qwt=Uwt,Xwt=Hwt,Qwt=Object.prototype,Ywt=Qwt.hasOwnProperty;function Kwt(t){if(!qwt(t))return Xwt(t);var e=[];for(var n in Object(t))Ywt.call(t,n)&&n!="constructor"&&e.push(n);return e}var Zwt=Kwt,Jwt=V4,eSt=uU;function tSt(t){return t!=null&&eSt(t.length)&&!Jwt(t)}var bw=tSt,nSt=jwt,rSt=Zwt,iSt=bw;function oSt(t){return iSt(t)?nSt(t):rSt(t)}var sk=oSt,aSt=_1t,sSt=A1t,lSt=sk;function cSt(t){return aSt(t,lSt,sSt)}var uSt=cSt,SX=uSt,fSt=1,dSt=Object.prototype,hSt=dSt.hasOwnProperty;function pSt(t,e,n,r,i,o){var a=n&fSt,s=SX(t),l=s.length,c=SX(e),u=c.length;if(l!=u&&!a)return!1;for(var f=l;f--;){var d=s[f];if(!(a?d in e:hSt.call(e,d)))return!1}var h=o.get(t),p=o.get(e);if(h&&p)return h==e&&p==t;var m=!0;o.set(t,e),o.set(e,t);for(var g=a;++f-1}var dCt=fCt;function hCt(t,e,n){for(var r=-1,i=t==null?0:t.length;++r=PCt){var c=e?null:TCt(t);if(c)return ECt(c);a=!1,i=CCt,l=new wCt}else l=e?[]:s;e:for(;++r=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function WCt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function VCt(t){return t.value}function GCt(t,e){if(ue.isValidElement(t))return ue.cloneElement(t,e);if(typeof t=="function")return ue.createElement(t,e);e.ref;var n=UCt(e,LCt);return ue.createElement(aU,n)}var jX=1,gv=function(t){BCt(e,t);function e(){var n;$Ct(this,e);for(var r=arguments.length,i=new Array(r),o=0;ojX||Math.abs(i.height-this.lastBoundingBox.height)>jX)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,r&&r(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Fd({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,o=i.layout,a=i.align,s=i.verticalAlign,l=i.margin,c=i.chartWidth,u=i.chartHeight,f,d;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(a==="center"&&o==="vertical"){var h=this.getBBoxSnapshot();f={left:((c||0)-h.width)/2}}else f=a==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(s==="middle"){var p=this.getBBoxSnapshot();d={top:((u||0)-p.height)/2}}else d=s==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return Fd(Fd({},f),d)}},{key:"render",value:function(){var r=this,i=this.props,o=i.content,a=i.width,s=i.height,l=i.wrapperStyle,c=i.payloadUniqBy,u=i.payload,f=Fd(Fd({position:"absolute",width:a||"auto",height:s||"auto"},this.getDefaultPosition(l)),l);return ue.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(h){r.wrapperNode=h}},GCt(o,Fd(Fd({},this.props),{},{payload:Ume(u,c,VCt)})))}}],[{key:"getWithHeight",value:function(r,i){var o=r.props.layout;return o==="vertical"&&Ye(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||i}:null}}]),e}(M.PureComponent);lk(gv,"displayName","Legend");lk(gv,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var BX=yw,HCt=lU,qCt=Ho,zX=BX?BX.isConcatSpreadable:void 0;function XCt(t){return qCt(t)||HCt(t)||!!(zX&&t&&t[zX])}var QCt=XCt,YCt=kme,KCt=QCt;function Hme(t,e,n,r,i){var o=-1,a=t.length;for(n||(n=KCt),i||(i=[]);++o0&&n(s)?e>1?Hme(s,e-1,n,r,i):YCt(i,s):r||(i[i.length]=s)}return i}var qme=Hme;function ZCt(t){return function(e,n,r){for(var i=-1,o=Object(e),a=r(e),s=a.length;s--;){var l=a[t?s:++i];if(n(o[l],l,o)===!1)break}return e}}var JCt=ZCt,eTt=JCt,tTt=eTt(),nTt=tTt,rTt=nTt,iTt=sk;function oTt(t,e){return t&&rTt(t,e,iTt)}var Xme=oTt,aTt=bw;function sTt(t,e){return function(n,r){if(n==null)return n;if(!aTt(n))return t(n,r);for(var i=n.length,o=e?i:-1,a=Object(n);(e?o--:++oe||o&&a&&l&&!s&&!c||r&&a&&l||!n&&l||!i)return 1;if(!r&&!o&&!c&&t=s)return l;var c=n[r];return l*(c=="desc"?-1:1)}}return t.index-e.index}var _Tt=bTt,fI=Q4,wTt=Y4,STt=Sd,OTt=Qme,CTt=gTt,TTt=Ime,ETt=_Tt,PTt=Fy,MTt=Ho;function kTt(t,e,n){e.length?e=fI(e,function(o){return MTt(o)?function(a){return wTt(a,o.length===1?o[0]:o)}:o}):e=[PTt];var r=-1;e=fI(e,TTt(STt));var i=OTt(t,function(o,a,s){var l=fI(e,function(c){return c(o)});return{criteria:l,index:++r,value:o}});return CTt(i,function(o,a){return ETt(o,a,n)})}var ATt=kTt;function RTt(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var ITt=RTt,DTt=ITt,WX=Math.max;function LTt(t,e,n){return e=WX(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=WX(r.length-e,0),a=Array(o);++i0){if(++e>=GTt)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var QTt=XTt,YTt=VTt,KTt=QTt,ZTt=KTt(YTt),JTt=ZTt,eEt=Fy,tEt=$Tt,nEt=JTt;function rEt(t,e){return nEt(tEt(t,e,eEt),t+"")}var iEt=rEt,oEt=G4,aEt=bw,sEt=cU,lEt=wd;function cEt(t,e,n){if(!lEt(n))return!1;var r=typeof e;return(r=="number"?aEt(n)&&sEt(e,n.length):r=="string"&&e in n)?oEt(n[e],t):!1}var ck=cEt,uEt=qme,fEt=ATt,dEt=iEt,GX=ck,hEt=dEt(function(t,e){if(t==null)return[];var n=e.length;return n>1&&GX(t,e[0],e[1])?e=[]:n>2&&GX(e[0],e[1],e[2])&&(e=[e[0]]),fEt(t,uEt(e,1),[])}),pEt=hEt;const hU=Nt(pEt);function g_(t){"@babel/helpers - typeof";return g_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},g_(t)}function gN(){return gN=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=e.x),"".concat(D0,"-left"),Ye(n)&&e&&Ye(e.x)&&n=e.y),"".concat(D0,"-top"),Ye(r)&&e&&Ye(e.y)&&rm?Math.max(u,l[r]):Math.max(f,l[r])}function MEt(t){var e=t.translateX,n=t.translateY,r=t.useTranslate3d;return{transform:r?"translate3d(".concat(e,"px, ").concat(n,"px, 0)"):"translate(".concat(e,"px, ").concat(n,"px)")}}function kEt(t){var e=t.allowEscapeViewBox,n=t.coordinate,r=t.offsetTopLeft,i=t.position,o=t.reverseDirection,a=t.tooltipBox,s=t.useTranslate3d,l=t.viewBox,c,u,f;return a.height>0&&a.width>0&&n?(u=XX({allowEscapeViewBox:e,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:a.width,viewBox:l,viewBoxDimension:l.width}),f=XX({allowEscapeViewBox:e,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:a.height,viewBox:l,viewBoxDimension:l.height}),c=MEt({translateX:u,translateY:f,useTranslate3d:s})):c=EEt,{cssProperties:c,cssClasses:PEt({translateX:u,translateY:f,coordinate:n})}}function vv(t){"@babel/helpers - typeof";return vv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vv(t)}function QX(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function YX(t){for(var e=1;eZX||Math.abs(r.height-this.lastBoundingBox.height)>ZX)&&(this.lastBoundingBox.width=r.width,this.lastBoundingBox.height=r.height)}else(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1)}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,i=this.props,o=i.active,a=i.allowEscapeViewBox,s=i.animationDuration,l=i.animationEasing,c=i.children,u=i.coordinate,f=i.hasPayload,d=i.isAnimationActive,h=i.offset,p=i.position,m=i.reverseDirection,g=i.useTranslate3d,v=i.viewBox,y=i.wrapperStyle,x=kEt({allowEscapeViewBox:a,coordinate:u,offsetTopLeft:h,position:p,reverseDirection:m,tooltipBox:{height:this.lastBoundingBox.height,width:this.lastBoundingBox.width},useTranslate3d:g,viewBox:v}),b=x.cssClasses,_=x.cssProperties,S=YX(YX({transition:d&&o?"transform ".concat(s,"ms ").concat(l):void 0},_),{},{pointerEvents:"none",visibility:!this.state.dismissed&&o&&f?"visible":"hidden",position:"absolute",top:0,left:0},y);return ue.createElement("div",{tabIndex:-1,className:b,style:S,ref:function(C){r.wrapperNode=C}},c)}}]),e}(M.PureComponent),FEt=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},ql={isSsr:FEt(),get:function(e){return ql[e]},set:function(e,n){if(typeof e=="string")ql[e]=n;else{var r=Object.keys(e);r&&r.length&&r.forEach(function(i){ql[i]=e[i]})}}};function yv(t){"@babel/helpers - typeof";return yv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yv(t)}function JX(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function eQ(t){for(var e=1;e0;return ue.createElement(NEt,{allowEscapeViewBox:a,animationDuration:s,animationEasing:l,isAnimationActive:d,active:o,coordinate:u,hasPayload:S,offset:h,position:g,reverseDirection:v,useTranslate3d:y,viewBox:x,wrapperStyle:b},qEt(c,eQ(eQ({},this.props),{},{payload:_})))}}]),e}(M.PureComponent);pU(ml,"displayName","Tooltip");pU(ml,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!ql.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var XEt=cc,QEt=function(){return XEt.Date.now()},YEt=QEt,KEt=/\s/;function ZEt(t){for(var e=t.length;e--&&KEt.test(t.charAt(e)););return e}var JEt=ZEt,ePt=JEt,tPt=/^\s+/;function nPt(t){return t&&t.slice(0,ePt(t)+1).replace(tPt,"")}var rPt=nPt,iPt=rPt,nQ=wd,oPt=My,rQ=NaN,aPt=/^[-+]0x[0-9a-f]+$/i,sPt=/^0b[01]+$/i,lPt=/^0o[0-7]+$/i,cPt=parseInt;function uPt(t){if(typeof t=="number")return t;if(oPt(t))return rQ;if(nQ(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=nQ(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=iPt(t);var n=sPt.test(t);return n||lPt.test(t)?cPt(t.slice(2),n?2:8):aPt.test(t)?rQ:+t}var tge=uPt,fPt=wd,hI=YEt,iQ=tge,dPt="Expected a function",hPt=Math.max,pPt=Math.min;function mPt(t,e,n){var r,i,o,a,s,l,c=0,u=!1,f=!1,d=!0;if(typeof t!="function")throw new TypeError(dPt);e=iQ(e)||0,fPt(n)&&(u=!!n.leading,f="maxWait"in n,o=f?hPt(iQ(n.maxWait)||0,e):o,d="trailing"in n?!!n.trailing:d);function h(S){var O=r,C=i;return r=i=void 0,c=S,a=t.apply(C,O),a}function p(S){return c=S,s=setTimeout(v,e),u?h(S):a}function m(S){var O=S-l,C=S-c,E=e-O;return f?pPt(E,o-C):E}function g(S){var O=S-l,C=S-c;return l===void 0||O>=e||O<0||f&&C>=o}function v(){var S=hI();if(g(S))return y(S);s=setTimeout(v,m(S))}function y(S){return s=void 0,d&&r?h(S):(r=i=void 0,a)}function x(){s!==void 0&&clearTimeout(s),c=0,r=l=i=s=void 0}function b(){return s===void 0?a:y(hI())}function _(){var S=hI(),O=g(S);if(r=arguments,i=this,l=S,O){if(s===void 0)return p(l);if(f)return clearTimeout(s),s=setTimeout(v,e),h(l)}return s===void 0&&(s=setTimeout(v,e)),a}return _.cancel=x,_.flush=b,_}var gPt=mPt,vPt=gPt,yPt=wd,xPt="Expected a function";function bPt(t,e,n){var r=!0,i=!0;if(typeof t!="function")throw new TypeError(xPt);return yPt(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),vPt(t,e,{leading:r,maxWait:e,trailing:i})}var _Pt=bPt;const nge=Nt(_Pt);function y_(t){"@babel/helpers - typeof";return y_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y_(t)}function oQ(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function fO(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&(R=nge(R,m,{trailing:!0,leading:!1}));var T=new ResizeObserver(R),L=_.current.getBoundingClientRect(),z=L.width,B=L.height;return I(z,B),T.observe(_.current),function(){T.disconnect()}},[I,m]);var P=M.useMemo(function(){var R=E.containerWidth,T=E.containerHeight;if(R<0||T<0)return null;Jc(xh(a)||xh(l),`The width(%s) and height(%s) are both fixed numbers, maybe you don't need to use a ResponsiveContainer.`,a,l),Jc(!n||n>0,"The aspect(%s) must be greater than zero.",n);var L=xh(a)?R:a,z=xh(l)?T:l;n&&n>0&&(L?z=L/n:z&&(L=z*n),d&&z>d&&(z=d)),Jc(L>0||z>0,`The width(%s) and height(%s) of chart should be greater than 0, please check the style of container, or the props width(%s) and height(%s), or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the - height and width.`,L,z,a,l,u,f,n);var B=!Array.isArray(h)&&q3.isElement(h)&&Zc(h.type).endsWith("Chart");return ue.Children.map(h,function(W){return q3.isElement(W)?M.cloneElement(W,fO({width:L,height:z},B?{style:fO({height:"100%",width:"100%",maxHeight:z,maxWidth:L},W.props.style)}:{})):W})},[n,h,l,d,f,u,E,a]);return ue.createElement("div",{id:g?"".concat(g):void 0,className:ke("recharts-responsive-container",v),style:fO(fO({},b),{},{width:a,height:l,minWidth:u,minHeight:f,maxHeight:d}),ref:_},P)}),rge=function(e){return null};rge.displayName="Cell";function x_(t){"@babel/helpers - typeof";return x_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},x_(t)}function oQ(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function yN(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||ql.isSsr)return{width:0,height:0};var r=IPt(n),i=JSON.stringify({text:e,copyStyle:r});if(am.widthCache[i])return am.widthCache[i];try{var o=document.getElementById(aQ);o||(o=document.createElement("span"),o.setAttribute("id",aQ),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var a=yN(yN({},RPt),r);Object.assign(o.style,a),o.textContent="".concat(e);var s=o.getBoundingClientRect(),l={width:s.width,height:s.height};return am.widthCache[i]=l,++am.cacheCount>APt&&(am.cacheCount=0,am.widthCache={}),l}catch{return{width:0,height:0}}},DPt=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}};function b_(t){"@babel/helpers - typeof";return b_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b_(t)}function GE(t,e){return FPt(t)||NPt(t,e)||$Pt(t,e)||LPt()}function LPt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $Pt(t,e){if(t){if(typeof t=="string")return sQ(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sQ(t,e)}}function sQ(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function ZPt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function hQ(t,e){return nMt(t)||tMt(t,e)||eMt(t,e)||JPt()}function JPt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eMt(t,e){if(t){if(typeof t=="string")return pQ(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pQ(t,e)}}function pQ(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&arguments[0]!==void 0?arguments[0]:[];return L.reduce(function(z,B){var W=B.word,U=B.width,N=z[z.length-1];if(N&&(i==null||o||N.width+U+rB.width?z:B})};if(!u)return h;for(var m="…",g=function(L){var z=f.slice(0,L),B=sge({breakAll:c,style:l,children:z+m}).wordsWithComputedWidth,W=d(B),U=W.length>a||p(W).width>Number(i);return[U,W]},v=0,y=f.length-1,x=0,b;v<=y&&x<=f.length-1;){var _=Math.floor((v+y)/2),S=_-1,O=g(S),C=hQ(O,2),E=C[0],k=C[1],I=g(_),P=hQ(I,1),R=P[0];if(!E&&!R&&(v=_+1),E&&R&&(y=_-1),!E&&R){b=k;break}x++}return b||h},mQ=function(e){var n=qt(e)?[]:e.toString().split(age);return[{words:n}]},iMt=function(e){var n=e.width,r=e.scaleToFit,i=e.children,o=e.style,a=e.breakAll,s=e.maxLines;if((n||r)&&!ql.isSsr){var l,c,u=sge({breakAll:a,children:i,style:o});if(u){var f=u.wordsWithComputedWidth,d=u.spaceWidth;l=f,c=d}else return mQ(i);return rMt({breakAll:a,children:i,maxLines:s,style:o},l,c,n,r)}return mQ(i)},gQ="#808080",HE=function(e){var n=e.x,r=n===void 0?0:n,i=e.y,o=i===void 0?0:i,a=e.lineHeight,s=a===void 0?"1em":a,l=e.capHeight,c=l===void 0?"0.71em":l,u=e.scaleToFit,f=u===void 0?!1:u,d=e.textAnchor,h=d===void 0?"start":d,p=e.verticalAnchor,m=p===void 0?"end":p,g=e.fill,v=g===void 0?gQ:g,y=dQ(e,YPt),x=M.useMemo(function(){return iMt({breakAll:y.breakAll,children:y.children,maxLines:y.maxLines,scaleToFit:f,style:y.style,width:y.width})},[y.breakAll,y.children,y.maxLines,f,y.style,y.width]),b=y.dx,_=y.dy,S=y.angle,O=y.className,C=y.breakAll,E=dQ(y,KPt);if(!ei(r)||!ei(o))return null;var k=r+(Ye(b)?b:0),I=o+(Ye(_)?_:0),P;switch(m){case"start":P=hI("calc(".concat(c,")"));break;case"middle":P=hI("calc(".concat((x.length-1)/2," * -").concat(s," + (").concat(c," / 2))"));break;default:P=hI("calc(".concat(x.length-1," * -").concat(s,")"));break}var R=[];if(f){var T=x[0].width,L=y.width;R.push("scale(".concat((Ye(L)?L/T:1)/T,")"))}return S&&R.push("rotate(".concat(S,", ").concat(k,", ").concat(I,")")),R.length&&(E.transform=R.join(" ")),ue.createElement("text",xN({},jt(E,!0),{x:k,y:I,className:ke("recharts-text",O),textAnchor:h,fill:v.includes("url")?gQ:v}),x.map(function(z,B){var W=z.words.join(C?"":" ");return ue.createElement("tspan",{x:k,dy:B===0?P:s,key:W},W)}))};function zf(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function oMt(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function pU(t){let e,n,r;t.length!==2?(e=zf,n=(s,l)=>zf(t(s),l),r=(s,l)=>t(s)-l):(e=t===zf||t===oMt?t:aMt,n=t,r=t);function i(s,l,c=0,u=s.length){if(c>>1;n(s[f],l)<0?c=f+1:u=f}while(c>>1;n(s[f],l)<=0?c=f+1:u=f}while(cc&&r(s[f-1],l)>-r(s[f],l)?f-1:f}return{left:i,center:a,right:o}}function aMt(){return 0}function lge(t){return t===null?NaN:+t}function*sMt(t,e){if(e===void 0)for(let n of t)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of t)(r=e(r,++n,t))!=null&&(r=+r)>=r&&(yield r)}}const lMt=pU(zf),_w=lMt.right;pU(lge).center;class vQ extends Map{constructor(e,n=fMt){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[r,i]of e)this.set(r,i)}get(e){return super.get(yQ(this,e))}has(e){return super.has(yQ(this,e))}set(e,n){return super.set(cMt(this,e),n)}delete(e){return super.delete(uMt(this,e))}}function yQ({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function cMt({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function uMt({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function fMt(t){return t!==null&&typeof t=="object"?t.valueOf():t}function dMt(t=zf){if(t===zf)return cge;if(typeof t!="function")throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||r===0?r:(t(n,n)===0)-(t(e,e)===0)}}function cge(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(te?1:0)}const hMt=Math.sqrt(50),pMt=Math.sqrt(10),mMt=Math.sqrt(2);function qE(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=hMt?10:o>=pMt?5:o>=mMt?2:1;let s,l,c;return i<0?(c=Math.pow(10,-i)/a,s=Math.round(t*c),l=Math.round(e*c),s/ce&&--l,c=-c):(c=Math.pow(10,i)*a,s=Math.round(t/c),l=Math.round(e/c),s*ce&&--l),l0))return[];if(t===e)return[t];const r=e=i))return[];const s=o-i+1,l=new Array(s);if(r)if(a<0)for(let c=0;c=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n=i)&&(n=i)}return n}function bQ(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function uge(t,e,n=0,r=1/0,i){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(i=i===void 0?cge:dMt(i);r>n;){if(r-n>600){const l=r-n+1,c=e-n+1,u=Math.log(l),f=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*f*(l-f)/l)*(c-l/2<0?-1:1),h=Math.max(n,Math.floor(e-c*f/l+d)),p=Math.min(r,Math.floor(e+(l-c)*f/l+d));uge(t,e,h,p,i)}const o=t[e];let a=n,s=r;for(L0(t,n,e),i(t[r],o)>0&&L0(t,n,r);a0;)--s}i(t[n],o)===0?L0(t,n,s):(++s,L0(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function L0(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function gMt(t,e,n){if(t=Float64Array.from(sMt(t,n)),!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return bQ(t);if(e>=1)return xQ(t);var r,i=(r-1)*e,o=Math.floor(i),a=xQ(uge(t,o).subarray(0,o+1)),s=bQ(t.subarray(o+1));return a+(s-a)*(i-o)}}function vMt(t,e,n=lge){if(!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,o=Math.floor(i),a=+n(t[o],o,t),s=+n(t[o+1],o+1,t);return a+(s-a)*(i-o)}}function yMt(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((e-t)/n))|0,o=new Array(i);++r>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?hO(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?hO(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=bMt.exec(t))?new Ro(e[1],e[2],e[3],1):(e=_Mt.exec(t))?new Ro(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=wMt.exec(t))?hO(e[1],e[2],e[3],e[4]):(e=SMt.exec(t))?hO(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=OMt.exec(t))?EQ(e[1],e[2]/100,e[3]/100,1):(e=CMt.exec(t))?EQ(e[1],e[2]/100,e[3]/100,e[4]):_Q.hasOwnProperty(t)?OQ(_Q[t]):t==="transparent"?new Ro(NaN,NaN,NaN,0):null}function OQ(t){return new Ro(t>>16&255,t>>8&255,t&255,1)}function hO(t,e,n,r){return r<=0&&(t=e=n=NaN),new Ro(t,e,n,r)}function PMt(t){return t instanceof ww||(t=O_(t)),t?(t=t.rgb(),new Ro(t.r,t.g,t.b,t.opacity)):new Ro}function ON(t,e,n,r){return arguments.length===1?PMt(t):new Ro(t,e,n,r??1)}function Ro(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}gU(Ro,ON,dge(ww,{brighter(t){return t=t==null?XE:Math.pow(XE,t),new Ro(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?w_:Math.pow(w_,t),new Ro(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ro(Fh(this.r),Fh(this.g),Fh(this.b),QE(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:CQ,formatHex:CQ,formatHex8:MMt,formatRgb:TQ,toString:TQ}));function CQ(){return`#${bh(this.r)}${bh(this.g)}${bh(this.b)}`}function MMt(){return`#${bh(this.r)}${bh(this.g)}${bh(this.b)}${bh((isNaN(this.opacity)?1:this.opacity)*255)}`}function TQ(){const t=QE(this.opacity);return`${t===1?"rgb(":"rgba("}${Fh(this.r)}, ${Fh(this.g)}, ${Fh(this.b)}${t===1?")":`, ${t})`}`}function QE(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Fh(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function bh(t){return t=Fh(t),(t<16?"0":"")+t.toString(16)}function EQ(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new zs(t,e,n,r)}function hge(t){if(t instanceof zs)return new zs(t.h,t.s,t.l,t.opacity);if(t instanceof ww||(t=O_(t)),!t)return new zs;if(t instanceof zs)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(e===o?a=(n-r)/s+(n0&&l<1?0:a,new zs(a,s,l,t.opacity)}function kMt(t,e,n,r){return arguments.length===1?hge(t):new zs(t,e,n,r??1)}function zs(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}gU(zs,kMt,dge(ww,{brighter(t){return t=t==null?XE:Math.pow(XE,t),new zs(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?w_:Math.pow(w_,t),new zs(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Ro(pI(t>=240?t-240:t+120,i,r),pI(t,i,r),pI(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new zs(PQ(this.h),pO(this.s),pO(this.l),QE(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 t=QE(this.opacity);return`${t===1?"hsl(":"hsla("}${PQ(this.h)}, ${pO(this.s)*100}%, ${pO(this.l)*100}%${t===1?")":`, ${t})`}`}}));function PQ(t){return t=(t||0)%360,t<0?t+360:t}function pO(t){return Math.max(0,Math.min(1,t||0))}function pI(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const vU=t=>()=>t;function AMt(t,e){return function(n){return t+n*e}}function RMt(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function IMt(t){return(t=+t)==1?pge:function(e,n){return n-e?RMt(e,n,t):vU(isNaN(e)?n:e)}}function pge(t,e){var n=e-t;return n?AMt(t,n):vU(isNaN(t)?e:t)}const MQ=function t(e){var n=IMt(e);function r(i,o){var a=n((i=ON(i)).r,(o=ON(o)).r),s=n(i.g,o.g),l=n(i.b,o.b),c=pge(i.opacity,o.opacity);return function(u){return i.r=a(u),i.g=s(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=t,r}(1);function DMt(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(o){for(i=0;in&&(o=e.slice(n,o),s[a]?s[a]+=o:s[++a]=o),(r=r[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,l.push({i:a,x:YE(r,i)})),n=mI.lastIndex;return ne&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function GMt(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return i2?HMt:GMt,l=c=null,f}function f(d){return d==null||isNaN(d=+d)?o:(l||(l=s(t.map(r),e,n)))(r(a(d)))}return f.invert=function(d){return a(i((c||(c=s(e,t.map(r),YE)))(d)))},f.domain=function(d){return arguments.length?(t=Array.from(d,KE),u()):t.slice()},f.range=function(d){return arguments.length?(e=Array.from(d),u()):e.slice()},f.rangeRound=function(d){return e=Array.from(d),n=yU,u()},f.clamp=function(d){return arguments.length?(a=d?!0:lo,u()):a!==lo},f.interpolate=function(d){return arguments.length?(n=d,u()):n},f.unknown=function(d){return arguments.length?(o=d,f):o},function(d,h){return r=d,i=h,u()}}function xU(){return uk()(lo,lo)}function qMt(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function ZE(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function xv(t){return t=ZE(Math.abs(t)),t?t[1]:NaN}function XMt(t,e){return function(n,r){for(var i=n.length,o=[],a=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(n.substring(i-=s,i+s)),!((l+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(e)}}function QMt(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var YMt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function C_(t){if(!(e=YMt.exec(t)))throw new Error("invalid format: "+t);var e;return new bU({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}C_.prototype=bU.prototype;function bU(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}bU.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 KMt(t){e:for(var e=t.length,n=1,r=-1,i;n0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var mge;function ZMt(t,e){var n=ZE(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(mge=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+ZE(t,Math.max(0,e+o-1))[0]}function AQ(t,e){var n=ZE(t,e);if(!n)return t+"";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 RQ={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:qMt,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>AQ(t*100,e),r:AQ,s:ZMt,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function IQ(t){return t}var DQ=Array.prototype.map,LQ=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function JMt(t){var e=t.grouping===void 0||t.thousands===void 0?IQ:XMt(DQ.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",o=t.numerals===void 0?IQ:QMt(DQ.call(t.numerals,String)),a=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function c(f){f=C_(f);var d=f.fill,h=f.align,p=f.sign,m=f.symbol,g=f.zero,v=f.width,y=f.comma,x=f.precision,b=f.trim,_=f.type;_==="n"?(y=!0,_="g"):RQ[_]||(x===void 0&&(x=12),b=!0,_="g"),(g||d==="0"&&h==="=")&&(g=!0,d="0",h="=");var S=m==="$"?n:m==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",O=m==="$"?r:/[%p]/.test(_)?a:"",C=RQ[_],E=/[defgprs%]/.test(_);x=x===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function k(I){var P=S,R=O,T,L,z;if(_==="c")R=C(I)+R,I="";else{I=+I;var B=I<0||1/I<0;if(I=isNaN(I)?l:C(Math.abs(I),x),b&&(I=KMt(I)),B&&+I==0&&p!=="+"&&(B=!1),P=(B?p==="("?p:s:p==="-"||p==="("?"":p)+P,R=(_==="s"?LQ[8+mge/3]:"")+R+(B&&p==="("?")":""),E){for(T=-1,L=I.length;++Tz||z>57){R=(z===46?i+I.slice(T+1):I.slice(T))+R,I=I.slice(0,T);break}}}y&&!g&&(I=e(I,1/0));var W=P.length+I.length+R.length,U=W>1)+P+I+R+U.slice(W);break;default:I=U+P+I+R;break}return o(I)}return k.toString=function(){return f+""},k}function u(f,d){var h=c((f=C_(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(xv(d)/3)))*3,m=Math.pow(10,-p),g=LQ[8+p/3];return function(v){return h(m*v)+g}}return{format:c,formatPrefix:u}}var mO,_U,gge;e2t({thousands:",",grouping:[3],currency:["$",""]});function e2t(t){return mO=JMt(t),_U=mO.format,gge=mO.formatPrefix,mO}function t2t(t){return Math.max(0,-xv(Math.abs(t)))}function n2t(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(xv(e)/3)))*3-xv(Math.abs(t)))}function r2t(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,xv(e)-xv(t))+1}function vge(t,e,n,r){var i=wN(t,e,n),o;switch(r=C_(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(o=n2t(i,a))&&(r.precision=o),gge(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=r2t(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=t2t(i))&&(r.precision=o-(r.type==="%")*2);break}}return _U(r)}function Od(t){var e=t.domain;return t.ticks=function(n){var r=e();return bN(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return vge(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,o=r.length-1,a=r[i],s=r[o],l,c,u=10;for(s0;){if(c=_N(a,s,n),c===l)return r[i]=a,r[o]=s,e(r);if(c>0)a=Math.floor(a/c)*c,s=Math.ceil(s/c)*c;else if(c<0)a=Math.ceil(a*c)/c,s=Math.floor(s*c)/c;else break;l=c}return t},t}function JE(){var t=xU();return t.copy=function(){return Sw(t,JE())},ws.apply(t,arguments),Od(t)}function yge(t){var e;function n(r){return r==null||isNaN(r=+r)?e:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(t=Array.from(r,KE),n):t.slice()},n.unknown=function(r){return arguments.length?(e=r,n):e},n.copy=function(){return yge(t).unknown(e)},t=arguments.length?Array.from(t,KE):[0,1],Od(n)}function xge(t,e){t=t.slice();var n=0,r=t.length-1,i=t[n],o=t[r],a;return oMath.pow(t,e)}function l2t(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function FQ(t){return(e,n)=>-t(-e,n)}function wU(t){const e=t($Q,NQ),n=e.domain;let r=10,i,o;function a(){return i=l2t(r),o=s2t(r),n()[0]<0?(i=FQ(i),o=FQ(o),t(i2t,o2t)):t($Q,NQ),e}return e.base=function(s){return arguments.length?(r=+s,a()):r},e.domain=function(s){return arguments.length?(n(s),a()):n()},e.ticks=s=>{const l=n();let c=l[0],u=l[l.length-1];const f=u0){for(;d<=h;++d)for(p=1;pu)break;v.push(m)}}else for(;d<=h;++d)for(p=r-1;p>=1;--p)if(m=d>0?p/o(-d):p*o(d),!(mu)break;v.push(m)}v.length*2{if(s==null&&(s=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=C_(l)).precision==null&&(l.trim=!0),l=_U(l)),s===1/0)return l;const c=Math.max(1,r*s/e.ticks().length);return u=>{let f=u/o(Math.round(i(u)));return f*rn(xge(n(),{floor:s=>o(Math.floor(i(s))),ceil:s=>o(Math.ceil(i(s)))})),e}function bge(){const t=wU(uk()).domain([1,10]);return t.copy=()=>Sw(t,bge()).base(t.base()),ws.apply(t,arguments),t}function jQ(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function BQ(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function SU(t){var e=1,n=t(jQ(e),BQ(e));return n.constant=function(r){return arguments.length?t(jQ(e=+r),BQ(e)):e},Od(n)}function _ge(){var t=SU(uk());return t.copy=function(){return Sw(t,_ge()).constant(t.constant())},ws.apply(t,arguments)}function zQ(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function c2t(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function u2t(t){return t<0?-t*t:t*t}function OU(t){var e=t(lo,lo),n=1;function r(){return n===1?t(lo,lo):n===.5?t(c2t,u2t):t(zQ(n),zQ(1/n))}return e.exponent=function(i){return arguments.length?(n=+i,r()):n},Od(e)}function CU(){var t=OU(uk());return t.copy=function(){return Sw(t,CU()).exponent(t.exponent())},ws.apply(t,arguments),t}function f2t(){return CU.apply(null,arguments).exponent(.5)}function UQ(t){return Math.sign(t)*t*t}function d2t(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function wge(){var t=xU(),e=[0,1],n=!1,r;function i(o){var a=d2t(t(o));return isNaN(a)?r:n?Math.round(a):a}return i.invert=function(o){return t.invert(UQ(o))},i.domain=function(o){return arguments.length?(t.domain(o),i):t.domain()},i.range=function(o){return arguments.length?(t.range((e=Array.from(o,KE)).map(UQ)),i):e.slice()},i.rangeRound=function(o){return i.range(o).round(!0)},i.round=function(o){return arguments.length?(n=!!o,i):n},i.clamp=function(o){return arguments.length?(t.clamp(o),i):t.clamp()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return wge(t.domain(),e).round(n).clamp(t.clamp()).unknown(r)},ws.apply(i,arguments),Od(i)}function Sge(){var t=[],e=[],n=[],r;function i(){var a=0,s=Math.max(1,e.length);for(n=new Array(s-1);++a0?n[s-1]:t[0],s=n?[r[n-1],e]:[r[c-1],r[c]]},a.unknown=function(l){return arguments.length&&(o=l),a},a.thresholds=function(){return r.slice()},a.copy=function(){return Oge().domain([t,e]).range(i).unknown(o)},ws.apply(Od(a),arguments)}function Cge(){var t=[.5],e=[0,1],n,r=1;function i(o){return o!=null&&o<=o?e[_w(t,o,0,r)]:n}return i.domain=function(o){return arguments.length?(t=Array.from(o),r=Math.min(t.length,e.length-1),i):t.slice()},i.range=function(o){return arguments.length?(e=Array.from(o),r=Math.min(t.length,e.length-1),i):e.slice()},i.invertExtent=function(o){var a=e.indexOf(o);return[t[a-1],t[a]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return Cge().domain(t).range(e).unknown(n)},ws.apply(i,arguments)}const gI=new Date,vI=new Date;function ni(t,e,n,r){function i(o){return t(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(t(o=new Date(+o)),o),i.ceil=o=>(t(o=new Date(o-1)),e(o,1),t(o),o),i.round=o=>{const a=i(o),s=i.ceil(o);return o-a(e(o=new Date(+o),a==null?1:Math.floor(a)),o),i.range=(o,a,s)=>{const l=[];if(o=i.ceil(o),s=s==null?1:Math.floor(s),!(o0))return l;let c;do l.push(c=new Date(+o)),e(o,s),t(o);while(cni(a=>{if(a>=a)for(;t(a),!o(a);)a.setTime(a-1)},(a,s)=>{if(a>=a)if(s<0)for(;++s<=0;)for(;e(a,-1),!o(a););else for(;--s>=0;)for(;e(a,1),!o(a););}),n&&(i.count=(o,a)=>(gI.setTime(+o),vI.setTime(+a),t(gI),t(vI),Math.floor(n(gI,vI))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?a=>r(a)%o===0:a=>i.count(0,a)%o===0):i)),i}const eP=ni(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);eP.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?ni(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):eP);eP.range;const Vc=1e3,Ka=Vc*60,Gc=Ka*60,hu=Gc*24,TU=hu*7,WQ=hu*30,yI=hu*365,_h=ni(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*Vc)},(t,e)=>(e-t)/Vc,t=>t.getUTCSeconds());_h.range;const EU=ni(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Vc)},(t,e)=>{t.setTime(+t+e*Ka)},(t,e)=>(e-t)/Ka,t=>t.getMinutes());EU.range;const PU=ni(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*Ka)},(t,e)=>(e-t)/Ka,t=>t.getUTCMinutes());PU.range;const MU=ni(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Vc-t.getMinutes()*Ka)},(t,e)=>{t.setTime(+t+e*Gc)},(t,e)=>(e-t)/Gc,t=>t.getHours());MU.range;const kU=ni(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Gc)},(t,e)=>(e-t)/Gc,t=>t.getUTCHours());kU.range;const Ow=ni(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Ka)/hu,t=>t.getDate()-1);Ow.range;const fk=ni(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/hu,t=>t.getUTCDate()-1);fk.range;const Tge=ni(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/hu,t=>Math.floor(t/hu));Tge.range;function Ip(t){return ni(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*Ka)/TU)}const dk=Ip(0),tP=Ip(1),h2t=Ip(2),p2t=Ip(3),bv=Ip(4),m2t=Ip(5),g2t=Ip(6);dk.range;tP.range;h2t.range;p2t.range;bv.range;m2t.range;g2t.range;function Dp(t){return ni(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/TU)}const hk=Dp(0),nP=Dp(1),v2t=Dp(2),y2t=Dp(3),_v=Dp(4),x2t=Dp(5),b2t=Dp(6);hk.range;nP.range;v2t.range;y2t.range;_v.range;x2t.range;b2t.range;const AU=ni(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());AU.range;const RU=ni(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());RU.range;const pu=ni(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());pu.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:ni(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});pu.range;const mu=ni(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());mu.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:ni(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});mu.range;function Ege(t,e,n,r,i,o){const a=[[_h,1,Vc],[_h,5,5*Vc],[_h,15,15*Vc],[_h,30,30*Vc],[o,1,Ka],[o,5,5*Ka],[o,15,15*Ka],[o,30,30*Ka],[i,1,Gc],[i,3,3*Gc],[i,6,6*Gc],[i,12,12*Gc],[r,1,hu],[r,2,2*hu],[n,1,TU],[e,1,WQ],[e,3,3*WQ],[t,1,yI]];function s(c,u,f){const d=ug).right(a,d);if(h===a.length)return t.every(wN(c/yI,u/yI,f));if(h===0)return eP.every(Math.max(wN(c,u,f),1));const[p,m]=a[d/a[h-1][2]53)return null;"w"in re||(re.w=1),"Z"in re?(F=bI($0(re.y,0,1)),ce=F.getUTCDay(),F=ce>4||ce===0?nP.ceil(F):nP(F),F=fk.offset(F,(re.V-1)*7),re.y=F.getUTCFullYear(),re.m=F.getUTCMonth(),re.d=F.getUTCDate()+(re.w+6)%7):(F=xI($0(re.y,0,1)),ce=F.getDay(),F=ce>4||ce===0?tP.ceil(F):tP(F),F=Ow.offset(F,(re.V-1)*7),re.y=F.getFullYear(),re.m=F.getMonth(),re.d=F.getDate()+(re.w+6)%7)}else("W"in re||"U"in re)&&("w"in re||(re.w="u"in re?re.u%7:"W"in re?1:0),ce="Z"in re?bI($0(re.y,0,1)).getUTCDay():xI($0(re.y,0,1)).getDay(),re.m=0,re.d="W"in re?(re.w+6)%7+re.W*7-(ce+5)%7:re.w+re.U*7-(ce+6)%7);return"Z"in re?(re.H+=re.Z/100|0,re.M+=re.Z%100,bI(re)):xI(re)}}function C(J,pe,be,re){for(var ve=0,F=pe.length,ce=be.length,le,Q;ve=ce)return-1;if(le=pe.charCodeAt(ve++),le===37){if(le=pe.charAt(ve++),Q=_[le in VQ?pe.charAt(ve++):le],!Q||(re=Q(J,be,re))<0)return-1}else if(le!=be.charCodeAt(re++))return-1}return re}function E(J,pe,be){var re=c.exec(pe.slice(be));return re?(J.p=u.get(re[0].toLowerCase()),be+re[0].length):-1}function k(J,pe,be){var re=h.exec(pe.slice(be));return re?(J.w=p.get(re[0].toLowerCase()),be+re[0].length):-1}function I(J,pe,be){var re=f.exec(pe.slice(be));return re?(J.w=d.get(re[0].toLowerCase()),be+re[0].length):-1}function P(J,pe,be){var re=v.exec(pe.slice(be));return re?(J.m=y.get(re[0].toLowerCase()),be+re[0].length):-1}function R(J,pe,be){var re=m.exec(pe.slice(be));return re?(J.m=g.get(re[0].toLowerCase()),be+re[0].length):-1}function T(J,pe,be){return C(J,e,pe,be)}function L(J,pe,be){return C(J,n,pe,be)}function z(J,pe,be){return C(J,r,pe,be)}function B(J){return a[J.getDay()]}function W(J){return o[J.getDay()]}function U(J){return l[J.getMonth()]}function N(J){return s[J.getMonth()]}function $(J){return i[+(J.getHours()>=12)]}function D(J){return 1+~~(J.getMonth()/3)}function A(J){return a[J.getUTCDay()]}function q(J){return o[J.getUTCDay()]}function Y(J){return l[J.getUTCMonth()]}function K(J){return s[J.getUTCMonth()]}function se(J){return i[+(J.getUTCHours()>=12)]}function te(J){return 1+~~(J.getUTCMonth()/3)}return{format:function(J){var pe=S(J+="",x);return pe.toString=function(){return J},pe},parse:function(J){var pe=O(J+="",!1);return pe.toString=function(){return J},pe},utcFormat:function(J){var pe=S(J+="",b);return pe.toString=function(){return J},pe},utcParse:function(J){var pe=O(J+="",!0);return pe.toString=function(){return J},pe}}}var VQ={"-":"",_:" ",0:"0"},gi=/^\s*\d+/,T2t=/^%/,E2t=/[\\^$*+?|[\]().{}]/g;function hn(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o[e.toLowerCase(),n]))}function M2t(t,e,n){var r=gi.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function k2t(t,e,n){var r=gi.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function A2t(t,e,n){var r=gi.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function R2t(t,e,n){var r=gi.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function I2t(t,e,n){var r=gi.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function GQ(t,e,n){var r=gi.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function HQ(t,e,n){var r=gi.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function D2t(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function L2t(t,e,n){var r=gi.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function $2t(t,e,n){var r=gi.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function qQ(t,e,n){var r=gi.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function N2t(t,e,n){var r=gi.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function XQ(t,e,n){var r=gi.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function F2t(t,e,n){var r=gi.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function j2t(t,e,n){var r=gi.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function B2t(t,e,n){var r=gi.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function z2t(t,e,n){var r=gi.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function U2t(t,e,n){var r=T2t.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function W2t(t,e,n){var r=gi.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function V2t(t,e,n){var r=gi.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function QQ(t,e){return hn(t.getDate(),e,2)}function G2t(t,e){return hn(t.getHours(),e,2)}function H2t(t,e){return hn(t.getHours()%12||12,e,2)}function q2t(t,e){return hn(1+Ow.count(pu(t),t),e,3)}function Pge(t,e){return hn(t.getMilliseconds(),e,3)}function X2t(t,e){return Pge(t,e)+"000"}function Q2t(t,e){return hn(t.getMonth()+1,e,2)}function Y2t(t,e){return hn(t.getMinutes(),e,2)}function K2t(t,e){return hn(t.getSeconds(),e,2)}function Z2t(t){var e=t.getDay();return e===0?7:e}function J2t(t,e){return hn(dk.count(pu(t)-1,t),e,2)}function Mge(t){var e=t.getDay();return e>=4||e===0?bv(t):bv.ceil(t)}function ekt(t,e){return t=Mge(t),hn(bv.count(pu(t),t)+(pu(t).getDay()===4),e,2)}function tkt(t){return t.getDay()}function nkt(t,e){return hn(tP.count(pu(t)-1,t),e,2)}function rkt(t,e){return hn(t.getFullYear()%100,e,2)}function ikt(t,e){return t=Mge(t),hn(t.getFullYear()%100,e,2)}function okt(t,e){return hn(t.getFullYear()%1e4,e,4)}function akt(t,e){var n=t.getDay();return t=n>=4||n===0?bv(t):bv.ceil(t),hn(t.getFullYear()%1e4,e,4)}function skt(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+hn(e/60|0,"0",2)+hn(e%60,"0",2)}function YQ(t,e){return hn(t.getUTCDate(),e,2)}function lkt(t,e){return hn(t.getUTCHours(),e,2)}function ckt(t,e){return hn(t.getUTCHours()%12||12,e,2)}function ukt(t,e){return hn(1+fk.count(mu(t),t),e,3)}function kge(t,e){return hn(t.getUTCMilliseconds(),e,3)}function fkt(t,e){return kge(t,e)+"000"}function dkt(t,e){return hn(t.getUTCMonth()+1,e,2)}function hkt(t,e){return hn(t.getUTCMinutes(),e,2)}function pkt(t,e){return hn(t.getUTCSeconds(),e,2)}function mkt(t){var e=t.getUTCDay();return e===0?7:e}function gkt(t,e){return hn(hk.count(mu(t)-1,t),e,2)}function Age(t){var e=t.getUTCDay();return e>=4||e===0?_v(t):_v.ceil(t)}function vkt(t,e){return t=Age(t),hn(_v.count(mu(t),t)+(mu(t).getUTCDay()===4),e,2)}function ykt(t){return t.getUTCDay()}function xkt(t,e){return hn(nP.count(mu(t)-1,t),e,2)}function bkt(t,e){return hn(t.getUTCFullYear()%100,e,2)}function _kt(t,e){return t=Age(t),hn(t.getUTCFullYear()%100,e,2)}function wkt(t,e){return hn(t.getUTCFullYear()%1e4,e,4)}function Skt(t,e){var n=t.getUTCDay();return t=n>=4||n===0?_v(t):_v.ceil(t),hn(t.getUTCFullYear()%1e4,e,4)}function Okt(){return"+0000"}function KQ(){return"%"}function ZQ(t){return+t}function JQ(t){return Math.floor(+t/1e3)}var sm,Rge,Ige;Ckt({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 Ckt(t){return sm=C2t(t),Rge=sm.format,sm.parse,Ige=sm.utcFormat,sm.utcParse,sm}function Tkt(t){return new Date(t)}function Ekt(t){return t instanceof Date?+t:+new Date(+t)}function IU(t,e,n,r,i,o,a,s,l,c){var u=xU(),f=u.invert,d=u.domain,h=c(".%L"),p=c(":%S"),m=c("%I:%M"),g=c("%I %p"),v=c("%a %d"),y=c("%b %d"),x=c("%B"),b=c("%Y");function _(S){return(l(S)e(i/(t.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,o)=>gMt(t,o/r))},n.copy=function(){return Nge(e).domain(t)},Su.apply(n,arguments)}function mk(){var t=0,e=.5,n=1,r=1,i,o,a,s,l,c=lo,u,f=!1,d;function h(m){return isNaN(m=+m)?d:(m=.5+((m=+u(m))-o)*(r*me}var Lkt=Dkt,$kt=zge,Nkt=Lkt,Fkt=Fy;function jkt(t){return t&&t.length?$kt(t,Fkt,Nkt):void 0}var Bkt=jkt;const wf=Nt(Bkt);function zkt(t,e){return tt.e^o.s<0?1:-1;for(r=o.d.length,i=t.d.length,e=0,n=rt.d[e]^o.s<0?1:-1;return r===i?0:r>i^o.s<0?1:-1};ut.decimalPlaces=ut.dp=function(){var t=this,e=t.d.length-1,n=(e-t.e)*Qn;if(e=t.d[e],e)for(;e%10==0;e/=10)n--;return n<0?0:n};ut.dividedBy=ut.div=function(t){return eu(this,new this.constructor(t))};ut.dividedToIntegerBy=ut.idiv=function(t){var e=this,n=e.constructor;return Ln(eu(e,new n(t),0,1),n.precision)};ut.equals=ut.eq=function(t){return!this.cmp(t)};ut.exponent=function(){return Wr(this)};ut.greaterThan=ut.gt=function(t){return this.cmp(t)>0};ut.greaterThanOrEqualTo=ut.gte=function(t){return this.cmp(t)>=0};ut.isInteger=ut.isint=function(){return this.e>this.d.length-2};ut.isNegative=ut.isneg=function(){return this.s<0};ut.isPositive=ut.ispos=function(){return this.s>0};ut.isZero=function(){return this.s===0};ut.lessThan=ut.lt=function(t){return this.cmp(t)<0};ut.lessThanOrEqualTo=ut.lte=function(t){return this.cmp(t)<1};ut.logarithm=ut.log=function(t){var e,n=this,r=n.constructor,i=r.precision,o=i+5;if(t===void 0)t=new r(10);else if(t=new r(t),t.s<1||t.eq(ha))throw Error(ms+"NaN");if(n.s<1)throw Error(ms+(n.s?"NaN":"-Infinity"));return n.eq(ha)?new r(0):(fr=!1,e=eu(T_(n,o),T_(t,o),o),fr=!0,Ln(e,i))};ut.minus=ut.sub=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?Gge(e,t):Wge(e,(t.s=-t.s,t))};ut.modulo=ut.mod=function(t){var e,n=this,r=n.constructor,i=r.precision;if(t=new r(t),!t.s)throw Error(ms+"NaN");return n.s?(fr=!1,e=eu(n,t,0,1).times(t),fr=!0,n.minus(e)):Ln(new r(n),i)};ut.naturalExponential=ut.exp=function(){return Vge(this)};ut.naturalLogarithm=ut.ln=function(){return T_(this)};ut.negated=ut.neg=function(){var t=new this.constructor(this);return t.s=-t.s||0,t};ut.plus=ut.add=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?Wge(e,t):Gge(e,(t.s=-t.s,t))};ut.precision=ut.sd=function(t){var e,n,r,i=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(jh+t);if(e=Wr(i)+1,r=i.d.length-1,n=r*Qn+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return t&&e>n?e:n};ut.squareRoot=ut.sqrt=function(){var t,e,n,r,i,o,a,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(ms+"NaN")}for(t=Wr(s),fr=!1,i=Math.sqrt(+s),i==0||i==1/0?(e=Dl(s.d),(e.length+t)%2==0&&(e+="0"),i=Math.sqrt(e),t=zy((t+1)/2)-(t<0||t%2),i==1/0?e="5e"+t:(e=i.toExponential(),e=e.slice(0,e.indexOf("e")+1)+t),r=new l(e)):r=new l(i.toString()),n=l.precision,i=a=n+3;;)if(o=r,r=o.plus(eu(s,o,a+2)).times(.5),Dl(o.d).slice(0,a)===(e=Dl(r.d)).slice(0,a)){if(e=e.slice(a-3,a+1),i==a&&e=="4999"){if(Ln(o,n+1,0),o.times(o).eq(s)){r=o;break}}else if(e!="9999")break;a+=4}return fr=!0,Ln(r,n)};ut.times=ut.mul=function(t){var e,n,r,i,o,a,s,l,c,u=this,f=u.constructor,d=u.d,h=(t=new f(t)).d;if(!u.s||!t.s)return new f(0);for(t.s*=u.s,n=u.e+t.e,l=d.length,c=h.length,l=0;){for(e=0,i=l+r;i>r;)s=o[i]+h[r]*d[i-r-1]+e,o[i--]=s%si|0,e=s/si|0;o[i]=(o[i]+e)%si|0}for(;!o[--a];)o.pop();return e?++n:o.shift(),t.d=o,t.e=n,fr?Ln(t,f.precision):t};ut.toDecimalPlaces=ut.todp=function(t,e){var n=this,r=n.constructor;return n=new r(n),t===void 0?n:(Jl(t,0,By),e===void 0?e=r.rounding:Jl(e,0,8),Ln(n,t+Wr(n)+1,e))};ut.toExponential=function(t,e){var n,r=this,i=r.constructor;return t===void 0?n=ap(r,!0):(Jl(t,0,By),e===void 0?e=i.rounding:Jl(e,0,8),r=Ln(new i(r),t+1,e),n=ap(r,!0,t+1)),n};ut.toFixed=function(t,e){var n,r,i=this,o=i.constructor;return t===void 0?ap(i):(Jl(t,0,By),e===void 0?e=o.rounding:Jl(e,0,8),r=Ln(new o(i),t+Wr(i)+1,e),n=ap(r.abs(),!1,t+Wr(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};ut.toInteger=ut.toint=function(){var t=this,e=t.constructor;return Ln(new e(t),Wr(t)+1,e.rounding)};ut.toNumber=function(){return+this};ut.toPower=ut.pow=function(t){var e,n,r,i,o,a,s=this,l=s.constructor,c=12,u=+(t=new l(t));if(!t.s)return new l(ha);if(s=new l(s),!s.s){if(t.s<1)throw Error(ms+"Infinity");return s}if(s.eq(ha))return s;if(r=l.precision,t.eq(ha))return Ln(s,r);if(e=t.e,n=t.d.length-1,a=e>=n,o=s.s,a){if((n=u<0?-u:u)<=Uge){for(i=new l(ha),e=Math.ceil(r/Qn+4),fr=!1;n%2&&(i=i.times(s),nY(i.d,e)),n=zy(n/2),n!==0;)s=s.times(s),nY(s.d,e);return fr=!0,t.s<0?new l(ha).div(i):Ln(i,r)}}else if(o<0)throw Error(ms+"NaN");return o=o<0&&t.d[Math.max(e,n)]&1?-1:1,s.s=1,fr=!1,i=t.times(T_(s,r+c)),fr=!0,i=Vge(i),i.s=o,i};ut.toPrecision=function(t,e){var n,r,i=this,o=i.constructor;return t===void 0?(n=Wr(i),r=ap(i,n<=o.toExpNeg||n>=o.toExpPos)):(Jl(t,1,By),e===void 0?e=o.rounding:Jl(e,0,8),i=Ln(new o(i),t,e),n=Wr(i),r=ap(i,t<=n||n<=o.toExpNeg,t)),r};ut.toSignificantDigits=ut.tosd=function(t,e){var n=this,r=n.constructor;return t===void 0?(t=r.precision,e=r.rounding):(Jl(t,1,By),e===void 0?e=r.rounding:Jl(e,0,8)),Ln(new r(n),t,e)};ut.toString=ut.valueOf=ut.val=ut.toJSON=ut[Symbol.for("nodejs.util.inspect.custom")]=function(){var t=this,e=Wr(t),n=t.constructor;return ap(t,e<=n.toExpNeg||e>=n.toExpPos)};function Wge(t,e){var n,r,i,o,a,s,l,c,u=t.constructor,f=u.precision;if(!t.s||!e.s)return e.s||(e=new u(t)),fr?Ln(e,f):e;if(l=t.d,c=e.d,a=t.e,i=e.e,l=l.slice(),o=a-i,o){for(o<0?(r=l,o=-o,s=c.length):(r=c,i=a,s=l.length),a=Math.ceil(f/Qn),s=a>s?a+1:s+1,o>s&&(o=s,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(s=l.length,o=c.length,s-o<0&&(o=s,r=c,c=l,l=r),n=0;o;)n=(l[--o]=l[o]+c[o]+n)/si|0,l[o]%=si;for(n&&(l.unshift(n),++i),s=l.length;l[--s]==0;)l.pop();return e.d=l,e.e=i,fr?Ln(e,f):e}function Jl(t,e,n){if(t!==~~t||tn)throw Error(jh+t)}function Dl(t){var e,n,r,i=t.length-1,o="",a=t[0];if(i>0){for(o+=a,e=1;ea?1:-1;else for(s=l=0;si[s]?1:-1;break}return l}function n(r,i,o){for(var a=0;o--;)r[o]-=a,a=r[o]1;)r.shift()}return function(r,i,o,a){var s,l,c,u,f,d,h,p,m,g,v,y,x,b,_,S,O,C,E=r.constructor,k=r.s==i.s?1:-1,I=r.d,P=i.d;if(!r.s)return new E(r);if(!i.s)throw Error(ms+"Division by zero");for(l=r.e-i.e,O=P.length,_=I.length,h=new E(k),p=h.d=[],c=0;P[c]==(I[c]||0);)++c;if(P[c]>(I[c]||0)&&--l,o==null?y=o=E.precision:a?y=o+(Wr(r)-Wr(i))+1:y=o,y<0)return new E(0);if(y=y/Qn+2|0,c=0,O==1)for(u=0,P=P[0],y++;(c<_||u)&&y--;c++)x=u*si+(I[c]||0),p[c]=x/P|0,u=x%P|0;else{for(u=si/(P[0]+1)|0,u>1&&(P=t(P,u),I=t(I,u),O=P.length,_=I.length),b=O,m=I.slice(0,O),g=m.length;g=si/2&&++S;do u=0,s=e(P,m,O,g),s<0?(v=m[0],O!=g&&(v=v*si+(m[1]||0)),u=v/S|0,u>1?(u>=si&&(u=si-1),f=t(P,u),d=f.length,g=m.length,s=e(f,m,d,g),s==1&&(u--,n(f,O16)throw Error($U+Wr(t));if(!t.s)return new u(ha);for(e==null?(fr=!1,s=f):s=e,a=new u(.03125);t.abs().gte(.1);)t=t.times(a),c+=5;for(r=Math.log(Yd(2,c))/Math.LN10*2+5|0,s+=r,n=i=o=new u(ha),u.precision=s;;){if(i=Ln(i.times(t),s),n=n.times(++l),a=o.plus(eu(i,n,s)),Dl(a.d).slice(0,s)===Dl(o.d).slice(0,s)){for(;c--;)o=Ln(o.times(o),s);return u.precision=f,e==null?(fr=!0,Ln(o,f)):o}o=a}}function Wr(t){for(var e=t.e*Qn,n=t.d[0];n>=10;n/=10)e++;return e}function _I(t,e,n){if(e>t.LN10.sd())throw fr=!0,n&&(t.precision=n),Error(ms+"LN10 precision limit exceeded");return Ln(new t(t.LN10),e)}function sf(t){for(var e="";t--;)e+="0";return e}function T_(t,e){var n,r,i,o,a,s,l,c,u,f=1,d=10,h=t,p=h.d,m=h.constructor,g=m.precision;if(h.s<1)throw Error(ms+(h.s?"NaN":"-Infinity"));if(h.eq(ha))return new m(0);if(e==null?(fr=!1,c=g):c=e,h.eq(10))return e==null&&(fr=!0),_I(m,c);if(c+=d,m.precision=c,n=Dl(p),r=n.charAt(0),o=Wr(h),Math.abs(o)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)h=h.times(t),n=Dl(h.d),r=n.charAt(0),f++;o=Wr(h),r>1?(h=new m("0."+n),o++):h=new m(r+"."+n.slice(1))}else return l=_I(m,c+2,g).times(o+""),h=T_(new m(r+"."+n.slice(1)),c-d).plus(l),m.precision=g,e==null?(fr=!0,Ln(h,g)):h;for(s=a=h=eu(h.minus(ha),h.plus(ha),c),u=Ln(h.times(h),c),i=3;;){if(a=Ln(a.times(u),c),l=s.plus(eu(a,new m(i),c)),Dl(l.d).slice(0,c)===Dl(s.d).slice(0,c))return s=s.times(2),o!==0&&(s=s.plus(_I(m,c+2,g).times(o+""))),s=eu(s,new m(f),c),m.precision=g,e==null?(fr=!0,Ln(s,g)):s;s=l,i+=2}}function tY(t,e){var n,r,i;for((n=e.indexOf("."))>-1&&(e=e.replace(".","")),(r=e.search(/e/i))>0?(n<0&&(n=r),n+=+e.slice(r+1),e=e.substring(0,r)):n<0&&(n=e.length),r=0;e.charCodeAt(r)===48;)++r;for(i=e.length;e.charCodeAt(i-1)===48;)--i;if(e=e.slice(r,i),e){if(i-=r,n=n-r-1,t.e=zy(n/Qn),t.d=[],r=(n+1)%Qn,n<0&&(r+=Qn),rrP||t.e<-rP))throw Error($U+n)}else t.s=0,t.e=0,t.d=[0];return t}function Ln(t,e,n){var r,i,o,a,s,l,c,u,f=t.d;for(a=1,o=f[0];o>=10;o/=10)a++;if(r=e-a,r<0)r+=Qn,i=e,c=f[u=0];else{if(u=Math.ceil((r+1)/Qn),o=f.length,u>=o)return t;for(c=o=f[u],a=1;o>=10;o/=10)a++;r%=Qn,i=r-Qn+a}if(n!==void 0&&(o=Yd(10,a-i-1),s=c/o%10|0,l=e<0||f[u+1]!==void 0||c%o,l=n<4?(s||l)&&(n==0||n==(t.s<0?3:2)):s>5||s==5&&(n==4||l||n==6&&(r>0?i>0?c/Yd(10,a-i):0:f[u-1])%10&1||n==(t.s<0?8:7))),e<1||!f[0])return l?(o=Wr(t),f.length=1,e=e-o-1,f[0]=Yd(10,(Qn-e%Qn)%Qn),t.e=zy(-e/Qn)||0):(f.length=1,f[0]=t.e=t.s=0),t;if(r==0?(f.length=u,o=1,u--):(f.length=u+1,o=Yd(10,Qn-r),f[u]=i>0?(c/Yd(10,a-i)%Yd(10,i)|0)*o:0),l)for(;;)if(u==0){(f[0]+=o)==si&&(f[0]=1,++t.e);break}else{if(f[u]+=o,f[u]!=si)break;f[u--]=0,o=1}for(r=f.length;f[--r]===0;)f.pop();if(fr&&(t.e>rP||t.e<-rP))throw Error($U+Wr(t));return t}function Gge(t,e){var n,r,i,o,a,s,l,c,u,f,d=t.constructor,h=d.precision;if(!t.s||!e.s)return e.s?e.s=-e.s:e=new d(t),fr?Ln(e,h):e;if(l=t.d,f=e.d,r=e.e,c=t.e,l=l.slice(),a=c-r,a){for(u=a<0,u?(n=l,a=-a,s=f.length):(n=f,r=c,s=l.length),i=Math.max(Math.ceil(h/Qn),s)+2,a>i&&(a=i,n.length=1),n.reverse(),i=a;i--;)n.push(0);n.reverse()}else{for(i=l.length,s=f.length,u=i0;--i)l[s++]=0;for(i=f.length;i>a;){if(l[--i]0?o=o.charAt(0)+"."+o.slice(1)+sf(r):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+sf(-i-1)+o,n&&(r=n-a)>0&&(o+=sf(r))):i>=a?(o+=sf(i+1-a),n&&(r=n-i-1)>0&&(o=o+"."+sf(r))):((r=i+1)0&&(i+1===a&&(o+="."),o+=sf(r))),t.s<0?"-"+o:o}function nY(t,e){if(t.length>e)return t.length=e,!0}function Hge(t){var e,n,r;function i(o){var a=this;if(!(a instanceof i))return new i(o);if(a.constructor=i,o instanceof i){a.s=o.s,a.e=o.e,a.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(jh+o);if(o>0)a.s=1;else if(o<0)o=-o,a.s=-1;else{a.s=0,a.e=0,a.d=[0];return}if(o===~~o&&o<1e7){a.e=0,a.d=[o];return}return tY(a,o.toString())}else if(typeof o!="string")throw Error(jh+o);if(o.charCodeAt(0)===45?(o=o.slice(1),a.s=-1):a.s=1,cAt.test(o))tY(a,o);else throw Error(jh+o)}if(i.prototype=ut,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=Hge,i.config=i.set=uAt,t===void 0&&(t={}),t)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],e=0;e=i[e+1]&&r<=i[e+2])this[n]=r;else throw Error(jh+n+": "+r);if((r=t[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(jh+n+": "+r);return this}var NU=Hge(lAt);ha=new NU(1);const Rn=NU;function fAt(t){return mAt(t)||pAt(t)||hAt(t)||dAt()}function dAt(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hAt(t,e){if(t){if(typeof t=="string")return EN(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return EN(t,e)}}function pAt(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function mAt(t){if(Array.isArray(t))return EN(t)}function EN(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=e?n.apply(void 0,i):t(e-a,rY(function(){for(var s=arguments.length,l=new Array(s),c=0;ct.length)&&(e=t.length);for(var n=0,r=new Array(e);n"u"||!(Symbol.iterator in Object(t)))){var n=[],r=!0,i=!1,o=void 0;try{for(var a=t[Symbol.iterator](),s;!(r=(s=a.next()).done)&&(n.push(s.value),!(e&&n.length===e));r=!0);}catch(l){i=!0,o=l}finally{try{!r&&a.return!=null&&a.return()}finally{if(i)throw o}}return n}}function kAt(t){if(Array.isArray(t))return t}function Kge(t){var e=E_(t,2),n=e[0],r=e[1],i=n,o=r;return n>r&&(i=r,o=n),[i,o]}function Zge(t,e,n){if(t.lte(0))return new Rn(0);var r=yk.getDigitCount(t.toNumber()),i=new Rn(10).pow(r),o=t.div(i),a=r!==1?.05:.1,s=new Rn(Math.ceil(o.div(a).toNumber())).add(n).mul(a),l=s.mul(i);return e?l:new Rn(Math.ceil(l))}function AAt(t,e,n){var r=1,i=new Rn(t);if(!i.isint()&&n){var o=Math.abs(t);o<1?(r=new Rn(10).pow(yk.getDigitCount(t)-1),i=new Rn(Math.floor(i.div(r).toNumber())).mul(r)):o>1&&(i=new Rn(Math.floor(t)))}else t===0?i=new Rn(Math.floor((e-1)/2)):n||(i=new Rn(Math.floor(t)));var a=Math.floor((e-1)/2),s=xAt(yAt(function(l){return i.add(new Rn(l-a).mul(r)).toNumber()}),PN);return s(0,e)}function Jge(t,e,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((e-t)/(n-1)))return{step:new Rn(0),tickMin:new Rn(0),tickMax:new Rn(0)};var o=Zge(new Rn(e).sub(t).div(n-1),r,i),a;t<=0&&e>=0?a=new Rn(0):(a=new Rn(t).add(e).div(2),a=a.sub(new Rn(a).mod(o)));var s=Math.ceil(a.sub(t).div(o).toNumber()),l=Math.ceil(new Rn(e).sub(a).div(o).toNumber()),c=s+l+1;return c>n?Jge(t,e,n,r,i+1):(c0?l+(n-c):l,s=e>0?s:s+(n-c)),{step:o,tickMin:a.sub(new Rn(s).mul(o)),tickMax:a.add(new Rn(l).mul(o))})}function RAt(t){var e=E_(t,2),n=e[0],r=e[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=Math.max(i,2),s=Kge([n,r]),l=E_(s,2),c=l[0],u=l[1];if(c===-1/0||u===1/0){var f=u===1/0?[c].concat(kN(PN(0,i-1).map(function(){return 1/0}))):[].concat(kN(PN(0,i-1).map(function(){return-1/0})),[u]);return n>r?MN(f):f}if(c===u)return AAt(c,i,o);var d=Jge(c,u,a,o),h=d.step,p=d.tickMin,m=d.tickMax,g=yk.rangeStep(p,m.add(new Rn(.1).mul(h)),h);return n>r?MN(g):g}function IAt(t,e){var n=E_(t,2),r=n[0],i=n[1],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=Kge([r,i]),s=E_(a,2),l=s[0],c=s[1];if(l===-1/0||c===1/0)return[r,i];if(l===c)return[l];var u=Math.max(e,2),f=Zge(new Rn(c).sub(l).div(u-1),o,0),d=[].concat(kN(yk.rangeStep(new Rn(l),new Rn(c).sub(new Rn(.99).mul(f)),f)),[c]);return r>i?MN(d):d}var DAt=Qge(RAt),LAt=Qge(IAt),$At="Invariant failed";function sp(t,e){if(!t)throw new Error($At)}var NAt=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function iP(){return iP=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function VAt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function Uy(t){var e=t.offset,n=t.layout,r=t.width,i=t.dataKey,o=t.data,a=t.dataPointFormatter,s=t.xAxis,l=t.yAxis,c=WAt(t,NAt),u=jt(c,!1);t.direction==="x"&&s.type!=="number"&&sp(!1);var f=o.map(function(d){var h=a(d,i),p=h.x,m=h.y,g=h.value,v=h.errorVal;if(!v)return null;var y=[],x,b;if(Array.isArray(v)){var _=FAt(v,2);x=_[0],b=_[1]}else x=b=v;if(n==="vertical"){var S=s.scale,O=m+e,C=O+r,E=O-r,k=S(g-x),I=S(g+b);y.push({x1:I,y1:C,x2:I,y2:E}),y.push({x1:k,y1:O,x2:I,y2:O}),y.push({x1:k,y1:C,x2:k,y2:E})}else if(n==="horizontal"){var P=l.scale,R=p+e,T=R-r,L=R+r,z=P(g-x),B=P(g+b);y.push({x1:T,y1:B,x2:L,y2:B}),y.push({x1:R,y1:z,x2:R,y2:B}),y.push({x1:T,y1:z,x2:L,y2:z})}return ue.createElement(Vn,iP({className:"recharts-errorBar",key:"bar-".concat(y.map(function(W){return"".concat(W.x1,"-").concat(W.x2,"-").concat(W.y1,"-").concat(W.y2)}))},u),y.map(function(W){return ue.createElement("line",iP({},W,{key:"line-".concat(W.x1,"-").concat(W.x2,"-").concat(W.y1,"-").concat(W.y2)}))}))});return ue.createElement(Vn,{className:"recharts-errorBars"},f)}Uy.defaultProps={stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"};Uy.displayName="ErrorBar";function P_(t){"@babel/helpers - typeof";return P_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},P_(t)}function oY(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function wI(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,a=-1,s=(n=r==null?void 0:r.length)!==null&&n!==void 0?n:0;if(s<=1)return 0;if(o&&o.axisType==="angleAxis"&&Math.abs(Math.abs(o.range[1]-o.range[0])-360)<=1e-6)for(var l=o.range,c=0;c0?i[c-1].coordinate:i[s-1].coordinate,f=i[c].coordinate,d=c>=s-1?i[0].coordinate:i[c+1].coordinate,h=void 0;if(Vs(f-u)!==Vs(d-f)){var p=[];if(Vs(d-f)===Vs(l[1]-l[0])){h=d;var m=f+l[1]-l[0];p[0]=Math.min(m,(m+u)/2),p[1]=Math.max(m,(m+u)/2)}else{h=u;var g=d+l[1]-l[0];p[0]=Math.min(f,(g+f)/2),p[1]=Math.max(f,(g+f)/2)}var v=[Math.min(f,(h+f)/2),Math.max(f,(h+f)/2)];if(e>v[0]&&e<=v[1]||e>=p[0]&&e<=p[1]){a=i[c].index;break}}else{var y=Math.min(u,d),x=Math.max(u,d);if(e>(y+f)/2&&e<=(x+f)/2){a=i[c].index;break}}}else for(var b=0;b0&&b(r[b].coordinate+r[b-1].coordinate)/2&&e<=(r[b].coordinate+r[b+1].coordinate)/2||b===s-1&&e>(r[b].coordinate+r[b-1].coordinate)/2){a=r[b].index;break}return a},FU=function(e){var n=e,r=n.type.displayName,i=e.props,o=i.stroke,a=i.fill,s;switch(r){case"Line":s=o;break;case"Area":case"Radar":s=o&&o!=="none"?o:a;break;default:s=a;break}return s},tRt=function(e){var n=e.barSize,r=e.stackGroups,i=r===void 0?{}:r;if(!i)return{};for(var o={},a=Object.keys(i),s=0,l=a.length;s=0});if(g&&g.length){var v=g[0].props.barSize,y=g[0].props[m];o[y]||(o[y]=[]),o[y].push({item:g[0],stackList:g.slice(1),barSize:qt(v)?n:v})}}return o},nRt=function(e){var n=e.barGap,r=e.barCategoryGap,i=e.bandSize,o=e.sizeList,a=o===void 0?[]:o,s=e.maxBarSize,l=a.length;if(l<1)return null;var c=dv(n,i,0,!0),u,f=[];if(a[0].barSize===+a[0].barSize){var d=!1,h=i/l,p=a.reduce(function(b,_){return b+_.barSize||0},0);p+=(l-1)*c,p>=i&&(p-=(l-1)*c,c=0),p>=i&&h>0&&(d=!0,h*=.9,p=l*h);var m=(i-p)/2>>0,g={offset:m-c,size:0};u=a.reduce(function(b,_){var S={item:_.item,position:{offset:g.offset+g.size+c,size:d?h:_.barSize}},O=[].concat(sY(b),[S]);return g=O[O.length-1].position,_.stackList&&_.stackList.length&&_.stackList.forEach(function(C){O.push({item:C,position:g})}),O},f)}else{var v=dv(r,i,0,!0);i-2*v-(l-1)*c<=0&&(c=0);var y=(i-2*v-(l-1)*c)/l;y>1&&(y>>=0);var x=s===+s?Math.min(y,s):y;u=a.reduce(function(b,_,S){var O=[].concat(sY(b),[{item:_.item,position:{offset:v+(y+c)*S+(y-x)/2,size:x}}]);return _.stackList&&_.stackList.length&&_.stackList.forEach(function(C){O.push({item:C,position:O[O.length-1].position})}),O},f)}return u},rRt=function(e,n,r,i){var o=r.children,a=r.width,s=r.margin,l=a-(s.left||0)-(s.right||0),c=eve({children:o,legendWidth:l});if(c){var u=i||{},f=u.width,d=u.height,h=c.align,p=c.verticalAlign,m=c.layout;if((m==="vertical"||m==="horizontal"&&p==="middle")&&h!=="center"&&Ye(e[h]))return za(za({},e),{},Ig({},h,e[h]+(f||0)));if((m==="horizontal"||m==="vertical"&&h==="center")&&p!=="middle"&&Ye(e[p]))return za(za({},e),{},Ig({},p,e[p]+(d||0)))}return e},iRt=function(e,n,r){return qt(n)?!0:e==="horizontal"?n==="yAxis":e==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},tve=function(e,n,r,i,o){var a=n.props.children,s=is(a,Uy).filter(function(c){return iRt(i,o,c.props.direction)});if(s&&s.length){var l=s.map(function(c){return c.props.dataKey});return e.reduce(function(c,u){var f=ho(u,r);if(qt(f))return c;var d=Array.isArray(f)?[gk(f),wf(f)]:[f,f],h=l.reduce(function(p,m){var g=ho(u,m,0),v=d[0]-Math.abs(Array.isArray(g)?g[0]:g),y=d[1]+Math.abs(Array.isArray(g)?g[1]:g);return[Math.min(v,p[0]),Math.max(y,p[1])]},[1/0,-1/0]);return[Math.min(h[0],c[0]),Math.max(h[1],c[1])]},[1/0,-1/0])}return null},oRt=function(e,n,r,i,o){var a=n.map(function(s){return tve(e,s,r,o,i)}).filter(function(s){return!qt(s)});return a&&a.length?a.reduce(function(s,l){return[Math.min(s[0],l[0]),Math.max(s[1],l[1])]},[1/0,-1/0]):null},nve=function(e,n,r,i,o){var a=n.map(function(l){var c=l.props.dataKey;return r==="number"&&c&&tve(e,l,c,i)||rb(e,c,r,o)});if(r==="number")return a.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]);var s={};return a.reduce(function(l,c){for(var u=0,f=c.length;u=2?Vs(s[0]-s[1])*2*c:c,n&&(e.ticks||e.niceTicks)){var u=(e.ticks||e.niceTicks).map(function(f){var d=o?o.indexOf(f):f;return{coordinate:i(d)+c,value:f,offset:c}});return u.filter(function(f){return!Dy(f.coordinate)})}return e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(f,d){return{coordinate:i(f)+c,value:f,index:d,offset:c}}):i.ticks&&!r?i.ticks(e.tickCount).map(function(f){return{coordinate:i(f)+c,value:f,offset:c}}):i.domain().map(function(f,d){return{coordinate:i(f)+c,value:o?o[f]:f,index:d,offset:c}})},SI=new WeakMap,gO=function(e,n){if(typeof n!="function")return e;SI.has(e)||SI.set(e,new WeakMap);var r=SI.get(e);if(r.has(n))return r.get(n);var i=function(){e.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,i),i},aRt=function(e,n,r){var i=e.scale,o=e.type,a=e.layout,s=e.axisType;if(i==="auto")return a==="radial"&&s==="radiusAxis"?{scale:__(),realScaleType:"band"}:a==="radial"&&s==="angleAxis"?{scale:JE(),realScaleType:"linear"}:o==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:nb(),realScaleType:"point"}:o==="category"?{scale:__(),realScaleType:"band"}:{scale:JE(),realScaleType:"linear"};if(xw(i)){var l="scale".concat(rk(i));return{scale:(eY[l]||nb)(),realScaleType:eY[l]?l:"point"}}return Bt(i)?{scale:i}:{scale:nb(),realScaleType:"point"}},lY=1e-4,sRt=function(e){var n=e.domain();if(!(!n||n.length<=2)){var r=n.length,i=e.range(),o=Math.min(i[0],i[1])-lY,a=Math.max(i[0],i[1])+lY,s=e(n[0]),l=e(n[r-1]);(sa||la)&&e.domain([n[0],n[r-1]])}},lRt=function(e,n){if(!e)return null;for(var r=0,i=e.length;ri)&&(o[1]=i),o[0]>i&&(o[0]=i),o[1]=0?(e[s][r][0]=o,e[s][r][1]=o+l,o=e[s][r][1]):(e[s][r][0]=a,e[s][r][1]=a+l,a=e[s][r][1])}},fRt=function(e){var n=e.length;if(!(n<=0))for(var r=0,i=e[0].length;r=0?(e[a][r][0]=o,e[a][r][1]=o+s,o=e[a][r][1]):(e[a][r][0]=0,e[a][r][1]=0)}},dRt={sign:uRt,expand:Bbt,none:hv,silhouette:zbt,wiggle:Ubt,positive:fRt},hRt=function(e,n,r){var i=n.map(function(s){return s.props.dataKey}),o=dRt[r],a=jbt().keys(i).value(function(s,l){return+ho(s,l,0)}).order(oN).offset(o);return a(e)},pRt=function(e,n,r,i,o,a){if(!e)return null;var s=a?n.reverse():n,l={},c=s.reduce(function(f,d){var h=d.props,p=h.stackId,m=h.hide;if(m)return f;var g=d.props[r],v=f[g]||{hasStack:!1,stackGroups:{}};if(ei(p)){var y=v.stackGroups[p]||{numericAxisId:r,cateAxisId:i,items:[]};y.items.push(d),v.hasStack=!0,v.stackGroups[p]=y}else v.stackGroups[Ly("_stackId_")]={numericAxisId:r,cateAxisId:i,items:[d]};return za(za({},f),{},Ig({},g,v))},l),u={};return Object.keys(c).reduce(function(f,d){var h=c[d];if(h.hasStack){var p={};h.stackGroups=Object.keys(h.stackGroups).reduce(function(m,g){var v=h.stackGroups[g];return za(za({},m),{},Ig({},g,{numericAxisId:r,cateAxisId:i,items:v.items,stackedData:hRt(e,v.items,o)}))},p)}return za(za({},f),{},Ig({},d,h))},u)},mRt=function(e,n){var r=n.realScaleType,i=n.type,o=n.tickCount,a=n.originalDomain,s=n.allowDecimals,l=r||n.scale;if(l!=="auto"&&l!=="linear")return null;if(o&&i==="number"&&a&&(a[0]==="auto"||a[1]==="auto")){var c=e.domain();if(!c.length)return null;var u=DAt(c,o,s);return e.domain([gk(u),wf(u)]),{niceTicks:u}}if(o&&i==="number"){var f=e.domain(),d=LAt(f,o,s);return{niceTicks:d}}return null};function oP(t){var e=t.axis,n=t.ticks,r=t.bandSize,i=t.entry,o=t.index,a=t.dataKey;if(e.type==="category"){if(!e.allowDuplicatedCategory&&e.dataKey&&!qt(i[e.dataKey])){var s=kE(n,"value",i[e.dataKey]);if(s)return s.coordinate+r/2}return n[o]?n[o].coordinate+r/2:null}var l=ho(i,qt(a)?e.dataKey:a);return qt(l)?null:e.scale(l)}var cY=function(e){var n=e.axis,r=e.ticks,i=e.offset,o=e.bandSize,a=e.entry,s=e.index;if(n.type==="category")return r[s]?r[s].coordinate+i:null;var l=ho(a,n.dataKey,n.domain[s]);return qt(l)?null:n.scale(l)-o/2+i},gRt=function(e){var n=e.numericAxis,r=n.scale.domain();if(n.type==="number"){var i=Math.min(r[0],r[1]),o=Math.max(r[0],r[1]);return i<=0&&o>=0?0:o<0?o:i}return r[0]},vRt=function(e,n){var r=e.props.stackId;if(ei(r)){var i=n[r];if(i){var o=i.items.indexOf(e);return o>=0?i.stackedData[o]:null}}return null},yRt=function(e){return e.reduce(function(n,r){return[gk(r.concat([n[0]]).filter(Ye)),wf(r.concat([n[1]]).filter(Ye))]},[1/0,-1/0])},ove=function(e,n,r){return Object.keys(e).reduce(function(i,o){var a=e[o],s=a.stackedData,l=s.reduce(function(c,u){var f=yRt(u.slice(n,r+1));return[Math.min(c[0],f[0]),Math.max(c[1],f[1])]},[1/0,-1/0]);return[Math.min(l[0],i[0]),Math.max(l[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},uY=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,fY=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,IN=function(e,n,r){if(Bt(e))return e(n,r);if(!Array.isArray(e))return n;var i=[];if(Ye(e[0]))i[0]=r?e[0]:Math.min(e[0],n[0]);else if(uY.test(e[0])){var o=+uY.exec(e[0])[1];i[0]=n[0]-o}else Bt(e[0])?i[0]=e[0](n[0]):i[0]=n[0];if(Ye(e[1]))i[1]=r?e[1]:Math.max(e[1],n[1]);else if(fY.test(e[1])){var a=+fY.exec(e[1])[1];i[1]=n[1]+a}else Bt(e[1])?i[1]=e[1](n[1]):i[1]=n[1];return i},aP=function(e,n,r){if(e&&e.scale&&e.scale.bandwidth){var i=e.scale.bandwidth();if(!r||i>0)return i}if(e&&n&&n.length>=2){for(var o=dU(n,function(f){return f.coordinate}),a=1/0,s=1,l=o.length;sa&&(c=2*Math.PI-c),{radius:s,angle:wRt(c),angleInRadian:c}},CRt=function(e){var n=e.startAngle,r=e.endAngle,i=Math.floor(n/360),o=Math.floor(r/360),a=Math.min(i,o);return{startAngle:n-a*360,endAngle:r-a*360}},TRt=function(e,n){var r=n.startAngle,i=n.endAngle,o=Math.floor(r/360),a=Math.floor(i/360),s=Math.min(o,a);return e+s*360},mY=function(e,n){var r=e.x,i=e.y,o=ORt({x:r,y:i},n),a=o.radius,s=o.angle,l=n.innerRadius,c=n.outerRadius;if(ac)return!1;if(a===0)return!0;var u=CRt(n),f=u.startAngle,d=u.endAngle,h=s,p;if(f<=d){for(;h>d;)h-=360;for(;h=f&&h<=d}else{for(;h>f;)h-=360;for(;h=d&&h<=f}return p?pY(pY({},n),{},{radius:a,angle:TRt(h,n)}):null};function A_(t){"@babel/helpers - typeof";return A_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},A_(t)}var ERt=["offset"];function PRt(t){return RRt(t)||ARt(t)||kRt(t)||MRt()}function MRt(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kRt(t,e){if(t){if(typeof t=="string")return DN(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return DN(t,e)}}function ARt(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function RRt(t){if(Array.isArray(t))return DN(t)}function DN(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function DRt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function gY(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Qr(t){for(var e=1;e=0?1:-1,x,b;i==="insideStart"?(x=h+y*a,b=m):i==="insideEnd"?(x=p-y*a,b=!m):i==="end"&&(x=p+y*a,b=m),b=v<=0?b:!b;var _=Ai(c,u,g,x),S=Ai(c,u,g,x+(b?1:-1)*359),O="M".concat(_.x,",").concat(_.y,` + height and width.`,L,z,a,l,u,f,n);var B=!Array.isArray(h)&&X3.isElement(h)&&Zc(h.type).endsWith("Chart");return ue.Children.map(h,function(W){return X3.isElement(W)?M.cloneElement(W,fO({width:L,height:z},B?{style:fO({height:"100%",width:"100%",maxHeight:z,maxWidth:L},W.props.style)}:{})):W})},[n,h,l,d,f,u,E,a]);return ue.createElement("div",{id:g?"".concat(g):void 0,className:ke("recharts-responsive-container",v),style:fO(fO({},b),{},{width:a,height:l,minWidth:u,minHeight:f,maxHeight:d}),ref:_},P)}),ige=function(e){return null};ige.displayName="Cell";function x_(t){"@babel/helpers - typeof";return x_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},x_(t)}function sQ(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function xN(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||ql.isSsr)return{width:0,height:0};var r=LPt(n),i=JSON.stringify({text:e,copyStyle:r});if(am.widthCache[i])return am.widthCache[i];try{var o=document.getElementById(lQ);o||(o=document.createElement("span"),o.setAttribute("id",lQ),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var a=xN(xN({},DPt),r);Object.assign(o.style,a),o.textContent="".concat(e);var s=o.getBoundingClientRect(),l={width:s.width,height:s.height};return am.widthCache[i]=l,++am.cacheCount>IPt&&(am.cacheCount=0,am.widthCache={}),l}catch{return{width:0,height:0}}},$Pt=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}};function b_(t){"@babel/helpers - typeof";return b_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b_(t)}function GE(t,e){return BPt(t)||jPt(t,e)||FPt(t,e)||NPt()}function NPt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function FPt(t,e){if(t){if(typeof t=="string")return cQ(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cQ(t,e)}}function cQ(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function eMt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function mQ(t,e){return iMt(t)||rMt(t,e)||nMt(t,e)||tMt()}function tMt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nMt(t,e){if(t){if(typeof t=="string")return gQ(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gQ(t,e)}}function gQ(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&arguments[0]!==void 0?arguments[0]:[];return L.reduce(function(z,B){var W=B.word,U=B.width,N=z[z.length-1];if(N&&(i==null||o||N.width+U+rB.width?z:B})};if(!u)return h;for(var m="…",g=function(L){var z=f.slice(0,L),B=lge({breakAll:c,style:l,children:z+m}).wordsWithComputedWidth,W=d(B),U=W.length>a||p(W).width>Number(i);return[U,W]},v=0,y=f.length-1,x=0,b;v<=y&&x<=f.length-1;){var _=Math.floor((v+y)/2),S=_-1,O=g(S),C=mQ(O,2),E=C[0],k=C[1],I=g(_),P=mQ(I,1),R=P[0];if(!E&&!R&&(v=_+1),E&&R&&(y=_-1),!E&&R){b=k;break}x++}return b||h},vQ=function(e){var n=qt(e)?[]:e.toString().split(sge);return[{words:n}]},aMt=function(e){var n=e.width,r=e.scaleToFit,i=e.children,o=e.style,a=e.breakAll,s=e.maxLines;if((n||r)&&!ql.isSsr){var l,c,u=lge({breakAll:a,children:i,style:o});if(u){var f=u.wordsWithComputedWidth,d=u.spaceWidth;l=f,c=d}else return vQ(i);return oMt({breakAll:a,children:i,maxLines:s,style:o},l,c,n,r)}return vQ(i)},yQ="#808080",HE=function(e){var n=e.x,r=n===void 0?0:n,i=e.y,o=i===void 0?0:i,a=e.lineHeight,s=a===void 0?"1em":a,l=e.capHeight,c=l===void 0?"0.71em":l,u=e.scaleToFit,f=u===void 0?!1:u,d=e.textAnchor,h=d===void 0?"start":d,p=e.verticalAnchor,m=p===void 0?"end":p,g=e.fill,v=g===void 0?yQ:g,y=pQ(e,ZPt),x=M.useMemo(function(){return aMt({breakAll:y.breakAll,children:y.children,maxLines:y.maxLines,scaleToFit:f,style:y.style,width:y.width})},[y.breakAll,y.children,y.maxLines,f,y.style,y.width]),b=y.dx,_=y.dy,S=y.angle,O=y.className,C=y.breakAll,E=pQ(y,JPt);if(!ei(r)||!ei(o))return null;var k=r+(Ye(b)?b:0),I=o+(Ye(_)?_:0),P;switch(m){case"start":P=pI("calc(".concat(c,")"));break;case"middle":P=pI("calc(".concat((x.length-1)/2," * -").concat(s," + (").concat(c," / 2))"));break;default:P=pI("calc(".concat(x.length-1," * -").concat(s,")"));break}var R=[];if(f){var T=x[0].width,L=y.width;R.push("scale(".concat((Ye(L)?L/T:1)/T,")"))}return S&&R.push("rotate(".concat(S,", ").concat(k,", ").concat(I,")")),R.length&&(E.transform=R.join(" ")),ue.createElement("text",bN({},jt(E,!0),{x:k,y:I,className:ke("recharts-text",O),textAnchor:h,fill:v.includes("url")?yQ:v}),x.map(function(z,B){var W=z.words.join(C?"":" ");return ue.createElement("tspan",{x:k,dy:B===0?P:s,key:W},W)}))};function zf(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function sMt(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function mU(t){let e,n,r;t.length!==2?(e=zf,n=(s,l)=>zf(t(s),l),r=(s,l)=>t(s)-l):(e=t===zf||t===sMt?t:lMt,n=t,r=t);function i(s,l,c=0,u=s.length){if(c>>1;n(s[f],l)<0?c=f+1:u=f}while(c>>1;n(s[f],l)<=0?c=f+1:u=f}while(cc&&r(s[f-1],l)>-r(s[f],l)?f-1:f}return{left:i,center:a,right:o}}function lMt(){return 0}function cge(t){return t===null?NaN:+t}function*cMt(t,e){if(e===void 0)for(let n of t)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of t)(r=e(r,++n,t))!=null&&(r=+r)>=r&&(yield r)}}const uMt=mU(zf),_w=uMt.right;mU(cge).center;class xQ extends Map{constructor(e,n=hMt){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[r,i]of e)this.set(r,i)}get(e){return super.get(bQ(this,e))}has(e){return super.has(bQ(this,e))}set(e,n){return super.set(fMt(this,e),n)}delete(e){return super.delete(dMt(this,e))}}function bQ({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function fMt({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function dMt({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function hMt(t){return t!==null&&typeof t=="object"?t.valueOf():t}function pMt(t=zf){if(t===zf)return uge;if(typeof t!="function")throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||r===0?r:(t(n,n)===0)-(t(e,e)===0)}}function uge(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(te?1:0)}const mMt=Math.sqrt(50),gMt=Math.sqrt(10),vMt=Math.sqrt(2);function qE(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=mMt?10:o>=gMt?5:o>=vMt?2:1;let s,l,c;return i<0?(c=Math.pow(10,-i)/a,s=Math.round(t*c),l=Math.round(e*c),s/ce&&--l,c=-c):(c=Math.pow(10,i)*a,s=Math.round(t/c),l=Math.round(e/c),s*ce&&--l),l0))return[];if(t===e)return[t];const r=e=i))return[];const s=o-i+1,l=new Array(s);if(r)if(a<0)for(let c=0;c=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n=i)&&(n=i)}return n}function wQ(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function fge(t,e,n=0,r=1/0,i){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(i=i===void 0?uge:pMt(i);r>n;){if(r-n>600){const l=r-n+1,c=e-n+1,u=Math.log(l),f=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*f*(l-f)/l)*(c-l/2<0?-1:1),h=Math.max(n,Math.floor(e-c*f/l+d)),p=Math.min(r,Math.floor(e+(l-c)*f/l+d));fge(t,e,h,p,i)}const o=t[e];let a=n,s=r;for(L0(t,n,e),i(t[r],o)>0&&L0(t,n,r);a0;)--s}i(t[n],o)===0?L0(t,n,s):(++s,L0(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function L0(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function yMt(t,e,n){if(t=Float64Array.from(cMt(t,n)),!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return wQ(t);if(e>=1)return _Q(t);var r,i=(r-1)*e,o=Math.floor(i),a=_Q(fge(t,o).subarray(0,o+1)),s=wQ(t.subarray(o+1));return a+(s-a)*(i-o)}}function xMt(t,e,n=cge){if(!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,o=Math.floor(i),a=+n(t[o],o,t),s=+n(t[o+1],o+1,t);return a+(s-a)*(i-o)}}function bMt(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((e-t)/n))|0,o=new Array(i);++r>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?hO(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?hO(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=wMt.exec(t))?new Ro(e[1],e[2],e[3],1):(e=SMt.exec(t))?new Ro(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=OMt.exec(t))?hO(e[1],e[2],e[3],e[4]):(e=CMt.exec(t))?hO(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=TMt.exec(t))?MQ(e[1],e[2]/100,e[3]/100,1):(e=EMt.exec(t))?MQ(e[1],e[2]/100,e[3]/100,e[4]):SQ.hasOwnProperty(t)?TQ(SQ[t]):t==="transparent"?new Ro(NaN,NaN,NaN,0):null}function TQ(t){return new Ro(t>>16&255,t>>8&255,t&255,1)}function hO(t,e,n,r){return r<=0&&(t=e=n=NaN),new Ro(t,e,n,r)}function kMt(t){return t instanceof ww||(t=O_(t)),t?(t=t.rgb(),new Ro(t.r,t.g,t.b,t.opacity)):new Ro}function CN(t,e,n,r){return arguments.length===1?kMt(t):new Ro(t,e,n,r??1)}function Ro(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}vU(Ro,CN,hge(ww,{brighter(t){return t=t==null?XE:Math.pow(XE,t),new Ro(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?w_:Math.pow(w_,t),new Ro(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ro(Fh(this.r),Fh(this.g),Fh(this.b),QE(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:EQ,formatHex:EQ,formatHex8:AMt,formatRgb:PQ,toString:PQ}));function EQ(){return`#${bh(this.r)}${bh(this.g)}${bh(this.b)}`}function AMt(){return`#${bh(this.r)}${bh(this.g)}${bh(this.b)}${bh((isNaN(this.opacity)?1:this.opacity)*255)}`}function PQ(){const t=QE(this.opacity);return`${t===1?"rgb(":"rgba("}${Fh(this.r)}, ${Fh(this.g)}, ${Fh(this.b)}${t===1?")":`, ${t})`}`}function QE(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Fh(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function bh(t){return t=Fh(t),(t<16?"0":"")+t.toString(16)}function MQ(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new zs(t,e,n,r)}function pge(t){if(t instanceof zs)return new zs(t.h,t.s,t.l,t.opacity);if(t instanceof ww||(t=O_(t)),!t)return new zs;if(t instanceof zs)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(e===o?a=(n-r)/s+(n0&&l<1?0:a,new zs(a,s,l,t.opacity)}function RMt(t,e,n,r){return arguments.length===1?pge(t):new zs(t,e,n,r??1)}function zs(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}vU(zs,RMt,hge(ww,{brighter(t){return t=t==null?XE:Math.pow(XE,t),new zs(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?w_:Math.pow(w_,t),new zs(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Ro(mI(t>=240?t-240:t+120,i,r),mI(t,i,r),mI(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new zs(kQ(this.h),pO(this.s),pO(this.l),QE(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 t=QE(this.opacity);return`${t===1?"hsl(":"hsla("}${kQ(this.h)}, ${pO(this.s)*100}%, ${pO(this.l)*100}%${t===1?")":`, ${t})`}`}}));function kQ(t){return t=(t||0)%360,t<0?t+360:t}function pO(t){return Math.max(0,Math.min(1,t||0))}function mI(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const yU=t=>()=>t;function IMt(t,e){return function(n){return t+n*e}}function DMt(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function LMt(t){return(t=+t)==1?mge:function(e,n){return n-e?DMt(e,n,t):yU(isNaN(e)?n:e)}}function mge(t,e){var n=e-t;return n?IMt(t,n):yU(isNaN(t)?e:t)}const AQ=function t(e){var n=LMt(e);function r(i,o){var a=n((i=CN(i)).r,(o=CN(o)).r),s=n(i.g,o.g),l=n(i.b,o.b),c=mge(i.opacity,o.opacity);return function(u){return i.r=a(u),i.g=s(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=t,r}(1);function $Mt(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(o){for(i=0;in&&(o=e.slice(n,o),s[a]?s[a]+=o:s[++a]=o),(r=r[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,l.push({i:a,x:YE(r,i)})),n=gI.lastIndex;return ne&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function qMt(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return i2?XMt:qMt,l=c=null,f}function f(d){return d==null||isNaN(d=+d)?o:(l||(l=s(t.map(r),e,n)))(r(a(d)))}return f.invert=function(d){return a(i((c||(c=s(e,t.map(r),YE)))(d)))},f.domain=function(d){return arguments.length?(t=Array.from(d,KE),u()):t.slice()},f.range=function(d){return arguments.length?(e=Array.from(d),u()):e.slice()},f.rangeRound=function(d){return e=Array.from(d),n=xU,u()},f.clamp=function(d){return arguments.length?(a=d?!0:lo,u()):a!==lo},f.interpolate=function(d){return arguments.length?(n=d,u()):n},f.unknown=function(d){return arguments.length?(o=d,f):o},function(d,h){return r=d,i=h,u()}}function bU(){return uk()(lo,lo)}function QMt(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function ZE(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function xv(t){return t=ZE(Math.abs(t)),t?t[1]:NaN}function YMt(t,e){return function(n,r){for(var i=n.length,o=[],a=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(n.substring(i-=s,i+s)),!((l+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(e)}}function KMt(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var ZMt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function C_(t){if(!(e=ZMt.exec(t)))throw new Error("invalid format: "+t);var e;return new _U({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}C_.prototype=_U.prototype;function _U(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}_U.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 JMt(t){e:for(var e=t.length,n=1,r=-1,i;n0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var gge;function e2t(t,e){var n=ZE(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(gge=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+ZE(t,Math.max(0,e+o-1))[0]}function IQ(t,e){var n=ZE(t,e);if(!n)return t+"";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 DQ={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:QMt,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>IQ(t*100,e),r:IQ,s:e2t,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function LQ(t){return t}var $Q=Array.prototype.map,NQ=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function t2t(t){var e=t.grouping===void 0||t.thousands===void 0?LQ:YMt($Q.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",o=t.numerals===void 0?LQ:KMt($Q.call(t.numerals,String)),a=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function c(f){f=C_(f);var d=f.fill,h=f.align,p=f.sign,m=f.symbol,g=f.zero,v=f.width,y=f.comma,x=f.precision,b=f.trim,_=f.type;_==="n"?(y=!0,_="g"):DQ[_]||(x===void 0&&(x=12),b=!0,_="g"),(g||d==="0"&&h==="=")&&(g=!0,d="0",h="=");var S=m==="$"?n:m==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",O=m==="$"?r:/[%p]/.test(_)?a:"",C=DQ[_],E=/[defgprs%]/.test(_);x=x===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function k(I){var P=S,R=O,T,L,z;if(_==="c")R=C(I)+R,I="";else{I=+I;var B=I<0||1/I<0;if(I=isNaN(I)?l:C(Math.abs(I),x),b&&(I=JMt(I)),B&&+I==0&&p!=="+"&&(B=!1),P=(B?p==="("?p:s:p==="-"||p==="("?"":p)+P,R=(_==="s"?NQ[8+gge/3]:"")+R+(B&&p==="("?")":""),E){for(T=-1,L=I.length;++Tz||z>57){R=(z===46?i+I.slice(T+1):I.slice(T))+R,I=I.slice(0,T);break}}}y&&!g&&(I=e(I,1/0));var W=P.length+I.length+R.length,U=W>1)+P+I+R+U.slice(W);break;default:I=U+P+I+R;break}return o(I)}return k.toString=function(){return f+""},k}function u(f,d){var h=c((f=C_(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(xv(d)/3)))*3,m=Math.pow(10,-p),g=NQ[8+p/3];return function(v){return h(m*v)+g}}return{format:c,formatPrefix:u}}var mO,wU,vge;n2t({thousands:",",grouping:[3],currency:["$",""]});function n2t(t){return mO=t2t(t),wU=mO.format,vge=mO.formatPrefix,mO}function r2t(t){return Math.max(0,-xv(Math.abs(t)))}function i2t(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(xv(e)/3)))*3-xv(Math.abs(t)))}function o2t(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,xv(e)-xv(t))+1}function yge(t,e,n,r){var i=SN(t,e,n),o;switch(r=C_(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(o=i2t(i,a))&&(r.precision=o),vge(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=o2t(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=r2t(i))&&(r.precision=o-(r.type==="%")*2);break}}return wU(r)}function Od(t){var e=t.domain;return t.ticks=function(n){var r=e();return _N(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return yge(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,o=r.length-1,a=r[i],s=r[o],l,c,u=10;for(s0;){if(c=wN(a,s,n),c===l)return r[i]=a,r[o]=s,e(r);if(c>0)a=Math.floor(a/c)*c,s=Math.ceil(s/c)*c;else if(c<0)a=Math.ceil(a*c)/c,s=Math.floor(s*c)/c;else break;l=c}return t},t}function JE(){var t=bU();return t.copy=function(){return Sw(t,JE())},ws.apply(t,arguments),Od(t)}function xge(t){var e;function n(r){return r==null||isNaN(r=+r)?e:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(t=Array.from(r,KE),n):t.slice()},n.unknown=function(r){return arguments.length?(e=r,n):e},n.copy=function(){return xge(t).unknown(e)},t=arguments.length?Array.from(t,KE):[0,1],Od(n)}function bge(t,e){t=t.slice();var n=0,r=t.length-1,i=t[n],o=t[r],a;return oMath.pow(t,e)}function u2t(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function BQ(t){return(e,n)=>-t(-e,n)}function SU(t){const e=t(FQ,jQ),n=e.domain;let r=10,i,o;function a(){return i=u2t(r),o=c2t(r),n()[0]<0?(i=BQ(i),o=BQ(o),t(a2t,s2t)):t(FQ,jQ),e}return e.base=function(s){return arguments.length?(r=+s,a()):r},e.domain=function(s){return arguments.length?(n(s),a()):n()},e.ticks=s=>{const l=n();let c=l[0],u=l[l.length-1];const f=u0){for(;d<=h;++d)for(p=1;pu)break;v.push(m)}}else for(;d<=h;++d)for(p=r-1;p>=1;--p)if(m=d>0?p/o(-d):p*o(d),!(mu)break;v.push(m)}v.length*2{if(s==null&&(s=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=C_(l)).precision==null&&(l.trim=!0),l=wU(l)),s===1/0)return l;const c=Math.max(1,r*s/e.ticks().length);return u=>{let f=u/o(Math.round(i(u)));return f*rn(bge(n(),{floor:s=>o(Math.floor(i(s))),ceil:s=>o(Math.ceil(i(s)))})),e}function _ge(){const t=SU(uk()).domain([1,10]);return t.copy=()=>Sw(t,_ge()).base(t.base()),ws.apply(t,arguments),t}function zQ(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function UQ(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function OU(t){var e=1,n=t(zQ(e),UQ(e));return n.constant=function(r){return arguments.length?t(zQ(e=+r),UQ(e)):e},Od(n)}function wge(){var t=OU(uk());return t.copy=function(){return Sw(t,wge()).constant(t.constant())},ws.apply(t,arguments)}function WQ(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function f2t(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function d2t(t){return t<0?-t*t:t*t}function CU(t){var e=t(lo,lo),n=1;function r(){return n===1?t(lo,lo):n===.5?t(f2t,d2t):t(WQ(n),WQ(1/n))}return e.exponent=function(i){return arguments.length?(n=+i,r()):n},Od(e)}function TU(){var t=CU(uk());return t.copy=function(){return Sw(t,TU()).exponent(t.exponent())},ws.apply(t,arguments),t}function h2t(){return TU.apply(null,arguments).exponent(.5)}function VQ(t){return Math.sign(t)*t*t}function p2t(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function Sge(){var t=bU(),e=[0,1],n=!1,r;function i(o){var a=p2t(t(o));return isNaN(a)?r:n?Math.round(a):a}return i.invert=function(o){return t.invert(VQ(o))},i.domain=function(o){return arguments.length?(t.domain(o),i):t.domain()},i.range=function(o){return arguments.length?(t.range((e=Array.from(o,KE)).map(VQ)),i):e.slice()},i.rangeRound=function(o){return i.range(o).round(!0)},i.round=function(o){return arguments.length?(n=!!o,i):n},i.clamp=function(o){return arguments.length?(t.clamp(o),i):t.clamp()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return Sge(t.domain(),e).round(n).clamp(t.clamp()).unknown(r)},ws.apply(i,arguments),Od(i)}function Oge(){var t=[],e=[],n=[],r;function i(){var a=0,s=Math.max(1,e.length);for(n=new Array(s-1);++a0?n[s-1]:t[0],s=n?[r[n-1],e]:[r[c-1],r[c]]},a.unknown=function(l){return arguments.length&&(o=l),a},a.thresholds=function(){return r.slice()},a.copy=function(){return Cge().domain([t,e]).range(i).unknown(o)},ws.apply(Od(a),arguments)}function Tge(){var t=[.5],e=[0,1],n,r=1;function i(o){return o!=null&&o<=o?e[_w(t,o,0,r)]:n}return i.domain=function(o){return arguments.length?(t=Array.from(o),r=Math.min(t.length,e.length-1),i):t.slice()},i.range=function(o){return arguments.length?(e=Array.from(o),r=Math.min(t.length,e.length-1),i):e.slice()},i.invertExtent=function(o){var a=e.indexOf(o);return[t[a-1],t[a]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return Tge().domain(t).range(e).unknown(n)},ws.apply(i,arguments)}const vI=new Date,yI=new Date;function ni(t,e,n,r){function i(o){return t(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(t(o=new Date(+o)),o),i.ceil=o=>(t(o=new Date(o-1)),e(o,1),t(o),o),i.round=o=>{const a=i(o),s=i.ceil(o);return o-a(e(o=new Date(+o),a==null?1:Math.floor(a)),o),i.range=(o,a,s)=>{const l=[];if(o=i.ceil(o),s=s==null?1:Math.floor(s),!(o0))return l;let c;do l.push(c=new Date(+o)),e(o,s),t(o);while(cni(a=>{if(a>=a)for(;t(a),!o(a);)a.setTime(a-1)},(a,s)=>{if(a>=a)if(s<0)for(;++s<=0;)for(;e(a,-1),!o(a););else for(;--s>=0;)for(;e(a,1),!o(a););}),n&&(i.count=(o,a)=>(vI.setTime(+o),yI.setTime(+a),t(vI),t(yI),Math.floor(n(vI,yI))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?a=>r(a)%o===0:a=>i.count(0,a)%o===0):i)),i}const eP=ni(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);eP.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?ni(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):eP);eP.range;const Vc=1e3,Ka=Vc*60,Gc=Ka*60,hu=Gc*24,EU=hu*7,GQ=hu*30,xI=hu*365,_h=ni(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*Vc)},(t,e)=>(e-t)/Vc,t=>t.getUTCSeconds());_h.range;const PU=ni(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Vc)},(t,e)=>{t.setTime(+t+e*Ka)},(t,e)=>(e-t)/Ka,t=>t.getMinutes());PU.range;const MU=ni(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*Ka)},(t,e)=>(e-t)/Ka,t=>t.getUTCMinutes());MU.range;const kU=ni(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Vc-t.getMinutes()*Ka)},(t,e)=>{t.setTime(+t+e*Gc)},(t,e)=>(e-t)/Gc,t=>t.getHours());kU.range;const AU=ni(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Gc)},(t,e)=>(e-t)/Gc,t=>t.getUTCHours());AU.range;const Ow=ni(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Ka)/hu,t=>t.getDate()-1);Ow.range;const fk=ni(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/hu,t=>t.getUTCDate()-1);fk.range;const Ege=ni(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/hu,t=>Math.floor(t/hu));Ege.range;function Ip(t){return ni(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*Ka)/EU)}const dk=Ip(0),tP=Ip(1),m2t=Ip(2),g2t=Ip(3),bv=Ip(4),v2t=Ip(5),y2t=Ip(6);dk.range;tP.range;m2t.range;g2t.range;bv.range;v2t.range;y2t.range;function Dp(t){return ni(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/EU)}const hk=Dp(0),nP=Dp(1),x2t=Dp(2),b2t=Dp(3),_v=Dp(4),_2t=Dp(5),w2t=Dp(6);hk.range;nP.range;x2t.range;b2t.range;_v.range;_2t.range;w2t.range;const RU=ni(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());RU.range;const IU=ni(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());IU.range;const pu=ni(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());pu.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:ni(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});pu.range;const mu=ni(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());mu.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:ni(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});mu.range;function Pge(t,e,n,r,i,o){const a=[[_h,1,Vc],[_h,5,5*Vc],[_h,15,15*Vc],[_h,30,30*Vc],[o,1,Ka],[o,5,5*Ka],[o,15,15*Ka],[o,30,30*Ka],[i,1,Gc],[i,3,3*Gc],[i,6,6*Gc],[i,12,12*Gc],[r,1,hu],[r,2,2*hu],[n,1,EU],[e,1,GQ],[e,3,3*GQ],[t,1,xI]];function s(c,u,f){const d=ug).right(a,d);if(h===a.length)return t.every(SN(c/xI,u/xI,f));if(h===0)return eP.every(Math.max(SN(c,u,f),1));const[p,m]=a[d/a[h-1][2]53)return null;"w"in re||(re.w=1),"Z"in re?(F=_I($0(re.y,0,1)),ce=F.getUTCDay(),F=ce>4||ce===0?nP.ceil(F):nP(F),F=fk.offset(F,(re.V-1)*7),re.y=F.getUTCFullYear(),re.m=F.getUTCMonth(),re.d=F.getUTCDate()+(re.w+6)%7):(F=bI($0(re.y,0,1)),ce=F.getDay(),F=ce>4||ce===0?tP.ceil(F):tP(F),F=Ow.offset(F,(re.V-1)*7),re.y=F.getFullYear(),re.m=F.getMonth(),re.d=F.getDate()+(re.w+6)%7)}else("W"in re||"U"in re)&&("w"in re||(re.w="u"in re?re.u%7:"W"in re?1:0),ce="Z"in re?_I($0(re.y,0,1)).getUTCDay():bI($0(re.y,0,1)).getDay(),re.m=0,re.d="W"in re?(re.w+6)%7+re.W*7-(ce+5)%7:re.w+re.U*7-(ce+6)%7);return"Z"in re?(re.H+=re.Z/100|0,re.M+=re.Z%100,_I(re)):bI(re)}}function C(J,pe,be,re){for(var ve=0,F=pe.length,ce=be.length,le,Q;ve=ce)return-1;if(le=pe.charCodeAt(ve++),le===37){if(le=pe.charAt(ve++),Q=_[le in HQ?pe.charAt(ve++):le],!Q||(re=Q(J,be,re))<0)return-1}else if(le!=be.charCodeAt(re++))return-1}return re}function E(J,pe,be){var re=c.exec(pe.slice(be));return re?(J.p=u.get(re[0].toLowerCase()),be+re[0].length):-1}function k(J,pe,be){var re=h.exec(pe.slice(be));return re?(J.w=p.get(re[0].toLowerCase()),be+re[0].length):-1}function I(J,pe,be){var re=f.exec(pe.slice(be));return re?(J.w=d.get(re[0].toLowerCase()),be+re[0].length):-1}function P(J,pe,be){var re=v.exec(pe.slice(be));return re?(J.m=y.get(re[0].toLowerCase()),be+re[0].length):-1}function R(J,pe,be){var re=m.exec(pe.slice(be));return re?(J.m=g.get(re[0].toLowerCase()),be+re[0].length):-1}function T(J,pe,be){return C(J,e,pe,be)}function L(J,pe,be){return C(J,n,pe,be)}function z(J,pe,be){return C(J,r,pe,be)}function B(J){return a[J.getDay()]}function W(J){return o[J.getDay()]}function U(J){return l[J.getMonth()]}function N(J){return s[J.getMonth()]}function $(J){return i[+(J.getHours()>=12)]}function D(J){return 1+~~(J.getMonth()/3)}function A(J){return a[J.getUTCDay()]}function q(J){return o[J.getUTCDay()]}function Y(J){return l[J.getUTCMonth()]}function K(J){return s[J.getUTCMonth()]}function se(J){return i[+(J.getUTCHours()>=12)]}function te(J){return 1+~~(J.getUTCMonth()/3)}return{format:function(J){var pe=S(J+="",x);return pe.toString=function(){return J},pe},parse:function(J){var pe=O(J+="",!1);return pe.toString=function(){return J},pe},utcFormat:function(J){var pe=S(J+="",b);return pe.toString=function(){return J},pe},utcParse:function(J){var pe=O(J+="",!0);return pe.toString=function(){return J},pe}}}var HQ={"-":"",_:" ",0:"0"},gi=/^\s*\d+/,P2t=/^%/,M2t=/[\\^$*+?|[\]().{}]/g;function hn(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o[e.toLowerCase(),n]))}function A2t(t,e,n){var r=gi.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function R2t(t,e,n){var r=gi.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function I2t(t,e,n){var r=gi.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function D2t(t,e,n){var r=gi.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function L2t(t,e,n){var r=gi.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function qQ(t,e,n){var r=gi.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function XQ(t,e,n){var r=gi.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function $2t(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function N2t(t,e,n){var r=gi.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function F2t(t,e,n){var r=gi.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function QQ(t,e,n){var r=gi.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function j2t(t,e,n){var r=gi.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function YQ(t,e,n){var r=gi.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function B2t(t,e,n){var r=gi.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function z2t(t,e,n){var r=gi.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function U2t(t,e,n){var r=gi.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function W2t(t,e,n){var r=gi.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function V2t(t,e,n){var r=P2t.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function G2t(t,e,n){var r=gi.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function H2t(t,e,n){var r=gi.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function KQ(t,e){return hn(t.getDate(),e,2)}function q2t(t,e){return hn(t.getHours(),e,2)}function X2t(t,e){return hn(t.getHours()%12||12,e,2)}function Q2t(t,e){return hn(1+Ow.count(pu(t),t),e,3)}function Mge(t,e){return hn(t.getMilliseconds(),e,3)}function Y2t(t,e){return Mge(t,e)+"000"}function K2t(t,e){return hn(t.getMonth()+1,e,2)}function Z2t(t,e){return hn(t.getMinutes(),e,2)}function J2t(t,e){return hn(t.getSeconds(),e,2)}function ekt(t){var e=t.getDay();return e===0?7:e}function tkt(t,e){return hn(dk.count(pu(t)-1,t),e,2)}function kge(t){var e=t.getDay();return e>=4||e===0?bv(t):bv.ceil(t)}function nkt(t,e){return t=kge(t),hn(bv.count(pu(t),t)+(pu(t).getDay()===4),e,2)}function rkt(t){return t.getDay()}function ikt(t,e){return hn(tP.count(pu(t)-1,t),e,2)}function okt(t,e){return hn(t.getFullYear()%100,e,2)}function akt(t,e){return t=kge(t),hn(t.getFullYear()%100,e,2)}function skt(t,e){return hn(t.getFullYear()%1e4,e,4)}function lkt(t,e){var n=t.getDay();return t=n>=4||n===0?bv(t):bv.ceil(t),hn(t.getFullYear()%1e4,e,4)}function ckt(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+hn(e/60|0,"0",2)+hn(e%60,"0",2)}function ZQ(t,e){return hn(t.getUTCDate(),e,2)}function ukt(t,e){return hn(t.getUTCHours(),e,2)}function fkt(t,e){return hn(t.getUTCHours()%12||12,e,2)}function dkt(t,e){return hn(1+fk.count(mu(t),t),e,3)}function Age(t,e){return hn(t.getUTCMilliseconds(),e,3)}function hkt(t,e){return Age(t,e)+"000"}function pkt(t,e){return hn(t.getUTCMonth()+1,e,2)}function mkt(t,e){return hn(t.getUTCMinutes(),e,2)}function gkt(t,e){return hn(t.getUTCSeconds(),e,2)}function vkt(t){var e=t.getUTCDay();return e===0?7:e}function ykt(t,e){return hn(hk.count(mu(t)-1,t),e,2)}function Rge(t){var e=t.getUTCDay();return e>=4||e===0?_v(t):_v.ceil(t)}function xkt(t,e){return t=Rge(t),hn(_v.count(mu(t),t)+(mu(t).getUTCDay()===4),e,2)}function bkt(t){return t.getUTCDay()}function _kt(t,e){return hn(nP.count(mu(t)-1,t),e,2)}function wkt(t,e){return hn(t.getUTCFullYear()%100,e,2)}function Skt(t,e){return t=Rge(t),hn(t.getUTCFullYear()%100,e,2)}function Okt(t,e){return hn(t.getUTCFullYear()%1e4,e,4)}function Ckt(t,e){var n=t.getUTCDay();return t=n>=4||n===0?_v(t):_v.ceil(t),hn(t.getUTCFullYear()%1e4,e,4)}function Tkt(){return"+0000"}function JQ(){return"%"}function eY(t){return+t}function tY(t){return Math.floor(+t/1e3)}var sm,Ige,Dge;Ekt({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 Ekt(t){return sm=E2t(t),Ige=sm.format,sm.parse,Dge=sm.utcFormat,sm.utcParse,sm}function Pkt(t){return new Date(t)}function Mkt(t){return t instanceof Date?+t:+new Date(+t)}function DU(t,e,n,r,i,o,a,s,l,c){var u=bU(),f=u.invert,d=u.domain,h=c(".%L"),p=c(":%S"),m=c("%I:%M"),g=c("%I %p"),v=c("%a %d"),y=c("%b %d"),x=c("%B"),b=c("%Y");function _(S){return(l(S)e(i/(t.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,o)=>yMt(t,o/r))},n.copy=function(){return Fge(e).domain(t)},Su.apply(n,arguments)}function mk(){var t=0,e=.5,n=1,r=1,i,o,a,s,l,c=lo,u,f=!1,d;function h(m){return isNaN(m=+m)?d:(m=.5+((m=+u(m))-o)*(r*me}var Nkt=$kt,Fkt=Uge,jkt=Nkt,Bkt=Fy;function zkt(t){return t&&t.length?Fkt(t,Bkt,jkt):void 0}var Ukt=zkt;const wf=Nt(Ukt);function Wkt(t,e){return tt.e^o.s<0?1:-1;for(r=o.d.length,i=t.d.length,e=0,n=rt.d[e]^o.s<0?1:-1;return r===i?0:r>i^o.s<0?1:-1};ut.decimalPlaces=ut.dp=function(){var t=this,e=t.d.length-1,n=(e-t.e)*Qn;if(e=t.d[e],e)for(;e%10==0;e/=10)n--;return n<0?0:n};ut.dividedBy=ut.div=function(t){return eu(this,new this.constructor(t))};ut.dividedToIntegerBy=ut.idiv=function(t){var e=this,n=e.constructor;return Ln(eu(e,new n(t),0,1),n.precision)};ut.equals=ut.eq=function(t){return!this.cmp(t)};ut.exponent=function(){return Wr(this)};ut.greaterThan=ut.gt=function(t){return this.cmp(t)>0};ut.greaterThanOrEqualTo=ut.gte=function(t){return this.cmp(t)>=0};ut.isInteger=ut.isint=function(){return this.e>this.d.length-2};ut.isNegative=ut.isneg=function(){return this.s<0};ut.isPositive=ut.ispos=function(){return this.s>0};ut.isZero=function(){return this.s===0};ut.lessThan=ut.lt=function(t){return this.cmp(t)<0};ut.lessThanOrEqualTo=ut.lte=function(t){return this.cmp(t)<1};ut.logarithm=ut.log=function(t){var e,n=this,r=n.constructor,i=r.precision,o=i+5;if(t===void 0)t=new r(10);else if(t=new r(t),t.s<1||t.eq(ha))throw Error(ms+"NaN");if(n.s<1)throw Error(ms+(n.s?"NaN":"-Infinity"));return n.eq(ha)?new r(0):(fr=!1,e=eu(T_(n,o),T_(t,o),o),fr=!0,Ln(e,i))};ut.minus=ut.sub=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?Hge(e,t):Vge(e,(t.s=-t.s,t))};ut.modulo=ut.mod=function(t){var e,n=this,r=n.constructor,i=r.precision;if(t=new r(t),!t.s)throw Error(ms+"NaN");return n.s?(fr=!1,e=eu(n,t,0,1).times(t),fr=!0,n.minus(e)):Ln(new r(n),i)};ut.naturalExponential=ut.exp=function(){return Gge(this)};ut.naturalLogarithm=ut.ln=function(){return T_(this)};ut.negated=ut.neg=function(){var t=new this.constructor(this);return t.s=-t.s||0,t};ut.plus=ut.add=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?Vge(e,t):Hge(e,(t.s=-t.s,t))};ut.precision=ut.sd=function(t){var e,n,r,i=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(jh+t);if(e=Wr(i)+1,r=i.d.length-1,n=r*Qn+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return t&&e>n?e:n};ut.squareRoot=ut.sqrt=function(){var t,e,n,r,i,o,a,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(ms+"NaN")}for(t=Wr(s),fr=!1,i=Math.sqrt(+s),i==0||i==1/0?(e=Dl(s.d),(e.length+t)%2==0&&(e+="0"),i=Math.sqrt(e),t=zy((t+1)/2)-(t<0||t%2),i==1/0?e="5e"+t:(e=i.toExponential(),e=e.slice(0,e.indexOf("e")+1)+t),r=new l(e)):r=new l(i.toString()),n=l.precision,i=a=n+3;;)if(o=r,r=o.plus(eu(s,o,a+2)).times(.5),Dl(o.d).slice(0,a)===(e=Dl(r.d)).slice(0,a)){if(e=e.slice(a-3,a+1),i==a&&e=="4999"){if(Ln(o,n+1,0),o.times(o).eq(s)){r=o;break}}else if(e!="9999")break;a+=4}return fr=!0,Ln(r,n)};ut.times=ut.mul=function(t){var e,n,r,i,o,a,s,l,c,u=this,f=u.constructor,d=u.d,h=(t=new f(t)).d;if(!u.s||!t.s)return new f(0);for(t.s*=u.s,n=u.e+t.e,l=d.length,c=h.length,l=0;){for(e=0,i=l+r;i>r;)s=o[i]+h[r]*d[i-r-1]+e,o[i--]=s%si|0,e=s/si|0;o[i]=(o[i]+e)%si|0}for(;!o[--a];)o.pop();return e?++n:o.shift(),t.d=o,t.e=n,fr?Ln(t,f.precision):t};ut.toDecimalPlaces=ut.todp=function(t,e){var n=this,r=n.constructor;return n=new r(n),t===void 0?n:(Jl(t,0,By),e===void 0?e=r.rounding:Jl(e,0,8),Ln(n,t+Wr(n)+1,e))};ut.toExponential=function(t,e){var n,r=this,i=r.constructor;return t===void 0?n=ap(r,!0):(Jl(t,0,By),e===void 0?e=i.rounding:Jl(e,0,8),r=Ln(new i(r),t+1,e),n=ap(r,!0,t+1)),n};ut.toFixed=function(t,e){var n,r,i=this,o=i.constructor;return t===void 0?ap(i):(Jl(t,0,By),e===void 0?e=o.rounding:Jl(e,0,8),r=Ln(new o(i),t+Wr(i)+1,e),n=ap(r.abs(),!1,t+Wr(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};ut.toInteger=ut.toint=function(){var t=this,e=t.constructor;return Ln(new e(t),Wr(t)+1,e.rounding)};ut.toNumber=function(){return+this};ut.toPower=ut.pow=function(t){var e,n,r,i,o,a,s=this,l=s.constructor,c=12,u=+(t=new l(t));if(!t.s)return new l(ha);if(s=new l(s),!s.s){if(t.s<1)throw Error(ms+"Infinity");return s}if(s.eq(ha))return s;if(r=l.precision,t.eq(ha))return Ln(s,r);if(e=t.e,n=t.d.length-1,a=e>=n,o=s.s,a){if((n=u<0?-u:u)<=Wge){for(i=new l(ha),e=Math.ceil(r/Qn+4),fr=!1;n%2&&(i=i.times(s),iY(i.d,e)),n=zy(n/2),n!==0;)s=s.times(s),iY(s.d,e);return fr=!0,t.s<0?new l(ha).div(i):Ln(i,r)}}else if(o<0)throw Error(ms+"NaN");return o=o<0&&t.d[Math.max(e,n)]&1?-1:1,s.s=1,fr=!1,i=t.times(T_(s,r+c)),fr=!0,i=Gge(i),i.s=o,i};ut.toPrecision=function(t,e){var n,r,i=this,o=i.constructor;return t===void 0?(n=Wr(i),r=ap(i,n<=o.toExpNeg||n>=o.toExpPos)):(Jl(t,1,By),e===void 0?e=o.rounding:Jl(e,0,8),i=Ln(new o(i),t,e),n=Wr(i),r=ap(i,t<=n||n<=o.toExpNeg,t)),r};ut.toSignificantDigits=ut.tosd=function(t,e){var n=this,r=n.constructor;return t===void 0?(t=r.precision,e=r.rounding):(Jl(t,1,By),e===void 0?e=r.rounding:Jl(e,0,8)),Ln(new r(n),t,e)};ut.toString=ut.valueOf=ut.val=ut.toJSON=ut[Symbol.for("nodejs.util.inspect.custom")]=function(){var t=this,e=Wr(t),n=t.constructor;return ap(t,e<=n.toExpNeg||e>=n.toExpPos)};function Vge(t,e){var n,r,i,o,a,s,l,c,u=t.constructor,f=u.precision;if(!t.s||!e.s)return e.s||(e=new u(t)),fr?Ln(e,f):e;if(l=t.d,c=e.d,a=t.e,i=e.e,l=l.slice(),o=a-i,o){for(o<0?(r=l,o=-o,s=c.length):(r=c,i=a,s=l.length),a=Math.ceil(f/Qn),s=a>s?a+1:s+1,o>s&&(o=s,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(s=l.length,o=c.length,s-o<0&&(o=s,r=c,c=l,l=r),n=0;o;)n=(l[--o]=l[o]+c[o]+n)/si|0,l[o]%=si;for(n&&(l.unshift(n),++i),s=l.length;l[--s]==0;)l.pop();return e.d=l,e.e=i,fr?Ln(e,f):e}function Jl(t,e,n){if(t!==~~t||tn)throw Error(jh+t)}function Dl(t){var e,n,r,i=t.length-1,o="",a=t[0];if(i>0){for(o+=a,e=1;ea?1:-1;else for(s=l=0;si[s]?1:-1;break}return l}function n(r,i,o){for(var a=0;o--;)r[o]-=a,a=r[o]1;)r.shift()}return function(r,i,o,a){var s,l,c,u,f,d,h,p,m,g,v,y,x,b,_,S,O,C,E=r.constructor,k=r.s==i.s?1:-1,I=r.d,P=i.d;if(!r.s)return new E(r);if(!i.s)throw Error(ms+"Division by zero");for(l=r.e-i.e,O=P.length,_=I.length,h=new E(k),p=h.d=[],c=0;P[c]==(I[c]||0);)++c;if(P[c]>(I[c]||0)&&--l,o==null?y=o=E.precision:a?y=o+(Wr(r)-Wr(i))+1:y=o,y<0)return new E(0);if(y=y/Qn+2|0,c=0,O==1)for(u=0,P=P[0],y++;(c<_||u)&&y--;c++)x=u*si+(I[c]||0),p[c]=x/P|0,u=x%P|0;else{for(u=si/(P[0]+1)|0,u>1&&(P=t(P,u),I=t(I,u),O=P.length,_=I.length),b=O,m=I.slice(0,O),g=m.length;g=si/2&&++S;do u=0,s=e(P,m,O,g),s<0?(v=m[0],O!=g&&(v=v*si+(m[1]||0)),u=v/S|0,u>1?(u>=si&&(u=si-1),f=t(P,u),d=f.length,g=m.length,s=e(f,m,d,g),s==1&&(u--,n(f,O16)throw Error(NU+Wr(t));if(!t.s)return new u(ha);for(e==null?(fr=!1,s=f):s=e,a=new u(.03125);t.abs().gte(.1);)t=t.times(a),c+=5;for(r=Math.log(Yd(2,c))/Math.LN10*2+5|0,s+=r,n=i=o=new u(ha),u.precision=s;;){if(i=Ln(i.times(t),s),n=n.times(++l),a=o.plus(eu(i,n,s)),Dl(a.d).slice(0,s)===Dl(o.d).slice(0,s)){for(;c--;)o=Ln(o.times(o),s);return u.precision=f,e==null?(fr=!0,Ln(o,f)):o}o=a}}function Wr(t){for(var e=t.e*Qn,n=t.d[0];n>=10;n/=10)e++;return e}function wI(t,e,n){if(e>t.LN10.sd())throw fr=!0,n&&(t.precision=n),Error(ms+"LN10 precision limit exceeded");return Ln(new t(t.LN10),e)}function sf(t){for(var e="";t--;)e+="0";return e}function T_(t,e){var n,r,i,o,a,s,l,c,u,f=1,d=10,h=t,p=h.d,m=h.constructor,g=m.precision;if(h.s<1)throw Error(ms+(h.s?"NaN":"-Infinity"));if(h.eq(ha))return new m(0);if(e==null?(fr=!1,c=g):c=e,h.eq(10))return e==null&&(fr=!0),wI(m,c);if(c+=d,m.precision=c,n=Dl(p),r=n.charAt(0),o=Wr(h),Math.abs(o)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)h=h.times(t),n=Dl(h.d),r=n.charAt(0),f++;o=Wr(h),r>1?(h=new m("0."+n),o++):h=new m(r+"."+n.slice(1))}else return l=wI(m,c+2,g).times(o+""),h=T_(new m(r+"."+n.slice(1)),c-d).plus(l),m.precision=g,e==null?(fr=!0,Ln(h,g)):h;for(s=a=h=eu(h.minus(ha),h.plus(ha),c),u=Ln(h.times(h),c),i=3;;){if(a=Ln(a.times(u),c),l=s.plus(eu(a,new m(i),c)),Dl(l.d).slice(0,c)===Dl(s.d).slice(0,c))return s=s.times(2),o!==0&&(s=s.plus(wI(m,c+2,g).times(o+""))),s=eu(s,new m(f),c),m.precision=g,e==null?(fr=!0,Ln(s,g)):s;s=l,i+=2}}function rY(t,e){var n,r,i;for((n=e.indexOf("."))>-1&&(e=e.replace(".","")),(r=e.search(/e/i))>0?(n<0&&(n=r),n+=+e.slice(r+1),e=e.substring(0,r)):n<0&&(n=e.length),r=0;e.charCodeAt(r)===48;)++r;for(i=e.length;e.charCodeAt(i-1)===48;)--i;if(e=e.slice(r,i),e){if(i-=r,n=n-r-1,t.e=zy(n/Qn),t.d=[],r=(n+1)%Qn,n<0&&(r+=Qn),rrP||t.e<-rP))throw Error(NU+n)}else t.s=0,t.e=0,t.d=[0];return t}function Ln(t,e,n){var r,i,o,a,s,l,c,u,f=t.d;for(a=1,o=f[0];o>=10;o/=10)a++;if(r=e-a,r<0)r+=Qn,i=e,c=f[u=0];else{if(u=Math.ceil((r+1)/Qn),o=f.length,u>=o)return t;for(c=o=f[u],a=1;o>=10;o/=10)a++;r%=Qn,i=r-Qn+a}if(n!==void 0&&(o=Yd(10,a-i-1),s=c/o%10|0,l=e<0||f[u+1]!==void 0||c%o,l=n<4?(s||l)&&(n==0||n==(t.s<0?3:2)):s>5||s==5&&(n==4||l||n==6&&(r>0?i>0?c/Yd(10,a-i):0:f[u-1])%10&1||n==(t.s<0?8:7))),e<1||!f[0])return l?(o=Wr(t),f.length=1,e=e-o-1,f[0]=Yd(10,(Qn-e%Qn)%Qn),t.e=zy(-e/Qn)||0):(f.length=1,f[0]=t.e=t.s=0),t;if(r==0?(f.length=u,o=1,u--):(f.length=u+1,o=Yd(10,Qn-r),f[u]=i>0?(c/Yd(10,a-i)%Yd(10,i)|0)*o:0),l)for(;;)if(u==0){(f[0]+=o)==si&&(f[0]=1,++t.e);break}else{if(f[u]+=o,f[u]!=si)break;f[u--]=0,o=1}for(r=f.length;f[--r]===0;)f.pop();if(fr&&(t.e>rP||t.e<-rP))throw Error(NU+Wr(t));return t}function Hge(t,e){var n,r,i,o,a,s,l,c,u,f,d=t.constructor,h=d.precision;if(!t.s||!e.s)return e.s?e.s=-e.s:e=new d(t),fr?Ln(e,h):e;if(l=t.d,f=e.d,r=e.e,c=t.e,l=l.slice(),a=c-r,a){for(u=a<0,u?(n=l,a=-a,s=f.length):(n=f,r=c,s=l.length),i=Math.max(Math.ceil(h/Qn),s)+2,a>i&&(a=i,n.length=1),n.reverse(),i=a;i--;)n.push(0);n.reverse()}else{for(i=l.length,s=f.length,u=i0;--i)l[s++]=0;for(i=f.length;i>a;){if(l[--i]0?o=o.charAt(0)+"."+o.slice(1)+sf(r):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+sf(-i-1)+o,n&&(r=n-a)>0&&(o+=sf(r))):i>=a?(o+=sf(i+1-a),n&&(r=n-i-1)>0&&(o=o+"."+sf(r))):((r=i+1)0&&(i+1===a&&(o+="."),o+=sf(r))),t.s<0?"-"+o:o}function iY(t,e){if(t.length>e)return t.length=e,!0}function qge(t){var e,n,r;function i(o){var a=this;if(!(a instanceof i))return new i(o);if(a.constructor=i,o instanceof i){a.s=o.s,a.e=o.e,a.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(jh+o);if(o>0)a.s=1;else if(o<0)o=-o,a.s=-1;else{a.s=0,a.e=0,a.d=[0];return}if(o===~~o&&o<1e7){a.e=0,a.d=[o];return}return rY(a,o.toString())}else if(typeof o!="string")throw Error(jh+o);if(o.charCodeAt(0)===45?(o=o.slice(1),a.s=-1):a.s=1,fAt.test(o))rY(a,o);else throw Error(jh+o)}if(i.prototype=ut,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=qge,i.config=i.set=dAt,t===void 0&&(t={}),t)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],e=0;e=i[e+1]&&r<=i[e+2])this[n]=r;else throw Error(jh+n+": "+r);if((r=t[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(jh+n+": "+r);return this}var FU=qge(uAt);ha=new FU(1);const Rn=FU;function hAt(t){return vAt(t)||gAt(t)||mAt(t)||pAt()}function pAt(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mAt(t,e){if(t){if(typeof t=="string")return PN(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return PN(t,e)}}function gAt(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function vAt(t){if(Array.isArray(t))return PN(t)}function PN(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=e?n.apply(void 0,i):t(e-a,oY(function(){for(var s=arguments.length,l=new Array(s),c=0;ct.length)&&(e=t.length);for(var n=0,r=new Array(e);n"u"||!(Symbol.iterator in Object(t)))){var n=[],r=!0,i=!1,o=void 0;try{for(var a=t[Symbol.iterator](),s;!(r=(s=a.next()).done)&&(n.push(s.value),!(e&&n.length===e));r=!0);}catch(l){i=!0,o=l}finally{try{!r&&a.return!=null&&a.return()}finally{if(i)throw o}}return n}}function RAt(t){if(Array.isArray(t))return t}function Zge(t){var e=E_(t,2),n=e[0],r=e[1],i=n,o=r;return n>r&&(i=r,o=n),[i,o]}function Jge(t,e,n){if(t.lte(0))return new Rn(0);var r=yk.getDigitCount(t.toNumber()),i=new Rn(10).pow(r),o=t.div(i),a=r!==1?.05:.1,s=new Rn(Math.ceil(o.div(a).toNumber())).add(n).mul(a),l=s.mul(i);return e?l:new Rn(Math.ceil(l))}function IAt(t,e,n){var r=1,i=new Rn(t);if(!i.isint()&&n){var o=Math.abs(t);o<1?(r=new Rn(10).pow(yk.getDigitCount(t)-1),i=new Rn(Math.floor(i.div(r).toNumber())).mul(r)):o>1&&(i=new Rn(Math.floor(t)))}else t===0?i=new Rn(Math.floor((e-1)/2)):n||(i=new Rn(Math.floor(t)));var a=Math.floor((e-1)/2),s=_At(bAt(function(l){return i.add(new Rn(l-a).mul(r)).toNumber()}),MN);return s(0,e)}function eve(t,e,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((e-t)/(n-1)))return{step:new Rn(0),tickMin:new Rn(0),tickMax:new Rn(0)};var o=Jge(new Rn(e).sub(t).div(n-1),r,i),a;t<=0&&e>=0?a=new Rn(0):(a=new Rn(t).add(e).div(2),a=a.sub(new Rn(a).mod(o)));var s=Math.ceil(a.sub(t).div(o).toNumber()),l=Math.ceil(new Rn(e).sub(a).div(o).toNumber()),c=s+l+1;return c>n?eve(t,e,n,r,i+1):(c0?l+(n-c):l,s=e>0?s:s+(n-c)),{step:o,tickMin:a.sub(new Rn(s).mul(o)),tickMax:a.add(new Rn(l).mul(o))})}function DAt(t){var e=E_(t,2),n=e[0],r=e[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=Math.max(i,2),s=Zge([n,r]),l=E_(s,2),c=l[0],u=l[1];if(c===-1/0||u===1/0){var f=u===1/0?[c].concat(AN(MN(0,i-1).map(function(){return 1/0}))):[].concat(AN(MN(0,i-1).map(function(){return-1/0})),[u]);return n>r?kN(f):f}if(c===u)return IAt(c,i,o);var d=eve(c,u,a,o),h=d.step,p=d.tickMin,m=d.tickMax,g=yk.rangeStep(p,m.add(new Rn(.1).mul(h)),h);return n>r?kN(g):g}function LAt(t,e){var n=E_(t,2),r=n[0],i=n[1],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=Zge([r,i]),s=E_(a,2),l=s[0],c=s[1];if(l===-1/0||c===1/0)return[r,i];if(l===c)return[l];var u=Math.max(e,2),f=Jge(new Rn(c).sub(l).div(u-1),o,0),d=[].concat(AN(yk.rangeStep(new Rn(l),new Rn(c).sub(new Rn(.99).mul(f)),f)),[c]);return r>i?kN(d):d}var $At=Yge(DAt),NAt=Yge(LAt),FAt="Invariant failed";function sp(t,e){if(!t)throw new Error(FAt)}var jAt=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function iP(){return iP=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function HAt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function Uy(t){var e=t.offset,n=t.layout,r=t.width,i=t.dataKey,o=t.data,a=t.dataPointFormatter,s=t.xAxis,l=t.yAxis,c=GAt(t,jAt),u=jt(c,!1);t.direction==="x"&&s.type!=="number"&&sp(!1);var f=o.map(function(d){var h=a(d,i),p=h.x,m=h.y,g=h.value,v=h.errorVal;if(!v)return null;var y=[],x,b;if(Array.isArray(v)){var _=BAt(v,2);x=_[0],b=_[1]}else x=b=v;if(n==="vertical"){var S=s.scale,O=m+e,C=O+r,E=O-r,k=S(g-x),I=S(g+b);y.push({x1:I,y1:C,x2:I,y2:E}),y.push({x1:k,y1:O,x2:I,y2:O}),y.push({x1:k,y1:C,x2:k,y2:E})}else if(n==="horizontal"){var P=l.scale,R=p+e,T=R-r,L=R+r,z=P(g-x),B=P(g+b);y.push({x1:T,y1:B,x2:L,y2:B}),y.push({x1:R,y1:z,x2:R,y2:B}),y.push({x1:T,y1:z,x2:L,y2:z})}return ue.createElement(Vn,iP({className:"recharts-errorBar",key:"bar-".concat(y.map(function(W){return"".concat(W.x1,"-").concat(W.x2,"-").concat(W.y1,"-").concat(W.y2)}))},u),y.map(function(W){return ue.createElement("line",iP({},W,{key:"line-".concat(W.x1,"-").concat(W.x2,"-").concat(W.y1,"-").concat(W.y2)}))}))});return ue.createElement(Vn,{className:"recharts-errorBars"},f)}Uy.defaultProps={stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"};Uy.displayName="ErrorBar";function P_(t){"@babel/helpers - typeof";return P_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},P_(t)}function sY(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function SI(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,a=-1,s=(n=r==null?void 0:r.length)!==null&&n!==void 0?n:0;if(s<=1)return 0;if(o&&o.axisType==="angleAxis"&&Math.abs(Math.abs(o.range[1]-o.range[0])-360)<=1e-6)for(var l=o.range,c=0;c0?i[c-1].coordinate:i[s-1].coordinate,f=i[c].coordinate,d=c>=s-1?i[0].coordinate:i[c+1].coordinate,h=void 0;if(Vs(f-u)!==Vs(d-f)){var p=[];if(Vs(d-f)===Vs(l[1]-l[0])){h=d;var m=f+l[1]-l[0];p[0]=Math.min(m,(m+u)/2),p[1]=Math.max(m,(m+u)/2)}else{h=u;var g=d+l[1]-l[0];p[0]=Math.min(f,(g+f)/2),p[1]=Math.max(f,(g+f)/2)}var v=[Math.min(f,(h+f)/2),Math.max(f,(h+f)/2)];if(e>v[0]&&e<=v[1]||e>=p[0]&&e<=p[1]){a=i[c].index;break}}else{var y=Math.min(u,d),x=Math.max(u,d);if(e>(y+f)/2&&e<=(x+f)/2){a=i[c].index;break}}}else for(var b=0;b0&&b(r[b].coordinate+r[b-1].coordinate)/2&&e<=(r[b].coordinate+r[b+1].coordinate)/2||b===s-1&&e>(r[b].coordinate+r[b-1].coordinate)/2){a=r[b].index;break}return a},jU=function(e){var n=e,r=n.type.displayName,i=e.props,o=i.stroke,a=i.fill,s;switch(r){case"Line":s=o;break;case"Area":case"Radar":s=o&&o!=="none"?o:a;break;default:s=a;break}return s},rRt=function(e){var n=e.barSize,r=e.stackGroups,i=r===void 0?{}:r;if(!i)return{};for(var o={},a=Object.keys(i),s=0,l=a.length;s=0});if(g&&g.length){var v=g[0].props.barSize,y=g[0].props[m];o[y]||(o[y]=[]),o[y].push({item:g[0],stackList:g.slice(1),barSize:qt(v)?n:v})}}return o},iRt=function(e){var n=e.barGap,r=e.barCategoryGap,i=e.bandSize,o=e.sizeList,a=o===void 0?[]:o,s=e.maxBarSize,l=a.length;if(l<1)return null;var c=dv(n,i,0,!0),u,f=[];if(a[0].barSize===+a[0].barSize){var d=!1,h=i/l,p=a.reduce(function(b,_){return b+_.barSize||0},0);p+=(l-1)*c,p>=i&&(p-=(l-1)*c,c=0),p>=i&&h>0&&(d=!0,h*=.9,p=l*h);var m=(i-p)/2>>0,g={offset:m-c,size:0};u=a.reduce(function(b,_){var S={item:_.item,position:{offset:g.offset+g.size+c,size:d?h:_.barSize}},O=[].concat(cY(b),[S]);return g=O[O.length-1].position,_.stackList&&_.stackList.length&&_.stackList.forEach(function(C){O.push({item:C,position:g})}),O},f)}else{var v=dv(r,i,0,!0);i-2*v-(l-1)*c<=0&&(c=0);var y=(i-2*v-(l-1)*c)/l;y>1&&(y>>=0);var x=s===+s?Math.min(y,s):y;u=a.reduce(function(b,_,S){var O=[].concat(cY(b),[{item:_.item,position:{offset:v+(y+c)*S+(y-x)/2,size:x}}]);return _.stackList&&_.stackList.length&&_.stackList.forEach(function(C){O.push({item:C,position:O[O.length-1].position})}),O},f)}return u},oRt=function(e,n,r,i){var o=r.children,a=r.width,s=r.margin,l=a-(s.left||0)-(s.right||0),c=tve({children:o,legendWidth:l});if(c){var u=i||{},f=u.width,d=u.height,h=c.align,p=c.verticalAlign,m=c.layout;if((m==="vertical"||m==="horizontal"&&p==="middle")&&h!=="center"&&Ye(e[h]))return za(za({},e),{},Ig({},h,e[h]+(f||0)));if((m==="horizontal"||m==="vertical"&&h==="center")&&p!=="middle"&&Ye(e[p]))return za(za({},e),{},Ig({},p,e[p]+(d||0)))}return e},aRt=function(e,n,r){return qt(n)?!0:e==="horizontal"?n==="yAxis":e==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},nve=function(e,n,r,i,o){var a=n.props.children,s=is(a,Uy).filter(function(c){return aRt(i,o,c.props.direction)});if(s&&s.length){var l=s.map(function(c){return c.props.dataKey});return e.reduce(function(c,u){var f=ho(u,r);if(qt(f))return c;var d=Array.isArray(f)?[gk(f),wf(f)]:[f,f],h=l.reduce(function(p,m){var g=ho(u,m,0),v=d[0]-Math.abs(Array.isArray(g)?g[0]:g),y=d[1]+Math.abs(Array.isArray(g)?g[1]:g);return[Math.min(v,p[0]),Math.max(y,p[1])]},[1/0,-1/0]);return[Math.min(h[0],c[0]),Math.max(h[1],c[1])]},[1/0,-1/0])}return null},sRt=function(e,n,r,i,o){var a=n.map(function(s){return nve(e,s,r,o,i)}).filter(function(s){return!qt(s)});return a&&a.length?a.reduce(function(s,l){return[Math.min(s[0],l[0]),Math.max(s[1],l[1])]},[1/0,-1/0]):null},rve=function(e,n,r,i,o){var a=n.map(function(l){var c=l.props.dataKey;return r==="number"&&c&&nve(e,l,c,i)||rb(e,c,r,o)});if(r==="number")return a.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]);var s={};return a.reduce(function(l,c){for(var u=0,f=c.length;u=2?Vs(s[0]-s[1])*2*c:c,n&&(e.ticks||e.niceTicks)){var u=(e.ticks||e.niceTicks).map(function(f){var d=o?o.indexOf(f):f;return{coordinate:i(d)+c,value:f,offset:c}});return u.filter(function(f){return!Dy(f.coordinate)})}return e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(f,d){return{coordinate:i(f)+c,value:f,index:d,offset:c}}):i.ticks&&!r?i.ticks(e.tickCount).map(function(f){return{coordinate:i(f)+c,value:f,offset:c}}):i.domain().map(function(f,d){return{coordinate:i(f)+c,value:o?o[f]:f,index:d,offset:c}})},OI=new WeakMap,gO=function(e,n){if(typeof n!="function")return e;OI.has(e)||OI.set(e,new WeakMap);var r=OI.get(e);if(r.has(n))return r.get(n);var i=function(){e.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,i),i},lRt=function(e,n,r){var i=e.scale,o=e.type,a=e.layout,s=e.axisType;if(i==="auto")return a==="radial"&&s==="radiusAxis"?{scale:__(),realScaleType:"band"}:a==="radial"&&s==="angleAxis"?{scale:JE(),realScaleType:"linear"}:o==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:nb(),realScaleType:"point"}:o==="category"?{scale:__(),realScaleType:"band"}:{scale:JE(),realScaleType:"linear"};if(xw(i)){var l="scale".concat(rk(i));return{scale:(nY[l]||nb)(),realScaleType:nY[l]?l:"point"}}return Bt(i)?{scale:i}:{scale:nb(),realScaleType:"point"}},uY=1e-4,cRt=function(e){var n=e.domain();if(!(!n||n.length<=2)){var r=n.length,i=e.range(),o=Math.min(i[0],i[1])-uY,a=Math.max(i[0],i[1])+uY,s=e(n[0]),l=e(n[r-1]);(sa||la)&&e.domain([n[0],n[r-1]])}},uRt=function(e,n){if(!e)return null;for(var r=0,i=e.length;ri)&&(o[1]=i),o[0]>i&&(o[0]=i),o[1]=0?(e[s][r][0]=o,e[s][r][1]=o+l,o=e[s][r][1]):(e[s][r][0]=a,e[s][r][1]=a+l,a=e[s][r][1])}},hRt=function(e){var n=e.length;if(!(n<=0))for(var r=0,i=e[0].length;r=0?(e[a][r][0]=o,e[a][r][1]=o+s,o=e[a][r][1]):(e[a][r][0]=0,e[a][r][1]=0)}},pRt={sign:dRt,expand:Ubt,none:hv,silhouette:Wbt,wiggle:Vbt,positive:hRt},mRt=function(e,n,r){var i=n.map(function(s){return s.props.dataKey}),o=pRt[r],a=zbt().keys(i).value(function(s,l){return+ho(s,l,0)}).order(aN).offset(o);return a(e)},gRt=function(e,n,r,i,o,a){if(!e)return null;var s=a?n.reverse():n,l={},c=s.reduce(function(f,d){var h=d.props,p=h.stackId,m=h.hide;if(m)return f;var g=d.props[r],v=f[g]||{hasStack:!1,stackGroups:{}};if(ei(p)){var y=v.stackGroups[p]||{numericAxisId:r,cateAxisId:i,items:[]};y.items.push(d),v.hasStack=!0,v.stackGroups[p]=y}else v.stackGroups[Ly("_stackId_")]={numericAxisId:r,cateAxisId:i,items:[d]};return za(za({},f),{},Ig({},g,v))},l),u={};return Object.keys(c).reduce(function(f,d){var h=c[d];if(h.hasStack){var p={};h.stackGroups=Object.keys(h.stackGroups).reduce(function(m,g){var v=h.stackGroups[g];return za(za({},m),{},Ig({},g,{numericAxisId:r,cateAxisId:i,items:v.items,stackedData:mRt(e,v.items,o)}))},p)}return za(za({},f),{},Ig({},d,h))},u)},vRt=function(e,n){var r=n.realScaleType,i=n.type,o=n.tickCount,a=n.originalDomain,s=n.allowDecimals,l=r||n.scale;if(l!=="auto"&&l!=="linear")return null;if(o&&i==="number"&&a&&(a[0]==="auto"||a[1]==="auto")){var c=e.domain();if(!c.length)return null;var u=$At(c,o,s);return e.domain([gk(u),wf(u)]),{niceTicks:u}}if(o&&i==="number"){var f=e.domain(),d=NAt(f,o,s);return{niceTicks:d}}return null};function oP(t){var e=t.axis,n=t.ticks,r=t.bandSize,i=t.entry,o=t.index,a=t.dataKey;if(e.type==="category"){if(!e.allowDuplicatedCategory&&e.dataKey&&!qt(i[e.dataKey])){var s=kE(n,"value",i[e.dataKey]);if(s)return s.coordinate+r/2}return n[o]?n[o].coordinate+r/2:null}var l=ho(i,qt(a)?e.dataKey:a);return qt(l)?null:e.scale(l)}var fY=function(e){var n=e.axis,r=e.ticks,i=e.offset,o=e.bandSize,a=e.entry,s=e.index;if(n.type==="category")return r[s]?r[s].coordinate+i:null;var l=ho(a,n.dataKey,n.domain[s]);return qt(l)?null:n.scale(l)-o/2+i},yRt=function(e){var n=e.numericAxis,r=n.scale.domain();if(n.type==="number"){var i=Math.min(r[0],r[1]),o=Math.max(r[0],r[1]);return i<=0&&o>=0?0:o<0?o:i}return r[0]},xRt=function(e,n){var r=e.props.stackId;if(ei(r)){var i=n[r];if(i){var o=i.items.indexOf(e);return o>=0?i.stackedData[o]:null}}return null},bRt=function(e){return e.reduce(function(n,r){return[gk(r.concat([n[0]]).filter(Ye)),wf(r.concat([n[1]]).filter(Ye))]},[1/0,-1/0])},ave=function(e,n,r){return Object.keys(e).reduce(function(i,o){var a=e[o],s=a.stackedData,l=s.reduce(function(c,u){var f=bRt(u.slice(n,r+1));return[Math.min(c[0],f[0]),Math.max(c[1],f[1])]},[1/0,-1/0]);return[Math.min(l[0],i[0]),Math.max(l[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},dY=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,hY=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,DN=function(e,n,r){if(Bt(e))return e(n,r);if(!Array.isArray(e))return n;var i=[];if(Ye(e[0]))i[0]=r?e[0]:Math.min(e[0],n[0]);else if(dY.test(e[0])){var o=+dY.exec(e[0])[1];i[0]=n[0]-o}else Bt(e[0])?i[0]=e[0](n[0]):i[0]=n[0];if(Ye(e[1]))i[1]=r?e[1]:Math.max(e[1],n[1]);else if(hY.test(e[1])){var a=+hY.exec(e[1])[1];i[1]=n[1]+a}else Bt(e[1])?i[1]=e[1](n[1]):i[1]=n[1];return i},aP=function(e,n,r){if(e&&e.scale&&e.scale.bandwidth){var i=e.scale.bandwidth();if(!r||i>0)return i}if(e&&n&&n.length>=2){for(var o=hU(n,function(f){return f.coordinate}),a=1/0,s=1,l=o.length;sa&&(c=2*Math.PI-c),{radius:s,angle:ORt(c),angleInRadian:c}},ERt=function(e){var n=e.startAngle,r=e.endAngle,i=Math.floor(n/360),o=Math.floor(r/360),a=Math.min(i,o);return{startAngle:n-a*360,endAngle:r-a*360}},PRt=function(e,n){var r=n.startAngle,i=n.endAngle,o=Math.floor(r/360),a=Math.floor(i/360),s=Math.min(o,a);return e+s*360},vY=function(e,n){var r=e.x,i=e.y,o=TRt({x:r,y:i},n),a=o.radius,s=o.angle,l=n.innerRadius,c=n.outerRadius;if(ac)return!1;if(a===0)return!0;var u=ERt(n),f=u.startAngle,d=u.endAngle,h=s,p;if(f<=d){for(;h>d;)h-=360;for(;h=f&&h<=d}else{for(;h>f;)h-=360;for(;h=d&&h<=f}return p?gY(gY({},n),{},{radius:a,angle:PRt(h,n)}):null};function A_(t){"@babel/helpers - typeof";return A_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},A_(t)}var MRt=["offset"];function kRt(t){return DRt(t)||IRt(t)||RRt(t)||ARt()}function ARt(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function RRt(t,e){if(t){if(typeof t=="string")return LN(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return LN(t,e)}}function IRt(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function DRt(t){if(Array.isArray(t))return LN(t)}function LN(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function $Rt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function yY(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Qr(t){for(var e=1;e=0?1:-1,x,b;i==="insideStart"?(x=h+y*a,b=m):i==="insideEnd"?(x=p-y*a,b=!m):i==="end"&&(x=p+y*a,b=m),b=v<=0?b:!b;var _=Ai(c,u,g,x),S=Ai(c,u,g,x+(b?1:-1)*359),O="M".concat(_.x,",").concat(_.y,` A`).concat(g,",").concat(g,",0,1,").concat(b?0:1,`, - `).concat(S.x,",").concat(S.y),C=qt(e.id)?Ly("recharts-radial-line-"):e.id;return ue.createElement("text",R_({},r,{dominantBaseline:"central",className:ke("recharts-radial-bar-label",s)}),ue.createElement("defs",null,ue.createElement("path",{id:C,d:O})),ue.createElement("textPath",{xlinkHref:"#".concat(C)},n))},zRt=function(e){var n=e.viewBox,r=e.offset,i=e.position,o=n,a=o.cx,s=o.cy,l=o.innerRadius,c=o.outerRadius,u=o.startAngle,f=o.endAngle,d=(u+f)/2;if(i==="outside"){var h=Ai(a,s,c+r,d),p=h.x,m=h.y;return{x:p,y:m,textAnchor:p>=a?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"end"};var g=(l+c)/2,v=Ai(a,s,g,d),y=v.x,x=v.y;return{x:y,y:x,textAnchor:"middle",verticalAnchor:"middle"}},URt=function(e){var n=e.viewBox,r=e.parentViewBox,i=e.offset,o=e.position,a=n,s=a.x,l=a.y,c=a.width,u=a.height,f=u>=0?1:-1,d=f*i,h=f>0?"end":"start",p=f>0?"start":"end",m=c>=0?1:-1,g=m*i,v=m>0?"end":"start",y=m>0?"start":"end";if(o==="top"){var x={x:s+c/2,y:l-f*i,textAnchor:"middle",verticalAnchor:h};return Qr(Qr({},x),r?{height:Math.max(l-r.y,0),width:c}:{})}if(o==="bottom"){var b={x:s+c/2,y:l+u+d,textAnchor:"middle",verticalAnchor:p};return Qr(Qr({},b),r?{height:Math.max(r.y+r.height-(l+u),0),width:c}:{})}if(o==="left"){var _={x:s-g,y:l+u/2,textAnchor:v,verticalAnchor:"middle"};return Qr(Qr({},_),r?{width:Math.max(_.x-r.x,0),height:u}:{})}if(o==="right"){var S={x:s+c+g,y:l+u/2,textAnchor:y,verticalAnchor:"middle"};return Qr(Qr({},S),r?{width:Math.max(r.x+r.width-S.x,0),height:u}:{})}var O=r?{width:c,height:u}:{};return o==="insideLeft"?Qr({x:s+g,y:l+u/2,textAnchor:y,verticalAnchor:"middle"},O):o==="insideRight"?Qr({x:s+c-g,y:l+u/2,textAnchor:v,verticalAnchor:"middle"},O):o==="insideTop"?Qr({x:s+c/2,y:l+d,textAnchor:"middle",verticalAnchor:p},O):o==="insideBottom"?Qr({x:s+c/2,y:l+u-d,textAnchor:"middle",verticalAnchor:h},O):o==="insideTopLeft"?Qr({x:s+g,y:l+d,textAnchor:y,verticalAnchor:p},O):o==="insideTopRight"?Qr({x:s+c-g,y:l+d,textAnchor:v,verticalAnchor:p},O):o==="insideBottomLeft"?Qr({x:s+g,y:l+u-d,textAnchor:y,verticalAnchor:h},O):o==="insideBottomRight"?Qr({x:s+c-g,y:l+u-d,textAnchor:v,verticalAnchor:h},O):ky(o)&&(Ye(o.x)||xh(o.x))&&(Ye(o.y)||xh(o.y))?Qr({x:s+dv(o.x,c),y:l+dv(o.y,u),textAnchor:"end",verticalAnchor:"end"},O):Qr({x:s+c/2,y:l+u/2,textAnchor:"middle",verticalAnchor:"middle"},O)},WRt=function(e){return"cx"in e&&Ye(e.cx)};function Xi(t){var e=t.offset,n=e===void 0?5:e,r=IRt(t,ERt),i=Qr({offset:n},r),o=i.viewBox,a=i.position,s=i.value,l=i.children,c=i.content,u=i.className,f=u===void 0?"":u,d=i.textBreakAll;if(!o||qt(s)&&qt(l)&&!M.isValidElement(c)&&!Bt(c))return null;if(M.isValidElement(c))return M.cloneElement(c,i);var h;if(Bt(c)){if(h=M.createElement(c,i),M.isValidElement(h))return h}else h=FRt(i);var p=WRt(o),m=jt(i,!0);if(p&&(a==="insideStart"||a==="insideEnd"||a==="end"))return BRt(i,h,m);var g=p?zRt(i):URt(i);return ue.createElement(HE,R_({className:ke("recharts-label",f)},m,g,{breakAll:d}),h)}Xi.displayName="Label";var sve=function(e){var n=e.cx,r=e.cy,i=e.angle,o=e.startAngle,a=e.endAngle,s=e.r,l=e.radius,c=e.innerRadius,u=e.outerRadius,f=e.x,d=e.y,h=e.top,p=e.left,m=e.width,g=e.height,v=e.clockWise,y=e.labelViewBox;if(y)return y;if(Ye(m)&&Ye(g)){if(Ye(f)&&Ye(d))return{x:f,y:d,width:m,height:g};if(Ye(h)&&Ye(p))return{x:h,y:p,width:m,height:g}}return Ye(f)&&Ye(d)?{x:f,y:d,width:0,height:0}:Ye(n)&&Ye(r)?{cx:n,cy:r,startAngle:o||i||0,endAngle:a||i||0,innerRadius:c||0,outerRadius:u||l||s||0,clockWise:v}:e.viewBox?e.viewBox:{}},VRt=function(e,n){return e?e===!0?ue.createElement(Xi,{key:"label-implicit",viewBox:n}):ei(e)?ue.createElement(Xi,{key:"label-implicit",viewBox:n,value:e}):M.isValidElement(e)?e.type===Xi?M.cloneElement(e,{key:"label-implicit",viewBox:n}):ue.createElement(Xi,{key:"label-implicit",content:e,viewBox:n}):Bt(e)?ue.createElement(Xi,{key:"label-implicit",content:e,viewBox:n}):ky(e)?ue.createElement(Xi,R_({viewBox:n},e,{key:"label-implicit"})):null:null},GRt=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var i=e.children,o=sve(e),a=is(i,Xi).map(function(l,c){return M.cloneElement(l,{viewBox:n||o,key:"label-".concat(c)})});if(!r)return a;var s=VRt(e.label,n||o);return[s].concat(PRt(a))};Xi.parseViewBox=sve;Xi.renderCallByParent=GRt;function HRt(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var qRt=HRt;const XRt=Nt(qRt);function I_(t){"@babel/helpers - typeof";return I_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},I_(t)}var QRt=["valueAccessor"],YRt=["data","dataKey","clockWise","id","textBreakAll"];function KRt(t){return tIt(t)||eIt(t)||JRt(t)||ZRt()}function ZRt(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function JRt(t,e){if(t){if(typeof t=="string")return LN(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return LN(t,e)}}function eIt(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function tIt(t){if(Array.isArray(t))return LN(t)}function LN(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function oIt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var aIt=function(e){return Array.isArray(e.value)?XRt(e.value):e.value};function tu(t){var e=t.valueAccessor,n=e===void 0?aIt:e,r=xY(t,QRt),i=r.data,o=r.dataKey,a=r.clockWise,s=r.id,l=r.textBreakAll,c=xY(r,YRt);return!i||!i.length?null:ue.createElement(Vn,{className:"recharts-label-list"},i.map(function(u,f){var d=qt(o)?n(u,f):ho(u&&u.payload,o),h=qt(s)?{}:{id:"".concat(s,"-").concat(f)};return ue.createElement(Xi,lP({},jt(u,!0),c,h,{parentViewBox:u.parentViewBox,value:d,textBreakAll:l,viewBox:Xi.parseViewBox(qt(a)?u:yY(yY({},u),{},{clockWise:a})),key:"label-".concat(f),index:f}))}))}tu.displayName="LabelList";function sIt(t,e){return t?t===!0?ue.createElement(tu,{key:"labelList-implicit",data:e}):ue.isValidElement(t)||Bt(t)?ue.createElement(tu,{key:"labelList-implicit",data:e,content:t}):ky(t)?ue.createElement(tu,lP({data:e},t,{key:"labelList-implicit"})):null:null}function lIt(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var r=t.children,i=is(r,tu).map(function(a,s){return M.cloneElement(a,{data:e,key:"labelList-".concat(s)})});if(!n)return i;var o=sIt(t.label,e);return[o].concat(KRt(i))}tu.renderCallByParent=lIt;function D_(t){"@babel/helpers - typeof";return D_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},D_(t)}function $N(){return $N=Object.assign?Object.assign.bind():function(t){for(var e=1;e=a?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"end"};var g=(l+c)/2,v=Ai(a,s,g,d),y=v.x,x=v.y;return{x:y,y:x,textAnchor:"middle",verticalAnchor:"middle"}},VRt=function(e){var n=e.viewBox,r=e.parentViewBox,i=e.offset,o=e.position,a=n,s=a.x,l=a.y,c=a.width,u=a.height,f=u>=0?1:-1,d=f*i,h=f>0?"end":"start",p=f>0?"start":"end",m=c>=0?1:-1,g=m*i,v=m>0?"end":"start",y=m>0?"start":"end";if(o==="top"){var x={x:s+c/2,y:l-f*i,textAnchor:"middle",verticalAnchor:h};return Qr(Qr({},x),r?{height:Math.max(l-r.y,0),width:c}:{})}if(o==="bottom"){var b={x:s+c/2,y:l+u+d,textAnchor:"middle",verticalAnchor:p};return Qr(Qr({},b),r?{height:Math.max(r.y+r.height-(l+u),0),width:c}:{})}if(o==="left"){var _={x:s-g,y:l+u/2,textAnchor:v,verticalAnchor:"middle"};return Qr(Qr({},_),r?{width:Math.max(_.x-r.x,0),height:u}:{})}if(o==="right"){var S={x:s+c+g,y:l+u/2,textAnchor:y,verticalAnchor:"middle"};return Qr(Qr({},S),r?{width:Math.max(r.x+r.width-S.x,0),height:u}:{})}var O=r?{width:c,height:u}:{};return o==="insideLeft"?Qr({x:s+g,y:l+u/2,textAnchor:y,verticalAnchor:"middle"},O):o==="insideRight"?Qr({x:s+c-g,y:l+u/2,textAnchor:v,verticalAnchor:"middle"},O):o==="insideTop"?Qr({x:s+c/2,y:l+d,textAnchor:"middle",verticalAnchor:p},O):o==="insideBottom"?Qr({x:s+c/2,y:l+u-d,textAnchor:"middle",verticalAnchor:h},O):o==="insideTopLeft"?Qr({x:s+g,y:l+d,textAnchor:y,verticalAnchor:p},O):o==="insideTopRight"?Qr({x:s+c-g,y:l+d,textAnchor:v,verticalAnchor:p},O):o==="insideBottomLeft"?Qr({x:s+g,y:l+u-d,textAnchor:y,verticalAnchor:h},O):o==="insideBottomRight"?Qr({x:s+c-g,y:l+u-d,textAnchor:v,verticalAnchor:h},O):ky(o)&&(Ye(o.x)||xh(o.x))&&(Ye(o.y)||xh(o.y))?Qr({x:s+dv(o.x,c),y:l+dv(o.y,u),textAnchor:"end",verticalAnchor:"end"},O):Qr({x:s+c/2,y:l+u/2,textAnchor:"middle",verticalAnchor:"middle"},O)},GRt=function(e){return"cx"in e&&Ye(e.cx)};function Xi(t){var e=t.offset,n=e===void 0?5:e,r=LRt(t,MRt),i=Qr({offset:n},r),o=i.viewBox,a=i.position,s=i.value,l=i.children,c=i.content,u=i.className,f=u===void 0?"":u,d=i.textBreakAll;if(!o||qt(s)&&qt(l)&&!M.isValidElement(c)&&!Bt(c))return null;if(M.isValidElement(c))return M.cloneElement(c,i);var h;if(Bt(c)){if(h=M.createElement(c,i),M.isValidElement(h))return h}else h=BRt(i);var p=GRt(o),m=jt(i,!0);if(p&&(a==="insideStart"||a==="insideEnd"||a==="end"))return URt(i,h,m);var g=p?WRt(i):VRt(i);return ue.createElement(HE,R_({className:ke("recharts-label",f)},m,g,{breakAll:d}),h)}Xi.displayName="Label";var lve=function(e){var n=e.cx,r=e.cy,i=e.angle,o=e.startAngle,a=e.endAngle,s=e.r,l=e.radius,c=e.innerRadius,u=e.outerRadius,f=e.x,d=e.y,h=e.top,p=e.left,m=e.width,g=e.height,v=e.clockWise,y=e.labelViewBox;if(y)return y;if(Ye(m)&&Ye(g)){if(Ye(f)&&Ye(d))return{x:f,y:d,width:m,height:g};if(Ye(h)&&Ye(p))return{x:h,y:p,width:m,height:g}}return Ye(f)&&Ye(d)?{x:f,y:d,width:0,height:0}:Ye(n)&&Ye(r)?{cx:n,cy:r,startAngle:o||i||0,endAngle:a||i||0,innerRadius:c||0,outerRadius:u||l||s||0,clockWise:v}:e.viewBox?e.viewBox:{}},HRt=function(e,n){return e?e===!0?ue.createElement(Xi,{key:"label-implicit",viewBox:n}):ei(e)?ue.createElement(Xi,{key:"label-implicit",viewBox:n,value:e}):M.isValidElement(e)?e.type===Xi?M.cloneElement(e,{key:"label-implicit",viewBox:n}):ue.createElement(Xi,{key:"label-implicit",content:e,viewBox:n}):Bt(e)?ue.createElement(Xi,{key:"label-implicit",content:e,viewBox:n}):ky(e)?ue.createElement(Xi,R_({viewBox:n},e,{key:"label-implicit"})):null:null},qRt=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var i=e.children,o=lve(e),a=is(i,Xi).map(function(l,c){return M.cloneElement(l,{viewBox:n||o,key:"label-".concat(c)})});if(!r)return a;var s=HRt(e.label,n||o);return[s].concat(kRt(a))};Xi.parseViewBox=lve;Xi.renderCallByParent=qRt;function XRt(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var QRt=XRt;const YRt=Nt(QRt);function I_(t){"@babel/helpers - typeof";return I_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},I_(t)}var KRt=["valueAccessor"],ZRt=["data","dataKey","clockWise","id","textBreakAll"];function JRt(t){return rIt(t)||nIt(t)||tIt(t)||eIt()}function eIt(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tIt(t,e){if(t){if(typeof t=="string")return $N(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $N(t,e)}}function nIt(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function rIt(t){if(Array.isArray(t))return $N(t)}function $N(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function sIt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var lIt=function(e){return Array.isArray(e.value)?YRt(e.value):e.value};function tu(t){var e=t.valueAccessor,n=e===void 0?lIt:e,r=_Y(t,KRt),i=r.data,o=r.dataKey,a=r.clockWise,s=r.id,l=r.textBreakAll,c=_Y(r,ZRt);return!i||!i.length?null:ue.createElement(Vn,{className:"recharts-label-list"},i.map(function(u,f){var d=qt(o)?n(u,f):ho(u&&u.payload,o),h=qt(s)?{}:{id:"".concat(s,"-").concat(f)};return ue.createElement(Xi,lP({},jt(u,!0),c,h,{parentViewBox:u.parentViewBox,value:d,textBreakAll:l,viewBox:Xi.parseViewBox(qt(a)?u:bY(bY({},u),{},{clockWise:a})),key:"label-".concat(f),index:f}))}))}tu.displayName="LabelList";function cIt(t,e){return t?t===!0?ue.createElement(tu,{key:"labelList-implicit",data:e}):ue.isValidElement(t)||Bt(t)?ue.createElement(tu,{key:"labelList-implicit",data:e,content:t}):ky(t)?ue.createElement(tu,lP({data:e},t,{key:"labelList-implicit"})):null:null}function uIt(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var r=t.children,i=is(r,tu).map(function(a,s){return M.cloneElement(a,{data:e,key:"labelList-".concat(s)})});if(!n)return i;var o=cIt(t.label,e);return[o].concat(JRt(i))}tu.renderCallByParent=uIt;function D_(t){"@babel/helpers - typeof";return D_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},D_(t)}function NN(){return NN=Object.assign?Object.assign.bind():function(t){for(var e=1;e180),",").concat(+(a>c),`, `).concat(f.x,",").concat(f.y,` `);if(i>0){var h=Ai(n,r,i,a),p=Ai(n,r,i,c);d+="L ".concat(p.x,",").concat(p.y,` A `).concat(i,",").concat(i,`,0, `).concat(+(Math.abs(l)>180),",").concat(+(a<=c),`, - `).concat(h.x,",").concat(h.y," Z")}else d+="L ".concat(n,",").concat(r," Z");return d},hIt=function(e){var n=e.cx,r=e.cy,i=e.innerRadius,o=e.outerRadius,a=e.cornerRadius,s=e.forceCornerRadius,l=e.cornerIsExternal,c=e.startAngle,u=e.endAngle,f=Vs(u-c),d=vO({cx:n,cy:r,radius:o,angle:c,sign:f,cornerRadius:a,cornerIsExternal:l}),h=d.circleTangency,p=d.lineTangency,m=d.theta,g=vO({cx:n,cy:r,radius:o,angle:u,sign:-f,cornerRadius:a,cornerIsExternal:l}),v=g.circleTangency,y=g.lineTangency,x=g.theta,b=l?Math.abs(c-u):Math.abs(c-u)-m-x;if(b<0)return s?"M ".concat(p.x,",").concat(p.y,` + `).concat(h.x,",").concat(h.y," Z")}else d+="L ".concat(n,",").concat(r," Z");return d},mIt=function(e){var n=e.cx,r=e.cy,i=e.innerRadius,o=e.outerRadius,a=e.cornerRadius,s=e.forceCornerRadius,l=e.cornerIsExternal,c=e.startAngle,u=e.endAngle,f=Vs(u-c),d=vO({cx:n,cy:r,radius:o,angle:c,sign:f,cornerRadius:a,cornerIsExternal:l}),h=d.circleTangency,p=d.lineTangency,m=d.theta,g=vO({cx:n,cy:r,radius:o,angle:u,sign:-f,cornerRadius:a,cornerIsExternal:l}),v=g.circleTangency,y=g.lineTangency,x=g.theta,b=l?Math.abs(c-u):Math.abs(c-u)-m-x;if(b<0)return s?"M ".concat(p.x,",").concat(p.y,` a`).concat(a,",").concat(a,",0,0,1,").concat(a*2,`,0 a`).concat(a,",").concat(a,",0,0,1,").concat(-a*2,`,0 - `):lve({cx:n,cy:r,innerRadius:i,outerRadius:o,startAngle:c,endAngle:u});var _="M ".concat(p.x,",").concat(p.y,` + `):cve({cx:n,cy:r,innerRadius:i,outerRadius:o,startAngle:c,endAngle:u});var _="M ".concat(p.x,",").concat(p.y,` A`).concat(a,",").concat(a,",0,0,").concat(+(f<0),",").concat(h.x,",").concat(h.y,` A`).concat(o,",").concat(o,",0,").concat(+(b>180),",").concat(+(f<0),",").concat(v.x,",").concat(v.y,` A`).concat(a,",").concat(a,",0,0,").concat(+(f<0),",").concat(y.x,",").concat(y.y,` `);if(i>0){var S=vO({cx:n,cy:r,radius:i,angle:c,sign:f,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),O=S.circleTangency,C=S.lineTangency,E=S.theta,k=vO({cx:n,cy:r,radius:i,angle:u,sign:-f,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),I=k.circleTangency,P=k.lineTangency,R=k.theta,T=l?Math.abs(c-u):Math.abs(c-u)-E-R;if(T<0&&a===0)return"".concat(_,"L").concat(n,",").concat(r,"Z");_+="L".concat(P.x,",").concat(P.y,` A`).concat(a,",").concat(a,",0,0,").concat(+(f<0),",").concat(I.x,",").concat(I.y,` A`).concat(i,",").concat(i,",0,").concat(+(T>180),",").concat(+(f>0),",").concat(O.x,",").concat(O.y,` - A`).concat(a,",").concat(a,",0,0,").concat(+(f<0),",").concat(C.x,",").concat(C.y,"Z")}else _+="L".concat(n,",").concat(r,"Z");return _},pIt={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},cve=function(e){var n=_Y(_Y({},pIt),e),r=n.cx,i=n.cy,o=n.innerRadius,a=n.outerRadius,s=n.cornerRadius,l=n.forceCornerRadius,c=n.cornerIsExternal,u=n.startAngle,f=n.endAngle,d=n.className;if(a0&&Math.abs(u-f)<360?g=hIt({cx:r,cy:i,innerRadius:o,outerRadius:a,cornerRadius:Math.min(m,p/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:f}):g=lve({cx:r,cy:i,innerRadius:o,outerRadius:a,startAngle:u,endAngle:f}),ue.createElement("path",$N({},jt(n,!0),{className:h,d:g,role:"img"}))};function L_(t){"@babel/helpers - typeof";return L_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},L_(t)}function NN(){return NN=Object.assign?Object.assign.bind():function(t){for(var e=1;e0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function OIt(t,e){return Wy(t.getTime(),e.getTime())}function MY(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.entries(),o=0,a,s;(a=i.next())&&!a.done;){for(var l=e.entries(),c=!1,u=0;(s=l.next())&&!s.done;){var f=a.value,d=f[0],h=f[1],p=s.value,m=p[0],g=p[1];!c&&!r[u]&&(c=n.equals(d,m,o,u,t,e,n)&&n.equals(h,g,d,m,t,e,n))&&(r[u]=!0),u++}if(!c)return!1;o++}return!0}function CIt(t,e,n){var r=PY(t),i=r.length;if(PY(e).length!==i)return!1;for(var o;i-- >0;)if(o=r[i],o===fve&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!uve(e,o)||!n.equals(t[o],e[o],o,o,t,e,n))return!1;return!0}function z0(t,e,n){var r=TY(t),i=r.length;if(TY(e).length!==i)return!1;for(var o,a,s;i-- >0;)if(o=r[i],o===fve&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!uve(e,o)||!n.equals(t[o],e[o],o,o,t,e,n)||(a=EY(t,o),s=EY(e,o),(a||s)&&(!a||!s||a.configurable!==s.configurable||a.enumerable!==s.enumerable||a.writable!==s.writable)))return!1;return!0}function TIt(t,e){return Wy(t.valueOf(),e.valueOf())}function EIt(t,e){return t.source===e.source&&t.flags===e.flags}function kY(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.values(),o,a;(o=i.next())&&!o.done;){for(var s=e.values(),l=!1,c=0;(a=s.next())&&!a.done;)!l&&!r[c]&&(l=n.equals(o.value,a.value,o.value,a.value,t,e,n))&&(r[c]=!0),c++;if(!l)return!1}return!0}function PIt(t,e){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}var MIt="[object Arguments]",kIt="[object Boolean]",AIt="[object Date]",RIt="[object Map]",IIt="[object Number]",DIt="[object Object]",LIt="[object RegExp]",$It="[object Set]",NIt="[object String]",FIt=Array.isArray,AY=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,RY=Object.assign,jIt=Object.prototype.toString.call.bind(Object.prototype.toString);function BIt(t){var e=t.areArraysEqual,n=t.areDatesEqual,r=t.areMapsEqual,i=t.areObjectsEqual,o=t.arePrimitiveWrappersEqual,a=t.areRegExpsEqual,s=t.areSetsEqual,l=t.areTypedArraysEqual;return function(u,f,d){if(u===f)return!0;if(u==null||f==null||typeof u!="object"||typeof f!="object")return u!==u&&f!==f;var h=u.constructor;if(h!==f.constructor)return!1;if(h===Object)return i(u,f,d);if(FIt(u))return e(u,f,d);if(AY!=null&&AY(u))return l(u,f,d);if(h===Date)return n(u,f,d);if(h===RegExp)return a(u,f,d);if(h===Map)return r(u,f,d);if(h===Set)return s(u,f,d);var p=jIt(u);return p===AIt?n(u,f,d):p===LIt?a(u,f,d):p===RIt?r(u,f,d):p===$It?s(u,f,d):p===DIt?typeof u.then!="function"&&typeof f.then!="function"&&i(u,f,d):p===MIt?i(u,f,d):p===kIt||p===IIt||p===NIt?o(u,f,d):!1}}function zIt(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?z0:SIt,areDatesEqual:OIt,areMapsEqual:r?CY(MY,z0):MY,areObjectsEqual:r?z0:CIt,arePrimitiveWrappersEqual:TIt,areRegExpsEqual:EIt,areSetsEqual:r?CY(kY,z0):kY,areTypedArraysEqual:r?z0:PIt};if(n&&(i=RY({},i,n(i))),e){var o=xO(i.areArraysEqual),a=xO(i.areMapsEqual),s=xO(i.areObjectsEqual),l=xO(i.areSetsEqual);i=RY({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:s,areSetsEqual:l})}return i}function UIt(t){return function(e,n,r,i,o,a,s){return t(e,n,s)}}function WIt(t){var e=t.circular,n=t.comparator,r=t.createState,i=t.equals,o=t.strict;if(r)return function(l,c){var u=r(),f=u.cache,d=f===void 0?e?new WeakMap:void 0:f,h=u.meta;return n(l,c,{cache:d,equals:i,meta:h,strict:o})};if(e)return function(l,c){return n(l,c,{cache:new WeakMap,equals:i,meta:void 0,strict:o})};var a={cache:void 0,equals:i,meta:void 0,strict:o};return function(l,c){return n(l,c,a)}}var VIt=Td();Td({strict:!0});Td({circular:!0});Td({circular:!0,strict:!0});Td({createInternalComparator:function(){return Wy}});Td({strict:!0,createInternalComparator:function(){return Wy}});Td({circular:!0,createInternalComparator:function(){return Wy}});Td({circular:!0,createInternalComparator:function(){return Wy},strict:!0});function Td(t){t===void 0&&(t={});var e=t.circular,n=e===void 0?!1:e,r=t.createInternalComparator,i=t.createState,o=t.strict,a=o===void 0?!1:o,s=zIt(t),l=BIt(s),c=r?r(l):UIt(l);return WIt({circular:n,comparator:l,createState:i,equals:c,strict:a})}function GIt(t){typeof requestAnimationFrame<"u"&&requestAnimationFrame(t)}function IY(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function i(o){n<0&&(n=o),o-n>e?(t(o),n=-1):GIt(i)};requestAnimationFrame(r)}function FN(t){"@babel/helpers - typeof";return FN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},FN(t)}function HIt(t){return YIt(t)||QIt(t)||XIt(t)||qIt()}function qIt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function XIt(t,e){if(t){if(typeof t=="string")return DY(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return DY(t,e)}}function DY(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n1?1:v<0?0:v},m=function(v){for(var y=v>1?1:v,x=y,b=0;b<8;++b){var _=f(x)-y,S=h(x);if(Math.abs(_-y)0&&arguments[0]!==void 0?arguments[0]:{},n=e.stiff,r=n===void 0?100:n,i=e.damping,o=i===void 0?8:i,a=e.dt,s=a===void 0?17:a,l=function(u,f,d){var h=-(u-f)*r,p=d*o,m=d+(h-p)*s/1e3,g=d*s/1e3+u;return Math.abs(g-f)t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function EDt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function OI(t){return ADt(t)||kDt(t)||MDt(t)||PDt()}function PDt(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function MDt(t,e){if(t){if(typeof t=="string")return WN(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return WN(t,e)}}function kDt(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function ADt(t){if(Array.isArray(t))return WN(t)}function WN(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function fP(t){return fP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},fP(t)}var ec=function(t){LDt(n,t);var e=$Dt(n);function n(r,i){var o;RDt(this,n),o=e.call(this,r,i);var a=o.props,s=a.isActive,l=a.attributeName,c=a.from,u=a.to,f=a.steps,d=a.children,h=a.duration;if(o.handleStyleChange=o.handleStyleChange.bind(HN(o)),o.changeStyle=o.changeStyle.bind(HN(o)),!s||h<=0)return o.state={style:{}},typeof d=="function"&&(o.state={style:u}),GN(o);if(f&&f.length)o.state={style:f[0].style};else if(c){if(typeof d=="function")return o.state={style:c},GN(o);o.state={style:l?mx({},l,c):c}}else o.state={style:{}};return o}return IDt(n,[{key:"componentDidMount",value:function(){var i=this.props,o=i.isActive,a=i.canBegin;this.mounted=!0,!(!o||!a)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var o=this.props,a=o.isActive,s=o.canBegin,l=o.attributeName,c=o.shouldReAnimate,u=o.to,f=o.from,d=this.state.style;if(s){if(!a){var h={style:l?mx({},l,u):u};this.state&&d&&(l&&d[l]!==u||!l&&d!==u)&&this.setState(h);return}if(!(VIt(i.to,u)&&i.canBegin&&i.isActive)){var p=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var m=p||c?f:i.to;if(this.state&&d){var g={style:l?mx({},l,m):m};(l&&d[l]!==m||!l&&d!==m)&&this.setState(g)}this.runAnimation(Es(Es({},this.props),{},{from:m,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var o=this,a=i.from,s=i.to,l=i.duration,c=i.easing,u=i.begin,f=i.onAnimationEnd,d=i.onAnimationStart,h=ODt(a,s,hDt(c),l,this.changeStyle),p=function(){o.stopJSAnimation=h()};this.manager.start([d,u,p,l,f])}},{key:"runStepAnimation",value:function(i){var o=this,a=i.steps,s=i.begin,l=i.onAnimationStart,c=a[0],u=c.style,f=c.duration,d=f===void 0?0:f,h=function(m,g,v){if(v===0)return m;var y=g.duration,x=g.easing,b=x===void 0?"ease":x,_=g.style,S=g.properties,O=g.onAnimationEnd,C=v>0?a[v-1]:g,E=S||Object.keys(_);if(typeof b=="function"||b==="spring")return[].concat(OI(m),[o.runJSAnimation.bind(o,{from:C.style,to:_,duration:y,easing:b}),y]);var k=NY(E,y,b),I=Es(Es(Es({},C.style),_),{},{transition:k});return[].concat(OI(m),[I,y,O]).filter(tDt)};return this.manager.start([l].concat(OI(a.reduce(h,[u,Math.max(d,s)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=KIt());var o=i.begin,a=i.duration,s=i.attributeName,l=i.to,c=i.easing,u=i.onAnimationStart,f=i.onAnimationEnd,d=i.steps,h=i.children,p=this.manager;if(this.unSubscribe=p.subscribe(this.handleStyleChange),typeof c=="function"||typeof h=="function"||c==="spring"){this.runJSAnimation(i);return}if(d.length>1){this.runStepAnimation(i);return}var m=s?mx({},s,l):l,g=NY(Object.keys(m),a,c);p.start([u,o,Es(Es({},m),{},{transition:g}),a,f])}},{key:"render",value:function(){var i=this.props,o=i.children;i.begin;var a=i.duration;i.attributeName,i.easing;var s=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var l=TDt(i,CDt),c=M.Children.count(o),u=this.state.style;if(typeof o=="function")return o(u);if(!s||c===0||a<=0)return o;var f=function(h){var p=h.props,m=p.style,g=m===void 0?{}:m,v=p.className,y=M.cloneElement(h,Es(Es({},l),{},{style:Es(Es({},g),u),className:v}));return y};return c===1?f(M.Children.only(o)):ue.createElement("div",null,M.Children.map(o,function(d){return f(d)}))}}]),n}(M.PureComponent);ec.displayName="Animate";ec.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};ec.propTypes={from:Qe.oneOfType([Qe.object,Qe.string]),to:Qe.oneOfType([Qe.object,Qe.string]),attributeName:Qe.string,duration:Qe.number,begin:Qe.number,easing:Qe.oneOfType([Qe.string,Qe.func]),steps:Qe.arrayOf(Qe.shape({duration:Qe.number.isRequired,style:Qe.object.isRequired,easing:Qe.oneOfType([Qe.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Qe.func]),properties:Qe.arrayOf("string"),onAnimationEnd:Qe.func})),children:Qe.oneOfType([Qe.node,Qe.func]),isActive:Qe.bool,canBegin:Qe.bool,onAnimationEnd:Qe.func,shouldReAnimate:Qe.bool,onAnimationStart:Qe.func,onAnimationReStart:Qe.func};Qe.object,Qe.object,Qe.object,Qe.element;Qe.object,Qe.object,Qe.object,Qe.oneOfType([Qe.array,Qe.element]),Qe.any;function F_(t){"@babel/helpers - typeof";return F_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},F_(t)}function dP(){return dP=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0?1:-1,l=r>=0?1:-1,c=i>=0&&r>=0||i<0&&r<0?1:0,u;if(a>0&&o instanceof Array){for(var f=[0,0,0,0],d=0,h=4;da?a:o[d];u="M".concat(e,",").concat(n+s*f[0]),f[0]>0&&(u+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(c,",").concat(e+l*f[0],",").concat(n)),u+="L ".concat(e+r-l*f[1],",").concat(n),f[1]>0&&(u+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(c,`, + A`).concat(a,",").concat(a,",0,0,").concat(+(f<0),",").concat(C.x,",").concat(C.y,"Z")}else _+="L".concat(n,",").concat(r,"Z");return _},gIt={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},uve=function(e){var n=SY(SY({},gIt),e),r=n.cx,i=n.cy,o=n.innerRadius,a=n.outerRadius,s=n.cornerRadius,l=n.forceCornerRadius,c=n.cornerIsExternal,u=n.startAngle,f=n.endAngle,d=n.className;if(a0&&Math.abs(u-f)<360?g=mIt({cx:r,cy:i,innerRadius:o,outerRadius:a,cornerRadius:Math.min(m,p/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:f}):g=cve({cx:r,cy:i,innerRadius:o,outerRadius:a,startAngle:u,endAngle:f}),ue.createElement("path",NN({},jt(n,!0),{className:h,d:g,role:"img"}))};function L_(t){"@babel/helpers - typeof";return L_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},L_(t)}function FN(){return FN=Object.assign?Object.assign.bind():function(t){for(var e=1;e0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function TIt(t,e){return Wy(t.getTime(),e.getTime())}function AY(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.entries(),o=0,a,s;(a=i.next())&&!a.done;){for(var l=e.entries(),c=!1,u=0;(s=l.next())&&!s.done;){var f=a.value,d=f[0],h=f[1],p=s.value,m=p[0],g=p[1];!c&&!r[u]&&(c=n.equals(d,m,o,u,t,e,n)&&n.equals(h,g,d,m,t,e,n))&&(r[u]=!0),u++}if(!c)return!1;o++}return!0}function EIt(t,e,n){var r=kY(t),i=r.length;if(kY(e).length!==i)return!1;for(var o;i-- >0;)if(o=r[i],o===dve&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!fve(e,o)||!n.equals(t[o],e[o],o,o,t,e,n))return!1;return!0}function z0(t,e,n){var r=PY(t),i=r.length;if(PY(e).length!==i)return!1;for(var o,a,s;i-- >0;)if(o=r[i],o===dve&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!fve(e,o)||!n.equals(t[o],e[o],o,o,t,e,n)||(a=MY(t,o),s=MY(e,o),(a||s)&&(!a||!s||a.configurable!==s.configurable||a.enumerable!==s.enumerable||a.writable!==s.writable)))return!1;return!0}function PIt(t,e){return Wy(t.valueOf(),e.valueOf())}function MIt(t,e){return t.source===e.source&&t.flags===e.flags}function RY(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.values(),o,a;(o=i.next())&&!o.done;){for(var s=e.values(),l=!1,c=0;(a=s.next())&&!a.done;)!l&&!r[c]&&(l=n.equals(o.value,a.value,o.value,a.value,t,e,n))&&(r[c]=!0),c++;if(!l)return!1}return!0}function kIt(t,e){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}var AIt="[object Arguments]",RIt="[object Boolean]",IIt="[object Date]",DIt="[object Map]",LIt="[object Number]",$It="[object Object]",NIt="[object RegExp]",FIt="[object Set]",jIt="[object String]",BIt=Array.isArray,IY=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,DY=Object.assign,zIt=Object.prototype.toString.call.bind(Object.prototype.toString);function UIt(t){var e=t.areArraysEqual,n=t.areDatesEqual,r=t.areMapsEqual,i=t.areObjectsEqual,o=t.arePrimitiveWrappersEqual,a=t.areRegExpsEqual,s=t.areSetsEqual,l=t.areTypedArraysEqual;return function(u,f,d){if(u===f)return!0;if(u==null||f==null||typeof u!="object"||typeof f!="object")return u!==u&&f!==f;var h=u.constructor;if(h!==f.constructor)return!1;if(h===Object)return i(u,f,d);if(BIt(u))return e(u,f,d);if(IY!=null&&IY(u))return l(u,f,d);if(h===Date)return n(u,f,d);if(h===RegExp)return a(u,f,d);if(h===Map)return r(u,f,d);if(h===Set)return s(u,f,d);var p=zIt(u);return p===IIt?n(u,f,d):p===NIt?a(u,f,d):p===DIt?r(u,f,d):p===FIt?s(u,f,d):p===$It?typeof u.then!="function"&&typeof f.then!="function"&&i(u,f,d):p===AIt?i(u,f,d):p===RIt||p===LIt||p===jIt?o(u,f,d):!1}}function WIt(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?z0:CIt,areDatesEqual:TIt,areMapsEqual:r?EY(AY,z0):AY,areObjectsEqual:r?z0:EIt,arePrimitiveWrappersEqual:PIt,areRegExpsEqual:MIt,areSetsEqual:r?EY(RY,z0):RY,areTypedArraysEqual:r?z0:kIt};if(n&&(i=DY({},i,n(i))),e){var o=xO(i.areArraysEqual),a=xO(i.areMapsEqual),s=xO(i.areObjectsEqual),l=xO(i.areSetsEqual);i=DY({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:s,areSetsEqual:l})}return i}function VIt(t){return function(e,n,r,i,o,a,s){return t(e,n,s)}}function GIt(t){var e=t.circular,n=t.comparator,r=t.createState,i=t.equals,o=t.strict;if(r)return function(l,c){var u=r(),f=u.cache,d=f===void 0?e?new WeakMap:void 0:f,h=u.meta;return n(l,c,{cache:d,equals:i,meta:h,strict:o})};if(e)return function(l,c){return n(l,c,{cache:new WeakMap,equals:i,meta:void 0,strict:o})};var a={cache:void 0,equals:i,meta:void 0,strict:o};return function(l,c){return n(l,c,a)}}var HIt=Td();Td({strict:!0});Td({circular:!0});Td({circular:!0,strict:!0});Td({createInternalComparator:function(){return Wy}});Td({strict:!0,createInternalComparator:function(){return Wy}});Td({circular:!0,createInternalComparator:function(){return Wy}});Td({circular:!0,createInternalComparator:function(){return Wy},strict:!0});function Td(t){t===void 0&&(t={});var e=t.circular,n=e===void 0?!1:e,r=t.createInternalComparator,i=t.createState,o=t.strict,a=o===void 0?!1:o,s=WIt(t),l=UIt(s),c=r?r(l):VIt(l);return GIt({circular:n,comparator:l,createState:i,equals:c,strict:a})}function qIt(t){typeof requestAnimationFrame<"u"&&requestAnimationFrame(t)}function LY(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function i(o){n<0&&(n=o),o-n>e?(t(o),n=-1):qIt(i)};requestAnimationFrame(r)}function jN(t){"@babel/helpers - typeof";return jN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jN(t)}function XIt(t){return ZIt(t)||KIt(t)||YIt(t)||QIt()}function QIt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function YIt(t,e){if(t){if(typeof t=="string")return $Y(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $Y(t,e)}}function $Y(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n1?1:v<0?0:v},m=function(v){for(var y=v>1?1:v,x=y,b=0;b<8;++b){var _=f(x)-y,S=h(x);if(Math.abs(_-y)0&&arguments[0]!==void 0?arguments[0]:{},n=e.stiff,r=n===void 0?100:n,i=e.damping,o=i===void 0?8:i,a=e.dt,s=a===void 0?17:a,l=function(u,f,d){var h=-(u-f)*r,p=d*o,m=d+(h-p)*s/1e3,g=d*s/1e3+u;return Math.abs(g-f)t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function MDt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function CI(t){return IDt(t)||RDt(t)||ADt(t)||kDt()}function kDt(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ADt(t,e){if(t){if(typeof t=="string")return VN(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return VN(t,e)}}function RDt(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function IDt(t){if(Array.isArray(t))return VN(t)}function VN(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function fP(t){return fP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},fP(t)}var ec=function(t){NDt(n,t);var e=FDt(n);function n(r,i){var o;DDt(this,n),o=e.call(this,r,i);var a=o.props,s=a.isActive,l=a.attributeName,c=a.from,u=a.to,f=a.steps,d=a.children,h=a.duration;if(o.handleStyleChange=o.handleStyleChange.bind(qN(o)),o.changeStyle=o.changeStyle.bind(qN(o)),!s||h<=0)return o.state={style:{}},typeof d=="function"&&(o.state={style:u}),HN(o);if(f&&f.length)o.state={style:f[0].style};else if(c){if(typeof d=="function")return o.state={style:c},HN(o);o.state={style:l?mx({},l,c):c}}else o.state={style:{}};return o}return LDt(n,[{key:"componentDidMount",value:function(){var i=this.props,o=i.isActive,a=i.canBegin;this.mounted=!0,!(!o||!a)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var o=this.props,a=o.isActive,s=o.canBegin,l=o.attributeName,c=o.shouldReAnimate,u=o.to,f=o.from,d=this.state.style;if(s){if(!a){var h={style:l?mx({},l,u):u};this.state&&d&&(l&&d[l]!==u||!l&&d!==u)&&this.setState(h);return}if(!(HIt(i.to,u)&&i.canBegin&&i.isActive)){var p=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var m=p||c?f:i.to;if(this.state&&d){var g={style:l?mx({},l,m):m};(l&&d[l]!==m||!l&&d!==m)&&this.setState(g)}this.runAnimation(Es(Es({},this.props),{},{from:m,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var o=this,a=i.from,s=i.to,l=i.duration,c=i.easing,u=i.begin,f=i.onAnimationEnd,d=i.onAnimationStart,h=TDt(a,s,mDt(c),l,this.changeStyle),p=function(){o.stopJSAnimation=h()};this.manager.start([d,u,p,l,f])}},{key:"runStepAnimation",value:function(i){var o=this,a=i.steps,s=i.begin,l=i.onAnimationStart,c=a[0],u=c.style,f=c.duration,d=f===void 0?0:f,h=function(m,g,v){if(v===0)return m;var y=g.duration,x=g.easing,b=x===void 0?"ease":x,_=g.style,S=g.properties,O=g.onAnimationEnd,C=v>0?a[v-1]:g,E=S||Object.keys(_);if(typeof b=="function"||b==="spring")return[].concat(CI(m),[o.runJSAnimation.bind(o,{from:C.style,to:_,duration:y,easing:b}),y]);var k=jY(E,y,b),I=Es(Es(Es({},C.style),_),{},{transition:k});return[].concat(CI(m),[I,y,O]).filter(rDt)};return this.manager.start([l].concat(CI(a.reduce(h,[u,Math.max(d,s)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=JIt());var o=i.begin,a=i.duration,s=i.attributeName,l=i.to,c=i.easing,u=i.onAnimationStart,f=i.onAnimationEnd,d=i.steps,h=i.children,p=this.manager;if(this.unSubscribe=p.subscribe(this.handleStyleChange),typeof c=="function"||typeof h=="function"||c==="spring"){this.runJSAnimation(i);return}if(d.length>1){this.runStepAnimation(i);return}var m=s?mx({},s,l):l,g=jY(Object.keys(m),a,c);p.start([u,o,Es(Es({},m),{},{transition:g}),a,f])}},{key:"render",value:function(){var i=this.props,o=i.children;i.begin;var a=i.duration;i.attributeName,i.easing;var s=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var l=PDt(i,EDt),c=M.Children.count(o),u=this.state.style;if(typeof o=="function")return o(u);if(!s||c===0||a<=0)return o;var f=function(h){var p=h.props,m=p.style,g=m===void 0?{}:m,v=p.className,y=M.cloneElement(h,Es(Es({},l),{},{style:Es(Es({},g),u),className:v}));return y};return c===1?f(M.Children.only(o)):ue.createElement("div",null,M.Children.map(o,function(d){return f(d)}))}}]),n}(M.PureComponent);ec.displayName="Animate";ec.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};ec.propTypes={from:Qe.oneOfType([Qe.object,Qe.string]),to:Qe.oneOfType([Qe.object,Qe.string]),attributeName:Qe.string,duration:Qe.number,begin:Qe.number,easing:Qe.oneOfType([Qe.string,Qe.func]),steps:Qe.arrayOf(Qe.shape({duration:Qe.number.isRequired,style:Qe.object.isRequired,easing:Qe.oneOfType([Qe.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Qe.func]),properties:Qe.arrayOf("string"),onAnimationEnd:Qe.func})),children:Qe.oneOfType([Qe.node,Qe.func]),isActive:Qe.bool,canBegin:Qe.bool,onAnimationEnd:Qe.func,shouldReAnimate:Qe.bool,onAnimationStart:Qe.func,onAnimationReStart:Qe.func};Qe.object,Qe.object,Qe.object,Qe.element;Qe.object,Qe.object,Qe.object,Qe.oneOfType([Qe.array,Qe.element]),Qe.any;function F_(t){"@babel/helpers - typeof";return F_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},F_(t)}function dP(){return dP=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0?1:-1,l=r>=0?1:-1,c=i>=0&&r>=0||i<0&&r<0?1:0,u;if(a>0&&o instanceof Array){for(var f=[0,0,0,0],d=0,h=4;da?a:o[d];u="M".concat(e,",").concat(n+s*f[0]),f[0]>0&&(u+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(c,",").concat(e+l*f[0],",").concat(n)),u+="L ".concat(e+r-l*f[1],",").concat(n),f[1]>0&&(u+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(c,`, `).concat(e+r,",").concat(n+s*f[1])),u+="L ".concat(e+r,",").concat(n+i-s*f[2]),f[2]>0&&(u+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(c,`, `).concat(e+r-l*f[2],",").concat(n+i)),u+="L ".concat(e+l*f[3],",").concat(n+i),f[3]>0&&(u+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(c,`, `).concat(e,",").concat(n+i-s*f[3])),u+="Z"}else if(a>0&&o===+o&&o>0){var p=Math.min(a,o);u="M ".concat(e,",").concat(n+s*p,` @@ -319,22 +319,22 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho L `).concat(e+r,",").concat(n+i-s*p,` A `).concat(p,",").concat(p,",0,0,").concat(c,",").concat(e+r-l*p,",").concat(n+i,` L `).concat(e+l*p,",").concat(n+i,` - A `).concat(p,",").concat(p,",0,0,").concat(c,",").concat(e,",").concat(n+i-s*p," Z")}else u="M ".concat(e,",").concat(n," h ").concat(r," v ").concat(i," h ").concat(-r," Z");return u},HDt=function(e,n){if(!e||!n)return!1;var r=e.x,i=e.y,o=n.x,a=n.y,s=n.width,l=n.height;if(Math.abs(s)>0&&Math.abs(l)>0){var c=Math.min(o,o+s),u=Math.max(o,o+s),f=Math.min(a,a+l),d=Math.max(a,a+l);return r>=c&&r<=u&&i>=f&&i<=d}return!1},qDt={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},jU=function(e){var n=HY(HY({},qDt),e),r=M.useRef(),i=M.useState(-1),o=FDt(i,2),a=o[0],s=o[1];M.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var b=r.current.getTotalLength();b&&s(b)}catch{}},[]);var l=n.x,c=n.y,u=n.width,f=n.height,d=n.radius,h=n.className,p=n.animationEasing,m=n.animationDuration,g=n.animationBegin,v=n.isAnimationActive,y=n.isUpdateAnimationActive;if(l!==+l||c!==+c||u!==+u||f!==+f||u===0||f===0)return null;var x=ke("recharts-rectangle",h);return y?ue.createElement(ec,{canBegin:a>0,from:{width:u,height:f,x:l,y:c},to:{width:u,height:f,x:l,y:c},duration:m,animationEasing:p,isActive:y},function(b){var _=b.width,S=b.height,O=b.x,C=b.y;return ue.createElement(ec,{canBegin:a>0,from:"0px ".concat(a===-1?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:m,isActive:v,easing:p},ue.createElement("path",dP({},jt(n,!0),{className:x,d:qY(O,C,_,S,d),ref:r})))}):ue.createElement("path",dP({},jt(n,!0),{className:x,d:qY(l,c,u,f,d)}))};function qN(){return qN=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function eLt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var tLt=function(e,n,r,i,o,a){return"M".concat(e,",").concat(o,"v").concat(i,"M").concat(a,",").concat(n,"h").concat(r)},nLt=function(e){var n=e.x,r=n===void 0?0:n,i=e.y,o=i===void 0?0:i,a=e.top,s=a===void 0?0:a,l=e.left,c=l===void 0?0:l,u=e.width,f=u===void 0?0:u,d=e.height,h=d===void 0?0:d,p=e.className,m=JDt(e,XDt),g=QDt({x:r,y:o,top:s,left:c,width:f,height:h},m);return!Ye(r)||!Ye(o)||!Ye(f)||!Ye(h)||!Ye(s)||!Ye(c)?null:ue.createElement("path",XN({},jt(g,!0),{className:ke("recharts-cross",p),d:tLt(r,o,f,h,s,c)}))},rLt=Dme,iLt=rLt(Object.getPrototypeOf,Object),oLt=iLt,aLt=_u,sLt=oLt,lLt=wu,cLt="[object Object]",uLt=Function.prototype,fLt=Object.prototype,yve=uLt.toString,dLt=fLt.hasOwnProperty,hLt=yve.call(Object);function pLt(t){if(!lLt(t)||aLt(t)!=cLt)return!1;var e=sLt(t);if(e===null)return!0;var n=dLt.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&yve.call(n)==hLt}var mLt=pLt;const gLt=Nt(mLt);var vLt=_u,yLt=wu,xLt="[object Boolean]";function bLt(t){return t===!0||t===!1||yLt(t)&&vLt(t)==xLt}var _Lt=bLt;const wLt=Nt(_Lt);function B_(t){"@babel/helpers - typeof";return B_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},B_(t)}function hP(){return hP=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0,from:{upperWidth:0,lowerWidth:0,height:d,x:l,y:c},to:{upperWidth:u,lowerWidth:f,height:d,x:l,y:c},duration:m,animationEasing:p,isActive:v},function(x){var b=x.upperWidth,_=x.lowerWidth,S=x.height,O=x.x,C=x.y;return ue.createElement(ec,{canBegin:a>0,from:"0px ".concat(a===-1?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:m,easing:p},ue.createElement("path",hP({},jt(n,!0),{className:y,d:ZY(O,C,b,_,S),ref:r})))}):ue.createElement("g",null,ue.createElement("path",hP({},jt(n,!0),{className:y,d:ZY(l,c,u,f,d)})))},ILt=["option","shapeType","propTransformer","activeClassName","isActive"];function z_(t){"@babel/helpers - typeof";return z_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},z_(t)}function DLt(t,e){if(t==null)return{};var n=LLt(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function LLt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function JY(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function pP(t){for(var e=1;e0&&r.handleDrag(i.changedTouches[0])}),oa(ul(r),"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=r.props,o=i.endIndex,a=i.onDragEnd,s=i.startIndex;a==null||a({endIndex:o,startIndex:s})}),r.detachDragEndListener()}),oa(ul(r),"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),oa(ul(r),"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),oa(ul(r),"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),oa(ul(r),"handleSlideDragStart",function(i){var o=aK(i)?i.changedTouches[0]:i;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:o.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(ul(r),"startX"),endX:r.handleTravellerDragStart.bind(ul(r),"endX")},r.state={},r}return m$t(e,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var i=r.startX,o=r.endX,a=this.state.scaleValues,s=this.props,l=s.gap,c=s.data,u=c.length-1,f=Math.min(i,o),d=Math.max(i,o),h=e.getIndexInRange(a,f),p=e.getIndexInRange(a,d);return{startIndex:h-h%l,endIndex:p===u?u:p-p%l}}},{key:"getTextOfTick",value:function(r){var i=this.props,o=i.data,a=i.tickFormatter,s=i.dataKey,l=ho(o[r],s,r);return Bt(a)?a(l,r):l}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var i=this.state,o=i.slideMoveStartX,a=i.startX,s=i.endX,l=this.props,c=l.x,u=l.width,f=l.travellerWidth,d=l.startIndex,h=l.endIndex,p=l.onChange,m=r.pageX-o;m>0?m=Math.min(m,c+u-f-s,c+u-f-a):m<0&&(m=Math.max(m,c-a,c-s));var g=this.getIndex({startX:a+m,endX:s+m});(g.startIndex!==d||g.endIndex!==h)&&p&&p(g),this.setState({startX:a+m,endX:s+m,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,i){var o=aK(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:o.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var i=this.state,o=i.brushMoveStartX,a=i.movingTravellerId,s=i.endX,l=i.startX,c=this.state[a],u=this.props,f=u.x,d=u.width,h=u.travellerWidth,p=u.onChange,m=u.gap,g=u.data,v={startX:this.state.startX,endX:this.state.endX},y=r.pageX-o;y>0?y=Math.min(y,f+d-h-c):y<0&&(y=Math.max(y,f-c)),v[a]=c+y;var x=this.getIndex(v),b=x.startIndex,_=x.endIndex,S=function(){var C=g.length-1;return a==="startX"&&(s>l?b%m===0:_%m===0)||sl?_%m===0:b%m===0)||s>l&&_===C};this.setState(oa(oa({},a,c+y),"brushMoveStartX",r.pageX),function(){p&&S()&&p(x)})}},{key:"handleTravellerMoveKeyboard",value:function(r,i){var o=this,a=this.state,s=a.scaleValues,l=a.startX,c=a.endX,u=this.state[i],f=s.indexOf(u);if(f!==-1){var d=f+r;if(!(d===-1||d>=s.length)){var h=s[d];i==="startX"&&h>=c||i==="endX"&&h<=l||this.setState(oa({},i,h),function(){o.props.onChange(o.getIndex({startX:o.state.startX,endX:o.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,i=r.x,o=r.y,a=r.width,s=r.height,l=r.fill,c=r.stroke;return ue.createElement("rect",{stroke:c,fill:l,x:i,y:o,width:a,height:s})}},{key:"renderPanorama",value:function(){var r=this.props,i=r.x,o=r.y,a=r.width,s=r.height,l=r.data,c=r.children,u=r.padding,f=M.Children.only(c);return f?ue.cloneElement(f,{x:i,y:o,width:a,height:s,margin:u,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(r,i){var o=this,a=this.props,s=a.y,l=a.travellerWidth,c=a.height,u=a.traveller,f=a.ariaLabel,d=a.data,h=a.startIndex,p=a.endIndex,m=Math.max(r,this.props.x),g=TI(TI({},jt(this.props,!1)),{},{x:m,y:s,width:l,height:c}),v=f||"Min value: ".concat(d[h].name,", Max value: ").concat(d[p].name);return ue.createElement(Vn,{tabIndex:0,role:"slider","aria-label":v,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(x){["ArrowLeft","ArrowRight"].includes(x.key)&&(x.preventDefault(),x.stopPropagation(),o.handleTravellerMoveKeyboard(x.key==="ArrowRight"?1:-1,i))},onFocus:function(){o.setState({isTravellerFocused:!0})},onBlur:function(){o.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},e.renderTraveller(u,g))}},{key:"renderSlide",value:function(r,i){var o=this.props,a=o.y,s=o.height,l=o.stroke,c=o.travellerWidth,u=Math.min(r,i)+c,f=Math.max(Math.abs(i-r)-c,0);return ue.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:l,fillOpacity:.2,x:u,y:a,width:f,height:s})}},{key:"renderText",value:function(){var r=this.props,i=r.startIndex,o=r.endIndex,a=r.y,s=r.height,l=r.travellerWidth,c=r.stroke,u=this.state,f=u.startX,d=u.endX,h=5,p={pointerEvents:"none",fill:c};return ue.createElement(Vn,{className:"recharts-brush-texts"},ue.createElement(HE,gP({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,d)-h,y:a+s/2},p),this.getTextOfTick(i)),ue.createElement(HE,gP({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,d)+l+h,y:a+s/2},p),this.getTextOfTick(o)))}},{key:"render",value:function(){var r=this.props,i=r.data,o=r.className,a=r.children,s=r.x,l=r.y,c=r.width,u=r.height,f=r.alwaysShowText,d=this.state,h=d.startX,p=d.endX,m=d.isTextActive,g=d.isSlideMoving,v=d.isTravellerMoving,y=d.isTravellerFocused;if(!i||!i.length||!Ye(s)||!Ye(l)||!Ye(c)||!Ye(u)||c<=0||u<=0)return null;var x=ke("recharts-brush",o),b=ue.Children.count(a)===1,_=h$t("userSelect","none");return ue.createElement(Vn,{className:x,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:_},this.renderBackground(),b&&this.renderPanorama(),this.renderSlide(h,p),this.renderTravellerLayer(h,"startX"),this.renderTravellerLayer(p,"endX"),(m||g||v||y||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var i=r.x,o=r.y,a=r.width,s=r.height,l=r.stroke,c=Math.floor(o+s/2)-1;return ue.createElement(ue.Fragment,null,ue.createElement("rect",{x:i,y:o,width:a,height:s,fill:l,stroke:"none"}),ue.createElement("line",{x1:i+1,y1:c,x2:i+a-1,y2:c,fill:"none",stroke:"#fff"}),ue.createElement("line",{x1:i+1,y1:c+2,x2:i+a-1,y2:c+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,i){var o;return ue.isValidElement(r)?o=ue.cloneElement(r,i):Bt(r)?o=r(i):o=e.renderDefaultTraveller(i),o}},{key:"getDerivedStateFromProps",value:function(r,i){var o=r.data,a=r.width,s=r.x,l=r.travellerWidth,c=r.updateId,u=r.startIndex,f=r.endIndex;if(o!==i.prevData||c!==i.prevUpdateId)return TI({prevData:o,prevTravellerWidth:l,prevUpdateId:c,prevX:s,prevWidth:a},o&&o.length?b$t({data:o,width:a,x:s,travellerWidth:l,startIndex:u,endIndex:f}):{scale:null,scaleValues:null});if(i.scale&&(a!==i.prevWidth||s!==i.prevX||l!==i.prevTravellerWidth)){i.scale.range([s,s+a-l]);var d=i.scale.domain().map(function(h){return i.scale(h)});return{prevData:o,prevTravellerWidth:l,prevUpdateId:c,prevX:s,prevWidth:a,startX:i.scale(r.startIndex),endX:i.scale(r.endIndex),scaleValues:d}}return null}},{key:"getIndexInRange",value:function(r,i){for(var o=r.length,a=0,s=o-1;s-a>1;){var l=Math.floor((a+s)/2);r[l]>i?s=l:a=l}return i>=r[s]?s:a}}]),e}(M.PureComponent);oa(lp,"displayName","Brush");oa(lp,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var _$t=fU;function w$t(t,e){var n;return _$t(t,function(r,i,o){return n=e(r,i,o),!n}),!!n}var S$t=w$t,O$t=Tme,C$t=Sd,T$t=S$t,E$t=Ho,P$t=ck;function M$t(t,e,n){var r=E$t(t)?O$t:T$t;return n&&P$t(t,e,n)&&(e=void 0),r(t,C$t(e))}var k$t=M$t;const A$t=Nt(k$t);var Ql=function(e,n){var r=e.alwaysShow,i=e.ifOverflow;return r&&(i="extendDomain"),i===n},sK=Qme;function R$t(t,e,n){e=="__proto__"&&sK?sK(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var I$t=R$t,D$t=I$t,L$t=qme,$$t=Sd;function N$t(t,e){var n={};return e=$$t(e),L$t(t,function(r,i,o){D$t(n,i,e(r,i,o))}),n}var F$t=N$t;const j$t=Nt(F$t);function B$t(t,e){for(var n=-1,r=t==null?0:t.length;++n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function r3t(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function i3t(t,e){var n=t.x,r=t.y,i=n3t(t,Z$t),o="".concat(n),a=parseInt(o,10),s="".concat(r),l=parseInt(s,10),c="".concat(e.height||i.height),u=parseInt(c,10),f="".concat(e.width||i.width),d=parseInt(f,10);return U0(U0(U0(U0(U0({},e),i),a?{x:a}:{}),l?{y:l}:{}),{},{height:u,width:d,name:e.name,radius:e.radius})}function cK(t){return ue.createElement(ULt,YN({shapeType:"rectangle",propTransformer:i3t,activeClassName:"recharts-active-bar"},t))}var o3t=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,i){if(typeof e=="number")return e;var o=typeof r=="number";return o?e(r,i):(o||sp(!1),n)}},a3t=["value","background"],Ove;function Cv(t){"@babel/helpers - typeof";return Cv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Cv(t)}function s3t(t,e){if(t==null)return{};var n=l3t(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function l3t(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function yP(){return yP=Object.assign?Object.assign.bind():function(t){for(var e=1;e0&&Math.abs(T)0&&Math.abs(R)0&&(R=Math.min((q||0)-(T[Y-1]||0),R))}),Number.isFinite(R)){var L=R/P,z=m.layout==="vertical"?r.height:r.width;if(m.padding==="gap"&&(O=L*z/2),m.padding==="no-gap"){var B=dv(e.barCategoryGap,L*z),W=L*z/2;O=W-B-(W-B)/z*B}}}i==="xAxis"?C=[r.left+(x.left||0)+(O||0),r.left+r.width-(x.right||0)-(O||0)]:i==="yAxis"?C=l==="horizontal"?[r.top+r.height-(x.bottom||0),r.top+(x.top||0)]:[r.top+(x.top||0)+(O||0),r.top+r.height-(x.bottom||0)-(O||0)]:C=m.range,_&&(C=[C[1],C[0]]);var U=aRt(m,o,d),N=U.scale,$=U.realScaleType;N.domain(v).range(C),sRt(N);var D=mRt(N,Ns(Ns({},m),{},{realScaleType:$}));i==="xAxis"?(I=g==="top"&&!b||g==="bottom"&&b,E=r.left,k=f[S]-I*m.height):i==="yAxis"&&(I=g==="left"&&!b||g==="right"&&b,E=f[S]-I*m.width,k=r.top);var A=Ns(Ns(Ns({},m),D),{},{realScaleType:$,x:E,y:k,scale:N,width:i==="xAxis"?r.width:m.width,height:i==="yAxis"?r.height:m.height});return A.bandSize=aP(A,D),!m.hide&&i==="xAxis"?f[S]+=(I?-1:1)*A.height:m.hide||(f[S]+=(I?-1:1)*A.width),Ns(Ns({},h),{},wk({},p,A))},{})},Pve=function(e,n){var r=e.x,i=e.y,o=n.x,a=n.y;return{x:Math.min(r,o),y:Math.min(i,a),width:Math.abs(o-r),height:Math.abs(a-i)}},y3t=function(e){var n=e.x1,r=e.y1,i=e.x2,o=e.y2;return Pve({x:n,y:r},{x:i,y:o})},Mve=function(){function t(e){m3t(this,t),this.scale=e}return g3t(t,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.bandAware,o=r.position;if(n!==void 0){if(o)switch(o){case"start":return this.scale(n);case"middle":{var a=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+a}case"end":{var s=this.bandwidth?this.bandwidth():0;return this.scale(n)+s}default:return this.scale(n)}if(i){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+l}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),i=r[0],o=r[r.length-1];return i<=o?n>=i&&n<=o:n>=o&&n<=i}}],[{key:"create",value:function(n){return new t(n)}}]),t}();wk(Mve,"EPS",1e-4);var zU=function(e){var n=Object.keys(e).reduce(function(r,i){return Ns(Ns({},r),{},wk({},i,Mve.create(e[i])))},{});return Ns(Ns({},n),{},{apply:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=o.bandAware,s=o.position;return j$t(i,function(l,c){return n[c].apply(l,{bandAware:a,position:s})})},isInRange:function(i){return Sve(i,function(o,a){return n[a].isInRange(o)})}})};function x3t(t){return(t%180+180)%180}var b3t=function(e){var n=e.width,r=e.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=x3t(i),a=o*Math.PI/180,s=Math.atan(r/n),l=a>s&&a-1?i[o?e[a]:a]:void 0}}var C3t=O3t,T3t=xve;function E3t(t){var e=T3t(t),n=e%1;return e===e?n?e-n:e:0}var P3t=E3t,M3t=Bme,k3t=Sd,A3t=P3t,R3t=Math.max;function I3t(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=n==null?0:A3t(n);return i<0&&(i=R3t(r+i,0)),M3t(t,k3t(e),i)}var D3t=I3t,L3t=C3t,$3t=D3t,N3t=L3t($3t),F3t=N3t;const j3t=Nt(F3t);var B3t=r0t(function(t){return{x:t.left,y:t.top,width:t.width,height:t.height}},function(t){return["l",t.left,"t",t.top,"w",t.width,"h",t.height].join("")}),UU=M.createContext(void 0),WU=M.createContext(void 0),kve=M.createContext(void 0),Ave=M.createContext({}),Rve=M.createContext(void 0),Ive=M.createContext(0),Dve=M.createContext(0),pK=function(e){var n=e.state,r=n.xAxisMap,i=n.yAxisMap,o=n.offset,a=e.clipPathId,s=e.children,l=e.width,c=e.height,u=B3t(o);return ue.createElement(UU.Provider,{value:r},ue.createElement(WU.Provider,{value:i},ue.createElement(Ave.Provider,{value:o},ue.createElement(kve.Provider,{value:u},ue.createElement(Rve.Provider,{value:a},ue.createElement(Ive.Provider,{value:c},ue.createElement(Dve.Provider,{value:l},s)))))))},z3t=function(){return M.useContext(Rve)},Lve=function(e){var n=M.useContext(UU);n==null&&sp(!1);var r=n[e];return r==null&&sp(!1),r},U3t=function(){var e=M.useContext(UU);return ff(e)},W3t=function(){var e=M.useContext(WU),n=j3t(e,function(r){return Sve(r.domain,Number.isFinite)});return n||ff(e)},$ve=function(e){var n=M.useContext(WU);n==null&&sp(!1);var r=n[e];return r==null&&sp(!1),r},V3t=function(){var e=M.useContext(kve);return e},G3t=function(){return M.useContext(Ave)},VU=function(){return M.useContext(Dve)},GU=function(){return M.useContext(Ive)};function H_(t){"@babel/helpers - typeof";return H_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},H_(t)}function mK(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function gK(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);nt*i)return!1;var o=n();return t*(e-t*o/2-r)>=0&&t*(e+t*o/2-i)<=0}function dNt(t,e){return Nve(t,e+1)}function hNt(t,e,n,r,i){for(var o=(r||[]).slice(),a=e.start,s=e.end,l=0,c=1,u=a,f=function(){var p=r==null?void 0:r[l];if(p===void 0)return{v:Nve(r,c)};var m=l,g,v=function(){return g===void 0&&(g=n(p,m)),g},y=p.coordinate,x=l===0||bP(t,y,v,u,s);x||(l=0,u=a,c+=1),x&&(u=y+t*(v()/2+i),l+=c)},d;c<=o.length;)if(d=f(),d)return d.v;return[]}function Q_(t){"@babel/helpers - typeof";return Q_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Q_(t)}function wK(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Vi(t){for(var e=1;e0?h.coordinate-g*t:h.coordinate})}else o[d]=h=Vi(Vi({},h),{},{tickCoord:h.coordinate});var v=bP(t,h.tickCoord,m,s,l);v&&(l=h.tickCoord-t*(m()/2+i),o[d]=Vi(Vi({},h),{},{isShow:!0}))},u=a-1;u>=0;u--)c(u);return o}function yNt(t,e,n,r,i,o){var a=(r||[]).slice(),s=a.length,l=e.start,c=e.end;if(o){var u=r[s-1],f=n(u,s-1),d=t*(u.coordinate+t*f/2-c);a[s-1]=u=Vi(Vi({},u),{},{tickCoord:d>0?u.coordinate-d*t:u.coordinate});var h=bP(t,u.tickCoord,function(){return f},l,c);h&&(c=u.tickCoord-t*(f/2+i),a[s-1]=Vi(Vi({},u),{},{isShow:!0}))}for(var p=o?s-1:s,m=function(y){var x=a[y],b,_=function(){return b===void 0&&(b=n(x,y)),b};if(y===0){var S=t*(x.coordinate-t*_()/2-l);a[y]=x=Vi(Vi({},x),{},{tickCoord:S<0?x.coordinate-S*t:x.coordinate})}else a[y]=x=Vi(Vi({},x),{},{tickCoord:x.coordinate});var O=bP(t,x.tickCoord,_,l,c);O&&(l=x.tickCoord+t*(_()/2+i),a[y]=Vi(Vi({},x),{},{isShow:!0}))},g=0;g=2?Vs(i[1].coordinate-i[0].coordinate):1,v=fNt(o,g,h);return l==="equidistantPreserveStart"?hNt(g,v,m,i,a):(l==="preserveStart"||l==="preserveStartEnd"?d=yNt(g,v,m,i,a,l==="preserveStartEnd"):d=vNt(g,v,m,i,a),d.filter(function(y){return y.isShow}))}var xNt=["viewBox"],bNt=["viewBox"],_Nt=["ticks"];function Tv(t){"@babel/helpers - typeof";return Tv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Tv(t)}function rg(){return rg=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function wNt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function SNt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function OK(t,e){for(var n=0;n0?l(this.props):l(h)),a<=0||s<=0||!p||!p.length?null:ue.createElement(Vn,{className:ke("recharts-cartesian-axis",c),ref:function(g){r.layerReference=g}},o&&this.renderAxisLine(),this.renderTicks(p,this.state.fontSize,this.state.letterSpacing),Xi.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,i,o){var a;return ue.isValidElement(r)?a=ue.cloneElement(r,i):Bt(r)?a=r(i):a=ue.createElement(HE,rg({},i,{className:"recharts-cartesian-axis-tick-value"}),o),a}}]),e}(M.Component);qU(Vy,"displayName","CartesianAxis");qU(Vy,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var kNt=["x1","y1","x2","y2","key"],ANt=["offset"];function cp(t){"@babel/helpers - typeof";return cp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cp(t)}function CK(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Qi(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function LNt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var $Nt=function(e){var n=e.fill;if(!n||n==="none")return null;var r=e.fillOpacity,i=e.x,o=e.y,a=e.width,s=e.height;return ue.createElement("rect",{x:i,y:o,width:a,height:s,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function Bve(t,e){var n;if(ue.isValidElement(t))n=ue.cloneElement(t,e);else if(Bt(t))n=t(e);else{var r=e.x1,i=e.y1,o=e.x2,a=e.y2,s=e.key,l=TK(e,kNt),c=jt(l,!1);c.offset;var u=TK(c,ANt);n=ue.createElement("line",wh({},u,{x1:r,y1:i,x2:o,y2:a,fill:"none",key:s}))}return n}function NNt(t){var e=t.x,n=t.width,r=t.horizontal,i=r===void 0?!0:r,o=t.horizontalPoints;if(!i||!o||!o.length)return null;var a=o.map(function(s,l){var c=Qi(Qi({},t),{},{x1:e,y1:s,x2:e+n,y2:s,key:"line-".concat(l),index:l});return Bve(i,c)});return ue.createElement("g",{className:"recharts-cartesian-grid-horizontal"},a)}function FNt(t){var e=t.y,n=t.height,r=t.vertical,i=r===void 0?!0:r,o=t.verticalPoints;if(!i||!o||!o.length)return null;var a=o.map(function(s,l){var c=Qi(Qi({},t),{},{x1:s,y1:e,x2:s,y2:e+n,key:"line-".concat(l),index:l});return Bve(i,c)});return ue.createElement("g",{className:"recharts-cartesian-grid-vertical"},a)}function jNt(t){var e=t.horizontalFill,n=t.fillOpacity,r=t.x,i=t.y,o=t.width,a=t.height,s=t.horizontalPoints,l=t.horizontal,c=l===void 0?!0:l;if(!c||!e||!e.length)return null;var u=s.map(function(d){return Math.round(d+i-i)}).sort(function(d,h){return d-h});i!==u[0]&&u.unshift(0);var f=u.map(function(d,h){var p=!u[h+1],m=p?i+a-d:u[h+1]-d;if(m<=0)return null;var g=h%e.length;return ue.createElement("rect",{key:"react-".concat(h),y:d,x:r,height:m,width:o,stroke:"none",fill:e[g],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return ue.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function BNt(t){var e=t.vertical,n=e===void 0?!0:e,r=t.verticalFill,i=t.fillOpacity,o=t.x,a=t.y,s=t.width,l=t.height,c=t.verticalPoints;if(!n||!r||!r.length)return null;var u=c.map(function(d){return Math.round(d+o-o)}).sort(function(d,h){return d-h});o!==u[0]&&u.unshift(0);var f=u.map(function(d,h){var p=!u[h+1],m=p?o+s-d:u[h+1]-d;if(m<=0)return null;var g=h%r.length;return ue.createElement("rect",{key:"react-".concat(h),x:d,y:a,width:m,height:l,stroke:"none",fill:r[g],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return ue.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var zNt=function(e,n){var r=e.xAxis,i=e.width,o=e.height,a=e.offset;return ive(HU(Qi(Qi(Qi({},Vy.defaultProps),r),{},{ticks:Hc(r,!0),viewBox:{x:0,y:0,width:i,height:o}})),a.left,a.left+a.width,n)},UNt=function(e,n){var r=e.yAxis,i=e.width,o=e.height,a=e.offset;return ive(HU(Qi(Qi(Qi({},Vy.defaultProps),r),{},{ticks:Hc(r,!0),viewBox:{x:0,y:0,width:i,height:o}})),a.top,a.top+a.height,n)},lm={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function XU(t){var e,n,r,i,o,a,s=VU(),l=GU(),c=G3t(),u=Qi(Qi({},t),{},{stroke:(e=t.stroke)!==null&&e!==void 0?e:lm.stroke,fill:(n=t.fill)!==null&&n!==void 0?n:lm.fill,horizontal:(r=t.horizontal)!==null&&r!==void 0?r:lm.horizontal,horizontalFill:(i=t.horizontalFill)!==null&&i!==void 0?i:lm.horizontalFill,vertical:(o=t.vertical)!==null&&o!==void 0?o:lm.vertical,verticalFill:(a=t.verticalFill)!==null&&a!==void 0?a:lm.verticalFill,x:Ye(t.x)?t.x:c.left,y:Ye(t.y)?t.y:c.top,width:Ye(t.width)?t.width:c.width,height:Ye(t.height)?t.height:c.height}),f=u.x,d=u.y,h=u.width,p=u.height,m=u.syncWithTicks,g=u.horizontalValues,v=u.verticalValues,y=U3t(),x=W3t();if(!Ye(h)||h<=0||!Ye(p)||p<=0||!Ye(f)||f!==+f||!Ye(d)||d!==+d)return null;var b=u.verticalCoordinatesGenerator||zNt,_=u.horizontalCoordinatesGenerator||UNt,S=u.horizontalPoints,O=u.verticalPoints;if((!S||!S.length)&&Bt(_)){var C=g&&g.length,E=_({yAxis:x?Qi(Qi({},x),{},{ticks:C?g:x.ticks}):void 0,width:s,height:l,offset:c},C?!0:m);Jc(Array.isArray(E),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(cp(E),"]")),Array.isArray(E)&&(S=E)}if((!O||!O.length)&&Bt(b)){var k=v&&v.length,I=b({xAxis:y?Qi(Qi({},y),{},{ticks:k?v:y.ticks}):void 0,width:s,height:l,offset:c},k?!0:m);Jc(Array.isArray(I),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(cp(I),"]")),Array.isArray(I)&&(O=I)}return ue.createElement("g",{className:"recharts-cartesian-grid"},ue.createElement($Nt,{fill:u.fill,fillOpacity:u.fillOpacity,x:u.x,y:u.y,width:u.width,height:u.height}),ue.createElement(NNt,wh({},u,{offset:c,horizontalPoints:S,xAxis:y,yAxis:x})),ue.createElement(FNt,wh({},u,{offset:c,verticalPoints:O,xAxis:y,yAxis:x})),ue.createElement(jNt,wh({},u,{horizontalPoints:S})),ue.createElement(BNt,wh({},u,{verticalPoints:O})))}XU.displayName="CartesianGrid";var WNt=["type","layout","connectNulls","ref"];function Ev(t){"@babel/helpers - typeof";return Ev=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ev(t)}function VNt(t,e){if(t==null)return{};var n=GNt(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function GNt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function ob(){return ob=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);nf){h=[].concat(cm(l.slice(0,p)),[f-m]);break}var g=h.length%2===0?[0,d]:[d];return[].concat(cm(e.repeat(l,u)),cm(h),g).map(function(v){return"".concat(v,"px")}).join(", ")}),Fs(Xu(n),"id",Ly("recharts-line-")),Fs(Xu(n),"pathRef",function(a){n.mainCurve=a}),Fs(Xu(n),"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),Fs(Xu(n),"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return KNt(e,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,a=o.points,s=o.xAxis,l=o.yAxis,c=o.layout,u=o.children,f=is(u,Uy);if(!f)return null;var d=function(m,g){return{x:m.x,y:m.y,value:m.value,errorVal:ho(m.payload,g)}},h={clipPath:r?"url(#clipPath-".concat(i,")"):null};return ue.createElement(Vn,h,f.map(function(p){return ue.cloneElement(p,{key:"bar-".concat(p.props.dataKey),data:a,xAxis:s,yAxis:l,layout:c,dataPointFormatter:d})}))}},{key:"renderDots",value:function(r,i,o){var a=this.props.isAnimationActive;if(a&&!this.state.isAnimationFinished)return null;var s=this.props,l=s.dot,c=s.points,u=s.dataKey,f=jt(this.props,!1),d=jt(l,!0),h=c.map(function(m,g){var v=ra(ra(ra({key:"dot-".concat(g),r:3},f),d),{},{value:m.value,dataKey:u,cx:m.x,cy:m.y,index:g,payload:m.payload});return e.renderDotItem(l,v)}),p={clipPath:r?"url(#clipPath-".concat(i?"":"dots-").concat(o,")"):null};return ue.createElement(Vn,ob({className:"recharts-line-dots",key:"dots"},p),h)}},{key:"renderCurveStatically",value:function(r,i,o,a){var s=this.props,l=s.type,c=s.layout,u=s.connectNulls;s.ref;var f=VNt(s,WNt),d=ra(ra(ra({},jt(f,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(o,")"):null,points:r},a),{},{type:l,layout:c,connectNulls:u});return ue.createElement(Dg,ob({},d,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,i){var o=this,a=this.props,s=a.points,l=a.strokeDasharray,c=a.isAnimationActive,u=a.animationBegin,f=a.animationDuration,d=a.animationEasing,h=a.animationId,p=a.animateNewValues,m=a.width,g=a.height,v=this.state,y=v.prevPoints,x=v.totalLength;return ue.createElement(ec,{begin:u,duration:f,isActive:c,easing:d,from:{t:0},to:{t:1},key:"line-".concat(h),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(b){var _=b.t;if(y){var S=y.length/s.length,O=s.map(function(P,R){var T=Math.floor(R*S);if(y[T]){var L=y[T],z=Ei(L.x,P.x),B=Ei(L.y,P.y);return ra(ra({},P),{},{x:z(_),y:B(_)})}if(p){var W=Ei(m*2,P.x),U=Ei(g/2,P.y);return ra(ra({},P),{},{x:W(_),y:U(_)})}return ra(ra({},P),{},{x:P.x,y:P.y})});return o.renderCurveStatically(O,r,i)}var C=Ei(0,x),E=C(_),k;if(l){var I="".concat(l).split(/[,\s]+/gim).map(function(P){return parseFloat(P)});k=o.getStrokeDasharray(E,x,I)}else k=o.generateSimpleStrokeDasharray(x,E);return o.renderCurveStatically(s,r,i,{strokeDasharray:k})})}},{key:"renderCurve",value:function(r,i){var o=this.props,a=o.points,s=o.isAnimationActive,l=this.state,c=l.prevPoints,u=l.totalLength;return s&&a&&a.length&&(!c&&u>0||!wv(c,a))?this.renderCurveWithAnimation(r,i):this.renderCurveStatically(a,r,i)}},{key:"render",value:function(){var r,i=this.props,o=i.hide,a=i.dot,s=i.points,l=i.className,c=i.xAxis,u=i.yAxis,f=i.top,d=i.left,h=i.width,p=i.height,m=i.isAnimationActive,g=i.id;if(o||!s||!s.length)return null;var v=this.state.isAnimationFinished,y=s.length===1,x=ke("recharts-line",l),b=c&&c.allowDataOverflow,_=u&&u.allowDataOverflow,S=b||_,O=qt(g)?this.id:g,C=(r=jt(a,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},E=C.r,k=E===void 0?3:E,I=C.strokeWidth,P=I===void 0?2:I,R=Kpe(a)?a:{},T=R.clipDot,L=T===void 0?!0:T,z=k*2+P;return ue.createElement(Vn,{className:x},b||_?ue.createElement("defs",null,ue.createElement("clipPath",{id:"clipPath-".concat(O)},ue.createElement("rect",{x:b?d:d-h/2,y:_?f:f-p/2,width:b?h:h*2,height:_?p:p*2})),!L&&ue.createElement("clipPath",{id:"clipPath-dots-".concat(O)},ue.createElement("rect",{x:d-z/2,y:f-z/2,width:h+z,height:p+z}))):null,!y&&this.renderCurve(S,O),this.renderErrorBar(S,O),(y||a)&&this.renderDots(S,L,O),(!m||v)&&tu.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:i.curPoints}:r.points!==i.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,i){for(var o=r.length%2!==0?[].concat(cm(r),[0]):r,a=[],s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function iFt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function Sh(){return Sh=Object.assign?Object.assign.bind():function(t){for(var e=1;e0||!wv(u,a)||!wv(f,s))?this.renderAreaWithAnimation(r,i):this.renderAreaStatically(a,s,r,i)}},{key:"render",value:function(){var r,i=this.props,o=i.hide,a=i.dot,s=i.points,l=i.className,c=i.top,u=i.left,f=i.xAxis,d=i.yAxis,h=i.width,p=i.height,m=i.isAnimationActive,g=i.id;if(o||!s||!s.length)return null;var v=this.state.isAnimationFinished,y=s.length===1,x=ke("recharts-area",l),b=f&&f.allowDataOverflow,_=d&&d.allowDataOverflow,S=b||_,O=qt(g)?this.id:g,C=(r=jt(a,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},E=C.r,k=E===void 0?3:E,I=C.strokeWidth,P=I===void 0?2:I,R=Kpe(a)?a:{},T=R.clipDot,L=T===void 0?!0:T,z=k*2+P;return ue.createElement(Vn,{className:x},b||_?ue.createElement("defs",null,ue.createElement("clipPath",{id:"clipPath-".concat(O)},ue.createElement("rect",{x:b?u:u-h/2,y:_?c:c-p/2,width:b?h:h*2,height:_?p:p*2})),!L&&ue.createElement("clipPath",{id:"clipPath-dots-".concat(O)},ue.createElement("rect",{x:u-z/2,y:c-z/2,width:h+z,height:p+z}))):null,y?null:this.renderArea(S,O),(a||y)&&this.renderDots(S,L,O),(!m||v)&&tu.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,curBaseLine:r.baseLine,prevPoints:i.curPoints,prevBaseLine:i.curBaseLine}:r.points!==i.curPoints||r.baseLine!==i.curBaseLine?{curPoints:r.points,curBaseLine:r.baseLine}:null}}]),e}(M.PureComponent);Wve=Ed;Ll(Ed,"displayName","Area");Ll(Ed,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!ql.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});Ll(Ed,"getBaseValue",function(t,e,n,r){var i=t.layout,o=t.baseValue,a=e.props.baseValue,s=a??o;if(Ye(s)&&typeof s=="number")return s;var l=i==="horizontal"?r:n,c=l.scale.domain();if(l.type==="number"){var u=Math.max(c[0],c[1]),f=Math.min(c[0],c[1]);return s==="dataMin"?f:s==="dataMax"||u<0?u:Math.max(Math.min(c[0],c[1]),0)}return s==="dataMin"?c[0]:s==="dataMax"?c[1]:c[0]});Ll(Ed,"getComposedData",function(t){var e=t.props,n=t.item,r=t.xAxis,i=t.yAxis,o=t.xAxisTicks,a=t.yAxisTicks,s=t.bandSize,l=t.dataKey,c=t.stackedData,u=t.dataStartIndex,f=t.displayedData,d=t.offset,h=e.layout,p=c&&c.length,m=Wve.getBaseValue(e,n,r,i),g=h==="horizontal",v=!1,y=f.map(function(b,_){var S;p?S=c[u+_]:(S=ho(b,l),Array.isArray(S)?v=!0:S=[m,S]);var O=S[1]==null||p&&ho(b,l)==null;return g?{x:oP({axis:r,ticks:o,bandSize:s,entry:b,index:_}),y:O?null:i.scale(S[1]),value:S,payload:b}:{x:O?null:r.scale(S[1]),y:oP({axis:i,ticks:a,bandSize:s,entry:b,index:_}),value:S,payload:b}}),x;return p||v?x=y.map(function(b){var _=Array.isArray(b.value)?b.value[0]:null;return g?{x:b.x,y:_!=null&&b.y!=null?i.scale(_):null}:{x:_!=null?r.scale(_):null,y:b.y}}):x=g?i.scale(m):r.scale(m),Qu({points:y,baseLine:x,layout:h,isRange:v},d)});Ll(Ed,"renderDotItem",function(t,e){var n;if(ue.isValidElement(t))n=ue.cloneElement(t,e);else if(Bt(t))n=t(e);else{var r=ke("recharts-area-dot",typeof t!="boolean"?t.className:"");n=ue.createElement(xk,Sh({},e,{className:r}))}return n});function oF(){return oF=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function IFt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function DFt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function $K(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n0?a:e&&e.length&&Ye(i)&&Ye(o)?e.slice(i,o+1):[]};function Jve(t){return t==="number"?[0,"auto"]:void 0}var fF=function(e,n,r,i){var o=e.graphicalItems,a=e.tooltipAxis,s=Sk(n,e);return r<0||!o||!o.length||r>=s.length?null:o.reduce(function(l,c){var u,f=(u=c.props.data)!==null&&u!==void 0?u:n;f&&e.dataStartIndex+e.dataEndIndex!==0&&(f=f.slice(e.dataStartIndex,e.dataEndIndex+1));var d;if(a.dataKey&&!a.allowDuplicatedCategory){var h=f===void 0?s:f;d=kE(h,a.dataKey,i)}else d=f&&f[r]||s[r];return d?[].concat(kv(l),[ave(c,d)]):l},[])},FK=function(e,n,r,i){var o=i||{x:e.chartX,y:e.chartY},a=GFt(o,r),s=e.orderedTooltipTicks,l=e.tooltipAxis,c=e.tooltipTicks,u=eRt(a,s,c,l);if(u>=0&&c){var f=c[u]&&c[u].value,d=fF(e,n,u,f),h=HFt(r,s,u,o);return{activeTooltipIndex:u,activeLabel:f,activePayload:d,activeCoordinate:h}}return null},qFt=function(e,n){var r=n.axes,i=n.graphicalItems,o=n.axisType,a=n.axisIdKey,s=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.layout,f=e.children,d=e.stackOffset,h=rve(u,o);return r.reduce(function(p,m){var g,v=m.props,y=v.type,x=v.dataKey,b=v.allowDataOverflow,_=v.allowDuplicatedCategory,S=v.scale,O=v.ticks,C=v.includeHidden,E=m.props[a];if(p[E])return p;var k=Sk(e.data,{graphicalItems:i.filter(function(D){return D.props[a]===E}),dataStartIndex:l,dataEndIndex:c}),I=k.length,P,R,T;_Ft(m.props.domain,b,y)&&(P=IN(m.props.domain,null,b),h&&(y==="number"||S!=="auto")&&(T=rb(k,x,"category")));var L=Jve(y);if(!P||P.length===0){var z,B=(z=m.props.domain)!==null&&z!==void 0?z:L;if(x){if(P=rb(k,x,y),y==="category"&&h){var W=nxt(P);_&&W?(R=P,P=mP(0,I)):_||(P=dY(B,P,m).reduce(function(D,A){return D.indexOf(A)>=0?D:[].concat(kv(D),[A])},[]))}else if(y==="category")_?P=P.filter(function(D){return D!==""&&!qt(D)}):P=dY(B,P,m).reduce(function(D,A){return D.indexOf(A)>=0||A===""||qt(A)?D:[].concat(kv(D),[A])},[]);else if(y==="number"){var U=oRt(k,i.filter(function(D){return D.props[a]===E&&(C||!D.props.hide)}),x,o,u);U&&(P=U)}h&&(y==="number"||S!=="auto")&&(T=rb(k,x,"category"))}else h?P=mP(0,I):s&&s[E]&&s[E].hasStack&&y==="number"?P=d==="expand"?[0,1]:ove(s[E].stackGroups,l,c):P=nve(k,i.filter(function(D){return D.props[a]===E&&(C||!D.props.hide)}),y,u,!0);if(y==="number")P=lF(f,P,E,o,O),B&&(P=IN(B,P,b));else if(y==="category"&&B){var N=B,$=P.every(function(D){return N.indexOf(D)>=0});$&&(P=N)}}return Be(Be({},p),{},Ct({},E,Be(Be({},m.props),{},{axisType:o,domain:P,categoricalDomain:T,duplicateDomain:R,originalDomain:(g=m.props.domain)!==null&&g!==void 0?g:L,isCategorical:h,layout:u})))},{})},XFt=function(e,n){var r=n.graphicalItems,i=n.Axis,o=n.axisType,a=n.axisIdKey,s=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.layout,f=e.children,d=Sk(e.data,{graphicalItems:r,dataStartIndex:l,dataEndIndex:c}),h=d.length,p=rve(u,o),m=-1;return r.reduce(function(g,v){var y=v.props[a],x=Jve("number");if(!g[y]){m++;var b;return p?b=mP(0,h):s&&s[y]&&s[y].hasStack?(b=ove(s[y].stackGroups,l,c),b=lF(f,b,y,o)):(b=IN(x,nve(d,r.filter(function(_){return _.props[a]===y&&!_.props.hide}),"number",u),i.defaultProps.allowDataOverflow),b=lF(f,b,y,o)),Be(Be({},g),{},Ct({},y,Be(Be({axisType:o},i.defaultProps),{},{hide:!0,orientation:rs(WFt,"".concat(o,".").concat(m%2),null),domain:b,originalDomain:x,isCategorical:p,layout:u})))}return g},{})},QFt=function(e,n){var r=n.axisType,i=r===void 0?"xAxis":r,o=n.AxisComp,a=n.graphicalItems,s=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.children,f="".concat(i,"Id"),d=is(u,o),h={};return d&&d.length?h=qFt(e,{axes:d,graphicalItems:a,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:c}):a&&a.length&&(h=XFt(e,{Axis:o,graphicalItems:a,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:c})),h},YFt=function(e){var n=ff(e),r=Hc(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:dU(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:aP(n,r)}},jK=function(e){var n=e.children,r=e.defaultShowTooltip,i=la(n,lp),o=0,a=0;return e.data&&e.data.length!==0&&(a=e.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(o=i.props.startIndex),i.props.endIndex>=0&&(a=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:a,activeTooltipIndex:-1,isTooltipActive:!!r}},KFt=function(e){return!e||!e.length?!1:e.some(function(n){var r=Zc(n&&n.type);return r&&r.indexOf("Bar")>=0})},BK=function(e){return e==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:e==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:e==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},ZFt=function(e,n){var r=e.props,i=e.graphicalItems,o=e.xAxisMap,a=o===void 0?{}:o,s=e.yAxisMap,l=s===void 0?{}:s,c=r.width,u=r.height,f=r.children,d=r.margin||{},h=la(f,lp),p=la(f,gv),m=Object.keys(l).reduce(function(_,S){var O=l[S],C=O.orientation;return!O.mirror&&!O.hide?Be(Be({},_),{},Ct({},C,_[C]+O.width)):_},{left:d.left||0,right:d.right||0}),g=Object.keys(a).reduce(function(_,S){var O=a[S],C=O.orientation;return!O.mirror&&!O.hide?Be(Be({},_),{},Ct({},C,rs(_,"".concat(C))+O.height)):_},{top:d.top||0,bottom:d.bottom||0}),v=Be(Be({},g),m),y=v.bottom;h&&(v.bottom+=h.props.height||lp.defaultProps.height),p&&n&&(v=rRt(v,i,r,n));var x=c-v.left-v.right,b=u-v.top-v.bottom;return Be(Be({brushBottom:y},v),{},{width:Math.max(x,0),height:Math.max(b,0)})},QU=function(e){var n,r=e.chartName,i=e.GraphicalChild,o=e.defaultTooltipEventType,a=o===void 0?"axis":o,s=e.validateTooltipEventTypes,l=s===void 0?["axis"]:s,c=e.axisComponents,u=e.legendContent,f=e.formatAxisMap,d=e.defaultProps,h=function(g,v){var y=v.graphicalItems,x=v.stackGroups,b=v.offset,_=v.updateId,S=v.dataStartIndex,O=v.dataEndIndex,C=g.barSize,E=g.layout,k=g.barGap,I=g.barCategoryGap,P=g.maxBarSize,R=BK(E),T=R.numericAxisName,L=R.cateAxisName,z=KFt(y),B=z&&tRt({barSize:C,stackGroups:x}),W=[];return y.forEach(function(U,N){var $=Sk(g.data,{graphicalItems:[U],dataStartIndex:S,dataEndIndex:O}),D=U.props,A=D.dataKey,q=D.maxBarSize,Y=U.props["".concat(T,"Id")],K=U.props["".concat(L,"Id")],se={},te=c.reduce(function(ge,ye){var H=v["".concat(ye.axisType,"Map")],G=U.props["".concat(ye.axisType,"Id")];H&&H[G]||ye.axisType==="zAxis"||sp(!1);var ie=H[G];return Be(Be({},ge),{},Ct(Ct({},ye.axisType,ie),"".concat(ye.axisType,"Ticks"),Hc(ie)))},se),J=te[L],pe=te["".concat(L,"Ticks")],be=x&&x[Y]&&x[Y].hasStack&&vRt(U,x[Y].stackGroups),re=Zc(U.type).indexOf("Bar")>=0,ve=aP(J,pe),F=[];if(re){var ce,le,Q=qt(q)?P:q,X=(ce=(le=aP(J,pe,!0))!==null&&le!==void 0?le:Q)!==null&&ce!==void 0?ce:0;F=nRt({barGap:k,barCategoryGap:I,bandSize:X!==ve?X:ve,sizeList:B[K],maxBarSize:Q}),X!==ve&&(F=F.map(function(ge){return Be(Be({},ge),{},{position:Be(Be({},ge.position),{},{offset:ge.position.offset-X/2})})}))}var ee=U&&U.type&&U.type.getComposedData;ee&&W.push({props:Be(Be({},ee(Be(Be({},te),{},{displayedData:$,props:g,dataKey:A,item:U,bandSize:ve,barPosition:F,offset:b,stackedData:be,layout:E,dataStartIndex:S,dataEndIndex:O}))),{},Ct(Ct(Ct({key:U.key||"item-".concat(N)},T,te[T]),L,te[L]),"animationId",_)),childIndex:hxt(U,g.children),item:U})}),W},p=function(g,v){var y=g.props,x=g.dataStartIndex,b=g.dataEndIndex,_=g.updateId;if(!rX({props:y}))return null;var S=y.children,O=y.layout,C=y.stackOffset,E=y.data,k=y.reverseStackOrder,I=BK(O),P=I.numericAxisName,R=I.cateAxisName,T=is(S,i),L=pRt(E,T,"".concat(P,"Id"),"".concat(R,"Id"),C,k),z=c.reduce(function($,D){var A="".concat(D.axisType,"Map");return Be(Be({},$),{},Ct({},A,QFt(y,Be(Be({},D),{},{graphicalItems:T,stackGroups:D.axisType===P&&L,dataStartIndex:x,dataEndIndex:b}))))},{}),B=ZFt(Be(Be({},z),{},{props:y,graphicalItems:T}),v==null?void 0:v.legendBBox);Object.keys(z).forEach(function($){z[$]=f(y,z[$],B,$.replace("Map",""),r)});var W=z["".concat(R,"Map")],U=YFt(W),N=h(y,Be(Be({},z),{},{dataStartIndex:x,dataEndIndex:b,updateId:_,graphicalItems:T,stackGroups:L,offset:B}));return Be(Be({formattedGraphicalItems:N,graphicalItems:T,offset:B,stackGroups:L},U),z)};return n=function(m){FFt(g,m);function g(v){var y,x,b;return DFt(this,g),b=$Ft(this,g,[v]),Ct(on(b),"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Ct(on(b),"accessibilityManager",new bFt),Ct(on(b),"handleLegendBBoxUpdate",function(_){if(_){var S=b.state,O=S.dataStartIndex,C=S.dataEndIndex,E=S.updateId;b.setState(Be({legendBBox:_},p({props:b.props,dataStartIndex:O,dataEndIndex:C,updateId:E},Be(Be({},b.state),{},{legendBBox:_}))))}}),Ct(on(b),"handleReceiveSyncEvent",function(_,S,O){if(b.props.syncId===_){if(O===b.eventEmitterSymbol&&typeof b.props.syncMethod!="function")return;b.applySyncEvent(S)}}),Ct(on(b),"handleBrushChange",function(_){var S=_.startIndex,O=_.endIndex;if(S!==b.state.dataStartIndex||O!==b.state.dataEndIndex){var C=b.state.updateId;b.setState(function(){return Be({dataStartIndex:S,dataEndIndex:O},p({props:b.props,dataStartIndex:S,dataEndIndex:O,updateId:C},b.state))}),b.triggerSyncEvent({dataStartIndex:S,dataEndIndex:O})}}),Ct(on(b),"handleMouseEnter",function(_){var S=b.getMouseInfo(_);if(S){var O=Be(Be({},S),{},{isTooltipActive:!0});b.setState(O),b.triggerSyncEvent(O);var C=b.props.onMouseEnter;Bt(C)&&C(O,_)}}),Ct(on(b),"triggeredAfterMouseMove",function(_){var S=b.getMouseInfo(_),O=S?Be(Be({},S),{},{isTooltipActive:!0}):{isTooltipActive:!1};b.setState(O),b.triggerSyncEvent(O);var C=b.props.onMouseMove;Bt(C)&&C(O,_)}),Ct(on(b),"handleItemMouseEnter",function(_){b.setState(function(){return{isTooltipActive:!0,activeItem:_,activePayload:_.tooltipPayload,activeCoordinate:_.tooltipPosition||{x:_.cx,y:_.cy}}})}),Ct(on(b),"handleItemMouseLeave",function(){b.setState(function(){return{isTooltipActive:!1}})}),Ct(on(b),"handleMouseMove",function(_){_.persist(),b.throttleTriggeredAfterMouseMove(_)}),Ct(on(b),"handleMouseLeave",function(_){b.throttleTriggeredAfterMouseMove.cancel();var S={isTooltipActive:!1};b.setState(S),b.triggerSyncEvent(S);var O=b.props.onMouseLeave;Bt(O)&&O(S,_)}),Ct(on(b),"handleOuterEvent",function(_){var S=dxt(_),O=rs(b.props,"".concat(S));if(S&&Bt(O)){var C,E;/.*touch.*/i.test(S)?E=b.getMouseInfo(_.changedTouches[0]):E=b.getMouseInfo(_),O((C=E)!==null&&C!==void 0?C:{},_)}}),Ct(on(b),"handleClick",function(_){var S=b.getMouseInfo(_);if(S){var O=Be(Be({},S),{},{isTooltipActive:!0});b.setState(O),b.triggerSyncEvent(O);var C=b.props.onClick;Bt(C)&&C(O,_)}}),Ct(on(b),"handleMouseDown",function(_){var S=b.props.onMouseDown;if(Bt(S)){var O=b.getMouseInfo(_);S(O,_)}}),Ct(on(b),"handleMouseUp",function(_){var S=b.props.onMouseUp;if(Bt(S)){var O=b.getMouseInfo(_);S(O,_)}}),Ct(on(b),"handleTouchMove",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&b.throttleTriggeredAfterMouseMove(_.changedTouches[0])}),Ct(on(b),"handleTouchStart",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&b.handleMouseDown(_.changedTouches[0])}),Ct(on(b),"handleTouchEnd",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&b.handleMouseUp(_.changedTouches[0])}),Ct(on(b),"triggerSyncEvent",function(_){b.props.syncId!==void 0&&PI.emit(MI,b.props.syncId,_,b.eventEmitterSymbol)}),Ct(on(b),"applySyncEvent",function(_){var S=b.props,O=S.layout,C=S.syncMethod,E=b.state.updateId,k=_.dataStartIndex,I=_.dataEndIndex;if(_.dataStartIndex!==void 0||_.dataEndIndex!==void 0)b.setState(Be({dataStartIndex:k,dataEndIndex:I},p({props:b.props,dataStartIndex:k,dataEndIndex:I,updateId:E},b.state)));else if(_.activeTooltipIndex!==void 0){var P=_.chartX,R=_.chartY,T=_.activeTooltipIndex,L=b.state,z=L.offset,B=L.tooltipTicks;if(!z)return;if(typeof C=="function")T=C(B,_);else if(C==="value"){T=-1;for(var W=0;W=0){var pe,be;if(P.dataKey&&!P.allowDuplicatedCategory){var re=typeof P.dataKey=="function"?J:"payload.".concat(P.dataKey.toString());pe=kE(W,re,T),be=U&&N&&kE(N,re,T)}else pe=W==null?void 0:W[R],be=U&&N&&N[R];if(Y||q){var ve=_.props.activeIndex!==void 0?_.props.activeIndex:R;return[M.cloneElement(_,Be(Be(Be({},C.props),se),{},{activeIndex:ve})),null,null]}if(!qt(pe))return[te].concat(kv(b.renderActivePoints({item:C,activePoint:pe,basePoint:be,childIndex:R,isRange:U})))}else{var F,ce=(F=b.getItemByXY(b.state.activeCoordinate))!==null&&F!==void 0?F:{graphicalItem:te},le=ce.graphicalItem,Q=le.item,X=Q===void 0?_:Q,ee=le.childIndex,ge=Be(Be(Be({},C.props),se),{},{activeIndex:ee});return[M.cloneElement(X,ge),null,null]}return U?[te,null,null]:[te,null]}),Ct(on(b),"renderCustomized",function(_,S,O){return M.cloneElement(_,Be(Be({key:"recharts-customized-".concat(O)},b.props),b.state))}),Ct(on(b),"renderMap",{CartesianGrid:{handler:_O,once:!0},ReferenceArea:{handler:b.renderReferenceElement},ReferenceLine:{handler:_O},ReferenceDot:{handler:b.renderReferenceElement},XAxis:{handler:_O},YAxis:{handler:_O},Brush:{handler:b.renderBrush,once:!0},Bar:{handler:b.renderGraphicChild},Line:{handler:b.renderGraphicChild},Area:{handler:b.renderGraphicChild},Radar:{handler:b.renderGraphicChild},RadialBar:{handler:b.renderGraphicChild},Scatter:{handler:b.renderGraphicChild},Pie:{handler:b.renderGraphicChild},Funnel:{handler:b.renderGraphicChild},Tooltip:{handler:b.renderCursor,once:!0},PolarGrid:{handler:b.renderPolarGrid,once:!0},PolarAngleAxis:{handler:b.renderPolarAxis},PolarRadiusAxis:{handler:b.renderPolarAxis},Customized:{handler:b.renderCustomized}}),b.clipPathId="".concat((y=v.id)!==null&&y!==void 0?y:Ly("recharts"),"-clip"),b.throttleTriggeredAfterMouseMove=tge(b.triggeredAfterMouseMove,(x=v.throttleDelay)!==null&&x!==void 0?x:1e3/60),b.state={},b}return LFt(g,[{key:"componentDidMount",value:function(){var y,x;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(y=this.props.margin.left)!==null&&y!==void 0?y:0,top:(x=this.props.margin.top)!==null&&x!==void 0?x:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var y=this.props,x=y.children,b=y.data,_=y.height,S=y.layout,O=la(x,ml);if(O){var C=O.props.defaultIndex;if(!(typeof C!="number"||C<0||C>this.state.tooltipTicks.length)){var E=this.state.tooltipTicks[C]&&this.state.tooltipTicks[C].value,k=fF(this.state,b,C,E),I=this.state.tooltipTicks[C].coordinate,P=(this.state.offset.top+_)/2,R=S==="horizontal",T=R?{x:I,y:P}:{y:I,x:P},L=this.state.formattedGraphicalItems.find(function(B){var W=B.item;return W.type.name==="Scatter"});L&&(T=Be(Be({},T),L.props.points[C].tooltipPosition),k=L.props.points[C].tooltipPayload);var z={activeTooltipIndex:C,isTooltipActive:!0,activeLabel:E,activePayload:k,activeCoordinate:T};this.setState(z),this.renderCursor(O),this.accessibilityManager.setIndex(C)}}}},{key:"getSnapshotBeforeUpdate",value:function(y,x){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==x.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==y.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==y.margin){var b,_;this.accessibilityManager.setDetails({offset:{left:(b=this.props.margin.left)!==null&&b!==void 0?b:0,top:(_=this.props.margin.top)!==null&&_!==void 0?_:0}})}return null}},{key:"componentDidUpdate",value:function(y){Y3([la(y.children,ml)],[la(this.props.children,ml)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var y=la(this.props.children,ml);if(y&&typeof y.props.shared=="boolean"){var x=y.props.shared?"axis":"item";return l.indexOf(x)>=0?x:a}return a}},{key:"getMouseInfo",value:function(y){if(!this.container)return null;var x=this.container,b=x.getBoundingClientRect(),_=DPt(b),S={chartX:Math.round(y.pageX-_.left),chartY:Math.round(y.pageY-_.top)},O=b.width/x.offsetWidth||1,C=this.inRange(S.chartX,S.chartY,O);if(!C)return null;var E=this.state,k=E.xAxisMap,I=E.yAxisMap,P=this.getTooltipEventType();if(P!=="axis"&&k&&I){var R=ff(k).scale,T=ff(I).scale,L=R&&R.invert?R.invert(S.chartX):null,z=T&&T.invert?T.invert(S.chartY):null;return Be(Be({},S),{},{xValue:L,yValue:z})}var B=FK(this.state,this.props.data,this.props.layout,C);return B?Be(Be({},S),B):null}},{key:"inRange",value:function(y,x){var b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,_=this.props.layout,S=y/b,O=x/b;if(_==="horizontal"||_==="vertical"){var C=this.state.offset,E=S>=C.left&&S<=C.left+C.width&&O>=C.top&&O<=C.top+C.height;return E?{x:S,y:O}:null}var k=this.state,I=k.angleAxisMap,P=k.radiusAxisMap;if(I&&P){var R=ff(I);return mY({x:S,y:O},R)}return null}},{key:"parseEventsOfWrapper",value:function(){var y=this.props.children,x=this.getTooltipEventType(),b=la(y,ml),_={};b&&x==="axis"&&(b.props.trigger==="click"?_={onClick:this.handleClick}:_={onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd});var S=AE(this.props,this.handleOuterEvent);return Be(Be({},S),_)}},{key:"addListener",value:function(){PI.on(MI,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){PI.removeListener(MI,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(y,x,b){for(var _=this.state.formattedGraphicalItems,S=0,O=_.length;S!En(t)||!Number.isFinite(t)?"":Gb(t),rjt=t=>t.toPrecision(3),AI={legendContainer:{display:"flex",justifyContent:"center",columnGap:"12px",flexWrap:"wrap"},legendItem:{display:"flex",alignItems:"center"},legendCloseIcon:{marginLeft:"4px",cursor:"pointer",display:"flex",alignItems:"center"}};function ijt({payload:t,removeTimeSeries:e}){return!t||t.length===0?null:w.jsx(Ke,{sx:AI.legendContainer,children:t.map((n,r)=>w.jsxs(Ke,{sx:{...AI.legendItem,color:n.color},children:[w.jsx("span",{children:n.value}),e&&w.jsx(Ke,{component:"span",sx:AI.legendCloseIcon,onMouseUp:()=>e(r),children:w.jsx(nw,{fontSize:"small"})})]},n.value))})}const RI={toolTipContainer:t=>({backgroundColor:"black",opacity:.8,color:"white",border:"2px solid black",borderRadius:t.spacing(2),padding:t.spacing(1.5)}),toolTipValue:{fontWeight:"bold"},toolTipLabel:t=>({fontWeight:"bold",paddingBottom:t.spacing(1)})},ojt="#00000000",ajt="#FAFFDD";function sjt({active:t,label:e,payload:n}){if(!t||!En(e)||!n||n.length===0)return null;const r=n.map((i,o)=>{const{name:a,value:s,unit:l,dataKey:c}=i;let u=i.color;if(!En(s))return null;const f=a||"?",d=s.toFixed(3);u===ojt&&(u=ajt);let p=f.indexOf(":")!==-1?"":` (${c})`;return typeof l=="string"&&(p!==""?p=`${l} ${p}`:p=l),w.jsxs("div",{children:[w.jsxs("span",{children:[f,": "]}),w.jsx(Ke,{component:"span",sx:RI.toolTipValue,style:{color:u},children:d}),w.jsxs("span",{children:[" ",p]})]},o)});return r?w.jsxs(Ke,{sx:RI.toolTipContainer,children:[w.jsx(Ke,{component:"span",sx:RI.toolTipLabel,children:`${dy(e)} UTC`}),r]}):null}function zK({cx:t,cy:e,radius:n,stroke:r,fill:i,strokeWidth:o,symbol:a}){const l=n+.5*o,c=2*l,u=Math.floor(100*o/c+.5)+"%";let f;if(a==="diamond"){const m=1024*(n/c);f=w.jsx("polygon",{points:`${512-m},512 512,${512-m} ${512+m},512 512,${512+m}`,strokeWidth:u,stroke:r,fill:i})}else{const d=Math.floor(100*n/c+.5)+"%";f=w.jsx("circle",{cx:"50%",cy:"50%",r:d,strokeWidth:u,stroke:r,fill:i})}return En(t)&&En(e)?w.jsx("svg",{x:t-l,y:e-l,width:c,height:c,viewBox:"0 0 1024 1024",children:f}):null}function ljt({timeSeriesGroup:t,timeSeriesIndex:e,selectTimeSeries:n,places:r,selectPlace:i,placeInfos:o,placeGroupTimeSeries:a,paletteMode:s,chartType:l,stdevBars:c}){const u=t.timeSeriesArray[e],f=u.source,d=()=>{n&&n(t.id,e,u),i(u.source.placeId,r,!0)};let h=f.variableName,p="red";if(f.placeId===null){h=`${f.datasetTitle}/${h}`;let x=null;a.forEach(b=>{if(x===null&&b.placeGroup.id===f.datasetId){const _=b.placeGroup.features;_.length>0&&_[0].properties&&(x=_[0].properties.color||null)}}),p=x||"red"}else if(o){const x=o[f.placeId];if(x){const{place:b,label:_,color:S}=x;if(b.geometry.type==="Point"){const O=b.geometry.coordinates[0],C=b.geometry.coordinates[1];h+=` (${_}: ${C.toFixed(5)},${O.toFixed(5)})`}else h+=` (${_})`;p=S}}const m=pie(p,s);let g,v;u.source.placeId===null?(g=0,v={radius:5,strokeWidth:1.5,symbol:"diamond"}):(g=l==="point"?0:u.dataProgress,v={radius:3,strokeWidth:2,symbol:"circle"});const y=c&&f.valueDataKey&&f.errorDataKey&&w.jsx(Uy,{dataKey:`ev${e}`,width:4,strokeWidth:1,stroke:m,strokeOpacity:.5});return l==="bar"?w.jsx(Lp,{type:"monotone",name:h,unit:f.variableUnits,dataKey:`v${e}`,fill:m,fillOpacity:g,isAnimationActive:!1,onClick:d,children:y},e):w.jsx(Ew,{type:"monotone",name:h,unit:f.variableUnits,dataKey:`v${e}`,dot:w.jsx(zK,{...v,stroke:m,fill:"white"}),activeDot:w.jsx(zK,{...v,stroke:"white",fill:m}),stroke:m,strokeOpacity:g,isAnimationActive:!1,onClick:d,children:y},e)}var YU={},cjt=ct;Object.defineProperty(YU,"__esModule",{value:!0});var eye=YU.default=void 0,ujt=cjt(pt()),fjt=w;eye=YU.default=(0,ujt.default)((0,fjt.jsx)("path",{d:"M19 12h-2v3h-3v2h5zM7 9h3V7H5v5h2zm14-6H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16.01H3V4.99h18z"}),"AspectRatio");var KU={},djt=ct;Object.defineProperty(KU,"__esModule",{value:!0});var tye=KU.default=void 0,hjt=djt(pt()),pjt=w;tye=KU.default=(0,hjt.default)((0,pjt.jsx)("path",{d:"M4 9h4v11H4zm12 4h4v7h-4zm-6-9h4v16h-4z"}),"BarChart");var ZU={},mjt=ct;Object.defineProperty(ZU,"__esModule",{value:!0});var nye=ZU.default=void 0,gjt=mjt(pt()),vjt=w;nye=ZU.default=(0,gjt.default)((0,vjt.jsx)("path",{d:"M21.99 4c0-1.1-.89-2-1.99-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h14l4 4zM18 14H6v-2h12zm0-3H6V9h12zm0-3H6V6h12z"}),"Comment");var JU={},yjt=ct;Object.defineProperty(JU,"__esModule",{value:!0});var rye=JU.default=void 0,xjt=yjt(pt()),bjt=w;rye=JU.default=(0,xjt.default)((0,bjt.jsx)("path",{d:"M4 20h16v2H4zM4 2h16v2H4zm9 7h3l-4-4-4 4h3v6H8l4 4 4-4h-3z"}),"Expand");var e6={},_jt=ct;Object.defineProperty(e6,"__esModule",{value:!0});var iye=e6.default=void 0,wjt=_jt(pt()),Sjt=w;iye=e6.default=(0,wjt.default)((0,Sjt.jsx)("path",{d:"M17 4h3c1.1 0 2 .9 2 2v2h-2V6h-3zM4 8V6h3V4H4c-1.1 0-2 .9-2 2v2zm16 8v2h-3v2h3c1.1 0 2-.9 2-2v-2zM7 18H4v-2H2v2c0 1.1.9 2 2 2h3zM18 8H6v8h12z"}),"FitScreen");var t6={},Ojt=ct;Object.defineProperty(t6,"__esModule",{value:!0});var n6=t6.default=void 0,Cjt=Ojt(pt()),Tjt=w;n6=t6.default=(0,Cjt.default)((0,Tjt.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2M5.5 7.5h2v-2H9v2h2V9H9v2H7.5V9h-2zM19 19H5L19 5zm-2-2v-1.5h-5V17z"}),"Iso");var r6={},Ejt=ct;Object.defineProperty(r6,"__esModule",{value:!0});var oye=r6.default=void 0,Pjt=Ejt(pt()),II=w;oye=r6.default=(0,Pjt.default)([(0,II.jsx)("circle",{cx:"7",cy:"14",r:"3"},"0"),(0,II.jsx)("circle",{cx:"11",cy:"6",r:"3"},"1"),(0,II.jsx)("circle",{cx:"16.6",cy:"17.6",r:"3"},"2")],"ScatterPlot");var i6={},Mjt=ct;Object.defineProperty(i6,"__esModule",{value:!0});var aye=i6.default=void 0,kjt=Mjt(pt()),Ajt=w;aye=i6.default=(0,kjt.default)((0,Ajt.jsx)("path",{d:"m3.5 18.49 6-6.01 4 4L22 6.92l-1.41-1.41-7.09 7.97-4-4L2 16.99z"}),"ShowChart");var o6={},Rjt=ct;Object.defineProperty(o6,"__esModule",{value:!0});var sye=o6.default=void 0,Ijt=Rjt(pt()),UK=w;sye=o6.default=(0,Ijt.default)([(0,UK.jsx)("circle",{cx:"12",cy:"12",r:"3.2"},"0"),(0,UK.jsx)("path",{d:"M9 2 7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5"},"1")],"CameraAlt");function Djt(t,e){if(t.match(/^[a-z]+:\/\//i))return t;if(t.match(/^\/\//))return window.location.protocol+t;if(t.match(/^[a-z]+:/i))return t;const n=document.implementation.createHTMLDocument(),r=n.createElement("base"),i=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(i),e&&(r.href=e),i.href=t,i.href}const Ljt=(()=>{let t=0;const e=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${e()}${t}`)})();function nu(t){const e=[];for(let n=0,r=t.length;nKo||t.height>Ko)&&(t.width>Ko&&t.height>Ko?t.width>t.height?(t.height*=Ko/t.width,t.width=Ko):(t.width*=Ko/t.height,t.height=Ko):t.width>Ko?(t.height*=Ko/t.width,t.width=Ko):(t.width*=Ko/t.height,t.height=Ko))}function TP(t){return new Promise((e,n)=>{const r=new Image;r.decode=()=>e(r),r.onload=()=>e(r),r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=t})}async function Bjt(t){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(t)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}async function zjt(t,e,n){const r="http://www.w3.org/2000/svg",i=document.createElementNS(r,"svg"),o=document.createElementNS(r,"foreignObject");return i.setAttribute("width",`${e}`),i.setAttribute("height",`${n}`),i.setAttribute("viewBox",`0 0 ${e} ${n}`),o.setAttribute("width","100%"),o.setAttribute("height","100%"),o.setAttribute("x","0"),o.setAttribute("y","0"),o.setAttribute("externalResourcesRequired","true"),i.appendChild(o),o.appendChild(t),Bjt(i)}const jo=(t,e)=>{if(t instanceof e)return!0;const n=Object.getPrototypeOf(t);return n===null?!1:n.constructor.name===e.name||jo(n,e)};function Ujt(t){const e=t.getPropertyValue("content");return`${t.cssText} content: '${e.replace(/'|"/g,"")}';`}function Wjt(t){return nu(t).map(e=>{const n=t.getPropertyValue(e),r=t.getPropertyPriority(e);return`${e}: ${n}${r?" !important":""};`}).join(" ")}function Vjt(t,e,n){const r=`.${t}:${e}`,i=n.cssText?Ujt(n):Wjt(n);return document.createTextNode(`${r}{${i}}`)}function WK(t,e,n){const r=window.getComputedStyle(t,n),i=r.getPropertyValue("content");if(i===""||i==="none")return;const o=Ljt();try{e.className=`${e.className} ${o}`}catch{return}const a=document.createElement("style");a.appendChild(Vjt(o,n,r)),e.appendChild(a)}function Gjt(t,e){WK(t,e,":before"),WK(t,e,":after")}const VK="application/font-woff",GK="image/jpeg",Hjt={woff:VK,woff2:VK,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:GK,jpeg:GK,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function qjt(t){const e=/\.([^./]*?)$/g.exec(t);return e?e[1]:""}function a6(t){const e=qjt(t).toLowerCase();return Hjt[e]||""}function Xjt(t){return t.split(/,/)[1]}function dF(t){return t.search(/^(data:)/)!==-1}function cye(t,e){return`data:${e};base64,${t}`}async function uye(t,e,n){const r=await fetch(t,e);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const i=await r.blob();return new Promise((o,a)=>{const s=new FileReader;s.onerror=a,s.onloadend=()=>{try{o(n({res:r,result:s.result}))}catch(l){a(l)}},s.readAsDataURL(i)})}const DI={};function Qjt(t,e,n){let r=t.replace(/\?.*/,"");return n&&(r=t),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),e?`[${e}]${r}`:r}async function s6(t,e,n){const r=Qjt(t,e,n.includeQueryParams);if(DI[r]!=null)return DI[r];n.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+new Date().getTime());let i;try{const o=await uye(t,n.fetchRequestInit,({res:a,result:s})=>(e||(e=a.headers.get("Content-Type")||""),Xjt(s)));i=cye(o,e)}catch(o){i=n.imagePlaceholder||"";let a=`Failed to fetch resource: ${t}`;o&&(a=typeof o=="string"?o:o.message),a&&console.warn(a)}return DI[r]=i,i}async function Yjt(t){const e=t.toDataURL();return e==="data:,"?t.cloneNode(!1):TP(e)}async function Kjt(t,e){if(t.currentSrc){const o=document.createElement("canvas"),a=o.getContext("2d");o.width=t.clientWidth,o.height=t.clientHeight,a==null||a.drawImage(t,0,0,o.width,o.height);const s=o.toDataURL();return TP(s)}const n=t.poster,r=a6(n),i=await s6(n,r,e);return TP(i)}async function Zjt(t){var e;try{if(!((e=t==null?void 0:t.contentDocument)===null||e===void 0)&&e.body)return await Ok(t.contentDocument.body,{},!0)}catch{}return t.cloneNode(!1)}async function Jjt(t,e){return jo(t,HTMLCanvasElement)?Yjt(t):jo(t,HTMLVideoElement)?Kjt(t,e):jo(t,HTMLIFrameElement)?Zjt(t):t.cloneNode(!1)}const e5t=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SLOT";async function t5t(t,e,n){var r,i;let o=[];return e5t(t)&&t.assignedNodes?o=nu(t.assignedNodes()):jo(t,HTMLIFrameElement)&&(!((r=t.contentDocument)===null||r===void 0)&&r.body)?o=nu(t.contentDocument.body.childNodes):o=nu(((i=t.shadowRoot)!==null&&i!==void 0?i:t).childNodes),o.length===0||jo(t,HTMLVideoElement)||await o.reduce((a,s)=>a.then(()=>Ok(s,n)).then(l=>{l&&e.appendChild(l)}),Promise.resolve()),e}function n5t(t,e){const n=e.style;if(!n)return;const r=window.getComputedStyle(t);r.cssText?(n.cssText=r.cssText,n.transformOrigin=r.transformOrigin):nu(r).forEach(i=>{let o=r.getPropertyValue(i);i==="font-size"&&o.endsWith("px")&&(o=`${Math.floor(parseFloat(o.substring(0,o.length-2)))-.1}px`),jo(t,HTMLIFrameElement)&&i==="display"&&o==="inline"&&(o="block"),i==="d"&&e.getAttribute("d")&&(o=`path(${e.getAttribute("d")})`),n.setProperty(i,o,r.getPropertyPriority(i))})}function r5t(t,e){jo(t,HTMLTextAreaElement)&&(e.innerHTML=t.value),jo(t,HTMLInputElement)&&e.setAttribute("value",t.value)}function i5t(t,e){if(jo(t,HTMLSelectElement)){const n=e,r=Array.from(n.children).find(i=>t.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function o5t(t,e){return jo(e,Element)&&(n5t(t,e),Gjt(t,e),r5t(t,e),i5t(t,e)),e}async function a5t(t,e){const n=t.querySelectorAll?t.querySelectorAll("use"):[];if(n.length===0)return t;const r={};for(let o=0;oJjt(r,e)).then(r=>t5t(t,r,e)).then(r=>o5t(t,r)).then(r=>a5t(r,e))}const fye=/url\((['"]?)([^'"]+?)\1\)/g,s5t=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,l5t=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function c5t(t){const e=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}function u5t(t){const e=[];return t.replace(fye,(n,r,i)=>(e.push(i),n)),e.filter(n=>!dF(n))}async function f5t(t,e,n,r,i){try{const o=n?Djt(e,n):e,a=a6(e);let s;if(i){const l=await i(o);s=cye(l,a)}else s=await s6(o,a,r);return t.replace(c5t(e),`$1${s}$3`)}catch{}return t}function d5t(t,{preferredFontFormat:e}){return e?t.replace(l5t,n=>{for(;;){const[r,,i]=s5t.exec(n)||[];if(!i)return"";if(i===e)return`src: ${r};`}}):t}function dye(t){return t.search(fye)!==-1}async function hye(t,e,n){if(!dye(t))return t;const r=d5t(t,n);return u5t(r).reduce((o,a)=>o.then(s=>f5t(s,a,e,n)),Promise.resolve(r))}async function wO(t,e,n){var r;const i=(r=e.style)===null||r===void 0?void 0:r.getPropertyValue(t);if(i){const o=await hye(i,null,n);return e.style.setProperty(t,o,e.style.getPropertyPriority(t)),!0}return!1}async function h5t(t,e){await wO("background",t,e)||await wO("background-image",t,e),await wO("mask",t,e)||await wO("mask-image",t,e)}async function p5t(t,e){const n=jo(t,HTMLImageElement);if(!(n&&!dF(t.src))&&!(jo(t,SVGImageElement)&&!dF(t.href.baseVal)))return;const r=n?t.src:t.href.baseVal,i=await s6(r,a6(r),e);await new Promise((o,a)=>{t.onload=o,t.onerror=a;const s=t;s.decode&&(s.decode=o),s.loading==="lazy"&&(s.loading="eager"),n?(t.srcset="",t.src=i):t.href.baseVal=i})}async function m5t(t,e){const r=nu(t.childNodes).map(i=>pye(i,e));await Promise.all(r).then(()=>t)}async function pye(t,e){jo(t,Element)&&(await h5t(t,e),await p5t(t,e),await m5t(t,e))}function g5t(t,e){const{style:n}=t;e.backgroundColor&&(n.backgroundColor=e.backgroundColor),e.width&&(n.width=`${e.width}px`),e.height&&(n.height=`${e.height}px`);const r=e.style;return r!=null&&Object.keys(r).forEach(i=>{n[i]=r[i]}),t}const HK={};async function qK(t){let e=HK[t];if(e!=null)return e;const r=await(await fetch(t)).text();return e={url:t,cssText:r},HK[t]=e,e}async function XK(t,e){let n=t.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,o=(n.match(/url\([^)]+\)/g)||[]).map(async a=>{let s=a.replace(r,"$1");return s.startsWith("https://")||(s=new URL(s,t.url).href),uye(s,e.fetchRequestInit,({result:l})=>(n=n.replace(a,`url(${l})`),[a,l]))});return Promise.all(o).then(()=>n)}function QK(t){if(t==null)return[];const e=[],n=/(\/\*[\s\S]*?\*\/)/gi;let r=t.replace(n,"");const i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const l=i.exec(r);if(l===null)break;e.push(l[0])}r=r.replace(i,"");const o=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,a="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",s=new RegExp(a,"gi");for(;;){let l=o.exec(r);if(l===null){if(l=s.exec(r),l===null)break;o.lastIndex=s.lastIndex}else s.lastIndex=o.lastIndex;e.push(l[0])}return e}async function v5t(t,e){const n=[],r=[];return t.forEach(i=>{if("cssRules"in i)try{nu(i.cssRules||[]).forEach((o,a)=>{if(o.type===CSSRule.IMPORT_RULE){let s=a+1;const l=o.href,c=qK(l).then(u=>XK(u,e)).then(u=>QK(u).forEach(f=>{try{i.insertRule(f,f.startsWith("@import")?s+=1:i.cssRules.length)}catch(d){console.error("Error inserting rule from remote css",{rule:f,error:d})}})).catch(u=>{console.error("Error loading remote css",u.toString())});r.push(c)}})}catch(o){const a=t.find(s=>s.href==null)||document.styleSheets[0];i.href!=null&&r.push(qK(i.href).then(s=>XK(s,e)).then(s=>QK(s).forEach(l=>{a.insertRule(l,i.cssRules.length)})).catch(s=>{console.error("Error loading remote stylesheet",s)})),console.error("Error inlining remote css file",o)}}),Promise.all(r).then(()=>(t.forEach(i=>{if("cssRules"in i)try{nu(i.cssRules||[]).forEach(o=>{n.push(o)})}catch(o){console.error(`Error while reading CSS rules from ${i.href}`,o)}}),n))}function y5t(t){return t.filter(e=>e.type===CSSRule.FONT_FACE_RULE).filter(e=>dye(e.style.getPropertyValue("src")))}async function x5t(t,e){if(t.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=nu(t.ownerDocument.styleSheets),r=await v5t(n,e);return y5t(r)}async function b5t(t,e){const n=await x5t(t,e);return(await Promise.all(n.map(i=>{const o=i.parentStyleSheet?i.parentStyleSheet.href:null;return hye(i.cssText,o,e)}))).join(` -`)}async function _5t(t,e){const n=e.fontEmbedCSS!=null?e.fontEmbedCSS:e.skipFonts?null:await b5t(t,e);if(n){const r=document.createElement("style"),i=document.createTextNode(n);r.appendChild(i),t.firstChild?t.insertBefore(r,t.firstChild):t.appendChild(r)}}async function w5t(t,e={}){const{width:n,height:r}=lye(t,e),i=await Ok(t,e,!0);return await _5t(i,e),await pye(i,e),g5t(i,e),await zjt(i,n,r)}async function mye(t,e={}){const{width:n,height:r}=lye(t,e),i=await w5t(t,e),o=await TP(i),a=document.createElement("canvas"),s=a.getContext("2d"),l=e.pixelRatio||Fjt(),c=e.canvasWidth||n,u=e.canvasHeight||r;return a.width=c*l,a.height=u*l,e.skipAutoScale||jjt(a),a.style.width=`${c}`,a.style.height=`${u}`,e.backgroundColor&&(s.fillStyle=e.backgroundColor,s.fillRect(0,0,a.width,a.height)),s.drawImage(o,0,0,a.width,a.height),a}async function S5t(t,e={}){return(await mye(t,e)).toDataURL()}async function O5t(t,e={}){return(await mye(t,e)).toDataURL("image/jpeg",e.quality||1)}const YK={png:S5t,jpeg:O5t};function C5t(t,e){T5t(t,e).then(()=>{e!=null&&e.handleSuccess&&e.handleSuccess()}).catch(n=>{if(e!=null&&e.handleError)e.handleError(n);else throw n})}async function T5t(t,e={}){const n=t,r=e.format||"png";if(!(r in YK))throw new Error(`Image format '${r}' is unknown or not supported.`);const i=await YK[r](n,{backgroundColor:"#00000000",canvasWidth:e.width||(e.height||n.clientHeight)*n.clientWidth/n.clientHeight,canvasHeight:e.height||(e.width||n.clientWidth)*n.clientHeight/n.clientWidth}),a=await(await fetch(i)).blob();await navigator.clipboard.write([new ClipboardItem({"image/png":a})])}function gye({elementRef:t,postMessage:e}){const n=()=>{e("success",fe.get("Snapshot copied to clipboard"))},r=o=>{const a="Error copying snapshot to clipboard";console.error(a+":",o),e("error",fe.get(a))},i=()=>{t.current?C5t(t.current,{format:"png",width:2e3,handleSuccess:n,handleError:r}):r(new Error("missing element reference"))};return w.jsx(Qa,{tooltipText:fe.get("Copy snapshot of chart to clipboard"),onClick:i,icon:w.jsx(sye,{fontSize:"inherit"})})}function E5t({sx:t,timeSeriesGroupId:e,placeGroupTimeSeries:n,addPlaceGroupTimeSeries:r}){const[i,o]=ue.useState(null),a=f=>{o(f.currentTarget)},s=()=>{o(null)},l=f=>{o(null),r(e,f)},c=[];n.forEach(f=>{Object.getOwnPropertyNames(f.timeSeries).forEach(d=>{const h=`${f.placeGroup.title} / ${d}`;c.push(w.jsx(Nr,{onClick:()=>l(f.timeSeries[d]),children:h},h))})});const u=!!i;return w.jsxs(w.Fragment,{children:[w.jsx(Ot,{size:"small",sx:t,"aria-label":"Add","aria-controls":u?"basic-menu":void 0,"aria-haspopup":"true","aria-expanded":u?"true":void 0,onClick:a,disabled:c.length===0,children:w.jsx(_t,{arrow:!0,title:fe.get("Add time-series from places"),children:w.jsx(aw,{fontSize:"inherit"})})}),w.jsx(_p,{id:"basic-menu",anchorEl:i,open:u,onClose:s,MenuListProps:{"aria-labelledby":"basic-button"},children:c})]})}const SO={container:t=>({padding:t.spacing(1),display:"flex",flexDirection:"column",gap:t.spacing(1)}),minMaxBox:t=>({display:"flex",justifyContent:"center",gap:t.spacing(1)}),minTextField:{maxWidth:"8em"},maxTextField:{maxWidth:"8em"}};function P5t({anchorEl:t,valueRange:e,setValueRange:n}){const[r,i]=M.useState(e?[e[0]+"",e[1]+""]:["0","1"]);if(!t)return null;const o=[Number.parseFloat(r[0]),Number.parseFloat(r[1])],a=Number.isFinite(o[0])&&Number.isFinite(o[1])&&o[0]{const d=f.target.value;i([d,r[1]])},l=f=>{const d=f.target.value;i([r[0],d])},c=()=>{n(o)},u=()=>{n(void 0)};return w.jsx(bp,{anchorEl:t,open:!0,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"center"},children:w.jsxs(Ke,{sx:SO.container,children:[w.jsxs(Ke,{component:"form",sx:SO.minMaxBox,children:[w.jsx(lr,{sx:SO.minTextField,label:"Y-Minimum",variant:"filled",size:"small",value:r[0],error:!a,onChange:f=>s(f)}),w.jsx(lr,{sx:SO.maxTextField,label:"Y-Maximum",variant:"filled",size:"small",value:r[1],error:!a,onChange:f=>l(f)})]}),w.jsx(sw,{onDone:c,doneDisabled:!a,onCancel:u,size:"medium"})]})})}const OO="stddev",jd={headerContainer:{display:"flex",flexDirection:"row",justifyContent:"right"},actionsContainer:{display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",gap:"1px"},responsiveContainer:{flexGrow:"1px"},actionButton:{zIndex:1e3,opacity:.8},chartTitle:{fontSize:"inherit",fontWeight:"normal"},chartTypes:t=>({paddingLeft:t.spacing(1),paddingRight:t.spacing(1)})};function M5t({timeSeriesGroup:t,placeGroupTimeSeries:e,addPlaceGroupTimeSeries:n,removeTimeSeriesGroup:r,resetZoom:i,loading:o,zoomed:a,zoomMode:s,setZoomMode:l,showTooltips:c,setShowTooltips:u,chartType:f,setChartType:d,stdevBarsDisabled:h,stdevBars:p,setStdevBars:m,valueRange:g,setValueRange:v,chartElement:y,postMessage:x}){const b=M.useRef(null),[_,S]=M.useState(!1),O=()=>{S(!_)},C=k=>{S(!1),k&&v(k)},E=(k,I)=>{const P=new Set(I),R=P.has(OO);P.delete(OO),P.delete(f),I=Array.from(P),d(I.length===1?I[0]:f),m(R)};return w.jsx(Ke,{sx:jd.headerContainer,children:w.jsxs(Ke,{sx:jd.actionsContainer,children:[a&&w.jsx(_t,{arrow:!0,title:fe.get("Zoom to full range"),children:w.jsx(Ot,{sx:jd.actionButton,onClick:i,size:"small",children:w.jsx(iye,{fontSize:"inherit"})},"zoomOutButton")}),w.jsx(_t,{arrow:!0,title:fe.get("Toggle zoom mode (or press CTRL key)"),children:w.jsx(Pn,{value:"zoomMode",selected:s,onClick:()=>l(!s),size:"small",children:w.jsx(eye,{fontSize:"inherit"})})}),w.jsx(P5t,{anchorEl:_?b.current:null,valueRange:g,setValueRange:C}),w.jsx(_t,{arrow:!0,title:fe.get("Enter fixed y-range"),children:w.jsx(Pn,{ref:b,value:"valueRange",selected:_,onClick:O,size:"small",children:w.jsx(rye,{fontSize:"inherit"})})}),w.jsx(_t,{arrow:!0,title:fe.get("Toggle showing info popup on hover"),children:w.jsx(Pn,{value:"showTooltips",selected:c,onClick:()=>u(!c),size:"small",children:w.jsx(nye,{fontSize:"inherit"})})}),w.jsxs(Jv,{value:p?[f,OO]:[f],onChange:E,size:"small",sx:jd.chartTypes,children:[w.jsx(_t,{arrow:!0,title:fe.get("Show points"),children:w.jsx(Pn,{value:"point",size:"small",children:w.jsx(oye,{fontSize:"inherit"})})}),w.jsx(_t,{arrow:!0,title:fe.get("Show lines"),children:w.jsx(Pn,{value:"line",size:"small",children:w.jsx(aye,{fontSize:"inherit"})})}),w.jsx(_t,{arrow:!0,title:fe.get("Show bars"),children:w.jsx(Pn,{value:"bar",size:"small",children:w.jsx(tye,{fontSize:"inherit"})})}),w.jsx(_t,{arrow:!0,title:fe.get("Show standard deviation (if any)"),children:w.jsx(Pn,{value:OO,size:"small",disabled:h,children:w.jsx(n6,{fontSize:"inherit"})})})]}),w.jsx(gye,{elementRef:y,postMessage:x}),w.jsx(E5t,{sx:jd.actionButton,timeSeriesGroupId:t.id,placeGroupTimeSeries:e,addPlaceGroupTimeSeries:n}),o?w.jsx(Qv,{size:24,sx:jd.actionButton,color:"secondary"}):w.jsx(Ot,{sx:jd.actionButton,"aria-label":"Close",onClick:()=>r(t.id),size:"small",children:w.jsx(kp,{fontSize:"inherit"})})]})})}const k5t=Li("div")(({theme:t})=>({userSelect:"none",marginTop:t.spacing(1),width:"99%",height:"32vh",display:"flex",flexDirection:"column",alignItems:"flex-stretch"})),A5t={style:{textAnchor:"middle"},angle:-90,position:"left",offset:0};function R5t({timeSeriesGroup:t,selectTimeSeries:e,selectedTime:n,selectTime:r,selectedTimeRange:i,selectTimeRange:o,places:a,selectPlace:s,placeInfos:l,dataTimeRange:c,chartTypeDefault:u,includeStdev:f,removeTimeSeries:d,removeTimeSeriesGroup:h,placeGroupTimeSeries:p,addPlaceGroupTimeSeries:m,postMessage:g}){const v=ld(),[y,x]=M.useState(!1),[b,_]=M.useState(!0),[S,O]=M.useState(u),[C,E]=M.useState(f),[k,I]=M.useState({}),P=M.useRef(),R=M.useRef(),T=M.useRef(),L=M.useRef(null),z=M.useRef(null),B=M.useMemo(()=>{const G=new Map;t.timeSeriesArray.forEach((he,_e)=>{const oe=`v${_e}`,Z=`ev${_e}`,V=he.source.valueDataKey,de=he.source.errorDataKey;he.data.forEach(xe=>{const Me=G.get(xe.time);let me;Me===void 0?(me={time:xe.time},G.set(xe.time,me)):me=Me;const Ne=xe[V];if(En(Ne)&&isFinite(Ne)&&(me[oe]=Ne),de){const Ce=xe[de];En(Ce)&&isFinite(Ce)&&(me[Z]=Ce)}})});const ie=Array.from(G.values());return ie.sort((he,_e)=>he.time-_e.time),ie},[t]),W=M.useMemo(()=>t.timeSeriesArray.map(G=>G.dataProgress?G.dataProgress:0),[t]),U=W.reduce((G,ie)=>G+ie,0)/W.length,N=U>0&&U<1,$=!!i&&!J8e(i,c||null);t.timeSeriesArray.forEach(G=>{G.source.valueDataKey});const D=t.variableUnits||fe.get("unknown units"),A=`${fe.get("Quantity")} (${D})`,q=v.palette.primary.light,Y=v.palette.primary.main,K=v.palette.text.primary,se=()=>{En(k.x1)&&I({})},te=G=>{if(!G)return;const{chartX:ie,chartY:he}=G;if(!En(ie)||!En(he))return;const _e=ee(ie,he);if(_e){const[oe,Z]=_e;I({x1:oe,y1:Z})}},J=(G,ie)=>{const{x1:he,y1:_e}=k;if(!En(he)||!En(_e)||!G)return;const{chartX:oe,chartY:Z}=G;if(!En(oe)||!En(Z))return;const V=ee(oe,Z);if(V){const[de,xe]=V;ie.ctrlKey||y?de!==he&&xe!==_e&&I({x1:he,y1:_e,x2:de,y2:xe}):de!==he&&I({x1:he,y1:_e,x2:de})}},pe=G=>{const[ie,he]=KK(k);se(),ie&&ie[0]{se()},re=()=>{se()},ve=G=>{d(t.id,G)},F=()=>{se(),o(c||null,t.id,null)},ce=G=>{G&&o(i,t.id,G)},le=(G,ie)=>{if(T.current=[G,ie],L.current){const he=L.current.getElementsByClassName("recharts-legend-wrapper");he.length!==0&&(z.current=he.item(0))}},Q=([G,ie])=>{const he=(ie-G)*.1;return i?P.current=i:P.current=[G-he,ie+he],P.current},X=([G,ie])=>{const he=(ie-G)*.1;if(t.variableRange)R.current=t.variableRange;else{const _e=G-he;R.current=[_e<0&&G-1e-6>0?0:_e,ie+he]}return R.current},ee=(G,ie)=>{const he=z.current;if(!T.current||!P.current||!R.current||!he)return;const[_e,oe]=P.current,[Z,V]=R.current,[de,xe]=T.current,Me=he.clientHeight,me=65,Ne=5,Ce=5,Re=38,ae=de-me-Ce,Le=xe-Ne-Re-Me,Ee=(G-me)/ae,ze=(ie-Ne)/Le;return[_e+Ee*(oe-_e),V-ze*(V-Z)]},[ge,ye]=KK(k),H=S==="bar"?ejt:JFt;return w.jsxs(k5t,{children:[w.jsx(M5t,{timeSeriesGroup:t,placeGroupTimeSeries:p,addPlaceGroupTimeSeries:m,removeTimeSeriesGroup:h,resetZoom:F,loading:N,zoomed:$,zoomMode:y,setZoomMode:x,showTooltips:b,setShowTooltips:_,chartType:S,setChartType:O,stdevBarsDisabled:!f,stdevBars:C,setStdevBars:E,valueRange:R.current,setValueRange:ce,chartElement:L,postMessage:g}),w.jsx(nge,{width:"98%",onResize:le,ref:L,children:w.jsxs(H,{onMouseDown:te,onMouseMove:J,onMouseUp:pe,onMouseEnter:be,onMouseLeave:re,syncId:"anyId",style:{color:K,fontSize:"0.8em"},data:B,barGap:1,barSize:30,maxBarSize:30,children:[w.jsx(Np,{dataKey:"time",type:"number",tickCount:6,domain:Q,tickFormatter:njt,stroke:K,allowDataOverflow:!0}),w.jsx(Fp,{type:"number",tickCount:5,domain:X,tickFormatter:rjt,stroke:K,allowDataOverflow:!0,label:{...A5t,value:A}}),w.jsx(XU,{strokeDasharray:"3 3"}),b&&!En(k.x1)&&w.jsx(ml,{content:w.jsx(sjt,{})}),w.jsx(gv,{content:w.jsx(ijt,{removeTimeSeries:ve})}),t.timeSeriesArray.map((G,ie)=>ljt({timeSeriesGroup:t,timeSeriesIndex:ie,selectTimeSeries:e,places:a,selectPlace:s,placeGroupTimeSeries:p,placeInfos:l,chartType:S,stdevBars:C,paletteMode:v.palette.mode})),ge&&w.jsx($p,{x1:ge[0],y1:ye?ye[0]:void 0,x2:ge[1],y2:ye?ye[1]:void 0,strokeOpacity:.3,fill:q,fillOpacity:.3}),n!==null&&w.jsx(Cw,{isFront:!0,x:n,stroke:Y,strokeWidth:3,strokeOpacity:.5})]})})]})}function KK(t){const{x1:e,x2:n,y1:r,y2:i}=t;let o,a;return En(e)&&En(n)&&(o=ew.jsx(R5t,{timeSeriesGroup:l,dataTimeRange:n,selectedTimeRange:r,selectTimeRange:i,...s},l.id))]})}const N5t=t=>({locale:t.controlState.locale,timeSeriesGroups:t.dataState.timeSeriesGroups,selectedTime:t.controlState.selectedTime,selectedTimeRange:t.controlState.selectedTimeRange,dataTimeRange:VHe(t),chartTypeDefault:t.controlState.timeSeriesChartTypeDefault,includeStdev:t.controlState.timeSeriesIncludeStdev,placeInfos:YHe(t),places:K1(t),placeGroupTimeSeries:aGe(t),canAddTimeSeries:Ose(t)}),F5t={selectTime:y2,selectTimeRange:Ele,removeTimeSeries:r7e,removeTimeSeriesGroup:i7e,selectPlace:v2,addPlaceGroupTimeSeries:n7e,addTimeSeries:g2,postMessage:ba},j5t=Jt(N5t,F5t)($5t);var l6={},B5t=ct;Object.defineProperty(l6,"__esModule",{value:!0});var vye=l6.default=void 0,z5t=B5t(pt()),U5t=w;vye=l6.default=(0,z5t.default)((0,U5t.jsx)("path",{d:"M22 18v-2H8V4h2L7 1 4 4h2v2H2v2h4v8c0 1.1.9 2 2 2h8v2h-2l3 3 3-3h-2v-2zM10 8h6v6h2V8c0-1.1-.9-2-2-2h-6z"}),"Transform");function W5t(t){return t.count===0}function V5t(t){return t.count===1}function G5t(t){return t.count>1}function H5t({statisticsRecord:t}){const e=t.statistics;return w.jsx(v5,{size:"small",children:w.jsx(y5,{children:W5t(e)?w.jsxs(pl,{children:[w.jsx(ar,{children:fe.get("Value")}),w.jsx(ar,{align:"right",children:"NaN"})]}):V5t(e)?w.jsxs(pl,{children:[w.jsx(ar,{children:fe.get("Value")}),w.jsx(ar,{align:"right",children:W0(e.mean)})]}):w.jsxs(w.Fragment,{children:[w.jsxs(pl,{children:[w.jsx(ar,{children:fe.get("Count")}),w.jsx(ar,{align:"right",children:e.count})]}),w.jsxs(pl,{children:[w.jsx(ar,{children:fe.get("Minimum")}),w.jsx(ar,{align:"right",children:W0(e.minimum)})]}),w.jsxs(pl,{children:[w.jsx(ar,{children:fe.get("Maximum")}),w.jsx(ar,{align:"right",children:W0(e.maximum)})]}),w.jsxs(pl,{children:[w.jsx(ar,{children:fe.get("Mean")}),w.jsx(ar,{align:"right",children:W0(e.mean)})]}),w.jsxs(pl,{children:[w.jsx(ar,{children:fe.get("Deviation")}),w.jsx(ar,{align:"right",children:W0(e.deviation)})]})]})})})}function W0(t){return Zf(t,3)}function q5t({statisticsRecord:t,showBrush:e,showDetails:n}){const r=Vo(),i=t.statistics,o=M.useMemo(()=>{if(!i.histogram)return null;const{values:y,edges:x}=i.histogram;return y.map((b,_)=>({x:.5*(x[_]+x[_+1]),y:b,i:_}))},[i]),[a,s]=M.useState([0,o?o.length-1:-1]);if(M.useEffect(()=>{o&&s([0,o.length-1])},[o]),o===null)return null;const{placeInfo:l}=t.source,[c,u]=a,f=o[c]?o[c].x:NaN,d=o[u]?o[u].x:NaN,h=Math.max(i.mean-i.deviation,i.minimum,f),p=Math.min(i.mean+i.deviation,i.maximum,d),m=r.palette.text.primary,g=r.palette.text.primary,v=({startIndex:y,endIndex:x})=>{En(y)&&En(x)&&s([y,x])};return w.jsx(nge,{width:"100%",height:"100%",children:w.jsxs(tjt,{data:o,margin:{top:0,right:e?30:5,bottom:1,left:2},style:{color:g,fontSize:"0.8em"},children:[w.jsx(XU,{strokeDasharray:"3 3"}),w.jsx(Np,{type:"number",dataKey:"x",domain:[f,d],tickCount:10,tickFormatter:y=>Zf(y,2)}),w.jsx(Fp,{}),w.jsx(Ed,{type:"monotone",dataKey:"y",stroke:l.color,fill:l.color}),n&&w.jsx(Cw,{x:i.mean,isFront:!0,stroke:m,strokeWidth:2,strokeOpacity:.5}),n&&w.jsx($p,{x1:h,x2:p,isFront:!1,stroke:m,strokeWidth:1,strokeOpacity:.3,fill:m,fillOpacity:.05}),e&&w.jsx(lp,{dataKey:"i",height:22,startIndex:c,endIndex:u,tickFormatter:y=>Zf(o[y].x,1),onChange:v})]})})}const CO={container:{padding:1,width:"100%"},header:{display:"flex",justifyContent:"space-between",alignItems:"center",paddingBottom:.5},actions:{display:"flex",gap:.1},body:{display:"flex"}};function TO({phrase:t}){return w.jsx("span",{style:{color:"red"},children:`<${fe.get(t)}?>`})}function yye({dataset:t,variable:e,time:n,placeInfo:r,actions:i,body:o,containerRef:a}){const s=t?t.title:w.jsx(TO,{phrase:"Dataset"}),l=e?e.name:w.jsx(TO,{phrase:"Variable"}),c=n?Lae(n):w.jsx(TO,{phrase:"Time"}),u=r?r.label:w.jsx(TO,{phrase:"Place"});return w.jsxs(Ke,{sx:CO.container,ref:a,children:[w.jsxs(Ke,{sx:CO.header,children:[w.jsxs(At,{fontSize:"small",children:[s," / ",l,", ",c,", ",u]}),w.jsx(Ke,{sx:CO.actions,children:i})]}),o&&w.jsx(Ke,{sx:CO.body,children:o})]})}const ZK={table:{flexGrow:0},chart:{flexGrow:1}};function X5t({locale:t,statisticsRecord:e,rowIndex:n,removeStatistics:r,postMessage:i}){const o=M.useRef(null),[a,s]=M.useState(!1),[l,c]=M.useState(!1),{dataset:u,variable:f,time:d,placeInfo:h}=e.source,p=G5t(e.statistics),m=()=>{c(!l)},g=()=>{s(!a)},v=()=>{r(n)};return w.jsx(yye,{dataset:u,variable:f,time:d,placeInfo:h,containerRef:o,actions:w.jsxs(w.Fragment,{children:[p&&w.jsxs(Jv,{size:"small",children:[w.jsx(_t,{arrow:!0,title:fe.get("Toggle adjustable x-range"),children:w.jsx(Pn,{selected:a,onClick:g,value:"brush",size:"small",children:w.jsx(vye,{fontSize:"inherit"})})}),w.jsx(_t,{arrow:!0,title:fe.get("Show standard deviation (if any)"),children:w.jsx(Pn,{selected:l,onClick:m,value:"details",size:"small",children:w.jsx(n6,{fontSize:"inherit"})})})]}),p&&w.jsx(gye,{elementRef:o,postMessage:i}),w.jsx(Ot,{size:"small",onClick:v,children:w.jsx(kp,{fontSize:"inherit"})})]}),body:w.jsxs(w.Fragment,{children:[w.jsx(Ke,{sx:ZK.table,children:w.jsx(H5t,{locale:t,statisticsRecord:e})}),w.jsx(Ke,{sx:ZK.chart,children:w.jsx(q5t,{showBrush:a,showDetails:l,statisticsRecord:e})})]})})}const Q5t={progress:{color:"primary"}};function Y5t({selectedDataset:t,selectedVariable:e,selectedTime:n,selectedPlaceInfo:r,canAddStatistics:i,addStatistics:o,statisticsLoading:a}){return w.jsx(yye,{dataset:t,variable:e,time:n,placeInfo:r,actions:a?w.jsx(Qv,{size:20,sx:Q5t.progress}):w.jsx(Ot,{size:"small",disabled:!i,onClick:o,color:"primary",children:w.jsx(aw,{fontSize:"inherit"})})})}const K5t={container:{padding:1,display:"flex",flexDirection:"column",alignItems:"flex-start"}};function Z5t({selectedDataset:t,selectedVariable:e,selectedTime:n,selectedPlaceInfo:r,statisticsLoading:i,statisticsRecords:o,canAddStatistics:a,addStatistics:s,removeStatistics:l,postMessage:c}){return w.jsxs(Ke,{sx:K5t.container,children:[w.jsx(Y5t,{selectedDataset:t,selectedVariable:e,selectedTime:n,selectedPlaceInfo:r,canAddStatistics:a,addStatistics:s,statisticsLoading:i}),o.map((u,f)=>w.jsx(X5t,{statisticsRecord:u,rowIndex:f,removeStatistics:l,postMessage:c},f))]})}const J5t=t=>({selectedDataset:Gr(t),selectedVariable:vo(t),selectedTime:xy(t),selectedPlaceInfo:Z1(t),statisticsLoading:iGe(t),statisticsRecords:KHe(t),canAddStatistics:Cse(t)}),eBt={addStatistics:Zse,removeStatistics:e7e,postMessage:ba},tBt=Jt(J5t,eBt)(Z5t);/** + A `).concat(p,",").concat(p,",0,0,").concat(c,",").concat(e,",").concat(n+i-s*p," Z")}else u="M ".concat(e,",").concat(n," h ").concat(r," v ").concat(i," h ").concat(-r," Z");return u},XDt=function(e,n){if(!e||!n)return!1;var r=e.x,i=e.y,o=n.x,a=n.y,s=n.width,l=n.height;if(Math.abs(s)>0&&Math.abs(l)>0){var c=Math.min(o,o+s),u=Math.max(o,o+s),f=Math.min(a,a+l),d=Math.max(a,a+l);return r>=c&&r<=u&&i>=f&&i<=d}return!1},QDt={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},BU=function(e){var n=XY(XY({},QDt),e),r=M.useRef(),i=M.useState(-1),o=BDt(i,2),a=o[0],s=o[1];M.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var b=r.current.getTotalLength();b&&s(b)}catch{}},[]);var l=n.x,c=n.y,u=n.width,f=n.height,d=n.radius,h=n.className,p=n.animationEasing,m=n.animationDuration,g=n.animationBegin,v=n.isAnimationActive,y=n.isUpdateAnimationActive;if(l!==+l||c!==+c||u!==+u||f!==+f||u===0||f===0)return null;var x=ke("recharts-rectangle",h);return y?ue.createElement(ec,{canBegin:a>0,from:{width:u,height:f,x:l,y:c},to:{width:u,height:f,x:l,y:c},duration:m,animationEasing:p,isActive:y},function(b){var _=b.width,S=b.height,O=b.x,C=b.y;return ue.createElement(ec,{canBegin:a>0,from:"0px ".concat(a===-1?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:m,isActive:v,easing:p},ue.createElement("path",dP({},jt(n,!0),{className:x,d:QY(O,C,_,S,d),ref:r})))}):ue.createElement("path",dP({},jt(n,!0),{className:x,d:QY(l,c,u,f,d)}))};function XN(){return XN=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function nLt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var rLt=function(e,n,r,i,o,a){return"M".concat(e,",").concat(o,"v").concat(i,"M").concat(a,",").concat(n,"h").concat(r)},iLt=function(e){var n=e.x,r=n===void 0?0:n,i=e.y,o=i===void 0?0:i,a=e.top,s=a===void 0?0:a,l=e.left,c=l===void 0?0:l,u=e.width,f=u===void 0?0:u,d=e.height,h=d===void 0?0:d,p=e.className,m=tLt(e,YDt),g=KDt({x:r,y:o,top:s,left:c,width:f,height:h},m);return!Ye(r)||!Ye(o)||!Ye(f)||!Ye(h)||!Ye(s)||!Ye(c)?null:ue.createElement("path",QN({},jt(g,!0),{className:ke("recharts-cross",p),d:rLt(r,o,f,h,s,c)}))},oLt=Lme,aLt=oLt(Object.getPrototypeOf,Object),sLt=aLt,lLt=_u,cLt=sLt,uLt=wu,fLt="[object Object]",dLt=Function.prototype,hLt=Object.prototype,xve=dLt.toString,pLt=hLt.hasOwnProperty,mLt=xve.call(Object);function gLt(t){if(!uLt(t)||lLt(t)!=fLt)return!1;var e=cLt(t);if(e===null)return!0;var n=pLt.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&xve.call(n)==mLt}var vLt=gLt;const yLt=Nt(vLt);var xLt=_u,bLt=wu,_Lt="[object Boolean]";function wLt(t){return t===!0||t===!1||bLt(t)&&xLt(t)==_Lt}var SLt=wLt;const OLt=Nt(SLt);function B_(t){"@babel/helpers - typeof";return B_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},B_(t)}function hP(){return hP=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0,from:{upperWidth:0,lowerWidth:0,height:d,x:l,y:c},to:{upperWidth:u,lowerWidth:f,height:d,x:l,y:c},duration:m,animationEasing:p,isActive:v},function(x){var b=x.upperWidth,_=x.lowerWidth,S=x.height,O=x.x,C=x.y;return ue.createElement(ec,{canBegin:a>0,from:"0px ".concat(a===-1?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:m,easing:p},ue.createElement("path",hP({},jt(n,!0),{className:y,d:eK(O,C,b,_,S),ref:r})))}):ue.createElement("g",null,ue.createElement("path",hP({},jt(n,!0),{className:y,d:eK(l,c,u,f,d)})))},LLt=["option","shapeType","propTransformer","activeClassName","isActive"];function z_(t){"@babel/helpers - typeof";return z_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},z_(t)}function $Lt(t,e){if(t==null)return{};var n=NLt(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function NLt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function tK(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function pP(t){for(var e=1;e0&&r.handleDrag(i.changedTouches[0])}),oa(ul(r),"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=r.props,o=i.endIndex,a=i.onDragEnd,s=i.startIndex;a==null||a({endIndex:o,startIndex:s})}),r.detachDragEndListener()}),oa(ul(r),"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),oa(ul(r),"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),oa(ul(r),"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),oa(ul(r),"handleSlideDragStart",function(i){var o=lK(i)?i.changedTouches[0]:i;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:o.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(ul(r),"startX"),endX:r.handleTravellerDragStart.bind(ul(r),"endX")},r.state={},r}return v$t(e,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var i=r.startX,o=r.endX,a=this.state.scaleValues,s=this.props,l=s.gap,c=s.data,u=c.length-1,f=Math.min(i,o),d=Math.max(i,o),h=e.getIndexInRange(a,f),p=e.getIndexInRange(a,d);return{startIndex:h-h%l,endIndex:p===u?u:p-p%l}}},{key:"getTextOfTick",value:function(r){var i=this.props,o=i.data,a=i.tickFormatter,s=i.dataKey,l=ho(o[r],s,r);return Bt(a)?a(l,r):l}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var i=this.state,o=i.slideMoveStartX,a=i.startX,s=i.endX,l=this.props,c=l.x,u=l.width,f=l.travellerWidth,d=l.startIndex,h=l.endIndex,p=l.onChange,m=r.pageX-o;m>0?m=Math.min(m,c+u-f-s,c+u-f-a):m<0&&(m=Math.max(m,c-a,c-s));var g=this.getIndex({startX:a+m,endX:s+m});(g.startIndex!==d||g.endIndex!==h)&&p&&p(g),this.setState({startX:a+m,endX:s+m,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,i){var o=lK(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:o.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var i=this.state,o=i.brushMoveStartX,a=i.movingTravellerId,s=i.endX,l=i.startX,c=this.state[a],u=this.props,f=u.x,d=u.width,h=u.travellerWidth,p=u.onChange,m=u.gap,g=u.data,v={startX:this.state.startX,endX:this.state.endX},y=r.pageX-o;y>0?y=Math.min(y,f+d-h-c):y<0&&(y=Math.max(y,f-c)),v[a]=c+y;var x=this.getIndex(v),b=x.startIndex,_=x.endIndex,S=function(){var C=g.length-1;return a==="startX"&&(s>l?b%m===0:_%m===0)||sl?_%m===0:b%m===0)||s>l&&_===C};this.setState(oa(oa({},a,c+y),"brushMoveStartX",r.pageX),function(){p&&S()&&p(x)})}},{key:"handleTravellerMoveKeyboard",value:function(r,i){var o=this,a=this.state,s=a.scaleValues,l=a.startX,c=a.endX,u=this.state[i],f=s.indexOf(u);if(f!==-1){var d=f+r;if(!(d===-1||d>=s.length)){var h=s[d];i==="startX"&&h>=c||i==="endX"&&h<=l||this.setState(oa({},i,h),function(){o.props.onChange(o.getIndex({startX:o.state.startX,endX:o.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,i=r.x,o=r.y,a=r.width,s=r.height,l=r.fill,c=r.stroke;return ue.createElement("rect",{stroke:c,fill:l,x:i,y:o,width:a,height:s})}},{key:"renderPanorama",value:function(){var r=this.props,i=r.x,o=r.y,a=r.width,s=r.height,l=r.data,c=r.children,u=r.padding,f=M.Children.only(c);return f?ue.cloneElement(f,{x:i,y:o,width:a,height:s,margin:u,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(r,i){var o=this,a=this.props,s=a.y,l=a.travellerWidth,c=a.height,u=a.traveller,f=a.ariaLabel,d=a.data,h=a.startIndex,p=a.endIndex,m=Math.max(r,this.props.x),g=EI(EI({},jt(this.props,!1)),{},{x:m,y:s,width:l,height:c}),v=f||"Min value: ".concat(d[h].name,", Max value: ").concat(d[p].name);return ue.createElement(Vn,{tabIndex:0,role:"slider","aria-label":v,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(x){["ArrowLeft","ArrowRight"].includes(x.key)&&(x.preventDefault(),x.stopPropagation(),o.handleTravellerMoveKeyboard(x.key==="ArrowRight"?1:-1,i))},onFocus:function(){o.setState({isTravellerFocused:!0})},onBlur:function(){o.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},e.renderTraveller(u,g))}},{key:"renderSlide",value:function(r,i){var o=this.props,a=o.y,s=o.height,l=o.stroke,c=o.travellerWidth,u=Math.min(r,i)+c,f=Math.max(Math.abs(i-r)-c,0);return ue.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:l,fillOpacity:.2,x:u,y:a,width:f,height:s})}},{key:"renderText",value:function(){var r=this.props,i=r.startIndex,o=r.endIndex,a=r.y,s=r.height,l=r.travellerWidth,c=r.stroke,u=this.state,f=u.startX,d=u.endX,h=5,p={pointerEvents:"none",fill:c};return ue.createElement(Vn,{className:"recharts-brush-texts"},ue.createElement(HE,gP({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,d)-h,y:a+s/2},p),this.getTextOfTick(i)),ue.createElement(HE,gP({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,d)+l+h,y:a+s/2},p),this.getTextOfTick(o)))}},{key:"render",value:function(){var r=this.props,i=r.data,o=r.className,a=r.children,s=r.x,l=r.y,c=r.width,u=r.height,f=r.alwaysShowText,d=this.state,h=d.startX,p=d.endX,m=d.isTextActive,g=d.isSlideMoving,v=d.isTravellerMoving,y=d.isTravellerFocused;if(!i||!i.length||!Ye(s)||!Ye(l)||!Ye(c)||!Ye(u)||c<=0||u<=0)return null;var x=ke("recharts-brush",o),b=ue.Children.count(a)===1,_=m$t("userSelect","none");return ue.createElement(Vn,{className:x,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:_},this.renderBackground(),b&&this.renderPanorama(),this.renderSlide(h,p),this.renderTravellerLayer(h,"startX"),this.renderTravellerLayer(p,"endX"),(m||g||v||y||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var i=r.x,o=r.y,a=r.width,s=r.height,l=r.stroke,c=Math.floor(o+s/2)-1;return ue.createElement(ue.Fragment,null,ue.createElement("rect",{x:i,y:o,width:a,height:s,fill:l,stroke:"none"}),ue.createElement("line",{x1:i+1,y1:c,x2:i+a-1,y2:c,fill:"none",stroke:"#fff"}),ue.createElement("line",{x1:i+1,y1:c+2,x2:i+a-1,y2:c+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,i){var o;return ue.isValidElement(r)?o=ue.cloneElement(r,i):Bt(r)?o=r(i):o=e.renderDefaultTraveller(i),o}},{key:"getDerivedStateFromProps",value:function(r,i){var o=r.data,a=r.width,s=r.x,l=r.travellerWidth,c=r.updateId,u=r.startIndex,f=r.endIndex;if(o!==i.prevData||c!==i.prevUpdateId)return EI({prevData:o,prevTravellerWidth:l,prevUpdateId:c,prevX:s,prevWidth:a},o&&o.length?w$t({data:o,width:a,x:s,travellerWidth:l,startIndex:u,endIndex:f}):{scale:null,scaleValues:null});if(i.scale&&(a!==i.prevWidth||s!==i.prevX||l!==i.prevTravellerWidth)){i.scale.range([s,s+a-l]);var d=i.scale.domain().map(function(h){return i.scale(h)});return{prevData:o,prevTravellerWidth:l,prevUpdateId:c,prevX:s,prevWidth:a,startX:i.scale(r.startIndex),endX:i.scale(r.endIndex),scaleValues:d}}return null}},{key:"getIndexInRange",value:function(r,i){for(var o=r.length,a=0,s=o-1;s-a>1;){var l=Math.floor((a+s)/2);r[l]>i?s=l:a=l}return i>=r[s]?s:a}}]),e}(M.PureComponent);oa(lp,"displayName","Brush");oa(lp,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var S$t=dU;function O$t(t,e){var n;return S$t(t,function(r,i,o){return n=e(r,i,o),!n}),!!n}var C$t=O$t,T$t=Eme,E$t=Sd,P$t=C$t,M$t=Ho,k$t=ck;function A$t(t,e,n){var r=M$t(t)?T$t:P$t;return n&&k$t(t,e,n)&&(e=void 0),r(t,E$t(e))}var R$t=A$t;const I$t=Nt(R$t);var Ql=function(e,n){var r=e.alwaysShow,i=e.ifOverflow;return r&&(i="extendDomain"),i===n},cK=Yme;function D$t(t,e,n){e=="__proto__"&&cK?cK(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var L$t=D$t,$$t=L$t,N$t=Xme,F$t=Sd;function j$t(t,e){var n={};return e=F$t(e),N$t(t,function(r,i,o){$$t(n,i,e(r,i,o))}),n}var B$t=j$t;const z$t=Nt(B$t);function U$t(t,e){for(var n=-1,r=t==null?0:t.length;++n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function o3t(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function a3t(t,e){var n=t.x,r=t.y,i=i3t(t,e3t),o="".concat(n),a=parseInt(o,10),s="".concat(r),l=parseInt(s,10),c="".concat(e.height||i.height),u=parseInt(c,10),f="".concat(e.width||i.width),d=parseInt(f,10);return U0(U0(U0(U0(U0({},e),i),a?{x:a}:{}),l?{y:l}:{}),{},{height:u,width:d,name:e.name,radius:e.radius})}function fK(t){return ue.createElement(VLt,KN({shapeType:"rectangle",propTransformer:a3t,activeClassName:"recharts-active-bar"},t))}var s3t=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,i){if(typeof e=="number")return e;var o=typeof r=="number";return o?e(r,i):(o||sp(!1),n)}},l3t=["value","background"],Cve;function Cv(t){"@babel/helpers - typeof";return Cv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Cv(t)}function c3t(t,e){if(t==null)return{};var n=u3t(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function u3t(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function yP(){return yP=Object.assign?Object.assign.bind():function(t){for(var e=1;e0&&Math.abs(T)0&&Math.abs(R)0&&(R=Math.min((q||0)-(T[Y-1]||0),R))}),Number.isFinite(R)){var L=R/P,z=m.layout==="vertical"?r.height:r.width;if(m.padding==="gap"&&(O=L*z/2),m.padding==="no-gap"){var B=dv(e.barCategoryGap,L*z),W=L*z/2;O=W-B-(W-B)/z*B}}}i==="xAxis"?C=[r.left+(x.left||0)+(O||0),r.left+r.width-(x.right||0)-(O||0)]:i==="yAxis"?C=l==="horizontal"?[r.top+r.height-(x.bottom||0),r.top+(x.top||0)]:[r.top+(x.top||0)+(O||0),r.top+r.height-(x.bottom||0)-(O||0)]:C=m.range,_&&(C=[C[1],C[0]]);var U=lRt(m,o,d),N=U.scale,$=U.realScaleType;N.domain(v).range(C),cRt(N);var D=vRt(N,Ns(Ns({},m),{},{realScaleType:$}));i==="xAxis"?(I=g==="top"&&!b||g==="bottom"&&b,E=r.left,k=f[S]-I*m.height):i==="yAxis"&&(I=g==="left"&&!b||g==="right"&&b,E=f[S]-I*m.width,k=r.top);var A=Ns(Ns(Ns({},m),D),{},{realScaleType:$,x:E,y:k,scale:N,width:i==="xAxis"?r.width:m.width,height:i==="yAxis"?r.height:m.height});return A.bandSize=aP(A,D),!m.hide&&i==="xAxis"?f[S]+=(I?-1:1)*A.height:m.hide||(f[S]+=(I?-1:1)*A.width),Ns(Ns({},h),{},wk({},p,A))},{})},Mve=function(e,n){var r=e.x,i=e.y,o=n.x,a=n.y;return{x:Math.min(r,o),y:Math.min(i,a),width:Math.abs(o-r),height:Math.abs(a-i)}},b3t=function(e){var n=e.x1,r=e.y1,i=e.x2,o=e.y2;return Mve({x:n,y:r},{x:i,y:o})},kve=function(){function t(e){v3t(this,t),this.scale=e}return y3t(t,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.bandAware,o=r.position;if(n!==void 0){if(o)switch(o){case"start":return this.scale(n);case"middle":{var a=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+a}case"end":{var s=this.bandwidth?this.bandwidth():0;return this.scale(n)+s}default:return this.scale(n)}if(i){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+l}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),i=r[0],o=r[r.length-1];return i<=o?n>=i&&n<=o:n>=o&&n<=i}}],[{key:"create",value:function(n){return new t(n)}}]),t}();wk(kve,"EPS",1e-4);var UU=function(e){var n=Object.keys(e).reduce(function(r,i){return Ns(Ns({},r),{},wk({},i,kve.create(e[i])))},{});return Ns(Ns({},n),{},{apply:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=o.bandAware,s=o.position;return z$t(i,function(l,c){return n[c].apply(l,{bandAware:a,position:s})})},isInRange:function(i){return Ove(i,function(o,a){return n[a].isInRange(o)})}})};function _3t(t){return(t%180+180)%180}var w3t=function(e){var n=e.width,r=e.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=_3t(i),a=o*Math.PI/180,s=Math.atan(r/n),l=a>s&&a-1?i[o?e[a]:a]:void 0}}var E3t=T3t,P3t=bve;function M3t(t){var e=P3t(t),n=e%1;return e===e?n?e-n:e:0}var k3t=M3t,A3t=zme,R3t=Sd,I3t=k3t,D3t=Math.max;function L3t(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=n==null?0:I3t(n);return i<0&&(i=D3t(r+i,0)),A3t(t,R3t(e),i)}var $3t=L3t,N3t=E3t,F3t=$3t,j3t=N3t(F3t),B3t=j3t;const z3t=Nt(B3t);var U3t=o0t(function(t){return{x:t.left,y:t.top,width:t.width,height:t.height}},function(t){return["l",t.left,"t",t.top,"w",t.width,"h",t.height].join("")}),WU=M.createContext(void 0),VU=M.createContext(void 0),Ave=M.createContext(void 0),Rve=M.createContext({}),Ive=M.createContext(void 0),Dve=M.createContext(0),Lve=M.createContext(0),gK=function(e){var n=e.state,r=n.xAxisMap,i=n.yAxisMap,o=n.offset,a=e.clipPathId,s=e.children,l=e.width,c=e.height,u=U3t(o);return ue.createElement(WU.Provider,{value:r},ue.createElement(VU.Provider,{value:i},ue.createElement(Rve.Provider,{value:o},ue.createElement(Ave.Provider,{value:u},ue.createElement(Ive.Provider,{value:a},ue.createElement(Dve.Provider,{value:c},ue.createElement(Lve.Provider,{value:l},s)))))))},W3t=function(){return M.useContext(Ive)},$ve=function(e){var n=M.useContext(WU);n==null&&sp(!1);var r=n[e];return r==null&&sp(!1),r},V3t=function(){var e=M.useContext(WU);return ff(e)},G3t=function(){var e=M.useContext(VU),n=z3t(e,function(r){return Ove(r.domain,Number.isFinite)});return n||ff(e)},Nve=function(e){var n=M.useContext(VU);n==null&&sp(!1);var r=n[e];return r==null&&sp(!1),r},H3t=function(){var e=M.useContext(Ave);return e},q3t=function(){return M.useContext(Rve)},GU=function(){return M.useContext(Lve)},HU=function(){return M.useContext(Dve)};function H_(t){"@babel/helpers - typeof";return H_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},H_(t)}function vK(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function yK(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);nt*i)return!1;var o=n();return t*(e-t*o/2-r)>=0&&t*(e+t*o/2-i)<=0}function pNt(t,e){return Fve(t,e+1)}function mNt(t,e,n,r,i){for(var o=(r||[]).slice(),a=e.start,s=e.end,l=0,c=1,u=a,f=function(){var p=r==null?void 0:r[l];if(p===void 0)return{v:Fve(r,c)};var m=l,g,v=function(){return g===void 0&&(g=n(p,m)),g},y=p.coordinate,x=l===0||bP(t,y,v,u,s);x||(l=0,u=a,c+=1),x&&(u=y+t*(v()/2+i),l+=c)},d;c<=o.length;)if(d=f(),d)return d.v;return[]}function Q_(t){"@babel/helpers - typeof";return Q_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Q_(t)}function OK(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Vi(t){for(var e=1;e0?h.coordinate-g*t:h.coordinate})}else o[d]=h=Vi(Vi({},h),{},{tickCoord:h.coordinate});var v=bP(t,h.tickCoord,m,s,l);v&&(l=h.tickCoord-t*(m()/2+i),o[d]=Vi(Vi({},h),{},{isShow:!0}))},u=a-1;u>=0;u--)c(u);return o}function bNt(t,e,n,r,i,o){var a=(r||[]).slice(),s=a.length,l=e.start,c=e.end;if(o){var u=r[s-1],f=n(u,s-1),d=t*(u.coordinate+t*f/2-c);a[s-1]=u=Vi(Vi({},u),{},{tickCoord:d>0?u.coordinate-d*t:u.coordinate});var h=bP(t,u.tickCoord,function(){return f},l,c);h&&(c=u.tickCoord-t*(f/2+i),a[s-1]=Vi(Vi({},u),{},{isShow:!0}))}for(var p=o?s-1:s,m=function(y){var x=a[y],b,_=function(){return b===void 0&&(b=n(x,y)),b};if(y===0){var S=t*(x.coordinate-t*_()/2-l);a[y]=x=Vi(Vi({},x),{},{tickCoord:S<0?x.coordinate-S*t:x.coordinate})}else a[y]=x=Vi(Vi({},x),{},{tickCoord:x.coordinate});var O=bP(t,x.tickCoord,_,l,c);O&&(l=x.tickCoord+t*(_()/2+i),a[y]=Vi(Vi({},x),{},{isShow:!0}))},g=0;g=2?Vs(i[1].coordinate-i[0].coordinate):1,v=hNt(o,g,h);return l==="equidistantPreserveStart"?mNt(g,v,m,i,a):(l==="preserveStart"||l==="preserveStartEnd"?d=bNt(g,v,m,i,a,l==="preserveStartEnd"):d=xNt(g,v,m,i,a),d.filter(function(y){return y.isShow}))}var _Nt=["viewBox"],wNt=["viewBox"],SNt=["ticks"];function Tv(t){"@babel/helpers - typeof";return Tv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Tv(t)}function rg(){return rg=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function ONt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function CNt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function TK(t,e){for(var n=0;n0?l(this.props):l(h)),a<=0||s<=0||!p||!p.length?null:ue.createElement(Vn,{className:ke("recharts-cartesian-axis",c),ref:function(g){r.layerReference=g}},o&&this.renderAxisLine(),this.renderTicks(p,this.state.fontSize,this.state.letterSpacing),Xi.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,i,o){var a;return ue.isValidElement(r)?a=ue.cloneElement(r,i):Bt(r)?a=r(i):a=ue.createElement(HE,rg({},i,{className:"recharts-cartesian-axis-tick-value"}),o),a}}]),e}(M.Component);XU(Vy,"displayName","CartesianAxis");XU(Vy,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var RNt=["x1","y1","x2","y2","key"],INt=["offset"];function cp(t){"@babel/helpers - typeof";return cp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cp(t)}function EK(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Qi(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function NNt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var FNt=function(e){var n=e.fill;if(!n||n==="none")return null;var r=e.fillOpacity,i=e.x,o=e.y,a=e.width,s=e.height;return ue.createElement("rect",{x:i,y:o,width:a,height:s,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function zve(t,e){var n;if(ue.isValidElement(t))n=ue.cloneElement(t,e);else if(Bt(t))n=t(e);else{var r=e.x1,i=e.y1,o=e.x2,a=e.y2,s=e.key,l=PK(e,RNt),c=jt(l,!1);c.offset;var u=PK(c,INt);n=ue.createElement("line",wh({},u,{x1:r,y1:i,x2:o,y2:a,fill:"none",key:s}))}return n}function jNt(t){var e=t.x,n=t.width,r=t.horizontal,i=r===void 0?!0:r,o=t.horizontalPoints;if(!i||!o||!o.length)return null;var a=o.map(function(s,l){var c=Qi(Qi({},t),{},{x1:e,y1:s,x2:e+n,y2:s,key:"line-".concat(l),index:l});return zve(i,c)});return ue.createElement("g",{className:"recharts-cartesian-grid-horizontal"},a)}function BNt(t){var e=t.y,n=t.height,r=t.vertical,i=r===void 0?!0:r,o=t.verticalPoints;if(!i||!o||!o.length)return null;var a=o.map(function(s,l){var c=Qi(Qi({},t),{},{x1:s,y1:e,x2:s,y2:e+n,key:"line-".concat(l),index:l});return zve(i,c)});return ue.createElement("g",{className:"recharts-cartesian-grid-vertical"},a)}function zNt(t){var e=t.horizontalFill,n=t.fillOpacity,r=t.x,i=t.y,o=t.width,a=t.height,s=t.horizontalPoints,l=t.horizontal,c=l===void 0?!0:l;if(!c||!e||!e.length)return null;var u=s.map(function(d){return Math.round(d+i-i)}).sort(function(d,h){return d-h});i!==u[0]&&u.unshift(0);var f=u.map(function(d,h){var p=!u[h+1],m=p?i+a-d:u[h+1]-d;if(m<=0)return null;var g=h%e.length;return ue.createElement("rect",{key:"react-".concat(h),y:d,x:r,height:m,width:o,stroke:"none",fill:e[g],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return ue.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function UNt(t){var e=t.vertical,n=e===void 0?!0:e,r=t.verticalFill,i=t.fillOpacity,o=t.x,a=t.y,s=t.width,l=t.height,c=t.verticalPoints;if(!n||!r||!r.length)return null;var u=c.map(function(d){return Math.round(d+o-o)}).sort(function(d,h){return d-h});o!==u[0]&&u.unshift(0);var f=u.map(function(d,h){var p=!u[h+1],m=p?o+s-d:u[h+1]-d;if(m<=0)return null;var g=h%r.length;return ue.createElement("rect",{key:"react-".concat(h),x:d,y:a,width:m,height:l,stroke:"none",fill:r[g],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return ue.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var WNt=function(e,n){var r=e.xAxis,i=e.width,o=e.height,a=e.offset;return ove(qU(Qi(Qi(Qi({},Vy.defaultProps),r),{},{ticks:Hc(r,!0),viewBox:{x:0,y:0,width:i,height:o}})),a.left,a.left+a.width,n)},VNt=function(e,n){var r=e.yAxis,i=e.width,o=e.height,a=e.offset;return ove(qU(Qi(Qi(Qi({},Vy.defaultProps),r),{},{ticks:Hc(r,!0),viewBox:{x:0,y:0,width:i,height:o}})),a.top,a.top+a.height,n)},lm={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function QU(t){var e,n,r,i,o,a,s=GU(),l=HU(),c=q3t(),u=Qi(Qi({},t),{},{stroke:(e=t.stroke)!==null&&e!==void 0?e:lm.stroke,fill:(n=t.fill)!==null&&n!==void 0?n:lm.fill,horizontal:(r=t.horizontal)!==null&&r!==void 0?r:lm.horizontal,horizontalFill:(i=t.horizontalFill)!==null&&i!==void 0?i:lm.horizontalFill,vertical:(o=t.vertical)!==null&&o!==void 0?o:lm.vertical,verticalFill:(a=t.verticalFill)!==null&&a!==void 0?a:lm.verticalFill,x:Ye(t.x)?t.x:c.left,y:Ye(t.y)?t.y:c.top,width:Ye(t.width)?t.width:c.width,height:Ye(t.height)?t.height:c.height}),f=u.x,d=u.y,h=u.width,p=u.height,m=u.syncWithTicks,g=u.horizontalValues,v=u.verticalValues,y=V3t(),x=G3t();if(!Ye(h)||h<=0||!Ye(p)||p<=0||!Ye(f)||f!==+f||!Ye(d)||d!==+d)return null;var b=u.verticalCoordinatesGenerator||WNt,_=u.horizontalCoordinatesGenerator||VNt,S=u.horizontalPoints,O=u.verticalPoints;if((!S||!S.length)&&Bt(_)){var C=g&&g.length,E=_({yAxis:x?Qi(Qi({},x),{},{ticks:C?g:x.ticks}):void 0,width:s,height:l,offset:c},C?!0:m);Jc(Array.isArray(E),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(cp(E),"]")),Array.isArray(E)&&(S=E)}if((!O||!O.length)&&Bt(b)){var k=v&&v.length,I=b({xAxis:y?Qi(Qi({},y),{},{ticks:k?v:y.ticks}):void 0,width:s,height:l,offset:c},k?!0:m);Jc(Array.isArray(I),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(cp(I),"]")),Array.isArray(I)&&(O=I)}return ue.createElement("g",{className:"recharts-cartesian-grid"},ue.createElement(FNt,{fill:u.fill,fillOpacity:u.fillOpacity,x:u.x,y:u.y,width:u.width,height:u.height}),ue.createElement(jNt,wh({},u,{offset:c,horizontalPoints:S,xAxis:y,yAxis:x})),ue.createElement(BNt,wh({},u,{offset:c,verticalPoints:O,xAxis:y,yAxis:x})),ue.createElement(zNt,wh({},u,{horizontalPoints:S})),ue.createElement(UNt,wh({},u,{verticalPoints:O})))}QU.displayName="CartesianGrid";var GNt=["type","layout","connectNulls","ref"];function Ev(t){"@babel/helpers - typeof";return Ev=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ev(t)}function HNt(t,e){if(t==null)return{};var n=qNt(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function qNt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function ob(){return ob=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);nf){h=[].concat(cm(l.slice(0,p)),[f-m]);break}var g=h.length%2===0?[0,d]:[d];return[].concat(cm(e.repeat(l,u)),cm(h),g).map(function(v){return"".concat(v,"px")}).join(", ")}),Fs(Xu(n),"id",Ly("recharts-line-")),Fs(Xu(n),"pathRef",function(a){n.mainCurve=a}),Fs(Xu(n),"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),Fs(Xu(n),"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return JNt(e,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,a=o.points,s=o.xAxis,l=o.yAxis,c=o.layout,u=o.children,f=is(u,Uy);if(!f)return null;var d=function(m,g){return{x:m.x,y:m.y,value:m.value,errorVal:ho(m.payload,g)}},h={clipPath:r?"url(#clipPath-".concat(i,")"):null};return ue.createElement(Vn,h,f.map(function(p){return ue.cloneElement(p,{key:"bar-".concat(p.props.dataKey),data:a,xAxis:s,yAxis:l,layout:c,dataPointFormatter:d})}))}},{key:"renderDots",value:function(r,i,o){var a=this.props.isAnimationActive;if(a&&!this.state.isAnimationFinished)return null;var s=this.props,l=s.dot,c=s.points,u=s.dataKey,f=jt(this.props,!1),d=jt(l,!0),h=c.map(function(m,g){var v=ra(ra(ra({key:"dot-".concat(g),r:3},f),d),{},{value:m.value,dataKey:u,cx:m.x,cy:m.y,index:g,payload:m.payload});return e.renderDotItem(l,v)}),p={clipPath:r?"url(#clipPath-".concat(i?"":"dots-").concat(o,")"):null};return ue.createElement(Vn,ob({className:"recharts-line-dots",key:"dots"},p),h)}},{key:"renderCurveStatically",value:function(r,i,o,a){var s=this.props,l=s.type,c=s.layout,u=s.connectNulls;s.ref;var f=HNt(s,GNt),d=ra(ra(ra({},jt(f,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(o,")"):null,points:r},a),{},{type:l,layout:c,connectNulls:u});return ue.createElement(Dg,ob({},d,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,i){var o=this,a=this.props,s=a.points,l=a.strokeDasharray,c=a.isAnimationActive,u=a.animationBegin,f=a.animationDuration,d=a.animationEasing,h=a.animationId,p=a.animateNewValues,m=a.width,g=a.height,v=this.state,y=v.prevPoints,x=v.totalLength;return ue.createElement(ec,{begin:u,duration:f,isActive:c,easing:d,from:{t:0},to:{t:1},key:"line-".concat(h),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(b){var _=b.t;if(y){var S=y.length/s.length,O=s.map(function(P,R){var T=Math.floor(R*S);if(y[T]){var L=y[T],z=Ei(L.x,P.x),B=Ei(L.y,P.y);return ra(ra({},P),{},{x:z(_),y:B(_)})}if(p){var W=Ei(m*2,P.x),U=Ei(g/2,P.y);return ra(ra({},P),{},{x:W(_),y:U(_)})}return ra(ra({},P),{},{x:P.x,y:P.y})});return o.renderCurveStatically(O,r,i)}var C=Ei(0,x),E=C(_),k;if(l){var I="".concat(l).split(/[,\s]+/gim).map(function(P){return parseFloat(P)});k=o.getStrokeDasharray(E,x,I)}else k=o.generateSimpleStrokeDasharray(x,E);return o.renderCurveStatically(s,r,i,{strokeDasharray:k})})}},{key:"renderCurve",value:function(r,i){var o=this.props,a=o.points,s=o.isAnimationActive,l=this.state,c=l.prevPoints,u=l.totalLength;return s&&a&&a.length&&(!c&&u>0||!wv(c,a))?this.renderCurveWithAnimation(r,i):this.renderCurveStatically(a,r,i)}},{key:"render",value:function(){var r,i=this.props,o=i.hide,a=i.dot,s=i.points,l=i.className,c=i.xAxis,u=i.yAxis,f=i.top,d=i.left,h=i.width,p=i.height,m=i.isAnimationActive,g=i.id;if(o||!s||!s.length)return null;var v=this.state.isAnimationFinished,y=s.length===1,x=ke("recharts-line",l),b=c&&c.allowDataOverflow,_=u&&u.allowDataOverflow,S=b||_,O=qt(g)?this.id:g,C=(r=jt(a,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},E=C.r,k=E===void 0?3:E,I=C.strokeWidth,P=I===void 0?2:I,R=Zpe(a)?a:{},T=R.clipDot,L=T===void 0?!0:T,z=k*2+P;return ue.createElement(Vn,{className:x},b||_?ue.createElement("defs",null,ue.createElement("clipPath",{id:"clipPath-".concat(O)},ue.createElement("rect",{x:b?d:d-h/2,y:_?f:f-p/2,width:b?h:h*2,height:_?p:p*2})),!L&&ue.createElement("clipPath",{id:"clipPath-dots-".concat(O)},ue.createElement("rect",{x:d-z/2,y:f-z/2,width:h+z,height:p+z}))):null,!y&&this.renderCurve(S,O),this.renderErrorBar(S,O),(y||a)&&this.renderDots(S,L,O),(!m||v)&&tu.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:i.curPoints}:r.points!==i.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,i){for(var o=r.length%2!==0?[].concat(cm(r),[0]):r,a=[],s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function aFt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function Sh(){return Sh=Object.assign?Object.assign.bind():function(t){for(var e=1;e0||!wv(u,a)||!wv(f,s))?this.renderAreaWithAnimation(r,i):this.renderAreaStatically(a,s,r,i)}},{key:"render",value:function(){var r,i=this.props,o=i.hide,a=i.dot,s=i.points,l=i.className,c=i.top,u=i.left,f=i.xAxis,d=i.yAxis,h=i.width,p=i.height,m=i.isAnimationActive,g=i.id;if(o||!s||!s.length)return null;var v=this.state.isAnimationFinished,y=s.length===1,x=ke("recharts-area",l),b=f&&f.allowDataOverflow,_=d&&d.allowDataOverflow,S=b||_,O=qt(g)?this.id:g,C=(r=jt(a,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},E=C.r,k=E===void 0?3:E,I=C.strokeWidth,P=I===void 0?2:I,R=Zpe(a)?a:{},T=R.clipDot,L=T===void 0?!0:T,z=k*2+P;return ue.createElement(Vn,{className:x},b||_?ue.createElement("defs",null,ue.createElement("clipPath",{id:"clipPath-".concat(O)},ue.createElement("rect",{x:b?u:u-h/2,y:_?c:c-p/2,width:b?h:h*2,height:_?p:p*2})),!L&&ue.createElement("clipPath",{id:"clipPath-dots-".concat(O)},ue.createElement("rect",{x:u-z/2,y:c-z/2,width:h+z,height:p+z}))):null,y?null:this.renderArea(S,O),(a||y)&&this.renderDots(S,L,O),(!m||v)&&tu.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,curBaseLine:r.baseLine,prevPoints:i.curPoints,prevBaseLine:i.curBaseLine}:r.points!==i.curPoints||r.baseLine!==i.curBaseLine?{curPoints:r.points,curBaseLine:r.baseLine}:null}}]),e}(M.PureComponent);Vve=Ed;Ll(Ed,"displayName","Area");Ll(Ed,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!ql.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});Ll(Ed,"getBaseValue",function(t,e,n,r){var i=t.layout,o=t.baseValue,a=e.props.baseValue,s=a??o;if(Ye(s)&&typeof s=="number")return s;var l=i==="horizontal"?r:n,c=l.scale.domain();if(l.type==="number"){var u=Math.max(c[0],c[1]),f=Math.min(c[0],c[1]);return s==="dataMin"?f:s==="dataMax"||u<0?u:Math.max(Math.min(c[0],c[1]),0)}return s==="dataMin"?c[0]:s==="dataMax"?c[1]:c[0]});Ll(Ed,"getComposedData",function(t){var e=t.props,n=t.item,r=t.xAxis,i=t.yAxis,o=t.xAxisTicks,a=t.yAxisTicks,s=t.bandSize,l=t.dataKey,c=t.stackedData,u=t.dataStartIndex,f=t.displayedData,d=t.offset,h=e.layout,p=c&&c.length,m=Vve.getBaseValue(e,n,r,i),g=h==="horizontal",v=!1,y=f.map(function(b,_){var S;p?S=c[u+_]:(S=ho(b,l),Array.isArray(S)?v=!0:S=[m,S]);var O=S[1]==null||p&&ho(b,l)==null;return g?{x:oP({axis:r,ticks:o,bandSize:s,entry:b,index:_}),y:O?null:i.scale(S[1]),value:S,payload:b}:{x:O?null:r.scale(S[1]),y:oP({axis:i,ticks:a,bandSize:s,entry:b,index:_}),value:S,payload:b}}),x;return p||v?x=y.map(function(b){var _=Array.isArray(b.value)?b.value[0]:null;return g?{x:b.x,y:_!=null&&b.y!=null?i.scale(_):null}:{x:_!=null?r.scale(_):null,y:b.y}}):x=g?i.scale(m):r.scale(m),Qu({points:y,baseLine:x,layout:h,isRange:v},d)});Ll(Ed,"renderDotItem",function(t,e){var n;if(ue.isValidElement(t))n=ue.cloneElement(t,e);else if(Bt(t))n=t(e);else{var r=ke("recharts-area-dot",typeof t!="boolean"?t.className:"");n=ue.createElement(xk,Sh({},e,{className:r}))}return n});function aF(){return aF=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function LFt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function $Ft(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function FK(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n0?a:e&&e.length&&Ye(i)&&Ye(o)?e.slice(i,o+1):[]};function eye(t){return t==="number"?[0,"auto"]:void 0}var dF=function(e,n,r,i){var o=e.graphicalItems,a=e.tooltipAxis,s=Sk(n,e);return r<0||!o||!o.length||r>=s.length?null:o.reduce(function(l,c){var u,f=(u=c.props.data)!==null&&u!==void 0?u:n;f&&e.dataStartIndex+e.dataEndIndex!==0&&(f=f.slice(e.dataStartIndex,e.dataEndIndex+1));var d;if(a.dataKey&&!a.allowDuplicatedCategory){var h=f===void 0?s:f;d=kE(h,a.dataKey,i)}else d=f&&f[r]||s[r];return d?[].concat(kv(l),[sve(c,d)]):l},[])},BK=function(e,n,r,i){var o=i||{x:e.chartX,y:e.chartY},a=qFt(o,r),s=e.orderedTooltipTicks,l=e.tooltipAxis,c=e.tooltipTicks,u=nRt(a,s,c,l);if(u>=0&&c){var f=c[u]&&c[u].value,d=dF(e,n,u,f),h=XFt(r,s,u,o);return{activeTooltipIndex:u,activeLabel:f,activePayload:d,activeCoordinate:h}}return null},QFt=function(e,n){var r=n.axes,i=n.graphicalItems,o=n.axisType,a=n.axisIdKey,s=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.layout,f=e.children,d=e.stackOffset,h=ive(u,o);return r.reduce(function(p,m){var g,v=m.props,y=v.type,x=v.dataKey,b=v.allowDataOverflow,_=v.allowDuplicatedCategory,S=v.scale,O=v.ticks,C=v.includeHidden,E=m.props[a];if(p[E])return p;var k=Sk(e.data,{graphicalItems:i.filter(function(D){return D.props[a]===E}),dataStartIndex:l,dataEndIndex:c}),I=k.length,P,R,T;SFt(m.props.domain,b,y)&&(P=DN(m.props.domain,null,b),h&&(y==="number"||S!=="auto")&&(T=rb(k,x,"category")));var L=eye(y);if(!P||P.length===0){var z,B=(z=m.props.domain)!==null&&z!==void 0?z:L;if(x){if(P=rb(k,x,y),y==="category"&&h){var W=ixt(P);_&&W?(R=P,P=mP(0,I)):_||(P=pY(B,P,m).reduce(function(D,A){return D.indexOf(A)>=0?D:[].concat(kv(D),[A])},[]))}else if(y==="category")_?P=P.filter(function(D){return D!==""&&!qt(D)}):P=pY(B,P,m).reduce(function(D,A){return D.indexOf(A)>=0||A===""||qt(A)?D:[].concat(kv(D),[A])},[]);else if(y==="number"){var U=sRt(k,i.filter(function(D){return D.props[a]===E&&(C||!D.props.hide)}),x,o,u);U&&(P=U)}h&&(y==="number"||S!=="auto")&&(T=rb(k,x,"category"))}else h?P=mP(0,I):s&&s[E]&&s[E].hasStack&&y==="number"?P=d==="expand"?[0,1]:ave(s[E].stackGroups,l,c):P=rve(k,i.filter(function(D){return D.props[a]===E&&(C||!D.props.hide)}),y,u,!0);if(y==="number")P=cF(f,P,E,o,O),B&&(P=DN(B,P,b));else if(y==="category"&&B){var N=B,$=P.every(function(D){return N.indexOf(D)>=0});$&&(P=N)}}return Be(Be({},p),{},Ct({},E,Be(Be({},m.props),{},{axisType:o,domain:P,categoricalDomain:T,duplicateDomain:R,originalDomain:(g=m.props.domain)!==null&&g!==void 0?g:L,isCategorical:h,layout:u})))},{})},YFt=function(e,n){var r=n.graphicalItems,i=n.Axis,o=n.axisType,a=n.axisIdKey,s=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.layout,f=e.children,d=Sk(e.data,{graphicalItems:r,dataStartIndex:l,dataEndIndex:c}),h=d.length,p=ive(u,o),m=-1;return r.reduce(function(g,v){var y=v.props[a],x=eye("number");if(!g[y]){m++;var b;return p?b=mP(0,h):s&&s[y]&&s[y].hasStack?(b=ave(s[y].stackGroups,l,c),b=cF(f,b,y,o)):(b=DN(x,rve(d,r.filter(function(_){return _.props[a]===y&&!_.props.hide}),"number",u),i.defaultProps.allowDataOverflow),b=cF(f,b,y,o)),Be(Be({},g),{},Ct({},y,Be(Be({axisType:o},i.defaultProps),{},{hide:!0,orientation:rs(GFt,"".concat(o,".").concat(m%2),null),domain:b,originalDomain:x,isCategorical:p,layout:u})))}return g},{})},KFt=function(e,n){var r=n.axisType,i=r===void 0?"xAxis":r,o=n.AxisComp,a=n.graphicalItems,s=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.children,f="".concat(i,"Id"),d=is(u,o),h={};return d&&d.length?h=QFt(e,{axes:d,graphicalItems:a,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:c}):a&&a.length&&(h=YFt(e,{Axis:o,graphicalItems:a,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:c})),h},ZFt=function(e){var n=ff(e),r=Hc(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:hU(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:aP(n,r)}},zK=function(e){var n=e.children,r=e.defaultShowTooltip,i=la(n,lp),o=0,a=0;return e.data&&e.data.length!==0&&(a=e.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(o=i.props.startIndex),i.props.endIndex>=0&&(a=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:a,activeTooltipIndex:-1,isTooltipActive:!!r}},JFt=function(e){return!e||!e.length?!1:e.some(function(n){var r=Zc(n&&n.type);return r&&r.indexOf("Bar")>=0})},UK=function(e){return e==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:e==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:e==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},ejt=function(e,n){var r=e.props,i=e.graphicalItems,o=e.xAxisMap,a=o===void 0?{}:o,s=e.yAxisMap,l=s===void 0?{}:s,c=r.width,u=r.height,f=r.children,d=r.margin||{},h=la(f,lp),p=la(f,gv),m=Object.keys(l).reduce(function(_,S){var O=l[S],C=O.orientation;return!O.mirror&&!O.hide?Be(Be({},_),{},Ct({},C,_[C]+O.width)):_},{left:d.left||0,right:d.right||0}),g=Object.keys(a).reduce(function(_,S){var O=a[S],C=O.orientation;return!O.mirror&&!O.hide?Be(Be({},_),{},Ct({},C,rs(_,"".concat(C))+O.height)):_},{top:d.top||0,bottom:d.bottom||0}),v=Be(Be({},g),m),y=v.bottom;h&&(v.bottom+=h.props.height||lp.defaultProps.height),p&&n&&(v=oRt(v,i,r,n));var x=c-v.left-v.right,b=u-v.top-v.bottom;return Be(Be({brushBottom:y},v),{},{width:Math.max(x,0),height:Math.max(b,0)})},YU=function(e){var n,r=e.chartName,i=e.GraphicalChild,o=e.defaultTooltipEventType,a=o===void 0?"axis":o,s=e.validateTooltipEventTypes,l=s===void 0?["axis"]:s,c=e.axisComponents,u=e.legendContent,f=e.formatAxisMap,d=e.defaultProps,h=function(g,v){var y=v.graphicalItems,x=v.stackGroups,b=v.offset,_=v.updateId,S=v.dataStartIndex,O=v.dataEndIndex,C=g.barSize,E=g.layout,k=g.barGap,I=g.barCategoryGap,P=g.maxBarSize,R=UK(E),T=R.numericAxisName,L=R.cateAxisName,z=JFt(y),B=z&&rRt({barSize:C,stackGroups:x}),W=[];return y.forEach(function(U,N){var $=Sk(g.data,{graphicalItems:[U],dataStartIndex:S,dataEndIndex:O}),D=U.props,A=D.dataKey,q=D.maxBarSize,Y=U.props["".concat(T,"Id")],K=U.props["".concat(L,"Id")],se={},te=c.reduce(function(ge,ye){var H=v["".concat(ye.axisType,"Map")],G=U.props["".concat(ye.axisType,"Id")];H&&H[G]||ye.axisType==="zAxis"||sp(!1);var ie=H[G];return Be(Be({},ge),{},Ct(Ct({},ye.axisType,ie),"".concat(ye.axisType,"Ticks"),Hc(ie)))},se),J=te[L],pe=te["".concat(L,"Ticks")],be=x&&x[Y]&&x[Y].hasStack&&xRt(U,x[Y].stackGroups),re=Zc(U.type).indexOf("Bar")>=0,ve=aP(J,pe),F=[];if(re){var ce,le,Q=qt(q)?P:q,X=(ce=(le=aP(J,pe,!0))!==null&&le!==void 0?le:Q)!==null&&ce!==void 0?ce:0;F=iRt({barGap:k,barCategoryGap:I,bandSize:X!==ve?X:ve,sizeList:B[K],maxBarSize:Q}),X!==ve&&(F=F.map(function(ge){return Be(Be({},ge),{},{position:Be(Be({},ge.position),{},{offset:ge.position.offset-X/2})})}))}var ee=U&&U.type&&U.type.getComposedData;ee&&W.push({props:Be(Be({},ee(Be(Be({},te),{},{displayedData:$,props:g,dataKey:A,item:U,bandSize:ve,barPosition:F,offset:b,stackedData:be,layout:E,dataStartIndex:S,dataEndIndex:O}))),{},Ct(Ct(Ct({key:U.key||"item-".concat(N)},T,te[T]),L,te[L]),"animationId",_)),childIndex:mxt(U,g.children),item:U})}),W},p=function(g,v){var y=g.props,x=g.dataStartIndex,b=g.dataEndIndex,_=g.updateId;if(!oX({props:y}))return null;var S=y.children,O=y.layout,C=y.stackOffset,E=y.data,k=y.reverseStackOrder,I=UK(O),P=I.numericAxisName,R=I.cateAxisName,T=is(S,i),L=gRt(E,T,"".concat(P,"Id"),"".concat(R,"Id"),C,k),z=c.reduce(function($,D){var A="".concat(D.axisType,"Map");return Be(Be({},$),{},Ct({},A,KFt(y,Be(Be({},D),{},{graphicalItems:T,stackGroups:D.axisType===P&&L,dataStartIndex:x,dataEndIndex:b}))))},{}),B=ejt(Be(Be({},z),{},{props:y,graphicalItems:T}),v==null?void 0:v.legendBBox);Object.keys(z).forEach(function($){z[$]=f(y,z[$],B,$.replace("Map",""),r)});var W=z["".concat(R,"Map")],U=ZFt(W),N=h(y,Be(Be({},z),{},{dataStartIndex:x,dataEndIndex:b,updateId:_,graphicalItems:T,stackGroups:L,offset:B}));return Be(Be({formattedGraphicalItems:N,graphicalItems:T,offset:B,stackGroups:L},U),z)};return n=function(m){BFt(g,m);function g(v){var y,x,b;return $Ft(this,g),b=FFt(this,g,[v]),Ct(on(b),"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Ct(on(b),"accessibilityManager",new wFt),Ct(on(b),"handleLegendBBoxUpdate",function(_){if(_){var S=b.state,O=S.dataStartIndex,C=S.dataEndIndex,E=S.updateId;b.setState(Be({legendBBox:_},p({props:b.props,dataStartIndex:O,dataEndIndex:C,updateId:E},Be(Be({},b.state),{},{legendBBox:_}))))}}),Ct(on(b),"handleReceiveSyncEvent",function(_,S,O){if(b.props.syncId===_){if(O===b.eventEmitterSymbol&&typeof b.props.syncMethod!="function")return;b.applySyncEvent(S)}}),Ct(on(b),"handleBrushChange",function(_){var S=_.startIndex,O=_.endIndex;if(S!==b.state.dataStartIndex||O!==b.state.dataEndIndex){var C=b.state.updateId;b.setState(function(){return Be({dataStartIndex:S,dataEndIndex:O},p({props:b.props,dataStartIndex:S,dataEndIndex:O,updateId:C},b.state))}),b.triggerSyncEvent({dataStartIndex:S,dataEndIndex:O})}}),Ct(on(b),"handleMouseEnter",function(_){var S=b.getMouseInfo(_);if(S){var O=Be(Be({},S),{},{isTooltipActive:!0});b.setState(O),b.triggerSyncEvent(O);var C=b.props.onMouseEnter;Bt(C)&&C(O,_)}}),Ct(on(b),"triggeredAfterMouseMove",function(_){var S=b.getMouseInfo(_),O=S?Be(Be({},S),{},{isTooltipActive:!0}):{isTooltipActive:!1};b.setState(O),b.triggerSyncEvent(O);var C=b.props.onMouseMove;Bt(C)&&C(O,_)}),Ct(on(b),"handleItemMouseEnter",function(_){b.setState(function(){return{isTooltipActive:!0,activeItem:_,activePayload:_.tooltipPayload,activeCoordinate:_.tooltipPosition||{x:_.cx,y:_.cy}}})}),Ct(on(b),"handleItemMouseLeave",function(){b.setState(function(){return{isTooltipActive:!1}})}),Ct(on(b),"handleMouseMove",function(_){_.persist(),b.throttleTriggeredAfterMouseMove(_)}),Ct(on(b),"handleMouseLeave",function(_){b.throttleTriggeredAfterMouseMove.cancel();var S={isTooltipActive:!1};b.setState(S),b.triggerSyncEvent(S);var O=b.props.onMouseLeave;Bt(O)&&O(S,_)}),Ct(on(b),"handleOuterEvent",function(_){var S=pxt(_),O=rs(b.props,"".concat(S));if(S&&Bt(O)){var C,E;/.*touch.*/i.test(S)?E=b.getMouseInfo(_.changedTouches[0]):E=b.getMouseInfo(_),O((C=E)!==null&&C!==void 0?C:{},_)}}),Ct(on(b),"handleClick",function(_){var S=b.getMouseInfo(_);if(S){var O=Be(Be({},S),{},{isTooltipActive:!0});b.setState(O),b.triggerSyncEvent(O);var C=b.props.onClick;Bt(C)&&C(O,_)}}),Ct(on(b),"handleMouseDown",function(_){var S=b.props.onMouseDown;if(Bt(S)){var O=b.getMouseInfo(_);S(O,_)}}),Ct(on(b),"handleMouseUp",function(_){var S=b.props.onMouseUp;if(Bt(S)){var O=b.getMouseInfo(_);S(O,_)}}),Ct(on(b),"handleTouchMove",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&b.throttleTriggeredAfterMouseMove(_.changedTouches[0])}),Ct(on(b),"handleTouchStart",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&b.handleMouseDown(_.changedTouches[0])}),Ct(on(b),"handleTouchEnd",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&b.handleMouseUp(_.changedTouches[0])}),Ct(on(b),"triggerSyncEvent",function(_){b.props.syncId!==void 0&&MI.emit(kI,b.props.syncId,_,b.eventEmitterSymbol)}),Ct(on(b),"applySyncEvent",function(_){var S=b.props,O=S.layout,C=S.syncMethod,E=b.state.updateId,k=_.dataStartIndex,I=_.dataEndIndex;if(_.dataStartIndex!==void 0||_.dataEndIndex!==void 0)b.setState(Be({dataStartIndex:k,dataEndIndex:I},p({props:b.props,dataStartIndex:k,dataEndIndex:I,updateId:E},b.state)));else if(_.activeTooltipIndex!==void 0){var P=_.chartX,R=_.chartY,T=_.activeTooltipIndex,L=b.state,z=L.offset,B=L.tooltipTicks;if(!z)return;if(typeof C=="function")T=C(B,_);else if(C==="value"){T=-1;for(var W=0;W=0){var pe,be;if(P.dataKey&&!P.allowDuplicatedCategory){var re=typeof P.dataKey=="function"?J:"payload.".concat(P.dataKey.toString());pe=kE(W,re,T),be=U&&N&&kE(N,re,T)}else pe=W==null?void 0:W[R],be=U&&N&&N[R];if(Y||q){var ve=_.props.activeIndex!==void 0?_.props.activeIndex:R;return[M.cloneElement(_,Be(Be(Be({},C.props),se),{},{activeIndex:ve})),null,null]}if(!qt(pe))return[te].concat(kv(b.renderActivePoints({item:C,activePoint:pe,basePoint:be,childIndex:R,isRange:U})))}else{var F,ce=(F=b.getItemByXY(b.state.activeCoordinate))!==null&&F!==void 0?F:{graphicalItem:te},le=ce.graphicalItem,Q=le.item,X=Q===void 0?_:Q,ee=le.childIndex,ge=Be(Be(Be({},C.props),se),{},{activeIndex:ee});return[M.cloneElement(X,ge),null,null]}return U?[te,null,null]:[te,null]}),Ct(on(b),"renderCustomized",function(_,S,O){return M.cloneElement(_,Be(Be({key:"recharts-customized-".concat(O)},b.props),b.state))}),Ct(on(b),"renderMap",{CartesianGrid:{handler:_O,once:!0},ReferenceArea:{handler:b.renderReferenceElement},ReferenceLine:{handler:_O},ReferenceDot:{handler:b.renderReferenceElement},XAxis:{handler:_O},YAxis:{handler:_O},Brush:{handler:b.renderBrush,once:!0},Bar:{handler:b.renderGraphicChild},Line:{handler:b.renderGraphicChild},Area:{handler:b.renderGraphicChild},Radar:{handler:b.renderGraphicChild},RadialBar:{handler:b.renderGraphicChild},Scatter:{handler:b.renderGraphicChild},Pie:{handler:b.renderGraphicChild},Funnel:{handler:b.renderGraphicChild},Tooltip:{handler:b.renderCursor,once:!0},PolarGrid:{handler:b.renderPolarGrid,once:!0},PolarAngleAxis:{handler:b.renderPolarAxis},PolarRadiusAxis:{handler:b.renderPolarAxis},Customized:{handler:b.renderCustomized}}),b.clipPathId="".concat((y=v.id)!==null&&y!==void 0?y:Ly("recharts"),"-clip"),b.throttleTriggeredAfterMouseMove=nge(b.triggeredAfterMouseMove,(x=v.throttleDelay)!==null&&x!==void 0?x:1e3/60),b.state={},b}return NFt(g,[{key:"componentDidMount",value:function(){var y,x;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(y=this.props.margin.left)!==null&&y!==void 0?y:0,top:(x=this.props.margin.top)!==null&&x!==void 0?x:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var y=this.props,x=y.children,b=y.data,_=y.height,S=y.layout,O=la(x,ml);if(O){var C=O.props.defaultIndex;if(!(typeof C!="number"||C<0||C>this.state.tooltipTicks.length)){var E=this.state.tooltipTicks[C]&&this.state.tooltipTicks[C].value,k=dF(this.state,b,C,E),I=this.state.tooltipTicks[C].coordinate,P=(this.state.offset.top+_)/2,R=S==="horizontal",T=R?{x:I,y:P}:{y:I,x:P},L=this.state.formattedGraphicalItems.find(function(B){var W=B.item;return W.type.name==="Scatter"});L&&(T=Be(Be({},T),L.props.points[C].tooltipPosition),k=L.props.points[C].tooltipPayload);var z={activeTooltipIndex:C,isTooltipActive:!0,activeLabel:E,activePayload:k,activeCoordinate:T};this.setState(z),this.renderCursor(O),this.accessibilityManager.setIndex(C)}}}},{key:"getSnapshotBeforeUpdate",value:function(y,x){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==x.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==y.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==y.margin){var b,_;this.accessibilityManager.setDetails({offset:{left:(b=this.props.margin.left)!==null&&b!==void 0?b:0,top:(_=this.props.margin.top)!==null&&_!==void 0?_:0}})}return null}},{key:"componentDidUpdate",value:function(y){K3([la(y.children,ml)],[la(this.props.children,ml)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var y=la(this.props.children,ml);if(y&&typeof y.props.shared=="boolean"){var x=y.props.shared?"axis":"item";return l.indexOf(x)>=0?x:a}return a}},{key:"getMouseInfo",value:function(y){if(!this.container)return null;var x=this.container,b=x.getBoundingClientRect(),_=$Pt(b),S={chartX:Math.round(y.pageX-_.left),chartY:Math.round(y.pageY-_.top)},O=b.width/x.offsetWidth||1,C=this.inRange(S.chartX,S.chartY,O);if(!C)return null;var E=this.state,k=E.xAxisMap,I=E.yAxisMap,P=this.getTooltipEventType();if(P!=="axis"&&k&&I){var R=ff(k).scale,T=ff(I).scale,L=R&&R.invert?R.invert(S.chartX):null,z=T&&T.invert?T.invert(S.chartY):null;return Be(Be({},S),{},{xValue:L,yValue:z})}var B=BK(this.state,this.props.data,this.props.layout,C);return B?Be(Be({},S),B):null}},{key:"inRange",value:function(y,x){var b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,_=this.props.layout,S=y/b,O=x/b;if(_==="horizontal"||_==="vertical"){var C=this.state.offset,E=S>=C.left&&S<=C.left+C.width&&O>=C.top&&O<=C.top+C.height;return E?{x:S,y:O}:null}var k=this.state,I=k.angleAxisMap,P=k.radiusAxisMap;if(I&&P){var R=ff(I);return vY({x:S,y:O},R)}return null}},{key:"parseEventsOfWrapper",value:function(){var y=this.props.children,x=this.getTooltipEventType(),b=la(y,ml),_={};b&&x==="axis"&&(b.props.trigger==="click"?_={onClick:this.handleClick}:_={onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd});var S=AE(this.props,this.handleOuterEvent);return Be(Be({},S),_)}},{key:"addListener",value:function(){MI.on(kI,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){MI.removeListener(kI,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(y,x,b){for(var _=this.state.formattedGraphicalItems,S=0,O=_.length;S!En(t)||!Number.isFinite(t)?"":Gb(t),ojt=t=>t.toPrecision(3),RI={legendContainer:{display:"flex",justifyContent:"center",columnGap:"12px",flexWrap:"wrap"},legendItem:{display:"flex",alignItems:"center"},legendCloseIcon:{marginLeft:"4px",cursor:"pointer",display:"flex",alignItems:"center"}};function ajt({payload:t,removeTimeSeries:e}){return!t||t.length===0?null:w.jsx(Ke,{sx:RI.legendContainer,children:t.map((n,r)=>w.jsxs(Ke,{sx:{...RI.legendItem,color:n.color},children:[w.jsx("span",{children:n.value}),e&&w.jsx(Ke,{component:"span",sx:RI.legendCloseIcon,onMouseUp:()=>e(r),children:w.jsx(nw,{fontSize:"small"})})]},n.value))})}const II={toolTipContainer:t=>({backgroundColor:"black",opacity:.8,color:"white",border:"2px solid black",borderRadius:t.spacing(2),padding:t.spacing(1.5)}),toolTipValue:{fontWeight:"bold"},toolTipLabel:t=>({fontWeight:"bold",paddingBottom:t.spacing(1)})},sjt="#00000000",ljt="#FAFFDD";function cjt({active:t,label:e,payload:n}){if(!t||!En(e)||!n||n.length===0)return null;const r=n.map((i,o)=>{const{name:a,value:s,unit:l,dataKey:c}=i;let u=i.color;if(!En(s))return null;const f=a||"?",d=s.toFixed(3);u===sjt&&(u=ljt);let p=f.indexOf(":")!==-1?"":` (${c})`;return typeof l=="string"&&(p!==""?p=`${l} ${p}`:p=l),w.jsxs("div",{children:[w.jsxs("span",{children:[f,": "]}),w.jsx(Ke,{component:"span",sx:II.toolTipValue,style:{color:u},children:d}),w.jsxs("span",{children:[" ",p]})]},o)});return r?w.jsxs(Ke,{sx:II.toolTipContainer,children:[w.jsx(Ke,{component:"span",sx:II.toolTipLabel,children:`${dy(e)} UTC`}),r]}):null}function WK({cx:t,cy:e,radius:n,stroke:r,fill:i,strokeWidth:o,symbol:a}){const l=n+.5*o,c=2*l,u=Math.floor(100*o/c+.5)+"%";let f;if(a==="diamond"){const m=1024*(n/c);f=w.jsx("polygon",{points:`${512-m},512 512,${512-m} ${512+m},512 512,${512+m}`,strokeWidth:u,stroke:r,fill:i})}else{const d=Math.floor(100*n/c+.5)+"%";f=w.jsx("circle",{cx:"50%",cy:"50%",r:d,strokeWidth:u,stroke:r,fill:i})}return En(t)&&En(e)?w.jsx("svg",{x:t-l,y:e-l,width:c,height:c,viewBox:"0 0 1024 1024",children:f}):null}function ujt({timeSeriesGroup:t,timeSeriesIndex:e,selectTimeSeries:n,places:r,selectPlace:i,placeInfos:o,placeGroupTimeSeries:a,paletteMode:s,chartType:l,stdevBars:c}){const u=t.timeSeriesArray[e],f=u.source,d=()=>{n&&n(t.id,e,u),i(u.source.placeId,r,!0)};let h=f.variableName,p="red";if(f.placeId===null){h=`${f.datasetTitle}/${h}`;let x=null;a.forEach(b=>{if(x===null&&b.placeGroup.id===f.datasetId){const _=b.placeGroup.features;_.length>0&&_[0].properties&&(x=_[0].properties.color||null)}}),p=x||"red"}else if(o){const x=o[f.placeId];if(x){const{place:b,label:_,color:S}=x;if(b.geometry.type==="Point"){const O=b.geometry.coordinates[0],C=b.geometry.coordinates[1];h+=` (${_}: ${C.toFixed(5)},${O.toFixed(5)})`}else h+=` (${_})`;p=S}}const m=gie(p,s);let g,v;u.source.placeId===null?(g=0,v={radius:5,strokeWidth:1.5,symbol:"diamond"}):(g=l==="point"?0:u.dataProgress,v={radius:3,strokeWidth:2,symbol:"circle"});const y=c&&f.valueDataKey&&f.errorDataKey&&w.jsx(Uy,{dataKey:`ev${e}`,width:4,strokeWidth:1,stroke:m,strokeOpacity:.5});return l==="bar"?w.jsx(Lp,{type:"monotone",name:h,unit:f.variableUnits,dataKey:`v${e}`,fill:m,fillOpacity:g,isAnimationActive:!1,onClick:d,children:y},e):w.jsx(Ew,{type:"monotone",name:h,unit:f.variableUnits,dataKey:`v${e}`,dot:w.jsx(WK,{...v,stroke:m,fill:"white"}),activeDot:w.jsx(WK,{...v,stroke:"white",fill:m}),stroke:m,strokeOpacity:g,isAnimationActive:!1,onClick:d,children:y},e)}var KU={},fjt=ct;Object.defineProperty(KU,"__esModule",{value:!0});var tye=KU.default=void 0,djt=fjt(pt()),hjt=w;tye=KU.default=(0,djt.default)((0,hjt.jsx)("path",{d:"M19 12h-2v3h-3v2h5zM7 9h3V7H5v5h2zm14-6H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16.01H3V4.99h18z"}),"AspectRatio");var ZU={},pjt=ct;Object.defineProperty(ZU,"__esModule",{value:!0});var nye=ZU.default=void 0,mjt=pjt(pt()),gjt=w;nye=ZU.default=(0,mjt.default)((0,gjt.jsx)("path",{d:"M4 9h4v11H4zm12 4h4v7h-4zm-6-9h4v16h-4z"}),"BarChart");var JU={},vjt=ct;Object.defineProperty(JU,"__esModule",{value:!0});var rye=JU.default=void 0,yjt=vjt(pt()),xjt=w;rye=JU.default=(0,yjt.default)((0,xjt.jsx)("path",{d:"M21.99 4c0-1.1-.89-2-1.99-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h14l4 4zM18 14H6v-2h12zm0-3H6V9h12zm0-3H6V6h12z"}),"Comment");var e6={},bjt=ct;Object.defineProperty(e6,"__esModule",{value:!0});var iye=e6.default=void 0,_jt=bjt(pt()),wjt=w;iye=e6.default=(0,_jt.default)((0,wjt.jsx)("path",{d:"M4 20h16v2H4zM4 2h16v2H4zm9 7h3l-4-4-4 4h3v6H8l4 4 4-4h-3z"}),"Expand");var t6={},Sjt=ct;Object.defineProperty(t6,"__esModule",{value:!0});var oye=t6.default=void 0,Ojt=Sjt(pt()),Cjt=w;oye=t6.default=(0,Ojt.default)((0,Cjt.jsx)("path",{d:"M17 4h3c1.1 0 2 .9 2 2v2h-2V6h-3zM4 8V6h3V4H4c-1.1 0-2 .9-2 2v2zm16 8v2h-3v2h3c1.1 0 2-.9 2-2v-2zM7 18H4v-2H2v2c0 1.1.9 2 2 2h3zM18 8H6v8h12z"}),"FitScreen");var n6={},Tjt=ct;Object.defineProperty(n6,"__esModule",{value:!0});var r6=n6.default=void 0,Ejt=Tjt(pt()),Pjt=w;r6=n6.default=(0,Ejt.default)((0,Pjt.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2M5.5 7.5h2v-2H9v2h2V9H9v2H7.5V9h-2zM19 19H5L19 5zm-2-2v-1.5h-5V17z"}),"Iso");var i6={},Mjt=ct;Object.defineProperty(i6,"__esModule",{value:!0});var aye=i6.default=void 0,kjt=Mjt(pt()),DI=w;aye=i6.default=(0,kjt.default)([(0,DI.jsx)("circle",{cx:"7",cy:"14",r:"3"},"0"),(0,DI.jsx)("circle",{cx:"11",cy:"6",r:"3"},"1"),(0,DI.jsx)("circle",{cx:"16.6",cy:"17.6",r:"3"},"2")],"ScatterPlot");var o6={},Ajt=ct;Object.defineProperty(o6,"__esModule",{value:!0});var sye=o6.default=void 0,Rjt=Ajt(pt()),Ijt=w;sye=o6.default=(0,Rjt.default)((0,Ijt.jsx)("path",{d:"m3.5 18.49 6-6.01 4 4L22 6.92l-1.41-1.41-7.09 7.97-4-4L2 16.99z"}),"ShowChart");var a6={},Djt=ct;Object.defineProperty(a6,"__esModule",{value:!0});var lye=a6.default=void 0,Ljt=Djt(pt()),VK=w;lye=a6.default=(0,Ljt.default)([(0,VK.jsx)("circle",{cx:"12",cy:"12",r:"3.2"},"0"),(0,VK.jsx)("path",{d:"M9 2 7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5"},"1")],"CameraAlt");function $jt(t,e){if(t.match(/^[a-z]+:\/\//i))return t;if(t.match(/^\/\//))return window.location.protocol+t;if(t.match(/^[a-z]+:/i))return t;const n=document.implementation.createHTMLDocument(),r=n.createElement("base"),i=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(i),e&&(r.href=e),i.href=t,i.href}const Njt=(()=>{let t=0;const e=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${e()}${t}`)})();function nu(t){const e=[];for(let n=0,r=t.length;nKo||t.height>Ko)&&(t.width>Ko&&t.height>Ko?t.width>t.height?(t.height*=Ko/t.width,t.width=Ko):(t.width*=Ko/t.height,t.height=Ko):t.width>Ko?(t.height*=Ko/t.width,t.width=Ko):(t.width*=Ko/t.height,t.height=Ko))}function TP(t){return new Promise((e,n)=>{const r=new Image;r.decode=()=>e(r),r.onload=()=>e(r),r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=t})}async function Ujt(t){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(t)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}async function Wjt(t,e,n){const r="http://www.w3.org/2000/svg",i=document.createElementNS(r,"svg"),o=document.createElementNS(r,"foreignObject");return i.setAttribute("width",`${e}`),i.setAttribute("height",`${n}`),i.setAttribute("viewBox",`0 0 ${e} ${n}`),o.setAttribute("width","100%"),o.setAttribute("height","100%"),o.setAttribute("x","0"),o.setAttribute("y","0"),o.setAttribute("externalResourcesRequired","true"),i.appendChild(o),o.appendChild(t),Ujt(i)}const jo=(t,e)=>{if(t instanceof e)return!0;const n=Object.getPrototypeOf(t);return n===null?!1:n.constructor.name===e.name||jo(n,e)};function Vjt(t){const e=t.getPropertyValue("content");return`${t.cssText} content: '${e.replace(/'|"/g,"")}';`}function Gjt(t){return nu(t).map(e=>{const n=t.getPropertyValue(e),r=t.getPropertyPriority(e);return`${e}: ${n}${r?" !important":""};`}).join(" ")}function Hjt(t,e,n){const r=`.${t}:${e}`,i=n.cssText?Vjt(n):Gjt(n);return document.createTextNode(`${r}{${i}}`)}function GK(t,e,n){const r=window.getComputedStyle(t,n),i=r.getPropertyValue("content");if(i===""||i==="none")return;const o=Njt();try{e.className=`${e.className} ${o}`}catch{return}const a=document.createElement("style");a.appendChild(Hjt(o,n,r)),e.appendChild(a)}function qjt(t,e){GK(t,e,":before"),GK(t,e,":after")}const HK="application/font-woff",qK="image/jpeg",Xjt={woff:HK,woff2:HK,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:qK,jpeg:qK,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Qjt(t){const e=/\.([^./]*?)$/g.exec(t);return e?e[1]:""}function s6(t){const e=Qjt(t).toLowerCase();return Xjt[e]||""}function Yjt(t){return t.split(/,/)[1]}function hF(t){return t.search(/^(data:)/)!==-1}function uye(t,e){return`data:${e};base64,${t}`}async function fye(t,e,n){const r=await fetch(t,e);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const i=await r.blob();return new Promise((o,a)=>{const s=new FileReader;s.onerror=a,s.onloadend=()=>{try{o(n({res:r,result:s.result}))}catch(l){a(l)}},s.readAsDataURL(i)})}const LI={};function Kjt(t,e,n){let r=t.replace(/\?.*/,"");return n&&(r=t),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),e?`[${e}]${r}`:r}async function l6(t,e,n){const r=Kjt(t,e,n.includeQueryParams);if(LI[r]!=null)return LI[r];n.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+new Date().getTime());let i;try{const o=await fye(t,n.fetchRequestInit,({res:a,result:s})=>(e||(e=a.headers.get("Content-Type")||""),Yjt(s)));i=uye(o,e)}catch(o){i=n.imagePlaceholder||"";let a=`Failed to fetch resource: ${t}`;o&&(a=typeof o=="string"?o:o.message),a&&console.warn(a)}return LI[r]=i,i}async function Zjt(t){const e=t.toDataURL();return e==="data:,"?t.cloneNode(!1):TP(e)}async function Jjt(t,e){if(t.currentSrc){const o=document.createElement("canvas"),a=o.getContext("2d");o.width=t.clientWidth,o.height=t.clientHeight,a==null||a.drawImage(t,0,0,o.width,o.height);const s=o.toDataURL();return TP(s)}const n=t.poster,r=s6(n),i=await l6(n,r,e);return TP(i)}async function e5t(t){var e;try{if(!((e=t==null?void 0:t.contentDocument)===null||e===void 0)&&e.body)return await Ok(t.contentDocument.body,{},!0)}catch{}return t.cloneNode(!1)}async function t5t(t,e){return jo(t,HTMLCanvasElement)?Zjt(t):jo(t,HTMLVideoElement)?Jjt(t,e):jo(t,HTMLIFrameElement)?e5t(t):t.cloneNode(!1)}const n5t=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SLOT";async function r5t(t,e,n){var r,i;let o=[];return n5t(t)&&t.assignedNodes?o=nu(t.assignedNodes()):jo(t,HTMLIFrameElement)&&(!((r=t.contentDocument)===null||r===void 0)&&r.body)?o=nu(t.contentDocument.body.childNodes):o=nu(((i=t.shadowRoot)!==null&&i!==void 0?i:t).childNodes),o.length===0||jo(t,HTMLVideoElement)||await o.reduce((a,s)=>a.then(()=>Ok(s,n)).then(l=>{l&&e.appendChild(l)}),Promise.resolve()),e}function i5t(t,e){const n=e.style;if(!n)return;const r=window.getComputedStyle(t);r.cssText?(n.cssText=r.cssText,n.transformOrigin=r.transformOrigin):nu(r).forEach(i=>{let o=r.getPropertyValue(i);i==="font-size"&&o.endsWith("px")&&(o=`${Math.floor(parseFloat(o.substring(0,o.length-2)))-.1}px`),jo(t,HTMLIFrameElement)&&i==="display"&&o==="inline"&&(o="block"),i==="d"&&e.getAttribute("d")&&(o=`path(${e.getAttribute("d")})`),n.setProperty(i,o,r.getPropertyPriority(i))})}function o5t(t,e){jo(t,HTMLTextAreaElement)&&(e.innerHTML=t.value),jo(t,HTMLInputElement)&&e.setAttribute("value",t.value)}function a5t(t,e){if(jo(t,HTMLSelectElement)){const n=e,r=Array.from(n.children).find(i=>t.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function s5t(t,e){return jo(e,Element)&&(i5t(t,e),qjt(t,e),o5t(t,e),a5t(t,e)),e}async function l5t(t,e){const n=t.querySelectorAll?t.querySelectorAll("use"):[];if(n.length===0)return t;const r={};for(let o=0;ot5t(r,e)).then(r=>r5t(t,r,e)).then(r=>s5t(t,r)).then(r=>l5t(r,e))}const dye=/url\((['"]?)([^'"]+?)\1\)/g,c5t=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,u5t=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function f5t(t){const e=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}function d5t(t){const e=[];return t.replace(dye,(n,r,i)=>(e.push(i),n)),e.filter(n=>!hF(n))}async function h5t(t,e,n,r,i){try{const o=n?$jt(e,n):e,a=s6(e);let s;if(i){const l=await i(o);s=uye(l,a)}else s=await l6(o,a,r);return t.replace(f5t(e),`$1${s}$3`)}catch{}return t}function p5t(t,{preferredFontFormat:e}){return e?t.replace(u5t,n=>{for(;;){const[r,,i]=c5t.exec(n)||[];if(!i)return"";if(i===e)return`src: ${r};`}}):t}function hye(t){return t.search(dye)!==-1}async function pye(t,e,n){if(!hye(t))return t;const r=p5t(t,n);return d5t(r).reduce((o,a)=>o.then(s=>h5t(s,a,e,n)),Promise.resolve(r))}async function wO(t,e,n){var r;const i=(r=e.style)===null||r===void 0?void 0:r.getPropertyValue(t);if(i){const o=await pye(i,null,n);return e.style.setProperty(t,o,e.style.getPropertyPriority(t)),!0}return!1}async function m5t(t,e){await wO("background",t,e)||await wO("background-image",t,e),await wO("mask",t,e)||await wO("mask-image",t,e)}async function g5t(t,e){const n=jo(t,HTMLImageElement);if(!(n&&!hF(t.src))&&!(jo(t,SVGImageElement)&&!hF(t.href.baseVal)))return;const r=n?t.src:t.href.baseVal,i=await l6(r,s6(r),e);await new Promise((o,a)=>{t.onload=o,t.onerror=a;const s=t;s.decode&&(s.decode=o),s.loading==="lazy"&&(s.loading="eager"),n?(t.srcset="",t.src=i):t.href.baseVal=i})}async function v5t(t,e){const r=nu(t.childNodes).map(i=>mye(i,e));await Promise.all(r).then(()=>t)}async function mye(t,e){jo(t,Element)&&(await m5t(t,e),await g5t(t,e),await v5t(t,e))}function y5t(t,e){const{style:n}=t;e.backgroundColor&&(n.backgroundColor=e.backgroundColor),e.width&&(n.width=`${e.width}px`),e.height&&(n.height=`${e.height}px`);const r=e.style;return r!=null&&Object.keys(r).forEach(i=>{n[i]=r[i]}),t}const XK={};async function QK(t){let e=XK[t];if(e!=null)return e;const r=await(await fetch(t)).text();return e={url:t,cssText:r},XK[t]=e,e}async function YK(t,e){let n=t.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,o=(n.match(/url\([^)]+\)/g)||[]).map(async a=>{let s=a.replace(r,"$1");return s.startsWith("https://")||(s=new URL(s,t.url).href),fye(s,e.fetchRequestInit,({result:l})=>(n=n.replace(a,`url(${l})`),[a,l]))});return Promise.all(o).then(()=>n)}function KK(t){if(t==null)return[];const e=[],n=/(\/\*[\s\S]*?\*\/)/gi;let r=t.replace(n,"");const i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const l=i.exec(r);if(l===null)break;e.push(l[0])}r=r.replace(i,"");const o=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,a="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",s=new RegExp(a,"gi");for(;;){let l=o.exec(r);if(l===null){if(l=s.exec(r),l===null)break;o.lastIndex=s.lastIndex}else s.lastIndex=o.lastIndex;e.push(l[0])}return e}async function x5t(t,e){const n=[],r=[];return t.forEach(i=>{if("cssRules"in i)try{nu(i.cssRules||[]).forEach((o,a)=>{if(o.type===CSSRule.IMPORT_RULE){let s=a+1;const l=o.href,c=QK(l).then(u=>YK(u,e)).then(u=>KK(u).forEach(f=>{try{i.insertRule(f,f.startsWith("@import")?s+=1:i.cssRules.length)}catch(d){console.error("Error inserting rule from remote css",{rule:f,error:d})}})).catch(u=>{console.error("Error loading remote css",u.toString())});r.push(c)}})}catch(o){const a=t.find(s=>s.href==null)||document.styleSheets[0];i.href!=null&&r.push(QK(i.href).then(s=>YK(s,e)).then(s=>KK(s).forEach(l=>{a.insertRule(l,i.cssRules.length)})).catch(s=>{console.error("Error loading remote stylesheet",s)})),console.error("Error inlining remote css file",o)}}),Promise.all(r).then(()=>(t.forEach(i=>{if("cssRules"in i)try{nu(i.cssRules||[]).forEach(o=>{n.push(o)})}catch(o){console.error(`Error while reading CSS rules from ${i.href}`,o)}}),n))}function b5t(t){return t.filter(e=>e.type===CSSRule.FONT_FACE_RULE).filter(e=>hye(e.style.getPropertyValue("src")))}async function _5t(t,e){if(t.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=nu(t.ownerDocument.styleSheets),r=await x5t(n,e);return b5t(r)}async function w5t(t,e){const n=await _5t(t,e);return(await Promise.all(n.map(i=>{const o=i.parentStyleSheet?i.parentStyleSheet.href:null;return pye(i.cssText,o,e)}))).join(` +`)}async function S5t(t,e){const n=e.fontEmbedCSS!=null?e.fontEmbedCSS:e.skipFonts?null:await w5t(t,e);if(n){const r=document.createElement("style"),i=document.createTextNode(n);r.appendChild(i),t.firstChild?t.insertBefore(r,t.firstChild):t.appendChild(r)}}async function O5t(t,e={}){const{width:n,height:r}=cye(t,e),i=await Ok(t,e,!0);return await S5t(i,e),await mye(i,e),y5t(i,e),await Wjt(i,n,r)}async function gye(t,e={}){const{width:n,height:r}=cye(t,e),i=await O5t(t,e),o=await TP(i),a=document.createElement("canvas"),s=a.getContext("2d"),l=e.pixelRatio||Bjt(),c=e.canvasWidth||n,u=e.canvasHeight||r;return a.width=c*l,a.height=u*l,e.skipAutoScale||zjt(a),a.style.width=`${c}`,a.style.height=`${u}`,e.backgroundColor&&(s.fillStyle=e.backgroundColor,s.fillRect(0,0,a.width,a.height)),s.drawImage(o,0,0,a.width,a.height),a}async function C5t(t,e={}){return(await gye(t,e)).toDataURL()}async function T5t(t,e={}){return(await gye(t,e)).toDataURL("image/jpeg",e.quality||1)}const ZK={png:C5t,jpeg:T5t};function E5t(t,e){P5t(t,e).then(()=>{e!=null&&e.handleSuccess&&e.handleSuccess()}).catch(n=>{if(e!=null&&e.handleError)e.handleError(n);else throw n})}async function P5t(t,e={}){const n=t,r=e.format||"png";if(!(r in ZK))throw new Error(`Image format '${r}' is unknown or not supported.`);const i=await ZK[r](n,{backgroundColor:"#00000000",canvasWidth:e.width||(e.height||n.clientHeight)*n.clientWidth/n.clientHeight,canvasHeight:e.height||(e.width||n.clientWidth)*n.clientHeight/n.clientWidth}),a=await(await fetch(i)).blob();await navigator.clipboard.write([new ClipboardItem({"image/png":a})])}function vye({elementRef:t,postMessage:e}){const n=()=>{e("success",fe.get("Snapshot copied to clipboard"))},r=o=>{const a="Error copying snapshot to clipboard";console.error(a+":",o),e("error",fe.get(a))},i=()=>{t.current?E5t(t.current,{format:"png",width:2e3,handleSuccess:n,handleError:r}):r(new Error("missing element reference"))};return w.jsx(Qa,{tooltipText:fe.get("Copy snapshot of chart to clipboard"),onClick:i,icon:w.jsx(lye,{fontSize:"inherit"})})}function M5t({sx:t,timeSeriesGroupId:e,placeGroupTimeSeries:n,addPlaceGroupTimeSeries:r}){const[i,o]=ue.useState(null),a=f=>{o(f.currentTarget)},s=()=>{o(null)},l=f=>{o(null),r(e,f)},c=[];n.forEach(f=>{Object.getOwnPropertyNames(f.timeSeries).forEach(d=>{const h=`${f.placeGroup.title} / ${d}`;c.push(w.jsx(Nr,{onClick:()=>l(f.timeSeries[d]),children:h},h))})});const u=!!i;return w.jsxs(w.Fragment,{children:[w.jsx(Ot,{size:"small",sx:t,"aria-label":"Add","aria-controls":u?"basic-menu":void 0,"aria-haspopup":"true","aria-expanded":u?"true":void 0,onClick:a,disabled:c.length===0,children:w.jsx(_t,{arrow:!0,title:fe.get("Add time-series from places"),children:w.jsx(aw,{fontSize:"inherit"})})}),w.jsx(_p,{id:"basic-menu",anchorEl:i,open:u,onClose:s,MenuListProps:{"aria-labelledby":"basic-button"},children:c})]})}const SO={container:t=>({padding:t.spacing(1),display:"flex",flexDirection:"column",gap:t.spacing(1)}),minMaxBox:t=>({display:"flex",justifyContent:"center",gap:t.spacing(1)}),minTextField:{maxWidth:"8em"},maxTextField:{maxWidth:"8em"}};function k5t({anchorEl:t,valueRange:e,setValueRange:n}){const[r,i]=M.useState(e?[e[0]+"",e[1]+""]:["0","1"]);if(!t)return null;const o=[Number.parseFloat(r[0]),Number.parseFloat(r[1])],a=Number.isFinite(o[0])&&Number.isFinite(o[1])&&o[0]{const d=f.target.value;i([d,r[1]])},l=f=>{const d=f.target.value;i([r[0],d])},c=()=>{n(o)},u=()=>{n(void 0)};return w.jsx(bp,{anchorEl:t,open:!0,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"center"},children:w.jsxs(Ke,{sx:SO.container,children:[w.jsxs(Ke,{component:"form",sx:SO.minMaxBox,children:[w.jsx(lr,{sx:SO.minTextField,label:"Y-Minimum",variant:"filled",size:"small",value:r[0],error:!a,onChange:f=>s(f)}),w.jsx(lr,{sx:SO.maxTextField,label:"Y-Maximum",variant:"filled",size:"small",value:r[1],error:!a,onChange:f=>l(f)})]}),w.jsx(sw,{onDone:c,doneDisabled:!a,onCancel:u,size:"medium"})]})})}const OO="stddev",jd={headerContainer:{display:"flex",flexDirection:"row",justifyContent:"right"},actionsContainer:{display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",gap:"1px"},responsiveContainer:{flexGrow:"1px"},actionButton:{zIndex:1e3,opacity:.8},chartTitle:{fontSize:"inherit",fontWeight:"normal"},chartTypes:t=>({paddingLeft:t.spacing(1),paddingRight:t.spacing(1)})};function A5t({timeSeriesGroup:t,placeGroupTimeSeries:e,addPlaceGroupTimeSeries:n,removeTimeSeriesGroup:r,resetZoom:i,loading:o,zoomed:a,zoomMode:s,setZoomMode:l,showTooltips:c,setShowTooltips:u,chartType:f,setChartType:d,stdevBarsDisabled:h,stdevBars:p,setStdevBars:m,valueRange:g,setValueRange:v,chartElement:y,postMessage:x}){const b=M.useRef(null),[_,S]=M.useState(!1),O=()=>{S(!_)},C=k=>{S(!1),k&&v(k)},E=(k,I)=>{const P=new Set(I),R=P.has(OO);P.delete(OO),P.delete(f),I=Array.from(P),d(I.length===1?I[0]:f),m(R)};return w.jsx(Ke,{sx:jd.headerContainer,children:w.jsxs(Ke,{sx:jd.actionsContainer,children:[a&&w.jsx(_t,{arrow:!0,title:fe.get("Zoom to full range"),children:w.jsx(Ot,{sx:jd.actionButton,onClick:i,size:"small",children:w.jsx(oye,{fontSize:"inherit"})},"zoomOutButton")}),w.jsx(_t,{arrow:!0,title:fe.get("Toggle zoom mode (or press CTRL key)"),children:w.jsx(Pn,{value:"zoomMode",selected:s,onClick:()=>l(!s),size:"small",children:w.jsx(tye,{fontSize:"inherit"})})}),w.jsx(k5t,{anchorEl:_?b.current:null,valueRange:g,setValueRange:C}),w.jsx(_t,{arrow:!0,title:fe.get("Enter fixed y-range"),children:w.jsx(Pn,{ref:b,value:"valueRange",selected:_,onClick:O,size:"small",children:w.jsx(iye,{fontSize:"inherit"})})}),w.jsx(_t,{arrow:!0,title:fe.get("Toggle showing info popup on hover"),children:w.jsx(Pn,{value:"showTooltips",selected:c,onClick:()=>u(!c),size:"small",children:w.jsx(rye,{fontSize:"inherit"})})}),w.jsxs(Jv,{value:p?[f,OO]:[f],onChange:E,size:"small",sx:jd.chartTypes,children:[w.jsx(_t,{arrow:!0,title:fe.get("Show points"),children:w.jsx(Pn,{value:"point",size:"small",children:w.jsx(aye,{fontSize:"inherit"})})}),w.jsx(_t,{arrow:!0,title:fe.get("Show lines"),children:w.jsx(Pn,{value:"line",size:"small",children:w.jsx(sye,{fontSize:"inherit"})})}),w.jsx(_t,{arrow:!0,title:fe.get("Show bars"),children:w.jsx(Pn,{value:"bar",size:"small",children:w.jsx(nye,{fontSize:"inherit"})})}),w.jsx(_t,{arrow:!0,title:fe.get("Show standard deviation (if any)"),children:w.jsx(Pn,{value:OO,size:"small",disabled:h,children:w.jsx(r6,{fontSize:"inherit"})})})]}),w.jsx(vye,{elementRef:y,postMessage:x}),w.jsx(M5t,{sx:jd.actionButton,timeSeriesGroupId:t.id,placeGroupTimeSeries:e,addPlaceGroupTimeSeries:n}),o?w.jsx(Qv,{size:24,sx:jd.actionButton,color:"secondary"}):w.jsx(Ot,{sx:jd.actionButton,"aria-label":"Close",onClick:()=>r(t.id),size:"small",children:w.jsx(kp,{fontSize:"inherit"})})]})})}const R5t=Li("div")(({theme:t})=>({userSelect:"none",marginTop:t.spacing(1),width:"99%",height:"32vh",display:"flex",flexDirection:"column",alignItems:"flex-stretch"})),I5t={style:{textAnchor:"middle"},angle:-90,position:"left",offset:0};function D5t({timeSeriesGroup:t,selectTimeSeries:e,selectedTime:n,selectTime:r,selectedTimeRange:i,selectTimeRange:o,places:a,selectPlace:s,placeInfos:l,dataTimeRange:c,chartTypeDefault:u,includeStdev:f,removeTimeSeries:d,removeTimeSeriesGroup:h,placeGroupTimeSeries:p,addPlaceGroupTimeSeries:m,postMessage:g}){const v=ld(),[y,x]=M.useState(!1),[b,_]=M.useState(!0),[S,O]=M.useState(u),[C,E]=M.useState(f),[k,I]=M.useState({}),P=M.useRef(),R=M.useRef(),T=M.useRef(),L=M.useRef(null),z=M.useRef(null),B=M.useMemo(()=>{const G=new Map;t.timeSeriesArray.forEach((he,_e)=>{const oe=`v${_e}`,Z=`ev${_e}`,V=he.source.valueDataKey,de=he.source.errorDataKey;he.data.forEach(xe=>{const Me=G.get(xe.time);let me;Me===void 0?(me={time:xe.time},G.set(xe.time,me)):me=Me;const Ne=xe[V];if(En(Ne)&&isFinite(Ne)&&(me[oe]=Ne),de){const Ce=xe[de];En(Ce)&&isFinite(Ce)&&(me[Z]=Ce)}})});const ie=Array.from(G.values());return ie.sort((he,_e)=>he.time-_e.time),ie},[t]),W=M.useMemo(()=>t.timeSeriesArray.map(G=>G.dataProgress?G.dataProgress:0),[t]),U=W.reduce((G,ie)=>G+ie,0)/W.length,N=U>0&&U<1,$=!!i&&!tGe(i,c||null);t.timeSeriesArray.forEach(G=>{G.source.valueDataKey});const D=t.variableUnits||fe.get("unknown units"),A=`${fe.get("Quantity")} (${D})`,q=v.palette.primary.light,Y=v.palette.primary.main,K=v.palette.text.primary,se=()=>{En(k.x1)&&I({})},te=G=>{if(!G)return;const{chartX:ie,chartY:he}=G;if(!En(ie)||!En(he))return;const _e=ee(ie,he);if(_e){const[oe,Z]=_e;I({x1:oe,y1:Z})}},J=(G,ie)=>{const{x1:he,y1:_e}=k;if(!En(he)||!En(_e)||!G)return;const{chartX:oe,chartY:Z}=G;if(!En(oe)||!En(Z))return;const V=ee(oe,Z);if(V){const[de,xe]=V;ie.ctrlKey||y?de!==he&&xe!==_e&&I({x1:he,y1:_e,x2:de,y2:xe}):de!==he&&I({x1:he,y1:_e,x2:de})}},pe=G=>{const[ie,he]=JK(k);se(),ie&&ie[0]{se()},re=()=>{se()},ve=G=>{d(t.id,G)},F=()=>{se(),o(c||null,t.id,null)},ce=G=>{G&&o(i,t.id,G)},le=(G,ie)=>{if(T.current=[G,ie],L.current){const he=L.current.getElementsByClassName("recharts-legend-wrapper");he.length!==0&&(z.current=he.item(0))}},Q=([G,ie])=>{const he=(ie-G)*.1;return i?P.current=i:P.current=[G-he,ie+he],P.current},X=([G,ie])=>{const he=(ie-G)*.1;if(t.variableRange)R.current=t.variableRange;else{const _e=G-he;R.current=[_e<0&&G-1e-6>0?0:_e,ie+he]}return R.current},ee=(G,ie)=>{const he=z.current;if(!T.current||!P.current||!R.current||!he)return;const[_e,oe]=P.current,[Z,V]=R.current,[de,xe]=T.current,Me=he.clientHeight,me=65,Ne=5,Ce=5,Re=38,ae=de-me-Ce,Le=xe-Ne-Re-Me,Ee=(G-me)/ae,ze=(ie-Ne)/Le;return[_e+Ee*(oe-_e),V-ze*(V-Z)]},[ge,ye]=JK(k),H=S==="bar"?njt:tjt;return w.jsxs(R5t,{children:[w.jsx(A5t,{timeSeriesGroup:t,placeGroupTimeSeries:p,addPlaceGroupTimeSeries:m,removeTimeSeriesGroup:h,resetZoom:F,loading:N,zoomed:$,zoomMode:y,setZoomMode:x,showTooltips:b,setShowTooltips:_,chartType:S,setChartType:O,stdevBarsDisabled:!f,stdevBars:C,setStdevBars:E,valueRange:R.current,setValueRange:ce,chartElement:L,postMessage:g}),w.jsx(rge,{width:"98%",onResize:le,ref:L,children:w.jsxs(H,{onMouseDown:te,onMouseMove:J,onMouseUp:pe,onMouseEnter:be,onMouseLeave:re,syncId:"anyId",style:{color:K,fontSize:"0.8em"},data:B,barGap:1,barSize:30,maxBarSize:30,children:[w.jsx(Np,{dataKey:"time",type:"number",tickCount:6,domain:Q,tickFormatter:ijt,stroke:K,allowDataOverflow:!0}),w.jsx(Fp,{type:"number",tickCount:5,domain:X,tickFormatter:ojt,stroke:K,allowDataOverflow:!0,label:{...I5t,value:A}}),w.jsx(QU,{strokeDasharray:"3 3"}),b&&!En(k.x1)&&w.jsx(ml,{content:w.jsx(cjt,{})}),w.jsx(gv,{content:w.jsx(ajt,{removeTimeSeries:ve})}),t.timeSeriesArray.map((G,ie)=>ujt({timeSeriesGroup:t,timeSeriesIndex:ie,selectTimeSeries:e,places:a,selectPlace:s,placeGroupTimeSeries:p,placeInfos:l,chartType:S,stdevBars:C,paletteMode:v.palette.mode})),ge&&w.jsx($p,{x1:ge[0],y1:ye?ye[0]:void 0,x2:ge[1],y2:ye?ye[1]:void 0,strokeOpacity:.3,fill:q,fillOpacity:.3}),n!==null&&w.jsx(Cw,{isFront:!0,x:n,stroke:Y,strokeWidth:3,strokeOpacity:.5})]})})]})}function JK(t){const{x1:e,x2:n,y1:r,y2:i}=t;let o,a;return En(e)&&En(n)&&(o=ew.jsx(D5t,{timeSeriesGroup:l,dataTimeRange:n,selectedTimeRange:r,selectTimeRange:i,...s},l.id))]})}const j5t=t=>({locale:t.controlState.locale,timeSeriesGroups:t.dataState.timeSeriesGroups,selectedTime:t.controlState.selectedTime,selectedTimeRange:t.controlState.selectedTimeRange,dataTimeRange:HHe(t),chartTypeDefault:t.controlState.timeSeriesChartTypeDefault,includeStdev:t.controlState.timeSeriesIncludeStdev,placeInfos:ZHe(t),places:K1(t),placeGroupTimeSeries:lGe(t),canAddTimeSeries:Cse(t)}),B5t={selectTime:y2,selectTimeRange:Ple,removeTimeSeries:o7e,removeTimeSeriesGroup:a7e,selectPlace:v2,addPlaceGroupTimeSeries:i7e,addTimeSeries:g2,postMessage:ba},z5t=Jt(j5t,B5t)(F5t);var c6={},U5t=ct;Object.defineProperty(c6,"__esModule",{value:!0});var yye=c6.default=void 0,W5t=U5t(pt()),V5t=w;yye=c6.default=(0,W5t.default)((0,V5t.jsx)("path",{d:"M22 18v-2H8V4h2L7 1 4 4h2v2H2v2h4v8c0 1.1.9 2 2 2h8v2h-2l3 3 3-3h-2v-2zM10 8h6v6h2V8c0-1.1-.9-2-2-2h-6z"}),"Transform");function G5t(t){return t.count===0}function H5t(t){return t.count===1}function q5t(t){return t.count>1}function X5t({statisticsRecord:t}){const e=t.statistics;return w.jsx(y5,{size:"small",children:w.jsx(x5,{children:G5t(e)?w.jsxs(pl,{children:[w.jsx(ar,{children:fe.get("Value")}),w.jsx(ar,{align:"right",children:"NaN"})]}):H5t(e)?w.jsxs(pl,{children:[w.jsx(ar,{children:fe.get("Value")}),w.jsx(ar,{align:"right",children:W0(e.mean)})]}):w.jsxs(w.Fragment,{children:[w.jsxs(pl,{children:[w.jsx(ar,{children:fe.get("Count")}),w.jsx(ar,{align:"right",children:e.count})]}),w.jsxs(pl,{children:[w.jsx(ar,{children:fe.get("Minimum")}),w.jsx(ar,{align:"right",children:W0(e.minimum)})]}),w.jsxs(pl,{children:[w.jsx(ar,{children:fe.get("Maximum")}),w.jsx(ar,{align:"right",children:W0(e.maximum)})]}),w.jsxs(pl,{children:[w.jsx(ar,{children:fe.get("Mean")}),w.jsx(ar,{align:"right",children:W0(e.mean)})]}),w.jsxs(pl,{children:[w.jsx(ar,{children:fe.get("Deviation")}),w.jsx(ar,{align:"right",children:W0(e.deviation)})]})]})})})}function W0(t){return Zf(t,3)}function Q5t({statisticsRecord:t,showBrush:e,showDetails:n}){const r=Vo(),i=t.statistics,o=M.useMemo(()=>{if(!i.histogram)return null;const{values:y,edges:x}=i.histogram;return y.map((b,_)=>({x:.5*(x[_]+x[_+1]),y:b,i:_}))},[i]),[a,s]=M.useState([0,o?o.length-1:-1]);if(M.useEffect(()=>{o&&s([0,o.length-1])},[o]),o===null)return null;const{placeInfo:l}=t.source,[c,u]=a,f=o[c]?o[c].x:NaN,d=o[u]?o[u].x:NaN,h=Math.max(i.mean-i.deviation,i.minimum,f),p=Math.min(i.mean+i.deviation,i.maximum,d),m=r.palette.text.primary,g=r.palette.text.primary,v=({startIndex:y,endIndex:x})=>{En(y)&&En(x)&&s([y,x])};return w.jsx(rge,{width:"100%",height:"100%",children:w.jsxs(rjt,{data:o,margin:{top:0,right:e?30:5,bottom:1,left:2},style:{color:g,fontSize:"0.8em"},children:[w.jsx(QU,{strokeDasharray:"3 3"}),w.jsx(Np,{type:"number",dataKey:"x",domain:[f,d],tickCount:10,tickFormatter:y=>Zf(y,2)}),w.jsx(Fp,{}),w.jsx(Ed,{type:"monotone",dataKey:"y",stroke:l.color,fill:l.color}),n&&w.jsx(Cw,{x:i.mean,isFront:!0,stroke:m,strokeWidth:2,strokeOpacity:.5}),n&&w.jsx($p,{x1:h,x2:p,isFront:!1,stroke:m,strokeWidth:1,strokeOpacity:.3,fill:m,fillOpacity:.05}),e&&w.jsx(lp,{dataKey:"i",height:22,startIndex:c,endIndex:u,tickFormatter:y=>Zf(o[y].x,1),onChange:v})]})})}const CO={container:{padding:1,width:"100%"},header:{display:"flex",justifyContent:"space-between",alignItems:"center",paddingBottom:.5},actions:{display:"flex",gap:.1},body:{display:"flex"}};function TO({phrase:t}){return w.jsx("span",{style:{color:"red"},children:`<${fe.get(t)}?>`})}function xye({dataset:t,variable:e,time:n,placeInfo:r,actions:i,body:o,containerRef:a}){const s=t?t.title:w.jsx(TO,{phrase:"Dataset"}),l=e?e.name:w.jsx(TO,{phrase:"Variable"}),c=n?$ae(n):w.jsx(TO,{phrase:"Time"}),u=r?r.label:w.jsx(TO,{phrase:"Place"});return w.jsxs(Ke,{sx:CO.container,ref:a,children:[w.jsxs(Ke,{sx:CO.header,children:[w.jsxs(At,{fontSize:"small",children:[s," / ",l,", ",c,", ",u]}),w.jsx(Ke,{sx:CO.actions,children:i})]}),o&&w.jsx(Ke,{sx:CO.body,children:o})]})}const eZ={table:{flexGrow:0},chart:{flexGrow:1}};function Y5t({locale:t,statisticsRecord:e,rowIndex:n,removeStatistics:r,postMessage:i}){const o=M.useRef(null),[a,s]=M.useState(!1),[l,c]=M.useState(!1),{dataset:u,variable:f,time:d,placeInfo:h}=e.source,p=q5t(e.statistics),m=()=>{c(!l)},g=()=>{s(!a)},v=()=>{r(n)};return w.jsx(xye,{dataset:u,variable:f,time:d,placeInfo:h,containerRef:o,actions:w.jsxs(w.Fragment,{children:[p&&w.jsxs(Jv,{size:"small",children:[w.jsx(_t,{arrow:!0,title:fe.get("Toggle adjustable x-range"),children:w.jsx(Pn,{selected:a,onClick:g,value:"brush",size:"small",children:w.jsx(yye,{fontSize:"inherit"})})}),w.jsx(_t,{arrow:!0,title:fe.get("Show standard deviation (if any)"),children:w.jsx(Pn,{selected:l,onClick:m,value:"details",size:"small",children:w.jsx(r6,{fontSize:"inherit"})})})]}),p&&w.jsx(vye,{elementRef:o,postMessage:i}),w.jsx(Ot,{size:"small",onClick:v,children:w.jsx(kp,{fontSize:"inherit"})})]}),body:w.jsxs(w.Fragment,{children:[w.jsx(Ke,{sx:eZ.table,children:w.jsx(X5t,{locale:t,statisticsRecord:e})}),w.jsx(Ke,{sx:eZ.chart,children:w.jsx(Q5t,{showBrush:a,showDetails:l,statisticsRecord:e})})]})})}const K5t={progress:{color:"primary"}};function Z5t({selectedDataset:t,selectedVariable:e,selectedTime:n,selectedPlaceInfo:r,canAddStatistics:i,addStatistics:o,statisticsLoading:a}){return w.jsx(xye,{dataset:t,variable:e,time:n,placeInfo:r,actions:a?w.jsx(Qv,{size:20,sx:K5t.progress}):w.jsx(Ot,{size:"small",disabled:!i,onClick:o,color:"primary",children:w.jsx(aw,{fontSize:"inherit"})})})}const J5t={container:{padding:1,display:"flex",flexDirection:"column",alignItems:"flex-start"}};function eBt({selectedDataset:t,selectedVariable:e,selectedTime:n,selectedPlaceInfo:r,statisticsLoading:i,statisticsRecords:o,canAddStatistics:a,addStatistics:s,removeStatistics:l,postMessage:c}){return w.jsxs(Ke,{sx:J5t.container,children:[w.jsx(Z5t,{selectedDataset:t,selectedVariable:e,selectedTime:n,selectedPlaceInfo:r,canAddStatistics:a,addStatistics:s,statisticsLoading:i}),o.map((u,f)=>w.jsx(Y5t,{statisticsRecord:u,rowIndex:f,removeStatistics:l,postMessage:c},f))]})}const tBt=t=>({selectedDataset:Gr(t),selectedVariable:vo(t),selectedTime:xy(t),selectedPlaceInfo:Z1(t),statisticsLoading:aGe(t),statisticsRecords:JHe(t),canAddStatistics:Tse(t)}),nBt={addStatistics:Jse,removeStatistics:n7e,postMessage:ba},rBt=Jt(tBt,nBt)(eBt);/** * @license * Copyright 2010-2022 Three.js Authors * SPDX-License-Identifier: MIT - */const c6="144",um={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},fm={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},nBt=0,JK=1,rBt=2,xye=1,iBt=2,yx=3,Av=0,_a=1,qc=2,Uf=0,Lg=1,eZ=2,tZ=3,nZ=4,oBt=5,Fm=100,aBt=101,sBt=102,rZ=103,iZ=104,lBt=200,cBt=201,uBt=202,fBt=203,bye=204,_ye=205,dBt=206,hBt=207,pBt=208,mBt=209,gBt=210,vBt=0,yBt=1,xBt=2,hF=3,bBt=4,_Bt=5,wBt=6,SBt=7,wye=0,OBt=1,CBt=2,ru=0,TBt=1,EBt=2,PBt=3,MBt=4,kBt=5,Sye=300,Rv=301,Iv=302,pF=303,mF=304,Ck=306,gF=1e3,Ha=1001,vF=1002,To=1003,oZ=1004,aZ=1005,Eo=1006,ABt=1007,Tk=1008,up=1009,RBt=1010,IBt=1011,Oye=1012,DBt=1013,Oh=1014,Of=1015,Z_=1016,LBt=1017,$Bt=1018,$g=1020,NBt=1021,FBt=1022,$l=1023,jBt=1024,BBt=1025,Bh=1026,Dv=1027,Cye=1028,zBt=1029,UBt=1030,WBt=1031,VBt=1033,LI=33776,$I=33777,NI=33778,FI=33779,sZ=35840,lZ=35841,cZ=35842,uZ=35843,GBt=36196,fZ=37492,dZ=37496,hZ=37808,pZ=37809,mZ=37810,gZ=37811,vZ=37812,yZ=37813,xZ=37814,bZ=37815,_Z=37816,wZ=37817,SZ=37818,OZ=37819,CZ=37820,TZ=37821,EZ=36492,fp=3e3,vr=3001,HBt=3200,qBt=3201,XBt=0,QBt=1,Mc="srgb",Ch="srgb-linear",jI=7680,YBt=519,PZ=35044,MZ="300 es",yF=1035;class jp{addEventListener(e,n){this._listeners===void 0&&(this._listeners={});const r=this._listeners;r[e]===void 0&&(r[e]=[]),r[e].indexOf(n)===-1&&r[e].push(n)}hasEventListener(e,n){if(this._listeners===void 0)return!1;const r=this._listeners;return r[e]!==void 0&&r[e].indexOf(n)!==-1}removeEventListener(e,n){if(this._listeners===void 0)return;const i=this._listeners[e];if(i!==void 0){const o=i.indexOf(n);o!==-1&&i.splice(o,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const r=this._listeners[e.type];if(r!==void 0){e.target=this;const i=r.slice(0);for(let o=0,a=i.length;o>8&255]+Fi[t>>16&255]+Fi[t>>24&255]+"-"+Fi[e&255]+Fi[e>>8&255]+"-"+Fi[e>>16&15|64]+Fi[e>>24&255]+"-"+Fi[n&63|128]+Fi[n>>8&255]+"-"+Fi[n>>16&255]+Fi[n>>24&255]+Fi[r&255]+Fi[r>>8&255]+Fi[r>>16&255]+Fi[r>>24&255]).toLowerCase()}function Po(t,e,n){return Math.max(e,Math.min(n,t))}function KBt(t,e){return(t%e+e)%e}function zI(t,e,n){return(1-n)*t+n*e}function AZ(t){return(t&t-1)===0&&t!==0}function xF(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function EO(t,e){switch(e.constructor){case Float32Array:return t;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function Zo(t,e){switch(e.constructor){case Float32Array:return t;case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("Invalid component type.")}}class Ht{constructor(e=0,n=0){Ht.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const n=this.x,r=this.y,i=e.elements;return this.x=i[0]*n+i[3]*r+i[6],this.y=i[1]*n+i[4]*r+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(n,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y;return n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){const r=Math.cos(n),i=Math.sin(n),o=this.x-e.x,a=this.y-e.y;return this.x=o*r-a*i+e.x,this.y=o*i+a*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class va{constructor(){va.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1]}set(e,n,r,i,o,a,s,l,c){const u=this.elements;return u[0]=e,u[1]=i,u[2]=s,u[3]=n,u[4]=o,u[5]=l,u[6]=r,u[7]=a,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],this}extractBasis(e,n,r){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const r=e.elements,i=n.elements,o=this.elements,a=r[0],s=r[3],l=r[6],c=r[1],u=r[4],f=r[7],d=r[2],h=r[5],p=r[8],m=i[0],g=i[3],v=i[6],y=i[1],x=i[4],b=i[7],_=i[2],S=i[5],O=i[8];return o[0]=a*m+s*y+l*_,o[3]=a*g+s*x+l*S,o[6]=a*v+s*b+l*O,o[1]=c*m+u*y+f*_,o[4]=c*g+u*x+f*S,o[7]=c*v+u*b+f*O,o[2]=d*m+h*y+p*_,o[5]=d*g+h*x+p*S,o[8]=d*v+h*b+p*O,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8];return n*a*u-n*s*c-r*o*u+r*s*l+i*o*c-i*a*l}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8],f=u*a-s*c,d=s*l-u*o,h=c*o-a*l,p=n*f+r*d+i*h;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);const m=1/p;return e[0]=f*m,e[1]=(i*c-u*r)*m,e[2]=(s*r-i*a)*m,e[3]=d*m,e[4]=(u*n-i*l)*m,e[5]=(i*o-s*n)*m,e[6]=h*m,e[7]=(r*l-c*n)*m,e[8]=(a*n-r*o)*m,this}transpose(){let e;const n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,n,r,i,o,a,s){const l=Math.cos(o),c=Math.sin(o);return this.set(r*l,r*c,-r*(l*a+c*s)+a+e,-i*c,i*l,-i*(-c*a+l*s)+s+n,0,0,1),this}scale(e,n){const r=this.elements;return r[0]*=e,r[3]*=e,r[6]*=e,r[1]*=n,r[4]*=n,r[7]*=n,this}rotate(e){const n=Math.cos(e),r=Math.sin(e),i=this.elements,o=i[0],a=i[3],s=i[6],l=i[1],c=i[4],u=i[7];return i[0]=n*o+r*l,i[3]=n*a+r*c,i[6]=n*s+r*u,i[1]=-r*o+n*l,i[4]=-r*a+n*c,i[7]=-r*s+n*u,this}translate(e,n){const r=this.elements;return r[0]+=e*r[2],r[3]+=e*r[5],r[6]+=e*r[8],r[1]+=n*r[2],r[4]+=n*r[5],r[7]+=n*r[8],this}equals(e){const n=this.elements,r=e.elements;for(let i=0;i<9;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<9;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){const r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e}clone(){return new this.constructor().fromArray(this.elements)}}function Tye(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}function J_(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function zh(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function GC(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}const UI={[Mc]:{[Ch]:zh},[Ch]:{[Mc]:GC}},Ps={legacyMode:!0,get workingColorSpace(){return Ch},set workingColorSpace(t){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(t,e,n){if(this.legacyMode||e===n||!e||!n)return t;if(UI[e]&&UI[e][n]!==void 0){const r=UI[e][n];return t.r=r(t.r),t.g=r(t.g),t.b=r(t.b),t}throw new Error("Unsupported color space conversion.")},fromWorkingColorSpace:function(t,e){return this.convert(t,this.workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this.workingColorSpace)}},Eye={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},Xr={r:0,g:0,b:0},Ms={h:0,s:0,l:0},PO={h:0,s:0,l:0};function WI(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*6*(2/3-n):t}function MO(t,e){return e.r=t.r,e.g=t.g,e.b=t.b,e}class sr{constructor(e,n,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,n===void 0&&r===void 0?this.set(e):this.setRGB(e,n,r)}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=Mc){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Ps.toWorkingColorSpace(this,n),this}setRGB(e,n,r,i=Ch){return this.r=e,this.g=n,this.b=r,Ps.toWorkingColorSpace(this,i),this}setHSL(e,n,r,i=Ch){if(e=KBt(e,1),n=Po(n,0,1),r=Po(r,0,1),n===0)this.r=this.g=this.b=r;else{const o=r<=.5?r*(1+n):r+n-r*n,a=2*r-o;this.r=WI(a,o,e+1/3),this.g=WI(a,o,e),this.b=WI(a,o,e-1/3)}return Ps.toWorkingColorSpace(this,i),this}setStyle(e,n=Mc){function r(o){o!==void 0&&parseFloat(o)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let o;const a=i[1],s=i[2];switch(a){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.r=Math.min(255,parseInt(o[1],10))/255,this.g=Math.min(255,parseInt(o[2],10))/255,this.b=Math.min(255,parseInt(o[3],10))/255,Ps.toWorkingColorSpace(this,n),r(o[4]),this;if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.r=Math.min(100,parseInt(o[1],10))/100,this.g=Math.min(100,parseInt(o[2],10))/100,this.b=Math.min(100,parseInt(o[3],10))/100,Ps.toWorkingColorSpace(this,n),r(o[4]),this;break;case"hsl":case"hsla":if(o=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s)){const l=parseFloat(o[1])/360,c=parseFloat(o[2])/100,u=parseFloat(o[3])/100;return r(o[4]),this.setHSL(l,c,u,n)}break}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const o=i[1],a=o.length;if(a===3)return this.r=parseInt(o.charAt(0)+o.charAt(0),16)/255,this.g=parseInt(o.charAt(1)+o.charAt(1),16)/255,this.b=parseInt(o.charAt(2)+o.charAt(2),16)/255,Ps.toWorkingColorSpace(this,n),this;if(a===6)return this.r=parseInt(o.charAt(0)+o.charAt(1),16)/255,this.g=parseInt(o.charAt(2)+o.charAt(3),16)/255,this.b=parseInt(o.charAt(4)+o.charAt(5),16)/255,Ps.toWorkingColorSpace(this,n),this}return e&&e.length>0?this.setColorName(e,n):this}setColorName(e,n=Mc){const r=Eye[e.toLowerCase()];return r!==void 0?this.setHex(r,n):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=zh(e.r),this.g=zh(e.g),this.b=zh(e.b),this}copyLinearToSRGB(e){return this.r=GC(e.r),this.g=GC(e.g),this.b=GC(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Mc){return Ps.fromWorkingColorSpace(MO(this,Xr),e),Po(Xr.r*255,0,255)<<16^Po(Xr.g*255,0,255)<<8^Po(Xr.b*255,0,255)<<0}getHexString(e=Mc){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=Ch){Ps.fromWorkingColorSpace(MO(this,Xr),n);const r=Xr.r,i=Xr.g,o=Xr.b,a=Math.max(r,i,o),s=Math.min(r,i,o);let l,c;const u=(s+a)/2;if(s===a)l=0,c=0;else{const f=a-s;switch(c=u<=.5?f/(a+s):f/(2-a-s),a){case r:l=(i-o)/f+(i"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{dm===void 0&&(dm=J_("canvas")),dm.width=e.width,dm.height=e.height;const r=dm.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),n=dm}return n.width>2048||n.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),n.toDataURL("image/jpeg",.6)):n.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const n=J_("canvas");n.width=e.width,n.height=e.height;const r=n.getContext("2d");r.drawImage(e,0,0,e.width,e.height);const i=r.getImageData(0,0,e.width,e.height),o=i.data;for(let a=0;a1)switch(this.wrapS){case gF:e.x=e.x-Math.floor(e.x);break;case Ha:e.x=e.x<0?0:1;break;case vF:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case gF:e.y=e.y-Math.floor(e.y);break;case Ha:e.y=e.y<0?0:1;break;case vF:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}}Ta.DEFAULT_IMAGE=null;Ta.DEFAULT_MAPPING=Sye;class Ri{constructor(e=0,n=0,r=0,i=1){Ri.prototype.isVector4=!0,this.x=e,this.y=n,this.z=r,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,n,r,i){return this.x=e,this.y=n,this.z=r,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const n=this.x,r=this.y,i=this.z,o=this.w,a=e.elements;return this.x=a[0]*n+a[4]*r+a[8]*i+a[12]*o,this.y=a[1]*n+a[5]*r+a[9]*i+a[13]*o,this.z=a[2]*n+a[6]*r+a[10]*i+a[14]*o,this.w=a[3]*n+a[7]*r+a[11]*i+a[15]*o,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this}setAxisAngleFromRotationMatrix(e){let n,r,i,o;const l=e.elements,c=l[0],u=l[4],f=l[8],d=l[1],h=l[5],p=l[9],m=l[2],g=l[6],v=l[10];if(Math.abs(u-d)<.01&&Math.abs(f-m)<.01&&Math.abs(p-g)<.01){if(Math.abs(u+d)<.1&&Math.abs(f+m)<.1&&Math.abs(p+g)<.1&&Math.abs(c+h+v-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const x=(c+1)/2,b=(h+1)/2,_=(v+1)/2,S=(u+d)/4,O=(f+m)/4,C=(p+g)/4;return x>b&&x>_?x<.01?(r=0,i=.707106781,o=.707106781):(r=Math.sqrt(x),i=S/r,o=O/r):b>_?b<.01?(r=.707106781,i=0,o=.707106781):(i=Math.sqrt(b),r=S/i,o=C/i):_<.01?(r=.707106781,i=.707106781,o=0):(o=Math.sqrt(_),r=O/o,i=C/o),this.set(r,i,o,n),this}let y=Math.sqrt((g-p)*(g-p)+(f-m)*(f-m)+(d-u)*(d-u));return Math.abs(y)<.001&&(y=1),this.x=(g-p)/y,this.y=(f-m)/y,this.z=(d-u)/y,this.w=Math.acos((c+h+v-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this.w=Math.max(e.w,Math.min(n.w,this.w)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this.w=Math.max(e,Math.min(n,this.w)),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(n,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this.w=e.w+(n.w-e.w)*r,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.getW(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class dp extends jp{constructor(e,n,r={}){super(),this.isWebGLRenderTarget=!0,this.width=e,this.height=n,this.depth=1,this.scissor=new Ri(0,0,e,n),this.scissorTest=!1,this.viewport=new Ri(0,0,e,n);const i={width:e,height:n,depth:1};this.texture=new Ta(i,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.encoding),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=r.generateMipmaps!==void 0?r.generateMipmaps:!1,this.texture.internalFormat=r.internalFormat!==void 0?r.internalFormat:null,this.texture.minFilter=r.minFilter!==void 0?r.minFilter:Eo,this.depthBuffer=r.depthBuffer!==void 0?r.depthBuffer:!0,this.stencilBuffer=r.stencilBuffer!==void 0?r.stencilBuffer:!1,this.depthTexture=r.depthTexture!==void 0?r.depthTexture:null,this.samples=r.samples!==void 0?r.samples:0}setSize(e,n,r=1){(this.width!==e||this.height!==n||this.depth!==r)&&(this.width=e,this.height=n,this.depth=r,this.texture.image.width=e,this.texture.image.height=n,this.texture.image.depth=r,this.dispose()),this.viewport.set(0,0,e,n),this.scissor.set(0,0,e,n)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const n=Object.assign({},e.texture.image);return this.texture.source=new Mye(n),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class kye extends Ta{constructor(e=null,n=1,r=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:n,height:r,depth:i},this.magFilter=To,this.minFilter=To,this.wrapR=Ha,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Aye extends Ta{constructor(e=null,n=1,r=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:n,height:r,depth:i},this.magFilter=To,this.minFilter=To,this.wrapR=Ha,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class hp{constructor(e=0,n=0,r=0,i=1){this.isQuaternion=!0,this._x=e,this._y=n,this._z=r,this._w=i}static slerpFlat(e,n,r,i,o,a,s){let l=r[i+0],c=r[i+1],u=r[i+2],f=r[i+3];const d=o[a+0],h=o[a+1],p=o[a+2],m=o[a+3];if(s===0){e[n+0]=l,e[n+1]=c,e[n+2]=u,e[n+3]=f;return}if(s===1){e[n+0]=d,e[n+1]=h,e[n+2]=p,e[n+3]=m;return}if(f!==m||l!==d||c!==h||u!==p){let g=1-s;const v=l*d+c*h+u*p+f*m,y=v>=0?1:-1,x=1-v*v;if(x>Number.EPSILON){const _=Math.sqrt(x),S=Math.atan2(_,v*y);g=Math.sin(g*S)/_,s=Math.sin(s*S)/_}const b=s*y;if(l=l*g+d*b,c=c*g+h*b,u=u*g+p*b,f=f*g+m*b,g===1-s){const _=1/Math.sqrt(l*l+c*c+u*u+f*f);l*=_,c*=_,u*=_,f*=_}}e[n]=l,e[n+1]=c,e[n+2]=u,e[n+3]=f}static multiplyQuaternionsFlat(e,n,r,i,o,a){const s=r[i],l=r[i+1],c=r[i+2],u=r[i+3],f=o[a],d=o[a+1],h=o[a+2],p=o[a+3];return e[n]=s*p+u*f+l*h-c*d,e[n+1]=l*p+u*d+c*f-s*h,e[n+2]=c*p+u*h+s*d-l*f,e[n+3]=u*p-s*f-l*d-c*h,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,n,r,i){return this._x=e,this._y=n,this._z=r,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,n){const r=e._x,i=e._y,o=e._z,a=e._order,s=Math.cos,l=Math.sin,c=s(r/2),u=s(i/2),f=s(o/2),d=l(r/2),h=l(i/2),p=l(o/2);switch(a){case"XYZ":this._x=d*u*f+c*h*p,this._y=c*h*f-d*u*p,this._z=c*u*p+d*h*f,this._w=c*u*f-d*h*p;break;case"YXZ":this._x=d*u*f+c*h*p,this._y=c*h*f-d*u*p,this._z=c*u*p-d*h*f,this._w=c*u*f+d*h*p;break;case"ZXY":this._x=d*u*f-c*h*p,this._y=c*h*f+d*u*p,this._z=c*u*p+d*h*f,this._w=c*u*f-d*h*p;break;case"ZYX":this._x=d*u*f-c*h*p,this._y=c*h*f+d*u*p,this._z=c*u*p-d*h*f,this._w=c*u*f+d*h*p;break;case"YZX":this._x=d*u*f+c*h*p,this._y=c*h*f+d*u*p,this._z=c*u*p-d*h*f,this._w=c*u*f-d*h*p;break;case"XZY":this._x=d*u*f-c*h*p,this._y=c*h*f-d*u*p,this._z=c*u*p+d*h*f,this._w=c*u*f+d*h*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return n!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,n){const r=n/2,i=Math.sin(r);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(e){const n=e.elements,r=n[0],i=n[4],o=n[8],a=n[1],s=n[5],l=n[9],c=n[2],u=n[6],f=n[10],d=r+s+f;if(d>0){const h=.5/Math.sqrt(d+1);this._w=.25/h,this._x=(u-l)*h,this._y=(o-c)*h,this._z=(a-i)*h}else if(r>s&&r>f){const h=2*Math.sqrt(1+r-s-f);this._w=(u-l)/h,this._x=.25*h,this._y=(i+a)/h,this._z=(o+c)/h}else if(s>f){const h=2*Math.sqrt(1+s-r-f);this._w=(o-c)/h,this._x=(i+a)/h,this._y=.25*h,this._z=(l+u)/h}else{const h=2*Math.sqrt(1+f-r-s);this._w=(a-i)/h,this._x=(o+c)/h,this._y=(l+u)/h,this._z=.25*h}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let r=e.dot(n)+1;return rMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(this._x=e.y*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Po(this.dot(e),-1,1)))}rotateTowards(e,n){const r=this.angleTo(e);if(r===0)return this;const i=Math.min(1,n/r);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,n){const r=e._x,i=e._y,o=e._z,a=e._w,s=n._x,l=n._y,c=n._z,u=n._w;return this._x=r*u+a*s+i*c-o*l,this._y=i*u+a*l+o*s-r*c,this._z=o*u+a*c+r*l-i*s,this._w=a*u-r*s-i*l-o*c,this._onChangeCallback(),this}slerp(e,n){if(n===0)return this;if(n===1)return this.copy(e);const r=this._x,i=this._y,o=this._z,a=this._w;let s=a*e._w+r*e._x+i*e._y+o*e._z;if(s<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,s=-s):this.copy(e),s>=1)return this._w=a,this._x=r,this._y=i,this._z=o,this;const l=1-s*s;if(l<=Number.EPSILON){const h=1-n;return this._w=h*a+n*this._w,this._x=h*r+n*this._x,this._y=h*i+n*this._y,this._z=h*o+n*this._z,this.normalize(),this._onChangeCallback(),this}const c=Math.sqrt(l),u=Math.atan2(c,s),f=Math.sin((1-n)*u)/c,d=Math.sin(n*u)/c;return this._w=a*f+this._w*d,this._x=r*f+this._x*d,this._y=i*f+this._y*d,this._z=o*f+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,n,r){return this.copy(e).slerp(n,r)}random(){const e=Math.random(),n=Math.sqrt(1-e),r=Math.sqrt(e),i=2*Math.PI*Math.random(),o=2*Math.PI*Math.random();return this.set(n*Math.cos(i),r*Math.sin(o),r*Math.cos(o),n*Math.sin(i))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Se{constructor(e=0,n=0,r=0){Se.prototype.isVector3=!0,this.x=e,this.y=n,this.z=r}set(e,n,r){return r===void 0&&(r=this.z),this.x=e,this.y=n,this.z=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(RZ.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(RZ.setFromAxisAngle(e,n))}applyMatrix3(e){const n=this.x,r=this.y,i=this.z,o=e.elements;return this.x=o[0]*n+o[3]*r+o[6]*i,this.y=o[1]*n+o[4]*r+o[7]*i,this.z=o[2]*n+o[5]*r+o[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const n=this.x,r=this.y,i=this.z,o=e.elements,a=1/(o[3]*n+o[7]*r+o[11]*i+o[15]);return this.x=(o[0]*n+o[4]*r+o[8]*i+o[12])*a,this.y=(o[1]*n+o[5]*r+o[9]*i+o[13])*a,this.z=(o[2]*n+o[6]*r+o[10]*i+o[14])*a,this}applyQuaternion(e){const n=this.x,r=this.y,i=this.z,o=e.x,a=e.y,s=e.z,l=e.w,c=l*n+a*i-s*r,u=l*r+s*n-o*i,f=l*i+o*r-a*n,d=-o*n-a*r-s*i;return this.x=c*l+d*-o+u*-s-f*-a,this.y=u*l+d*-a+f*-o-c*-s,this.z=f*l+d*-s+c*-a-u*-o,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const n=this.x,r=this.y,i=this.z,o=e.elements;return this.x=o[0]*n+o[4]*r+o[8]*i,this.y=o[1]*n+o[5]*r+o[9]*i,this.z=o[2]*n+o[6]*r+o[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(n,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){const r=e.x,i=e.y,o=e.z,a=n.x,s=n.y,l=n.z;return this.x=i*l-o*s,this.y=o*a-r*l,this.z=r*s-i*a,this}projectOnVector(e){const n=e.lengthSq();if(n===0)return this.set(0,0,0);const r=e.dot(this)/n;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return GI.copy(this).projectOnVector(e),this.sub(GI)}reflect(e){return this.sub(GI.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const r=this.dot(e)/n;return Math.acos(Po(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y,i=this.z-e.z;return n*n+r*r+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,n,r){const i=Math.sin(n)*e;return this.x=i*Math.sin(r),this.y=Math.cos(n)*e,this.z=i*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,r){return this.x=e*Math.sin(n),this.y=r,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){const n=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=r,this.z=i,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=(Math.random()-.5)*2,n=Math.random()*Math.PI*2,r=Math.sqrt(1-e**2);return this.x=r*Math.cos(n),this.y=r*Math.sin(n),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const GI=new Se,RZ=new hp;class Gy{constructor(e=new Se(1/0,1/0,1/0),n=new Se(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=n}set(e,n){return this.min.copy(e),this.max.copy(n),this}setFromArray(e){let n=1/0,r=1/0,i=1/0,o=-1/0,a=-1/0,s=-1/0;for(let l=0,c=e.length;lo&&(o=u),f>a&&(a=f),d>s&&(s=d)}return this.min.set(n,r,i),this.max.set(o,a,s),this}setFromBufferAttribute(e){let n=1/0,r=1/0,i=1/0,o=-1/0,a=-1/0,s=-1/0;for(let l=0,c=e.count;lo&&(o=u),f>a&&(a=f),d>s&&(s=d)}return this.min.set(n,r,i),this.max.set(o,a,s),this}setFromPoints(e){this.makeEmpty();for(let n=0,r=e.length;nthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Bd),Bd.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,r;return e.normal.x>0?(n=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),n<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(V0),kO.subVectors(this.max,V0),hm.subVectors(e.a,V0),pm.subVectors(e.b,V0),mm.subVectors(e.c,V0),$u.subVectors(pm,hm),Nu.subVectors(mm,pm),zd.subVectors(hm,mm);let n=[0,-$u.z,$u.y,0,-Nu.z,Nu.y,0,-zd.z,zd.y,$u.z,0,-$u.x,Nu.z,0,-Nu.x,zd.z,0,-zd.x,-$u.y,$u.x,0,-Nu.y,Nu.x,0,-zd.y,zd.x,0];return!qI(n,hm,pm,mm,kO)||(n=[1,0,0,0,1,0,0,0,1],!qI(n,hm,pm,mm,kO))?!1:(AO.crossVectors($u,Nu),n=[AO.x,AO.y,AO.z],qI(n,hm,pm,mm,kO))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return Bd.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=this.getSize(Bd).length()*.5,e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(gc[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),gc[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),gc[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),gc[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),gc[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),gc[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),gc[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),gc[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(gc),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const gc=[new Se,new Se,new Se,new Se,new Se,new Se,new Se,new Se],Bd=new Se,HI=new Gy,hm=new Se,pm=new Se,mm=new Se,$u=new Se,Nu=new Se,zd=new Se,V0=new Se,kO=new Se,AO=new Se,Ud=new Se;function qI(t,e,n,r,i){for(let o=0,a=t.length-3;o<=a;o+=3){Ud.fromArray(t,o);const s=i.x*Math.abs(Ud.x)+i.y*Math.abs(Ud.y)+i.z*Math.abs(Ud.z),l=e.dot(Ud),c=n.dot(Ud),u=r.dot(Ud);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>s)return!1}return!0}const JBt=new Gy,IZ=new Se,RO=new Se,XI=new Se;class Ek{constructor(e=new Se,n=-1){this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}setFromPoints(e,n){const r=this.center;n!==void 0?r.copy(n):JBt.setFromPoints(e).getCenter(r);let i=0;for(let o=0,a=e.length;othis.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){XI.subVectors(e,this.center);const n=XI.lengthSq();if(n>this.radius*this.radius){const r=Math.sqrt(n),i=(r-this.radius)*.5;this.center.add(XI.multiplyScalar(i/r)),this.radius+=i}return this}union(e){return this.center.equals(e.center)===!0?RO.set(0,0,1).multiplyScalar(e.radius):RO.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(IZ.copy(e.center).add(RO)),this.expandByPoint(IZ.copy(e.center).sub(RO)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const vc=new Se,QI=new Se,IO=new Se,Fu=new Se,YI=new Se,DO=new Se,KI=new Se;class Rye{constructor(e=new Se,n=new Se(0,0,-1)){this.origin=e,this.direction=n}set(e,n){return this.origin.copy(e),this.direction.copy(n),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,n){return n.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,vc)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);const r=n.dot(this.direction);return r<0?n.copy(this.origin):n.copy(this.direction).multiplyScalar(r).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const n=vc.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(vc.copy(this.direction).multiplyScalar(n).add(this.origin),vc.distanceToSquared(e))}distanceSqToSegment(e,n,r,i){QI.copy(e).add(n).multiplyScalar(.5),IO.copy(n).sub(e).normalize(),Fu.copy(this.origin).sub(QI);const o=e.distanceTo(n)*.5,a=-this.direction.dot(IO),s=Fu.dot(this.direction),l=-Fu.dot(IO),c=Fu.lengthSq(),u=Math.abs(1-a*a);let f,d,h,p;if(u>0)if(f=a*l-s,d=a*s-l,p=o*u,f>=0)if(d>=-p)if(d<=p){const m=1/u;f*=m,d*=m,h=f*(f+a*d+2*s)+d*(a*f+d+2*l)+c}else d=o,f=Math.max(0,-(a*d+s)),h=-f*f+d*(d+2*l)+c;else d=-o,f=Math.max(0,-(a*d+s)),h=-f*f+d*(d+2*l)+c;else d<=-p?(f=Math.max(0,-(-a*o+s)),d=f>0?-o:Math.min(Math.max(-o,-l),o),h=-f*f+d*(d+2*l)+c):d<=p?(f=0,d=Math.min(Math.max(-o,-l),o),h=d*(d+2*l)+c):(f=Math.max(0,-(a*o+s)),d=f>0?o:Math.min(Math.max(-o,-l),o),h=-f*f+d*(d+2*l)+c);else d=a>0?-o:o,f=Math.max(0,-(a*d+s)),h=-f*f+d*(d+2*l)+c;return r&&r.copy(this.direction).multiplyScalar(f).add(this.origin),i&&i.copy(IO).multiplyScalar(d).add(QI),h}intersectSphere(e,n){vc.subVectors(e.center,this.origin);const r=vc.dot(this.direction),i=vc.dot(vc)-r*r,o=e.radius*e.radius;if(i>o)return null;const a=Math.sqrt(o-i),s=r-a,l=r+a;return s<0&&l<0?null:s<0?this.at(l,n):this.at(s,n)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const n=e.normal.dot(this.direction);if(n===0)return e.distanceToPoint(this.origin)===0?0:null;const r=-(this.origin.dot(e.normal)+e.constant)/n;return r>=0?r:null}intersectPlane(e,n){const r=this.distanceToPlane(e);return r===null?null:this.at(r,n)}intersectsPlane(e){const n=e.distanceToPoint(this.origin);return n===0||e.normal.dot(this.direction)*n<0}intersectBox(e,n){let r,i,o,a,s,l;const c=1/this.direction.x,u=1/this.direction.y,f=1/this.direction.z,d=this.origin;return c>=0?(r=(e.min.x-d.x)*c,i=(e.max.x-d.x)*c):(r=(e.max.x-d.x)*c,i=(e.min.x-d.x)*c),u>=0?(o=(e.min.y-d.y)*u,a=(e.max.y-d.y)*u):(o=(e.max.y-d.y)*u,a=(e.min.y-d.y)*u),r>a||o>i||((o>r||r!==r)&&(r=o),(a=0?(s=(e.min.z-d.z)*f,l=(e.max.z-d.z)*f):(s=(e.max.z-d.z)*f,l=(e.min.z-d.z)*f),r>l||s>i)||((s>r||r!==r)&&(r=s),(l=0?r:i,n)}intersectsBox(e){return this.intersectBox(e,vc)!==null}intersectTriangle(e,n,r,i,o){YI.subVectors(n,e),DO.subVectors(r,e),KI.crossVectors(YI,DO);let a=this.direction.dot(KI),s;if(a>0){if(i)return null;s=1}else if(a<0)s=-1,a=-a;else return null;Fu.subVectors(this.origin,e);const l=s*this.direction.dot(DO.crossVectors(Fu,DO));if(l<0)return null;const c=s*this.direction.dot(YI.cross(Fu));if(c<0||l+c>a)return null;const u=-s*Fu.dot(KI);return u<0?null:this.at(u/a,o)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Gn{constructor(){Gn.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(e,n,r,i,o,a,s,l,c,u,f,d,h,p,m,g){const v=this.elements;return v[0]=e,v[4]=n,v[8]=r,v[12]=i,v[1]=o,v[5]=a,v[9]=s,v[13]=l,v[2]=c,v[6]=u,v[10]=f,v[14]=d,v[3]=h,v[7]=p,v[11]=m,v[15]=g,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Gn().fromArray(this.elements)}copy(e){const n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],n[9]=r[9],n[10]=r[10],n[11]=r[11],n[12]=r[12],n[13]=r[13],n[14]=r[14],n[15]=r[15],this}copyPosition(e){const n=this.elements,r=e.elements;return n[12]=r[12],n[13]=r[13],n[14]=r[14],this}setFromMatrix3(e){const n=e.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(e,n,r){return e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(e,n,r){return this.set(e.x,n.x,r.x,0,e.y,n.y,r.y,0,e.z,n.z,r.z,0,0,0,0,1),this}extractRotation(e){const n=this.elements,r=e.elements,i=1/gm.setFromMatrixColumn(e,0).length(),o=1/gm.setFromMatrixColumn(e,1).length(),a=1/gm.setFromMatrixColumn(e,2).length();return n[0]=r[0]*i,n[1]=r[1]*i,n[2]=r[2]*i,n[3]=0,n[4]=r[4]*o,n[5]=r[5]*o,n[6]=r[6]*o,n[7]=0,n[8]=r[8]*a,n[9]=r[9]*a,n[10]=r[10]*a,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){const n=this.elements,r=e.x,i=e.y,o=e.z,a=Math.cos(r),s=Math.sin(r),l=Math.cos(i),c=Math.sin(i),u=Math.cos(o),f=Math.sin(o);if(e.order==="XYZ"){const d=a*u,h=a*f,p=s*u,m=s*f;n[0]=l*u,n[4]=-l*f,n[8]=c,n[1]=h+p*c,n[5]=d-m*c,n[9]=-s*l,n[2]=m-d*c,n[6]=p+h*c,n[10]=a*l}else if(e.order==="YXZ"){const d=l*u,h=l*f,p=c*u,m=c*f;n[0]=d+m*s,n[4]=p*s-h,n[8]=a*c,n[1]=a*f,n[5]=a*u,n[9]=-s,n[2]=h*s-p,n[6]=m+d*s,n[10]=a*l}else if(e.order==="ZXY"){const d=l*u,h=l*f,p=c*u,m=c*f;n[0]=d-m*s,n[4]=-a*f,n[8]=p+h*s,n[1]=h+p*s,n[5]=a*u,n[9]=m-d*s,n[2]=-a*c,n[6]=s,n[10]=a*l}else if(e.order==="ZYX"){const d=a*u,h=a*f,p=s*u,m=s*f;n[0]=l*u,n[4]=p*c-h,n[8]=d*c+m,n[1]=l*f,n[5]=m*c+d,n[9]=h*c-p,n[2]=-c,n[6]=s*l,n[10]=a*l}else if(e.order==="YZX"){const d=a*l,h=a*c,p=s*l,m=s*c;n[0]=l*u,n[4]=m-d*f,n[8]=p*f+h,n[1]=f,n[5]=a*u,n[9]=-s*u,n[2]=-c*u,n[6]=h*f+p,n[10]=d-m*f}else if(e.order==="XZY"){const d=a*l,h=a*c,p=s*l,m=s*c;n[0]=l*u,n[4]=-f,n[8]=c*u,n[1]=d*f+m,n[5]=a*u,n[9]=h*f-p,n[2]=p*f-h,n[6]=s*u,n[10]=m*f+d}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(e){return this.compose(ezt,e,tzt)}lookAt(e,n,r){const i=this.elements;return Jo.subVectors(e,n),Jo.lengthSq()===0&&(Jo.z=1),Jo.normalize(),ju.crossVectors(r,Jo),ju.lengthSq()===0&&(Math.abs(r.z)===1?Jo.x+=1e-4:Jo.z+=1e-4,Jo.normalize(),ju.crossVectors(r,Jo)),ju.normalize(),LO.crossVectors(Jo,ju),i[0]=ju.x,i[4]=LO.x,i[8]=Jo.x,i[1]=ju.y,i[5]=LO.y,i[9]=Jo.y,i[2]=ju.z,i[6]=LO.z,i[10]=Jo.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const r=e.elements,i=n.elements,o=this.elements,a=r[0],s=r[4],l=r[8],c=r[12],u=r[1],f=r[5],d=r[9],h=r[13],p=r[2],m=r[6],g=r[10],v=r[14],y=r[3],x=r[7],b=r[11],_=r[15],S=i[0],O=i[4],C=i[8],E=i[12],k=i[1],I=i[5],P=i[9],R=i[13],T=i[2],L=i[6],z=i[10],B=i[14],W=i[3],U=i[7],N=i[11],$=i[15];return o[0]=a*S+s*k+l*T+c*W,o[4]=a*O+s*I+l*L+c*U,o[8]=a*C+s*P+l*z+c*N,o[12]=a*E+s*R+l*B+c*$,o[1]=u*S+f*k+d*T+h*W,o[5]=u*O+f*I+d*L+h*U,o[9]=u*C+f*P+d*z+h*N,o[13]=u*E+f*R+d*B+h*$,o[2]=p*S+m*k+g*T+v*W,o[6]=p*O+m*I+g*L+v*U,o[10]=p*C+m*P+g*z+v*N,o[14]=p*E+m*R+g*B+v*$,o[3]=y*S+x*k+b*T+_*W,o[7]=y*O+x*I+b*L+_*U,o[11]=y*C+x*P+b*z+_*N,o[15]=y*E+x*R+b*B+_*$,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){const e=this.elements,n=e[0],r=e[4],i=e[8],o=e[12],a=e[1],s=e[5],l=e[9],c=e[13],u=e[2],f=e[6],d=e[10],h=e[14],p=e[3],m=e[7],g=e[11],v=e[15];return p*(+o*l*f-i*c*f-o*s*d+r*c*d+i*s*h-r*l*h)+m*(+n*l*h-n*c*d+o*a*d-i*a*h+i*c*u-o*l*u)+g*(+n*c*f-n*s*h-o*a*f+r*a*h+o*s*u-r*c*u)+v*(-i*s*u-n*l*f+n*s*d+i*a*f-r*a*d+r*l*u)}transpose(){const e=this.elements;let n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this}setPosition(e,n,r){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=n,i[14]=r),this}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8],f=e[9],d=e[10],h=e[11],p=e[12],m=e[13],g=e[14],v=e[15],y=f*g*c-m*d*c+m*l*h-s*g*h-f*l*v+s*d*v,x=p*d*c-u*g*c-p*l*h+a*g*h+u*l*v-a*d*v,b=u*m*c-p*f*c+p*s*h-a*m*h-u*s*v+a*f*v,_=p*f*l-u*m*l-p*s*d+a*m*d+u*s*g-a*f*g,S=n*y+r*x+i*b+o*_;if(S===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const O=1/S;return e[0]=y*O,e[1]=(m*d*o-f*g*o-m*i*h+r*g*h+f*i*v-r*d*v)*O,e[2]=(s*g*o-m*l*o+m*i*c-r*g*c-s*i*v+r*l*v)*O,e[3]=(f*l*o-s*d*o-f*i*c+r*d*c+s*i*h-r*l*h)*O,e[4]=x*O,e[5]=(u*g*o-p*d*o+p*i*h-n*g*h-u*i*v+n*d*v)*O,e[6]=(p*l*o-a*g*o-p*i*c+n*g*c+a*i*v-n*l*v)*O,e[7]=(a*d*o-u*l*o+u*i*c-n*d*c-a*i*h+n*l*h)*O,e[8]=b*O,e[9]=(p*f*o-u*m*o-p*r*h+n*m*h+u*r*v-n*f*v)*O,e[10]=(a*m*o-p*s*o+p*r*c-n*m*c-a*r*v+n*s*v)*O,e[11]=(u*s*o-a*f*o-u*r*c+n*f*c+a*r*h-n*s*h)*O,e[12]=_*O,e[13]=(u*m*i-p*f*i+p*r*d-n*m*d-u*r*g+n*f*g)*O,e[14]=(p*s*i-a*m*i-p*r*l+n*m*l+a*r*g-n*s*g)*O,e[15]=(a*f*i-u*s*i+u*r*l-n*f*l-a*r*d+n*s*d)*O,this}scale(e){const n=this.elements,r=e.x,i=e.y,o=e.z;return n[0]*=r,n[4]*=i,n[8]*=o,n[1]*=r,n[5]*=i,n[9]*=o,n[2]*=r,n[6]*=i,n[10]*=o,n[3]*=r,n[7]*=i,n[11]*=o,this}getMaxScaleOnAxis(){const e=this.elements,n=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(n,r,i))}makeTranslation(e,n,r){return this.set(1,0,0,e,0,1,0,n,0,0,1,r,0,0,0,1),this}makeRotationX(e){const n=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,n,-r,0,0,r,n,0,0,0,0,1),this}makeRotationY(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,0,r,0,0,1,0,0,-r,0,n,0,0,0,0,1),this}makeRotationZ(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,-r,0,0,r,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){const r=Math.cos(n),i=Math.sin(n),o=1-r,a=e.x,s=e.y,l=e.z,c=o*a,u=o*s;return this.set(c*a+r,c*s-i*l,c*l+i*s,0,c*s+i*l,u*s+r,u*l-i*a,0,c*l-i*s,u*l+i*a,o*l*l+r,0,0,0,0,1),this}makeScale(e,n,r){return this.set(e,0,0,0,0,n,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,n,r,i,o,a){return this.set(1,r,o,0,e,1,a,0,n,i,1,0,0,0,0,1),this}compose(e,n,r){const i=this.elements,o=n._x,a=n._y,s=n._z,l=n._w,c=o+o,u=a+a,f=s+s,d=o*c,h=o*u,p=o*f,m=a*u,g=a*f,v=s*f,y=l*c,x=l*u,b=l*f,_=r.x,S=r.y,O=r.z;return i[0]=(1-(m+v))*_,i[1]=(h+b)*_,i[2]=(p-x)*_,i[3]=0,i[4]=(h-b)*S,i[5]=(1-(d+v))*S,i[6]=(g+y)*S,i[7]=0,i[8]=(p+x)*O,i[9]=(g-y)*O,i[10]=(1-(d+m))*O,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,n,r){const i=this.elements;let o=gm.set(i[0],i[1],i[2]).length();const a=gm.set(i[4],i[5],i[6]).length(),s=gm.set(i[8],i[9],i[10]).length();this.determinant()<0&&(o=-o),e.x=i[12],e.y=i[13],e.z=i[14],ks.copy(this);const c=1/o,u=1/a,f=1/s;return ks.elements[0]*=c,ks.elements[1]*=c,ks.elements[2]*=c,ks.elements[4]*=u,ks.elements[5]*=u,ks.elements[6]*=u,ks.elements[8]*=f,ks.elements[9]*=f,ks.elements[10]*=f,n.setFromRotationMatrix(ks),r.x=o,r.y=a,r.z=s,this}makePerspective(e,n,r,i,o,a){const s=this.elements,l=2*o/(n-e),c=2*o/(r-i),u=(n+e)/(n-e),f=(r+i)/(r-i),d=-(a+o)/(a-o),h=-2*a*o/(a-o);return s[0]=l,s[4]=0,s[8]=u,s[12]=0,s[1]=0,s[5]=c,s[9]=f,s[13]=0,s[2]=0,s[6]=0,s[10]=d,s[14]=h,s[3]=0,s[7]=0,s[11]=-1,s[15]=0,this}makeOrthographic(e,n,r,i,o,a){const s=this.elements,l=1/(n-e),c=1/(r-i),u=1/(a-o),f=(n+e)*l,d=(r+i)*c,h=(a+o)*u;return s[0]=2*l,s[4]=0,s[8]=0,s[12]=-f,s[1]=0,s[5]=2*c,s[9]=0,s[13]=-d,s[2]=0,s[6]=0,s[10]=-2*u,s[14]=-h,s[3]=0,s[7]=0,s[11]=0,s[15]=1,this}equals(e){const n=this.elements,r=e.elements;for(let i=0;i<16;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<16;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){const r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e[n+9]=r[9],e[n+10]=r[10],e[n+11]=r[11],e[n+12]=r[12],e[n+13]=r[13],e[n+14]=r[14],e[n+15]=r[15],e}}const gm=new Se,ks=new Gn,ezt=new Se(0,0,0),tzt=new Se(1,1,1),ju=new Se,LO=new Se,Jo=new Se,DZ=new Gn,LZ=new hp;class Mw{constructor(e=0,n=0,r=0,i=Mw.DefaultOrder){this.isEuler=!0,this._x=e,this._y=n,this._z=r,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,n,r,i=this._order){return this._x=e,this._y=n,this._z=r,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,n=this._order,r=!0){const i=e.elements,o=i[0],a=i[4],s=i[8],l=i[1],c=i[5],u=i[9],f=i[2],d=i[6],h=i[10];switch(n){case"XYZ":this._y=Math.asin(Po(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-u,h),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Po(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(s,h),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-f,o),this._z=0);break;case"ZXY":this._x=Math.asin(Po(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-f,h),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,o));break;case"ZYX":this._y=Math.asin(-Po(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(d,h),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(Po(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-f,o)):(this._x=0,this._y=Math.atan2(s,h));break;case"XZY":this._z=Math.asin(-Po(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(s,o)):(this._x=Math.atan2(-u,h),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,r===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,r){return DZ.makeRotationFromQuaternion(e),this.setFromRotationMatrix(DZ,n,r)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return LZ.setFromEuler(this),this.setFromQuaternion(LZ,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}toVector3(){console.error("THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead")}}Mw.DefaultOrder="XYZ";Mw.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class Iye{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let n=0;n1){for(let r=0;r0){i.children=[];for(let s=0;s0){i.animations=[];for(let s=0;s0&&(r.geometries=s),l.length>0&&(r.materials=l),c.length>0&&(r.textures=c),u.length>0&&(r.images=u),f.length>0&&(r.shapes=f),d.length>0&&(r.skeletons=d),h.length>0&&(r.animations=h),p.length>0&&(r.nodes=p)}return r.object=i,r;function a(s){const l=[];for(const c in s){const u=s[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),n===!0)for(let r=0;r0?i.multiplyScalar(1/Math.sqrt(o)):i.set(0,0,0)}static getBarycoord(e,n,r,i,o){As.subVectors(i,n),xc.subVectors(r,n),ZI.subVectors(e,n);const a=As.dot(As),s=As.dot(xc),l=As.dot(ZI),c=xc.dot(xc),u=xc.dot(ZI),f=a*c-s*s;if(f===0)return o.set(-2,-1,-1);const d=1/f,h=(c*l-s*u)*d,p=(a*u-s*l)*d;return o.set(1-h-p,p,h)}static containsPoint(e,n,r,i){return this.getBarycoord(e,n,r,i,bc),bc.x>=0&&bc.y>=0&&bc.x+bc.y<=1}static getUV(e,n,r,i,o,a,s,l){return this.getBarycoord(e,n,r,i,bc),l.set(0,0),l.addScaledVector(o,bc.x),l.addScaledVector(a,bc.y),l.addScaledVector(s,bc.z),l}static isFrontFacing(e,n,r,i){return As.subVectors(r,n),xc.subVectors(e,n),As.cross(xc).dot(i)<0}set(e,n,r){return this.a.copy(e),this.b.copy(n),this.c.copy(r),this}setFromPointsAndIndices(e,n,r,i){return this.a.copy(e[n]),this.b.copy(e[r]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,n,r,i){return this.a.fromBufferAttribute(e,n),this.b.fromBufferAttribute(e,r),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return As.subVectors(this.c,this.b),xc.subVectors(this.a,this.b),As.cross(xc).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Bc.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return Bc.getBarycoord(e,this.a,this.b,this.c,n)}getUV(e,n,r,i,o){return Bc.getUV(e,this.a,this.b,this.c,n,r,i,o)}containsPoint(e){return Bc.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Bc.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){const r=this.a,i=this.b,o=this.c;let a,s;ym.subVectors(i,r),xm.subVectors(o,r),JI.subVectors(e,r);const l=ym.dot(JI),c=xm.dot(JI);if(l<=0&&c<=0)return n.copy(r);eD.subVectors(e,i);const u=ym.dot(eD),f=xm.dot(eD);if(u>=0&&f<=u)return n.copy(i);const d=l*f-u*c;if(d<=0&&l>=0&&u<=0)return a=l/(l-u),n.copy(r).addScaledVector(ym,a);tD.subVectors(e,o);const h=ym.dot(tD),p=xm.dot(tD);if(p>=0&&h<=p)return n.copy(o);const m=h*c-l*p;if(m<=0&&c>=0&&p<=0)return s=c/(c-p),n.copy(r).addScaledVector(xm,s);const g=u*p-h*f;if(g<=0&&f-u>=0&&h-p>=0)return zZ.subVectors(o,i),s=(f-u)/(f-u+(h-p)),n.copy(i).addScaledVector(zZ,s);const v=1/(g+m+d);return a=m*v,s=d*v,n.copy(r).addScaledVector(ym,a).addScaledVector(xm,s)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let azt=0;class kw extends jp{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:azt++}),this.uuid=Pw(),this.name="",this.type="Material",this.blending=Lg,this.side=Av,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=bye,this.blendDst=_ye,this.blendEquation=Fm,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=hF,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=YBt,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=jI,this.stencilZFail=jI,this.stencilZPass=jI,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const n in e){const r=e[n];if(r===void 0){console.warn("THREE.Material: '"+n+"' parameter is undefined.");continue}const i=this[n];if(i===void 0){console.warn("THREE."+this.type+": '"+n+"' is not a property of this material.");continue}i&&i.isColor?i.set(r):i&&i.isVector3&&r&&r.isVector3?i.copy(r):this[n]=r}}toJSON(e){const n=e===void 0||typeof e=="string";n&&(e={textures:{},images:{}});const r={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),this.roughness!==void 0&&(r.roughness=this.roughness),this.metalness!==void 0&&(r.metalness=this.metalness),this.sheen!==void 0&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(r.shininess=this.shininess),this.clearcoat!==void 0&&(r.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(r.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(r.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(e).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(r.combine=this.combine)),this.envMapIntensity!==void 0&&(r.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(r.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&(r.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(r.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(r.size=this.size),this.shadowSide!==null&&(r.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==Lg&&(r.blending=this.blending),this.side!==Av&&(r.side=this.side),this.vertexColors&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),this.transparent===!0&&(r.transparent=this.transparent),r.depthFunc=this.depthFunc,r.depthTest=this.depthTest,r.depthWrite=this.depthWrite,r.colorWrite=this.colorWrite,r.stencilWrite=this.stencilWrite,r.stencilWriteMask=this.stencilWriteMask,r.stencilFunc=this.stencilFunc,r.stencilRef=this.stencilRef,r.stencilFuncMask=this.stencilFuncMask,r.stencilFail=this.stencilFail,r.stencilZFail=this.stencilZFail,r.stencilZPass=this.stencilZPass,this.rotation!==void 0&&this.rotation!==0&&(r.rotation=this.rotation),this.polygonOffset===!0&&(r.polygonOffset=!0),this.polygonOffsetFactor!==0&&(r.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(r.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(r.linewidth=this.linewidth),this.dashSize!==void 0&&(r.dashSize=this.dashSize),this.gapSize!==void 0&&(r.gapSize=this.gapSize),this.scale!==void 0&&(r.scale=this.scale),this.dithering===!0&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(r.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(r.wireframe=this.wireframe),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(r.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(r.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(r.flatShading=this.flatShading),this.visible===!1&&(r.visible=!1),this.toneMapped===!1&&(r.toneMapped=!1),this.fog===!1&&(r.fog=!1),JSON.stringify(this.userData)!=="{}"&&(r.userData=this.userData);function i(o){const a=[];for(const s in o){const l=o[s];delete l.metadata,a.push(l)}return a}if(n){const o=i(e.textures),a=i(e.images);o.length>0&&(r.textures=o),a.length>0&&(r.images=a)}return r}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const n=e.clippingPlanes;let r=null;if(n!==null){const i=n.length;r=new Array(i);for(let o=0;o!==i;++o)r[o]=n[o].clone()}return this.clippingPlanes=r,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class u6 extends kw{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new sr(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=wye,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Ir=new Se,NO=new Ht;class os{constructor(e,n,r){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=n,this.count=e!==void 0?e.length/n:0,this.normalized=r===!0,this.usage=PZ,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this}copyAt(e,n,r){e*=this.itemSize,r*=n.itemSize;for(let i=0,o=this.itemSize;i0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const n=this.index;n!==null&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});const r=this.attributes;for(const l in r){const c=r[l];e.data.attributes[l]=c.toJSON(e.data)}const i={};let o=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let f=0,d=c.length;f0&&(i[l]=u,o=!0)}o&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const s=this.boundingSphere;return s!==null&&(e.data.boundingSphere={center:s.center.toArray(),radius:s.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const n={};this.name=e.name;const r=e.index;r!==null&&this.setIndex(r.clone(n));const i=e.attributes;for(const c in i){const u=i[c];this.setAttribute(c,u.clone(n))}const o=e.morphAttributes;for(const c in o){const u=[],f=o[c];for(let d=0,h=f.length;d0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,a=i.length;on.far?null:{distance:c,point:VO.clone(),object:t}}function GO(t,e,n,r,i,o,a,s,l,c,u,f){Bu.fromBufferAttribute(i,c),zu.fromBufferAttribute(i,u),Uu.fromBufferAttribute(i,f);const d=t.morphTargetInfluences;if(o&&d){FO.set(0,0,0),jO.set(0,0,0),BO.set(0,0,0);for(let p=0,m=o.length;p0?1:-1,u.push(U.x,U.y,U.z),f.push(D/O),f.push(1-N/C),B+=1}}for(let N=0;N>8&255]+Fi[t>>16&255]+Fi[t>>24&255]+"-"+Fi[e&255]+Fi[e>>8&255]+"-"+Fi[e>>16&15|64]+Fi[e>>24&255]+"-"+Fi[n&63|128]+Fi[n>>8&255]+"-"+Fi[n>>16&255]+Fi[n>>24&255]+Fi[r&255]+Fi[r>>8&255]+Fi[r>>16&255]+Fi[r>>24&255]).toLowerCase()}function Po(t,e,n){return Math.max(e,Math.min(n,t))}function JBt(t,e){return(t%e+e)%e}function UI(t,e,n){return(1-n)*t+n*e}function IZ(t){return(t&t-1)===0&&t!==0}function bF(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function EO(t,e){switch(e.constructor){case Float32Array:return t;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function Zo(t,e){switch(e.constructor){case Float32Array:return t;case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("Invalid component type.")}}class Ht{constructor(e=0,n=0){Ht.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const n=this.x,r=this.y,i=e.elements;return this.x=i[0]*n+i[3]*r+i[6],this.y=i[1]*n+i[4]*r+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(n,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y;return n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){const r=Math.cos(n),i=Math.sin(n),o=this.x-e.x,a=this.y-e.y;return this.x=o*r-a*i+e.x,this.y=o*i+a*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class va{constructor(){va.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1]}set(e,n,r,i,o,a,s,l,c){const u=this.elements;return u[0]=e,u[1]=i,u[2]=s,u[3]=n,u[4]=o,u[5]=l,u[6]=r,u[7]=a,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],this}extractBasis(e,n,r){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const r=e.elements,i=n.elements,o=this.elements,a=r[0],s=r[3],l=r[6],c=r[1],u=r[4],f=r[7],d=r[2],h=r[5],p=r[8],m=i[0],g=i[3],v=i[6],y=i[1],x=i[4],b=i[7],_=i[2],S=i[5],O=i[8];return o[0]=a*m+s*y+l*_,o[3]=a*g+s*x+l*S,o[6]=a*v+s*b+l*O,o[1]=c*m+u*y+f*_,o[4]=c*g+u*x+f*S,o[7]=c*v+u*b+f*O,o[2]=d*m+h*y+p*_,o[5]=d*g+h*x+p*S,o[8]=d*v+h*b+p*O,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8];return n*a*u-n*s*c-r*o*u+r*s*l+i*o*c-i*a*l}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8],f=u*a-s*c,d=s*l-u*o,h=c*o-a*l,p=n*f+r*d+i*h;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);const m=1/p;return e[0]=f*m,e[1]=(i*c-u*r)*m,e[2]=(s*r-i*a)*m,e[3]=d*m,e[4]=(u*n-i*l)*m,e[5]=(i*o-s*n)*m,e[6]=h*m,e[7]=(r*l-c*n)*m,e[8]=(a*n-r*o)*m,this}transpose(){let e;const n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,n,r,i,o,a,s){const l=Math.cos(o),c=Math.sin(o);return this.set(r*l,r*c,-r*(l*a+c*s)+a+e,-i*c,i*l,-i*(-c*a+l*s)+s+n,0,0,1),this}scale(e,n){const r=this.elements;return r[0]*=e,r[3]*=e,r[6]*=e,r[1]*=n,r[4]*=n,r[7]*=n,this}rotate(e){const n=Math.cos(e),r=Math.sin(e),i=this.elements,o=i[0],a=i[3],s=i[6],l=i[1],c=i[4],u=i[7];return i[0]=n*o+r*l,i[3]=n*a+r*c,i[6]=n*s+r*u,i[1]=-r*o+n*l,i[4]=-r*a+n*c,i[7]=-r*s+n*u,this}translate(e,n){const r=this.elements;return r[0]+=e*r[2],r[3]+=e*r[5],r[6]+=e*r[8],r[1]+=n*r[2],r[4]+=n*r[5],r[7]+=n*r[8],this}equals(e){const n=this.elements,r=e.elements;for(let i=0;i<9;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<9;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){const r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e}clone(){return new this.constructor().fromArray(this.elements)}}function Eye(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}function J_(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function zh(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function GC(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}const WI={[Mc]:{[Ch]:zh},[Ch]:{[Mc]:GC}},Ps={legacyMode:!0,get workingColorSpace(){return Ch},set workingColorSpace(t){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(t,e,n){if(this.legacyMode||e===n||!e||!n)return t;if(WI[e]&&WI[e][n]!==void 0){const r=WI[e][n];return t.r=r(t.r),t.g=r(t.g),t.b=r(t.b),t}throw new Error("Unsupported color space conversion.")},fromWorkingColorSpace:function(t,e){return this.convert(t,this.workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this.workingColorSpace)}},Pye={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},Xr={r:0,g:0,b:0},Ms={h:0,s:0,l:0},PO={h:0,s:0,l:0};function VI(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*6*(2/3-n):t}function MO(t,e){return e.r=t.r,e.g=t.g,e.b=t.b,e}class sr{constructor(e,n,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,n===void 0&&r===void 0?this.set(e):this.setRGB(e,n,r)}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=Mc){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Ps.toWorkingColorSpace(this,n),this}setRGB(e,n,r,i=Ch){return this.r=e,this.g=n,this.b=r,Ps.toWorkingColorSpace(this,i),this}setHSL(e,n,r,i=Ch){if(e=JBt(e,1),n=Po(n,0,1),r=Po(r,0,1),n===0)this.r=this.g=this.b=r;else{const o=r<=.5?r*(1+n):r+n-r*n,a=2*r-o;this.r=VI(a,o,e+1/3),this.g=VI(a,o,e),this.b=VI(a,o,e-1/3)}return Ps.toWorkingColorSpace(this,i),this}setStyle(e,n=Mc){function r(o){o!==void 0&&parseFloat(o)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let o;const a=i[1],s=i[2];switch(a){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.r=Math.min(255,parseInt(o[1],10))/255,this.g=Math.min(255,parseInt(o[2],10))/255,this.b=Math.min(255,parseInt(o[3],10))/255,Ps.toWorkingColorSpace(this,n),r(o[4]),this;if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.r=Math.min(100,parseInt(o[1],10))/100,this.g=Math.min(100,parseInt(o[2],10))/100,this.b=Math.min(100,parseInt(o[3],10))/100,Ps.toWorkingColorSpace(this,n),r(o[4]),this;break;case"hsl":case"hsla":if(o=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s)){const l=parseFloat(o[1])/360,c=parseFloat(o[2])/100,u=parseFloat(o[3])/100;return r(o[4]),this.setHSL(l,c,u,n)}break}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const o=i[1],a=o.length;if(a===3)return this.r=parseInt(o.charAt(0)+o.charAt(0),16)/255,this.g=parseInt(o.charAt(1)+o.charAt(1),16)/255,this.b=parseInt(o.charAt(2)+o.charAt(2),16)/255,Ps.toWorkingColorSpace(this,n),this;if(a===6)return this.r=parseInt(o.charAt(0)+o.charAt(1),16)/255,this.g=parseInt(o.charAt(2)+o.charAt(3),16)/255,this.b=parseInt(o.charAt(4)+o.charAt(5),16)/255,Ps.toWorkingColorSpace(this,n),this}return e&&e.length>0?this.setColorName(e,n):this}setColorName(e,n=Mc){const r=Pye[e.toLowerCase()];return r!==void 0?this.setHex(r,n):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=zh(e.r),this.g=zh(e.g),this.b=zh(e.b),this}copyLinearToSRGB(e){return this.r=GC(e.r),this.g=GC(e.g),this.b=GC(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Mc){return Ps.fromWorkingColorSpace(MO(this,Xr),e),Po(Xr.r*255,0,255)<<16^Po(Xr.g*255,0,255)<<8^Po(Xr.b*255,0,255)<<0}getHexString(e=Mc){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=Ch){Ps.fromWorkingColorSpace(MO(this,Xr),n);const r=Xr.r,i=Xr.g,o=Xr.b,a=Math.max(r,i,o),s=Math.min(r,i,o);let l,c;const u=(s+a)/2;if(s===a)l=0,c=0;else{const f=a-s;switch(c=u<=.5?f/(a+s):f/(2-a-s),a){case r:l=(i-o)/f+(i"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{dm===void 0&&(dm=J_("canvas")),dm.width=e.width,dm.height=e.height;const r=dm.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),n=dm}return n.width>2048||n.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),n.toDataURL("image/jpeg",.6)):n.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const n=J_("canvas");n.width=e.width,n.height=e.height;const r=n.getContext("2d");r.drawImage(e,0,0,e.width,e.height);const i=r.getImageData(0,0,e.width,e.height),o=i.data;for(let a=0;a1)switch(this.wrapS){case vF:e.x=e.x-Math.floor(e.x);break;case Ha:e.x=e.x<0?0:1;break;case yF:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case vF:e.y=e.y-Math.floor(e.y);break;case Ha:e.y=e.y<0?0:1;break;case yF:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}}Ta.DEFAULT_IMAGE=null;Ta.DEFAULT_MAPPING=Oye;class Ri{constructor(e=0,n=0,r=0,i=1){Ri.prototype.isVector4=!0,this.x=e,this.y=n,this.z=r,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,n,r,i){return this.x=e,this.y=n,this.z=r,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const n=this.x,r=this.y,i=this.z,o=this.w,a=e.elements;return this.x=a[0]*n+a[4]*r+a[8]*i+a[12]*o,this.y=a[1]*n+a[5]*r+a[9]*i+a[13]*o,this.z=a[2]*n+a[6]*r+a[10]*i+a[14]*o,this.w=a[3]*n+a[7]*r+a[11]*i+a[15]*o,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this}setAxisAngleFromRotationMatrix(e){let n,r,i,o;const l=e.elements,c=l[0],u=l[4],f=l[8],d=l[1],h=l[5],p=l[9],m=l[2],g=l[6],v=l[10];if(Math.abs(u-d)<.01&&Math.abs(f-m)<.01&&Math.abs(p-g)<.01){if(Math.abs(u+d)<.1&&Math.abs(f+m)<.1&&Math.abs(p+g)<.1&&Math.abs(c+h+v-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const x=(c+1)/2,b=(h+1)/2,_=(v+1)/2,S=(u+d)/4,O=(f+m)/4,C=(p+g)/4;return x>b&&x>_?x<.01?(r=0,i=.707106781,o=.707106781):(r=Math.sqrt(x),i=S/r,o=O/r):b>_?b<.01?(r=.707106781,i=0,o=.707106781):(i=Math.sqrt(b),r=S/i,o=C/i):_<.01?(r=.707106781,i=.707106781,o=0):(o=Math.sqrt(_),r=O/o,i=C/o),this.set(r,i,o,n),this}let y=Math.sqrt((g-p)*(g-p)+(f-m)*(f-m)+(d-u)*(d-u));return Math.abs(y)<.001&&(y=1),this.x=(g-p)/y,this.y=(f-m)/y,this.z=(d-u)/y,this.w=Math.acos((c+h+v-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this.w=Math.max(e.w,Math.min(n.w,this.w)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this.w=Math.max(e,Math.min(n,this.w)),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(n,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this.w=e.w+(n.w-e.w)*r,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.getW(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class dp extends jp{constructor(e,n,r={}){super(),this.isWebGLRenderTarget=!0,this.width=e,this.height=n,this.depth=1,this.scissor=new Ri(0,0,e,n),this.scissorTest=!1,this.viewport=new Ri(0,0,e,n);const i={width:e,height:n,depth:1};this.texture=new Ta(i,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.encoding),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=r.generateMipmaps!==void 0?r.generateMipmaps:!1,this.texture.internalFormat=r.internalFormat!==void 0?r.internalFormat:null,this.texture.minFilter=r.minFilter!==void 0?r.minFilter:Eo,this.depthBuffer=r.depthBuffer!==void 0?r.depthBuffer:!0,this.stencilBuffer=r.stencilBuffer!==void 0?r.stencilBuffer:!1,this.depthTexture=r.depthTexture!==void 0?r.depthTexture:null,this.samples=r.samples!==void 0?r.samples:0}setSize(e,n,r=1){(this.width!==e||this.height!==n||this.depth!==r)&&(this.width=e,this.height=n,this.depth=r,this.texture.image.width=e,this.texture.image.height=n,this.texture.image.depth=r,this.dispose()),this.viewport.set(0,0,e,n),this.scissor.set(0,0,e,n)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const n=Object.assign({},e.texture.image);return this.texture.source=new kye(n),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Aye extends Ta{constructor(e=null,n=1,r=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:n,height:r,depth:i},this.magFilter=To,this.minFilter=To,this.wrapR=Ha,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Rye extends Ta{constructor(e=null,n=1,r=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:n,height:r,depth:i},this.magFilter=To,this.minFilter=To,this.wrapR=Ha,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class hp{constructor(e=0,n=0,r=0,i=1){this.isQuaternion=!0,this._x=e,this._y=n,this._z=r,this._w=i}static slerpFlat(e,n,r,i,o,a,s){let l=r[i+0],c=r[i+1],u=r[i+2],f=r[i+3];const d=o[a+0],h=o[a+1],p=o[a+2],m=o[a+3];if(s===0){e[n+0]=l,e[n+1]=c,e[n+2]=u,e[n+3]=f;return}if(s===1){e[n+0]=d,e[n+1]=h,e[n+2]=p,e[n+3]=m;return}if(f!==m||l!==d||c!==h||u!==p){let g=1-s;const v=l*d+c*h+u*p+f*m,y=v>=0?1:-1,x=1-v*v;if(x>Number.EPSILON){const _=Math.sqrt(x),S=Math.atan2(_,v*y);g=Math.sin(g*S)/_,s=Math.sin(s*S)/_}const b=s*y;if(l=l*g+d*b,c=c*g+h*b,u=u*g+p*b,f=f*g+m*b,g===1-s){const _=1/Math.sqrt(l*l+c*c+u*u+f*f);l*=_,c*=_,u*=_,f*=_}}e[n]=l,e[n+1]=c,e[n+2]=u,e[n+3]=f}static multiplyQuaternionsFlat(e,n,r,i,o,a){const s=r[i],l=r[i+1],c=r[i+2],u=r[i+3],f=o[a],d=o[a+1],h=o[a+2],p=o[a+3];return e[n]=s*p+u*f+l*h-c*d,e[n+1]=l*p+u*d+c*f-s*h,e[n+2]=c*p+u*h+s*d-l*f,e[n+3]=u*p-s*f-l*d-c*h,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,n,r,i){return this._x=e,this._y=n,this._z=r,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,n){const r=e._x,i=e._y,o=e._z,a=e._order,s=Math.cos,l=Math.sin,c=s(r/2),u=s(i/2),f=s(o/2),d=l(r/2),h=l(i/2),p=l(o/2);switch(a){case"XYZ":this._x=d*u*f+c*h*p,this._y=c*h*f-d*u*p,this._z=c*u*p+d*h*f,this._w=c*u*f-d*h*p;break;case"YXZ":this._x=d*u*f+c*h*p,this._y=c*h*f-d*u*p,this._z=c*u*p-d*h*f,this._w=c*u*f+d*h*p;break;case"ZXY":this._x=d*u*f-c*h*p,this._y=c*h*f+d*u*p,this._z=c*u*p+d*h*f,this._w=c*u*f-d*h*p;break;case"ZYX":this._x=d*u*f-c*h*p,this._y=c*h*f+d*u*p,this._z=c*u*p-d*h*f,this._w=c*u*f+d*h*p;break;case"YZX":this._x=d*u*f+c*h*p,this._y=c*h*f+d*u*p,this._z=c*u*p-d*h*f,this._w=c*u*f-d*h*p;break;case"XZY":this._x=d*u*f-c*h*p,this._y=c*h*f-d*u*p,this._z=c*u*p+d*h*f,this._w=c*u*f+d*h*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return n!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,n){const r=n/2,i=Math.sin(r);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(e){const n=e.elements,r=n[0],i=n[4],o=n[8],a=n[1],s=n[5],l=n[9],c=n[2],u=n[6],f=n[10],d=r+s+f;if(d>0){const h=.5/Math.sqrt(d+1);this._w=.25/h,this._x=(u-l)*h,this._y=(o-c)*h,this._z=(a-i)*h}else if(r>s&&r>f){const h=2*Math.sqrt(1+r-s-f);this._w=(u-l)/h,this._x=.25*h,this._y=(i+a)/h,this._z=(o+c)/h}else if(s>f){const h=2*Math.sqrt(1+s-r-f);this._w=(o-c)/h,this._x=(i+a)/h,this._y=.25*h,this._z=(l+u)/h}else{const h=2*Math.sqrt(1+f-r-s);this._w=(a-i)/h,this._x=(o+c)/h,this._y=(l+u)/h,this._z=.25*h}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let r=e.dot(n)+1;return rMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(this._x=e.y*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Po(this.dot(e),-1,1)))}rotateTowards(e,n){const r=this.angleTo(e);if(r===0)return this;const i=Math.min(1,n/r);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,n){const r=e._x,i=e._y,o=e._z,a=e._w,s=n._x,l=n._y,c=n._z,u=n._w;return this._x=r*u+a*s+i*c-o*l,this._y=i*u+a*l+o*s-r*c,this._z=o*u+a*c+r*l-i*s,this._w=a*u-r*s-i*l-o*c,this._onChangeCallback(),this}slerp(e,n){if(n===0)return this;if(n===1)return this.copy(e);const r=this._x,i=this._y,o=this._z,a=this._w;let s=a*e._w+r*e._x+i*e._y+o*e._z;if(s<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,s=-s):this.copy(e),s>=1)return this._w=a,this._x=r,this._y=i,this._z=o,this;const l=1-s*s;if(l<=Number.EPSILON){const h=1-n;return this._w=h*a+n*this._w,this._x=h*r+n*this._x,this._y=h*i+n*this._y,this._z=h*o+n*this._z,this.normalize(),this._onChangeCallback(),this}const c=Math.sqrt(l),u=Math.atan2(c,s),f=Math.sin((1-n)*u)/c,d=Math.sin(n*u)/c;return this._w=a*f+this._w*d,this._x=r*f+this._x*d,this._y=i*f+this._y*d,this._z=o*f+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,n,r){return this.copy(e).slerp(n,r)}random(){const e=Math.random(),n=Math.sqrt(1-e),r=Math.sqrt(e),i=2*Math.PI*Math.random(),o=2*Math.PI*Math.random();return this.set(n*Math.cos(i),r*Math.sin(o),r*Math.cos(o),n*Math.sin(i))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Se{constructor(e=0,n=0,r=0){Se.prototype.isVector3=!0,this.x=e,this.y=n,this.z=r}set(e,n,r){return r===void 0&&(r=this.z),this.x=e,this.y=n,this.z=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(DZ.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(DZ.setFromAxisAngle(e,n))}applyMatrix3(e){const n=this.x,r=this.y,i=this.z,o=e.elements;return this.x=o[0]*n+o[3]*r+o[6]*i,this.y=o[1]*n+o[4]*r+o[7]*i,this.z=o[2]*n+o[5]*r+o[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const n=this.x,r=this.y,i=this.z,o=e.elements,a=1/(o[3]*n+o[7]*r+o[11]*i+o[15]);return this.x=(o[0]*n+o[4]*r+o[8]*i+o[12])*a,this.y=(o[1]*n+o[5]*r+o[9]*i+o[13])*a,this.z=(o[2]*n+o[6]*r+o[10]*i+o[14])*a,this}applyQuaternion(e){const n=this.x,r=this.y,i=this.z,o=e.x,a=e.y,s=e.z,l=e.w,c=l*n+a*i-s*r,u=l*r+s*n-o*i,f=l*i+o*r-a*n,d=-o*n-a*r-s*i;return this.x=c*l+d*-o+u*-s-f*-a,this.y=u*l+d*-a+f*-o-c*-s,this.z=f*l+d*-s+c*-a-u*-o,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const n=this.x,r=this.y,i=this.z,o=e.elements;return this.x=o[0]*n+o[4]*r+o[8]*i,this.y=o[1]*n+o[5]*r+o[9]*i,this.z=o[2]*n+o[6]*r+o[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(n,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){const r=e.x,i=e.y,o=e.z,a=n.x,s=n.y,l=n.z;return this.x=i*l-o*s,this.y=o*a-r*l,this.z=r*s-i*a,this}projectOnVector(e){const n=e.lengthSq();if(n===0)return this.set(0,0,0);const r=e.dot(this)/n;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return HI.copy(this).projectOnVector(e),this.sub(HI)}reflect(e){return this.sub(HI.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const r=this.dot(e)/n;return Math.acos(Po(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y,i=this.z-e.z;return n*n+r*r+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,n,r){const i=Math.sin(n)*e;return this.x=i*Math.sin(r),this.y=Math.cos(n)*e,this.z=i*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,r){return this.x=e*Math.sin(n),this.y=r,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){const n=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=r,this.z=i,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=(Math.random()-.5)*2,n=Math.random()*Math.PI*2,r=Math.sqrt(1-e**2);return this.x=r*Math.cos(n),this.y=r*Math.sin(n),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const HI=new Se,DZ=new hp;class Gy{constructor(e=new Se(1/0,1/0,1/0),n=new Se(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=n}set(e,n){return this.min.copy(e),this.max.copy(n),this}setFromArray(e){let n=1/0,r=1/0,i=1/0,o=-1/0,a=-1/0,s=-1/0;for(let l=0,c=e.length;lo&&(o=u),f>a&&(a=f),d>s&&(s=d)}return this.min.set(n,r,i),this.max.set(o,a,s),this}setFromBufferAttribute(e){let n=1/0,r=1/0,i=1/0,o=-1/0,a=-1/0,s=-1/0;for(let l=0,c=e.count;lo&&(o=u),f>a&&(a=f),d>s&&(s=d)}return this.min.set(n,r,i),this.max.set(o,a,s),this}setFromPoints(e){this.makeEmpty();for(let n=0,r=e.length;nthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Bd),Bd.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,r;return e.normal.x>0?(n=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),n<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(V0),kO.subVectors(this.max,V0),hm.subVectors(e.a,V0),pm.subVectors(e.b,V0),mm.subVectors(e.c,V0),$u.subVectors(pm,hm),Nu.subVectors(mm,pm),zd.subVectors(hm,mm);let n=[0,-$u.z,$u.y,0,-Nu.z,Nu.y,0,-zd.z,zd.y,$u.z,0,-$u.x,Nu.z,0,-Nu.x,zd.z,0,-zd.x,-$u.y,$u.x,0,-Nu.y,Nu.x,0,-zd.y,zd.x,0];return!XI(n,hm,pm,mm,kO)||(n=[1,0,0,0,1,0,0,0,1],!XI(n,hm,pm,mm,kO))?!1:(AO.crossVectors($u,Nu),n=[AO.x,AO.y,AO.z],XI(n,hm,pm,mm,kO))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return Bd.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=this.getSize(Bd).length()*.5,e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(gc[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),gc[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),gc[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),gc[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),gc[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),gc[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),gc[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),gc[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(gc),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const gc=[new Se,new Se,new Se,new Se,new Se,new Se,new Se,new Se],Bd=new Se,qI=new Gy,hm=new Se,pm=new Se,mm=new Se,$u=new Se,Nu=new Se,zd=new Se,V0=new Se,kO=new Se,AO=new Se,Ud=new Se;function XI(t,e,n,r,i){for(let o=0,a=t.length-3;o<=a;o+=3){Ud.fromArray(t,o);const s=i.x*Math.abs(Ud.x)+i.y*Math.abs(Ud.y)+i.z*Math.abs(Ud.z),l=e.dot(Ud),c=n.dot(Ud),u=r.dot(Ud);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>s)return!1}return!0}const tzt=new Gy,LZ=new Se,RO=new Se,QI=new Se;class Ek{constructor(e=new Se,n=-1){this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}setFromPoints(e,n){const r=this.center;n!==void 0?r.copy(n):tzt.setFromPoints(e).getCenter(r);let i=0;for(let o=0,a=e.length;othis.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){QI.subVectors(e,this.center);const n=QI.lengthSq();if(n>this.radius*this.radius){const r=Math.sqrt(n),i=(r-this.radius)*.5;this.center.add(QI.multiplyScalar(i/r)),this.radius+=i}return this}union(e){return this.center.equals(e.center)===!0?RO.set(0,0,1).multiplyScalar(e.radius):RO.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(LZ.copy(e.center).add(RO)),this.expandByPoint(LZ.copy(e.center).sub(RO)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const vc=new Se,YI=new Se,IO=new Se,Fu=new Se,KI=new Se,DO=new Se,ZI=new Se;class Iye{constructor(e=new Se,n=new Se(0,0,-1)){this.origin=e,this.direction=n}set(e,n){return this.origin.copy(e),this.direction.copy(n),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,n){return n.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,vc)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);const r=n.dot(this.direction);return r<0?n.copy(this.origin):n.copy(this.direction).multiplyScalar(r).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const n=vc.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(vc.copy(this.direction).multiplyScalar(n).add(this.origin),vc.distanceToSquared(e))}distanceSqToSegment(e,n,r,i){YI.copy(e).add(n).multiplyScalar(.5),IO.copy(n).sub(e).normalize(),Fu.copy(this.origin).sub(YI);const o=e.distanceTo(n)*.5,a=-this.direction.dot(IO),s=Fu.dot(this.direction),l=-Fu.dot(IO),c=Fu.lengthSq(),u=Math.abs(1-a*a);let f,d,h,p;if(u>0)if(f=a*l-s,d=a*s-l,p=o*u,f>=0)if(d>=-p)if(d<=p){const m=1/u;f*=m,d*=m,h=f*(f+a*d+2*s)+d*(a*f+d+2*l)+c}else d=o,f=Math.max(0,-(a*d+s)),h=-f*f+d*(d+2*l)+c;else d=-o,f=Math.max(0,-(a*d+s)),h=-f*f+d*(d+2*l)+c;else d<=-p?(f=Math.max(0,-(-a*o+s)),d=f>0?-o:Math.min(Math.max(-o,-l),o),h=-f*f+d*(d+2*l)+c):d<=p?(f=0,d=Math.min(Math.max(-o,-l),o),h=d*(d+2*l)+c):(f=Math.max(0,-(a*o+s)),d=f>0?o:Math.min(Math.max(-o,-l),o),h=-f*f+d*(d+2*l)+c);else d=a>0?-o:o,f=Math.max(0,-(a*d+s)),h=-f*f+d*(d+2*l)+c;return r&&r.copy(this.direction).multiplyScalar(f).add(this.origin),i&&i.copy(IO).multiplyScalar(d).add(YI),h}intersectSphere(e,n){vc.subVectors(e.center,this.origin);const r=vc.dot(this.direction),i=vc.dot(vc)-r*r,o=e.radius*e.radius;if(i>o)return null;const a=Math.sqrt(o-i),s=r-a,l=r+a;return s<0&&l<0?null:s<0?this.at(l,n):this.at(s,n)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const n=e.normal.dot(this.direction);if(n===0)return e.distanceToPoint(this.origin)===0?0:null;const r=-(this.origin.dot(e.normal)+e.constant)/n;return r>=0?r:null}intersectPlane(e,n){const r=this.distanceToPlane(e);return r===null?null:this.at(r,n)}intersectsPlane(e){const n=e.distanceToPoint(this.origin);return n===0||e.normal.dot(this.direction)*n<0}intersectBox(e,n){let r,i,o,a,s,l;const c=1/this.direction.x,u=1/this.direction.y,f=1/this.direction.z,d=this.origin;return c>=0?(r=(e.min.x-d.x)*c,i=(e.max.x-d.x)*c):(r=(e.max.x-d.x)*c,i=(e.min.x-d.x)*c),u>=0?(o=(e.min.y-d.y)*u,a=(e.max.y-d.y)*u):(o=(e.max.y-d.y)*u,a=(e.min.y-d.y)*u),r>a||o>i||((o>r||r!==r)&&(r=o),(a=0?(s=(e.min.z-d.z)*f,l=(e.max.z-d.z)*f):(s=(e.max.z-d.z)*f,l=(e.min.z-d.z)*f),r>l||s>i)||((s>r||r!==r)&&(r=s),(l=0?r:i,n)}intersectsBox(e){return this.intersectBox(e,vc)!==null}intersectTriangle(e,n,r,i,o){KI.subVectors(n,e),DO.subVectors(r,e),ZI.crossVectors(KI,DO);let a=this.direction.dot(ZI),s;if(a>0){if(i)return null;s=1}else if(a<0)s=-1,a=-a;else return null;Fu.subVectors(this.origin,e);const l=s*this.direction.dot(DO.crossVectors(Fu,DO));if(l<0)return null;const c=s*this.direction.dot(KI.cross(Fu));if(c<0||l+c>a)return null;const u=-s*Fu.dot(ZI);return u<0?null:this.at(u/a,o)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Gn{constructor(){Gn.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(e,n,r,i,o,a,s,l,c,u,f,d,h,p,m,g){const v=this.elements;return v[0]=e,v[4]=n,v[8]=r,v[12]=i,v[1]=o,v[5]=a,v[9]=s,v[13]=l,v[2]=c,v[6]=u,v[10]=f,v[14]=d,v[3]=h,v[7]=p,v[11]=m,v[15]=g,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Gn().fromArray(this.elements)}copy(e){const n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],n[9]=r[9],n[10]=r[10],n[11]=r[11],n[12]=r[12],n[13]=r[13],n[14]=r[14],n[15]=r[15],this}copyPosition(e){const n=this.elements,r=e.elements;return n[12]=r[12],n[13]=r[13],n[14]=r[14],this}setFromMatrix3(e){const n=e.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(e,n,r){return e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(e,n,r){return this.set(e.x,n.x,r.x,0,e.y,n.y,r.y,0,e.z,n.z,r.z,0,0,0,0,1),this}extractRotation(e){const n=this.elements,r=e.elements,i=1/gm.setFromMatrixColumn(e,0).length(),o=1/gm.setFromMatrixColumn(e,1).length(),a=1/gm.setFromMatrixColumn(e,2).length();return n[0]=r[0]*i,n[1]=r[1]*i,n[2]=r[2]*i,n[3]=0,n[4]=r[4]*o,n[5]=r[5]*o,n[6]=r[6]*o,n[7]=0,n[8]=r[8]*a,n[9]=r[9]*a,n[10]=r[10]*a,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){const n=this.elements,r=e.x,i=e.y,o=e.z,a=Math.cos(r),s=Math.sin(r),l=Math.cos(i),c=Math.sin(i),u=Math.cos(o),f=Math.sin(o);if(e.order==="XYZ"){const d=a*u,h=a*f,p=s*u,m=s*f;n[0]=l*u,n[4]=-l*f,n[8]=c,n[1]=h+p*c,n[5]=d-m*c,n[9]=-s*l,n[2]=m-d*c,n[6]=p+h*c,n[10]=a*l}else if(e.order==="YXZ"){const d=l*u,h=l*f,p=c*u,m=c*f;n[0]=d+m*s,n[4]=p*s-h,n[8]=a*c,n[1]=a*f,n[5]=a*u,n[9]=-s,n[2]=h*s-p,n[6]=m+d*s,n[10]=a*l}else if(e.order==="ZXY"){const d=l*u,h=l*f,p=c*u,m=c*f;n[0]=d-m*s,n[4]=-a*f,n[8]=p+h*s,n[1]=h+p*s,n[5]=a*u,n[9]=m-d*s,n[2]=-a*c,n[6]=s,n[10]=a*l}else if(e.order==="ZYX"){const d=a*u,h=a*f,p=s*u,m=s*f;n[0]=l*u,n[4]=p*c-h,n[8]=d*c+m,n[1]=l*f,n[5]=m*c+d,n[9]=h*c-p,n[2]=-c,n[6]=s*l,n[10]=a*l}else if(e.order==="YZX"){const d=a*l,h=a*c,p=s*l,m=s*c;n[0]=l*u,n[4]=m-d*f,n[8]=p*f+h,n[1]=f,n[5]=a*u,n[9]=-s*u,n[2]=-c*u,n[6]=h*f+p,n[10]=d-m*f}else if(e.order==="XZY"){const d=a*l,h=a*c,p=s*l,m=s*c;n[0]=l*u,n[4]=-f,n[8]=c*u,n[1]=d*f+m,n[5]=a*u,n[9]=h*f-p,n[2]=p*f-h,n[6]=s*u,n[10]=m*f+d}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(e){return this.compose(nzt,e,rzt)}lookAt(e,n,r){const i=this.elements;return Jo.subVectors(e,n),Jo.lengthSq()===0&&(Jo.z=1),Jo.normalize(),ju.crossVectors(r,Jo),ju.lengthSq()===0&&(Math.abs(r.z)===1?Jo.x+=1e-4:Jo.z+=1e-4,Jo.normalize(),ju.crossVectors(r,Jo)),ju.normalize(),LO.crossVectors(Jo,ju),i[0]=ju.x,i[4]=LO.x,i[8]=Jo.x,i[1]=ju.y,i[5]=LO.y,i[9]=Jo.y,i[2]=ju.z,i[6]=LO.z,i[10]=Jo.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const r=e.elements,i=n.elements,o=this.elements,a=r[0],s=r[4],l=r[8],c=r[12],u=r[1],f=r[5],d=r[9],h=r[13],p=r[2],m=r[6],g=r[10],v=r[14],y=r[3],x=r[7],b=r[11],_=r[15],S=i[0],O=i[4],C=i[8],E=i[12],k=i[1],I=i[5],P=i[9],R=i[13],T=i[2],L=i[6],z=i[10],B=i[14],W=i[3],U=i[7],N=i[11],$=i[15];return o[0]=a*S+s*k+l*T+c*W,o[4]=a*O+s*I+l*L+c*U,o[8]=a*C+s*P+l*z+c*N,o[12]=a*E+s*R+l*B+c*$,o[1]=u*S+f*k+d*T+h*W,o[5]=u*O+f*I+d*L+h*U,o[9]=u*C+f*P+d*z+h*N,o[13]=u*E+f*R+d*B+h*$,o[2]=p*S+m*k+g*T+v*W,o[6]=p*O+m*I+g*L+v*U,o[10]=p*C+m*P+g*z+v*N,o[14]=p*E+m*R+g*B+v*$,o[3]=y*S+x*k+b*T+_*W,o[7]=y*O+x*I+b*L+_*U,o[11]=y*C+x*P+b*z+_*N,o[15]=y*E+x*R+b*B+_*$,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){const e=this.elements,n=e[0],r=e[4],i=e[8],o=e[12],a=e[1],s=e[5],l=e[9],c=e[13],u=e[2],f=e[6],d=e[10],h=e[14],p=e[3],m=e[7],g=e[11],v=e[15];return p*(+o*l*f-i*c*f-o*s*d+r*c*d+i*s*h-r*l*h)+m*(+n*l*h-n*c*d+o*a*d-i*a*h+i*c*u-o*l*u)+g*(+n*c*f-n*s*h-o*a*f+r*a*h+o*s*u-r*c*u)+v*(-i*s*u-n*l*f+n*s*d+i*a*f-r*a*d+r*l*u)}transpose(){const e=this.elements;let n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this}setPosition(e,n,r){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=n,i[14]=r),this}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8],f=e[9],d=e[10],h=e[11],p=e[12],m=e[13],g=e[14],v=e[15],y=f*g*c-m*d*c+m*l*h-s*g*h-f*l*v+s*d*v,x=p*d*c-u*g*c-p*l*h+a*g*h+u*l*v-a*d*v,b=u*m*c-p*f*c+p*s*h-a*m*h-u*s*v+a*f*v,_=p*f*l-u*m*l-p*s*d+a*m*d+u*s*g-a*f*g,S=n*y+r*x+i*b+o*_;if(S===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const O=1/S;return e[0]=y*O,e[1]=(m*d*o-f*g*o-m*i*h+r*g*h+f*i*v-r*d*v)*O,e[2]=(s*g*o-m*l*o+m*i*c-r*g*c-s*i*v+r*l*v)*O,e[3]=(f*l*o-s*d*o-f*i*c+r*d*c+s*i*h-r*l*h)*O,e[4]=x*O,e[5]=(u*g*o-p*d*o+p*i*h-n*g*h-u*i*v+n*d*v)*O,e[6]=(p*l*o-a*g*o-p*i*c+n*g*c+a*i*v-n*l*v)*O,e[7]=(a*d*o-u*l*o+u*i*c-n*d*c-a*i*h+n*l*h)*O,e[8]=b*O,e[9]=(p*f*o-u*m*o-p*r*h+n*m*h+u*r*v-n*f*v)*O,e[10]=(a*m*o-p*s*o+p*r*c-n*m*c-a*r*v+n*s*v)*O,e[11]=(u*s*o-a*f*o-u*r*c+n*f*c+a*r*h-n*s*h)*O,e[12]=_*O,e[13]=(u*m*i-p*f*i+p*r*d-n*m*d-u*r*g+n*f*g)*O,e[14]=(p*s*i-a*m*i-p*r*l+n*m*l+a*r*g-n*s*g)*O,e[15]=(a*f*i-u*s*i+u*r*l-n*f*l-a*r*d+n*s*d)*O,this}scale(e){const n=this.elements,r=e.x,i=e.y,o=e.z;return n[0]*=r,n[4]*=i,n[8]*=o,n[1]*=r,n[5]*=i,n[9]*=o,n[2]*=r,n[6]*=i,n[10]*=o,n[3]*=r,n[7]*=i,n[11]*=o,this}getMaxScaleOnAxis(){const e=this.elements,n=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(n,r,i))}makeTranslation(e,n,r){return this.set(1,0,0,e,0,1,0,n,0,0,1,r,0,0,0,1),this}makeRotationX(e){const n=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,n,-r,0,0,r,n,0,0,0,0,1),this}makeRotationY(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,0,r,0,0,1,0,0,-r,0,n,0,0,0,0,1),this}makeRotationZ(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,-r,0,0,r,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){const r=Math.cos(n),i=Math.sin(n),o=1-r,a=e.x,s=e.y,l=e.z,c=o*a,u=o*s;return this.set(c*a+r,c*s-i*l,c*l+i*s,0,c*s+i*l,u*s+r,u*l-i*a,0,c*l-i*s,u*l+i*a,o*l*l+r,0,0,0,0,1),this}makeScale(e,n,r){return this.set(e,0,0,0,0,n,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,n,r,i,o,a){return this.set(1,r,o,0,e,1,a,0,n,i,1,0,0,0,0,1),this}compose(e,n,r){const i=this.elements,o=n._x,a=n._y,s=n._z,l=n._w,c=o+o,u=a+a,f=s+s,d=o*c,h=o*u,p=o*f,m=a*u,g=a*f,v=s*f,y=l*c,x=l*u,b=l*f,_=r.x,S=r.y,O=r.z;return i[0]=(1-(m+v))*_,i[1]=(h+b)*_,i[2]=(p-x)*_,i[3]=0,i[4]=(h-b)*S,i[5]=(1-(d+v))*S,i[6]=(g+y)*S,i[7]=0,i[8]=(p+x)*O,i[9]=(g-y)*O,i[10]=(1-(d+m))*O,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,n,r){const i=this.elements;let o=gm.set(i[0],i[1],i[2]).length();const a=gm.set(i[4],i[5],i[6]).length(),s=gm.set(i[8],i[9],i[10]).length();this.determinant()<0&&(o=-o),e.x=i[12],e.y=i[13],e.z=i[14],ks.copy(this);const c=1/o,u=1/a,f=1/s;return ks.elements[0]*=c,ks.elements[1]*=c,ks.elements[2]*=c,ks.elements[4]*=u,ks.elements[5]*=u,ks.elements[6]*=u,ks.elements[8]*=f,ks.elements[9]*=f,ks.elements[10]*=f,n.setFromRotationMatrix(ks),r.x=o,r.y=a,r.z=s,this}makePerspective(e,n,r,i,o,a){const s=this.elements,l=2*o/(n-e),c=2*o/(r-i),u=(n+e)/(n-e),f=(r+i)/(r-i),d=-(a+o)/(a-o),h=-2*a*o/(a-o);return s[0]=l,s[4]=0,s[8]=u,s[12]=0,s[1]=0,s[5]=c,s[9]=f,s[13]=0,s[2]=0,s[6]=0,s[10]=d,s[14]=h,s[3]=0,s[7]=0,s[11]=-1,s[15]=0,this}makeOrthographic(e,n,r,i,o,a){const s=this.elements,l=1/(n-e),c=1/(r-i),u=1/(a-o),f=(n+e)*l,d=(r+i)*c,h=(a+o)*u;return s[0]=2*l,s[4]=0,s[8]=0,s[12]=-f,s[1]=0,s[5]=2*c,s[9]=0,s[13]=-d,s[2]=0,s[6]=0,s[10]=-2*u,s[14]=-h,s[3]=0,s[7]=0,s[11]=0,s[15]=1,this}equals(e){const n=this.elements,r=e.elements;for(let i=0;i<16;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<16;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){const r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e[n+9]=r[9],e[n+10]=r[10],e[n+11]=r[11],e[n+12]=r[12],e[n+13]=r[13],e[n+14]=r[14],e[n+15]=r[15],e}}const gm=new Se,ks=new Gn,nzt=new Se(0,0,0),rzt=new Se(1,1,1),ju=new Se,LO=new Se,Jo=new Se,$Z=new Gn,NZ=new hp;class Mw{constructor(e=0,n=0,r=0,i=Mw.DefaultOrder){this.isEuler=!0,this._x=e,this._y=n,this._z=r,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,n,r,i=this._order){return this._x=e,this._y=n,this._z=r,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,n=this._order,r=!0){const i=e.elements,o=i[0],a=i[4],s=i[8],l=i[1],c=i[5],u=i[9],f=i[2],d=i[6],h=i[10];switch(n){case"XYZ":this._y=Math.asin(Po(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-u,h),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Po(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(s,h),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-f,o),this._z=0);break;case"ZXY":this._x=Math.asin(Po(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-f,h),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,o));break;case"ZYX":this._y=Math.asin(-Po(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(d,h),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(Po(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-f,o)):(this._x=0,this._y=Math.atan2(s,h));break;case"XZY":this._z=Math.asin(-Po(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(s,o)):(this._x=Math.atan2(-u,h),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,r===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,r){return $Z.makeRotationFromQuaternion(e),this.setFromRotationMatrix($Z,n,r)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return NZ.setFromEuler(this),this.setFromQuaternion(NZ,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}toVector3(){console.error("THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead")}}Mw.DefaultOrder="XYZ";Mw.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class Dye{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let n=0;n1){for(let r=0;r0){i.children=[];for(let s=0;s0){i.animations=[];for(let s=0;s0&&(r.geometries=s),l.length>0&&(r.materials=l),c.length>0&&(r.textures=c),u.length>0&&(r.images=u),f.length>0&&(r.shapes=f),d.length>0&&(r.skeletons=d),h.length>0&&(r.animations=h),p.length>0&&(r.nodes=p)}return r.object=i,r;function a(s){const l=[];for(const c in s){const u=s[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),n===!0)for(let r=0;r0?i.multiplyScalar(1/Math.sqrt(o)):i.set(0,0,0)}static getBarycoord(e,n,r,i,o){As.subVectors(i,n),xc.subVectors(r,n),JI.subVectors(e,n);const a=As.dot(As),s=As.dot(xc),l=As.dot(JI),c=xc.dot(xc),u=xc.dot(JI),f=a*c-s*s;if(f===0)return o.set(-2,-1,-1);const d=1/f,h=(c*l-s*u)*d,p=(a*u-s*l)*d;return o.set(1-h-p,p,h)}static containsPoint(e,n,r,i){return this.getBarycoord(e,n,r,i,bc),bc.x>=0&&bc.y>=0&&bc.x+bc.y<=1}static getUV(e,n,r,i,o,a,s,l){return this.getBarycoord(e,n,r,i,bc),l.set(0,0),l.addScaledVector(o,bc.x),l.addScaledVector(a,bc.y),l.addScaledVector(s,bc.z),l}static isFrontFacing(e,n,r,i){return As.subVectors(r,n),xc.subVectors(e,n),As.cross(xc).dot(i)<0}set(e,n,r){return this.a.copy(e),this.b.copy(n),this.c.copy(r),this}setFromPointsAndIndices(e,n,r,i){return this.a.copy(e[n]),this.b.copy(e[r]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,n,r,i){return this.a.fromBufferAttribute(e,n),this.b.fromBufferAttribute(e,r),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return As.subVectors(this.c,this.b),xc.subVectors(this.a,this.b),As.cross(xc).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Bc.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return Bc.getBarycoord(e,this.a,this.b,this.c,n)}getUV(e,n,r,i,o){return Bc.getUV(e,this.a,this.b,this.c,n,r,i,o)}containsPoint(e){return Bc.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Bc.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){const r=this.a,i=this.b,o=this.c;let a,s;ym.subVectors(i,r),xm.subVectors(o,r),eD.subVectors(e,r);const l=ym.dot(eD),c=xm.dot(eD);if(l<=0&&c<=0)return n.copy(r);tD.subVectors(e,i);const u=ym.dot(tD),f=xm.dot(tD);if(u>=0&&f<=u)return n.copy(i);const d=l*f-u*c;if(d<=0&&l>=0&&u<=0)return a=l/(l-u),n.copy(r).addScaledVector(ym,a);nD.subVectors(e,o);const h=ym.dot(nD),p=xm.dot(nD);if(p>=0&&h<=p)return n.copy(o);const m=h*c-l*p;if(m<=0&&c>=0&&p<=0)return s=c/(c-p),n.copy(r).addScaledVector(xm,s);const g=u*p-h*f;if(g<=0&&f-u>=0&&h-p>=0)return WZ.subVectors(o,i),s=(f-u)/(f-u+(h-p)),n.copy(i).addScaledVector(WZ,s);const v=1/(g+m+d);return a=m*v,s=d*v,n.copy(r).addScaledVector(ym,a).addScaledVector(xm,s)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let lzt=0;class kw extends jp{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:lzt++}),this.uuid=Pw(),this.name="",this.type="Material",this.blending=Lg,this.side=Av,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=_ye,this.blendDst=wye,this.blendEquation=Fm,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=pF,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=ZBt,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=BI,this.stencilZFail=BI,this.stencilZPass=BI,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const n in e){const r=e[n];if(r===void 0){console.warn("THREE.Material: '"+n+"' parameter is undefined.");continue}const i=this[n];if(i===void 0){console.warn("THREE."+this.type+": '"+n+"' is not a property of this material.");continue}i&&i.isColor?i.set(r):i&&i.isVector3&&r&&r.isVector3?i.copy(r):this[n]=r}}toJSON(e){const n=e===void 0||typeof e=="string";n&&(e={textures:{},images:{}});const r={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),this.roughness!==void 0&&(r.roughness=this.roughness),this.metalness!==void 0&&(r.metalness=this.metalness),this.sheen!==void 0&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(r.shininess=this.shininess),this.clearcoat!==void 0&&(r.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(r.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(r.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(e).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(r.combine=this.combine)),this.envMapIntensity!==void 0&&(r.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(r.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&(r.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(r.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(r.size=this.size),this.shadowSide!==null&&(r.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==Lg&&(r.blending=this.blending),this.side!==Av&&(r.side=this.side),this.vertexColors&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),this.transparent===!0&&(r.transparent=this.transparent),r.depthFunc=this.depthFunc,r.depthTest=this.depthTest,r.depthWrite=this.depthWrite,r.colorWrite=this.colorWrite,r.stencilWrite=this.stencilWrite,r.stencilWriteMask=this.stencilWriteMask,r.stencilFunc=this.stencilFunc,r.stencilRef=this.stencilRef,r.stencilFuncMask=this.stencilFuncMask,r.stencilFail=this.stencilFail,r.stencilZFail=this.stencilZFail,r.stencilZPass=this.stencilZPass,this.rotation!==void 0&&this.rotation!==0&&(r.rotation=this.rotation),this.polygonOffset===!0&&(r.polygonOffset=!0),this.polygonOffsetFactor!==0&&(r.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(r.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(r.linewidth=this.linewidth),this.dashSize!==void 0&&(r.dashSize=this.dashSize),this.gapSize!==void 0&&(r.gapSize=this.gapSize),this.scale!==void 0&&(r.scale=this.scale),this.dithering===!0&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(r.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(r.wireframe=this.wireframe),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(r.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(r.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(r.flatShading=this.flatShading),this.visible===!1&&(r.visible=!1),this.toneMapped===!1&&(r.toneMapped=!1),this.fog===!1&&(r.fog=!1),JSON.stringify(this.userData)!=="{}"&&(r.userData=this.userData);function i(o){const a=[];for(const s in o){const l=o[s];delete l.metadata,a.push(l)}return a}if(n){const o=i(e.textures),a=i(e.images);o.length>0&&(r.textures=o),a.length>0&&(r.images=a)}return r}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const n=e.clippingPlanes;let r=null;if(n!==null){const i=n.length;r=new Array(i);for(let o=0;o!==i;++o)r[o]=n[o].clone()}return this.clippingPlanes=r,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class f6 extends kw{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new sr(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Sye,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Ir=new Se,NO=new Ht;class os{constructor(e,n,r){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=n,this.count=e!==void 0?e.length/n:0,this.normalized=r===!0,this.usage=kZ,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this}copyAt(e,n,r){e*=this.itemSize,r*=n.itemSize;for(let i=0,o=this.itemSize;i0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const n=this.index;n!==null&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});const r=this.attributes;for(const l in r){const c=r[l];e.data.attributes[l]=c.toJSON(e.data)}const i={};let o=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let f=0,d=c.length;f0&&(i[l]=u,o=!0)}o&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const s=this.boundingSphere;return s!==null&&(e.data.boundingSphere={center:s.center.toArray(),radius:s.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const n={};this.name=e.name;const r=e.index;r!==null&&this.setIndex(r.clone(n));const i=e.attributes;for(const c in i){const u=i[c];this.setAttribute(c,u.clone(n))}const o=e.morphAttributes;for(const c in o){const u=[],f=o[c];for(let d=0,h=f.length;d0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,a=i.length;on.far?null:{distance:c,point:VO.clone(),object:t}}function GO(t,e,n,r,i,o,a,s,l,c,u,f){Bu.fromBufferAttribute(i,c),zu.fromBufferAttribute(i,u),Uu.fromBufferAttribute(i,f);const d=t.morphTargetInfluences;if(o&&d){FO.set(0,0,0),jO.set(0,0,0),BO.set(0,0,0);for(let p=0,m=o.length;p0?1:-1,u.push(U.x,U.y,U.z),f.push(D/O),f.push(1-N/C),B+=1}}for(let N=0;N0&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader;const r={};for(const i in this.extensions)this.extensions[i]===!0&&(r[i]=!0);return Object.keys(r).length>0&&(n.extensions=r),n}}class Nye extends Bo{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Gn,this.projectionMatrix=new Gn,this.projectionMatrixInverse=new Gn}copy(e,n){return super.copy(e,n),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const n=this.matrixWorld.elements;return e.set(-n[8],-n[9],-n[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,n){super.updateWorldMatrix(e,n),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}class js extends Nye{constructor(e=50,n=1,r=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=r,this.far=i,this.focus=10,this.aspect=n,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const n=.5*this.getFilmHeight()/e;this.fov=kZ*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(BI*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return kZ*2*Math.atan(Math.tan(BI*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,n,r,i,o,a){this.aspect=e/n,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let n=e*Math.tan(BI*.5*this.fov)/this.zoom,r=2*n,i=this.aspect*r,o=-.5*i;const a=this.view;if(this.view!==null&&this.view.enabled){const l=a.fullWidth,c=a.fullHeight;o+=a.offsetX*i/l,n-=a.offsetY*r/c,i*=a.width/l,r*=a.height/c}const s=this.filmOffset;s!==0&&(o+=e*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(o,o+i,n,n-r,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,this.view!==null&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}}const wm=90,Sm=1;class dzt extends Bo{constructor(e,n,r){super(),this.type="CubeCamera",this.renderTarget=r;const i=new js(wm,Sm,e,n);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new Se(1,0,0)),this.add(i);const o=new js(wm,Sm,e,n);o.layers=this.layers,o.up.set(0,-1,0),o.lookAt(new Se(-1,0,0)),this.add(o);const a=new js(wm,Sm,e,n);a.layers=this.layers,a.up.set(0,0,1),a.lookAt(new Se(0,1,0)),this.add(a);const s=new js(wm,Sm,e,n);s.layers=this.layers,s.up.set(0,0,-1),s.lookAt(new Se(0,-1,0)),this.add(s);const l=new js(wm,Sm,e,n);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new Se(0,0,1)),this.add(l);const c=new js(wm,Sm,e,n);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new Se(0,0,-1)),this.add(c)}update(e,n){this.parent===null&&this.updateMatrixWorld();const r=this.renderTarget,[i,o,a,s,l,c]=this.children,u=e.getRenderTarget(),f=e.toneMapping,d=e.xr.enabled;e.toneMapping=ru,e.xr.enabled=!1;const h=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0),e.render(n,i),e.setRenderTarget(r,1),e.render(n,o),e.setRenderTarget(r,2),e.render(n,a),e.setRenderTarget(r,3),e.render(n,s),e.setRenderTarget(r,4),e.render(n,l),r.texture.generateMipmaps=h,e.setRenderTarget(r,5),e.render(n,c),e.setRenderTarget(u),e.toneMapping=f,e.xr.enabled=d,r.texture.needsPMREMUpdate=!0}}class Fye extends Ta{constructor(e,n,r,i,o,a,s,l,c,u){e=e!==void 0?e:[],n=n!==void 0?n:Rv,super(e,n,r,i,o,a,s,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class hzt extends dp{constructor(e,n={}){super(e,e,n),this.isWebGLCubeRenderTarget=!0;const r={width:e,height:e,depth:1},i=[r,r,r,r,r,r];this.texture=new Fye(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=n.generateMipmaps!==void 0?n.generateMipmaps:!1,this.texture.minFilter=n.minFilter!==void 0?n.minFilter:Eo}fromEquirectangularTexture(e,n){this.texture.type=n.type,this.texture.encoding=n.encoding,this.texture.generateMipmaps=n.generateMipmaps,this.texture.minFilter=n.minFilter,this.texture.magFilter=n.magFilter;const r={uniforms:{tEquirect:{value:null}},vertexShader:` +}`;class od extends kw{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=dzt,this.fragmentShader=hzt,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Lv(e.uniforms),this.uniformsGroups=fzt(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const n=super.toJSON(e);n.glslVersion=this.glslVersion,n.uniforms={};for(const i in this.uniforms){const a=this.uniforms[i].value;a&&a.isTexture?n.uniforms[i]={type:"t",value:a.toJSON(e).uuid}:a&&a.isColor?n.uniforms[i]={type:"c",value:a.getHex()}:a&&a.isVector2?n.uniforms[i]={type:"v2",value:a.toArray()}:a&&a.isVector3?n.uniforms[i]={type:"v3",value:a.toArray()}:a&&a.isVector4?n.uniforms[i]={type:"v4",value:a.toArray()}:a&&a.isMatrix3?n.uniforms[i]={type:"m3",value:a.toArray()}:a&&a.isMatrix4?n.uniforms[i]={type:"m4",value:a.toArray()}:n.uniforms[i]={value:a}}Object.keys(this.defines).length>0&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader;const r={};for(const i in this.extensions)this.extensions[i]===!0&&(r[i]=!0);return Object.keys(r).length>0&&(n.extensions=r),n}}class Fye extends Bo{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Gn,this.projectionMatrix=new Gn,this.projectionMatrixInverse=new Gn}copy(e,n){return super.copy(e,n),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const n=this.matrixWorld.elements;return e.set(-n[8],-n[9],-n[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,n){super.updateWorldMatrix(e,n),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}class js extends Fye{constructor(e=50,n=1,r=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=r,this.far=i,this.focus=10,this.aspect=n,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const n=.5*this.getFilmHeight()/e;this.fov=RZ*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(zI*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return RZ*2*Math.atan(Math.tan(zI*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,n,r,i,o,a){this.aspect=e/n,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let n=e*Math.tan(zI*.5*this.fov)/this.zoom,r=2*n,i=this.aspect*r,o=-.5*i;const a=this.view;if(this.view!==null&&this.view.enabled){const l=a.fullWidth,c=a.fullHeight;o+=a.offsetX*i/l,n-=a.offsetY*r/c,i*=a.width/l,r*=a.height/c}const s=this.filmOffset;s!==0&&(o+=e*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(o,o+i,n,n-r,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,this.view!==null&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}}const wm=90,Sm=1;class pzt extends Bo{constructor(e,n,r){super(),this.type="CubeCamera",this.renderTarget=r;const i=new js(wm,Sm,e,n);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new Se(1,0,0)),this.add(i);const o=new js(wm,Sm,e,n);o.layers=this.layers,o.up.set(0,-1,0),o.lookAt(new Se(-1,0,0)),this.add(o);const a=new js(wm,Sm,e,n);a.layers=this.layers,a.up.set(0,0,1),a.lookAt(new Se(0,1,0)),this.add(a);const s=new js(wm,Sm,e,n);s.layers=this.layers,s.up.set(0,0,-1),s.lookAt(new Se(0,-1,0)),this.add(s);const l=new js(wm,Sm,e,n);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new Se(0,0,1)),this.add(l);const c=new js(wm,Sm,e,n);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new Se(0,0,-1)),this.add(c)}update(e,n){this.parent===null&&this.updateMatrixWorld();const r=this.renderTarget,[i,o,a,s,l,c]=this.children,u=e.getRenderTarget(),f=e.toneMapping,d=e.xr.enabled;e.toneMapping=ru,e.xr.enabled=!1;const h=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0),e.render(n,i),e.setRenderTarget(r,1),e.render(n,o),e.setRenderTarget(r,2),e.render(n,a),e.setRenderTarget(r,3),e.render(n,s),e.setRenderTarget(r,4),e.render(n,l),r.texture.generateMipmaps=h,e.setRenderTarget(r,5),e.render(n,c),e.setRenderTarget(u),e.toneMapping=f,e.xr.enabled=d,r.texture.needsPMREMUpdate=!0}}class jye extends Ta{constructor(e,n,r,i,o,a,s,l,c,u){e=e!==void 0?e:[],n=n!==void 0?n:Rv,super(e,n,r,i,o,a,s,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class mzt extends dp{constructor(e,n={}){super(e,e,n),this.isWebGLCubeRenderTarget=!0;const r={width:e,height:e,depth:1},i=[r,r,r,r,r,r];this.texture=new jye(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=n.generateMipmaps!==void 0?n.generateMipmaps:!1,this.texture.minFilter=n.minFilter!==void 0?n.minFilter:Eo}fromEquirectangularTexture(e,n){this.texture.type=n.type,this.texture.encoding=n.encoding,this.texture.generateMipmaps=n.generateMipmaps,this.texture.minFilter=n.minFilter,this.texture.magFilter=n.magFilter;const r={uniforms:{tEquirect:{value:null}},vertexShader:` varying vec3 vWorldDirection; @@ -369,28 +369,28 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho gl_FragColor = texture2D( tEquirect, sampleUV ); } - `},i=new Hy(5,5,5),o=new od({name:"CubemapFromEquirect",uniforms:Lv(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:_a,blending:Uf});o.uniforms.tEquirect.value=n;const a=new Nl(i,o),s=n.minFilter;return n.minFilter===Tk&&(n.minFilter=Eo),new dzt(1,10,this).update(e,a),n.minFilter=s,a.geometry.dispose(),a.material.dispose(),this}clear(e,n,r,i){const o=e.getRenderTarget();for(let a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(n,r,i);e.setRenderTarget(o)}}const lD=new Se,pzt=new Se,mzt=new va;class Kd{constructor(e=new Se(1,0,0),n=0){this.isPlane=!0,this.normal=e,this.constant=n}set(e,n){return this.normal.copy(e),this.constant=n,this}setComponents(e,n,r,i){return this.normal.set(e,n,r),this.constant=i,this}setFromNormalAndCoplanarPoint(e,n){return this.normal.copy(e),this.constant=-n.dot(this.normal),this}setFromCoplanarPoints(e,n,r){const i=lD.subVectors(r,n).cross(pzt.subVectors(e,n)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,n){return n.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,n){const r=e.delta(lD),i=this.normal.dot(r);if(i===0)return this.distanceToPoint(e.start)===0?n.copy(e.start):null;const o=-(e.start.dot(this.normal)+this.constant)/i;return o<0||o>1?null:n.copy(r).multiplyScalar(o).add(e.start)}intersectsLine(e){const n=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return n<0&&r>0||r<0&&n>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,n){const r=n||mzt.getNormalMatrix(e),i=this.coplanarPoint(lD).applyMatrix4(e),o=this.normal.applyMatrix3(r).normalize();return this.constant=-i.dot(o),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Om=new Ek,HO=new Se;class jye{constructor(e=new Kd,n=new Kd,r=new Kd,i=new Kd,o=new Kd,a=new Kd){this.planes=[e,n,r,i,o,a]}set(e,n,r,i,o,a){const s=this.planes;return s[0].copy(e),s[1].copy(n),s[2].copy(r),s[3].copy(i),s[4].copy(o),s[5].copy(a),this}copy(e){const n=this.planes;for(let r=0;r<6;r++)n[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e){const n=this.planes,r=e.elements,i=r[0],o=r[1],a=r[2],s=r[3],l=r[4],c=r[5],u=r[6],f=r[7],d=r[8],h=r[9],p=r[10],m=r[11],g=r[12],v=r[13],y=r[14],x=r[15];return n[0].setComponents(s-i,f-l,m-d,x-g).normalize(),n[1].setComponents(s+i,f+l,m+d,x+g).normalize(),n[2].setComponents(s+o,f+c,m+h,x+v).normalize(),n[3].setComponents(s-o,f-c,m-h,x-v).normalize(),n[4].setComponents(s-a,f-u,m-p,x-y).normalize(),n[5].setComponents(s+a,f+u,m+p,x+y).normalize(),this}intersectsObject(e){const n=e.geometry;return n.boundingSphere===null&&n.computeBoundingSphere(),Om.copy(n.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(Om)}intersectsSprite(e){return Om.center.set(0,0,0),Om.radius=.7071067811865476,Om.applyMatrix4(e.matrixWorld),this.intersectsSphere(Om)}intersectsSphere(e){const n=this.planes,r=e.center,i=-e.radius;for(let o=0;o<6;o++)if(n[o].distanceToPoint(r)0?e.max.x:e.min.x,HO.y=i.normal.y>0?e.max.y:e.min.y,HO.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(HO)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let r=0;r<6;r++)if(n[r].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function Bye(){let t=null,e=!1,n=null,r=null;function i(o,a){n(o,a),r=t.requestAnimationFrame(i)}return{start:function(){e!==!0&&n!==null&&(r=t.requestAnimationFrame(i),e=!0)},stop:function(){t.cancelAnimationFrame(r),e=!1},setAnimationLoop:function(o){n=o},setContext:function(o){t=o}}}function gzt(t,e){const n=e.isWebGL2,r=new WeakMap;function i(c,u){const f=c.array,d=c.usage,h=t.createBuffer();t.bindBuffer(u,h),t.bufferData(u,f,d),c.onUploadCallback();let p;if(f instanceof Float32Array)p=5126;else if(f instanceof Uint16Array)if(c.isFloat16BufferAttribute)if(n)p=5131;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else p=5123;else if(f instanceof Int16Array)p=5122;else if(f instanceof Uint32Array)p=5125;else if(f instanceof Int32Array)p=5124;else if(f instanceof Int8Array)p=5120;else if(f instanceof Uint8Array)p=5121;else if(f instanceof Uint8ClampedArray)p=5121;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+f);return{buffer:h,type:p,bytesPerElement:f.BYTES_PER_ELEMENT,version:c.version}}function o(c,u,f){const d=u.array,h=u.updateRange;t.bindBuffer(f,c),h.count===-1?t.bufferSubData(f,0,d):(n?t.bufferSubData(f,h.offset*d.BYTES_PER_ELEMENT,d,h.offset,h.count):t.bufferSubData(f,h.offset*d.BYTES_PER_ELEMENT,d.subarray(h.offset,h.offset+h.count)),h.count=-1)}function a(c){return c.isInterleavedBufferAttribute&&(c=c.data),r.get(c)}function s(c){c.isInterleavedBufferAttribute&&(c=c.data);const u=r.get(c);u&&(t.deleteBuffer(u.buffer),r.delete(c))}function l(c,u){if(c.isGLBufferAttribute){const d=r.get(c);(!d||d.version1?null:n.copy(r).multiplyScalar(o).add(e.start)}intersectsLine(e){const n=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return n<0&&r>0||r<0&&n>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,n){const r=n||vzt.getNormalMatrix(e),i=this.coplanarPoint(cD).applyMatrix4(e),o=this.normal.applyMatrix3(r).normalize();return this.constant=-i.dot(o),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Om=new Ek,HO=new Se;class Bye{constructor(e=new Kd,n=new Kd,r=new Kd,i=new Kd,o=new Kd,a=new Kd){this.planes=[e,n,r,i,o,a]}set(e,n,r,i,o,a){const s=this.planes;return s[0].copy(e),s[1].copy(n),s[2].copy(r),s[3].copy(i),s[4].copy(o),s[5].copy(a),this}copy(e){const n=this.planes;for(let r=0;r<6;r++)n[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e){const n=this.planes,r=e.elements,i=r[0],o=r[1],a=r[2],s=r[3],l=r[4],c=r[5],u=r[6],f=r[7],d=r[8],h=r[9],p=r[10],m=r[11],g=r[12],v=r[13],y=r[14],x=r[15];return n[0].setComponents(s-i,f-l,m-d,x-g).normalize(),n[1].setComponents(s+i,f+l,m+d,x+g).normalize(),n[2].setComponents(s+o,f+c,m+h,x+v).normalize(),n[3].setComponents(s-o,f-c,m-h,x-v).normalize(),n[4].setComponents(s-a,f-u,m-p,x-y).normalize(),n[5].setComponents(s+a,f+u,m+p,x+y).normalize(),this}intersectsObject(e){const n=e.geometry;return n.boundingSphere===null&&n.computeBoundingSphere(),Om.copy(n.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(Om)}intersectsSprite(e){return Om.center.set(0,0,0),Om.radius=.7071067811865476,Om.applyMatrix4(e.matrixWorld),this.intersectsSphere(Om)}intersectsSphere(e){const n=this.planes,r=e.center,i=-e.radius;for(let o=0;o<6;o++)if(n[o].distanceToPoint(r)0?e.max.x:e.min.x,HO.y=i.normal.y>0?e.max.y:e.min.y,HO.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(HO)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let r=0;r<6;r++)if(n[r].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function zye(){let t=null,e=!1,n=null,r=null;function i(o,a){n(o,a),r=t.requestAnimationFrame(i)}return{start:function(){e!==!0&&n!==null&&(r=t.requestAnimationFrame(i),e=!0)},stop:function(){t.cancelAnimationFrame(r),e=!1},setAnimationLoop:function(o){n=o},setContext:function(o){t=o}}}function yzt(t,e){const n=e.isWebGL2,r=new WeakMap;function i(c,u){const f=c.array,d=c.usage,h=t.createBuffer();t.bindBuffer(u,h),t.bufferData(u,f,d),c.onUploadCallback();let p;if(f instanceof Float32Array)p=5126;else if(f instanceof Uint16Array)if(c.isFloat16BufferAttribute)if(n)p=5131;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else p=5123;else if(f instanceof Int16Array)p=5122;else if(f instanceof Uint32Array)p=5125;else if(f instanceof Int32Array)p=5124;else if(f instanceof Int8Array)p=5120;else if(f instanceof Uint8Array)p=5121;else if(f instanceof Uint8ClampedArray)p=5121;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+f);return{buffer:h,type:p,bytesPerElement:f.BYTES_PER_ELEMENT,version:c.version}}function o(c,u,f){const d=u.array,h=u.updateRange;t.bindBuffer(f,c),h.count===-1?t.bufferSubData(f,0,d):(n?t.bufferSubData(f,h.offset*d.BYTES_PER_ELEMENT,d,h.offset,h.count):t.bufferSubData(f,h.offset*d.BYTES_PER_ELEMENT,d.subarray(h.offset,h.offset+h.count)),h.count=-1)}function a(c){return c.isInterleavedBufferAttribute&&(c=c.data),r.get(c)}function s(c){c.isInterleavedBufferAttribute&&(c=c.data);const u=r.get(c);u&&(t.deleteBuffer(u.buffer),r.delete(c))}function l(c,u){if(c.isGLBufferAttribute){const d=r.get(c);(!d||d.version 0 +#endif`,kzt=`#if NUM_CLIPPING_PLANES > 0 vec4 plane; #pragma unroll_loop_start for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { @@ -630,26 +630,26 @@ vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 no #pragma unroll_loop_end if ( clipped ) discard; #endif -#endif`,Mzt=`#if NUM_CLIPPING_PLANES > 0 +#endif`,Azt=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,kzt=`#if NUM_CLIPPING_PLANES > 0 +#endif`,Rzt=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; -#endif`,Azt=`#if NUM_CLIPPING_PLANES > 0 +#endif`,Izt=`#if NUM_CLIPPING_PLANES > 0 vClipPosition = - mvPosition.xyz; -#endif`,Rzt=`#if defined( USE_COLOR_ALPHA ) +#endif`,Dzt=`#if defined( USE_COLOR_ALPHA ) diffuseColor *= vColor; #elif defined( USE_COLOR ) diffuseColor.rgb *= vColor; -#endif`,Izt=`#if defined( USE_COLOR_ALPHA ) +#endif`,Lzt=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) varying vec3 vColor; -#endif`,Dzt=`#if defined( USE_COLOR_ALPHA ) +#endif`,$zt=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) varying vec3 vColor; -#endif`,Lzt=`#if defined( USE_COLOR_ALPHA ) +#endif`,Nzt=`#if defined( USE_COLOR_ALPHA ) vColor = vec4( 1.0 ); #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) vColor = vec3( 1.0 ); @@ -659,7 +659,7 @@ vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 no #endif #ifdef USE_INSTANCING_COLOR vColor.xyz *= instanceColor.xyz; -#endif`,$zt=`#define PI 3.141592653589793 +#endif`,Fzt=`#define PI 3.141592653589793 #define PI2 6.283185307179586 #define PI_HALF 1.5707963267948966 #define RECIPROCAL_PI 0.3183098861837907 @@ -731,7 +731,7 @@ vec2 equirectUv( in vec3 dir ) { float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; return vec2( u, v ); -}`,Nzt=`#ifdef ENVMAP_TYPE_CUBE_UV +}`,jzt=`#ifdef ENVMAP_TYPE_CUBE_UV #define cubeUV_minMipLevel 4.0 #define cubeUV_minTileSize 16.0 float getFace( vec3 direction ) { @@ -829,7 +829,7 @@ vec2 equirectUv( in vec3 dir ) { return vec4( mix( color0, color1, mipF ), 1.0 ); } } -#endif`,Fzt=`vec3 transformedNormal = objectNormal; +#endif`,Bzt=`vec3 transformedNormal = objectNormal; #ifdef USE_INSTANCING mat3 m = mat3( instanceMatrix ); transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) ); @@ -844,23 +844,23 @@ transformedNormal = normalMatrix * transformedNormal; #ifdef FLIP_SIDED transformedTangent = - transformedTangent; #endif -#endif`,jzt=`#ifdef USE_DISPLACEMENTMAP +#endif`,zzt=`#ifdef USE_DISPLACEMENTMAP uniform sampler2D displacementMap; uniform float displacementScale; uniform float displacementBias; -#endif`,Bzt=`#ifdef USE_DISPLACEMENTMAP +#endif`,Uzt=`#ifdef USE_DISPLACEMENTMAP transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias ); -#endif`,zzt=`#ifdef USE_EMISSIVEMAP +#endif`,Wzt=`#ifdef USE_EMISSIVEMAP vec4 emissiveColor = texture2D( emissiveMap, vUv ); totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,Uzt=`#ifdef USE_EMISSIVEMAP +#endif`,Vzt=`#ifdef USE_EMISSIVEMAP uniform sampler2D emissiveMap; -#endif`,Wzt="gl_FragColor = linearToOutputTexel( gl_FragColor );",Vzt=`vec4 LinearToLinear( in vec4 value ) { +#endif`,Gzt="gl_FragColor = linearToOutputTexel( gl_FragColor );",Hzt=`vec4 LinearToLinear( in vec4 value ) { return value; } vec4 LinearTosRGB( in vec4 value ) { return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); -}`,Gzt=`#ifdef USE_ENVMAP +}`,qzt=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vec3 cameraToFrag; if ( isOrthographic ) { @@ -891,7 +891,7 @@ vec4 LinearTosRGB( in vec4 value ) { #elif defined( ENVMAP_BLENDING_ADD ) outgoingLight += envColor.xyz * specularStrength * reflectivity; #endif -#endif`,Hzt=`#ifdef USE_ENVMAP +#endif`,Xzt=`#ifdef USE_ENVMAP uniform float envMapIntensity; uniform float flipEnvMap; #ifdef ENVMAP_TYPE_CUBE @@ -900,7 +900,7 @@ vec4 LinearTosRGB( in vec4 value ) { uniform sampler2D envMap; #endif -#endif`,qzt=`#ifdef USE_ENVMAP +#endif`,Qzt=`#ifdef USE_ENVMAP uniform float reflectivity; #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS @@ -911,7 +911,7 @@ vec4 LinearTosRGB( in vec4 value ) { #else varying vec3 vReflect; #endif -#endif`,Xzt=`#ifdef USE_ENVMAP +#endif`,Yzt=`#ifdef USE_ENVMAP #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS #endif @@ -922,7 +922,7 @@ vec4 LinearTosRGB( in vec4 value ) { varying vec3 vReflect; uniform float refractionRatio; #endif -#endif`,Qzt=`#ifdef USE_ENVMAP +#endif`,Kzt=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vWorldPosition = worldPosition.xyz; #else @@ -939,18 +939,18 @@ vec4 LinearTosRGB( in vec4 value ) { vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); #endif #endif -#endif`,Yzt=`#ifdef USE_FOG +#endif`,Zzt=`#ifdef USE_FOG vFogDepth = - mvPosition.z; -#endif`,Kzt=`#ifdef USE_FOG +#endif`,Jzt=`#ifdef USE_FOG varying float vFogDepth; -#endif`,Zzt=`#ifdef USE_FOG +#endif`,e4t=`#ifdef USE_FOG #ifdef FOG_EXP2 float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); #else float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); #endif gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); -#endif`,Jzt=`#ifdef USE_FOG +#endif`,t4t=`#ifdef USE_FOG uniform vec3 fogColor; varying float vFogDepth; #ifdef FOG_EXP2 @@ -959,7 +959,7 @@ vec4 LinearTosRGB( in vec4 value ) { uniform float fogNear; uniform float fogFar; #endif -#endif`,e4t=`#ifdef USE_GRADIENTMAP +#endif`,n4t=`#ifdef USE_GRADIENTMAP uniform sampler2D gradientMap; #endif vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { @@ -971,16 +971,16 @@ vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { vec2 fw = fwidth( coord ) * 0.5; return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); #endif -}`,t4t=`#ifdef USE_LIGHTMAP +}`,r4t=`#ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vUv2 ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; reflectedLight.indirectDiffuse += lightMapIrradiance; -#endif`,n4t=`#ifdef USE_LIGHTMAP +#endif`,i4t=`#ifdef USE_LIGHTMAP uniform sampler2D lightMap; uniform float lightMapIntensity; -#endif`,r4t=`LambertMaterial material; +#endif`,o4t=`LambertMaterial material; material.diffuseColor = diffuseColor.rgb; -material.specularStrength = specularStrength;`,i4t=`varying vec3 vViewPosition; +material.specularStrength = specularStrength;`,a4t=`varying vec3 vViewPosition; struct LambertMaterial { vec3 diffuseColor; float specularStrength; @@ -995,7 +995,7 @@ void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in GeometricCon } #define RE_Direct RE_Direct_Lambert #define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert -#define Material_LightProbeLOD( material ) (0)`,o4t=`uniform bool receiveShadow; +#define Material_LightProbeLOD( material ) (0)`,s4t=`uniform bool receiveShadow; uniform vec3 ambientLightColor; uniform vec3 lightProbe[ 9 ]; vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { @@ -1116,7 +1116,7 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); return irradiance; } -#endif`,a4t=`#if defined( USE_ENVMAP ) +#endif`,l4t=`#if defined( USE_ENVMAP ) vec3 getIBLIrradiance( const in vec3 normal ) { #if defined( ENVMAP_TYPE_CUBE_UV ) vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); @@ -1137,8 +1137,8 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi return vec3( 0.0 ); #endif } -#endif`,s4t=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,l4t=`varying vec3 vViewPosition; +#endif`,c4t=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,u4t=`varying vec3 vViewPosition; struct ToonMaterial { vec3 diffuseColor; }; @@ -1151,11 +1151,11 @@ void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContex } #define RE_Direct RE_Direct_Toon #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon -#define Material_LightProbeLOD( material ) (0)`,c4t=`BlinnPhongMaterial material; +#define Material_LightProbeLOD( material ) (0)`,f4t=`BlinnPhongMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularColor = specular; material.specularShininess = shininess; -material.specularStrength = specularStrength;`,u4t=`varying vec3 vViewPosition; +material.specularStrength = specularStrength;`,d4t=`varying vec3 vViewPosition; struct BlinnPhongMaterial { vec3 diffuseColor; vec3 specularColor; @@ -1173,7 +1173,7 @@ void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in Geometric } #define RE_Direct RE_Direct_BlinnPhong #define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong -#define Material_LightProbeLOD( material ) (0)`,f4t=`PhysicalMaterial material; +#define Material_LightProbeLOD( material ) (0)`,h4t=`PhysicalMaterial material; material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) ); float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); @@ -1237,7 +1237,7 @@ material.roughness = min( material.roughness, 1.0 ); #ifdef USE_SHEENROUGHNESSMAP material.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a; #endif -#endif`,d4t=`struct PhysicalMaterial { +#endif`,p4t=`struct PhysicalMaterial { vec3 diffuseColor; float roughness; vec3 specularColor; @@ -1386,7 +1386,7 @@ void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradia #define RE_IndirectSpecular RE_IndirectSpecular_Physical float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); -}`,h4t=` +}`,m4t=` GeometricContext geometry; geometry.position = - vViewPosition; geometry.normal = normal; @@ -1499,7 +1499,7 @@ IncidentLight directLight; #if defined( RE_IndirectSpecular ) vec3 radiance = vec3( 0.0 ); vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,p4t=`#if defined( RE_IndirectDiffuse ) +#endif`,g4t=`#if defined( RE_IndirectDiffuse ) #ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vUv2 ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; @@ -1514,25 +1514,25 @@ IncidentLight directLight; #ifdef USE_CLEARCOAT clearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness ); #endif -#endif`,m4t=`#if defined( RE_IndirectDiffuse ) +#endif`,v4t=`#if defined( RE_IndirectDiffuse ) RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight ); #endif #if defined( RE_IndirectSpecular ) RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight ); -#endif`,g4t=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) +#endif`,y4t=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,v4t=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) +#endif`,x4t=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) uniform float logDepthBufFC; varying float vFragDepth; varying float vIsPerspective; -#endif`,y4t=`#ifdef USE_LOGDEPTHBUF +#endif`,b4t=`#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT varying float vFragDepth; varying float vIsPerspective; #else uniform float logDepthBufFC; #endif -#endif`,x4t=`#ifdef USE_LOGDEPTHBUF +#endif`,_4t=`#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT vFragDepth = 1.0 + gl_Position.w; vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); @@ -1542,15 +1542,15 @@ IncidentLight directLight; gl_Position.z *= gl_Position.w; } #endif -#endif`,b4t=`#ifdef USE_MAP +#endif`,w4t=`#ifdef USE_MAP vec4 sampledDiffuseColor = texture2D( map, vUv ); #ifdef DECODE_VIDEO_TEXTURE sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w ); #endif diffuseColor *= sampledDiffuseColor; -#endif`,_4t=`#ifdef USE_MAP +#endif`,S4t=`#ifdef USE_MAP uniform sampler2D map; -#endif`,w4t=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) +#endif`,O4t=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; #endif #ifdef USE_MAP @@ -1558,7 +1558,7 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,S4t=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) +#endif`,C4t=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) uniform mat3 uvTransform; #endif #ifdef USE_MAP @@ -1566,13 +1566,13 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP uniform sampler2D alphaMap; -#endif`,O4t=`float metalnessFactor = metalness; +#endif`,T4t=`float metalnessFactor = metalness; #ifdef USE_METALNESSMAP vec4 texelMetalness = texture2D( metalnessMap, vUv ); metalnessFactor *= texelMetalness.b; -#endif`,C4t=`#ifdef USE_METALNESSMAP +#endif`,E4t=`#ifdef USE_METALNESSMAP uniform sampler2D metalnessMap; -#endif`,T4t=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) +#endif`,P4t=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) vColor *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { #if defined( USE_COLOR_ALPHA ) @@ -1581,7 +1581,7 @@ IncidentLight directLight; if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; #endif } -#endif`,E4t=`#ifdef USE_MORPHNORMALS +#endif`,M4t=`#ifdef USE_MORPHNORMALS objectNormal *= morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { @@ -1593,7 +1593,7 @@ IncidentLight directLight; objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; #endif -#endif`,P4t=`#ifdef USE_MORPHTARGETS +#endif`,k4t=`#ifdef USE_MORPHTARGETS uniform float morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; @@ -1613,7 +1613,7 @@ IncidentLight directLight; uniform float morphTargetInfluences[ 4 ]; #endif #endif -#endif`,M4t=`#ifdef USE_MORPHTARGETS +#endif`,A4t=`#ifdef USE_MORPHTARGETS transformed *= morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { @@ -1631,7 +1631,7 @@ IncidentLight directLight; transformed += morphTarget7 * morphTargetInfluences[ 7 ]; #endif #endif -#endif`,k4t=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#endif`,R4t=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; #ifdef FLAT_SHADED vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) ); vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) ); @@ -1653,7 +1653,7 @@ IncidentLight directLight; #endif #endif #endif -vec3 geometryNormal = normal;`,A4t=`#ifdef OBJECTSPACE_NORMALMAP +vec3 geometryNormal = normal;`,I4t=`#ifdef OBJECTSPACE_NORMALMAP normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; #ifdef FLIP_SIDED normal = - normal; @@ -1672,25 +1672,25 @@ vec3 geometryNormal = normal;`,A4t=`#ifdef OBJECTSPACE_NORMALMAP #endif #elif defined( USE_BUMPMAP ) normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,R4t=`#ifndef FLAT_SHADED +#endif`,D4t=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif -#endif`,I4t=`#ifndef FLAT_SHADED +#endif`,L4t=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif -#endif`,D4t=`#ifndef FLAT_SHADED +#endif`,$4t=`#ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #ifdef USE_TANGENT vTangent = normalize( transformedTangent ); vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); #endif -#endif`,L4t=`#ifdef USE_NORMALMAP +#endif`,N4t=`#ifdef USE_NORMALMAP uniform sampler2D normalMap; uniform vec2 normalScale; #endif @@ -1712,9 +1712,9 @@ vec3 geometryNormal = normal;`,A4t=`#ifdef OBJECTSPACE_NORMALMAP float scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det ); return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z ); } -#endif`,$4t=`#ifdef USE_CLEARCOAT +#endif`,F4t=`#ifdef USE_CLEARCOAT vec3 clearcoatNormal = geometryNormal; -#endif`,N4t=`#ifdef USE_CLEARCOAT_NORMALMAP +#endif`,j4t=`#ifdef USE_CLEARCOAT_NORMALMAP vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0; clearcoatMapN.xy *= clearcoatNormalScale; #ifdef USE_TANGENT @@ -1722,7 +1722,7 @@ vec3 geometryNormal = normal;`,A4t=`#ifdef OBJECTSPACE_NORMALMAP #else clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection ); #endif -#endif`,F4t=`#ifdef USE_CLEARCOATMAP +#endif`,B4t=`#ifdef USE_CLEARCOATMAP uniform sampler2D clearcoatMap; #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP @@ -1731,18 +1731,18 @@ vec3 geometryNormal = normal;`,A4t=`#ifdef OBJECTSPACE_NORMALMAP #ifdef USE_CLEARCOAT_NORMALMAP uniform sampler2D clearcoatNormalMap; uniform vec2 clearcoatNormalScale; -#endif`,j4t=`#ifdef USE_IRIDESCENCEMAP +#endif`,z4t=`#ifdef USE_IRIDESCENCEMAP uniform sampler2D iridescenceMap; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP uniform sampler2D iridescenceThicknessMap; -#endif`,B4t=`#ifdef OPAQUE +#endif`,U4t=`#ifdef OPAQUE diffuseColor.a = 1.0; #endif #ifdef USE_TRANSMISSION diffuseColor.a *= material.transmissionAlpha + 0.1; #endif -gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,z4t=`vec3 packNormalToRGB( const in vec3 normal ) { +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,W4t=`vec3 packNormalToRGB( const in vec3 normal ) { return normalize( normal ) * 0.5 + 0.5; } vec3 unpackRGBToNormal( const in vec3 rgb ) { @@ -1777,29 +1777,29 @@ float viewZToPerspectiveDepth( const in float viewZ, const in float near, const } float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) { return ( near * far ) / ( ( far - near ) * invClipZ - far ); -}`,U4t=`#ifdef PREMULTIPLIED_ALPHA +}`,V4t=`#ifdef PREMULTIPLIED_ALPHA gl_FragColor.rgb *= gl_FragColor.a; -#endif`,W4t=`vec4 mvPosition = vec4( transformed, 1.0 ); +#endif`,G4t=`vec4 mvPosition = vec4( transformed, 1.0 ); #ifdef USE_INSTANCING mvPosition = instanceMatrix * mvPosition; #endif mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,V4t=`#ifdef DITHERING +gl_Position = projectionMatrix * mvPosition;`,H4t=`#ifdef DITHERING gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,G4t=`#ifdef DITHERING +#endif`,q4t=`#ifdef DITHERING vec3 dithering( vec3 color ) { float grid_position = rand( gl_FragCoord.xy ); vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); return color + dither_shift_RGB; } -#endif`,H4t=`float roughnessFactor = roughness; +#endif`,X4t=`float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP vec4 texelRoughness = texture2D( roughnessMap, vUv ); roughnessFactor *= texelRoughness.g; -#endif`,q4t=`#ifdef USE_ROUGHNESSMAP +#endif`,Q4t=`#ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; -#endif`,X4t=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,Y4t=`#if NUM_SPOT_LIGHT_COORDS > 0 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif #if NUM_SPOT_LIGHT_MAPS > 0 @@ -1978,7 +1978,7 @@ gl_Position = projectionMatrix * mvPosition;`,V4t=`#ifdef DITHERING return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); #endif } -#endif`,Q4t=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,K4t=`#if NUM_SPOT_LIGHT_COORDS > 0 uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif @@ -2016,7 +2016,7 @@ gl_Position = projectionMatrix * mvPosition;`,V4t=`#ifdef DITHERING }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif -#endif`,Y4t=`#if defined( USE_SHADOWMAP ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) +#endif`,Z4t=`#if defined( USE_SHADOWMAP ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) #if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_COORDS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); vec4 shadowWorldPosition; @@ -2048,7 +2048,7 @@ gl_Position = projectionMatrix * mvPosition;`,V4t=`#ifdef DITHERING } #pragma unroll_loop_end #endif -#endif`,K4t=`float getShadowMask() { +#endif`,J4t=`float getShadowMask() { float shadow = 1.0; #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 @@ -2080,12 +2080,12 @@ gl_Position = projectionMatrix * mvPosition;`,V4t=`#ifdef DITHERING #endif #endif return shadow; -}`,Z4t=`#ifdef USE_SKINNING +}`,eUt=`#ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); mat4 boneMatY = getBoneMatrix( skinIndex.y ); mat4 boneMatZ = getBoneMatrix( skinIndex.z ); mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,J4t=`#ifdef USE_SKINNING +#endif`,tUt=`#ifdef USE_SKINNING uniform mat4 bindMatrix; uniform mat4 bindMatrixInverse; uniform highp sampler2D boneTexture; @@ -2104,7 +2104,7 @@ gl_Position = projectionMatrix * mvPosition;`,V4t=`#ifdef DITHERING mat4 bone = mat4( v1, v2, v3, v4 ); return bone; } -#endif`,eUt=`#ifdef USE_SKINNING +#endif`,nUt=`#ifdef USE_SKINNING vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); vec4 skinned = vec4( 0.0 ); skinned += boneMatX * skinVertex * skinWeight.x; @@ -2112,7 +2112,7 @@ gl_Position = projectionMatrix * mvPosition;`,V4t=`#ifdef DITHERING skinned += boneMatZ * skinVertex * skinWeight.z; skinned += boneMatW * skinVertex * skinWeight.w; transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,tUt=`#ifdef USE_SKINNING +#endif`,rUt=`#ifdef USE_SKINNING mat4 skinMatrix = mat4( 0.0 ); skinMatrix += skinWeight.x * boneMatX; skinMatrix += skinWeight.y * boneMatY; @@ -2123,17 +2123,17 @@ gl_Position = projectionMatrix * mvPosition;`,V4t=`#ifdef DITHERING #ifdef USE_TANGENT objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; #endif -#endif`,nUt=`float specularStrength; +#endif`,iUt=`float specularStrength; #ifdef USE_SPECULARMAP vec4 texelSpecular = texture2D( specularMap, vUv ); specularStrength = texelSpecular.r; #else specularStrength = 1.0; -#endif`,rUt=`#ifdef USE_SPECULARMAP +#endif`,oUt=`#ifdef USE_SPECULARMAP uniform sampler2D specularMap; -#endif`,iUt=`#if defined( TONE_MAPPING ) +#endif`,aUt=`#if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,oUt=`#ifndef saturate +#endif`,sUt=`#ifndef saturate #define saturate( a ) clamp( a, 0.0, 1.0 ) #endif uniform float toneMappingExposure; @@ -2169,7 +2169,7 @@ vec3 ACESFilmicToneMapping( vec3 color ) { color = ACESOutputMat * color; return saturate( color ); } -vec3 CustomToneMapping( vec3 color ) { return color; }`,aUt=`#ifdef USE_TRANSMISSION +vec3 CustomToneMapping( vec3 color ) { return color; }`,lUt=`#ifdef USE_TRANSMISSION material.transmission = transmission; material.transmissionAlpha = 1.0; material.thickness = thickness; @@ -2190,7 +2190,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,aUt=`#ifdef USE_TRANSMIS material.attenuationColor, material.attenuationDistance ); material.transmissionAlpha = mix( material.transmissionAlpha, transmission.a, material.transmission ); totalDiffuse = mix( totalDiffuse, transmission.rgb, material.transmission ); -#endif`,sUt=`#ifdef USE_TRANSMISSION +#endif`,cUt=`#ifdef USE_TRANSMISSION uniform float transmission; uniform float thickness; uniform float attenuationDistance; @@ -2248,37 +2248,37 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,aUt=`#ifdef USE_TRANSMIS vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); return vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a ); } -#endif`,lUt=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) ) +#endif`,uUt=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) ) varying vec2 vUv; -#endif`,cUt=`#ifdef USE_UV +#endif`,fUt=`#ifdef USE_UV #ifdef UVS_VERTEX_ONLY vec2 vUv; #else varying vec2 vUv; #endif uniform mat3 uvTransform; -#endif`,uUt=`#ifdef USE_UV +#endif`,dUt=`#ifdef USE_UV vUv = ( uvTransform * vec3( uv, 1 ) ).xy; -#endif`,fUt=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) +#endif`,hUt=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) varying vec2 vUv2; -#endif`,dUt=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) +#endif`,pUt=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) attribute vec2 uv2; varying vec2 vUv2; uniform mat3 uv2Transform; -#endif`,hUt=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) +#endif`,mUt=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy; -#endif`,pUt=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 +#endif`,gUt=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 vec4 worldPosition = vec4( transformed, 1.0 ); #ifdef USE_INSTANCING worldPosition = instanceMatrix * worldPosition; #endif worldPosition = modelMatrix * worldPosition; -#endif`;const mUt=`varying vec2 vUv; +#endif`;const vUt=`varying vec2 vUv; uniform mat3 uvTransform; void main() { vUv = ( uvTransform * vec3( uv, 1 ) ).xy; gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,gUt=`uniform sampler2D t2D; +}`,yUt=`uniform sampler2D t2D; varying vec2 vUv; void main() { gl_FragColor = texture2D( t2D, vUv ); @@ -2287,14 +2287,14 @@ void main() { #endif #include #include -}`,vUt=`varying vec3 vWorldDirection; +}`,xUt=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; -}`,yUt=`#include +}`,bUt=`#include uniform float opacity; varying vec3 vWorldDirection; #include @@ -2305,7 +2305,7 @@ void main() { gl_FragColor.a *= opacity; #include #include -}`,xUt=`#include +}`,_Ut=`#include #include #include #include @@ -2329,7 +2329,7 @@ void main() { #include #include vHighPrecisionZW = gl_Position.zw; -}`,bUt=`#if DEPTH_PACKING == 3200 +}`,wUt=`#if DEPTH_PACKING == 3200 uniform float opacity; #endif #include @@ -2357,7 +2357,7 @@ void main() { #elif DEPTH_PACKING == 3201 gl_FragColor = packDepthToRGBA( fragCoordZ ); #endif -}`,_Ut=`#define DISTANCE +}`,SUt=`#define DISTANCE varying vec3 vWorldPosition; #include #include @@ -2381,7 +2381,7 @@ void main() { #include #include vWorldPosition = worldPosition.xyz; -}`,wUt=`#define DISTANCE +}`,OUt=`#define DISTANCE uniform vec3 referencePosition; uniform float nearDistance; uniform float farDistance; @@ -2403,13 +2403,13 @@ void main () { dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); dist = saturate( dist ); gl_FragColor = packDepthToRGBA( dist ); -}`,SUt=`varying vec3 vWorldDirection; +}`,CUt=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include -}`,OUt=`uniform sampler2D tEquirect; +}`,TUt=`uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { @@ -2418,7 +2418,7 @@ void main() { gl_FragColor = texture2D( tEquirect, sampleUV ); #include #include -}`,CUt=`uniform float scale; +}`,EUt=`uniform float scale; attribute float lineDistance; varying float vLineDistance; #include @@ -2437,7 +2437,7 @@ void main() { #include #include #include -}`,TUt=`uniform vec3 diffuse; +}`,PUt=`uniform vec3 diffuse; uniform float opacity; uniform float dashSize; uniform float totalSize; @@ -2462,7 +2462,7 @@ void main() { #include #include #include -}`,EUt=`#include +}`,MUt=`#include #include #include #include @@ -2493,7 +2493,7 @@ void main() { #include #include #include -}`,PUt=`uniform vec3 diffuse; +}`,kUt=`uniform vec3 diffuse; uniform float opacity; #ifndef FLAT_SHADED varying vec3 vNormal; @@ -2540,7 +2540,7 @@ void main() { #include #include #include -}`,MUt=`#define LAMBERT +}`,AUt=`#define LAMBERT varying vec3 vViewPosition; #include #include @@ -2578,7 +2578,7 @@ void main() { #include #include #include -}`,kUt=`#define LAMBERT +}`,RUt=`#define LAMBERT uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -2634,7 +2634,7 @@ void main() { #include #include #include -}`,AUt=`#define MATCAP +}`,IUt=`#define MATCAP varying vec3 vViewPosition; #include #include @@ -2665,7 +2665,7 @@ void main() { #include #include vViewPosition = - mvPosition.xyz; -}`,RUt=`#define MATCAP +}`,DUt=`#define MATCAP uniform vec3 diffuse; uniform float opacity; uniform sampler2D matcap; @@ -2709,7 +2709,7 @@ void main() { #include #include #include -}`,IUt=`#define NORMAL +}`,LUt=`#define NORMAL #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) varying vec3 vViewPosition; #endif @@ -2739,7 +2739,7 @@ void main() { #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) vViewPosition = - mvPosition.xyz; #endif -}`,DUt=`#define NORMAL +}`,$Ut=`#define NORMAL uniform float opacity; #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) varying vec3 vViewPosition; @@ -2760,7 +2760,7 @@ void main() { #ifdef OPAQUE gl_FragColor.a = 1.0; #endif -}`,LUt=`#define PHONG +}`,NUt=`#define PHONG varying vec3 vViewPosition; #include #include @@ -2798,7 +2798,7 @@ void main() { #include #include #include -}`,$Ut=`#define PHONG +}`,FUt=`#define PHONG uniform vec3 diffuse; uniform vec3 emissive; uniform vec3 specular; @@ -2856,7 +2856,7 @@ void main() { #include #include #include -}`,NUt=`#define STANDARD +}`,jUt=`#define STANDARD varying vec3 vViewPosition; #ifdef USE_TRANSMISSION varying vec3 vWorldPosition; @@ -2898,7 +2898,7 @@ void main() { #ifdef USE_TRANSMISSION vWorldPosition = worldPosition.xyz; #endif -}`,FUt=`#define STANDARD +}`,BUt=`#define STANDARD #ifdef PHYSICAL #define IOR #define SPECULAR @@ -3014,7 +3014,7 @@ void main() { #include #include #include -}`,jUt=`#define TOON +}`,zUt=`#define TOON varying vec3 vViewPosition; #include #include @@ -3050,7 +3050,7 @@ void main() { #include #include #include -}`,BUt=`#define TOON +}`,UUt=`#define TOON uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -3102,7 +3102,7 @@ void main() { #include #include #include -}`,zUt=`uniform float size; +}`,WUt=`uniform float size; uniform float scale; #include #include @@ -3125,7 +3125,7 @@ void main() { #include #include #include -}`,UUt=`uniform vec3 diffuse; +}`,VUt=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -3148,7 +3148,7 @@ void main() { #include #include #include -}`,WUt=`#include +}`,GUt=`#include #include #include #include @@ -3166,7 +3166,7 @@ void main() { #include #include #include -}`,VUt=`uniform vec3 color; +}`,HUt=`uniform vec3 color; uniform float opacity; #include #include @@ -3180,7 +3180,7 @@ void main() { #include #include #include -}`,GUt=`uniform float rotation; +}`,qUt=`uniform float rotation; uniform vec2 center; #include #include @@ -3206,7 +3206,7 @@ void main() { #include #include #include -}`,HUt=`uniform vec3 diffuse; +}`,XUt=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -3229,7 +3229,7 @@ void main() { #include #include #include -}`,Vt={alphamap_fragment:vzt,alphamap_pars_fragment:yzt,alphatest_fragment:xzt,alphatest_pars_fragment:bzt,aomap_fragment:_zt,aomap_pars_fragment:wzt,begin_vertex:Szt,beginnormal_vertex:Ozt,bsdfs:Czt,iridescence_fragment:Tzt,bumpmap_pars_fragment:Ezt,clipping_planes_fragment:Pzt,clipping_planes_pars_fragment:Mzt,clipping_planes_pars_vertex:kzt,clipping_planes_vertex:Azt,color_fragment:Rzt,color_pars_fragment:Izt,color_pars_vertex:Dzt,color_vertex:Lzt,common:$zt,cube_uv_reflection_fragment:Nzt,defaultnormal_vertex:Fzt,displacementmap_pars_vertex:jzt,displacementmap_vertex:Bzt,emissivemap_fragment:zzt,emissivemap_pars_fragment:Uzt,encodings_fragment:Wzt,encodings_pars_fragment:Vzt,envmap_fragment:Gzt,envmap_common_pars_fragment:Hzt,envmap_pars_fragment:qzt,envmap_pars_vertex:Xzt,envmap_physical_pars_fragment:a4t,envmap_vertex:Qzt,fog_vertex:Yzt,fog_pars_vertex:Kzt,fog_fragment:Zzt,fog_pars_fragment:Jzt,gradientmap_pars_fragment:e4t,lightmap_fragment:t4t,lightmap_pars_fragment:n4t,lights_lambert_fragment:r4t,lights_lambert_pars_fragment:i4t,lights_pars_begin:o4t,lights_toon_fragment:s4t,lights_toon_pars_fragment:l4t,lights_phong_fragment:c4t,lights_phong_pars_fragment:u4t,lights_physical_fragment:f4t,lights_physical_pars_fragment:d4t,lights_fragment_begin:h4t,lights_fragment_maps:p4t,lights_fragment_end:m4t,logdepthbuf_fragment:g4t,logdepthbuf_pars_fragment:v4t,logdepthbuf_pars_vertex:y4t,logdepthbuf_vertex:x4t,map_fragment:b4t,map_pars_fragment:_4t,map_particle_fragment:w4t,map_particle_pars_fragment:S4t,metalnessmap_fragment:O4t,metalnessmap_pars_fragment:C4t,morphcolor_vertex:T4t,morphnormal_vertex:E4t,morphtarget_pars_vertex:P4t,morphtarget_vertex:M4t,normal_fragment_begin:k4t,normal_fragment_maps:A4t,normal_pars_fragment:R4t,normal_pars_vertex:I4t,normal_vertex:D4t,normalmap_pars_fragment:L4t,clearcoat_normal_fragment_begin:$4t,clearcoat_normal_fragment_maps:N4t,clearcoat_pars_fragment:F4t,iridescence_pars_fragment:j4t,output_fragment:B4t,packing:z4t,premultiplied_alpha_fragment:U4t,project_vertex:W4t,dithering_fragment:V4t,dithering_pars_fragment:G4t,roughnessmap_fragment:H4t,roughnessmap_pars_fragment:q4t,shadowmap_pars_fragment:X4t,shadowmap_pars_vertex:Q4t,shadowmap_vertex:Y4t,shadowmask_pars_fragment:K4t,skinbase_vertex:Z4t,skinning_pars_vertex:J4t,skinning_vertex:eUt,skinnormal_vertex:tUt,specularmap_fragment:nUt,specularmap_pars_fragment:rUt,tonemapping_fragment:iUt,tonemapping_pars_fragment:oUt,transmission_fragment:aUt,transmission_pars_fragment:sUt,uv_pars_fragment:lUt,uv_pars_vertex:cUt,uv_vertex:uUt,uv2_pars_fragment:fUt,uv2_pars_vertex:dUt,uv2_vertex:hUt,worldpos_vertex:pUt,background_vert:mUt,background_frag:gUt,cube_vert:vUt,cube_frag:yUt,depth_vert:xUt,depth_frag:bUt,distanceRGBA_vert:_Ut,distanceRGBA_frag:wUt,equirect_vert:SUt,equirect_frag:OUt,linedashed_vert:CUt,linedashed_frag:TUt,meshbasic_vert:EUt,meshbasic_frag:PUt,meshlambert_vert:MUt,meshlambert_frag:kUt,meshmatcap_vert:AUt,meshmatcap_frag:RUt,meshnormal_vert:IUt,meshnormal_frag:DUt,meshphong_vert:LUt,meshphong_frag:$Ut,meshphysical_vert:NUt,meshphysical_frag:FUt,meshtoon_vert:jUt,meshtoon_frag:BUt,points_vert:zUt,points_frag:UUt,shadow_vert:WUt,shadow_frag:VUt,sprite_vert:GUt,sprite_frag:HUt},Je={common:{diffuse:{value:new sr(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new va},uv2Transform:{value:new va},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Ht(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new sr(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new sr(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new va}},sprite:{diffuse:{value:new sr(16777215)},opacity:{value:1},center:{value:new Ht(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new va}}},xl={basic:{uniforms:zi([Je.common,Je.specularmap,Je.envmap,Je.aomap,Je.lightmap,Je.fog]),vertexShader:Vt.meshbasic_vert,fragmentShader:Vt.meshbasic_frag},lambert:{uniforms:zi([Je.common,Je.specularmap,Je.envmap,Je.aomap,Je.lightmap,Je.emissivemap,Je.bumpmap,Je.normalmap,Je.displacementmap,Je.fog,Je.lights,{emissive:{value:new sr(0)}}]),vertexShader:Vt.meshlambert_vert,fragmentShader:Vt.meshlambert_frag},phong:{uniforms:zi([Je.common,Je.specularmap,Je.envmap,Je.aomap,Je.lightmap,Je.emissivemap,Je.bumpmap,Je.normalmap,Je.displacementmap,Je.fog,Je.lights,{emissive:{value:new sr(0)},specular:{value:new sr(1118481)},shininess:{value:30}}]),vertexShader:Vt.meshphong_vert,fragmentShader:Vt.meshphong_frag},standard:{uniforms:zi([Je.common,Je.envmap,Je.aomap,Je.lightmap,Je.emissivemap,Je.bumpmap,Je.normalmap,Je.displacementmap,Je.roughnessmap,Je.metalnessmap,Je.fog,Je.lights,{emissive:{value:new sr(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Vt.meshphysical_vert,fragmentShader:Vt.meshphysical_frag},toon:{uniforms:zi([Je.common,Je.aomap,Je.lightmap,Je.emissivemap,Je.bumpmap,Je.normalmap,Je.displacementmap,Je.gradientmap,Je.fog,Je.lights,{emissive:{value:new sr(0)}}]),vertexShader:Vt.meshtoon_vert,fragmentShader:Vt.meshtoon_frag},matcap:{uniforms:zi([Je.common,Je.bumpmap,Je.normalmap,Je.displacementmap,Je.fog,{matcap:{value:null}}]),vertexShader:Vt.meshmatcap_vert,fragmentShader:Vt.meshmatcap_frag},points:{uniforms:zi([Je.points,Je.fog]),vertexShader:Vt.points_vert,fragmentShader:Vt.points_frag},dashed:{uniforms:zi([Je.common,Je.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Vt.linedashed_vert,fragmentShader:Vt.linedashed_frag},depth:{uniforms:zi([Je.common,Je.displacementmap]),vertexShader:Vt.depth_vert,fragmentShader:Vt.depth_frag},normal:{uniforms:zi([Je.common,Je.bumpmap,Je.normalmap,Je.displacementmap,{opacity:{value:1}}]),vertexShader:Vt.meshnormal_vert,fragmentShader:Vt.meshnormal_frag},sprite:{uniforms:zi([Je.sprite,Je.fog]),vertexShader:Vt.sprite_vert,fragmentShader:Vt.sprite_frag},background:{uniforms:{uvTransform:{value:new va},t2D:{value:null}},vertexShader:Vt.background_vert,fragmentShader:Vt.background_frag},cube:{uniforms:zi([Je.envmap,{opacity:{value:1}}]),vertexShader:Vt.cube_vert,fragmentShader:Vt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Vt.equirect_vert,fragmentShader:Vt.equirect_frag},distanceRGBA:{uniforms:zi([Je.common,Je.displacementmap,{referencePosition:{value:new Se},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Vt.distanceRGBA_vert,fragmentShader:Vt.distanceRGBA_frag},shadow:{uniforms:zi([Je.lights,Je.fog,{color:{value:new sr(0)},opacity:{value:1}}]),vertexShader:Vt.shadow_vert,fragmentShader:Vt.shadow_frag}};xl.physical={uniforms:zi([xl.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new Ht(1,1)},clearcoatNormalMap:{value:null},iridescence:{value:0},iridescenceMap:{value:null},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},sheen:{value:0},sheenColor:{value:new sr(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new Ht},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new sr(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new sr(1,1,1)},specularColorMap:{value:null}}]),vertexShader:Vt.meshphysical_vert,fragmentShader:Vt.meshphysical_frag};function qUt(t,e,n,r,i,o){const a=new sr(0);let s=i===!0?0:1,l,c,u=null,f=0,d=null;function h(m,g){let v=!1,y=g.isScene===!0?g.background:null;y&&y.isTexture&&(y=e.get(y));const x=t.xr,b=x.getSession&&x.getSession();b&&b.environmentBlendMode==="additive"&&(y=null),y===null?p(a,s):y&&y.isColor&&(p(y,1),v=!0),(t.autoClear||v)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),y&&(y.isCubeTexture||y.mapping===Ck)?(c===void 0&&(c=new Nl(new Hy(1,1,1),new od({name:"BackgroundCubeMaterial",uniforms:Lv(xl.cube.uniforms),vertexShader:xl.cube.vertexShader,fragmentShader:xl.cube.fragmentShader,side:_a,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(_,S,O){this.matrixWorld.copyPosition(O.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(c)),c.material.uniforms.envMap.value=y,c.material.uniforms.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,(u!==y||f!==y.version||d!==t.toneMapping)&&(c.material.needsUpdate=!0,u=y,f=y.version,d=t.toneMapping),c.layers.enableAll(),m.unshift(c,c.geometry,c.material,0,0,null)):y&&y.isTexture&&(l===void 0&&(l=new Nl(new Pk(2,2),new od({name:"BackgroundMaterial",uniforms:Lv(xl.background.uniforms),vertexShader:xl.background.vertexShader,fragmentShader:xl.background.fragmentShader,side:Av,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(l)),l.material.uniforms.t2D.value=y,y.matrixAutoUpdate===!0&&y.updateMatrix(),l.material.uniforms.uvTransform.value.copy(y.matrix),(u!==y||f!==y.version||d!==t.toneMapping)&&(l.material.needsUpdate=!0,u=y,f=y.version,d=t.toneMapping),l.layers.enableAll(),m.unshift(l,l.geometry,l.material,0,0,null))}function p(m,g){n.buffers.color.setClear(m.r,m.g,m.b,g,o)}return{getClearColor:function(){return a},setClearColor:function(m,g=1){a.set(m),s=g,p(a,s)},getClearAlpha:function(){return s},setClearAlpha:function(m){s=m,p(a,s)},render:h}}function XUt(t,e,n,r){const i=t.getParameter(34921),o=r.isWebGL2?null:e.get("OES_vertex_array_object"),a=r.isWebGL2||o!==null,s={},l=g(null);let c=l,u=!1;function f(T,L,z,B,W){let U=!1;if(a){const N=m(B,z,L);c!==N&&(c=N,h(c.object)),U=v(T,B,z,W),U&&y(T,B,z,W)}else{const N=L.wireframe===!0;(c.geometry!==B.id||c.program!==z.id||c.wireframe!==N)&&(c.geometry=B.id,c.program=z.id,c.wireframe=N,U=!0)}W!==null&&n.update(W,34963),(U||u)&&(u=!1,C(T,L,z,B),W!==null&&t.bindBuffer(34963,n.get(W).buffer))}function d(){return r.isWebGL2?t.createVertexArray():o.createVertexArrayOES()}function h(T){return r.isWebGL2?t.bindVertexArray(T):o.bindVertexArrayOES(T)}function p(T){return r.isWebGL2?t.deleteVertexArray(T):o.deleteVertexArrayOES(T)}function m(T,L,z){const B=z.wireframe===!0;let W=s[T.id];W===void 0&&(W={},s[T.id]=W);let U=W[L.id];U===void 0&&(U={},W[L.id]=U);let N=U[B];return N===void 0&&(N=g(d()),U[B]=N),N}function g(T){const L=[],z=[],B=[];for(let W=0;W=0){const q=W[D];let Y=U[D];if(Y===void 0&&(D==="instanceMatrix"&&T.instanceMatrix&&(Y=T.instanceMatrix),D==="instanceColor"&&T.instanceColor&&(Y=T.instanceColor)),q===void 0||q.attribute!==Y||Y&&q.data!==Y.data)return!0;N++}return c.attributesNum!==N||c.index!==B}function y(T,L,z,B){const W={},U=L.attributes;let N=0;const $=z.getAttributes();for(const D in $)if($[D].location>=0){let q=U[D];q===void 0&&(D==="instanceMatrix"&&T.instanceMatrix&&(q=T.instanceMatrix),D==="instanceColor"&&T.instanceColor&&(q=T.instanceColor));const Y={};Y.attribute=q,q&&q.data&&(Y.data=q.data),W[D]=Y,N++}c.attributes=W,c.attributesNum=N,c.index=B}function x(){const T=c.newAttributes;for(let L=0,z=T.length;L=0){let A=W[$];if(A===void 0&&($==="instanceMatrix"&&T.instanceMatrix&&(A=T.instanceMatrix),$==="instanceColor"&&T.instanceColor&&(A=T.instanceColor)),A!==void 0){const q=A.normalized,Y=A.itemSize,K=n.get(A);if(K===void 0)continue;const se=K.buffer,te=K.type,J=K.bytesPerElement;if(A.isInterleavedBufferAttribute){const pe=A.data,be=pe.stride,re=A.offset;if(pe.isInstancedInterleavedBuffer){for(let ve=0;ve0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";O="mediump"}return O==="mediump"&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const a=typeof WebGL2RenderingContext<"u"&&t instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext<"u"&&t instanceof WebGL2ComputeRenderingContext;let s=n.precision!==void 0?n.precision:"highp";const l=o(s);l!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",l,"instead."),s=l);const c=a||e.has("WEBGL_draw_buffers"),u=n.logarithmicDepthBuffer===!0,f=t.getParameter(34930),d=t.getParameter(35660),h=t.getParameter(3379),p=t.getParameter(34076),m=t.getParameter(34921),g=t.getParameter(36347),v=t.getParameter(36348),y=t.getParameter(36349),x=d>0,b=a||e.has("OES_texture_float"),_=x&&b,S=a?t.getParameter(36183):0;return{isWebGL2:a,drawBuffers:c,getMaxAnisotropy:i,getMaxPrecision:o,precision:s,logarithmicDepthBuffer:u,maxTextures:f,maxVertexTextures:d,maxTextureSize:h,maxCubemapSize:p,maxAttributes:m,maxVertexUniforms:g,maxVaryings:v,maxFragmentUniforms:y,vertexTextures:x,floatFragmentTextures:b,floatVertexTextures:_,maxSamples:S}}function KUt(t){const e=this;let n=null,r=0,i=!1,o=!1;const a=new Kd,s=new va,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(f,d,h){const p=f.length!==0||d||r!==0||i;return i=d,n=u(f,h,0),r=f.length,p},this.beginShadows=function(){o=!0,u(null)},this.endShadows=function(){o=!1,c()},this.setState=function(f,d,h){const p=f.clippingPlanes,m=f.clipIntersection,g=f.clipShadows,v=t.get(f);if(!i||p===null||p.length===0||o&&!g)o?u(null):c();else{const y=o?0:r,x=y*4;let b=v.clippingState||null;l.value=b,b=u(p,d,x,h);for(let _=0;_!==x;++_)b[_]=n[_];v.clippingState=b,this.numIntersection=m?this.numPlanes:0,this.numPlanes+=y}};function c(){l.value!==n&&(l.value=n,l.needsUpdate=r>0),e.numPlanes=r,e.numIntersection=0}function u(f,d,h,p){const m=f!==null?f.length:0;let g=null;if(m!==0){if(g=l.value,p!==!0||g===null){const v=h+m*4,y=d.matrixWorldInverse;s.getNormalMatrix(y),(g===null||g.length0){const c=new hzt(l.height/2);return c.fromEquirectangularTexture(t,a),e.set(a,c),a.addEventListener("dispose",i),n(c.texture,a.mapping)}else return null}}return a}function i(a){const s=a.target;s.removeEventListener("dispose",i);const l=e.get(s);l!==void 0&&(e.delete(s),l.dispose())}function o(){e=new WeakMap}return{get:r,dispose:o}}class zye extends Nye{constructor(e=-1,n=1,r=1,i=-1,o=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=n,this.top=r,this.bottom=i,this.near=o,this.far=a,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,n,r,i,o,a){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let o=r-e,a=r+e,s=i+n,l=i-n;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o+=c*this.view.offsetX,a=o+c*this.view.width,s-=u*this.view.offsetY,l=s-u*this.view.height}this.projectionMatrix.makeOrthographic(o,a,s,l,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.zoom=this.zoom,n.object.left=this.left,n.object.right=this.right,n.object.top=this.top,n.object.bottom=this.bottom,n.object.near=this.near,n.object.far=this.far,this.view!==null&&(n.object.view=Object.assign({},this.view)),n}}const ig=4,WZ=[.125,.215,.35,.446,.526,.582],ah=20,cD=new zye,VZ=new sr;let uD=null;const Zd=(1+Math.sqrt(5))/2,Cm=1/Zd,GZ=[new Se(1,1,1),new Se(-1,1,1),new Se(1,1,-1),new Se(-1,1,-1),new Se(0,Zd,Cm),new Se(0,Zd,-Cm),new Se(Cm,0,Zd),new Se(-Cm,0,Zd),new Se(Zd,Cm,0),new Se(-Zd,Cm,0)];class HZ{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,n=0,r=.1,i=100){uD=this._renderer.getRenderTarget(),this._setSize(256);const o=this._allocateTargets();return o.depthBuffer=!0,this._sceneToCubeUV(e,r,i,o),n>0&&this._blur(o,0,0,n),this._applyPMREM(o),this._cleanup(o),o}fromEquirectangular(e,n=null){return this._fromTexture(e,n)}fromCubemap(e,n=null){return this._fromTexture(e,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=QZ(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=XZ(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?x:0,x,x),u.setRenderTarget(i),m&&u.render(p,s),u.render(e,s)}p.geometry.dispose(),p.material.dispose(),u.toneMapping=d,u.autoClear=f,e.background=g}_textureToCubeUV(e,n){const r=this._renderer,i=e.mapping===Rv||e.mapping===Iv;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=QZ()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=XZ());const o=i?this._cubemapMaterial:this._equirectMaterial,a=new Nl(this._lodPlanes[0],o),s=o.uniforms;s.envMap.value=e;const l=this._cubeSize;qO(n,0,0,3*l,2*l),r.setRenderTarget(n),r.render(a,cD)}_applyPMREM(e){const n=this._renderer,r=n.autoClear;n.autoClear=!1;for(let i=1;iah&&console.warn(`sigmaRadians, ${o}, is too large and will clip, as it requested ${g} samples when the maximum is set to ${ah}`);const v=[];let y=0;for(let O=0;Ox-ig?i-x+ig:0),S=4*(this._cubeSize-b);qO(n,_,S,3*b,2*b),l.setRenderTarget(n),l.render(f,cD)}}function JUt(t){const e=[],n=[],r=[];let i=t;const o=t-ig+1+WZ.length;for(let a=0;at-ig?l=WZ[a-t+ig-1]:a===0&&(l=0),r.push(l);const c=1/(s-2),u=-c,f=1+c,d=[u,u,f,u,f,f,u,u,f,f,u,f],h=6,p=6,m=3,g=2,v=1,y=new Float32Array(m*p*h),x=new Float32Array(g*p*h),b=new Float32Array(v*p*h);for(let S=0;S2?0:-1,E=[O,C,0,O+2/3,C,0,O+2/3,C+1,0,O,C,0,O+2/3,C+1,0,O,C+1,0];y.set(E,m*p*S),x.set(d,g*p*S);const k=[S,S,S,S,S,S];b.set(k,v*p*S)}const _=new Ou;_.setAttribute("position",new os(y,m)),_.setAttribute("uv",new os(x,g)),_.setAttribute("faceIndex",new os(b,v)),e.push(_),i>ig&&i--}return{lodPlanes:e,sizeLods:n,sigmas:r}}function qZ(t,e,n){const r=new dp(t,e,n);return r.texture.mapping=Ck,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function qO(t,e,n,r,i){t.viewport.set(e,n,r,i),t.scissor.set(e,n,r,i)}function e6t(t,e,n){const r=new Float32Array(ah),i=new Se(0,1,0);return new od({name:"SphericalGaussianBlur",defines:{n:ah,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:f6(),fragmentShader:` +}`,Vt={alphamap_fragment:xzt,alphamap_pars_fragment:bzt,alphatest_fragment:_zt,alphatest_pars_fragment:wzt,aomap_fragment:Szt,aomap_pars_fragment:Ozt,begin_vertex:Czt,beginnormal_vertex:Tzt,bsdfs:Ezt,iridescence_fragment:Pzt,bumpmap_pars_fragment:Mzt,clipping_planes_fragment:kzt,clipping_planes_pars_fragment:Azt,clipping_planes_pars_vertex:Rzt,clipping_planes_vertex:Izt,color_fragment:Dzt,color_pars_fragment:Lzt,color_pars_vertex:$zt,color_vertex:Nzt,common:Fzt,cube_uv_reflection_fragment:jzt,defaultnormal_vertex:Bzt,displacementmap_pars_vertex:zzt,displacementmap_vertex:Uzt,emissivemap_fragment:Wzt,emissivemap_pars_fragment:Vzt,encodings_fragment:Gzt,encodings_pars_fragment:Hzt,envmap_fragment:qzt,envmap_common_pars_fragment:Xzt,envmap_pars_fragment:Qzt,envmap_pars_vertex:Yzt,envmap_physical_pars_fragment:l4t,envmap_vertex:Kzt,fog_vertex:Zzt,fog_pars_vertex:Jzt,fog_fragment:e4t,fog_pars_fragment:t4t,gradientmap_pars_fragment:n4t,lightmap_fragment:r4t,lightmap_pars_fragment:i4t,lights_lambert_fragment:o4t,lights_lambert_pars_fragment:a4t,lights_pars_begin:s4t,lights_toon_fragment:c4t,lights_toon_pars_fragment:u4t,lights_phong_fragment:f4t,lights_phong_pars_fragment:d4t,lights_physical_fragment:h4t,lights_physical_pars_fragment:p4t,lights_fragment_begin:m4t,lights_fragment_maps:g4t,lights_fragment_end:v4t,logdepthbuf_fragment:y4t,logdepthbuf_pars_fragment:x4t,logdepthbuf_pars_vertex:b4t,logdepthbuf_vertex:_4t,map_fragment:w4t,map_pars_fragment:S4t,map_particle_fragment:O4t,map_particle_pars_fragment:C4t,metalnessmap_fragment:T4t,metalnessmap_pars_fragment:E4t,morphcolor_vertex:P4t,morphnormal_vertex:M4t,morphtarget_pars_vertex:k4t,morphtarget_vertex:A4t,normal_fragment_begin:R4t,normal_fragment_maps:I4t,normal_pars_fragment:D4t,normal_pars_vertex:L4t,normal_vertex:$4t,normalmap_pars_fragment:N4t,clearcoat_normal_fragment_begin:F4t,clearcoat_normal_fragment_maps:j4t,clearcoat_pars_fragment:B4t,iridescence_pars_fragment:z4t,output_fragment:U4t,packing:W4t,premultiplied_alpha_fragment:V4t,project_vertex:G4t,dithering_fragment:H4t,dithering_pars_fragment:q4t,roughnessmap_fragment:X4t,roughnessmap_pars_fragment:Q4t,shadowmap_pars_fragment:Y4t,shadowmap_pars_vertex:K4t,shadowmap_vertex:Z4t,shadowmask_pars_fragment:J4t,skinbase_vertex:eUt,skinning_pars_vertex:tUt,skinning_vertex:nUt,skinnormal_vertex:rUt,specularmap_fragment:iUt,specularmap_pars_fragment:oUt,tonemapping_fragment:aUt,tonemapping_pars_fragment:sUt,transmission_fragment:lUt,transmission_pars_fragment:cUt,uv_pars_fragment:uUt,uv_pars_vertex:fUt,uv_vertex:dUt,uv2_pars_fragment:hUt,uv2_pars_vertex:pUt,uv2_vertex:mUt,worldpos_vertex:gUt,background_vert:vUt,background_frag:yUt,cube_vert:xUt,cube_frag:bUt,depth_vert:_Ut,depth_frag:wUt,distanceRGBA_vert:SUt,distanceRGBA_frag:OUt,equirect_vert:CUt,equirect_frag:TUt,linedashed_vert:EUt,linedashed_frag:PUt,meshbasic_vert:MUt,meshbasic_frag:kUt,meshlambert_vert:AUt,meshlambert_frag:RUt,meshmatcap_vert:IUt,meshmatcap_frag:DUt,meshnormal_vert:LUt,meshnormal_frag:$Ut,meshphong_vert:NUt,meshphong_frag:FUt,meshphysical_vert:jUt,meshphysical_frag:BUt,meshtoon_vert:zUt,meshtoon_frag:UUt,points_vert:WUt,points_frag:VUt,shadow_vert:GUt,shadow_frag:HUt,sprite_vert:qUt,sprite_frag:XUt},Je={common:{diffuse:{value:new sr(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new va},uv2Transform:{value:new va},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Ht(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new sr(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new sr(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new va}},sprite:{diffuse:{value:new sr(16777215)},opacity:{value:1},center:{value:new Ht(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new va}}},xl={basic:{uniforms:zi([Je.common,Je.specularmap,Je.envmap,Je.aomap,Je.lightmap,Je.fog]),vertexShader:Vt.meshbasic_vert,fragmentShader:Vt.meshbasic_frag},lambert:{uniforms:zi([Je.common,Je.specularmap,Je.envmap,Je.aomap,Je.lightmap,Je.emissivemap,Je.bumpmap,Je.normalmap,Je.displacementmap,Je.fog,Je.lights,{emissive:{value:new sr(0)}}]),vertexShader:Vt.meshlambert_vert,fragmentShader:Vt.meshlambert_frag},phong:{uniforms:zi([Je.common,Je.specularmap,Je.envmap,Je.aomap,Je.lightmap,Je.emissivemap,Je.bumpmap,Je.normalmap,Je.displacementmap,Je.fog,Je.lights,{emissive:{value:new sr(0)},specular:{value:new sr(1118481)},shininess:{value:30}}]),vertexShader:Vt.meshphong_vert,fragmentShader:Vt.meshphong_frag},standard:{uniforms:zi([Je.common,Je.envmap,Je.aomap,Je.lightmap,Je.emissivemap,Je.bumpmap,Je.normalmap,Je.displacementmap,Je.roughnessmap,Je.metalnessmap,Je.fog,Je.lights,{emissive:{value:new sr(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Vt.meshphysical_vert,fragmentShader:Vt.meshphysical_frag},toon:{uniforms:zi([Je.common,Je.aomap,Je.lightmap,Je.emissivemap,Je.bumpmap,Je.normalmap,Je.displacementmap,Je.gradientmap,Je.fog,Je.lights,{emissive:{value:new sr(0)}}]),vertexShader:Vt.meshtoon_vert,fragmentShader:Vt.meshtoon_frag},matcap:{uniforms:zi([Je.common,Je.bumpmap,Je.normalmap,Je.displacementmap,Je.fog,{matcap:{value:null}}]),vertexShader:Vt.meshmatcap_vert,fragmentShader:Vt.meshmatcap_frag},points:{uniforms:zi([Je.points,Je.fog]),vertexShader:Vt.points_vert,fragmentShader:Vt.points_frag},dashed:{uniforms:zi([Je.common,Je.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Vt.linedashed_vert,fragmentShader:Vt.linedashed_frag},depth:{uniforms:zi([Je.common,Je.displacementmap]),vertexShader:Vt.depth_vert,fragmentShader:Vt.depth_frag},normal:{uniforms:zi([Je.common,Je.bumpmap,Je.normalmap,Je.displacementmap,{opacity:{value:1}}]),vertexShader:Vt.meshnormal_vert,fragmentShader:Vt.meshnormal_frag},sprite:{uniforms:zi([Je.sprite,Je.fog]),vertexShader:Vt.sprite_vert,fragmentShader:Vt.sprite_frag},background:{uniforms:{uvTransform:{value:new va},t2D:{value:null}},vertexShader:Vt.background_vert,fragmentShader:Vt.background_frag},cube:{uniforms:zi([Je.envmap,{opacity:{value:1}}]),vertexShader:Vt.cube_vert,fragmentShader:Vt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Vt.equirect_vert,fragmentShader:Vt.equirect_frag},distanceRGBA:{uniforms:zi([Je.common,Je.displacementmap,{referencePosition:{value:new Se},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Vt.distanceRGBA_vert,fragmentShader:Vt.distanceRGBA_frag},shadow:{uniforms:zi([Je.lights,Je.fog,{color:{value:new sr(0)},opacity:{value:1}}]),vertexShader:Vt.shadow_vert,fragmentShader:Vt.shadow_frag}};xl.physical={uniforms:zi([xl.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new Ht(1,1)},clearcoatNormalMap:{value:null},iridescence:{value:0},iridescenceMap:{value:null},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},sheen:{value:0},sheenColor:{value:new sr(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new Ht},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new sr(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new sr(1,1,1)},specularColorMap:{value:null}}]),vertexShader:Vt.meshphysical_vert,fragmentShader:Vt.meshphysical_frag};function QUt(t,e,n,r,i,o){const a=new sr(0);let s=i===!0?0:1,l,c,u=null,f=0,d=null;function h(m,g){let v=!1,y=g.isScene===!0?g.background:null;y&&y.isTexture&&(y=e.get(y));const x=t.xr,b=x.getSession&&x.getSession();b&&b.environmentBlendMode==="additive"&&(y=null),y===null?p(a,s):y&&y.isColor&&(p(y,1),v=!0),(t.autoClear||v)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),y&&(y.isCubeTexture||y.mapping===Ck)?(c===void 0&&(c=new Nl(new Hy(1,1,1),new od({name:"BackgroundCubeMaterial",uniforms:Lv(xl.cube.uniforms),vertexShader:xl.cube.vertexShader,fragmentShader:xl.cube.fragmentShader,side:_a,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(_,S,O){this.matrixWorld.copyPosition(O.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(c)),c.material.uniforms.envMap.value=y,c.material.uniforms.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,(u!==y||f!==y.version||d!==t.toneMapping)&&(c.material.needsUpdate=!0,u=y,f=y.version,d=t.toneMapping),c.layers.enableAll(),m.unshift(c,c.geometry,c.material,0,0,null)):y&&y.isTexture&&(l===void 0&&(l=new Nl(new Pk(2,2),new od({name:"BackgroundMaterial",uniforms:Lv(xl.background.uniforms),vertexShader:xl.background.vertexShader,fragmentShader:xl.background.fragmentShader,side:Av,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(l)),l.material.uniforms.t2D.value=y,y.matrixAutoUpdate===!0&&y.updateMatrix(),l.material.uniforms.uvTransform.value.copy(y.matrix),(u!==y||f!==y.version||d!==t.toneMapping)&&(l.material.needsUpdate=!0,u=y,f=y.version,d=t.toneMapping),l.layers.enableAll(),m.unshift(l,l.geometry,l.material,0,0,null))}function p(m,g){n.buffers.color.setClear(m.r,m.g,m.b,g,o)}return{getClearColor:function(){return a},setClearColor:function(m,g=1){a.set(m),s=g,p(a,s)},getClearAlpha:function(){return s},setClearAlpha:function(m){s=m,p(a,s)},render:h}}function YUt(t,e,n,r){const i=t.getParameter(34921),o=r.isWebGL2?null:e.get("OES_vertex_array_object"),a=r.isWebGL2||o!==null,s={},l=g(null);let c=l,u=!1;function f(T,L,z,B,W){let U=!1;if(a){const N=m(B,z,L);c!==N&&(c=N,h(c.object)),U=v(T,B,z,W),U&&y(T,B,z,W)}else{const N=L.wireframe===!0;(c.geometry!==B.id||c.program!==z.id||c.wireframe!==N)&&(c.geometry=B.id,c.program=z.id,c.wireframe=N,U=!0)}W!==null&&n.update(W,34963),(U||u)&&(u=!1,C(T,L,z,B),W!==null&&t.bindBuffer(34963,n.get(W).buffer))}function d(){return r.isWebGL2?t.createVertexArray():o.createVertexArrayOES()}function h(T){return r.isWebGL2?t.bindVertexArray(T):o.bindVertexArrayOES(T)}function p(T){return r.isWebGL2?t.deleteVertexArray(T):o.deleteVertexArrayOES(T)}function m(T,L,z){const B=z.wireframe===!0;let W=s[T.id];W===void 0&&(W={},s[T.id]=W);let U=W[L.id];U===void 0&&(U={},W[L.id]=U);let N=U[B];return N===void 0&&(N=g(d()),U[B]=N),N}function g(T){const L=[],z=[],B=[];for(let W=0;W=0){const q=W[D];let Y=U[D];if(Y===void 0&&(D==="instanceMatrix"&&T.instanceMatrix&&(Y=T.instanceMatrix),D==="instanceColor"&&T.instanceColor&&(Y=T.instanceColor)),q===void 0||q.attribute!==Y||Y&&q.data!==Y.data)return!0;N++}return c.attributesNum!==N||c.index!==B}function y(T,L,z,B){const W={},U=L.attributes;let N=0;const $=z.getAttributes();for(const D in $)if($[D].location>=0){let q=U[D];q===void 0&&(D==="instanceMatrix"&&T.instanceMatrix&&(q=T.instanceMatrix),D==="instanceColor"&&T.instanceColor&&(q=T.instanceColor));const Y={};Y.attribute=q,q&&q.data&&(Y.data=q.data),W[D]=Y,N++}c.attributes=W,c.attributesNum=N,c.index=B}function x(){const T=c.newAttributes;for(let L=0,z=T.length;L=0){let A=W[$];if(A===void 0&&($==="instanceMatrix"&&T.instanceMatrix&&(A=T.instanceMatrix),$==="instanceColor"&&T.instanceColor&&(A=T.instanceColor)),A!==void 0){const q=A.normalized,Y=A.itemSize,K=n.get(A);if(K===void 0)continue;const se=K.buffer,te=K.type,J=K.bytesPerElement;if(A.isInterleavedBufferAttribute){const pe=A.data,be=pe.stride,re=A.offset;if(pe.isInstancedInterleavedBuffer){for(let ve=0;ve0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";O="mediump"}return O==="mediump"&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const a=typeof WebGL2RenderingContext<"u"&&t instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext<"u"&&t instanceof WebGL2ComputeRenderingContext;let s=n.precision!==void 0?n.precision:"highp";const l=o(s);l!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",l,"instead."),s=l);const c=a||e.has("WEBGL_draw_buffers"),u=n.logarithmicDepthBuffer===!0,f=t.getParameter(34930),d=t.getParameter(35660),h=t.getParameter(3379),p=t.getParameter(34076),m=t.getParameter(34921),g=t.getParameter(36347),v=t.getParameter(36348),y=t.getParameter(36349),x=d>0,b=a||e.has("OES_texture_float"),_=x&&b,S=a?t.getParameter(36183):0;return{isWebGL2:a,drawBuffers:c,getMaxAnisotropy:i,getMaxPrecision:o,precision:s,logarithmicDepthBuffer:u,maxTextures:f,maxVertexTextures:d,maxTextureSize:h,maxCubemapSize:p,maxAttributes:m,maxVertexUniforms:g,maxVaryings:v,maxFragmentUniforms:y,vertexTextures:x,floatFragmentTextures:b,floatVertexTextures:_,maxSamples:S}}function JUt(t){const e=this;let n=null,r=0,i=!1,o=!1;const a=new Kd,s=new va,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(f,d,h){const p=f.length!==0||d||r!==0||i;return i=d,n=u(f,h,0),r=f.length,p},this.beginShadows=function(){o=!0,u(null)},this.endShadows=function(){o=!1,c()},this.setState=function(f,d,h){const p=f.clippingPlanes,m=f.clipIntersection,g=f.clipShadows,v=t.get(f);if(!i||p===null||p.length===0||o&&!g)o?u(null):c();else{const y=o?0:r,x=y*4;let b=v.clippingState||null;l.value=b,b=u(p,d,x,h);for(let _=0;_!==x;++_)b[_]=n[_];v.clippingState=b,this.numIntersection=m?this.numPlanes:0,this.numPlanes+=y}};function c(){l.value!==n&&(l.value=n,l.needsUpdate=r>0),e.numPlanes=r,e.numIntersection=0}function u(f,d,h,p){const m=f!==null?f.length:0;let g=null;if(m!==0){if(g=l.value,p!==!0||g===null){const v=h+m*4,y=d.matrixWorldInverse;s.getNormalMatrix(y),(g===null||g.length0){const c=new mzt(l.height/2);return c.fromEquirectangularTexture(t,a),e.set(a,c),a.addEventListener("dispose",i),n(c.texture,a.mapping)}else return null}}return a}function i(a){const s=a.target;s.removeEventListener("dispose",i);const l=e.get(s);l!==void 0&&(e.delete(s),l.dispose())}function o(){e=new WeakMap}return{get:r,dispose:o}}class Uye extends Fye{constructor(e=-1,n=1,r=1,i=-1,o=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=n,this.top=r,this.bottom=i,this.near=o,this.far=a,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,n,r,i,o,a){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let o=r-e,a=r+e,s=i+n,l=i-n;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o+=c*this.view.offsetX,a=o+c*this.view.width,s-=u*this.view.offsetY,l=s-u*this.view.height}this.projectionMatrix.makeOrthographic(o,a,s,l,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.zoom=this.zoom,n.object.left=this.left,n.object.right=this.right,n.object.top=this.top,n.object.bottom=this.bottom,n.object.near=this.near,n.object.far=this.far,this.view!==null&&(n.object.view=Object.assign({},this.view)),n}}const ig=4,GZ=[.125,.215,.35,.446,.526,.582],ah=20,uD=new Uye,HZ=new sr;let fD=null;const Zd=(1+Math.sqrt(5))/2,Cm=1/Zd,qZ=[new Se(1,1,1),new Se(-1,1,1),new Se(1,1,-1),new Se(-1,1,-1),new Se(0,Zd,Cm),new Se(0,Zd,-Cm),new Se(Cm,0,Zd),new Se(-Cm,0,Zd),new Se(Zd,Cm,0),new Se(-Zd,Cm,0)];class XZ{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,n=0,r=.1,i=100){fD=this._renderer.getRenderTarget(),this._setSize(256);const o=this._allocateTargets();return o.depthBuffer=!0,this._sceneToCubeUV(e,r,i,o),n>0&&this._blur(o,0,0,n),this._applyPMREM(o),this._cleanup(o),o}fromEquirectangular(e,n=null){return this._fromTexture(e,n)}fromCubemap(e,n=null){return this._fromTexture(e,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=KZ(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=YZ(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?x:0,x,x),u.setRenderTarget(i),m&&u.render(p,s),u.render(e,s)}p.geometry.dispose(),p.material.dispose(),u.toneMapping=d,u.autoClear=f,e.background=g}_textureToCubeUV(e,n){const r=this._renderer,i=e.mapping===Rv||e.mapping===Iv;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=KZ()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=YZ());const o=i?this._cubemapMaterial:this._equirectMaterial,a=new Nl(this._lodPlanes[0],o),s=o.uniforms;s.envMap.value=e;const l=this._cubeSize;qO(n,0,0,3*l,2*l),r.setRenderTarget(n),r.render(a,uD)}_applyPMREM(e){const n=this._renderer,r=n.autoClear;n.autoClear=!1;for(let i=1;iah&&console.warn(`sigmaRadians, ${o}, is too large and will clip, as it requested ${g} samples when the maximum is set to ${ah}`);const v=[];let y=0;for(let O=0;Ox-ig?i-x+ig:0),S=4*(this._cubeSize-b);qO(n,_,S,3*b,2*b),l.setRenderTarget(n),l.render(f,uD)}}function t6t(t){const e=[],n=[],r=[];let i=t;const o=t-ig+1+GZ.length;for(let a=0;at-ig?l=GZ[a-t+ig-1]:a===0&&(l=0),r.push(l);const c=1/(s-2),u=-c,f=1+c,d=[u,u,f,u,f,f,u,u,f,f,u,f],h=6,p=6,m=3,g=2,v=1,y=new Float32Array(m*p*h),x=new Float32Array(g*p*h),b=new Float32Array(v*p*h);for(let S=0;S2?0:-1,E=[O,C,0,O+2/3,C,0,O+2/3,C+1,0,O,C,0,O+2/3,C+1,0,O,C+1,0];y.set(E,m*p*S),x.set(d,g*p*S);const k=[S,S,S,S,S,S];b.set(k,v*p*S)}const _=new Ou;_.setAttribute("position",new os(y,m)),_.setAttribute("uv",new os(x,g)),_.setAttribute("faceIndex",new os(b,v)),e.push(_),i>ig&&i--}return{lodPlanes:e,sizeLods:n,sigmas:r}}function QZ(t,e,n){const r=new dp(t,e,n);return r.texture.mapping=Ck,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function qO(t,e,n,r,i){t.viewport.set(e,n,r,i),t.scissor.set(e,n,r,i)}function n6t(t,e,n){const r=new Float32Array(ah),i=new Se(0,1,0);return new od({name:"SphericalGaussianBlur",defines:{n:ah,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:d6(),fragmentShader:` precision mediump float; precision mediump int; @@ -3289,7 +3289,7 @@ void main() { } } - `,blending:Uf,depthTest:!1,depthWrite:!1})}function XZ(){return new od({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:f6(),fragmentShader:` + `,blending:Uf,depthTest:!1,depthWrite:!1})}function YZ(){return new od({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:d6(),fragmentShader:` precision mediump float; precision mediump int; @@ -3308,7 +3308,7 @@ void main() { gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); } - `,blending:Uf,depthTest:!1,depthWrite:!1})}function QZ(){return new od({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:f6(),fragmentShader:` + `,blending:Uf,depthTest:!1,depthWrite:!1})}function KZ(){return new od({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:d6(),fragmentShader:` precision mediump float; precision mediump int; @@ -3324,7 +3324,7 @@ void main() { gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); } - `,blending:Uf,depthTest:!1,depthWrite:!1})}function f6(){return` + `,blending:Uf,depthTest:!1,depthWrite:!1})}function d6(){return` precision mediump float; precision mediump int; @@ -3379,39 +3379,39 @@ void main() { gl_Position = vec4( position, 1.0 ); } - `}function t6t(t){let e=new WeakMap,n=null;function r(s){if(s&&s.isTexture){const l=s.mapping,c=l===pF||l===mF,u=l===Rv||l===Iv;if(c||u)if(s.isRenderTargetTexture&&s.needsPMREMUpdate===!0){s.needsPMREMUpdate=!1;let f=e.get(s);return n===null&&(n=new HZ(t)),f=c?n.fromEquirectangular(s,f):n.fromCubemap(s,f),e.set(s,f),f.texture}else{if(e.has(s))return e.get(s).texture;{const f=s.image;if(c&&f&&f.height>0||u&&f&&i(f)){n===null&&(n=new HZ(t));const d=c?n.fromEquirectangular(s):n.fromCubemap(s);return e.set(s,d),s.addEventListener("dispose",o),d.texture}else return null}}}return s}function i(s){let l=0;const c=6;for(let u=0;ue.maxTextureSize&&(I=Math.ceil(k/e.maxTextureSize),k=e.maxTextureSize);const P=new Float32Array(k*I*4*m),R=new kye(P,k,I,m);R.type=Of,R.needsUpdate=!0;const T=E*4;for(let z=0;z0)return t;const i=e*n;let o=YZ[i];if(o===void 0&&(o=new Float32Array(i),YZ[i]=o),e!==0){r.toArray(o,0);for(let a=1,s=0;a!==e;++a)s+=n,t[a].toArray(o,s)}return o}function po(t,e){if(t.length!==e.length)return!1;for(let n=0,r=t.length;n0||u&&f&&i(f)){n===null&&(n=new XZ(t));const d=c?n.fromEquirectangular(s):n.fromCubemap(s);return e.set(s,d),s.addEventListener("dispose",o),d.texture}else return null}}}return s}function i(s){let l=0;const c=6;for(let u=0;ue.maxTextureSize&&(I=Math.ceil(k/e.maxTextureSize),k=e.maxTextureSize);const P=new Float32Array(k*I*4*m),R=new Aye(P,k,I,m);R.type=Of,R.needsUpdate=!0;const T=E*4;for(let z=0;z0)return t;const i=e*n;let o=ZZ[i];if(o===void 0&&(o=new Float32Array(i),ZZ[i]=o),e!==0){r.toArray(o,0);for(let a=1,s=0;a!==e;++a)s+=n,t[a].toArray(o,s)}return o}function po(t,e){if(t.length!==e.length)return!1;for(let n=0,r=t.length;n":" "} ${s}: ${n[a]}`)}return r.join(` -`)}function nWt(t){switch(t){case fp:return["Linear","( value )"];case vr:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",t),["Linear","( value )"]}}function rJ(t,e,n){const r=t.getShaderParameter(e,35713),i=t.getShaderInfoLog(e).trim();if(r&&i==="")return"";const o=/ERROR: 0:(\d+)/.exec(i);if(o){const a=parseInt(o[1]);return n.toUpperCase()+` +`)}function iWt(t){switch(t){case fp:return["Linear","( value )"];case vr:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",t),["Linear","( value )"]}}function oJ(t,e,n){const r=t.getShaderParameter(e,35713),i=t.getShaderInfoLog(e).trim();if(r&&i==="")return"";const o=/ERROR: 0:(\d+)/.exec(i);if(o){const a=parseInt(o[1]);return n.toUpperCase()+` `+i+` -`+tWt(t.getShaderSource(e),a)}else return i}function rWt(t,e){const n=nWt(e);return"vec4 "+t+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}function iWt(t,e){let n;switch(e){case TBt:n="Linear";break;case EBt:n="Reinhard";break;case PBt:n="OptimizedCineon";break;case MBt:n="ACESFilmic";break;case kBt:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function oWt(t){return[t.extensionDerivatives||t.envMapCubeUVHeight||t.bumpMap||t.tangentSpaceNormalMap||t.clearcoatNormalMap||t.flatShading||t.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap||t.transmission)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(xx).join(` -`)}function aWt(t){const e=[];for(const n in t){const r=t[n];r!==!1&&e.push("#define "+n+" "+r)}return e.join(` -`)}function sWt(t,e){const n={},r=t.getProgramParameter(e,35721);for(let i=0;i/gm;function bF(t){return t.replace(lWt,cWt)}function cWt(t,e){const n=Vt[e];if(n===void 0)throw new Error("Can not resolve #include <"+e+">");return bF(n)}const uWt=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function aJ(t){return t.replace(uWt,fWt)}function fWt(t,e,n,r){let i="";for(let o=parseInt(e);o/gm;function _F(t){return t.replace(uWt,fWt)}function fWt(t,e){const n=Vt[e];if(n===void 0)throw new Error("Can not resolve #include <"+e+">");return _F(n)}const dWt=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function lJ(t){return t.replace(dWt,hWt)}function hWt(t,e,n,r){let i="";for(let o=parseInt(e);o0&&(g+=` `),v=[h,p].filter(xx).join(` `),v.length>0&&(v+=` -`)):(g=[sJ(n),"#define SHADER_NAME "+n.shaderName,p,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",n.specularColorMap?"#define USE_SPECULARCOLORMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEENCOLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&n.flatShading===!1?"#define USE_MORPHNORMALS":"",n.morphColors&&n.isWebGL2?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` +`)):(g=[cJ(n),"#define SHADER_NAME "+n.shaderName,p,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",n.specularColorMap?"#define USE_SPECULARCOLORMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEENCOLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&n.flatShading===!1?"#define USE_MORPHNORMALS":"",n.morphColors&&n.isWebGL2?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` `].filter(xx).join(` -`),v=[h,sJ(n),"#define SHADER_NAME "+n.shaderName,p,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+u:"",n.envMap?"#define "+f:"",d?"#define CUBEUV_TEXEL_WIDTH "+d.texelWidth:"",d?"#define CUBEUV_TEXEL_HEIGHT "+d.texelHeight:"",d?"#define CUBEUV_MAX_MIP "+d.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",n.specularColorMap?"#define USE_SPECULARCOLORMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEENCOLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==ru?"#define TONE_MAPPING":"",n.toneMapping!==ru?Vt.tonemapping_pars_fragment:"",n.toneMapping!==ru?iWt("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Vt.encodings_pars_fragment,rWt("linearToOutputTexel",n.outputEncoding),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",` +`),v=[h,cJ(n),"#define SHADER_NAME "+n.shaderName,p,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+u:"",n.envMap?"#define "+f:"",d?"#define CUBEUV_TEXEL_WIDTH "+d.texelWidth:"",d?"#define CUBEUV_TEXEL_HEIGHT "+d.texelHeight:"",d?"#define CUBEUV_MAX_MIP "+d.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",n.specularColorMap?"#define USE_SPECULARCOLORMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEENCOLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==ru?"#define TONE_MAPPING":"",n.toneMapping!==ru?Vt.tonemapping_pars_fragment:"",n.toneMapping!==ru?aWt("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Vt.encodings_pars_fragment,oWt("linearToOutputTexel",n.outputEncoding),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",` `].filter(xx).join(` -`)),a=bF(a),a=iJ(a,n),a=oJ(a,n),s=bF(s),s=iJ(s,n),s=oJ(s,n),a=aJ(a),s=aJ(s),n.isWebGL2&&n.isRawShaderMaterial!==!0&&(y=`#version 300 es +`)),a=_F(a),a=aJ(a,n),a=sJ(a,n),s=_F(s),s=aJ(s,n),s=sJ(s,n),a=lJ(a),s=lJ(s),n.isWebGL2&&n.isRawShaderMaterial!==!0&&(y=`#version 300 es `,g=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` `)+` -`+g,v=["#define varying in",n.glslVersion===MZ?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===MZ?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` +`+g,v=["#define varying in",n.glslVersion===AZ?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===AZ?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` `)+` -`+v);const x=y+g+a,b=y+v+s,_=nJ(i,35633,x),S=nJ(i,35632,b);if(i.attachShader(m,_),i.attachShader(m,S),n.index0AttributeName!==void 0?i.bindAttribLocation(m,0,n.index0AttributeName):n.morphTargets===!0&&i.bindAttribLocation(m,0,"position"),i.linkProgram(m),t.debug.checkShaderErrors){const E=i.getProgramInfoLog(m).trim(),k=i.getShaderInfoLog(_).trim(),I=i.getShaderInfoLog(S).trim();let P=!0,R=!0;if(i.getProgramParameter(m,35714)===!1){P=!1;const T=rJ(i,_,"vertex"),L=rJ(i,S,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(m,35715)+` +`+v);const x=y+g+a,b=y+v+s,_=iJ(i,35633,x),S=iJ(i,35632,b);if(i.attachShader(m,_),i.attachShader(m,S),n.index0AttributeName!==void 0?i.bindAttribLocation(m,0,n.index0AttributeName):n.morphTargets===!0&&i.bindAttribLocation(m,0,"position"),i.linkProgram(m),t.debug.checkShaderErrors){const E=i.getProgramInfoLog(m).trim(),k=i.getShaderInfoLog(_).trim(),I=i.getShaderInfoLog(S).trim();let P=!0,R=!0;if(i.getProgramParameter(m,35714)===!1){P=!1;const T=oJ(i,_,"vertex"),L=oJ(i,S,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(m,35715)+` Program Info Log: `+E+` `+T+` -`+L)}else E!==""?console.warn("THREE.WebGLProgram: Program Info Log:",E):(k===""||I==="")&&(R=!1);R&&(this.diagnostics={runnable:P,programLog:E,vertexShader:{log:k,prefix:g},fragmentShader:{log:I,prefix:v}})}i.deleteShader(_),i.deleteShader(S);let O;this.getUniforms=function(){return O===void 0&&(O=new HC(i,m)),O};let C;return this.getAttributes=function(){return C===void 0&&(C=sWt(i,m)),C},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(m),this.program=void 0},this.name=n.shaderName,this.id=eWt++,this.cacheKey=e,this.usedTimes=1,this.program=m,this.vertexShader=_,this.fragmentShader=S,this}let yWt=0;class xWt{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const n=e.vertexShader,r=e.fragmentShader,i=this._getShaderStage(n),o=this._getShaderStage(r),a=this._getShaderCacheForMaterial(e);return a.has(i)===!1&&(a.add(i),i.usedTimes++),a.has(o)===!1&&(a.add(o),o.usedTimes++),this}remove(e){const n=this.materialCache.get(e);for(const r of n)r.usedTimes--,r.usedTimes===0&&this.shaderCache.delete(r.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const n=this.materialCache;let r=n.get(e);return r===void 0&&(r=new Set,n.set(e,r)),r}_getShaderStage(e){const n=this.shaderCache;let r=n.get(e);return r===void 0&&(r=new bWt(e),n.set(e,r)),r}}class bWt{constructor(e){this.id=yWt++,this.code=e,this.usedTimes=0}}function _Wt(t,e,n,r,i,o,a){const s=new Iye,l=new xWt,c=[],u=i.isWebGL2,f=i.logarithmicDepthBuffer,d=i.vertexTextures;let h=i.precision;const p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function m(C,E,k,I,P){const R=I.fog,T=P.geometry,L=C.isMeshStandardMaterial?I.environment:null,z=(C.isMeshStandardMaterial?n:e).get(C.envMap||L),B=z&&z.mapping===Ck?z.image.height:null,W=p[C.type];C.precision!==null&&(h=i.getMaxPrecision(C.precision),h!==C.precision&&console.warn("THREE.WebGLProgram.getParameters:",C.precision,"not supported, using",h,"instead."));const U=T.morphAttributes.position||T.morphAttributes.normal||T.morphAttributes.color,N=U!==void 0?U.length:0;let $=0;T.morphAttributes.position!==void 0&&($=1),T.morphAttributes.normal!==void 0&&($=2),T.morphAttributes.color!==void 0&&($=3);let D,A,q,Y;if(W){const be=xl[W];D=be.vertexShader,A=be.fragmentShader}else D=C.vertexShader,A=C.fragmentShader,l.update(C),q=l.getVertexShaderID(C),Y=l.getFragmentShaderID(C);const K=t.getRenderTarget(),se=C.alphaTest>0,te=C.clearcoat>0,J=C.iridescence>0;return{isWebGL2:u,shaderID:W,shaderName:C.type,vertexShader:D,fragmentShader:A,defines:C.defines,customVertexShaderID:q,customFragmentShaderID:Y,isRawShaderMaterial:C.isRawShaderMaterial===!0,glslVersion:C.glslVersion,precision:h,instancing:P.isInstancedMesh===!0,instancingColor:P.isInstancedMesh===!0&&P.instanceColor!==null,supportsVertexTextures:d,outputEncoding:K===null?t.outputEncoding:K.isXRRenderTarget===!0?K.texture.encoding:fp,map:!!C.map,matcap:!!C.matcap,envMap:!!z,envMapMode:z&&z.mapping,envMapCubeUVHeight:B,lightMap:!!C.lightMap,aoMap:!!C.aoMap,emissiveMap:!!C.emissiveMap,bumpMap:!!C.bumpMap,normalMap:!!C.normalMap,objectSpaceNormalMap:C.normalMapType===QBt,tangentSpaceNormalMap:C.normalMapType===XBt,decodeVideoTexture:!!C.map&&C.map.isVideoTexture===!0&&C.map.encoding===vr,clearcoat:te,clearcoatMap:te&&!!C.clearcoatMap,clearcoatRoughnessMap:te&&!!C.clearcoatRoughnessMap,clearcoatNormalMap:te&&!!C.clearcoatNormalMap,iridescence:J,iridescenceMap:J&&!!C.iridescenceMap,iridescenceThicknessMap:J&&!!C.iridescenceThicknessMap,displacementMap:!!C.displacementMap,roughnessMap:!!C.roughnessMap,metalnessMap:!!C.metalnessMap,specularMap:!!C.specularMap,specularIntensityMap:!!C.specularIntensityMap,specularColorMap:!!C.specularColorMap,opaque:C.transparent===!1&&C.blending===Lg,alphaMap:!!C.alphaMap,alphaTest:se,gradientMap:!!C.gradientMap,sheen:C.sheen>0,sheenColorMap:!!C.sheenColorMap,sheenRoughnessMap:!!C.sheenRoughnessMap,transmission:C.transmission>0,transmissionMap:!!C.transmissionMap,thicknessMap:!!C.thicknessMap,combine:C.combine,vertexTangents:!!C.normalMap&&!!T.attributes.tangent,vertexColors:C.vertexColors,vertexAlphas:C.vertexColors===!0&&!!T.attributes.color&&T.attributes.color.itemSize===4,vertexUvs:!!C.map||!!C.bumpMap||!!C.normalMap||!!C.specularMap||!!C.alphaMap||!!C.emissiveMap||!!C.roughnessMap||!!C.metalnessMap||!!C.clearcoatMap||!!C.clearcoatRoughnessMap||!!C.clearcoatNormalMap||!!C.iridescenceMap||!!C.iridescenceThicknessMap||!!C.displacementMap||!!C.transmissionMap||!!C.thicknessMap||!!C.specularIntensityMap||!!C.specularColorMap||!!C.sheenColorMap||!!C.sheenRoughnessMap,uvsVertexOnly:!(C.map||C.bumpMap||C.normalMap||C.specularMap||C.alphaMap||C.emissiveMap||C.roughnessMap||C.metalnessMap||C.clearcoatNormalMap||C.iridescenceMap||C.iridescenceThicknessMap||C.transmission>0||C.transmissionMap||C.thicknessMap||C.specularIntensityMap||C.specularColorMap||C.sheen>0||C.sheenColorMap||C.sheenRoughnessMap)&&!!C.displacementMap,fog:!!R,useFog:C.fog===!0,fogExp2:R&&R.isFogExp2,flatShading:!!C.flatShading,sizeAttenuation:C.sizeAttenuation,logarithmicDepthBuffer:f,skinning:P.isSkinnedMesh===!0,morphTargets:T.morphAttributes.position!==void 0,morphNormals:T.morphAttributes.normal!==void 0,morphColors:T.morphAttributes.color!==void 0,morphTargetsCount:N,morphTextureStride:$,numDirLights:E.directional.length,numPointLights:E.point.length,numSpotLights:E.spot.length,numSpotLightMaps:E.spotLightMap.length,numRectAreaLights:E.rectArea.length,numHemiLights:E.hemi.length,numDirLightShadows:E.directionalShadowMap.length,numPointLightShadows:E.pointShadowMap.length,numSpotLightShadows:E.spotShadowMap.length,numSpotLightShadowsWithMaps:E.numSpotLightShadowsWithMaps,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:C.dithering,shadowMapEnabled:t.shadowMap.enabled&&k.length>0,shadowMapType:t.shadowMap.type,toneMapping:C.toneMapped?t.toneMapping:ru,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:C.premultipliedAlpha,doubleSided:C.side===qc,flipSided:C.side===_a,useDepthPacking:!!C.depthPacking,depthPacking:C.depthPacking||0,index0AttributeName:C.index0AttributeName,extensionDerivatives:C.extensions&&C.extensions.derivatives,extensionFragDepth:C.extensions&&C.extensions.fragDepth,extensionDrawBuffers:C.extensions&&C.extensions.drawBuffers,extensionShaderTextureLOD:C.extensions&&C.extensions.shaderTextureLOD,rendererExtensionFragDepth:u||r.has("EXT_frag_depth"),rendererExtensionDrawBuffers:u||r.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:u||r.has("EXT_shader_texture_lod"),customProgramCacheKey:C.customProgramCacheKey()}}function g(C){const E=[];if(C.shaderID?E.push(C.shaderID):(E.push(C.customVertexShaderID),E.push(C.customFragmentShaderID)),C.defines!==void 0)for(const k in C.defines)E.push(k),E.push(C.defines[k]);return C.isRawShaderMaterial===!1&&(v(E,C),y(E,C),E.push(t.outputEncoding)),E.push(C.customProgramCacheKey),E.join()}function v(C,E){C.push(E.precision),C.push(E.outputEncoding),C.push(E.envMapMode),C.push(E.envMapCubeUVHeight),C.push(E.combine),C.push(E.vertexUvs),C.push(E.fogExp2),C.push(E.sizeAttenuation),C.push(E.morphTargetsCount),C.push(E.morphAttributeCount),C.push(E.numDirLights),C.push(E.numPointLights),C.push(E.numSpotLights),C.push(E.numSpotLightMaps),C.push(E.numHemiLights),C.push(E.numRectAreaLights),C.push(E.numDirLightShadows),C.push(E.numPointLightShadows),C.push(E.numSpotLightShadows),C.push(E.numSpotLightShadowsWithMaps),C.push(E.shadowMapType),C.push(E.toneMapping),C.push(E.numClippingPlanes),C.push(E.numClipIntersection),C.push(E.depthPacking)}function y(C,E){s.disableAll(),E.isWebGL2&&s.enable(0),E.supportsVertexTextures&&s.enable(1),E.instancing&&s.enable(2),E.instancingColor&&s.enable(3),E.map&&s.enable(4),E.matcap&&s.enable(5),E.envMap&&s.enable(6),E.lightMap&&s.enable(7),E.aoMap&&s.enable(8),E.emissiveMap&&s.enable(9),E.bumpMap&&s.enable(10),E.normalMap&&s.enable(11),E.objectSpaceNormalMap&&s.enable(12),E.tangentSpaceNormalMap&&s.enable(13),E.clearcoat&&s.enable(14),E.clearcoatMap&&s.enable(15),E.clearcoatRoughnessMap&&s.enable(16),E.clearcoatNormalMap&&s.enable(17),E.iridescence&&s.enable(18),E.iridescenceMap&&s.enable(19),E.iridescenceThicknessMap&&s.enable(20),E.displacementMap&&s.enable(21),E.specularMap&&s.enable(22),E.roughnessMap&&s.enable(23),E.metalnessMap&&s.enable(24),E.gradientMap&&s.enable(25),E.alphaMap&&s.enable(26),E.alphaTest&&s.enable(27),E.vertexColors&&s.enable(28),E.vertexAlphas&&s.enable(29),E.vertexUvs&&s.enable(30),E.vertexTangents&&s.enable(31),E.uvsVertexOnly&&s.enable(32),C.push(s.mask),s.disableAll(),E.fog&&s.enable(0),E.useFog&&s.enable(1),E.flatShading&&s.enable(2),E.logarithmicDepthBuffer&&s.enable(3),E.skinning&&s.enable(4),E.morphTargets&&s.enable(5),E.morphNormals&&s.enable(6),E.morphColors&&s.enable(7),E.premultipliedAlpha&&s.enable(8),E.shadowMapEnabled&&s.enable(9),E.physicallyCorrectLights&&s.enable(10),E.doubleSided&&s.enable(11),E.flipSided&&s.enable(12),E.useDepthPacking&&s.enable(13),E.dithering&&s.enable(14),E.specularIntensityMap&&s.enable(15),E.specularColorMap&&s.enable(16),E.transmission&&s.enable(17),E.transmissionMap&&s.enable(18),E.thicknessMap&&s.enable(19),E.sheen&&s.enable(20),E.sheenColorMap&&s.enable(21),E.sheenRoughnessMap&&s.enable(22),E.decodeVideoTexture&&s.enable(23),E.opaque&&s.enable(24),C.push(s.mask)}function x(C){const E=p[C.type];let k;if(E){const I=xl[E];k=$ye.clone(I.uniforms)}else k=C.uniforms;return k}function b(C,E){let k;for(let I=0,P=c.length;I0?r.push(v):h.transparent===!0?i.push(v):n.push(v)}function l(f,d,h,p,m,g){const v=a(f,d,h,p,m,g);h.transmission>0?r.unshift(v):h.transparent===!0?i.unshift(v):n.unshift(v)}function c(f,d){n.length>1&&n.sort(f||SWt),r.length>1&&r.sort(d||lJ),i.length>1&&i.sort(d||lJ)}function u(){for(let f=e,d=t.length;f=o.length?(a=new cJ,o.push(a)):a=o[i],a}function n(){t=new WeakMap}return{get:e,dispose:n}}function CWt(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new Se,color:new sr};break;case"SpotLight":n={position:new Se,direction:new Se,color:new sr,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new Se,color:new sr,distance:0,decay:0};break;case"HemisphereLight":n={direction:new Se,skyColor:new sr,groundColor:new sr};break;case"RectAreaLight":n={color:new sr,position:new Se,halfWidth:new Se,halfHeight:new Se};break}return t[e.id]=n,n}}}function TWt(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ht};break;case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ht};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ht,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let EWt=0;function PWt(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function MWt(t,e){const n=new CWt,r=TWt(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0};for(let u=0;u<9;u++)i.probe.push(new Se);const o=new Se,a=new Gn,s=new Gn;function l(u,f){let d=0,h=0,p=0;for(let I=0;I<9;I++)i.probe[I].set(0,0,0);let m=0,g=0,v=0,y=0,x=0,b=0,_=0,S=0,O=0,C=0;u.sort(PWt);const E=f!==!0?Math.PI:1;for(let I=0,P=u.length;I0&&(e.isWebGL2||t.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=Je.LTC_FLOAT_1,i.rectAreaLTC2=Je.LTC_FLOAT_2):t.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=Je.LTC_HALF_1,i.rectAreaLTC2=Je.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=d,i.ambient[1]=h,i.ambient[2]=p;const k=i.hash;(k.directionalLength!==m||k.pointLength!==g||k.spotLength!==v||k.rectAreaLength!==y||k.hemiLength!==x||k.numDirectionalShadows!==b||k.numPointShadows!==_||k.numSpotShadows!==S||k.numSpotMaps!==O)&&(i.directional.length=m,i.spot.length=v,i.rectArea.length=y,i.point.length=g,i.hemi.length=x,i.directionalShadow.length=b,i.directionalShadowMap.length=b,i.pointShadow.length=_,i.pointShadowMap.length=_,i.spotShadow.length=S,i.spotShadowMap.length=S,i.directionalShadowMatrix.length=b,i.pointShadowMatrix.length=_,i.spotLightMatrix.length=S+O-C,i.spotLightMap.length=O,i.numSpotLightShadowsWithMaps=C,k.directionalLength=m,k.pointLength=g,k.spotLength=v,k.rectAreaLength=y,k.hemiLength=x,k.numDirectionalShadows=b,k.numPointShadows=_,k.numSpotShadows=S,k.numSpotMaps=O,i.version=EWt++)}function c(u,f){let d=0,h=0,p=0,m=0,g=0;const v=f.matrixWorldInverse;for(let y=0,x=u.length;y=s.length?(l=new uJ(t,e),s.push(l)):l=s[a],l}function i(){n=new WeakMap}return{get:r,dispose:i}}class AWt extends kw{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=HBt,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class RWt extends kw{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.referencePosition=new Se,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const IWt=`void main() { +`+L)}else E!==""?console.warn("THREE.WebGLProgram: Program Info Log:",E):(k===""||I==="")&&(R=!1);R&&(this.diagnostics={runnable:P,programLog:E,vertexShader:{log:k,prefix:g},fragmentShader:{log:I,prefix:v}})}i.deleteShader(_),i.deleteShader(S);let O;this.getUniforms=function(){return O===void 0&&(O=new HC(i,m)),O};let C;return this.getAttributes=function(){return C===void 0&&(C=cWt(i,m)),C},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(m),this.program=void 0},this.name=n.shaderName,this.id=nWt++,this.cacheKey=e,this.usedTimes=1,this.program=m,this.vertexShader=_,this.fragmentShader=S,this}let bWt=0;class _Wt{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const n=e.vertexShader,r=e.fragmentShader,i=this._getShaderStage(n),o=this._getShaderStage(r),a=this._getShaderCacheForMaterial(e);return a.has(i)===!1&&(a.add(i),i.usedTimes++),a.has(o)===!1&&(a.add(o),o.usedTimes++),this}remove(e){const n=this.materialCache.get(e);for(const r of n)r.usedTimes--,r.usedTimes===0&&this.shaderCache.delete(r.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const n=this.materialCache;let r=n.get(e);return r===void 0&&(r=new Set,n.set(e,r)),r}_getShaderStage(e){const n=this.shaderCache;let r=n.get(e);return r===void 0&&(r=new wWt(e),n.set(e,r)),r}}class wWt{constructor(e){this.id=bWt++,this.code=e,this.usedTimes=0}}function SWt(t,e,n,r,i,o,a){const s=new Dye,l=new _Wt,c=[],u=i.isWebGL2,f=i.logarithmicDepthBuffer,d=i.vertexTextures;let h=i.precision;const p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function m(C,E,k,I,P){const R=I.fog,T=P.geometry,L=C.isMeshStandardMaterial?I.environment:null,z=(C.isMeshStandardMaterial?n:e).get(C.envMap||L),B=z&&z.mapping===Ck?z.image.height:null,W=p[C.type];C.precision!==null&&(h=i.getMaxPrecision(C.precision),h!==C.precision&&console.warn("THREE.WebGLProgram.getParameters:",C.precision,"not supported, using",h,"instead."));const U=T.morphAttributes.position||T.morphAttributes.normal||T.morphAttributes.color,N=U!==void 0?U.length:0;let $=0;T.morphAttributes.position!==void 0&&($=1),T.morphAttributes.normal!==void 0&&($=2),T.morphAttributes.color!==void 0&&($=3);let D,A,q,Y;if(W){const be=xl[W];D=be.vertexShader,A=be.fragmentShader}else D=C.vertexShader,A=C.fragmentShader,l.update(C),q=l.getVertexShaderID(C),Y=l.getFragmentShaderID(C);const K=t.getRenderTarget(),se=C.alphaTest>0,te=C.clearcoat>0,J=C.iridescence>0;return{isWebGL2:u,shaderID:W,shaderName:C.type,vertexShader:D,fragmentShader:A,defines:C.defines,customVertexShaderID:q,customFragmentShaderID:Y,isRawShaderMaterial:C.isRawShaderMaterial===!0,glslVersion:C.glslVersion,precision:h,instancing:P.isInstancedMesh===!0,instancingColor:P.isInstancedMesh===!0&&P.instanceColor!==null,supportsVertexTextures:d,outputEncoding:K===null?t.outputEncoding:K.isXRRenderTarget===!0?K.texture.encoding:fp,map:!!C.map,matcap:!!C.matcap,envMap:!!z,envMapMode:z&&z.mapping,envMapCubeUVHeight:B,lightMap:!!C.lightMap,aoMap:!!C.aoMap,emissiveMap:!!C.emissiveMap,bumpMap:!!C.bumpMap,normalMap:!!C.normalMap,objectSpaceNormalMap:C.normalMapType===KBt,tangentSpaceNormalMap:C.normalMapType===YBt,decodeVideoTexture:!!C.map&&C.map.isVideoTexture===!0&&C.map.encoding===vr,clearcoat:te,clearcoatMap:te&&!!C.clearcoatMap,clearcoatRoughnessMap:te&&!!C.clearcoatRoughnessMap,clearcoatNormalMap:te&&!!C.clearcoatNormalMap,iridescence:J,iridescenceMap:J&&!!C.iridescenceMap,iridescenceThicknessMap:J&&!!C.iridescenceThicknessMap,displacementMap:!!C.displacementMap,roughnessMap:!!C.roughnessMap,metalnessMap:!!C.metalnessMap,specularMap:!!C.specularMap,specularIntensityMap:!!C.specularIntensityMap,specularColorMap:!!C.specularColorMap,opaque:C.transparent===!1&&C.blending===Lg,alphaMap:!!C.alphaMap,alphaTest:se,gradientMap:!!C.gradientMap,sheen:C.sheen>0,sheenColorMap:!!C.sheenColorMap,sheenRoughnessMap:!!C.sheenRoughnessMap,transmission:C.transmission>0,transmissionMap:!!C.transmissionMap,thicknessMap:!!C.thicknessMap,combine:C.combine,vertexTangents:!!C.normalMap&&!!T.attributes.tangent,vertexColors:C.vertexColors,vertexAlphas:C.vertexColors===!0&&!!T.attributes.color&&T.attributes.color.itemSize===4,vertexUvs:!!C.map||!!C.bumpMap||!!C.normalMap||!!C.specularMap||!!C.alphaMap||!!C.emissiveMap||!!C.roughnessMap||!!C.metalnessMap||!!C.clearcoatMap||!!C.clearcoatRoughnessMap||!!C.clearcoatNormalMap||!!C.iridescenceMap||!!C.iridescenceThicknessMap||!!C.displacementMap||!!C.transmissionMap||!!C.thicknessMap||!!C.specularIntensityMap||!!C.specularColorMap||!!C.sheenColorMap||!!C.sheenRoughnessMap,uvsVertexOnly:!(C.map||C.bumpMap||C.normalMap||C.specularMap||C.alphaMap||C.emissiveMap||C.roughnessMap||C.metalnessMap||C.clearcoatNormalMap||C.iridescenceMap||C.iridescenceThicknessMap||C.transmission>0||C.transmissionMap||C.thicknessMap||C.specularIntensityMap||C.specularColorMap||C.sheen>0||C.sheenColorMap||C.sheenRoughnessMap)&&!!C.displacementMap,fog:!!R,useFog:C.fog===!0,fogExp2:R&&R.isFogExp2,flatShading:!!C.flatShading,sizeAttenuation:C.sizeAttenuation,logarithmicDepthBuffer:f,skinning:P.isSkinnedMesh===!0,morphTargets:T.morphAttributes.position!==void 0,morphNormals:T.morphAttributes.normal!==void 0,morphColors:T.morphAttributes.color!==void 0,morphTargetsCount:N,morphTextureStride:$,numDirLights:E.directional.length,numPointLights:E.point.length,numSpotLights:E.spot.length,numSpotLightMaps:E.spotLightMap.length,numRectAreaLights:E.rectArea.length,numHemiLights:E.hemi.length,numDirLightShadows:E.directionalShadowMap.length,numPointLightShadows:E.pointShadowMap.length,numSpotLightShadows:E.spotShadowMap.length,numSpotLightShadowsWithMaps:E.numSpotLightShadowsWithMaps,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:C.dithering,shadowMapEnabled:t.shadowMap.enabled&&k.length>0,shadowMapType:t.shadowMap.type,toneMapping:C.toneMapped?t.toneMapping:ru,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:C.premultipliedAlpha,doubleSided:C.side===qc,flipSided:C.side===_a,useDepthPacking:!!C.depthPacking,depthPacking:C.depthPacking||0,index0AttributeName:C.index0AttributeName,extensionDerivatives:C.extensions&&C.extensions.derivatives,extensionFragDepth:C.extensions&&C.extensions.fragDepth,extensionDrawBuffers:C.extensions&&C.extensions.drawBuffers,extensionShaderTextureLOD:C.extensions&&C.extensions.shaderTextureLOD,rendererExtensionFragDepth:u||r.has("EXT_frag_depth"),rendererExtensionDrawBuffers:u||r.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:u||r.has("EXT_shader_texture_lod"),customProgramCacheKey:C.customProgramCacheKey()}}function g(C){const E=[];if(C.shaderID?E.push(C.shaderID):(E.push(C.customVertexShaderID),E.push(C.customFragmentShaderID)),C.defines!==void 0)for(const k in C.defines)E.push(k),E.push(C.defines[k]);return C.isRawShaderMaterial===!1&&(v(E,C),y(E,C),E.push(t.outputEncoding)),E.push(C.customProgramCacheKey),E.join()}function v(C,E){C.push(E.precision),C.push(E.outputEncoding),C.push(E.envMapMode),C.push(E.envMapCubeUVHeight),C.push(E.combine),C.push(E.vertexUvs),C.push(E.fogExp2),C.push(E.sizeAttenuation),C.push(E.morphTargetsCount),C.push(E.morphAttributeCount),C.push(E.numDirLights),C.push(E.numPointLights),C.push(E.numSpotLights),C.push(E.numSpotLightMaps),C.push(E.numHemiLights),C.push(E.numRectAreaLights),C.push(E.numDirLightShadows),C.push(E.numPointLightShadows),C.push(E.numSpotLightShadows),C.push(E.numSpotLightShadowsWithMaps),C.push(E.shadowMapType),C.push(E.toneMapping),C.push(E.numClippingPlanes),C.push(E.numClipIntersection),C.push(E.depthPacking)}function y(C,E){s.disableAll(),E.isWebGL2&&s.enable(0),E.supportsVertexTextures&&s.enable(1),E.instancing&&s.enable(2),E.instancingColor&&s.enable(3),E.map&&s.enable(4),E.matcap&&s.enable(5),E.envMap&&s.enable(6),E.lightMap&&s.enable(7),E.aoMap&&s.enable(8),E.emissiveMap&&s.enable(9),E.bumpMap&&s.enable(10),E.normalMap&&s.enable(11),E.objectSpaceNormalMap&&s.enable(12),E.tangentSpaceNormalMap&&s.enable(13),E.clearcoat&&s.enable(14),E.clearcoatMap&&s.enable(15),E.clearcoatRoughnessMap&&s.enable(16),E.clearcoatNormalMap&&s.enable(17),E.iridescence&&s.enable(18),E.iridescenceMap&&s.enable(19),E.iridescenceThicknessMap&&s.enable(20),E.displacementMap&&s.enable(21),E.specularMap&&s.enable(22),E.roughnessMap&&s.enable(23),E.metalnessMap&&s.enable(24),E.gradientMap&&s.enable(25),E.alphaMap&&s.enable(26),E.alphaTest&&s.enable(27),E.vertexColors&&s.enable(28),E.vertexAlphas&&s.enable(29),E.vertexUvs&&s.enable(30),E.vertexTangents&&s.enable(31),E.uvsVertexOnly&&s.enable(32),C.push(s.mask),s.disableAll(),E.fog&&s.enable(0),E.useFog&&s.enable(1),E.flatShading&&s.enable(2),E.logarithmicDepthBuffer&&s.enable(3),E.skinning&&s.enable(4),E.morphTargets&&s.enable(5),E.morphNormals&&s.enable(6),E.morphColors&&s.enable(7),E.premultipliedAlpha&&s.enable(8),E.shadowMapEnabled&&s.enable(9),E.physicallyCorrectLights&&s.enable(10),E.doubleSided&&s.enable(11),E.flipSided&&s.enable(12),E.useDepthPacking&&s.enable(13),E.dithering&&s.enable(14),E.specularIntensityMap&&s.enable(15),E.specularColorMap&&s.enable(16),E.transmission&&s.enable(17),E.transmissionMap&&s.enable(18),E.thicknessMap&&s.enable(19),E.sheen&&s.enable(20),E.sheenColorMap&&s.enable(21),E.sheenRoughnessMap&&s.enable(22),E.decodeVideoTexture&&s.enable(23),E.opaque&&s.enable(24),C.push(s.mask)}function x(C){const E=p[C.type];let k;if(E){const I=xl[E];k=Nye.clone(I.uniforms)}else k=C.uniforms;return k}function b(C,E){let k;for(let I=0,P=c.length;I0?r.push(v):h.transparent===!0?i.push(v):n.push(v)}function l(f,d,h,p,m,g){const v=a(f,d,h,p,m,g);h.transmission>0?r.unshift(v):h.transparent===!0?i.unshift(v):n.unshift(v)}function c(f,d){n.length>1&&n.sort(f||CWt),r.length>1&&r.sort(d||uJ),i.length>1&&i.sort(d||uJ)}function u(){for(let f=e,d=t.length;f=o.length?(a=new fJ,o.push(a)):a=o[i],a}function n(){t=new WeakMap}return{get:e,dispose:n}}function EWt(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new Se,color:new sr};break;case"SpotLight":n={position:new Se,direction:new Se,color:new sr,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new Se,color:new sr,distance:0,decay:0};break;case"HemisphereLight":n={direction:new Se,skyColor:new sr,groundColor:new sr};break;case"RectAreaLight":n={color:new sr,position:new Se,halfWidth:new Se,halfHeight:new Se};break}return t[e.id]=n,n}}}function PWt(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ht};break;case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ht};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ht,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let MWt=0;function kWt(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function AWt(t,e){const n=new EWt,r=PWt(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0};for(let u=0;u<9;u++)i.probe.push(new Se);const o=new Se,a=new Gn,s=new Gn;function l(u,f){let d=0,h=0,p=0;for(let I=0;I<9;I++)i.probe[I].set(0,0,0);let m=0,g=0,v=0,y=0,x=0,b=0,_=0,S=0,O=0,C=0;u.sort(kWt);const E=f!==!0?Math.PI:1;for(let I=0,P=u.length;I0&&(e.isWebGL2||t.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=Je.LTC_FLOAT_1,i.rectAreaLTC2=Je.LTC_FLOAT_2):t.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=Je.LTC_HALF_1,i.rectAreaLTC2=Je.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=d,i.ambient[1]=h,i.ambient[2]=p;const k=i.hash;(k.directionalLength!==m||k.pointLength!==g||k.spotLength!==v||k.rectAreaLength!==y||k.hemiLength!==x||k.numDirectionalShadows!==b||k.numPointShadows!==_||k.numSpotShadows!==S||k.numSpotMaps!==O)&&(i.directional.length=m,i.spot.length=v,i.rectArea.length=y,i.point.length=g,i.hemi.length=x,i.directionalShadow.length=b,i.directionalShadowMap.length=b,i.pointShadow.length=_,i.pointShadowMap.length=_,i.spotShadow.length=S,i.spotShadowMap.length=S,i.directionalShadowMatrix.length=b,i.pointShadowMatrix.length=_,i.spotLightMatrix.length=S+O-C,i.spotLightMap.length=O,i.numSpotLightShadowsWithMaps=C,k.directionalLength=m,k.pointLength=g,k.spotLength=v,k.rectAreaLength=y,k.hemiLength=x,k.numDirectionalShadows=b,k.numPointShadows=_,k.numSpotShadows=S,k.numSpotMaps=O,i.version=MWt++)}function c(u,f){let d=0,h=0,p=0,m=0,g=0;const v=f.matrixWorldInverse;for(let y=0,x=u.length;y=s.length?(l=new dJ(t,e),s.push(l)):l=s[a],l}function i(){n=new WeakMap}return{get:r,dispose:i}}class IWt extends kw{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=XBt,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class DWt extends kw{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.referencePosition=new Se,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const LWt=`void main() { gl_Position = vec4( position, 1.0 ); -}`,DWt=`uniform sampler2D shadow_pass; +}`,$Wt=`uniform sampler2D shadow_pass; uniform vec2 resolution; uniform float radius; #include @@ -3437,7 +3437,7 @@ void main() { squared_mean = squared_mean / samples; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function LWt(t,e,n){let r=new jye;const i=new Ht,o=new Ht,a=new Ri,s=new AWt({depthPacking:qBt}),l=new RWt,c={},u=n.maxTextureSize,f={0:_a,1:Av,2:qc},d=new od({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ht},radius:{value:4}},vertexShader:IWt,fragmentShader:DWt}),h=d.clone();h.defines.HORIZONTAL_PASS=1;const p=new Ou;p.setAttribute("position",new os(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const m=new Nl(p,d),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=xye,this.render=function(b,_,S){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||b.length===0)return;const O=t.getRenderTarget(),C=t.getActiveCubeFace(),E=t.getActiveMipmapLevel(),k=t.state;k.setBlending(Uf),k.buffers.color.setClear(1,1,1,1),k.buffers.depth.setTest(!0),k.setScissorTest(!1);for(let I=0,P=b.length;Iu||i.y>u)&&(i.x>u&&(o.x=Math.floor(u/L.x),i.x=o.x*L.x,T.mapSize.x=o.x),i.y>u&&(o.y=Math.floor(u/L.y),i.y=o.y*L.y,T.mapSize.y=o.y)),T.map===null){const B=this.type!==yx?{minFilter:To,magFilter:To}:{};T.map=new dp(i.x,i.y,B),T.map.texture.name=R.name+".shadowMap",T.camera.updateProjectionMatrix()}t.setRenderTarget(T.map),t.clear();const z=T.getViewportCount();for(let B=0;B0){const P=k.uuid,R=_.uuid;let T=c[P];T===void 0&&(T={},c[P]=T);let L=T[R];L===void 0&&(L=k.clone(),T[R]=L),k=L}return k.visible=_.visible,k.wireframe=_.wireframe,E===yx?k.side=_.shadowSide!==null?_.shadowSide:_.side:k.side=_.shadowSide!==null?_.shadowSide:f[_.side],k.alphaMap=_.alphaMap,k.alphaTest=_.alphaTest,k.clipShadows=_.clipShadows,k.clippingPlanes=_.clippingPlanes,k.clipIntersection=_.clipIntersection,k.displacementMap=_.displacementMap,k.displacementScale=_.displacementScale,k.displacementBias=_.displacementBias,k.wireframeLinewidth=_.wireframeLinewidth,k.linewidth=_.linewidth,S.isPointLight===!0&&k.isMeshDistanceMaterial===!0&&(k.referencePosition.setFromMatrixPosition(S.matrixWorld),k.nearDistance=O,k.farDistance=C),k}function x(b,_,S,O,C){if(b.visible===!1)return;if(b.layers.test(_.layers)&&(b.isMesh||b.isLine||b.isPoints)&&(b.castShadow||b.receiveShadow&&C===yx)&&(!b.frustumCulled||r.intersectsObject(b))){b.modelViewMatrix.multiplyMatrices(S.matrixWorldInverse,b.matrixWorld);const I=e.update(b),P=b.material;if(Array.isArray(P)){const R=I.groups;for(let T=0,L=R.length;T=1):W.indexOf("OpenGL ES")!==-1&&(B=parseFloat(/^OpenGL ES (\d)/.exec(W)[1]),z=B>=2);let U=null,N={};const $=t.getParameter(3088),D=t.getParameter(2978),A=new Ri().fromArray($),q=new Ri().fromArray(D);function Y(ae,Le,Ee){const ze=new Uint8Array(4),He=t.createTexture();t.bindTexture(ae,He),t.texParameteri(ae,10241,9728),t.texParameteri(ae,10240,9728);for(let xt=0;xthe||H.height>he)&&(_e=he/Math.max(H.width,H.height)),_e<1||G===!0)if(typeof HTMLImageElement<"u"&&H instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&H instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&H instanceof ImageBitmap){const oe=G?xF:Math.floor,Z=oe(_e*H.width),V=oe(_e*H.height);m===void 0&&(m=y(Z,V));const de=ie?y(Z,V):m;return de.width=Z,de.height=V,de.getContext("2d").drawImage(H,0,0,Z,V),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+H.width+"x"+H.height+") to ("+Z+"x"+V+")."),de}else return"data"in H&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+H.width+"x"+H.height+")."),H;return H}function b(H){return AZ(H.width)&&AZ(H.height)}function _(H){return s?!1:H.wrapS!==Ha||H.wrapT!==Ha||H.minFilter!==To&&H.minFilter!==Eo}function S(H,G){return H.generateMipmaps&&G&&H.minFilter!==To&&H.minFilter!==Eo}function O(H){t.generateMipmap(H)}function C(H,G,ie,he,_e=!1){if(s===!1)return G;if(H!==null){if(t[H]!==void 0)return t[H];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+H+"'")}let oe=G;return G===6403&&(ie===5126&&(oe=33326),ie===5131&&(oe=33325),ie===5121&&(oe=33321)),G===33319&&(ie===5126&&(oe=33328),ie===5131&&(oe=33327),ie===5121&&(oe=33323)),G===6408&&(ie===5126&&(oe=34836),ie===5131&&(oe=34842),ie===5121&&(oe=he===vr&&_e===!1?35907:32856),ie===32819&&(oe=32854),ie===32820&&(oe=32855)),(oe===33325||oe===33326||oe===33327||oe===33328||oe===34842||oe===34836)&&e.get("EXT_color_buffer_float"),oe}function E(H,G,ie){return S(H,ie)===!0||H.isFramebufferTexture&&H.minFilter!==To&&H.minFilter!==Eo?Math.log2(Math.max(G.width,G.height))+1:H.mipmaps!==void 0&&H.mipmaps.length>0?H.mipmaps.length:H.isCompressedTexture&&Array.isArray(H.image)?G.mipmaps.length:1}function k(H){return H===To||H===oZ||H===aZ?9728:9729}function I(H){const G=H.target;G.removeEventListener("dispose",I),R(G),G.isVideoTexture&&p.delete(G)}function P(H){const G=H.target;G.removeEventListener("dispose",P),L(G)}function R(H){const G=r.get(H);if(G.__webglInit===void 0)return;const ie=H.source,he=g.get(ie);if(he){const _e=he[G.__cacheKey];_e.usedTimes--,_e.usedTimes===0&&T(H),Object.keys(he).length===0&&g.delete(ie)}r.remove(H)}function T(H){const G=r.get(H);t.deleteTexture(G.__webglTexture);const ie=H.source,he=g.get(ie);delete he[G.__cacheKey],a.memory.textures--}function L(H){const G=H.texture,ie=r.get(H),he=r.get(G);if(he.__webglTexture!==void 0&&(t.deleteTexture(he.__webglTexture),a.memory.textures--),H.depthTexture&&H.depthTexture.dispose(),H.isWebGLCubeRenderTarget)for(let _e=0;_e<6;_e++)t.deleteFramebuffer(ie.__webglFramebuffer[_e]),ie.__webglDepthbuffer&&t.deleteRenderbuffer(ie.__webglDepthbuffer[_e]);else{if(t.deleteFramebuffer(ie.__webglFramebuffer),ie.__webglDepthbuffer&&t.deleteRenderbuffer(ie.__webglDepthbuffer),ie.__webglMultisampledFramebuffer&&t.deleteFramebuffer(ie.__webglMultisampledFramebuffer),ie.__webglColorRenderbuffer)for(let _e=0;_e=l&&console.warn("THREE.WebGLTextures: Trying to use "+H+" texture units while this GPU supports only "+l),z+=1,H}function U(H){const G=[];return G.push(H.wrapS),G.push(H.wrapT),G.push(H.magFilter),G.push(H.minFilter),G.push(H.anisotropy),G.push(H.internalFormat),G.push(H.format),G.push(H.type),G.push(H.generateMipmaps),G.push(H.premultiplyAlpha),G.push(H.flipY),G.push(H.unpackAlignment),G.push(H.encoding),G.join()}function N(H,G){const ie=r.get(H);if(H.isVideoTexture&&ge(H),H.isRenderTargetTexture===!1&&H.version>0&&ie.__version!==H.version){const he=H.image;if(he===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(he.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{te(ie,H,G);return}}n.activeTexture(33984+G),n.bindTexture(3553,ie.__webglTexture)}function $(H,G){const ie=r.get(H);if(H.version>0&&ie.__version!==H.version){te(ie,H,G);return}n.activeTexture(33984+G),n.bindTexture(35866,ie.__webglTexture)}function D(H,G){const ie=r.get(H);if(H.version>0&&ie.__version!==H.version){te(ie,H,G);return}n.activeTexture(33984+G),n.bindTexture(32879,ie.__webglTexture)}function A(H,G){const ie=r.get(H);if(H.version>0&&ie.__version!==H.version){J(ie,H,G);return}n.activeTexture(33984+G),n.bindTexture(34067,ie.__webglTexture)}const q={[gF]:10497,[Ha]:33071,[vF]:33648},Y={[To]:9728,[oZ]:9984,[aZ]:9986,[Eo]:9729,[ABt]:9985,[Tk]:9987};function K(H,G,ie){if(ie?(t.texParameteri(H,10242,q[G.wrapS]),t.texParameteri(H,10243,q[G.wrapT]),(H===32879||H===35866)&&t.texParameteri(H,32882,q[G.wrapR]),t.texParameteri(H,10240,Y[G.magFilter]),t.texParameteri(H,10241,Y[G.minFilter])):(t.texParameteri(H,10242,33071),t.texParameteri(H,10243,33071),(H===32879||H===35866)&&t.texParameteri(H,32882,33071),(G.wrapS!==Ha||G.wrapT!==Ha)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(H,10240,k(G.magFilter)),t.texParameteri(H,10241,k(G.minFilter)),G.minFilter!==To&&G.minFilter!==Eo&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){const he=e.get("EXT_texture_filter_anisotropic");if(G.type===Of&&e.has("OES_texture_float_linear")===!1||s===!1&&G.type===Z_&&e.has("OES_texture_half_float_linear")===!1)return;(G.anisotropy>1||r.get(G).__currentAnisotropy)&&(t.texParameterf(H,he.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(G.anisotropy,i.getMaxAnisotropy())),r.get(G).__currentAnisotropy=G.anisotropy)}}function se(H,G){let ie=!1;H.__webglInit===void 0&&(H.__webglInit=!0,G.addEventListener("dispose",I));const he=G.source;let _e=g.get(he);_e===void 0&&(_e={},g.set(he,_e));const oe=U(G);if(oe!==H.__cacheKey){_e[oe]===void 0&&(_e[oe]={texture:t.createTexture(),usedTimes:0},a.memory.textures++,ie=!0),_e[oe].usedTimes++;const Z=_e[H.__cacheKey];Z!==void 0&&(_e[H.__cacheKey].usedTimes--,Z.usedTimes===0&&T(G)),H.__cacheKey=oe,H.__webglTexture=_e[oe].texture}return ie}function te(H,G,ie){let he=3553;G.isDataArrayTexture&&(he=35866),G.isData3DTexture&&(he=32879);const _e=se(H,G),oe=G.source;if(n.activeTexture(33984+ie),n.bindTexture(he,H.__webglTexture),oe.version!==oe.__currentVersion||_e===!0){t.pixelStorei(37440,G.flipY),t.pixelStorei(37441,G.premultiplyAlpha),t.pixelStorei(3317,G.unpackAlignment),t.pixelStorei(37443,0);const Z=_(G)&&b(G.image)===!1;let V=x(G.image,Z,!1,u);V=ye(G,V);const de=b(V)||s,xe=o.convert(G.format,G.encoding);let Me=o.convert(G.type),me=C(G.internalFormat,xe,Me,G.encoding,G.isVideoTexture);K(he,G,de);let Ne;const Ce=G.mipmaps,Re=s&&G.isVideoTexture!==!0,ae=oe.__currentVersion===void 0||_e===!0,Le=E(G,V,de);if(G.isDepthTexture)me=6402,s?G.type===Of?me=36012:G.type===Oh?me=33190:G.type===$g?me=35056:me=33189:G.type===Of&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),G.format===Bh&&me===6402&&G.type!==Oye&&G.type!==Oh&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),G.type=Oh,Me=o.convert(G.type)),G.format===Dv&&me===6402&&(me=34041,G.type!==$g&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),G.type=$g,Me=o.convert(G.type))),ae&&(Re?n.texStorage2D(3553,1,me,V.width,V.height):n.texImage2D(3553,0,me,V.width,V.height,0,xe,Me,null));else if(G.isDataTexture)if(Ce.length>0&&de){Re&&ae&&n.texStorage2D(3553,Le,me,Ce[0].width,Ce[0].height);for(let Ee=0,ze=Ce.length;Ee>=1,ze>>=1}}else if(Ce.length>0&&de){Re&&ae&&n.texStorage2D(3553,Le,me,Ce[0].width,Ce[0].height);for(let Ee=0,ze=Ce.length;Ee0&&ae++,n.texStorage2D(34067,ae,Ne,V[0].width,V[0].height));for(let Ee=0;Ee<6;Ee++)if(Z){Ce?n.texSubImage2D(34069+Ee,0,0,0,V[Ee].width,V[Ee].height,Me,me,V[Ee].data):n.texImage2D(34069+Ee,0,Ne,V[Ee].width,V[Ee].height,0,Me,me,V[Ee].data);for(let ze=0;ze0&&ee(H)===!1){const V=oe?G:[G];ie.__webglMultisampledFramebuffer=t.createFramebuffer(),ie.__webglColorRenderbuffer=[],n.bindFramebuffer(36160,ie.__webglMultisampledFramebuffer);for(let de=0;de0&&ee(H)===!1){const G=H.isWebGLMultipleRenderTargets?H.texture:[H.texture],ie=H.width,he=H.height;let _e=16384;const oe=[],Z=H.stencilBuffer?33306:36096,V=r.get(H),de=H.isWebGLMultipleRenderTargets===!0;if(de)for(let xe=0;xe0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&G.__useRenderToTexture!==!1}function ge(H){const G=a.render.frame;p.get(H)!==G&&(p.set(H,G),H.update())}function ye(H,G){const ie=H.encoding,he=H.format,_e=H.type;return H.isCompressedTexture===!0||H.isVideoTexture===!0||H.format===yF||ie!==fp&&(ie===vr?s===!1?e.has("EXT_sRGB")===!0&&he===$l?(H.format=yF,H.minFilter=Eo,H.generateMipmaps=!1):G=Pye.sRGBToLinear(G):(he!==$l||_e!==up)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",ie)),G}this.allocateTextureUnit=W,this.resetTextureUnits=B,this.setTexture2D=N,this.setTexture2DArray=$,this.setTexture3D=D,this.setTextureCube=A,this.rebindTextures=F,this.setupRenderTarget=ce,this.updateRenderTargetMipmap=le,this.updateMultisampleRenderTarget=Q,this.setupDepthRenderbuffer=ve,this.setupFrameBufferTexture=pe,this.useMultisampledRTT=ee}function FWt(t,e,n){const r=n.isWebGL2;function i(o,a=null){let s;if(o===up)return 5121;if(o===LBt)return 32819;if(o===$Bt)return 32820;if(o===RBt)return 5120;if(o===IBt)return 5122;if(o===Oye)return 5123;if(o===DBt)return 5124;if(o===Oh)return 5125;if(o===Of)return 5126;if(o===Z_)return r?5131:(s=e.get("OES_texture_half_float"),s!==null?s.HALF_FLOAT_OES:null);if(o===NBt)return 6406;if(o===$l)return 6408;if(o===jBt)return 6409;if(o===BBt)return 6410;if(o===Bh)return 6402;if(o===Dv)return 34041;if(o===Cye)return 6403;if(o===FBt)return console.warn("THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228"),6408;if(o===yF)return s=e.get("EXT_sRGB"),s!==null?s.SRGB_ALPHA_EXT:null;if(o===zBt)return 36244;if(o===UBt)return 33319;if(o===WBt)return 33320;if(o===VBt)return 36249;if(o===LI||o===$I||o===NI||o===FI)if(a===vr)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(o===LI)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(o===$I)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(o===NI)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(o===FI)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(o===LI)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(o===$I)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(o===NI)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(o===FI)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(o===sZ||o===lZ||o===cZ||o===uZ)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(o===sZ)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(o===lZ)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(o===cZ)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(o===uZ)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(o===GBt)return s=e.get("WEBGL_compressed_texture_etc1"),s!==null?s.COMPRESSED_RGB_ETC1_WEBGL:null;if(o===fZ||o===dZ)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(o===fZ)return a===vr?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(o===dZ)return a===vr?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(o===hZ||o===pZ||o===mZ||o===gZ||o===vZ||o===yZ||o===xZ||o===bZ||o===_Z||o===wZ||o===SZ||o===OZ||o===CZ||o===TZ)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(o===hZ)return a===vr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(o===pZ)return a===vr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(o===mZ)return a===vr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(o===gZ)return a===vr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(o===vZ)return a===vr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(o===yZ)return a===vr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(o===xZ)return a===vr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(o===bZ)return a===vr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(o===_Z)return a===vr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(o===wZ)return a===vr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(o===SZ)return a===vr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(o===OZ)return a===vr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(o===CZ)return a===vr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(o===TZ)return a===vr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(o===EZ)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(o===EZ)return a===vr?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;return o===$g?r?34042:(s=e.get("WEBGL_depth_texture"),s!==null?s.UNSIGNED_INT_24_8_WEBGL:null):t[o]!==void 0?t[o]:null}return{convert:i}}class jWt extends js{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class XO extends Bo{constructor(){super(),this.isGroup=!0,this.type="Group"}}const BWt={type:"move"};class dD{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new XO,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new XO,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Se,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Se),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new XO,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Se,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Se),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,n,r){let i=null,o=null,a=null;const s=this._targetRay,l=this._grip,c=this._hand;if(e&&n.session.visibilityState!=="visible-blurred"){if(c&&e.hand){a=!0;for(const m of e.hand.values()){const g=n.getJointPose(m,r);if(c.joints[m.jointName]===void 0){const y=new XO;y.matrixAutoUpdate=!1,y.visible=!1,c.joints[m.jointName]=y,c.add(y)}const v=c.joints[m.jointName];g!==null&&(v.matrix.fromArray(g.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.jointRadius=g.radius),v.visible=g!==null}const u=c.joints["index-finger-tip"],f=c.joints["thumb-tip"],d=u.position.distanceTo(f.position),h=.02,p=.005;c.inputState.pinching&&d>h+p?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&d<=h-p&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(o=n.getPose(e.gripSpace,r),o!==null&&(l.matrix.fromArray(o.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),o.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(o.linearVelocity)):l.hasLinearVelocity=!1,o.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(o.angularVelocity)):l.hasAngularVelocity=!1));s!==null&&(i=n.getPose(e.targetRaySpace,r),i===null&&o!==null&&(i=o),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(BWt)))}return s!==null&&(s.visible=i!==null),l!==null&&(l.visible=o!==null),c!==null&&(c.visible=a!==null),this}}class zWt extends Ta{constructor(e,n,r,i,o,a,s,l,c,u){if(u=u!==void 0?u:Bh,u!==Bh&&u!==Dv)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");r===void 0&&u===Bh&&(r=Oh),r===void 0&&u===Dv&&(r=$g),super(null,i,o,a,s,l,u,r,c),this.isDepthTexture=!0,this.image={width:e,height:n},this.magFilter=s!==void 0?s:To,this.minFilter=l!==void 0?l:To,this.flipY=!1,this.generateMipmaps=!1}}class UWt extends jp{constructor(e,n){super();const r=this;let i=null,o=1,a=null,s="local-floor",l=null,c=null,u=null,f=null,d=null,h=null;const p=n.getContextAttributes();let m=null,g=null;const v=[],y=[],x=new js;x.layers.enable(1),x.viewport=new Ri;const b=new js;b.layers.enable(2),b.viewport=new Ri;const _=[x,b],S=new jWt;S.layers.enable(1),S.layers.enable(2);let O=null,C=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(U){let N=v[U];return N===void 0&&(N=new dD,v[U]=N),N.getTargetRaySpace()},this.getControllerGrip=function(U){let N=v[U];return N===void 0&&(N=new dD,v[U]=N),N.getGripSpace()},this.getHand=function(U){let N=v[U];return N===void 0&&(N=new dD,v[U]=N),N.getHandSpace()};function E(U){const N=y.indexOf(U.inputSource);if(N===-1)return;const $=v[N];$!==void 0&&$.dispatchEvent({type:U.type,data:U.inputSource})}function k(){i.removeEventListener("select",E),i.removeEventListener("selectstart",E),i.removeEventListener("selectend",E),i.removeEventListener("squeeze",E),i.removeEventListener("squeezestart",E),i.removeEventListener("squeezeend",E),i.removeEventListener("end",k),i.removeEventListener("inputsourceschange",I);for(let U=0;U=0&&(y[D]=null,v[D].dispatchEvent({type:"disconnected",data:$}))}for(let N=0;N=y.length){y.push($),D=q;break}else if(y[q]===null){y[q]=$,D=q;break}if(D===-1)break}const A=v[D];A&&A.dispatchEvent({type:"connected",data:$})}}const P=new Se,R=new Se;function T(U,N,$){P.setFromMatrixPosition(N.matrixWorld),R.setFromMatrixPosition($.matrixWorld);const D=P.distanceTo(R),A=N.projectionMatrix.elements,q=$.projectionMatrix.elements,Y=A[14]/(A[10]-1),K=A[14]/(A[10]+1),se=(A[9]+1)/A[5],te=(A[9]-1)/A[5],J=(A[8]-1)/A[0],pe=(q[8]+1)/q[0],be=Y*J,re=Y*pe,ve=D/(-J+pe),F=ve*-J;N.matrixWorld.decompose(U.position,U.quaternion,U.scale),U.translateX(F),U.translateZ(ve),U.matrixWorld.compose(U.position,U.quaternion,U.scale),U.matrixWorldInverse.copy(U.matrixWorld).invert();const ce=Y+ve,le=K+ve,Q=be-F,X=re+(D-F),ee=se*K/le*ce,ge=te*K/le*ce;U.projectionMatrix.makePerspective(Q,X,ee,ge,ce,le)}function L(U,N){N===null?U.matrixWorld.copy(U.matrix):U.matrixWorld.multiplyMatrices(N.matrixWorld,U.matrix),U.matrixWorldInverse.copy(U.matrixWorld).invert()}this.updateCamera=function(U){if(i===null)return;S.near=b.near=x.near=U.near,S.far=b.far=x.far=U.far,(O!==S.near||C!==S.far)&&(i.updateRenderState({depthNear:S.near,depthFar:S.far}),O=S.near,C=S.far);const N=U.parent,$=S.cameras;L(S,N);for(let A=0;A<$.length;A++)L($[A],N);S.matrixWorld.decompose(S.position,S.quaternion,S.scale),U.matrix.copy(S.matrix),U.matrix.decompose(U.position,U.quaternion,U.scale);const D=U.children;for(let A=0,q=D.length;A0&&(m.alphaTest.value=g.alphaTest);const v=e.get(g).envMap;if(v&&(m.envMap.value=v,m.flipEnvMap.value=v.isCubeTexture&&v.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=g.reflectivity,m.ior.value=g.ior,m.refractionRatio.value=g.refractionRatio),g.lightMap){m.lightMap.value=g.lightMap;const b=t.physicallyCorrectLights!==!0?Math.PI:1;m.lightMapIntensity.value=g.lightMapIntensity*b}g.aoMap&&(m.aoMap.value=g.aoMap,m.aoMapIntensity.value=g.aoMapIntensity);let y;g.map?y=g.map:g.specularMap?y=g.specularMap:g.displacementMap?y=g.displacementMap:g.normalMap?y=g.normalMap:g.bumpMap?y=g.bumpMap:g.roughnessMap?y=g.roughnessMap:g.metalnessMap?y=g.metalnessMap:g.alphaMap?y=g.alphaMap:g.emissiveMap?y=g.emissiveMap:g.clearcoatMap?y=g.clearcoatMap:g.clearcoatNormalMap?y=g.clearcoatNormalMap:g.clearcoatRoughnessMap?y=g.clearcoatRoughnessMap:g.iridescenceMap?y=g.iridescenceMap:g.iridescenceThicknessMap?y=g.iridescenceThicknessMap:g.specularIntensityMap?y=g.specularIntensityMap:g.specularColorMap?y=g.specularColorMap:g.transmissionMap?y=g.transmissionMap:g.thicknessMap?y=g.thicknessMap:g.sheenColorMap?y=g.sheenColorMap:g.sheenRoughnessMap&&(y=g.sheenRoughnessMap),y!==void 0&&(y.isWebGLRenderTarget&&(y=y.texture),y.matrixAutoUpdate===!0&&y.updateMatrix(),m.uvTransform.value.copy(y.matrix));let x;g.aoMap?x=g.aoMap:g.lightMap&&(x=g.lightMap),x!==void 0&&(x.isWebGLRenderTarget&&(x=x.texture),x.matrixAutoUpdate===!0&&x.updateMatrix(),m.uv2Transform.value.copy(x.matrix))}function o(m,g){m.diffuse.value.copy(g.color),m.opacity.value=g.opacity}function a(m,g){m.dashSize.value=g.dashSize,m.totalSize.value=g.dashSize+g.gapSize,m.scale.value=g.scale}function s(m,g,v,y){m.diffuse.value.copy(g.color),m.opacity.value=g.opacity,m.size.value=g.size*v,m.scale.value=y*.5,g.map&&(m.map.value=g.map),g.alphaMap&&(m.alphaMap.value=g.alphaMap),g.alphaTest>0&&(m.alphaTest.value=g.alphaTest);let x;g.map?x=g.map:g.alphaMap&&(x=g.alphaMap),x!==void 0&&(x.matrixAutoUpdate===!0&&x.updateMatrix(),m.uvTransform.value.copy(x.matrix))}function l(m,g){m.diffuse.value.copy(g.color),m.opacity.value=g.opacity,m.rotation.value=g.rotation,g.map&&(m.map.value=g.map),g.alphaMap&&(m.alphaMap.value=g.alphaMap),g.alphaTest>0&&(m.alphaTest.value=g.alphaTest);let v;g.map?v=g.map:g.alphaMap&&(v=g.alphaMap),v!==void 0&&(v.matrixAutoUpdate===!0&&v.updateMatrix(),m.uvTransform.value.copy(v.matrix))}function c(m,g){m.specular.value.copy(g.specular),m.shininess.value=Math.max(g.shininess,1e-4)}function u(m,g){g.gradientMap&&(m.gradientMap.value=g.gradientMap)}function f(m,g){m.roughness.value=g.roughness,m.metalness.value=g.metalness,g.roughnessMap&&(m.roughnessMap.value=g.roughnessMap),g.metalnessMap&&(m.metalnessMap.value=g.metalnessMap),e.get(g).envMap&&(m.envMapIntensity.value=g.envMapIntensity)}function d(m,g,v){m.ior.value=g.ior,g.sheen>0&&(m.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),m.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(m.sheenColorMap.value=g.sheenColorMap),g.sheenRoughnessMap&&(m.sheenRoughnessMap.value=g.sheenRoughnessMap)),g.clearcoat>0&&(m.clearcoat.value=g.clearcoat,m.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(m.clearcoatMap.value=g.clearcoatMap),g.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap),g.clearcoatNormalMap&&(m.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),m.clearcoatNormalMap.value=g.clearcoatNormalMap,g.side===_a&&m.clearcoatNormalScale.value.negate())),g.iridescence>0&&(m.iridescence.value=g.iridescence,m.iridescenceIOR.value=g.iridescenceIOR,m.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap&&(m.iridescenceMap.value=g.iridescenceMap),g.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=g.iridescenceThicknessMap)),g.transmission>0&&(m.transmission.value=g.transmission,m.transmissionSamplerMap.value=v.texture,m.transmissionSamplerSize.value.set(v.width,v.height),g.transmissionMap&&(m.transmissionMap.value=g.transmissionMap),m.thickness.value=g.thickness,g.thicknessMap&&(m.thicknessMap.value=g.thicknessMap),m.attenuationDistance.value=g.attenuationDistance,m.attenuationColor.value.copy(g.attenuationColor)),m.specularIntensity.value=g.specularIntensity,m.specularColor.value.copy(g.specularColor),g.specularIntensityMap&&(m.specularIntensityMap.value=g.specularIntensityMap),g.specularColorMap&&(m.specularColorMap.value=g.specularColorMap)}function h(m,g){g.matcap&&(m.matcap.value=g.matcap)}function p(m,g){m.referencePosition.value.copy(g.referencePosition),m.nearDistance.value=g.nearDistance,m.farDistance.value=g.farDistance}return{refreshFogUniforms:n,refreshMaterialUniforms:r}}function VWt(t,e,n,r){let i={},o={},a=[];const s=n.isWebGL2?t.getParameter(35375):0;function l(y,x){const b=x.program;r.uniformBlockBinding(y,b)}function c(y,x){let b=i[y.id];b===void 0&&(p(y),b=u(y),i[y.id]=b,y.addEventListener("dispose",g));const _=x.program;r.updateUBOMapping(y,_);const S=e.render.frame;o[y.id]!==S&&(d(y),o[y.id]=S)}function u(y){const x=f();y.__bindingPointIndex=x;const b=t.createBuffer(),_=y.__size,S=y.usage;return t.bindBuffer(35345,b),t.bufferData(35345,_,S),t.bindBuffer(35345,null),t.bindBufferBase(35345,x,b),b}function f(){for(let y=0;y0){S=b%_;const I=_-S;S!==0&&I-k.boundary<0&&(b+=_-S,E.__offset=b)}b+=k.storage}return S=b%_,S>0&&(b+=_-S),y.__size=b,y.__cache={},this}function m(y){const x=y.value,b={boundary:0,storage:0};return typeof x=="number"?(b.boundary=4,b.storage=4):x.isVector2?(b.boundary=8,b.storage=8):x.isVector3||x.isColor?(b.boundary=16,b.storage=12):x.isVector4?(b.boundary=16,b.storage=16):x.isMatrix3?(b.boundary=48,b.storage=48):x.isMatrix4?(b.boundary=64,b.storage=64):x.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",x),b}function g(y){const x=y.target;x.removeEventListener("dispose",g);const b=a.indexOf(x.__bindingPointIndex);a.splice(b,1),t.deleteBuffer(i[x.id]),delete i[x.id],delete o[x.id]}function v(){for(const y in i)t.deleteBuffer(i[y]);a=[],i={},o={}}return{bind:l,update:c,dispose:v}}function GWt(){const t=J_("canvas");return t.style.display="block",t}function Hye(t={}){this.isWebGLRenderer=!0;const e=t.canvas!==void 0?t.canvas:GWt(),n=t.context!==void 0?t.context:null,r=t.depth!==void 0?t.depth:!0,i=t.stencil!==void 0?t.stencil:!0,o=t.antialias!==void 0?t.antialias:!1,a=t.premultipliedAlpha!==void 0?t.premultipliedAlpha:!0,s=t.preserveDrawingBuffer!==void 0?t.preserveDrawingBuffer:!1,l=t.powerPreference!==void 0?t.powerPreference:"default",c=t.failIfMajorPerformanceCaveat!==void 0?t.failIfMajorPerformanceCaveat:!1;let u;n!==null?u=n.getContextAttributes().alpha:u=t.alpha!==void 0?t.alpha:!1;let f=null,d=null;const h=[],p=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputEncoding=fp,this.physicallyCorrectLights=!1,this.toneMapping=ru,this.toneMappingExposure=1,Object.defineProperties(this,{gammaFactor:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaFactor has been removed."),2},set:function(){console.warn("THREE.WebGLRenderer: .gammaFactor has been removed.")}}});const m=this;let g=!1,v=0,y=0,x=null,b=-1,_=null;const S=new Ri,O=new Ri;let C=null,E=e.width,k=e.height,I=1,P=null,R=null;const T=new Ri(0,0,E,k),L=new Ri(0,0,E,k);let z=!1;const B=new jye;let W=!1,U=!1,N=null;const $=new Gn,D=new Ht,A=new Se,q={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Y(){return x===null?I:1}let K=n;function se(ne,Pe){for(let Ie=0;Ie0?d=p[p.length-1]:d=null,h.pop(),h.length>0?f=h[h.length-1]:f=null};function Hr(ne,Pe,Ie,Oe){if(ne.visible===!1)return;if(ne.layers.test(Pe.layers)){if(ne.isGroup)Ie=ne.renderOrder;else if(ne.isLOD)ne.autoUpdate===!0&&ne.update(Pe);else if(ne.isLight)d.pushLight(ne),ne.castShadow&&d.pushShadow(ne);else if(ne.isSprite){if(!ne.frustumCulled||B.intersectsSprite(ne)){Oe&&A.setFromMatrixPosition(ne.matrixWorld).applyMatrix4($);const Ze=X.update(ne),mt=ne.material;mt.visible&&f.push(ne,Ze,mt,Ie,A.z,null)}}else if((ne.isMesh||ne.isLine||ne.isPoints)&&(ne.isSkinnedMesh&&ne.skeleton.frame!==be.render.frame&&(ne.skeleton.update(),ne.skeleton.frame=be.render.frame),!ne.frustumCulled||B.intersectsObject(ne))){Oe&&A.setFromMatrixPosition(ne.matrixWorld).applyMatrix4($);const Ze=X.update(ne),mt=ne.material;if(Array.isArray(mt)){const wt=Ze.groups;for(let zt=0,Pt=wt.length;zt0&&qr($e,Pe,Ie),Oe&&pe.viewport(S.copy(Oe)),$e.length>0&&rr($e,Pe,Ie),ot.length>0&&rr(ot,Pe,Ie),Ze.length>0&&rr(Ze,Pe,Ie),pe.buffers.depth.setTest(!0),pe.buffers.depth.setMask(!0),pe.buffers.color.setMask(!0),pe.setPolygonOffset(!1)}function qr(ne,Pe,Ie){const Oe=J.isWebGL2;N===null&&(N=new dp(1,1,{generateMipmaps:!0,type:te.has("EXT_color_buffer_half_float")?Z_:up,minFilter:Tk,samples:Oe&&o===!0?4:0})),m.getDrawingBufferSize(D),Oe?N.setSize(D.x,D.y):N.setSize(xF(D.x),xF(D.y));const $e=m.getRenderTarget();m.setRenderTarget(N),m.clear();const ot=m.toneMapping;m.toneMapping=ru,rr(ne,Pe,Ie),m.toneMapping=ot,ve.updateMultisampleRenderTarget(N),ve.updateRenderTargetMipmap(N),m.setRenderTarget($e)}function rr(ne,Pe,Ie){const Oe=Pe.isScene===!0?Pe.overrideMaterial:null;for(let $e=0,ot=ne.length;$e0&&ve.useMultisampledRTT(ne)===!1?$e=re.get(ne).__webglMultisampledFramebuffer:$e=zt,S.copy(ne.viewport),O.copy(ne.scissor),C=ne.scissorTest}else S.copy(T).multiplyScalar(I).floor(),O.copy(L).multiplyScalar(I).floor(),C=z;if(pe.bindFramebuffer(36160,$e)&&J.drawBuffers&&Oe&&pe.drawBuffers(ne,$e),pe.viewport(S),pe.scissor(O),pe.setScissorTest(C),ot){const wt=re.get(ne.texture);K.framebufferTexture2D(36160,36064,34069+Pe,wt.__webglTexture,Ie)}else if(Ze){const wt=re.get(ne.texture),zt=Pe||0;K.framebufferTextureLayer(36160,36064,wt.__webglTexture,Ie||0,zt)}b=-1},this.readRenderTargetPixels=function(ne,Pe,Ie,Oe,$e,ot,Ze){if(!(ne&&ne.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let mt=re.get(ne).__webglFramebuffer;if(ne.isWebGLCubeRenderTarget&&Ze!==void 0&&(mt=mt[Ze]),mt){pe.bindFramebuffer(36160,mt);try{const wt=ne.texture,zt=wt.format,Pt=wt.type;if(zt!==$l&&V.convert(zt)!==K.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const st=Pt===Z_&&(te.has("EXT_color_buffer_half_float")||J.isWebGL2&&te.has("EXT_color_buffer_float"));if(Pt!==up&&V.convert(Pt)!==K.getParameter(35738)&&!(Pt===Of&&(J.isWebGL2||te.has("OES_texture_float")||te.has("WEBGL_color_buffer_float")))&&!st){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}Pe>=0&&Pe<=ne.width-Oe&&Ie>=0&&Ie<=ne.height-$e&&K.readPixels(Pe,Ie,Oe,$e,V.convert(zt),V.convert(Pt),ot)}finally{const wt=x!==null?re.get(x).__webglFramebuffer:null;pe.bindFramebuffer(36160,wt)}}},this.copyFramebufferToTexture=function(ne,Pe,Ie=0){const Oe=Math.pow(2,-Ie),$e=Math.floor(Pe.image.width*Oe),ot=Math.floor(Pe.image.height*Oe);ve.setTexture2D(Pe,0),K.copyTexSubImage2D(3553,Ie,0,0,ne.x,ne.y,$e,ot),pe.unbindTexture()},this.copyTextureToTexture=function(ne,Pe,Ie,Oe=0){const $e=Pe.image.width,ot=Pe.image.height,Ze=V.convert(Ie.format),mt=V.convert(Ie.type);ve.setTexture2D(Ie,0),K.pixelStorei(37440,Ie.flipY),K.pixelStorei(37441,Ie.premultiplyAlpha),K.pixelStorei(3317,Ie.unpackAlignment),Pe.isDataTexture?K.texSubImage2D(3553,Oe,ne.x,ne.y,$e,ot,Ze,mt,Pe.image.data):Pe.isCompressedTexture?K.compressedTexSubImage2D(3553,Oe,ne.x,ne.y,Pe.mipmaps[0].width,Pe.mipmaps[0].height,Ze,Pe.mipmaps[0].data):K.texSubImage2D(3553,Oe,ne.x,ne.y,Ze,mt,Pe.image),Oe===0&&Ie.generateMipmaps&&K.generateMipmap(3553),pe.unbindTexture()},this.copyTextureToTexture3D=function(ne,Pe,Ie,Oe,$e=0){if(m.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const ot=ne.max.x-ne.min.x+1,Ze=ne.max.y-ne.min.y+1,mt=ne.max.z-ne.min.z+1,wt=V.convert(Oe.format),zt=V.convert(Oe.type);let Pt;if(Oe.isData3DTexture)ve.setTexture3D(Oe,0),Pt=32879;else if(Oe.isDataArrayTexture)ve.setTexture2DArray(Oe,0),Pt=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}K.pixelStorei(37440,Oe.flipY),K.pixelStorei(37441,Oe.premultiplyAlpha),K.pixelStorei(3317,Oe.unpackAlignment);const st=K.getParameter(3314),Qt=K.getParameter(32878),Pd=K.getParameter(3316),zp=K.getParameter(3315),Up=K.getParameter(32877),il=Ie.isCompressedTexture?Ie.mipmaps[0]:Ie.image;K.pixelStorei(3314,il.width),K.pixelStorei(32878,il.height),K.pixelStorei(3316,ne.min.x),K.pixelStorei(3315,ne.min.y),K.pixelStorei(32877,ne.min.z),Ie.isDataTexture||Ie.isData3DTexture?K.texSubImage3D(Pt,$e,Pe.x,Pe.y,Pe.z,ot,Ze,mt,wt,zt,il.data):Ie.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),K.compressedTexSubImage3D(Pt,$e,Pe.x,Pe.y,Pe.z,ot,Ze,mt,wt,il.data)):K.texSubImage3D(Pt,$e,Pe.x,Pe.y,Pe.z,ot,Ze,mt,wt,zt,il),K.pixelStorei(3314,st),K.pixelStorei(32878,Qt),K.pixelStorei(3316,Pd),K.pixelStorei(3315,zp),K.pixelStorei(32877,Up),$e===0&&Oe.generateMipmaps&&K.generateMipmap(Pt),pe.unbindTexture()},this.initTexture=function(ne){ne.isCubeTexture?ve.setTextureCube(ne,0):ne.isData3DTexture?ve.setTexture3D(ne,0):ne.isDataArrayTexture?ve.setTexture2DArray(ne,0):ve.setTexture2D(ne,0),pe.unbindTexture()},this.resetState=function(){v=0,y=0,x=null,pe.reset(),de.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class HWt extends Hye{}HWt.prototype.isWebGL1Renderer=!0;class qWt extends Bo{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,n){return super.copy(e,n),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const n=super.toJSON(e);return this.fog!==null&&(n.object.fog=this.fog.toJSON()),n}get autoUpdate(){return console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate}set autoUpdate(e){console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate=e}}class qye extends kw{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new sr(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const fJ=new Se,dJ=new Se,hJ=new Gn,hD=new Rye,QO=new Ek;class XWt extends Bo{constructor(e=new Ou,n=new qye){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=n,this.updateMorphTargets()}copy(e,n){return super.copy(e,n),this.material=e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.attributes.position,r=[0];for(let i=1,o=n.count;il)continue;d.applyMatrix4(this.matrixWorld);const C=e.ray.origin.distanceTo(d);Ce.far||n.push({distance:C,point:f.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}else{const v=Math.max(0,a.start),y=Math.min(g.count,a.start+a.count);for(let x=v,b=y-1;xl)continue;d.applyMatrix4(this.matrixWorld);const S=e.ray.origin.distanceTo(d);Se.far||n.push({distance:S,point:f.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const n=this.geometry.morphAttributes,r=Object.keys(n);if(r.length>0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,a=i.length;o{n&&n(o),this.manager.itemEnd(e)},0),o;if(_c[e]!==void 0){_c[e].push({onLoad:n,onProgress:r,onError:i});return}_c[e]=[],_c[e].push({onLoad:n,onProgress:r,onError:i});const a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),s=this.mimeType,l=this.responseType;fetch(a).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=_c[e],f=c.body.getReader(),d=c.headers.get("Content-Length"),h=d?parseInt(d):0,p=h!==0;let m=0;const g=new ReadableStream({start(v){y();function y(){f.read().then(({done:x,value:b})=>{if(x)v.close();else{m+=b.byteLength;const _=new ProgressEvent("progress",{lengthComputable:p,loaded:m,total:h});for(let S=0,O=u.length;S{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,s));case"json":return c.json();default:if(s===void 0)return c.text();{const f=/charset="?([^;"\s]*)"?/i.exec(s),d=f&&f[1]?f[1].toLowerCase():void 0,h=new TextDecoder(d);return c.arrayBuffer().then(p=>h.decode(p))}}}).then(c=>{EP.add(e,c);const u=_c[e];delete _c[e];for(let f=0,d=u.length;f{const u=_c[e];if(u===void 0)throw this.manager.itemError(e),c;delete _c[e];for(let f=0,d=u.length;f{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class eVt extends kk{constructor(e){super(e)}load(e,n,r,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,a=EP.get(e);if(a!==void 0)return o.manager.itemStart(e),setTimeout(function(){n&&n(a),o.manager.itemEnd(e)},0),a;const s=J_("img");function l(){u(),EP.add(e,this),n&&n(this),o.manager.itemEnd(e)}function c(f){u(),i&&i(f),o.manager.itemError(e),o.manager.itemEnd(e)}function u(){s.removeEventListener("load",l,!1),s.removeEventListener("error",c,!1)}return s.addEventListener("load",l,!1),s.addEventListener("error",c,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(s.crossOrigin=this.crossOrigin),o.manager.itemStart(e),s.src=e,s}}class tVt extends kk{constructor(e){super(e)}load(e,n,r,i){const o=new Ta,a=new eVt(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(s){o.image=s,o.needsUpdate=!0,n!==void 0&&n(o)},r,i),o}}class gJ{constructor(e=1,n=0,r=0){return this.radius=e,this.phi=n,this.theta=r,this}set(e,n,r){return this.radius=e,this.phi=n,this.theta=r,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,n,r){return this.radius=Math.sqrt(e*e+n*n+r*r),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,r),this.phi=Math.acos(Po(n/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}const YO=new Gy;class nVt extends QWt{constructor(e,n=16776960){const r=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Float32Array(8*3),o=new Ou;o.setIndex(new os(r,1)),o.setAttribute("position",new os(i,3)),super(o,new qye({color:n,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(e){if(e!==void 0&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),this.object!==void 0&&YO.setFromObject(this.object),YO.isEmpty())return;const n=YO.min,r=YO.max,i=this.geometry.attributes.position,o=i.array;o[0]=r.x,o[1]=r.y,o[2]=r.z,o[3]=n.x,o[4]=r.y,o[5]=r.z,o[6]=n.x,o[7]=n.y,o[8]=r.z,o[9]=r.x,o[10]=n.y,o[11]=r.z,o[12]=r.x,o[13]=r.y,o[14]=n.z,o[15]=n.x,o[16]=r.y,o[17]=n.z,o[18]=n.x,o[19]=n.y,o[20]=n.z,o[21]=r.x,o[22]=n.y,o[23]=n.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e,n){return super.copy(e,n),this.object=e.object,this}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:c6}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=c6);const vJ={type:"change"},pD={type:"start"},yJ={type:"end"};class rVt extends jp{constructor(e,n){super(),this.object=e,this.domElement=n,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new Se,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:um.ROTATE,MIDDLE:um.DOLLY,RIGHT:um.PAN},this.touches={ONE:fm.ROTATE,TWO:fm.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return s.phi},this.getAzimuthalAngle=function(){return s.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(V){V.addEventListener("keydown",ye),this._domElementKeyEvents=V},this.saveState=function(){r.target0.copy(r.target),r.position0.copy(r.object.position),r.zoom0=r.object.zoom},this.reset=function(){r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.zoom=r.zoom0,r.object.updateProjectionMatrix(),r.dispatchEvent(vJ),r.update(),o=i.NONE},this.update=function(){const V=new Se,de=new hp().setFromUnitVectors(e.up,new Se(0,1,0)),xe=de.clone().invert(),Me=new Se,me=new hp,Ne=2*Math.PI;return function(){const Re=r.object.position;V.copy(Re).sub(r.target),V.applyQuaternion(de),s.setFromVector3(V),r.autoRotate&&o===i.NONE&&E(O()),r.enableDamping?(s.theta+=l.theta*r.dampingFactor,s.phi+=l.phi*r.dampingFactor):(s.theta+=l.theta,s.phi+=l.phi);let ae=r.minAzimuthAngle,Le=r.maxAzimuthAngle;return isFinite(ae)&&isFinite(Le)&&(ae<-Math.PI?ae+=Ne:ae>Math.PI&&(ae-=Ne),Le<-Math.PI?Le+=Ne:Le>Math.PI&&(Le-=Ne),ae<=Le?s.theta=Math.max(ae,Math.min(Le,s.theta)):s.theta=s.theta>(ae+Le)/2?Math.max(ae,s.theta):Math.min(Le,s.theta)),s.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,s.phi)),s.makeSafe(),s.radius*=c,s.radius=Math.max(r.minDistance,Math.min(r.maxDistance,s.radius)),r.enableDamping===!0?r.target.addScaledVector(u,r.dampingFactor):r.target.add(u),V.setFromSpherical(s),V.applyQuaternion(xe),Re.copy(r.target).add(V),r.object.lookAt(r.target),r.enableDamping===!0?(l.theta*=1-r.dampingFactor,l.phi*=1-r.dampingFactor,u.multiplyScalar(1-r.dampingFactor)):(l.set(0,0,0),u.set(0,0,0)),c=1,f||Me.distanceToSquared(r.object.position)>a||8*(1-me.dot(r.object.quaternion))>a?(r.dispatchEvent(vJ),Me.copy(r.object.position),me.copy(r.object.quaternion),f=!1,!0):!1}}(),this.dispose=function(){r.domElement.removeEventListener("contextmenu",ie),r.domElement.removeEventListener("pointerdown",F),r.domElement.removeEventListener("pointercancel",Q),r.domElement.removeEventListener("wheel",ge),r.domElement.removeEventListener("pointermove",ce),r.domElement.removeEventListener("pointerup",le),r._domElementKeyEvents!==null&&r._domElementKeyEvents.removeEventListener("keydown",ye)};const r=this,i={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let o=i.NONE;const a=1e-6,s=new gJ,l=new gJ;let c=1;const u=new Se;let f=!1;const d=new Ht,h=new Ht,p=new Ht,m=new Ht,g=new Ht,v=new Ht,y=new Ht,x=new Ht,b=new Ht,_=[],S={};function O(){return 2*Math.PI/60/60*r.autoRotateSpeed}function C(){return Math.pow(.95,r.zoomSpeed)}function E(V){l.theta-=V}function k(V){l.phi-=V}const I=function(){const V=new Se;return function(xe,Me){V.setFromMatrixColumn(Me,0),V.multiplyScalar(-xe),u.add(V)}}(),P=function(){const V=new Se;return function(xe,Me){r.screenSpacePanning===!0?V.setFromMatrixColumn(Me,1):(V.setFromMatrixColumn(Me,0),V.crossVectors(r.object.up,V)),V.multiplyScalar(xe),u.add(V)}}(),R=function(){const V=new Se;return function(xe,Me){const me=r.domElement;if(r.object.isPerspectiveCamera){const Ne=r.object.position;V.copy(Ne).sub(r.target);let Ce=V.length();Ce*=Math.tan(r.object.fov/2*Math.PI/180),I(2*xe*Ce/me.clientHeight,r.object.matrix),P(2*Me*Ce/me.clientHeight,r.object.matrix)}else r.object.isOrthographicCamera?(I(xe*(r.object.right-r.object.left)/r.object.zoom/me.clientWidth,r.object.matrix),P(Me*(r.object.top-r.object.bottom)/r.object.zoom/me.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}}();function T(V){r.object.isPerspectiveCamera?c/=V:r.object.isOrthographicCamera?(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom*V)),r.object.updateProjectionMatrix(),f=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function L(V){r.object.isPerspectiveCamera?c*=V:r.object.isOrthographicCamera?(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/V)),r.object.updateProjectionMatrix(),f=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function z(V){d.set(V.clientX,V.clientY)}function B(V){y.set(V.clientX,V.clientY)}function W(V){m.set(V.clientX,V.clientY)}function U(V){h.set(V.clientX,V.clientY),p.subVectors(h,d).multiplyScalar(r.rotateSpeed);const de=r.domElement;E(2*Math.PI*p.x/de.clientHeight),k(2*Math.PI*p.y/de.clientHeight),d.copy(h),r.update()}function N(V){x.set(V.clientX,V.clientY),b.subVectors(x,y),b.y>0?T(C()):b.y<0&&L(C()),y.copy(x),r.update()}function $(V){g.set(V.clientX,V.clientY),v.subVectors(g,m).multiplyScalar(r.panSpeed),R(v.x,v.y),m.copy(g),r.update()}function D(V){V.deltaY<0?L(C()):V.deltaY>0&&T(C()),r.update()}function A(V){let de=!1;switch(V.code){case r.keys.UP:R(0,r.keyPanSpeed),de=!0;break;case r.keys.BOTTOM:R(0,-r.keyPanSpeed),de=!0;break;case r.keys.LEFT:R(r.keyPanSpeed,0),de=!0;break;case r.keys.RIGHT:R(-r.keyPanSpeed,0),de=!0;break}de&&(V.preventDefault(),r.update())}function q(){if(_.length===1)d.set(_[0].pageX,_[0].pageY);else{const V=.5*(_[0].pageX+_[1].pageX),de=.5*(_[0].pageY+_[1].pageY);d.set(V,de)}}function Y(){if(_.length===1)m.set(_[0].pageX,_[0].pageY);else{const V=.5*(_[0].pageX+_[1].pageX),de=.5*(_[0].pageY+_[1].pageY);m.set(V,de)}}function K(){const V=_[0].pageX-_[1].pageX,de=_[0].pageY-_[1].pageY,xe=Math.sqrt(V*V+de*de);y.set(0,xe)}function se(){r.enableZoom&&K(),r.enablePan&&Y()}function te(){r.enableZoom&&K(),r.enableRotate&&q()}function J(V){if(_.length===1)h.set(V.pageX,V.pageY);else{const xe=Z(V),Me=.5*(V.pageX+xe.x),me=.5*(V.pageY+xe.y);h.set(Me,me)}p.subVectors(h,d).multiplyScalar(r.rotateSpeed);const de=r.domElement;E(2*Math.PI*p.x/de.clientHeight),k(2*Math.PI*p.y/de.clientHeight),d.copy(h)}function pe(V){if(_.length===1)g.set(V.pageX,V.pageY);else{const de=Z(V),xe=.5*(V.pageX+de.x),Me=.5*(V.pageY+de.y);g.set(xe,Me)}v.subVectors(g,m).multiplyScalar(r.panSpeed),R(v.x,v.y),m.copy(g)}function be(V){const de=Z(V),xe=V.pageX-de.x,Me=V.pageY-de.y,me=Math.sqrt(xe*xe+Me*Me);x.set(0,me),b.set(0,Math.pow(x.y/y.y,r.zoomSpeed)),T(b.y),y.copy(x)}function re(V){r.enableZoom&&be(V),r.enablePan&&pe(V)}function ve(V){r.enableZoom&&be(V),r.enableRotate&&J(V)}function F(V){r.enabled!==!1&&(_.length===0&&(r.domElement.setPointerCapture(V.pointerId),r.domElement.addEventListener("pointermove",ce),r.domElement.addEventListener("pointerup",le)),he(V),V.pointerType==="touch"?H(V):X(V))}function ce(V){r.enabled!==!1&&(V.pointerType==="touch"?G(V):ee(V))}function le(V){_e(V),_.length===0&&(r.domElement.releasePointerCapture(V.pointerId),r.domElement.removeEventListener("pointermove",ce),r.domElement.removeEventListener("pointerup",le)),r.dispatchEvent(yJ),o=i.NONE}function Q(V){_e(V)}function X(V){let de;switch(V.button){case 0:de=r.mouseButtons.LEFT;break;case 1:de=r.mouseButtons.MIDDLE;break;case 2:de=r.mouseButtons.RIGHT;break;default:de=-1}switch(de){case um.DOLLY:if(r.enableZoom===!1)return;B(V),o=i.DOLLY;break;case um.ROTATE:if(V.ctrlKey||V.metaKey||V.shiftKey){if(r.enablePan===!1)return;W(V),o=i.PAN}else{if(r.enableRotate===!1)return;z(V),o=i.ROTATE}break;case um.PAN:if(V.ctrlKey||V.metaKey||V.shiftKey){if(r.enableRotate===!1)return;z(V),o=i.ROTATE}else{if(r.enablePan===!1)return;W(V),o=i.PAN}break;default:o=i.NONE}o!==i.NONE&&r.dispatchEvent(pD)}function ee(V){switch(o){case i.ROTATE:if(r.enableRotate===!1)return;U(V);break;case i.DOLLY:if(r.enableZoom===!1)return;N(V);break;case i.PAN:if(r.enablePan===!1)return;$(V);break}}function ge(V){r.enabled===!1||r.enableZoom===!1||o!==i.NONE||(V.preventDefault(),r.dispatchEvent(pD),D(V),r.dispatchEvent(yJ))}function ye(V){r.enabled===!1||r.enablePan===!1||A(V)}function H(V){switch(oe(V),_.length){case 1:switch(r.touches.ONE){case fm.ROTATE:if(r.enableRotate===!1)return;q(),o=i.TOUCH_ROTATE;break;case fm.PAN:if(r.enablePan===!1)return;Y(),o=i.TOUCH_PAN;break;default:o=i.NONE}break;case 2:switch(r.touches.TWO){case fm.DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;se(),o=i.TOUCH_DOLLY_PAN;break;case fm.DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;te(),o=i.TOUCH_DOLLY_ROTATE;break;default:o=i.NONE}break;default:o=i.NONE}o!==i.NONE&&r.dispatchEvent(pD)}function G(V){switch(oe(V),o){case i.TOUCH_ROTATE:if(r.enableRotate===!1)return;J(V),r.update();break;case i.TOUCH_PAN:if(r.enablePan===!1)return;pe(V),r.update();break;case i.TOUCH_DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;re(V),r.update();break;case i.TOUCH_DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;ve(V),r.update();break;default:o=i.NONE}}function ie(V){r.enabled!==!1&&V.preventDefault()}function he(V){_.push(V)}function _e(V){delete S[V.pointerId];for(let de=0;de<_.length;de++)if(_[de].pointerId===V.pointerId){_.splice(de,1);return}}function oe(V){let de=S[V.pointerId];de===void 0&&(de=new Ht,S[V.pointerId]=de),de.set(V.pageX,V.pageY)}function Z(V){const de=V.pointerId===_[0].pointerId?_[1]:_[0];return S[de.pointerId]}r.domElement.addEventListener("contextmenu",ie),r.domElement.addEventListener("pointerdown",F),r.domElement.addEventListener("pointercancel",Q),r.domElement.addEventListener("wheel",ge,{passive:!1}),this.update()}}const iVt={uniforms:{u_size:{value:new Se(1,1,1)},u_renderstyle:{value:0},u_renderthreshold:{value:.5},u_clim:{value:new Ht(0,1)},u_data:{value:null},u_cmdata:{value:null}},vertexShader:` +}`;function NWt(t,e,n){let r=new Bye;const i=new Ht,o=new Ht,a=new Ri,s=new IWt({depthPacking:QBt}),l=new DWt,c={},u=n.maxTextureSize,f={0:_a,1:Av,2:qc},d=new od({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ht},radius:{value:4}},vertexShader:LWt,fragmentShader:$Wt}),h=d.clone();h.defines.HORIZONTAL_PASS=1;const p=new Ou;p.setAttribute("position",new os(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const m=new Nl(p,d),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=bye,this.render=function(b,_,S){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||b.length===0)return;const O=t.getRenderTarget(),C=t.getActiveCubeFace(),E=t.getActiveMipmapLevel(),k=t.state;k.setBlending(Uf),k.buffers.color.setClear(1,1,1,1),k.buffers.depth.setTest(!0),k.setScissorTest(!1);for(let I=0,P=b.length;Iu||i.y>u)&&(i.x>u&&(o.x=Math.floor(u/L.x),i.x=o.x*L.x,T.mapSize.x=o.x),i.y>u&&(o.y=Math.floor(u/L.y),i.y=o.y*L.y,T.mapSize.y=o.y)),T.map===null){const B=this.type!==yx?{minFilter:To,magFilter:To}:{};T.map=new dp(i.x,i.y,B),T.map.texture.name=R.name+".shadowMap",T.camera.updateProjectionMatrix()}t.setRenderTarget(T.map),t.clear();const z=T.getViewportCount();for(let B=0;B0){const P=k.uuid,R=_.uuid;let T=c[P];T===void 0&&(T={},c[P]=T);let L=T[R];L===void 0&&(L=k.clone(),T[R]=L),k=L}return k.visible=_.visible,k.wireframe=_.wireframe,E===yx?k.side=_.shadowSide!==null?_.shadowSide:_.side:k.side=_.shadowSide!==null?_.shadowSide:f[_.side],k.alphaMap=_.alphaMap,k.alphaTest=_.alphaTest,k.clipShadows=_.clipShadows,k.clippingPlanes=_.clippingPlanes,k.clipIntersection=_.clipIntersection,k.displacementMap=_.displacementMap,k.displacementScale=_.displacementScale,k.displacementBias=_.displacementBias,k.wireframeLinewidth=_.wireframeLinewidth,k.linewidth=_.linewidth,S.isPointLight===!0&&k.isMeshDistanceMaterial===!0&&(k.referencePosition.setFromMatrixPosition(S.matrixWorld),k.nearDistance=O,k.farDistance=C),k}function x(b,_,S,O,C){if(b.visible===!1)return;if(b.layers.test(_.layers)&&(b.isMesh||b.isLine||b.isPoints)&&(b.castShadow||b.receiveShadow&&C===yx)&&(!b.frustumCulled||r.intersectsObject(b))){b.modelViewMatrix.multiplyMatrices(S.matrixWorldInverse,b.matrixWorld);const I=e.update(b),P=b.material;if(Array.isArray(P)){const R=I.groups;for(let T=0,L=R.length;T=1):W.indexOf("OpenGL ES")!==-1&&(B=parseFloat(/^OpenGL ES (\d)/.exec(W)[1]),z=B>=2);let U=null,N={};const $=t.getParameter(3088),D=t.getParameter(2978),A=new Ri().fromArray($),q=new Ri().fromArray(D);function Y(ae,Le,Ee){const ze=new Uint8Array(4),He=t.createTexture();t.bindTexture(ae,He),t.texParameteri(ae,10241,9728),t.texParameteri(ae,10240,9728);for(let xt=0;xthe||H.height>he)&&(_e=he/Math.max(H.width,H.height)),_e<1||G===!0)if(typeof HTMLImageElement<"u"&&H instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&H instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&H instanceof ImageBitmap){const oe=G?bF:Math.floor,Z=oe(_e*H.width),V=oe(_e*H.height);m===void 0&&(m=y(Z,V));const de=ie?y(Z,V):m;return de.width=Z,de.height=V,de.getContext("2d").drawImage(H,0,0,Z,V),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+H.width+"x"+H.height+") to ("+Z+"x"+V+")."),de}else return"data"in H&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+H.width+"x"+H.height+")."),H;return H}function b(H){return IZ(H.width)&&IZ(H.height)}function _(H){return s?!1:H.wrapS!==Ha||H.wrapT!==Ha||H.minFilter!==To&&H.minFilter!==Eo}function S(H,G){return H.generateMipmaps&&G&&H.minFilter!==To&&H.minFilter!==Eo}function O(H){t.generateMipmap(H)}function C(H,G,ie,he,_e=!1){if(s===!1)return G;if(H!==null){if(t[H]!==void 0)return t[H];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+H+"'")}let oe=G;return G===6403&&(ie===5126&&(oe=33326),ie===5131&&(oe=33325),ie===5121&&(oe=33321)),G===33319&&(ie===5126&&(oe=33328),ie===5131&&(oe=33327),ie===5121&&(oe=33323)),G===6408&&(ie===5126&&(oe=34836),ie===5131&&(oe=34842),ie===5121&&(oe=he===vr&&_e===!1?35907:32856),ie===32819&&(oe=32854),ie===32820&&(oe=32855)),(oe===33325||oe===33326||oe===33327||oe===33328||oe===34842||oe===34836)&&e.get("EXT_color_buffer_float"),oe}function E(H,G,ie){return S(H,ie)===!0||H.isFramebufferTexture&&H.minFilter!==To&&H.minFilter!==Eo?Math.log2(Math.max(G.width,G.height))+1:H.mipmaps!==void 0&&H.mipmaps.length>0?H.mipmaps.length:H.isCompressedTexture&&Array.isArray(H.image)?G.mipmaps.length:1}function k(H){return H===To||H===sZ||H===lZ?9728:9729}function I(H){const G=H.target;G.removeEventListener("dispose",I),R(G),G.isVideoTexture&&p.delete(G)}function P(H){const G=H.target;G.removeEventListener("dispose",P),L(G)}function R(H){const G=r.get(H);if(G.__webglInit===void 0)return;const ie=H.source,he=g.get(ie);if(he){const _e=he[G.__cacheKey];_e.usedTimes--,_e.usedTimes===0&&T(H),Object.keys(he).length===0&&g.delete(ie)}r.remove(H)}function T(H){const G=r.get(H);t.deleteTexture(G.__webglTexture);const ie=H.source,he=g.get(ie);delete he[G.__cacheKey],a.memory.textures--}function L(H){const G=H.texture,ie=r.get(H),he=r.get(G);if(he.__webglTexture!==void 0&&(t.deleteTexture(he.__webglTexture),a.memory.textures--),H.depthTexture&&H.depthTexture.dispose(),H.isWebGLCubeRenderTarget)for(let _e=0;_e<6;_e++)t.deleteFramebuffer(ie.__webglFramebuffer[_e]),ie.__webglDepthbuffer&&t.deleteRenderbuffer(ie.__webglDepthbuffer[_e]);else{if(t.deleteFramebuffer(ie.__webglFramebuffer),ie.__webglDepthbuffer&&t.deleteRenderbuffer(ie.__webglDepthbuffer),ie.__webglMultisampledFramebuffer&&t.deleteFramebuffer(ie.__webglMultisampledFramebuffer),ie.__webglColorRenderbuffer)for(let _e=0;_e=l&&console.warn("THREE.WebGLTextures: Trying to use "+H+" texture units while this GPU supports only "+l),z+=1,H}function U(H){const G=[];return G.push(H.wrapS),G.push(H.wrapT),G.push(H.magFilter),G.push(H.minFilter),G.push(H.anisotropy),G.push(H.internalFormat),G.push(H.format),G.push(H.type),G.push(H.generateMipmaps),G.push(H.premultiplyAlpha),G.push(H.flipY),G.push(H.unpackAlignment),G.push(H.encoding),G.join()}function N(H,G){const ie=r.get(H);if(H.isVideoTexture&&ge(H),H.isRenderTargetTexture===!1&&H.version>0&&ie.__version!==H.version){const he=H.image;if(he===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(he.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{te(ie,H,G);return}}n.activeTexture(33984+G),n.bindTexture(3553,ie.__webglTexture)}function $(H,G){const ie=r.get(H);if(H.version>0&&ie.__version!==H.version){te(ie,H,G);return}n.activeTexture(33984+G),n.bindTexture(35866,ie.__webglTexture)}function D(H,G){const ie=r.get(H);if(H.version>0&&ie.__version!==H.version){te(ie,H,G);return}n.activeTexture(33984+G),n.bindTexture(32879,ie.__webglTexture)}function A(H,G){const ie=r.get(H);if(H.version>0&&ie.__version!==H.version){J(ie,H,G);return}n.activeTexture(33984+G),n.bindTexture(34067,ie.__webglTexture)}const q={[vF]:10497,[Ha]:33071,[yF]:33648},Y={[To]:9728,[sZ]:9984,[lZ]:9986,[Eo]:9729,[IBt]:9985,[Tk]:9987};function K(H,G,ie){if(ie?(t.texParameteri(H,10242,q[G.wrapS]),t.texParameteri(H,10243,q[G.wrapT]),(H===32879||H===35866)&&t.texParameteri(H,32882,q[G.wrapR]),t.texParameteri(H,10240,Y[G.magFilter]),t.texParameteri(H,10241,Y[G.minFilter])):(t.texParameteri(H,10242,33071),t.texParameteri(H,10243,33071),(H===32879||H===35866)&&t.texParameteri(H,32882,33071),(G.wrapS!==Ha||G.wrapT!==Ha)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(H,10240,k(G.magFilter)),t.texParameteri(H,10241,k(G.minFilter)),G.minFilter!==To&&G.minFilter!==Eo&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){const he=e.get("EXT_texture_filter_anisotropic");if(G.type===Of&&e.has("OES_texture_float_linear")===!1||s===!1&&G.type===Z_&&e.has("OES_texture_half_float_linear")===!1)return;(G.anisotropy>1||r.get(G).__currentAnisotropy)&&(t.texParameterf(H,he.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(G.anisotropy,i.getMaxAnisotropy())),r.get(G).__currentAnisotropy=G.anisotropy)}}function se(H,G){let ie=!1;H.__webglInit===void 0&&(H.__webglInit=!0,G.addEventListener("dispose",I));const he=G.source;let _e=g.get(he);_e===void 0&&(_e={},g.set(he,_e));const oe=U(G);if(oe!==H.__cacheKey){_e[oe]===void 0&&(_e[oe]={texture:t.createTexture(),usedTimes:0},a.memory.textures++,ie=!0),_e[oe].usedTimes++;const Z=_e[H.__cacheKey];Z!==void 0&&(_e[H.__cacheKey].usedTimes--,Z.usedTimes===0&&T(G)),H.__cacheKey=oe,H.__webglTexture=_e[oe].texture}return ie}function te(H,G,ie){let he=3553;G.isDataArrayTexture&&(he=35866),G.isData3DTexture&&(he=32879);const _e=se(H,G),oe=G.source;if(n.activeTexture(33984+ie),n.bindTexture(he,H.__webglTexture),oe.version!==oe.__currentVersion||_e===!0){t.pixelStorei(37440,G.flipY),t.pixelStorei(37441,G.premultiplyAlpha),t.pixelStorei(3317,G.unpackAlignment),t.pixelStorei(37443,0);const Z=_(G)&&b(G.image)===!1;let V=x(G.image,Z,!1,u);V=ye(G,V);const de=b(V)||s,xe=o.convert(G.format,G.encoding);let Me=o.convert(G.type),me=C(G.internalFormat,xe,Me,G.encoding,G.isVideoTexture);K(he,G,de);let Ne;const Ce=G.mipmaps,Re=s&&G.isVideoTexture!==!0,ae=oe.__currentVersion===void 0||_e===!0,Le=E(G,V,de);if(G.isDepthTexture)me=6402,s?G.type===Of?me=36012:G.type===Oh?me=33190:G.type===$g?me=35056:me=33189:G.type===Of&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),G.format===Bh&&me===6402&&G.type!==Cye&&G.type!==Oh&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),G.type=Oh,Me=o.convert(G.type)),G.format===Dv&&me===6402&&(me=34041,G.type!==$g&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),G.type=$g,Me=o.convert(G.type))),ae&&(Re?n.texStorage2D(3553,1,me,V.width,V.height):n.texImage2D(3553,0,me,V.width,V.height,0,xe,Me,null));else if(G.isDataTexture)if(Ce.length>0&&de){Re&&ae&&n.texStorage2D(3553,Le,me,Ce[0].width,Ce[0].height);for(let Ee=0,ze=Ce.length;Ee>=1,ze>>=1}}else if(Ce.length>0&&de){Re&&ae&&n.texStorage2D(3553,Le,me,Ce[0].width,Ce[0].height);for(let Ee=0,ze=Ce.length;Ee0&&ae++,n.texStorage2D(34067,ae,Ne,V[0].width,V[0].height));for(let Ee=0;Ee<6;Ee++)if(Z){Ce?n.texSubImage2D(34069+Ee,0,0,0,V[Ee].width,V[Ee].height,Me,me,V[Ee].data):n.texImage2D(34069+Ee,0,Ne,V[Ee].width,V[Ee].height,0,Me,me,V[Ee].data);for(let ze=0;ze0&&ee(H)===!1){const V=oe?G:[G];ie.__webglMultisampledFramebuffer=t.createFramebuffer(),ie.__webglColorRenderbuffer=[],n.bindFramebuffer(36160,ie.__webglMultisampledFramebuffer);for(let de=0;de0&&ee(H)===!1){const G=H.isWebGLMultipleRenderTargets?H.texture:[H.texture],ie=H.width,he=H.height;let _e=16384;const oe=[],Z=H.stencilBuffer?33306:36096,V=r.get(H),de=H.isWebGLMultipleRenderTargets===!0;if(de)for(let xe=0;xe0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&G.__useRenderToTexture!==!1}function ge(H){const G=a.render.frame;p.get(H)!==G&&(p.set(H,G),H.update())}function ye(H,G){const ie=H.encoding,he=H.format,_e=H.type;return H.isCompressedTexture===!0||H.isVideoTexture===!0||H.format===xF||ie!==fp&&(ie===vr?s===!1?e.has("EXT_sRGB")===!0&&he===$l?(H.format=xF,H.minFilter=Eo,H.generateMipmaps=!1):G=Mye.sRGBToLinear(G):(he!==$l||_e!==up)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",ie)),G}this.allocateTextureUnit=W,this.resetTextureUnits=B,this.setTexture2D=N,this.setTexture2DArray=$,this.setTexture3D=D,this.setTextureCube=A,this.rebindTextures=F,this.setupRenderTarget=ce,this.updateRenderTargetMipmap=le,this.updateMultisampleRenderTarget=Q,this.setupDepthRenderbuffer=ve,this.setupFrameBufferTexture=pe,this.useMultisampledRTT=ee}function BWt(t,e,n){const r=n.isWebGL2;function i(o,a=null){let s;if(o===up)return 5121;if(o===NBt)return 32819;if(o===FBt)return 32820;if(o===DBt)return 5120;if(o===LBt)return 5122;if(o===Cye)return 5123;if(o===$Bt)return 5124;if(o===Oh)return 5125;if(o===Of)return 5126;if(o===Z_)return r?5131:(s=e.get("OES_texture_half_float"),s!==null?s.HALF_FLOAT_OES:null);if(o===jBt)return 6406;if(o===$l)return 6408;if(o===zBt)return 6409;if(o===UBt)return 6410;if(o===Bh)return 6402;if(o===Dv)return 34041;if(o===Tye)return 6403;if(o===BBt)return console.warn("THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228"),6408;if(o===xF)return s=e.get("EXT_sRGB"),s!==null?s.SRGB_ALPHA_EXT:null;if(o===WBt)return 36244;if(o===VBt)return 33319;if(o===GBt)return 33320;if(o===HBt)return 36249;if(o===$I||o===NI||o===FI||o===jI)if(a===vr)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(o===$I)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(o===NI)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(o===FI)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(o===jI)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(o===$I)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(o===NI)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(o===FI)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(o===jI)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(o===cZ||o===uZ||o===fZ||o===dZ)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(o===cZ)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(o===uZ)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(o===fZ)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(o===dZ)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(o===qBt)return s=e.get("WEBGL_compressed_texture_etc1"),s!==null?s.COMPRESSED_RGB_ETC1_WEBGL:null;if(o===hZ||o===pZ)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(o===hZ)return a===vr?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(o===pZ)return a===vr?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(o===mZ||o===gZ||o===vZ||o===yZ||o===xZ||o===bZ||o===_Z||o===wZ||o===SZ||o===OZ||o===CZ||o===TZ||o===EZ||o===PZ)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(o===mZ)return a===vr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(o===gZ)return a===vr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(o===vZ)return a===vr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(o===yZ)return a===vr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(o===xZ)return a===vr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(o===bZ)return a===vr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(o===_Z)return a===vr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(o===wZ)return a===vr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(o===SZ)return a===vr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(o===OZ)return a===vr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(o===CZ)return a===vr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(o===TZ)return a===vr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(o===EZ)return a===vr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(o===PZ)return a===vr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(o===MZ)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(o===MZ)return a===vr?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;return o===$g?r?34042:(s=e.get("WEBGL_depth_texture"),s!==null?s.UNSIGNED_INT_24_8_WEBGL:null):t[o]!==void 0?t[o]:null}return{convert:i}}class zWt extends js{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class XO extends Bo{constructor(){super(),this.isGroup=!0,this.type="Group"}}const UWt={type:"move"};class hD{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new XO,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new XO,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Se,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Se),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new XO,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Se,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Se),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,n,r){let i=null,o=null,a=null;const s=this._targetRay,l=this._grip,c=this._hand;if(e&&n.session.visibilityState!=="visible-blurred"){if(c&&e.hand){a=!0;for(const m of e.hand.values()){const g=n.getJointPose(m,r);if(c.joints[m.jointName]===void 0){const y=new XO;y.matrixAutoUpdate=!1,y.visible=!1,c.joints[m.jointName]=y,c.add(y)}const v=c.joints[m.jointName];g!==null&&(v.matrix.fromArray(g.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.jointRadius=g.radius),v.visible=g!==null}const u=c.joints["index-finger-tip"],f=c.joints["thumb-tip"],d=u.position.distanceTo(f.position),h=.02,p=.005;c.inputState.pinching&&d>h+p?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&d<=h-p&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(o=n.getPose(e.gripSpace,r),o!==null&&(l.matrix.fromArray(o.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),o.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(o.linearVelocity)):l.hasLinearVelocity=!1,o.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(o.angularVelocity)):l.hasAngularVelocity=!1));s!==null&&(i=n.getPose(e.targetRaySpace,r),i===null&&o!==null&&(i=o),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(UWt)))}return s!==null&&(s.visible=i!==null),l!==null&&(l.visible=o!==null),c!==null&&(c.visible=a!==null),this}}class WWt extends Ta{constructor(e,n,r,i,o,a,s,l,c,u){if(u=u!==void 0?u:Bh,u!==Bh&&u!==Dv)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");r===void 0&&u===Bh&&(r=Oh),r===void 0&&u===Dv&&(r=$g),super(null,i,o,a,s,l,u,r,c),this.isDepthTexture=!0,this.image={width:e,height:n},this.magFilter=s!==void 0?s:To,this.minFilter=l!==void 0?l:To,this.flipY=!1,this.generateMipmaps=!1}}class VWt extends jp{constructor(e,n){super();const r=this;let i=null,o=1,a=null,s="local-floor",l=null,c=null,u=null,f=null,d=null,h=null;const p=n.getContextAttributes();let m=null,g=null;const v=[],y=[],x=new js;x.layers.enable(1),x.viewport=new Ri;const b=new js;b.layers.enable(2),b.viewport=new Ri;const _=[x,b],S=new zWt;S.layers.enable(1),S.layers.enable(2);let O=null,C=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(U){let N=v[U];return N===void 0&&(N=new hD,v[U]=N),N.getTargetRaySpace()},this.getControllerGrip=function(U){let N=v[U];return N===void 0&&(N=new hD,v[U]=N),N.getGripSpace()},this.getHand=function(U){let N=v[U];return N===void 0&&(N=new hD,v[U]=N),N.getHandSpace()};function E(U){const N=y.indexOf(U.inputSource);if(N===-1)return;const $=v[N];$!==void 0&&$.dispatchEvent({type:U.type,data:U.inputSource})}function k(){i.removeEventListener("select",E),i.removeEventListener("selectstart",E),i.removeEventListener("selectend",E),i.removeEventListener("squeeze",E),i.removeEventListener("squeezestart",E),i.removeEventListener("squeezeend",E),i.removeEventListener("end",k),i.removeEventListener("inputsourceschange",I);for(let U=0;U=0&&(y[D]=null,v[D].dispatchEvent({type:"disconnected",data:$}))}for(let N=0;N=y.length){y.push($),D=q;break}else if(y[q]===null){y[q]=$,D=q;break}if(D===-1)break}const A=v[D];A&&A.dispatchEvent({type:"connected",data:$})}}const P=new Se,R=new Se;function T(U,N,$){P.setFromMatrixPosition(N.matrixWorld),R.setFromMatrixPosition($.matrixWorld);const D=P.distanceTo(R),A=N.projectionMatrix.elements,q=$.projectionMatrix.elements,Y=A[14]/(A[10]-1),K=A[14]/(A[10]+1),se=(A[9]+1)/A[5],te=(A[9]-1)/A[5],J=(A[8]-1)/A[0],pe=(q[8]+1)/q[0],be=Y*J,re=Y*pe,ve=D/(-J+pe),F=ve*-J;N.matrixWorld.decompose(U.position,U.quaternion,U.scale),U.translateX(F),U.translateZ(ve),U.matrixWorld.compose(U.position,U.quaternion,U.scale),U.matrixWorldInverse.copy(U.matrixWorld).invert();const ce=Y+ve,le=K+ve,Q=be-F,X=re+(D-F),ee=se*K/le*ce,ge=te*K/le*ce;U.projectionMatrix.makePerspective(Q,X,ee,ge,ce,le)}function L(U,N){N===null?U.matrixWorld.copy(U.matrix):U.matrixWorld.multiplyMatrices(N.matrixWorld,U.matrix),U.matrixWorldInverse.copy(U.matrixWorld).invert()}this.updateCamera=function(U){if(i===null)return;S.near=b.near=x.near=U.near,S.far=b.far=x.far=U.far,(O!==S.near||C!==S.far)&&(i.updateRenderState({depthNear:S.near,depthFar:S.far}),O=S.near,C=S.far);const N=U.parent,$=S.cameras;L(S,N);for(let A=0;A<$.length;A++)L($[A],N);S.matrixWorld.decompose(S.position,S.quaternion,S.scale),U.matrix.copy(S.matrix),U.matrix.decompose(U.position,U.quaternion,U.scale);const D=U.children;for(let A=0,q=D.length;A0&&(m.alphaTest.value=g.alphaTest);const v=e.get(g).envMap;if(v&&(m.envMap.value=v,m.flipEnvMap.value=v.isCubeTexture&&v.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=g.reflectivity,m.ior.value=g.ior,m.refractionRatio.value=g.refractionRatio),g.lightMap){m.lightMap.value=g.lightMap;const b=t.physicallyCorrectLights!==!0?Math.PI:1;m.lightMapIntensity.value=g.lightMapIntensity*b}g.aoMap&&(m.aoMap.value=g.aoMap,m.aoMapIntensity.value=g.aoMapIntensity);let y;g.map?y=g.map:g.specularMap?y=g.specularMap:g.displacementMap?y=g.displacementMap:g.normalMap?y=g.normalMap:g.bumpMap?y=g.bumpMap:g.roughnessMap?y=g.roughnessMap:g.metalnessMap?y=g.metalnessMap:g.alphaMap?y=g.alphaMap:g.emissiveMap?y=g.emissiveMap:g.clearcoatMap?y=g.clearcoatMap:g.clearcoatNormalMap?y=g.clearcoatNormalMap:g.clearcoatRoughnessMap?y=g.clearcoatRoughnessMap:g.iridescenceMap?y=g.iridescenceMap:g.iridescenceThicknessMap?y=g.iridescenceThicknessMap:g.specularIntensityMap?y=g.specularIntensityMap:g.specularColorMap?y=g.specularColorMap:g.transmissionMap?y=g.transmissionMap:g.thicknessMap?y=g.thicknessMap:g.sheenColorMap?y=g.sheenColorMap:g.sheenRoughnessMap&&(y=g.sheenRoughnessMap),y!==void 0&&(y.isWebGLRenderTarget&&(y=y.texture),y.matrixAutoUpdate===!0&&y.updateMatrix(),m.uvTransform.value.copy(y.matrix));let x;g.aoMap?x=g.aoMap:g.lightMap&&(x=g.lightMap),x!==void 0&&(x.isWebGLRenderTarget&&(x=x.texture),x.matrixAutoUpdate===!0&&x.updateMatrix(),m.uv2Transform.value.copy(x.matrix))}function o(m,g){m.diffuse.value.copy(g.color),m.opacity.value=g.opacity}function a(m,g){m.dashSize.value=g.dashSize,m.totalSize.value=g.dashSize+g.gapSize,m.scale.value=g.scale}function s(m,g,v,y){m.diffuse.value.copy(g.color),m.opacity.value=g.opacity,m.size.value=g.size*v,m.scale.value=y*.5,g.map&&(m.map.value=g.map),g.alphaMap&&(m.alphaMap.value=g.alphaMap),g.alphaTest>0&&(m.alphaTest.value=g.alphaTest);let x;g.map?x=g.map:g.alphaMap&&(x=g.alphaMap),x!==void 0&&(x.matrixAutoUpdate===!0&&x.updateMatrix(),m.uvTransform.value.copy(x.matrix))}function l(m,g){m.diffuse.value.copy(g.color),m.opacity.value=g.opacity,m.rotation.value=g.rotation,g.map&&(m.map.value=g.map),g.alphaMap&&(m.alphaMap.value=g.alphaMap),g.alphaTest>0&&(m.alphaTest.value=g.alphaTest);let v;g.map?v=g.map:g.alphaMap&&(v=g.alphaMap),v!==void 0&&(v.matrixAutoUpdate===!0&&v.updateMatrix(),m.uvTransform.value.copy(v.matrix))}function c(m,g){m.specular.value.copy(g.specular),m.shininess.value=Math.max(g.shininess,1e-4)}function u(m,g){g.gradientMap&&(m.gradientMap.value=g.gradientMap)}function f(m,g){m.roughness.value=g.roughness,m.metalness.value=g.metalness,g.roughnessMap&&(m.roughnessMap.value=g.roughnessMap),g.metalnessMap&&(m.metalnessMap.value=g.metalnessMap),e.get(g).envMap&&(m.envMapIntensity.value=g.envMapIntensity)}function d(m,g,v){m.ior.value=g.ior,g.sheen>0&&(m.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),m.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(m.sheenColorMap.value=g.sheenColorMap),g.sheenRoughnessMap&&(m.sheenRoughnessMap.value=g.sheenRoughnessMap)),g.clearcoat>0&&(m.clearcoat.value=g.clearcoat,m.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(m.clearcoatMap.value=g.clearcoatMap),g.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap),g.clearcoatNormalMap&&(m.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),m.clearcoatNormalMap.value=g.clearcoatNormalMap,g.side===_a&&m.clearcoatNormalScale.value.negate())),g.iridescence>0&&(m.iridescence.value=g.iridescence,m.iridescenceIOR.value=g.iridescenceIOR,m.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap&&(m.iridescenceMap.value=g.iridescenceMap),g.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=g.iridescenceThicknessMap)),g.transmission>0&&(m.transmission.value=g.transmission,m.transmissionSamplerMap.value=v.texture,m.transmissionSamplerSize.value.set(v.width,v.height),g.transmissionMap&&(m.transmissionMap.value=g.transmissionMap),m.thickness.value=g.thickness,g.thicknessMap&&(m.thicknessMap.value=g.thicknessMap),m.attenuationDistance.value=g.attenuationDistance,m.attenuationColor.value.copy(g.attenuationColor)),m.specularIntensity.value=g.specularIntensity,m.specularColor.value.copy(g.specularColor),g.specularIntensityMap&&(m.specularIntensityMap.value=g.specularIntensityMap),g.specularColorMap&&(m.specularColorMap.value=g.specularColorMap)}function h(m,g){g.matcap&&(m.matcap.value=g.matcap)}function p(m,g){m.referencePosition.value.copy(g.referencePosition),m.nearDistance.value=g.nearDistance,m.farDistance.value=g.farDistance}return{refreshFogUniforms:n,refreshMaterialUniforms:r}}function HWt(t,e,n,r){let i={},o={},a=[];const s=n.isWebGL2?t.getParameter(35375):0;function l(y,x){const b=x.program;r.uniformBlockBinding(y,b)}function c(y,x){let b=i[y.id];b===void 0&&(p(y),b=u(y),i[y.id]=b,y.addEventListener("dispose",g));const _=x.program;r.updateUBOMapping(y,_);const S=e.render.frame;o[y.id]!==S&&(d(y),o[y.id]=S)}function u(y){const x=f();y.__bindingPointIndex=x;const b=t.createBuffer(),_=y.__size,S=y.usage;return t.bindBuffer(35345,b),t.bufferData(35345,_,S),t.bindBuffer(35345,null),t.bindBufferBase(35345,x,b),b}function f(){for(let y=0;y0){S=b%_;const I=_-S;S!==0&&I-k.boundary<0&&(b+=_-S,E.__offset=b)}b+=k.storage}return S=b%_,S>0&&(b+=_-S),y.__size=b,y.__cache={},this}function m(y){const x=y.value,b={boundary:0,storage:0};return typeof x=="number"?(b.boundary=4,b.storage=4):x.isVector2?(b.boundary=8,b.storage=8):x.isVector3||x.isColor?(b.boundary=16,b.storage=12):x.isVector4?(b.boundary=16,b.storage=16):x.isMatrix3?(b.boundary=48,b.storage=48):x.isMatrix4?(b.boundary=64,b.storage=64):x.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",x),b}function g(y){const x=y.target;x.removeEventListener("dispose",g);const b=a.indexOf(x.__bindingPointIndex);a.splice(b,1),t.deleteBuffer(i[x.id]),delete i[x.id],delete o[x.id]}function v(){for(const y in i)t.deleteBuffer(i[y]);a=[],i={},o={}}return{bind:l,update:c,dispose:v}}function qWt(){const t=J_("canvas");return t.style.display="block",t}function qye(t={}){this.isWebGLRenderer=!0;const e=t.canvas!==void 0?t.canvas:qWt(),n=t.context!==void 0?t.context:null,r=t.depth!==void 0?t.depth:!0,i=t.stencil!==void 0?t.stencil:!0,o=t.antialias!==void 0?t.antialias:!1,a=t.premultipliedAlpha!==void 0?t.premultipliedAlpha:!0,s=t.preserveDrawingBuffer!==void 0?t.preserveDrawingBuffer:!1,l=t.powerPreference!==void 0?t.powerPreference:"default",c=t.failIfMajorPerformanceCaveat!==void 0?t.failIfMajorPerformanceCaveat:!1;let u;n!==null?u=n.getContextAttributes().alpha:u=t.alpha!==void 0?t.alpha:!1;let f=null,d=null;const h=[],p=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputEncoding=fp,this.physicallyCorrectLights=!1,this.toneMapping=ru,this.toneMappingExposure=1,Object.defineProperties(this,{gammaFactor:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaFactor has been removed."),2},set:function(){console.warn("THREE.WebGLRenderer: .gammaFactor has been removed.")}}});const m=this;let g=!1,v=0,y=0,x=null,b=-1,_=null;const S=new Ri,O=new Ri;let C=null,E=e.width,k=e.height,I=1,P=null,R=null;const T=new Ri(0,0,E,k),L=new Ri(0,0,E,k);let z=!1;const B=new Bye;let W=!1,U=!1,N=null;const $=new Gn,D=new Ht,A=new Se,q={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Y(){return x===null?I:1}let K=n;function se(ne,Pe){for(let Ie=0;Ie0?d=p[p.length-1]:d=null,h.pop(),h.length>0?f=h[h.length-1]:f=null};function Hr(ne,Pe,Ie,Oe){if(ne.visible===!1)return;if(ne.layers.test(Pe.layers)){if(ne.isGroup)Ie=ne.renderOrder;else if(ne.isLOD)ne.autoUpdate===!0&&ne.update(Pe);else if(ne.isLight)d.pushLight(ne),ne.castShadow&&d.pushShadow(ne);else if(ne.isSprite){if(!ne.frustumCulled||B.intersectsSprite(ne)){Oe&&A.setFromMatrixPosition(ne.matrixWorld).applyMatrix4($);const Ze=X.update(ne),mt=ne.material;mt.visible&&f.push(ne,Ze,mt,Ie,A.z,null)}}else if((ne.isMesh||ne.isLine||ne.isPoints)&&(ne.isSkinnedMesh&&ne.skeleton.frame!==be.render.frame&&(ne.skeleton.update(),ne.skeleton.frame=be.render.frame),!ne.frustumCulled||B.intersectsObject(ne))){Oe&&A.setFromMatrixPosition(ne.matrixWorld).applyMatrix4($);const Ze=X.update(ne),mt=ne.material;if(Array.isArray(mt)){const wt=Ze.groups;for(let zt=0,Pt=wt.length;zt0&&qr($e,Pe,Ie),Oe&&pe.viewport(S.copy(Oe)),$e.length>0&&rr($e,Pe,Ie),ot.length>0&&rr(ot,Pe,Ie),Ze.length>0&&rr(Ze,Pe,Ie),pe.buffers.depth.setTest(!0),pe.buffers.depth.setMask(!0),pe.buffers.color.setMask(!0),pe.setPolygonOffset(!1)}function qr(ne,Pe,Ie){const Oe=J.isWebGL2;N===null&&(N=new dp(1,1,{generateMipmaps:!0,type:te.has("EXT_color_buffer_half_float")?Z_:up,minFilter:Tk,samples:Oe&&o===!0?4:0})),m.getDrawingBufferSize(D),Oe?N.setSize(D.x,D.y):N.setSize(bF(D.x),bF(D.y));const $e=m.getRenderTarget();m.setRenderTarget(N),m.clear();const ot=m.toneMapping;m.toneMapping=ru,rr(ne,Pe,Ie),m.toneMapping=ot,ve.updateMultisampleRenderTarget(N),ve.updateRenderTargetMipmap(N),m.setRenderTarget($e)}function rr(ne,Pe,Ie){const Oe=Pe.isScene===!0?Pe.overrideMaterial:null;for(let $e=0,ot=ne.length;$e0&&ve.useMultisampledRTT(ne)===!1?$e=re.get(ne).__webglMultisampledFramebuffer:$e=zt,S.copy(ne.viewport),O.copy(ne.scissor),C=ne.scissorTest}else S.copy(T).multiplyScalar(I).floor(),O.copy(L).multiplyScalar(I).floor(),C=z;if(pe.bindFramebuffer(36160,$e)&&J.drawBuffers&&Oe&&pe.drawBuffers(ne,$e),pe.viewport(S),pe.scissor(O),pe.setScissorTest(C),ot){const wt=re.get(ne.texture);K.framebufferTexture2D(36160,36064,34069+Pe,wt.__webglTexture,Ie)}else if(Ze){const wt=re.get(ne.texture),zt=Pe||0;K.framebufferTextureLayer(36160,36064,wt.__webglTexture,Ie||0,zt)}b=-1},this.readRenderTargetPixels=function(ne,Pe,Ie,Oe,$e,ot,Ze){if(!(ne&&ne.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let mt=re.get(ne).__webglFramebuffer;if(ne.isWebGLCubeRenderTarget&&Ze!==void 0&&(mt=mt[Ze]),mt){pe.bindFramebuffer(36160,mt);try{const wt=ne.texture,zt=wt.format,Pt=wt.type;if(zt!==$l&&V.convert(zt)!==K.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const st=Pt===Z_&&(te.has("EXT_color_buffer_half_float")||J.isWebGL2&&te.has("EXT_color_buffer_float"));if(Pt!==up&&V.convert(Pt)!==K.getParameter(35738)&&!(Pt===Of&&(J.isWebGL2||te.has("OES_texture_float")||te.has("WEBGL_color_buffer_float")))&&!st){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}Pe>=0&&Pe<=ne.width-Oe&&Ie>=0&&Ie<=ne.height-$e&&K.readPixels(Pe,Ie,Oe,$e,V.convert(zt),V.convert(Pt),ot)}finally{const wt=x!==null?re.get(x).__webglFramebuffer:null;pe.bindFramebuffer(36160,wt)}}},this.copyFramebufferToTexture=function(ne,Pe,Ie=0){const Oe=Math.pow(2,-Ie),$e=Math.floor(Pe.image.width*Oe),ot=Math.floor(Pe.image.height*Oe);ve.setTexture2D(Pe,0),K.copyTexSubImage2D(3553,Ie,0,0,ne.x,ne.y,$e,ot),pe.unbindTexture()},this.copyTextureToTexture=function(ne,Pe,Ie,Oe=0){const $e=Pe.image.width,ot=Pe.image.height,Ze=V.convert(Ie.format),mt=V.convert(Ie.type);ve.setTexture2D(Ie,0),K.pixelStorei(37440,Ie.flipY),K.pixelStorei(37441,Ie.premultiplyAlpha),K.pixelStorei(3317,Ie.unpackAlignment),Pe.isDataTexture?K.texSubImage2D(3553,Oe,ne.x,ne.y,$e,ot,Ze,mt,Pe.image.data):Pe.isCompressedTexture?K.compressedTexSubImage2D(3553,Oe,ne.x,ne.y,Pe.mipmaps[0].width,Pe.mipmaps[0].height,Ze,Pe.mipmaps[0].data):K.texSubImage2D(3553,Oe,ne.x,ne.y,Ze,mt,Pe.image),Oe===0&&Ie.generateMipmaps&&K.generateMipmap(3553),pe.unbindTexture()},this.copyTextureToTexture3D=function(ne,Pe,Ie,Oe,$e=0){if(m.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const ot=ne.max.x-ne.min.x+1,Ze=ne.max.y-ne.min.y+1,mt=ne.max.z-ne.min.z+1,wt=V.convert(Oe.format),zt=V.convert(Oe.type);let Pt;if(Oe.isData3DTexture)ve.setTexture3D(Oe,0),Pt=32879;else if(Oe.isDataArrayTexture)ve.setTexture2DArray(Oe,0),Pt=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}K.pixelStorei(37440,Oe.flipY),K.pixelStorei(37441,Oe.premultiplyAlpha),K.pixelStorei(3317,Oe.unpackAlignment);const st=K.getParameter(3314),Qt=K.getParameter(32878),Pd=K.getParameter(3316),zp=K.getParameter(3315),Up=K.getParameter(32877),il=Ie.isCompressedTexture?Ie.mipmaps[0]:Ie.image;K.pixelStorei(3314,il.width),K.pixelStorei(32878,il.height),K.pixelStorei(3316,ne.min.x),K.pixelStorei(3315,ne.min.y),K.pixelStorei(32877,ne.min.z),Ie.isDataTexture||Ie.isData3DTexture?K.texSubImage3D(Pt,$e,Pe.x,Pe.y,Pe.z,ot,Ze,mt,wt,zt,il.data):Ie.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),K.compressedTexSubImage3D(Pt,$e,Pe.x,Pe.y,Pe.z,ot,Ze,mt,wt,il.data)):K.texSubImage3D(Pt,$e,Pe.x,Pe.y,Pe.z,ot,Ze,mt,wt,zt,il),K.pixelStorei(3314,st),K.pixelStorei(32878,Qt),K.pixelStorei(3316,Pd),K.pixelStorei(3315,zp),K.pixelStorei(32877,Up),$e===0&&Oe.generateMipmaps&&K.generateMipmap(Pt),pe.unbindTexture()},this.initTexture=function(ne){ne.isCubeTexture?ve.setTextureCube(ne,0):ne.isData3DTexture?ve.setTexture3D(ne,0):ne.isDataArrayTexture?ve.setTexture2DArray(ne,0):ve.setTexture2D(ne,0),pe.unbindTexture()},this.resetState=function(){v=0,y=0,x=null,pe.reset(),de.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class XWt extends qye{}XWt.prototype.isWebGL1Renderer=!0;class QWt extends Bo{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,n){return super.copy(e,n),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const n=super.toJSON(e);return this.fog!==null&&(n.object.fog=this.fog.toJSON()),n}get autoUpdate(){return console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate}set autoUpdate(e){console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate=e}}class Xye extends kw{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new sr(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const hJ=new Se,pJ=new Se,mJ=new Gn,pD=new Iye,QO=new Ek;class YWt extends Bo{constructor(e=new Ou,n=new Xye){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=n,this.updateMorphTargets()}copy(e,n){return super.copy(e,n),this.material=e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.attributes.position,r=[0];for(let i=1,o=n.count;il)continue;d.applyMatrix4(this.matrixWorld);const C=e.ray.origin.distanceTo(d);Ce.far||n.push({distance:C,point:f.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}else{const v=Math.max(0,a.start),y=Math.min(g.count,a.start+a.count);for(let x=v,b=y-1;xl)continue;d.applyMatrix4(this.matrixWorld);const S=e.ray.origin.distanceTo(d);Se.far||n.push({distance:S,point:f.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const n=this.geometry.morphAttributes,r=Object.keys(n);if(r.length>0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,a=i.length;o{n&&n(o),this.manager.itemEnd(e)},0),o;if(_c[e]!==void 0){_c[e].push({onLoad:n,onProgress:r,onError:i});return}_c[e]=[],_c[e].push({onLoad:n,onProgress:r,onError:i});const a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),s=this.mimeType,l=this.responseType;fetch(a).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=_c[e],f=c.body.getReader(),d=c.headers.get("Content-Length"),h=d?parseInt(d):0,p=h!==0;let m=0;const g=new ReadableStream({start(v){y();function y(){f.read().then(({done:x,value:b})=>{if(x)v.close();else{m+=b.byteLength;const _=new ProgressEvent("progress",{lengthComputable:p,loaded:m,total:h});for(let S=0,O=u.length;S{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,s));case"json":return c.json();default:if(s===void 0)return c.text();{const f=/charset="?([^;"\s]*)"?/i.exec(s),d=f&&f[1]?f[1].toLowerCase():void 0,h=new TextDecoder(d);return c.arrayBuffer().then(p=>h.decode(p))}}}).then(c=>{EP.add(e,c);const u=_c[e];delete _c[e];for(let f=0,d=u.length;f{const u=_c[e];if(u===void 0)throw this.manager.itemError(e),c;delete _c[e];for(let f=0,d=u.length;f{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class nVt extends kk{constructor(e){super(e)}load(e,n,r,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,a=EP.get(e);if(a!==void 0)return o.manager.itemStart(e),setTimeout(function(){n&&n(a),o.manager.itemEnd(e)},0),a;const s=J_("img");function l(){u(),EP.add(e,this),n&&n(this),o.manager.itemEnd(e)}function c(f){u(),i&&i(f),o.manager.itemError(e),o.manager.itemEnd(e)}function u(){s.removeEventListener("load",l,!1),s.removeEventListener("error",c,!1)}return s.addEventListener("load",l,!1),s.addEventListener("error",c,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(s.crossOrigin=this.crossOrigin),o.manager.itemStart(e),s.src=e,s}}class rVt extends kk{constructor(e){super(e)}load(e,n,r,i){const o=new Ta,a=new nVt(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(s){o.image=s,o.needsUpdate=!0,n!==void 0&&n(o)},r,i),o}}class yJ{constructor(e=1,n=0,r=0){return this.radius=e,this.phi=n,this.theta=r,this}set(e,n,r){return this.radius=e,this.phi=n,this.theta=r,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,n,r){return this.radius=Math.sqrt(e*e+n*n+r*r),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,r),this.phi=Math.acos(Po(n/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}const YO=new Gy;class iVt extends KWt{constructor(e,n=16776960){const r=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Float32Array(8*3),o=new Ou;o.setIndex(new os(r,1)),o.setAttribute("position",new os(i,3)),super(o,new Xye({color:n,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(e){if(e!==void 0&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),this.object!==void 0&&YO.setFromObject(this.object),YO.isEmpty())return;const n=YO.min,r=YO.max,i=this.geometry.attributes.position,o=i.array;o[0]=r.x,o[1]=r.y,o[2]=r.z,o[3]=n.x,o[4]=r.y,o[5]=r.z,o[6]=n.x,o[7]=n.y,o[8]=r.z,o[9]=r.x,o[10]=n.y,o[11]=r.z,o[12]=r.x,o[13]=r.y,o[14]=n.z,o[15]=n.x,o[16]=r.y,o[17]=n.z,o[18]=n.x,o[19]=n.y,o[20]=n.z,o[21]=r.x,o[22]=n.y,o[23]=n.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e,n){return super.copy(e,n),this.object=e.object,this}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:u6}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=u6);const xJ={type:"change"},mD={type:"start"},bJ={type:"end"};class oVt extends jp{constructor(e,n){super(),this.object=e,this.domElement=n,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new Se,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:um.ROTATE,MIDDLE:um.DOLLY,RIGHT:um.PAN},this.touches={ONE:fm.ROTATE,TWO:fm.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return s.phi},this.getAzimuthalAngle=function(){return s.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(V){V.addEventListener("keydown",ye),this._domElementKeyEvents=V},this.saveState=function(){r.target0.copy(r.target),r.position0.copy(r.object.position),r.zoom0=r.object.zoom},this.reset=function(){r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.zoom=r.zoom0,r.object.updateProjectionMatrix(),r.dispatchEvent(xJ),r.update(),o=i.NONE},this.update=function(){const V=new Se,de=new hp().setFromUnitVectors(e.up,new Se(0,1,0)),xe=de.clone().invert(),Me=new Se,me=new hp,Ne=2*Math.PI;return function(){const Re=r.object.position;V.copy(Re).sub(r.target),V.applyQuaternion(de),s.setFromVector3(V),r.autoRotate&&o===i.NONE&&E(O()),r.enableDamping?(s.theta+=l.theta*r.dampingFactor,s.phi+=l.phi*r.dampingFactor):(s.theta+=l.theta,s.phi+=l.phi);let ae=r.minAzimuthAngle,Le=r.maxAzimuthAngle;return isFinite(ae)&&isFinite(Le)&&(ae<-Math.PI?ae+=Ne:ae>Math.PI&&(ae-=Ne),Le<-Math.PI?Le+=Ne:Le>Math.PI&&(Le-=Ne),ae<=Le?s.theta=Math.max(ae,Math.min(Le,s.theta)):s.theta=s.theta>(ae+Le)/2?Math.max(ae,s.theta):Math.min(Le,s.theta)),s.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,s.phi)),s.makeSafe(),s.radius*=c,s.radius=Math.max(r.minDistance,Math.min(r.maxDistance,s.radius)),r.enableDamping===!0?r.target.addScaledVector(u,r.dampingFactor):r.target.add(u),V.setFromSpherical(s),V.applyQuaternion(xe),Re.copy(r.target).add(V),r.object.lookAt(r.target),r.enableDamping===!0?(l.theta*=1-r.dampingFactor,l.phi*=1-r.dampingFactor,u.multiplyScalar(1-r.dampingFactor)):(l.set(0,0,0),u.set(0,0,0)),c=1,f||Me.distanceToSquared(r.object.position)>a||8*(1-me.dot(r.object.quaternion))>a?(r.dispatchEvent(xJ),Me.copy(r.object.position),me.copy(r.object.quaternion),f=!1,!0):!1}}(),this.dispose=function(){r.domElement.removeEventListener("contextmenu",ie),r.domElement.removeEventListener("pointerdown",F),r.domElement.removeEventListener("pointercancel",Q),r.domElement.removeEventListener("wheel",ge),r.domElement.removeEventListener("pointermove",ce),r.domElement.removeEventListener("pointerup",le),r._domElementKeyEvents!==null&&r._domElementKeyEvents.removeEventListener("keydown",ye)};const r=this,i={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let o=i.NONE;const a=1e-6,s=new yJ,l=new yJ;let c=1;const u=new Se;let f=!1;const d=new Ht,h=new Ht,p=new Ht,m=new Ht,g=new Ht,v=new Ht,y=new Ht,x=new Ht,b=new Ht,_=[],S={};function O(){return 2*Math.PI/60/60*r.autoRotateSpeed}function C(){return Math.pow(.95,r.zoomSpeed)}function E(V){l.theta-=V}function k(V){l.phi-=V}const I=function(){const V=new Se;return function(xe,Me){V.setFromMatrixColumn(Me,0),V.multiplyScalar(-xe),u.add(V)}}(),P=function(){const V=new Se;return function(xe,Me){r.screenSpacePanning===!0?V.setFromMatrixColumn(Me,1):(V.setFromMatrixColumn(Me,0),V.crossVectors(r.object.up,V)),V.multiplyScalar(xe),u.add(V)}}(),R=function(){const V=new Se;return function(xe,Me){const me=r.domElement;if(r.object.isPerspectiveCamera){const Ne=r.object.position;V.copy(Ne).sub(r.target);let Ce=V.length();Ce*=Math.tan(r.object.fov/2*Math.PI/180),I(2*xe*Ce/me.clientHeight,r.object.matrix),P(2*Me*Ce/me.clientHeight,r.object.matrix)}else r.object.isOrthographicCamera?(I(xe*(r.object.right-r.object.left)/r.object.zoom/me.clientWidth,r.object.matrix),P(Me*(r.object.top-r.object.bottom)/r.object.zoom/me.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}}();function T(V){r.object.isPerspectiveCamera?c/=V:r.object.isOrthographicCamera?(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom*V)),r.object.updateProjectionMatrix(),f=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function L(V){r.object.isPerspectiveCamera?c*=V:r.object.isOrthographicCamera?(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/V)),r.object.updateProjectionMatrix(),f=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function z(V){d.set(V.clientX,V.clientY)}function B(V){y.set(V.clientX,V.clientY)}function W(V){m.set(V.clientX,V.clientY)}function U(V){h.set(V.clientX,V.clientY),p.subVectors(h,d).multiplyScalar(r.rotateSpeed);const de=r.domElement;E(2*Math.PI*p.x/de.clientHeight),k(2*Math.PI*p.y/de.clientHeight),d.copy(h),r.update()}function N(V){x.set(V.clientX,V.clientY),b.subVectors(x,y),b.y>0?T(C()):b.y<0&&L(C()),y.copy(x),r.update()}function $(V){g.set(V.clientX,V.clientY),v.subVectors(g,m).multiplyScalar(r.panSpeed),R(v.x,v.y),m.copy(g),r.update()}function D(V){V.deltaY<0?L(C()):V.deltaY>0&&T(C()),r.update()}function A(V){let de=!1;switch(V.code){case r.keys.UP:R(0,r.keyPanSpeed),de=!0;break;case r.keys.BOTTOM:R(0,-r.keyPanSpeed),de=!0;break;case r.keys.LEFT:R(r.keyPanSpeed,0),de=!0;break;case r.keys.RIGHT:R(-r.keyPanSpeed,0),de=!0;break}de&&(V.preventDefault(),r.update())}function q(){if(_.length===1)d.set(_[0].pageX,_[0].pageY);else{const V=.5*(_[0].pageX+_[1].pageX),de=.5*(_[0].pageY+_[1].pageY);d.set(V,de)}}function Y(){if(_.length===1)m.set(_[0].pageX,_[0].pageY);else{const V=.5*(_[0].pageX+_[1].pageX),de=.5*(_[0].pageY+_[1].pageY);m.set(V,de)}}function K(){const V=_[0].pageX-_[1].pageX,de=_[0].pageY-_[1].pageY,xe=Math.sqrt(V*V+de*de);y.set(0,xe)}function se(){r.enableZoom&&K(),r.enablePan&&Y()}function te(){r.enableZoom&&K(),r.enableRotate&&q()}function J(V){if(_.length===1)h.set(V.pageX,V.pageY);else{const xe=Z(V),Me=.5*(V.pageX+xe.x),me=.5*(V.pageY+xe.y);h.set(Me,me)}p.subVectors(h,d).multiplyScalar(r.rotateSpeed);const de=r.domElement;E(2*Math.PI*p.x/de.clientHeight),k(2*Math.PI*p.y/de.clientHeight),d.copy(h)}function pe(V){if(_.length===1)g.set(V.pageX,V.pageY);else{const de=Z(V),xe=.5*(V.pageX+de.x),Me=.5*(V.pageY+de.y);g.set(xe,Me)}v.subVectors(g,m).multiplyScalar(r.panSpeed),R(v.x,v.y),m.copy(g)}function be(V){const de=Z(V),xe=V.pageX-de.x,Me=V.pageY-de.y,me=Math.sqrt(xe*xe+Me*Me);x.set(0,me),b.set(0,Math.pow(x.y/y.y,r.zoomSpeed)),T(b.y),y.copy(x)}function re(V){r.enableZoom&&be(V),r.enablePan&&pe(V)}function ve(V){r.enableZoom&&be(V),r.enableRotate&&J(V)}function F(V){r.enabled!==!1&&(_.length===0&&(r.domElement.setPointerCapture(V.pointerId),r.domElement.addEventListener("pointermove",ce),r.domElement.addEventListener("pointerup",le)),he(V),V.pointerType==="touch"?H(V):X(V))}function ce(V){r.enabled!==!1&&(V.pointerType==="touch"?G(V):ee(V))}function le(V){_e(V),_.length===0&&(r.domElement.releasePointerCapture(V.pointerId),r.domElement.removeEventListener("pointermove",ce),r.domElement.removeEventListener("pointerup",le)),r.dispatchEvent(bJ),o=i.NONE}function Q(V){_e(V)}function X(V){let de;switch(V.button){case 0:de=r.mouseButtons.LEFT;break;case 1:de=r.mouseButtons.MIDDLE;break;case 2:de=r.mouseButtons.RIGHT;break;default:de=-1}switch(de){case um.DOLLY:if(r.enableZoom===!1)return;B(V),o=i.DOLLY;break;case um.ROTATE:if(V.ctrlKey||V.metaKey||V.shiftKey){if(r.enablePan===!1)return;W(V),o=i.PAN}else{if(r.enableRotate===!1)return;z(V),o=i.ROTATE}break;case um.PAN:if(V.ctrlKey||V.metaKey||V.shiftKey){if(r.enableRotate===!1)return;z(V),o=i.ROTATE}else{if(r.enablePan===!1)return;W(V),o=i.PAN}break;default:o=i.NONE}o!==i.NONE&&r.dispatchEvent(mD)}function ee(V){switch(o){case i.ROTATE:if(r.enableRotate===!1)return;U(V);break;case i.DOLLY:if(r.enableZoom===!1)return;N(V);break;case i.PAN:if(r.enablePan===!1)return;$(V);break}}function ge(V){r.enabled===!1||r.enableZoom===!1||o!==i.NONE||(V.preventDefault(),r.dispatchEvent(mD),D(V),r.dispatchEvent(bJ))}function ye(V){r.enabled===!1||r.enablePan===!1||A(V)}function H(V){switch(oe(V),_.length){case 1:switch(r.touches.ONE){case fm.ROTATE:if(r.enableRotate===!1)return;q(),o=i.TOUCH_ROTATE;break;case fm.PAN:if(r.enablePan===!1)return;Y(),o=i.TOUCH_PAN;break;default:o=i.NONE}break;case 2:switch(r.touches.TWO){case fm.DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;se(),o=i.TOUCH_DOLLY_PAN;break;case fm.DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;te(),o=i.TOUCH_DOLLY_ROTATE;break;default:o=i.NONE}break;default:o=i.NONE}o!==i.NONE&&r.dispatchEvent(mD)}function G(V){switch(oe(V),o){case i.TOUCH_ROTATE:if(r.enableRotate===!1)return;J(V),r.update();break;case i.TOUCH_PAN:if(r.enablePan===!1)return;pe(V),r.update();break;case i.TOUCH_DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;re(V),r.update();break;case i.TOUCH_DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;ve(V),r.update();break;default:o=i.NONE}}function ie(V){r.enabled!==!1&&V.preventDefault()}function he(V){_.push(V)}function _e(V){delete S[V.pointerId];for(let de=0;de<_.length;de++)if(_[de].pointerId===V.pointerId){_.splice(de,1);return}}function oe(V){let de=S[V.pointerId];de===void 0&&(de=new Ht,S[V.pointerId]=de),de.set(V.pageX,V.pageY)}function Z(V){const de=V.pointerId===_[0].pointerId?_[1]:_[0];return S[de.pointerId]}r.domElement.addEventListener("contextmenu",ie),r.domElement.addEventListener("pointerdown",F),r.domElement.addEventListener("pointercancel",Q),r.domElement.addEventListener("wheel",ge,{passive:!1}),this.update()}}const aVt={uniforms:{u_size:{value:new Se(1,1,1)},u_renderstyle:{value:0},u_renderthreshold:{value:.5},u_clim:{value:new Ht(0,1)},u_data:{value:null},u_cmdata:{value:null}},vertexShader:` varying vec4 v_nearpos; varying vec4 v_farpos; @@ -3720,6 +3720,6 @@ void main() { final_color = color * (ambient_color + diffuse_color) + specular_color; final_color.a = color.a; return final_color; - }`};function oVt(){try{const t=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&t.getContext("webgl2"))}catch{return!1}}class aVt{constructor(){Yt(this,"textures");this.textures={}}get(e,n){const r=ZT(e);let i=this.textures[r];return i||(i=new tVt().load(`data:image/png;base64,${e.imageData}`,n),this.textures[r]=i),i}}const sVt=new aVt;class lVt{constructor(e){Yt(this,"canvas");Yt(this,"camera");Yt(this,"renderer");Yt(this,"scene");Yt(this,"material");if(!oVt())throw new Error("Missing WebGL2");this.render=this.render.bind(this);const n=new Hye({canvas:e});n.setPixelRatio(window.devicePixelRatio),n.setSize(e.clientWidth,e.clientHeight);const r=100,i=e.clientWidth/e.clientHeight,o=new zye(-r*i,r*i,r,-r,-1e3,1e3);o.position.set(0,0,100),o.up.set(0,1,0);const a=new rVt(o,n.domElement);a.target.set(100,50,0),a.minZoom=.1,a.maxZoom=500,a.enablePan=!0,a.update(),this.canvas=e,this.renderer=n,this.camera=o,this.scene=null,this.material=null,a.addEventListener("change",this.render),e.addEventListener("resize",this.onCanvasResize)}setVolume(e,n){const r=new Aye(e.data,e.xLength,e.yLength,e.zLength);r.format=Cye,r.type=Of,r.minFilter=r.magFilter=Eo,r.unpackAlignment=1,r.needsUpdate=!0;const i=iVt,o=$ye.clone(i.uniforms),[a,s,l]=e.spacing,c=Math.floor(a*e.xLength),u=Math.floor(s*e.yLength),f=Math.floor(l*e.zLength);o.u_data.value=r,o.u_size.value.set(c,u,f);const d=new od({uniforms:o,vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:_a}),h=new Hy(c,u,f);h.translate(c/2,u/2,f/2);const p=new Nl(h,d),m=new qWt;m.add(p),m.add(new nVt(p)),this.scene=m,this.material=d,this.setVolumeOptions(n)}setVolumeOptions(e){const n=this.material;if(n!==null){const{value1:r,value2:i,isoThreshold:o,renderMode:a,colorBar:s}=e,l=n.uniforms;l.u_clim.value.set(r,i),l.u_renderthreshold.value=o,l.u_renderstyle.value=a==="mip"?0:a==="aip"?1:2,l.u_cmdata.value=sVt.get(s,this.render),this.render()}}getMaterial(){if(this.material===null)throw new Error("Volume not set!");return this.material}onCanvasResize(){console.warn("Alarm: Canvas resize!");const e=this.renderer.domElement;this.renderer.setSize(e.clientWidth,e.clientHeight);const n=e.clientWidth/e.clientHeight,r=this.camera.top-this.camera.bottom;this.camera.left=-r*n/2,this.camera.right=r*n/2,this.camera.updateProjectionMatrix(),this.render()}render(){this.scene!==null&&this.renderer.render(this.scene,this.camera)}}var pa=Uint8Array,Th=Uint16Array,Xye=Uint32Array,Qye=new pa([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Yye=new pa([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),cVt=new pa([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Kye=function(t,e){for(var n=new Th(31),r=0;r<31;++r)n[r]=e+=1<>>1|(Zn&21845)<<1;Wu=(Wu&52428)>>>2|(Wu&13107)<<2,Wu=(Wu&61680)>>>4|(Wu&3855)<<4,_F[Zn]=((Wu&65280)>>>8|(Wu&255)<<8)>>>1}var sb=function(t,e,n){for(var r=t.length,i=0,o=new Th(e);i>>l]=c}else for(s=new Th(r),i=0;i>>15-t[i]);return s},Aw=new pa(288);for(var Zn=0;Zn<144;++Zn)Aw[Zn]=8;for(var Zn=144;Zn<256;++Zn)Aw[Zn]=9;for(var Zn=256;Zn<280;++Zn)Aw[Zn]=7;for(var Zn=280;Zn<288;++Zn)Aw[Zn]=8;var e0e=new pa(32);for(var Zn=0;Zn<32;++Zn)e0e[Zn]=5;var hVt=sb(Aw,9,1),pVt=sb(e0e,5,1),mD=function(t){for(var e=t[0],n=1;ne&&(e=t[n]);return e},Rs=function(t,e,n){var r=e/8|0;return(t[r]|t[r+1]<<8)>>(e&7)&n},gD=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(e&7)},mVt=function(t){return(t+7)/8|0},gVt=function(t,e,n){(e==null||e<0)&&(e=0),(n==null||n>t.length)&&(n=t.length);var r=new(t.BYTES_PER_ELEMENT==2?Th:t.BYTES_PER_ELEMENT==4?Xye:pa)(n-e);return r.set(t.subarray(e,n)),r},vVt=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],kc=function(t,e,n){var r=new Error(e||vVt[t]);if(r.code=t,Error.captureStackTrace&&Error.captureStackTrace(r,kc),!n)throw r;return r},yVt=function(t,e,n){var r=t.length;if(!r||n&&n.f&&!n.l)return e||new pa(0);var i=!e||n,o=!n||n.i;n||(n={}),e||(e=new pa(r*3));var a=function(K){var se=e.length;if(K>se){var te=new pa(Math.max(se*2,K));te.set(e),e=te}},s=n.f||0,l=n.p||0,c=n.b||0,u=n.l,f=n.d,d=n.m,h=n.n,p=r*8;do{if(!u){s=Rs(t,l,1);var m=Rs(t,l+1,3);if(l+=3,m)if(m==1)u=hVt,f=pVt,d=9,h=5;else if(m==2){var x=Rs(t,l,31)+257,b=Rs(t,l+10,15)+4,_=x+Rs(t,l+5,31)+1;l+=14;for(var S=new pa(_),O=new pa(19),C=0;C>>4;if(g<16)S[C++]=g;else{var R=0,T=0;for(g==16?(T=3+Rs(t,l,3),l+=2,R=S[C-1]):g==17?(T=3+Rs(t,l,7),l+=3):g==18&&(T=11+Rs(t,l,127),l+=7);T--;)S[C++]=R}}var L=S.subarray(0,x),z=S.subarray(x);d=mD(L),h=mD(z),u=sb(L,d,1),f=sb(z,h,1)}else kc(1);else{var g=mVt(l)+4,v=t[g-4]|t[g-3]<<8,y=g+v;if(y>r){o&&kc(0);break}i&&a(c+v),e.set(t.subarray(g,y),c),n.b=c+=v,n.p=l=y*8,n.f=s;continue}if(l>p){o&&kc(0);break}}i&&a(c+131072);for(var B=(1<>>4;if(l+=R&15,l>p){o&&kc(0);break}if(R||kc(2),N<256)e[c++]=N;else if(N==256){U=l,u=null;break}else{var $=N-254;if(N>264){var C=N-257,D=Qye[C];$=Rs(t,l,(1<>>4;A||kc(3),l+=A&15;var z=dVt[q];if(q>3){var D=Yye[q];z+=gD(t,l)&(1<p){o&&kc(0);break}i&&a(c+131072);for(var Y=c+$;c>3&1)+(e>>4&1);r>0;r-=!t[n++]);return n+(e&2)},_Vt=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0};function wVt(t,e){return yVt(t.subarray(bVt(t),-8),e||new pa(_Vt(t)))}var SVt=typeof TextDecoder<"u"&&new TextDecoder,OVt=0;try{SVt.decode(xVt,{stream:!0}),OVt=1}catch{}class CVt{constructor(e,n,r){const i=this;this.volume=e,n=n||0,Object.defineProperty(this,"index",{get:function(){return n},set:function(s){return n=s,i.geometryNeedsUpdate=!0,n}}),this.axis=r||"z",this.canvas=document.createElement("canvas"),this.canvasBuffer=document.createElement("canvas"),this.updateGeometry();const o=new Ta(this.canvas);o.minFilter=Eo,o.wrapS=o.wrapT=Ha;const a=new u6({map:o,side:qc,transparent:!0});this.mesh=new Nl(this.geometry,a),this.mesh.matrixAutoUpdate=!1,this.geometryNeedsUpdate=!0,this.repaint()}repaint(){this.geometryNeedsUpdate&&this.updateGeometry();const e=this.iLength,n=this.jLength,r=this.sliceAccess,i=this.volume,o=this.canvasBuffer,a=this.ctxBuffer,s=a.getImageData(0,0,e,n),l=s.data,c=i.data,u=i.upperThreshold,f=i.lowerThreshold,d=i.windowLow,h=i.windowHigh;let p=0;if(i.dataType==="label")for(let m=0;m=this.colorMap.length?v%this.colorMap.length+1:v;const y=this.colorMap[v];l[4*p]=y>>24&255,l[4*p+1]=y>>16&255,l[4*p+2]=y>>8&255,l[4*p+3]=y&255,p++}else for(let m=0;m=v&&f<=v?y:0,v=Math.floor(255*(v-d)/(h-d)),v=v>255?255:v<0?0:v|0,l[4*p]=v,l[4*p+1]=v,l[4*p+2]=v,l[4*p+3]=y,p++}a.putImageData(s,0,0),this.ctx.drawImage(o,0,0,e,n,0,0,this.canvas.width,this.canvas.height),this.mesh.material.map.needsUpdate=!0}updateGeometry(){const e=this.volume.extractPerpendicularPlane(this.axis,this.index);this.sliceAccess=e.sliceAccess,this.jLength=e.jLength,this.iLength=e.iLength,this.matrix=e.matrix,this.canvas.width=e.planeWidth,this.canvas.height=e.planeHeight,this.canvasBuffer.width=this.iLength,this.canvasBuffer.height=this.jLength,this.ctx=this.canvas.getContext("2d"),this.ctxBuffer=this.canvasBuffer.getContext("2d"),this.geometry&&this.geometry.dispose(),this.geometry=new Pk(e.planeWidth,e.planeHeight),this.mesh&&(this.mesh.geometry=this.geometry,this.mesh.matrix.identity(),this.mesh.applyMatrix4(this.matrix)),this.geometryNeedsUpdate=!1}}class TVt{constructor(e,n,r,i,o){if(e!==void 0){switch(this.xLength=Number(e)||1,this.yLength=Number(n)||1,this.zLength=Number(r)||1,this.axisOrder=["x","y","z"],i){case"Uint8":case"uint8":case"uchar":case"unsigned char":case"uint8_t":this.data=new Uint8Array(o);break;case"Int8":case"int8":case"signed char":case"int8_t":this.data=new Int8Array(o);break;case"Int16":case"int16":case"short":case"short int":case"signed short":case"signed short int":case"int16_t":this.data=new Int16Array(o);break;case"Uint16":case"uint16":case"ushort":case"unsigned short":case"unsigned short int":case"uint16_t":this.data=new Uint16Array(o);break;case"Int32":case"int32":case"int":case"signed int":case"int32_t":this.data=new Int32Array(o);break;case"Uint32":case"uint32":case"uint":case"unsigned int":case"uint32_t":this.data=new Uint32Array(o);break;case"longlong":case"long long":case"long long int":case"signed long long":case"signed long long int":case"int64":case"int64_t":case"ulonglong":case"unsigned long long":case"unsigned long long int":case"uint64":case"uint64_t":throw new Error("Error in Volume constructor : this type is not supported in JavaScript");case"Float32":case"float32":case"float":this.data=new Float32Array(o);break;case"Float64":case"float64":case"double":this.data=new Float64Array(o);break;default:this.data=new Uint8Array(o)}if(this.data.length!==this.xLength*this.yLength*this.zLength)throw new Error("Error in Volume constructor, lengths are not matching arrayBuffer size")}this.spacing=[1,1,1],this.offset=[0,0,0],this.matrix=new va,this.matrix.identity();let a=-1/0;Object.defineProperty(this,"lowerThreshold",{get:function(){return a},set:function(l){a=l,this.sliceList.forEach(function(c){c.geometryNeedsUpdate=!0})}});let s=1/0;Object.defineProperty(this,"upperThreshold",{get:function(){return s},set:function(l){s=l,this.sliceList.forEach(function(c){c.geometryNeedsUpdate=!0})}}),this.sliceList=[]}getData(e,n,r){return this.data[r*this.xLength*this.yLength+n*this.xLength+e]}access(e,n,r){return r*this.xLength*this.yLength+n*this.xLength+e}reverseAccess(e){const n=Math.floor(e/(this.yLength*this.xLength)),r=Math.floor((e-n*this.yLength*this.xLength)/this.xLength);return[e-n*this.yLength*this.xLength-r*this.xLength,r,n]}map(e,n){const r=this.data.length;n=n||this;for(let i=0;i.9}),x=[l,c,s].find(function(S){return Math.abs(S.dot(v[1]))>.9}),b=[l,c,s].find(function(S){return Math.abs(S.dot(v[2]))>.9});function _(S,O){const C=y===s?a:y.arglet==="i"?S:O,E=x===s?a:x.arglet==="i"?S:O,k=b===s?a:b.arglet==="i"?S:O,I=y.dot(v[0])>0?C:f.xLength-1-C,P=x.dot(v[1])>0?E:f.yLength-1-E,R=b.dot(v[2])>0?k:f.zLength-1-k;return f.access(I,P,R)}return{iLength:h,jLength:p,sliceAccess:_,matrix:u,planeWidth:m,planeHeight:g}}extractSlice(e,n){const r=new CVt(this,n,e);return this.sliceList.push(r),r}repaintAllSlices(){return this.sliceList.forEach(function(e){e.repaint()}),this}computeMinMax(){let e=1/0,n=-1/0;const r=this.data.length;let i=0;for(i=0;i0,o=!0,a={};function s(C,E){E==null&&(E=1);let k=1,I=Uint8Array;switch(C){case"uchar":break;case"schar":I=Int8Array;break;case"ushort":I=Uint16Array,k=2;break;case"sshort":I=Int16Array,k=2;break;case"uint":I=Uint32Array,k=4;break;case"sint":I=Int32Array,k=4;break;case"float":I=Float32Array,k=4;break;case"complex":I=Float64Array,k=8;break;case"double":I=Float64Array,k=8;break}let P=new I(n.slice(r,r+=E*k));return i!==o&&(P=l(P,k)),E===1?P[0]:P}function l(C,E){const k=new Uint8Array(C.buffer,C.byteOffset,C.byteLength);for(let I=0;IR;P--,R++){const T=k[R];k[R]=k[P],k[P]=T}return C}function c(C){let E,k,I,P,R,T,L,z;const B=C.split(/\r?\n/);for(L=0,z=B.length;L13)&&P!==32?I+=String.fromCharCode(P):(I!==""&&(L[z]=B(I,T),z++),I="");return I!==""&&(L[z]=B(I,T),z++),L}const f=s("uchar",e.byteLength),d=f.length;let h=null,p=0,m;for(m=1;mP[0]!==0),E=a.vectors.findIndex(P=>P[1]!==0),k=a.vectors.findIndex(P=>P[2]!==0),I=[];I[C]="x",I[E]="y",I[k]="z",g.axisOrder=I}else g.axisOrder=["x","y","z"];const b=new Se().fromArray(a.vectors[0]).length(),_=new Se().fromArray(a.vectors[1]).length(),S=new Se().fromArray(a.vectors[2]).length();g.spacing=[b,_,S],g.matrix=new Gn;const O=new Gn;if(a.space==="left-posterior-superior"?O.set(-1,0,0,0,0,-1,0,0,0,0,1,0,0,0,0,1):a.space==="left-anterior-superior"&&O.set(1,0,0,0,0,1,0,0,0,0,-1,0,0,0,0,1),!a.vectors)g.matrix.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);else{const C=a.vectors,E=new Gn().set(C[0][0],C[1][0],C[2][0],0,C[0][1],C[1][1],C[2][1],0,C[0][2],C[1][2],C[2][2],0,0,0,0,1);g.matrix=new Gn().multiplyMatrices(E,O)}return g.inverseMatrix=new Gn,g.inverseMatrix.copy(g.matrix).invert(),g.RASDimensions=new Se(g.xLength,g.yLength,g.zLength).applyMatrix4(g.matrix).round().toArray().map(Math.abs),g.lowerThreshold===-1/0&&(g.lowerThreshold=y),g.upperThreshold===1/0&&(g.upperThreshold=x),g}parseChars(e,n,r){n===void 0&&(n=0),r===void 0&&(r=e.length);let i="",o;for(o=n;o{n.setVolume(f,lb.getVolumeOptions(this.props)),vD[a]=f,s(a,{status:"ok"})},()=>{},f=>{f.response instanceof Response?f.response.json().then(d=>{const h=d.error,p=!!h&&h.message;h&&h.exception&&console.debug("exception:",h.exception),s(a,{status:"error",message:p||`${f}`})}):s(a,{status:"error",message:`${f}`})})}}}render(){const{volumeId:n}=this.props;let r,i;if(!n)r=[w.jsx(At,{variant:"subtitle2",children:"Cannot display 3D volume"},"subtitle2"),w.jsx(At,{variant:"body2",children:"To display a volume, a variable and a place that represents an area must be selected. Please note that the 3D volume rendering is still an experimental feature."},"body2")];else{const o=this.props.volumeStates[n];(!o||o.status==="error"||!vD[n])&&(i=[w.jsx(er,{onClick:this.handleLoadVolume,disabled:!!o&&o.status==="loading",children:fe.get("Load Volume Data")},"load"),w.jsx(At,{variant:"body2",children:fe.get("Please note that the 3D volume rendering is still an experimental feature.")},"note")]),o&&(o.status==="loading"?r=w.jsx(Qv,{style:{margin:10}}):o.status==="error"&&(r=w.jsx(At,{variant:"body2",color:"red",children:`Failed loading volume: ${o.message}`})))}return r&&(r=w.jsx("div",{style:xJ,children:r})),i&&(i=w.jsx("div",{style:xJ,children:i})),w.jsxs("div",{style:RVt,children:[i,r,w.jsx("canvas",{id:"VolumeCanvas-canvas",ref:this.canvasRef,style:MVt}),!r&&!i&&AVt]})}updateVolumeScene(){const n=this.canvasRef.current;if(n===null){this.volumeScene=null;return}let r;this.props.volumeId&&(r=vD[this.props.volumeId]);let i=!1;(this.volumeScene===null||this.volumeScene.canvas!==n)&&(this.volumeScene=new lVt(n),i=!0),i&&r?this.volumeScene.setVolume(r,lb.getVolumeOptions(this.props)):this.volumeScene.setVolumeOptions(lb.getVolumeOptions(this.props))}}function bJ(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;for(const o of t){const a=o[0],s=o[1];e=Math.min(e,a),n=Math.min(n,s),r=Math.max(r,a),i=Math.max(i,s)}return[e,n,r,i]}function IVt(t){let[e,n,r,i]=t[0];for(const o of t.slice(1))e=Math.min(e,o[0]),n=Math.min(n,o[1]),r=Math.max(r,o[2]),i=Math.max(i,o[3]);return[e,n,r,i]}const PP={card:t=>({maxWidth:"100%",marginBottom:t.spacing(1),marginRight:t.spacing(1)}),info:t=>({marginRight:t.spacing(1)}),close:{marginLeft:"auto"},cardContent:{padding:8},isoEditor:{display:"flex",flexDirection:"row"},isoTextField:{minWidth:"16em",marginLeft:"1em"},isoSlider:{minWidth:200}},DVt=({selectedDataset:t,selectedVariable:e,selectedPlaceInfo:n,variableColorBar:r,volumeId:i,volumeRenderMode:o,setVolumeRenderMode:a,volumeStates:s,updateVolumeState:l,updateVariableVolume:c,serverUrl:u})=>{let f=.5;e&&(typeof e.volumeIsoThreshold=="number"?f=e.volumeIsoThreshold:f=.5*(e.colorBarMin+e.colorBarMax),typeof e.volumeRenderMode=="string"&&(o=e.volumeRenderMode));const d=p=>{c(t.id,e.name,r,o,p)},h=(p,m)=>{m!==null&&(a(m),e&&c(t.id,e.name,r,m,f))};return w.jsxs(Lre,{sx:PP.card,children:[w.jsx($re,{disableSpacing:!0,children:e&&w.jsxs(w.Fragment,{children:[w.jsxs(Jv,{size:"small",exclusive:!0,value:o,onChange:h,children:[w.jsx(Pn,{value:"mip",size:"small",children:w.jsx(_t,{arrow:!0,title:"Maximum intensity projection",children:w.jsx("span",{children:"MIP"})})},"mip"),w.jsx(Pn,{value:"aip",size:"small",children:w.jsx(_t,{arrow:!0,title:"Average intensity projection",children:w.jsx("span",{children:"AIP"})})},"aip"),w.jsx(Pn,{value:"iso",size:"small",children:w.jsx(_t,{arrow:!0,title:"Iso-surface extraction",children:w.jsx("span",{children:"ISO"})})},"iso")]},0),o==="iso"&&w.jsx(LVt,{minValue:e.colorBarMin,maxValue:e.colorBarMax,value:f,setValue:d})]})}),w.jsx(Nre,{sx:PP.cardContent,children:w.jsx(lb,{selectedDataset:t,selectedVariable:e,selectedPlaceInfo:n,variableColorBar:r,volumeRenderMode:o,volumeIsoThreshold:f,volumeId:i,volumeStates:s,updateVolumeState:l,serverUrl:u})})]})},LVt=({value:t,minValue:e,maxValue:n,setValue:r,disabled:i})=>{const[o,a]=ue.useState(t),[s,l]=ue.useState(""+t),[c,u]=ue.useState(null);function f(m){const g=m.target.value||"";l(g);const v=parseFloat(g);Number.isNaN(v)?u("Not a number"):vn?u("Out of range"):u(null)}function d(m){if(m.key==="Enter"&&!c){const g=parseFloat(s);a(g),r(g)}}function h(m,g){a(g),l(g.toFixed(2))}function p(m,g){r(g)}return w.jsx(lr,{sx:PP.isoTextField,disabled:i,label:"Iso-Threshold",variant:"filled",size:"small",value:s,error:c!==null,onChange:f,onKeyPress:d,InputProps:{endAdornment:w.jsx(Zv,{size:"small",sx:PP.isoSlider,min:e,max:n,value:o,step:(n-e)/20,onChange:h,onChangeCommitted:p})}})},$Vt=t=>({locale:t.controlState.locale,selectedDataset:Gr(t),selectedVariable:vo(t),selectedPlaceInfo:Z1(t),variableColorBar:AB(t),volumeRenderMode:t.controlState.volumeRenderMode,volumeId:QHe(t),volumeStates:t.controlState.volumeStates,serverUrl:hi(t).url}),NVt={setVolumeRenderMode:L7e,updateVolumeState:$7e,updateVariableVolume:h7e},FVt=Jt($Vt,NVt)(DVt),jVt={info:w.jsx(Xz,{fontSize:"inherit"}),timeSeries:w.jsx(mfe,{fontSize:"inherit"}),stats:w.jsx(uz,{fontSize:"inherit"}),volume:w.jsx(gfe,{fontSize:"inherit"})},BVt={info:"Info",timeSeries:"Time-Series",stats:"Statistics",volume:"Volume"},yD={tabs:{minHeight:"34px"},tab:{padding:"5px 10px",textTransform:"none",fontWeight:"regular",minHeight:"32px"},tabBoxHeader:{borderBottom:1,borderColor:"divider",position:"sticky",top:0,zIndex:1100,backgroundColor:"background.paper"}},zVt=t=>({sidebarPanelId:t.controlState.sidebarPanelId}),UVt={setSidebarPanelId:HB};function WVt({sidebarPanelId:t,setSidebarPanelId:e}){return w.jsxs(Ke,{sx:{width:"100%"},children:[w.jsx(Ke,{sx:yD.tabBoxHeader,children:w.jsx(x5,{value:t,onChange:(n,r)=>{e(r)},variant:"scrollable",sx:yD.tabs,children:eHe.map(n=>w.jsx(Ib,{icon:jVt[n],iconPosition:"start",sx:yD.tab,disableRipple:!0,value:n,label:fe.get(BVt[n])},n))})}),t==="info"&&w.jsx(ygt,{}),t==="stats"&&w.jsx(tBt,{}),t==="timeSeries"&&w.jsx(j5t,{}),t==="volume"&&w.jsx(FVt,{})]})}const VVt=Jt(zVt,UVt)(WVt),KO={containerHor:{flexGrow:1,overflow:"hidden"},containerVer:{flexGrow:1,overflowX:"hidden",overflowY:"auto"},viewerHor:{height:"100%",overflow:"hidden",padding:0},viewerVer:{width:"100%",overflow:"hidden",padding:0},sidebarHor:{flex:"auto",overflowX:"hidden",overflowY:"auto"},sidebarVer:{width:"100%",overflow:"hidden"},viewer:{overflow:"hidden",width:"100%",height:"100%"}},GVt=t=>({sidebarOpen:t.controlState.sidebarOpen,sidebarPosition:t.controlState.sidebarPosition}),HVt={setSidebarPosition:D7e},_J=()=>window.innerWidth/window.innerHeight>=1?"hor":"ver";function qVt({sidebarOpen:t,sidebarPosition:e,setSidebarPosition:n}){const[r,i]=M.useState(null),[o,a]=M.useState(_J()),s=M.useRef(null),l=Vo();M.useEffect(()=>(c(),s.current=new ResizeObserver(c),s.current.observe(document.documentElement),()=>{s.current&&s.current.disconnect()}),[]),M.useEffect(()=>{r&&r.updateSize()},[r,e]);const c=()=>{a(_J())},u=o==="hor"?"Hor":"Ver";return t?w.jsxs(uot,{dir:o,splitPosition:e,setSplitPosition:n,style:KO["container"+u],child1Style:KO["viewer"+u],child2Style:KO["sidebar"+u],children:[w.jsx(B9,{onMapRef:i,theme:l}),w.jsx(VVt,{})]}):w.jsx("div",{style:KO.viewer,children:w.jsx(B9,{onMapRef:i,theme:l})})}const XVt=Jt(GVt,HVt)(qVt);var Ak={exports:{}},t0e={};function n0e(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const n=(t=window.document)===null||t===void 0||(t=t.documentElement)===null||t===void 0?void 0:t.style;if(!n||e in n)return"";for(let r=0;re===n.identifier)||t.changedTouches&&(0,wa.findInArray)(t.changedTouches,n=>e===n.identifier)}function g8t(t){if(t.targetTouches&&t.targetTouches[0])return t.targetTouches[0].identifier;if(t.changedTouches&&t.changedTouches[0])return t.changedTouches[0].identifier}function v8t(t){if(!t)return;let e=t.getElementById("react-draggable-style-el");e||(e=t.createElement("style"),e.type="text/css",e.id="react-draggable-style-el",e.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} + }`};function sVt(){try{const t=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&t.getContext("webgl2"))}catch{return!1}}class lVt{constructor(){Yt(this,"textures");this.textures={}}get(e,n){const r=ZT(e);let i=this.textures[r];return i||(i=new rVt().load(`data:image/png;base64,${e.imageData}`,n),this.textures[r]=i),i}}const cVt=new lVt;class uVt{constructor(e){Yt(this,"canvas");Yt(this,"camera");Yt(this,"renderer");Yt(this,"scene");Yt(this,"material");if(!sVt())throw new Error("Missing WebGL2");this.render=this.render.bind(this);const n=new qye({canvas:e});n.setPixelRatio(window.devicePixelRatio),n.setSize(e.clientWidth,e.clientHeight);const r=100,i=e.clientWidth/e.clientHeight,o=new Uye(-r*i,r*i,r,-r,-1e3,1e3);o.position.set(0,0,100),o.up.set(0,1,0);const a=new oVt(o,n.domElement);a.target.set(100,50,0),a.minZoom=.1,a.maxZoom=500,a.enablePan=!0,a.update(),this.canvas=e,this.renderer=n,this.camera=o,this.scene=null,this.material=null,a.addEventListener("change",this.render),e.addEventListener("resize",this.onCanvasResize)}setVolume(e,n){const r=new Rye(e.data,e.xLength,e.yLength,e.zLength);r.format=Tye,r.type=Of,r.minFilter=r.magFilter=Eo,r.unpackAlignment=1,r.needsUpdate=!0;const i=aVt,o=Nye.clone(i.uniforms),[a,s,l]=e.spacing,c=Math.floor(a*e.xLength),u=Math.floor(s*e.yLength),f=Math.floor(l*e.zLength);o.u_data.value=r,o.u_size.value.set(c,u,f);const d=new od({uniforms:o,vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:_a}),h=new Hy(c,u,f);h.translate(c/2,u/2,f/2);const p=new Nl(h,d),m=new QWt;m.add(p),m.add(new iVt(p)),this.scene=m,this.material=d,this.setVolumeOptions(n)}setVolumeOptions(e){const n=this.material;if(n!==null){const{value1:r,value2:i,isoThreshold:o,renderMode:a,colorBar:s}=e,l=n.uniforms;l.u_clim.value.set(r,i),l.u_renderthreshold.value=o,l.u_renderstyle.value=a==="mip"?0:a==="aip"?1:2,l.u_cmdata.value=cVt.get(s,this.render),this.render()}}getMaterial(){if(this.material===null)throw new Error("Volume not set!");return this.material}onCanvasResize(){console.warn("Alarm: Canvas resize!");const e=this.renderer.domElement;this.renderer.setSize(e.clientWidth,e.clientHeight);const n=e.clientWidth/e.clientHeight,r=this.camera.top-this.camera.bottom;this.camera.left=-r*n/2,this.camera.right=r*n/2,this.camera.updateProjectionMatrix(),this.render()}render(){this.scene!==null&&this.renderer.render(this.scene,this.camera)}}var pa=Uint8Array,Th=Uint16Array,Qye=Uint32Array,Yye=new pa([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Kye=new pa([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),fVt=new pa([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Zye=function(t,e){for(var n=new Th(31),r=0;r<31;++r)n[r]=e+=1<>>1|(Zn&21845)<<1;Wu=(Wu&52428)>>>2|(Wu&13107)<<2,Wu=(Wu&61680)>>>4|(Wu&3855)<<4,wF[Zn]=((Wu&65280)>>>8|(Wu&255)<<8)>>>1}var sb=function(t,e,n){for(var r=t.length,i=0,o=new Th(e);i>>l]=c}else for(s=new Th(r),i=0;i>>15-t[i]);return s},Aw=new pa(288);for(var Zn=0;Zn<144;++Zn)Aw[Zn]=8;for(var Zn=144;Zn<256;++Zn)Aw[Zn]=9;for(var Zn=256;Zn<280;++Zn)Aw[Zn]=7;for(var Zn=280;Zn<288;++Zn)Aw[Zn]=8;var t0e=new pa(32);for(var Zn=0;Zn<32;++Zn)t0e[Zn]=5;var mVt=sb(Aw,9,1),gVt=sb(t0e,5,1),gD=function(t){for(var e=t[0],n=1;ne&&(e=t[n]);return e},Rs=function(t,e,n){var r=e/8|0;return(t[r]|t[r+1]<<8)>>(e&7)&n},vD=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(e&7)},vVt=function(t){return(t+7)/8|0},yVt=function(t,e,n){(e==null||e<0)&&(e=0),(n==null||n>t.length)&&(n=t.length);var r=new(t.BYTES_PER_ELEMENT==2?Th:t.BYTES_PER_ELEMENT==4?Qye:pa)(n-e);return r.set(t.subarray(e,n)),r},xVt=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],kc=function(t,e,n){var r=new Error(e||xVt[t]);if(r.code=t,Error.captureStackTrace&&Error.captureStackTrace(r,kc),!n)throw r;return r},bVt=function(t,e,n){var r=t.length;if(!r||n&&n.f&&!n.l)return e||new pa(0);var i=!e||n,o=!n||n.i;n||(n={}),e||(e=new pa(r*3));var a=function(K){var se=e.length;if(K>se){var te=new pa(Math.max(se*2,K));te.set(e),e=te}},s=n.f||0,l=n.p||0,c=n.b||0,u=n.l,f=n.d,d=n.m,h=n.n,p=r*8;do{if(!u){s=Rs(t,l,1);var m=Rs(t,l+1,3);if(l+=3,m)if(m==1)u=mVt,f=gVt,d=9,h=5;else if(m==2){var x=Rs(t,l,31)+257,b=Rs(t,l+10,15)+4,_=x+Rs(t,l+5,31)+1;l+=14;for(var S=new pa(_),O=new pa(19),C=0;C>>4;if(g<16)S[C++]=g;else{var R=0,T=0;for(g==16?(T=3+Rs(t,l,3),l+=2,R=S[C-1]):g==17?(T=3+Rs(t,l,7),l+=3):g==18&&(T=11+Rs(t,l,127),l+=7);T--;)S[C++]=R}}var L=S.subarray(0,x),z=S.subarray(x);d=gD(L),h=gD(z),u=sb(L,d,1),f=sb(z,h,1)}else kc(1);else{var g=vVt(l)+4,v=t[g-4]|t[g-3]<<8,y=g+v;if(y>r){o&&kc(0);break}i&&a(c+v),e.set(t.subarray(g,y),c),n.b=c+=v,n.p=l=y*8,n.f=s;continue}if(l>p){o&&kc(0);break}}i&&a(c+131072);for(var B=(1<>>4;if(l+=R&15,l>p){o&&kc(0);break}if(R||kc(2),N<256)e[c++]=N;else if(N==256){U=l,u=null;break}else{var $=N-254;if(N>264){var C=N-257,D=Yye[C];$=Rs(t,l,(1<>>4;A||kc(3),l+=A&15;var z=pVt[q];if(q>3){var D=Kye[q];z+=vD(t,l)&(1<p){o&&kc(0);break}i&&a(c+131072);for(var Y=c+$;c>3&1)+(e>>4&1);r>0;r-=!t[n++]);return n+(e&2)},SVt=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0};function OVt(t,e){return bVt(t.subarray(wVt(t),-8),e||new pa(SVt(t)))}var CVt=typeof TextDecoder<"u"&&new TextDecoder,TVt=0;try{CVt.decode(_Vt,{stream:!0}),TVt=1}catch{}class EVt{constructor(e,n,r){const i=this;this.volume=e,n=n||0,Object.defineProperty(this,"index",{get:function(){return n},set:function(s){return n=s,i.geometryNeedsUpdate=!0,n}}),this.axis=r||"z",this.canvas=document.createElement("canvas"),this.canvasBuffer=document.createElement("canvas"),this.updateGeometry();const o=new Ta(this.canvas);o.minFilter=Eo,o.wrapS=o.wrapT=Ha;const a=new f6({map:o,side:qc,transparent:!0});this.mesh=new Nl(this.geometry,a),this.mesh.matrixAutoUpdate=!1,this.geometryNeedsUpdate=!0,this.repaint()}repaint(){this.geometryNeedsUpdate&&this.updateGeometry();const e=this.iLength,n=this.jLength,r=this.sliceAccess,i=this.volume,o=this.canvasBuffer,a=this.ctxBuffer,s=a.getImageData(0,0,e,n),l=s.data,c=i.data,u=i.upperThreshold,f=i.lowerThreshold,d=i.windowLow,h=i.windowHigh;let p=0;if(i.dataType==="label")for(let m=0;m=this.colorMap.length?v%this.colorMap.length+1:v;const y=this.colorMap[v];l[4*p]=y>>24&255,l[4*p+1]=y>>16&255,l[4*p+2]=y>>8&255,l[4*p+3]=y&255,p++}else for(let m=0;m=v&&f<=v?y:0,v=Math.floor(255*(v-d)/(h-d)),v=v>255?255:v<0?0:v|0,l[4*p]=v,l[4*p+1]=v,l[4*p+2]=v,l[4*p+3]=y,p++}a.putImageData(s,0,0),this.ctx.drawImage(o,0,0,e,n,0,0,this.canvas.width,this.canvas.height),this.mesh.material.map.needsUpdate=!0}updateGeometry(){const e=this.volume.extractPerpendicularPlane(this.axis,this.index);this.sliceAccess=e.sliceAccess,this.jLength=e.jLength,this.iLength=e.iLength,this.matrix=e.matrix,this.canvas.width=e.planeWidth,this.canvas.height=e.planeHeight,this.canvasBuffer.width=this.iLength,this.canvasBuffer.height=this.jLength,this.ctx=this.canvas.getContext("2d"),this.ctxBuffer=this.canvasBuffer.getContext("2d"),this.geometry&&this.geometry.dispose(),this.geometry=new Pk(e.planeWidth,e.planeHeight),this.mesh&&(this.mesh.geometry=this.geometry,this.mesh.matrix.identity(),this.mesh.applyMatrix4(this.matrix)),this.geometryNeedsUpdate=!1}}class PVt{constructor(e,n,r,i,o){if(e!==void 0){switch(this.xLength=Number(e)||1,this.yLength=Number(n)||1,this.zLength=Number(r)||1,this.axisOrder=["x","y","z"],i){case"Uint8":case"uint8":case"uchar":case"unsigned char":case"uint8_t":this.data=new Uint8Array(o);break;case"Int8":case"int8":case"signed char":case"int8_t":this.data=new Int8Array(o);break;case"Int16":case"int16":case"short":case"short int":case"signed short":case"signed short int":case"int16_t":this.data=new Int16Array(o);break;case"Uint16":case"uint16":case"ushort":case"unsigned short":case"unsigned short int":case"uint16_t":this.data=new Uint16Array(o);break;case"Int32":case"int32":case"int":case"signed int":case"int32_t":this.data=new Int32Array(o);break;case"Uint32":case"uint32":case"uint":case"unsigned int":case"uint32_t":this.data=new Uint32Array(o);break;case"longlong":case"long long":case"long long int":case"signed long long":case"signed long long int":case"int64":case"int64_t":case"ulonglong":case"unsigned long long":case"unsigned long long int":case"uint64":case"uint64_t":throw new Error("Error in Volume constructor : this type is not supported in JavaScript");case"Float32":case"float32":case"float":this.data=new Float32Array(o);break;case"Float64":case"float64":case"double":this.data=new Float64Array(o);break;default:this.data=new Uint8Array(o)}if(this.data.length!==this.xLength*this.yLength*this.zLength)throw new Error("Error in Volume constructor, lengths are not matching arrayBuffer size")}this.spacing=[1,1,1],this.offset=[0,0,0],this.matrix=new va,this.matrix.identity();let a=-1/0;Object.defineProperty(this,"lowerThreshold",{get:function(){return a},set:function(l){a=l,this.sliceList.forEach(function(c){c.geometryNeedsUpdate=!0})}});let s=1/0;Object.defineProperty(this,"upperThreshold",{get:function(){return s},set:function(l){s=l,this.sliceList.forEach(function(c){c.geometryNeedsUpdate=!0})}}),this.sliceList=[]}getData(e,n,r){return this.data[r*this.xLength*this.yLength+n*this.xLength+e]}access(e,n,r){return r*this.xLength*this.yLength+n*this.xLength+e}reverseAccess(e){const n=Math.floor(e/(this.yLength*this.xLength)),r=Math.floor((e-n*this.yLength*this.xLength)/this.xLength);return[e-n*this.yLength*this.xLength-r*this.xLength,r,n]}map(e,n){const r=this.data.length;n=n||this;for(let i=0;i.9}),x=[l,c,s].find(function(S){return Math.abs(S.dot(v[1]))>.9}),b=[l,c,s].find(function(S){return Math.abs(S.dot(v[2]))>.9});function _(S,O){const C=y===s?a:y.arglet==="i"?S:O,E=x===s?a:x.arglet==="i"?S:O,k=b===s?a:b.arglet==="i"?S:O,I=y.dot(v[0])>0?C:f.xLength-1-C,P=x.dot(v[1])>0?E:f.yLength-1-E,R=b.dot(v[2])>0?k:f.zLength-1-k;return f.access(I,P,R)}return{iLength:h,jLength:p,sliceAccess:_,matrix:u,planeWidth:m,planeHeight:g}}extractSlice(e,n){const r=new EVt(this,n,e);return this.sliceList.push(r),r}repaintAllSlices(){return this.sliceList.forEach(function(e){e.repaint()}),this}computeMinMax(){let e=1/0,n=-1/0;const r=this.data.length;let i=0;for(i=0;i0,o=!0,a={};function s(C,E){E==null&&(E=1);let k=1,I=Uint8Array;switch(C){case"uchar":break;case"schar":I=Int8Array;break;case"ushort":I=Uint16Array,k=2;break;case"sshort":I=Int16Array,k=2;break;case"uint":I=Uint32Array,k=4;break;case"sint":I=Int32Array,k=4;break;case"float":I=Float32Array,k=4;break;case"complex":I=Float64Array,k=8;break;case"double":I=Float64Array,k=8;break}let P=new I(n.slice(r,r+=E*k));return i!==o&&(P=l(P,k)),E===1?P[0]:P}function l(C,E){const k=new Uint8Array(C.buffer,C.byteOffset,C.byteLength);for(let I=0;IR;P--,R++){const T=k[R];k[R]=k[P],k[P]=T}return C}function c(C){let E,k,I,P,R,T,L,z;const B=C.split(/\r?\n/);for(L=0,z=B.length;L13)&&P!==32?I+=String.fromCharCode(P):(I!==""&&(L[z]=B(I,T),z++),I="");return I!==""&&(L[z]=B(I,T),z++),L}const f=s("uchar",e.byteLength),d=f.length;let h=null,p=0,m;for(m=1;mP[0]!==0),E=a.vectors.findIndex(P=>P[1]!==0),k=a.vectors.findIndex(P=>P[2]!==0),I=[];I[C]="x",I[E]="y",I[k]="z",g.axisOrder=I}else g.axisOrder=["x","y","z"];const b=new Se().fromArray(a.vectors[0]).length(),_=new Se().fromArray(a.vectors[1]).length(),S=new Se().fromArray(a.vectors[2]).length();g.spacing=[b,_,S],g.matrix=new Gn;const O=new Gn;if(a.space==="left-posterior-superior"?O.set(-1,0,0,0,0,-1,0,0,0,0,1,0,0,0,0,1):a.space==="left-anterior-superior"&&O.set(1,0,0,0,0,1,0,0,0,0,-1,0,0,0,0,1),!a.vectors)g.matrix.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);else{const C=a.vectors,E=new Gn().set(C[0][0],C[1][0],C[2][0],0,C[0][1],C[1][1],C[2][1],0,C[0][2],C[1][2],C[2][2],0,0,0,0,1);g.matrix=new Gn().multiplyMatrices(E,O)}return g.inverseMatrix=new Gn,g.inverseMatrix.copy(g.matrix).invert(),g.RASDimensions=new Se(g.xLength,g.yLength,g.zLength).applyMatrix4(g.matrix).round().toArray().map(Math.abs),g.lowerThreshold===-1/0&&(g.lowerThreshold=y),g.upperThreshold===1/0&&(g.upperThreshold=x),g}parseChars(e,n,r){n===void 0&&(n=0),r===void 0&&(r=e.length);let i="",o;for(o=n;o{n.setVolume(f,lb.getVolumeOptions(this.props)),yD[a]=f,s(a,{status:"ok"})},()=>{},f=>{f.response instanceof Response?f.response.json().then(d=>{const h=d.error,p=!!h&&h.message;h&&h.exception&&console.debug("exception:",h.exception),s(a,{status:"error",message:p||`${f}`})}):s(a,{status:"error",message:`${f}`})})}}}render(){const{volumeId:n}=this.props;let r,i;if(!n)r=[w.jsx(At,{variant:"subtitle2",children:"Cannot display 3D volume"},"subtitle2"),w.jsx(At,{variant:"body2",children:"To display a volume, a variable and a place that represents an area must be selected. Please note that the 3D volume rendering is still an experimental feature."},"body2")];else{const o=this.props.volumeStates[n];(!o||o.status==="error"||!yD[n])&&(i=[w.jsx(er,{onClick:this.handleLoadVolume,disabled:!!o&&o.status==="loading",children:fe.get("Load Volume Data")},"load"),w.jsx(At,{variant:"body2",children:fe.get("Please note that the 3D volume rendering is still an experimental feature.")},"note")]),o&&(o.status==="loading"?r=w.jsx(Qv,{style:{margin:10}}):o.status==="error"&&(r=w.jsx(At,{variant:"body2",color:"red",children:`Failed loading volume: ${o.message}`})))}return r&&(r=w.jsx("div",{style:_J,children:r})),i&&(i=w.jsx("div",{style:_J,children:i})),w.jsxs("div",{style:DVt,children:[i,r,w.jsx("canvas",{id:"VolumeCanvas-canvas",ref:this.canvasRef,style:AVt}),!r&&!i&&IVt]})}updateVolumeScene(){const n=this.canvasRef.current;if(n===null){this.volumeScene=null;return}let r;this.props.volumeId&&(r=yD[this.props.volumeId]);let i=!1;(this.volumeScene===null||this.volumeScene.canvas!==n)&&(this.volumeScene=new uVt(n),i=!0),i&&r?this.volumeScene.setVolume(r,lb.getVolumeOptions(this.props)):this.volumeScene.setVolumeOptions(lb.getVolumeOptions(this.props))}}function wJ(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;for(const o of t){const a=o[0],s=o[1];e=Math.min(e,a),n=Math.min(n,s),r=Math.max(r,a),i=Math.max(i,s)}return[e,n,r,i]}function LVt(t){let[e,n,r,i]=t[0];for(const o of t.slice(1))e=Math.min(e,o[0]),n=Math.min(n,o[1]),r=Math.max(r,o[2]),i=Math.max(i,o[3]);return[e,n,r,i]}const PP={card:t=>({maxWidth:"100%",marginBottom:t.spacing(1),marginRight:t.spacing(1)}),info:t=>({marginRight:t.spacing(1)}),close:{marginLeft:"auto"},cardContent:{padding:8},isoEditor:{display:"flex",flexDirection:"row"},isoTextField:{minWidth:"16em",marginLeft:"1em"},isoSlider:{minWidth:200}},$Vt=({selectedDataset:t,selectedVariable:e,selectedPlaceInfo:n,variableColorBar:r,volumeId:i,volumeRenderMode:o,setVolumeRenderMode:a,volumeStates:s,updateVolumeState:l,updateVariableVolume:c,serverUrl:u})=>{let f=.5;e&&(typeof e.volumeIsoThreshold=="number"?f=e.volumeIsoThreshold:f=.5*(e.colorBarMin+e.colorBarMax),typeof e.volumeRenderMode=="string"&&(o=e.volumeRenderMode));const d=p=>{c(t.id,e.name,r,o,p)},h=(p,m)=>{m!==null&&(a(m),e&&c(t.id,e.name,r,m,f))};return w.jsxs(Nre,{sx:PP.card,children:[w.jsx(Fre,{disableSpacing:!0,children:e&&w.jsxs(w.Fragment,{children:[w.jsxs(Jv,{size:"small",exclusive:!0,value:o,onChange:h,children:[w.jsx(Pn,{value:"mip",size:"small",children:w.jsx(_t,{arrow:!0,title:"Maximum intensity projection",children:w.jsx("span",{children:"MIP"})})},"mip"),w.jsx(Pn,{value:"aip",size:"small",children:w.jsx(_t,{arrow:!0,title:"Average intensity projection",children:w.jsx("span",{children:"AIP"})})},"aip"),w.jsx(Pn,{value:"iso",size:"small",children:w.jsx(_t,{arrow:!0,title:"Iso-surface extraction",children:w.jsx("span",{children:"ISO"})})},"iso")]},0),o==="iso"&&w.jsx(NVt,{minValue:e.colorBarMin,maxValue:e.colorBarMax,value:f,setValue:d})]})}),w.jsx(jre,{sx:PP.cardContent,children:w.jsx(lb,{selectedDataset:t,selectedVariable:e,selectedPlaceInfo:n,variableColorBar:r,volumeRenderMode:o,volumeIsoThreshold:f,volumeId:i,volumeStates:s,updateVolumeState:l,serverUrl:u})})]})},NVt=({value:t,minValue:e,maxValue:n,setValue:r,disabled:i})=>{const[o,a]=ue.useState(t),[s,l]=ue.useState(""+t),[c,u]=ue.useState(null);function f(m){const g=m.target.value||"";l(g);const v=parseFloat(g);Number.isNaN(v)?u("Not a number"):vn?u("Out of range"):u(null)}function d(m){if(m.key==="Enter"&&!c){const g=parseFloat(s);a(g),r(g)}}function h(m,g){a(g),l(g.toFixed(2))}function p(m,g){r(g)}return w.jsx(lr,{sx:PP.isoTextField,disabled:i,label:"Iso-Threshold",variant:"filled",size:"small",value:s,error:c!==null,onChange:f,onKeyPress:d,InputProps:{endAdornment:w.jsx(Zv,{size:"small",sx:PP.isoSlider,min:e,max:n,value:o,step:(n-e)/20,onChange:h,onChangeCommitted:p})}})},FVt=t=>({locale:t.controlState.locale,selectedDataset:Gr(t),selectedVariable:vo(t),selectedPlaceInfo:Z1(t),variableColorBar:RB(t),volumeRenderMode:t.controlState.volumeRenderMode,volumeId:KHe(t),volumeStates:t.controlState.volumeStates,serverUrl:hi(t).url}),jVt={setVolumeRenderMode:N7e,updateVolumeState:F7e,updateVariableVolume:m7e},BVt=Jt(FVt,jVt)($Vt),zVt={info:w.jsx(Qz,{fontSize:"inherit"}),timeSeries:w.jsx(gfe,{fontSize:"inherit"}),stats:w.jsx(fz,{fontSize:"inherit"}),volume:w.jsx(vfe,{fontSize:"inherit"})},UVt={info:"Info",timeSeries:"Time-Series",stats:"Statistics",volume:"Volume"},xD={tabs:{minHeight:"34px"},tab:{padding:"5px 10px",textTransform:"none",fontWeight:"regular",minHeight:"32px"},tabBoxHeader:{borderBottom:1,borderColor:"divider",position:"sticky",top:0,zIndex:1100,backgroundColor:"background.paper"}},WVt=t=>({sidebarPanelId:t.controlState.sidebarPanelId}),VVt={setSidebarPanelId:qB};function GVt({sidebarPanelId:t,setSidebarPanelId:e}){return w.jsxs(Ke,{sx:{width:"100%"},children:[w.jsx(Ke,{sx:xD.tabBoxHeader,children:w.jsx(b5,{value:t,onChange:(n,r)=>{e(r)},variant:"scrollable",sx:xD.tabs,children:nHe.map(n=>w.jsx(Ib,{icon:zVt[n],iconPosition:"start",sx:xD.tab,disableRipple:!0,value:n,label:fe.get(UVt[n])},n))})}),t==="info"&&w.jsx(bgt,{}),t==="stats"&&w.jsx(rBt,{}),t==="timeSeries"&&w.jsx(z5t,{}),t==="volume"&&w.jsx(BVt,{})]})}const HVt=Jt(WVt,VVt)(GVt),KO={containerHor:{flexGrow:1,overflow:"hidden"},containerVer:{flexGrow:1,overflowX:"hidden",overflowY:"auto"},viewerHor:{height:"100%",overflow:"hidden",padding:0},viewerVer:{width:"100%",overflow:"hidden",padding:0},sidebarHor:{flex:"auto",overflowX:"hidden",overflowY:"auto"},sidebarVer:{width:"100%",overflow:"hidden"},viewer:{overflow:"hidden",width:"100%",height:"100%"}},qVt=t=>({sidebarOpen:t.controlState.sidebarOpen,sidebarPosition:t.controlState.sidebarPosition}),XVt={setSidebarPosition:$7e},SJ=()=>window.innerWidth/window.innerHeight>=1?"hor":"ver";function QVt({sidebarOpen:t,sidebarPosition:e,setSidebarPosition:n}){const[r,i]=M.useState(null),[o,a]=M.useState(SJ()),s=M.useRef(null),l=Vo();M.useEffect(()=>(c(),s.current=new ResizeObserver(c),s.current.observe(document.documentElement),()=>{s.current&&s.current.disconnect()}),[]),M.useEffect(()=>{r&&r.updateSize()},[r,e]);const c=()=>{a(SJ())},u=o==="hor"?"Hor":"Ver";return t?w.jsxs(dot,{dir:o,splitPosition:e,setSplitPosition:n,style:KO["container"+u],child1Style:KO["viewer"+u],child2Style:KO["sidebar"+u],children:[w.jsx(U9,{onMapRef:i,theme:l}),w.jsx(HVt,{})]}):w.jsx("div",{style:KO.viewer,children:w.jsx(U9,{onMapRef:i,theme:l})})}const YVt=Jt(qVt,XVt)(QVt);var Ak={exports:{}},n0e={};function r0e(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const n=(t=window.document)===null||t===void 0||(t=t.documentElement)===null||t===void 0?void 0:t.style;if(!n||e in n)return"";for(let r=0;re===n.identifier)||t.changedTouches&&(0,wa.findInArray)(t.changedTouches,n=>e===n.identifier)}function y8t(t){if(t.targetTouches&&t.targetTouches[0])return t.targetTouches[0].identifier;if(t.changedTouches&&t.changedTouches[0])return t.changedTouches[0].identifier}function x8t(t){if(!t)return;let e=t.getElementById("react-draggable-style-el");e||(e=t.createElement("style"),e.type="text/css",e.id="react-draggable-style-el",e.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} `,e.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;} -`,t.getElementsByTagName("head")[0].appendChild(e)),t.body&&s0e(t.body,"react-draggable-transparent-selection")}function y8t(t){if(t)try{if(t.body&&l0e(t.body,"react-draggable-transparent-selection"),t.selection)t.selection.empty();else{const e=(t.defaultView||window).getSelection();e&&e.type!=="Caret"&&e.removeAllRanges()}}catch{}}function s0e(t,e){t.classList?t.classList.add(e):t.className.match(new RegExp("(?:^|\\s)".concat(e,"(?!\\S)")))||(t.className+=" ".concat(e))}function l0e(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(new RegExp("(?:^|\\s)".concat(e,"(?!\\S)"),"g"),"")}var fc={};Object.defineProperty(fc,"__esModule",{value:!0});fc.canDragX=_8t;fc.canDragY=w8t;fc.createCoreData=O8t;fc.createDraggableData=C8t;fc.getBoundPosition=x8t;fc.getControlPosition=S8t;fc.snapToGrid=b8t;var ia=uc,og=Sr;function x8t(t,e,n){if(!t.props.bounds)return[e,n];let{bounds:r}=t.props;r=typeof r=="string"?r:T8t(r);const i=h6(t);if(typeof r=="string"){const{ownerDocument:o}=i,a=o.defaultView;let s;if(r==="parent"?s=i.parentNode:s=o.querySelector(r),!(s instanceof a.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=s,c=a.getComputedStyle(i),u=a.getComputedStyle(l);r={left:-i.offsetLeft+(0,ia.int)(u.paddingLeft)+(0,ia.int)(c.marginLeft),top:-i.offsetTop+(0,ia.int)(u.paddingTop)+(0,ia.int)(c.marginTop),right:(0,og.innerWidth)(l)-(0,og.outerWidth)(i)-i.offsetLeft+(0,ia.int)(u.paddingRight)-(0,ia.int)(c.marginRight),bottom:(0,og.innerHeight)(l)-(0,og.outerHeight)(i)-i.offsetTop+(0,ia.int)(u.paddingBottom)-(0,ia.int)(c.marginBottom)}}return(0,ia.isNum)(r.right)&&(e=Math.min(e,r.right)),(0,ia.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,ia.isNum)(r.left)&&(e=Math.max(e,r.left)),(0,ia.isNum)(r.top)&&(n=Math.max(n,r.top)),[e,n]}function b8t(t,e,n){const r=Math.round(e/t[0])*t[0],i=Math.round(n/t[1])*t[1];return[r,i]}function _8t(t){return t.props.axis==="both"||t.props.axis==="x"}function w8t(t){return t.props.axis==="both"||t.props.axis==="y"}function S8t(t,e,n){const r=typeof e=="number"?(0,og.getTouch)(t,e):null;if(typeof e=="number"&&!r)return null;const i=h6(n),o=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return(0,og.offsetXYFromParent)(r||t,o,n.props.scale)}function O8t(t,e,n){const r=!(0,ia.isNum)(t.lastX),i=h6(t);return r?{node:i,deltaX:0,deltaY:0,lastX:e,lastY:n,x:e,y:n}:{node:i,deltaX:e-t.lastX,deltaY:n-t.lastY,lastX:t.lastX,lastY:t.lastY,x:e,y:n}}function C8t(t,e){const n=t.props.scale;return{node:e.node,x:t.state.x+e.deltaX/n,y:t.state.y+e.deltaY/n,deltaX:e.deltaX/n,deltaY:e.deltaY/n,lastX:t.state.x,lastY:t.state.y}}function T8t(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}}function h6(t){const e=t.findDOMNode();if(!e)throw new Error(": Unmounted during event!");return e}var Rk={},Ik={};Object.defineProperty(Ik,"__esModule",{value:!0});Ik.default=E8t;function E8t(){}Object.defineProperty(Rk,"__esModule",{value:!0});Rk.default=void 0;var bD=M8t(M),bo=p6(s1),P8t=p6(Wv),ji=Sr,Vu=fc,_D=uc,q0=p6(Ik);function p6(t){return t&&t.__esModule?t:{default:t}}function c0e(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(c0e=function(r){return r?n:e})(t)}function M8t(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=c0e(e);if(n&&n.has(t))return n.get(t);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&Object.prototype.hasOwnProperty.call(t,o)){var a=i?Object.getOwnPropertyDescriptor(t,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=t[o]}return r.default=t,n&&n.set(t,r),r}function ao(t,e,n){return e=k8t(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function k8t(t){var e=A8t(t,"string");return typeof e=="symbol"?e:String(e)}function A8t(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Is={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let Gu=Is.mouse,Dk=class extends bD.Component{constructor(){super(...arguments),ao(this,"dragging",!1),ao(this,"lastX",NaN),ao(this,"lastY",NaN),ao(this,"touchIdentifier",null),ao(this,"mounted",!1),ao(this,"handleDragStart",e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&typeof e.button=="number"&&e.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error(" not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(e.target instanceof r.defaultView.Node)||this.props.handle&&!(0,ji.matchesSelectorAndParentsTo)(e.target,this.props.handle,n)||this.props.cancel&&(0,ji.matchesSelectorAndParentsTo)(e.target,this.props.cancel,n))return;e.type==="touchstart"&&e.preventDefault();const i=(0,ji.getTouchIdentifier)(e);this.touchIdentifier=i;const o=(0,Vu.getControlPosition)(e,i,this);if(o==null)return;const{x:a,y:s}=o,l=(0,Vu.createCoreData)(this,a,s);(0,q0.default)("DraggableCore: handleDragStart: %j",l),(0,q0.default)("calling",this.props.onStart),!(this.props.onStart(e,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,ji.addUserSelectStyles)(r),this.dragging=!0,this.lastX=a,this.lastY=s,(0,ji.addEvent)(r,Gu.move,this.handleDrag),(0,ji.addEvent)(r,Gu.stop,this.handleDragStop))}),ao(this,"handleDrag",e=>{const n=(0,Vu.getControlPosition)(e,this.touchIdentifier,this);if(n==null)return;let{x:r,y:i}=n;if(Array.isArray(this.props.grid)){let s=r-this.lastX,l=i-this.lastY;if([s,l]=(0,Vu.snapToGrid)(this.props.grid,s,l),!s&&!l)return;r=this.lastX+s,i=this.lastY+l}const o=(0,Vu.createCoreData)(this,r,i);if((0,q0.default)("DraggableCore: handleDrag: %j",o),this.props.onDrag(e,o)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(l)}return}this.lastX=r,this.lastY=i}),ao(this,"handleDragStop",e=>{if(!this.dragging)return;const n=(0,Vu.getControlPosition)(e,this.touchIdentifier,this);if(n==null)return;let{x:r,y:i}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,c=i-this.lastY||0;[l,c]=(0,Vu.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,i=this.lastY+c}const o=(0,Vu.createCoreData)(this,r,i);if(this.props.onStop(e,o)===!1||this.mounted===!1)return!1;const s=this.findDOMNode();s&&this.props.enableUserSelectHack&&(0,ji.removeUserSelectStyles)(s.ownerDocument),(0,q0.default)("DraggableCore: handleDragStop: %j",o),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,s&&((0,q0.default)("DraggableCore: Removing handlers"),(0,ji.removeEvent)(s.ownerDocument,Gu.move,this.handleDrag),(0,ji.removeEvent)(s.ownerDocument,Gu.stop,this.handleDragStop))}),ao(this,"onMouseDown",e=>(Gu=Is.mouse,this.handleDragStart(e))),ao(this,"onMouseUp",e=>(Gu=Is.mouse,this.handleDragStop(e))),ao(this,"onTouchStart",e=>(Gu=Is.touch,this.handleDragStart(e))),ao(this,"onTouchEnd",e=>(Gu=Is.touch,this.handleDragStop(e)))}componentDidMount(){this.mounted=!0;const e=this.findDOMNode();e&&(0,ji.addEvent)(e,Is.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const e=this.findDOMNode();if(e){const{ownerDocument:n}=e;(0,ji.removeEvent)(n,Is.mouse.move,this.handleDrag),(0,ji.removeEvent)(n,Is.touch.move,this.handleDrag),(0,ji.removeEvent)(n,Is.mouse.stop,this.handleDragStop),(0,ji.removeEvent)(n,Is.touch.stop,this.handleDragStop),(0,ji.removeEvent)(e,Is.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,ji.removeUserSelectStyles)(n)}}findDOMNode(){var e,n;return(e=this.props)!==null&&e!==void 0&&e.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:P8t.default.findDOMNode(this)}render(){return bD.cloneElement(bD.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Rk.default=Dk;ao(Dk,"displayName","DraggableCore");ao(Dk,"propTypes",{allowAnyClick:bo.default.bool,children:bo.default.node.isRequired,disabled:bo.default.bool,enableUserSelectHack:bo.default.bool,offsetParent:function(t,e){if(t[e]&&t[e].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:bo.default.arrayOf(bo.default.number),handle:bo.default.string,cancel:bo.default.string,nodeRef:bo.default.object,onStart:bo.default.func,onDrag:bo.default.func,onStop:bo.default.func,onMouseDown:bo.default.func,scale:bo.default.number,className:_D.dontSetMe,style:_D.dontSetMe,transform:_D.dontSetMe});ao(Dk,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1});(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),t.default=void 0;var e=d(M),n=u(s1),r=u(Wv),i=u(YVt),o=Sr,a=fc,s=uc,l=u(Rk),c=u(Ik);function u(y){return y&&y.__esModule?y:{default:y}}function f(y){if(typeof WeakMap!="function")return null;var x=new WeakMap,b=new WeakMap;return(f=function(_){return _?b:x})(y)}function d(y,x){if(!x&&y&&y.__esModule)return y;if(y===null||typeof y!="object"&&typeof y!="function")return{default:y};var b=f(x);if(b&&b.has(y))return b.get(y);var _={},S=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var O in y)if(O!=="default"&&Object.prototype.hasOwnProperty.call(y,O)){var C=S?Object.getOwnPropertyDescriptor(y,O):null;C&&(C.get||C.set)?Object.defineProperty(_,O,C):_[O]=y[O]}return _.default=y,b&&b.set(y,_),_}function h(){return h=Object.assign?Object.assign.bind():function(y){for(var x=1;x{if((0,c.default)("Draggable: onDragStart: %j",_),this.props.onStart(b,(0,a.createDraggableData)(this,_))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),p(this,"onDrag",(b,_)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",_);const S=(0,a.createDraggableData)(this,_),O={x:S.x,y:S.y,slackX:0,slackY:0};if(this.props.bounds){const{x:E,y:k}=O;O.x+=this.state.slackX,O.y+=this.state.slackY;const[I,P]=(0,a.getBoundPosition)(this,O.x,O.y);O.x=I,O.y=P,O.slackX=this.state.slackX+(E-O.x),O.slackY=this.state.slackY+(k-O.y),S.x=O.x,S.y=O.y,S.deltaX=O.x-this.state.x,S.deltaY=O.y-this.state.y}if(this.props.onDrag(b,S)===!1)return!1;this.setState(O)}),p(this,"onDragStop",(b,_)=>{if(!this.state.dragging||this.props.onStop(b,(0,a.createDraggableData)(this,_))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",_);const O={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:E,y:k}=this.props.position;O.x=E,O.y=k}this.setState(O)}),this.state={dragging:!1,dragged:!1,x:x.position?x.position.x:x.defaultPosition.x,y:x.position?x.position.y:x.defaultPosition.y,prevPropsPosition:{...x.position},slackX:0,slackY:0,isElementSVG:!1},x.position&&!(x.onDrag||x.onStop)&&console.warn("A `position` was applied to this , without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var x,b;return(x=(b=this.props)===null||b===void 0||(b=b.nodeRef)===null||b===void 0?void 0:b.current)!==null&&x!==void 0?x:r.default.findDOMNode(this)}render(){const{axis:x,bounds:b,children:_,defaultPosition:S,defaultClassName:O,defaultClassNameDragging:C,defaultClassNameDragged:E,position:k,positionOffset:I,scale:P,...R}=this.props;let T={},L=null;const B=!!!k||this.state.dragging,W=k||S,U={x:(0,a.canDragX)(this)&&B?this.state.x:W.x,y:(0,a.canDragY)(this)&&B?this.state.y:W.y};this.state.isElementSVG?L=(0,o.createSVGTransform)(U,I):T=(0,o.createCSSTransform)(U,I);const N=(0,i.default)(_.props.className||"",O,{[C]:this.state.dragging,[E]:this.state.dragged});return e.createElement(l.default,h({},R,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),e.cloneElement(e.Children.only(_),{className:N,style:{..._.props.style,...T},transform:L}))}}t.default=v,p(v,"displayName","Draggable"),p(v,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:s.dontSetMe,style:s.dontSetMe,transform:s.dontSetMe}),p(v,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(t0e);const{default:u0e,DraggableCore:R8t}=t0e;Ak.exports=u0e;Ak.exports.default=u0e;Ak.exports.DraggableCore=R8t;var f0e=Ak.exports;const I8t=Nt(f0e);var m6={exports:{}},Rw={},g6={};g6.__esModule=!0;g6.cloneElement=j8t;var D8t=L8t(M);function L8t(t){return t&&t.__esModule?t:{default:t}}function OJ(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function CJ(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function TJ(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function wD(t){for(var e=1;eMath.abs(d*u)?o=i/u:i=o*u}var h=i,p=o,m=this.slack||[0,0],g=m[0],v=m[1];return i+=g,o+=v,s&&(i=Math.max(s[0],i),o=Math.max(s[1],o)),l&&(i=Math.min(l[0],i),o=Math.min(l[1],o)),this.slack=[g+(h-i),v+(p-o)],[i,o]},n.resizeHandler=function(i,o){var a=this;return function(s,l){var c=l.node,u=l.deltaX,f=l.deltaY;i==="onResizeStart"&&a.resetData();var d=(a.props.axis==="both"||a.props.axis==="x")&&o!=="n"&&o!=="s",h=(a.props.axis==="both"||a.props.axis==="y")&&o!=="e"&&o!=="w";if(!(!d&&!h)){var p=o[0],m=o[o.length-1],g=c.getBoundingClientRect();if(a.lastHandleRect!=null){if(m==="w"){var v=g.left-a.lastHandleRect.left;u+=v}if(p==="n"){var y=g.top-a.lastHandleRect.top;f+=y}}a.lastHandleRect=g,m==="w"&&(u=-u),p==="n"&&(f=-f);var x=a.props.width+(d?u/a.props.transformScale:0),b=a.props.height+(h?f/a.props.transformScale:0),_=a.runConstraints(x,b);x=_[0],b=_[1];var S=x!==a.props.width||b!==a.props.height,O=typeof a.props[i]=="function"?a.props[i]:null,C=i==="onResize"&&!S;O&&!C&&(s.persist==null||s.persist(),O(s,{node:c,size:{width:x,height:b},handle:o})),i==="onResizeStop"&&a.resetData()}}},n.renderResizeHandle=function(i,o){var a=this.props.handle;if(!a)return X0.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+i,ref:o});if(typeof a=="function")return a(i,o);var s=typeof a.type=="string",l=wD({ref:o},s?{}:{handleAxis:i});return X0.cloneElement(a,l)},n.render=function(){var i=this,o=this.props,a=o.children,s=o.className,l=o.draggableOpts;o.width,o.height,o.handle,o.handleSize,o.lockAspectRatio,o.axis,o.minConstraints,o.maxConstraints,o.onResize,o.onResizeStop,o.onResizeStart;var c=o.resizeHandles;o.transformScale;var u=q8t(o,G8t);return(0,W8t.cloneElement)(a,wD(wD({},u),{},{className:(s?s+" ":"")+"react-resizable",children:[].concat(a.props.children,c.map(function(f){var d,h=(d=i.handleRefs[f])!=null?d:i.handleRefs[f]=X0.createRef();return X0.createElement(U8t.DraggableCore,wF({},l,{nodeRef:h,key:"resizableHandle-"+f,onStop:i.resizeHandler("onResizeStop",f),onStart:i.resizeHandler("onResizeStart",f),onDrag:i.resizeHandler("onResize",f)}),i.renderResizeHandle(f,h))}))}))},e}(X0.Component);Rw.default=v6;v6.propTypes=V8t.resizableProps;v6.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var Lk={};Lk.__esModule=!0;Lk.default=void 0;var SD=nGt(M),Z8t=h0e(s1),J8t=h0e(Rw),eGt=Iw,tGt=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function h0e(t){return t&&t.__esModule?t:{default:t}}function p0e(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(p0e=function(i){return i?n:e})(t)}function nGt(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=p0e(e);if(n&&n.has(t))return n.get(t);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&Object.prototype.hasOwnProperty.call(t,o)){var a=i?Object.getOwnPropertyDescriptor(t,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=t[o]}return r.default=t,n&&n.set(t,r),r}function OF(){return OF=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function sGt(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,CF(t,e)}function CF(t,e){return CF=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},CF(t,e)}var m0e=function(t){sGt(e,t);function e(){for(var r,i=arguments.length,o=new Array(i),a=0;an(t,!i.visible)}),r?w.jsx(Qg,{}):w.jsx(Qg,{variant:"inset",component:"li",style:{margin:"0 0 0 52px"}})]})}const dGt={x:48,y:128},hGt={width:320,height:520},JO={resizeBox:{position:"absolute",zIndex:1e3},windowPaper:{width:"100%",height:"100%",display:"flex",flexDirection:"column"},windowHeader:t=>({display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"move",padding:1,marginBottom:"2px",borderBottom:`1px solid ${t.palette.mode==="dark"?"#FFFFFF3F":"#0000003F"}`}),windowTitle:{fontWeight:"bolder"}};function pGt(t){const[e,n]=M.useState(dGt),[r,i]=M.useState(hGt),{layerMenuOpen:o,setLayerMenuOpen:a,openDialog:s,...l}=t;if(!o)return null;console.log("layerProps",l);const c=()=>{s("userOverlays")},u=()=>{s("userBaseMaps")},f=()=>{a(!1)},d=(p,m)=>{n({...m})},h=(p,m)=>{i({...m.size})};return w.jsx(I8t,{handle:"#layer-select-header",position:e,onStop:d,children:w.jsx(lGt,{width:r.width,height:r.height,style:JO.resizeBox,onResize:h,children:w.jsxs(Go,{elevation:10,sx:JO.windowPaper,component:"div",children:[w.jsxs(Ke,{id:"layer-select-header",sx:JO.windowHeader,children:[w.jsx(Ke,{component:"span",sx:JO.windowTitle,children:fe.get("Layers")}),w.jsx(Ot,{size:"small",onClick:f,children:w.jsx(kp,{fontSize:"inherit"})})]}),w.jsx(Ke,{sx:{width:"100%",overflow:"auto",flexGrow:1},children:w.jsxs(Zre,{dense:!0,children:[w.jsx(wc,{layerId:"overlay",...l}),w.jsx(wc,{layerId:"userPlaces",...l}),w.jsx(wc,{layerId:"datasetPlaces",...l}),w.jsx(wc,{layerId:"datasetBoundary",...l}),w.jsx(wc,{layerId:"datasetVariable",...l}),w.jsx(wc,{layerId:"datasetVariable2",...l}),w.jsx(wc,{layerId:"datasetRgb",...l}),w.jsx(wc,{layerId:"datasetRgb2",...l}),w.jsx(wc,{layerId:"baseMap",...l,last:!0}),w.jsx(Nr,{onClick:u,children:fe.get("User Base Maps")+"..."}),w.jsx(Nr,{onClick:c,children:fe.get("User Overlays")+"..."})]})})]})})})}const mGt=t=>({locale:t.controlState.locale,layerMenuOpen:t.controlState.layerMenuOpen,layerStates:T9e(t)}),gGt={openDialog:Pp,setLayerMenuOpen:Rle,setLayerVisibility:T7e},vGt=Jt(mGt,gGt)(pGt),yGt=t=>({locale:t.controlState.locale,hasConsent:t.controlState.privacyNoticeAccepted,compact:Kt.instance.branding.compact}),xGt={},bGt=we("main")(({theme:t})=>({padding:0,width:"100vw",height:"100vh",overflow:"hidden",display:"flex",flexDirection:"column",alignItems:"stretch",[t.breakpoints.up("md")]:{overflow:"hidden"}})),_Gt=({hasConsent:t,compact:e})=>w.jsxs(bGt,{children:[!e&&w.jsx(BM,{variant:"dense"}),t&&w.jsxs(w.Fragment,{children:[w.jsx(lot,{}),w.jsx(XVt,{}),w.jsx(vGt,{})]})]}),wGt=Jt(yGt,xGt)(_Gt),SGt={icon:t=>({marginRight:t.spacing(2)})};function OGt({open:t,settings:e,updateSettings:n,syncWithServer:r}){const[i,o]=M.useState(null);if(M.useEffect(()=>{const l=fe.get("docs/privacy-note.en.md");fetch(l).then(c=>c.text()).then(c=>o(c))}),!t)return null;function a(){n({...e,privacyNoticeAccepted:!0}),r()}function s(){try{window.history.length>0?window.history.back():typeof window.home=="function"?window.home():window.location.href="about:home"}catch(l){console.error(l)}}return w.jsxs(el,{open:t,disableEscapeKeyDown:!0,keepMounted:!0,scroll:"body",children:[w.jsx(dd,{children:fe.get("Privacy Notice")}),w.jsx(qs,{children:w.jsx(qke,{children:i===null?w.jsx(Qv,{}):w.jsx(S2,{children:i,linkTarget:"_blank"})})}),w.jsxs(yp,{children:[w.jsxs(er,{onClick:a,children:[w.jsx(x6,{sx:SGt.icon}),fe.get("Accept and continue")]}),w.jsx(er,{onClick:s,children:fe.get("Leave")})]})]})}const CGt=t=>({open:!t.controlState.privacyNoticeAccepted,settings:t.controlState}),TGt={updateSettings:J1,syncWithServer:UB},EGt=Jt(CGt,TGt)(OGt),PGt=Li(Qv)(({theme:t})=>({margin:t.spacing(2)})),MGt=Li(At)(({theme:t})=>({margin:t.spacing(1)})),kGt=Li("div")(({theme:t})=>({margin:t.spacing(1),textAlign:"center",display:"flex",alignItems:"center",flexDirection:"column"}));function AGt({messages:t}){return t.length===0?null:w.jsxs(el,{open:!0,"aria-labelledby":"loading",children:[w.jsx(dd,{id:"loading",children:fe.get("Please wait...")}),w.jsxs(kGt,{children:[w.jsx(PGt,{}),t.map((e,n)=>w.jsx(MGt,{children:e},n))]})]})}const RGt=t=>({locale:t.controlState.locale,messages:_9e(t)}),IGt={},DGt=Jt(RGt,IGt)(AGt);var b6={},LGt=ct;Object.defineProperty(b6,"__esModule",{value:!0});var v0e=b6.default=void 0,$Gt=LGt(pt()),NGt=w;v0e=b6.default=(0,$Gt.default)((0,NGt.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"}),"Error");var _6={},FGt=ct;Object.defineProperty(_6,"__esModule",{value:!0});var y0e=_6.default=void 0,jGt=FGt(pt()),BGt=w;y0e=_6.default=(0,jGt.default)((0,BGt.jsx)("path",{d:"M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z"}),"Warning");var w6={},zGt=ct;Object.defineProperty(w6,"__esModule",{value:!0});var x0e=w6.default=void 0,UGt=zGt(pt()),WGt=w;x0e=w6.default=(0,UGt.default)((0,WGt.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"}),"CheckCircle");const VGt={success:x0e,warning:y0e,error:v0e,info:Xz},GGt=Li("span")(()=>({display:"flex",alignItems:"center"})),eC={close:{p:.5},success:t=>({color:t.palette.error.contrastText,backgroundColor:Rc[600]}),error:t=>({color:t.palette.error.contrastText,backgroundColor:t.palette.error.dark}),info:t=>({color:t.palette.error.contrastText,backgroundColor:t.palette.primary.dark}),warning:t=>({color:t.palette.error.contrastText,backgroundColor:lne[700]}),icon:{fontSize:20},iconVariant:t=>({opacity:.9,marginRight:t.spacing(1),fontSize:20}),message:{display:"flex",alignItems:"center"}},HGt={vertical:"bottom",horizontal:"center"};function qGt({className:t,message:e,hideMessage:n}){const r=()=>{n(e.id)};if(!e)return null;const i=VGt[e.type];return w.jsx(vLe,{open:!0,anchorOrigin:HGt,autoHideDuration:5e3,onClose:r,children:w.jsx(sie,{sx:eC[e.type],className:t,"aria-describedby":"client-snackbar",message:w.jsxs(GGt,{id:"client-snackbar",children:[w.jsx(i,{sx:eC.iconVariant}),e.text]}),action:[w.jsx(Ot,{"aria-label":"Close",color:"inherit",sx:eC.close,onClick:r,size:"large",children:w.jsx(kp,{sx:eC.icon})},"close")]})},e.type+":"+e.text)}const XGt=t=>{const e=t.messageLogState.newEntries;return{locale:t.controlState.locale,message:e.length>0?e[0]:null}},QGt={hideMessage:M9e},YGt=Jt(XGt,QGt)(qGt);var S6={},KGt=ct;Object.defineProperty(S6,"__esModule",{value:!0});var kP=S6.default=void 0,ZGt=KGt(pt()),JGt=w;kP=S6.default=(0,ZGt.default)((0,JGt.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add");var O6={},eHt=ct;Object.defineProperty(O6,"__esModule",{value:!0});var C6=O6.default=void 0,tHt=eHt(pt()),nHt=w;C6=O6.default=(0,tHt.default)((0,nHt.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete");const Tm={formControl:t=>({marginLeft:t.spacing(1),marginRight:t.spacing(1),width:200}),textField:t=>({marginLeft:t.spacing(1),marginRight:t.spacing(1),width:200}),textField2:t=>({marginLeft:t.spacing(1),marginRight:t.spacing(1),width:400}),button:t=>({margin:t.spacing(.1)})};function rHt({open:t,servers:e,selectedServer:n,closeDialog:r,configureServers:i}){const o=M.useRef(!1),[a,s]=M.useState(e),[l,c]=M.useState(n),[u,f]=M.useState("select");M.useEffect(()=>{o.current&&(s(e),c(n)),o.current=!0},[e,n]);const d=()=>{u==="select"?(r("server"),i(a,l.id)):u==="add"?E():u==="edit"&&k()},h=()=>{u==="select"?_():I()},p=()=>{_()},m=B=>{const W=B.target.value,U=a.find(N=>N.id===W);c(U)},g=B=>{const W=B.target.value,U={...l,name:W};c(U)},v=B=>{const W=B.target.value,U={...l,url:W};c(U)},y=()=>{f("add")},x=()=>{f("edit")},b=()=>{P()},_=()=>{r("server")},S=()=>{const B=l.id;return a.findIndex(W=>W.id===B)},O=(B,W)=>{const U=[...a];U[B]=W,s(U),c(W),f("select")},C=(B,W)=>{s(B),c(W),f("select")},E=()=>{const B={...l,id:Ys("server-")},W=[...a,B];C(W,B)},k=()=>{O(S(),{...l})},I=()=>{const B=S();O(S(),a[B])},P=()=>{const B=[...a];if(B.length<2)throw new Error("internal error: server list cannot be emptied");const W=S(),U=B[W+(W>0?-1:1)];B.splice(W,1),C(B,U)},R=a.map((B,W)=>w.jsx(Nr,{value:B.id,children:B.name},W));let T;u==="add"?T=fe.get("Add"):u==="edit"?T=fe.get("Save"):T=fe.get("OK");let L;u==="add"?L=fe.get("Add Server"):u==="edit"?L=fe.get("Edit Server"):L=fe.get("Select Server");let z;return u==="add"||u==="edit"?z=w.jsxs(qs,{dividers:!0,children:[w.jsx(lr,{variant:"standard",required:!0,id:"server-name",label:"Name",sx:Tm.textField,margin:"normal",value:l.name,onChange:g}),w.jsx("br",{}),w.jsx(lr,{variant:"standard",required:!0,id:"server-url",label:"URL",sx:Tm.textField2,margin:"normal",value:l.url,onChange:v})]}):z=w.jsx(qs,{dividers:!0,children:w.jsxs("div",{children:[w.jsxs(Yv,{variant:"standard",sx:Tm.formControl,children:[w.jsx(Kv,{htmlFor:"server-name",children:"Name"}),w.jsx(wp,{variant:"standard",value:l.id,onChange:m,inputProps:{name:"server-name",id:"server-name"},children:R}),w.jsx(Wre,{children:l.url})]}),w.jsx(Ot,{sx:Tm.button,"aria-label":"Add",color:"primary",onClick:y,size:"large",children:w.jsx(kP,{fontSize:"small"})}),w.jsx(Ot,{sx:Tm.button,"aria-label":"Edit",onClick:x,size:"large",children:w.jsx(Ap,{fontSize:"small"})}),w.jsx(Ot,{sx:Tm.button,"aria-label":"Delete",disabled:a.length<2,onClick:b,size:"large",children:w.jsx(C6,{fontSize:"small"})})]})}),w.jsxs(el,{open:t,onClose:p,"aria-labelledby":"server-dialog-title",children:[w.jsx(dd,{id:"server-dialog-title",children:L}),z,w.jsxs(yp,{children:[w.jsx(er,{onClick:h,children:fe.get("Cancel")}),w.jsx(er,{onClick:d,autoFocus:!0,children:T})]})]})}const iHt=t=>({open:!!t.controlState.dialogOpen.server,servers:Fae(t),selectedServer:hi(t)}),oHt={closeDialog:by,configureServers:a7e},aHt=Jt(iHt,oHt)(rHt),PJ=({anchorElement:t,layers:e,selectedLayerId:n,setSelectedLayerId:r,onClose:i})=>w.jsx(_p,{anchorEl:t,keepMounted:!0,open:!!t,onClose:i,children:t&&e.map(o=>w.jsx(Nr,{selected:o.id===n,onClick:()=>r(o.id===n?null:o.id),dense:!0,children:w.jsx(es,{primary:YT(o)})},o.id))}),OD={settingsPanelTitle:t=>({marginBottom:t.spacing(1)}),settingsPanelPaper:t=>({backgroundColor:(t.palette.mode==="dark"?qne:Hne)(t.palette.background.paper,.1),marginBottom:t.spacing(2)}),settingsPanelList:{margin:0}},jm=({title:t,children:e})=>{const n=ue.Children.count(e),r=[];return ue.Children.forEach(e,(i,o)=>{r.push(i),o{let i;e||(i={marginBottom:10});const o=w.jsx(es,{primary:t,secondary:e});let a;return r&&(a=w.jsx(TT,{children:r})),n?w.jsxs(Xre,{style:i,onClick:n,children:[o,a]}):w.jsxs(jx,{style:i,children:[o,a]})},Cf=({propertyName:t,settings:e,updateSettings:n,disabled:r})=>w.jsx(lie,{checked:!!e[t],onChange:()=>n({...e,[t]:!e[t]}),disabled:r}),sHt=({propertyName:t,settings:e,updateSettings:n,options:r,disabled:i})=>{const o=(a,s)=>{n({...e,[t]:s})};return w.jsx(m5,{row:!0,value:e[t],onChange:o,children:r.map(([a,s])=>w.jsx(xg,{control:w.jsx(Bx,{}),value:s,label:a,disabled:i},a))})},Q0={textField:t=>({marginLeft:t.spacing(1),marginRight:t.spacing(1),fontSize:t.typography.fontSize/2}),intTextField:t=>({marginLeft:t.spacing(1),marginRight:t.spacing(1),fontSize:t.typography.fontSize/2,width:t.spacing(6)}),localeAvatar:{margin:10}},MJ=[["doNothing","Do nothing"],["pan","Pan"],["panAndZoom","Pan and zoom"]],lHt=[["point","Points"],["line","Lines"],["bar","Bars"]],cHt=({open:t,closeDialog:e,settings:n,selectedServer:r,baseMapLayers:i,overlayLayers:o,updateSettings:a,changeLocale:s,openDialog:l,viewerVersion:c,serverInfo:u})=>{const[f,d]=ue.useState(null),[h,p]=ue.useState(null),[m,g]=ue.useState(null),[v,y]=ue.useState(n.timeChunkSize+"");if(ue.useEffect(()=>{const A=parseInt(v);!Number.isNaN(A)&&A!==n.timeChunkSize&&a({timeChunkSize:A})},[v,n,a]),!t)return null;function x(){e("settings")}function b(){l("server")}function _(A){a({timeAnimationInterval:parseInt(A.target.value)})}function S(A){a({timeSeriesChartTypeDefault:A.target.value})}function O(A){a({datasetLocateMode:A.target.value})}function C(A){a({placeLocateMode:A.target.value})}function E(A){y(A.target.value)}let k=null;f&&(k=Object.getOwnPropertyNames(fe.languages).map(A=>{const q=fe.languages[A];return w.jsx(Nr,{selected:A===n.locale,onClick:()=>s(A),children:w.jsx(es,{primary:q})},A)}));function I(A){d(A.currentTarget)}function P(){d(null)}function R(A){p(A.currentTarget)}function T(){p(null)}const L=A=>{A.stopPropagation(),l("userBaseMaps")},z=KT(i,n.selectedBaseMapId),B=YT(z);function W(A){g(A.currentTarget)}function U(){g(null)}const N=A=>{A.stopPropagation(),l("userOverlays")},$=KT(o,n.selectedOverlayId),D=YT($);return w.jsxs("div",{children:[w.jsxs(el,{open:t,fullWidth:!0,maxWidth:"sm",onClose:x,scroll:"body",children:[w.jsx(dd,{children:fe.get("Settings")}),w.jsxs(qs,{children:[w.jsxs(jm,{title:fe.get("General"),children:[w.jsx(hr,{label:fe.get("Server"),value:r.name,onClick:b}),w.jsx(hr,{label:fe.get("Language"),value:fe.languages[n.locale],onClick:I}),w.jsx(hr,{label:fe.get("Time interval of the player"),children:w.jsx(lr,{variant:"standard",select:!0,sx:Q0.textField,value:n.timeAnimationInterval,onChange:_,margin:"normal",children:JGe.map((A,q)=>w.jsx(Nr,{value:A,children:A+" ms"},q))})})]}),w.jsxs(jm,{title:fe.get("Time-Series"),children:[w.jsx(hr,{label:fe.get("Show chart after adding a place"),value:tC(n.autoShowTimeSeries),children:w.jsx(Cf,{propertyName:"autoShowTimeSeries",settings:n,updateSettings:a})}),w.jsx(hr,{label:fe.get("Default chart type"),children:w.jsx(lr,{variant:"standard",select:!0,sx:Q0.textField,value:n.timeSeriesChartTypeDefault,onChange:S,margin:"normal",children:lHt.map(([A,q])=>w.jsx(Nr,{value:A,children:fe.get(q)},A))})}),w.jsx(hr,{label:fe.get("Calculate standard deviation"),value:tC(n.timeSeriesIncludeStdev),children:w.jsx(Cf,{propertyName:"timeSeriesIncludeStdev",settings:n,updateSettings:a})}),w.jsx(hr,{label:fe.get("Calculate median instead of mean (disables standard deviation)"),value:tC(n.timeSeriesUseMedian),children:w.jsx(Cf,{propertyName:"timeSeriesUseMedian",settings:n,updateSettings:a})}),w.jsx(hr,{label:fe.get("Minimal number of data points in a time series update"),children:w.jsx(lr,{variant:"standard",sx:Q0.intTextField,value:v,onChange:E,margin:"normal",size:"small"})})]}),w.jsxs(jm,{title:fe.get("Map"),children:[w.jsx(hr,{label:fe.get("Base map"),value:B,onClick:R,children:w.jsx(er,{onClick:L,children:fe.get("User Base Maps")+"..."})}),w.jsx(hr,{label:fe.get("Overlay"),value:D,onClick:W,children:w.jsx(er,{onClick:N,children:fe.get("User Overlays")+"..."})}),w.jsx(hr,{label:fe.get("Projection"),children:w.jsx(sHt,{propertyName:"mapProjection",settings:n,updateSettings:a,options:[[fe.get("Geographic"),uy],[fe.get("Mercator"),wB]]})}),w.jsx(hr,{label:fe.get("Image smoothing"),value:tC(n.imageSmoothingEnabled),children:w.jsx(Cf,{propertyName:"imageSmoothingEnabled",settings:n,updateSettings:a})}),w.jsx(hr,{label:fe.get("On dataset selection"),children:w.jsx(lr,{variant:"standard",select:!0,sx:Q0.textField,value:n.datasetLocateMode,onChange:O,margin:"normal",children:MJ.map(([A,q])=>w.jsx(Nr,{value:A,children:fe.get(q)},A))})}),w.jsx(hr,{label:fe.get("On place selection"),children:w.jsx(lr,{variant:"standard",select:!0,sx:Q0.textField,value:n.placeLocateMode,onChange:C,margin:"normal",children:MJ.map(([A,q])=>w.jsx(Nr,{value:A,children:fe.get(q)},A))})})]}),w.jsx(jm,{title:fe.get("Legal Agreement"),children:w.jsx(hr,{label:fe.get("Privacy notice"),value:n.privacyNoticeAccepted?fe.get("Accepted"):"",children:w.jsx(er,{disabled:!n.privacyNoticeAccepted,onClick:()=>{a({privacyNoticeAccepted:!1}),window.location.reload()},children:fe.get("Revoke consent")})})}),w.jsxs(jm,{title:fe.get("System Information"),children:[w.jsx(hr,{label:`xcube Viewer ${fe.get("version")}`,value:c}),w.jsx(hr,{label:`xcube Server ${fe.get("version")}`,value:u?u.version:fe.get("Cannot reach server")})]})]})]}),w.jsx(_p,{anchorEl:f,keepMounted:!0,open:!!f,onClose:P,children:k}),w.jsx(PJ,{anchorElement:h,layers:i,selectedLayerId:n.selectedBaseMapId,setSelectedLayerId:A=>a({selectedBaseMapId:A}),onClose:T}),w.jsx(PJ,{anchorElement:m,layers:o,selectedLayerId:n.selectedOverlayId,setSelectedLayerId:A=>a({selectedOverlayId:A}),onClose:U})]})},tC=t=>t?fe.get("On"):fe.get("Off"),uHt="1.3.0-dev.1",fHt=t=>({locale:t.controlState.locale,open:t.controlState.dialogOpen.settings,settings:t.controlState,baseMapLayers:IB(t),overlayLayers:DB(t),selectedServer:hi(t),viewerVersion:uHt,serverInfo:t.dataState.serverInfo}),dHt={closeDialog:by,updateSettings:J1,changeLocale:Wle,openDialog:Pp},hHt=Jt(fHt,dHt)(cHt),kJ={separatorTextField:t=>({marginLeft:t.spacing(1),marginRight:t.spacing(1),fontSize:t.typography.fontSize/2,maxWidth:"6em"}),fileNameTextField:t=>({marginLeft:t.spacing(1),marginRight:t.spacing(1),fontSize:t.typography.fontSize/2})},pHt=({open:t,closeDialog:e,settings:n,updateSettings:r,downloadTimeSeries:i})=>{const o=()=>{e("export")};function a(c){r({exportFileName:c.target.value})}function s(c){r({exportTimeSeriesSeparator:c.target.value})}const l=()=>{o(),i()};return w.jsx("div",{children:w.jsxs(el,{open:t,fullWidth:!0,maxWidth:"xs",onClose:o,scroll:"body",children:[w.jsx(qs,{children:w.jsxs(jm,{title:fe.get("Export Settings"),children:[w.jsx(hr,{label:fe.get("Include time-series data")+" (*.txt)",value:nC(n.exportTimeSeries),children:w.jsx(Cf,{propertyName:"exportTimeSeries",settings:n,updateSettings:r})}),w.jsx(hr,{label:fe.get("Separator for time-series data"),children:w.jsx(lr,{variant:"standard",sx:kJ.separatorTextField,value:n.exportTimeSeriesSeparator,onChange:s,disabled:!n.exportTimeSeries,margin:"normal",size:"small"})}),w.jsx(hr,{label:fe.get("Include places data")+" (*.geojson)",value:nC(n.exportPlaces),children:w.jsx(Cf,{propertyName:"exportPlaces",settings:n,updateSettings:r})}),w.jsx(hr,{label:fe.get("Combine place data in one file"),value:nC(n.exportPlacesAsCollection),children:w.jsx(Cf,{propertyName:"exportPlacesAsCollection",settings:n,updateSettings:r,disabled:!n.exportPlaces})}),w.jsx(hr,{label:fe.get("As ZIP archive"),value:nC(n.exportZipArchive),children:w.jsx(Cf,{propertyName:"exportZipArchive",settings:n,updateSettings:r})}),w.jsx(hr,{label:fe.get("File name"),children:w.jsx(lr,{variant:"standard",sx:kJ.fileNameTextField,value:n.exportFileName,onChange:a,margin:"normal",size:"small"})})]})}),w.jsx(yp,{children:w.jsx(er,{onClick:l,disabled:!vHt(n),children:fe.get("Download")})})]})})},nC=t=>t?fe.get("On"):fe.get("Off"),mHt=t=>/^[0-9a-zA-Z_-]+$/.test(t),gHt=t=>t.toUpperCase()==="TAB"||t.length===1,vHt=t=>(t.exportTimeSeries||t.exportPlaces)&&mHt(t.exportFileName)&&(!t.exportTimeSeries||gHt(t.exportTimeSeriesSeparator)),yHt=t=>({locale:t.controlState.locale,open:!!t.controlState.dialogOpen.export,settings:t.controlState}),xHt={closeDialog:by,updateSettings:J1,downloadTimeSeries:p7e},bHt=Jt(yHt,xHt)(pHt);var T6={},_Ht=ct;Object.defineProperty(T6,"__esModule",{value:!0});var b0e=T6.default=void 0,wHt=_Ht(pt()),SHt=w;b0e=T6.default=(0,wHt.default)((0,SHt.jsx)("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore");var E6={},OHt=ct;Object.defineProperty(E6,"__esModule",{value:!0});var _0e=E6.default=void 0,CHt=OHt(pt()),THt=w;_0e=E6.default=(0,CHt.default)((0,THt.jsx)("path",{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}),"ExpandLess");const EHt=({title:t,accept:e,multiple:n,disabled:r,onSelect:i,className:o})=>{const a=M.useRef(null),s=c=>{if(c.target.files!==null&&c.target.files.length){const u=[];for(let f=0;f{a.current!==null&&a.current.click()};return w.jsxs(w.Fragment,{children:[w.jsx("input",{type:"file",accept:e,multiple:n,ref:a,hidden:!0,onChange:s,disabled:r}),w.jsx(er,{onClick:l,disabled:r,className:o,variant:"outlined",size:"small",children:t})]})},CD={parse:t=>t,format:t=>typeof t=="string"?t:`${t}`,validate:t=>!0};function P6(){return t=>{const{options:e,updateOptions:n,optionKey:r,label:i,style:o,className:a,disabled:s,parse:l,format:c,validate:u}=t,f=e[r],d=h=>{const p=h.target.value,m=(l||CD.parse)(p);n({[r]:m})};return w.jsx(lr,{label:fe.get(i),value:(c||CD.format)(f),error:!(u||CD.validate)(f),onChange:d,style:o,className:a,disabled:s,size:"small",variant:"standard"})}}const Y0=P6(),PHt=Li("div")(({theme:t})=>({paddingTop:t.spacing(2)})),MHt=({options:t,updateOptions:e})=>w.jsx(PHt,{children:w.jsxs("div",{style:{display:"grid",gap:12,paddingTop:12,gridTemplateColumns:"auto auto"},children:[w.jsx(Y0,{optionKey:"timeNames",label:"Time property names",options:t,updateOptions:e}),w.jsx("div",{id:"spareField"}),w.jsx(Y0,{label:"Group property names",optionKey:"groupNames",options:t,updateOptions:e}),w.jsx(Y0,{label:"Group prefix (used as fallback)",optionKey:"groupPrefix",options:t,updateOptions:e}),w.jsx(Y0,{label:"Label property names",optionKey:"labelNames",options:t,updateOptions:e}),w.jsx(Y0,{label:"Label prefix (used as fallback)",optionKey:"labelPrefix",options:t,updateOptions:e})]})}),io=P6(),kHt=Li("div")(({theme:t})=>({paddingTop:t.spacing(2)})),AHt=({options:t,updateOptions:e})=>{const n=t.forceGeometry;return w.jsxs(kHt,{children:[w.jsxs("div",{style:{display:"grid",gap:12,paddingTop:12,gridTemplateColumns:"auto auto"},children:[w.jsx(io,{optionKey:"xNames",label:"X/longitude column names",options:t,updateOptions:e,disabled:n}),w.jsx(io,{optionKey:"yNames",label:"Y/latitude column names",options:t,updateOptions:e,disabled:n}),w.jsxs("span",{children:[w.jsx(IL,{checked:t.forceGeometry,onChange:r=>e({forceGeometry:r.target.checked}),size:"small"}),w.jsx("span",{children:"Use geometry column"})]}),w.jsx(io,{optionKey:"geometryNames",label:"Geometry column names",options:t,updateOptions:e,disabled:!n}),w.jsx(io,{optionKey:"timeNames",label:"Time column names",options:t,updateOptions:e}),w.jsx("div",{id:"spareField"}),w.jsx(io,{optionKey:"groupNames",label:"Group column names",options:t,updateOptions:e}),w.jsx(io,{optionKey:"groupPrefix",label:"Group prefix (used as fallback)",options:t,updateOptions:e}),w.jsx(io,{optionKey:"labelNames",label:"Label column names",options:t,updateOptions:e}),w.jsx(io,{optionKey:"labelPrefix",label:"Label prefix (used as fallback)",options:t,updateOptions:e})]}),w.jsxs("div",{style:{display:"grid",gap:12,paddingTop:12,gridTemplateColumns:"auto auto auto"},children:[w.jsx(io,{optionKey:"separator",label:"Separator character",options:t,updateOptions:e}),w.jsx(io,{optionKey:"comment",label:"Comment character",options:t,updateOptions:e}),w.jsx(io,{optionKey:"quote",label:"Quote character",options:t,updateOptions:e}),w.jsx(io,{optionKey:"escape",label:"Escape character",options:t,updateOptions:e}),w.jsx("div",{}),w.jsxs("span",{children:[w.jsx(IL,{checked:t.trim,onChange:r=>e({trim:r.target.checked}),size:"small"}),w.jsx("span",{children:"Remove whitespaces"})]}),w.jsx(io,{optionKey:"nanToken",label:"Not-a-number token",options:t,updateOptions:e}),w.jsx(io,{optionKey:"trueToken",label:"True token",options:t,updateOptions:e}),w.jsx(io,{optionKey:"falseToken",label:"False token",options:t,updateOptions:e})]})]})},K0=P6(),RHt=Li("div")(({theme:t})=>({paddingTop:t.spacing(2)})),IHt=({options:t,updateOptions:e})=>w.jsx(RHt,{children:w.jsxs("div",{style:{display:"grid",gap:12,paddingTop:12,gridTemplateColumns:"auto auto"},children:[w.jsx(K0,{optionKey:"time",label:"Time (UTC, ISO-format)",options:t,updateOptions:e}),w.jsx("div",{id:"spareField"}),w.jsx(K0,{label:"Group",options:t,optionKey:"group",updateOptions:e}),w.jsx(K0,{label:"Group prefix (used as fallback)",optionKey:"groupPrefix",options:t,updateOptions:e,disabled:t.group.trim()!==""}),w.jsx(K0,{label:"Label",optionKey:"label",options:t,updateOptions:e}),w.jsx(K0,{label:"Label prefix (used as fallback)",optionKey:"labelPrefix",options:t,updateOptions:e,disabled:t.label.trim()!==""})]})}),TD={csv:{...Kae,codeExt:[]},geojson:{...Zae,codeExt:[Tpe()]},wkt:{...Jae,codeExt:[]}},ED={spacer:{flexGrow:1},actionButton:t=>({marginRight:t.spacing(1)}),error:{fontSize:"small"}},DHt=Li("div")(({theme:t})=>({paddingTop:t.spacing(.5),display:"flex",flexDirection:"row",alignItems:"center"})),LHt=Li(EHt)(({theme:t})=>({marginRight:t.spacing(1)})),$Ht=({open:t,closeDialog:e,userPlacesFormatName:n,userPlacesFormatOptions:r,updateSettings:i,addUserPlacesFromText:o,nextMapInteraction:a,setMapInteraction:s})=>{const[l,c]=M.useState(""),[u,f]=M.useState(null),[d,h]=M.useState(!1),[p,m]=M.useState(!1),[g,v]=M.useState(n),[y,x]=M.useState(r);if(M.useEffect(()=>{v(n)},[n]),M.useEffect(()=>{x(r)},[r]),!t)return null;const b=()=>{s("Select"),e("addUserPlacesFromText"),i({userPlacesFormatName:g,userPlacesFormatOptions:y}),o(l)},_=()=>{s(a),e("addUserPlacesFromText")},S=()=>{c("")},O=z=>{const B=z[0];h(!0);const W=new FileReader;W.onloadend=()=>{const U=W.result;v(tH(U)),c(U),h(!1)},W.onabort=W.onerror=()=>{h(!1)},W.readAsText(B,"UTF-8")},C=()=>{c("")},E=()=>{console.info("PASTE!",l)},k=z=>{let B=g;l===""&&z.length>10&&(B=tH(z),v(B)),c(z),f(TD[B].checkError(z))};function I(z){v(z.target.value)}function P(z){x({...y,csv:{...y.csv,...z}})}function R(z){x({...y,geojson:{...y.geojson,...z}})}function T(z){x({...y,wkt:{...y.wkt,...z}})}let L;return g==="csv"?L=w.jsx(AHt,{options:y.csv,updateOptions:P}):g==="geojson"?L=w.jsx(MHt,{options:y.geojson,updateOptions:R}):L=w.jsx(IHt,{options:y.wkt,updateOptions:T}),w.jsxs(el,{fullWidth:!0,open:t,onClose:_,"aria-labelledby":"server-dialog-title",children:[w.jsx(dd,{id:"server-dialog-title",children:fe.get("Import places")}),w.jsxs(qs,{dividers:!0,children:[w.jsxs(m5,{row:!0,value:g,onChange:z=>I(z),children:[w.jsx(xg,{value:"csv",label:fe.get(Kae.name),control:w.jsx(Bx,{})},"csv"),w.jsx(xg,{value:"geojson",label:fe.get(Zae.name),control:w.jsx(Bx,{})},"geojson"),w.jsx(xg,{value:"wkt",label:fe.get(Jae.name),control:w.jsx(Bx,{})},"wkt")]}),w.jsx(j2,{theme:Kt.instance.branding.themeName||"light",placeholder:fe.get("Enter text or drag & drop a text file."),autoFocus:!0,height:"400px",extensions:TD[g].codeExt,value:l,onChange:k,onDrop:C,onPaste:E,onPasteCapture:E}),u&&w.jsx(At,{color:"error",sx:ED.error,children:u}),w.jsxs(DHt,{children:[w.jsx(LHt,{title:fe.get("From File")+"...",accept:TD[g].fileExt,multiple:!1,onSelect:O,disabled:d}),w.jsx(er,{onClick:S,disabled:l.trim()===""||d,sx:ED.actionButton,variant:"outlined",size:"small",children:fe.get("Clear")}),w.jsx(Ke,{sx:ED.spacer}),w.jsx(er,{onClick:()=>m(!p),endIcon:p?w.jsx(_0e,{}):w.jsx(b0e,{}),variant:"outlined",size:"small",children:fe.get("Options")})]}),w.jsx(fre,{in:p,timeout:"auto",unmountOnExit:!0,children:L})]}),w.jsxs(yp,{children:[w.jsx(er,{onClick:_,variant:"text",children:fe.get("Cancel")}),w.jsx(er,{onClick:b,disabled:l.trim()===""||u!==null||d,variant:"text",children:fe.get("OK")})]})]})},NHt=t=>({open:t.controlState.dialogOpen.addUserPlacesFromText,userPlacesFormatName:t.controlState.userPlacesFormatName,userPlacesFormatOptions:t.controlState.userPlacesFormatOptions,nextMapInteraction:t.controlState.lastMapInteraction}),FHt={closeDialog:by,updateSettings:J1,setMapInteraction:kle,addUserPlacesFromText:Xse},jHt=Jt(NHt,FHt)($Ht);var M6={},BHt=ct;Object.defineProperty(M6,"__esModule",{value:!0});var k6=M6.default=void 0,zHt=BHt(pt()),UHt=w;k6=M6.default=(0,zHt.default)((0,UHt.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"}),"ContentCopy");function A6(t,e){return w0e(t,e,[]).join("")}function w0e(t,e,n){if(t.nodeType==Node.CDATA_SECTION_NODE||t.nodeType==Node.TEXT_NODE)e?n.push(String(t.nodeValue).replace(/(\r\n|\r|\n)/g,"")):n.push(t.nodeValue);else{var r=void 0;for(r=t.firstChild;r;r=r.nextSibling)w0e(r,e,n)}return n}function WHt(t){return"documentElement"in t}function VHt(t){return new DOMParser().parseFromString(t,"application/xml")}function S0e(t,e){return function(n,r){var i=t.call(e!==void 0?e:this,n,r);if(i!==void 0){var o=r[r.length-1];o.push(i)}}}function aa(t,e,n){return function(r,i){var o=t.call(n!==void 0?n:this,r,i);if(o!==void 0){var a=i[i.length-1],s=e!==void 0?e:r.localName,l=void 0;s in a?l=a[s]:(l=[],a[s]=l),l.push(o)}}}function gt(t,e,n){return function(r,i){var o=t.call(n!==void 0?n:this,r,i);if(o!==void 0){var a=i[i.length-1],s=e!==void 0?e:r.localName;a[s]=o}}}function $i(t,e,n){var r=n!==void 0?n:{},i,o;for(i=0,o=t.length;i{const n=e.Name,r=e.Title||n;let i;const o=e.Attribution;if(RP(o)){const a=o.Title,s=o.OnlineResource;a&&s?i=`© ${a}`:s?i=`${s}`:a&&(i=`${a}`)}return{name:n,title:r,attribution:i}})}function D9t(t){const e=k9t.read(t);if(RP(e)){const n=e.Capability;if(RP(n))return TF(n,!0)}throw new Error("invalid WMSCapabilities object")}function TF(t,e){let n,r;if(e)n=t.Layer;else{const{Layer:o,...a}=t;n=o,r=a}let i;return Array.isArray(n)?i=n.flatMap(o=>TF(o)):RP(n)?i=TF(n):i=[{}],i.map(o=>L9t(r,o))}function L9t(t,e){if(!t)return e;if(typeof(t.Name||e.Name)!="string")throw new Error("invalid WMSCapabilities: missing Layer/Name");const r=t.Title,i=e.Title,o=r&&i?`${r} / ${i}`:i||r;return{...t,...e,Title:o}}function RP(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}const $9t=({userLayer:t,onChange:e,onCancel:n})=>{const[r,i]=M.useState(t.url),[o,a]=M.useState(null),[s,l]=M.useState(-1);M.useEffect(()=>{A9t(r).then(f=>{a(f)})},[r]),M.useEffect(()=>{if(o&&t.wms){const{layerName:f}=t.wms;l(o.findIndex(d=>d.name===f))}else l(-1)},[o,t.wms]);const c=()=>o&&o.length&&s!=-1,u=()=>{o&&s!==-1&&e({...t,group:TB,title:o[s].title,url:r.trim(),attribution:o[s].attribution,wms:{layerName:o[s].name}})};return w.jsxs(Ke,{sx:{display:"flex",gap:2,flexDirection:"column",padding:"5px 15px"},children:[w.jsx(lr,{required:!0,label:fe.get("WMS URL"),variant:"standard",size:"small",value:r,fullWidth:!0,onChange:f=>i(f.currentTarget.value)}),w.jsx(wp,{disabled:!o||!o.length,variant:"standard",onChange:f=>l(f.target.value),value:s,size:"small",renderValue:()=>o&&o.length&&s>=0?o[s].title:fe.get("WMS Layer"),children:(o||[]).map((f,d)=>w.jsx(Nr,{value:d,selected:s===d,children:w.jsx(es,{primary:f.title})},f.name))}),w.jsx(sw,{onDone:u,onCancel:n,doneDisabled:!c(),helpUrl:fe.get("docs/add-layer-wms.en.md")})]})},N9t=({userLayer:t,onChange:e,onCancel:n})=>{const[r,i]=ue.useState(t.title),[o,a]=ue.useState(t.url),[s,l]=ue.useState(t.attribution||""),c=(d,h)=>{const p=d!=="",m=h!==""&&(h.startsWith("http://")||h.trim().startsWith("https://"));return p&&m},u=()=>c(r.trim(),o.trim()),f=()=>e({...t,group:TB,title:r.trim(),url:o.trim(),attribution:s.trim()});return w.jsxs(Ke,{sx:{display:"flex",gap:1,flexDirection:"column",padding:"5px 15px"},children:[w.jsx(lr,{required:!0,label:fe.get("XYZ Layer URL"),variant:"standard",size:"small",value:o,fullWidth:!0,onChange:d=>a(d.currentTarget.value)}),w.jsxs(Ke,{sx:{display:"flex",gap:1},children:[w.jsx(lr,{required:!0,label:fe.get("Layer Title"),variant:"standard",size:"small",sx:{flexGrow:.3},value:r,onChange:d=>i(d.currentTarget.value)}),w.jsx(lr,{label:fe.get("Layer Attribution"),variant:"standard",size:"small",sx:{flexGrow:.7},value:s,onChange:d=>l(d.currentTarget.value)})]}),w.jsx(sw,{onDone:f,onCancel:n,doneDisabled:!u(),helpUrl:fe.get("docs/add-layer-xyz.en.md")})]})},F9t={paper:t=>({backgroundColor:(t.palette.mode==="dark"?qne:Hne)(t.palette.background.paper,.1),marginBottom:t.spacing(2)})},AJ=({userLayers:t,setUserLayers:e,selectedId:n,setSelectedId:r})=>{const[i,o]=ue.useState(n),[a,s]=ue.useState(null),[l,c]=afe();if(!open)return null;const u=x=>{c(()=>e(t)),s({editId:x.id,editMode:"edit"})},f=x=>{c(void 0);const b=t.findIndex(_=>_.id===x.id);e([...t.slice(0,b+1),{...x,id:Ys("user-layer"),title:x.title+" Copy"},...t.slice(b+1)])},d=x=>{c(void 0);const b=t.findIndex(_=>_.id===x.id);x.id===n&&r(i),x.id===i&&o(null),e([...t.slice(0,b),...t.slice(b+1)])},h=x=>{c(()=>e(t));const b=Ys("user-layer-");e([...t,{id:b,group:TB,title:"",url:"",attribution:"",wms:x==="wms"?{layerName:""}:void 0}]),s({editId:b,editMode:"add"})},p=()=>{h("wms")},m=()=>{h("xyz")},g=x=>{c(void 0);const b=t.findIndex(_=>_.id===x.id);n===x.id&&r(i),e([...t.slice(0,b),x,...t.slice(b+1)]),s(null)},v=()=>{if(l(),a&&a.editMode==="add"){const x=t.findIndex(b=>b.id===a.editId);e([...t.slice(0,x),...t.slice(x+1)])}s(null)},y=a!==null;return w.jsx(Go,{sx:F9t.paper,children:w.jsxs(FM,{component:"nav",dense:!0,children:[t.map(x=>{const b=n===x.id;return a&&a.editId===x.id?x.wms?w.jsx($9t,{userLayer:x,onChange:g,onCancel:v},x.id):w.jsx(N9t,{userLayer:x,onChange:g,onCancel:v},x.id):w.jsxs(Xre,{selected:b,onClick:()=>r(b?null:x.id),children:[w.jsx(es,{primary:x.title,secondary:x.url}),w.jsxs(TT,{children:[w.jsx(Ot,{onClick:()=>u(x),size:"small",disabled:y,children:w.jsx(Ap,{})}),w.jsx(Ot,{onClick:()=>f(x),size:"small",disabled:y,children:w.jsx(k6,{})}),w.jsx(Ot,{onClick:()=>d(x),size:"small",disabled:y,children:w.jsx(kp,{})})]})]},x.id)}),!y&&w.jsx(jx,{sx:{minHeight:"3em"},children:w.jsx(TT,{children:w.jsxs(Ke,{sx:{display:"flex",gap:2,paddingTop:2},children:[w.jsx(_t,{title:fe.get("Add layer from a Web Map Service"),children:w.jsx(er,{onClick:p,startIcon:w.jsx(kP,{}),children:"WMS"})}),w.jsx(_t,{title:fe.get("Add layer from a Tiled Web Map"),children:w.jsx(er,{onClick:m,startIcon:w.jsx(kP,{}),children:"XYZ"})})]})})})]})})},j9t=({dialogId:t,open:e,closeDialog:n,settings:r,updateSettings:i})=>{const[o,a]=ue.useState(t==="userBaseMaps"?0:1);if(!e)return null;const s=r.userBaseMaps,l=g=>{i({userBaseMaps:g})},c=r.userOverlays,u=g=>{i({userOverlays:g})},f=r.selectedBaseMapId,d=g=>{i({selectedBaseMapId:g})},h=r.selectedOverlayId,p=g=>{i({selectedOverlayId:g})};function m(){n(t)}return w.jsxs(el,{open:e,fullWidth:!0,maxWidth:"sm",onClose:m,scroll:"body",children:[w.jsx(dd,{children:fe.get("User Layers")}),w.jsxs(qs,{children:[w.jsx(Ke,{sx:{borderBottom:1,borderColor:"divider"},children:w.jsxs(x5,{value:o,onChange:(g,v)=>a(v),children:[w.jsx(Ib,{label:"Base Maps"}),w.jsx(Ib,{label:"Overlays"})]})}),o===0&&w.jsx(AJ,{userLayers:s,setUserLayers:l,selectedId:f,setSelectedId:d},"baseMaps"),o===1&&w.jsx(AJ,{userLayers:c,setUserLayers:u,selectedId:h,setSelectedId:p},"overlays")]})]})},B9t=(t,e)=>({open:t.controlState.dialogOpen[e.dialogId],settings:t.controlState,dialogId:e.dialogId}),z9t={closeDialog:by,updateSettings:J1},RJ=Jt(B9t,z9t)(j9t);function P0e({selected:t,title:e,actions:n}){return w.jsxs(BM,{sx:{pl:{sm:2},pr:{xs:1,sm:1},...t&&{background:r=>Wc(r.palette.primary.main,r.palette.action.activatedOpacity)}},children:[w.jsx(tE,{}),w.jsx(At,{sx:{flex:"1 1 100%",paddingLeft:1},children:e}),n]})}const U9t={container:{display:"flex",flexDirection:"column",height:"100%"},tableContainer:{overflowY:"auto",flexGrow:1}};function W9t({userVariables:t,setUserVariables:e,selectedIndex:n,setSelectedIndex:r,setEditedVariable:i}){const o=n>=0?t[n]:null,a=n>=0,s=d=>{r(n!==d?d:-1)},l=()=>{i({editMode:"add",variable:FKe()})},c=()=>{const d=t[n];e([...t.slice(0,n+1),jKe(d),...t.slice(n+1)]),r(n+1)},u=()=>{i({editMode:"edit",variable:o})},f=()=>{e([...t.slice(0,n),...t.slice(n+1)]),n>=t.length-1&&r(t.length-2)};return w.jsxs(w.Fragment,{children:[w.jsx(P0e,{selected:n!==null,title:fe.get("Manage user variables"),actions:w.jsxs(w.Fragment,{children:[w.jsx(_t,{title:fe.get("Add user variable"),children:w.jsx(Ot,{color:"primary",onClick:l,children:w.jsx(aw,{})})}),a&&w.jsx(_t,{title:fe.get("Duplicate user variable"),children:w.jsx(Ot,{onClick:c,children:w.jsx(k6,{})})}),a&&w.jsx(_t,{title:fe.get("Edit user variable"),children:w.jsx(Ot,{onClick:u,children:w.jsx(Ap,{})})}),a&&w.jsx(_t,{title:fe.get("Remove user variable"),children:w.jsx(Ot,{onClick:f,children:w.jsx(C6,{})})})]})}),w.jsx(uie,{sx:U9t.tableContainer,children:w.jsxs(v5,{size:"small",children:[w.jsx(x$e,{children:w.jsxs(pl,{children:[w.jsx(ar,{sx:{width:"15%"},children:fe.get("Name")}),w.jsx(ar,{sx:{width:"15%"},children:fe.get("Title")}),w.jsx(ar,{sx:{width:"10%"},children:fe.get("Units")}),w.jsx(ar,{children:fe.get("Expression")})]})}),w.jsx(y5,{children:t.map((d,h)=>w.jsxs(pl,{hover:!0,selected:h===n,onClick:()=>s(h),children:[w.jsx(ar,{component:"th",scope:"row",children:d.name}),w.jsx(ar,{children:d.title}),w.jsx(ar,{children:d.units}),w.jsx(ar,{children:d.expression||""})]},d.id))})]})})]})}var I6={},V9t=ct;Object.defineProperty(I6,"__esModule",{value:!0});var M0e=I6.default=void 0,G9t=V9t(pt()),H9t=w;M0e=I6.default=(0,G9t.default)((0,H9t.jsx)("path",{d:"M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z"}),"FilterList");const q9t=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/;function X9t(t){return q9t.test(t)}const IJ={expressionPart:{padding:.2},expressionPartChip:{fontFamily:"monospace"}};function DJ({part:t,partType:e,onPartClicked:n}){return w.jsx(Ke,{component:"span",sx:IJ.expressionPart,children:w.jsx(sMe,{label:t,sx:IJ.expressionPartChip,size:"small",variant:"outlined",color:e==="variables"||e==="constants"?"default":e.includes("Functions")?"primary":"secondary",onClick:()=>n(t)})})}function Q9t({anchorEl:t,exprPartTypes:e,setExprPartTypes:n,onClose:r}){const i=o=>{n({...e,[o]:!e[o]})};return w.jsx(_p,{open:!!t,anchorEl:t,onClose:r,children:Bce.map(o=>w.jsx(g0e,{selected:e[o],title:fe.get(zKe[o]),onClick:()=>i(o),dense:!0},o))})}function Y9t({expression:t,onExpressionChange:e,variableNames:n,expressionCapabilities:r,handleInsertPartRef:i}){const o=ld(),a=M.useRef(null),s=M.useCallback(c=>{var f;const u=(f=a.current)==null?void 0:f.view;if(u){const d=u.state.selection.main,h=u.state.sliceDoc(d.from,d.to).trim();h!==""&&c.includes("X")&&(c=c.replace("X",h));const p=u.state.replaceSelection(c);p&&u.dispatch(p)}},[]);M.useEffect(()=>{i.current=s},[i,s]);const l=M.useCallback(c=>{const u=c.matchBefore(/\w*/);return u===null||u.from==u.to&&!c.explicit?null:{from:u.from,options:[...n.map(f=>({label:f,type:"variable"})),...r.namespace.constants.map(f=>({label:f,type:"variable"})),...r.namespace.arrayFunctions.map(f=>({label:f,type:"function"})),...r.namespace.otherFunctions.map(f=>({label:f,type:"function"}))]}},[n,r.namespace]);return w.jsx(j2,{theme:o.palette.mode||"none",width:"100%",height:"100px",placeholder:fe.get("Use keys CTRL+SPACE to show autocompletions"),extensions:[xpe({override:[l]})],value:t,onChange:e,ref:a})}async function K9t(t,e,n){if(n.trim()==="")return fe.get("Must not be empty");const r=`${t}/expressions/validate/${iy(e)}/${encodeURIComponent(n)}`;try{return await loe(r),null}catch(i){const o=i.message;if(o){const a=o.indexOf("("),s=o.lastIndexOf(")");return o.slice(a>=0?a+1:0,s>=0?s:o.length)}return fe.get("Invalid expression")}}const rC={container:{display:"flex",flexDirection:"column",height:"100%"},content:{flexGrow:1,display:"flex",flexDirection:"column",gap:2,padding:1},propertiesRow:{display:"flex",gap:1},expressionRow:{flexGrow:1},expressionParts:{paddingTop:1,overflowY:"auto"},expressionPart:{padding:.2},expressionPartChip:{fontFamily:"monospace"}};function Z9t({userVariables:t,setUserVariables:e,editedVariable:n,setEditedVariable:r,contextDataset:i,expressionCapabilities:o,serverUrl:a}){const[s,l]=M.useState(BKe),[c,u]=M.useState(null),f=[...t,...i.variables],d=i.variables.filter(D=>!N1(D)).map(D=>D.name),{id:h,name:p,title:m,units:g,expression:v}=n.variable,y=f.findIndex(D=>D.id!==h&&D.name===p)>=0,x=!X9t(p),b=y?fe.get("Already in use"):x?fe.get("Not a valid identifier"):null,_=!b,[S,O]=M.useState(null),E=_&&!S,k=M.useRef(null);M.useEffect(()=>{const D=setTimeout(()=>{K9t(a,i.id,n.variable.expression).then(O)},500);return()=>{clearTimeout(D)}},[a,i.id,n.variable.expression]);const I=(D,A)=>{r({...n,variable:{...n.variable,[D]:A}})},P=()=>{if(n.editMode==="add")e([n.variable,...t]);else{const D=t.findIndex(A=>A.id===n.variable.id);if(D>=0){const A=[...t];A[D]=n.variable,e(A)}}r(null)},R=()=>{r(null)},T=D=>{I("name",D.target.value)},L=D=>{I("title",D.target.value)},z=D=>{I("units",D.target.value)},B=D=>{I("expression",D)},W=D=>{k.current(D)},U=D=>{u(D.currentTarget)},N=()=>{u(null)},$=[w.jsx(Ot,{size:"small",onClick:U,children:w.jsx(_t,{arrow:!0,title:fe.get("Display further elements to be used in expressions"),children:w.jsx(M0e,{})})},"filter")];return Bce.forEach(D=>{s[D]&&(D==="variables"?d.forEach(A=>{$.push(w.jsx(DJ,{part:A,partType:D,onPartClicked:W},`${D}-${A}`))}):o.namespace[D].forEach(A=>{$.push(w.jsx(DJ,{part:A,partType:D,onPartClicked:W},`${D}-${A}`))}))}),w.jsxs(w.Fragment,{children:[w.jsx(Q9t,{anchorEl:c,exprPartTypes:s,setExprPartTypes:l,onClose:N}),w.jsx(P0e,{selected:!0,title:n.editMode==="add"?fe.get("Add user variable"):fe.get("Edit user variable"),actions:w.jsx(sw,{size:"medium",onDone:P,doneDisabled:!E,onCancel:R})}),w.jsxs(Ke,{sx:rC.content,children:[w.jsxs(Ke,{sx:rC.propertiesRow,children:[w.jsx(lr,{sx:{flexGrow:.3},error:!_,helperText:b,size:"small",variant:"standard",label:fe.get("Name"),value:p,onChange:T}),w.jsx(lr,{sx:{flexGrow:.6},size:"small",variant:"standard",label:fe.get("Title"),value:m,onChange:L}),w.jsx(lr,{sx:{flexGrow:.1},size:"small",variant:"standard",label:fe.get("Units"),value:g,onChange:z})]}),w.jsxs(Ke,{sx:rC.expressionRow,children:[w.jsx(At,{sx:D=>({paddingBottom:1,color:D.palette.text.secondary}),children:fe.get("Expression")}),w.jsx(Y9t,{expression:v,onExpressionChange:B,variableNames:d,expressionCapabilities:o,handleInsertPartRef:k}),S&&w.jsx(At,{sx:{paddingBottom:1},color:"error",fontSize:"small",children:S}),w.jsx(Ke,{sx:rC.expressionParts,children:$})]})]})]})}const LJ={dialogContent:{height:420},dialogActions:{display:"flex",justifyContent:"space-between",gap:.2}};function J9t({open:t,closeDialog:e,selectedDataset:n,selectedVariableName:r,selectVariable:i,userVariables:o,updateDatasetUserVariables:a,expressionCapabilities:s,serverUrl:l}){const[c,u]=M.useState(o),[f,d]=M.useState(c.findIndex(v=>v.name===r)),[h,p]=M.useState(null);if(M.useEffect(()=>{u(o)},[o]),!t||!n||!s)return null;function m(){a(n.id,c),e(rE),f>=0&&i(c[f].name)}function g(){u(o),e(rE)}return w.jsxs(el,{open:t,fullWidth:!0,maxWidth:"md",onClose:g,scroll:"body",children:[w.jsx(dd,{children:fe.get("User Variables")}),w.jsx(qs,{dividers:!0,sx:LJ.dialogContent,children:h===null?w.jsx(W9t,{userVariables:c,setUserVariables:u,selectedIndex:f,setSelectedIndex:d,setEditedVariable:p}):w.jsx(Z9t,{userVariables:c,setUserVariables:u,editedVariable:h,setEditedVariable:p,contextDataset:n,expressionCapabilities:s,serverUrl:l})}),w.jsxs(yp,{sx:LJ.dialogActions,children:[w.jsx(Ke,{children:w.jsx(cfe,{size:"medium",helpUrl:fe.get("docs/user-variables.en.md")})}),w.jsxs(Ke,{children:[w.jsx(er,{onClick:g,children:fe.get("Cancel")}),w.jsx(er,{onClick:m,disabled:h!==null||!e7t(c),children:fe.get("OK")})]})]})]})}function e7t(t){const e=new Set;return t.forEach(n=>e.add(n.name)),e.size===t.length}const t7t=t=>({open:t.controlState.dialogOpen[rE],selectedDataset:Gr(t),selectedVariableName:py(t),userVariables:NHe(t),expressionCapabilities:rGe(t),serverUrl:hi(t).url}),n7t={closeDialog:by,selectVariable:Sle,updateDatasetUserVariables:z9e},r7t=Jt(t7t,n7t)(J9t),i7t=t=>({compact:Kt.instance.branding.compact}),o7t={},a7t=()=>Yj({typography:{fontSize:12,htmlFontSize:14},palette:{mode:Kt.instance.branding.themeName,primary:Kt.instance.branding.primaryColor,secondary:Kt.instance.branding.secondaryColor}}),s7t=({compact:t})=>w.jsx(WNe,{children:w.jsx(Tne,{injectFirst:!0,children:w.jsxs(DCe,{theme:a7t(),children:[w.jsx(dke,{}),!t&&w.jsx(mKe,{}),w.jsx(wGt,{}),w.jsxs(w.Fragment,{children:[w.jsx(DGt,{}),w.jsx(aHt,{}),w.jsx(hHt,{}),w.jsx(RJ,{dialogId:"userOverlays"},"userOverlays"),w.jsx(RJ,{dialogId:"userBaseMaps"},"userBaseMaps"),w.jsx(r7t,{}),w.jsx(jHt,{}),w.jsx(bHt,{}),w.jsx(EGt,{}),w.jsx(YGt,{})]})]})})}),l7t=Jt(i7t,o7t)(s7t);function c7t(t,e,n){switch(t===void 0&&(t=tHe()),e.type){case qB:{const r={...t,...e.settings};return ol(r),r}case Hle:return ol(t),t;case Hb:{let r=t.selectedDatasetId||cf.get("dataset"),i=t.selectedVariableName||cf.get("variable"),o=t.mapInteraction,a=Fb(e.datasets,r);const s=a&&e$(a,i)||null;return a?s||(i=a.variables.length?a.variables[0].name:null):(r=null,i=null,a=e.datasets.length?e.datasets[0]:null,a&&(r=a.id,a.variables.length>0&&(i=a.variables[0].name))),r||(o="Select"),{...t,selectedDatasetId:r,selectedVariableName:i,mapInteraction:o}}case dle:{let r=t.selectedVariableName;const i=Fb(e.datasets,e.selectedDatasetId);!e$(i,r)&&i.variables.length>0&&(r=i.variables[0].name);const a=e.selectedDatasetId,s=uoe(i),l=s?s[1]:null;return{...t,selectedDatasetId:a,selectedVariableName:r,selectedTimeRange:s,selectedTime:l}}case gle:{const{location:r}=e;return t.flyTo!==r?{...t,flyTo:r}:t}case vle:{const r=e.selectedPlaceGroupIds;return{...t,selectedPlaceGroupIds:r,selectedPlaceId:null}}case yle:{const{placeId:r}=e;return{...t,selectedPlaceId:r}}case wle:return{...t,selectedVariableName:e.selectedVariableName};case xle:return{...t,layerVisibilities:{...t.layerVisibilities,[e.layerId]:e.visible}};case ble:{const{mapPointInfoBoxEnabled:r}=e;return{...t,mapPointInfoBoxEnabled:r}}case _le:{const{variableCompareMode:r}=e;return{...t,variableCompareMode:r,variableSplitPos:void 0}}case WB:{const{variableSplitPos:r}=e;return{...t,variableSplitPos:r}}case Cle:{let{selectedTime:r}=e;if(r!==null&&n){const i=w$(n),o=i?pae(i,r):-1;o>=0&&(r=i[o])}return t.selectedTime!==r?{...t,selectedTime:r}:t}case Tle:{if(n){let r=kse(n);if(r>=0){const i=w$(n);r+=e.increment,r<0&&(r=i.length-1),r>i.length-1&&(r=0);let o=i[r];const a=t.selectedTimeRange;if(a!==null&&(oa[1]&&(o=a[1])),t.selectedTime!==o)return{...t,selectedTime:o}}}return t}case VB:return{...t,selectedTimeRange:e.selectedTimeRange};case R7e:return{...t,timeSeriesUpdateMode:e.timeSeriesUpdateMode};case Ple:return{...t,timeAnimationActive:e.timeAnimationActive,timeAnimationInterval:e.timeAnimationInterval};case NB:{const{id:r,selected:i}=e;return i?u7t(t,Bs,r):t}case FB:{const{placeGroups:r}=e;return r.length>0?{...t,selectedPlaceGroupIds:[...t.selectedPlaceGroupIds||[],r[0].id]}:t}case jB:{const{placeGroupId:r,newName:i}=e;return r===Bs?{...t,userDrawnPlaceGroupName:i}:t}case BB:{const{placeId:r,places:i}=e;if(r===t.selectedPlaceId){let o=null;const a=i.findIndex(s=>s.id===r);return a>=0&&(a0&&(o=i[a-1].id)),{...t,selectedPlaceId:o}}return t}case Qle:{const r=e.colorBarId;return{...t,userColorBars:[{id:r,type:"continuous",code:moe},...t.userColorBars]}}case Yle:{const r=e.colorBarId,i=t.userColorBars.findIndex(o=>o.id===r);if(i>=0){const o={...t,userColorBars:[...t.userColorBars.slice(0,i),...t.userColorBars.slice(i+1)]};return ol(o),o}return t}case Jle:{const r=e.userColorBar,i=t.userColorBars.findIndex(o=>o.id===r.id);return i>=0?{...t,userColorBars:[...t.userColorBars.slice(0,i),{...r},...t.userColorBars.slice(i+1)]}:t}case Mle:{let r={...t,mapInteraction:e.mapInteraction,lastMapInteraction:t.mapInteraction};return e.mapInteraction==="Geometry"&&(r={...r,dialogOpen:{...t.dialogOpen,addUserPlacesFromText:!0}}),r}case Ale:{const{layerMenuOpen:r}=e;return t={...t,layerMenuOpen:r},ol(t),t}case Ile:{const{sidebarPosition:r}=e;return t={...t,sidebarPosition:r},t}case Dle:{const{sidebarOpen:r}=e;return t={...t,sidebarOpen:r},ol(t),t}case Lle:{const{sidebarPanelId:r}=e;return t={...t,sidebarPanelId:r},ol(t),t}case $le:return t={...t,volumeRenderMode:e.volumeRenderMode},ol(t),t;case Nle:{const{volumeId:r,volumeState:i}=e;return t={...t,volumeStates:{...t.volumeStates,[r]:i}},t}case Fle:{const r={...t.infoCardElementStates};return Object.getOwnPropertyNames(r).forEach(i=>{r[i]={...r[i],visible:e.visibleElements.includes(i)}}),t={...t,infoCardElementStates:r},ol(t),t}case jle:{const{elementType:r,viewMode:i}=e,o={...t,infoCardElementStates:{...t.infoCardElementStates,[r]:{...t.infoCardElementStates[r],viewMode:i}}};return ol(o),o}case Ble:return{...t,activities:{...t.activities,[e.id]:e.message}};case zle:{const r={...t.activities};return delete r[e.id],{...t,activities:r}}case Ule:{const r=e.locale;return fe.locale=r,r!==t.locale&&(t={...t,locale:r},ol(t)),t}case Vle:{const r=e.dialogId;return{...t,dialogOpen:{...t.dialogOpen,[r]:!0}}}case Gle:{const r=e.dialogId;return{...t,dialogOpen:{...t.dialogOpen,[r]:!1}}}case Ole:{const{selectedDataset2Id:r,selectedVariable2Name:i}=e;return r===t.selectedDataset2Id&&i===t.selectedVariable2Name?{...t,selectedDataset2Id:null,selectedVariable2Name:null,variableCompareMode:!1,variableSplitPos:void 0}:{...t,selectedDataset2Id:r,selectedVariable2Name:i,variableCompareMode:!0}}case zB:if(t.selectedServerId!==e.selectedServerId)return{...t,selectedServerId:e.selectedServerId}}return t}function u7t(t,e,n){let r=t.selectedPlaceGroupIds;return!t.selectedPlaceGroupIds||t.selectedPlaceGroupIds.length===0?r=[e]:t.selectedPlaceGroupIds.find(i=>i===e)||(r=[...t.selectedPlaceGroupIds,e]),{...t,selectedPlaceGroupIds:r,selectedPlaceId:n}}function f7t(){const t=qGe(),e=[{...Kt.instance.server}];return t.forEach(n=>{e.find(r=>r.id===n.id)||e.push(n)}),{serverInfo:null,expressionCapabilities:null,datasets:[],colorBars:null,statistics:{loading:!1,records:[]},timeSeriesGroups:[],userPlaceGroups:[],userServers:e}}function d7t(t,e){switch(t===void 0&&(t=f7t()),e.type){case JT:return{...t,serverInfo:e.serverInfo};case ale:return{...t,expressionCapabilities:e.expressionCapabilities};case Hb:return{...t,datasets:e.datasets};case qse:{const{datasetId:n,userVariables:r}=e,i=t.datasets.findIndex(l=>l.id===n),o=t.datasets[i],[a,s]=nB(o);return{...t,datasets:[...t.datasets.slice(0,i),{...o,variables:[...a,...r]},...t.datasets.slice(i+1)]}}case lle:{const{datasetId:n,variableName:r,colorBarName:i,colorBarMinMax:o,colorBarNorm:a,opacity:s}=e,l={colorBarName:i,colorBarMin:o[0],colorBarMax:o[1],colorBarNorm:a,opacity:s};return $J(t,n,r,l)}case ule:{const{datasetId:n,variableName:r,volumeRenderMode:i,volumeIsoThreshold:o}=e;return $J(t,n,r,{volumeRenderMode:i,volumeIsoThreshold:o})}case $B:{const n=e.placeGroup,r=t.datasets.map(i=>{if(i.placeGroups){const o=i.placeGroups.findIndex(a=>a.id===n.id);if(o>=0){const a=[...i.placeGroups];return a[o]=n,{...i,placeGroups:a}}}return i});return{...t,datasets:r}}case NB:{const{placeGroupTitle:n,id:r,properties:i,geometry:o}=e,a={type:"Feature",id:r,properties:i,geometry:o},s=t.userPlaceGroups,l=s.findIndex(c=>c.id===Bs);if(l>=0){const c=s[l];return{...t,userPlaceGroups:[...s.slice(0,l),{...c,features:[...c.features,a]},...s.slice(l+1)]}}else{const c=n&&n!==""?n:fe.get("My places");return{...t,userPlaceGroups:[{type:"FeatureCollection",id:Bs,title:c,features:[a]},...s]}}}case FB:{const{placeGroups:n}=e;return{...t,userPlaceGroups:[...t.userPlaceGroups,...n]}}case jB:{const{placeGroupId:n,newName:r}=e,i=t.userPlaceGroups,o=i.findIndex(a=>a.id===n);if(o>=0){const a=i[o];return{...t,userPlaceGroups:[...i.slice(0,o),{...a,title:r},...i.slice(o+1)]}}return t}case Qse:{const{placeGroupId:n,placeId:r,newName:i}=e,o=t.userPlaceGroups,a=FJ(o,n,r,{label:i});return a?{...t,userPlaceGroups:a}:t}case Yse:{const{placeGroupId:n,placeId:r,placeStyle:i}=e,o=t.userPlaceGroups,a=FJ(o,n,r,i);return a?{...t,userPlaceGroups:a}:t}case BB:{const{placeGroupId:n,placeId:r}=e,i=t.userPlaceGroups,o=i.findIndex(a=>a.id===n);if(o>=0){const a=i[o],s=a.features.findIndex(l=>l.id===r);if(s>=0){const l=NJ(t.timeSeriesGroups,[r]);let c=t.timeSeriesGroups;return l.forEach(u=>{c=kD(c,u,"remove","append")}),{...t,userPlaceGroups:[...i.slice(0,o),{...a,features:[...a.features.slice(0,s),...a.features.slice(s+1)]},...i.slice(o+1)],timeSeriesGroups:c}}}return t}case Kse:{const{placeGroupId:n}=e,r=t.userPlaceGroups,i=r.findIndex(o=>o.id===n);if(i>=0){const a=r[i].features.map(c=>c.id),s=NJ(t.timeSeriesGroups,a);let l=t.timeSeriesGroups;return s.forEach(c=>{l=kD(l,c,"remove","append")}),{...t,userPlaceGroups:[...r.slice(0,i),...r.slice(i+1)],timeSeriesGroups:l}}return t}case sle:return{...t,colorBars:e.colorBars};case nle:{const{timeSeriesGroupId:n,timeSeries:r}=e,i=t.timeSeriesGroups,o=i.findIndex(l=>l.id===n),a=i[o],s=[...i];return s[o]={...a,timeSeriesArray:[...a.timeSeriesArray,r]},{...t,timeSeriesGroups:s}}case Jse:{const n=t.statistics;if(e.statistics===null)return{...t,statistics:{...n,loading:!0}};const r=n.records;return{...t,statistics:{...n,loading:!1,records:[e.statistics,...r]}}}case ele:{const{index:n}=e,r=t.statistics,i=r.records;return{...t,statistics:{...r,records:[...i.slice(0,n),...i.slice(n+1)]}}}case tle:{const{timeSeries:n,updateMode:r,dataMode:i}=e,o=kD(t.timeSeriesGroups,n,r,i);return o!==t.timeSeriesGroups?{...t,timeSeriesGroups:o}:t}case rle:{const n=t.timeSeriesGroups.findIndex(r=>r.id===e.groupId);if(n>=0){const r=[...t.timeSeriesGroups],i={...r[n]},o=[...i.timeSeriesArray];return o.splice(e.index,1),i.timeSeriesArray=o,r[n]=i,{...t,timeSeriesGroups:r}}return t}case ile:{const n=t.timeSeriesGroups.findIndex(r=>r.id===e.id);if(n>=0){const r=[...t.timeSeriesGroups];return r.splice(n,1),{...t,timeSeriesGroups:r}}return t}case ole:return{...t,timeSeriesGroups:[]};case VB:{const{selectedGroupId:n,selectedValueRange:r}=e;if(!n)return t;const i=t.timeSeriesGroups.findIndex(a=>a.id===n),o=r||void 0;return{...t,timeSeriesGroups:[...t.timeSeriesGroups.slice(0,i),{...t.timeSeriesGroups[i],variableRange:o},...t.timeSeriesGroups.slice(i+1)]}}case zB:return t.userServers!==e.servers?(HGe(e.servers),{...t,userServers:e.servers}):t;default:return t}}function $J(t,e,n,r){const i=t.datasets.findIndex(o=>o.id===e);if(i>=0){const o=t.datasets[i],a=o.variables.findIndex(s=>s.name===n);if(a>=0){const s=o.variables[a],l=t.datasets.slice(),c=o.variables.slice();return c[a]={...s,...r},l[i]={...o,variables:c},{...t,datasets:l}}}return t}function kD(t,e,n,r){let i=e,o;const a=t.findIndex(s=>s.variableUnits===i.source.variableUnits);if(a>=0){const s=t[a],l=s.timeSeriesArray,c=l.findIndex(f=>f.source.datasetId===i.source.datasetId&&f.source.variableName===i.source.variableName&&f.source.placeId===i.source.placeId);let u;if(c>=0){const f=l[c];r==="append"&&(i={...i,data:[...i.data,...f.data]}),n==="replace"?u=[i]:n==="add"?(u=l.slice(),u[c]=i):(u=l.slice(),u.splice(c,1))}else n==="replace"?u=[i]:n==="add"?u=[i,...l]:u=l;n==="replace"?o=[{...s,timeSeriesArray:u}]:n==="add"?(o=t.slice(),o[a]={...s,timeSeriesArray:u}):u.length>=0?(o=t.slice(),o[a]={...s,timeSeriesArray:u}):(o=t.slice(),o.splice(a,1))}else n==="replace"?o=[{id:Ys("ts-"),variableUnits:i.source.variableUnits,timeSeriesArray:[i]}]:n==="add"?o=[{id:Ys("ts-"),variableUnits:i.source.variableUnits,timeSeriesArray:[i]},...t]:o=t;return o}function NJ(t,e){const n=[];return t.forEach(r=>{r.timeSeriesArray.forEach(i=>{e.forEach(o=>{i.source.placeId===o&&n.push(i)})})}),n}function FJ(t,e,n,r){const i=t.findIndex(o=>o.id===e);if(i>=0){const o=t[i],a=o.features,s=a.findIndex(l=>l.id===n);if(s>=0){const l=a[s];return[...t.slice(0,i),{...o,features:[...a.slice(0,s),{...l,properties:{...l.properties,...r}},...a.slice(s+1)]},...t.slice(i+1)]}}}function h7t(){return{newEntries:[],oldEntries:[]}}let p7t=0;function m7t(t,e){t===void 0&&(t=h7t());const n=t.newEntries;switch(e.type){case Wse:{const r=e.messageType,i=e.messageText;let o=n.length?n[0]:null;return o&&r===o.type&&i===o.text?t:(o={id:++p7t,type:r,text:i},{...t,newEntries:[o,...n]})}case Vse:{const r=n.findIndex(i=>i.id===e.messageId);if(r>=0){const i=n[r],o=[...n];o.splice(r,1);const a=[i,...t.oldEntries];return{...t,newEntries:o,oldEntries:a}}}}return t}function g7t(){return{accessToken:null}}function v7t(t,e){switch(t===void 0&&(t=g7t()),e.type){case Fce:return{...t,accessToken:e.accessToken}}return t}function y7t(t,e){return{dataState:d7t(t&&t.dataState,e),controlState:c7t(t&&t.controlState,e,t),messageLogState:m7t(t&&t.messageLogState,e),userAuthState:v7t(t&&t.userAuthState,e)}}Kt.load().then(()=>{const t=(o,a)=>a.type!==WB,e=r1e.createLogger({collapsed:!0,diff:!1,predicate:t}),n=n1e(i1e,e),r=Jte(y7t,n),i=r.dispatch;i(Wle(r.getState().controlState.locale)),i(z7e()),r.getState().controlState.privacyNoticeAccepted&&i(UB()),Wv.render(w.jsx(Ybe,{store:r,children:w.jsx(l7t,{})}),document.getElementById("root"))}); +`,t.getElementsByTagName("head")[0].appendChild(e)),t.body&&l0e(t.body,"react-draggable-transparent-selection")}function b8t(t){if(t)try{if(t.body&&c0e(t.body,"react-draggable-transparent-selection"),t.selection)t.selection.empty();else{const e=(t.defaultView||window).getSelection();e&&e.type!=="Caret"&&e.removeAllRanges()}}catch{}}function l0e(t,e){t.classList?t.classList.add(e):t.className.match(new RegExp("(?:^|\\s)".concat(e,"(?!\\S)")))||(t.className+=" ".concat(e))}function c0e(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(new RegExp("(?:^|\\s)".concat(e,"(?!\\S)"),"g"),"")}var fc={};Object.defineProperty(fc,"__esModule",{value:!0});fc.canDragX=S8t;fc.canDragY=O8t;fc.createCoreData=T8t;fc.createDraggableData=E8t;fc.getBoundPosition=_8t;fc.getControlPosition=C8t;fc.snapToGrid=w8t;var ia=uc,og=Sr;function _8t(t,e,n){if(!t.props.bounds)return[e,n];let{bounds:r}=t.props;r=typeof r=="string"?r:P8t(r);const i=p6(t);if(typeof r=="string"){const{ownerDocument:o}=i,a=o.defaultView;let s;if(r==="parent"?s=i.parentNode:s=o.querySelector(r),!(s instanceof a.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=s,c=a.getComputedStyle(i),u=a.getComputedStyle(l);r={left:-i.offsetLeft+(0,ia.int)(u.paddingLeft)+(0,ia.int)(c.marginLeft),top:-i.offsetTop+(0,ia.int)(u.paddingTop)+(0,ia.int)(c.marginTop),right:(0,og.innerWidth)(l)-(0,og.outerWidth)(i)-i.offsetLeft+(0,ia.int)(u.paddingRight)-(0,ia.int)(c.marginRight),bottom:(0,og.innerHeight)(l)-(0,og.outerHeight)(i)-i.offsetTop+(0,ia.int)(u.paddingBottom)-(0,ia.int)(c.marginBottom)}}return(0,ia.isNum)(r.right)&&(e=Math.min(e,r.right)),(0,ia.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,ia.isNum)(r.left)&&(e=Math.max(e,r.left)),(0,ia.isNum)(r.top)&&(n=Math.max(n,r.top)),[e,n]}function w8t(t,e,n){const r=Math.round(e/t[0])*t[0],i=Math.round(n/t[1])*t[1];return[r,i]}function S8t(t){return t.props.axis==="both"||t.props.axis==="x"}function O8t(t){return t.props.axis==="both"||t.props.axis==="y"}function C8t(t,e,n){const r=typeof e=="number"?(0,og.getTouch)(t,e):null;if(typeof e=="number"&&!r)return null;const i=p6(n),o=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return(0,og.offsetXYFromParent)(r||t,o,n.props.scale)}function T8t(t,e,n){const r=!(0,ia.isNum)(t.lastX),i=p6(t);return r?{node:i,deltaX:0,deltaY:0,lastX:e,lastY:n,x:e,y:n}:{node:i,deltaX:e-t.lastX,deltaY:n-t.lastY,lastX:t.lastX,lastY:t.lastY,x:e,y:n}}function E8t(t,e){const n=t.props.scale;return{node:e.node,x:t.state.x+e.deltaX/n,y:t.state.y+e.deltaY/n,deltaX:e.deltaX/n,deltaY:e.deltaY/n,lastX:t.state.x,lastY:t.state.y}}function P8t(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}}function p6(t){const e=t.findDOMNode();if(!e)throw new Error(": Unmounted during event!");return e}var Rk={},Ik={};Object.defineProperty(Ik,"__esModule",{value:!0});Ik.default=M8t;function M8t(){}Object.defineProperty(Rk,"__esModule",{value:!0});Rk.default=void 0;var _D=A8t(M),bo=m6(s1),k8t=m6(Wv),ji=Sr,Vu=fc,wD=uc,q0=m6(Ik);function m6(t){return t&&t.__esModule?t:{default:t}}function u0e(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(u0e=function(r){return r?n:e})(t)}function A8t(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=u0e(e);if(n&&n.has(t))return n.get(t);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&Object.prototype.hasOwnProperty.call(t,o)){var a=i?Object.getOwnPropertyDescriptor(t,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=t[o]}return r.default=t,n&&n.set(t,r),r}function ao(t,e,n){return e=R8t(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function R8t(t){var e=I8t(t,"string");return typeof e=="symbol"?e:String(e)}function I8t(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Is={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let Gu=Is.mouse,Dk=class extends _D.Component{constructor(){super(...arguments),ao(this,"dragging",!1),ao(this,"lastX",NaN),ao(this,"lastY",NaN),ao(this,"touchIdentifier",null),ao(this,"mounted",!1),ao(this,"handleDragStart",e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&typeof e.button=="number"&&e.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error(" not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(e.target instanceof r.defaultView.Node)||this.props.handle&&!(0,ji.matchesSelectorAndParentsTo)(e.target,this.props.handle,n)||this.props.cancel&&(0,ji.matchesSelectorAndParentsTo)(e.target,this.props.cancel,n))return;e.type==="touchstart"&&e.preventDefault();const i=(0,ji.getTouchIdentifier)(e);this.touchIdentifier=i;const o=(0,Vu.getControlPosition)(e,i,this);if(o==null)return;const{x:a,y:s}=o,l=(0,Vu.createCoreData)(this,a,s);(0,q0.default)("DraggableCore: handleDragStart: %j",l),(0,q0.default)("calling",this.props.onStart),!(this.props.onStart(e,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,ji.addUserSelectStyles)(r),this.dragging=!0,this.lastX=a,this.lastY=s,(0,ji.addEvent)(r,Gu.move,this.handleDrag),(0,ji.addEvent)(r,Gu.stop,this.handleDragStop))}),ao(this,"handleDrag",e=>{const n=(0,Vu.getControlPosition)(e,this.touchIdentifier,this);if(n==null)return;let{x:r,y:i}=n;if(Array.isArray(this.props.grid)){let s=r-this.lastX,l=i-this.lastY;if([s,l]=(0,Vu.snapToGrid)(this.props.grid,s,l),!s&&!l)return;r=this.lastX+s,i=this.lastY+l}const o=(0,Vu.createCoreData)(this,r,i);if((0,q0.default)("DraggableCore: handleDrag: %j",o),this.props.onDrag(e,o)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(l)}return}this.lastX=r,this.lastY=i}),ao(this,"handleDragStop",e=>{if(!this.dragging)return;const n=(0,Vu.getControlPosition)(e,this.touchIdentifier,this);if(n==null)return;let{x:r,y:i}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,c=i-this.lastY||0;[l,c]=(0,Vu.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,i=this.lastY+c}const o=(0,Vu.createCoreData)(this,r,i);if(this.props.onStop(e,o)===!1||this.mounted===!1)return!1;const s=this.findDOMNode();s&&this.props.enableUserSelectHack&&(0,ji.removeUserSelectStyles)(s.ownerDocument),(0,q0.default)("DraggableCore: handleDragStop: %j",o),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,s&&((0,q0.default)("DraggableCore: Removing handlers"),(0,ji.removeEvent)(s.ownerDocument,Gu.move,this.handleDrag),(0,ji.removeEvent)(s.ownerDocument,Gu.stop,this.handleDragStop))}),ao(this,"onMouseDown",e=>(Gu=Is.mouse,this.handleDragStart(e))),ao(this,"onMouseUp",e=>(Gu=Is.mouse,this.handleDragStop(e))),ao(this,"onTouchStart",e=>(Gu=Is.touch,this.handleDragStart(e))),ao(this,"onTouchEnd",e=>(Gu=Is.touch,this.handleDragStop(e)))}componentDidMount(){this.mounted=!0;const e=this.findDOMNode();e&&(0,ji.addEvent)(e,Is.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const e=this.findDOMNode();if(e){const{ownerDocument:n}=e;(0,ji.removeEvent)(n,Is.mouse.move,this.handleDrag),(0,ji.removeEvent)(n,Is.touch.move,this.handleDrag),(0,ji.removeEvent)(n,Is.mouse.stop,this.handleDragStop),(0,ji.removeEvent)(n,Is.touch.stop,this.handleDragStop),(0,ji.removeEvent)(e,Is.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,ji.removeUserSelectStyles)(n)}}findDOMNode(){var e,n;return(e=this.props)!==null&&e!==void 0&&e.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:k8t.default.findDOMNode(this)}render(){return _D.cloneElement(_D.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Rk.default=Dk;ao(Dk,"displayName","DraggableCore");ao(Dk,"propTypes",{allowAnyClick:bo.default.bool,children:bo.default.node.isRequired,disabled:bo.default.bool,enableUserSelectHack:bo.default.bool,offsetParent:function(t,e){if(t[e]&&t[e].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:bo.default.arrayOf(bo.default.number),handle:bo.default.string,cancel:bo.default.string,nodeRef:bo.default.object,onStart:bo.default.func,onDrag:bo.default.func,onStop:bo.default.func,onMouseDown:bo.default.func,scale:bo.default.number,className:wD.dontSetMe,style:wD.dontSetMe,transform:wD.dontSetMe});ao(Dk,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1});(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),t.default=void 0;var e=d(M),n=u(s1),r=u(Wv),i=u(ZVt),o=Sr,a=fc,s=uc,l=u(Rk),c=u(Ik);function u(y){return y&&y.__esModule?y:{default:y}}function f(y){if(typeof WeakMap!="function")return null;var x=new WeakMap,b=new WeakMap;return(f=function(_){return _?b:x})(y)}function d(y,x){if(!x&&y&&y.__esModule)return y;if(y===null||typeof y!="object"&&typeof y!="function")return{default:y};var b=f(x);if(b&&b.has(y))return b.get(y);var _={},S=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var O in y)if(O!=="default"&&Object.prototype.hasOwnProperty.call(y,O)){var C=S?Object.getOwnPropertyDescriptor(y,O):null;C&&(C.get||C.set)?Object.defineProperty(_,O,C):_[O]=y[O]}return _.default=y,b&&b.set(y,_),_}function h(){return h=Object.assign?Object.assign.bind():function(y){for(var x=1;x{if((0,c.default)("Draggable: onDragStart: %j",_),this.props.onStart(b,(0,a.createDraggableData)(this,_))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),p(this,"onDrag",(b,_)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",_);const S=(0,a.createDraggableData)(this,_),O={x:S.x,y:S.y,slackX:0,slackY:0};if(this.props.bounds){const{x:E,y:k}=O;O.x+=this.state.slackX,O.y+=this.state.slackY;const[I,P]=(0,a.getBoundPosition)(this,O.x,O.y);O.x=I,O.y=P,O.slackX=this.state.slackX+(E-O.x),O.slackY=this.state.slackY+(k-O.y),S.x=O.x,S.y=O.y,S.deltaX=O.x-this.state.x,S.deltaY=O.y-this.state.y}if(this.props.onDrag(b,S)===!1)return!1;this.setState(O)}),p(this,"onDragStop",(b,_)=>{if(!this.state.dragging||this.props.onStop(b,(0,a.createDraggableData)(this,_))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",_);const O={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:E,y:k}=this.props.position;O.x=E,O.y=k}this.setState(O)}),this.state={dragging:!1,dragged:!1,x:x.position?x.position.x:x.defaultPosition.x,y:x.position?x.position.y:x.defaultPosition.y,prevPropsPosition:{...x.position},slackX:0,slackY:0,isElementSVG:!1},x.position&&!(x.onDrag||x.onStop)&&console.warn("A `position` was applied to this , without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var x,b;return(x=(b=this.props)===null||b===void 0||(b=b.nodeRef)===null||b===void 0?void 0:b.current)!==null&&x!==void 0?x:r.default.findDOMNode(this)}render(){const{axis:x,bounds:b,children:_,defaultPosition:S,defaultClassName:O,defaultClassNameDragging:C,defaultClassNameDragged:E,position:k,positionOffset:I,scale:P,...R}=this.props;let T={},L=null;const B=!!!k||this.state.dragging,W=k||S,U={x:(0,a.canDragX)(this)&&B?this.state.x:W.x,y:(0,a.canDragY)(this)&&B?this.state.y:W.y};this.state.isElementSVG?L=(0,o.createSVGTransform)(U,I):T=(0,o.createCSSTransform)(U,I);const N=(0,i.default)(_.props.className||"",O,{[C]:this.state.dragging,[E]:this.state.dragged});return e.createElement(l.default,h({},R,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),e.cloneElement(e.Children.only(_),{className:N,style:{..._.props.style,...T},transform:L}))}}t.default=v,p(v,"displayName","Draggable"),p(v,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:s.dontSetMe,style:s.dontSetMe,transform:s.dontSetMe}),p(v,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(n0e);const{default:f0e,DraggableCore:D8t}=n0e;Ak.exports=f0e;Ak.exports.default=f0e;Ak.exports.DraggableCore=D8t;var d0e=Ak.exports;const L8t=Nt(d0e);var g6={exports:{}},Rw={},v6={};v6.__esModule=!0;v6.cloneElement=z8t;var $8t=N8t(M);function N8t(t){return t&&t.__esModule?t:{default:t}}function TJ(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function EJ(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function PJ(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function SD(t){for(var e=1;eMath.abs(d*u)?o=i/u:i=o*u}var h=i,p=o,m=this.slack||[0,0],g=m[0],v=m[1];return i+=g,o+=v,s&&(i=Math.max(s[0],i),o=Math.max(s[1],o)),l&&(i=Math.min(l[0],i),o=Math.min(l[1],o)),this.slack=[g+(h-i),v+(p-o)],[i,o]},n.resizeHandler=function(i,o){var a=this;return function(s,l){var c=l.node,u=l.deltaX,f=l.deltaY;i==="onResizeStart"&&a.resetData();var d=(a.props.axis==="both"||a.props.axis==="x")&&o!=="n"&&o!=="s",h=(a.props.axis==="both"||a.props.axis==="y")&&o!=="e"&&o!=="w";if(!(!d&&!h)){var p=o[0],m=o[o.length-1],g=c.getBoundingClientRect();if(a.lastHandleRect!=null){if(m==="w"){var v=g.left-a.lastHandleRect.left;u+=v}if(p==="n"){var y=g.top-a.lastHandleRect.top;f+=y}}a.lastHandleRect=g,m==="w"&&(u=-u),p==="n"&&(f=-f);var x=a.props.width+(d?u/a.props.transformScale:0),b=a.props.height+(h?f/a.props.transformScale:0),_=a.runConstraints(x,b);x=_[0],b=_[1];var S=x!==a.props.width||b!==a.props.height,O=typeof a.props[i]=="function"?a.props[i]:null,C=i==="onResize"&&!S;O&&!C&&(s.persist==null||s.persist(),O(s,{node:c,size:{width:x,height:b},handle:o})),i==="onResizeStop"&&a.resetData()}}},n.renderResizeHandle=function(i,o){var a=this.props.handle;if(!a)return X0.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+i,ref:o});if(typeof a=="function")return a(i,o);var s=typeof a.type=="string",l=SD({ref:o},s?{}:{handleAxis:i});return X0.cloneElement(a,l)},n.render=function(){var i=this,o=this.props,a=o.children,s=o.className,l=o.draggableOpts;o.width,o.height,o.handle,o.handleSize,o.lockAspectRatio,o.axis,o.minConstraints,o.maxConstraints,o.onResize,o.onResizeStop,o.onResizeStart;var c=o.resizeHandles;o.transformScale;var u=Q8t(o,q8t);return(0,G8t.cloneElement)(a,SD(SD({},u),{},{className:(s?s+" ":"")+"react-resizable",children:[].concat(a.props.children,c.map(function(f){var d,h=(d=i.handleRefs[f])!=null?d:i.handleRefs[f]=X0.createRef();return X0.createElement(V8t.DraggableCore,SF({},l,{nodeRef:h,key:"resizableHandle-"+f,onStop:i.resizeHandler("onResizeStop",f),onStart:i.resizeHandler("onResizeStart",f),onDrag:i.resizeHandler("onResize",f)}),i.renderResizeHandle(f,h))}))}))},e}(X0.Component);Rw.default=y6;y6.propTypes=H8t.resizableProps;y6.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var Lk={};Lk.__esModule=!0;Lk.default=void 0;var OD=iGt(M),eGt=p0e(s1),tGt=p0e(Rw),nGt=Iw,rGt=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function p0e(t){return t&&t.__esModule?t:{default:t}}function m0e(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(m0e=function(i){return i?n:e})(t)}function iGt(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=m0e(e);if(n&&n.has(t))return n.get(t);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&Object.prototype.hasOwnProperty.call(t,o)){var a=i?Object.getOwnPropertyDescriptor(t,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=t[o]}return r.default=t,n&&n.set(t,r),r}function CF(){return CF=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function cGt(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,TF(t,e)}function TF(t,e){return TF=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},TF(t,e)}var g0e=function(t){cGt(e,t);function e(){for(var r,i=arguments.length,o=new Array(i),a=0;an(t,!i.visible)}),r?w.jsx(Qg,{}):w.jsx(Qg,{variant:"inset",component:"li",style:{margin:"0 0 0 52px"}})]})}const pGt={x:48,y:128},mGt={width:320,height:520},JO={resizeBox:{position:"absolute",zIndex:1e3},windowPaper:{width:"100%",height:"100%",display:"flex",flexDirection:"column"},windowHeader:t=>({display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"move",padding:1,marginBottom:"2px",borderBottom:`1px solid ${t.palette.mode==="dark"?"#FFFFFF3F":"#0000003F"}`}),windowTitle:{fontWeight:"bolder"}};function gGt(t){const[e,n]=M.useState(pGt),[r,i]=M.useState(mGt),{layerMenuOpen:o,setLayerMenuOpen:a,openDialog:s,...l}=t;if(!o)return null;console.log("layerProps",l);const c=()=>{s("userOverlays")},u=()=>{s("userBaseMaps")},f=()=>{a(!1)},d=(p,m)=>{n({...m})},h=(p,m)=>{i({...m.size})};return w.jsx(L8t,{handle:"#layer-select-header",position:e,onStop:d,children:w.jsx(uGt,{width:r.width,height:r.height,style:JO.resizeBox,onResize:h,children:w.jsxs(Go,{elevation:10,sx:JO.windowPaper,component:"div",children:[w.jsxs(Ke,{id:"layer-select-header",sx:JO.windowHeader,children:[w.jsx(Ke,{component:"span",sx:JO.windowTitle,children:fe.get("Layers")}),w.jsx(Ot,{size:"small",onClick:f,children:w.jsx(kp,{fontSize:"inherit"})})]}),w.jsx(Ke,{sx:{width:"100%",overflow:"auto",flexGrow:1},children:w.jsxs(eie,{dense:!0,children:[w.jsx(wc,{layerId:"overlay",...l}),w.jsx(wc,{layerId:"userPlaces",...l}),w.jsx(wc,{layerId:"datasetPlaces",...l}),w.jsx(wc,{layerId:"datasetBoundary",...l}),w.jsx(wc,{layerId:"datasetVariable",...l}),w.jsx(wc,{layerId:"datasetVariable2",...l}),w.jsx(wc,{layerId:"datasetRgb",...l}),w.jsx(wc,{layerId:"datasetRgb2",...l}),w.jsx(wc,{layerId:"baseMap",...l,last:!0}),w.jsx(Nr,{onClick:u,children:fe.get("User Base Maps")+"..."}),w.jsx(Nr,{onClick:c,children:fe.get("User Overlays")+"..."})]})})]})})})}const vGt=t=>({locale:t.controlState.locale,layerMenuOpen:t.controlState.layerMenuOpen,layerStates:P9e(t)}),yGt={openDialog:Pp,setLayerMenuOpen:Ile,setLayerVisibility:P7e},xGt=Jt(vGt,yGt)(gGt),bGt=t=>({locale:t.controlState.locale,hasConsent:t.controlState.privacyNoticeAccepted,compact:Kt.instance.branding.compact}),_Gt={},wGt=we("main")(({theme:t})=>({padding:0,width:"100vw",height:"100vh",overflow:"hidden",display:"flex",flexDirection:"column",alignItems:"stretch",[t.breakpoints.up("md")]:{overflow:"hidden"}})),SGt=({hasConsent:t,compact:e})=>w.jsxs(wGt,{children:[!e&&w.jsx(BM,{variant:"dense"}),t&&w.jsxs(w.Fragment,{children:[w.jsx(uot,{}),w.jsx(YVt,{}),w.jsx(xGt,{})]})]}),OGt=Jt(bGt,_Gt)(SGt),CGt={icon:t=>({marginRight:t.spacing(2)})};function TGt({open:t,settings:e,updateSettings:n,syncWithServer:r}){const[i,o]=M.useState(null);if(M.useEffect(()=>{const l=fe.get("docs/privacy-note.en.md");fetch(l).then(c=>c.text()).then(c=>o(c))}),!t)return null;function a(){n({...e,privacyNoticeAccepted:!0}),r()}function s(){try{window.history.length>0?window.history.back():typeof window.home=="function"?window.home():window.location.href="about:home"}catch(l){console.error(l)}}return w.jsxs(el,{open:t,disableEscapeKeyDown:!0,keepMounted:!0,scroll:"body",children:[w.jsx(dd,{children:fe.get("Privacy Notice")}),w.jsx(qs,{children:w.jsx(Xke,{children:i===null?w.jsx(Qv,{}):w.jsx(S2,{children:i,linkTarget:"_blank"})})}),w.jsxs(yp,{children:[w.jsxs(er,{onClick:a,children:[w.jsx(b6,{sx:CGt.icon}),fe.get("Accept and continue")]}),w.jsx(er,{onClick:s,children:fe.get("Leave")})]})]})}const EGt=t=>({open:!t.controlState.privacyNoticeAccepted,settings:t.controlState}),PGt={updateSettings:J1,syncWithServer:WB},MGt=Jt(EGt,PGt)(TGt),kGt=Li(Qv)(({theme:t})=>({margin:t.spacing(2)})),AGt=Li(At)(({theme:t})=>({margin:t.spacing(1)})),RGt=Li("div")(({theme:t})=>({margin:t.spacing(1),textAlign:"center",display:"flex",alignItems:"center",flexDirection:"column"}));function IGt({messages:t}){return t.length===0?null:w.jsxs(el,{open:!0,"aria-labelledby":"loading",children:[w.jsx(dd,{id:"loading",children:fe.get("Please wait...")}),w.jsxs(RGt,{children:[w.jsx(kGt,{}),t.map((e,n)=>w.jsx(AGt,{children:e},n))]})]})}const DGt=t=>({locale:t.controlState.locale,messages:S9e(t)}),LGt={},$Gt=Jt(DGt,LGt)(IGt);var _6={},NGt=ct;Object.defineProperty(_6,"__esModule",{value:!0});var y0e=_6.default=void 0,FGt=NGt(pt()),jGt=w;y0e=_6.default=(0,FGt.default)((0,jGt.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"}),"Error");var w6={},BGt=ct;Object.defineProperty(w6,"__esModule",{value:!0});var x0e=w6.default=void 0,zGt=BGt(pt()),UGt=w;x0e=w6.default=(0,zGt.default)((0,UGt.jsx)("path",{d:"M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z"}),"Warning");var S6={},WGt=ct;Object.defineProperty(S6,"__esModule",{value:!0});var b0e=S6.default=void 0,VGt=WGt(pt()),GGt=w;b0e=S6.default=(0,VGt.default)((0,GGt.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"}),"CheckCircle");const HGt={success:b0e,warning:x0e,error:y0e,info:Qz},qGt=Li("span")(()=>({display:"flex",alignItems:"center"})),eC={close:{p:.5},success:t=>({color:t.palette.error.contrastText,backgroundColor:Rc[600]}),error:t=>({color:t.palette.error.contrastText,backgroundColor:t.palette.error.dark}),info:t=>({color:t.palette.error.contrastText,backgroundColor:t.palette.primary.dark}),warning:t=>({color:t.palette.error.contrastText,backgroundColor:une[700]}),icon:{fontSize:20},iconVariant:t=>({opacity:.9,marginRight:t.spacing(1),fontSize:20}),message:{display:"flex",alignItems:"center"}},XGt={vertical:"bottom",horizontal:"center"};function QGt({className:t,message:e,hideMessage:n}){const r=()=>{n(e.id)};if(!e)return null;const i=HGt[e.type];return w.jsx(yLe,{open:!0,anchorOrigin:XGt,autoHideDuration:5e3,onClose:r,children:w.jsx(cie,{sx:eC[e.type],className:t,"aria-describedby":"client-snackbar",message:w.jsxs(qGt,{id:"client-snackbar",children:[w.jsx(i,{sx:eC.iconVariant}),e.text]}),action:[w.jsx(Ot,{"aria-label":"Close",color:"inherit",sx:eC.close,onClick:r,size:"large",children:w.jsx(kp,{sx:eC.icon})},"close")]})},e.type+":"+e.text)}const YGt=t=>{const e=t.messageLogState.newEntries;return{locale:t.controlState.locale,message:e.length>0?e[0]:null}},KGt={hideMessage:A9e},ZGt=Jt(YGt,KGt)(QGt);var O6={},JGt=ct;Object.defineProperty(O6,"__esModule",{value:!0});var kP=O6.default=void 0,eHt=JGt(pt()),tHt=w;kP=O6.default=(0,eHt.default)((0,tHt.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add");var C6={},nHt=ct;Object.defineProperty(C6,"__esModule",{value:!0});var T6=C6.default=void 0,rHt=nHt(pt()),iHt=w;T6=C6.default=(0,rHt.default)((0,iHt.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete");const Tm={formControl:t=>({marginLeft:t.spacing(1),marginRight:t.spacing(1),width:200}),textField:t=>({marginLeft:t.spacing(1),marginRight:t.spacing(1),width:200}),textField2:t=>({marginLeft:t.spacing(1),marginRight:t.spacing(1),width:400}),button:t=>({margin:t.spacing(.1)})};function oHt({open:t,servers:e,selectedServer:n,closeDialog:r,configureServers:i}){const o=M.useRef(!1),[a,s]=M.useState(e),[l,c]=M.useState(n),[u,f]=M.useState("select");M.useEffect(()=>{o.current&&(s(e),c(n)),o.current=!0},[e,n]);const d=()=>{u==="select"?(r("server"),i(a,l.id)):u==="add"?E():u==="edit"&&k()},h=()=>{u==="select"?_():I()},p=()=>{_()},m=B=>{const W=B.target.value,U=a.find(N=>N.id===W);c(U)},g=B=>{const W=B.target.value,U={...l,name:W};c(U)},v=B=>{const W=B.target.value,U={...l,url:W};c(U)},y=()=>{f("add")},x=()=>{f("edit")},b=()=>{P()},_=()=>{r("server")},S=()=>{const B=l.id;return a.findIndex(W=>W.id===B)},O=(B,W)=>{const U=[...a];U[B]=W,s(U),c(W),f("select")},C=(B,W)=>{s(B),c(W),f("select")},E=()=>{const B={...l,id:Ys("server-")},W=[...a,B];C(W,B)},k=()=>{O(S(),{...l})},I=()=>{const B=S();O(S(),a[B])},P=()=>{const B=[...a];if(B.length<2)throw new Error("internal error: server list cannot be emptied");const W=S(),U=B[W+(W>0?-1:1)];B.splice(W,1),C(B,U)},R=a.map((B,W)=>w.jsx(Nr,{value:B.id,children:B.name},W));let T;u==="add"?T=fe.get("Add"):u==="edit"?T=fe.get("Save"):T=fe.get("OK");let L;u==="add"?L=fe.get("Add Server"):u==="edit"?L=fe.get("Edit Server"):L=fe.get("Select Server");let z;return u==="add"||u==="edit"?z=w.jsxs(qs,{dividers:!0,children:[w.jsx(lr,{variant:"standard",required:!0,id:"server-name",label:"Name",sx:Tm.textField,margin:"normal",value:l.name,onChange:g}),w.jsx("br",{}),w.jsx(lr,{variant:"standard",required:!0,id:"server-url",label:"URL",sx:Tm.textField2,margin:"normal",value:l.url,onChange:v})]}):z=w.jsx(qs,{dividers:!0,children:w.jsxs("div",{children:[w.jsxs(Yv,{variant:"standard",sx:Tm.formControl,children:[w.jsx(Kv,{htmlFor:"server-name",children:"Name"}),w.jsx(wp,{variant:"standard",value:l.id,onChange:m,inputProps:{name:"server-name",id:"server-name"},children:R}),w.jsx(Gre,{children:l.url})]}),w.jsx(Ot,{sx:Tm.button,"aria-label":"Add",color:"primary",onClick:y,size:"large",children:w.jsx(kP,{fontSize:"small"})}),w.jsx(Ot,{sx:Tm.button,"aria-label":"Edit",onClick:x,size:"large",children:w.jsx(Ap,{fontSize:"small"})}),w.jsx(Ot,{sx:Tm.button,"aria-label":"Delete",disabled:a.length<2,onClick:b,size:"large",children:w.jsx(T6,{fontSize:"small"})})]})}),w.jsxs(el,{open:t,onClose:p,"aria-labelledby":"server-dialog-title",children:[w.jsx(dd,{id:"server-dialog-title",children:L}),z,w.jsxs(yp,{children:[w.jsx(er,{onClick:h,children:fe.get("Cancel")}),w.jsx(er,{onClick:d,autoFocus:!0,children:T})]})]})}const aHt=t=>({open:!!t.controlState.dialogOpen.server,servers:jae(t),selectedServer:hi(t)}),sHt={closeDialog:by,configureServers:l7e},lHt=Jt(aHt,sHt)(oHt),kJ=({anchorElement:t,layers:e,selectedLayerId:n,setSelectedLayerId:r,onClose:i})=>w.jsx(_p,{anchorEl:t,keepMounted:!0,open:!!t,onClose:i,children:t&&e.map(o=>w.jsx(Nr,{selected:o.id===n,onClick:()=>r(o.id===n?null:o.id),dense:!0,children:w.jsx(es,{primary:YT(o)})},o.id))}),CD={settingsPanelTitle:t=>({marginBottom:t.spacing(1)}),settingsPanelPaper:t=>({backgroundColor:(t.palette.mode==="dark"?Qne:Xne)(t.palette.background.paper,.1),marginBottom:t.spacing(2)}),settingsPanelList:{margin:0}},jm=({title:t,children:e})=>{const n=ue.Children.count(e),r=[];return ue.Children.forEach(e,(i,o)=>{r.push(i),o{let i;e||(i={marginBottom:10});const o=w.jsx(es,{primary:t,secondary:e});let a;return r&&(a=w.jsx(TT,{children:r})),n?w.jsxs(Yre,{style:i,onClick:n,children:[o,a]}):w.jsxs(jx,{style:i,children:[o,a]})},Cf=({propertyName:t,settings:e,updateSettings:n,disabled:r})=>w.jsx(uie,{checked:!!e[t],onChange:()=>n({...e,[t]:!e[t]}),disabled:r}),cHt=({propertyName:t,settings:e,updateSettings:n,options:r,disabled:i})=>{const o=(a,s)=>{n({...e,[t]:s})};return w.jsx(g5,{row:!0,value:e[t],onChange:o,children:r.map(([a,s])=>w.jsx(xg,{control:w.jsx(Bx,{}),value:s,label:a,disabled:i},a))})},Q0={textField:t=>({marginLeft:t.spacing(1),marginRight:t.spacing(1),fontSize:t.typography.fontSize/2}),intTextField:t=>({marginLeft:t.spacing(1),marginRight:t.spacing(1),fontSize:t.typography.fontSize/2,width:t.spacing(6)}),localeAvatar:{margin:10}},AJ=[["doNothing","Do nothing"],["pan","Pan"],["panAndZoom","Pan and zoom"]],uHt=[["point","Points"],["line","Lines"],["bar","Bars"]],fHt=({open:t,closeDialog:e,settings:n,selectedServer:r,baseMapLayers:i,overlayLayers:o,updateSettings:a,changeLocale:s,openDialog:l,viewerVersion:c,serverInfo:u})=>{const[f,d]=ue.useState(null),[h,p]=ue.useState(null),[m,g]=ue.useState(null),[v,y]=ue.useState(n.timeChunkSize+"");if(ue.useEffect(()=>{const A=parseInt(v);!Number.isNaN(A)&&A!==n.timeChunkSize&&a({timeChunkSize:A})},[v,n,a]),!t)return null;function x(){e("settings")}function b(){l("server")}function _(A){a({timeAnimationInterval:parseInt(A.target.value)})}function S(A){a({timeSeriesChartTypeDefault:A.target.value})}function O(A){a({datasetLocateMode:A.target.value})}function C(A){a({placeLocateMode:A.target.value})}function E(A){y(A.target.value)}let k=null;f&&(k=Object.getOwnPropertyNames(fe.languages).map(A=>{const q=fe.languages[A];return w.jsx(Nr,{selected:A===n.locale,onClick:()=>s(A),children:w.jsx(es,{primary:q})},A)}));function I(A){d(A.currentTarget)}function P(){d(null)}function R(A){p(A.currentTarget)}function T(){p(null)}const L=A=>{A.stopPropagation(),l("userBaseMaps")},z=KT(i,n.selectedBaseMapId),B=YT(z);function W(A){g(A.currentTarget)}function U(){g(null)}const N=A=>{A.stopPropagation(),l("userOverlays")},$=KT(o,n.selectedOverlayId),D=YT($);return w.jsxs("div",{children:[w.jsxs(el,{open:t,fullWidth:!0,maxWidth:"sm",onClose:x,scroll:"body",children:[w.jsx(dd,{children:fe.get("Settings")}),w.jsxs(qs,{children:[w.jsxs(jm,{title:fe.get("General"),children:[w.jsx(hr,{label:fe.get("Server"),value:r.name,onClick:b}),w.jsx(hr,{label:fe.get("Language"),value:fe.languages[n.locale],onClick:I}),w.jsx(hr,{label:fe.get("Time interval of the player"),children:w.jsx(lr,{variant:"standard",select:!0,sx:Q0.textField,value:n.timeAnimationInterval,onChange:_,margin:"normal",children:tHe.map((A,q)=>w.jsx(Nr,{value:A,children:A+" ms"},q))})})]}),w.jsxs(jm,{title:fe.get("Time-Series"),children:[w.jsx(hr,{label:fe.get("Show chart after adding a place"),value:tC(n.autoShowTimeSeries),children:w.jsx(Cf,{propertyName:"autoShowTimeSeries",settings:n,updateSettings:a})}),w.jsx(hr,{label:fe.get("Default chart type"),children:w.jsx(lr,{variant:"standard",select:!0,sx:Q0.textField,value:n.timeSeriesChartTypeDefault,onChange:S,margin:"normal",children:uHt.map(([A,q])=>w.jsx(Nr,{value:A,children:fe.get(q)},A))})}),w.jsx(hr,{label:fe.get("Calculate standard deviation"),value:tC(n.timeSeriesIncludeStdev),children:w.jsx(Cf,{propertyName:"timeSeriesIncludeStdev",settings:n,updateSettings:a})}),w.jsx(hr,{label:fe.get("Calculate median instead of mean (disables standard deviation)"),value:tC(n.timeSeriesUseMedian),children:w.jsx(Cf,{propertyName:"timeSeriesUseMedian",settings:n,updateSettings:a})}),w.jsx(hr,{label:fe.get("Minimal number of data points in a time series update"),children:w.jsx(lr,{variant:"standard",sx:Q0.intTextField,value:v,onChange:E,margin:"normal",size:"small"})})]}),w.jsxs(jm,{title:fe.get("Map"),children:[w.jsx(hr,{label:fe.get("Base map"),value:B,onClick:R,children:w.jsx(er,{onClick:L,children:fe.get("User Base Maps")+"..."})}),w.jsx(hr,{label:fe.get("Overlay"),value:D,onClick:W,children:w.jsx(er,{onClick:N,children:fe.get("User Overlays")+"..."})}),w.jsx(hr,{label:fe.get("Projection"),children:w.jsx(cHt,{propertyName:"mapProjection",settings:n,updateSettings:a,options:[[fe.get("Geographic"),uy],[fe.get("Mercator"),SB]]})}),w.jsx(hr,{label:fe.get("Image smoothing"),value:tC(n.imageSmoothingEnabled),children:w.jsx(Cf,{propertyName:"imageSmoothingEnabled",settings:n,updateSettings:a})}),w.jsx(hr,{label:fe.get("On dataset selection"),children:w.jsx(lr,{variant:"standard",select:!0,sx:Q0.textField,value:n.datasetLocateMode,onChange:O,margin:"normal",children:AJ.map(([A,q])=>w.jsx(Nr,{value:A,children:fe.get(q)},A))})}),w.jsx(hr,{label:fe.get("On place selection"),children:w.jsx(lr,{variant:"standard",select:!0,sx:Q0.textField,value:n.placeLocateMode,onChange:C,margin:"normal",children:AJ.map(([A,q])=>w.jsx(Nr,{value:A,children:fe.get(q)},A))})})]}),w.jsx(jm,{title:fe.get("Legal Agreement"),children:w.jsx(hr,{label:fe.get("Privacy notice"),value:n.privacyNoticeAccepted?fe.get("Accepted"):"",children:w.jsx(er,{disabled:!n.privacyNoticeAccepted,onClick:()=>{a({privacyNoticeAccepted:!1}),window.location.reload()},children:fe.get("Revoke consent")})})}),w.jsxs(jm,{title:fe.get("System Information"),children:[w.jsx(hr,{label:`xcube Viewer ${fe.get("version")}`,value:c}),w.jsx(hr,{label:`xcube Server ${fe.get("version")}`,value:u?u.version:fe.get("Cannot reach server")})]})]})]}),w.jsx(_p,{anchorEl:f,keepMounted:!0,open:!!f,onClose:P,children:k}),w.jsx(kJ,{anchorElement:h,layers:i,selectedLayerId:n.selectedBaseMapId,setSelectedLayerId:A=>a({selectedBaseMapId:A}),onClose:T}),w.jsx(kJ,{anchorElement:m,layers:o,selectedLayerId:n.selectedOverlayId,setSelectedLayerId:A=>a({selectedOverlayId:A}),onClose:U})]})},tC=t=>t?fe.get("On"):fe.get("Off"),dHt="1.3.0-dev.1",hHt=t=>({locale:t.controlState.locale,open:t.controlState.dialogOpen.settings,settings:t.controlState,baseMapLayers:DB(t),overlayLayers:LB(t),selectedServer:hi(t),viewerVersion:dHt,serverInfo:t.dataState.serverInfo}),pHt={closeDialog:by,updateSettings:J1,changeLocale:Vle,openDialog:Pp},mHt=Jt(hHt,pHt)(fHt),RJ={separatorTextField:t=>({marginLeft:t.spacing(1),marginRight:t.spacing(1),fontSize:t.typography.fontSize/2,maxWidth:"6em"}),fileNameTextField:t=>({marginLeft:t.spacing(1),marginRight:t.spacing(1),fontSize:t.typography.fontSize/2})},gHt=({open:t,closeDialog:e,settings:n,updateSettings:r,downloadTimeSeries:i})=>{const o=()=>{e("export")};function a(c){r({exportFileName:c.target.value})}function s(c){r({exportTimeSeriesSeparator:c.target.value})}const l=()=>{o(),i()};return w.jsx("div",{children:w.jsxs(el,{open:t,fullWidth:!0,maxWidth:"xs",onClose:o,scroll:"body",children:[w.jsx(qs,{children:w.jsxs(jm,{title:fe.get("Export Settings"),children:[w.jsx(hr,{label:fe.get("Include time-series data")+" (*.txt)",value:nC(n.exportTimeSeries),children:w.jsx(Cf,{propertyName:"exportTimeSeries",settings:n,updateSettings:r})}),w.jsx(hr,{label:fe.get("Separator for time-series data"),children:w.jsx(lr,{variant:"standard",sx:RJ.separatorTextField,value:n.exportTimeSeriesSeparator,onChange:s,disabled:!n.exportTimeSeries,margin:"normal",size:"small"})}),w.jsx(hr,{label:fe.get("Include places data")+" (*.geojson)",value:nC(n.exportPlaces),children:w.jsx(Cf,{propertyName:"exportPlaces",settings:n,updateSettings:r})}),w.jsx(hr,{label:fe.get("Combine place data in one file"),value:nC(n.exportPlacesAsCollection),children:w.jsx(Cf,{propertyName:"exportPlacesAsCollection",settings:n,updateSettings:r,disabled:!n.exportPlaces})}),w.jsx(hr,{label:fe.get("As ZIP archive"),value:nC(n.exportZipArchive),children:w.jsx(Cf,{propertyName:"exportZipArchive",settings:n,updateSettings:r})}),w.jsx(hr,{label:fe.get("File name"),children:w.jsx(lr,{variant:"standard",sx:RJ.fileNameTextField,value:n.exportFileName,onChange:a,margin:"normal",size:"small"})})]})}),w.jsx(yp,{children:w.jsx(er,{onClick:l,disabled:!xHt(n),children:fe.get("Download")})})]})})},nC=t=>t?fe.get("On"):fe.get("Off"),vHt=t=>/^[0-9a-zA-Z_-]+$/.test(t),yHt=t=>t.toUpperCase()==="TAB"||t.length===1,xHt=t=>(t.exportTimeSeries||t.exportPlaces)&&vHt(t.exportFileName)&&(!t.exportTimeSeries||yHt(t.exportTimeSeriesSeparator)),bHt=t=>({locale:t.controlState.locale,open:!!t.controlState.dialogOpen.export,settings:t.controlState}),_Ht={closeDialog:by,updateSettings:J1,downloadTimeSeries:g7e},wHt=Jt(bHt,_Ht)(gHt);var E6={},SHt=ct;Object.defineProperty(E6,"__esModule",{value:!0});var _0e=E6.default=void 0,OHt=SHt(pt()),CHt=w;_0e=E6.default=(0,OHt.default)((0,CHt.jsx)("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore");var P6={},THt=ct;Object.defineProperty(P6,"__esModule",{value:!0});var w0e=P6.default=void 0,EHt=THt(pt()),PHt=w;w0e=P6.default=(0,EHt.default)((0,PHt.jsx)("path",{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}),"ExpandLess");const MHt=({title:t,accept:e,multiple:n,disabled:r,onSelect:i,className:o})=>{const a=M.useRef(null),s=c=>{if(c.target.files!==null&&c.target.files.length){const u=[];for(let f=0;f{a.current!==null&&a.current.click()};return w.jsxs(w.Fragment,{children:[w.jsx("input",{type:"file",accept:e,multiple:n,ref:a,hidden:!0,onChange:s,disabled:r}),w.jsx(er,{onClick:l,disabled:r,className:o,variant:"outlined",size:"small",children:t})]})},TD={parse:t=>t,format:t=>typeof t=="string"?t:`${t}`,validate:t=>!0};function M6(){return t=>{const{options:e,updateOptions:n,optionKey:r,label:i,style:o,className:a,disabled:s,parse:l,format:c,validate:u}=t,f=e[r],d=h=>{const p=h.target.value,m=(l||TD.parse)(p);n({[r]:m})};return w.jsx(lr,{label:fe.get(i),value:(c||TD.format)(f),error:!(u||TD.validate)(f),onChange:d,style:o,className:a,disabled:s,size:"small",variant:"standard"})}}const Y0=M6(),kHt=Li("div")(({theme:t})=>({paddingTop:t.spacing(2)})),AHt=({options:t,updateOptions:e})=>w.jsx(kHt,{children:w.jsxs("div",{style:{display:"grid",gap:12,paddingTop:12,gridTemplateColumns:"auto auto"},children:[w.jsx(Y0,{optionKey:"timeNames",label:"Time property names",options:t,updateOptions:e}),w.jsx("div",{id:"spareField"}),w.jsx(Y0,{label:"Group property names",optionKey:"groupNames",options:t,updateOptions:e}),w.jsx(Y0,{label:"Group prefix (used as fallback)",optionKey:"groupPrefix",options:t,updateOptions:e}),w.jsx(Y0,{label:"Label property names",optionKey:"labelNames",options:t,updateOptions:e}),w.jsx(Y0,{label:"Label prefix (used as fallback)",optionKey:"labelPrefix",options:t,updateOptions:e})]})}),io=M6(),RHt=Li("div")(({theme:t})=>({paddingTop:t.spacing(2)})),IHt=({options:t,updateOptions:e})=>{const n=t.forceGeometry;return w.jsxs(RHt,{children:[w.jsxs("div",{style:{display:"grid",gap:12,paddingTop:12,gridTemplateColumns:"auto auto"},children:[w.jsx(io,{optionKey:"xNames",label:"X/longitude column names",options:t,updateOptions:e,disabled:n}),w.jsx(io,{optionKey:"yNames",label:"Y/latitude column names",options:t,updateOptions:e,disabled:n}),w.jsxs("span",{children:[w.jsx(DL,{checked:t.forceGeometry,onChange:r=>e({forceGeometry:r.target.checked}),size:"small"}),w.jsx("span",{children:"Use geometry column"})]}),w.jsx(io,{optionKey:"geometryNames",label:"Geometry column names",options:t,updateOptions:e,disabled:!n}),w.jsx(io,{optionKey:"timeNames",label:"Time column names",options:t,updateOptions:e}),w.jsx("div",{id:"spareField"}),w.jsx(io,{optionKey:"groupNames",label:"Group column names",options:t,updateOptions:e}),w.jsx(io,{optionKey:"groupPrefix",label:"Group prefix (used as fallback)",options:t,updateOptions:e}),w.jsx(io,{optionKey:"labelNames",label:"Label column names",options:t,updateOptions:e}),w.jsx(io,{optionKey:"labelPrefix",label:"Label prefix (used as fallback)",options:t,updateOptions:e})]}),w.jsxs("div",{style:{display:"grid",gap:12,paddingTop:12,gridTemplateColumns:"auto auto auto"},children:[w.jsx(io,{optionKey:"separator",label:"Separator character",options:t,updateOptions:e}),w.jsx(io,{optionKey:"comment",label:"Comment character",options:t,updateOptions:e}),w.jsx(io,{optionKey:"quote",label:"Quote character",options:t,updateOptions:e}),w.jsx(io,{optionKey:"escape",label:"Escape character",options:t,updateOptions:e}),w.jsx("div",{}),w.jsxs("span",{children:[w.jsx(DL,{checked:t.trim,onChange:r=>e({trim:r.target.checked}),size:"small"}),w.jsx("span",{children:"Remove whitespaces"})]}),w.jsx(io,{optionKey:"nanToken",label:"Not-a-number token",options:t,updateOptions:e}),w.jsx(io,{optionKey:"trueToken",label:"True token",options:t,updateOptions:e}),w.jsx(io,{optionKey:"falseToken",label:"False token",options:t,updateOptions:e})]})]})},K0=M6(),DHt=Li("div")(({theme:t})=>({paddingTop:t.spacing(2)})),LHt=({options:t,updateOptions:e})=>w.jsx(DHt,{children:w.jsxs("div",{style:{display:"grid",gap:12,paddingTop:12,gridTemplateColumns:"auto auto"},children:[w.jsx(K0,{optionKey:"time",label:"Time (UTC, ISO-format)",options:t,updateOptions:e}),w.jsx("div",{id:"spareField"}),w.jsx(K0,{label:"Group",options:t,optionKey:"group",updateOptions:e}),w.jsx(K0,{label:"Group prefix (used as fallback)",optionKey:"groupPrefix",options:t,updateOptions:e,disabled:t.group.trim()!==""}),w.jsx(K0,{label:"Label",optionKey:"label",options:t,updateOptions:e}),w.jsx(K0,{label:"Label prefix (used as fallback)",optionKey:"labelPrefix",options:t,updateOptions:e,disabled:t.label.trim()!==""})]})}),ED={csv:{...Zae,codeExt:[]},geojson:{...Jae,codeExt:[Epe()]},wkt:{...ese,codeExt:[]}},PD={spacer:{flexGrow:1},actionButton:t=>({marginRight:t.spacing(1)}),error:{fontSize:"small"}},$Ht=Li("div")(({theme:t})=>({paddingTop:t.spacing(.5),display:"flex",flexDirection:"row",alignItems:"center"})),NHt=Li(MHt)(({theme:t})=>({marginRight:t.spacing(1)})),FHt=({open:t,closeDialog:e,userPlacesFormatName:n,userPlacesFormatOptions:r,updateSettings:i,addUserPlacesFromText:o,nextMapInteraction:a,setMapInteraction:s})=>{const[l,c]=M.useState(""),[u,f]=M.useState(null),[d,h]=M.useState(!1),[p,m]=M.useState(!1),[g,v]=M.useState(n),[y,x]=M.useState(r);if(M.useEffect(()=>{v(n)},[n]),M.useEffect(()=>{x(r)},[r]),!t)return null;const b=()=>{s("Select"),e("addUserPlacesFromText"),i({userPlacesFormatName:g,userPlacesFormatOptions:y}),o(l)},_=()=>{s(a),e("addUserPlacesFromText")},S=()=>{c("")},O=z=>{const B=z[0];h(!0);const W=new FileReader;W.onloadend=()=>{const U=W.result;v(rH(U)),c(U),h(!1)},W.onabort=W.onerror=()=>{h(!1)},W.readAsText(B,"UTF-8")},C=()=>{c("")},E=()=>{console.info("PASTE!",l)},k=z=>{let B=g;l===""&&z.length>10&&(B=rH(z),v(B)),c(z),f(ED[B].checkError(z))};function I(z){v(z.target.value)}function P(z){x({...y,csv:{...y.csv,...z}})}function R(z){x({...y,geojson:{...y.geojson,...z}})}function T(z){x({...y,wkt:{...y.wkt,...z}})}let L;return g==="csv"?L=w.jsx(IHt,{options:y.csv,updateOptions:P}):g==="geojson"?L=w.jsx(AHt,{options:y.geojson,updateOptions:R}):L=w.jsx(LHt,{options:y.wkt,updateOptions:T}),w.jsxs(el,{fullWidth:!0,open:t,onClose:_,"aria-labelledby":"server-dialog-title",children:[w.jsx(dd,{id:"server-dialog-title",children:fe.get("Import places")}),w.jsxs(qs,{dividers:!0,children:[w.jsxs(g5,{row:!0,value:g,onChange:z=>I(z),children:[w.jsx(xg,{value:"csv",label:fe.get(Zae.name),control:w.jsx(Bx,{})},"csv"),w.jsx(xg,{value:"geojson",label:fe.get(Jae.name),control:w.jsx(Bx,{})},"geojson"),w.jsx(xg,{value:"wkt",label:fe.get(ese.name),control:w.jsx(Bx,{})},"wkt")]}),w.jsx(j2,{theme:Kt.instance.branding.themeName||"light",placeholder:fe.get("Enter text or drag & drop a text file."),autoFocus:!0,height:"400px",extensions:ED[g].codeExt,value:l,onChange:k,onDrop:C,onPaste:E,onPasteCapture:E}),u&&w.jsx(At,{color:"error",sx:PD.error,children:u}),w.jsxs($Ht,{children:[w.jsx(NHt,{title:fe.get("From File")+"...",accept:ED[g].fileExt,multiple:!1,onSelect:O,disabled:d}),w.jsx(er,{onClick:S,disabled:l.trim()===""||d,sx:PD.actionButton,variant:"outlined",size:"small",children:fe.get("Clear")}),w.jsx(Ke,{sx:PD.spacer}),w.jsx(er,{onClick:()=>m(!p),endIcon:p?w.jsx(w0e,{}):w.jsx(_0e,{}),variant:"outlined",size:"small",children:fe.get("Options")})]}),w.jsx(hre,{in:p,timeout:"auto",unmountOnExit:!0,children:L})]}),w.jsxs(yp,{children:[w.jsx(er,{onClick:_,variant:"text",children:fe.get("Cancel")}),w.jsx(er,{onClick:b,disabled:l.trim()===""||u!==null||d,variant:"text",children:fe.get("OK")})]})]})},jHt=t=>({open:t.controlState.dialogOpen.addUserPlacesFromText,userPlacesFormatName:t.controlState.userPlacesFormatName,userPlacesFormatOptions:t.controlState.userPlacesFormatOptions,nextMapInteraction:t.controlState.lastMapInteraction}),BHt={closeDialog:by,updateSettings:J1,setMapInteraction:Ale,addUserPlacesFromText:Qse},zHt=Jt(jHt,BHt)(FHt);var k6={},UHt=ct;Object.defineProperty(k6,"__esModule",{value:!0});var A6=k6.default=void 0,WHt=UHt(pt()),VHt=w;A6=k6.default=(0,WHt.default)((0,VHt.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"}),"ContentCopy");function R6(t,e){return S0e(t,e,[]).join("")}function S0e(t,e,n){if(t.nodeType==Node.CDATA_SECTION_NODE||t.nodeType==Node.TEXT_NODE)e?n.push(String(t.nodeValue).replace(/(\r\n|\r|\n)/g,"")):n.push(t.nodeValue);else{var r=void 0;for(r=t.firstChild;r;r=r.nextSibling)S0e(r,e,n)}return n}function GHt(t){return"documentElement"in t}function HHt(t){return new DOMParser().parseFromString(t,"application/xml")}function O0e(t,e){return function(n,r){var i=t.call(e!==void 0?e:this,n,r);if(i!==void 0){var o=r[r.length-1];o.push(i)}}}function aa(t,e,n){return function(r,i){var o=t.call(n!==void 0?n:this,r,i);if(o!==void 0){var a=i[i.length-1],s=e!==void 0?e:r.localName,l=void 0;s in a?l=a[s]:(l=[],a[s]=l),l.push(o)}}}function gt(t,e,n){return function(r,i){var o=t.call(n!==void 0?n:this,r,i);if(o!==void 0){var a=i[i.length-1],s=e!==void 0?e:r.localName;a[s]=o}}}function $i(t,e,n){var r=n!==void 0?n:{},i,o;for(i=0,o=t.length;i{const n=e.Name,r=e.Title||n;let i;const o=e.Attribution;if(RP(o)){const a=o.Title,s=o.OnlineResource;a&&s?i=`© ${a}`:s?i=`${s}`:a&&(i=`${a}`)}return{name:n,title:r,attribution:i}})}function $9t(t){const e=R9t.read(t);if(RP(e)){const n=e.Capability;if(RP(n))return EF(n,!0)}throw new Error("invalid WMSCapabilities object")}function EF(t,e){let n,r;if(e)n=t.Layer;else{const{Layer:o,...a}=t;n=o,r=a}let i;return Array.isArray(n)?i=n.flatMap(o=>EF(o)):RP(n)?i=EF(n):i=[{}],i.map(o=>N9t(r,o))}function N9t(t,e){if(!t)return e;if(typeof(t.Name||e.Name)!="string")throw new Error("invalid WMSCapabilities: missing Layer/Name");const r=t.Title,i=e.Title,o=r&&i?`${r} / ${i}`:i||r;return{...t,...e,Title:o}}function RP(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}const F9t=({userLayer:t,onChange:e,onCancel:n})=>{const[r,i]=M.useState(t.url),[o,a]=M.useState(null),[s,l]=M.useState(-1);M.useEffect(()=>{I9t(r).then(f=>{a(f)})},[r]),M.useEffect(()=>{if(o&&t.wms){const{layerName:f}=t.wms;l(o.findIndex(d=>d.name===f))}else l(-1)},[o,t.wms]);const c=()=>o&&o.length&&s!=-1,u=()=>{o&&s!==-1&&e({...t,group:EB,title:o[s].title,url:r.trim(),attribution:o[s].attribution,wms:{layerName:o[s].name}})};return w.jsxs(Ke,{sx:{display:"flex",gap:2,flexDirection:"column",padding:"5px 15px"},children:[w.jsx(lr,{required:!0,label:fe.get("WMS URL"),variant:"standard",size:"small",value:r,fullWidth:!0,onChange:f=>i(f.currentTarget.value)}),w.jsx(wp,{disabled:!o||!o.length,variant:"standard",onChange:f=>l(f.target.value),value:s,size:"small",renderValue:()=>o&&o.length&&s>=0?o[s].title:fe.get("WMS Layer"),children:(o||[]).map((f,d)=>w.jsx(Nr,{value:d,selected:s===d,children:w.jsx(es,{primary:f.title})},f.name))}),w.jsx(sw,{onDone:u,onCancel:n,doneDisabled:!c(),helpUrl:fe.get("docs/add-layer-wms.en.md")})]})},j9t=({userLayer:t,onChange:e,onCancel:n})=>{const[r,i]=ue.useState(t.title),[o,a]=ue.useState(t.url),[s,l]=ue.useState(t.attribution||""),c=(d,h)=>{const p=d!=="",m=h!==""&&(h.startsWith("http://")||h.trim().startsWith("https://"));return p&&m},u=()=>c(r.trim(),o.trim()),f=()=>e({...t,group:EB,title:r.trim(),url:o.trim(),attribution:s.trim()});return w.jsxs(Ke,{sx:{display:"flex",gap:1,flexDirection:"column",padding:"5px 15px"},children:[w.jsx(lr,{required:!0,label:fe.get("XYZ Layer URL"),variant:"standard",size:"small",value:o,fullWidth:!0,onChange:d=>a(d.currentTarget.value)}),w.jsxs(Ke,{sx:{display:"flex",gap:1},children:[w.jsx(lr,{required:!0,label:fe.get("Layer Title"),variant:"standard",size:"small",sx:{flexGrow:.3},value:r,onChange:d=>i(d.currentTarget.value)}),w.jsx(lr,{label:fe.get("Layer Attribution"),variant:"standard",size:"small",sx:{flexGrow:.7},value:s,onChange:d=>l(d.currentTarget.value)})]}),w.jsx(sw,{onDone:f,onCancel:n,doneDisabled:!u(),helpUrl:fe.get("docs/add-layer-xyz.en.md")})]})},B9t={paper:t=>({backgroundColor:(t.palette.mode==="dark"?Qne:Xne)(t.palette.background.paper,.1),marginBottom:t.spacing(2)})},IJ=({userLayers:t,setUserLayers:e,selectedId:n,setSelectedId:r})=>{const[i,o]=ue.useState(n),[a,s]=ue.useState(null),[l,c]=sfe();if(!open)return null;const u=x=>{c(()=>e(t)),s({editId:x.id,editMode:"edit"})},f=x=>{c(void 0);const b=t.findIndex(_=>_.id===x.id);e([...t.slice(0,b+1),{...x,id:Ys("user-layer"),title:x.title+" Copy"},...t.slice(b+1)])},d=x=>{c(void 0);const b=t.findIndex(_=>_.id===x.id);x.id===n&&r(i),x.id===i&&o(null),e([...t.slice(0,b),...t.slice(b+1)])},h=x=>{c(()=>e(t));const b=Ys("user-layer-");e([...t,{id:b,group:EB,title:"",url:"",attribution:"",wms:x==="wms"?{layerName:""}:void 0}]),s({editId:b,editMode:"add"})},p=()=>{h("wms")},m=()=>{h("xyz")},g=x=>{c(void 0);const b=t.findIndex(_=>_.id===x.id);n===x.id&&r(i),e([...t.slice(0,b),x,...t.slice(b+1)]),s(null)},v=()=>{if(l(),a&&a.editMode==="add"){const x=t.findIndex(b=>b.id===a.editId);e([...t.slice(0,x),...t.slice(x+1)])}s(null)},y=a!==null;return w.jsx(Go,{sx:B9t.paper,children:w.jsxs(FM,{component:"nav",dense:!0,children:[t.map(x=>{const b=n===x.id;return a&&a.editId===x.id?x.wms?w.jsx(F9t,{userLayer:x,onChange:g,onCancel:v},x.id):w.jsx(j9t,{userLayer:x,onChange:g,onCancel:v},x.id):w.jsxs(Yre,{selected:b,onClick:()=>r(b?null:x.id),children:[w.jsx(es,{primary:x.title,secondary:x.url}),w.jsxs(TT,{children:[w.jsx(Ot,{onClick:()=>u(x),size:"small",disabled:y,children:w.jsx(Ap,{})}),w.jsx(Ot,{onClick:()=>f(x),size:"small",disabled:y,children:w.jsx(A6,{})}),w.jsx(Ot,{onClick:()=>d(x),size:"small",disabled:y,children:w.jsx(kp,{})})]})]},x.id)}),!y&&w.jsx(jx,{sx:{minHeight:"3em"},children:w.jsx(TT,{children:w.jsxs(Ke,{sx:{display:"flex",gap:2,paddingTop:2},children:[w.jsx(_t,{title:fe.get("Add layer from a Web Map Service"),children:w.jsx(er,{onClick:p,startIcon:w.jsx(kP,{}),children:"WMS"})}),w.jsx(_t,{title:fe.get("Add layer from a Tiled Web Map"),children:w.jsx(er,{onClick:m,startIcon:w.jsx(kP,{}),children:"XYZ"})})]})})})]})})},z9t=({dialogId:t,open:e,closeDialog:n,settings:r,updateSettings:i})=>{const[o,a]=ue.useState(t==="userBaseMaps"?0:1);if(!e)return null;const s=r.userBaseMaps,l=g=>{i({userBaseMaps:g})},c=r.userOverlays,u=g=>{i({userOverlays:g})},f=r.selectedBaseMapId,d=g=>{i({selectedBaseMapId:g})},h=r.selectedOverlayId,p=g=>{i({selectedOverlayId:g})};function m(){n(t)}return w.jsxs(el,{open:e,fullWidth:!0,maxWidth:"sm",onClose:m,scroll:"body",children:[w.jsx(dd,{children:fe.get("User Layers")}),w.jsxs(qs,{children:[w.jsx(Ke,{sx:{borderBottom:1,borderColor:"divider"},children:w.jsxs(b5,{value:o,onChange:(g,v)=>a(v),children:[w.jsx(Ib,{label:"Base Maps"}),w.jsx(Ib,{label:"Overlays"})]})}),o===0&&w.jsx(IJ,{userLayers:s,setUserLayers:l,selectedId:f,setSelectedId:d},"baseMaps"),o===1&&w.jsx(IJ,{userLayers:c,setUserLayers:u,selectedId:h,setSelectedId:p},"overlays")]})]})},U9t=(t,e)=>({open:t.controlState.dialogOpen[e.dialogId],settings:t.controlState,dialogId:e.dialogId}),W9t={closeDialog:by,updateSettings:J1},DJ=Jt(U9t,W9t)(z9t);function M0e({selected:t,title:e,actions:n}){return w.jsxs(BM,{sx:{pl:{sm:2},pr:{xs:1,sm:1},...t&&{background:r=>Wc(r.palette.primary.main,r.palette.action.activatedOpacity)}},children:[w.jsx(tE,{}),w.jsx(At,{sx:{flex:"1 1 100%",paddingLeft:1},children:e}),n]})}const V9t={container:{display:"flex",flexDirection:"column",height:"100%"},tableContainer:{overflowY:"auto",flexGrow:1}};function G9t({userVariables:t,setUserVariables:e,selectedIndex:n,setSelectedIndex:r,setEditedVariable:i}){const o=n>=0?t[n]:null,a=n>=0,s=d=>{r(n!==d?d:-1)},l=()=>{i({editMode:"add",variable:BKe()})},c=()=>{const d=t[n];e([...t.slice(0,n+1),zKe(d),...t.slice(n+1)]),r(n+1)},u=()=>{i({editMode:"edit",variable:o})},f=()=>{e([...t.slice(0,n),...t.slice(n+1)]),n>=t.length-1&&r(t.length-2)};return w.jsxs(w.Fragment,{children:[w.jsx(M0e,{selected:n!==null,title:fe.get("Manage user variables"),actions:w.jsxs(w.Fragment,{children:[w.jsx(_t,{title:fe.get("Add user variable"),children:w.jsx(Ot,{color:"primary",onClick:l,children:w.jsx(aw,{})})}),a&&w.jsx(_t,{title:fe.get("Duplicate user variable"),children:w.jsx(Ot,{onClick:c,children:w.jsx(A6,{})})}),a&&w.jsx(_t,{title:fe.get("Edit user variable"),children:w.jsx(Ot,{onClick:u,children:w.jsx(Ap,{})})}),a&&w.jsx(_t,{title:fe.get("Remove user variable"),children:w.jsx(Ot,{onClick:f,children:w.jsx(T6,{})})})]})}),w.jsx(die,{sx:V9t.tableContainer,children:w.jsxs(y5,{size:"small",children:[w.jsx(b$e,{children:w.jsxs(pl,{children:[w.jsx(ar,{sx:{width:"15%"},children:fe.get("Name")}),w.jsx(ar,{sx:{width:"15%"},children:fe.get("Title")}),w.jsx(ar,{sx:{width:"10%"},children:fe.get("Units")}),w.jsx(ar,{children:fe.get("Expression")})]})}),w.jsx(x5,{children:t.map((d,h)=>w.jsxs(pl,{hover:!0,selected:h===n,onClick:()=>s(h),children:[w.jsx(ar,{component:"th",scope:"row",children:d.name}),w.jsx(ar,{children:d.title}),w.jsx(ar,{children:d.units}),w.jsx(ar,{children:d.expression||""})]},d.id))})]})})]})}var D6={},H9t=ct;Object.defineProperty(D6,"__esModule",{value:!0});var k0e=D6.default=void 0,q9t=H9t(pt()),X9t=w;k0e=D6.default=(0,q9t.default)((0,X9t.jsx)("path",{d:"M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z"}),"FilterList");const Q9t=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/;function Y9t(t){return Q9t.test(t)}const LJ={expressionPart:{padding:.2},expressionPartChip:{fontFamily:"monospace"}};function $J({part:t,partType:e,onPartClicked:n}){return w.jsx(Ke,{component:"span",sx:LJ.expressionPart,children:w.jsx(lMe,{label:t,sx:LJ.expressionPartChip,size:"small",variant:"outlined",color:e==="variables"||e==="constants"?"default":e.includes("Functions")?"primary":"secondary",onClick:()=>n(t)})})}function K9t({anchorEl:t,exprPartTypes:e,setExprPartTypes:n,onClose:r}){const i=o=>{n({...e,[o]:!e[o]})};return w.jsx(_p,{open:!!t,anchorEl:t,onClose:r,children:zce.map(o=>w.jsx(v0e,{selected:e[o],title:fe.get(WKe[o]),onClick:()=>i(o),dense:!0},o))})}function Z9t({expression:t,onExpressionChange:e,variableNames:n,expressionCapabilities:r,handleInsertPartRef:i}){const o=ld(),a=M.useRef(null),s=M.useCallback(c=>{var f;const u=(f=a.current)==null?void 0:f.view;if(u){const d=u.state.selection.main,h=u.state.sliceDoc(d.from,d.to).trim();h!==""&&c.includes("X")&&(c=c.replace("X",h));const p=u.state.replaceSelection(c);p&&u.dispatch(p)}},[]);M.useEffect(()=>{i.current=s},[i,s]);const l=M.useCallback(c=>{const u=c.matchBefore(/\w*/);return u===null||u.from==u.to&&!c.explicit?null:{from:u.from,options:[...n.map(f=>({label:f,type:"variable"})),...r.namespace.constants.map(f=>({label:f,type:"variable"})),...r.namespace.arrayFunctions.map(f=>({label:f,type:"function"})),...r.namespace.otherFunctions.map(f=>({label:f,type:"function"}))]}},[n,r.namespace]);return w.jsx(j2,{theme:o.palette.mode||"none",width:"100%",height:"100px",placeholder:fe.get("Use keys CTRL+SPACE to show autocompletions"),extensions:[bpe({override:[l]})],value:t,onChange:e,ref:a})}async function J9t(t,e,n){if(n.trim()==="")return fe.get("Must not be empty");const r=`${t}/expressions/validate/${iy(e)}/${encodeURIComponent(n)}`;try{return await coe(r),null}catch(i){const o=i.message;if(o){const a=o.indexOf("("),s=o.lastIndexOf(")");return o.slice(a>=0?a+1:0,s>=0?s:o.length)}return fe.get("Invalid expression")}}const rC={container:{display:"flex",flexDirection:"column",height:"100%"},content:{flexGrow:1,display:"flex",flexDirection:"column",gap:2,padding:1},propertiesRow:{display:"flex",gap:1},expressionRow:{flexGrow:1},expressionParts:{paddingTop:1,overflowY:"auto"},expressionPart:{padding:.2},expressionPartChip:{fontFamily:"monospace"}};function e7t({userVariables:t,setUserVariables:e,editedVariable:n,setEditedVariable:r,contextDataset:i,expressionCapabilities:o,serverUrl:a}){const[s,l]=M.useState(UKe),[c,u]=M.useState(null),f=[...t,...i.variables],d=i.variables.filter(D=>!N1(D)).map(D=>D.name),{id:h,name:p,title:m,units:g,expression:v}=n.variable,y=f.findIndex(D=>D.id!==h&&D.name===p)>=0,x=!Y9t(p),b=y?fe.get("Already in use"):x?fe.get("Not a valid identifier"):null,_=!b,[S,O]=M.useState(null),E=_&&!S,k=M.useRef(null);M.useEffect(()=>{const D=setTimeout(()=>{J9t(a,i.id,n.variable.expression).then(O)},500);return()=>{clearTimeout(D)}},[a,i.id,n.variable.expression]);const I=(D,A)=>{r({...n,variable:{...n.variable,[D]:A}})},P=()=>{if(n.editMode==="add")e([n.variable,...t]);else{const D=t.findIndex(A=>A.id===n.variable.id);if(D>=0){const A=[...t];A[D]=n.variable,e(A)}}r(null)},R=()=>{r(null)},T=D=>{I("name",D.target.value)},L=D=>{I("title",D.target.value)},z=D=>{I("units",D.target.value)},B=D=>{I("expression",D)},W=D=>{k.current(D)},U=D=>{u(D.currentTarget)},N=()=>{u(null)},$=[w.jsx(Ot,{size:"small",onClick:U,children:w.jsx(_t,{arrow:!0,title:fe.get("Display further elements to be used in expressions"),children:w.jsx(k0e,{})})},"filter")];return zce.forEach(D=>{s[D]&&(D==="variables"?d.forEach(A=>{$.push(w.jsx($J,{part:A,partType:D,onPartClicked:W},`${D}-${A}`))}):o.namespace[D].forEach(A=>{$.push(w.jsx($J,{part:A,partType:D,onPartClicked:W},`${D}-${A}`))}))}),w.jsxs(w.Fragment,{children:[w.jsx(K9t,{anchorEl:c,exprPartTypes:s,setExprPartTypes:l,onClose:N}),w.jsx(M0e,{selected:!0,title:n.editMode==="add"?fe.get("Add user variable"):fe.get("Edit user variable"),actions:w.jsx(sw,{size:"medium",onDone:P,doneDisabled:!E,onCancel:R})}),w.jsxs(Ke,{sx:rC.content,children:[w.jsxs(Ke,{sx:rC.propertiesRow,children:[w.jsx(lr,{sx:{flexGrow:.3},error:!_,helperText:b,size:"small",variant:"standard",label:fe.get("Name"),value:p,onChange:T}),w.jsx(lr,{sx:{flexGrow:.6},size:"small",variant:"standard",label:fe.get("Title"),value:m,onChange:L}),w.jsx(lr,{sx:{flexGrow:.1},size:"small",variant:"standard",label:fe.get("Units"),value:g,onChange:z})]}),w.jsxs(Ke,{sx:rC.expressionRow,children:[w.jsx(At,{sx:D=>({paddingBottom:1,color:D.palette.text.secondary}),children:fe.get("Expression")}),w.jsx(Z9t,{expression:v,onExpressionChange:B,variableNames:d,expressionCapabilities:o,handleInsertPartRef:k}),S&&w.jsx(At,{sx:{paddingBottom:1},color:"error",fontSize:"small",children:S}),w.jsx(Ke,{sx:rC.expressionParts,children:$})]})]})]})}const NJ={dialogContent:{height:420},dialogActions:{display:"flex",justifyContent:"space-between",gap:.2}};function t7t({open:t,closeDialog:e,selectedDataset:n,selectedVariableName:r,selectVariable:i,userVariables:o,updateDatasetUserVariables:a,expressionCapabilities:s,serverUrl:l}){const[c,u]=M.useState(o),[f,d]=M.useState(c.findIndex(v=>v.name===r)),[h,p]=M.useState(null);if(M.useEffect(()=>{u(o)},[o]),!t||!n||!s)return null;function m(){a(n.id,c),e(rE),f>=0&&i(c[f].name)}function g(){u(o),e(rE)}return w.jsxs(el,{open:t,fullWidth:!0,maxWidth:"md",onClose:g,scroll:"body",children:[w.jsx(dd,{children:fe.get("User Variables")}),w.jsx(qs,{dividers:!0,sx:NJ.dialogContent,children:h===null?w.jsx(G9t,{userVariables:c,setUserVariables:u,selectedIndex:f,setSelectedIndex:d,setEditedVariable:p}):w.jsx(e7t,{userVariables:c,setUserVariables:u,editedVariable:h,setEditedVariable:p,contextDataset:n,expressionCapabilities:s,serverUrl:l})}),w.jsxs(yp,{sx:NJ.dialogActions,children:[w.jsx(Ke,{children:w.jsx(ufe,{size:"medium",helpUrl:fe.get("docs/user-variables.en.md")})}),w.jsxs(Ke,{children:[w.jsx(er,{onClick:g,children:fe.get("Cancel")}),w.jsx(er,{onClick:m,disabled:h!==null||!n7t(c),children:fe.get("OK")})]})]})]})}function n7t(t){const e=new Set;return t.forEach(n=>e.add(n.name)),e.size===t.length}const r7t=t=>({open:t.controlState.dialogOpen[rE],selectedDataset:Gr(t),selectedVariableName:py(t),userVariables:jHe(t),expressionCapabilities:oGe(t),serverUrl:hi(t).url}),i7t={closeDialog:by,selectVariable:Ole,updateDatasetUserVariables:W9e},o7t=Jt(r7t,i7t)(t7t),a7t=t=>({compact:Kt.instance.branding.compact}),s7t={},l7t=()=>Kj({typography:{fontSize:12,htmlFontSize:14},palette:{mode:Kt.instance.branding.themeName,primary:Kt.instance.branding.primaryColor,secondary:Kt.instance.branding.secondaryColor}}),c7t=({compact:t})=>w.jsx(GNe,{children:w.jsx(Pne,{injectFirst:!0,children:w.jsxs(LCe,{theme:l7t(),children:[w.jsx(hke,{}),!t&&w.jsx(vKe,{}),w.jsx(OGt,{}),w.jsxs(w.Fragment,{children:[w.jsx($Gt,{}),w.jsx(lHt,{}),w.jsx(mHt,{}),w.jsx(DJ,{dialogId:"userOverlays"},"userOverlays"),w.jsx(DJ,{dialogId:"userBaseMaps"},"userBaseMaps"),w.jsx(o7t,{}),w.jsx(zHt,{}),w.jsx(wHt,{}),w.jsx(MGt,{}),w.jsx(ZGt,{})]})]})})}),u7t=Jt(a7t,s7t)(c7t);function f7t(t,e,n){switch(t===void 0&&(t=rHe()),e.type){case XB:{const r={...t,...e.settings};return ol(r),r}case qle:return ol(t),t;case Hb:{let r=t.selectedDatasetId||cf.get("dataset"),i=t.selectedVariableName||cf.get("variable"),o=t.mapInteraction,a=Fb(e.datasets,r);const s=a&&t$(a,i)||null;return a?s||(i=a.variables.length?a.variables[0].name:null):(r=null,i=null,a=e.datasets.length?e.datasets[0]:null,a&&(r=a.id,a.variables.length>0&&(i=a.variables[0].name))),r||(o="Select"),{...t,selectedDatasetId:r,selectedVariableName:i,mapInteraction:o}}case hle:{let r=t.selectedVariableName;const i=Fb(e.datasets,e.selectedDatasetId);!t$(i,r)&&i.variables.length>0&&(r=i.variables[0].name);const a=e.selectedDatasetId,s=foe(i),l=s?s[1]:null;return{...t,selectedDatasetId:a,selectedVariableName:r,selectedTimeRange:s,selectedTime:l}}case vle:{const{location:r}=e;return t.flyTo!==r?{...t,flyTo:r}:t}case yle:{const r=e.selectedPlaceGroupIds;return{...t,selectedPlaceGroupIds:r,selectedPlaceId:null}}case xle:{const{placeId:r}=e;return{...t,selectedPlaceId:r}}case Sle:return{...t,selectedVariableName:e.selectedVariableName};case ble:return{...t,layerVisibilities:{...t.layerVisibilities,[e.layerId]:e.visible}};case _le:{const{mapPointInfoBoxEnabled:r}=e;return{...t,mapPointInfoBoxEnabled:r}}case wle:{const{variableCompareMode:r}=e;return{...t,variableCompareMode:r,variableSplitPos:void 0}}case VB:{const{variableSplitPos:r}=e;return{...t,variableSplitPos:r}}case Tle:{let{selectedTime:r}=e;if(r!==null&&n){const i=S$(n),o=i?mae(i,r):-1;o>=0&&(r=i[o])}return t.selectedTime!==r?{...t,selectedTime:r}:t}case Ele:{if(n){let r=Ase(n);if(r>=0){const i=S$(n);r+=e.increment,r<0&&(r=i.length-1),r>i.length-1&&(r=0);let o=i[r];const a=t.selectedTimeRange;if(a!==null&&(oa[1]&&(o=a[1])),t.selectedTime!==o)return{...t,selectedTime:o}}}return t}case GB:return{...t,selectedTimeRange:e.selectedTimeRange};case D7e:return{...t,timeSeriesUpdateMode:e.timeSeriesUpdateMode};case Mle:return{...t,timeAnimationActive:e.timeAnimationActive,timeAnimationInterval:e.timeAnimationInterval};case FB:{const{id:r,selected:i}=e;return i?d7t(t,Bs,r):t}case jB:{const{placeGroups:r}=e;return r.length>0?{...t,selectedPlaceGroupIds:[...t.selectedPlaceGroupIds||[],r[0].id]}:t}case BB:{const{placeGroupId:r,newName:i}=e;return r===Bs?{...t,userDrawnPlaceGroupName:i}:t}case zB:{const{placeId:r,places:i}=e;if(r===t.selectedPlaceId){let o=null;const a=i.findIndex(s=>s.id===r);return a>=0&&(a0&&(o=i[a-1].id)),{...t,selectedPlaceId:o}}return t}case Yle:{const r=e.colorBarId;return{...t,userColorBars:[{id:r,type:"continuous",code:goe},...t.userColorBars]}}case Kle:{const r=e.colorBarId,i=t.userColorBars.findIndex(o=>o.id===r);if(i>=0){const o={...t,userColorBars:[...t.userColorBars.slice(0,i),...t.userColorBars.slice(i+1)]};return ol(o),o}return t}case ece:{const r=e.userColorBar,i=t.userColorBars.findIndex(o=>o.id===r.id);return i>=0?{...t,userColorBars:[...t.userColorBars.slice(0,i),{...r},...t.userColorBars.slice(i+1)]}:t}case kle:{let r={...t,mapInteraction:e.mapInteraction,lastMapInteraction:t.mapInteraction};return e.mapInteraction==="Geometry"&&(r={...r,dialogOpen:{...t.dialogOpen,addUserPlacesFromText:!0}}),r}case Rle:{const{layerMenuOpen:r}=e;return t={...t,layerMenuOpen:r},ol(t),t}case Dle:{const{sidebarPosition:r}=e;return t={...t,sidebarPosition:r},t}case Lle:{const{sidebarOpen:r}=e;return t={...t,sidebarOpen:r},ol(t),t}case $le:{const{sidebarPanelId:r}=e;return t={...t,sidebarPanelId:r},ol(t),t}case Nle:return t={...t,volumeRenderMode:e.volumeRenderMode},ol(t),t;case Fle:{const{volumeId:r,volumeState:i}=e;return t={...t,volumeStates:{...t.volumeStates,[r]:i}},t}case jle:{const r={...t.infoCardElementStates};return Object.getOwnPropertyNames(r).forEach(i=>{r[i]={...r[i],visible:e.visibleElements.includes(i)}}),t={...t,infoCardElementStates:r},ol(t),t}case Ble:{const{elementType:r,viewMode:i}=e,o={...t,infoCardElementStates:{...t.infoCardElementStates,[r]:{...t.infoCardElementStates[r],viewMode:i}}};return ol(o),o}case zle:return{...t,activities:{...t.activities,[e.id]:e.message}};case Ule:{const r={...t.activities};return delete r[e.id],{...t,activities:r}}case Wle:{const r=e.locale;return fe.locale=r,r!==t.locale&&(t={...t,locale:r},ol(t)),t}case Gle:{const r=e.dialogId;return{...t,dialogOpen:{...t.dialogOpen,[r]:!0}}}case Hle:{const r=e.dialogId;return{...t,dialogOpen:{...t.dialogOpen,[r]:!1}}}case Cle:{const{selectedDataset2Id:r,selectedVariable2Name:i}=e;return r===t.selectedDataset2Id&&i===t.selectedVariable2Name?{...t,selectedDataset2Id:null,selectedVariable2Name:null,variableCompareMode:!1,variableSplitPos:void 0}:{...t,selectedDataset2Id:r,selectedVariable2Name:i,variableCompareMode:!0}}case UB:if(t.selectedServerId!==e.selectedServerId)return{...t,selectedServerId:e.selectedServerId}}return t}function d7t(t,e,n){let r=t.selectedPlaceGroupIds;return!t.selectedPlaceGroupIds||t.selectedPlaceGroupIds.length===0?r=[e]:t.selectedPlaceGroupIds.find(i=>i===e)||(r=[...t.selectedPlaceGroupIds,e]),{...t,selectedPlaceGroupIds:r,selectedPlaceId:n}}function h7t(){const t=QGe(),e=[{...Kt.instance.server}];return t.forEach(n=>{e.find(r=>r.id===n.id)||e.push(n)}),{serverInfo:null,expressionCapabilities:null,datasets:[],colorBars:null,statistics:{loading:!1,records:[]},timeSeriesGroups:[],userPlaceGroups:[],userServers:e}}function p7t(t,e){switch(t===void 0&&(t=h7t()),e.type){case JT:return{...t,serverInfo:e.serverInfo};case sle:return{...t,expressionCapabilities:e.expressionCapabilities};case Hb:return{...t,datasets:e.datasets};case Xse:{const{datasetId:n,userVariables:r}=e,i=t.datasets.findIndex(l=>l.id===n),o=t.datasets[i],[a,s]=rB(o);return{...t,datasets:[...t.datasets.slice(0,i),{...o,variables:[...a,...r]},...t.datasets.slice(i+1)]}}case cle:{const{datasetId:n,variableName:r,colorBarName:i,colorBarMinMax:o,colorBarNorm:a,opacity:s}=e,l={colorBarName:i,colorBarMin:o[0],colorBarMax:o[1],colorBarNorm:a,opacity:s};return FJ(t,n,r,l)}case fle:{const{datasetId:n,variableName:r,volumeRenderMode:i,volumeIsoThreshold:o}=e;return FJ(t,n,r,{volumeRenderMode:i,volumeIsoThreshold:o})}case NB:{const n=e.placeGroup,r=t.datasets.map(i=>{if(i.placeGroups){const o=i.placeGroups.findIndex(a=>a.id===n.id);if(o>=0){const a=[...i.placeGroups];return a[o]=n,{...i,placeGroups:a}}}return i});return{...t,datasets:r}}case FB:{const{placeGroupTitle:n,id:r,properties:i,geometry:o}=e,a={type:"Feature",id:r,properties:i,geometry:o},s=t.userPlaceGroups,l=s.findIndex(c=>c.id===Bs);if(l>=0){const c=s[l];return{...t,userPlaceGroups:[...s.slice(0,l),{...c,features:[...c.features,a]},...s.slice(l+1)]}}else{const c=n&&n!==""?n:fe.get("My places");return{...t,userPlaceGroups:[{type:"FeatureCollection",id:Bs,title:c,features:[a]},...s]}}}case jB:{const{placeGroups:n}=e;return{...t,userPlaceGroups:[...t.userPlaceGroups,...n]}}case BB:{const{placeGroupId:n,newName:r}=e,i=t.userPlaceGroups,o=i.findIndex(a=>a.id===n);if(o>=0){const a=i[o];return{...t,userPlaceGroups:[...i.slice(0,o),{...a,title:r},...i.slice(o+1)]}}return t}case Yse:{const{placeGroupId:n,placeId:r,newName:i}=e,o=t.userPlaceGroups,a=BJ(o,n,r,{label:i});return a?{...t,userPlaceGroups:a}:t}case Kse:{const{placeGroupId:n,placeId:r,placeStyle:i}=e,o=t.userPlaceGroups,a=BJ(o,n,r,i);return a?{...t,userPlaceGroups:a}:t}case zB:{const{placeGroupId:n,placeId:r}=e,i=t.userPlaceGroups,o=i.findIndex(a=>a.id===n);if(o>=0){const a=i[o],s=a.features.findIndex(l=>l.id===r);if(s>=0){const l=jJ(t.timeSeriesGroups,[r]);let c=t.timeSeriesGroups;return l.forEach(u=>{c=AD(c,u,"remove","append")}),{...t,userPlaceGroups:[...i.slice(0,o),{...a,features:[...a.features.slice(0,s),...a.features.slice(s+1)]},...i.slice(o+1)],timeSeriesGroups:c}}}return t}case Zse:{const{placeGroupId:n}=e,r=t.userPlaceGroups,i=r.findIndex(o=>o.id===n);if(i>=0){const a=r[i].features.map(c=>c.id),s=jJ(t.timeSeriesGroups,a);let l=t.timeSeriesGroups;return s.forEach(c=>{l=AD(l,c,"remove","append")}),{...t,userPlaceGroups:[...r.slice(0,i),...r.slice(i+1)],timeSeriesGroups:l}}return t}case lle:return{...t,colorBars:e.colorBars};case rle:{const{timeSeriesGroupId:n,timeSeries:r}=e,i=t.timeSeriesGroups,o=i.findIndex(l=>l.id===n),a=i[o],s=[...i];return s[o]={...a,timeSeriesArray:[...a.timeSeriesArray,r]},{...t,timeSeriesGroups:s}}case ele:{const n=t.statistics;if(e.statistics===null)return{...t,statistics:{...n,loading:!0}};const r=n.records;return{...t,statistics:{...n,loading:!1,records:[e.statistics,...r]}}}case tle:{const{index:n}=e,r=t.statistics,i=r.records;return{...t,statistics:{...r,records:[...i.slice(0,n),...i.slice(n+1)]}}}case nle:{const{timeSeries:n,updateMode:r,dataMode:i}=e,o=AD(t.timeSeriesGroups,n,r,i);return o!==t.timeSeriesGroups?{...t,timeSeriesGroups:o}:t}case ile:{const n=t.timeSeriesGroups.findIndex(r=>r.id===e.groupId);if(n>=0){const r=[...t.timeSeriesGroups],i={...r[n]},o=[...i.timeSeriesArray];return o.splice(e.index,1),i.timeSeriesArray=o,r[n]=i,{...t,timeSeriesGroups:r}}return t}case ole:{const n=t.timeSeriesGroups.findIndex(r=>r.id===e.id);if(n>=0){const r=[...t.timeSeriesGroups];return r.splice(n,1),{...t,timeSeriesGroups:r}}return t}case ale:return{...t,timeSeriesGroups:[]};case GB:{const{selectedGroupId:n,selectedValueRange:r}=e;if(!n)return t;const i=t.timeSeriesGroups.findIndex(a=>a.id===n),o=r||void 0;return{...t,timeSeriesGroups:[...t.timeSeriesGroups.slice(0,i),{...t.timeSeriesGroups[i],variableRange:o},...t.timeSeriesGroups.slice(i+1)]}}case UB:return t.userServers!==e.servers?(XGe(e.servers),{...t,userServers:e.servers}):t;default:return t}}function FJ(t,e,n,r){const i=t.datasets.findIndex(o=>o.id===e);if(i>=0){const o=t.datasets[i],a=o.variables.findIndex(s=>s.name===n);if(a>=0){const s=o.variables[a],l=t.datasets.slice(),c=o.variables.slice();return c[a]={...s,...r},l[i]={...o,variables:c},{...t,datasets:l}}}return t}function AD(t,e,n,r){let i=e,o;const a=t.findIndex(s=>s.variableUnits===i.source.variableUnits);if(a>=0){const s=t[a],l=s.timeSeriesArray,c=l.findIndex(f=>f.source.datasetId===i.source.datasetId&&f.source.variableName===i.source.variableName&&f.source.placeId===i.source.placeId);let u;if(c>=0){const f=l[c];r==="append"&&(i={...i,data:[...i.data,...f.data]}),n==="replace"?u=[i]:n==="add"?(u=l.slice(),u[c]=i):(u=l.slice(),u.splice(c,1))}else n==="replace"?u=[i]:n==="add"?u=[i,...l]:u=l;n==="replace"?o=[{...s,timeSeriesArray:u}]:n==="add"?(o=t.slice(),o[a]={...s,timeSeriesArray:u}):u.length>=0?(o=t.slice(),o[a]={...s,timeSeriesArray:u}):(o=t.slice(),o.splice(a,1))}else n==="replace"?o=[{id:Ys("ts-"),variableUnits:i.source.variableUnits,timeSeriesArray:[i]}]:n==="add"?o=[{id:Ys("ts-"),variableUnits:i.source.variableUnits,timeSeriesArray:[i]},...t]:o=t;return o}function jJ(t,e){const n=[];return t.forEach(r=>{r.timeSeriesArray.forEach(i=>{e.forEach(o=>{i.source.placeId===o&&n.push(i)})})}),n}function BJ(t,e,n,r){const i=t.findIndex(o=>o.id===e);if(i>=0){const o=t[i],a=o.features,s=a.findIndex(l=>l.id===n);if(s>=0){const l=a[s];return[...t.slice(0,i),{...o,features:[...a.slice(0,s),{...l,properties:{...l.properties,...r}},...a.slice(s+1)]},...t.slice(i+1)]}}}function m7t(){return{newEntries:[],oldEntries:[]}}let g7t=0;function v7t(t,e){t===void 0&&(t=m7t());const n=t.newEntries;switch(e.type){case Vse:{const r=e.messageType,i=e.messageText;let o=n.length?n[0]:null;return o&&r===o.type&&i===o.text?t:(o={id:++g7t,type:r,text:i},{...t,newEntries:[o,...n]})}case Gse:{const r=n.findIndex(i=>i.id===e.messageId);if(r>=0){const i=n[r],o=[...n];o.splice(r,1);const a=[i,...t.oldEntries];return{...t,newEntries:o,oldEntries:a}}}}return t}function y7t(){return{accessToken:null}}function x7t(t,e){switch(t===void 0&&(t=y7t()),e.type){case jce:return{...t,accessToken:e.accessToken}}return t}function b7t(t,e){return{dataState:p7t(t&&t.dataState,e),controlState:f7t(t&&t.controlState,e,t),messageLogState:v7t(t&&t.messageLogState,e),userAuthState:x7t(t&&t.userAuthState,e)}}Kt.load().then(()=>{const t=(o,a)=>a.type!==VB,e=i1e.createLogger({collapsed:!0,diff:!1,predicate:t}),n=r1e(o1e,e),r=tne(b7t,n),i=r.dispatch;i(Vle(r.getState().controlState.locale)),i(W7e()),r.getState().controlState.privacyNoticeAccepted&&i(WB()),Wv.render(w.jsx(Kbe,{store:r,children:w.jsx(u7t,{})}),document.getElementById("root"))}); diff --git a/xcube/webapi/viewer/dist/index.html b/xcube/webapi/viewer/dist/index.html index 89015e096..5c27459be 100644 --- a/xcube/webapi/viewer/dist/index.html +++ b/xcube/webapi/viewer/dist/index.html @@ -38,7 +38,7 @@ xcube Viewer - +