From ab72547db6d630507cb7f6845dde88789f218bc6 Mon Sep 17 00:00:00 2001 From: Norman Fomferra Date: Fri, 11 Oct 2024 11:20:30 +0200 Subject: [PATCH 1/2] Preparing release 1.7.1 --- CHANGES.md | 12 ++++++------ xcube/version.py | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 85bb36c48..34ccf38fe 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,9 @@ -## Changes in 1.7.1 (in development) +## Changes in 1.7.1 + +### Enhancements + +* Level creation now supports aggregation method `mode` to aggregate to the value which + is most frequent. (#913) ### Fixes @@ -14,11 +19,6 @@ [collection STAC specifications](https://github.com/radiantearth/stac-spec/blob/master/collection-spec/collection-spec.md#extent-object). (#1077) -### Enhancements - -* Level creation now supports aggregation method `mode` to aggregate to the value which - is most frequent. (#913) - ## Changes in 1.7.0 ### Enhancements diff --git a/xcube/version.py b/xcube/version.py index 51ad10d93..c3a98db2d 100644 --- a/xcube/version.py +++ b/xcube/version.py @@ -2,4 +2,4 @@ # Permissions are hereby granted under the terms of the MIT License: # https://opensource.org/licenses/MIT. -version = "1.7.1.dev1" +version = "1.7.1" From e59b97f614d9770729d4f4b5293659c9a000c056 Mon Sep 17 00:00:00 2001 From: Norman Fomferra Date: Fri, 11 Oct 2024 16:23:19 +0200 Subject: [PATCH 2/2] Preparing release 1.7.1, added viewer 1.3.1 --- .../{index-Cf0_zMLN.js => index-CHdlbXuI.js} | 530 +++++++++--------- xcube/webapi/viewer/dist/index.html | 2 +- 2 files changed, 266 insertions(+), 266 deletions(-) rename xcube/webapi/viewer/dist/assets/{index-Cf0_zMLN.js => index-CHdlbXuI.js} (71%) diff --git a/xcube/webapi/viewer/dist/assets/index-Cf0_zMLN.js b/xcube/webapi/viewer/dist/assets/index-CHdlbXuI.js similarity index 71% rename from xcube/webapi/viewer/dist/assets/index-Cf0_zMLN.js rename to xcube/webapi/viewer/dist/assets/index-CHdlbXuI.js index a69271021..d39a86957 100644 --- a/xcube/webapi/viewer/dist/assets/index-Cf0_zMLN.js +++ b/xcube/webapi/viewer/dist/assets/index-CHdlbXuI.js @@ -1,58 +1,58 @@ -var C0e=Object.defineProperty;var T0e=(t,e,n)=>e in t?C0e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Yt=(t,e,n)=>T0e(t,typeof e!="symbol"?e+"":e,n);function E0e(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 Zn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $t(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 QJ={exports:{}},s1={};/* +var O0e=Object.defineProperty;var C0e=(t,e,n)=>e in t?O0e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Yt=(t,e,n)=>C0e(t,typeof e!="symbol"?e+"":e,n);function T0e(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 Zn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $t(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 qJ={exports:{}},a1={};/* object-assign (c) Sindre Sorhus @license MIT -*/var Q6=Object.getOwnPropertySymbols,P0e=Object.prototype.hasOwnProperty,M0e=Object.prototype.propertyIsEnumerable;function k0e(t){if(t==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function A0e(){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 YJ=A0e()?Object.assign:function(t,e){for(var n,r=k0e(t),i,o=1;o"u"||typeof MessageChannel!="function"){var l=null,c=null,u=function(){if(l!==null)try{var N=t.unstable_now();l(!0,N),l=null}catch(D){throw setTimeout(u,0),D}};e=function(N){l!==null?setTimeout(e,0,N):(l=N,setTimeout(u,0))},n=function(N,D){c=setTimeout(N,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(N){0>N||125>>1,Y=N[q];if(Y!==void 0&&0C(se,A))J!==void 0&&0>C(J,se)?(N[q]=J,N[te]=A,q=te):(N[q]=se,N[K]=A,q=K);else if(J!==void 0&&0>C(J,A))N[q]=J,N[te]=A,q=te;else break e}}return D}return null}function C(N,D){var A=N.sortIndex-D.sortIndex;return A!==0?A:N.id-D.id}var E=[],k=[],I=1,P=null,R=3,T=!1,L=!1,z=!1;function B(N){for(var D=S(k);D!==null;){if(D.callback===null)O(k);else if(D.startTime<=N)O(k),D.sortIndex=D.expirationTime,_(E,D);else break;D=S(k)}}function U(N){if(z=!1,B(N),!L)if(S(E)!==null)L=!0,e(W);else{var D=S(k);D!==null&&n(U,D.startTime-N)}}function W(N,D){L=!1,z&&(z=!1,r()),T=!0;var A=R;try{for(B(D),P=S(E);P!==null&&(!(P.expirationTime>D)||N&&!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(U,se.startTime-D),K=!1}return K}finally{P=null,R=A,T=!1}}var $=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(N){N.callback=null},t.unstable_continueExecution=function(){L||T||(L=!0,e(W))},t.unstable_getCurrentPriorityLevel=function(){return R},t.unstable_getFirstCallbackNode=function(){return S(E)},t.unstable_next=function(N){switch(R){case 1:case 2:case 3:var D=3;break;default:D=R}var A=R;R=D;try{return N()}finally{R=A}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=$,t.unstable_runWithPriority=function(N,D){switch(N){case 1:case 2:case 3:case 4:case 5:break;default:N=3}var A=R;R=N;try{return D()}finally{R=A}},t.unstable_scheduleCallback=function(N,D,A){var q=t.unstable_now();switch(typeof A=="object"&&A!==null?(A=A.delay,A=typeof A=="number"&&0q?(N.sortIndex=A,_(k,N),S(E)===null&&N===S(k)&&(z?r():z=!0,n(U,A-q))):(N.sortIndex=Y,_(E,N),L||T||(L=!0,e(W))),N},t.unstable_wrapCallback=function(N){var D=R;return function(){var A=R;R=D;try{return N.apply(this,arguments)}finally{R=A}}}})(mee);pee.exports=mee;var z0e=pee.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 N=t.unstable_now();l(!0,N),l=null}catch(D){throw setTimeout(u,0),D}};e=function(N){l!==null?setTimeout(e,0,N):(l=N,setTimeout(u,0))},n=function(N,D){c=setTimeout(N,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(N){0>N||125>>1,Y=N[q];if(Y!==void 0&&0C(se,A))J!==void 0&&0>C(J,se)?(N[q]=J,N[te]=A,q=te):(N[q]=se,N[K]=A,q=K);else if(J!==void 0&&0>C(J,A))N[q]=J,N[te]=A,q=te;else break e}}return D}return null}function C(N,D){var A=N.sortIndex-D.sortIndex;return A!==0?A:N.id-D.id}var E=[],k=[],I=1,P=null,R=3,T=!1,L=!1,z=!1;function B(N){for(var D=S(k);D!==null;){if(D.callback===null)O(k);else if(D.startTime<=N)O(k),D.sortIndex=D.expirationTime,_(E,D);else break;D=S(k)}}function U(N){if(z=!1,B(N),!L)if(S(E)!==null)L=!0,e(W);else{var D=S(k);D!==null&&n(U,D.startTime-N)}}function W(N,D){L=!1,z&&(z=!1,r()),T=!0;var A=R;try{for(B(D),P=S(E);P!==null&&(!(P.expirationTime>D)||N&&!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(U,se.startTime-D),K=!1}return K}finally{P=null,R=A,T=!1}}var $=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(N){N.callback=null},t.unstable_continueExecution=function(){L||T||(L=!0,e(W))},t.unstable_getCurrentPriorityLevel=function(){return R},t.unstable_getFirstCallbackNode=function(){return S(E)},t.unstable_next=function(N){switch(R){case 1:case 2:case 3:var D=3;break;default:D=R}var A=R;R=D;try{return N()}finally{R=A}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=$,t.unstable_runWithPriority=function(N,D){switch(N){case 1:case 2:case 3:case 4:case 5:break;default:N=3}var A=R;R=N;try{return D()}finally{R=A}},t.unstable_scheduleCallback=function(N,D,A){var q=t.unstable_now();switch(typeof A=="object"&&A!==null?(A=A.delay,A=typeof A=="number"&&0q?(N.sortIndex=A,_(k,N),S(E)===null&&N===S(k)&&(z?r():z=!0,n(U,A-q))):(N.sortIndex=Y,_(E,N),L||T||(L=!0,e(W))),N},t.unstable_wrapCallback=function(N){var D=R;return function(){var A=R;R=D;try{return N.apply(this,arguments)}finally{R=A}}}})(hee);dee.exports=hee;var B0e=dee.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 jP=M,hr=YJ,ui=z0e;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"),U0e=/^[: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,eW={},tW={};function W0e(t){return J6.call(tW,t)?!0:J6.call(eW,t)?!1:U0e.test(t)?tW[t]=!0:(eW[t]=!0,!1)}function V0e(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 G0e(t,e,n,r){if(e===null||typeof e>"u"||V0e(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 zF=/[\-:]([a-z])/g;function UF(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(zF,UF);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(zF,UF);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(zF,UF);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 WF(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"),z0e=/^[: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]*$/,Z6=Object.prototype.hasOwnProperty,J6={},eW={};function U0e(t){return Z6.call(eW,t)?!0:Z6.call(J6,t)?!1:z0e.test(t)?eW[t]=!0:(J6[t]=!0,!1)}function W0e(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 V0e(t,e,n,r){if(e===null||typeof e>"u"||W0e(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 BF=/[\-:]([a-z])/g;function zF(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(BF,zF);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(BF,zF);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(BF,zF);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 UF(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{Yk=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?rx(t):""}function H0e(t){switch(t.tag){case 5:return rx(t.type);case 16:return rx("Lazy");case 13:return rx("Suspense");case 19:return rx("SuspenseList");case 0:case 2:case 15:return t=Uw(t.type,!1),t;case 11:return t=Uw(t.type.render,!1),t;case 22:return t=Uw(t.type._render,!1),t;case 1:return t=Uw(t.type,!0),t;default:return""}}function dg(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 df:return"Fragment";case hh:return"Portal";case Ox:return"Profiler";case VF:return"StrictMode";case Cx:return"Suspense";case ZC:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case HF:return(t.displayName||"Context")+".Consumer";case GF:return(t._context.displayName||"Context")+".Provider";case BP:var e=t.render;return e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case zP:return dg(t.type);case XF:return dg(t._render);case qF:e=t._payload,t=t._init;try{return dg(t(e))}catch{}}return null}function qf(t){switch(typeof t){case"boolean":case"number":case"object":case"string":case"undefined":return t;default:return""}}function yee(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function q0e(t){var e=yee(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 Ww(t){t._valueTracker||(t._valueTracker=q0e(t))}function xee(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=yee(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function JC(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 WD(t,e){var n=e.checked;return hr({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function rW(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=qf(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 bee(t,e){e=e.checked,e!=null&&WF(t,"checked",e,!1)}function VD(t,e){bee(t,e);var n=qf(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")?GD(t,e.type,n):e.hasOwnProperty("defaultValue")&&GD(t,e.type,qf(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function iW(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 GD(t,e,n){(e!=="number"||JC(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}function X0e(t){var e="";return jP.Children.forEach(t,function(n){n!=null&&(e+=n)}),e}function HD(t,e){return t=hr({children:void 0},e),(e=X0e(e.children))&&(t.children=e),t}function hg(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:qf(n)}}function _ee(t,e){var n=qf(e.value),r=qf(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 aW(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}var XD={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function wee(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 QD(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?wee(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var Vw,See=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!==XD.svg||"innerHTML"in t)t.innerHTML=e;else{for(Vw=Vw||document.createElement("div"),Vw.innerHTML=""+e.valueOf().toString()+"",e=Vw.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function pb(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var Tx={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},Q0e=["Webkit","ms","Moz","O"];Object.keys(Tx).forEach(function(t){Q0e.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Tx[e]=Tx[t]})});function Oee(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||Tx.hasOwnProperty(t)&&Tx[t]?(""+e).trim():e+"px"}function Cee(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Oee(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var Y0e=hr({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 YD(t,e){if(e){if(Y0e[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 KD(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 KF(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var ZD=null,pg=null,mg=null;function sW(t){if(t=u1(t)){if(typeof ZD!="function")throw Error(Xe(280));var e=t.stateNode;e&&(e=qP(e),ZD(t.stateNode,t.type,e))}}function Tee(t){pg?mg?mg.push(t):mg=[t]:pg=t}function Eee(){if(pg){var t=pg,e=mg;if(mg=pg=null,sW(t),e)for(t=0;tr?0:1<n;n++)e.push(t);return e}function WP(t,e,n){t.pendingLanes|=e;var r=e-1;t.suspendedLanes&=r,t.pingedLanes&=r,t=t.eventTimes,e=31-Xf(e),t[e]=n}var Xf=Math.clz32?Math.clz32:dxe,uxe=Math.log,fxe=Math.LN2;function dxe(t){return t===0?32:31-(uxe(t)/fxe|0)|0}var hxe=ui.unstable_UserBlockingPriority,pxe=ui.unstable_runWithPriority,hC=!0;function mxe(t,e,n,r){ph||JF();var i=ij,o=ph;ph=!0;try{Pee(i,t,e,n,r)}finally{(ph=o)||ej()}}function gxe(t,e,n,r){pxe(hxe,ij.bind(null,t,e,n,r))}function ij(t,e,n,r){if(hC){var i;if((i=(e&4)===0)&&0=Px),vW=" ",yW=!1;function Gee(t,e){switch(t){case"keyup":return jxe.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hee(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var qm=!1;function zxe(t,e){switch(t){case"compositionend":return Hee(e);case"keypress":return e.which!==32?null:(yW=!0,vW);case"textInput":return t=e.data,t===vW&&yW?null:t;default:return null}}function Uxe(t,e){if(qm)return t==="compositionend"||!cj&&Gee(t,e)?(t=Wee(),pC=aj=vf=null,qm=!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=wW(n)}}function Yee(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Yee(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function OW(){for(var t=window,e=JC();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=JC(t.document)}return e}function rL(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 Zxe=cu&&"documentMode"in document&&11>=document.documentMode,Xm=null,iL=null,kx=null,oL=!1;function CW(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;oL||Xm==null||Xm!==JC(r)||(r=Xm,"selectionStart"in r&&rL(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}),kx&&bb(kx,r)||(kx=r,r=rT(iL,"onSelect"),0Ym||(t.current=sL[Ym],sL[Ym]=null,Ym--)}function br(t,e){Ym++,sL[Ym]=t.current,t.current=e}var Qf={},Ji=fd(Qf),Do=fd(!1),Xh=Qf;function Vg(t,e){var n=t.type.contextTypes;if(!n)return Qf;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 Lo(t){return t=t.childContextTypes,t!=null}function aT(){er(Do),er(Ji)}function DW(t,e,n){if(Ji.current!==Qf)throw Error(Xe(168));br(Ji,e),br(Do,n)}function rte(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,dg(e)||"Unknown",i));return hr({},n,r)}function gC(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Qf,Xh=Ji.current,br(Ji,t),br(Do,Do.current),!0}function LW(t,e,n){var r=t.stateNode;if(!r)throw Error(Xe(169));n?(t=rte(t,e,Xh),r.__reactInternalMemoizedMergedChildContext=t,er(Do),er(Ji),br(Ji,t)):er(Do),br(Do,n)}var fj=null,Ih=null,nbe=ui.unstable_runWithPriority,dj=ui.unstable_scheduleCallback,lL=ui.unstable_cancelCallback,rbe=ui.unstable_shouldYield,NW=ui.unstable_requestPaint,cL=ui.unstable_now,ibe=ui.unstable_getCurrentPriorityLevel,XP=ui.unstable_ImmediatePriority,ite=ui.unstable_UserBlockingPriority,ote=ui.unstable_NormalPriority,ate=ui.unstable_LowPriority,ste=ui.unstable_IdlePriority,cA={},obe=NW!==void 0?NW:function(){},Dc=null,vC=null,uA=!1,$W=cL(),Ki=1e4>$W?cL:function(){return cL()-$W};function Gg(){switch(ibe()){case XP:return 99;case ite:return 98;case ote:return 97;case ate:return 96;case ste:return 95;default:throw Error(Xe(332))}}function lte(t){switch(t){case 99:return XP;case 98:return ite;case 97:return ote;case 96:return ate;case 95:return ste;default:throw Error(Xe(332))}}function Qh(t,e){return t=lte(t),nbe(t,e)}function wb(t,e,n){return t=lte(t),dj(t,e,n)}function ic(){if(vC!==null){var t=vC;vC=null,lL(t)}cte()}function cte(){if(!uA&&Dc!==null){uA=!0;var t=0;try{var e=Dc;Qh(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===df&&y.key===null;b&&(y=y.props.children);var _=typeof y=="object"&&y!==null;if(_)switch(y.$$typeof){case nx:e:{for(_=y.key,b=v;b!==null;){if(b.key===_){switch(b.tag){case 7:if(y.type===df){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=o0(g,b,y),v.return=g,g=v;break e}}n(g,b);break}else e(g,b);b=b.sibling}y.type===df?(v=_g(y.props.children,g.mode,x,y.key),v.return=g,g=v):(x=_C(y.type,y.key,y.props,null,g.mode,x),x.ref=o0(g,v,y),x.return=g,g=x)}return a(g);case hh: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=gA(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=mA(y,g.mode,x),v.return=g,g=v),a(g);if(qw(y))return p(g,v,y,x);if(Jy(y))return m(g,v,y,x);if(_&&Xw(g,y),typeof y>"u"&&!b)switch(g.tag){case 1:case 22:case 0:case 11:case 15:throw Error(Xe(152,dg(g.type)||"Component"))}return n(g,v)}}var fT=pte(!0),mte=pte(!1),f1={},zl=fd(f1),Ob=fd(f1),Cb=fd(f1);function gh(t){if(t===f1)throw Error(Xe(174));return t}function fL(t,e){switch(br(Cb,e),br(Ob,t),br(zl,f1),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:QD(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=QD(e,t)}er(zl),br(zl,e)}function Hg(){er(zl),er(Ob),er(Cb)}function UW(t){gh(Cb.current);var e=gh(zl.current),n=QD(e,t.type);e!==n&&(br(Ob,t),br(zl,n))}function gj(t){Ob.current===t&&(er(zl),er(Ob))}var xr=fd(0);function dT(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 Vc=null,xf=null,Ul=!1;function gte(t,e){var n=Va(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 WW(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 dL(t){if(Ul){var e=xf;if(e){var n=e;if(!WW(t,e)){if(e=gg(n.nextSibling),!e||!WW(t,e)){t.flags=t.flags&-1025|2,Ul=!1,Vc=t;return}gte(Vc,n)}Vc=t,xf=gg(e.firstChild)}else t.flags=t.flags&-1025|2,Ul=!1,Vc=t}}function VW(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;Vc=t}function Qw(t){if(t!==Vc)return!1;if(!Ul)return VW(t),Ul=!0,!1;var e=t.type;if(t.tag!==5||e!=="head"&&e!=="body"&&!aL(e,t.memoizedProps))for(e=xf;e;)gte(t,e),e=gg(e.nextSibling);if(VW(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){xf=gg(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}xf=null}}else xf=Vc?gg(t.stateNode.nextSibling):null;return!0}function fA(){xf=Vc=null,Ul=!1}var yg=[];function vj(){for(var t=0;to))throw Error(Xe(301));o+=1,wi=Gi=null,e.updateQueue=null,Ax.current=ube,t=n(r,i)}while(Rx)}if(Ax.current=vT,e=Gi!==null&&Gi.next!==null,Tb=0,wi=Gi=Mr=null,hT=!1,e)throw Error(Xe(300));return t}function vh(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wi===null?Mr.memoizedState=wi=t:wi=wi.next=t,wi}function Cp(){if(Gi===null){var t=Mr.alternate;t=t!==null?t.memoizedState:null}else t=Gi.next;var e=wi===null?Mr.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?Mr.memoizedState=wi=t:wi=wi.next=t}return wi}function Ml(t,e){return typeof e=="function"?e(t):e}function a0(t){var e=Cp(),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((Tb&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,Mr.lanes|=c,d1|=c}l=l.next}while(l!==null&&l!==i);s===null?o=r:s.next=a,Wa(r,e.memoizedState)||(Gs=!0),e.memoizedState=r,e.baseState=o,e.baseQueue=s,n.lastRenderedState=r}return[e.memoizedState,n.dispatch]}function s0(t){var e=Cp(),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);Wa(o,e.memoizedState)||(Gs=!0),e.memoizedState=o,e.baseQueue===null&&(e.baseState=o),n.lastRenderedState=o}return[o,r]}function GW(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=(Tb&t)===t)&&(e._workInProgressVersionPrimary=r,yg.push(e))),t)return n(e._source);throw yg.push(e),Error(Xe(350))}function vte(t,e,n,r){var i=co;if(i===null)throw Error(Xe(349));var o=e._getVersion,a=o(e._source),s=Ax.current,l=s.useState(function(){return GW(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=Mr;return t.memoizedState={refs:d,source:e,subscribe:r},s.useEffect(function(){d.getSnapshot=n,d.setSnapshot=c;var g=o(e._source);if(!Wa(a,g)){g=n(e._source),Wa(u,g)||(c(g),g=Nf(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)}),Qh(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[yf]=e,t[oT]=r,Tte(t,e,!1,!1),e.stateNode=t,a=KD(n,r),n){case"dialog":qn("cancel",t),qn("close",t),i=r;break;case"iframe":case"object":case"embed":qn("load",t),i=r;break;case"video":case"audio":for(i=0;iwL&&(e.flags|=64,o=!0,c0(r,!1),e.lanes=33554432)}else{if(!o)if(t=dT(a),t!==null){if(e.flags|=64,o=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),c0(r,!0),r.tail===null&&r.tailMode==="hidden"&&!a.alternate&&!Ul)return e=e.lastEffect=r.lastEffect,e!==null&&(e.nextEffect=null),null}else 2*Ki()-r.renderingStartTime>wL&&n!==1073741824&&(e.flags|=64,o=!0,c0(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=xr.current,br(xr,o?e&1|2:e&1),n):null;case 23:case 24:return Ej(),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 hbe(t){switch(t.tag){case 1:Lo(t.type)&&aT();var e=t.flags;return e&4096?(t.flags=e&-4097|64,t):null;case 3:if(Hg(),er(Do),er(Ji),vj(),e=t.flags,e&64)throw Error(Xe(285));return t.flags=e&-4097|64,t;case 5:return gj(t),null;case 13:return er(xr),e=t.flags,e&4096?(t.flags=e&-4097|64,t):null;case 19:return er(xr),null;case 4:return Hg(),null;case 10:return pj(t),null;case 23:case 24:return Ej(),null;default:return null}}function Sj(t,e){try{var n="",r=e;do n+=H0e(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{Yk=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?nx(t):""}function G0e(t){switch(t.tag){case 5:return nx(t.type);case 16:return nx("Lazy");case 13:return nx("Suspense");case 19:return nx("SuspenseList");case 0:case 2:case 15:return t=Uw(t.type,!1),t;case 11:return t=Uw(t.type.render,!1),t;case 22:return t=Uw(t.type._render,!1),t;case 1:return t=Uw(t.type,!0),t;default:return""}}function dg(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 df:return"Fragment";case hh:return"Portal";case Sx:return"Profiler";case WF:return"StrictMode";case Ox:return"Suspense";case ZC:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case GF:return(t.displayName||"Context")+".Consumer";case VF:return(t._context.displayName||"Context")+".Provider";case BP:var e=t.render;return e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case zP:return dg(t.type);case qF:return dg(t._render);case HF:e=t._payload,t=t._init;try{return dg(t(e))}catch{}}return null}function qf(t){switch(typeof t){case"boolean":case"number":case"object":case"string":case"undefined":return t;default:return""}}function gee(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function H0e(t){var e=gee(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 Ww(t){t._valueTracker||(t._valueTracker=H0e(t))}function vee(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=gee(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function JC(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 UD(t,e){var n=e.checked;return hr({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function nW(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=qf(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 yee(t,e){e=e.checked,e!=null&&UF(t,"checked",e,!1)}function WD(t,e){yee(t,e);var n=qf(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")?VD(t,e.type,n):e.hasOwnProperty("defaultValue")&&VD(t,e.type,qf(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function rW(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 VD(t,e,n){(e!=="number"||JC(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}function q0e(t){var e="";return jP.Children.forEach(t,function(n){n!=null&&(e+=n)}),e}function GD(t,e){return t=hr({children:void 0},e),(e=q0e(e.children))&&(t.children=e),t}function hg(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:qf(n)}}function xee(t,e){var n=qf(e.value),r=qf(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 oW(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}var qD={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function bee(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 XD(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?bee(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var Vw,_ee=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!==qD.svg||"innerHTML"in t)t.innerHTML=e;else{for(Vw=Vw||document.createElement("div"),Vw.innerHTML=""+e.valueOf().toString()+"",e=Vw.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function hb(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var Cx={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},X0e=["Webkit","ms","Moz","O"];Object.keys(Cx).forEach(function(t){X0e.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Cx[e]=Cx[t]})});function wee(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||Cx.hasOwnProperty(t)&&Cx[t]?(""+e).trim():e+"px"}function See(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=wee(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var Q0e=hr({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 QD(t,e){if(e){if(Q0e[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 YD(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 YF(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var KD=null,pg=null,mg=null;function aW(t){if(t=c1(t)){if(typeof KD!="function")throw Error(Xe(280));var e=t.stateNode;e&&(e=qP(e),KD(t.stateNode,t.type,e))}}function Oee(t){pg?mg?mg.push(t):mg=[t]:pg=t}function Cee(){if(pg){var t=pg,e=mg;if(mg=pg=null,aW(t),e)for(t=0;tr?0:1<n;n++)e.push(t);return e}function WP(t,e,n){t.pendingLanes|=e;var r=e-1;t.suspendedLanes&=r,t.pingedLanes&=r,t=t.eventTimes,e=31-Xf(e),t[e]=n}var Xf=Math.clz32?Math.clz32:fxe,cxe=Math.log,uxe=Math.LN2;function fxe(t){return t===0?32:31-(cxe(t)/uxe|0)|0}var dxe=ui.unstable_UserBlockingPriority,hxe=ui.unstable_runWithPriority,hC=!0;function pxe(t,e,n,r){ph||ZF();var i=rj,o=ph;ph=!0;try{Tee(i,t,e,n,r)}finally{(ph=o)||JF()}}function mxe(t,e,n,r){hxe(dxe,rj.bind(null,t,e,n,r))}function rj(t,e,n,r){if(hC){var i;if((i=(e&4)===0)&&0=Ex),gW=" ",vW=!1;function Wee(t,e){switch(t){case"keyup":return Fxe.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vee(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var qm=!1;function Bxe(t,e){switch(t){case"compositionend":return Vee(e);case"keypress":return e.which!==32?null:(vW=!0,gW);case"textInput":return t=e.data,t===gW&&vW?null:t;default:return null}}function zxe(t,e){if(qm)return t==="compositionend"||!lj&&Wee(t,e)?(t=zee(),pC=oj=vf=null,qm=!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=_W(n)}}function Xee(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Xee(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function SW(){for(var t=window,e=JC();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=JC(t.document)}return e}function nL(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 Kxe=cu&&"documentMode"in document&&11>=document.documentMode,Xm=null,rL=null,Mx=null,iL=!1;function OW(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;iL||Xm==null||Xm!==JC(r)||(r=Xm,"selectionStart"in r&&nL(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}),Mx&&xb(Mx,r)||(Mx=r,r=rT(rL,"onSelect"),0Ym||(t.current=aL[Ym],aL[Ym]=null,Ym--)}function br(t,e){Ym++,aL[Ym]=t.current,t.current=e}var Qf={},Ji=fd(Qf),Do=fd(!1),Xh=Qf;function Vg(t,e){var n=t.type.contextTypes;if(!n)return Qf;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 Lo(t){return t=t.childContextTypes,t!=null}function aT(){er(Do),er(Ji)}function IW(t,e,n){if(Ji.current!==Qf)throw Error(Xe(168));br(Ji,e),br(Do,n)}function tte(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,dg(e)||"Unknown",i));return hr({},n,r)}function gC(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Qf,Xh=Ji.current,br(Ji,t),br(Do,Do.current),!0}function DW(t,e,n){var r=t.stateNode;if(!r)throw Error(Xe(169));n?(t=tte(t,e,Xh),r.__reactInternalMemoizedMergedChildContext=t,er(Do),er(Ji),br(Ji,t)):er(Do),br(Do,n)}var uj=null,Ih=null,tbe=ui.unstable_runWithPriority,fj=ui.unstable_scheduleCallback,sL=ui.unstable_cancelCallback,nbe=ui.unstable_shouldYield,LW=ui.unstable_requestPaint,lL=ui.unstable_now,rbe=ui.unstable_getCurrentPriorityLevel,XP=ui.unstable_ImmediatePriority,nte=ui.unstable_UserBlockingPriority,rte=ui.unstable_NormalPriority,ite=ui.unstable_LowPriority,ote=ui.unstable_IdlePriority,cA={},ibe=LW!==void 0?LW:function(){},Dc=null,vC=null,uA=!1,NW=lL(),Ki=1e4>NW?lL:function(){return lL()-NW};function Gg(){switch(rbe()){case XP:return 99;case nte:return 98;case rte:return 97;case ite:return 96;case ote:return 95;default:throw Error(Xe(332))}}function ate(t){switch(t){case 99:return XP;case 98:return nte;case 97:return rte;case 96:return ite;case 95:return ote;default:throw Error(Xe(332))}}function Qh(t,e){return t=ate(t),tbe(t,e)}function _b(t,e,n){return t=ate(t),fj(t,e,n)}function ic(){if(vC!==null){var t=vC;vC=null,sL(t)}ste()}function ste(){if(!uA&&Dc!==null){uA=!0;var t=0;try{var e=Dc;Qh(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===df&&y.key===null;b&&(y=y.props.children);var _=typeof y=="object"&&y!==null;if(_)switch(y.$$typeof){case tx:e:{for(_=y.key,b=v;b!==null;){if(b.key===_){switch(b.tag){case 7:if(y.type===df){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=i0(g,b,y),v.return=g,g=v;break e}}n(g,b);break}else e(g,b);b=b.sibling}y.type===df?(v=_g(y.props.children,g.mode,x,y.key),v.return=g,g=v):(x=_C(y.type,y.key,y.props,null,g.mode,x),x.ref=i0(g,v,y),x.return=g,g=x)}return a(g);case hh: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=gA(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=mA(y,g.mode,x),v.return=g,g=v),a(g);if(qw(y))return p(g,v,y,x);if(Zy(y))return m(g,v,y,x);if(_&&Xw(g,y),typeof y>"u"&&!b)switch(g.tag){case 1:case 22:case 0:case 11:case 15:throw Error(Xe(152,dg(g.type)||"Component"))}return n(g,v)}}var fT=dte(!0),hte=dte(!1),u1={},zl=fd(u1),Sb=fd(u1),Ob=fd(u1);function gh(t){if(t===u1)throw Error(Xe(174));return t}function uL(t,e){switch(br(Ob,e),br(Sb,t),br(zl,u1),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:XD(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=XD(e,t)}er(zl),br(zl,e)}function Hg(){er(zl),er(Sb),er(Ob)}function zW(t){gh(Ob.current);var e=gh(zl.current),n=XD(e,t.type);e!==n&&(br(Sb,t),br(zl,n))}function mj(t){Sb.current===t&&(er(zl),er(Sb))}var xr=fd(0);function dT(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 Vc=null,xf=null,Ul=!1;function pte(t,e){var n=Va(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 UW(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 fL(t){if(Ul){var e=xf;if(e){var n=e;if(!UW(t,e)){if(e=gg(n.nextSibling),!e||!UW(t,e)){t.flags=t.flags&-1025|2,Ul=!1,Vc=t;return}pte(Vc,n)}Vc=t,xf=gg(e.firstChild)}else t.flags=t.flags&-1025|2,Ul=!1,Vc=t}}function WW(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;Vc=t}function Qw(t){if(t!==Vc)return!1;if(!Ul)return WW(t),Ul=!0,!1;var e=t.type;if(t.tag!==5||e!=="head"&&e!=="body"&&!oL(e,t.memoizedProps))for(e=xf;e;)pte(t,e),e=gg(e.nextSibling);if(WW(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){xf=gg(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}xf=null}}else xf=Vc?gg(t.stateNode.nextSibling):null;return!0}function fA(){xf=Vc=null,Ul=!1}var yg=[];function gj(){for(var t=0;to))throw Error(Xe(301));o+=1,wi=Gi=null,e.updateQueue=null,kx.current=cbe,t=n(r,i)}while(Ax)}if(kx.current=vT,e=Gi!==null&&Gi.next!==null,Cb=0,wi=Gi=Mr=null,hT=!1,e)throw Error(Xe(300));return t}function vh(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wi===null?Mr.memoizedState=wi=t:wi=wi.next=t,wi}function Cp(){if(Gi===null){var t=Mr.alternate;t=t!==null?t.memoizedState:null}else t=Gi.next;var e=wi===null?Mr.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?Mr.memoizedState=wi=t:wi=wi.next=t}return wi}function Ml(t,e){return typeof e=="function"?e(t):e}function o0(t){var e=Cp(),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((Cb&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,Mr.lanes|=c,f1|=c}l=l.next}while(l!==null&&l!==i);s===null?o=r:s.next=a,Wa(r,e.memoizedState)||(Gs=!0),e.memoizedState=r,e.baseState=o,e.baseQueue=s,n.lastRenderedState=r}return[e.memoizedState,n.dispatch]}function a0(t){var e=Cp(),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);Wa(o,e.memoizedState)||(Gs=!0),e.memoizedState=o,e.baseQueue===null&&(e.baseState=o),n.lastRenderedState=o}return[o,r]}function VW(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=(Cb&t)===t)&&(e._workInProgressVersionPrimary=r,yg.push(e))),t)return n(e._source);throw yg.push(e),Error(Xe(350))}function mte(t,e,n,r){var i=co;if(i===null)throw Error(Xe(349));var o=e._getVersion,a=o(e._source),s=kx.current,l=s.useState(function(){return VW(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=Mr;return t.memoizedState={refs:d,source:e,subscribe:r},s.useEffect(function(){d.getSnapshot=n,d.setSnapshot=c;var g=o(e._source);if(!Wa(a,g)){g=n(e._source),Wa(u,g)||(c(g),g=Nf(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)}),Qh(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[yf]=e,t[oT]=r,Ote(t,e,!1,!1),e.stateNode=t,a=YD(n,r),n){case"dialog":qn("cancel",t),qn("close",t),i=r;break;case"iframe":case"object":case"embed":qn("load",t),i=r;break;case"video":case"audio":for(i=0;i_L&&(e.flags|=64,o=!0,l0(r,!1),e.lanes=33554432)}else{if(!o)if(t=dT(a),t!==null){if(e.flags|=64,o=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),l0(r,!0),r.tail===null&&r.tailMode==="hidden"&&!a.alternate&&!Ul)return e=e.lastEffect=r.lastEffect,e!==null&&(e.nextEffect=null),null}else 2*Ki()-r.renderingStartTime>_L&&n!==1073741824&&(e.flags|=64,o=!0,l0(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=xr.current,br(xr,o?e&1|2:e&1),n):null;case 23:case 24:return Tj(),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 dbe(t){switch(t.tag){case 1:Lo(t.type)&&aT();var e=t.flags;return e&4096?(t.flags=e&-4097|64,t):null;case 3:if(Hg(),er(Do),er(Ji),gj(),e=t.flags,e&64)throw Error(Xe(285));return t.flags=e&-4097|64,t;case 5:return mj(t),null;case 13:return er(xr),e=t.flags,e&4096?(t.flags=e&-4097|64,t):null;case 19:return er(xr),null;case 4:return Hg(),null;case 10:return hj(t),null;case 23:case 24:return Tj(),null;default:return null}}function wj(t,e){try{var n="",r=e;do n+=G0e(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 vL(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var pbe=typeof WeakMap=="function"?WeakMap:Map;function Mte(t,e,n){n=Df(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){xT||(xT=!0,SL=r),vL(t,e)},n}function kte(t,e,n){n=Df(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var i=e.value;n.payload=function(){return vL(t,e),r(i)}}var o=t.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){typeof r!="function"&&(kl===null?kl=new Set([this]):kl.add(this),vL(t,e));var a=e.stack;this.componentDidCatch(e.value,{componentStack:a!==null?a:""})}),n}var mbe=typeof WeakSet=="function"?WeakSet:Set;function iV(t){var e=t.ref;if(e!==null)if(typeof e=="function")try{e(null)}catch(n){Ff(t,n)}else e.current=null}function gbe(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:Fs(e.type,n),r),t.__reactInternalSnapshotBeforeUpdate=e}return;case 3:e.flags&256&&uj(e.stateNode.containerInfo);return;case 5:case 6:case 4:case 17:return}throw Error(Xe(163))}function vbe(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&&(jte(n,t),Cbe(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:Fs(n.type,e.memoizedProps),t.componentDidUpdate(r,e.memoizedState,t.__reactInternalSnapshotBeforeUpdate))),e=n.updateQueue,e!==null&&jW(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}jW(n,e,t)}return;case 5:t=n.stateNode,e===null&&n.flags&4&&tte(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&&Lee(n))));return;case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(Xe(163))}function oV(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=Oee("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 aV(t,e){if(Ih&&typeof Ih.onCommitFiberUnmount=="function")try{Ih.onCommitFiberUnmount(fj,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)jte(e,n);else{r=e;try{i()}catch(o){Ff(r,o)}}n=n.next}while(n!==t)}break;case 1:if(iV(e),t=e.stateNode,typeof t.componentWillUnmount=="function")try{t.props=e.memoizedProps,t.state=e.memoizedState,t.componentWillUnmount()}catch(o){Ff(e,o)}break;case 5:iV(e);break;case 4:Ate(t,e)}}function sV(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 lV(t){return t.tag===5||t.tag===3||t.tag===4}function cV(t){e:{for(var e=t.return;e!==null;){if(lV(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&&(pb(e,""),n.flags&=-17);e:t:for(n=t;;){for(;n.sibling===null;){if(n.return===null||lV(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?yL(t,n,e):xL(t,n,e)}function yL(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=iT));else if(r!==4&&(t=t.child,t!==null))for(yL(t,e,n),t=t.sibling;t!==null;)yL(t,e,n),t=t.sibling}function xL(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(xL(t,e,n),t=t.sibling;t!==null;)xL(t,e,n),t=t.sibling}function Ate(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(aV(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(aV(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 pA(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[oT]=r,t==="input"&&r.type==="radio"&&r.name!=null&&bee(n,r),KD(t,i),e=KD(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*xbe(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*ybe(n/1960))-n,10 component higher in the tree to provide a loading indicator or placeholder to display.`)}Oi!==5&&(Oi=2),l=Sj(l,s),d=a;do{switch(d.tag){case 3:o=l,d.flags|=4096,e&=-e,d.lanes|=e;var _=Mte(d,o,e);FW(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"&&(kl===null||!kl.has(O)))){d.flags|=4096,e&=-e,d.lanes|=e;var C=kte(d,o,e);FW(d,C);break e}}d=d.return}while(d!==null)}Fte(n)}catch(E){e=E,ei===n&&n!==null&&(ei=n=n.return);continue}break}while(!0)}function Nte(){var t=yT.current;return yT.current=vT,t===null?vT:t}function ax(t,e){var n=Et;Et|=16;var r=Nte();co===t&&Zi===e||bg(t,e);do try{_be();break}catch(i){Lte(t,i)}while(!0);if(hj(),Et=n,yT.current=r,ei!==null)throw Error(Xe(261));return co=null,Zi=0,Oi}function _be(){for(;ei!==null;)$te(ei)}function wbe(){for(;ei!==null&&!rbe();)$te(ei)}function $te(t){var e=Bte(t.alternate,t,Yh);t.memoizedProps=t.pendingProps,e===null?Fte(t):ei=e,Oj.current=null}function Fte(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&2048){if(n=hbe(e),n!==null){n.flags&=2047,ei=n;return}t!==null&&(t.firstEffect=t.lastEffect=null,t.flags|=2048)}else{if(n=dbe(n,e,Yh),n!==null){ei=n;return}if(n=e,n.tag!==24&&n.tag!==23||n.memoizedState===null||Yh&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=SW(y,_),o=SW(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()-Tj?bg(t,0):Cj|=n),ls(t,e)}function Pbe(t,e){var n=t.stateNode;n!==null&&n.delete(e),e=0,e===0&&(e=t.mode,e&2?e&4?(jc===0&&(jc=Vv),e=Dm(62914560&~jc),e===0&&(e=4194304)):e=Gg()===99?1:2:e=1),n=ya(),t=KP(t,e),t!==null&&(WP(t,e,n),ls(t,n))}var Bte;Bte=function(t,e,n){var r=e.lanes;if(t!==null)if(t.memoizedProps!==e.pendingProps||Do.current)Gs=!0;else if(n&r)Gs=!!(t.flags&16384);else{switch(Gs=!1,e.tag){case 3:KW(e),fA();break;case 5:UW(e);break;case 1:Lo(e.type)&&gC(e);break;case 4:fL(e,e.stateNode.containerInfo);break;case 10:r=e.memoizedProps.value;var i=e.type._context;br(sT,i._currentValue),i._currentValue=r;break;case 13:if(e.memoizedState!==null)return n&e.child.childLanes?ZW(t,e,n):(br(xr,xr.current&1),e=Gc(t,e,n),e!==null?e.sibling:null);br(xr,xr.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&64){if(r)return rV(t,e,n);e.flags|=64}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),br(xr,xr.current),r)break;return null;case 23:case 24:return e.lanes=0,dA(t,e,n)}return Gc(t,e,n)}else Gs=!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=Vg(e,Ji.current),vg(e,n),i=xj(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,Lo(r)){var o=!0;gC(e)}else o=!1;e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,mj(e);var a=r.getDerivedStateFromProps;typeof a=="function"&&uT(e,r,a,t),i.updater=QP,e.stateNode=i,i._reactInternals=e,uL(e,r,t,n),e=mL(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=kbe(i),t=Fs(i,t),o){case 0:e=pL(null,e,i,t,n);break e;case 1:e=YW(null,e,i,t,n);break e;case 11:e=XW(null,e,i,t,n);break e;case 14:e=QW(null,e,i,Fs(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:Fs(r,i),pL(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Fs(r,i),YW(t,e,r,i,n);case 3:if(KW(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,fte(t,e),Sb(e,r,null,n),r=e.memoizedState.element,r===i)fA(),e=Gc(t,e,n);else{if(i=e.stateNode,(o=i.hydrate)&&(xf=gg(e.stateNode.containerInfo.firstChild),Vc=e,o=Ul=!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(Ute)}catch(t){console.error(t)}}Ute(),hee.exports=vs;var qv=hee.exports;const Jw=$t(qv);var Wte={exports:{}},$be="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Fbe=$be,jbe=Fbe;function Vte(){}function Gte(){}Gte.resetWarningCache=Vte;var Bbe=function(){function t(r,i,o,a,s,l){if(l!==jbe){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:Gte,resetWarningCache:Vte};return n.PropTypes=n,n};Wte.exports=Bbe();var p1=Wte.exports;const Qe=$t(p1);var Hte=ue.createContext(null);function zbe(t){t()}var qte=zbe,Ube=function(e){return qte=e},Wbe=function(){return qte};function Vbe(){var t=Wbe(),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 hV={notify:function(){},get:function(){return[]}};function Xte(t,e){var n,r=hV;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=Vbe())}function c(){n&&(n(),n=void 0,r.clear(),r=hV)}var u={addNestedSub:i,notifyNestedSubs:o,handleChangeWrapper:a,isSubscribed:s,trySubscribe:l,tryUnsubscribe:c,getListeners:function(){return r}};return u}var Qte=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?M.useLayoutEffect:M.useEffect;function Gbe(t){var e=t.store,n=t.context,r=t.children,i=M.useMemo(function(){var s=Xte(e);return{store:e,subscription:s}},[e]),o=M.useMemo(function(){return e.getState()},[e]);Qte(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||Hte;return ue.createElement(a.Provider,{value:i},r)}function j(){return j=Object.assign?Object.assign.bind():function(t){for(var e=1;e component higher in the tree to provide a loading indicator or placeholder to display.`)}Oi!==5&&(Oi=2),l=wj(l,s),d=a;do{switch(d.tag){case 3:o=l,d.flags|=4096,e&=-e,d.lanes|=e;var _=Ete(d,o,e);$W(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"&&(kl===null||!kl.has(O)))){d.flags|=4096,e&=-e,d.lanes|=e;var C=Pte(d,o,e);$W(d,C);break e}}d=d.return}while(d!==null)}Nte(n)}catch(E){e=E,ei===n&&n!==null&&(ei=n=n.return);continue}break}while(!0)}function Dte(){var t=yT.current;return yT.current=vT,t===null?vT:t}function ox(t,e){var n=Et;Et|=16;var r=Dte();co===t&&Zi===e||bg(t,e);do try{bbe();break}catch(i){Ite(t,i)}while(!0);if(dj(),Et=n,yT.current=r,ei!==null)throw Error(Xe(261));return co=null,Zi=0,Oi}function bbe(){for(;ei!==null;)Lte(ei)}function _be(){for(;ei!==null&&!nbe();)Lte(ei)}function Lte(t){var e=Fte(t.alternate,t,Yh);t.memoizedProps=t.pendingProps,e===null?Nte(t):ei=e,Sj.current=null}function Nte(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&2048){if(n=dbe(e),n!==null){n.flags&=2047,ei=n;return}t!==null&&(t.firstEffect=t.lastEffect=null,t.flags|=2048)}else{if(n=fbe(n,e,Yh),n!==null){ei=n;return}if(n=e,n.tag!==24&&n.tag!==23||n.memoizedState===null||Yh&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=wW(y,_),o=wW(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()-Cj?bg(t,0):Oj|=n),ls(t,e)}function Ebe(t,e){var n=t.stateNode;n!==null&&n.delete(e),e=0,e===0&&(e=t.mode,e&2?e&4?(jc===0&&(jc=Vv),e=Dm(62914560&~jc),e===0&&(e=4194304)):e=Gg()===99?1:2:e=1),n=ya(),t=KP(t,e),t!==null&&(WP(t,e,n),ls(t,n))}var Fte;Fte=function(t,e,n){var r=e.lanes;if(t!==null)if(t.memoizedProps!==e.pendingProps||Do.current)Gs=!0;else if(n&r)Gs=!!(t.flags&16384);else{switch(Gs=!1,e.tag){case 3:YW(e),fA();break;case 5:zW(e);break;case 1:Lo(e.type)&&gC(e);break;case 4:uL(e,e.stateNode.containerInfo);break;case 10:r=e.memoizedProps.value;var i=e.type._context;br(sT,i._currentValue),i._currentValue=r;break;case 13:if(e.memoizedState!==null)return n&e.child.childLanes?KW(t,e,n):(br(xr,xr.current&1),e=Gc(t,e,n),e!==null?e.sibling:null);br(xr,xr.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&64){if(r)return nV(t,e,n);e.flags|=64}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),br(xr,xr.current),r)break;return null;case 23:case 24:return e.lanes=0,dA(t,e,n)}return Gc(t,e,n)}else Gs=!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=Vg(e,Ji.current),vg(e,n),i=yj(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,Lo(r)){var o=!0;gC(e)}else o=!1;e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,pj(e);var a=r.getDerivedStateFromProps;typeof a=="function"&&uT(e,r,a,t),i.updater=QP,e.stateNode=i,i._reactInternals=e,cL(e,r,t,n),e=pL(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=Mbe(i),t=Fs(i,t),o){case 0:e=hL(null,e,i,t,n);break e;case 1:e=QW(null,e,i,t,n);break e;case 11:e=qW(null,e,i,t,n);break e;case 14:e=XW(null,e,i,Fs(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:Fs(r,i),hL(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Fs(r,i),QW(t,e,r,i,n);case 3:if(YW(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,cte(t,e),wb(e,r,null,n),r=e.memoizedState.element,r===i)fA(),e=Gc(t,e,n);else{if(i=e.stateNode,(o=i.hydrate)&&(xf=gg(e.stateNode.containerInfo.firstChild),Vc=e,o=Ul=!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(Bte)}catch(t){console.error(t)}}Bte(),fee.exports=vs;var qv=fee.exports;const Jw=$t(qv);var zte={exports:{}},Nbe="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",$be=Nbe,Fbe=$be;function Ute(){}function Wte(){}Wte.resetWarningCache=Ute;var jbe=function(){function t(r,i,o,a,s,l){if(l!==Fbe){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:Wte,resetWarningCache:Ute};return n.PropTypes=n,n};zte.exports=jbe();var h1=zte.exports;const Qe=$t(h1);var Vte=ue.createContext(null);function Bbe(t){t()}var Gte=Bbe,zbe=function(e){return Gte=e},Ube=function(){return Gte};function Wbe(){var t=Ube(),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 dV={notify:function(){},get:function(){return[]}};function Hte(t,e){var n,r=dV;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=Wbe())}function c(){n&&(n(),n=void 0,r.clear(),r=dV)}var u={addNestedSub:i,notifyNestedSubs:o,handleChangeWrapper:a,isSubscribed:s,trySubscribe:l,tryUnsubscribe:c,getListeners:function(){return r}};return u}var qte=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?M.useLayoutEffect:M.useEffect;function Vbe(t){var e=t.store,n=t.context,r=t.children,i=M.useMemo(function(){var s=Hte(e);return{store:e,subscription:s}},[e]),o=M.useMemo(function(){return e.getState()},[e]);qte(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||Vte;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;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 G_e(t,e){return t===e}function H_e(t){var e={},n=e.connectHOC,r=n===void 0?T_e:n,i=e.mapStateToPropsFactories,o=i===void 0?D_e:i,a=e.mapDispatchToPropsFactories,s=a===void 0?A_e:a,l=e.mergePropsFactories,c=l===void 0?j_e:l,u=e.selectorFactory,f=u===void 0?W_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?G_e:b,S=v.areOwnPropsEqual,O=S===void 0?yA:S,C=v.areStatePropsEqual,E=C===void 0?yA:C,k=v.areMergedPropsEqual,I=k===void 0?yA:k,P=Ae(v,V_e),R=xA(h,o,"mapStateToProps"),T=xA(p,s,"mapDispatchToProps"),L=xA(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=H_e();Ube(qv.unstable_batchedUpdates);function uu(t){"@babel/helpers - typeof";return uu=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},uu(t)}function q_e(t,e){if(uu(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(uu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function sne(t){var e=q_e(t,"string");return uu(e)=="symbol"?e:e+""}function it(t,e,n){return(e=sne(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bV(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 _V(t){for(var e=1;e"u"&&(n=e,e=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(na(1));return n(lne)(t,e)}if(typeof t!="function")throw new Error(na(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(na(3));return o}function f(m){if(typeof m!="function")throw new Error(na(4));if(l)throw new Error(na(5));var g=!0;return c(),s.push(m),function(){if(g){if(l)throw new Error(na(6));g=!1,c();var y=s.indexOf(m);s.splice(y,1),a=null}}}function d(m){if(!X_e(m))throw new Error(na(7));if(typeof m.type>"u")throw new Error(na(8));if(l)throw new Error(na(9));try{l=!0,o=i(o,m)}finally{l=!1}for(var g=a=s,v=0;v"u"?"undefined":L(N);return D!=="object"?D:N===Math?"math":N===null?"null":Array.isArray(N)?"array":Object.prototype.toString.call(N)==="[object Date]"?"date":typeof N.toString=="function"&&/^\/.*\//.test(N.toString())?"regexp":"object"}function f(N,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,N,D);J&&(N=J[0],D=J[1])}}}te.push(K)}u(N)==="regexp"&&u(D)==="regexp"&&(N=N.toString(),D=D.toString());var pe=typeof N>"u"?"undefined":L(N),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,N));else if(u(N)!==u(D))A(new o(te,N,D));else if(u(N)==="date"&&N-D!==0)A(new o(te,N,D));else if(pe==="object"&&N!==null&&D!==null)if(se.filter(function(Q){return Q.lhs===N}).length)N!==D&&A(new o(te,N,D));else{if(se.push({lhs:N,rhs:D}),Array.isArray(N)){var F;for(N.length,F=0;F=D.length?A(new l(te,F,new s(void 0,N[F]))):f(N[F],D[F],A,q,te,F,se);for(;F=0?(f(N[Q],D[Q],A,q,te,Q,se),le=c(le,ee)):f(N[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 N!==D&&(pe==="number"&&isNaN(N)&&isNaN(D)||A(new o(te,N,D)))}function d(N,D,A,q){return q=q||[],f(N,D,function(Y){Y&&q.push(Y)},A),q.length?q:void 0}function h(N,D,A){if(A.path&&A.path.length){var q,Y=N[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(N,D,A){if(A.path&&A.path.length){var q,Y=N[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(N,D,A){if(N&&D){var q=function(Y){A&&!A(N,D,Y)||p(N,D,Y)};f(N,D,q)}}function y(N){return"color: "+U[N].color+"; font-weight: bold"}function x(N){var D=N.kind,A=N.path,q=N.lhs,Y=N.rhs,K=N.index,se=N.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(N,D,A,q){var Y=d(N,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 "+U[se].text,y(se)].concat(z(te)))}):A.log("—— no diff ——");try{A.groupEnd()}catch{A.log("—— diff end —— ")}}function _(N,D,A,q){switch(typeof N>"u"?"undefined":L(N)){case"object":return typeof N[q]=="function"?N[q].apply(N,z(A)):N[q];case"function":return N(D);default:return N}}function S(N){var D=N.timestamp,A=N.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(N,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";N.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=N[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 $e="color: "+te.error(X,Q)+"; font-weight: bold;";A[de]("%c error ",$e,X)}else A[de]("error ",X);if(xe)if(te.nextState){var Te="color: "+te.nextState(ge)+"; font-weight: bold";A[xe]("%c next state",Te,ge)}else A[xe]("next state",ge);pe&&b(Q,ge,A,G);try{A.groupEnd()}catch{A.log("—— log end ——")}})}function C(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},D=Object.assign({},W,N),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(N.getState&&N.dispatch)return console.error(`[redux-logger] redux-logger not installed. Make sure to pass logger instance as middleware: + */var cM=60103,uM=60106,p1=60107,m1=60108,g1=60114,v1=60109,y1=60110,x1=60112,b1=60113,Nj=60120,_1=60115,w1=60116,Jte=60121,ene=60122,tne=60117,nne=60129,rne=60131;if(typeof Symbol=="function"&&Symbol.for){var xi=Symbol.for;cM=xi("react.element"),uM=xi("react.portal"),p1=xi("react.fragment"),m1=xi("react.strict_mode"),g1=xi("react.profiler"),v1=xi("react.provider"),y1=xi("react.context"),x1=xi("react.forward_ref"),b1=xi("react.suspense"),Nj=xi("react.suspense_list"),_1=xi("react.memo"),w1=xi("react.lazy"),Jte=xi("react.block"),ene=xi("react.server.block"),tne=xi("react.fundamental"),nne=xi("react.debug_trace_mode"),rne=xi("react.legacy_hidden")}function nl(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case cM:switch(t=t.type,t){case p1:case g1:case m1:case b1:case Nj:return t;default:switch(t=t&&t.$$typeof,t){case y1:case x1:case w1:case _1:case v1:return t;default:return e}}case uM:return e}}}var a_e=v1,s_e=cM,l_e=x1,c_e=p1,u_e=w1,f_e=_1,d_e=uM,h_e=g1,p_e=m1,m_e=b1;Fn.ContextConsumer=y1;Fn.ContextProvider=a_e;Fn.Element=s_e;Fn.ForwardRef=l_e;Fn.Fragment=c_e;Fn.Lazy=u_e;Fn.Memo=f_e;Fn.Portal=d_e;Fn.Profiler=h_e;Fn.StrictMode=p_e;Fn.Suspense=m_e;Fn.isAsyncMode=function(){return!1};Fn.isConcurrentMode=function(){return!1};Fn.isContextConsumer=function(t){return nl(t)===y1};Fn.isContextProvider=function(t){return nl(t)===v1};Fn.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===cM};Fn.isForwardRef=function(t){return nl(t)===x1};Fn.isFragment=function(t){return nl(t)===p1};Fn.isLazy=function(t){return nl(t)===w1};Fn.isMemo=function(t){return nl(t)===_1};Fn.isPortal=function(t){return nl(t)===uM};Fn.isProfiler=function(t){return nl(t)===g1};Fn.isStrictMode=function(t){return nl(t)===m1};Fn.isSuspense=function(t){return nl(t)===b1};Fn.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===p1||t===g1||t===nne||t===m1||t===b1||t===Nj||t===rne||typeof t=="object"&&t!==null&&(t.$$typeof===w1||t.$$typeof===_1||t.$$typeof===v1||t.$$typeof===y1||t.$$typeof===x1||t.$$typeof===tne||t.$$typeof===Jte||t[0]===ene)};Fn.typeOf=nl;Zte.exports=Fn;var g_e=Zte.exports,v_e=["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"],y_e=["reactReduxForwardedRef"],x_e=[],b_e=[null,null];function __e(t,e){var n=t[1];return[e.payload,n+1]}function gV(t,e,n){qte(function(){return t.apply(void 0,e)},n)}function w_e(t,e,n,r,i,o,a){t.current=r,e.current=i,n.current=!1,o.current&&(o.current=null,a())}function S_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 O_e=function(){return[null,0]};function C_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?Vte:m,v=Ae(n,v_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,y_e);return[T.context,ee,ge]},[T]),z=L[0],B=L[1],U=L[2],W=M.useMemo(function(){return z&&z.Consumer&&g_e.isContextConsumer(ue.createElement(z.Consumer,null))?z:y},[z,y]),$=M.useContext(W),N=!!T.store&&!!T.store.getState&&!!T.store.dispatch;$&&$.store;var D=N?T.store:$.store,A=M.useMemo(function(){return E(D)},[D]),q=M.useMemo(function(){if(!u)return b_e;var ee=Hte(D,N?null:$.subscription),ge=ee.notifyNestedSubs.bind(ee);return[ee,ge]},[D,N,$]),Y=q[0],K=q[1],se=M.useMemo(function(){return N?$:j({},$,{subscription:Y})},[N,$,Y]),te=M.useReducer(__e,x_e,O_e),J=te[0],pe=J[0],be=te[1];if(pe&&pe.error)throw pe.error;var re=M.useRef(),ve=M.useRef(U),F=M.useRef(),ce=M.useRef(!1),le=k(function(){return F.current&&U===ve.current?F.current:A(D.getState(),U)},[D,pe,U]);gV(w_e,[ve,re,ce,U,le,F,K]),gV(S_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(W.Provider,{value:se},Q):Q},[W,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,EL(R,b)}return EL(P,b)}}function vV(t,e){return t===e?t!==0||e!==0||1/t===1/e:t!==t&&e!==e}function yA(t,e){if(vV(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 V_e(t,e){return t===e}function G_e(t){var e={},n=e.connectHOC,r=n===void 0?C_e:n,i=e.mapStateToPropsFactories,o=i===void 0?I_e:i,a=e.mapDispatchToPropsFactories,s=a===void 0?k_e:a,l=e.mergePropsFactories,c=l===void 0?F_e:l,u=e.selectorFactory,f=u===void 0?U_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?V_e:b,S=v.areOwnPropsEqual,O=S===void 0?yA:S,C=v.areStatePropsEqual,E=C===void 0?yA:C,k=v.areMergedPropsEqual,I=k===void 0?yA:k,P=Ae(v,W_e),R=xA(h,o,"mapStateToProps"),T=xA(p,s,"mapDispatchToProps"),L=xA(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=G_e();zbe(qv.unstable_batchedUpdates);function uu(t){"@babel/helpers - typeof";return uu=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},uu(t)}function H_e(t,e){if(uu(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(uu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function one(t){var e=H_e(t,"string");return uu(e)=="symbol"?e:e+""}function it(t,e,n){return(e=one(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xV(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 bV(t){for(var e=1;e"u"&&(n=e,e=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(na(1));return n(ane)(t,e)}if(typeof t!="function")throw new Error(na(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(na(3));return o}function f(m){if(typeof m!="function")throw new Error(na(4));if(l)throw new Error(na(5));var g=!0;return c(),s.push(m),function(){if(g){if(l)throw new Error(na(6));g=!1,c();var y=s.indexOf(m);s.splice(y,1),a=null}}}function d(m){if(!q_e(m))throw new Error(na(7));if(typeof m.type>"u")throw new Error(na(8));if(l)throw new Error(na(9));try{l=!0,o=i(o,m)}finally{l=!1}for(var g=a=s,v=0;v"u"?"undefined":L(N);return D!=="object"?D:N===Math?"math":N===null?"null":Array.isArray(N)?"array":Object.prototype.toString.call(N)==="[object Date]"?"date":typeof N.toString=="function"&&/^\/.*\//.test(N.toString())?"regexp":"object"}function f(N,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,N,D);J&&(N=J[0],D=J[1])}}}te.push(K)}u(N)==="regexp"&&u(D)==="regexp"&&(N=N.toString(),D=D.toString());var pe=typeof N>"u"?"undefined":L(N),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,N));else if(u(N)!==u(D))A(new o(te,N,D));else if(u(N)==="date"&&N-D!==0)A(new o(te,N,D));else if(pe==="object"&&N!==null&&D!==null)if(se.filter(function(Q){return Q.lhs===N}).length)N!==D&&A(new o(te,N,D));else{if(se.push({lhs:N,rhs:D}),Array.isArray(N)){var F;for(N.length,F=0;F=D.length?A(new l(te,F,new s(void 0,N[F]))):f(N[F],D[F],A,q,te,F,se);for(;F=0?(f(N[Q],D[Q],A,q,te,Q,se),le=c(le,ee)):f(N[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 N!==D&&(pe==="number"&&isNaN(N)&&isNaN(D)||A(new o(te,N,D)))}function d(N,D,A,q){return q=q||[],f(N,D,function(Y){Y&&q.push(Y)},A),q.length?q:void 0}function h(N,D,A){if(A.path&&A.path.length){var q,Y=N[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(N,D,A){if(A.path&&A.path.length){var q,Y=N[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(N,D,A){if(N&&D){var q=function(Y){A&&!A(N,D,Y)||p(N,D,Y)};f(N,D,q)}}function y(N){return"color: "+U[N].color+"; font-weight: bold"}function x(N){var D=N.kind,A=N.path,q=N.lhs,Y=N.rhs,K=N.index,se=N.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(N,D,A,q){var Y=d(N,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 "+U[se].text,y(se)].concat(z(te)))}):A.log("—— no diff ——");try{A.groupEnd()}catch{A.log("—— diff end —— ")}}function _(N,D,A,q){switch(typeof N>"u"?"undefined":L(N)){case"object":return typeof N[q]=="function"?N[q].apply(N,z(A)):N[q];case"function":return N(D);default:return N}}function S(N){var D=N.timestamp,A=N.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(N,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";N.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=N[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 $e="color: "+te.error(X,Q)+"; font-weight: bold;";A[de]("%c error ",$e,X)}else A[de]("error ",X);if(xe)if(te.nextState){var Te="color: "+te.nextState(ge)+"; font-weight: bold";A[xe]("%c next state",Te,ge)}else A[xe]("next state",ge);pe&&b(Q,ge,A,G);try{A.groupEnd()}catch{A.log("—— log end ——")}})}function C(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},D=Object.assign({},W,N),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(N.getState&&N.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=W,n.createLogger=C,n.logger=$,n.default=$,Object.defineProperty(n,"__esModule",{value:!0})})})(ML,ML.exports);var K_e=ML.exports;function cne(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 une=cne();une.withExtraArgument=cne;const Eb={black:"#000",white:"#fff"},tf={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"},fne={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"},nf={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"},Z_e={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"},dne={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"},rf={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"},of={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"},hne={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"},pne={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"},Lc={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"},J_e={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"},mne={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"},gne={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"},vne={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"},oh={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"},Dh={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"},yne={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"},xne={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"},e1e={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"};function fu(t){let e="https://mui.com/production-error/?code="+t;for(let n=1;n0?Si(Xv,--Uo):0,qg--,Fr===10&&(qg=1,dM--),Fr}function xa(){return Fr=Uo2||Mb(Fr)>3?"":" "}function y1e(t,e){for(;--e&&xa()&&!(Fr<48||Fr>102||Fr>57&&Fr<65||Fr>70&&Fr<97););return O1(t,wC()+(e<6&&Wl()==32&&xa()==32))}function AL(t){for(;xa();)switch(Fr){case t:return Uo;case 34:case 39:t!==34&&t!==39&&AL(Fr);break;case 40:t===41&&AL(t);break;case 92:xa();break}return Uo}function x1e(t,e){for(;xa()&&t+Fr!==57;)if(t+Fr===84&&Wl()===47)break;return"/*"+O1(e,Uo-1)+"*"+fM(t===47?t:xa())}function b1e(t){for(;!Mb(Wl());)xa();return O1(t,Uo)}function _1e(t){return Tne(OC("",null,null,null,[""],t=Cne(t),0,[0],t))}function OC(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){kL(O+=gn(SC(y),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:O+=SC(y);break;case 9:case 10:case 13:case 32:O+=v1e(p);break;case 92:O+=y1e(wC()-1,7);continue;case 47:switch(Wl()){case 42:case 47:eS(w1e(x1e(xa(),wC()),e,n),l);break;default:O+="/"}break;case 123*m:s[c++]=xl(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&&xl(O)-f&&eS(h>32?CV(O+";",r,n,f-1):CV(gn(O," ","")+";",r,n,f-2),l);break;case 59:O+=";";default:if(eS(S=OV(O,e,n,c,u,i,s,x,b=[],_=[],f),o),y===123)if(u===0)OC(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:OC(t,S,S,r&&eS(OV(t,S,S,0,0,i,s,x,i,b=[],f),_),i,_,f,s,r?b:_);break;default:OC(O,S,S,S,[""],_,0,s,_)}}c=u=h=0,m=v=1,x=O="",f=a;break;case 58:f=1+xl(O),h=p;default:if(m<1){if(y==123)--m;else if(y==125&&m++==0&&g1e()==125)continue}switch(O+=fM(y),y*m){case 38:v=u>0?1:(O+="\f",-1);break;case 44:s[c++]=(xl(O)-1)*v,v=1;break;case 64:Wl()===45&&(O+=SC(xa())),d=Wl(),u=f=xl(x=O+=b1e(wC())),y++;break;case 45:p===45&&xl(O)==2&&(m=0)}}return o}function OV(t,e,n,r,i,o,a,s,l,c,u){for(var f=i-1,d=i===0?o:[""],h=zj(d),p=0,m=0,g=0;p0?d[v]+" "+y:gn(y,/&\f/g,d[v])))&&(l[g++]=x);return hM(t,e,n,i===0?jj:s,l,c,u)}function w1e(t,e,n){return hM(t,e,n,_ne,fM(m1e()),Pb(t,2,-2),0)}function CV(t,e,n,r){return hM(t,e,n,Bj,Pb(t,0,r),Pb(t,r+1,-1),r)}function wg(t,e){for(var n="",r=zj(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"+wT+(Si(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~kL(t,"stretch")?Ene(gn(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(Si(t,e+1)!==115)break;case 6444:switch(Si(t,xl(t)-3-(~kL(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 A1e=function(e,n,r,i){if(e.length>-1&&!e.return)switch(e.type){case Bj:e.return=Ene(e.value,e.length);break;case wne:return wg([f0(e,{value:gn(e.value,"@","@"+pn)})],i);case jj:if(e.length)return p1e(e.props,function(o){switch(h1e(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return wg([f0(e,{props:[gn(o,/:(read-\w+)/,":"+wT+"$1")]})],i);case"::placeholder":return wg([f0(e,{props:[gn(o,/:(plac\w+)/,":"+pn+"input-$1")]}),f0(e,{props:[gn(o,/:(plac\w+)/,":"+wT+"$1")]}),f0(e,{props:[gn(o,/:(plac\w+)/,Bi+"input-$1")]})],i)}return""})}},R1e=[A1e],Pne=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||R1e,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 N1e={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,scale: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},$1e=!1,F1e=/[A-Z]|^ms/g,j1e=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Ane=function(e){return e.charCodeAt(1)===45},EV=function(e){return e!=null&&typeof e!="boolean"},_A=bne(function(t){return Ane(t)?t:t.replace(F1e,"-$&").toLowerCase()}),PV=function(e,n){switch(e){case"animation":case"animationName":if(typeof n=="string")return n.replace(j1e,function(r,i,o){return bl={name:i,styles:o,next:bl},i})}return N1e[e]!==1&&!Ane(e)&&typeof n=="number"&&n!==0?n+"px":n},B1e="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function kb(t,e,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var i=n;if(i.anim===1)return bl={name:i.name,styles:i.styles,next:bl},i.name;var o=n;if(o.styles!==void 0){var a=o.next;if(a!==void 0)for(;a!==void 0;)bl={name:a.name,styles:a.styles,next:bl},a=a.next;var s=o.styles+";";return s}return z1e(t,e,n)}case"function":{if(t!==void 0){var l=bl,c=n(t);return bl=l,kb(t,e,c)}break}}var u=n;if(e==null)return u;var f=e[u];return f!==void 0?f:u}function z1e(t,e,n){var r="";if(Array.isArray(n))for(var i=0;i96?H1e:q1e},RV=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},X1e=!1,Q1e=function(e){var n=e.cache,r=e.serialized,i=e.isStringTag;return Mne(n,r,i),W1e(function(){return kne(n,r,i)}),null},Y1e=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=RV(e,n,r),l=s||AV(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(Z1e(i)?n:i):e;return w.jsx(G1e,{styles:r})}function Wj(t,e){return RL(t,e)}const $ne=(t,e)=>{Array.isArray(t.__emotion_styles)&&(t.__emotion_styles=e(t.__emotion_styles))},J1e=Object.freeze(Object.defineProperty({__proto__:null,GlobalStyles:Nne,StyledEngineProvider:Lne,ThemeContext:C1,css:pM,default:Wj,internal_processStyles:$ne,keyframes:Qv},Symbol.toStringTag,{value:"Module"}));function Bc(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 Fne(t){if(!Bc(t))return t;const e={};return Object.keys(t).forEach(n=>{e[n]=Fne(t[n])}),e}function Ii(t,e,n={clone:!0}){const r=n.clone?j({},t):t;return Bc(t)&&Bc(e)&&Object.keys(e).forEach(i=>{Bc(e[i])&&Object.prototype.hasOwnProperty.call(t,i)&&Bc(t[i])?r[i]=Ii(t[i],e[i],n):n.clone?r[i]=Bc(e[i])?Fne(e[i]):e[i]:r[i]=e[i]}),r}const ewe=Object.freeze(Object.defineProperty({__proto__:null,default:Ii,isPlainObject:Bc},Symbol.toStringTag,{value:"Module"})),twe=["values","unit","step"],nwe=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 jne(t){const{values:e={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5}=t,i=Ae(t,twe),o=nwe(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:${Vj[t]}px)`};function Wo(t,e,n){const r=t.theme||{};if(Array.isArray(e)){const o=r.breakpoints||IV;return e.reduce((a,s,l)=>(a[o.up(o.keys[l])]=n(e[l]),a),{})}if(typeof e=="object"){const o=r.breakpoints||IV;return Object.keys(e).reduce((a,s)=>{if(Object.keys(o.values||Vj).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 Bne(t={}){var e;return((e=t.keys)==null?void 0:e.reduce((r,i)=>{const o=t.up(i);return r[o]={},r},{}))||{}}function zne(t,e){return t.reduce((n,r)=>{const i=n[r];return(!i||Object.keys(i).length===0)&&delete n[r],n},e)}function iwe(t,...e){const n=Bne(t),r=[n,...e].reduce((i,o)=>Ii(i,o),{});return zne(Object.keys(n),r)}function owe(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 Lh({values:t,breakpoints:e,base:n}){const r=n||owe(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(fu(7));return t.charAt(0).toUpperCase()+t.slice(1)}const awe=Object.freeze(Object.defineProperty({__proto__:null,default:De},Symbol.toStringTag,{value:"Module"}));function Xg(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 ST(t,e,n,r=n){let i;return typeof t=="function"?i=t(n):Array.isArray(t)?i=t[n]||r:i=Xg(t,n)||r,e&&(i=e(i,r,t)),i}function Ar(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=Xg(l,r)||{};return Wo(a,s,f=>{let d=ST(c,i,f);return f===d&&typeof f=="string"&&(d=ST(c,i,`${e}${f==="default"?"":De(f)}`,f)),n===!1?d:{[n]:d}})};return o.propTypes={},o.filterProps=[e],o}function swe(t){const e={};return n=>(e[n]===void 0&&(e[n]=t(n)),e[n])}const lwe={m:"margin",p:"padding"},cwe={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},DV={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},uwe=swe(t=>{if(t.length>2)if(DV[t])t=DV[t];else return[t];const[e,n]=t.split(""),r=lwe[e],i=cwe[n]||"";return Array.isArray(i)?i.map(o=>r+o):[r+i]}),Gj=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Hj=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...Gj,...Hj];function T1(t,e,n,r){var i;const o=(i=Xg(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 qj(t){return T1(t,"spacing",8)}function Zh(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 fwe(t,e){return n=>t.reduce((r,i)=>(r[i]=Zh(e,n),r),{})}function dwe(t,e,n,r){if(e.indexOf(n)===-1)return null;const i=uwe(n),o=fwe(i,r),a=t[n];return Wo(t,a,o)}function Une(t,e){const n=qj(t.theme);return Object.keys(t).map(r=>dwe(t,e,r,n)).reduce(Nx,{})}function gr(t){return Une(t,Gj)}gr.propTypes={};gr.filterProps=Gj;function vr(t){return Une(t,Hj)}vr.propTypes={};vr.filterProps=Hj;function hwe(t=8){if(t.mui)return t;const e=qj({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 mM(...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]?Nx(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 ys(t,e){return Ar({prop:t,themeKey:"borders",transform:e})}const pwe=ys("border",ja),mwe=ys("borderTop",ja),gwe=ys("borderRight",ja),vwe=ys("borderBottom",ja),ywe=ys("borderLeft",ja),xwe=ys("borderColor"),bwe=ys("borderTopColor"),_we=ys("borderRightColor"),wwe=ys("borderBottomColor"),Swe=ys("borderLeftColor"),Owe=ys("outline",ja),Cwe=ys("outlineColor"),gM=t=>{if(t.borderRadius!==void 0&&t.borderRadius!==null){const e=T1(t.theme,"shape.borderRadius",4),n=r=>({borderRadius:Zh(e,r)});return Wo(t,t.borderRadius,n)}return null};gM.propTypes={};gM.filterProps=["borderRadius"];mM(pwe,mwe,gwe,vwe,ywe,xwe,bwe,_we,wwe,Swe,gM,Owe,Cwe);const vM=t=>{if(t.gap!==void 0&&t.gap!==null){const e=T1(t.theme,"spacing",8),n=r=>({gap:Zh(e,r)});return Wo(t,t.gap,n)}return null};vM.propTypes={};vM.filterProps=["gap"];const yM=t=>{if(t.columnGap!==void 0&&t.columnGap!==null){const e=T1(t.theme,"spacing",8),n=r=>({columnGap:Zh(e,r)});return Wo(t,t.columnGap,n)}return null};yM.propTypes={};yM.filterProps=["columnGap"];const xM=t=>{if(t.rowGap!==void 0&&t.rowGap!==null){const e=T1(t.theme,"spacing",8),n=r=>({rowGap:Zh(e,r)});return Wo(t,t.rowGap,n)}return null};xM.propTypes={};xM.filterProps=["rowGap"];const Twe=Ar({prop:"gridColumn"}),Ewe=Ar({prop:"gridRow"}),Pwe=Ar({prop:"gridAutoFlow"}),Mwe=Ar({prop:"gridAutoColumns"}),kwe=Ar({prop:"gridAutoRows"}),Awe=Ar({prop:"gridTemplateColumns"}),Rwe=Ar({prop:"gridTemplateRows"}),Iwe=Ar({prop:"gridTemplateAreas"}),Dwe=Ar({prop:"gridArea"});mM(vM,yM,xM,Twe,Ewe,Pwe,Mwe,kwe,Awe,Rwe,Iwe,Dwe);function Sg(t,e){return e==="grey"?e:t}const Lwe=Ar({prop:"color",themeKey:"palette",transform:Sg}),Nwe=Ar({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Sg}),$we=Ar({prop:"backgroundColor",themeKey:"palette",transform:Sg});mM(Lwe,Nwe,$we);function ua(t){return t<=1&&t!==0?`${t*100}%`:t}const Fwe=Ar({prop:"width",transform:ua}),Xj=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])||Vj[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:ua(n)}};return Wo(t,t.maxWidth,e)}return null};Xj.filterProps=["maxWidth"];const jwe=Ar({prop:"minWidth",transform:ua}),Bwe=Ar({prop:"height",transform:ua}),zwe=Ar({prop:"maxHeight",transform:ua}),Uwe=Ar({prop:"minHeight",transform:ua});Ar({prop:"size",cssProperty:"width",transform:ua});Ar({prop:"size",cssProperty:"height",transform:ua});const Wwe=Ar({prop:"boxSizing"});mM(Fwe,Xj,jwe,Bwe,zwe,Uwe,Wwe);const E1={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:gM},color:{themeKey:"palette",transform:Sg},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Sg},backgroundColor:{themeKey:"palette",transform:Sg},p:{style:vr},pt:{style:vr},pr:{style:vr},pb:{style:vr},pl:{style:vr},px:{style:vr},py:{style:vr},padding:{style:vr},paddingTop:{style:vr},paddingRight:{style:vr},paddingBottom:{style:vr},paddingLeft:{style:vr},paddingX:{style:vr},paddingY:{style:vr},paddingInline:{style:vr},paddingInlineStart:{style:vr},paddingInlineEnd:{style:vr},paddingBlock:{style:vr},paddingBlockStart:{style:vr},paddingBlockEnd:{style:vr},m:{style:gr},mt:{style:gr},mr:{style:gr},mb:{style:gr},ml:{style:gr},mx:{style:gr},my:{style:gr},margin:{style:gr},marginTop:{style:gr},marginRight:{style:gr},marginBottom:{style:gr},marginLeft:{style:gr},marginX:{style:gr},marginY:{style:gr},marginInline:{style:gr},marginInlineStart:{style:gr},marginInlineEnd:{style:gr},marginBlock:{style:gr},marginBlockStart:{style:gr},marginBlockEnd:{style:gr},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:vM},rowGap:{style:xM},columnGap:{style:yM},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:ua},maxWidth:{style:Xj},minWidth:{transform:ua},height:{transform:ua},maxHeight:{transform:ua},minHeight:{transform:ua},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function Vwe(...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 Gwe(t,e){return typeof t=="function"?t(e):t}function Wne(){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=Xg(i,c)||{};return f?f(a):Wo(a,r,p=>{let m=ST(d,u,p);return p===m&&typeof p=="string"&&(m=ST(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:E1;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=Bne(o.breakpoints),f=Object.keys(u);let d=u;return Object.keys(c).forEach(h=>{const p=Gwe(c[h],o);if(p!=null)if(typeof p=="object")if(a[h])d=Nx(d,t(h,p,o,a));else{const m=Wo({theme:o},p,g=>({[h]:g}));Vwe(m,p)?d[h]=e({sx:p,theme:o}):d=Nx(d,m)}else d=Nx(d,t(h,p,o,a))}),zne(f,d)}return Array.isArray(i)?i.map(s):s(i)}return e}const Yv=Wne();Yv.filterProps=["sx"];function Vne(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 Hwe=["breakpoints","palette","spacing","shape"];function P1(t={},...e){const{breakpoints:n={},palette:r={},spacing:i,shape:o={}}=t,a=Ae(t,Hwe),s=jne(n),l=hwe(i);let c=Ii({breakpoints:s,direction:"ltr",components:{},palette:j({mode:"light"},r),spacing:l,shape:j({},rwe,o)},a);return c.applyStyles=Vne,c=e.reduce((u,f)=>Ii(u,f),c),c.unstable_sxConfig=j({},E1,a==null?void 0:a.unstable_sxConfig),c.unstable_sx=function(f){return Yv({sx:f,theme:this})},c}const qwe=Object.freeze(Object.defineProperty({__proto__:null,default:P1,private_createBreakpoints:jne,unstable_applyStyles:Vne},Symbol.toStringTag,{value:"Module"}));function Xwe(t){return Object.keys(t).length===0}function Qj(t=null){const e=M.useContext(C1);return!e||Xwe(e)?t:e}const Qwe=P1();function hd(t=Qwe){return Qj(t)}function Ywe({styles:t,themeId:e,defaultTheme:n={}}){const r=hd(n),i=typeof t=="function"?t(e&&r[e]||r):t;return w.jsx(Nne,{styles:i})}const Kwe=["sx"],Zwe=t=>{var e,n;const r={systemProps:{},otherProps:{}},i=(e=t==null||(n=t.theme)==null?void 0:n.unstable_sxConfig)!=null?e:E1;return Object.keys(t).forEach(o=>{i[o]?r.systemProps[o]=t[o]:r.otherProps[o]=t[o]}),r};function M1(t){const{sx:e}=t,n=Ae(t,Kwe),{systemProps:r,otherProps:i}=Zwe(n);let o;return Array.isArray(e)?o=[r,...e]:typeof e=="function"?o=(...a)=>{const s=e(...a);return Bc(s)?j({},r,s):r}:o=j({},r,e),j({},i,{sx:o})}const Jwe=Object.freeze(Object.defineProperty({__proto__:null,default:Yv,extendSxProp:M1,unstable_createStyleFunctionSx:Wne,unstable_defaultSxConfig:E1},Symbol.toStringTag,{value:"Module"})),LV=t=>t,eSe=()=>{let t=LV;return{configure(e){t=e},generate(e){return t(e)},reset(){t=LV}}},Yj=eSe();function Gne(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"})(Yv);return M.forwardRef(function(l,c){const u=hd(n),f=M1(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 Hne={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=Hne[e];return r?`${n}-${r}`:`${Yj.generate(t)}-${e}`}function Ve(t,e,n="Mui"){const r={};return e.forEach(i=>{r[i]=We(t,i,n)}),r}var qne={exports:{}},kn={};/** +`)};n.defaults=W,n.createLogger=C,n.logger=$,n.default=$,Object.defineProperty(n,"__esModule",{value:!0})})})(PL,PL.exports);var Y_e=PL.exports;function sne(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 lne=sne();lne.withExtraArgument=sne;const Tb={black:"#000",white:"#fff"},tf={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"},cne={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"},nf={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"},K_e={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"},une={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"},rf={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"},of={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"},fne={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"},dne={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"},Lc={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"},Z_e={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"},hne={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"},pne={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"},mne={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"},oh={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"},Dh={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"},gne={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"},vne={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"},J_e={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"};function fu(t){let e="https://mui.com/production-error/?code="+t;for(let n=1;n0?Si(Xv,--Uo):0,qg--,Fr===10&&(qg=1,dM--),Fr}function xa(){return Fr=Uo2||Pb(Fr)>3?"":" "}function v1e(t,e){for(;--e&&xa()&&!(Fr<48||Fr>102||Fr>57&&Fr<65||Fr>70&&Fr<97););return S1(t,wC()+(e<6&&Wl()==32&&xa()==32))}function kL(t){for(;xa();)switch(Fr){case t:return Uo;case 34:case 39:t!==34&&t!==39&&kL(Fr);break;case 40:t===41&&kL(t);break;case 92:xa();break}return Uo}function y1e(t,e){for(;xa()&&t+Fr!==57;)if(t+Fr===84&&Wl()===47)break;return"/*"+S1(e,Uo-1)+"*"+fM(t===47?t:xa())}function x1e(t){for(;!Pb(Wl());)xa();return S1(t,Uo)}function b1e(t){return One(OC("",null,null,null,[""],t=Sne(t),0,[0],t))}function OC(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){ML(O+=gn(SC(y),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:O+=SC(y);break;case 9:case 10:case 13:case 32:O+=g1e(p);break;case 92:O+=v1e(wC()-1,7);continue;case 47:switch(Wl()){case 42:case 47:eS(_1e(y1e(xa(),wC()),e,n),l);break;default:O+="/"}break;case 123*m:s[c++]=xl(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&&xl(O)-f&&eS(h>32?OV(O+";",r,n,f-1):OV(gn(O," ","")+";",r,n,f-2),l);break;case 59:O+=";";default:if(eS(S=SV(O,e,n,c,u,i,s,x,b=[],_=[],f),o),y===123)if(u===0)OC(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:OC(t,S,S,r&&eS(SV(t,S,S,0,0,i,s,x,i,b=[],f),_),i,_,f,s,r?b:_);break;default:OC(O,S,S,S,[""],_,0,s,_)}}c=u=h=0,m=v=1,x=O="",f=a;break;case 58:f=1+xl(O),h=p;default:if(m<1){if(y==123)--m;else if(y==125&&m++==0&&m1e()==125)continue}switch(O+=fM(y),y*m){case 38:v=u>0?1:(O+="\f",-1);break;case 44:s[c++]=(xl(O)-1)*v,v=1;break;case 64:Wl()===45&&(O+=SC(xa())),d=Wl(),u=f=xl(x=O+=x1e(wC())),y++;break;case 45:p===45&&xl(O)==2&&(m=0)}}return o}function SV(t,e,n,r,i,o,a,s,l,c,u){for(var f=i-1,d=i===0?o:[""],h=Bj(d),p=0,m=0,g=0;p0?d[v]+" "+y:gn(y,/&\f/g,d[v])))&&(l[g++]=x);return hM(t,e,n,i===0?Fj:s,l,c,u)}function _1e(t,e,n){return hM(t,e,n,xne,fM(p1e()),Eb(t,2,-2),0)}function OV(t,e,n,r){return hM(t,e,n,jj,Eb(t,0,r),Eb(t,r+1,-1),r)}function wg(t,e){for(var n="",r=Bj(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"+wT+(Si(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~ML(t,"stretch")?Cne(gn(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(Si(t,e+1)!==115)break;case 6444:switch(Si(t,xl(t)-3-(~ML(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 k1e=function(e,n,r,i){if(e.length>-1&&!e.return)switch(e.type){case jj:e.return=Cne(e.value,e.length);break;case bne:return wg([u0(e,{value:gn(e.value,"@","@"+pn)})],i);case Fj:if(e.length)return h1e(e.props,function(o){switch(d1e(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return wg([u0(e,{props:[gn(o,/:(read-\w+)/,":"+wT+"$1")]})],i);case"::placeholder":return wg([u0(e,{props:[gn(o,/:(plac\w+)/,":"+pn+"input-$1")]}),u0(e,{props:[gn(o,/:(plac\w+)/,":"+wT+"$1")]}),u0(e,{props:[gn(o,/:(plac\w+)/,Bi+"input-$1")]})],i)}return""})}},A1e=[k1e],Tne=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||A1e,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 L1e={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,scale: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},N1e=!1,$1e=/[A-Z]|^ms/g,F1e=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Mne=function(e){return e.charCodeAt(1)===45},TV=function(e){return e!=null&&typeof e!="boolean"},_A=yne(function(t){return Mne(t)?t:t.replace($1e,"-$&").toLowerCase()}),EV=function(e,n){switch(e){case"animation":case"animationName":if(typeof n=="string")return n.replace(F1e,function(r,i,o){return bl={name:i,styles:o,next:bl},i})}return L1e[e]!==1&&!Mne(e)&&typeof n=="number"&&n!==0?n+"px":n},j1e="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function Mb(t,e,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var i=n;if(i.anim===1)return bl={name:i.name,styles:i.styles,next:bl},i.name;var o=n;if(o.styles!==void 0){var a=o.next;if(a!==void 0)for(;a!==void 0;)bl={name:a.name,styles:a.styles,next:bl},a=a.next;var s=o.styles+";";return s}return B1e(t,e,n)}case"function":{if(t!==void 0){var l=bl,c=n(t);return bl=l,Mb(t,e,c)}break}}var u=n;if(e==null)return u;var f=e[u];return f!==void 0?f:u}function B1e(t,e,n){var r="";if(Array.isArray(n))for(var i=0;i96?G1e:H1e},AV=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},q1e=!1,X1e=function(e){var n=e.cache,r=e.serialized,i=e.isStringTag;return Ene(n,r,i),U1e(function(){return Pne(n,r,i)}),null},Q1e=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=AV(e,n,r),l=s||kV(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(K1e(i)?n:i):e;return w.jsx(V1e,{styles:r})}function Uj(t,e){return AL(t,e)}const Lne=(t,e)=>{Array.isArray(t.__emotion_styles)&&(t.__emotion_styles=e(t.__emotion_styles))},Z1e=Object.freeze(Object.defineProperty({__proto__:null,GlobalStyles:Dne,StyledEngineProvider:Ine,ThemeContext:O1,css:pM,default:Uj,internal_processStyles:Lne,keyframes:Qv},Symbol.toStringTag,{value:"Module"}));function Bc(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 Nne(t){if(!Bc(t))return t;const e={};return Object.keys(t).forEach(n=>{e[n]=Nne(t[n])}),e}function Ii(t,e,n={clone:!0}){const r=n.clone?j({},t):t;return Bc(t)&&Bc(e)&&Object.keys(e).forEach(i=>{Bc(e[i])&&Object.prototype.hasOwnProperty.call(t,i)&&Bc(t[i])?r[i]=Ii(t[i],e[i],n):n.clone?r[i]=Bc(e[i])?Nne(e[i]):e[i]:r[i]=e[i]}),r}const J1e=Object.freeze(Object.defineProperty({__proto__:null,default:Ii,isPlainObject:Bc},Symbol.toStringTag,{value:"Module"})),ewe=["values","unit","step"],twe=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 $ne(t){const{values:e={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5}=t,i=Ae(t,ewe),o=twe(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:${Wj[t]}px)`};function Wo(t,e,n){const r=t.theme||{};if(Array.isArray(e)){const o=r.breakpoints||RV;return e.reduce((a,s,l)=>(a[o.up(o.keys[l])]=n(e[l]),a),{})}if(typeof e=="object"){const o=r.breakpoints||RV;return Object.keys(e).reduce((a,s)=>{if(Object.keys(o.values||Wj).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 Fne(t={}){var e;return((e=t.keys)==null?void 0:e.reduce((r,i)=>{const o=t.up(i);return r[o]={},r},{}))||{}}function jne(t,e){return t.reduce((n,r)=>{const i=n[r];return(!i||Object.keys(i).length===0)&&delete n[r],n},e)}function rwe(t,...e){const n=Fne(t),r=[n,...e].reduce((i,o)=>Ii(i,o),{});return jne(Object.keys(n),r)}function iwe(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 Lh({values:t,breakpoints:e,base:n}){const r=n||iwe(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(fu(7));return t.charAt(0).toUpperCase()+t.slice(1)}const owe=Object.freeze(Object.defineProperty({__proto__:null,default:De},Symbol.toStringTag,{value:"Module"}));function Xg(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 ST(t,e,n,r=n){let i;return typeof t=="function"?i=t(n):Array.isArray(t)?i=t[n]||r:i=Xg(t,n)||r,e&&(i=e(i,r,t)),i}function Ar(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=Xg(l,r)||{};return Wo(a,s,f=>{let d=ST(c,i,f);return f===d&&typeof f=="string"&&(d=ST(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 swe={m:"margin",p:"padding"},lwe={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},IV={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},cwe=awe(t=>{if(t.length>2)if(IV[t])t=IV[t];else return[t];const[e,n]=t.split(""),r=swe[e],i=lwe[n]||"";return Array.isArray(i)?i.map(o=>r+o):[r+i]}),Vj=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Gj=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...Vj,...Gj];function C1(t,e,n,r){var i;const o=(i=Xg(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 Hj(t){return C1(t,"spacing",8)}function Zh(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 uwe(t,e){return n=>t.reduce((r,i)=>(r[i]=Zh(e,n),r),{})}function fwe(t,e,n,r){if(e.indexOf(n)===-1)return null;const i=cwe(n),o=uwe(i,r),a=t[n];return Wo(t,a,o)}function Bne(t,e){const n=Hj(t.theme);return Object.keys(t).map(r=>fwe(t,e,r,n)).reduce(Lx,{})}function gr(t){return Bne(t,Vj)}gr.propTypes={};gr.filterProps=Vj;function vr(t){return Bne(t,Gj)}vr.propTypes={};vr.filterProps=Gj;function dwe(t=8){if(t.mui)return t;const e=Hj({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 mM(...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]?Lx(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 ys(t,e){return Ar({prop:t,themeKey:"borders",transform:e})}const hwe=ys("border",ja),pwe=ys("borderTop",ja),mwe=ys("borderRight",ja),gwe=ys("borderBottom",ja),vwe=ys("borderLeft",ja),ywe=ys("borderColor"),xwe=ys("borderTopColor"),bwe=ys("borderRightColor"),_we=ys("borderBottomColor"),wwe=ys("borderLeftColor"),Swe=ys("outline",ja),Owe=ys("outlineColor"),gM=t=>{if(t.borderRadius!==void 0&&t.borderRadius!==null){const e=C1(t.theme,"shape.borderRadius",4),n=r=>({borderRadius:Zh(e,r)});return Wo(t,t.borderRadius,n)}return null};gM.propTypes={};gM.filterProps=["borderRadius"];mM(hwe,pwe,mwe,gwe,vwe,ywe,xwe,bwe,_we,wwe,gM,Swe,Owe);const vM=t=>{if(t.gap!==void 0&&t.gap!==null){const e=C1(t.theme,"spacing",8),n=r=>({gap:Zh(e,r)});return Wo(t,t.gap,n)}return null};vM.propTypes={};vM.filterProps=["gap"];const yM=t=>{if(t.columnGap!==void 0&&t.columnGap!==null){const e=C1(t.theme,"spacing",8),n=r=>({columnGap:Zh(e,r)});return Wo(t,t.columnGap,n)}return null};yM.propTypes={};yM.filterProps=["columnGap"];const xM=t=>{if(t.rowGap!==void 0&&t.rowGap!==null){const e=C1(t.theme,"spacing",8),n=r=>({rowGap:Zh(e,r)});return Wo(t,t.rowGap,n)}return null};xM.propTypes={};xM.filterProps=["rowGap"];const Cwe=Ar({prop:"gridColumn"}),Twe=Ar({prop:"gridRow"}),Ewe=Ar({prop:"gridAutoFlow"}),Pwe=Ar({prop:"gridAutoColumns"}),Mwe=Ar({prop:"gridAutoRows"}),kwe=Ar({prop:"gridTemplateColumns"}),Awe=Ar({prop:"gridTemplateRows"}),Rwe=Ar({prop:"gridTemplateAreas"}),Iwe=Ar({prop:"gridArea"});mM(vM,yM,xM,Cwe,Twe,Ewe,Pwe,Mwe,kwe,Awe,Rwe,Iwe);function Sg(t,e){return e==="grey"?e:t}const Dwe=Ar({prop:"color",themeKey:"palette",transform:Sg}),Lwe=Ar({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Sg}),Nwe=Ar({prop:"backgroundColor",themeKey:"palette",transform:Sg});mM(Dwe,Lwe,Nwe);function ua(t){return t<=1&&t!==0?`${t*100}%`:t}const $we=Ar({prop:"width",transform:ua}),qj=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])||Wj[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:ua(n)}};return Wo(t,t.maxWidth,e)}return null};qj.filterProps=["maxWidth"];const Fwe=Ar({prop:"minWidth",transform:ua}),jwe=Ar({prop:"height",transform:ua}),Bwe=Ar({prop:"maxHeight",transform:ua}),zwe=Ar({prop:"minHeight",transform:ua});Ar({prop:"size",cssProperty:"width",transform:ua});Ar({prop:"size",cssProperty:"height",transform:ua});const Uwe=Ar({prop:"boxSizing"});mM($we,qj,Fwe,jwe,Bwe,zwe,Uwe);const T1={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:gM},color:{themeKey:"palette",transform:Sg},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Sg},backgroundColor:{themeKey:"palette",transform:Sg},p:{style:vr},pt:{style:vr},pr:{style:vr},pb:{style:vr},pl:{style:vr},px:{style:vr},py:{style:vr},padding:{style:vr},paddingTop:{style:vr},paddingRight:{style:vr},paddingBottom:{style:vr},paddingLeft:{style:vr},paddingX:{style:vr},paddingY:{style:vr},paddingInline:{style:vr},paddingInlineStart:{style:vr},paddingInlineEnd:{style:vr},paddingBlock:{style:vr},paddingBlockStart:{style:vr},paddingBlockEnd:{style:vr},m:{style:gr},mt:{style:gr},mr:{style:gr},mb:{style:gr},ml:{style:gr},mx:{style:gr},my:{style:gr},margin:{style:gr},marginTop:{style:gr},marginRight:{style:gr},marginBottom:{style:gr},marginLeft:{style:gr},marginX:{style:gr},marginY:{style:gr},marginInline:{style:gr},marginInlineStart:{style:gr},marginInlineEnd:{style:gr},marginBlock:{style:gr},marginBlockStart:{style:gr},marginBlockEnd:{style:gr},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:vM},rowGap:{style:xM},columnGap:{style:yM},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:ua},maxWidth:{style:qj},minWidth:{transform:ua},height:{transform:ua},maxHeight:{transform:ua},minHeight:{transform:ua},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function Wwe(...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 Vwe(t,e){return typeof t=="function"?t(e):t}function zne(){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=Xg(i,c)||{};return f?f(a):Wo(a,r,p=>{let m=ST(d,u,p);return p===m&&typeof p=="string"&&(m=ST(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:T1;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=Fne(o.breakpoints),f=Object.keys(u);let d=u;return Object.keys(c).forEach(h=>{const p=Vwe(c[h],o);if(p!=null)if(typeof p=="object")if(a[h])d=Lx(d,t(h,p,o,a));else{const m=Wo({theme:o},p,g=>({[h]:g}));Wwe(m,p)?d[h]=e({sx:p,theme:o}):d=Lx(d,m)}else d=Lx(d,t(h,p,o,a))}),jne(f,d)}return Array.isArray(i)?i.map(s):s(i)}return e}const Yv=zne();Yv.filterProps=["sx"];function Une(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 Gwe=["breakpoints","palette","spacing","shape"];function E1(t={},...e){const{breakpoints:n={},palette:r={},spacing:i,shape:o={}}=t,a=Ae(t,Gwe),s=$ne(n),l=dwe(i);let c=Ii({breakpoints:s,direction:"ltr",components:{},palette:j({mode:"light"},r),spacing:l,shape:j({},nwe,o)},a);return c.applyStyles=Une,c=e.reduce((u,f)=>Ii(u,f),c),c.unstable_sxConfig=j({},T1,a==null?void 0:a.unstable_sxConfig),c.unstable_sx=function(f){return Yv({sx:f,theme:this})},c}const Hwe=Object.freeze(Object.defineProperty({__proto__:null,default:E1,private_createBreakpoints:$ne,unstable_applyStyles:Une},Symbol.toStringTag,{value:"Module"}));function qwe(t){return Object.keys(t).length===0}function Xj(t=null){const e=M.useContext(O1);return!e||qwe(e)?t:e}const Xwe=E1();function hd(t=Xwe){return Xj(t)}function Qwe({styles:t,themeId:e,defaultTheme:n={}}){const r=hd(n),i=typeof t=="function"?t(e&&r[e]||r):t;return w.jsx(Dne,{styles:i})}const Ywe=["sx"],Kwe=t=>{var e,n;const r={systemProps:{},otherProps:{}},i=(e=t==null||(n=t.theme)==null?void 0:n.unstable_sxConfig)!=null?e:T1;return Object.keys(t).forEach(o=>{i[o]?r.systemProps[o]=t[o]:r.otherProps[o]=t[o]}),r};function P1(t){const{sx:e}=t,n=Ae(t,Ywe),{systemProps:r,otherProps:i}=Kwe(n);let o;return Array.isArray(e)?o=[r,...e]:typeof e=="function"?o=(...a)=>{const s=e(...a);return Bc(s)?j({},r,s):r}:o=j({},r,e),j({},i,{sx:o})}const Zwe=Object.freeze(Object.defineProperty({__proto__:null,default:Yv,extendSxProp:P1,unstable_createStyleFunctionSx:zne,unstable_defaultSxConfig:T1},Symbol.toStringTag,{value:"Module"})),DV=t=>t,Jwe=()=>{let t=DV;return{configure(e){t=e},generate(e){return t(e)},reset(){t=DV}}},Qj=Jwe();function Wne(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"})(Yv);return M.forwardRef(function(l,c){const u=hd(n),f=P1(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 Vne={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=Vne[e];return r?`${n}-${r}`:`${Qj.generate(t)}-${e}`}function Ve(t,e,n="Mui"){const r={};return e.forEach(i=>{r[i]=We(t,i,n)}),r}var Gne={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 Kj=Symbol.for("react.element"),Zj=Symbol.for("react.portal"),bM=Symbol.for("react.fragment"),_M=Symbol.for("react.strict_mode"),wM=Symbol.for("react.profiler"),SM=Symbol.for("react.provider"),OM=Symbol.for("react.context"),rSe=Symbol.for("react.server_context"),CM=Symbol.for("react.forward_ref"),TM=Symbol.for("react.suspense"),EM=Symbol.for("react.suspense_list"),PM=Symbol.for("react.memo"),MM=Symbol.for("react.lazy"),iSe=Symbol.for("react.offscreen"),Xne;Xne=Symbol.for("react.module.reference");function xs(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case Kj:switch(t=t.type,t){case bM:case wM:case _M:case TM:case EM:return t;default:switch(t=t&&t.$$typeof,t){case rSe:case OM:case CM:case MM:case PM:case SM:return t;default:return e}}case Zj:return e}}}kn.ContextConsumer=OM;kn.ContextProvider=SM;kn.Element=Kj;kn.ForwardRef=CM;kn.Fragment=bM;kn.Lazy=MM;kn.Memo=PM;kn.Portal=Zj;kn.Profiler=wM;kn.StrictMode=_M;kn.Suspense=TM;kn.SuspenseList=EM;kn.isAsyncMode=function(){return!1};kn.isConcurrentMode=function(){return!1};kn.isContextConsumer=function(t){return xs(t)===OM};kn.isContextProvider=function(t){return xs(t)===SM};kn.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===Kj};kn.isForwardRef=function(t){return xs(t)===CM};kn.isFragment=function(t){return xs(t)===bM};kn.isLazy=function(t){return xs(t)===MM};kn.isMemo=function(t){return xs(t)===PM};kn.isPortal=function(t){return xs(t)===Zj};kn.isProfiler=function(t){return xs(t)===wM};kn.isStrictMode=function(t){return xs(t)===_M};kn.isSuspense=function(t){return xs(t)===TM};kn.isSuspenseList=function(t){return xs(t)===EM};kn.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===bM||t===wM||t===_M||t===TM||t===EM||t===iSe||typeof t=="object"&&t!==null&&(t.$$typeof===MM||t.$$typeof===PM||t.$$typeof===SM||t.$$typeof===OM||t.$$typeof===CM||t.$$typeof===Xne||t.getModuleId!==void 0)};kn.typeOf=xs;qne.exports=kn;var NV=qne.exports;const oSe=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function Qne(t){const e=`${t}`.match(oSe);return e&&e[1]||""}function Yne(t,e=""){return t.displayName||t.name||Qne(t)||e}function $V(t,e,n){const r=Yne(e);return t.displayName||(r!==""?`${n}(${r})`:n)}function aSe(t){if(t!=null){if(typeof t=="string")return t;if(typeof t=="function")return Yne(t,"Component");if(typeof t=="object")switch(t.$$typeof){case NV.ForwardRef:return $V(t,t.render,"ForwardRef");case NV.Memo:return $V(t,t.type,"memo");default:return}}}const sSe=Object.freeze(Object.defineProperty({__proto__:null,default:aSe,getFunctionName:Qne},Symbol.toStringTag,{value:"Module"})),lSe=["ownerState"],cSe=["variants"],uSe=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function fSe(t){return Object.keys(t).length===0}function dSe(t){return typeof t=="string"&&t.charCodeAt(0)>96}function wA(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const hSe=P1(),pSe=t=>t&&t.charAt(0).toLowerCase()+t.slice(1);function tS({defaultTheme:t,theme:e,themeId:n}){return fSe(e)?t:e[n]||e}function mSe(t){return t?(e,n)=>n[t]:null}function CC(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=>CC(o,j({ownerState:n},r)));if(i&&typeof i=="object"&&Array.isArray(i.variants)){const{variants:o=[]}=i;let s=Ae(i,cSe);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 gSe(t={}){const{themeId:e,defaultTheme:n=hSe,rootShouldForwardProp:r=wA,slotShouldForwardProp:i=wA}=t,o=a=>Yv(j({},a,{theme:tS(j({},a,{defaultTheme:n,themeId:e}))}));return o.__mui_systemSx=!0,(a,s={})=>{$ne(a,_=>_.filter(S=>!(S!=null&&S.__mui_systemSx)));const{name:l,slot:c,skipVariantsResolver:u,skipSx:f,overridesResolver:d=mSe(pSe(c))}=s,h=Ae(s,uSe),p=u!==void 0?u:c&&c!=="Root"&&c!=="root"||!1,m=f||!1;let g,v=wA;c==="Root"||c==="root"?v=r:c?v=i:dSe(a)&&(v=void 0);const y=Wj(a,j({shouldForwardProp:v,label:g},h)),x=_=>typeof _=="function"&&_.__emotion_real!==_||Bc(_)?S=>CC(_,j({},S,{theme:tS({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=tS(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]=CC(z,j({},I,{theme:P}))}),d(I,T)}),l&&!p&&C.push(I=>{var P;const R=tS(j({},I,{defaultTheme:n,themeId:e})),T=R==null||(P=R.components)==null||(P=P[l])==null?void 0:P.variants;return CC({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=gSe();function kM(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]=kM(i[a],o[a])}))}else n[r]===void 0&&(n[r]=t[r])}),n}function Kne(t){const{theme:e,name:n,props:r}=t;return!e||!e.components||!e.components[n]||!e.components[n].defaultProps?r:kM(e.components[n].defaultProps,r)}function Zne({props:t,name:e,defaultTheme:n,themeId:r}){let i=hd(n);return r&&(i=i[r]||i),Kne({theme:i,name:e,props:t})}const Hr=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 Hr(()=>{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 Jne=M.useSyncExternalStore;function ySe(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 Jne(l,s,a)}function xSe(t,e={}){const n=Qj(),r=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:i=!1,matchMedia:o=r?window.matchMedia:null,ssrMatchMedia:a=null,noSsr:s=!1}=Kne({name:"MuiUseMediaQuery",props:e,theme:n});let l=typeof t=="function"?t(n):t;return l=l.replace(/^@media( ?)/m,""),(Jne!==void 0?ySe:vSe)(l,i,o,a,s)}function ah(t,e=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(t,n))}const bSe=Object.freeze(Object.defineProperty({__proto__:null,default:ah},Symbol.toStringTag,{value:"Module"}));function Jj(t,e=0,n=1){return ah(t,e,n)}function _Se(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 AM(t){if(t.type)return t;if(t.charAt(0)==="#")return AM(_Se(t));const e=t.indexOf("("),n=t.substring(0,e);if(["rgb","rgba","hsl","hsla","color"].indexOf(n)===-1)throw new Error(fu(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(fu(10,i))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:i}}function e5(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 Hc(t,e){return t=AM(t),e=Jj(e),(t.type==="rgb"||t.type==="hsl")&&(t.type+="a"),t.type==="color"?t.values[3]=`/${e}`:t.values[3]=e,e5(t)}function ere(t,e){if(t=AM(t),e=Jj(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 e5(t)}function tre(t,e){if(t=AM(t),e=Jj(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 e5(t)}function OT(...t){return t.reduce((e,n)=>n==null?e:function(...i){e.apply(this,i),n.apply(this,i)},()=>{})}function Kv(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 wSe(t,e){return()=>null}function $x(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 cs(t){return $n(t).defaultView||window}function SSe(t,e){return()=>null}function CT(t,e){typeof t=="function"?t(e):t&&(t.current=e)}let FV=0;function OSe(t){const[e,n]=M.useState(t),r=t||e;return M.useEffect(()=>{e==null&&(FV+=1,n(`mui-${FV}`))},[e]),r}const jV=zD.useId;function pd(t){if(jV!==void 0){const e=jV();return t??e}return OSe(t)}function CSe(t,e,n,r,i){return null}function Qs({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 _r(t){const e=M.useRef(t);return Hr(()=>{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=>{CT(n,e)})},t)}const BV={};function TSe(t,e){const n=M.useRef(BV);return n.current===BV&&(n.current=t(e)),n}const ESe=[];function PSe(t){M.useEffect(t,ESe)}class k1{constructor(){this.currentId=null,this.clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)},this.disposeEffect=()=>this.clear}static create(){return new k1}start(e,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},e)}}function bf(){const t=TSe(k1.create).current;return PSe(t.disposeEffect),t}let RM=!0,DL=!1;const MSe=new k1,kSe={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 ASe(t){const{type:e,tagName:n}=t;return!!(n==="INPUT"&&kSe[e]&&!t.readOnly||n==="TEXTAREA"&&!t.readOnly||t.isContentEditable)}function RSe(t){t.metaKey||t.altKey||t.ctrlKey||(RM=!0)}function SA(){RM=!1}function ISe(){this.visibilityState==="hidden"&&DL&&(RM=!0)}function DSe(t){t.addEventListener("keydown",RSe,!0),t.addEventListener("mousedown",SA,!0),t.addEventListener("pointerdown",SA,!0),t.addEventListener("touchstart",SA,!0),t.addEventListener("visibilitychange",ISe,!0)}function LSe(t){const{target:e}=t;try{return e.matches(":focus-visible")}catch{}return RM||ASe(e)}function A1(){const t=M.useCallback(i=>{i!=null&&DSe(i.ownerDocument)},[]),e=M.useRef(!1);function n(){return e.current?(DL=!0,MSe.start(100,()=>{DL=!1}),e.current=!1,!0):!1}function r(i){return LSe(i)?(e.current=!0,!0):!1}return{isFocusVisibleRef:e,onFocus:r,onBlur:n,ref:t}}function nre(t){const e=t.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}let Zp;function rre(){if(Zp)return Zp;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),Zp="reverse",t.scrollLeft>0?Zp="default":(t.scrollLeft=1,t.scrollLeft===0&&(Zp="negative")),document.body.removeChild(t),Zp}function NSe(t,e){const n=t.scrollLeft;if(e!=="rtl")return n;switch(rre()){case"negative":return t.scrollWidth-t.clientWidth+n;case"reverse":return t.scrollWidth-t.clientWidth-n;default:return n}}function $Se(t){return M.Children.toArray(t).filter(e=>M.isValidElement(e))}const FSe={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};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 ire=M.createContext(null);function t5(){return M.useContext(ire)}const jSe=typeof Symbol=="function"&&Symbol.for,ore=jSe?Symbol.for("mui.nested"):"__THEME_NESTED__";function BSe(t,e){return typeof e=="function"?e(t):j({},t,e)}function zSe(t){const{children:e,theme:n}=t,r=t5(),i=M.useMemo(()=>{const o=r===null?n:BSe(r,n);return o!=null&&(o[ore]=r!==null),o},[n,r]);return w.jsx(ire.Provider,{value:i,children:e})}const USe=["value"],are=M.createContext();function WSe(t){let{value:e}=t,n=Ae(t,USe);return w.jsx(are.Provider,j({value:e??!0},n))}const R1=()=>{const t=M.useContext(are);return t??!1},VSe=M.createContext(void 0);function GSe({value:t,children:e}){return w.jsx(VSe.Provider,{value:t,children:e})}const zV={};function UV(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 HSe(t){const{children:e,theme:n,themeId:r}=t,i=Qj(zV),o=t5()||zV,a=UV(r,i,n),s=UV(r,o,n,!0),l=a.direction==="rtl";return w.jsx(zSe,{theme:s,children:w.jsx(C1.Provider,{value:a,children:w.jsx(WSe,{value:l,children:w.jsx(GSe,{value:a==null?void 0:a.components,children:e})})})})}const qSe=["component","direction","spacing","divider","children","className","useFlexGap"],XSe=P1(),QSe=Li("div",{name:"MuiStack",slot:"Root",overridesResolver:(t,e)=>e.root});function YSe(t){return Zne({props:t,name:"MuiStack",defaultTheme:XSe})}function KSe(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],JSe=({ownerState:t,theme:e})=>{let n=j({display:"flex",flexDirection:"column"},Wo({theme:e},Lh({values:t.direction,breakpoints:e.breakpoints.values}),r=>({flexDirection:r})));if(t.spacing){const r=qj(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=Lh({values:t.direction,base:i}),a=Lh({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,Wo({theme:e},a,(l,c)=>t.useFlexGap?{gap:Zh(r,l)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${ZSe(c?o[c]:t.direction)}`]:Zh(r,l)}}))}return n=iwe(e.breakpoints,n),n};function eOe(t={}){const{createStyledComponent:e=QSe,useThemeProps:n=YSe,componentName:r="MuiStack"}=t,i=()=>Ue({root:["root"]},l=>We(r,l),{}),o=e(JSe);return M.forwardRef(function(l,c){const u=n(l),f=M1(u),{component:d="div",direction:h="column",spacing:p=0,divider:m,children:g,className:v,useFlexGap:y=!1}=f,x=Ae(f,qSe),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?KSe(g,m):g}))})}function tOe(t,e){return j({toolbar:{minHeight:56,[t.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[t.up("sm")]:{minHeight:64}}},e)}var Rr={},sre={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})(sre);var ft=sre.exports;const nOe=Ea(t1e),rOe=Ea(bSe);var lre=ft;Object.defineProperty(Rr,"__esModule",{value:!0});var kt=Rr.alpha=dre;Rr.blend=mOe;Rr.colorChannel=void 0;var Ab=Rr.darken=r5;Rr.decomposeColor=us;var iOe=Rr.emphasize=hre,oOe=Rr.getContrastRatio=uOe;Rr.getLuminance=TT;Rr.hexToRgb=cre;Rr.hslToRgb=fre;var Rb=Rr.lighten=i5;Rr.private_safeAlpha=fOe;Rr.private_safeColorChannel=void 0;Rr.private_safeDarken=dOe;Rr.private_safeEmphasize=pOe;Rr.private_safeLighten=hOe;Rr.recomposeColor=Zv;Rr.rgbToHex=cOe;var WV=lre(nOe),aOe=lre(rOe);function n5(t,e=0,n=1){return(0,aOe.default)(t,e,n)}function cre(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 sOe(t){const e=t.toString(16);return e.length===1?`0${e}`:e}function us(t){if(t.type)return t;if(t.charAt(0)==="#")return us(cre(t));const e=t.indexOf("("),n=t.substring(0,e);if(["rgb","rgba","hsl","hsla","color"].indexOf(n)===-1)throw new Error((0,WV.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,WV.default)(10,i))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:i}}const ure=t=>{const e=us(t);return e.values.slice(0,3).map((n,r)=>e.type.indexOf("hsl")!==-1&&r!==0?`${n}%`:n).join(" ")};Rr.colorChannel=ure;const lOe=(t,e)=>{try{return ure(t)}catch{return t}};Rr.private_safeColorChannel=lOe;function Zv(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 cOe(t){if(t.indexOf("#")===0)return t;const{values:e}=us(t);return`#${e.map((n,r)=>sOe(r===3?Math.round(255*n):n)).join("")}`}function fre(t){t=us(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])),Zv({type:s,values:l})}function TT(t){t=us(t);let e=t.type==="hsl"||t.type==="hsla"?us(fre(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 uOe(t,e){const n=TT(t),r=TT(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function dre(t,e){return t=us(t),e=n5(e),(t.type==="rgb"||t.type==="hsl")&&(t.type+="a"),t.type==="color"?t.values[3]=`/${e}`:t.values[3]=e,Zv(t)}function fOe(t,e,n){try{return dre(t,e)}catch{return t}}function r5(t,e){if(t=us(t),e=n5(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 Zv(t)}function dOe(t,e,n){try{return r5(t,e)}catch{return t}}function i5(t,e){if(t=us(t),e=n5(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 Zv(t)}function hOe(t,e,n){try{return i5(t,e)}catch{return t}}function hre(t,e=.15){return TT(t)>.5?r5(t,e):i5(t,e)}function pOe(t,e,n){try{return hre(t,e)}catch{return t}}function mOe(t,e,n,r=1){const i=(l,c)=>Math.round((l**(1/r)*(1-n)+c**(1/r)*n)**r),o=us(t),a=us(e),s=[i(o.values[0],a.values[0]),i(o.values[1],a.values[1]),i(o.values[2],a.values[2])];return Zv({type:"rgb",values:s})}const gOe=["mode","contrastThreshold","tonalOffset"],VV={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:Eb.white,default:Eb.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}},OA={text:{primary:Eb.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:Eb.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 GV(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=Rb(t.main,i):e==="dark"&&(t.dark=Ab(t.main,o)))}function vOe(t="light"){return t==="dark"?{main:rf[200],light:rf[50],dark:rf[400]}:{main:rf[700],light:rf[400],dark:rf[800]}}function yOe(t="light"){return t==="dark"?{main:nf[200],light:nf[50],dark:nf[400]}:{main:nf[500],light:nf[300],dark:nf[700]}}function xOe(t="light"){return t==="dark"?{main:tf[500],light:tf[300],dark:tf[700]}:{main:tf[700],light:tf[400],dark:tf[800]}}function bOe(t="light"){return t==="dark"?{main:of[400],light:of[300],dark:of[700]}:{main:of[700],light:of[500],dark:of[900]}}function _Oe(t="light"){return t==="dark"?{main:Lc[400],light:Lc[300],dark:Lc[700]}:{main:Lc[800],light:Lc[500],dark:Lc[900]}}function wOe(t="light"){return t==="dark"?{main:oh[400],light:oh[300],dark:oh[700]}:{main:"#ed6c02",light:oh[500],dark:oh[900]}}function SOe(t){const{mode:e="light",contrastThreshold:n=3,tonalOffset:r=.2}=t,i=Ae(t,gOe),o=t.primary||vOe(e),a=t.secondary||yOe(e),s=t.error||xOe(e),l=t.info||bOe(e),c=t.success||_Oe(e),u=t.warning||wOe(e);function f(m){return oOe(m,OA.text.primary)>=n?OA.text.primary:VV.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(fu(11,g?` (${g})`:"",v));if(typeof m.main!="string")throw new Error(fu(12,g?` (${g})`:"",JSON.stringify(m.main)));return GV(m,"light",y,r),GV(m,"dark",x,r),m.contrastText||(m.contrastText=f(m.main)),m},h={dark:OA,light:VV};return Ii(j({common:j({},Eb),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:xne,contrastThreshold:n,getContrastText:f,augmentColor:d,tonalOffset:r},h[e]),i)}const OOe=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function COe(t){return Math.round(t*1e5)/1e5}const HV={textTransform:"uppercase"},qV='"Roboto", "Helvetica", "Arial", sans-serif';function TOe(t,e){const n=typeof e=="function"?e(t):e,{fontFamily:r=qV,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,OOe),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===qV?{letterSpacing:`${COe(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,HV),caption:m(a,12,1.66,.4),overline:m(a,12,2.66,1,HV),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 EOe=.2,POe=.14,MOe=.12;function or(...t){return[`${t[0]}px ${t[1]}px ${t[2]}px ${t[3]}px rgba(0,0,0,${EOe})`,`${t[4]}px ${t[5]}px ${t[6]}px ${t[7]}px rgba(0,0,0,${POe})`,`${t[8]}px ${t[9]}px ${t[10]}px ${t[11]}px rgba(0,0,0,${MOe})`].join(",")}const kOe=["none",or(0,2,1,-1,0,1,1,0,0,1,3,0),or(0,3,1,-2,0,2,2,0,0,1,5,0),or(0,3,3,-2,0,3,4,0,0,1,8,0),or(0,2,4,-1,0,4,5,0,0,1,10,0),or(0,3,5,-1,0,5,8,0,0,1,14,0),or(0,3,5,-1,0,6,10,0,0,1,18,0),or(0,4,5,-2,0,7,10,1,0,2,16,1),or(0,5,5,-3,0,8,10,1,0,3,14,2),or(0,5,6,-3,0,9,12,1,0,3,16,2),or(0,6,6,-3,0,10,14,1,0,4,18,3),or(0,6,7,-4,0,11,15,1,0,4,20,3),or(0,7,8,-4,0,12,17,2,0,5,22,4),or(0,7,8,-4,0,13,19,2,0,5,24,4),or(0,7,9,-4,0,14,21,2,0,5,26,4),or(0,8,9,-5,0,15,22,2,0,6,28,5),or(0,8,10,-5,0,16,24,2,0,6,30,5),or(0,8,11,-5,0,17,26,2,0,6,32,5),or(0,9,11,-5,0,18,28,2,0,7,34,6),or(0,9,12,-6,0,19,29,2,0,7,36,6),or(0,10,13,-6,0,20,31,3,0,8,38,7),or(0,10,13,-6,0,21,33,3,0,8,40,7),or(0,10,14,-6,0,22,35,3,0,8,42,7),or(0,11,14,-7,0,23,36,3,0,9,44,8),or(0,11,15,-7,0,24,38,3,0,9,46,8)],AOe=["duration","easing","delay"],ROe={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)"},pre={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function XV(t){return`${Math.round(t)}ms`}function IOe(t){if(!t)return 0;const e=t/36;return Math.round((4+15*e**.25+e/5)*10)}function DOe(t){const e=j({},ROe,t.easing),n=j({},pre,t.duration);return j({getAutoHeightDuration:IOe,create:(i=["all"],o={})=>{const{duration:a=n.standard,easing:s=e.easeInOut,delay:l=0}=o;return Ae(o,AOe),(Array.isArray(i)?i:[i]).map(c=>`${c} ${typeof a=="string"?a:XV(a)} ${s} ${typeof l=="string"?l:XV(l)}`).join(",")}},t,{easing:e,duration:n})}const LOe={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},NOe=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function o5(t={},...e){const{mixins:n={},palette:r={},transitions:i={},typography:o={}}=t,a=Ae(t,NOe);if(t.vars)throw new Error(fu(18));const s=SOe(r),l=P1(t);let c=Ii(l,{mixins:tOe(l.breakpoints,n),palette:s,shadows:kOe.slice(),typography:TOe(s,o),transitions:DOe(i),zIndex:j({},LOe)});return c=Ii(c,a),c=e.reduce((u,f)=>Ii(u,f),c),c.unstable_sxConfig=j({},E1,a==null?void 0:a.unstable_sxConfig),c.unstable_sx=function(f){return Yv({sx:f,theme:this})},c}const IM=o5();function Go(){const t=hd(IM);return t[Kh]||t}function qe({props:t,name:e}){return Zne({props:t,name:e,defaultTheme:IM,themeId:Kh})}var I1={};const $Oe=Ea(Hbe),FOe=Ea(qbe),mre=Ea(J1e),jOe=Ea(ewe),BOe=Ea(awe),zOe=Ea(sSe),UOe=Ea(qwe),WOe=Ea(Jwe);var Jv=ft;Object.defineProperty(I1,"__esModule",{value:!0});var VOe=I1.default=rCe;I1.shouldForwardProp=TC;I1.systemDefaultTheme=void 0;var $a=Jv($Oe),LL=Jv(FOe),QV=KOe(mre),GOe=jOe;Jv(BOe);Jv(zOe);var HOe=Jv(UOe),qOe=Jv(WOe);const XOe=["ownerState"],QOe=["variants"],YOe=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function gre(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(gre=function(r){return r?n:e})(t)}function KOe(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=gre(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 ZOe(t){return Object.keys(t).length===0}function JOe(t){return typeof t=="string"&&t.charCodeAt(0)>96}function TC(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const eCe=I1.systemDefaultTheme=(0,HOe.default)(),tCe=t=>t&&t.charAt(0).toLowerCase()+t.slice(1);function nS({defaultTheme:t,theme:e,themeId:n}){return ZOe(e)?t:e[n]||e}function nCe(t){return t?(e,n)=>n[t]:null}function EC(t,e){let{ownerState:n}=e,r=(0,LL.default)(e,XOe);const i=typeof t=="function"?t((0,$a.default)({ownerState:n},r)):t;if(Array.isArray(i))return i.flatMap(o=>EC(o,(0,$a.default)({ownerState:n},r)));if(i&&typeof i=="object"&&Array.isArray(i.variants)){const{variants:o=[]}=i;let s=(0,LL.default)(i,QOe);return o.forEach(l=>{let c=!0;typeof l.props=="function"?c=l.props((0,$a.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,$a.default)({ownerState:n},r,n)):l.style))}),s}return i}function rCe(t={}){const{themeId:e,defaultTheme:n=eCe,rootShouldForwardProp:r=TC,slotShouldForwardProp:i=TC}=t,o=a=>(0,qOe.default)((0,$a.default)({},a,{theme:nS((0,$a.default)({},a,{defaultTheme:n,themeId:e}))}));return o.__mui_systemSx=!0,(a,s={})=>{(0,QV.internal_processStyles)(a,_=>_.filter(S=>!(S!=null&&S.__mui_systemSx)));const{name:l,slot:c,skipVariantsResolver:u,skipSx:f,overridesResolver:d=nCe(tCe(c))}=s,h=(0,LL.default)(s,YOe),p=u!==void 0?u:c&&c!=="Root"&&c!=="root"||!1,m=f||!1;let g,v=TC;c==="Root"||c==="root"?v=r:c?v=i:JOe(a)&&(v=void 0);const y=(0,QV.default)(a,(0,$a.default)({shouldForwardProp:v,label:g},h)),x=_=>typeof _=="function"&&_.__emotion_real!==_||(0,GOe.isPlainObject)(_)?S=>EC(_,(0,$a.default)({},S,{theme:nS({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=nS((0,$a.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]=EC(z,(0,$a.default)({},I,{theme:P}))}),d(I,T)}),l&&!p&&C.push(I=>{var P;const R=nS((0,$a.default)({},I,{defaultTheme:n,themeId:e})),T=R==null||(P=R.components)==null||(P=P[l])==null?void 0:P.variants;return EC({variants:T},(0,$a.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 DM(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const hi=t=>DM(t)&&t!=="classes",we=VOe({themeId:Kh,defaultTheme:IM,rootShouldForwardProp:hi}),iCe=["theme"];function oCe(t){let{theme:e}=t,n=Ae(t,iCe);const r=e[Kh];return w.jsx(HSe,j({},n,{themeId:r?Kh:void 0,theme:r||e}))}const YV=t=>{let e;return t<1?e=5.11916*t**2:e=4.5*Math.log(t+1)+2,(e/100).toFixed(2)};function aCe(t){return We("MuiSvgIcon",t)}Ve("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const sCe=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],lCe=t=>{const{color:e,fontSize:n,classes:r}=t,i={root:["root",e!=="inherit"&&`color${De(e)}`,`fontSize${De(n)}`]};return Ue(i,aCe,r)},cCe=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]}}),NL=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,sCe),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=lCe(m);return w.jsxs(cCe,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]}))});NL.muiName="SvgIcon";function ni(t,e){function n(r,i){return w.jsx(NL,j({"data-testid":`${e}Icon`,ref:i},r,{children:t}))}return n.muiName=NL.muiName,M.memo(M.forwardRef(n))}const uCe={configure:t=>{Yj.configure(t)}},fCe=Object.freeze(Object.defineProperty({__proto__:null,capitalize:De,createChainedFunction:OT,createSvgIcon:ni,debounce:Kv,deprecatedPropType:wSe,isMuiElement:$x,ownerDocument:$n,ownerWindow:cs,requirePropFactory:SSe,setRef:CT,unstable_ClassNameGenerator:uCe,unstable_useEnhancedEffect:Hr,unstable_useId:pd,unsupportedProp:CSe,useControlled:Qs,useEventCallback:_r,useForkRef:Zt,useIsFocusVisible:A1},Symbol.toStringTag,{value:"Module"}));var In={};/** + */var Yj=Symbol.for("react.element"),Kj=Symbol.for("react.portal"),bM=Symbol.for("react.fragment"),_M=Symbol.for("react.strict_mode"),wM=Symbol.for("react.profiler"),SM=Symbol.for("react.provider"),OM=Symbol.for("react.context"),nSe=Symbol.for("react.server_context"),CM=Symbol.for("react.forward_ref"),TM=Symbol.for("react.suspense"),EM=Symbol.for("react.suspense_list"),PM=Symbol.for("react.memo"),MM=Symbol.for("react.lazy"),rSe=Symbol.for("react.offscreen"),Hne;Hne=Symbol.for("react.module.reference");function xs(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case Yj:switch(t=t.type,t){case bM:case wM:case _M:case TM:case EM:return t;default:switch(t=t&&t.$$typeof,t){case nSe:case OM:case CM:case MM:case PM:case SM:return t;default:return e}}case Kj:return e}}}kn.ContextConsumer=OM;kn.ContextProvider=SM;kn.Element=Yj;kn.ForwardRef=CM;kn.Fragment=bM;kn.Lazy=MM;kn.Memo=PM;kn.Portal=Kj;kn.Profiler=wM;kn.StrictMode=_M;kn.Suspense=TM;kn.SuspenseList=EM;kn.isAsyncMode=function(){return!1};kn.isConcurrentMode=function(){return!1};kn.isContextConsumer=function(t){return xs(t)===OM};kn.isContextProvider=function(t){return xs(t)===SM};kn.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===Yj};kn.isForwardRef=function(t){return xs(t)===CM};kn.isFragment=function(t){return xs(t)===bM};kn.isLazy=function(t){return xs(t)===MM};kn.isMemo=function(t){return xs(t)===PM};kn.isPortal=function(t){return xs(t)===Kj};kn.isProfiler=function(t){return xs(t)===wM};kn.isStrictMode=function(t){return xs(t)===_M};kn.isSuspense=function(t){return xs(t)===TM};kn.isSuspenseList=function(t){return xs(t)===EM};kn.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===bM||t===wM||t===_M||t===TM||t===EM||t===rSe||typeof t=="object"&&t!==null&&(t.$$typeof===MM||t.$$typeof===PM||t.$$typeof===SM||t.$$typeof===OM||t.$$typeof===CM||t.$$typeof===Hne||t.getModuleId!==void 0)};kn.typeOf=xs;Gne.exports=kn;var LV=Gne.exports;const iSe=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function qne(t){const e=`${t}`.match(iSe);return e&&e[1]||""}function Xne(t,e=""){return t.displayName||t.name||qne(t)||e}function NV(t,e,n){const r=Xne(e);return t.displayName||(r!==""?`${n}(${r})`:n)}function oSe(t){if(t!=null){if(typeof t=="string")return t;if(typeof t=="function")return Xne(t,"Component");if(typeof t=="object")switch(t.$$typeof){case LV.ForwardRef:return NV(t,t.render,"ForwardRef");case LV.Memo:return NV(t,t.type,"memo");default:return}}}const aSe=Object.freeze(Object.defineProperty({__proto__:null,default:oSe,getFunctionName:qne},Symbol.toStringTag,{value:"Module"})),sSe=["ownerState"],lSe=["variants"],cSe=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function uSe(t){return Object.keys(t).length===0}function fSe(t){return typeof t=="string"&&t.charCodeAt(0)>96}function wA(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const dSe=E1(),hSe=t=>t&&t.charAt(0).toLowerCase()+t.slice(1);function tS({defaultTheme:t,theme:e,themeId:n}){return uSe(e)?t:e[n]||e}function pSe(t){return t?(e,n)=>n[t]:null}function CC(t,e){let{ownerState:n}=e,r=Ae(e,sSe);const i=typeof t=="function"?t(j({ownerState:n},r)):t;if(Array.isArray(i))return i.flatMap(o=>CC(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 mSe(t={}){const{themeId:e,defaultTheme:n=dSe,rootShouldForwardProp:r=wA,slotShouldForwardProp:i=wA}=t,o=a=>Yv(j({},a,{theme:tS(j({},a,{defaultTheme:n,themeId:e}))}));return o.__mui_systemSx=!0,(a,s={})=>{Lne(a,_=>_.filter(S=>!(S!=null&&S.__mui_systemSx)));const{name:l,slot:c,skipVariantsResolver:u,skipSx:f,overridesResolver:d=pSe(hSe(c))}=s,h=Ae(s,cSe),p=u!==void 0?u:c&&c!=="Root"&&c!=="root"||!1,m=f||!1;let g,v=wA;c==="Root"||c==="root"?v=r:c?v=i:fSe(a)&&(v=void 0);const y=Uj(a,j({shouldForwardProp:v,label:g},h)),x=_=>typeof _=="function"&&_.__emotion_real!==_||Bc(_)?S=>CC(_,j({},S,{theme:tS({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=tS(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]=CC(z,j({},I,{theme:P}))}),d(I,T)}),l&&!p&&C.push(I=>{var P;const R=tS(j({},I,{defaultTheme:n,themeId:e})),T=R==null||(P=R.components)==null||(P=P[l])==null?void 0:P.variants;return CC({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=mSe();function kM(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]=kM(i[a],o[a])}))}else n[r]===void 0&&(n[r]=t[r])}),n}function Qne(t){const{theme:e,name:n,props:r}=t;return!e||!e.components||!e.components[n]||!e.components[n].defaultProps?r:kM(e.components[n].defaultProps,r)}function Yne({props:t,name:e,defaultTheme:n,themeId:r}){let i=hd(n);return r&&(i=i[r]||i),Qne({theme:i,name:e,props:t})}const Hr=typeof window<"u"?M.useLayoutEffect:M.useEffect;function gSe(t,e,n,r,i){const[o,a]=M.useState(()=>i&&n?n(t).matches:r?r(t).matches:e);return Hr(()=>{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 Kne=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 Kne(l,s,a)}function ySe(t,e={}){const n=Xj(),r=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:i=!1,matchMedia:o=r?window.matchMedia:null,ssrMatchMedia:a=null,noSsr:s=!1}=Qne({name:"MuiUseMediaQuery",props:e,theme:n});let l=typeof t=="function"?t(n):t;return l=l.replace(/^@media( ?)/m,""),(Kne!==void 0?vSe:gSe)(l,i,o,a,s)}function ah(t,e=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(t,n))}const xSe=Object.freeze(Object.defineProperty({__proto__:null,default:ah},Symbol.toStringTag,{value:"Module"}));function Zj(t,e=0,n=1){return ah(t,e,n)}function bSe(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 AM(t){if(t.type)return t;if(t.charAt(0)==="#")return AM(bSe(t));const e=t.indexOf("("),n=t.substring(0,e);if(["rgb","rgba","hsl","hsla","color"].indexOf(n)===-1)throw new Error(fu(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(fu(10,i))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:i}}function Jj(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 Hc(t,e){return t=AM(t),e=Zj(e),(t.type==="rgb"||t.type==="hsl")&&(t.type+="a"),t.type==="color"?t.values[3]=`/${e}`:t.values[3]=e,Jj(t)}function Zne(t,e){if(t=AM(t),e=Zj(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 Jj(t)}function Jne(t,e){if(t=AM(t),e=Zj(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 Jj(t)}function OT(...t){return t.reduce((e,n)=>n==null?e:function(...i){e.apply(this,i),n.apply(this,i)},()=>{})}function Kv(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 _Se(t,e){return()=>null}function Nx(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 cs(t){return $n(t).defaultView||window}function wSe(t,e){return()=>null}function CT(t,e){typeof t=="function"?t(e):t&&(t.current=e)}let $V=0;function SSe(t){const[e,n]=M.useState(t),r=t||e;return M.useEffect(()=>{e==null&&($V+=1,n(`mui-${$V}`))},[e]),r}const FV=BD.useId;function pd(t){if(FV!==void 0){const e=FV();return t??e}return SSe(t)}function OSe(t,e,n,r,i){return null}function Qs({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 _r(t){const e=M.useRef(t);return Hr(()=>{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=>{CT(n,e)})},t)}const jV={};function CSe(t,e){const n=M.useRef(jV);return n.current===jV&&(n.current=t(e)),n}const TSe=[];function ESe(t){M.useEffect(t,TSe)}class M1{constructor(){this.currentId=null,this.clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)},this.disposeEffect=()=>this.clear}static create(){return new M1}start(e,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},e)}}function bf(){const t=CSe(M1.create).current;return ESe(t.disposeEffect),t}let RM=!0,IL=!1;const PSe=new M1,MSe={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 kSe(t){const{type:e,tagName:n}=t;return!!(n==="INPUT"&&MSe[e]&&!t.readOnly||n==="TEXTAREA"&&!t.readOnly||t.isContentEditable)}function ASe(t){t.metaKey||t.altKey||t.ctrlKey||(RM=!0)}function SA(){RM=!1}function RSe(){this.visibilityState==="hidden"&&IL&&(RM=!0)}function ISe(t){t.addEventListener("keydown",ASe,!0),t.addEventListener("mousedown",SA,!0),t.addEventListener("pointerdown",SA,!0),t.addEventListener("touchstart",SA,!0),t.addEventListener("visibilitychange",RSe,!0)}function DSe(t){const{target:e}=t;try{return e.matches(":focus-visible")}catch{}return RM||kSe(e)}function k1(){const t=M.useCallback(i=>{i!=null&&ISe(i.ownerDocument)},[]),e=M.useRef(!1);function n(){return e.current?(IL=!0,PSe.start(100,()=>{IL=!1}),e.current=!1,!0):!1}function r(i){return DSe(i)?(e.current=!0,!0):!1}return{isFocusVisibleRef:e,onFocus:r,onBlur:n,ref:t}}function ere(t){const e=t.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}let Zp;function tre(){if(Zp)return Zp;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),Zp="reverse",t.scrollLeft>0?Zp="default":(t.scrollLeft=1,t.scrollLeft===0&&(Zp="negative")),document.body.removeChild(t),Zp}function LSe(t,e){const n=t.scrollLeft;if(e!=="rtl")return n;switch(tre()){case"negative":return t.scrollWidth-t.clientWidth+n;case"reverse":return t.scrollWidth-t.clientWidth-n;default:return n}}function NSe(t){return M.Children.toArray(t).filter(e=>M.isValidElement(e))}const $Se={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};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 nre=M.createContext(null);function e5(){return M.useContext(nre)}const FSe=typeof Symbol=="function"&&Symbol.for,rre=FSe?Symbol.for("mui.nested"):"__THEME_NESTED__";function jSe(t,e){return typeof e=="function"?e(t):j({},t,e)}function BSe(t){const{children:e,theme:n}=t,r=e5(),i=M.useMemo(()=>{const o=r===null?n:jSe(r,n);return o!=null&&(o[rre]=r!==null),o},[n,r]);return w.jsx(nre.Provider,{value:i,children:e})}const zSe=["value"],ire=M.createContext();function USe(t){let{value:e}=t,n=Ae(t,zSe);return w.jsx(ire.Provider,j({value:e??!0},n))}const A1=()=>{const t=M.useContext(ire);return t??!1},WSe=M.createContext(void 0);function VSe({value:t,children:e}){return w.jsx(WSe.Provider,{value:t,children:e})}const BV={};function zV(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 GSe(t){const{children:e,theme:n,themeId:r}=t,i=Xj(BV),o=e5()||BV,a=zV(r,i,n),s=zV(r,o,n,!0),l=a.direction==="rtl";return w.jsx(BSe,{theme:s,children:w.jsx(O1.Provider,{value:a,children:w.jsx(USe,{value:l,children:w.jsx(VSe,{value:a==null?void 0:a.components,children:e})})})})}const HSe=["component","direction","spacing","divider","children","className","useFlexGap"],qSe=E1(),XSe=Li("div",{name:"MuiStack",slot:"Root",overridesResolver:(t,e)=>e.root});function QSe(t){return Yne({props:t,name:"MuiStack",defaultTheme:qSe})}function YSe(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],ZSe=({ownerState:t,theme:e})=>{let n=j({display:"flex",flexDirection:"column"},Wo({theme:e},Lh({values:t.direction,breakpoints:e.breakpoints.values}),r=>({flexDirection:r})));if(t.spacing){const r=Hj(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=Lh({values:t.direction,base:i}),a=Lh({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,Wo({theme:e},a,(l,c)=>t.useFlexGap?{gap:Zh(r,l)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${KSe(c?o[c]:t.direction)}`]:Zh(r,l)}}))}return n=rwe(e.breakpoints,n),n};function JSe(t={}){const{createStyledComponent:e=XSe,useThemeProps:n=QSe,componentName:r="MuiStack"}=t,i=()=>Ue({root:["root"]},l=>We(r,l),{}),o=e(ZSe);return M.forwardRef(function(l,c){const u=n(l),f=P1(u),{component:d="div",direction:h="column",spacing:p=0,divider:m,children:g,className:v,useFlexGap:y=!1}=f,x=Ae(f,HSe),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?YSe(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 Rr={},ore={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})(ore);var ft=ore.exports;const tOe=Ea(e1e),nOe=Ea(xSe);var are=ft;Object.defineProperty(Rr,"__esModule",{value:!0});var kt=Rr.alpha=ure;Rr.blend=pOe;Rr.colorChannel=void 0;var kb=Rr.darken=n5;Rr.decomposeColor=us;var rOe=Rr.emphasize=fre,iOe=Rr.getContrastRatio=cOe;Rr.getLuminance=TT;Rr.hexToRgb=sre;Rr.hslToRgb=cre;var Ab=Rr.lighten=r5;Rr.private_safeAlpha=uOe;Rr.private_safeColorChannel=void 0;Rr.private_safeDarken=fOe;Rr.private_safeEmphasize=hOe;Rr.private_safeLighten=dOe;Rr.recomposeColor=Zv;Rr.rgbToHex=lOe;var UV=are(tOe),oOe=are(nOe);function t5(t,e=0,n=1){return(0,oOe.default)(t,e,n)}function sre(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 aOe(t){const e=t.toString(16);return e.length===1?`0${e}`:e}function us(t){if(t.type)return t;if(t.charAt(0)==="#")return us(sre(t));const e=t.indexOf("("),n=t.substring(0,e);if(["rgb","rgba","hsl","hsla","color"].indexOf(n)===-1)throw new Error((0,UV.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,UV.default)(10,i))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:i}}const lre=t=>{const e=us(t);return e.values.slice(0,3).map((n,r)=>e.type.indexOf("hsl")!==-1&&r!==0?`${n}%`:n).join(" ")};Rr.colorChannel=lre;const sOe=(t,e)=>{try{return lre(t)}catch{return t}};Rr.private_safeColorChannel=sOe;function Zv(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}=us(t);return`#${e.map((n,r)=>aOe(r===3?Math.round(255*n):n)).join("")}`}function cre(t){t=us(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])),Zv({type:s,values:l})}function TT(t){t=us(t);let e=t.type==="hsl"||t.type==="hsla"?us(cre(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 cOe(t,e){const n=TT(t),r=TT(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function ure(t,e){return t=us(t),e=t5(e),(t.type==="rgb"||t.type==="hsl")&&(t.type+="a"),t.type==="color"?t.values[3]=`/${e}`:t.values[3]=e,Zv(t)}function uOe(t,e,n){try{return ure(t,e)}catch{return t}}function n5(t,e){if(t=us(t),e=t5(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 Zv(t)}function fOe(t,e,n){try{return n5(t,e)}catch{return t}}function r5(t,e){if(t=us(t),e=t5(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 Zv(t)}function dOe(t,e,n){try{return r5(t,e)}catch{return t}}function fre(t,e=.15){return TT(t)>.5?n5(t,e):r5(t,e)}function hOe(t,e,n){try{return fre(t,e)}catch{return t}}function pOe(t,e,n,r=1){const i=(l,c)=>Math.round((l**(1/r)*(1-n)+c**(1/r)*n)**r),o=us(t),a=us(e),s=[i(o.values[0],a.values[0]),i(o.values[1],a.values[1]),i(o.values[2],a.values[2])];return Zv({type:"rgb",values:s})}const mOe=["mode","contrastThreshold","tonalOffset"],WV={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:Tb.white,default:Tb.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}},OA={text:{primary:Tb.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:Tb.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 VV(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=Ab(t.main,i):e==="dark"&&(t.dark=kb(t.main,o)))}function gOe(t="light"){return t==="dark"?{main:rf[200],light:rf[50],dark:rf[400]}:{main:rf[700],light:rf[400],dark:rf[800]}}function vOe(t="light"){return t==="dark"?{main:nf[200],light:nf[50],dark:nf[400]}:{main:nf[500],light:nf[300],dark:nf[700]}}function yOe(t="light"){return t==="dark"?{main:tf[500],light:tf[300],dark:tf[700]}:{main:tf[700],light:tf[400],dark:tf[800]}}function xOe(t="light"){return t==="dark"?{main:of[400],light:of[300],dark:of[700]}:{main:of[700],light:of[500],dark:of[900]}}function bOe(t="light"){return t==="dark"?{main:Lc[400],light:Lc[300],dark:Lc[700]}:{main:Lc[800],light:Lc[500],dark:Lc[900]}}function _Oe(t="light"){return t==="dark"?{main:oh[400],light:oh[300],dark:oh[700]}:{main:"#ed6c02",light:oh[500],dark:oh[900]}}function wOe(t){const{mode:e="light",contrastThreshold:n=3,tonalOffset:r=.2}=t,i=Ae(t,mOe),o=t.primary||gOe(e),a=t.secondary||vOe(e),s=t.error||yOe(e),l=t.info||xOe(e),c=t.success||bOe(e),u=t.warning||_Oe(e);function f(m){return iOe(m,OA.text.primary)>=n?OA.text.primary:WV.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(fu(11,g?` (${g})`:"",v));if(typeof m.main!="string")throw new Error(fu(12,g?` (${g})`:"",JSON.stringify(m.main)));return VV(m,"light",y,r),VV(m,"dark",x,r),m.contrastText||(m.contrastText=f(m.main)),m},h={dark:OA,light:WV};return Ii(j({common:j({},Tb),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:vne,contrastThreshold:n,getContrastText:f,augmentColor:d,tonalOffset:r},h[e]),i)}const SOe=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function OOe(t){return Math.round(t*1e5)/1e5}const GV={textTransform:"uppercase"},HV='"Roboto", "Helvetica", "Arial", sans-serif';function COe(t,e){const n=typeof e=="function"?e(t):e,{fontFamily:r=HV,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,SOe),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===HV?{letterSpacing:`${OOe(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,GV),caption:m(a,12,1.66,.4),overline:m(a,12,2.66,1,GV),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 TOe=.2,EOe=.14,POe=.12;function or(...t){return[`${t[0]}px ${t[1]}px ${t[2]}px ${t[3]}px rgba(0,0,0,${TOe})`,`${t[4]}px ${t[5]}px ${t[6]}px ${t[7]}px rgba(0,0,0,${EOe})`,`${t[8]}px ${t[9]}px ${t[10]}px ${t[11]}px rgba(0,0,0,${POe})`].join(",")}const MOe=["none",or(0,2,1,-1,0,1,1,0,0,1,3,0),or(0,3,1,-2,0,2,2,0,0,1,5,0),or(0,3,3,-2,0,3,4,0,0,1,8,0),or(0,2,4,-1,0,4,5,0,0,1,10,0),or(0,3,5,-1,0,5,8,0,0,1,14,0),or(0,3,5,-1,0,6,10,0,0,1,18,0),or(0,4,5,-2,0,7,10,1,0,2,16,1),or(0,5,5,-3,0,8,10,1,0,3,14,2),or(0,5,6,-3,0,9,12,1,0,3,16,2),or(0,6,6,-3,0,10,14,1,0,4,18,3),or(0,6,7,-4,0,11,15,1,0,4,20,3),or(0,7,8,-4,0,12,17,2,0,5,22,4),or(0,7,8,-4,0,13,19,2,0,5,24,4),or(0,7,9,-4,0,14,21,2,0,5,26,4),or(0,8,9,-5,0,15,22,2,0,6,28,5),or(0,8,10,-5,0,16,24,2,0,6,30,5),or(0,8,11,-5,0,17,26,2,0,6,32,5),or(0,9,11,-5,0,18,28,2,0,7,34,6),or(0,9,12,-6,0,19,29,2,0,7,36,6),or(0,10,13,-6,0,20,31,3,0,8,38,7),or(0,10,13,-6,0,21,33,3,0,8,40,7),or(0,10,14,-6,0,22,35,3,0,8,42,7),or(0,11,14,-7,0,23,36,3,0,9,44,8),or(0,11,15,-7,0,24,38,3,0,9,46,8)],kOe=["duration","easing","delay"],AOe={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)"},dre={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function qV(t){return`${Math.round(t)}ms`}function ROe(t){if(!t)return 0;const e=t/36;return Math.round((4+15*e**.25+e/5)*10)}function IOe(t){const e=j({},AOe,t.easing),n=j({},dre,t.duration);return j({getAutoHeightDuration:ROe,create:(i=["all"],o={})=>{const{duration:a=n.standard,easing:s=e.easeInOut,delay:l=0}=o;return Ae(o,kOe),(Array.isArray(i)?i:[i]).map(c=>`${c} ${typeof a=="string"?a:qV(a)} ${s} ${typeof l=="string"?l:qV(l)}`).join(",")}},t,{easing:e,duration:n})}const DOe={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},LOe=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function i5(t={},...e){const{mixins:n={},palette:r={},transitions:i={},typography:o={}}=t,a=Ae(t,LOe);if(t.vars)throw new Error(fu(18));const s=wOe(r),l=E1(t);let c=Ii(l,{mixins:eOe(l.breakpoints,n),palette:s,shadows:MOe.slice(),typography:COe(s,o),transitions:IOe(i),zIndex:j({},DOe)});return c=Ii(c,a),c=e.reduce((u,f)=>Ii(u,f),c),c.unstable_sxConfig=j({},T1,a==null?void 0:a.unstable_sxConfig),c.unstable_sx=function(f){return Yv({sx:f,theme:this})},c}const IM=i5();function Go(){const t=hd(IM);return t[Kh]||t}function qe({props:t,name:e}){return Yne({props:t,name:e,defaultTheme:IM,themeId:Kh})}var R1={};const NOe=Ea(Gbe),$Oe=Ea(Hbe),hre=Ea(Z1e),FOe=Ea(J1e),jOe=Ea(owe),BOe=Ea(aSe),zOe=Ea(Hwe),UOe=Ea(Zwe);var Jv=ft;Object.defineProperty(R1,"__esModule",{value:!0});var WOe=R1.default=nCe;R1.shouldForwardProp=TC;R1.systemDefaultTheme=void 0;var $a=Jv(NOe),DL=Jv($Oe),XV=YOe(hre),VOe=FOe;Jv(jOe);Jv(BOe);var GOe=Jv(zOe),HOe=Jv(UOe);const qOe=["ownerState"],XOe=["variants"],QOe=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function pre(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(pre=function(r){return r?n:e})(t)}function YOe(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=pre(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 KOe(t){return Object.keys(t).length===0}function ZOe(t){return typeof t=="string"&&t.charCodeAt(0)>96}function TC(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const JOe=R1.systemDefaultTheme=(0,GOe.default)(),eCe=t=>t&&t.charAt(0).toLowerCase()+t.slice(1);function nS({defaultTheme:t,theme:e,themeId:n}){return KOe(e)?t:e[n]||e}function tCe(t){return t?(e,n)=>n[t]:null}function EC(t,e){let{ownerState:n}=e,r=(0,DL.default)(e,qOe);const i=typeof t=="function"?t((0,$a.default)({ownerState:n},r)):t;if(Array.isArray(i))return i.flatMap(o=>EC(o,(0,$a.default)({ownerState:n},r)));if(i&&typeof i=="object"&&Array.isArray(i.variants)){const{variants:o=[]}=i;let s=(0,DL.default)(i,XOe);return o.forEach(l=>{let c=!0;typeof l.props=="function"?c=l.props((0,$a.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,$a.default)({ownerState:n},r,n)):l.style))}),s}return i}function nCe(t={}){const{themeId:e,defaultTheme:n=JOe,rootShouldForwardProp:r=TC,slotShouldForwardProp:i=TC}=t,o=a=>(0,HOe.default)((0,$a.default)({},a,{theme:nS((0,$a.default)({},a,{defaultTheme:n,themeId:e}))}));return o.__mui_systemSx=!0,(a,s={})=>{(0,XV.internal_processStyles)(a,_=>_.filter(S=>!(S!=null&&S.__mui_systemSx)));const{name:l,slot:c,skipVariantsResolver:u,skipSx:f,overridesResolver:d=tCe(eCe(c))}=s,h=(0,DL.default)(s,QOe),p=u!==void 0?u:c&&c!=="Root"&&c!=="root"||!1,m=f||!1;let g,v=TC;c==="Root"||c==="root"?v=r:c?v=i:ZOe(a)&&(v=void 0);const y=(0,XV.default)(a,(0,$a.default)({shouldForwardProp:v,label:g},h)),x=_=>typeof _=="function"&&_.__emotion_real!==_||(0,VOe.isPlainObject)(_)?S=>EC(_,(0,$a.default)({},S,{theme:nS({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=nS((0,$a.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]=EC(z,(0,$a.default)({},I,{theme:P}))}),d(I,T)}),l&&!p&&C.push(I=>{var P;const R=nS((0,$a.default)({},I,{defaultTheme:n,themeId:e})),T=R==null||(P=R.components)==null||(P=P[l])==null?void 0:P.variants;return EC({variants:T},(0,$a.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 DM(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const hi=t=>DM(t)&&t!=="classes",we=WOe({themeId:Kh,defaultTheme:IM,rootShouldForwardProp:hi}),rCe=["theme"];function iCe(t){let{theme:e}=t,n=Ae(t,rCe);const r=e[Kh];return w.jsx(GSe,j({},n,{themeId:r?Kh:void 0,theme:r||e}))}const QV=t=>{let e;return t<1?e=5.11916*t**2:e=4.5*Math.log(t+1)+2,(e/100).toFixed(2)};function oCe(t){return We("MuiSvgIcon",t)}Ve("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const aCe=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],sCe=t=>{const{color:e,fontSize:n,classes:r}=t,i={root:["root",e!=="inherit"&&`color${De(e)}`,`fontSize${De(n)}`]};return Ue(i,oCe,r)},lCe=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]}}),LL=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,aCe),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=sCe(m);return w.jsxs(lCe,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]}))});LL.muiName="SvgIcon";function ni(t,e){function n(r,i){return w.jsx(LL,j({"data-testid":`${e}Icon`,ref:i},r,{children:t}))}return n.muiName=LL.muiName,M.memo(M.forwardRef(n))}const cCe={configure:t=>{Qj.configure(t)}},uCe=Object.freeze(Object.defineProperty({__proto__:null,capitalize:De,createChainedFunction:OT,createSvgIcon:ni,debounce:Kv,deprecatedPropType:_Se,isMuiElement:Nx,ownerDocument:$n,ownerWindow:cs,requirePropFactory:wSe,setRef:CT,unstable_ClassNameGenerator:cCe,unstable_useEnhancedEffect:Hr,unstable_useId:pd,unsupportedProp:OSe,useControlled:Qs,useEventCallback:_r,useForkRef:Zt,useIsFocusVisible:k1},Symbol.toStringTag,{value:"Module"}));var In={};/** * @license React * react-is.production.min.js * @@ -91,7 +91,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 a5=Symbol.for("react.element"),s5=Symbol.for("react.portal"),LM=Symbol.for("react.fragment"),NM=Symbol.for("react.strict_mode"),$M=Symbol.for("react.profiler"),FM=Symbol.for("react.provider"),jM=Symbol.for("react.context"),dCe=Symbol.for("react.server_context"),BM=Symbol.for("react.forward_ref"),zM=Symbol.for("react.suspense"),UM=Symbol.for("react.suspense_list"),WM=Symbol.for("react.memo"),VM=Symbol.for("react.lazy"),hCe=Symbol.for("react.offscreen"),vre;vre=Symbol.for("react.module.reference");function bs(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case a5:switch(t=t.type,t){case LM:case $M:case NM:case zM:case UM:return t;default:switch(t=t&&t.$$typeof,t){case dCe:case jM:case BM:case VM:case WM:case FM:return t;default:return e}}case s5:return e}}}In.ContextConsumer=jM;In.ContextProvider=FM;In.Element=a5;In.ForwardRef=BM;In.Fragment=LM;In.Lazy=VM;In.Memo=WM;In.Portal=s5;In.Profiler=$M;In.StrictMode=NM;In.Suspense=zM;In.SuspenseList=UM;In.isAsyncMode=function(){return!1};In.isConcurrentMode=function(){return!1};In.isContextConsumer=function(t){return bs(t)===jM};In.isContextProvider=function(t){return bs(t)===FM};In.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===a5};In.isForwardRef=function(t){return bs(t)===BM};In.isFragment=function(t){return bs(t)===LM};In.isLazy=function(t){return bs(t)===VM};In.isMemo=function(t){return bs(t)===WM};In.isPortal=function(t){return bs(t)===s5};In.isProfiler=function(t){return bs(t)===$M};In.isStrictMode=function(t){return bs(t)===NM};In.isSuspense=function(t){return bs(t)===zM};In.isSuspenseList=function(t){return bs(t)===UM};In.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===LM||t===$M||t===NM||t===zM||t===UM||t===hCe||typeof t=="object"&&t!==null&&(t.$$typeof===VM||t.$$typeof===WM||t.$$typeof===FM||t.$$typeof===jM||t.$$typeof===BM||t.$$typeof===vre||t.getModuleId!==void 0)};In.typeOf=bs;function l5(t){return qe}function ET(t,e){return ET=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},ET(t,e)}function D1(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,ET(t,e)}function pCe(t,e){return t.classList?!!e&&t.classList.contains(e):(" "+(t.className.baseVal||t.className)+" ").indexOf(" "+e+" ")!==-1}function mCe(t,e){t.classList?t.classList.add(e):pCe(t,e)||(typeof t.className=="string"?t.className=t.className+" "+e:t.setAttribute("class",(t.className&&t.className.baseVal||"")+" "+e))}function KV(t,e){return t.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function gCe(t,e){t.classList?t.classList.remove(e):typeof t.className=="string"?t.className=KV(t.className,e):t.setAttribute("class",KV(t.className&&t.className.baseVal||"",e))}const ZV={disabled:!1},PT=ue.createContext(null);var yre=function(e){return e.scrollTop},sx="unmounted",Yd="exited",Kd="entering",Lm="entered",$L="exiting",ka=function(t){D1(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=Yd,o.appearStatus=Kd):l=Lm:r.unmountOnExit||r.mountOnEnter?l=sx:l=Yd,o.state={status:l},o.nextCallback=null,o}e.getDerivedStateFromProps=function(i,o){var a=i.in;return a&&o.status===sx?{status:Yd}: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!==Kd&&a!==Lm&&(o=Kd):(a===Kd||a===Lm)&&(o=$L)}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===Kd){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:Jw.findDOMNode(this);a&&yre(a)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Yd&&this.setState({status:sx})},n.performEnter=function(i){var o=this,a=this.props.enter,s=this.context?this.context.isMounting:i,l=this.props.nodeRef?[s]:[Jw.findDOMNode(this),s],c=l[0],u=l[1],f=this.getTimeouts(),d=s?f.appear:f.enter;if(!i&&!a||ZV.disabled){this.safeSetState({status:Lm},function(){o.props.onEntered(c)});return}this.props.onEnter(c,u),this.safeSetState({status:Kd},function(){o.props.onEntering(c,u),o.onTransitionEnd(d,function(){o.safeSetState({status:Lm},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:Jw.findDOMNode(this);if(!o||ZV.disabled){this.safeSetState({status:Yd},function(){i.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:$L},function(){i.props.onExiting(s),i.onTransitionEnd(a.exit,function(){i.safeSetState({status:Yd},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:Jw.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===sx)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(PT.Provider,{value:null},typeof a=="function"?a(i,s):ue.cloneElement(ue.Children.only(a),s))},e}(ue.Component);ka.contextType=PT;ka.propTypes={};function Jp(){}ka.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Jp,onEntering:Jp,onEntered:Jp,onExit:Jp,onExiting:Jp,onExited:Jp};ka.UNMOUNTED=sx;ka.EXITED=Yd;ka.ENTERING=Kd;ka.ENTERED=Lm;ka.EXITING=$L;var vCe=function(e,n){return e&&n&&n.split(" ").forEach(function(r){return mCe(e,r)})},CA=function(e,n){return e&&n&&n.split(" ").forEach(function(r){return gCe(e,r)})},c5=function(t){D1(e,t);function e(){for(var r,i=arguments.length,o=new Array(i),a=0;at.scrollTop;function Zf(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 SCe(t){return We("MuiCollapse",t)}Ve("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const OCe=["addEndListener","children","className","collapsedSize","component","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","orientation","style","timeout","TransitionComponent"],CCe=t=>{const{orientation:e,classes:n}=t,r={root:["root",`${e}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${e}`],wrapperInner:["wrapperInner",`${e}`]};return Ue(r,SCe,n)},TCe=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"})),ECe=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%"})),PCe=we("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:(t,e)=>e.wrapperInner})(({ownerState:t})=>j({width:"100%"},t.orientation==="horizontal"&&{width:"auto",height:"100%"})),d5=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=pre.standard,TransitionComponent:b=ka}=r,_=Ae(r,OCe),S=j({},r,{orientation:v,collapsedSize:s}),O=CCe(S),C=Go(),E=bf(),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)}},U=()=>k.current?k.current[R?"clientWidth":"clientHeight"]:0,W=B((K,se)=>{k.current&&R&&(k.current.style.position="absolute"),K.style[T]=P,f&&f(K,se)}),$=B((K,se)=>{const te=U();k.current&&R&&(k.current.style.position="");const{duration:J,easing:pe}=Zf({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)}),N=B((K,se)=>{K.style[T]="auto",d&&d(K,se)}),D=B(K=>{K.style[T]=`${U()}px`,p&&p(K)}),A=B(m),q=B(K=>{const se=U(),{duration:te,easing:J}=Zf({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:W,onEntered:N,onEntering:$,onExit:D,onExited:A,onExiting:q,addEndListener:Y,nodeRef:L,timeout:x==="auto"?null:x},_,{children:(K,se)=>w.jsx(TCe,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(ECe,{ownerState:j({},S,{state:K}),className:O.wrapper,ref:k,children:w.jsx(PCe,{ownerState:j({},S,{state:K}),className:O.wrapperInner,children:o})})}))}))});d5.muiSupportAuto=!0;function MCe(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 kCe=["className","component","elevation","square","variant"],ACe=t=>{const{square:e,elevation:n,variant:r,classes:i}=t,o={root:["root",r,!e&&"rounded",r==="elevation"&&`elevation${n}`]};return Ue(o,MCe,i)},RCe=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",YV(e.elevation))}, ${kt("#fff",YV(e.elevation))})`},t.vars&&{backgroundImage:(n=t.vars.overlays)==null?void 0:n[e.elevation]}))}),Ho=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,kCe),u=j({},r,{component:o,elevation:a,square:s,variant:l}),f=ACe(u);return w.jsx(RCe,j({as:o,ownerState:u,className:ke(f.root,i),ref:n},c))});function Vl(t){return typeof t=="string"}function Zm(t,e,n){return t===void 0||Vl(t)?e:j({},e,{ownerState:j({},e.ownerState,n)})}function ICe(t,e,n=(r,i)=>r===i){return t.length===e.length&&t.every((r,i)=>n(r,e[i]))}const DCe={disableDefaultClasses:!1},LCe=M.createContext(DCe);function NCe(t){const{disableDefaultClasses:e}=M.useContext(LCe);return n=>e?"":t(n)}function Nh(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 xre(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 bre(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=Nh(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 $Ce=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function $r(t){var e;const{elementType:n,externalSlotProps:r,ownerState:i,skipResolvingSlotProps:o=!1}=t,a=Ae(t,$Ce),s=o?{}:xre(r,i),{props:l,internalRef:c}=bre(j({},a,{externalSlotProps:s})),u=Zt(c,s==null?void 0:s.ref,(e=t.additionalProps)==null?void 0:e.ref);return Zm(n,j({},l,{ref:u}),i)}const FCe=["className","elementType","ownerState","externalForwardedProps","getSlotOwnerState","internalForwardedProps"],jCe=["component","slots","slotProps"],BCe=["component"];function zCe(t,e){const{className:n,elementType:r,ownerState:i,externalForwardedProps:o,getSlotOwnerState:a,internalForwardedProps:s}=e,l=Ae(e,FCe),{component:c,slots:u={[t]:void 0},slotProps:f={[t]:void 0}}=o;Ae(o,jCe);const d=u[t]||r,h=xre(f[t],i),p=bre(j({className:n},l,{externalForwardedProps:void 0,externalSlotProps:h})),{props:{component:m},internalRef:g}=p,v=Ae(p.props,BCe),y=Zt(g,h==null?void 0:h.ref,e.ref),x=a?a(v):{},b=j({},i,x),_=m,S=Zm(d,j({},t==="root",!u[t]&&s,v,_&&{as:_},{ref:y}),b);return Object.keys(x).forEach(O=>{delete S[O]}),[d,S]}function UCe(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"]),WCe=["center","classes","className"];let GM=t=>t,e8,t8,n8,r8;const FL=550,VCe=80,GCe=Qv(e8||(e8=GM` + */var o5=Symbol.for("react.element"),a5=Symbol.for("react.portal"),LM=Symbol.for("react.fragment"),NM=Symbol.for("react.strict_mode"),$M=Symbol.for("react.profiler"),FM=Symbol.for("react.provider"),jM=Symbol.for("react.context"),fCe=Symbol.for("react.server_context"),BM=Symbol.for("react.forward_ref"),zM=Symbol.for("react.suspense"),UM=Symbol.for("react.suspense_list"),WM=Symbol.for("react.memo"),VM=Symbol.for("react.lazy"),dCe=Symbol.for("react.offscreen"),mre;mre=Symbol.for("react.module.reference");function bs(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case o5:switch(t=t.type,t){case LM:case $M:case NM:case zM:case UM:return t;default:switch(t=t&&t.$$typeof,t){case fCe:case jM:case BM:case VM:case WM:case FM:return t;default:return e}}case a5:return e}}}In.ContextConsumer=jM;In.ContextProvider=FM;In.Element=o5;In.ForwardRef=BM;In.Fragment=LM;In.Lazy=VM;In.Memo=WM;In.Portal=a5;In.Profiler=$M;In.StrictMode=NM;In.Suspense=zM;In.SuspenseList=UM;In.isAsyncMode=function(){return!1};In.isConcurrentMode=function(){return!1};In.isContextConsumer=function(t){return bs(t)===jM};In.isContextProvider=function(t){return bs(t)===FM};In.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===o5};In.isForwardRef=function(t){return bs(t)===BM};In.isFragment=function(t){return bs(t)===LM};In.isLazy=function(t){return bs(t)===VM};In.isMemo=function(t){return bs(t)===WM};In.isPortal=function(t){return bs(t)===a5};In.isProfiler=function(t){return bs(t)===$M};In.isStrictMode=function(t){return bs(t)===NM};In.isSuspense=function(t){return bs(t)===zM};In.isSuspenseList=function(t){return bs(t)===UM};In.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===LM||t===$M||t===NM||t===zM||t===UM||t===dCe||typeof t=="object"&&t!==null&&(t.$$typeof===VM||t.$$typeof===WM||t.$$typeof===FM||t.$$typeof===jM||t.$$typeof===BM||t.$$typeof===mre||t.getModuleId!==void 0)};In.typeOf=bs;function s5(t){return qe}function ET(t,e){return ET=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},ET(t,e)}function I1(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,ET(t,e)}function hCe(t,e){return t.classList?!!e&&t.classList.contains(e):(" "+(t.className.baseVal||t.className)+" ").indexOf(" "+e+" ")!==-1}function pCe(t,e){t.classList?t.classList.add(e):hCe(t,e)||(typeof t.className=="string"?t.className=t.className+" "+e:t.setAttribute("class",(t.className&&t.className.baseVal||"")+" "+e))}function YV(t,e){return t.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function mCe(t,e){t.classList?t.classList.remove(e):typeof t.className=="string"?t.className=YV(t.className,e):t.setAttribute("class",YV(t.className&&t.className.baseVal||"",e))}const KV={disabled:!1},PT=ue.createContext(null);var gre=function(e){return e.scrollTop},ax="unmounted",Yd="exited",Kd="entering",Lm="entered",NL="exiting",ka=function(t){I1(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=Yd,o.appearStatus=Kd):l=Lm:r.unmountOnExit||r.mountOnEnter?l=ax:l=Yd,o.state={status:l},o.nextCallback=null,o}e.getDerivedStateFromProps=function(i,o){var a=i.in;return a&&o.status===ax?{status:Yd}: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!==Kd&&a!==Lm&&(o=Kd):(a===Kd||a===Lm)&&(o=NL)}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===Kd){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:Jw.findDOMNode(this);a&&gre(a)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Yd&&this.setState({status:ax})},n.performEnter=function(i){var o=this,a=this.props.enter,s=this.context?this.context.isMounting:i,l=this.props.nodeRef?[s]:[Jw.findDOMNode(this),s],c=l[0],u=l[1],f=this.getTimeouts(),d=s?f.appear:f.enter;if(!i&&!a||KV.disabled){this.safeSetState({status:Lm},function(){o.props.onEntered(c)});return}this.props.onEnter(c,u),this.safeSetState({status:Kd},function(){o.props.onEntering(c,u),o.onTransitionEnd(d,function(){o.safeSetState({status:Lm},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:Jw.findDOMNode(this);if(!o||KV.disabled){this.safeSetState({status:Yd},function(){i.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:NL},function(){i.props.onExiting(s),i.onTransitionEnd(a.exit,function(){i.safeSetState({status:Yd},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:Jw.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===ax)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(PT.Provider,{value:null},typeof a=="function"?a(i,s):ue.cloneElement(ue.Children.only(a),s))},e}(ue.Component);ka.contextType=PT;ka.propTypes={};function Jp(){}ka.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Jp,onEntering:Jp,onEntered:Jp,onExit:Jp,onExiting:Jp,onExited:Jp};ka.UNMOUNTED=ax;ka.EXITED=Yd;ka.ENTERING=Kd;ka.ENTERED=Lm;ka.EXITING=NL;var gCe=function(e,n){return e&&n&&n.split(" ").forEach(function(r){return pCe(e,r)})},CA=function(e,n){return e&&n&&n.split(" ").forEach(function(r){return mCe(e,r)})},l5=function(t){I1(e,t);function e(){for(var r,i=arguments.length,o=new Array(i),a=0;at.scrollTop;function Zf(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 wCe(t){return We("MuiCollapse",t)}Ve("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const SCe=["addEndListener","children","className","collapsedSize","component","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","orientation","style","timeout","TransitionComponent"],OCe=t=>{const{orientation:e,classes:n}=t,r={root:["root",`${e}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${e}`],wrapperInner:["wrapperInner",`${e}`]};return Ue(r,wCe,n)},CCe=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"})),TCe=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%"})),ECe=we("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:(t,e)=>e.wrapperInner})(({ownerState:t})=>j({width:"100%"},t.orientation==="horizontal"&&{width:"auto",height:"100%"})),f5=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=dre.standard,TransitionComponent:b=ka}=r,_=Ae(r,SCe),S=j({},r,{orientation:v,collapsedSize:s}),O=OCe(S),C=Go(),E=bf(),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)}},U=()=>k.current?k.current[R?"clientWidth":"clientHeight"]:0,W=B((K,se)=>{k.current&&R&&(k.current.style.position="absolute"),K.style[T]=P,f&&f(K,se)}),$=B((K,se)=>{const te=U();k.current&&R&&(k.current.style.position="");const{duration:J,easing:pe}=Zf({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)}),N=B((K,se)=>{K.style[T]="auto",d&&d(K,se)}),D=B(K=>{K.style[T]=`${U()}px`,p&&p(K)}),A=B(m),q=B(K=>{const se=U(),{duration:te,easing:J}=Zf({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:W,onEntered:N,onEntering:$,onExit:D,onExited:A,onExiting:q,addEndListener:Y,nodeRef:L,timeout:x==="auto"?null:x},_,{children:(K,se)=>w.jsx(CCe,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(TCe,{ownerState:j({},S,{state:K}),className:O.wrapper,ref:k,children:w.jsx(ECe,{ownerState:j({},S,{state:K}),className:O.wrapperInner,children:o})})}))}))});f5.muiSupportAuto=!0;function PCe(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 MCe=["className","component","elevation","square","variant"],kCe=t=>{const{square:e,elevation:n,variant:r,classes:i}=t,o={root:["root",r,!e&&"rounded",r==="elevation"&&`elevation${n}`]};return Ue(o,PCe,i)},ACe=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",QV(e.elevation))}, ${kt("#fff",QV(e.elevation))})`},t.vars&&{backgroundImage:(n=t.vars.overlays)==null?void 0:n[e.elevation]}))}),Ho=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,MCe),u=j({},r,{component:o,elevation:a,square:s,variant:l}),f=kCe(u);return w.jsx(ACe,j({as:o,ownerState:u,className:ke(f.root,i),ref:n},c))});function Vl(t){return typeof t=="string"}function Zm(t,e,n){return t===void 0||Vl(t)?e:j({},e,{ownerState:j({},e.ownerState,n)})}function RCe(t,e,n=(r,i)=>r===i){return t.length===e.length&&t.every((r,i)=>n(r,e[i]))}const ICe={disableDefaultClasses:!1},DCe=M.createContext(ICe);function LCe(t){const{disableDefaultClasses:e}=M.useContext(DCe);return n=>e?"":t(n)}function Nh(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 vre(t,e,n){return typeof t=="function"?t(e,n):t}function ZV(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 yre(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=Nh(j({},i,r)),s=ZV(r),l=ZV(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 NCe=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function $r(t){var e;const{elementType:n,externalSlotProps:r,ownerState:i,skipResolvingSlotProps:o=!1}=t,a=Ae(t,NCe),s=o?{}:vre(r,i),{props:l,internalRef:c}=yre(j({},a,{externalSlotProps:s})),u=Zt(c,s==null?void 0:s.ref,(e=t.additionalProps)==null?void 0:e.ref);return Zm(n,j({},l,{ref:u}),i)}const $Ce=["className","elementType","ownerState","externalForwardedProps","getSlotOwnerState","internalForwardedProps"],FCe=["component","slots","slotProps"],jCe=["component"];function BCe(t,e){const{className:n,elementType:r,ownerState:i,externalForwardedProps:o,getSlotOwnerState:a,internalForwardedProps:s}=e,l=Ae(e,$Ce),{component:c,slots:u={[t]:void 0},slotProps:f={[t]:void 0}}=o;Ae(o,FCe);const d=u[t]||r,h=vre(f[t],i),p=yre(j({className:n},l,{externalForwardedProps:void 0,externalSlotProps:h})),{props:{component:m},internalRef:g}=p,v=Ae(p.props,jCe),y=Zt(g,h==null?void 0:h.ref,e.ref),x=a?a(v):{},b=j({},i,x),_=m,S=Zm(d,j({},t==="root",!u[t]&&s,v,_&&{as:_},{ref:y}),b);return Object.keys(x).forEach(O=>{delete S[O]}),[d,S]}function zCe(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"]),UCe=["center","classes","className"];let GM=t=>t,JV,e8,t8,n8;const $L=550,WCe=80,VCe=Qv(JV||(JV=GM` 0% { transform: scale(0); opacity: 0.1; @@ -101,7 +101,7 @@ const store = createStore( transform: scale(1); opacity: 0.3; } -`)),HCe=Qv(t8||(t8=GM` +`)),GCe=Qv(e8||(e8=GM` 0% { opacity: 1; } @@ -109,7 +109,7 @@ const store = createStore( 100% { opacity: 0; } -`)),qCe=Qv(n8||(n8=GM` +`)),HCe=Qv(t8||(t8=GM` 0% { transform: scale(1); } @@ -121,7 +121,7 @@ const store = createStore( 100% { transform: scale(1); } -`)),XCe=we("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),QCe=we(UCe,{name:"MuiTouchRipple",slot:"Ripple"})(r8||(r8=GM` +`)),qCe=we("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),XCe=we(zCe,{name:"MuiTouchRipple",slot:"Ripple"})(n8||(n8=GM` opacity: 0; position: absolute; @@ -164,8 +164,8 @@ const store = createStore( animation-iteration-count: infinite; animation-delay: 200ms; } -`),Fa.rippleVisible,GCe,FL,({theme:t})=>t.transitions.easing.easeInOut,Fa.ripplePulsate,({theme:t})=>t.transitions.duration.shorter,Fa.child,Fa.childLeaving,HCe,FL,({theme:t})=>t.transitions.easing.easeInOut,Fa.childPulsate,qCe,({theme:t})=>t.transitions.easing.easeInOut),YCe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTouchRipple"}),{center:i=!1,classes:o={},className:a}=r,s=Ae(r,WCe),[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=bf(),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(QCe,{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:FL,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(VCe,()=>{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(XCe,j({className:ke(Fa.root,o.root,a),ref:m},s,{children:w.jsx(L1,{component:null,exit:!0,children:l})}))});function KCe(t){return We("MuiButtonBase",t)}const ZCe=Ve("MuiButtonBase",["root","disabled","focusVisible"]),JCe=["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"],eTe=t=>{const{disabled:e,focusVisible:n,focusVisibleClassName:r,classes:i}=t,a=Ue({root:["root",e&&"disabled",n&&"focusVisible"]},KCe,i);return n&&r&&(a.root+=` ${r}`),a},tTe=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"},[`&.${ZCe.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),fs=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,JCe),B=M.useRef(null),U=M.useRef(null),W=Zt(U,T),{isFocusVisibleRef:$,onFocus:N,onBlur:D,ref:A}=A1(),[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&&U.current.pulsate()},[u,d,q,K]);function J(V,de,xe=f){return _r(Me=>(de&&de(Me),!xe&&U.current&&U.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),$.current===!1&&Y(!1),p&&p(V)},!1),ee=_r(V=>{B.current||(B.current=V.currentTarget),N(V),$.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=_r(V=>{d&&!ye.current&&q&&U.current&&V.key===" "&&(ye.current=!0,U.current.stop(V,()=>{U.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=_r(V=>{d&&V.key===" "&&U.current&&q&&!V.defaultPrevented&&(ye.current=!1,U.current.stop(V,()=>{U.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=eTe(oe);return w.jsxs(tTe,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(YCe,j({ref:W,center:o},R)):null]}))});function nTe(t){return We("MuiIconButton",t)}const rTe=Ve("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),iTe=["edge","children","className","color","disabled","disableFocusRipple","size"],oTe=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,nTe,e)},aTe=we(fs,{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)},{[`&.${rTe.disabled}`]:{backgroundColor:"transparent",color:(t.vars||t).palette.action.disabled}})}),Ot=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,iTe),d=j({},r,{edge:i,color:s,disabled:l,disableFocusRipple:c,size:u}),h=oTe(d);return w.jsx(aTe,j({className:ke(h.root,a),centerRipple:!0,focusRipple:!c,disabled:l,ref:n},f,{ownerState:d,children:o}))});function sTe(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 lTe=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],cTe=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,sTe,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})),i8={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},fTe={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},dTe=t=>fTe[t]||t,At=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTypography"}),i=dTe(r.color),o=M1(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=i8}=o,p=Ae(o,lTe),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]||i8[d])||"span",v=cTe(m);return w.jsx(uTe,j({as:g,ref:n,ownerState:m,className:ke(v.root,s)},p))});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 pTe=["className","color","enableColorOnDark","position"],mTe=t=>{const{color:e,position:n,classes:r}=t,i={root:["root",`color${De(e)}`,`position${De(n)}`]};return Ue(i,hTe,r)},rS=(t,e)=>t?`${t==null?void 0:t.replace(")","")}, ${e})`:e,gTe=we(Ho,{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:rS(t.vars.palette.AppBar.darkBg,t.vars.palette.AppBar.defaultBg),"--AppBar-color":e.enableColorOnDark?t.vars.palette.text.primary:rS(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:rS(t.vars.palette.AppBar.darkBg,t.vars.palette[e.color].main),"--AppBar-color":e.enableColorOnDark?t.vars.palette[e.color].contrastText:rS(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"}))}),_re=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,pTe),c=j({},r,{color:o,position:s,enableColorOnDark:a}),u=mTe(c);return w.jsx(gTe,j({square:!0,component:"header",ownerState:c,elevation:4,className:ke(u.root,i,s==="fixed"&&"mui-fixed"),ref:n},l))}),wre="base";function vTe(t){return`${wre}--${t}`}function yTe(t,e){return`${wre}-${t}-${e}`}function Sre(t,e){const n=Hne[e];return n?vTe(n):yTe(t,e)}function xTe(t,e){const n={};return e.forEach(r=>{n[r]=Sre(t,r)}),n}function o8(t){return t.substring(2).toLowerCase()}function bTe(t,e){return e.documentElement.clientWidth(setTimeout(()=>{l.current=!0},0),()=>{l.current=!1}),[]);const u=Zt(e.ref,s),f=_r(p=>{const m=c.current;c.current=!1;const g=$n(s.current);if(!l.current||!s.current||"clientX"in p&&bTe(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=o8(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=o8(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 wTe=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function STe(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 OTe(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 CTe(t){return!(t.disabled||t.tagName==="INPUT"&&t.type==="hidden"||OTe(t))}function TTe(t){const e=[],n=[];return Array.from(t.querySelectorAll(wTe)).forEach((r,i)=>{const o=STe(r);o===-1||!CTe(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 ETe(){return!0}function Ore(t){const{children:e,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:i=!1,getTabbable:o=TTe,isEnabled:a=ETe,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 PTe(t){return typeof t=="function"?t():t}const Cre=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(Hr(()=>{o||s(PTe(i)||document.body)},[i,o]),Hr(()=>{if(a&&!o)return CT(n,a),()=>{CT(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&&qv.createPortal(r,a)})});function MTe(t){const e=$n(t);return e.body===t?cs(t).innerWidth>e.documentElement.clientWidth:t.scrollHeight>t.clientHeight}function Fx(t,e){e?t.setAttribute("aria-hidden","true"):t.removeAttribute("aria-hidden")}function a8(t){return parseInt(cs(t).getComputedStyle(t).paddingRight,10)||0}function kTe(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 s8(t,e,n,r,i){const o=[e,n,...r];[].forEach.call(t.children,a=>{const s=o.indexOf(a)===-1,l=!kTe(a);s&&l&&Fx(a,i)})}function TA(t,e){let n=-1;return t.some((r,i)=>e(r)?(n=i,!0):!1),n}function ATe(t,e){const n=[],r=t.container;if(!e.disableScrollLock){if(MTe(r)){const a=nre($n(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${a8(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=`${a8(l)+a}px`})}let o;if(r.parentNode instanceof DocumentFragment)o=$n(r).body;else{const a=r.parentElement,s=cs(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 RTe(t){const e=[];return[].forEach.call(t.children,n=>{n.getAttribute("aria-hidden")==="true"&&e.push(n)}),e}class ITe{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&&Fx(e.modalRef,!1);const i=RTe(n);s8(n,e.mount,e.modalRef,i,!0);const o=TA(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=TA(this.containers,o=>o.modals.indexOf(e)!==-1),i=this.containers[r];i.restore||(i.restore=ATe(i,n))}remove(e,n=!0){const r=this.modals.indexOf(e);if(r===-1)return r;const i=TA(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&&Fx(e.modalRef,n),s8(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&&Fx(a.modalRef,!1)}return r}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}}function DTe(t){return typeof t=="function"?t():t}function LTe(t){return t?t.props.hasOwnProperty("in"):!1}const NTe=new ITe;function $Te(t){const{container:e,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,manager:i=NTe,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=LTe(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=_r(()=>{const z=DTe(e)||b().body;i.add(_(),z),p.current&&S()}),C=M.useCallback(()=>i.isTopModal(_()),[i]),E=_r(z=>{h.current=z,z&&(u&&C()?S():p.current&&Fx(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 U;(U=z.onKeyDown)==null||U.call(z,B),!(B.key!=="Escape"||B.which===229||!C())&&(n||(B.stopPropagation(),c&&c(B,"escapeKeyDown")))},P=z=>B=>{var U;(U=z.onClick)==null||U.call(z,B),B.target===B.currentTarget&&c&&c(B,"backdropClick")};return{getRootProps:(z={})=>{const B=Nh(t);delete B.onTransitionEnter,delete B.onTransitionExited;const U=j({},B,z);return j({role:"presentation"},U,{onKeyDown:I(U),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:OT(z,l==null?void 0:l.props.onEnter),onExited:OT(B,l==null?void 0:l.props.onExited)}},rootRef:m,portalRef:E,isTopModal:C,exited:g,hasTransition:y}}var No="top",ds="bottom",hs="right",$o="left",h5="auto",N1=[No,ds,hs,$o],Qg="start",Ib="end",FTe="clippingParents",Tre="viewport",d0="popper",jTe="reference",l8=N1.reduce(function(t,e){return t.concat([e+"-"+Qg,e+"-"+Ib])},[]),Ere=[].concat(N1,[h5]).reduce(function(t,e){return t.concat([e,e+"-"+Qg,e+"-"+Ib])},[]),BTe="beforeRead",zTe="read",UTe="afterRead",WTe="beforeMain",VTe="main",GTe="afterMain",HTe="beforeWrite",qTe="write",XTe="afterWrite",QTe=[BTe,zTe,UTe,WTe,VTe,GTe,HTe,qTe,XTe];function Jl(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 Jh(t){var e=Sa(t).Element;return t instanceof e||t instanceof Element}function es(t){var e=Sa(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function p5(t){if(typeof ShadowRoot>"u")return!1;var e=Sa(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function YTe(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];!es(o)||!Jl(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 KTe(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},{});!es(i)||!Jl(i)||(Object.assign(i.style,s),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const ZTe={name:"applyStyles",enabled:!0,phase:"write",fn:YTe,effect:KTe,requires:["computeStyles"]};function Gl(t){return t.split("-")[0]}var $h=Math.max,MT=Math.min,Yg=Math.round;function jL(){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 Pre(){return!/^((?!chrome|android).)*safari/i.test(jL())}function Kg(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&es(t)&&(i=t.offsetWidth>0&&Yg(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&Yg(r.height)/t.offsetHeight||1);var a=Jh(t)?Sa(t):window,s=a.visualViewport,l=!Pre()&&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 m5(t){var e=Kg(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 Mre(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&p5(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function du(t){return Sa(t).getComputedStyle(t)}function JTe(t){return["table","td","th"].indexOf(Jl(t))>=0}function md(t){return((Jh(t)?t.ownerDocument:t.document)||window.document).documentElement}function HM(t){return Jl(t)==="html"?t:t.assignedSlot||t.parentNode||(p5(t)?t.host:null)||md(t)}function c8(t){return!es(t)||du(t).position==="fixed"?null:t.offsetParent}function eEe(t){var e=/firefox/i.test(jL()),n=/Trident/i.test(jL());if(n&&es(t)){var r=du(t);if(r.position==="fixed")return null}var i=HM(t);for(p5(i)&&(i=i.host);es(i)&&["html","body"].indexOf(Jl(i))<0;){var o=du(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 $1(t){for(var e=Sa(t),n=c8(t);n&&JTe(n)&&du(n).position==="static";)n=c8(n);return n&&(Jl(n)==="html"||Jl(n)==="body"&&du(n).position==="static")?e:n||eEe(t)||e}function g5(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function jx(t,e,n){return $h(t,MT(e,n))}function tEe(t,e,n){var r=jx(t,e,n);return r>n?n:r}function kre(){return{top:0,right:0,bottom:0,left:0}}function Are(t){return Object.assign({},kre(),t)}function Rre(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,Are(typeof e!="number"?e:Rre(e,N1))};function rEe(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Gl(n.placement),l=g5(s),c=[$o,hs].indexOf(s)>=0,u=c?"height":"width";if(!(!o||!a)){var f=nEe(i.padding,n),d=m5(o),h=l==="y"?No:$o,p=l==="y"?ds:hs,m=n.rects.reference[u]+n.rects.reference[l]-a[l]-n.rects.popper[u],g=a[l]-n.rects.reference[l],v=$1(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=jx(b,S,_),C=l;n.modifiersData[r]=(e={},e[C]=O,e.centerOffset=O-S,e)}}function iEe(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)||Mre(e.elements.popper,i)&&(e.elements.arrow=i))}const oEe={name:"arrow",enabled:!0,phase:"main",fn:rEe,effect:iEe,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Zg(t){return t.split("-")[1]}var aEe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function sEe(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:Yg(n*i)/i||0,y:Yg(r*i)/i||0}}function u8(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=No,_=window;if(c){var S=$1(n),O="clientHeight",C="clientWidth";if(S===Sa(n)&&(S=md(n),du(S).position!=="static"&&s==="absolute"&&(O="scrollHeight",C="scrollWidth")),S=S,i===No||(i===$o||i===hs)&&o===Ib){b=ds;var E=f&&S===_&&_.visualViewport?_.visualViewport.height:S[O];m-=E-r.height,m*=l?1:-1}if(i===$o||(i===No||i===ds)&&o===Ib){x=hs;var k=f&&S===_&&_.visualViewport?_.visualViewport.width:S[C];h-=k-r.width,h*=l?1:-1}}var I=Object.assign({position:s},c&&aEe),P=u===!0?sEe({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 lEe(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:Gl(e.placement),variation:Zg(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,u8(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,u8(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 cEe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:lEe,data:{}};var iS={passive:!0};function uEe(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,iS)}),s&&l.addEventListener("resize",n.update,iS),function(){o&&c.forEach(function(u){u.removeEventListener("scroll",n.update,iS)}),s&&l.removeEventListener("resize",n.update,iS)}}const fEe={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:uEe,data:{}};var dEe={left:"right",right:"left",bottom:"top",top:"bottom"};function PC(t){return t.replace(/left|right|bottom|top/g,function(e){return dEe[e]})}var hEe={start:"end",end:"start"};function f8(t){return t.replace(/start|end/g,function(e){return hEe[e]})}function v5(t){var e=Sa(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function y5(t){return Kg(md(t)).left+v5(t).scrollLeft}function pEe(t,e){var n=Sa(t),r=md(t),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;var c=Pre();(c||!c&&e==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s+y5(t),y:l}}function mEe(t){var e,n=md(t),r=v5(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=$h(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=$h(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+y5(t),l=-r.scrollTop;return du(i||n).direction==="rtl"&&(s+=$h(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}function x5(t){var e=du(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Ire(t){return["html","body","#document"].indexOf(Jl(t))>=0?t.ownerDocument.body:es(t)&&x5(t)?t:Ire(HM(t))}function Bx(t,e){var n;e===void 0&&(e=[]);var r=Ire(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=Sa(r),a=i?[o].concat(o.visualViewport||[],x5(r)?r:[]):r,s=e.concat(a);return i?s:s.concat(Bx(HM(a)))}function BL(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function gEe(t,e){var n=Kg(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 d8(t,e,n){return e===Tre?BL(pEe(t,n)):Jh(e)?gEe(e,n):BL(mEe(md(t)))}function vEe(t){var e=Bx(HM(t)),n=["absolute","fixed"].indexOf(du(t).position)>=0,r=n&&es(t)?$1(t):t;return Jh(r)?e.filter(function(i){return Jh(i)&&Mre(i,r)&&Jl(i)!=="body"}):[]}function yEe(t,e,n,r){var i=e==="clippingParents"?vEe(t):[].concat(e),o=[].concat(i,[n]),a=o[0],s=o.reduce(function(l,c){var u=d8(t,c,r);return l.top=$h(u.top,l.top),l.right=MT(u.right,l.right),l.bottom=MT(u.bottom,l.bottom),l.left=$h(u.left,l.left),l},d8(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 Dre(t){var e=t.reference,n=t.element,r=t.placement,i=r?Gl(r):null,o=r?Zg(r):null,a=e.x+e.width/2-n.width/2,s=e.y+e.height/2-n.height/2,l;switch(i){case No:l={x:a,y:e.y-n.height};break;case ds:l={x:a,y:e.y+e.height};break;case hs: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?g5(i):null;if(c!=null){var u=c==="y"?"height":"width";switch(o){case Qg:l[c]=l[c]-(e[u]/2-n[u]/2);break;case Ib:l[c]=l[c]+(e[u]/2-n[u]/2);break}}return l}function Db(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?FTe:s,c=n.rootBoundary,u=c===void 0?Tre:c,f=n.elementContext,d=f===void 0?d0:f,h=n.altBoundary,p=h===void 0?!1:h,m=n.padding,g=m===void 0?0:m,v=Are(typeof g!="number"?g:Rre(g,N1)),y=d===d0?jTe:d0,x=t.rects.popper,b=t.elements[p?y:d],_=yEe(Jh(b)?b:b.contextElement||md(t.elements.popper),l,u,a),S=Kg(t.elements.reference),O=Dre({reference:S,element:x,strategy:"absolute",placement:i}),C=BL(Object.assign({},x,O)),E=d===d0?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===d0&&I){var P=I[i];Object.keys(k).forEach(function(R){var T=[hs,ds].indexOf(R)>=0?1:-1,L=[No,ds].indexOf(R)>=0?"y":"x";k[R]+=P[L]*T})}return k}function xEe(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?Ere:l,u=Zg(r),f=u?s?l8:l8.filter(function(p){return Zg(p)===u}):N1,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]=Db(t,{placement:m,boundary:i,rootBoundary:o,padding:a})[Gl(m)],p},{});return Object.keys(h).sort(function(p,m){return h[p]-h[m]})}function bEe(t){if(Gl(t)===h5)return[];var e=PC(t);return[f8(t),e,f8(e)]}function _Ee(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=Gl(g),y=v===g,x=l||(y||!p?[PC(g)]:bEe(g)),b=[g].concat(x).reduce(function(q,Y){return q.concat(Gl(Y)===h5?xEe(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=Db(e,{placement:I,boundary:u,rootBoundary:f,altBoundary:d,padding:c}),B=T?R?hs:$o:R?ds:No;_[L]>S[L]&&(B=PC(B));var U=PC(B),W=[];if(o&&W.push(z[P]<=0),s&&W.push(z[B]<=0,z[U]<=0),W.every(function(q){return q})){E=I,C=!1;break}O.set(I,W)}if(C)for(var $=p?3:1,N=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=$;D>0;D--){var A=N(D);if(A==="break")break}e.placement!==E&&(e.modifiersData[r]._skip=!0,e.placement=E,e.reset=!0)}}const wEe={name:"flip",enabled:!0,phase:"main",fn:_Ee,requiresIfExists:["offset"],data:{_skip:!1}};function h8(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 p8(t){return[No,hs,ds,$o].some(function(e){return t[e]>=0})}function SEe(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,a=Db(e,{elementContext:"reference"}),s=Db(e,{altBoundary:!0}),l=h8(a,r),c=h8(s,i,o),u=p8(l),f=p8(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 OEe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:SEe};function CEe(t,e,n){var r=Gl(t),i=[$o,No].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,hs].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function TEe(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,a=Ere.reduce(function(u,f){return u[f]=CEe(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 EEe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:TEe};function PEe(t){var e=t.state,n=t.name;e.modifiersData[n]=Dre({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const MEe={name:"popperOffsets",enabled:!0,phase:"read",fn:PEe,data:{}};function kEe(t){return t==="x"?"y":"x"}function AEe(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=Db(e,{boundary:l,rootBoundary:c,padding:f,altBoundary:u}),v=Gl(e.placement),y=Zg(e.placement),x=!y,b=g5(v),_=kEe(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"?No:$o,L=b==="y"?ds:hs,z=b==="y"?"height":"width",B=S[b],U=B+g[T],W=B-g[L],$=h?-C[z]/2:0,N=y===Qg?O[z]:C[z],D=y===Qg?-C[z]:-O[z],A=e.elements.arrow,q=h&&A?m5(A):{width:0,height:0},Y=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:kre(),K=Y[T],se=Y[L],te=jx(0,O[z],q[z]),J=x?O[z]/2-$-te-K-k.mainAxis:N-te-K-k.mainAxis,pe=x?-O[z]/2+$+te+se+k.mainAxis:D+te+se+k.mainAxis,be=e.elements.arrow&&$1(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=jx(h?MT(U,F):U,B,h?$h(W,ce):W);S[b]=le,P[b]=le-B}if(s){var Q,X=b==="x"?No:$o,ee=b==="x"?ds:hs,ge=S[_],ye=_==="y"?"height":"width",H=ge+g[X],G=ge-g[ee],ie=[No,$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?tEe(_e,ge,oe):jx(h?_e:H,ge,h?oe:G);S[_]=Z,P[_]=Z-ge}e.modifiersData[r]=P}}const REe={name:"preventOverflow",enabled:!0,phase:"main",fn:AEe,requiresIfExists:["offset"]};function IEe(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function DEe(t){return t===Sa(t)||!es(t)?v5(t):IEe(t)}function LEe(t){var e=t.getBoundingClientRect(),n=Yg(e.width)/t.offsetWidth||1,r=Yg(e.height)/t.offsetHeight||1;return n!==1||r!==1}function NEe(t,e,n){n===void 0&&(n=!1);var r=es(e),i=es(e)&&LEe(e),o=md(e),a=Kg(t,i,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((Jl(e)!=="body"||x5(o))&&(s=DEe(e)),es(e)?(l=Kg(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):o&&(l.x=y5(o))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function $Ee(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 FEe(t){var e=$Ee(t);return QTe.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function jEe(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function BEe(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 m8={placement:"bottom",modifiers:[],strategy:"absolute"};function g8(){for(var t=arguments.length,e=new Array(t),n=0;nUe({root:["root"]},NCe(VEe)),YEe={},KEe=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,GEe),v=M.useRef(null),y=Zt(v,n),x=M.useRef(null),b=Zt(x,d),_=M.useRef(b);Hr(()=>{_.current=b},[b]),M.useImperativeHandle(d,()=>x.current,[]);const S=qEe(u,a),[O,C]=M.useState(S),[E,k]=M.useState(zL(i));M.useEffect(()=>{x.current&&x.current.forceUpdate()}),M.useEffect(()=>{i&&k(zL(i))},[i]),Hr(()=>{if(!E||!c)return;const L=U=>{C(U.placement)};let z=[{name:"preventOverflow",options:{altBoundary:s}},{name:"flip",options:{altBoundary:s}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:U})=>{L(U)}}];l!=null&&(z=z.concat(l)),f&&f.modifiers!=null&&(z=z.concat(f.modifiers));const B=WEe(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=QEe(),R=(r=p.root)!=null?r:"div",T=$r({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}))}),ZEe=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=YEe,popperRef:h,style:p,transition:m=!1,slotProps:g={},slots:v={}}=e,y=Ae(e,HEe),[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=zL(r);O=k&&XEe(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(Cre,{disablePortal:s,container:O,children:w.jsx(KEe,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}))})}),JEe=2;function Nre(t,e){return t-e}function v8(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}%`})}},iPe=t=>t;let lS;function x8(){return lS===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?lS=CSS.supports("touch-action","none"):lS=!0),lS}function oPe(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=iPe,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]=Qs({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(Nre):[I];L=L.map(Z=>Z==null?l:ah(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:U,onBlur:W,onFocus:$,ref:N}=A1(),[D,A]=M.useState(-1),q=M.useRef(),Y=Zt(N,q),K=Zt(h,Y),se=Z=>V=>{var de;const xe=Number(V.currentTarget.getAttribute("data-index"));$(V),U.current===!0&&A(xe),O(xe),Z==null||(de=Z.onFocus)==null||de.call(Z,V)},te=Z=>V=>{var de;W(V),U.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 $e=B[B.length-1];me>$e?me=$e: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)};Hr(()=>{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:$e}=de.getBoundingClientRect();let Te;ve.indexOf("vertical")===0?Te=(me-Z.y)/Me:Te=(Z.x-$e)/xe,ve.indexOf("-reverse")!==-1&&(Te=1-Te);let Re;if(Re=ePe(Te,l,s),m)Re=nPe(Re,m,l);else{const Le=v8(B,Re);Re=B[Le]}Re=ah(Re,l,s);let ae=0;if(T){V?ae=re.current:ae=v8(L,Re),i&&(Re=ah(Re,L[ae-1]||-1/0,L[ae+1]||1/0));const Le=Re;Re=y8({values:L,newValue:Re,index:ae}),i&&V||(ae=Re.indexOf(Le),re.current=ae)}return{newValue:Re,activeIndex:ae}},ce=_r(Z=>{const V=oS(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});aS({sliderRef:q,activeIndex:xe,setActive:_}),P(de),!C&&k.current>JEe&&E(!0),R&&!sS(de,I)&&R(Z,de,xe)}),le=_r(Z=>{const V=oS(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=_r(Z=>{if(r)return;x8()||Z.preventDefault();const V=Z.changedTouches[0];V!=null&&(x.current=V.identifier);const de=oS(Z,x);if(de!==!1){const{newValue:Me,activeIndex:me}=F({finger:de});aS({sliderRef:q,activeIndex:me,setActive:_}),P(Me),R&&!sS(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:x8()}),()=>{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=oS(V,x);if(xe!==!1){const{newValue:me,activeIndex:$e}=F({finger:xe});aS({sliderRef:q,activeIndex:$e,setActive:_}),P(me),R&&!sS(me,I)&&R(V,me,$e)}k.current=0;const Me=$n(q.current);Me.addEventListener("mousemove",ce,{passive:!0}),Me.addEventListener("mouseup",le)},ge=kT(T?L[0]:l,l,s),ye=kT(L[L.length-1],l,s)-ge,H=(Z={})=>{const V=Nh(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:rPe,dragging:C,focusedThumbIndex:D,getHiddenInputProps:(Z={})=>{var V;const de=Nh(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({},FSe,{direction:o?"rtl":"ltr",width:"100%",height:"100%"})})},getRootProps:H,getThumbProps:(Z={})=>{const V=Nh(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 aPe(t={}){const{autoHideDuration:e=null,disableWindowBlurListener:n=!1,onClose:r,open:i,resumeHideDuration:o}=t,a=bf();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=_r((v,y)=>{r==null||r(v,y)}),l=_r(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({},Nh(t),Nh(v));return j({role:"presentation"},v,y,{onBlur:d(y),onFocus:h(y),onMouseEnter:p(y),onMouseLeave:m(y)})},onClickAway:c}}const sPe=["onChange","maxRows","minRows","style","value"];function cS(t){return parseInt(t,10)||0}const lPe={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function cPe(t){return t==null||Object.keys(t).length===0||t.outerHeightStyle===0&&!t.overflowing}const uPe=M.forwardRef(function(e,n){const{onChange:r,maxRows:i,minRows:o=1,style:a,value:s}=e,l=Ae(e,sPe),{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=cs(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,_=cS(y.paddingBottom)+cS(y.paddingTop),S=cS(y.borderBottomWidth)+cS(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(cPe(g))return;const v=u.current;v.style.height=`${g.outerHeightStyle}px`,v.style.overflow=g.overflowing?"hidden":""},[h]);Hr(()=>{const g=()=>{p()};let v;const y=Kv(g),x=u.current,b=cs(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]),Hr(()=>{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({},lPe.shadow,a,{paddingTop:0,paddingBottom:0})})]})});var b5={};Object.defineProperty(b5,"__esModule",{value:!0});var $re=b5.default=void 0,fPe=hPe(M),dPe=mre;function Fre(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(Fre=function(r){return r?n:e})(t)}function hPe(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=Fre(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 pPe(t){return Object.keys(t).length===0}function mPe(t=null){const e=fPe.useContext(dPe.ThemeContext);return!e||pPe(e)?t:e}$re=b5.default=mPe;const gPe=["anchorEl","component","components","componentsProps","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition","slots","slotProps"],vPe=we(ZEe,{name:"MuiPopper",slot:"Root",overridesResolver:(t,e)=>e.root})({}),_5=M.forwardRef(function(e,n){var r;const i=$re(),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,gPe),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(vPe,j({as:s,direction:i==null?void 0:i.direction,slots:{root:S},slotProps:b??c},O,{ref:n}))}),yPe=ni(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 xPe(t){return We("MuiChip",t)}const fn=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"]),bPe=["avatar","className","clickable","color","component","deleteIcon","disabled","icon","label","onClick","onDelete","onKeyDown","onKeyUp","size","variant","tabIndex","skipFocusWhenDisabled"],_Pe=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,xPe,e)},wPe=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}}})),SPe=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 b8(t){return t.key==="Backspace"||t.key==="Delete"}const OPe=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,bPe),S=M.useRef(null),O=Zt(S,n),C=W=>{W.stopPropagation(),p&&p(W)},E=W=>{W.currentTarget===W.target&&b8(W)&&W.preventDefault(),m&&m(W)},k=W=>{W.currentTarget===W.target&&(p&&b8(W)?p(W):W.key==="Escape"&&S.current&&S.current.blur()),g&&g(W)},I=a!==!1&&h?!0:a,P=I||p?fs: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=_Pe(R),L=P===fs?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(yPe,{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 U=null;return f&&M.isValidElement(f)&&(U=M.cloneElement(f,{className:ke(T.icon,f.props.className)})),w.jsxs(wPe,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||U,w.jsx(SPe,{className:ke(T.label),ownerState:R,children:d}),z]}))});function gd({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 qM=M.createContext(void 0);function oc(){return M.useContext(qM)}function jre(t){return w.jsx(Ywe,j({},t,{defaultTheme:IM,themeId:Kh}))}function _8(t){return t!=null&&!(Array.isArray(t)&&t.length===0)}function AT(t,e=!1){return t&&(_8(t.value)&&t.value!==""||e&&_8(t.defaultValue)&&t.defaultValue!=="")}function CPe(t){return t.startAdornment}function TPe(t){return We("MuiInputBase",t)}const Jg=Ve("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),EPe=["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"],XM=(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]},QM=(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]},PPe=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,TPe,e)},YM=we("div",{name:"MuiInputBase",slot:"Root",overridesResolver:XM})(({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",[`&.${Jg.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%"})),KM=we("input",{name:"MuiInputBase",slot:"Input",overridesResolver:QM})(({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] + .${Jg.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},[`&.${Jg.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"})}),MPe=w.jsx(jre,{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}}),kPe=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:U={},slots:W={},startAdornment:$,type:N="text",value:D}=i,A=Ae(i,EPe),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=oc(),re=gd({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=>{AT(Z)?ve&&ve():F&&F()},[ve,F]);Hr(()=>{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(fu(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=uPe);const H=Z=>{ce(Z.animationName==="mui-auto-fill-cancel"?K.current:{value:"x"})};M.useEffect(()=>{be&&be.setAdornedStart(!!$)},[be,$]);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:$,type:N}),ie=PPe(G),he=W.root||c.Root||YM,_e=U.root||u.root||{},oe=W.input||c.Input||KM;return ye=j({},ye,(r=U.input)!=null?r:u.input),w.jsxs(M.Fragment,{children:[!h&&MPe,w.jsxs(he,j({},_e,!Vl(he)&&{ownerState:j({},G,_e.ownerState)},{ref:n,onClick:ee},A,{className:ke(ie.root,_e.className,l,L&&"MuiInputBase-readOnly"),children:[$,w.jsx(qM.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:N},ye,!Vl(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:$})):null]}))]})}),w5=kPe;function APe(t){return We("MuiInput",t)}const h0=j({},Jg,Ve("MuiInput",["root","underline","input"]));function RPe(t){return We("MuiOutlinedInput",t)}const Mu=j({},Jg,Ve("MuiOutlinedInput",["root","notchedOutline","input"]));function IPe(t){return We("MuiFilledInput",t)}const $d=j({},Jg,Ve("MuiFilledInput",["root","underline","input"])),DPe=ni(w.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),LPe=ni(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 NPe(t){return We("MuiAvatar",t)}Ve("MuiAvatar",["root","colorDefault","circular","rounded","square","img","fallback"]);const $Pe=["alt","children","className","component","slots","slotProps","imgProps","sizes","src","srcSet","variant"],FPe=l5(),jPe=t=>{const{classes:e,variant:n,colorDefault:r}=t;return Ue({root:["root",n,r&&"colorDefault"],img:["img"],fallback:["fallback"]},NPe,e)},BPe=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]})))}]})),zPe=we("img",{name:"MuiAvatar",slot:"Img",overridesResolver:(t,e)=>e.img})({width:"100%",height:"100%",textAlign:"center",objectFit:"cover",color:"transparent",textIndent:1e4}),UPe=we(LPe,{name:"MuiAvatar",slot:"Fallback",overridesResolver:(t,e)=>e.fallback})({width:"75%",height:"75%"});function WPe({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 EA=M.forwardRef(function(e,n){const r=FPe({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,$Pe);let g=null;const v=WPe(j({},u,{src:d,srcSet:h})),y=d||h,x=y&&v!=="error",b=j({},r,{colorDefault:!x,component:s,variant:p}),_=jPe(b),[S,O]=zCe("img",{className:_.img,elementType:zPe,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(UPe,{ownerState:b,className:_.fallback}),w.jsx(BPe,j({as:s,ownerState:b,className:ke(_.root,a),ref:n},m,{children:g}))}),VPe=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],GPe={entering:{opacity:1},entered:{opacity:1}},ZM=M.forwardRef(function(e,n){const r=Go(),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=ka}=e,x=Ae(e,VPe),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)=>{f5(T);const z=Zf({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=Zf({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},GPe[T],g,s.props.style),ref:_},L))}))});function HPe(t){return We("MuiBackdrop",t)}Ve("MuiBackdrop",["root","invisible"]);const qPe=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],XPe=t=>{const{classes:e,invisible:n}=t;return Ue({root:["root",n&&"invisible"]},HPe,e)},QPe=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"})),Bre=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=ZM,transitionDuration:v}=a,y=Ae(a,qPe),x=j({},a,{component:c,invisible:d}),b=XPe(x),_=(r=p.root)!=null?r:f.root;return w.jsx(g,j({in:h,timeout:v},y,{children:w.jsx(QPe,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}))}))}),YPe=Ve("MuiBox",["root"]),KPe=o5(),Ke=nSe({themeId:Kh,defaultTheme:KPe,defaultClassName:YPe.root,generateClassName:Yj.generate});function ZPe(t){return We("MuiButton",t)}const uS=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"]),JPe=M.createContext({}),eMe=M.createContext(void 0),tMe=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],nMe=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,ZPe,a);return j({},a,l)},zre=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}}),rMe=we(fs,{shouldForwardProp:t=>hi(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]}),[`&.${uS.focusVisible}`]:j({},e.variant==="contained"&&{boxShadow:(t.vars||t).shadows[6]}),[`&.${uS.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"},[`&.${uS.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${uS.disabled}`]:{boxShadow:"none"}}),iMe=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},zre(t))),oMe=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},zre(t))),tr=M.forwardRef(function(e,n){const r=M.useContext(JPe),i=M.useContext(eMe),o=kM(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,tMe),S=j({},a,{color:l,component:c,disabled:f,disableElevation:d,disableFocusRipple:h,fullWidth:g,size:v,type:x,variant:b}),O=nMe(S),C=y&&w.jsx(iMe,{className:O.startIcon,ownerState:S,children:y}),E=p&&w.jsx(oMe,{className:O.endIcon,ownerState:S,children:p}),k=i||"";return w.jsxs(rMe,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]}))});function aMe(t){return We("MuiCard",t)}Ve("MuiCard",["root"]);const sMe=["className","raised"],lMe=t=>{const{classes:e}=t;return Ue({root:["root"]},aMe,e)},cMe=we(Ho,{name:"MuiCard",slot:"Root",overridesResolver:(t,e)=>e.root})(()=>({overflow:"hidden"})),Ure=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiCard"}),{className:i,raised:o=!1}=r,a=Ae(r,sMe),s=j({},r,{raised:o}),l=lMe(s);return w.jsx(cMe,j({className:ke(l.root,i),elevation:o?8:void 0,ref:n,ownerState:s},a))});function uMe(t){return We("MuiCardActions",t)}Ve("MuiCardActions",["root","spacing"]);const fMe=["disableSpacing","className"],dMe=t=>{const{classes:e,disableSpacing:n}=t;return Ue({root:["root",!n&&"spacing"]},uMe,e)},hMe=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}})),Wre=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiCardActions"}),{disableSpacing:i=!1,className:o}=r,a=Ae(r,fMe),s=j({},r,{disableSpacing:i}),l=dMe(s);return w.jsx(hMe,j({className:ke(l.root,o),ownerState:s,ref:n},a))});function pMe(t){return We("MuiCardContent",t)}Ve("MuiCardContent",["root"]);const mMe=["className","component"],gMe=t=>{const{classes:e}=t;return Ue({root:["root"]},pMe,e)},vMe=we("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(t,e)=>e.root})(()=>({padding:16,"&:last-child":{paddingBottom:24}})),Vre=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiCardContent"}),{className:i,component:o="div"}=r,a=Ae(r,mMe),s=j({},r,{component:o}),l=gMe(s);return w.jsx(vMe,j({as:o,className:ke(l.root,i),ownerState:s,ref:n},a))});function yMe(t){return We("MuiCardHeader",t)}const w8=Ve("MuiCardHeader",["root","avatar","action","content","title","subheader"]),xMe=["action","avatar","className","component","disableTypography","subheader","subheaderTypographyProps","title","titleTypographyProps"],bMe=t=>{const{classes:e}=t;return Ue({root:["root"],avatar:["avatar"],action:["action"],content:["content"],title:["title"],subheader:["subheader"]},yMe,e)},_Me=we("div",{name:"MuiCardHeader",slot:"Root",overridesResolver:(t,e)=>j({[`& .${w8.title}`]:e.title,[`& .${w8.subheader}`]:e.subheader},e.root)})({display:"flex",alignItems:"center",padding:16}),wMe=we("div",{name:"MuiCardHeader",slot:"Avatar",overridesResolver:(t,e)=>e.avatar})({display:"flex",flex:"0 0 auto",marginRight:16}),SMe=we("div",{name:"MuiCardHeader",slot:"Action",overridesResolver:(t,e)=>e.action})({flex:"0 0 auto",alignSelf:"flex-start",marginTop:-4,marginRight:-8,marginBottom:-4}),OMe=we("div",{name:"MuiCardHeader",slot:"Content",overridesResolver:(t,e)=>e.content})({flex:"1 1 auto"}),CMe=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,xMe),p=j({},r,{component:s,disableTypography:l}),m=bMe(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(_Me,j({className:ke(m.root,a),as:s,ref:n,ownerState:p},h,{children:[o&&w.jsx(wMe,{className:m.avatar,ownerState:p,children:o}),w.jsxs(OMe,{className:m.content,ownerState:p,children:[g,v]}),i&&w.jsx(SMe,{className:m.action,ownerState:p,children:i})]}))});function TMe(t){return We("MuiCardMedia",t)}Ve("MuiCardMedia",["root","media","img"]);const EMe=["children","className","component","image","src","style"],PMe=t=>{const{classes:e,isMediaComponent:n,isImageComponent:r}=t;return Ue({root:["root",n&&"media",r&&"img"]},TMe,e)},MMe=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"})),kMe=["video","audio","picture","iframe","img"],AMe=["picture","img"],RMe=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,EMe),f=kMe.indexOf(a)!==-1,d=!f&&s?j({backgroundImage:`url("${s}")`},c):c,h=j({},r,{component:a,isMediaComponent:f,isImageComponent:AMe.indexOf(a)!==-1}),p=PMe(h);return w.jsx(MMe,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}))});function IMe(t){return We("PrivateSwitchBase",t)}Ve("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const DMe=["autoFocus","checked","checkedIcon","className","defaultChecked","disabled","disableFocusRipple","edge","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"],LMe=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,IMe,e)},NMe=we(fs)(({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})),$Me=we("input",{shouldForwardProp:hi})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),S5=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,DMe),[E,k]=Qs({controlled:i,default:!!s,name:"SwitchBase",state:"checked"}),I=oc(),P=W=>{y&&y(W),I&&I.onFocus&&I.onFocus(W)},R=W=>{g&&g(W),I&&I.onBlur&&I.onBlur(W)},T=W=>{if(W.nativeEvent.defaultPrevented)return;const $=W.target.checked;k($),v&&v(W,$)};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}),U=LMe(B);return w.jsxs(NMe,j({component:"span",className:ke(U.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($Me,j({autoFocus:r,checked:i,defaultChecked:s,className:U.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]}))}),FMe=ni(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"),jMe=ni(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"),BMe=ni(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 zMe(t){return We("MuiCheckbox",t)}const PA=Ve("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),UMe=["checkedIcon","color","icon","indeterminate","indeterminateIcon","inputProps","size","className"],WMe=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,zMe,e);return j({},e,a)},VMe=we(S5,{shouldForwardProp:t=>hi(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"&&{[`&.${PA.checked}, &.${PA.indeterminate}`]:{color:(t.vars||t).palette[e.color].main},[`&.${PA.disabled}`]:{color:(t.vars||t).palette.action.disabled}})),GMe=w.jsx(jMe,{}),HMe=w.jsx(FMe,{}),qMe=w.jsx(BMe,{}),UL=M.forwardRef(function(e,n){var r,i;const o=qe({props:e,name:"MuiCheckbox"}),{checkedIcon:a=GMe,color:s="primary",icon:l=HMe,indeterminate:c=!1,indeterminateIcon:u=qMe,inputProps:f,size:d="medium",className:h}=o,p=Ae(o,UMe),m=c?u:l,g=c?u:a,v=j({},o,{color:s,indeterminate:c,size:d}),y=WMe(v);return w.jsx(VMe,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}))});function XMe(t){return We("MuiCircularProgress",t)}Ve("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const QMe=["className","color","disableShrink","size","style","thickness","value","variant"];let JM=t=>t,S8,O8,C8,T8;const ku=44,YMe=Qv(S8||(S8=JM` +`),Fa.rippleVisible,VCe,$L,({theme:t})=>t.transitions.easing.easeInOut,Fa.ripplePulsate,({theme:t})=>t.transitions.duration.shorter,Fa.child,Fa.childLeaving,GCe,$L,({theme:t})=>t.transitions.easing.easeInOut,Fa.childPulsate,HCe,({theme:t})=>t.transitions.easing.easeInOut),QCe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTouchRipple"}),{center:i=!1,classes:o={},className:a}=r,s=Ae(r,UCe),[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=bf(),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(XCe,{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:$L,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(WCe,()=>{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(qCe,j({className:ke(Fa.root,o.root,a),ref:m},s,{children:w.jsx(D1,{component:null,exit:!0,children:l})}))});function YCe(t){return We("MuiButtonBase",t)}const KCe=Ve("MuiButtonBase",["root","disabled","focusVisible"]),ZCe=["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"],JCe=t=>{const{disabled:e,focusVisible:n,focusVisibleClassName:r,classes:i}=t,a=Ue({root:["root",e&&"disabled",n&&"focusVisible"]},YCe,i);return n&&r&&(a.root+=` ${r}`),a},eTe=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"},[`&.${KCe.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),fs=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,ZCe),B=M.useRef(null),U=M.useRef(null),W=Zt(U,T),{isFocusVisibleRef:$,onFocus:N,onBlur:D,ref:A}=k1(),[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&&U.current.pulsate()},[u,d,q,K]);function J(V,de,xe=f){return _r(Me=>(de&&de(Me),!xe&&U.current&&U.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),$.current===!1&&Y(!1),p&&p(V)},!1),ee=_r(V=>{B.current||(B.current=V.currentTarget),N(V),$.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=_r(V=>{d&&!ye.current&&q&&U.current&&V.key===" "&&(ye.current=!0,U.current.stop(V,()=>{U.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=_r(V=>{d&&V.key===" "&&U.current&&q&&!V.defaultPrevented&&(ye.current=!1,U.current.stop(V,()=>{U.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=JCe(oe);return w.jsxs(eTe,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(QCe,j({ref:W,center:o},R)):null]}))});function tTe(t){return We("MuiIconButton",t)}const nTe=Ve("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),rTe=["edge","children","className","color","disabled","disableFocusRipple","size"],iTe=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,tTe,e)},oTe=we(fs,{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)},{[`&.${nTe.disabled}`]:{backgroundColor:"transparent",color:(t.vars||t).palette.action.disabled}})}),Ot=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,rTe),d=j({},r,{edge:i,color:s,disabled:l,disableFocusRipple:c,size:u}),h=iTe(d);return w.jsx(oTe,j({className:ke(h.root,a),centerRipple:!0,focusRipple:!c,disabled:l,ref:n},f,{ownerState:d,children:o}))});function aTe(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 sTe=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],lTe=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,aTe,a)},cTe=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})),r8={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},uTe={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},fTe=t=>uTe[t]||t,At=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTypography"}),i=fTe(r.color),o=P1(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=r8}=o,p=Ae(o,sTe),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]||r8[d])||"span",v=lTe(m);return w.jsx(cTe,j({as:g,ref:n,ownerState:m,className:ke(v.root,s)},p))});function dTe(t){return We("MuiAppBar",t)}Ve("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const hTe=["className","color","enableColorOnDark","position"],pTe=t=>{const{color:e,position:n,classes:r}=t,i={root:["root",`color${De(e)}`,`position${De(n)}`]};return Ue(i,dTe,r)},rS=(t,e)=>t?`${t==null?void 0:t.replace(")","")}, ${e})`:e,mTe=we(Ho,{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:rS(t.vars.palette.AppBar.darkBg,t.vars.palette.AppBar.defaultBg),"--AppBar-color":e.enableColorOnDark?t.vars.palette.text.primary:rS(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:rS(t.vars.palette.AppBar.darkBg,t.vars.palette[e.color].main),"--AppBar-color":e.enableColorOnDark?t.vars.palette[e.color].contrastText:rS(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"}))}),xre=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,hTe),c=j({},r,{color:o,position:s,enableColorOnDark:a}),u=pTe(c);return w.jsx(mTe,j({square:!0,component:"header",ownerState:c,elevation:4,className:ke(u.root,i,s==="fixed"&&"mui-fixed"),ref:n},l))}),bre="base";function gTe(t){return`${bre}--${t}`}function vTe(t,e){return`${bre}-${t}-${e}`}function _re(t,e){const n=Vne[e];return n?gTe(n):vTe(t,e)}function yTe(t,e){const n={};return e.forEach(r=>{n[r]=_re(t,r)}),n}function i8(t){return t.substring(2).toLowerCase()}function xTe(t,e){return e.documentElement.clientWidth(setTimeout(()=>{l.current=!0},0),()=>{l.current=!1}),[]);const u=Zt(e.ref,s),f=_r(p=>{const m=c.current;c.current=!1;const g=$n(s.current);if(!l.current||!s.current||"clientX"in p&&xTe(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=i8(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=i8(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 _Te=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function wTe(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 STe(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 OTe(t){return!(t.disabled||t.tagName==="INPUT"&&t.type==="hidden"||STe(t))}function CTe(t){const e=[],n=[];return Array.from(t.querySelectorAll(_Te)).forEach((r,i)=>{const o=wTe(r);o===-1||!OTe(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 TTe(){return!0}function wre(t){const{children:e,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:i=!1,getTabbable:o=CTe,isEnabled:a=TTe,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 ETe(t){return typeof t=="function"?t():t}const Sre=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(Hr(()=>{o||s(ETe(i)||document.body)},[i,o]),Hr(()=>{if(a&&!o)return CT(n,a),()=>{CT(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&&qv.createPortal(r,a)})});function PTe(t){const e=$n(t);return e.body===t?cs(t).innerWidth>e.documentElement.clientWidth:t.scrollHeight>t.clientHeight}function $x(t,e){e?t.setAttribute("aria-hidden","true"):t.removeAttribute("aria-hidden")}function o8(t){return parseInt(cs(t).getComputedStyle(t).paddingRight,10)||0}function MTe(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 a8(t,e,n,r,i){const o=[e,n,...r];[].forEach.call(t.children,a=>{const s=o.indexOf(a)===-1,l=!MTe(a);s&&l&&$x(a,i)})}function TA(t,e){let n=-1;return t.some((r,i)=>e(r)?(n=i,!0):!1),n}function kTe(t,e){const n=[],r=t.container;if(!e.disableScrollLock){if(PTe(r)){const a=ere($n(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${o8(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=`${o8(l)+a}px`})}let o;if(r.parentNode instanceof DocumentFragment)o=$n(r).body;else{const a=r.parentElement,s=cs(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 ATe(t){const e=[];return[].forEach.call(t.children,n=>{n.getAttribute("aria-hidden")==="true"&&e.push(n)}),e}class RTe{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&&$x(e.modalRef,!1);const i=ATe(n);a8(n,e.mount,e.modalRef,i,!0);const o=TA(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=TA(this.containers,o=>o.modals.indexOf(e)!==-1),i=this.containers[r];i.restore||(i.restore=kTe(i,n))}remove(e,n=!0){const r=this.modals.indexOf(e);if(r===-1)return r;const i=TA(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&&$x(e.modalRef,n),a8(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&&$x(a.modalRef,!1)}return r}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}}function ITe(t){return typeof t=="function"?t():t}function DTe(t){return t?t.props.hasOwnProperty("in"):!1}const LTe=new RTe;function NTe(t){const{container:e,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,manager:i=LTe,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=DTe(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=_r(()=>{const z=ITe(e)||b().body;i.add(_(),z),p.current&&S()}),C=M.useCallback(()=>i.isTopModal(_()),[i]),E=_r(z=>{h.current=z,z&&(u&&C()?S():p.current&&$x(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 U;(U=z.onKeyDown)==null||U.call(z,B),!(B.key!=="Escape"||B.which===229||!C())&&(n||(B.stopPropagation(),c&&c(B,"escapeKeyDown")))},P=z=>B=>{var U;(U=z.onClick)==null||U.call(z,B),B.target===B.currentTarget&&c&&c(B,"backdropClick")};return{getRootProps:(z={})=>{const B=Nh(t);delete B.onTransitionEnter,delete B.onTransitionExited;const U=j({},B,z);return j({role:"presentation"},U,{onKeyDown:I(U),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:OT(z,l==null?void 0:l.props.onEnter),onExited:OT(B,l==null?void 0:l.props.onExited)}},rootRef:m,portalRef:E,isTopModal:C,exited:g,hasTransition:y}}var No="top",ds="bottom",hs="right",$o="left",d5="auto",L1=[No,ds,hs,$o],Qg="start",Rb="end",$Te="clippingParents",Ore="viewport",f0="popper",FTe="reference",s8=L1.reduce(function(t,e){return t.concat([e+"-"+Qg,e+"-"+Rb])},[]),Cre=[].concat(L1,[d5]).reduce(function(t,e){return t.concat([e,e+"-"+Qg,e+"-"+Rb])},[]),jTe="beforeRead",BTe="read",zTe="afterRead",UTe="beforeMain",WTe="main",VTe="afterMain",GTe="beforeWrite",HTe="write",qTe="afterWrite",XTe=[jTe,BTe,zTe,UTe,WTe,VTe,GTe,HTe,qTe];function Jl(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 Jh(t){var e=Sa(t).Element;return t instanceof e||t instanceof Element}function es(t){var e=Sa(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function h5(t){if(typeof ShadowRoot>"u")return!1;var e=Sa(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function QTe(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];!es(o)||!Jl(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 YTe(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},{});!es(i)||!Jl(i)||(Object.assign(i.style,s),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const KTe={name:"applyStyles",enabled:!0,phase:"write",fn:QTe,effect:YTe,requires:["computeStyles"]};function Gl(t){return t.split("-")[0]}var $h=Math.max,MT=Math.min,Yg=Math.round;function FL(){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 Tre(){return!/^((?!chrome|android).)*safari/i.test(FL())}function Kg(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&es(t)&&(i=t.offsetWidth>0&&Yg(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&Yg(r.height)/t.offsetHeight||1);var a=Jh(t)?Sa(t):window,s=a.visualViewport,l=!Tre()&&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 p5(t){var e=Kg(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 Ere(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&h5(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function du(t){return Sa(t).getComputedStyle(t)}function ZTe(t){return["table","td","th"].indexOf(Jl(t))>=0}function md(t){return((Jh(t)?t.ownerDocument:t.document)||window.document).documentElement}function HM(t){return Jl(t)==="html"?t:t.assignedSlot||t.parentNode||(h5(t)?t.host:null)||md(t)}function l8(t){return!es(t)||du(t).position==="fixed"?null:t.offsetParent}function JTe(t){var e=/firefox/i.test(FL()),n=/Trident/i.test(FL());if(n&&es(t)){var r=du(t);if(r.position==="fixed")return null}var i=HM(t);for(h5(i)&&(i=i.host);es(i)&&["html","body"].indexOf(Jl(i))<0;){var o=du(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 N1(t){for(var e=Sa(t),n=l8(t);n&&ZTe(n)&&du(n).position==="static";)n=l8(n);return n&&(Jl(n)==="html"||Jl(n)==="body"&&du(n).position==="static")?e:n||JTe(t)||e}function m5(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Fx(t,e,n){return $h(t,MT(e,n))}function eEe(t,e,n){var r=Fx(t,e,n);return r>n?n:r}function Pre(){return{top:0,right:0,bottom:0,left:0}}function Mre(t){return Object.assign({},Pre(),t)}function kre(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var tEe=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,Mre(typeof e!="number"?e:kre(e,L1))};function nEe(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Gl(n.placement),l=m5(s),c=[$o,hs].indexOf(s)>=0,u=c?"height":"width";if(!(!o||!a)){var f=tEe(i.padding,n),d=p5(o),h=l==="y"?No:$o,p=l==="y"?ds:hs,m=n.rects.reference[u]+n.rects.reference[l]-a[l]-n.rects.popper[u],g=a[l]-n.rects.reference[l],v=N1(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=Fx(b,S,_),C=l;n.modifiersData[r]=(e={},e[C]=O,e.centerOffset=O-S,e)}}function rEe(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)||Ere(e.elements.popper,i)&&(e.elements.arrow=i))}const iEe={name:"arrow",enabled:!0,phase:"main",fn:nEe,effect:rEe,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Zg(t){return t.split("-")[1]}var oEe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function aEe(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:Yg(n*i)/i||0,y:Yg(r*i)/i||0}}function c8(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=No,_=window;if(c){var S=N1(n),O="clientHeight",C="clientWidth";if(S===Sa(n)&&(S=md(n),du(S).position!=="static"&&s==="absolute"&&(O="scrollHeight",C="scrollWidth")),S=S,i===No||(i===$o||i===hs)&&o===Rb){b=ds;var E=f&&S===_&&_.visualViewport?_.visualViewport.height:S[O];m-=E-r.height,m*=l?1:-1}if(i===$o||(i===No||i===ds)&&o===Rb){x=hs;var k=f&&S===_&&_.visualViewport?_.visualViewport.width:S[C];h-=k-r.width,h*=l?1:-1}}var I=Object.assign({position:s},c&&oEe),P=u===!0?aEe({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 sEe(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:Gl(e.placement),variation:Zg(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,c8(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,c8(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 lEe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:sEe,data:{}};var iS={passive:!0};function cEe(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,iS)}),s&&l.addEventListener("resize",n.update,iS),function(){o&&c.forEach(function(u){u.removeEventListener("scroll",n.update,iS)}),s&&l.removeEventListener("resize",n.update,iS)}}const uEe={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:cEe,data:{}};var fEe={left:"right",right:"left",bottom:"top",top:"bottom"};function PC(t){return t.replace(/left|right|bottom|top/g,function(e){return fEe[e]})}var dEe={start:"end",end:"start"};function u8(t){return t.replace(/start|end/g,function(e){return dEe[e]})}function g5(t){var e=Sa(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function v5(t){return Kg(md(t)).left+g5(t).scrollLeft}function hEe(t,e){var n=Sa(t),r=md(t),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;var c=Tre();(c||!c&&e==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s+v5(t),y:l}}function pEe(t){var e,n=md(t),r=g5(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=$h(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=$h(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+v5(t),l=-r.scrollTop;return du(i||n).direction==="rtl"&&(s+=$h(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}function y5(t){var e=du(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Are(t){return["html","body","#document"].indexOf(Jl(t))>=0?t.ownerDocument.body:es(t)&&y5(t)?t:Are(HM(t))}function jx(t,e){var n;e===void 0&&(e=[]);var r=Are(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=Sa(r),a=i?[o].concat(o.visualViewport||[],y5(r)?r:[]):r,s=e.concat(a);return i?s:s.concat(jx(HM(a)))}function jL(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function mEe(t,e){var n=Kg(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 f8(t,e,n){return e===Ore?jL(hEe(t,n)):Jh(e)?mEe(e,n):jL(pEe(md(t)))}function gEe(t){var e=jx(HM(t)),n=["absolute","fixed"].indexOf(du(t).position)>=0,r=n&&es(t)?N1(t):t;return Jh(r)?e.filter(function(i){return Jh(i)&&Ere(i,r)&&Jl(i)!=="body"}):[]}function vEe(t,e,n,r){var i=e==="clippingParents"?gEe(t):[].concat(e),o=[].concat(i,[n]),a=o[0],s=o.reduce(function(l,c){var u=f8(t,c,r);return l.top=$h(u.top,l.top),l.right=MT(u.right,l.right),l.bottom=MT(u.bottom,l.bottom),l.left=$h(u.left,l.left),l},f8(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 Rre(t){var e=t.reference,n=t.element,r=t.placement,i=r?Gl(r):null,o=r?Zg(r):null,a=e.x+e.width/2-n.width/2,s=e.y+e.height/2-n.height/2,l;switch(i){case No:l={x:a,y:e.y-n.height};break;case ds:l={x:a,y:e.y+e.height};break;case hs: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?m5(i):null;if(c!=null){var u=c==="y"?"height":"width";switch(o){case Qg:l[c]=l[c]-(e[u]/2-n[u]/2);break;case Rb:l[c]=l[c]+(e[u]/2-n[u]/2);break}}return l}function Ib(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?$Te:s,c=n.rootBoundary,u=c===void 0?Ore:c,f=n.elementContext,d=f===void 0?f0:f,h=n.altBoundary,p=h===void 0?!1:h,m=n.padding,g=m===void 0?0:m,v=Mre(typeof g!="number"?g:kre(g,L1)),y=d===f0?FTe:f0,x=t.rects.popper,b=t.elements[p?y:d],_=vEe(Jh(b)?b:b.contextElement||md(t.elements.popper),l,u,a),S=Kg(t.elements.reference),O=Rre({reference:S,element:x,strategy:"absolute",placement:i}),C=jL(Object.assign({},x,O)),E=d===f0?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===f0&&I){var P=I[i];Object.keys(k).forEach(function(R){var T=[hs,ds].indexOf(R)>=0?1:-1,L=[No,ds].indexOf(R)>=0?"y":"x";k[R]+=P[L]*T})}return k}function yEe(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?Cre:l,u=Zg(r),f=u?s?s8:s8.filter(function(p){return Zg(p)===u}):L1,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]=Ib(t,{placement:m,boundary:i,rootBoundary:o,padding:a})[Gl(m)],p},{});return Object.keys(h).sort(function(p,m){return h[p]-h[m]})}function xEe(t){if(Gl(t)===d5)return[];var e=PC(t);return[u8(t),e,u8(e)]}function bEe(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=Gl(g),y=v===g,x=l||(y||!p?[PC(g)]:xEe(g)),b=[g].concat(x).reduce(function(q,Y){return q.concat(Gl(Y)===d5?yEe(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=Ib(e,{placement:I,boundary:u,rootBoundary:f,altBoundary:d,padding:c}),B=T?R?hs:$o:R?ds:No;_[L]>S[L]&&(B=PC(B));var U=PC(B),W=[];if(o&&W.push(z[P]<=0),s&&W.push(z[B]<=0,z[U]<=0),W.every(function(q){return q})){E=I,C=!1;break}O.set(I,W)}if(C)for(var $=p?3:1,N=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=$;D>0;D--){var A=N(D);if(A==="break")break}e.placement!==E&&(e.modifiersData[r]._skip=!0,e.placement=E,e.reset=!0)}}const _Ee={name:"flip",enabled:!0,phase:"main",fn:bEe,requiresIfExists:["offset"],data:{_skip:!1}};function d8(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 h8(t){return[No,hs,ds,$o].some(function(e){return t[e]>=0})}function wEe(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,a=Ib(e,{elementContext:"reference"}),s=Ib(e,{altBoundary:!0}),l=d8(a,r),c=d8(s,i,o),u=h8(l),f=h8(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 SEe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:wEe};function OEe(t,e,n){var r=Gl(t),i=[$o,No].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,hs].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function CEe(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,a=Cre.reduce(function(u,f){return u[f]=OEe(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 TEe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:CEe};function EEe(t){var e=t.state,n=t.name;e.modifiersData[n]=Rre({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const PEe={name:"popperOffsets",enabled:!0,phase:"read",fn:EEe,data:{}};function MEe(t){return t==="x"?"y":"x"}function kEe(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=Ib(e,{boundary:l,rootBoundary:c,padding:f,altBoundary:u}),v=Gl(e.placement),y=Zg(e.placement),x=!y,b=m5(v),_=MEe(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"?No:$o,L=b==="y"?ds:hs,z=b==="y"?"height":"width",B=S[b],U=B+g[T],W=B-g[L],$=h?-C[z]/2:0,N=y===Qg?O[z]:C[z],D=y===Qg?-C[z]:-O[z],A=e.elements.arrow,q=h&&A?p5(A):{width:0,height:0},Y=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Pre(),K=Y[T],se=Y[L],te=Fx(0,O[z],q[z]),J=x?O[z]/2-$-te-K-k.mainAxis:N-te-K-k.mainAxis,pe=x?-O[z]/2+$+te+se+k.mainAxis:D+te+se+k.mainAxis,be=e.elements.arrow&&N1(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=Fx(h?MT(U,F):U,B,h?$h(W,ce):W);S[b]=le,P[b]=le-B}if(s){var Q,X=b==="x"?No:$o,ee=b==="x"?ds:hs,ge=S[_],ye=_==="y"?"height":"width",H=ge+g[X],G=ge-g[ee],ie=[No,$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?eEe(_e,ge,oe):Fx(h?_e:H,ge,h?oe:G);S[_]=Z,P[_]=Z-ge}e.modifiersData[r]=P}}const AEe={name:"preventOverflow",enabled:!0,phase:"main",fn:kEe,requiresIfExists:["offset"]};function REe(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function IEe(t){return t===Sa(t)||!es(t)?g5(t):REe(t)}function DEe(t){var e=t.getBoundingClientRect(),n=Yg(e.width)/t.offsetWidth||1,r=Yg(e.height)/t.offsetHeight||1;return n!==1||r!==1}function LEe(t,e,n){n===void 0&&(n=!1);var r=es(e),i=es(e)&&DEe(e),o=md(e),a=Kg(t,i,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((Jl(e)!=="body"||y5(o))&&(s=IEe(e)),es(e)?(l=Kg(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):o&&(l.x=v5(o))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function NEe(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 $Ee(t){var e=NEe(t);return XTe.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function FEe(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function jEe(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 p8={placement:"bottom",modifiers:[],strategy:"absolute"};function m8(){for(var t=arguments.length,e=new Array(t),n=0;nUe({root:["root"]},LCe(WEe)),QEe={},YEe=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,VEe),v=M.useRef(null),y=Zt(v,n),x=M.useRef(null),b=Zt(x,d),_=M.useRef(b);Hr(()=>{_.current=b},[b]),M.useImperativeHandle(d,()=>x.current,[]);const S=HEe(u,a),[O,C]=M.useState(S),[E,k]=M.useState(BL(i));M.useEffect(()=>{x.current&&x.current.forceUpdate()}),M.useEffect(()=>{i&&k(BL(i))},[i]),Hr(()=>{if(!E||!c)return;const L=U=>{C(U.placement)};let z=[{name:"preventOverflow",options:{altBoundary:s}},{name:"flip",options:{altBoundary:s}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:U})=>{L(U)}}];l!=null&&(z=z.concat(l)),f&&f.modifiers!=null&&(z=z.concat(f.modifiers));const B=UEe(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=XEe(),R=(r=p.root)!=null?r:"div",T=$r({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}))}),KEe=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=QEe,popperRef:h,style:p,transition:m=!1,slotProps:g={},slots:v={}}=e,y=Ae(e,GEe),[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=BL(r);O=k&&qEe(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(Sre,{disablePortal:s,container:O,children:w.jsx(YEe,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}))})}),ZEe=2;function Dre(t,e){return t-e}function g8(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}%`})}},rPe=t=>t;let lS;function y8(){return lS===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?lS=CSS.supports("touch-action","none"):lS=!0),lS}function iPe(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=rPe,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]=Qs({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(Dre):[I];L=L.map(Z=>Z==null?l:ah(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:U,onBlur:W,onFocus:$,ref:N}=k1(),[D,A]=M.useState(-1),q=M.useRef(),Y=Zt(N,q),K=Zt(h,Y),se=Z=>V=>{var de;const xe=Number(V.currentTarget.getAttribute("data-index"));$(V),U.current===!0&&A(xe),O(xe),Z==null||(de=Z.onFocus)==null||de.call(Z,V)},te=Z=>V=>{var de;W(V),U.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 $e=B[B.length-1];me>$e?me=$e: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)};Hr(()=>{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:$e}=de.getBoundingClientRect();let Te;ve.indexOf("vertical")===0?Te=(me-Z.y)/Me:Te=(Z.x-$e)/xe,ve.indexOf("-reverse")!==-1&&(Te=1-Te);let Re;if(Re=JEe(Te,l,s),m)Re=tPe(Re,m,l);else{const Le=g8(B,Re);Re=B[Le]}Re=ah(Re,l,s);let ae=0;if(T){V?ae=re.current:ae=g8(L,Re),i&&(Re=ah(Re,L[ae-1]||-1/0,L[ae+1]||1/0));const Le=Re;Re=v8({values:L,newValue:Re,index:ae}),i&&V||(ae=Re.indexOf(Le),re.current=ae)}return{newValue:Re,activeIndex:ae}},ce=_r(Z=>{const V=oS(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});aS({sliderRef:q,activeIndex:xe,setActive:_}),P(de),!C&&k.current>ZEe&&E(!0),R&&!sS(de,I)&&R(Z,de,xe)}),le=_r(Z=>{const V=oS(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=_r(Z=>{if(r)return;y8()||Z.preventDefault();const V=Z.changedTouches[0];V!=null&&(x.current=V.identifier);const de=oS(Z,x);if(de!==!1){const{newValue:Me,activeIndex:me}=F({finger:de});aS({sliderRef:q,activeIndex:me,setActive:_}),P(Me),R&&!sS(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:y8()}),()=>{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=oS(V,x);if(xe!==!1){const{newValue:me,activeIndex:$e}=F({finger:xe});aS({sliderRef:q,activeIndex:$e,setActive:_}),P(me),R&&!sS(me,I)&&R(V,me,$e)}k.current=0;const Me=$n(q.current);Me.addEventListener("mousemove",ce,{passive:!0}),Me.addEventListener("mouseup",le)},ge=kT(T?L[0]:l,l,s),ye=kT(L[L.length-1],l,s)-ge,H=(Z={})=>{const V=Nh(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=Nh(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({},$Se,{direction:o?"rtl":"ltr",width:"100%",height:"100%"})})},getRootProps:H,getThumbProps:(Z={})=>{const V=Nh(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 oPe(t={}){const{autoHideDuration:e=null,disableWindowBlurListener:n=!1,onClose:r,open:i,resumeHideDuration:o}=t,a=bf();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=_r((v,y)=>{r==null||r(v,y)}),l=_r(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({},Nh(t),Nh(v));return j({role:"presentation"},v,y,{onBlur:d(y),onFocus:h(y),onMouseEnter:p(y),onMouseLeave:m(y)})},onClickAway:c}}const aPe=["onChange","maxRows","minRows","style","value"];function cS(t){return parseInt(t,10)||0}const sPe={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function lPe(t){return t==null||Object.keys(t).length===0||t.outerHeightStyle===0&&!t.overflowing}const cPe=M.forwardRef(function(e,n){const{onChange:r,maxRows:i,minRows:o=1,style:a,value:s}=e,l=Ae(e,aPe),{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=cs(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,_=cS(y.paddingBottom)+cS(y.paddingTop),S=cS(y.borderBottomWidth)+cS(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(lPe(g))return;const v=u.current;v.style.height=`${g.outerHeightStyle}px`,v.style.overflow=g.overflowing?"hidden":""},[h]);Hr(()=>{const g=()=>{p()};let v;const y=Kv(g),x=u.current,b=cs(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]),Hr(()=>{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({},sPe.shadow,a,{paddingTop:0,paddingBottom:0})})]})});var x5={};Object.defineProperty(x5,"__esModule",{value:!0});var Lre=x5.default=void 0,uPe=dPe(M),fPe=hre;function Nre(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(Nre=function(r){return r?n:e})(t)}function dPe(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=Nre(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 hPe(t){return Object.keys(t).length===0}function pPe(t=null){const e=uPe.useContext(fPe.ThemeContext);return!e||hPe(e)?t:e}Lre=x5.default=pPe;const mPe=["anchorEl","component","components","componentsProps","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition","slots","slotProps"],gPe=we(KEe,{name:"MuiPopper",slot:"Root",overridesResolver:(t,e)=>e.root})({}),b5=M.forwardRef(function(e,n){var r;const i=Lre(),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,mPe),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(gPe,j({as:s,direction:i==null?void 0:i.direction,slots:{root:S},slotProps:b??c},O,{ref:n}))}),vPe=ni(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 yPe(t){return We("MuiChip",t)}const fn=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"]),xPe=["avatar","className","clickable","color","component","deleteIcon","disabled","icon","label","onClick","onDelete","onKeyDown","onKeyUp","size","variant","tabIndex","skipFocusWhenDisabled"],bPe=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,yPe,e)},_Pe=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}}})),wPe=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 x8(t){return t.key==="Backspace"||t.key==="Delete"}const SPe=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,xPe),S=M.useRef(null),O=Zt(S,n),C=W=>{W.stopPropagation(),p&&p(W)},E=W=>{W.currentTarget===W.target&&x8(W)&&W.preventDefault(),m&&m(W)},k=W=>{W.currentTarget===W.target&&(p&&x8(W)?p(W):W.key==="Escape"&&S.current&&S.current.blur()),g&&g(W)},I=a!==!1&&h?!0:a,P=I||p?fs: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=bPe(R),L=P===fs?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(vPe,{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 U=null;return f&&M.isValidElement(f)&&(U=M.cloneElement(f,{className:ke(T.icon,f.props.className)})),w.jsxs(_Pe,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||U,w.jsx(wPe,{className:ke(T.label),ownerState:R,children:d}),z]}))});function gd({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 qM=M.createContext(void 0);function oc(){return M.useContext(qM)}function $re(t){return w.jsx(Qwe,j({},t,{defaultTheme:IM,themeId:Kh}))}function b8(t){return t!=null&&!(Array.isArray(t)&&t.length===0)}function AT(t,e=!1){return t&&(b8(t.value)&&t.value!==""||e&&b8(t.defaultValue)&&t.defaultValue!=="")}function OPe(t){return t.startAdornment}function CPe(t){return We("MuiInputBase",t)}const Jg=Ve("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),TPe=["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"],XM=(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]},QM=(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]},EPe=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,CPe,e)},YM=we("div",{name:"MuiInputBase",slot:"Root",overridesResolver:XM})(({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",[`&.${Jg.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%"})),KM=we("input",{name:"MuiInputBase",slot:"Input",overridesResolver:QM})(({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] + .${Jg.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},[`&.${Jg.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"})}),PPe=w.jsx($re,{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}}),MPe=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:U={},slots:W={},startAdornment:$,type:N="text",value:D}=i,A=Ae(i,TPe),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=oc(),re=gd({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=>{AT(Z)?ve&&ve():F&&F()},[ve,F]);Hr(()=>{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(fu(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=cPe);const H=Z=>{ce(Z.animationName==="mui-auto-fill-cancel"?K.current:{value:"x"})};M.useEffect(()=>{be&&be.setAdornedStart(!!$)},[be,$]);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:$,type:N}),ie=EPe(G),he=W.root||c.Root||YM,_e=U.root||u.root||{},oe=W.input||c.Input||KM;return ye=j({},ye,(r=U.input)!=null?r:u.input),w.jsxs(M.Fragment,{children:[!h&&PPe,w.jsxs(he,j({},_e,!Vl(he)&&{ownerState:j({},G,_e.ownerState)},{ref:n,onClick:ee},A,{className:ke(ie.root,_e.className,l,L&&"MuiInputBase-readOnly"),children:[$,w.jsx(qM.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:N},ye,!Vl(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:$})):null]}))]})}),_5=MPe;function kPe(t){return We("MuiInput",t)}const d0=j({},Jg,Ve("MuiInput",["root","underline","input"]));function APe(t){return We("MuiOutlinedInput",t)}const Mu=j({},Jg,Ve("MuiOutlinedInput",["root","notchedOutline","input"]));function RPe(t){return We("MuiFilledInput",t)}const $d=j({},Jg,Ve("MuiFilledInput",["root","underline","input"])),IPe=ni(w.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),DPe=ni(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 LPe(t){return We("MuiAvatar",t)}Ve("MuiAvatar",["root","colorDefault","circular","rounded","square","img","fallback"]);const NPe=["alt","children","className","component","slots","slotProps","imgProps","sizes","src","srcSet","variant"],$Pe=s5(),FPe=t=>{const{classes:e,variant:n,colorDefault:r}=t;return Ue({root:["root",n,r&&"colorDefault"],img:["img"],fallback:["fallback"]},LPe,e)},jPe=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]})))}]})),BPe=we("img",{name:"MuiAvatar",slot:"Img",overridesResolver:(t,e)=>e.img})({width:"100%",height:"100%",textAlign:"center",objectFit:"cover",color:"transparent",textIndent:1e4}),zPe=we(DPe,{name:"MuiAvatar",slot:"Fallback",overridesResolver:(t,e)=>e.fallback})({width:"75%",height:"75%"});function UPe({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 EA=M.forwardRef(function(e,n){const r=$Pe({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,NPe);let g=null;const v=UPe(j({},u,{src:d,srcSet:h})),y=d||h,x=y&&v!=="error",b=j({},r,{colorDefault:!x,component:s,variant:p}),_=FPe(b),[S,O]=BCe("img",{className:_.img,elementType:BPe,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(zPe,{ownerState:b,className:_.fallback}),w.jsx(jPe,j({as:s,ownerState:b,className:ke(_.root,a),ref:n},m,{children:g}))}),WPe=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],VPe={entering:{opacity:1},entered:{opacity:1}},ZM=M.forwardRef(function(e,n){const r=Go(),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=ka}=e,x=Ae(e,WPe),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)=>{u5(T);const z=Zf({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=Zf({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},VPe[T],g,s.props.style),ref:_},L))}))});function GPe(t){return We("MuiBackdrop",t)}Ve("MuiBackdrop",["root","invisible"]);const HPe=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],qPe=t=>{const{classes:e,invisible:n}=t;return Ue({root:["root",n&&"invisible"]},GPe,e)},XPe=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"})),Fre=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=ZM,transitionDuration:v}=a,y=Ae(a,HPe),x=j({},a,{component:c,invisible:d}),b=qPe(x),_=(r=p.root)!=null?r:f.root;return w.jsx(g,j({in:h,timeout:v},y,{children:w.jsx(XPe,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}))}))}),QPe=Ve("MuiBox",["root"]),YPe=i5(),Ke=tSe({themeId:Kh,defaultTheme:YPe,defaultClassName:QPe.root,generateClassName:Qj.generate});function KPe(t){return We("MuiButton",t)}const uS=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"]),ZPe=M.createContext({}),JPe=M.createContext(void 0),eMe=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],tMe=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,KPe,a);return j({},a,l)},jre=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}}),nMe=we(fs,{shouldForwardProp:t=>hi(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]}),[`&.${uS.focusVisible}`]:j({},e.variant==="contained"&&{boxShadow:(t.vars||t).shadows[6]}),[`&.${uS.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"},[`&.${uS.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${uS.disabled}`]:{boxShadow:"none"}}),rMe=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},jre(t))),iMe=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},jre(t))),tr=M.forwardRef(function(e,n){const r=M.useContext(ZPe),i=M.useContext(JPe),o=kM(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,eMe),S=j({},a,{color:l,component:c,disabled:f,disableElevation:d,disableFocusRipple:h,fullWidth:g,size:v,type:x,variant:b}),O=tMe(S),C=y&&w.jsx(rMe,{className:O.startIcon,ownerState:S,children:y}),E=p&&w.jsx(iMe,{className:O.endIcon,ownerState:S,children:p}),k=i||"";return w.jsxs(nMe,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]}))});function oMe(t){return We("MuiCard",t)}Ve("MuiCard",["root"]);const aMe=["className","raised"],sMe=t=>{const{classes:e}=t;return Ue({root:["root"]},oMe,e)},lMe=we(Ho,{name:"MuiCard",slot:"Root",overridesResolver:(t,e)=>e.root})(()=>({overflow:"hidden"})),Bre=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiCard"}),{className:i,raised:o=!1}=r,a=Ae(r,aMe),s=j({},r,{raised:o}),l=sMe(s);return w.jsx(lMe,j({className:ke(l.root,i),elevation:o?8:void 0,ref:n,ownerState:s},a))});function cMe(t){return We("MuiCardActions",t)}Ve("MuiCardActions",["root","spacing"]);const uMe=["disableSpacing","className"],fMe=t=>{const{classes:e,disableSpacing:n}=t;return Ue({root:["root",!n&&"spacing"]},cMe,e)},dMe=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}})),zre=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiCardActions"}),{disableSpacing:i=!1,className:o}=r,a=Ae(r,uMe),s=j({},r,{disableSpacing:i}),l=fMe(s);return w.jsx(dMe,j({className:ke(l.root,o),ownerState:s,ref:n},a))});function hMe(t){return We("MuiCardContent",t)}Ve("MuiCardContent",["root"]);const pMe=["className","component"],mMe=t=>{const{classes:e}=t;return Ue({root:["root"]},hMe,e)},gMe=we("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(t,e)=>e.root})(()=>({padding:16,"&:last-child":{paddingBottom:24}})),Ure=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiCardContent"}),{className:i,component:o="div"}=r,a=Ae(r,pMe),s=j({},r,{component:o}),l=mMe(s);return w.jsx(gMe,j({as:o,className:ke(l.root,i),ownerState:s,ref:n},a))});function vMe(t){return We("MuiCardHeader",t)}const _8=Ve("MuiCardHeader",["root","avatar","action","content","title","subheader"]),yMe=["action","avatar","className","component","disableTypography","subheader","subheaderTypographyProps","title","titleTypographyProps"],xMe=t=>{const{classes:e}=t;return Ue({root:["root"],avatar:["avatar"],action:["action"],content:["content"],title:["title"],subheader:["subheader"]},vMe,e)},bMe=we("div",{name:"MuiCardHeader",slot:"Root",overridesResolver:(t,e)=>j({[`& .${_8.title}`]:e.title,[`& .${_8.subheader}`]:e.subheader},e.root)})({display:"flex",alignItems:"center",padding:16}),_Me=we("div",{name:"MuiCardHeader",slot:"Avatar",overridesResolver:(t,e)=>e.avatar})({display:"flex",flex:"0 0 auto",marginRight:16}),wMe=we("div",{name:"MuiCardHeader",slot:"Action",overridesResolver:(t,e)=>e.action})({flex:"0 0 auto",alignSelf:"flex-start",marginTop:-4,marginRight:-8,marginBottom:-4}),SMe=we("div",{name:"MuiCardHeader",slot:"Content",overridesResolver:(t,e)=>e.content})({flex:"1 1 auto"}),OMe=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,yMe),p=j({},r,{component:s,disableTypography:l}),m=xMe(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(bMe,j({className:ke(m.root,a),as:s,ref:n,ownerState:p},h,{children:[o&&w.jsx(_Me,{className:m.avatar,ownerState:p,children:o}),w.jsxs(SMe,{className:m.content,ownerState:p,children:[g,v]}),i&&w.jsx(wMe,{className:m.action,ownerState:p,children:i})]}))});function CMe(t){return We("MuiCardMedia",t)}Ve("MuiCardMedia",["root","media","img"]);const TMe=["children","className","component","image","src","style"],EMe=t=>{const{classes:e,isMediaComponent:n,isImageComponent:r}=t;return Ue({root:["root",n&&"media",r&&"img"]},CMe,e)},PMe=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"})),MMe=["video","audio","picture","iframe","img"],kMe=["picture","img"],AMe=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,TMe),f=MMe.indexOf(a)!==-1,d=!f&&s?j({backgroundImage:`url("${s}")`},c):c,h=j({},r,{component:a,isMediaComponent:f,isImageComponent:kMe.indexOf(a)!==-1}),p=EMe(h);return w.jsx(PMe,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}))});function RMe(t){return We("PrivateSwitchBase",t)}Ve("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const IMe=["autoFocus","checked","checkedIcon","className","defaultChecked","disabled","disableFocusRipple","edge","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"],DMe=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,RMe,e)},LMe=we(fs)(({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})),NMe=we("input",{shouldForwardProp:hi})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),w5=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,IMe),[E,k]=Qs({controlled:i,default:!!s,name:"SwitchBase",state:"checked"}),I=oc(),P=W=>{y&&y(W),I&&I.onFocus&&I.onFocus(W)},R=W=>{g&&g(W),I&&I.onBlur&&I.onBlur(W)},T=W=>{if(W.nativeEvent.defaultPrevented)return;const $=W.target.checked;k($),v&&v(W,$)};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}),U=DMe(B);return w.jsxs(LMe,j({component:"span",className:ke(U.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(NMe,j({autoFocus:r,checked:i,defaultChecked:s,className:U.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]}))}),$Me=ni(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"),FMe=ni(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"),jMe=ni(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 BMe(t){return We("MuiCheckbox",t)}const PA=Ve("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),zMe=["checkedIcon","color","icon","indeterminate","indeterminateIcon","inputProps","size","className"],UMe=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,BMe,e);return j({},e,a)},WMe=we(w5,{shouldForwardProp:t=>hi(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"&&{[`&.${PA.checked}, &.${PA.indeterminate}`]:{color:(t.vars||t).palette[e.color].main},[`&.${PA.disabled}`]:{color:(t.vars||t).palette.action.disabled}})),VMe=w.jsx(FMe,{}),GMe=w.jsx($Me,{}),HMe=w.jsx(jMe,{}),zL=M.forwardRef(function(e,n){var r,i;const o=qe({props:e,name:"MuiCheckbox"}),{checkedIcon:a=VMe,color:s="primary",icon:l=GMe,indeterminate:c=!1,indeterminateIcon:u=HMe,inputProps:f,size:d="medium",className:h}=o,p=Ae(o,zMe),m=c?u:l,g=c?u:a,v=j({},o,{color:s,indeterminate:c,size:d}),y=UMe(v);return w.jsx(WMe,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}))});function qMe(t){return We("MuiCircularProgress",t)}Ve("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const XMe=["className","color","disableShrink","size","style","thickness","value","variant"];let JM=t=>t,w8,S8,O8,C8;const ku=44,QMe=Qv(w8||(w8=JM` 0% { transform: rotate(0deg); } @@ -173,7 +173,7 @@ const store = createStore( 100% { transform: rotate(360deg); } -`)),KMe=Qv(O8||(O8=JM` +`)),YMe=Qv(S8||(S8=JM` 0% { stroke-dasharray: 1px, 200px; stroke-dashoffset: 0; @@ -188,28 +188,28 @@ const store = createStore( stroke-dasharray: 100px, 200px; stroke-dashoffset: -125px; } -`)),ZMe=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,XMe,e)},JMe=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"&&pM(C8||(C8=JM` +`)),KMe=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,qMe,e)},ZMe=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"&&pM(O8||(O8=JM` animation: ${0} 1.4s linear infinite; - `),YMe)),e2e=we("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(t,e)=>e.svg})({display:"block"}),t2e=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&&pM(T8||(T8=JM` + `),QMe)),JMe=we("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(t,e)=>e.svg})({display:"block"}),e2e=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&&pM(C8||(C8=JM` animation: ${0} 1.4s ease-in-out infinite; - `),KMe)),ey=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,QMe),h=j({},r,{color:o,disableShrink:a,size:s,thickness:c,value:u,variant:f}),p=ZMe(h),m={},g={},v={};if(f==="determinate"){const y=2*Math.PI*((ku-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(JMe,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(e2e,{className:p.svg,ownerState:h,viewBox:`${ku/2} ${ku/2} ${ku} ${ku}`,children:w.jsx(t2e,{className:p.circle,style:m,ownerState:h,cx:ku,cy:ku,r:(ku-c)/2,fill:"none",strokeWidth:c})})}))}),n2e=(t,e)=>j({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%"},e&&!t.vars&&{colorScheme:t.palette.mode}),r2e=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}}),i2e=(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:n2e(t,e),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:t.typography.fontWeightBold},body:j({margin:0},r2e(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 o2e(t){const e=qe({props:t,name:"MuiCssBaseline"}),{children:n,enableColorScheme:r=!1}=e;return w.jsxs(M.Fragment,{children:[w.jsx(jre,{styles:i=>i2e(i,r)}),n]})}function a2e(t){return We("MuiModal",t)}Ve("MuiModal",["root","hidden","backdrop"]);const s2e=["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"],l2e=t=>{const{open:e,exited:n,classes:r}=t;return Ue({root:["root",!e&&n&&"hidden"],backdrop:["backdrop"]},a2e,r)},c2e=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"})),u2e=we(Bre,{name:"MuiModal",slot:"Backdrop",overridesResolver:(t,e)=>e.backdrop})({zIndex:-1}),Gre=M.forwardRef(function(e,n){var r,i,o,a,s,l;const c=qe({name:"MuiModal",props:e}),{BackdropComponent:u=u2e,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,s2e),z=j({},c,{closeAfterTransition:h,disableAutoFocus:x,disableEnforceFocus:b,disableEscapeKeyDown:_,disablePortal:S,disableRestoreFocus:O,disableScrollLock:C,hideBackdrop:E,keepMounted:k}),{getRootProps:B,getBackdropProps:U,getTransitionProps:W,portalRef:$,isTopModal:N,exited:D,hasTransition:A}=$Te(j({},z,{rootRef:n})),q=j({},z,{exited:D}),Y=l2e(q),K={};if(p.props.tabIndex===void 0&&(K.tabIndex="-1"),A){const{onEnter:ve,onExited:F}=W();K.onEnter=ve,K.onExited=F}const se=(r=(i=T==null?void 0:T.root)!=null?i:v.Root)!=null?r:c2e,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=$r({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=$r({elementType:te,externalSlotProps:pe,additionalProps:f,getSlotProps:ve=>U(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(Cre,{ref:$,container:m,disablePortal:S,children:w.jsxs(se,j({},be,{children:[!E&&u?w.jsx(te,j({},re)):null,w.jsx(Ore,{disableEnforceFocus:b,disableAutoFocus:x,disableRestoreFocus:O,isEnabled:N,open:P,children:M.cloneElement(p,K)})]}))})});function f2e(t){return We("MuiDialog",t)}const zx=Ve("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),Hre=M.createContext({}),d2e=["aria-describedby","aria-labelledby","BackdropComponent","BackdropProps","children","className","disableEscapeKeyDown","fullScreen","fullWidth","maxWidth","onBackdropClick","onClick","onClose","open","PaperComponent","PaperProps","scroll","TransitionComponent","transitionDuration","TransitionProps"],h2e=we(Bre,{name:"MuiDialog",slot:"Backdrop",overrides:(t,e)=>e.backdrop})({zIndex:-1}),p2e=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,f2e,e)},m2e=we(Gre,{name:"MuiDialog",slot:"Root",overridesResolver:(t,e)=>e.root})({"@media print":{position:"absolute !important"}}),g2e=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"}})),v2e=we(Ho,{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)`,[`&.${zx.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}`,[`&.${zx.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,[`&.${zx.paperScrollBody}`]:{margin:0,maxWidth:"100%"}})),rl=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiDialog"}),i=Go(),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,onClick:v,onClose:y,open:x,PaperComponent:b=Ho,PaperProps:_={},scroll:S="paper",TransitionComponent:O=ZM,transitionDuration:C=o,TransitionProps:E}=r,k=Ae(r,d2e),I=j({},r,{disableEscapeKeyDown:d,fullScreen:h,fullWidth:p,maxWidth:m,scroll:S}),P=p2e(I),R=M.useRef(),T=U=>{R.current=U.target===U.currentTarget},L=U=>{v&&v(U),R.current&&(R.current=null,g&&g(U),y&&y(U,"backdropClick"))},z=pd(s),B=M.useMemo(()=>({titleId:z}),[z]);return w.jsx(m2e,j({className:ke(P.root,f),closeAfterTransition:!0,components:{Backdrop:h2e},componentsProps:{backdrop:j({transitionDuration:C,as:l},c)},disableEscapeKeyDown:d,onClose:y,open:x,ref:n,onClick:L,ownerState:I},k,{children:w.jsx(O,j({appear:!0,in:x,timeout:C,role:"presentation"},E,{children:w.jsx(g2e,{className:ke(P.container),onMouseDown:T,ownerState:I,children:w.jsx(v2e,j({as:b,elevation:24,role:"dialog","aria-describedby":a,"aria-labelledby":z},_,{className:ke(P.paper,_.className),ownerState:I,children:w.jsx(Hre.Provider,{value:B,children:u})}))})}))}))});function y2e(t){return We("MuiDialogActions",t)}Ve("MuiDialogActions",["root","spacing"]);const x2e=["className","disableSpacing"],b2e=t=>{const{classes:e,disableSpacing:n}=t;return Ue({root:["root",!n&&"spacing"]},y2e,e)},_2e=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}})),Tp=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiDialogActions"}),{className:i,disableSpacing:o=!1}=r,a=Ae(r,x2e),s=j({},r,{disableSpacing:o}),l=b2e(s);return w.jsx(_2e,j({className:ke(l.root,i),ownerState:s,ref:n},a))});function w2e(t){return We("MuiDialogContent",t)}Ve("MuiDialogContent",["root","dividers"]);function S2e(t){return We("MuiDialogTitle",t)}const O2e=Ve("MuiDialogTitle",["root"]),C2e=["className","dividers"],T2e=t=>{const{classes:e,dividers:n}=t;return Ue({root:["root",n&&"dividers"]},w2e,e)},E2e=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}`}:{[`.${O2e.root} + &`]:{paddingTop:0}})),Ys=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiDialogContent"}),{className:i,dividers:o=!1}=r,a=Ae(r,C2e),s=j({},r,{dividers:o}),l=T2e(s);return w.jsx(E2e,j({className:ke(l.root,i),ownerState:s,ref:n},a))});function P2e(t){return We("MuiDialogContentText",t)}Ve("MuiDialogContentText",["root"]);const M2e=["children","className"],k2e=t=>{const{classes:e}=t,r=Ue({root:["root"]},P2e,e);return j({},e,r)},A2e=we(At,{shouldForwardProp:t=>hi(t)||t==="classes",name:"MuiDialogContentText",slot:"Root",overridesResolver:(t,e)=>e.root})({}),R2e=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiDialogContentText"}),{className:i}=r,o=Ae(r,M2e),a=k2e(o);return w.jsx(A2e,j({component:"p",variant:"body1",color:"text.secondary",ref:n,ownerState:o,className:ke(a.root,i)},r,{classes:a}))}),I2e=["className","id"],D2e=t=>{const{classes:e}=t;return Ue({root:["root"]},S2e,e)},L2e=we(At,{name:"MuiDialogTitle",slot:"Root",overridesResolver:(t,e)=>e.root})({padding:"16px 24px",flex:"0 0 auto"}),vd=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiDialogTitle"}),{className:i,id:o}=r,a=Ae(r,I2e),s=r,l=D2e(s),{titleId:c=o}=M.useContext(Hre);return w.jsx(L2e,j({component:"h2",className:ke(l.root,i),ownerState:s,ref:n,variant:"h6",id:o??c},a))});function N2e(t){return We("MuiDivider",t)}const E8=Ve("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),$2e=["absolute","children","className","component","flexItem","light","orientation","role","textAlign","variant"],F2e=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"]},N2e,r)},j2e=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%"}})),B2e=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)`})),ep=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,$2e),m=j({},r,{absolute:i,component:s,flexItem:l,light:c,orientation:u,role:f,textAlign:d,variant:h}),g=F2e(m);return w.jsx(j2e,j({as:s,className:ke(g.root,a),role:f,ref:n,ownerState:m},p,{children:o?w.jsx(B2e,{className:g.wrapper,ownerState:m,children:o}):null}))});ep.muiSkipListHighlight=!0;const z2e=["addEndListener","appear","children","container","direction","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function U2e(t,e,n){const r=e.getBoundingClientRect(),i=n&&n.getBoundingClientRect(),o=cs(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 W2e(t){return typeof t=="function"?t():t}function fS(t,e,n){const r=W2e(n),i=U2e(t,e,r);i&&(e.style.webkitTransform=i,e.style.transform=i)}const V2e=M.forwardRef(function(e,n){const r=Go(),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:_=ka}=e,S=Ae(e,z2e),O=M.useRef(null),C=Zt(l.ref,O,n),E=U=>W=>{U&&(W===void 0?U(O.current):U(O.current,W))},k=E((U,W)=>{fS(u,U,c),f5(U),h&&h(U,W)}),I=E((U,W)=>{const $=Zf({timeout:b,style:x,easing:f},{mode:"enter"});U.style.webkitTransition=r.transitions.create("-webkit-transform",j({},$)),U.style.transition=r.transitions.create("transform",j({},$)),U.style.webkitTransform="none",U.style.transform="none",m&&m(U,W)}),P=E(p),R=E(y),T=E(U=>{const W=Zf({timeout:b,style:x,easing:f},{mode:"exit"});U.style.webkitTransition=r.transitions.create("-webkit-transform",W),U.style.transition=r.transitions.create("transform",W),fS(u,U,c),g&&g(U)}),L=E(U=>{U.style.webkitTransition="",U.style.transition="",v&&v(U)}),z=U=>{a&&a(O.current,U)},B=M.useCallback(()=>{O.current&&fS(u,O.current,c)},[u,c]);return M.useEffect(()=>{if(d||u==="down"||u==="right")return;const U=Kv(()=>{O.current&&fS(u,O.current,c)}),W=cs(O.current);return W.addEventListener("resize",U),()=>{U.clear(),W.removeEventListener("resize",U)}},[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:(U,W)=>M.cloneElement(l,j({ref:C,style:j({visibility:U==="exited"&&!d?"hidden":void 0},x,l.props.style)},W))}))}),G2e=["disableUnderline","components","componentsProps","fullWidth","hiddenLabel","inputComponent","multiline","slotProps","slots","type"],H2e=t=>{const{classes:e,disableUnderline:n}=t,i=Ue({root:["root",!n&&"underline"],input:["input"]},IPe,e);return j({},e,i)},q2e=we(YM,{shouldForwardProp:t=>hi(t)||t==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[...XM(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}},[`&.${$d.focused}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:o},[`&.${$d.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"},[`&.${$d.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${$d.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(.${$d.disabled}, .${$d.error}):before`]:{borderBottom:`1px solid ${(t.vars||t).palette.text.primary}`},[`&.${$d.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}))}),X2e=we(KM,{name:"MuiFilledInput",slot:"Input",overridesResolver:QM})(({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})),O5=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,G2e),v=j({},s,{fullWidth:u,inputComponent:f,multiline:d,type:m}),y=H2e(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:q2e,S=(o=(a=p.input)!=null?a:l.Input)!=null?o:X2e;return w.jsx(w5,j({slots:{root:_,input:S},componentsProps:b,fullWidth:u,inputComponent:f,multiline:d,ref:n,type:m},g,{classes:y}))});O5.muiName="Input";function Q2e(t){return We("MuiFormControl",t)}Ve("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const Y2e=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],K2e=t=>{const{classes:e,margin:n,fullWidth:r}=t,i={root:["root",n!=="none"&&`margin${De(n)}`,r&&"fullWidth"]};return Ue(i,Q2e,e)},Z2e=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%"})),ty=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,Y2e),y=j({},r,{color:a,component:s,disabled:l,error:c,fullWidth:f,hiddenLabel:d,margin:h,required:p,size:m,variant:g}),x=K2e(y),[b,_]=M.useState(()=>{let R=!1;return i&&M.Children.forEach(i,T=>{if(!$x(T,["Input","Select"]))return;const L=$x(T,["Select"])?T.props.input:T;L&&CPe(L.props)&&(R=!0)}),R}),[S,O]=M.useState(()=>{let R=!1;return i&&M.Children.forEach(i,T=>{$x(T,["Input","Select"])&&(AT(T.props,!0)||AT(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(qM.Provider,{value:P,children:w.jsx(Z2e,j({as:s,ownerState:y,className:ke(x.root,o),ref:n},v,{children:i}))})}),J2e=eOe({createStyledComponent:we("div",{name:"MuiStack",slot:"Root",overridesResolver:(t,e)=>e.root}),useThemeProps:t=>qe({props:t,name:"MuiStack"})});function eke(t){return We("MuiFormControlLabel",t)}const lx=Ve("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),tke=["checked","className","componentsProps","control","disabled","disableTypography","inputRef","label","labelPlacement","name","onChange","required","slotProps","value"],nke=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,eke,e)},rke=we("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${lx.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,[`&.${lx.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},{[`& .${lx.label}`]:{[`&.${lx.disabled}`]:{color:(t.vars||t).palette.text.disabled}}})),ike=we("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(t,e)=>e.asterisk})(({theme:t})=>({[`&.${lx.error}`]:{color:(t.vars||t).palette.error.main}})),Og=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,tke),g=oc(),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=gd({props:o,muiFormControl:g,states:["error"]}),_=j({},o,{disabled:v,labelPlacement:d,required:y,error:b.error}),S=nke(_),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(rke,j({className:ke(S.root,a),ownerState:_,ref:n},m,{children:[M.cloneElement(l,x),y?w.jsxs(J2e,{display:"block",children:[C,w.jsxs(ike,{ownerState:_,"aria-hidden":!0,className:S.asterisk,children:[" ","*"]})]}):C]}))});function oke(t){return We("MuiFormGroup",t)}Ve("MuiFormGroup",["root","row","error"]);const ake=["className","row"],ske=t=>{const{classes:e,row:n,error:r}=t;return Ue({root:["root",n&&"row",r&&"error"]},oke,e)},lke=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"})),cke=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiFormGroup"}),{className:i,row:o=!1}=r,a=Ae(r,ake),s=oc(),l=gd({props:r,muiFormControl:s,states:["error"]}),c=j({},r,{row:o,error:l.error}),u=ske(c);return w.jsx(lke,j({className:ke(u.root,i),ownerState:c,ref:n},a))});function uke(t){return We("MuiFormHelperText",t)}const P8=Ve("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var M8;const fke=["children","className","component","disabled","error","filled","focused","margin","required","variant"],dke=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,uke,e)},hke=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})),qre=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiFormHelperText"}),{children:i,className:o,component:a="p"}=r,s=Ae(r,fke),l=oc(),c=gd({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=dke(u);return w.jsx(hke,j({as:a,ownerState:u,className:ke(f.root,o),ref:n},s,{children:i===" "?M8||(M8=w.jsx("span",{className:"notranslate",children:"​"})):i}))});function pke(t){return We("MuiFormLabel",t)}const Ux=Ve("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),mke=["children","className","color","component","disabled","error","filled","focused","required"],gke=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,pke,e)},vke=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",[`&.${Ux.focused}`]:{color:(t.vars||t).palette[e.color].main},[`&.${Ux.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${Ux.error}`]:{color:(t.vars||t).palette.error.main}})),yke=we("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(t,e)=>e.asterisk})(({theme:t})=>({[`&.${Ux.error}`]:{color:(t.vars||t).palette.error.main}})),xke=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiFormLabel"}),{children:i,className:o,component:a="label"}=r,s=Ae(r,mke),l=oc(),c=gd({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=gke(u);return w.jsxs(vke,j({as:a,ownerState:u,className:ke(f.root,o),ref:n},s,{children:[i,c.required&&w.jsxs(yke,{ownerState:u,"aria-hidden":!0,className:f.asterisk,children:[" ","*"]})]}))}),k8=M.createContext();function bke(t){return We("MuiGrid",t)}const _ke=[0,1,2,3,4,5,6,7,8,9,10],wke=["column-reverse","column","row-reverse","row"],Ske=["nowrap","wrap-reverse","wrap"],p0=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],Lb=Ve("MuiGrid",["root","container","item","zeroMinWidth",..._ke.map(t=>`spacing-xs-${t}`),...wke.map(t=>`direction-xs-${t}`),...Ske.map(t=>`wrap-xs-${t}`),...p0.map(t=>`grid-xs-${t}`),...p0.map(t=>`grid-sm-${t}`),...p0.map(t=>`grid-md-${t}`),...p0.map(t=>`grid-lg-${t}`),...p0.map(t=>`grid-xl-${t}`)]),Oke=["className","columns","columnSpacing","component","container","direction","item","rowSpacing","spacing","wrap","zeroMinWidth"];function Cg(t){const e=parseFloat(t);return`${e}${String(t).replace(String(e),"")||"px"}`}function Cke({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=Lh({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} + ${Cg(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 Tke({theme:t,ownerState:e}){const n=Lh({values:e.direction,breakpoints:t.breakpoints.values});return Wo({theme:t},n,r=>{const i={flexDirection:r};return r.indexOf("column")===0&&(i[`& > .${Lb.item}`]={maxWidth:"none"}),i})}function Xre({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 Eke({theme:t,ownerState:e}){const{container:n,rowSpacing:r}=e;let i={};if(n&&r!==0){const o=Lh({values:r,breakpoints:t.breakpoints.values});let a;typeof o=="object"&&(a=Xre({breakpoints:t.breakpoints.values,values:o})),i=Wo({theme:t},o,(s,l)=>{var c;const u=t.spacing(s);return u!=="0px"?{marginTop:`-${Cg(u)}`,[`& > .${Lb.item}`]:{paddingTop:Cg(u)}}:(c=a)!=null&&c.includes(l)?{}:{marginTop:0,[`& > .${Lb.item}`]:{paddingTop:0}}})}return i}function Pke({theme:t,ownerState:e}){const{container:n,columnSpacing:r}=e;let i={};if(n&&r!==0){const o=Lh({values:r,breakpoints:t.breakpoints.values});let a;typeof o=="object"&&(a=Xre({breakpoints:t.breakpoints.values,values:o})),i=Wo({theme:t},o,(s,l)=>{var c;const u=t.spacing(s);return u!=="0px"?{width:`calc(100% + ${Cg(u)})`,marginLeft:`-${Cg(u)}`,[`& > .${Lb.item}`]:{paddingLeft:Cg(u)}}:(c=a)!=null&&c.includes(l)?{}:{width:"100%",marginLeft:0,[`& > .${Lb.item}`]:{paddingLeft:0}}})}return i}function Mke(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 kke=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=Mke(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}),Tke,Eke,Pke,Cke);function Ake(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 Rke=t=>{const{classes:e,container:n,direction:r,item:i,spacing:o,wrap:a,zeroMinWidth:s,breakpoints:l}=t;let c=[];n&&(c=Ake(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,bke,e)},MC=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiGrid"}),{breakpoints:i}=Go(),o=M1(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,Oke),y=h||p,x=l||p,b=M.useContext(k8),_=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=Rke(C);return w.jsx(k8.Provider,{value:_,children:w.jsx(kke,j({ownerState:C,className:ke(E.root,a),as:c,ref:n},O))})}),Ike=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function WL(t){return`scale(${t}, ${t**2})`}const Dke={entering:{opacity:1,transform:WL(1)},entered:{opacity:1,transform:"none"}},MA=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),ev=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=ka}=e,v=Ae(e,Ike),y=bf(),x=M.useRef(),b=Go(),_=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)=>{f5(L);const{duration:B,delay:U,easing:W}=Zf({style:p,timeout:m,easing:a},{mode:"enter"});let $;m==="auto"?($=b.transitions.getAutoHeightDuration(L.clientHeight),x.current=$):$=B,L.style.transition=[b.transitions.create("opacity",{duration:$,delay:U}),b.transitions.create("transform",{duration:MA?$:$*.666,delay:U,easing:W})].join(","),l&&l(L,z)}),k=O(c),I=O(h),P=O(L=>{const{duration:z,delay:B,easing:U}=Zf({style:p,timeout:m,easing:a},{mode:"exit"});let W;m==="auto"?(W=b.transitions.getAutoHeightDuration(L.clientHeight),x.current=W):W=z,L.style.transition=[b.transitions.create("opacity",{duration:W,delay:B}),b.transitions.create("transform",{duration:MA?W:W*.666,delay:MA?B:B||W*.333,easing:U})].join(","),L.style.opacity=0,L.style.transform=WL(.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:WL(.75),visibility:L==="exited"&&!s?"hidden":void 0},Dke[L],p,o.props.style),ref:S},z))}))});ev.muiSupportAuto=!0;const Lke=["disableUnderline","components","componentsProps","fullWidth","inputComponent","multiline","slotProps","slots","type"],Nke=t=>{const{classes:e,disableUnderline:n}=t,i=Ue({root:["root",!n&&"underline"],input:["input"]},APe,e);return j({},e,i)},$ke=we(YM,{shouldForwardProp:t=>hi(t)||t==="classes",name:"MuiInput",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[...XM(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"},[`&.${h0.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${h0.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(.${h0.disabled}, .${h0.error}):before`]:{borderBottom:`2px solid ${(t.vars||t).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${r}`}},[`&.${h0.disabled}:before`]:{borderBottomStyle:"dotted"}})}),Fke=we(KM,{name:"MuiInput",slot:"Input",overridesResolver:QM})({}),yd=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,Lke),y=Nke(s),b={root:{ownerState:{disableUnderline:l}}},_=p??u?Ii(p??u,b):b,S=(r=(i=m.root)!=null?i:c.Root)!=null?r:$ke,O=(o=(a=m.input)!=null?a:c.Input)!=null?o:Fke;return w.jsx(w5,j({slots:{root:S,input:O},slotProps:_,fullWidth:f,inputComponent:d,multiline:h,ref:n,type:g},v,{classes:y}))});yd.muiName="Input";function jke(t){return We("MuiInputAdornment",t)}const A8=Ve("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var R8;const Bke=["children","className","component","disablePointerEvents","disableTypography","position","variant"],zke=(t,e)=>{const{ownerState:n}=t;return[e.root,e[`position${De(n.position)}`],n.disablePointerEvents===!0&&e.disablePointerEvents,e[n.variant]]},Uke=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,jke,e)},Wke=we("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:zke})(({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"&&{[`&.${A8.positionStart}&:not(.${A8.hiddenLabel})`]:{marginTop:16}},e.position==="start"&&{marginRight:8},e.position==="end"&&{marginLeft:8},e.disablePointerEvents===!0&&{pointerEvents:"none"})),Vke=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,Bke),d=oc()||{};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=Uke(p);return w.jsx(qM.Provider,{value:null,children:w.jsx(Wke,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"?R8||(R8=w.jsx("span",{className:"notranslate",children:"​"})):null,i]})}))})});function Gke(t){return We("MuiInputLabel",t)}Ve("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const Hke=["disableAnimation","margin","shrink","variant","className"],qke=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,Gke,e);return j({},e,c)},Xke=we(xke,{shouldForwardProp:t=>hi(t)||t==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${Ux.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)"}))),ny=M.forwardRef(function(e,n){const r=qe({name:"MuiInputLabel",props:e}),{disableAnimation:i=!1,shrink:o,className:a}=r,s=Ae(r,Hke),l=oc();let c=o;typeof c>"u"&&l&&(c=l.filled||l.focused||l.adornedStart);const u=gd({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=qke(f);return w.jsx(Xke,j({"data-shrink":c,ownerState:f,ref:n,className:ke(d.root,a)},s,{classes:d}))});function Qke(t){return We("MuiLink",t)}const Yke=Ve("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),Qre={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},Kke=t=>Qre[t]||t,Zke=({theme:t,ownerState:e})=>{const n=Kke(e.color),r=Xg(t,`palette.${n}`,!1)||e.color,i=Xg(t,`palette.${n}Channel`);return"vars"in t&&i?`rgba(${i} / 0.4)`:kt(r,.4)},Jke=["className","color","component","onBlur","onFocus","TypographyClasses","underline","variant","sx"],eAe=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,Qke,e)},tAe=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:Zke({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"},[`&.${Yke.focusVisible}`]:{outline:"auto"}})),nAe=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,Jke),{isFocusVisibleRef:p,onBlur:m,onFocus:g,ref:v}=A1(),[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=eAe(O);return w.jsx(tAe,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))}),Xs=M.createContext({});function rAe(t){return We("MuiList",t)}Ve("MuiList",["root","padding","dense","subheader"]);const iAe=["children","className","component","dense","disablePadding","subheader"],oAe=t=>{const{classes:e,disablePadding:n,dense:r,subheader:i}=t;return Ue({root:["root",!n&&"padding",r&&"dense",i&&"subheader"]},rAe,e)},aAe=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})),e2=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,iAe),f=M.useMemo(()=>({dense:s}),[s]),d=j({},r,{component:a,dense:s,disablePadding:l}),h=oAe(d);return w.jsx(Xs.Provider,{value:f,children:w.jsxs(aAe,j({as:a,className:ke(h.root,o),ref:n,ownerState:d},u,{children:[c,i]}))})});function sAe(t){return We("MuiListItem",t)}const Nm=Ve("MuiListItem",["root","container","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","padding","button","secondaryAction","selected"]);function lAe(t){return We("MuiListItemButton",t)}const $m=Ve("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),cAe=["alignItems","autoFocus","component","children","dense","disableGutters","divider","focusVisibleClassName","selected","className"],uAe=(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]},fAe=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"]},lAe,n);return j({},n,c)},dAe=we(fs,{shouldForwardProp:t=>hi(t)||t==="classes",name:"MuiListItemButton",slot:"Root",overridesResolver:uAe})(({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"}},[`&.${$m.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${$m.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)}},[`&.${$m.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)}},[`&.${$m.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${$m.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})),Yre=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,cAe),m=M.useContext(Xs),g=M.useMemo(()=>({dense:l||m.dense||!1,alignItems:i,disableGutters:c}),[i,m.dense,l,c]),v=M.useRef(null);Hr(()=>{o&&v.current&&v.current.focus()},[o]);const y=j({},r,{alignItems:i,dense:g.dense,disableGutters:c,divider:u,selected:d}),x=fAe(y),b=Zt(v,n);return w.jsx(Xs.Provider,{value:g,children:w.jsx(dAe,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}))})});function hAe(t){return We("MuiListItemSecondaryAction",t)}Ve("MuiListItemSecondaryAction",["root","disableGutters"]);const pAe=["className"],mAe=t=>{const{disableGutters:e,classes:n}=t;return Ue({root:["root",e&&"disableGutters"]},hAe,n)},gAe=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})),Nb=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiListItemSecondaryAction"}),{className:i}=r,o=Ae(r,pAe),a=M.useContext(Xs),s=j({},r,{disableGutters:a.disableGutters}),l=mAe(s);return w.jsx(gAe,j({className:ke(l.root,i),ownerState:s,ref:n},o))});Nb.muiName="ListItemSecondaryAction";const vAe=["className"],yAe=["alignItems","autoFocus","button","children","className","component","components","componentsProps","ContainerComponent","ContainerProps","dense","disabled","disableGutters","disablePadding","divider","focusVisibleClassName","secondaryAction","selected","slotProps","slots"],xAe=(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]},bAe=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"]},sAe,r)},_Ae=we("div",{name:"MuiListItem",slot:"Root",overridesResolver:xAe})(({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&&{[`& > .${$m.root}`]:{paddingRight:48}},{[`&.${Nm.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${Nm.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${Nm.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)}},[`&.${Nm.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"}},[`&.${Nm.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})),wAe=we("li",{name:"MuiListItem",slot:"Container",overridesResolver:(t,e)=>e.container})({position:"relative"}),Wx=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,vAe),E=Ae(r,yAe),k=M.useContext(Xs),I=M.useMemo(()=>({dense:p||k.dense||!1,alignItems:i,disableGutters:g}),[i,k.dense,p,g]),P=M.useRef(null);Hr(()=>{o&&P.current&&P.current.focus()},[o]);const R=M.Children.toArray(s),T=R.length&&$x(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=bAe(L),B=Zt(P,n),U=O.root||u.Root||_Ae,W=S.root||f.root||{},$=j({className:ke(z.root,W.className,l),disabled:m},E);let N=c||"li";return a&&($.component=c||"div",$.focusVisibleClassName=ke(Nm.focusVisible,x),N=fs),T?(N=!$.component&&!c?"div":N,d==="li"&&(N==="li"?N="div":$.component==="li"&&($.component="div")),w.jsx(Xs.Provider,{value:I,children:w.jsxs(wAe,j({as:d,className:ke(z.container,h),ref:B,ownerState:L},C,{children:[w.jsx(U,j({},W,!Vl(U)&&{as:N,ownerState:j({},L,W.ownerState)},$,{children:R})),R.pop()]}))})):w.jsx(Xs.Provider,{value:I,children:w.jsxs(U,j({},W,{as:N,ref:B},!Vl(U)&&{ownerState:j({},L,W.ownerState)},$,{children:[R,b&&w.jsx(Nb,{children:b})]}))})});function SAe(t){return We("MuiListItemIcon",t)}const I8=Ve("MuiListItemIcon",["root","alignItemsFlexStart"]),OAe=["className"],CAe=t=>{const{alignItems:e,classes:n}=t;return Ue({root:["root",e==="flex-start"&&"alignItemsFlexStart"]},SAe,n)},TAe=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})),Kre=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiListItemIcon"}),{className:i}=r,o=Ae(r,OAe),a=M.useContext(Xs),s=j({},r,{alignItems:a.alignItems}),l=CAe(s);return w.jsx(TAe,j({className:ke(l.root,i),ownerState:s,ref:n},o))});function EAe(t){return We("MuiListItemText",t)}const RT=Ve("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),PAe=["children","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps"],MAe=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"]},EAe,e)},kAe=we("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${RT.primary}`]:e.primary},{[`& .${RT.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})),ts=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,PAe),{dense:h}=M.useContext(Xs);let p=l??i,m=u;const g=j({},r,{disableTypography:a,inset:s,primary:!!p,secondary:!!m,dense:h}),v=MAe(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(kAe,j({className:ke(v.root,o),ownerState:g,ref:n},d,{children:[p,m]}))}),AAe=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function kA(t,e,n){return t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:n?null:t.firstChild}function D8(t,e,n){return t===e?n?t.firstChild:t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:n?null:t.lastChild}function Zre(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 m0(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")||!Zre(s,o)||l)s=i(t,s,n);else return s.focus(),!0}return!1}const Jre=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,AAe),h=M.useRef(null),p=M.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});Hr(()=>{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(),m0(b,S,c,l,kA);else if(_==="ArrowUp")x.preventDefault(),m0(b,S,c,l,D8);else if(_==="Home")x.preventDefault(),m0(b,null,c,l,kA);else if(_==="End")x.preventDefault(),m0(b,null,c,l,D8);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&&Zre(S,O);O.previousKeyMatched&&(k||m0(b,S,!1,l,kA,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(e2,j({role:"menu",ref:g,className:s,onKeyDown:m,tabIndex:i?0:-1},d,{children:y}))});function RAe(t){return We("MuiPopover",t)}Ve("MuiPopover",["root","paper"]);const IAe=["onEntering"],DAe=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],LAe=["slotProps"];function L8(t,e){let n=0;return typeof e=="number"?n=e:e==="center"?n=t.height/2:e==="bottom"&&(n=t.height),n}function N8(t,e){let n=0;return typeof e=="number"?n=e:e==="center"?n=t.width/2:e==="right"&&(n=t.width),n}function $8(t){return[t.horizontal,t.vertical].map(e=>typeof e=="number"?`${e}px`:e).join(" ")}function AA(t){return typeof t=="function"?t():t}const NAe=t=>{const{classes:e}=t;return Ue({root:["root"],paper:["paper"]},RAe,e)},$Ae=we(Gre,{name:"MuiPopover",slot:"Root",overridesResolver:(t,e)=>e.root})({}),eie=we(Ho,{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}),Ep=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=ev,transitionDuration:O="auto",TransitionProps:{onEntering:C}={},disableScrollLock:E=!1}=a,k=Ae(a.TransitionProps,IAe),I=Ae(a,DAe),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=NAe(L),B=M.useCallback(()=>{if(f==="anchorPosition")return u;const ve=AA(l),ce=(ve&&ve.nodeType===1?ve:$n(R.current).body).getBoundingClientRect();return{top:ce.top+L8(ce,c.vertical),left:ce.left+N8(ce,c.horizontal)}},[l,c.horizontal,c.vertical,u,f]),U=M.useCallback(ve=>({vertical:L8(ve,_.vertical),horizontal:N8(ve,_.horizontal)}),[_.horizontal,_.vertical]),W=M.useCallback(ve=>{const F={width:ve.offsetWidth,height:ve.offsetHeight},ce=U(F);if(f==="none")return{top:null,left:null,transformOrigin:$8(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=cs(AA(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:$8(ce)}},[l,f,B,U,g]),[$,N]=M.useState(v),D=M.useCallback(()=>{const ve=R.current;if(!ve)return;const F=W(ve);F.top!==null&&(ve.style.top=F.top),F.left!==null&&(ve.style.left=F.left),ve.style.transformOrigin=F.transformOrigin,N(!0)},[W]);M.useEffect(()=>(E&&window.addEventListener("scroll",D),()=>window.removeEventListener("scroll",D)),[l,E,D]);const A=(ve,F)=>{C&&C(ve,F),D()},q=()=>{N(!1)};M.useEffect(()=>{v&&D()}),M.useImperativeHandle(s,()=>v?{updatePosition:()=>{D()}}:null,[v,D]),M.useEffect(()=>{if(!v)return;const ve=Kv(()=>{D()}),F=cs(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(AA(l)).body:void 0),se=(i=x==null?void 0:x.root)!=null?i:$Ae,te=(o=x==null?void 0:x.paper)!=null?o:eie,J=$r({elementType:te,externalSlotProps:j({},P,{style:$?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=$r({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,LAe);return w.jsx(se,j({},re,!Vl(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}))}))}))});function FAe(t){return We("MuiMenu",t)}Ve("MuiMenu",["root","paper","list"]);const jAe=["onEntering"],BAe=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],zAe={vertical:"top",horizontal:"right"},UAe={vertical:"top",horizontal:"left"},WAe=t=>{const{classes:e}=t;return Ue({root:["root"],paper:["paper"],list:["list"]},FAe,e)},VAe=we(Ep,{shouldForwardProp:t=>hi(t)||t==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(t,e)=>e.root})({}),GAe=we(eie,{name:"MuiMenu",slot:"Paper",overridesResolver:(t,e)=>e.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),HAe=we(Jre,{name:"MuiMenu",slot:"List",overridesResolver:(t,e)=>e.list})({outline:0}),Pp=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,jAe),_=Ae(o,BAe),S=R1(),O=j({},o,{autoFocus:a,disableAutoFocusItem:c,MenuListProps:u,onEntering:g,PaperProps:h,transitionDuration:m,TransitionProps:b,variant:v}),C=WAe(O),E=a&&!c&&d,k=M.useRef(null),I=(U,W)=>{k.current&&k.current.adjustStyleForScrollbar(U,{direction:S?"rtl":"ltr"}),g&&g(U,W)},P=U=>{U.key==="Tab"&&(U.preventDefault(),f&&f(U,"tabKeyDown"))};let R=-1;M.Children.map(s,(U,W)=>{M.isValidElement(U)&&(U.props.disabled||(v==="selectedMenu"&&U.props.selected||R===-1)&&(R=W))});const T=(r=y.paper)!=null?r:GAe,L=(i=x.paper)!=null?i:h,z=$r({elementType:y.root,externalSlotProps:x.root,ownerState:O,className:[C.root,l]}),B=$r({elementType:T,externalSlotProps:L,ownerState:O,className:C.paper});return w.jsx(VAe,j({onClose:f,anchorOrigin:{vertical:"bottom",horizontal:S?"right":"left"},transformOrigin:S?zAe:UAe,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(HAe,j({onKeyDown:P,actions:k,autoFocus:a&&(R===-1||c),autoFocusItem:E,variant:v},u,{className:ke(C.list,u.className),children:s}))}))});function qAe(t){return We("MuiMenuItem",t)}const g0=Ve("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),XAe=["autoFocus","component","dense","divider","disableGutters","focusVisibleClassName","role","tabIndex","className"],QAe=(t,e)=>{const{ownerState:n}=t;return[e.root,n.dense&&e.dense,n.divider&&e.divider,!n.disableGutters&&e.gutters]},YAe=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"]},qAe,a);return j({},a,l)},KAe=we(fs,{shouldForwardProp:t=>hi(t)||t==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:QAe})(({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"}},[`&.${g0.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${g0.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)}},[`&.${g0.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)}},[`&.${g0.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${g0.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity},[`& + .${E8.root}`]:{marginTop:t.spacing(1),marginBottom:t.spacing(1)},[`& + .${E8.inset}`]:{marginLeft:52},[`& .${RT.root}`]:{marginTop:0,marginBottom:0},[`& .${RT.inset}`]:{paddingLeft:36},[`& .${I8.root}`]:{minWidth:36}},!e.dense&&{[t.breakpoints.up("sm")]:{minHeight:"auto"}},e.dense&&j({minHeight:32,paddingTop:4,paddingBottom:4},t.typography.body2,{[`& .${I8.root} svg`]:{fontSize:"1.25rem"}}))),jr=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,XAe),p=M.useContext(Xs),m=M.useMemo(()=>({dense:a||p.dense||!1,disableGutters:l}),[p.dense,a,l]),g=M.useRef(null);Hr(()=>{i&&g.current&&g.current.focus()},[i]);const v=j({},r,{dense:m.dense,divider:s,disableGutters:l}),y=YAe(r),x=Zt(g,n);let b;return r.disabled||(b=f!==void 0?f:-1),w.jsx(Xs.Provider,{value:m,children:w.jsx(KAe,j({ref:x,role:u,tabIndex:b,component:o,focusVisibleClassName:ke(y.focusVisible,c),className:ke(y.root,d)},h,{ownerState:v,classes:y}))})});function ZAe(t){return We("MuiNativeSelect",t)}const C5=Ve("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),JAe=["className","disabled","error","IconComponent","inputRef","variant"],eRe=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,ZAe,e)},tie=({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"},[`&.${C5.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}}),tRe=we("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:hi,overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.select,e[n.variant],n.error&&e.error,{[`&.${C5.multiple}`]:e.multiple}]}})(tie),nie=({ownerState:t,theme:e})=>j({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(e.vars||e).palette.action.active,[`&.${C5.disabled}`]:{color:(e.vars||e).palette.action.disabled}},t.open&&{transform:"rotate(180deg)"},t.variant==="filled"&&{right:7},t.variant==="outlined"&&{right:7}),nRe=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]}})(nie),rRe=M.forwardRef(function(e,n){const{className:r,disabled:i,error:o,IconComponent:a,inputRef:s,variant:l="standard"}=e,c=Ae(e,JAe),u=j({},e,{disabled:i,variant:l,error:o}),f=eRe(u);return w.jsxs(M.Fragment,{children:[w.jsx(tRe,j({ownerState:u,className:ke(f.select,r),disabled:i,ref:s||n},c)),e.multiple?null:w.jsx(nRe,{as:a,ownerState:u,className:f.icon})]})});var F8;const iRe=["children","classes","className","label","notched"],oRe=we("fieldset",{shouldForwardProp:hi})({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%"}),aRe=we("legend",{shouldForwardProp:hi})(({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 sRe(t){const{className:e,label:n,notched:r}=t,i=Ae(t,iRe),o=n!=null&&n!=="",a=j({},t,{notched:r,withLabel:o});return w.jsx(oRe,j({"aria-hidden":!0,className:e,ownerState:a},i,{children:w.jsx(aRe,{ownerState:a,children:o?w.jsx("span",{children:n}):F8||(F8=w.jsx("span",{className:"notranslate",children:"​"}))})}))}const lRe=["components","fullWidth","inputComponent","label","multiline","notched","slots","type"],cRe=t=>{const{classes:e}=t,r=Ue({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},RPe,e);return j({},e,r)},uRe=we(YM,{shouldForwardProp:t=>hi(t)||t==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:XM})(({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 .${Mu.notchedOutline}`]:{borderColor:(t.vars||t).palette.text.primary},"@media (hover: none)":{[`&:hover .${Mu.notchedOutline}`]:{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:n}},[`&.${Mu.focused} .${Mu.notchedOutline}`]:{borderColor:(t.vars||t).palette[e.color].main,borderWidth:2},[`&.${Mu.error} .${Mu.notchedOutline}`]:{borderColor:(t.vars||t).palette.error.main},[`&.${Mu.disabled} .${Mu.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"}))}),fRe=we(sRe,{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}}),dRe=we(KM,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:QM})(({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})),T5=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,lRe),y=cRe(l),x=oc(),b=gd({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:uRe,O=(o=(a=m.input)!=null?a:c.Input)!=null?o:dRe;return w.jsx(w5,j({slots:{root:S,input:O},renderSuffix:C=>w.jsx(fRe,{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})}))});T5.muiName="Input";const hRe=ni(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"),pRe=ni(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"),mRe=we("span",{shouldForwardProp:hi})({position:"relative",display:"flex"}),gRe=we(hRe)({transform:"scale(1)"}),vRe=we(pRe)(({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 rie(t){const{checked:e=!1,classes:n={},fontSize:r}=t,i=j({},t,{checked:e});return w.jsxs(mRe,{className:n.root,ownerState:i,children:[w.jsx(gRe,{fontSize:r,className:n.background,ownerState:i}),w.jsx(vRe,{fontSize:r,className:n.dot,ownerState:i})]})}const iie=M.createContext(void 0);function yRe(){return M.useContext(iie)}function xRe(t){return We("MuiRadio",t)}const j8=Ve("MuiRadio",["root","checked","disabled","colorPrimary","colorSecondary","sizeSmall"]),bRe=["checked","checkedIcon","color","icon","name","onChange","size","className"],_Re=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,xRe,e))},wRe=we(S5,{shouldForwardProp:t=>hi(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"&&{[`&.${j8.checked}`]:{color:(t.vars||t).palette[e.color].main}},{[`&.${j8.disabled}`]:{color:(t.vars||t).palette.action.disabled}}));function SRe(t,e){return typeof e=="object"&&e!==null?t===e:String(t)===String(e)}const B8=w.jsx(rie,{checked:!0}),z8=w.jsx(rie,{}),Vx=M.forwardRef(function(e,n){var r,i;const o=qe({props:e,name:"MuiRadio"}),{checked:a,checkedIcon:s=B8,color:l="primary",icon:c=z8,name:u,onChange:f,size:d="medium",className:h}=o,p=Ae(o,bRe),m=j({},o,{color:l,size:d}),g=_Re(m),v=yRe();let y=a;const x=OT(f,v&&v.onChange);let b=u;return v&&(typeof y>"u"&&(y=SRe(v.value,o.value)),typeof b>"u"&&(b=v.name)),w.jsx(wRe,j({type:"radio",icon:M.cloneElement(c,{fontSize:(r=z8.props.fontSize)!=null?r:d}),checkedIcon:M.cloneElement(s,{fontSize:(i=B8.props.fontSize)!=null?i:d}),ownerState:m,classes:g,name:b,checked:y,onChange:x,ref:n,className:ke(g.root,h)},p))});function ORe(t){return We("MuiRadioGroup",t)}Ve("MuiRadioGroup",["root","row","error"]);const CRe=["actions","children","className","defaultValue","name","onChange","value"],TRe=t=>{const{classes:e,row:n,error:r}=t;return Ue({root:["root",n&&"row",r&&"error"]},ORe,e)},E5=M.forwardRef(function(e,n){const{actions:r,children:i,className:o,defaultValue:a,name:s,onChange:l,value:c}=e,u=Ae(e,CRe),f=M.useRef(null),d=TRe(e),[h,p]=Qs({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=pd(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(iie.Provider,{value:v,children:w.jsx(cke,j({role:"radiogroup",ref:m,className:ke(d.root,o)},u,{children:i}))})});function ERe(t){return We("MuiSelect",t)}const v0=Ve("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var U8;const PRe=["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"],MRe=we("div",{name:"MuiSelect",slot:"Select",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`&.${v0.select}`]:e.select},{[`&.${v0.select}`]:e[n.variant]},{[`&.${v0.error}`]:e.error},{[`&.${v0.multiple}`]:e.multiple}]}})(tie,{[`&.${v0.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),kRe=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]}})(nie),ARe=we("input",{shouldForwardProp:t=>DM(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 W8(t,e){return typeof e=="object"&&e!==null?t===e:String(t)===String(e)}function RRe(t){return t==null||typeof t=="string"&&!t.trim()}const IRe=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,ERe,e)},DRe=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,PRe),[U,W]=Qs({controlled:L,default:f,name:"Select"}),[$,N]=Qs({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:U}),[U]),M.useEffect(()=>{u&&$&&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 $e=()=>{getSelection().isCollapsed&&A.current.focus()};return me.addEventListener("click",$e),()=>{me.removeEventListener("click",$e)}}},[v]);const re=(me,$e)=>{me?E&&E($e):O&&O($e),K||(te(s?null:be.clientWidth),N(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 $e=ce.find(Te=>Te.props.value===me.target.value);$e!==void 0&&(W($e.props.value),S&&S(me,$e))},Q=me=>$e=>{let Te;if($e.currentTarget.hasAttribute("tabindex")){if(x){Te=Array.isArray(U)?U.slice():[];const Re=U.indexOf(me.props.value);Re===-1?Te.push(me.props.value):Te.splice(Re,1)}else Te=me.props.value;if(me.props.onClick&&me.props.onClick($e),U!==Te&&(W(Te),S)){const Re=$e.nativeEvent||$e,ae=new Re.constructor(Re.type,Re);Object.defineProperty(ae,"target",{writable:!0,value:{value:Te,name:b}}),S(ae,me)}x||re(!1,$e)}},X=me=>{I||[" ","ArrowUp","ArrowDown","Enter"].indexOf(me.key)!==-1&&(me.preventDefault(),re(!0,me))},ee=q!==null&&$,ge=me=>{!ee&&_&&(Object.defineProperty(me,"target",{writable:!0,value:{value:U,name:b}}),_(me))};delete B["aria-invalid"];let ye,H;const G=[];let ie=!1;(AT({value:U})||h)&&(P?ye=P(U):ie=!0);const he=ce.map(me=>{if(!M.isValidElement(me))return null;let $e;if(x){if(!Array.isArray(U))throw new Error(fu(2));$e=U.some(Te=>W8(Te,me.props.value)),$e&&ie&&G.push(me.props.children)}else $e=W8(U,me.props.value),$e&&ie&&(H=me.props.children);return M.cloneElement(me,{"aria-selected":$e?"true":"false",onClick:Q(me),onKeyUp:Te=>{Te.key===" "&&Te.preventDefault(),me.props.onKeyUp&&me.props.onKeyUp(Te)},role:"option",selected:$e,value:void 0,"data-value":me.props.value})});ie&&(x?G.length===0?ye=null:ye=G.reduce((me,$e,Te)=>(me.push($e),Te{const{classes:e}=t;return e},P5={name:"MuiSelect",overridesResolver:(t,e)=>e.root,shouldForwardProp:t=>hi(t)&&t!=="variant",slot:"Root"},FRe=we(yd,P5)(""),jRe=we(T5,P5)(""),BRe=we(O5,P5)(""),xd=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=DPe,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,LRe),k=y?rRe:DRe,I=oc(),P=gd({props:r,muiFormControl:I,states:["variant","error"]}),R=P.variant||C,T=j({},r,{variant:R,classes:a}),L=$Re(T),z=Ae(L,NRe),B=d||{standard:w.jsx(FRe,{ownerState:T}),outlined:w.jsx(jRe,{label:p,ownerState:T}),filled:w.jsx(BRe,{ownerState:T})}[R],U=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:U,className:ke(B.props.className,s,L.root)},!d&&{variant:R},E))})});xd.muiName="Select";const zRe=t=>!t||!Vl(t);function URe(t){return We("MuiSlider",t)}const Xa=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"]),WRe=t=>{const{open:e}=t;return{offset:ke(e&&Xa.valueLabelOpen),circle:Xa.valueLabelCircle,label:Xa.valueLabelLabel}};function VRe(t){const{children:e,className:n,value:r}=t,i=WRe(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 GRe=["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"],HRe=l5();function V8(t){return t}const qRe=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"},[`&.${Xa.disabled}`]:{pointerEvents:"none",cursor:"default",color:(t.vars||t).palette.grey[400]},[`&.${Xa.dragging}`]:{[`& .${Xa.thumb}, & .${Xa.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}}]}}),XRe=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}}]}),QRe=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:Rb(t.palette[n].main,.62),borderColor:Rb(t.palette[n].main,.62)},t.applyStyles("dark",{backgroundColor:Ab(t.palette[n].main,.5)}),t.applyStyles("dark",{borderColor:Ab(t.palette[n].main,.5)})))}))]}}),YRe=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%)"},[`&.${Xa.disabled}`]:{"&:hover":{boxShadow:"none"}},variants:[{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%)"}},...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, &.${Xa.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"}}),[`&.${Xa.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)}`})}}))]}}),KRe=we(VRe,{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%"},[`&.${Xa.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%"},[`&.${Xa.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"}}]})),ZRe=we("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:t=>DM(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}}]})),JRe=we("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:t=>DM(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}}]})),eIe=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,URe,a)},tIe=({children:t})=>t,ry=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=HRe({props:e,name:"MuiSlider"}),P=R1(),{"aria-label":R,"aria-valuetext":T,"aria-labelledby":L,component:z="span",components:B={},componentsProps:U={},color:W="primary",classes:$,className:N,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=V8,slotProps:F,slots:ce,track:le="normal",valueLabelDisplay:Q="off",valueLabelFormat:X=V8}=I,ee=Ae(I,GRe),ge=j({},I,{isRtl:P,max:se,min:te,classes:$,disabled:A,disableSwap:D,orientation:J,marks:K,color:W,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:$e,getThumbStyle:Te}=oPe(j({},ge,{rootRef:n}));ge.marked=xe.length>0&&xe.some(Ze=>Ze.label),ge.dragging=de,ge.focusedThumbIndex=Z;const Re=eIe(ge),ae=(r=(i=ce==null?void 0:ce.root)!=null?i:B.Root)!=null?r:qRe,Le=(o=(a=ce==null?void 0:ce.rail)!=null?a:B.Rail)!=null?o:XRe,Ee=(s=(l=ce==null?void 0:ce.track)!=null?l:B.Track)!=null?s:QRe,ze=(c=(u=ce==null?void 0:ce.thumb)!=null?u:B.Thumb)!=null?c:YRe,He=(f=(d=ce==null?void 0:ce.valueLabel)!=null?d:B.ValueLabel)!=null?f:KRe,xt=(h=(p=ce==null?void 0:ce.mark)!=null?p:B.Mark)!=null?h:ZRe,Dt=(m=(g=ce==null?void 0:ce.markLabel)!=null?g:B.MarkLabel)!=null?m:JRe,nn=(v=(y=ce==null?void 0:ce.input)!=null?y:B.Input)!=null?v:"input",Xr=(x=F==null?void 0:F.root)!=null?x:U.root,Cn=(b=F==null?void 0:F.rail)!=null?b:U.rail,Qr=(_=F==null?void 0:F.track)!=null?_:U.track,ir=(S=F==null?void 0:F.thumb)!=null?S:U.thumb,to=(O=F==null?void 0:F.valueLabel)!=null?O:U.valueLabel,yo=(C=F==null?void 0:F.mark)!=null?C:U.mark,Xo=(E=F==null?void 0:F.markLabel)!=null?E:U.markLabel,al=(k=F==null?void 0:F.input)!=null?k:U.input,yi=$r({elementType:ae,getSlotProps:H,externalSlotProps:Xr,externalForwardedProps:ee,additionalProps:j({},zRe(ae)&&{as:z}),ownerState:j({},ge,Xr==null?void 0:Xr.ownerState),className:[Re.root,N]}),Ts=$r({elementType:Le,externalSlotProps:Cn,ownerState:ge,className:Re.rail}),ne=$r({elementType:Ee,externalSlotProps:Qr,additionalProps:{style:j({},ye[oe].offset(me),ye[oe].leap($e))},ownerState:j({},ge,Qr==null?void 0:Qr.ownerState),className:Re.track}),Pe=$r({elementType:ze,getSlotProps:ie,externalSlotProps:ir,ownerState:j({},ge,ir==null?void 0:ir.ownerState),className:Re.thumb}),Ie=$r({elementType:He,externalSlotProps:to,ownerState:j({},ge,to==null?void 0:to.ownerState),className:Re.valueLabel}),Oe=$r({elementType:xt,externalSlotProps:yo,ownerState:ge,className:Re.mark}),Ne=$r({elementType:Dt,externalSlotProps:Xo,ownerState:ge,className:Re.markLabel}),ot=$r({elementType:nn,getSlotProps:G,externalSlotProps:al,ownerState:ge});return w.jsxs(ae,j({},yi,{children:[w.jsx(Le,j({},Ts)),w.jsx(Ee,j({},ne)),xe.filter(Ze=>Ze.value>=te&&Ze.value<=se).map((Ze,mt)=>{const wt=kT(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,!Vl(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},Ne,!Vl(Dt)&&{markLabelActive:Pt},{style:j({},zt,Ne.style),className:ke(Re.markLabel,Ne.className,Pt&&Re.markLabelActive),children:Ze.label})):null]},mt)}),Me.map((Ze,mt)=>{const wt=kT(Ze,te,se),zt=ye[oe].offset(wt),Pt=Q==="off"?tIe:He;return w.jsx(Pt,j({},!Vl(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,Te(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)})]}))});function nIe(t){return We("MuiSnackbarContent",t)}Ve("MuiSnackbarContent",["root","message","action"]);const rIe=["action","className","message","role"],iIe=t=>{const{classes:e}=t;return Ue({root:["root"],action:["action"],message:["message"]},nIe,e)},oIe=we(Ho,{name:"MuiSnackbarContent",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>{const e=t.palette.mode==="light"?.8:.98,n=iOe(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}})}),aIe=we("div",{name:"MuiSnackbarContent",slot:"Message",overridesResolver:(t,e)=>e.message})({padding:"8px 0"}),sIe=we("div",{name:"MuiSnackbarContent",slot:"Action",overridesResolver:(t,e)=>e.action})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),oie=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,rIe),c=r,u=iIe(c);return w.jsxs(oIe,j({role:s,square:!0,elevation:6,className:ke(u.root,o),ownerState:c,ref:n},l,{children:[w.jsx(aIe,{className:u.message,ownerState:c,children:a}),i?w.jsx(sIe,{className:u.action,ownerState:c,children:i}):null]}))});function lIe(t){return We("MuiSnackbar",t)}Ve("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const cIe=["onEnter","onExited"],uIe=["action","anchorOrigin","autoHideDuration","children","className","ClickAwayListenerProps","ContentProps","disableWindowBlurListener","message","onBlur","onClose","onFocus","onMouseEnter","onMouseLeave","open","resumeHideDuration","TransitionComponent","transitionDuration","TransitionProps"],fIe=t=>{const{classes:e,anchorOrigin:n}=t,r={root:["root",`anchorOrigin${De(n.vertical)}${De(n.horizontal)}`]};return Ue(r,lIe,e)},G8=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"})})}),dIe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiSnackbar"}),i=Go(),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=ev,transitionDuration:y=o,TransitionProps:{onEnter:x,onExited:b}={}}=r,_=Ae(r.TransitionProps,cIe),S=Ae(r,uIe),O=j({},r,{anchorOrigin:{vertical:s,horizontal:l},autoHideDuration:c,disableWindowBlurListener:p,TransitionComponent:v,transitionDuration:y}),C=fIe(O),{getRootProps:E,onClickAway:k}=aPe(j({},O)),[I,P]=M.useState(!0),R=$r({elementType:G8,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(_Te,j({onClickAway:k},d,{children:w.jsx(G8,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(oie,j({message:m,action:a},h))}))}))}))});function hIe(t){return We("MuiTooltip",t)}const _f=Ve("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]),pIe=["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 mIe(t){return Math.round(t*1e5)/1e5}const gIe=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,hIe,e)},vIe=we(_5,{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"] .${_f.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${_f.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${_f.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"] .${_f.arrow}`]:j({},e.isRtl?{left:0,marginLeft:"-0.71em"}:{right:0,marginRight:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}})})),yIe=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:`${mIe(16/14)}em`,fontWeight:t.typography.fontWeightRegular},{[`.${_f.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"})),[`.${_f.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"})),[`.${_f.popper}[data-popper-placement*="top"] &`]:j({transformOrigin:"center bottom",marginBottom:"14px"},e.touch&&{marginBottom:"24px"}),[`.${_f.popper}[data-popper-placement*="bottom"] &`]:j({transformOrigin:"center top",marginTop:"14px"},e.touch&&{marginTop:"24px"})})),xIe=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 dS=!1;const H8=new k1;let y0={x:0,y:0};function hS(t,e){return(n,...r)=>{e&&e(n,...r),t(n,...r)}}const _t=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:U=700,followCursor:W=!1,id:$,leaveDelay:N=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=ev,TransitionProps:ve}=S,F=Ae(S,pIe),ce=M.isValidElement(C)?C:w.jsx("span",{children:C}),le=Go(),Q=R1(),[X,ee]=M.useState(),[ge,ye]=M.useState(null),H=M.useRef(!1),G=T||W,ie=bf(),he=bf(),_e=bf(),oe=bf(),[Z,V]=Qs({controlled:Y,default:!1,name:"Tooltip",state:"open"});let de=Z;const xe=pd($),Me=M.useRef(),me=_r(()=>{Me.current!==void 0&&(document.body.style.WebkitUserSelect=Me.current,Me.current=void 0),oe.clear()});M.useEffect(()=>me,[me]);const $e=st=>{H8.clear(),dS=!0,V(!0),q&&!de&&q(st)},Te=_r(st=>{H8.start(800+N,()=>{dS=!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||dS&&B?he.start(dS?B:z,()=>{$e(st)}):$e(st))},ae=st=>{he.clear(),_e.start(N,()=>{Te(st)})},{isFocusVisibleRef:Le,onBlur:Ee,onFocus:ze,ref:He}=A1(),[,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))},Xr=st=>{H.current=!0;const Qt=ce.props;Qt.onTouchStart&&Qt.onTouchStart(st)},Cn=st=>{Xr(st),_e.clear(),ie.clear(),me(),Me.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",oe.start(U,()=>{document.body.style.WebkitUserSelect=Me.current,Re(st)})},Qr=st=>{ce.props.onTouchEnd&&ce.props.onTouchEnd(st),me(),_e.start(D,()=>{Te(st)})};M.useEffect(()=>{if(!de)return;function st(Qt){(Qt.key==="Escape"||Qt.key==="Esc")&&Te(Qt)}return document.addEventListener("keydown",st),()=>{document.removeEventListener("keydown",st)}},[Te,de]);const ir=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),y0={x:st.clientX,y:st.clientY},to.current&&to.current.update()},Xo={},al=typeof be=="string";I?(Xo.title=!de&&al&&!R?be:null,Xo["aria-describedby"]=de?xe:null):(Xo["aria-label"]=al?be:null,Xo["aria-labelledby"]=de&&!al?xe:null);const yi=j({},Xo,F,ce.props,{className:ke(F.className,ce.props.className),onTouchStart:Xr,ref:ir},W?{onMouseMove:yo}:{}),Ts={};L||(yi.onTouchStart=Cn,yi.onTouchEnd=Qr),R||(yi.onMouseOver=hS(Re,yi.onMouseOver),yi.onMouseLeave=hS(ae,yi.onMouseLeave),G||(Ts.onMouseOver=Re,Ts.onMouseLeave=ae)),P||(yi.onFocus=hS(nn,yi.onFocus),yi.onBlur=hS(Dt,yi.onBlur),G||(Ts.onFocus=nn,Ts.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=gIe(Pe),Oe=(r=(i=pe.popper)!=null?i:E.Popper)!=null?r:vIe,Ne=(o=(a=(s=pe.transition)!=null?s:E.Transition)!=null?a:re)!=null?o:ev,ot=(l=(c=pe.tooltip)!=null?c:E.Tooltip)!=null?l:yIe,Ze=(u=(f=pe.arrow)!=null?f:E.Arrow)!=null?u:xIe,mt=Zm(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=Zm(Ne,j({},ve,(m=J.transition)!=null?m:k.transition),Pe),zt=Zm(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=Zm(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??_5,placement:K,anchorEl:W?{getBoundingClientRect:()=>({top:y0.y,left:y0.x,right:y0.x,bottom:y0.y,width:0,height:0})}:X,popperRef:to,open:X?de:!1,id:xe,transition:!0},Ts,mt,{popperOptions:ne,children:({TransitionProps:st})=>w.jsx(Ne,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]}))}))}))]})});function bIe(t){return We("MuiSwitch",t)}const oo=Ve("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),_Ie=["className","color","edge","size","sx"],wIe=l5(),SIe=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,bIe,e);return j({},e,l)},OIe=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)"}}}}]}),CIe=we(S5,{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"?Rb(t.palette[e].main,.62):Ab(t.palette[e].main,.55)}`}},[`&.${oo.checked} + .${oo.track}`]:{backgroundColor:(t.vars||t).palette[e].main}}}))]})),TIe=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}`})),EIe=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%"})),aie=M.forwardRef(function(e,n){const r=wIe({props:e,name:"MuiSwitch"}),{className:i,color:o="primary",edge:a=!1,size:s="medium",sx:l}=r,c=Ae(r,_Ie),u=j({},r,{color:o,edge:a,size:s}),f=SIe(u),d=w.jsx(EIe,{className:f.thumb,ownerState:u});return w.jsxs(OIe,{className:ke(f.root,i),sx:l,ownerState:u,children:[w.jsx(CIe,j({type:"checkbox",icon:d,checkedIcon:d,ref:n,ownerState:u},c,{classes:j({},f,{root:f.switchBase})})),w.jsx(TIe,{className:f.track,ownerState:u})]})});function PIe(t){return We("MuiTab",t)}const Au=Ve("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),MIe=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],kIe=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,PIe,e)},AIe=we(fs,{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,{[`& .${Au.iconWrapper}`]:e.iconWrapper}]}})(({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,[`& > .${Au.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,[`&.${Au.selected}`]:{opacity:1},[`&.${Au.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.textColor==="primary"&&{color:(t.vars||t).palette.text.secondary,[`&.${Au.selected}`]:{color:(t.vars||t).palette.primary.main},[`&.${Au.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.textColor==="secondary"&&{color:(t.vars||t).palette.text.secondary,[`&.${Au.selected}`]:{color:(t.vars||t).palette.secondary.main},[`&.${Au.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)})),$b=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,MIe),_=j({},r,{disabled:o,disableFocusRipple:a,selected:m,icon:!!l,iconPosition:c,label:!!f,fullWidth:s,textColor:v,wrapped:x}),S=kIe(_),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(AIe,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]}))}),sie=M.createContext();function RIe(t){return We("MuiTable",t)}Ve("MuiTable",["root","stickyHeader"]);const IIe=["className","component","padding","size","stickyHeader"],DIe=t=>{const{classes:e,stickyHeader:n}=t;return Ue({root:["root",n&&"stickyHeader"]},RIe,e)},LIe=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"})),q8="table",M5=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTable"}),{className:i,component:o=q8,padding:a="normal",size:s="medium",stickyHeader:l=!1}=r,c=Ae(r,IIe),u=j({},r,{component:o,padding:a,size:s,stickyHeader:l}),f=DIe(u),d=M.useMemo(()=>({padding:a,size:s,stickyHeader:l}),[a,s,l]);return w.jsx(sie.Provider,{value:d,children:w.jsx(LIe,j({as:o,role:o===q8?null:"table",ref:n,className:ke(f.root,i),ownerState:u},c))})}),t2=M.createContext();function NIe(t){return We("MuiTableBody",t)}Ve("MuiTableBody",["root"]);const $Ie=["className","component"],FIe=t=>{const{classes:e}=t;return Ue({root:["root"]},NIe,e)},jIe=we("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"table-row-group"}),BIe={variant:"body"},X8="tbody",k5=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTableBody"}),{className:i,component:o=X8}=r,a=Ae(r,$Ie),s=j({},r,{component:o}),l=FIe(s);return w.jsx(t2.Provider,{value:BIe,children:w.jsx(jIe,j({className:ke(l.root,i),as:o,ref:n,role:o===X8?null:"rowgroup",ownerState:s},a))})});function zIe(t){return We("MuiTableCell",t)}const UIe=Ve("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),WIe=["align","className","component","padding","scope","size","sortDirection","variant"],VIe=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,zIe,e)},GIe=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"?Rb(kt(t.palette.divider,1),.88):Ab(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",[`&.${UIe.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})),sr=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,WIe),h=M.useContext(sie),p=M.useContext(t2),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=VIe(x);let _=null;return u&&(_=u==="asc"?"ascending":"descending"),w.jsx(GIe,j({as:g,ref:n,className:ke(b.root,o),"aria-sort":_,scope:v,ownerState:x},d))});function HIe(t){return We("MuiTableContainer",t)}Ve("MuiTableContainer",["root"]);const qIe=["className","component"],XIe=t=>{const{classes:e}=t;return Ue({root:["root"]},HIe,e)},QIe=we("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(t,e)=>e.root})({width:"100%",overflowX:"auto"}),lie=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTableContainer"}),{className:i,component:o="div"}=r,a=Ae(r,qIe),s=j({},r,{component:o}),l=XIe(s);return w.jsx(QIe,j({ref:n,as:o,className:ke(l.root,i),ownerState:s},a))});function YIe(t){return We("MuiTableHead",t)}Ve("MuiTableHead",["root"]);const KIe=["className","component"],ZIe=t=>{const{classes:e}=t;return Ue({root:["root"]},YIe,e)},JIe=we("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"table-header-group"}),eDe={variant:"head"},Q8="thead",tDe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTableHead"}),{className:i,component:o=Q8}=r,a=Ae(r,KIe),s=j({},r,{component:o}),l=ZIe(s);return w.jsx(t2.Provider,{value:eDe,children:w.jsx(JIe,j({as:o,className:ke(l.root,i),ref:n,role:o===Q8?null:"rowgroup",ownerState:s},a))})});function nDe(t){return We("MuiToolbar",t)}Ve("MuiToolbar",["root","gutters","regular","dense"]);const rDe=["className","component","disableGutters","variant"],iDe=t=>{const{classes:e,disableGutters:n,variant:r}=t;return Ue({root:["root",!n&&"gutters",r]},nDe,e)},oDe=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),n2=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,rDe),c=j({},r,{component:o,disableGutters:a,variant:s}),u=iDe(c);return w.jsx(oDe,j({as:o,className:ke(u.root,i),ref:n,ownerState:c},l))}),aDe=ni(w.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),sDe=ni(w.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight");function lDe(t){return We("MuiTableRow",t)}const Y8=Ve("MuiTableRow",["root","selected","hover","head","footer"]),cDe=["className","component","hover","selected"],uDe=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"]},lDe,e)},fDe=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,[`&.${Y8.hover}:hover`]:{backgroundColor:(t.vars||t).palette.action.hover},[`&.${Y8.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)}}})),K8="tr",vl=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTableRow"}),{className:i,component:o=K8,hover:a=!1,selected:s=!1}=r,l=Ae(r,cDe),c=M.useContext(t2),u=j({},r,{component:o,hover:a,selected:s,head:c&&c.variant==="head",footer:c&&c.variant==="footer"}),f=uDe(u);return w.jsx(fDe,j({as:o,ref:n,className:ke(f.root,i),role:o===K8?null:"row",ownerState:u},l))});function dDe(t){return(1+Math.sin(Math.PI*t-Math.PI/2))/2}function hDe(t,e,n,r={},i=()=>{}){const{ease:o=dDe,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 pDe=["onChange"],mDe={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function gDe(t){const{onChange:e}=t,n=Ae(t,pDe),r=M.useRef(),i=M.useRef(null),o=()=>{r.current=i.current.offsetHeight-i.current.clientHeight};return Hr(()=>{const a=Kv(()=>{const l=r.current;o(),l!==r.current&&e(r.current)}),s=cs(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:mDe,ref:i},n))}function vDe(t){return We("MuiTabScrollButton",t)}const yDe=Ve("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),xDe=["className","slots","slotProps","direction","orientation","disabled"],bDe=t=>{const{classes:e,orientation:n,disabled:r}=t;return Ue({root:["root",n,r&&"disabled"]},vDe,e)},_De=we(fs,{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,[`&.${yDe.disabled}`]:{opacity:0}},t.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${t.isRtl?-90:90}deg)`}})),wDe=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,xDe),f=R1(),d=j({isRtl:f},o),h=bDe(d),p=(r=s.StartScrollButtonIcon)!=null?r:aDe,m=(i=s.EndScrollButtonIcon)!=null?i:sDe,g=$r({elementType:p,externalSlotProps:l.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:d}),v=$r({elementType:m,externalSlotProps:l.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:d});return w.jsx(_De,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))}))});function SDe(t){return We("MuiTabs",t)}const kC=Ve("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),ODe=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","slots","slotProps","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],Z8=(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,pS=(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}}},CDe=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"]},SDe,l)},TDe=we("div",{name:"MuiTabs",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${kC.scrollButtons}`]:e.scrollButtons},{[`& .${kC.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&&{[`& .${kC.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}})),EDe=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"})),PDe=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"})),MDe=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})),kDe=we(gDe)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),eG={},A5=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTabs"}),i=Go(),o=R1(),{"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=wDe,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,ODe),R=k==="scrollable",T=g==="vertical",L=T?"scrollTop":"scrollLeft",z=T?"top":"left",B=T?"bottom":"right",U=T?"clientHeight":"clientWidth",W=T?"height":"width",$=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}),N=CDe($),D=$r({elementType:b.StartScrollButtonIcon,externalSlotProps:_.startScrollButtonIcon,ownerState:$}),A=$r({elementType:b.EndScrollButtonIcon,externalSlotProps:_.endScrollButtonIcon,ownerState:$}),[q,Y]=M.useState(!1),[K,se]=M.useState(eG),[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 Te=Q.current;let Re;if(Te){const Le=Te.getBoundingClientRect();Re={clientWidth:Te.clientWidth,scrollLeft:Te.scrollLeft,scrollTop:Te.scrollTop,scrollLeftNormalized:NSe(Te,o?"rtl":"ltr"),scrollWidth:Te.scrollWidth,top:Le.top,bottom:Le.bottom,left:Le.left,right:Le.right}}let ae;if(Te&&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=_r(()=>{const{tabsMeta:Te,tabMeta:Re}=ee();let ae=0,Le;if(T)Le="top",Re&&Te&&(ae=Re.top-Te.top+Te.scrollTop);else if(Le=o?"right":"left",Re&&Te){const ze=o?Te.scrollLeftNormalized+Te.clientWidth-Te.scrollWidth:Te.scrollLeft;ae=(o?-1:1)*(Re[Le]-Te[Le]+ze)}const Ee={[Le]:ae,[W]:Re?Re[W]:0};if(isNaN(K[Le])||isNaN(K[W]))se(Ee);else{const ze=Math.abs(K[Le]-Ee[Le]),He=Math.abs(K[W]-Ee[W]);(ze>=1||He>=1)&&se(Ee)}}),ye=(Te,{animation:Re=!0}={})=>{Re?hDe(L,Q.current,Te,{duration:i.transitions.duration.standard}):Q.current[L]=Te},H=Te=>{let Re=Q.current[L];T?Re+=Te:(Re+=Te*(o?-1:1),Re*=o&&rre()==="reverse"?-1:1),ye(Re)},G=()=>{const Te=Q.current[U];let Re=0;const ae=Array.from(X.current.children);for(let Le=0;LeTe){Le===0&&(Re=Te);break}Re+=Ee[U]}return Re},ie=()=>{H(-1*G())},he=()=>{H(G())},_e=M.useCallback(Te=>{ce({overflow:null,scrollbarWidth:Te})},[]),oe=()=>{const Te={};Te.scrollbarSizeListener=R?w.jsx(kDe,{onChange:_e,className:ke(N.scrollableX,N.hideScrollbar)}):null;const ae=R&&(y==="auto"&&(te||pe)||y===!0);return Te.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(N.scrollButtons,O.className)})):null,Te.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(N.scrollButtons,O.className)})):null,Te},Z=_r(Te=>{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:Te})}}}),V=_r(()=>{R&&y!==!1&&ve(!re)});M.useEffect(()=>{const Te=Kv(()=>{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)})}),Te(),V()},Le=cs(Q.current);Le.addEventListener("resize",Te);let Ee;return typeof ResizeObserver<"u"&&(Re=new ResizeObserver(Te),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;Te.clear(),Le.removeEventListener("resize",Te),(ze=Ee)==null||ze.disconnect(),(He=Re)==null||He.disconnect()}},[ge,V]),M.useEffect(()=>{const Te=Array.from(X.current.children),Re=Te.length;if(typeof IntersectionObserver<"u"&&Re>0&&R&&y!==!1){const ae=Te[0],Le=Te[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(eG!==K)},[Z,K]),M.useImperativeHandle(l,()=>({updateIndicator:ge,updateScrollButtons:V}),[ge,V]);const de=w.jsx(MDe,j({},S,{className:ke(N.indicator,S.className),ownerState:$,style:j({},K,S.style)}));let xe=0;const Me=M.Children.map(u,Te=>{if(!M.isValidElement(Te))return null;const Re=Te.props.value===void 0?xe:Te.props.value;le.set(Re,xe);const ae=Re===E;return xe+=1,M.cloneElement(Te,j({fullWidth:k==="fullWidth",indicator:ae&&!q&&de,selected:ae,selectionFollowsFocus:x,onChange:m,textColor:C,value:Re},xe===1&&E===!1&&!Te.props.tabIndex?{tabIndex:0}:{}))}),me=Te=>{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"),Te.key){case Ee:Te.preventDefault(),pS(Re,ae,J8);break;case ze:Te.preventDefault(),pS(Re,ae,Z8);break;case"Home":Te.preventDefault(),pS(Re,null,Z8);break;case"End":Te.preventDefault(),pS(Re,null,J8);break}},$e=oe();return w.jsxs(TDe,j({className:ke(N.root,f),ownerState:$,ref:n,as:d},P,{children:[$e.scrollButtonStart,$e.scrollbarSizeListener,w.jsxs(EDe,{className:N.scroller,ownerState:$,style:{overflow:F.overflow,[T?`margin${o?"Left":"Right"}`:"marginBottom"]:I?void 0:-F.scrollbarWidth},ref:Q,children:[w.jsx(PDe,{"aria-label":a,"aria-labelledby":s,"aria-orientation":g==="vertical"?"vertical":null,className:N.flexContainer,ownerState:$,onKeyDown:me,ref:X,role:"tablist",children:Me}),q&&de]}),$e.scrollButtonEnd]}))});function ADe(t){return We("MuiTextField",t)}Ve("MuiTextField",["root"]);const RDe=["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"],IDe={standard:yd,filled:O5,outlined:T5},DDe=t=>{const{classes:e}=t;return Ue({root:["root"]},ADe,e)},LDe=we(ty,{name:"MuiTextField",slot:"Root",overridesResolver:(t,e)=>e.root})({}),cr=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:U,variant:W="outlined"}=r,$=Ae(r,RDe),N=j({},r,{autoFocus:o,color:l,disabled:u,error:f,fullWidth:h,multiline:O,required:R,select:L,variant:W}),D=DDe(N),A={};W==="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=pd(m),Y=p&&q?`${q}-helper-text`:void 0,K=b&&q?`${q}-label`:void 0,se=IDe[W],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:U,id:q,inputRef:x,onBlur:E,onChange:k,onFocus:I,placeholder:P,inputProps:v},A,y));return w.jsxs(LDe,j({className:ke(D.root,s),disabled:u,error:f,fullWidth:h,ref:n,required:R,color:l,variant:W,ownerState:N},$,{children:[b!=null&&b!==""&&w.jsx(ny,j({htmlFor:q,id:K},g,{children:b})),L?w.jsx(xd,j({"aria-describedby":Y,id:q,labelId:K,value:U,input:te},z,{children:a})):te,p&&w.jsx(qre,j({id:Y},d,{children:p}))]}))});function NDe(t){return We("MuiToggleButton",t)}const Jm=Ve("MuiToggleButton",["root","disabled","selected","standard","primary","secondary","sizeSmall","sizeMedium","sizeLarge","fullWidth"]),cie=M.createContext({}),uie=M.createContext(void 0);function $De(t,e){return e===void 0||t===void 0?!1:Array.isArray(e)?e.indexOf(t)>=0:t===e}const FDe=["value"],jDe=["children","className","color","disabled","disableFocusRipple","fullWidth","onChange","onClick","selected","size","value"],BDe=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,NDe,e)},zDe=we(fs,{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%"},{[`&.${Jm.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})`:Hc(t.palette.text.primary,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Jm.selected}`]:{color:n,backgroundColor:t.vars?`rgba(${r} / ${t.vars.palette.action.selectedOpacity})`:Hc(n,t.palette.action.selectedOpacity),"&:hover":{backgroundColor:t.vars?`rgba(${r} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:Hc(n,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${r} / ${t.vars.palette.action.selectedOpacity})`:Hc(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)})}),Pn=M.forwardRef(function(e,n){const r=M.useContext(cie),{value:i}=r,o=Ae(r,FDe),a=M.useContext(uie),s=kM(j({},o,{selected:$De(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,jDe),_=j({},l,{color:f,disabled:d,disableFocusRipple:h,fullWidth:p,size:y}),S=BDe(_),O=E=>{g&&(g(E,x),E.defaultPrevented)||m&&m(E,x)},C=a||"";return w.jsx(zDe,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}))});function UDe(t){return We("MuiToggleButtonGroup",t)}const ar=Ve("MuiToggleButtonGroup",["root","selected","horizontal","vertical","disabled","grouped","groupedHorizontal","groupedVertical","fullWidth","firstButton","lastButton","middleButton"]),WDe=["children","className","color","disabled","exclusive","fullWidth","onChange","orientation","size","value"],VDe=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,UDe,e)},GDe=we("div",{name:"MuiToggleButtonGroup",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${ar.grouped}`]:e.grouped},{[`& .${ar.grouped}`]:e[`grouped${De(n.orientation)}`]},{[`& .${ar.firstButton}`]:e.firstButton},{[`& .${ar.lastButton}`]:e.lastButton},{[`& .${ar.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%"},{[`& .${ar.grouped}`]:j({},t.orientation==="horizontal"?{[`&.${ar.selected} + .${ar.grouped}.${ar.selected}`]:{borderLeft:0,marginLeft:0}}:{[`&.${ar.selected} + .${ar.grouped}.${ar.selected}`]:{borderTop:0,marginTop:0}})},t.orientation==="horizontal"?{[`& .${ar.firstButton},& .${ar.middleButton}`]:{borderTopRightRadius:0,borderBottomRightRadius:0},[`& .${ar.lastButton},& .${ar.middleButton}`]:{marginLeft:-1,borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0}}:{[`& .${ar.firstButton},& .${ar.middleButton}`]:{borderBottomLeftRadius:0,borderBottomRightRadius:0},[`& .${ar.lastButton},& .${ar.middleButton}`]:{marginTop:-1,borderTop:"1px solid transparent",borderTopLeftRadius:0,borderTopRightRadius:0}},t.orientation==="horizontal"?{[`& .${ar.lastButton}.${Jm.disabled},& .${ar.middleButton}.${Jm.disabled}`]:{borderLeft:"1px solid transparent"}}:{[`& .${ar.lastButton}.${Jm.disabled},& .${ar.middleButton}.${Jm.disabled}`]:{borderTop:"1px solid transparent"}})),iy=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,WDe),m=j({},r,{disabled:s,fullWidth:c,orientation:f,size:d}),g=VDe(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=$Se(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(GDe,j({role:"group",className:ke(g.root,o),ref:n,ownerState:m},p,{children:w.jsx(cie.Provider,{value:x,children:b.map((O,C)=>w.jsx(uie.Provider,{value:S(C),children:O},C))})}))}),HDe="default",qDe={id:"local",name:"Local Server",url:"http://localhost:8080"},XDe={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},mS={name:HDe,server:qDe,branding:XDe};function QDe(){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 r2=QDe();console.log("baseUrl = ",r2.href);function fie(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 YDe={amber:vne,blue:rf,blueGrey:e1e,brown:yne,cyan:hne,deepOrange:Dh,deepPurple:Z_e,green:Lc,grey:xne,indigo:dne,lightBlue:of,lightGreen:J_e,lime:mne,orange:oh,pink:fne,purple:nf,red:tf,teal:pne,yellow:gne};function tG(t,e){const n=t[e];let r=null;if(typeof n=="string"?(r=YDe[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 KDe(t,e,n){const r=t[e];typeof r=="string"&&(t[e]=fie(r2.href,n,r))}function ZDe(t,e){return t={...t},tG(t,"primaryColor"),tG(t,"secondaryColor"),KDe(t,"logoImage",e),t}function En(t){return typeof t=="number"}function Mp(t){return typeof t=="string"}function JDe(t){return typeof t=="function"}function nG(t){return t!==null&&typeof t=="object"&&t.constructor===Object}const hf=new URLSearchParams(window.location.search),$s=class $s{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=hf.get("configPath")||"config";const n=await this.loadRawConfig(e);n===mS&&(e="");const r=n.name||"default",i=this.getAuthConfig(n),o=this.getServerConfig(n),a=parseInt(hf.get("compact")||"0")!==0;let s=ZDe({...mS.branding,...n.branding,compact:a||n.branding.compact},e);return s=iG(s,"allowUserVariables"),s=iG(s,"allow3D"),$s._instance=new $s(r,o,s,i),s.windowTitle&&this.changeWindowTitle(s.windowTitle),s.windowIcon&&this.changeWindowIcon(s.windowIcon),$s._instance}static getAuthConfig(e){let n=e.authClient&&{...e.authClient};const r=$s.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={...mS.server,...e.server},r=$s.getApiServerFromEnv();return n.id=hf.get("serverId")||r.id||n.id,n.name=hf.get("serverName")||r.name||n.name,n.url=hf.get("serverUrl")||r.url||n.url,n}static async loadRawConfig(e){let n=null,r=null;const i=fie(r2.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=mS),n}static get instance(){return $s.assertConfigLoaded(),$s._instance}static assertConfigLoaded(){if(!$s._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(){return{authority:void 0,clientId:void 0,audience:void 0}}static getApiServerFromEnv(){return{id:void 0,name:void 0,url:void 0}}};Yt($s,"_instance");let Kt=$s;const R5=[["red",tf],["yellow",gne],["blue",rf],["pink",fne],["lightBlue",of],["green",Lc],["orange",oh],["lime",mne],["purple",nf],["indigo",dne],["cyan",hne],["brown",yne],["teal",pne]],eLe=(()=>{const t={};return R5.forEach(([e,n])=>{t[e]=n}),t})(),rG=R5.map(([t,e])=>t);function tLe(t){return t==="light"?800:400}function tp(t){return rG[t%rG.length]}function die(t,e){const n=tLe(e);return eLe[t][n]}function I5(t){return En(t)||(t=Kt.instance.branding.polygonFillOpacity),En(t)?t:.25}const nLe={Mapbox:{param:"access_token",token:"pk.eyJ1IjoiZm9ybWFuIiwiYSI6ImNrM2JranV0bDBtenczb2szZG84djh6bWUifQ.q0UKwf4CWt5fcQwIDwF8Bg"}};function rLe(t){return nLe[t]}function iG(t,e){const n=hf.get(e),r=n?!!parseInt(n):!!t[e];return{...t,[e]:r}}function cx(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 RA={exports:{}};const iLe={},oLe=Object.freeze(Object.defineProperty({__proto__:null,default:iLe},Symbol.toStringTag,{value:"Module"})),aLe=Ea(oLe);var oG;function i2(){return oG||(oG=1,function(t,e){(function(n,r){t.exports=r()})(Zn,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 Zn<"u"&&Zn.crypto&&(o=Zn.crypto),!o&&typeof cx=="function")try{o=aLe}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],U=L+T;O=S,S=_,_=b,b=x+B|0,x=y,y=v,v=g,g=B+U|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})})(hie);var cLe=hie.exports;const uLe=$t(cLe);var pie={exports:{}};(function(t,e){(function(n,r){t.exports=r(i2())})(Zn,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})})(pie);var fLe=pie.exports;const aG=$t(fLe);var mie={exports:{}};(function(t,e){(function(n,r){t.exports=r(i2())})(Zn,function(n){return n.enc.Utf8})})(mie);var dLe=mie.exports;const hLe=$t(dLe);function VL(t){this.message=t}VL.prototype=new Error,VL.prototype.name="InvalidCharacterError";var sG=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new VL("'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 pLe(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(sG(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 sG(e)}}function IT(t){this.message=t}function mLe(t,e){if(typeof t!="string")throw new IT("Invalid token specified");var n=(e=e||{}).header===!0?0:1;try{return JSON.parse(pLe(t.split(".")[n]))}catch(r){throw new IT("Invalid token specified: "+r.message)}}IT.prototype=new Error,IT.prototype.name="InvalidTokenError";var gLe={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}},pl,ml,DT=(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))(DT||{});(t=>{function e(){pl=3,ml=gLe}t.reset=e;function n(i){if(!(0<=i&&i<=4))throw new Error("Invalid log level");pl=i}t.setLevel=n;function r(i){ml=i}t.setLogger=r})(DT||(DT={}));var It=class{constructor(t){this._name=t}debug(...t){pl>=4&&ml.debug(It._format(this._name,this._method),...t)}info(...t){pl>=3&&ml.info(It._format(this._name,this._method),...t)}warn(...t){pl>=2&&ml.warn(It._format(this._name,this._method),...t)}error(...t){pl>=1&&ml.error(It._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 It(`${t}.${e}`);return n.debug("begin"),n}static _format(t,e){const n=`[${t}]`;return e?`${n} ${e}:`:n}static debug(t,...e){pl>=4&&ml.debug(It._format(t),...e)}static info(t,...e){pl>=3&&ml.info(It._format(t),...e)}static warn(t,...e){pl>=2&&ml.warn(It._format(t),...e)}static error(t,...e){pl>=1&&ml.error(It._format(t),...e)}};DT.reset();var vLe="10000000-1000-4000-8000-100000000000",Al=class{static _randomWord(){return lLe.lib.WordArray.random(1).words[0]}static generateUUIDv4(){return vLe.replace(/[018]/g,e=>(+e^Al._randomWord()&15>>+e/4).toString(16)).replace(/-/g,"")}static generateCodeVerifier(){return Al.generateUUIDv4()+Al.generateUUIDv4()+Al.generateUUIDv4()}static generateCodeChallenge(t){try{const e=uLe(t);return aG.stringify(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(e){throw It.error("CryptoUtils.generateCodeChallenge",e),e}}static generateBasicAuth(t,e){const n=hLe.parse([t,e].join(":"));return aG.stringify(n)}},af=class{constructor(t){this._name=t,this._logger=new It(`Event('${this._name}')`),this._callbacks=[]}addHandler(t){return this._callbacks.push(t),()=>this.removeHandler(t)}removeHandler(t){const e=this._callbacks.lastIndexOf(t);e>=0&&this._callbacks.splice(e,1)}raise(...t){this._logger.debug("raise:",...t);for(const e of this._callbacks)e(...t)}},GL=class{static decode(t){try{return mLe(t)}catch(e){throw It.error("JwtUtils.decode",e),e}}},lG=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(",")}},ns=class extends af{constructor(){super(...arguments),this._logger=new It(`Timer('${this._name}')`),this._timerHandle=null,this._expiration=0,this._callback=()=>{const t=this._expiration-ns.getEpochTime();this._logger.debug("timer completes in",t),this._expiration<=ns.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=ns.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)}},HL=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))}},np=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 It.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}},D5=class extends Error{constructor(t){super(t),this.name="ErrorTimeout"}},yLe=class{constructor(t){this._logger=new It("AccessTokenEvents"),this._expiringTimer=new ns("Access token expiring"),this._expiredTimer=new ns("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)}},xLe=class{constructor(t,e,n,r,i){this._callback=t,this._client_id=e,this._intervalInSeconds=r,this._stopOnError=i,this._logger=new It("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)}},gie=class{constructor(){this._logger=new It("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]}},L5=class{constructor(t=[],e=null,n={}){this._jwtHandler=e,this._extraHeaders=n,this._logger=new It("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 D5("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 np(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 np(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)})}},bLe=class{constructor(t){this._settings=t,this._logger=new It("MetadataService"),this._signingKeys=null,this._metadata=null,this._metadataUrl=this._settings.metadataUrl,this._jsonService=new L5(["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}},vie=class{constructor({prefix:t="oidc.",store:e=localStorage}={}){this._logger=new It("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=GL.decode(n);return r.debug("JWT decoding successful"),i}catch(i){throw r.error("Error parsing JWT response"),i}},this._jsonService=new L5(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}},xie=class{constructor(t,e){this._settings=t,this._metadataService=e,this._logger=new It("TokenClient"),this._jsonService=new L5(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=Al.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=Al.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))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=Al.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")}},PLe=class{constructor(t,e,n){this._settings=t,this._metadataService=e,this._claimsService=n,this._logger=new It("ResponseValidator"),this._userInfoService=new ELe(this._settings,this._metadataService),this._tokenClient=new xie(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&&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 np(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,(n=t.scope)!=null||(t.scope=e.scope),t.error)throw r.warn("Response was error",t.error),new np(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=GL.decode((n=t.id_token)!=null?n:"");if(i.sub||r.throw(new Error("ID Token is missing a subject claim")),e){const o=GL.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}},tv=class{constructor(t){this.id=t.id||Al.generateUUIDv4(),this.data=t.data,t.created&&t.created>0?this.created=t.created:this.created=ns.getEpochTime(),this.request_type=t.request_type}toStorageString(){return new It("State").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type})}static fromStorageString(t){return It.createStatic("State","fromStorageString"),new tv(JSON.parse(t))}static async clearStaleState(t,e){const n=It.createStatic("State","clearStaleState"),r=ns.getEpochTime()-e,i=await t.getAllKeys();n.debug("got keys",i);for(let o=0;ov.searchParams.append("resource",x));for(const[y,x]of Object.entries({response_mode:s,...g,...h}))x!=null&&v.searchParams.append(y,x.toString());this.url=v.href}},kLe="openid",IA=class{constructor(t){this.access_token="",this.token_type="",this.profile={},this.state=t.get("state"),this.session_state=t.get("session_state"),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-ns.getEpochTime()}set expires_in(t){typeof t=="string"&&(t=Number(t)),t!==void 0&&t>=0&&(this.expires_at=Math.floor(t)+ns.getEpochTime())}get isOpenId(){var t;return((t=this.scope)==null?void 0:t.split(" ").includes(kLe))||!!this.id_token}},ALe=class{constructor({url:t,state_data:e,id_token_hint:n,post_logout_redirect_uri:r,extraQueryParams:i,request_type:o}){if(this._logger=new It("SignoutRequest"),!t)throw this._logger.error("ctor: No url passed"),new Error("url");const a=new URL(t);n&&a.searchParams.append("id_token_hint",n),r&&(a.searchParams.append("post_logout_redirect_uri",r),e&&(this.state=new tv({data:e,request_type:o}),a.searchParams.append("state",this.state.id)));for(const[s,l]of Object.entries({...i}))l!=null&&a.searchParams.append(s,l.toString());this.url=a.href}},RLe=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")}},ILe=["nbf","jti","auth_time","nonce","acr","amr","azp","at_hash"],DLe=["sub","iss","aud","exp","iat"],LLe=class{constructor(t){this._settings=t,this._logger=new It("ClaimsService")}filterProtocolClaims(t){const e={...t};if(this._settings.filterProtocolClaims){let n;Array.isArray(this._settings.filterProtocolClaims)?n=this._settings.filterProtocolClaims:n=ILe;for(const r of n)DLe.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?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]):n[r]=o}return n}},NLe=class{constructor(t){this._logger=new It("OidcClient"),this.settings=new yie(t),this.metadataService=new bLe(this.settings),this._claimsService=new LLe(this.settings),this._validator=new PLe(this.settings,this.metadataService,this._claimsService),this._tokenClient=new xie(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,response_type:l=this.settings.response_type,scope:c=this.settings.scope,redirect_uri:u=this.settings.redirect_uri,prompt:f=this.settings.prompt,display:d=this.settings.display,max_age:h=this.settings.max_age,ui_locales:p=this.settings.ui_locales,acr_values:m=this.settings.acr_values,resource:g=this.settings.resource,response_mode:v=this.settings.response_mode,extraQueryParams:y=this.settings.extraQueryParams,extraTokenParams:x=this.settings.extraTokenParams}){const b=this._logger.create("createSigninRequest");if(l!=="code")throw new Error("Only the Authorization Code flow (with PKCE) is supported");const _=await this.metadataService.getAuthorizationEndpoint();b.debug("Received authorization endpoint",_);const S=new MLe({url:_,authority:this.settings.authority,client_id:this.settings.client_id,redirect_uri:u,response_type:l,scope:c,state_data:t,prompt:f,display:d,max_age:h,ui_locales:p,id_token_hint:i,login_hint:o,acr_values:m,resource:g,request:e,request_uri:n,extraQueryParams:y,extraTokenParams:x,request_type:r,response_mode:v,client_secret:this.settings.client_secret,skipUserInfo:a,nonce:s,disablePKCE:this.settings.disablePKCE});await this.clearStaleState();const O=S.state;return await this.settings.stateStore.set(O.id,O.toStorageString()),S}async readSigninResponseState(t,e=!1){const n=this._logger.create("readSigninResponseState"),r=new IA(HL.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:N5.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 IA(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,scope:i,timeoutInSeconds:e}),a=new IA(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,request_type:n,post_logout_redirect_uri:r=this.settings.post_logout_redirect_uri,extraQueryParams:i=this.settings.extraQueryParams}={}){const o=this._logger.create("createSignoutRequest"),a=await this.metadataService.getEndSessionEndpoint();if(!a)throw o.throw(new Error("No end session endpoint")),null;o.debug("Received end session endpoint",a);const s=new ALe({url:a,id_token_hint:e,post_logout_redirect_uri:r,state_data:t,extraQueryParams:i,request_type:n});await this.clearStaleState();const l=s.state;return l&&(o.debug("Signout request has state to persist"),await this.settings.stateStore.set(l.id,l.toStorageString())),s}async readSignoutResponseState(t,e=!1){const n=this._logger.create("readSignoutResponseState"),r=new RLe(HL.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 np(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:tv.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"),tv.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})}},$Le=class{constructor(t){this._userManager=t,this._logger=new It("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 xLe(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)}}}},AC=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}get expires_in(){if(this.expires_at!==void 0)return this.expires_at-ns.getEpochTime()}set expires_in(t){t!==void 0&&(this.expires_at=Math.floor(t)+ns.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 It("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 It.createStatic("User","fromStorageString"),new AC(JSON.parse(t))}},cG="oidc-client",bie=class{constructor(){this._abort=new af("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)!==cG)){try{const f=HL.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:cG,url:e,keepOpen:n},r)}},_ie={location:!1,toolbar:!1,height:640},wie="_blank",FLe=60,jLe=2,Sie=10,BLe=class extends yie{constructor(t){const{popup_redirect_uri:e=t.redirect_uri,popup_post_logout_redirect_uri:n=t.post_logout_redirect_uri,popupWindowFeatures:r=_ie,popupWindowTarget:i=wie,redirectMethod:o="assign",redirectTarget:a="self",iframeNotifyParentOrigin:s=t.iframeNotifyParentOrigin,iframeScriptOrigin:l=t.iframeScriptOrigin,silent_redirect_uri:c=t.redirect_uri,silentRequestTimeoutInSeconds:u=Sie,automaticSilentRenew:f=!0,validateSubOnSilentRenew:d=!0,includeIdTokenInSilentRenew:h=!1,monitorSession:p=!1,monitorAnonymousSession:m=!1,checkSessionIntervalInSeconds:g=jLe,query_status_response_type:v="code",stopCheckSessionOnError:y=!0,revokeTokenTypes:x=["access_token","refresh_token"],revokeTokensOnSignout:b=!1,includeIdTokenInSilentSignout:_=!1,accessTokenExpiringNotificationTimeInSeconds:S=FLe,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 gie;this.userStore=new vie({store:C})}}},qL=class extends bie{constructor({silentRequestTimeoutInSeconds:t=Sie}){super(),this._logger=new It("IFrameWindow"),this._timeoutInSeconds=t,this._frame=qL.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",t.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),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 D5("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)}},zLe=class{constructor(t){this._settings=t,this._logger=new It("IFrameNavigator")}async prepare({silentRequestTimeoutInSeconds:t=this._settings.silentRequestTimeoutInSeconds}){return new qL({silentRequestTimeoutInSeconds:t})}async callback(t){this._logger.create("callback"),qL.notifyParent(t,this._settings.iframeNotifyParentOrigin)}},ULe=500,uG=class extends bie{constructor({popupWindowTarget:t=wie,popupWindowFeatures:e={}}){super(),this._logger=new It("PopupWindow");const n=lG.center({..._ie,...e});this._window=window.open(void 0,t,lG.serialize(n))}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"))},ULe);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)}},WLe=class{constructor(t){this._settings=t,this._logger=new It("PopupNavigator")}async prepare({popupWindowFeatures:t=this._settings.popupWindowFeatures,popupWindowTarget:e=this._settings.popupWindowTarget}){return new uG({popupWindowFeatures:t,popupWindowTarget:e})}async callback(t,e=!1){this._logger.create("callback"),uG.notifyOpener(t,e)}},VLe=class{constructor(t){this._settings=t,this._logger=new It("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()}}}},GLe=class extends yLe{constructor(t){super({expiringNotificationTimeInSeconds:t.accessTokenExpiringNotificationTimeInSeconds}),this._logger=new It("UserManagerEvents"),this._userLoaded=new af("User loaded"),this._userUnloaded=new af("User unloaded"),this._silentRenewError=new af("Silent renew error"),this._userSignedIn=new af("User signed in"),this._userSignedOut=new af("User signed out"),this._userSessionChanged=new af("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()}},HLe=class{constructor(t){this._userManager=t,this._logger=new It("SilentRenewService"),this._isStarted=!1,this._retryTimer=new ns("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 D5){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)}},qLe=class{constructor(t){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.data=t.state}},XLe=class{constructor(t){this._logger=new It("UserManager"),this.settings=new BLe(t),this._client=new NLe(t),this._redirectNavigator=new VLe(this.settings),this._popupNavigator=new WLe(this.settings),this._iframeNavigator=new zLe(this.settings),this._events=new GLe(this.settings),this._silentRenewService=new HLe(this),this.settings.automaticSilentRenew&&this.startSilentRenew(),this._sessionMonitor=null,this.settings.monitorSession&&(this._sessionMonitor=new $Le(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,e),n.info("success")}async signinSilent(t={}){var e;const n=this._logger.create("signinSilent"),{silentRequestTimeoutInSeconds:r,...i}=t;let o=await this._loadUser();if(o!=null&&o.refresh_token){n.debug("using refresh token");const c=new qLe(o);return await this._useRefreshToken(c)}const a=this.settings.silent_redirect_uri;a||n.throw(new Error("No silent_redirect_uri configured"));let s;o&&this.settings.validateSubOnSilentRenew&&(n.debug("subject prior to silent renew:",o.profile.sub),s=o.profile.sub);const l=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:r});return o=await this._signin({request_type:"si:s",redirect_uri:a,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?o==null?void 0:o.id_token:void 0,...i},l,s),o&&((e=o.profile)!=null&&e.sub?n.info("success, signed in subject",o.profile.sub):n.info("no subject")),o}async _useRefreshToken(t){const e=await this._client.useRefreshToken({state:t,timeoutInSeconds:this.settings.silentRequestTimeoutInSeconds}),n=new AC({...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 np)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 AC(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 np({...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,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})}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"),AC.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()}},$5=ue.createContext(void 0);$5.displayName="AuthContext";var QLe={isLoading:!0,isAuthenticated:!1},YLe=(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}`)}}},KLe=(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")))},ZLe=t=>e=>e instanceof Error?e:new Error(t),JLe=ZLe("Login failed"),e3e=["clearStaleState","querySessionStatus","revokeTokens","startSilentRenew","stopSilentRenew"],t3e=["signinPopup","signinSilent","signinRedirect","signoutPopup","signoutRedirect","signoutSilent"],DA=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.`)},n3e=typeof window>"u"?null:XLe,r3e=t=>{const{children:e,onSigninCallback:n,skipSigninCallback:r,onRemoveUser:i,onSignoutRedirect:o,onSignoutPopup:a,implementation:s=n3e,userManager:l,...c}=t,[u]=M.useState(()=>l??(s?new s(c):{settings:c})),[f,d]=M.useReducer(YLe,QLe),h=M.useMemo(()=>Object.assign({settings:u.settings,events:u.events},Object.fromEntries(e3e.map(x=>{var b,_;return[x,(_=(b=u[x])==null?void 0:b.bind(u))!=null?_:DA(x)]})),Object.fromEntries(t3e.map(x=>[x,u[x]?async(...b)=>{d({type:"NAVIGATOR_INIT",method:x});try{return await u[x](...b)}finally{d({type:"NAVIGATOR_CLOSE"})}}:DA(x)]))),[u]),p=M.useRef(!1);M.useEffect(()=>{!u||p.current||(p.current=!0,(async()=>{let x=null;try{KLe()&&!r&&(x=await u.signinCallback(),n&&n(x)),x=x||await u.getUser(),d({type:"INITIALISED",user:x})}catch(b){d({type:"ERROR",error:JLe(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):DA("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($5.Provider,{value:{...f,...h,removeUser:m,signoutRedirect:g,signoutPopup:v,signoutSilent:y}},e)},i3e=()=>{const t=ue.useContext($5);if(!t)throw new Error("AuthProvider context is undefined, please verify you are calling useAuth() as child of a component.");return t};const fG="color:green;font-weight:bold;",o3e="color:blue;font-weight:bold;";class a3e{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=dG(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=dG(e),i=this._content[r];let o;return i?(o=i[this._locale],o||(console.debug(`missing translation of phrase %c${e}`,fG,` for locale %c${this._locale}`,o3e),o=e)):(console.debug(`missing translation for phrase %c${e}`,fG),o=e),n&&Object.keys(n).forEach(a=>{o=o.replace("${"+a+"}",`${n[a]}`)}),o}}const s3e=()=>{let t;return navigator.languages&&navigator.languages.length>0?t=navigator.languages[0]:t=navigator.language||navigator.userLanguage||navigator.browserLanguage||"en",t.split("-")[0]},dG=t=>t.toLowerCase(),l3e={en:"English",de:"Deutsch",se:"Svenska"},c3e=[{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"}],u3e={languages:l3e,dictionary:c3e},fe=new a3e(u3e);fe.locale=s3e();class Oie 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 f3e=({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=r2.href;return w.jsx(Oie,{children:w.jsx(r3e,{...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 F5={},LA={};const d3e=Ea(fCe);var hG;function pt(){return hG||(hG=1,function(t){"use client";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return e.createSvgIcon}});var e=d3e}(LA)),LA}var h3e=ft;Object.defineProperty(F5,"__esModule",{value:!0});var j5=F5.default=void 0,p3e=h3e(pt()),m3e=w;j5=F5.default=(0,p3e.default)((0,m3e.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 B5={},g3e=ft;Object.defineProperty(B5,"__esModule",{value:!0});var z5=B5.default=void 0,v3e=g3e(pt()),y3e=w;z5=B5.default=(0,v3e.default)((0,y3e.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 U5={},x3e=ft;Object.defineProperty(U5,"__esModule",{value:!0});var W5=U5.default=void 0,b3e=x3e(pt()),_3e=w;W5=U5.default=(0,b3e.default)((0,_3e.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 V5={},w3e=ft;Object.defineProperty(V5,"__esModule",{value:!0});var Cie=V5.default=void 0,S3e=w3e(pt()),pG=w;Cie=V5.default=(0,S3e.default)([(0,pG.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,pG.jsx)("circle",{cx:"12",cy:"12",r:"3"},"1")],"Policy");var G5={},O3e=ft;Object.defineProperty(G5,"__esModule",{value:!0});var H5=G5.default=void 0,C3e=O3e(pt()),T3e=w;H5=G5.default=(0,C3e.default)((0,T3e.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 ac=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 nv={PROPERTYCHANGE:"propertychange"};var q5=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function E3e(t,e,n){for(var r,i,o=rp,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 rp(t,e){return t>e?1:t0){for(i=1;i0?i-1:i:t[i-1]-e0||a===0)})}function Fh(){return!0}function F1(){return!1}function ip(){}function k3e(t){var e=!1,n,r,i;return function(){var o=Array.prototype.slice.call(arguments);return(!e||this!==i||!kp(o,r))&&(e=!0,i=this,r=o,n=t.apply(this,arguments)),n}}var ur=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]=ip,++this.pendingRemovals_[n]):(i.splice(o,1),i.length===0&&delete this.listeners_[n]))}},e}(q5);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 LT(t,e,n,r){return rn(t,e,n,r,!0)}function nr(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),j1(t))}var R3e=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)}}(),B1=function(t){R3e(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||Jf.match(/cpu (os|iphone os) 15_4 like mac os x/));var z3e=Jf.indexOf("webkit")!==-1&&Jf.indexOf("edge")==-1,U3e=Jf.indexOf("macintosh")!==-1,Mie=typeof devicePixelRatio<"u"?devicePixelRatio:1,o2=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,W3e=typeof Image<"u"&&Image.prototype.decode,kie=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 Hl(){return[1,0,0,1,0,0]}function V3e(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 G3e(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 Cr(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 H3e(t,e,n){return V3e(t,e,0,0,n,0,0)}function hu(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 Q5(t,e){var n=q3e(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 q3e(t){return t[0]*t[3]-t[1]*t[2]}var gG;function Aie(t){var e="matrix("+t.join(", ")+")";if(o2)return e;var n=gG||(gG=document.createElement("div"));return n.style.transform=e,n.style.transform}const si={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function vG(t){for(var e=Oa(),n=0,r=t.length;ni&&(l=l|si.RIGHT),so&&(l=l|si.ABOVE),l===si.UNKNOWN&&(l=si.INTERSECTING),l}function Oa(){return[1/0,1/0,-1/0,-1/0]}function Zs(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 U1(t){return Zs(1/0,1/0,-1/0,-1/0,t)}function Q3e(t,e){var n=t[0],r=t[1];return Zs(n,r,n,r,e)}function Iie(t,e,n,r,i){var o=U1(i);return Lie(o,t,e,n,r)}function jb(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function Die(t,e){return e[0]t[2]&&(t[2]=e[2]),e[1]t[3]&&(t[3]=e[3]),t}function Gx(t,e){e[0]t[2]&&(t[2]=e[0]),e[1]t[3]&&(t[3]=e[1])}function Lie(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 tB(t){return t[2]=a&&m<=l),!r&&o&si.RIGHT&&!(i&si.RIGHT)&&(g=h-(d-l)*p,r=g>=s&&g<=c),!r&&o&si.BELOW&&!(i&si.BELOW)&&(m=d-(h-s)/p,r=m>=a&&m<=l),!r&&o&si.LEFT&&!(i&si.LEFT)&&(g=h-(d-a)*p,r=g>=s&&g<=c)}return r}function eNe(t,e,n,r){var i=[],o;i=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]],e(i,i,2);for(var a=[],s=[],o=0,l=i.length;o=n[2])){var i=Kn(n),o=Math.floor((r[0]-n[0])/i),a=o*i;t[0]-=a,t[2]-=a}return t}function tNe(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]]];Nie(t,e);var r=Kn(n);if(Kn(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 $ie=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_||Ks[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}();function Br(t,e,n){return Math.min(Math.max(t,e),n)}var nNe=function(){var t;return"cosh"in Math?t=Math.cosh:t=function(e){var n=Math.exp(e);return(n+1/n)/2},t}(),rNe=function(){var t;return"log2"in Math?t=Math.log2:t=function(e){return Math.log(e)*Math.LOG2E},t}();function iNe(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 jh(t,e,n,r)}function jh(t,e,n,r){var i=n-t,o=r-e;return i*i+o*o}function oNe(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 RC(t){return t*Math.PI/180}function jf(t,e){var n=t%e;return n*e<0?n+e:n}function Nc(t,e,n){return t+n*(e-t)}function Fie(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n}function gS(t,e){return Math.floor(Fie(t,e))}function vS(t,e){return Math.ceil(Fie(t,e))}var aNe=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)}}(),W1=6378137,tg=Math.PI*W1,sNe=[-tg,-tg,tg,tg],lNe=[-180,-85,180,85],yS=W1*Math.log(Math.tan(Math.PI/2)),em=function(t){aNe(e,t);function e(n){return t.call(this,{code:n,units:ci.METERS,extent:sNe,global:!0,worldExtent:lNe,getPointResolution:function(r,i){return r/nNe(i[1]/W1)}})||this}return e}($ie),yG=[new em("EPSG:3857"),new em("EPSG:102100"),new em("EPSG:102113"),new em("EPSG:900913"),new em("http://www.opengis.net/def/crs/EPSG/0/3857"),new em("http://www.opengis.net/gml/srs/epsg.xml#3857")];function cNe(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;ayS?s=yS:s<-yS&&(s=-yS),o[a+1]=s}return o}function uNe(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 yNe(t,e){return t[0]+=+e[0],t[1]+=+e[1],t}function $T(t,e){for(var n=!0,r=t.length-1;r>=0;--r)if(t[r]!=e[r]){n=!1;break}return n}function nB(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 xNe(t,e){return t[0]*=e,t[1]*=e,t}function bNe(t,e){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function jie(t,e){if(e.canWrapX()){var n=Kn(e.getExtent()),r=_Ne(t,e,n);r&&(t[0]-=r*n)}return t}function _Ne(t,e,n){var r=e.getExtent(),i=0;if(e.canWrapX()&&(t[0]r[2])){var o=n||Kn(r);i=Math.floor((t[0]-r[0])/o)}return i}var wNe=63710088e-1;function _G(t,e,n){var r=wNe,i=RC(t[1]),o=RC(e[1]),a=(o-i)/2,s=RC(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 JL=!0;function SNe(t){var e=!0;JL=!e}function rB(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&&(JL=!1,console.warn("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),t}function Uie(t,e){return t}function xh(t,e){return t}function MNe(){wG(yG),wG(bG),TNe(bG,yG,cNe,uNe)}MNe();function Bh(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 lB(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 qie(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 hB(t,e,n,r,i,o){if(n.length===0||!bh(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:Xie(t,e,n,r,function(a,s){return J3e(i,a,s)}):!1}function qNe(t,e,n,r,i){for(var o=0,a=n.length;ob&&(c=(u+f)/2,hB(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 t$e(t,e,n,r,i){for(var o=[],a=0,s=n.length;a0}function roe(t,e,n,r,i){for(var o=0,a=n.length;o0){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 ooe(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 ioe(n.status,r)}async function wu(t,e,n){let r;JDe(e)?n=e:r=e;const o=await(await ooe(t,r)).json();return n?n(o):o}const O$e=/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,C$e=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=PG(r[3]),e===void 0)return;i[3]=e}return i}if(r.length!==2||(t=r[0],e=PG(r[1]),e===void 0))return}const n=(t.startsWith("#")?soe:E$e)(t);if(n){if(n.length===3)return[...n,e===void 0?255:e];if(n.length===4&&e===void 0)return n}};function aoe(t){return"#"+t.map(e=>{const n=e.toString(16);return n.length===1?"0"+n:n}).join("")}function soe(t){if(O$e.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 PG=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)},T$e=t=>P$e[t.toLowerCase()],E$e=t=>{const e=T$e(t);if(e)return soe(e)},P$e={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"};function M$e(t){return wu(`${t}/colorbars`,k$e)}function k$e(t){const e=[],n={},r={};return t.forEach(i=>{const[o,a,s]=i,l=[];s.forEach(c=>{if(c.length===3){const[u,f,d]=c;l.push(u),n[u]=f,r[u]={name:d.name,type:d.type,colorRecords:d.colors.map(A$e)}}else if(c.length===2){const[u,f]=c;l.push(u),n[u]=f}}),e.push({title:o,description:a,names:l})}),{groups:e,images:n,customColorMaps:r}}function A$e(t){const e=R$e(t[1]),n=t[0];if(t.length===3){const r=t[2];return{value:n,color:e,label:r}}else return{value:n,color:e}}function R$e(t){return t?Mp(t)?t:aoe(t):"#000000"}function I$e(t,e){const n=sy(`${t}/datasets`,[["details","1"]]),r=ay(e);return wu(n,r,D$e)}function D$e(t){return(t.datasets||[]).map(L$e)}function L$e(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 N$e(t,e,n,r){const i=ay(r),o=encodeURIComponent(e),a=encodeURIComponent(n);return wu(`${t}/datasets/${o}/places/${a}`,i)}function $$e(t){return wu(`${t}/expressions/capabilities`)}function F$e(t){return wu(`${t}/`)}function V1(t){return Mp(t.expression)}function ly(t){return encodeURIComponent(Mp(t)?t:t.id)}function G1(t){return encodeURIComponent(Mp(t)?t:V1(t)?`${t.name}=${t.expression}`:t.name)}function j$e(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=sy(`${t}/timeseries/${ly(e)}/${G1(n)}`,d),p={...ay(c),method:"post",body:JSON.stringify(i)};return wu(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 B$e(t,e,n,r,i,o){const a=[["time",i]],s=sy(`${t}/statistics/${ly(e)}/${G1(n)}`,a),l={...ay(o),method:"post",body:JSON.stringify(r.place.geometry)},c={dataset:e,variable:n,placeInfo:r,time:i};return wu(s,l,u=>({source:c,statistics:u.result}))}function z$e(t,e,n,r,i,o,a){const s=[["lon",r.toString()],["lat",i.toString()]];o&&s.push(["time",o]);const l=sy(`${t}/statistics/${ly(e)}/${G1(n)}`,s);return wu(l,ay(a),c=>c.result?c.result:{})}function U$e(t,e){const n=sy(`${t}/maintenance/update`,[]),r=ay(e);try{return wu(n,r).then(()=>!0).catch(i=>(console.error(i),!1))}catch(i){return console.error(i),Promise.resolve(!1)}}class UT extends Error{}function W$e(t,e){if(t===null)throw new UT(`assertion failed: ${e} must not be null`)}function V$e(t,e){if(typeof t>"u")throw new UT(`assertion failed: ${e} must not be undefined`)}function G$e(t,e){W$e(t,e),V$e(t,e)}function NA(t,e){if(Array.isArray(t)){if(t.length===0)throw new UT(`assertion failed: ${e} must be a non-empty array`)}else throw new UT(`assertion failed: ${e} must be an array`)}function Ub(t,e){return e&&t.find(n=>n.id===e)||null}function s3(t,e){return e&&t.variables.find(n=>n.name===e)||null}function H$e(t){return t.variables.findIndex(e=>Mp(e.expression))}function gB(t){const e=H$e(t);return e>=0?[t.variables.slice(0,e),t.variables.slice(e)]:[t.variables,[]]}function loe(t){G$e(t,"dataset"),NA(t.dimensions,"dataset.dimensions");const e=t.dimensions.find(n=>n.name==="time");return e?(NA(e.coordinates,"timeDimension.coordinates"),NA(e.labels,"timeDimension.labels"),e):null}function coe(t){const e=loe(t);if(!e)return null;const n=e.coordinates;return[n[0],n[n.length-1]]}var WT="NOT_FOUND";function q$e(t){var e;return{get:function(r){return e&&t(e.key,r)?e.value:WT},put:function(r,i){e={key:r,value:i}},getEntries:function(){return e?[e]:[]},clear:function(){e=void 0}}}function X$e(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 WT}function i(s,l){r(s)===WT&&(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 Q$e=function(e,n){return e===n};function Y$e(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=MG(n.properties,o)),a===void 0&&(a=MG(n,o)),t[r]=a||i}function oFe(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 MG(t,e){let n;for(const r of e)if(r in t)return t[r];return n}function H1(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 xB(t,e){t.forEach(n=>{uy(n)&&n.features.forEach(r=>{e(n,r)})})}function aFe(t,e){const n=Mp(e)?(r,i)=>i.id===e:e;for(const r of t)if(uy(r)){const i=r.features.find(o=>n(r,o));if(i)return u2(r,i)}return null}function sFe(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=foe(r[i],e);if(o)return o}return null}function bB(t,e){if(e)for(const n of t){const r=foe(n,e);if(r!==null)return r}return null}const doe="User",hoe=`0.0: #23FF52 + `),YMe)),ey=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,XMe),h=j({},r,{color:o,disableShrink:a,size:s,thickness:c,value:u,variant:f}),p=KMe(h),m={},g={},v={};if(f==="determinate"){const y=2*Math.PI*((ku-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(ZMe,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(JMe,{className:p.svg,ownerState:h,viewBox:`${ku/2} ${ku/2} ${ku} ${ku}`,children:w.jsx(e2e,{className:p.circle,style:m,ownerState:h,cx:ku,cy:ku,r:(ku-c)/2,fill:"none",strokeWidth:c})})}))}),t2e=(t,e)=>j({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%"},e&&!t.vars&&{colorScheme:t.palette.mode}),n2e=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}}),r2e=(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:t2e(t,e),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:t.typography.fontWeightBold},body:j({margin:0},n2e(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 i2e(t){const e=qe({props:t,name:"MuiCssBaseline"}),{children:n,enableColorScheme:r=!1}=e;return w.jsxs(M.Fragment,{children:[w.jsx($re,{styles:i=>r2e(i,r)}),n]})}function o2e(t){return We("MuiModal",t)}Ve("MuiModal",["root","hidden","backdrop"]);const a2e=["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"],s2e=t=>{const{open:e,exited:n,classes:r}=t;return Ue({root:["root",!e&&n&&"hidden"],backdrop:["backdrop"]},o2e,r)},l2e=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"})),c2e=we(Fre,{name:"MuiModal",slot:"Backdrop",overridesResolver:(t,e)=>e.backdrop})({zIndex:-1}),Wre=M.forwardRef(function(e,n){var r,i,o,a,s,l;const c=qe({name:"MuiModal",props:e}),{BackdropComponent:u=c2e,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,a2e),z=j({},c,{closeAfterTransition:h,disableAutoFocus:x,disableEnforceFocus:b,disableEscapeKeyDown:_,disablePortal:S,disableRestoreFocus:O,disableScrollLock:C,hideBackdrop:E,keepMounted:k}),{getRootProps:B,getBackdropProps:U,getTransitionProps:W,portalRef:$,isTopModal:N,exited:D,hasTransition:A}=NTe(j({},z,{rootRef:n})),q=j({},z,{exited:D}),Y=s2e(q),K={};if(p.props.tabIndex===void 0&&(K.tabIndex="-1"),A){const{onEnter:ve,onExited:F}=W();K.onEnter=ve,K.onExited=F}const se=(r=(i=T==null?void 0:T.root)!=null?i:v.Root)!=null?r:l2e,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=$r({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=$r({elementType:te,externalSlotProps:pe,additionalProps:f,getSlotProps:ve=>U(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(Sre,{ref:$,container:m,disablePortal:S,children:w.jsxs(se,j({},be,{children:[!E&&u?w.jsx(te,j({},re)):null,w.jsx(wre,{disableEnforceFocus:b,disableAutoFocus:x,disableRestoreFocus:O,isEnabled:N,open:P,children:M.cloneElement(p,K)})]}))})});function u2e(t){return We("MuiDialog",t)}const Bx=Ve("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),Vre=M.createContext({}),f2e=["aria-describedby","aria-labelledby","BackdropComponent","BackdropProps","children","className","disableEscapeKeyDown","fullScreen","fullWidth","maxWidth","onBackdropClick","onClick","onClose","open","PaperComponent","PaperProps","scroll","TransitionComponent","transitionDuration","TransitionProps"],d2e=we(Fre,{name:"MuiDialog",slot:"Backdrop",overrides:(t,e)=>e.backdrop})({zIndex:-1}),h2e=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,u2e,e)},p2e=we(Wre,{name:"MuiDialog",slot:"Root",overridesResolver:(t,e)=>e.root})({"@media print":{position:"absolute !important"}}),m2e=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"}})),g2e=we(Ho,{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)`,[`&.${Bx.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}`,[`&.${Bx.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,[`&.${Bx.paperScrollBody}`]:{margin:0,maxWidth:"100%"}})),rl=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiDialog"}),i=Go(),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,onClick:v,onClose:y,open:x,PaperComponent:b=Ho,PaperProps:_={},scroll:S="paper",TransitionComponent:O=ZM,transitionDuration:C=o,TransitionProps:E}=r,k=Ae(r,f2e),I=j({},r,{disableEscapeKeyDown:d,fullScreen:h,fullWidth:p,maxWidth:m,scroll:S}),P=h2e(I),R=M.useRef(),T=U=>{R.current=U.target===U.currentTarget},L=U=>{v&&v(U),R.current&&(R.current=null,g&&g(U),y&&y(U,"backdropClick"))},z=pd(s),B=M.useMemo(()=>({titleId:z}),[z]);return w.jsx(p2e,j({className:ke(P.root,f),closeAfterTransition:!0,components:{Backdrop:d2e},componentsProps:{backdrop:j({transitionDuration:C,as:l},c)},disableEscapeKeyDown:d,onClose:y,open:x,ref:n,onClick:L,ownerState:I},k,{children:w.jsx(O,j({appear:!0,in:x,timeout:C,role:"presentation"},E,{children:w.jsx(m2e,{className:ke(P.container),onMouseDown:T,ownerState:I,children:w.jsx(g2e,j({as:b,elevation:24,role:"dialog","aria-describedby":a,"aria-labelledby":z},_,{className:ke(P.paper,_.className),ownerState:I,children:w.jsx(Vre.Provider,{value:B,children:u})}))})}))}))});function v2e(t){return We("MuiDialogActions",t)}Ve("MuiDialogActions",["root","spacing"]);const y2e=["className","disableSpacing"],x2e=t=>{const{classes:e,disableSpacing:n}=t;return Ue({root:["root",!n&&"spacing"]},v2e,e)},b2e=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}})),Tp=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiDialogActions"}),{className:i,disableSpacing:o=!1}=r,a=Ae(r,y2e),s=j({},r,{disableSpacing:o}),l=x2e(s);return w.jsx(b2e,j({className:ke(l.root,i),ownerState:s,ref:n},a))});function _2e(t){return We("MuiDialogContent",t)}Ve("MuiDialogContent",["root","dividers"]);function w2e(t){return We("MuiDialogTitle",t)}const S2e=Ve("MuiDialogTitle",["root"]),O2e=["className","dividers"],C2e=t=>{const{classes:e,dividers:n}=t;return Ue({root:["root",n&&"dividers"]},_2e,e)},T2e=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}`}:{[`.${S2e.root} + &`]:{paddingTop:0}})),Ys=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiDialogContent"}),{className:i,dividers:o=!1}=r,a=Ae(r,O2e),s=j({},r,{dividers:o}),l=C2e(s);return w.jsx(T2e,j({className:ke(l.root,i),ownerState:s,ref:n},a))});function E2e(t){return We("MuiDialogContentText",t)}Ve("MuiDialogContentText",["root"]);const P2e=["children","className"],M2e=t=>{const{classes:e}=t,r=Ue({root:["root"]},E2e,e);return j({},e,r)},k2e=we(At,{shouldForwardProp:t=>hi(t)||t==="classes",name:"MuiDialogContentText",slot:"Root",overridesResolver:(t,e)=>e.root})({}),A2e=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiDialogContentText"}),{className:i}=r,o=Ae(r,P2e),a=M2e(o);return w.jsx(k2e,j({component:"p",variant:"body1",color:"text.secondary",ref:n,ownerState:o,className:ke(a.root,i)},r,{classes:a}))}),R2e=["className","id"],I2e=t=>{const{classes:e}=t;return Ue({root:["root"]},w2e,e)},D2e=we(At,{name:"MuiDialogTitle",slot:"Root",overridesResolver:(t,e)=>e.root})({padding:"16px 24px",flex:"0 0 auto"}),vd=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiDialogTitle"}),{className:i,id:o}=r,a=Ae(r,R2e),s=r,l=I2e(s),{titleId:c=o}=M.useContext(Vre);return w.jsx(D2e,j({component:"h2",className:ke(l.root,i),ownerState:s,ref:n,variant:"h6",id:o??c},a))});function L2e(t){return We("MuiDivider",t)}const T8=Ve("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),N2e=["absolute","children","className","component","flexItem","light","orientation","role","textAlign","variant"],$2e=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"]},L2e,r)},F2e=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%"}})),j2e=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)`})),ep=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,N2e),m=j({},r,{absolute:i,component:s,flexItem:l,light:c,orientation:u,role:f,textAlign:d,variant:h}),g=$2e(m);return w.jsx(F2e,j({as:s,className:ke(g.root,a),role:f,ref:n,ownerState:m},p,{children:o?w.jsx(j2e,{className:g.wrapper,ownerState:m,children:o}):null}))});ep.muiSkipListHighlight=!0;const B2e=["addEndListener","appear","children","container","direction","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function z2e(t,e,n){const r=e.getBoundingClientRect(),i=n&&n.getBoundingClientRect(),o=cs(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 U2e(t){return typeof t=="function"?t():t}function fS(t,e,n){const r=U2e(n),i=z2e(t,e,r);i&&(e.style.webkitTransform=i,e.style.transform=i)}const W2e=M.forwardRef(function(e,n){const r=Go(),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:_=ka}=e,S=Ae(e,B2e),O=M.useRef(null),C=Zt(l.ref,O,n),E=U=>W=>{U&&(W===void 0?U(O.current):U(O.current,W))},k=E((U,W)=>{fS(u,U,c),u5(U),h&&h(U,W)}),I=E((U,W)=>{const $=Zf({timeout:b,style:x,easing:f},{mode:"enter"});U.style.webkitTransition=r.transitions.create("-webkit-transform",j({},$)),U.style.transition=r.transitions.create("transform",j({},$)),U.style.webkitTransform="none",U.style.transform="none",m&&m(U,W)}),P=E(p),R=E(y),T=E(U=>{const W=Zf({timeout:b,style:x,easing:f},{mode:"exit"});U.style.webkitTransition=r.transitions.create("-webkit-transform",W),U.style.transition=r.transitions.create("transform",W),fS(u,U,c),g&&g(U)}),L=E(U=>{U.style.webkitTransition="",U.style.transition="",v&&v(U)}),z=U=>{a&&a(O.current,U)},B=M.useCallback(()=>{O.current&&fS(u,O.current,c)},[u,c]);return M.useEffect(()=>{if(d||u==="down"||u==="right")return;const U=Kv(()=>{O.current&&fS(u,O.current,c)}),W=cs(O.current);return W.addEventListener("resize",U),()=>{U.clear(),W.removeEventListener("resize",U)}},[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:(U,W)=>M.cloneElement(l,j({ref:C,style:j({visibility:U==="exited"&&!d?"hidden":void 0},x,l.props.style)},W))}))}),V2e=["disableUnderline","components","componentsProps","fullWidth","hiddenLabel","inputComponent","multiline","slotProps","slots","type"],G2e=t=>{const{classes:e,disableUnderline:n}=t,i=Ue({root:["root",!n&&"underline"],input:["input"]},RPe,e);return j({},e,i)},H2e=we(YM,{shouldForwardProp:t=>hi(t)||t==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[...XM(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}},[`&.${$d.focused}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:o},[`&.${$d.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"},[`&.${$d.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${$d.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(.${$d.disabled}, .${$d.error}):before`]:{borderBottom:`1px solid ${(t.vars||t).palette.text.primary}`},[`&.${$d.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}))}),q2e=we(KM,{name:"MuiFilledInput",slot:"Input",overridesResolver:QM})(({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})),S5=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,V2e),v=j({},s,{fullWidth:u,inputComponent:f,multiline:d,type:m}),y=G2e(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:H2e,S=(o=(a=p.input)!=null?a:l.Input)!=null?o:q2e;return w.jsx(_5,j({slots:{root:_,input:S},componentsProps:b,fullWidth:u,inputComponent:f,multiline:d,ref:n,type:m},g,{classes:y}))});S5.muiName="Input";function X2e(t){return We("MuiFormControl",t)}Ve("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const Q2e=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],Y2e=t=>{const{classes:e,margin:n,fullWidth:r}=t,i={root:["root",n!=="none"&&`margin${De(n)}`,r&&"fullWidth"]};return Ue(i,X2e,e)},K2e=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%"})),ty=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,Q2e),y=j({},r,{color:a,component:s,disabled:l,error:c,fullWidth:f,hiddenLabel:d,margin:h,required:p,size:m,variant:g}),x=Y2e(y),[b,_]=M.useState(()=>{let R=!1;return i&&M.Children.forEach(i,T=>{if(!Nx(T,["Input","Select"]))return;const L=Nx(T,["Select"])?T.props.input:T;L&&OPe(L.props)&&(R=!0)}),R}),[S,O]=M.useState(()=>{let R=!1;return i&&M.Children.forEach(i,T=>{Nx(T,["Input","Select"])&&(AT(T.props,!0)||AT(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(qM.Provider,{value:P,children:w.jsx(K2e,j({as:s,ownerState:y,className:ke(x.root,o),ref:n},v,{children:i}))})}),Z2e=JSe({createStyledComponent:we("div",{name:"MuiStack",slot:"Root",overridesResolver:(t,e)=>e.root}),useThemeProps:t=>qe({props:t,name:"MuiStack"})});function J2e(t){return We("MuiFormControlLabel",t)}const sx=Ve("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),eke=["checked","className","componentsProps","control","disabled","disableTypography","inputRef","label","labelPlacement","name","onChange","required","slotProps","value"],tke=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,J2e,e)},nke=we("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${sx.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,[`&.${sx.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},{[`& .${sx.label}`]:{[`&.${sx.disabled}`]:{color:(t.vars||t).palette.text.disabled}}})),rke=we("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(t,e)=>e.asterisk})(({theme:t})=>({[`&.${sx.error}`]:{color:(t.vars||t).palette.error.main}})),Og=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,eke),g=oc(),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=gd({props:o,muiFormControl:g,states:["error"]}),_=j({},o,{disabled:v,labelPlacement:d,required:y,error:b.error}),S=tke(_),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(nke,j({className:ke(S.root,a),ownerState:_,ref:n},m,{children:[M.cloneElement(l,x),y?w.jsxs(Z2e,{display:"block",children:[C,w.jsxs(rke,{ownerState:_,"aria-hidden":!0,className:S.asterisk,children:[" ","*"]})]}):C]}))});function ike(t){return We("MuiFormGroup",t)}Ve("MuiFormGroup",["root","row","error"]);const oke=["className","row"],ake=t=>{const{classes:e,row:n,error:r}=t;return Ue({root:["root",n&&"row",r&&"error"]},ike,e)},ske=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"})),lke=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiFormGroup"}),{className:i,row:o=!1}=r,a=Ae(r,oke),s=oc(),l=gd({props:r,muiFormControl:s,states:["error"]}),c=j({},r,{row:o,error:l.error}),u=ake(c);return w.jsx(ske,j({className:ke(u.root,i),ownerState:c,ref:n},a))});function cke(t){return We("MuiFormHelperText",t)}const E8=Ve("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var P8;const uke=["children","className","component","disabled","error","filled","focused","margin","required","variant"],fke=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,cke,e)},dke=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,[`&.${E8.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${E8.error}`]:{color:(t.vars||t).palette.error.main}},e.size==="small"&&{marginTop:4},e.contained&&{marginLeft:14,marginRight:14})),Gre=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiFormHelperText"}),{children:i,className:o,component:a="p"}=r,s=Ae(r,uke),l=oc(),c=gd({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=fke(u);return w.jsx(dke,j({as:a,ownerState:u,className:ke(f.root,o),ref:n},s,{children:i===" "?P8||(P8=w.jsx("span",{className:"notranslate",children:"​"})):i}))});function hke(t){return We("MuiFormLabel",t)}const zx=Ve("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),pke=["children","className","color","component","disabled","error","filled","focused","required"],mke=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,hke,e)},gke=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",[`&.${zx.focused}`]:{color:(t.vars||t).palette[e.color].main},[`&.${zx.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${zx.error}`]:{color:(t.vars||t).palette.error.main}})),vke=we("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(t,e)=>e.asterisk})(({theme:t})=>({[`&.${zx.error}`]:{color:(t.vars||t).palette.error.main}})),yke=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiFormLabel"}),{children:i,className:o,component:a="label"}=r,s=Ae(r,pke),l=oc(),c=gd({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=mke(u);return w.jsxs(gke,j({as:a,ownerState:u,className:ke(f.root,o),ref:n},s,{children:[i,c.required&&w.jsxs(vke,{ownerState:u,"aria-hidden":!0,className:f.asterisk,children:[" ","*"]})]}))}),M8=M.createContext();function xke(t){return We("MuiGrid",t)}const bke=[0,1,2,3,4,5,6,7,8,9,10],_ke=["column-reverse","column","row-reverse","row"],wke=["nowrap","wrap-reverse","wrap"],h0=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],Db=Ve("MuiGrid",["root","container","item","zeroMinWidth",...bke.map(t=>`spacing-xs-${t}`),..._ke.map(t=>`direction-xs-${t}`),...wke.map(t=>`wrap-xs-${t}`),...h0.map(t=>`grid-xs-${t}`),...h0.map(t=>`grid-sm-${t}`),...h0.map(t=>`grid-md-${t}`),...h0.map(t=>`grid-lg-${t}`),...h0.map(t=>`grid-xl-${t}`)]),Ske=["className","columns","columnSpacing","component","container","direction","item","rowSpacing","spacing","wrap","zeroMinWidth"];function Cg(t){const e=parseFloat(t);return`${e}${String(t).replace(String(e),"")||"px"}`}function Oke({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=Lh({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} + ${Cg(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 Cke({theme:t,ownerState:e}){const n=Lh({values:e.direction,breakpoints:t.breakpoints.values});return Wo({theme:t},n,r=>{const i={flexDirection:r};return r.indexOf("column")===0&&(i[`& > .${Db.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 Tke({theme:t,ownerState:e}){const{container:n,rowSpacing:r}=e;let i={};if(n&&r!==0){const o=Lh({values:r,breakpoints:t.breakpoints.values});let a;typeof o=="object"&&(a=Hre({breakpoints:t.breakpoints.values,values:o})),i=Wo({theme:t},o,(s,l)=>{var c;const u=t.spacing(s);return u!=="0px"?{marginTop:`-${Cg(u)}`,[`& > .${Db.item}`]:{paddingTop:Cg(u)}}:(c=a)!=null&&c.includes(l)?{}:{marginTop:0,[`& > .${Db.item}`]:{paddingTop:0}}})}return i}function Eke({theme:t,ownerState:e}){const{container:n,columnSpacing:r}=e;let i={};if(n&&r!==0){const o=Lh({values:r,breakpoints:t.breakpoints.values});let a;typeof o=="object"&&(a=Hre({breakpoints:t.breakpoints.values,values:o})),i=Wo({theme:t},o,(s,l)=>{var c;const u=t.spacing(s);return u!=="0px"?{width:`calc(100% + ${Cg(u)})`,marginLeft:`-${Cg(u)}`,[`& > .${Db.item}`]:{paddingLeft:Cg(u)}}:(c=a)!=null&&c.includes(l)?{}:{width:"100%",marginLeft:0,[`& > .${Db.item}`]:{paddingLeft:0}}})}return i}function Pke(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 Mke=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=Pke(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}),Cke,Tke,Eke,Oke);function kke(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 Ake=t=>{const{classes:e,container:n,direction:r,item:i,spacing:o,wrap:a,zeroMinWidth:s,breakpoints:l}=t;let c=[];n&&(c=kke(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,xke,e)},MC=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiGrid"}),{breakpoints:i}=Go(),o=P1(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,Ske),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=Ake(C);return w.jsx(M8.Provider,{value:_,children:w.jsx(Mke,j({ownerState:C,className:ke(E.root,a),as:c,ref:n},O))})}),Rke=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function UL(t){return`scale(${t}, ${t**2})`}const Ike={entering:{opacity:1,transform:UL(1)},entered:{opacity:1,transform:"none"}},MA=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),ev=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=ka}=e,v=Ae(e,Rke),y=bf(),x=M.useRef(),b=Go(),_=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)=>{u5(L);const{duration:B,delay:U,easing:W}=Zf({style:p,timeout:m,easing:a},{mode:"enter"});let $;m==="auto"?($=b.transitions.getAutoHeightDuration(L.clientHeight),x.current=$):$=B,L.style.transition=[b.transitions.create("opacity",{duration:$,delay:U}),b.transitions.create("transform",{duration:MA?$:$*.666,delay:U,easing:W})].join(","),l&&l(L,z)}),k=O(c),I=O(h),P=O(L=>{const{duration:z,delay:B,easing:U}=Zf({style:p,timeout:m,easing:a},{mode:"exit"});let W;m==="auto"?(W=b.transitions.getAutoHeightDuration(L.clientHeight),x.current=W):W=z,L.style.transition=[b.transitions.create("opacity",{duration:W,delay:B}),b.transitions.create("transform",{duration:MA?W:W*.666,delay:MA?B:B||W*.333,easing:U})].join(","),L.style.opacity=0,L.style.transform=UL(.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:UL(.75),visibility:L==="exited"&&!s?"hidden":void 0},Ike[L],p,o.props.style),ref:S},z))}))});ev.muiSupportAuto=!0;const Dke=["disableUnderline","components","componentsProps","fullWidth","inputComponent","multiline","slotProps","slots","type"],Lke=t=>{const{classes:e,disableUnderline:n}=t,i=Ue({root:["root",!n&&"underline"],input:["input"]},kPe,e);return j({},e,i)},Nke=we(YM,{shouldForwardProp:t=>hi(t)||t==="classes",name:"MuiInput",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[...XM(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"},[`&.${d0.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${d0.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(.${d0.disabled}, .${d0.error}):before`]:{borderBottom:`2px solid ${(t.vars||t).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${r}`}},[`&.${d0.disabled}:before`]:{borderBottomStyle:"dotted"}})}),$ke=we(KM,{name:"MuiInput",slot:"Input",overridesResolver:QM})({}),yd=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,Dke),y=Lke(s),b={root:{ownerState:{disableUnderline:l}}},_=p??u?Ii(p??u,b):b,S=(r=(i=m.root)!=null?i:c.Root)!=null?r:Nke,O=(o=(a=m.input)!=null?a:c.Input)!=null?o:$ke;return w.jsx(_5,j({slots:{root:S,input:O},slotProps:_,fullWidth:f,inputComponent:d,multiline:h,ref:n,type:g},v,{classes:y}))});yd.muiName="Input";function Fke(t){return We("MuiInputAdornment",t)}const k8=Ve("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var A8;const jke=["children","className","component","disablePointerEvents","disableTypography","position","variant"],Bke=(t,e)=>{const{ownerState:n}=t;return[e.root,e[`position${De(n.position)}`],n.disablePointerEvents===!0&&e.disablePointerEvents,e[n.variant]]},zke=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,Fke,e)},Uke=we("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:Bke})(({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"&&{[`&.${k8.positionStart}&:not(.${k8.hiddenLabel})`]:{marginTop:16}},e.position==="start"&&{marginRight:8},e.position==="end"&&{marginLeft:8},e.disablePointerEvents===!0&&{pointerEvents:"none"})),Wke=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,jke),d=oc()||{};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=zke(p);return w.jsx(qM.Provider,{value:null,children:w.jsx(Uke,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"?A8||(A8=w.jsx("span",{className:"notranslate",children:"​"})):null,i]})}))})});function Vke(t){return We("MuiInputLabel",t)}Ve("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const Gke=["disableAnimation","margin","shrink","variant","className"],Hke=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,Vke,e);return j({},e,c)},qke=we(yke,{shouldForwardProp:t=>hi(t)||t==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${zx.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)"}))),ny=M.forwardRef(function(e,n){const r=qe({name:"MuiInputLabel",props:e}),{disableAnimation:i=!1,shrink:o,className:a}=r,s=Ae(r,Gke),l=oc();let c=o;typeof c>"u"&&l&&(c=l.filled||l.focused||l.adornedStart);const u=gd({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=Hke(f);return w.jsx(qke,j({"data-shrink":c,ownerState:f,ref:n,className:ke(d.root,a)},s,{classes:d}))});function Xke(t){return We("MuiLink",t)}const Qke=Ve("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),qre={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},Yke=t=>qre[t]||t,Kke=({theme:t,ownerState:e})=>{const n=Yke(e.color),r=Xg(t,`palette.${n}`,!1)||e.color,i=Xg(t,`palette.${n}Channel`);return"vars"in t&&i?`rgba(${i} / 0.4)`:kt(r,.4)},Zke=["className","color","component","onBlur","onFocus","TypographyClasses","underline","variant","sx"],Jke=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,Xke,e)},eAe=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:Kke({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"},[`&.${Qke.focusVisible}`]:{outline:"auto"}})),tAe=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,Zke),{isFocusVisibleRef:p,onBlur:m,onFocus:g,ref:v}=k1(),[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=Jke(O);return w.jsx(eAe,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))}),Xs=M.createContext({});function nAe(t){return We("MuiList",t)}Ve("MuiList",["root","padding","dense","subheader"]);const rAe=["children","className","component","dense","disablePadding","subheader"],iAe=t=>{const{classes:e,disablePadding:n,dense:r,subheader:i}=t;return Ue({root:["root",!n&&"padding",r&&"dense",i&&"subheader"]},nAe,e)},oAe=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})),e2=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,rAe),f=M.useMemo(()=>({dense:s}),[s]),d=j({},r,{component:a,dense:s,disablePadding:l}),h=iAe(d);return w.jsx(Xs.Provider,{value:f,children:w.jsxs(oAe,j({as:a,className:ke(h.root,o),ref:n,ownerState:d},u,{children:[c,i]}))})});function aAe(t){return We("MuiListItem",t)}const Nm=Ve("MuiListItem",["root","container","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","padding","button","secondaryAction","selected"]);function sAe(t){return We("MuiListItemButton",t)}const $m=Ve("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),lAe=["alignItems","autoFocus","component","children","dense","disableGutters","divider","focusVisibleClassName","selected","className"],cAe=(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]},uAe=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"]},sAe,n);return j({},n,c)},fAe=we(fs,{shouldForwardProp:t=>hi(t)||t==="classes",name:"MuiListItemButton",slot:"Root",overridesResolver:cAe})(({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"}},[`&.${$m.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${$m.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)}},[`&.${$m.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)}},[`&.${$m.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${$m.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})),Xre=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,lAe),m=M.useContext(Xs),g=M.useMemo(()=>({dense:l||m.dense||!1,alignItems:i,disableGutters:c}),[i,m.dense,l,c]),v=M.useRef(null);Hr(()=>{o&&v.current&&v.current.focus()},[o]);const y=j({},r,{alignItems:i,dense:g.dense,disableGutters:c,divider:u,selected:d}),x=uAe(y),b=Zt(v,n);return w.jsx(Xs.Provider,{value:g,children:w.jsx(fAe,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}))})});function dAe(t){return We("MuiListItemSecondaryAction",t)}Ve("MuiListItemSecondaryAction",["root","disableGutters"]);const hAe=["className"],pAe=t=>{const{disableGutters:e,classes:n}=t;return Ue({root:["root",e&&"disableGutters"]},dAe,n)},mAe=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})),Lb=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiListItemSecondaryAction"}),{className:i}=r,o=Ae(r,hAe),a=M.useContext(Xs),s=j({},r,{disableGutters:a.disableGutters}),l=pAe(s);return w.jsx(mAe,j({className:ke(l.root,i),ownerState:s,ref:n},o))});Lb.muiName="ListItemSecondaryAction";const gAe=["className"],vAe=["alignItems","autoFocus","button","children","className","component","components","componentsProps","ContainerComponent","ContainerProps","dense","disabled","disableGutters","disablePadding","divider","focusVisibleClassName","secondaryAction","selected","slotProps","slots"],yAe=(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]},xAe=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"]},aAe,r)},bAe=we("div",{name:"MuiListItem",slot:"Root",overridesResolver:yAe})(({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&&{[`& > .${$m.root}`]:{paddingRight:48}},{[`&.${Nm.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${Nm.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${Nm.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)}},[`&.${Nm.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"}},[`&.${Nm.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})),_Ae=we("li",{name:"MuiListItem",slot:"Container",overridesResolver:(t,e)=>e.container})({position:"relative"}),Ux=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,gAe),E=Ae(r,vAe),k=M.useContext(Xs),I=M.useMemo(()=>({dense:p||k.dense||!1,alignItems:i,disableGutters:g}),[i,k.dense,p,g]),P=M.useRef(null);Hr(()=>{o&&P.current&&P.current.focus()},[o]);const R=M.Children.toArray(s),T=R.length&&Nx(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=xAe(L),B=Zt(P,n),U=O.root||u.Root||bAe,W=S.root||f.root||{},$=j({className:ke(z.root,W.className,l),disabled:m},E);let N=c||"li";return a&&($.component=c||"div",$.focusVisibleClassName=ke(Nm.focusVisible,x),N=fs),T?(N=!$.component&&!c?"div":N,d==="li"&&(N==="li"?N="div":$.component==="li"&&($.component="div")),w.jsx(Xs.Provider,{value:I,children:w.jsxs(_Ae,j({as:d,className:ke(z.container,h),ref:B,ownerState:L},C,{children:[w.jsx(U,j({},W,!Vl(U)&&{as:N,ownerState:j({},L,W.ownerState)},$,{children:R})),R.pop()]}))})):w.jsx(Xs.Provider,{value:I,children:w.jsxs(U,j({},W,{as:N,ref:B},!Vl(U)&&{ownerState:j({},L,W.ownerState)},$,{children:[R,b&&w.jsx(Lb,{children:b})]}))})});function wAe(t){return We("MuiListItemIcon",t)}const R8=Ve("MuiListItemIcon",["root","alignItemsFlexStart"]),SAe=["className"],OAe=t=>{const{alignItems:e,classes:n}=t;return Ue({root:["root",e==="flex-start"&&"alignItemsFlexStart"]},wAe,n)},CAe=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})),Qre=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiListItemIcon"}),{className:i}=r,o=Ae(r,SAe),a=M.useContext(Xs),s=j({},r,{alignItems:a.alignItems}),l=OAe(s);return w.jsx(CAe,j({className:ke(l.root,i),ownerState:s,ref:n},o))});function TAe(t){return We("MuiListItemText",t)}const RT=Ve("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),EAe=["children","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps"],PAe=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"]},TAe,e)},MAe=we("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${RT.primary}`]:e.primary},{[`& .${RT.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})),ts=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,EAe),{dense:h}=M.useContext(Xs);let p=l??i,m=u;const g=j({},r,{disableTypography:a,inset:s,primary:!!p,secondary:!!m,dense:h}),v=PAe(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(MAe,j({className:ke(v.root,o),ownerState:g,ref:n},d,{children:[p,m]}))}),kAe=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function kA(t,e,n){return t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:n?null:t.firstChild}function I8(t,e,n){return t===e?n?t.firstChild:t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:n?null:t.lastChild}function Yre(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 p0(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")||!Yre(s,o)||l)s=i(t,s,n);else return s.focus(),!0}return!1}const Kre=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,kAe),h=M.useRef(null),p=M.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});Hr(()=>{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(),p0(b,S,c,l,kA);else if(_==="ArrowUp")x.preventDefault(),p0(b,S,c,l,I8);else if(_==="Home")x.preventDefault(),p0(b,null,c,l,kA);else if(_==="End")x.preventDefault(),p0(b,null,c,l,I8);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&&Yre(S,O);O.previousKeyMatched&&(k||p0(b,S,!1,l,kA,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(e2,j({role:"menu",ref:g,className:s,onKeyDown:m,tabIndex:i?0:-1},d,{children:y}))});function AAe(t){return We("MuiPopover",t)}Ve("MuiPopover",["root","paper"]);const RAe=["onEntering"],IAe=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],DAe=["slotProps"];function D8(t,e){let n=0;return typeof e=="number"?n=e:e==="center"?n=t.height/2:e==="bottom"&&(n=t.height),n}function L8(t,e){let n=0;return typeof e=="number"?n=e:e==="center"?n=t.width/2:e==="right"&&(n=t.width),n}function N8(t){return[t.horizontal,t.vertical].map(e=>typeof e=="number"?`${e}px`:e).join(" ")}function AA(t){return typeof t=="function"?t():t}const LAe=t=>{const{classes:e}=t;return Ue({root:["root"],paper:["paper"]},AAe,e)},NAe=we(Wre,{name:"MuiPopover",slot:"Root",overridesResolver:(t,e)=>e.root})({}),Zre=we(Ho,{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}),Ep=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=ev,transitionDuration:O="auto",TransitionProps:{onEntering:C}={},disableScrollLock:E=!1}=a,k=Ae(a.TransitionProps,RAe),I=Ae(a,IAe),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=LAe(L),B=M.useCallback(()=>{if(f==="anchorPosition")return u;const ve=AA(l),ce=(ve&&ve.nodeType===1?ve:$n(R.current).body).getBoundingClientRect();return{top:ce.top+D8(ce,c.vertical),left:ce.left+L8(ce,c.horizontal)}},[l,c.horizontal,c.vertical,u,f]),U=M.useCallback(ve=>({vertical:D8(ve,_.vertical),horizontal:L8(ve,_.horizontal)}),[_.horizontal,_.vertical]),W=M.useCallback(ve=>{const F={width:ve.offsetWidth,height:ve.offsetHeight},ce=U(F);if(f==="none")return{top:null,left:null,transformOrigin:N8(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=cs(AA(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:N8(ce)}},[l,f,B,U,g]),[$,N]=M.useState(v),D=M.useCallback(()=>{const ve=R.current;if(!ve)return;const F=W(ve);F.top!==null&&(ve.style.top=F.top),F.left!==null&&(ve.style.left=F.left),ve.style.transformOrigin=F.transformOrigin,N(!0)},[W]);M.useEffect(()=>(E&&window.addEventListener("scroll",D),()=>window.removeEventListener("scroll",D)),[l,E,D]);const A=(ve,F)=>{C&&C(ve,F),D()},q=()=>{N(!1)};M.useEffect(()=>{v&&D()}),M.useImperativeHandle(s,()=>v?{updatePosition:()=>{D()}}:null,[v,D]),M.useEffect(()=>{if(!v)return;const ve=Kv(()=>{D()}),F=cs(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(AA(l)).body:void 0),se=(i=x==null?void 0:x.root)!=null?i:NAe,te=(o=x==null?void 0:x.paper)!=null?o:Zre,J=$r({elementType:te,externalSlotProps:j({},P,{style:$?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=$r({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,DAe);return w.jsx(se,j({},re,!Vl(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}))}))}))});function $Ae(t){return We("MuiMenu",t)}Ve("MuiMenu",["root","paper","list"]);const FAe=["onEntering"],jAe=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],BAe={vertical:"top",horizontal:"right"},zAe={vertical:"top",horizontal:"left"},UAe=t=>{const{classes:e}=t;return Ue({root:["root"],paper:["paper"],list:["list"]},$Ae,e)},WAe=we(Ep,{shouldForwardProp:t=>hi(t)||t==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(t,e)=>e.root})({}),VAe=we(Zre,{name:"MuiMenu",slot:"Paper",overridesResolver:(t,e)=>e.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),GAe=we(Kre,{name:"MuiMenu",slot:"List",overridesResolver:(t,e)=>e.list})({outline:0}),Pp=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,FAe),_=Ae(o,jAe),S=A1(),O=j({},o,{autoFocus:a,disableAutoFocusItem:c,MenuListProps:u,onEntering:g,PaperProps:h,transitionDuration:m,TransitionProps:b,variant:v}),C=UAe(O),E=a&&!c&&d,k=M.useRef(null),I=(U,W)=>{k.current&&k.current.adjustStyleForScrollbar(U,{direction:S?"rtl":"ltr"}),g&&g(U,W)},P=U=>{U.key==="Tab"&&(U.preventDefault(),f&&f(U,"tabKeyDown"))};let R=-1;M.Children.map(s,(U,W)=>{M.isValidElement(U)&&(U.props.disabled||(v==="selectedMenu"&&U.props.selected||R===-1)&&(R=W))});const T=(r=y.paper)!=null?r:VAe,L=(i=x.paper)!=null?i:h,z=$r({elementType:y.root,externalSlotProps:x.root,ownerState:O,className:[C.root,l]}),B=$r({elementType:T,externalSlotProps:L,ownerState:O,className:C.paper});return w.jsx(WAe,j({onClose:f,anchorOrigin:{vertical:"bottom",horizontal:S?"right":"left"},transformOrigin:S?BAe:zAe,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(GAe,j({onKeyDown:P,actions:k,autoFocus:a&&(R===-1||c),autoFocusItem:E,variant:v},u,{className:ke(C.list,u.className),children:s}))}))});function HAe(t){return We("MuiMenuItem",t)}const m0=Ve("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),qAe=["autoFocus","component","dense","divider","disableGutters","focusVisibleClassName","role","tabIndex","className"],XAe=(t,e)=>{const{ownerState:n}=t;return[e.root,n.dense&&e.dense,n.divider&&e.divider,!n.disableGutters&&e.gutters]},QAe=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"]},HAe,a);return j({},a,l)},YAe=we(fs,{shouldForwardProp:t=>hi(t)||t==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:XAe})(({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"}},[`&.${m0.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${m0.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)}},[`&.${m0.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)}},[`&.${m0.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${m0.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity},[`& + .${T8.root}`]:{marginTop:t.spacing(1),marginBottom:t.spacing(1)},[`& + .${T8.inset}`]:{marginLeft:52},[`& .${RT.root}`]:{marginTop:0,marginBottom:0},[`& .${RT.inset}`]:{paddingLeft:36},[`& .${R8.root}`]:{minWidth:36}},!e.dense&&{[t.breakpoints.up("sm")]:{minHeight:"auto"}},e.dense&&j({minHeight:32,paddingTop:4,paddingBottom:4},t.typography.body2,{[`& .${R8.root} svg`]:{fontSize:"1.25rem"}}))),jr=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,qAe),p=M.useContext(Xs),m=M.useMemo(()=>({dense:a||p.dense||!1,disableGutters:l}),[p.dense,a,l]),g=M.useRef(null);Hr(()=>{i&&g.current&&g.current.focus()},[i]);const v=j({},r,{dense:m.dense,divider:s,disableGutters:l}),y=QAe(r),x=Zt(g,n);let b;return r.disabled||(b=f!==void 0?f:-1),w.jsx(Xs.Provider,{value:m,children:w.jsx(YAe,j({ref:x,role:u,tabIndex:b,component:o,focusVisibleClassName:ke(y.focusVisible,c),className:ke(y.root,d)},h,{ownerState:v,classes:y}))})});function KAe(t){return We("MuiNativeSelect",t)}const O5=Ve("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),ZAe=["className","disabled","error","IconComponent","inputRef","variant"],JAe=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,KAe,e)},Jre=({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"},[`&.${O5.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}}),eRe=we("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:hi,overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.select,e[n.variant],n.error&&e.error,{[`&.${O5.multiple}`]:e.multiple}]}})(Jre),eie=({ownerState:t,theme:e})=>j({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(e.vars||e).palette.action.active,[`&.${O5.disabled}`]:{color:(e.vars||e).palette.action.disabled}},t.open&&{transform:"rotate(180deg)"},t.variant==="filled"&&{right:7},t.variant==="outlined"&&{right:7}),tRe=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]}})(eie),nRe=M.forwardRef(function(e,n){const{className:r,disabled:i,error:o,IconComponent:a,inputRef:s,variant:l="standard"}=e,c=Ae(e,ZAe),u=j({},e,{disabled:i,variant:l,error:o}),f=JAe(u);return w.jsxs(M.Fragment,{children:[w.jsx(eRe,j({ownerState:u,className:ke(f.select,r),disabled:i,ref:s||n},c)),e.multiple?null:w.jsx(tRe,{as:a,ownerState:u,className:f.icon})]})});var $8;const rRe=["children","classes","className","label","notched"],iRe=we("fieldset",{shouldForwardProp:hi})({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%"}),oRe=we("legend",{shouldForwardProp:hi})(({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 aRe(t){const{className:e,label:n,notched:r}=t,i=Ae(t,rRe),o=n!=null&&n!=="",a=j({},t,{notched:r,withLabel:o});return w.jsx(iRe,j({"aria-hidden":!0,className:e,ownerState:a},i,{children:w.jsx(oRe,{ownerState:a,children:o?w.jsx("span",{children:n}):$8||($8=w.jsx("span",{className:"notranslate",children:"​"}))})}))}const sRe=["components","fullWidth","inputComponent","label","multiline","notched","slots","type"],lRe=t=>{const{classes:e}=t,r=Ue({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},APe,e);return j({},e,r)},cRe=we(YM,{shouldForwardProp:t=>hi(t)||t==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:XM})(({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 .${Mu.notchedOutline}`]:{borderColor:(t.vars||t).palette.text.primary},"@media (hover: none)":{[`&:hover .${Mu.notchedOutline}`]:{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:n}},[`&.${Mu.focused} .${Mu.notchedOutline}`]:{borderColor:(t.vars||t).palette[e.color].main,borderWidth:2},[`&.${Mu.error} .${Mu.notchedOutline}`]:{borderColor:(t.vars||t).palette.error.main},[`&.${Mu.disabled} .${Mu.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"}))}),uRe=we(aRe,{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}}),fRe=we(KM,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:QM})(({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})),C5=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,sRe),y=lRe(l),x=oc(),b=gd({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:cRe,O=(o=(a=m.input)!=null?a:c.Input)!=null?o:fRe;return w.jsx(_5,j({slots:{root:S,input:O},renderSuffix:C=>w.jsx(uRe,{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})}))});C5.muiName="Input";const dRe=ni(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"),hRe=ni(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"),pRe=we("span",{shouldForwardProp:hi})({position:"relative",display:"flex"}),mRe=we(dRe)({transform:"scale(1)"}),gRe=we(hRe)(({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 tie(t){const{checked:e=!1,classes:n={},fontSize:r}=t,i=j({},t,{checked:e});return w.jsxs(pRe,{className:n.root,ownerState:i,children:[w.jsx(mRe,{fontSize:r,className:n.background,ownerState:i}),w.jsx(gRe,{fontSize:r,className:n.dot,ownerState:i})]})}const nie=M.createContext(void 0);function vRe(){return M.useContext(nie)}function yRe(t){return We("MuiRadio",t)}const F8=Ve("MuiRadio",["root","checked","disabled","colorPrimary","colorSecondary","sizeSmall"]),xRe=["checked","checkedIcon","color","icon","name","onChange","size","className"],bRe=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,yRe,e))},_Re=we(w5,{shouldForwardProp:t=>hi(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"&&{[`&.${F8.checked}`]:{color:(t.vars||t).palette[e.color].main}},{[`&.${F8.disabled}`]:{color:(t.vars||t).palette.action.disabled}}));function wRe(t,e){return typeof e=="object"&&e!==null?t===e:String(t)===String(e)}const j8=w.jsx(tie,{checked:!0}),B8=w.jsx(tie,{}),Wx=M.forwardRef(function(e,n){var r,i;const o=qe({props:e,name:"MuiRadio"}),{checked:a,checkedIcon:s=j8,color:l="primary",icon:c=B8,name:u,onChange:f,size:d="medium",className:h}=o,p=Ae(o,xRe),m=j({},o,{color:l,size:d}),g=bRe(m),v=vRe();let y=a;const x=OT(f,v&&v.onChange);let b=u;return v&&(typeof y>"u"&&(y=wRe(v.value,o.value)),typeof b>"u"&&(b=v.name)),w.jsx(_Re,j({type:"radio",icon:M.cloneElement(c,{fontSize:(r=B8.props.fontSize)!=null?r:d}),checkedIcon:M.cloneElement(s,{fontSize:(i=j8.props.fontSize)!=null?i:d}),ownerState:m,classes:g,name:b,checked:y,onChange:x,ref:n,className:ke(g.root,h)},p))});function SRe(t){return We("MuiRadioGroup",t)}Ve("MuiRadioGroup",["root","row","error"]);const ORe=["actions","children","className","defaultValue","name","onChange","value"],CRe=t=>{const{classes:e,row:n,error:r}=t;return Ue({root:["root",n&&"row",r&&"error"]},SRe,e)},T5=M.forwardRef(function(e,n){const{actions:r,children:i,className:o,defaultValue:a,name:s,onChange:l,value:c}=e,u=Ae(e,ORe),f=M.useRef(null),d=CRe(e),[h,p]=Qs({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=pd(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(nie.Provider,{value:v,children:w.jsx(lke,j({role:"radiogroup",ref:m,className:ke(d.root,o)},u,{children:i}))})});function TRe(t){return We("MuiSelect",t)}const g0=Ve("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var z8;const ERe=["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"],PRe=we("div",{name:"MuiSelect",slot:"Select",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`&.${g0.select}`]:e.select},{[`&.${g0.select}`]:e[n.variant]},{[`&.${g0.error}`]:e.error},{[`&.${g0.multiple}`]:e.multiple}]}})(Jre,{[`&.${g0.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),MRe=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]}})(eie),kRe=we("input",{shouldForwardProp:t=>DM(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 U8(t,e){return typeof e=="object"&&e!==null?t===e:String(t)===String(e)}function ARe(t){return t==null||typeof t=="string"&&!t.trim()}const RRe=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,TRe,e)},IRe=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,ERe),[U,W]=Qs({controlled:L,default:f,name:"Select"}),[$,N]=Qs({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:U}),[U]),M.useEffect(()=>{u&&$&&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 $e=()=>{getSelection().isCollapsed&&A.current.focus()};return me.addEventListener("click",$e),()=>{me.removeEventListener("click",$e)}}},[v]);const re=(me,$e)=>{me?E&&E($e):O&&O($e),K||(te(s?null:be.clientWidth),N(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 $e=ce.find(Te=>Te.props.value===me.target.value);$e!==void 0&&(W($e.props.value),S&&S(me,$e))},Q=me=>$e=>{let Te;if($e.currentTarget.hasAttribute("tabindex")){if(x){Te=Array.isArray(U)?U.slice():[];const Re=U.indexOf(me.props.value);Re===-1?Te.push(me.props.value):Te.splice(Re,1)}else Te=me.props.value;if(me.props.onClick&&me.props.onClick($e),U!==Te&&(W(Te),S)){const Re=$e.nativeEvent||$e,ae=new Re.constructor(Re.type,Re);Object.defineProperty(ae,"target",{writable:!0,value:{value:Te,name:b}}),S(ae,me)}x||re(!1,$e)}},X=me=>{I||[" ","ArrowUp","ArrowDown","Enter"].indexOf(me.key)!==-1&&(me.preventDefault(),re(!0,me))},ee=q!==null&&$,ge=me=>{!ee&&_&&(Object.defineProperty(me,"target",{writable:!0,value:{value:U,name:b}}),_(me))};delete B["aria-invalid"];let ye,H;const G=[];let ie=!1;(AT({value:U})||h)&&(P?ye=P(U):ie=!0);const he=ce.map(me=>{if(!M.isValidElement(me))return null;let $e;if(x){if(!Array.isArray(U))throw new Error(fu(2));$e=U.some(Te=>U8(Te,me.props.value)),$e&&ie&&G.push(me.props.children)}else $e=U8(U,me.props.value),$e&&ie&&(H=me.props.children);return M.cloneElement(me,{"aria-selected":$e?"true":"false",onClick:Q(me),onKeyUp:Te=>{Te.key===" "&&Te.preventDefault(),me.props.onKeyUp&&me.props.onKeyUp(Te)},role:"option",selected:$e,value:void 0,"data-value":me.props.value})});ie&&(x?G.length===0?ye=null:ye=G.reduce((me,$e,Te)=>(me.push($e),Te{const{classes:e}=t;return e},E5={name:"MuiSelect",overridesResolver:(t,e)=>e.root,shouldForwardProp:t=>hi(t)&&t!=="variant",slot:"Root"},$Re=we(yd,E5)(""),FRe=we(C5,E5)(""),jRe=we(S5,E5)(""),xd=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=IPe,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,DRe),k=y?nRe:IRe,I=oc(),P=gd({props:r,muiFormControl:I,states:["variant","error"]}),R=P.variant||C,T=j({},r,{variant:R,classes:a}),L=NRe(T),z=Ae(L,LRe),B=d||{standard:w.jsx($Re,{ownerState:T}),outlined:w.jsx(FRe,{label:p,ownerState:T}),filled:w.jsx(jRe,{ownerState:T})}[R],U=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:U,className:ke(B.props.className,s,L.root)},!d&&{variant:R},E))})});xd.muiName="Select";const BRe=t=>!t||!Vl(t);function zRe(t){return We("MuiSlider",t)}const Xa=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"]),URe=t=>{const{open:e}=t;return{offset:ke(e&&Xa.valueLabelOpen),circle:Xa.valueLabelCircle,label:Xa.valueLabelLabel}};function WRe(t){const{children:e,className:n,value:r}=t,i=URe(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 VRe=["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"],GRe=s5();function W8(t){return t}const HRe=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"},[`&.${Xa.disabled}`]:{pointerEvents:"none",cursor:"default",color:(t.vars||t).palette.grey[400]},[`&.${Xa.dragging}`]:{[`& .${Xa.thumb}, & .${Xa.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}}]}}),qRe=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}}]}),XRe=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:Ab(t.palette[n].main,.62),borderColor:Ab(t.palette[n].main,.62)},t.applyStyles("dark",{backgroundColor:kb(t.palette[n].main,.5)}),t.applyStyles("dark",{borderColor:kb(t.palette[n].main,.5)})))}))]}}),QRe=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%)"},[`&.${Xa.disabled}`]:{"&:hover":{boxShadow:"none"}},variants:[{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%)"}},...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, &.${Xa.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"}}),[`&.${Xa.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)}`})}}))]}}),YRe=we(WRe,{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%"},[`&.${Xa.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%"},[`&.${Xa.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"}}]})),KRe=we("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:t=>DM(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}}]})),ZRe=we("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:t=>DM(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}}]})),JRe=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,zRe,a)},eIe=({children:t})=>t,ry=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=GRe({props:e,name:"MuiSlider"}),P=A1(),{"aria-label":R,"aria-valuetext":T,"aria-labelledby":L,component:z="span",components:B={},componentsProps:U={},color:W="primary",classes:$,className:N,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=W8,slotProps:F,slots:ce,track:le="normal",valueLabelDisplay:Q="off",valueLabelFormat:X=W8}=I,ee=Ae(I,VRe),ge=j({},I,{isRtl:P,max:se,min:te,classes:$,disabled:A,disableSwap:D,orientation:J,marks:K,color:W,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:$e,getThumbStyle:Te}=iPe(j({},ge,{rootRef:n}));ge.marked=xe.length>0&&xe.some(Ze=>Ze.label),ge.dragging=de,ge.focusedThumbIndex=Z;const Re=JRe(ge),ae=(r=(i=ce==null?void 0:ce.root)!=null?i:B.Root)!=null?r:HRe,Le=(o=(a=ce==null?void 0:ce.rail)!=null?a:B.Rail)!=null?o:qRe,Ee=(s=(l=ce==null?void 0:ce.track)!=null?l:B.Track)!=null?s:XRe,ze=(c=(u=ce==null?void 0:ce.thumb)!=null?u:B.Thumb)!=null?c:QRe,He=(f=(d=ce==null?void 0:ce.valueLabel)!=null?d:B.ValueLabel)!=null?f:YRe,bt=(h=(p=ce==null?void 0:ce.mark)!=null?p:B.Mark)!=null?h:KRe,Dt=(m=(g=ce==null?void 0:ce.markLabel)!=null?g:B.MarkLabel)!=null?m:ZRe,nn=(v=(y=ce==null?void 0:ce.input)!=null?y:B.Input)!=null?v:"input",Xr=(x=F==null?void 0:F.root)!=null?x:U.root,Cn=(b=F==null?void 0:F.rail)!=null?b:U.rail,Qr=(_=F==null?void 0:F.track)!=null?_:U.track,ir=(S=F==null?void 0:F.thumb)!=null?S:U.thumb,to=(O=F==null?void 0:F.valueLabel)!=null?O:U.valueLabel,yo=(C=F==null?void 0:F.mark)!=null?C:U.mark,Xo=(E=F==null?void 0:F.markLabel)!=null?E:U.markLabel,al=(k=F==null?void 0:F.input)!=null?k:U.input,yi=$r({elementType:ae,getSlotProps:H,externalSlotProps:Xr,externalForwardedProps:ee,additionalProps:j({},BRe(ae)&&{as:z}),ownerState:j({},ge,Xr==null?void 0:Xr.ownerState),className:[Re.root,N]}),Ts=$r({elementType:Le,externalSlotProps:Cn,ownerState:ge,className:Re.rail}),ne=$r({elementType:Ee,externalSlotProps:Qr,additionalProps:{style:j({},ye[oe].offset(me),ye[oe].leap($e))},ownerState:j({},ge,Qr==null?void 0:Qr.ownerState),className:Re.track}),Pe=$r({elementType:ze,getSlotProps:ie,externalSlotProps:ir,ownerState:j({},ge,ir==null?void 0:ir.ownerState),className:Re.thumb}),Ie=$r({elementType:He,externalSlotProps:to,ownerState:j({},ge,to==null?void 0:to.ownerState),className:Re.valueLabel}),Oe=$r({elementType:bt,externalSlotProps:yo,ownerState:ge,className:Re.mark}),Ne=$r({elementType:Dt,externalSlotProps:Xo,ownerState:ge,className:Re.markLabel}),ot=$r({elementType:nn,getSlotProps:G,externalSlotProps:al,ownerState:ge});return w.jsxs(ae,j({},yi,{children:[w.jsx(Le,j({},Ts)),w.jsx(Ee,j({},ne)),xe.filter(Ze=>Ze.value>=te&&Ze.value<=se).map((Ze,mt)=>{const wt=kT(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(bt,j({"data-index":mt},Oe,!Vl(bt)&&{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},Ne,!Vl(Dt)&&{markLabelActive:Pt},{style:j({},zt,Ne.style),className:ke(Re.markLabel,Ne.className,Pt&&Re.markLabelActive),children:Ze.label})):null]},mt)}),Me.map((Ze,mt)=>{const wt=kT(Ze,te,se),zt=ye[oe].offset(wt),Pt=Q==="off"?eIe:He;return w.jsx(Pt,j({},!Vl(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,Te(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)})]}))});function tIe(t){return We("MuiSnackbarContent",t)}Ve("MuiSnackbarContent",["root","message","action"]);const nIe=["action","className","message","role"],rIe=t=>{const{classes:e}=t;return Ue({root:["root"],action:["action"],message:["message"]},tIe,e)},iIe=we(Ho,{name:"MuiSnackbarContent",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>{const e=t.palette.mode==="light"?.8:.98,n=rOe(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}})}),oIe=we("div",{name:"MuiSnackbarContent",slot:"Message",overridesResolver:(t,e)=>e.message})({padding:"8px 0"}),aIe=we("div",{name:"MuiSnackbarContent",slot:"Action",overridesResolver:(t,e)=>e.action})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),rie=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,nIe),c=r,u=rIe(c);return w.jsxs(iIe,j({role:s,square:!0,elevation:6,className:ke(u.root,o),ownerState:c,ref:n},l,{children:[w.jsx(oIe,{className:u.message,ownerState:c,children:a}),i?w.jsx(aIe,{className:u.action,ownerState:c,children:i}):null]}))});function sIe(t){return We("MuiSnackbar",t)}Ve("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const lIe=["onEnter","onExited"],cIe=["action","anchorOrigin","autoHideDuration","children","className","ClickAwayListenerProps","ContentProps","disableWindowBlurListener","message","onBlur","onClose","onFocus","onMouseEnter","onMouseLeave","open","resumeHideDuration","TransitionComponent","transitionDuration","TransitionProps"],uIe=t=>{const{classes:e,anchorOrigin:n}=t,r={root:["root",`anchorOrigin${De(n.vertical)}${De(n.horizontal)}`]};return Ue(r,sIe,e)},V8=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"})})}),fIe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiSnackbar"}),i=Go(),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=ev,transitionDuration:y=o,TransitionProps:{onEnter:x,onExited:b}={}}=r,_=Ae(r.TransitionProps,lIe),S=Ae(r,cIe),O=j({},r,{anchorOrigin:{vertical:s,horizontal:l},autoHideDuration:c,disableWindowBlurListener:p,TransitionComponent:v,transitionDuration:y}),C=uIe(O),{getRootProps:E,onClickAway:k}=oPe(j({},O)),[I,P]=M.useState(!0),R=$r({elementType:V8,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(bTe,j({onClickAway:k},d,{children:w.jsx(V8,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(rie,j({message:m,action:a},h))}))}))}))});function dIe(t){return We("MuiTooltip",t)}const _f=Ve("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]),hIe=["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 pIe(t){return Math.round(t*1e5)/1e5}const mIe=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,dIe,e)},gIe=we(b5,{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"] .${_f.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${_f.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${_f.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"] .${_f.arrow}`]:j({},e.isRtl?{left:0,marginLeft:"-0.71em"}:{right:0,marginRight:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}})})),vIe=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:`${pIe(16/14)}em`,fontWeight:t.typography.fontWeightRegular},{[`.${_f.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"})),[`.${_f.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"})),[`.${_f.popper}[data-popper-placement*="top"] &`]:j({transformOrigin:"center bottom",marginBottom:"14px"},e.touch&&{marginBottom:"24px"}),[`.${_f.popper}[data-popper-placement*="bottom"] &`]:j({transformOrigin:"center top",marginTop:"14px"},e.touch&&{marginTop:"24px"})})),yIe=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 dS=!1;const G8=new M1;let v0={x:0,y:0};function hS(t,e){return(n,...r)=>{e&&e(n,...r),t(n,...r)}}const xt=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:U=700,followCursor:W=!1,id:$,leaveDelay:N=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=ev,TransitionProps:ve}=S,F=Ae(S,hIe),ce=M.isValidElement(C)?C:w.jsx("span",{children:C}),le=Go(),Q=A1(),[X,ee]=M.useState(),[ge,ye]=M.useState(null),H=M.useRef(!1),G=T||W,ie=bf(),he=bf(),_e=bf(),oe=bf(),[Z,V]=Qs({controlled:Y,default:!1,name:"Tooltip",state:"open"});let de=Z;const xe=pd($),Me=M.useRef(),me=_r(()=>{Me.current!==void 0&&(document.body.style.WebkitUserSelect=Me.current,Me.current=void 0),oe.clear()});M.useEffect(()=>me,[me]);const $e=st=>{G8.clear(),dS=!0,V(!0),q&&!de&&q(st)},Te=_r(st=>{G8.start(800+N,()=>{dS=!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||dS&&B?he.start(dS?B:z,()=>{$e(st)}):$e(st))},ae=st=>{he.clear(),_e.start(N,()=>{Te(st)})},{isFocusVisibleRef:Le,onBlur:Ee,onFocus:ze,ref:He}=k1(),[,bt]=M.useState(!1),Dt=st=>{Ee(st),Le.current===!1&&(bt(!1),ae(st))},nn=st=>{X||ee(st.currentTarget),ze(st),Le.current===!0&&(bt(!0),Re(st))},Xr=st=>{H.current=!0;const Qt=ce.props;Qt.onTouchStart&&Qt.onTouchStart(st)},Cn=st=>{Xr(st),_e.clear(),ie.clear(),me(),Me.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",oe.start(U,()=>{document.body.style.WebkitUserSelect=Me.current,Re(st)})},Qr=st=>{ce.props.onTouchEnd&&ce.props.onTouchEnd(st),me(),_e.start(D,()=>{Te(st)})};M.useEffect(()=>{if(!de)return;function st(Qt){(Qt.key==="Escape"||Qt.key==="Esc")&&Te(Qt)}return document.addEventListener("keydown",st),()=>{document.removeEventListener("keydown",st)}},[Te,de]);const ir=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),v0={x:st.clientX,y:st.clientY},to.current&&to.current.update()},Xo={},al=typeof be=="string";I?(Xo.title=!de&&al&&!R?be:null,Xo["aria-describedby"]=de?xe:null):(Xo["aria-label"]=al?be:null,Xo["aria-labelledby"]=de&&!al?xe:null);const yi=j({},Xo,F,ce.props,{className:ke(F.className,ce.props.className),onTouchStart:Xr,ref:ir},W?{onMouseMove:yo}:{}),Ts={};L||(yi.onTouchStart=Cn,yi.onTouchEnd=Qr),R||(yi.onMouseOver=hS(Re,yi.onMouseOver),yi.onMouseLeave=hS(ae,yi.onMouseLeave),G||(Ts.onMouseOver=Re,Ts.onMouseLeave=ae)),P||(yi.onFocus=hS(nn,yi.onFocus),yi.onBlur=hS(Dt,yi.onBlur),G||(Ts.onFocus=nn,Ts.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=mIe(Pe),Oe=(r=(i=pe.popper)!=null?i:E.Popper)!=null?r:gIe,Ne=(o=(a=(s=pe.transition)!=null?s:E.Transition)!=null?a:re)!=null?o:ev,ot=(l=(c=pe.tooltip)!=null?c:E.Tooltip)!=null?l:vIe,Ze=(u=(f=pe.arrow)!=null?f:E.Arrow)!=null?u:yIe,mt=Zm(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=Zm(Ne,j({},ve,(m=J.transition)!=null?m:k.transition),Pe),zt=Zm(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=Zm(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??b5,placement:K,anchorEl:W?{getBoundingClientRect:()=>({top:v0.y,left:v0.x,right:v0.x,bottom:v0.y,width:0,height:0})}:X,popperRef:to,open:X?de:!1,id:xe,transition:!0},Ts,mt,{popperOptions:ne,children:({TransitionProps:st})=>w.jsx(Ne,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]}))}))}))]})});function xIe(t){return We("MuiSwitch",t)}const oo=Ve("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),bIe=["className","color","edge","size","sx"],_Ie=s5(),wIe=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,xIe,e);return j({},e,l)},SIe=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)"}}}}]}),OIe=we(w5,{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"?Ab(t.palette[e].main,.62):kb(t.palette[e].main,.55)}`}},[`&.${oo.checked} + .${oo.track}`]:{backgroundColor:(t.vars||t).palette[e].main}}}))]})),CIe=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}`})),TIe=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%"})),iie=M.forwardRef(function(e,n){const r=_Ie({props:e,name:"MuiSwitch"}),{className:i,color:o="primary",edge:a=!1,size:s="medium",sx:l}=r,c=Ae(r,bIe),u=j({},r,{color:o,edge:a,size:s}),f=wIe(u),d=w.jsx(TIe,{className:f.thumb,ownerState:u});return w.jsxs(SIe,{className:ke(f.root,i),sx:l,ownerState:u,children:[w.jsx(OIe,j({type:"checkbox",icon:d,checkedIcon:d,ref:n,ownerState:u},c,{classes:j({},f,{root:f.switchBase})})),w.jsx(CIe,{className:f.track,ownerState:u})]})});function EIe(t){return We("MuiTab",t)}const Au=Ve("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),PIe=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],MIe=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,EIe,e)},kIe=we(fs,{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,{[`& .${Au.iconWrapper}`]:e.iconWrapper}]}})(({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,[`& > .${Au.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,[`&.${Au.selected}`]:{opacity:1},[`&.${Au.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.textColor==="primary"&&{color:(t.vars||t).palette.text.secondary,[`&.${Au.selected}`]:{color:(t.vars||t).palette.primary.main},[`&.${Au.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.textColor==="secondary"&&{color:(t.vars||t).palette.text.secondary,[`&.${Au.selected}`]:{color:(t.vars||t).palette.secondary.main},[`&.${Au.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)})),Nb=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,PIe),_=j({},r,{disabled:o,disableFocusRipple:a,selected:m,icon:!!l,iconPosition:c,label:!!f,fullWidth:s,textColor:v,wrapped:x}),S=MIe(_),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(kIe,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]}))}),oie=M.createContext();function AIe(t){return We("MuiTable",t)}Ve("MuiTable",["root","stickyHeader"]);const RIe=["className","component","padding","size","stickyHeader"],IIe=t=>{const{classes:e,stickyHeader:n}=t;return Ue({root:["root",n&&"stickyHeader"]},AIe,e)},DIe=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"})),H8="table",P5=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTable"}),{className:i,component:o=H8,padding:a="normal",size:s="medium",stickyHeader:l=!1}=r,c=Ae(r,RIe),u=j({},r,{component:o,padding:a,size:s,stickyHeader:l}),f=IIe(u),d=M.useMemo(()=>({padding:a,size:s,stickyHeader:l}),[a,s,l]);return w.jsx(oie.Provider,{value:d,children:w.jsx(DIe,j({as:o,role:o===H8?null:"table",ref:n,className:ke(f.root,i),ownerState:u},c))})}),t2=M.createContext();function LIe(t){return We("MuiTableBody",t)}Ve("MuiTableBody",["root"]);const NIe=["className","component"],$Ie=t=>{const{classes:e}=t;return Ue({root:["root"]},LIe,e)},FIe=we("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"table-row-group"}),jIe={variant:"body"},q8="tbody",M5=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTableBody"}),{className:i,component:o=q8}=r,a=Ae(r,NIe),s=j({},r,{component:o}),l=$Ie(s);return w.jsx(t2.Provider,{value:jIe,children:w.jsx(FIe,j({className:ke(l.root,i),as:o,ref:n,role:o===q8?null:"rowgroup",ownerState:s},a))})});function BIe(t){return We("MuiTableCell",t)}const zIe=Ve("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),UIe=["align","className","component","padding","scope","size","sortDirection","variant"],WIe=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,BIe,e)},VIe=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"?Ab(kt(t.palette.divider,1),.88):kb(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",[`&.${zIe.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})),sr=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,UIe),h=M.useContext(oie),p=M.useContext(t2),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=WIe(x);let _=null;return u&&(_=u==="asc"?"ascending":"descending"),w.jsx(VIe,j({as:g,ref:n,className:ke(b.root,o),"aria-sort":_,scope:v,ownerState:x},d))});function GIe(t){return We("MuiTableContainer",t)}Ve("MuiTableContainer",["root"]);const HIe=["className","component"],qIe=t=>{const{classes:e}=t;return Ue({root:["root"]},GIe,e)},XIe=we("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(t,e)=>e.root})({width:"100%",overflowX:"auto"}),aie=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTableContainer"}),{className:i,component:o="div"}=r,a=Ae(r,HIe),s=j({},r,{component:o}),l=qIe(s);return w.jsx(XIe,j({ref:n,as:o,className:ke(l.root,i),ownerState:s},a))});function QIe(t){return We("MuiTableHead",t)}Ve("MuiTableHead",["root"]);const YIe=["className","component"],KIe=t=>{const{classes:e}=t;return Ue({root:["root"]},QIe,e)},ZIe=we("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"table-header-group"}),JIe={variant:"head"},X8="thead",eDe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTableHead"}),{className:i,component:o=X8}=r,a=Ae(r,YIe),s=j({},r,{component:o}),l=KIe(s);return w.jsx(t2.Provider,{value:JIe,children:w.jsx(ZIe,j({as:o,className:ke(l.root,i),ref:n,role:o===X8?null:"rowgroup",ownerState:s},a))})});function tDe(t){return We("MuiToolbar",t)}Ve("MuiToolbar",["root","gutters","regular","dense"]);const nDe=["className","component","disableGutters","variant"],rDe=t=>{const{classes:e,disableGutters:n,variant:r}=t;return Ue({root:["root",!n&&"gutters",r]},tDe,e)},iDe=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),n2=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,nDe),c=j({},r,{component:o,disableGutters:a,variant:s}),u=rDe(c);return w.jsx(iDe,j({as:o,className:ke(u.root,i),ref:n,ownerState:c},l))}),oDe=ni(w.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),aDe=ni(w.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight");function sDe(t){return We("MuiTableRow",t)}const Q8=Ve("MuiTableRow",["root","selected","hover","head","footer"]),lDe=["className","component","hover","selected"],cDe=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"]},sDe,e)},uDe=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,[`&.${Q8.hover}:hover`]:{backgroundColor:(t.vars||t).palette.action.hover},[`&.${Q8.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)}}})),Y8="tr",vl=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTableRow"}),{className:i,component:o=Y8,hover:a=!1,selected:s=!1}=r,l=Ae(r,lDe),c=M.useContext(t2),u=j({},r,{component:o,hover:a,selected:s,head:c&&c.variant==="head",footer:c&&c.variant==="footer"}),f=cDe(u);return w.jsx(uDe,j({as:o,ref:n,className:ke(f.root,i),role:o===Y8?null:"row",ownerState:u},l))});function fDe(t){return(1+Math.sin(Math.PI*t-Math.PI/2))/2}function dDe(t,e,n,r={},i=()=>{}){const{ease:o=fDe,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 hDe=["onChange"],pDe={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function mDe(t){const{onChange:e}=t,n=Ae(t,hDe),r=M.useRef(),i=M.useRef(null),o=()=>{r.current=i.current.offsetHeight-i.current.clientHeight};return Hr(()=>{const a=Kv(()=>{const l=r.current;o(),l!==r.current&&e(r.current)}),s=cs(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:pDe,ref:i},n))}function gDe(t){return We("MuiTabScrollButton",t)}const vDe=Ve("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),yDe=["className","slots","slotProps","direction","orientation","disabled"],xDe=t=>{const{classes:e,orientation:n,disabled:r}=t;return Ue({root:["root",n,r&&"disabled"]},gDe,e)},bDe=we(fs,{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,[`&.${vDe.disabled}`]:{opacity:0}},t.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${t.isRtl?-90:90}deg)`}})),_De=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,yDe),f=A1(),d=j({isRtl:f},o),h=xDe(d),p=(r=s.StartScrollButtonIcon)!=null?r:oDe,m=(i=s.EndScrollButtonIcon)!=null?i:aDe,g=$r({elementType:p,externalSlotProps:l.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:d}),v=$r({elementType:m,externalSlotProps:l.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:d});return w.jsx(bDe,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))}))});function wDe(t){return We("MuiTabs",t)}const kC=Ve("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),SDe=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","slots","slotProps","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],K8=(t,e)=>t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:t.firstChild,Z8=(t,e)=>t===e?t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:t.lastChild,pS=(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}}},ODe=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"]},wDe,l)},CDe=we("div",{name:"MuiTabs",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${kC.scrollButtons}`]:e.scrollButtons},{[`& .${kC.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&&{[`& .${kC.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}})),TDe=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"})),EDe=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"})),PDe=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})),MDe=we(mDe)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),J8={},k5=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTabs"}),i=Go(),o=A1(),{"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=_De,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,SDe),R=k==="scrollable",T=g==="vertical",L=T?"scrollTop":"scrollLeft",z=T?"top":"left",B=T?"bottom":"right",U=T?"clientHeight":"clientWidth",W=T?"height":"width",$=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}),N=ODe($),D=$r({elementType:b.StartScrollButtonIcon,externalSlotProps:_.startScrollButtonIcon,ownerState:$}),A=$r({elementType:b.EndScrollButtonIcon,externalSlotProps:_.endScrollButtonIcon,ownerState:$}),[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 Te=Q.current;let Re;if(Te){const Le=Te.getBoundingClientRect();Re={clientWidth:Te.clientWidth,scrollLeft:Te.scrollLeft,scrollTop:Te.scrollTop,scrollLeftNormalized:LSe(Te,o?"rtl":"ltr"),scrollWidth:Te.scrollWidth,top:Le.top,bottom:Le.bottom,left:Le.left,right:Le.right}}let ae;if(Te&&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=_r(()=>{const{tabsMeta:Te,tabMeta:Re}=ee();let ae=0,Le;if(T)Le="top",Re&&Te&&(ae=Re.top-Te.top+Te.scrollTop);else if(Le=o?"right":"left",Re&&Te){const ze=o?Te.scrollLeftNormalized+Te.clientWidth-Te.scrollWidth:Te.scrollLeft;ae=(o?-1:1)*(Re[Le]-Te[Le]+ze)}const Ee={[Le]:ae,[W]:Re?Re[W]:0};if(isNaN(K[Le])||isNaN(K[W]))se(Ee);else{const ze=Math.abs(K[Le]-Ee[Le]),He=Math.abs(K[W]-Ee[W]);(ze>=1||He>=1)&&se(Ee)}}),ye=(Te,{animation:Re=!0}={})=>{Re?dDe(L,Q.current,Te,{duration:i.transitions.duration.standard}):Q.current[L]=Te},H=Te=>{let Re=Q.current[L];T?Re+=Te:(Re+=Te*(o?-1:1),Re*=o&&tre()==="reverse"?-1:1),ye(Re)},G=()=>{const Te=Q.current[U];let Re=0;const ae=Array.from(X.current.children);for(let Le=0;LeTe){Le===0&&(Re=Te);break}Re+=Ee[U]}return Re},ie=()=>{H(-1*G())},he=()=>{H(G())},_e=M.useCallback(Te=>{ce({overflow:null,scrollbarWidth:Te})},[]),oe=()=>{const Te={};Te.scrollbarSizeListener=R?w.jsx(MDe,{onChange:_e,className:ke(N.scrollableX,N.hideScrollbar)}):null;const ae=R&&(y==="auto"&&(te||pe)||y===!0);return Te.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(N.scrollButtons,O.className)})):null,Te.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(N.scrollButtons,O.className)})):null,Te},Z=_r(Te=>{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:Te})}}}),V=_r(()=>{R&&y!==!1&&ve(!re)});M.useEffect(()=>{const Te=Kv(()=>{Q.current&&ge()});let Re;const ae=ze=>{ze.forEach(He=>{He.removedNodes.forEach(bt=>{var Dt;(Dt=Re)==null||Dt.unobserve(bt)}),He.addedNodes.forEach(bt=>{var Dt;(Dt=Re)==null||Dt.observe(bt)})}),Te(),V()},Le=cs(Q.current);Le.addEventListener("resize",Te);let Ee;return typeof ResizeObserver<"u"&&(Re=new ResizeObserver(Te),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;Te.clear(),Le.removeEventListener("resize",Te),(ze=Ee)==null||ze.disconnect(),(He=Re)==null||He.disconnect()}},[ge,V]),M.useEffect(()=>{const Te=Array.from(X.current.children),Re=Te.length;if(typeof IntersectionObserver<"u"&&Re>0&&R&&y!==!1){const ae=Te[0],Le=Te[Re-1],Ee={root:Q.current,threshold:.99},ze=nn=>{J(!nn[0].isIntersecting)},He=new IntersectionObserver(ze,Ee);He.observe(ae);const bt=nn=>{be(!nn[0].isIntersecting)},Dt=new IntersectionObserver(bt,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(PDe,j({},S,{className:ke(N.indicator,S.className),ownerState:$,style:j({},K,S.style)}));let xe=0;const Me=M.Children.map(u,Te=>{if(!M.isValidElement(Te))return null;const Re=Te.props.value===void 0?xe:Te.props.value;le.set(Re,xe);const ae=Re===E;return xe+=1,M.cloneElement(Te,j({fullWidth:k==="fullWidth",indicator:ae&&!q&&de,selected:ae,selectionFollowsFocus:x,onChange:m,textColor:C,value:Re},xe===1&&E===!1&&!Te.props.tabIndex?{tabIndex:0}:{}))}),me=Te=>{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"),Te.key){case Ee:Te.preventDefault(),pS(Re,ae,Z8);break;case ze:Te.preventDefault(),pS(Re,ae,K8);break;case"Home":Te.preventDefault(),pS(Re,null,K8);break;case"End":Te.preventDefault(),pS(Re,null,Z8);break}},$e=oe();return w.jsxs(CDe,j({className:ke(N.root,f),ownerState:$,ref:n,as:d},P,{children:[$e.scrollButtonStart,$e.scrollbarSizeListener,w.jsxs(TDe,{className:N.scroller,ownerState:$,style:{overflow:F.overflow,[T?`margin${o?"Left":"Right"}`:"marginBottom"]:I?void 0:-F.scrollbarWidth},ref:Q,children:[w.jsx(EDe,{"aria-label":a,"aria-labelledby":s,"aria-orientation":g==="vertical"?"vertical":null,className:N.flexContainer,ownerState:$,onKeyDown:me,ref:X,role:"tablist",children:Me}),q&&de]}),$e.scrollButtonEnd]}))});function kDe(t){return We("MuiTextField",t)}Ve("MuiTextField",["root"]);const ADe=["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"],RDe={standard:yd,filled:S5,outlined:C5},IDe=t=>{const{classes:e}=t;return Ue({root:["root"]},kDe,e)},DDe=we(ty,{name:"MuiTextField",slot:"Root",overridesResolver:(t,e)=>e.root})({}),cr=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:U,variant:W="outlined"}=r,$=Ae(r,ADe),N=j({},r,{autoFocus:o,color:l,disabled:u,error:f,fullWidth:h,multiline:O,required:R,select:L,variant:W}),D=IDe(N),A={};W==="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=pd(m),Y=p&&q?`${q}-helper-text`:void 0,K=b&&q?`${q}-label`:void 0,se=RDe[W],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:U,id:q,inputRef:x,onBlur:E,onChange:k,onFocus:I,placeholder:P,inputProps:v},A,y));return w.jsxs(DDe,j({className:ke(D.root,s),disabled:u,error:f,fullWidth:h,ref:n,required:R,color:l,variant:W,ownerState:N},$,{children:[b!=null&&b!==""&&w.jsx(ny,j({htmlFor:q,id:K},g,{children:b})),L?w.jsx(xd,j({"aria-describedby":Y,id:q,labelId:K,value:U,input:te},z,{children:a})):te,p&&w.jsx(Gre,j({id:Y},d,{children:p}))]}))});function LDe(t){return We("MuiToggleButton",t)}const Jm=Ve("MuiToggleButton",["root","disabled","selected","standard","primary","secondary","sizeSmall","sizeMedium","sizeLarge","fullWidth"]),sie=M.createContext({}),lie=M.createContext(void 0);function NDe(t,e){return e===void 0||t===void 0?!1:Array.isArray(e)?e.indexOf(t)>=0:t===e}const $De=["value"],FDe=["children","className","color","disabled","disableFocusRipple","fullWidth","onChange","onClick","selected","size","value"],jDe=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,LDe,e)},BDe=we(fs,{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%"},{[`&.${Jm.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})`:Hc(t.palette.text.primary,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Jm.selected}`]:{color:n,backgroundColor:t.vars?`rgba(${r} / ${t.vars.palette.action.selectedOpacity})`:Hc(n,t.palette.action.selectedOpacity),"&:hover":{backgroundColor:t.vars?`rgba(${r} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:Hc(n,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${r} / ${t.vars.palette.action.selectedOpacity})`:Hc(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)})}),Pn=M.forwardRef(function(e,n){const r=M.useContext(sie),{value:i}=r,o=Ae(r,$De),a=M.useContext(lie),s=kM(j({},o,{selected:NDe(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,FDe),_=j({},l,{color:f,disabled:d,disableFocusRipple:h,fullWidth:p,size:y}),S=jDe(_),O=E=>{g&&(g(E,x),E.defaultPrevented)||m&&m(E,x)},C=a||"";return w.jsx(BDe,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}))});function zDe(t){return We("MuiToggleButtonGroup",t)}const ar=Ve("MuiToggleButtonGroup",["root","selected","horizontal","vertical","disabled","grouped","groupedHorizontal","groupedVertical","fullWidth","firstButton","lastButton","middleButton"]),UDe=["children","className","color","disabled","exclusive","fullWidth","onChange","orientation","size","value"],WDe=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,zDe,e)},VDe=we("div",{name:"MuiToggleButtonGroup",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${ar.grouped}`]:e.grouped},{[`& .${ar.grouped}`]:e[`grouped${De(n.orientation)}`]},{[`& .${ar.firstButton}`]:e.firstButton},{[`& .${ar.lastButton}`]:e.lastButton},{[`& .${ar.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%"},{[`& .${ar.grouped}`]:j({},t.orientation==="horizontal"?{[`&.${ar.selected} + .${ar.grouped}.${ar.selected}`]:{borderLeft:0,marginLeft:0}}:{[`&.${ar.selected} + .${ar.grouped}.${ar.selected}`]:{borderTop:0,marginTop:0}})},t.orientation==="horizontal"?{[`& .${ar.firstButton},& .${ar.middleButton}`]:{borderTopRightRadius:0,borderBottomRightRadius:0},[`& .${ar.lastButton},& .${ar.middleButton}`]:{marginLeft:-1,borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0}}:{[`& .${ar.firstButton},& .${ar.middleButton}`]:{borderBottomLeftRadius:0,borderBottomRightRadius:0},[`& .${ar.lastButton},& .${ar.middleButton}`]:{marginTop:-1,borderTop:"1px solid transparent",borderTopLeftRadius:0,borderTopRightRadius:0}},t.orientation==="horizontal"?{[`& .${ar.lastButton}.${Jm.disabled},& .${ar.middleButton}.${Jm.disabled}`]:{borderLeft:"1px solid transparent"}}:{[`& .${ar.lastButton}.${Jm.disabled},& .${ar.middleButton}.${Jm.disabled}`]:{borderTop:"1px solid transparent"}})),iy=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,UDe),m=j({},r,{disabled:s,fullWidth:c,orientation:f,size:d}),g=WDe(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=NSe(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(VDe,j({role:"group",className:ke(g.root,o),ref:n,ownerState:m},p,{children:w.jsx(sie.Provider,{value:x,children:b.map((O,C)=>w.jsx(lie.Provider,{value:S(C),children:O},C))})}))}),GDe="default",HDe={id:"local",name:"Local Server",url:"http://localhost:8080"},qDe={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},mS={name:GDe,server:HDe,branding:qDe};function XDe(){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 r2=XDe();console.log("baseUrl = ",r2.href);function cie(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 QDe={amber:mne,blue:rf,blueGrey:J_e,brown:gne,cyan:fne,deepOrange:Dh,deepPurple:K_e,green:Lc,grey:vne,indigo:une,lightBlue:of,lightGreen:Z_e,lime:hne,orange:oh,pink:cne,purple:nf,red:tf,teal:dne,yellow:pne};function eG(t,e){const n=t[e];let r=null;if(typeof n=="string"?(r=QDe[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 YDe(t,e,n){const r=t[e];typeof r=="string"&&(t[e]=cie(r2.href,n,r))}function KDe(t,e){return t={...t},eG(t,"primaryColor"),eG(t,"secondaryColor"),YDe(t,"logoImage",e),t}function En(t){return typeof t=="number"}function Mp(t){return typeof t=="string"}function ZDe(t){return typeof t=="function"}function tG(t){return t!==null&&typeof t=="object"&&t.constructor===Object}const hf=new URLSearchParams(window.location.search),$s=class $s{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=hf.get("configPath")||"config";const n=await this.loadRawConfig(e);n===mS&&(e="");const r=n.name||"default",i=this.getAuthConfig(n),o=this.getServerConfig(n),a=parseInt(hf.get("compact")||"0")!==0;let s=KDe({...mS.branding,...n.branding,compact:a||n.branding.compact},e);return s=rG(s,"allowUserVariables"),s=rG(s,"allow3D"),$s._instance=new $s(r,o,s,i),s.windowTitle&&this.changeWindowTitle(s.windowTitle),s.windowIcon&&this.changeWindowIcon(s.windowIcon),$s._instance}static getAuthConfig(e){let n=e.authClient&&{...e.authClient};const r=$s.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={...mS.server,...e.server},r=$s.getApiServerFromEnv();return n.id=hf.get("serverId")||r.id||n.id,n.name=hf.get("serverName")||r.name||n.name,n.url=hf.get("serverUrl")||r.url||n.url,n}static async loadRawConfig(e){let n=null,r=null;const i=cie(r2.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=mS),n}static get instance(){return $s.assertConfigLoaded(),$s._instance}static assertConfigLoaded(){if(!$s._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(){return{authority:void 0,clientId:void 0,audience:void 0}}static getApiServerFromEnv(){return{id:void 0,name:void 0,url:void 0}}};Yt($s,"_instance");let Kt=$s;const A5=[["red",tf],["yellow",pne],["blue",rf],["pink",cne],["lightBlue",of],["green",Lc],["orange",oh],["lime",hne],["purple",nf],["indigo",une],["cyan",fne],["brown",gne],["teal",dne]],JDe=(()=>{const t={};return A5.forEach(([e,n])=>{t[e]=n}),t})(),nG=A5.map(([t,e])=>t);function eLe(t){return t==="light"?800:400}function tp(t){return nG[t%nG.length]}function uie(t,e){const n=eLe(e);return JDe[t][n]}function R5(t){return En(t)||(t=Kt.instance.branding.polygonFillOpacity),En(t)?t:.25}const tLe={Mapbox:{param:"access_token",token:"pk.eyJ1IjoiZm9ybWFuIiwiYSI6ImNrM2JranV0bDBtenczb2szZG84djh6bWUifQ.q0UKwf4CWt5fcQwIDwF8Bg"}};function nLe(t){return tLe[t]}function rG(t,e){const n=hf.get(e),r=n?!!parseInt(n):!!t[e];return{...t,[e]:r}}function lx(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 fie={exports:{}};const rLe={},iLe=Object.freeze(Object.defineProperty({__proto__:null,default:rLe},Symbol.toStringTag,{value:"Module"})),oLe=Ea(iLe);(function(t,e){(function(n,r){t.exports=r()})(Zn,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 Zn<"u"&&Zn.crypto&&(o=Zn.crypto),!o&&typeof lx=="function")try{o=oLe}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],U=L+T;O=S,S=_,_=b,b=x+B|0,x=y,y=v,v=g,g=B+U|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})})(die);var sLe=die.exports;const lLe=$t(sLe);var hie={exports:{}};(function(t,e){(function(n,r){t.exports=r(i2)})(Zn,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})})(hie);var cLe=hie.exports;const iG=$t(cLe);var pie={exports:{}};(function(t,e){(function(n,r){t.exports=r(i2)})(Zn,function(n){return n.enc.Utf8})})(pie);var uLe=pie.exports;const fLe=$t(uLe);function WL(t){this.message=t}WL.prototype=new Error,WL.prototype.name="InvalidCharacterError";var oG=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new WL("'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 dLe(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(oG(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 oG(e)}}function IT(t){this.message=t}function hLe(t,e){if(typeof t!="string")throw new IT("Invalid token specified");var n=(e=e||{}).header===!0?0:1;try{return JSON.parse(dLe(t.split(".")[n]))}catch(r){throw new IT("Invalid token specified: "+r.message)}}IT.prototype=new Error,IT.prototype.name="InvalidTokenError";var pLe={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}},pl,ml,DT=(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))(DT||{});(t=>{function e(){pl=3,ml=pLe}t.reset=e;function n(i){if(!(0<=i&&i<=4))throw new Error("Invalid log level");pl=i}t.setLevel=n;function r(i){ml=i}t.setLogger=r})(DT||(DT={}));var It=class{constructor(t){this._name=t}debug(...t){pl>=4&&ml.debug(It._format(this._name,this._method),...t)}info(...t){pl>=3&&ml.info(It._format(this._name,this._method),...t)}warn(...t){pl>=2&&ml.warn(It._format(this._name,this._method),...t)}error(...t){pl>=1&&ml.error(It._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 It(`${t}.${e}`);return n.debug("begin"),n}static _format(t,e){const n=`[${t}]`;return e?`${n} ${e}:`:n}static debug(t,...e){pl>=4&&ml.debug(It._format(t),...e)}static info(t,...e){pl>=3&&ml.info(It._format(t),...e)}static warn(t,...e){pl>=2&&ml.warn(It._format(t),...e)}static error(t,...e){pl>=1&&ml.error(It._format(t),...e)}};DT.reset();var mLe="10000000-1000-4000-8000-100000000000",Al=class{static _randomWord(){return aLe.lib.WordArray.random(1).words[0]}static generateUUIDv4(){return mLe.replace(/[018]/g,e=>(+e^Al._randomWord()&15>>+e/4).toString(16)).replace(/-/g,"")}static generateCodeVerifier(){return Al.generateUUIDv4()+Al.generateUUIDv4()+Al.generateUUIDv4()}static generateCodeChallenge(t){try{const e=lLe(t);return iG.stringify(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(e){throw It.error("CryptoUtils.generateCodeChallenge",e),e}}static generateBasicAuth(t,e){const n=fLe.parse([t,e].join(":"));return iG.stringify(n)}},af=class{constructor(t){this._name=t,this._logger=new It(`Event('${this._name}')`),this._callbacks=[]}addHandler(t){return this._callbacks.push(t),()=>this.removeHandler(t)}removeHandler(t){const e=this._callbacks.lastIndexOf(t);e>=0&&this._callbacks.splice(e,1)}raise(...t){this._logger.debug("raise:",...t);for(const e of this._callbacks)e(...t)}},VL=class{static decode(t){try{return hLe(t)}catch(e){throw It.error("JwtUtils.decode",e),e}}},aG=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(",")}},ns=class extends af{constructor(){super(...arguments),this._logger=new It(`Timer('${this._name}')`),this._timerHandle=null,this._expiration=0,this._callback=()=>{const t=this._expiration-ns.getEpochTime();this._logger.debug("timer completes in",t),this._expiration<=ns.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=ns.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)}},GL=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))}},np=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 It.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}},I5=class extends Error{constructor(t){super(t),this.name="ErrorTimeout"}},gLe=class{constructor(t){this._logger=new It("AccessTokenEvents"),this._expiringTimer=new ns("Access token expiring"),this._expiredTimer=new ns("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)}},vLe=class{constructor(t,e,n,r,i){this._callback=t,this._client_id=e,this._intervalInSeconds=r,this._stopOnError=i,this._logger=new It("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)}},mie=class{constructor(){this._logger=new It("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]}},D5=class{constructor(t=[],e=null,n={}){this._jwtHandler=e,this._extraHeaders=n,this._logger=new It("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 I5("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 np(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 np(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)})}},yLe=class{constructor(t){this._settings=t,this._logger=new It("MetadataService"),this._signingKeys=null,this._metadata=null,this._metadataUrl=this._settings.metadataUrl,this._jsonService=new D5(["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}},gie=class{constructor({prefix:t="oidc.",store:e=localStorage}={}){this._logger=new It("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=VL.decode(n);return r.debug("JWT decoding successful"),i}catch(i){throw r.error("Error parsing JWT response"),i}},this._jsonService=new D5(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}},yie=class{constructor(t,e){this._settings=t,this._metadataService=e,this._logger=new It("TokenClient"),this._jsonService=new D5(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=Al.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=Al.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))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=Al.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")}},TLe=class{constructor(t,e,n){this._settings=t,this._metadataService=e,this._claimsService=n,this._logger=new It("ResponseValidator"),this._userInfoService=new CLe(this._settings,this._metadataService),this._tokenClient=new yie(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&&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 np(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,(n=t.scope)!=null||(t.scope=e.scope),t.error)throw r.warn("Response was error",t.error),new np(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=VL.decode((n=t.id_token)!=null?n:"");if(i.sub||r.throw(new Error("ID Token is missing a subject claim")),e){const o=VL.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}},tv=class{constructor(t){this.id=t.id||Al.generateUUIDv4(),this.data=t.data,t.created&&t.created>0?this.created=t.created:this.created=ns.getEpochTime(),this.request_type=t.request_type}toStorageString(){return new It("State").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type})}static fromStorageString(t){return It.createStatic("State","fromStorageString"),new tv(JSON.parse(t))}static async clearStaleState(t,e){const n=It.createStatic("State","clearStaleState"),r=ns.getEpochTime()-e,i=await t.getAllKeys();n.debug("got keys",i);for(let o=0;ov.searchParams.append("resource",x));for(const[y,x]of Object.entries({response_mode:s,...g,...h}))x!=null&&v.searchParams.append(y,x.toString());this.url=v.href}},PLe="openid",RA=class{constructor(t){this.access_token="",this.token_type="",this.profile={},this.state=t.get("state"),this.session_state=t.get("session_state"),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-ns.getEpochTime()}set expires_in(t){typeof t=="string"&&(t=Number(t)),t!==void 0&&t>=0&&(this.expires_at=Math.floor(t)+ns.getEpochTime())}get isOpenId(){var t;return((t=this.scope)==null?void 0:t.split(" ").includes(PLe))||!!this.id_token}},MLe=class{constructor({url:t,state_data:e,id_token_hint:n,post_logout_redirect_uri:r,extraQueryParams:i,request_type:o}){if(this._logger=new It("SignoutRequest"),!t)throw this._logger.error("ctor: No url passed"),new Error("url");const a=new URL(t);n&&a.searchParams.append("id_token_hint",n),r&&(a.searchParams.append("post_logout_redirect_uri",r),e&&(this.state=new tv({data:e,request_type:o}),a.searchParams.append("state",this.state.id)));for(const[s,l]of Object.entries({...i}))l!=null&&a.searchParams.append(s,l.toString());this.url=a.href}},kLe=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")}},ALe=["nbf","jti","auth_time","nonce","acr","amr","azp","at_hash"],RLe=["sub","iss","aud","exp","iat"],ILe=class{constructor(t){this._settings=t,this._logger=new It("ClaimsService")}filterProtocolClaims(t){const e={...t};if(this._settings.filterProtocolClaims){let n;Array.isArray(this._settings.filterProtocolClaims)?n=this._settings.filterProtocolClaims:n=ALe;for(const r of n)RLe.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?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]):n[r]=o}return n}},DLe=class{constructor(t){this._logger=new It("OidcClient"),this.settings=new vie(t),this.metadataService=new yLe(this.settings),this._claimsService=new ILe(this.settings),this._validator=new TLe(this.settings,this.metadataService,this._claimsService),this._tokenClient=new yie(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,response_type:l=this.settings.response_type,scope:c=this.settings.scope,redirect_uri:u=this.settings.redirect_uri,prompt:f=this.settings.prompt,display:d=this.settings.display,max_age:h=this.settings.max_age,ui_locales:p=this.settings.ui_locales,acr_values:m=this.settings.acr_values,resource:g=this.settings.resource,response_mode:v=this.settings.response_mode,extraQueryParams:y=this.settings.extraQueryParams,extraTokenParams:x=this.settings.extraTokenParams}){const b=this._logger.create("createSigninRequest");if(l!=="code")throw new Error("Only the Authorization Code flow (with PKCE) is supported");const _=await this.metadataService.getAuthorizationEndpoint();b.debug("Received authorization endpoint",_);const S=new ELe({url:_,authority:this.settings.authority,client_id:this.settings.client_id,redirect_uri:u,response_type:l,scope:c,state_data:t,prompt:f,display:d,max_age:h,ui_locales:p,id_token_hint:i,login_hint:o,acr_values:m,resource:g,request:e,request_uri:n,extraQueryParams:y,extraTokenParams:x,request_type:r,response_mode:v,client_secret:this.settings.client_secret,skipUserInfo:a,nonce:s,disablePKCE:this.settings.disablePKCE});await this.clearStaleState();const O=S.state;return await this.settings.stateStore.set(O.id,O.toStorageString()),S}async readSigninResponseState(t,e=!1){const n=this._logger.create("readSigninResponseState"),r=new RA(GL.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:L5.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 RA(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,scope:i,timeoutInSeconds:e}),a=new RA(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,request_type:n,post_logout_redirect_uri:r=this.settings.post_logout_redirect_uri,extraQueryParams:i=this.settings.extraQueryParams}={}){const o=this._logger.create("createSignoutRequest"),a=await this.metadataService.getEndSessionEndpoint();if(!a)throw o.throw(new Error("No end session endpoint")),null;o.debug("Received end session endpoint",a);const s=new MLe({url:a,id_token_hint:e,post_logout_redirect_uri:r,state_data:t,extraQueryParams:i,request_type:n});await this.clearStaleState();const l=s.state;return l&&(o.debug("Signout request has state to persist"),await this.settings.stateStore.set(l.id,l.toStorageString())),s}async readSignoutResponseState(t,e=!1){const n=this._logger.create("readSignoutResponseState"),r=new kLe(GL.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 np(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:tv.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"),tv.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})}},LLe=class{constructor(t){this._userManager=t,this._logger=new It("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 vLe(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)}}}},AC=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}get expires_in(){if(this.expires_at!==void 0)return this.expires_at-ns.getEpochTime()}set expires_in(t){t!==void 0&&(this.expires_at=Math.floor(t)+ns.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 It("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 It.createStatic("User","fromStorageString"),new AC(JSON.parse(t))}},sG="oidc-client",xie=class{constructor(){this._abort=new af("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)!==sG)){try{const f=GL.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:sG,url:e,keepOpen:n},r)}},bie={location:!1,toolbar:!1,height:640},_ie="_blank",NLe=60,$Le=2,wie=10,FLe=class extends vie{constructor(t){const{popup_redirect_uri:e=t.redirect_uri,popup_post_logout_redirect_uri:n=t.post_logout_redirect_uri,popupWindowFeatures:r=bie,popupWindowTarget:i=_ie,redirectMethod:o="assign",redirectTarget:a="self",iframeNotifyParentOrigin:s=t.iframeNotifyParentOrigin,iframeScriptOrigin:l=t.iframeScriptOrigin,silent_redirect_uri:c=t.redirect_uri,silentRequestTimeoutInSeconds:u=wie,automaticSilentRenew:f=!0,validateSubOnSilentRenew:d=!0,includeIdTokenInSilentRenew:h=!1,monitorSession:p=!1,monitorAnonymousSession:m=!1,checkSessionIntervalInSeconds:g=$Le,query_status_response_type:v="code",stopCheckSessionOnError:y=!0,revokeTokenTypes:x=["access_token","refresh_token"],revokeTokensOnSignout:b=!1,includeIdTokenInSilentSignout:_=!1,accessTokenExpiringNotificationTimeInSeconds:S=NLe,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 mie;this.userStore=new gie({store:C})}}},HL=class extends xie{constructor({silentRequestTimeoutInSeconds:t=wie}){super(),this._logger=new It("IFrameWindow"),this._timeoutInSeconds=t,this._frame=HL.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",t.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),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 I5("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)}},jLe=class{constructor(t){this._settings=t,this._logger=new It("IFrameNavigator")}async prepare({silentRequestTimeoutInSeconds:t=this._settings.silentRequestTimeoutInSeconds}){return new HL({silentRequestTimeoutInSeconds:t})}async callback(t){this._logger.create("callback"),HL.notifyParent(t,this._settings.iframeNotifyParentOrigin)}},BLe=500,lG=class extends xie{constructor({popupWindowTarget:t=_ie,popupWindowFeatures:e={}}){super(),this._logger=new It("PopupWindow");const n=aG.center({...bie,...e});this._window=window.open(void 0,t,aG.serialize(n))}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"))},BLe);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)}},zLe=class{constructor(t){this._settings=t,this._logger=new It("PopupNavigator")}async prepare({popupWindowFeatures:t=this._settings.popupWindowFeatures,popupWindowTarget:e=this._settings.popupWindowTarget}){return new lG({popupWindowFeatures:t,popupWindowTarget:e})}async callback(t,e=!1){this._logger.create("callback"),lG.notifyOpener(t,e)}},ULe=class{constructor(t){this._settings=t,this._logger=new It("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()}}}},WLe=class extends gLe{constructor(t){super({expiringNotificationTimeInSeconds:t.accessTokenExpiringNotificationTimeInSeconds}),this._logger=new It("UserManagerEvents"),this._userLoaded=new af("User loaded"),this._userUnloaded=new af("User unloaded"),this._silentRenewError=new af("Silent renew error"),this._userSignedIn=new af("User signed in"),this._userSignedOut=new af("User signed out"),this._userSessionChanged=new af("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()}},VLe=class{constructor(t){this._userManager=t,this._logger=new It("SilentRenewService"),this._isStarted=!1,this._retryTimer=new ns("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 I5){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)}},GLe=class{constructor(t){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.data=t.state}},HLe=class{constructor(t){this._logger=new It("UserManager"),this.settings=new FLe(t),this._client=new DLe(t),this._redirectNavigator=new ULe(this.settings),this._popupNavigator=new zLe(this.settings),this._iframeNavigator=new jLe(this.settings),this._events=new WLe(this.settings),this._silentRenewService=new VLe(this),this.settings.automaticSilentRenew&&this.startSilentRenew(),this._sessionMonitor=null,this.settings.monitorSession&&(this._sessionMonitor=new LLe(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,e),n.info("success")}async signinSilent(t={}){var e;const n=this._logger.create("signinSilent"),{silentRequestTimeoutInSeconds:r,...i}=t;let o=await this._loadUser();if(o!=null&&o.refresh_token){n.debug("using refresh token");const c=new GLe(o);return await this._useRefreshToken(c)}const a=this.settings.silent_redirect_uri;a||n.throw(new Error("No silent_redirect_uri configured"));let s;o&&this.settings.validateSubOnSilentRenew&&(n.debug("subject prior to silent renew:",o.profile.sub),s=o.profile.sub);const l=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:r});return o=await this._signin({request_type:"si:s",redirect_uri:a,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?o==null?void 0:o.id_token:void 0,...i},l,s),o&&((e=o.profile)!=null&&e.sub?n.info("success, signed in subject",o.profile.sub):n.info("no subject")),o}async _useRefreshToken(t){const e=await this._client.useRefreshToken({state:t,timeoutInSeconds:this.settings.silentRequestTimeoutInSeconds}),n=new AC({...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 np)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 AC(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 np({...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,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})}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"),AC.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()}},N5=ue.createContext(void 0);N5.displayName="AuthContext";var qLe={isLoading:!0,isAuthenticated:!1},XLe=(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}`)}}},QLe=(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")))},YLe=t=>e=>e instanceof Error?e:new Error(t),KLe=YLe("Login failed"),ZLe=["clearStaleState","querySessionStatus","revokeTokens","startSilentRenew","stopSilentRenew"],JLe=["signinPopup","signinSilent","signinRedirect","signoutPopup","signoutRedirect","signoutSilent"],IA=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.`)},e3e=typeof window>"u"?null:HLe,t3e=t=>{const{children:e,onSigninCallback:n,skipSigninCallback:r,onRemoveUser:i,onSignoutRedirect:o,onSignoutPopup:a,implementation:s=e3e,userManager:l,...c}=t,[u]=M.useState(()=>l??(s?new s(c):{settings:c})),[f,d]=M.useReducer(XLe,qLe),h=M.useMemo(()=>Object.assign({settings:u.settings,events:u.events},Object.fromEntries(ZLe.map(x=>{var b,_;return[x,(_=(b=u[x])==null?void 0:b.bind(u))!=null?_:IA(x)]})),Object.fromEntries(JLe.map(x=>[x,u[x]?async(...b)=>{d({type:"NAVIGATOR_INIT",method:x});try{return await u[x](...b)}finally{d({type:"NAVIGATOR_CLOSE"})}}:IA(x)]))),[u]),p=M.useRef(!1);M.useEffect(()=>{!u||p.current||(p.current=!0,(async()=>{let x=null;try{QLe()&&!r&&(x=await u.signinCallback(),n&&n(x)),x=x||await u.getUser(),d({type:"INITIALISED",user:x})}catch(b){d({type:"ERROR",error:KLe(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):IA("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(N5.Provider,{value:{...f,...h,removeUser:m,signoutRedirect:g,signoutPopup:v,signoutSilent:y}},e)},n3e=()=>{const t=ue.useContext(N5);if(!t)throw new Error("AuthProvider context is undefined, please verify you are calling useAuth() as child of a component.");return t};const cG="color:green;font-weight:bold;",r3e="color:blue;font-weight:bold;";class i3e{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=uG(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=uG(e),i=this._content[r];let o;return i?(o=i[this._locale],o||(console.debug(`missing translation of phrase %c${e}`,cG,` for locale %c${this._locale}`,r3e),o=e)):(console.debug(`missing translation for phrase %c${e}`,cG),o=e),n&&Object.keys(n).forEach(a=>{o=o.replace("${"+a+"}",`${n[a]}`)}),o}}const o3e=()=>{let t;return navigator.languages&&navigator.languages.length>0?t=navigator.languages[0]:t=navigator.language||navigator.userLanguage||navigator.browserLanguage||"en",t.split("-")[0]},uG=t=>t.toLowerCase(),a3e={en:"English",de:"Deutsch",se:"Svenska"},s3e=[{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:"Add Statistics",de:"Statistiken hinzufügen",se:"Lägg till statistik"},{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:"Style place",de:"Ort stylen",se:"Styla 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:"First time step",de:"Erster Zeitschritt",se:"Första tidssteg"},{en:"Last time step",de:"Letzter Zeitschritt",se:"Sista tidssteg"},{en:"Previous time step",de:"Vorheriger Zeitschritt",se:"Föregående tidssteg"},{en:"Next time step",de:"Nächster Zeitschritt",se:"Nästa tidssteg"},{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"}],l3e={languages:a3e,dictionary:s3e},fe=new i3e(l3e);fe.locale=o3e();class Sie 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 c3e=({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=r2.href;return w.jsx(Sie,{children:w.jsx(t3e,{...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 $5={},DA={};const u3e=Ea(uCe);var fG;function pt(){return fG||(fG=1,function(t){"use client";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return e.createSvgIcon}});var e=u3e}(DA)),DA}var f3e=ft;Object.defineProperty($5,"__esModule",{value:!0});var F5=$5.default=void 0,d3e=f3e(pt()),h3e=w;F5=$5.default=(0,d3e.default)((0,h3e.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 j5={},p3e=ft;Object.defineProperty(j5,"__esModule",{value:!0});var B5=j5.default=void 0,m3e=p3e(pt()),g3e=w;B5=j5.default=(0,m3e.default)((0,g3e.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 z5={},v3e=ft;Object.defineProperty(z5,"__esModule",{value:!0});var U5=z5.default=void 0,y3e=v3e(pt()),x3e=w;U5=z5.default=(0,y3e.default)((0,x3e.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 W5={},b3e=ft;Object.defineProperty(W5,"__esModule",{value:!0});var Oie=W5.default=void 0,_3e=b3e(pt()),dG=w;Oie=W5.default=(0,_3e.default)([(0,dG.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,dG.jsx)("circle",{cx:"12",cy:"12",r:"3"},"1")],"Policy");var V5={},w3e=ft;Object.defineProperty(V5,"__esModule",{value:!0});var G5=V5.default=void 0,S3e=w3e(pt()),O3e=w;G5=V5.default=(0,S3e.default)((0,O3e.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 ac=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 nv={PROPERTYCHANGE:"propertychange"};var H5=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function C3e(t,e,n){for(var r,i,o=rp,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 rp(t,e){return t>e?1:t0){for(i=1;i0?i-1:i:t[i-1]-e0||a===0)})}function Fh(){return!0}function $1(){return!1}function ip(){}function P3e(t){var e=!1,n,r,i;return function(){var o=Array.prototype.slice.call(arguments);return(!e||this!==i||!kp(o,r))&&(e=!0,i=this,r=o,n=t.apply(this,arguments)),n}}var ur=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]=ip,++this.pendingRemovals_[n]):(i.splice(o,1),i.length===0&&delete this.listeners_[n]))}},e}(H5);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 LT(t,e,n,r){return rn(t,e,n,r,!0)}function nr(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),F1(t))}var k3e=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)}}(),j1=function(t){k3e(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||Jf.match(/cpu (os|iphone os) 15_4 like mac os x/));var j3e=Jf.indexOf("webkit")!==-1&&Jf.indexOf("edge")==-1,B3e=Jf.indexOf("macintosh")!==-1,Pie=typeof devicePixelRatio<"u"?devicePixelRatio:1,o2=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,z3e=typeof Image<"u"&&Image.prototype.decode,Mie=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 Hl(){return[1,0,0,1,0,0]}function U3e(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 W3e(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 Cr(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 V3e(t,e,n){return U3e(t,e,0,0,n,0,0)}function hu(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 X5(t,e){var n=G3e(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 G3e(t){return t[0]*t[3]-t[1]*t[2]}var pG;function kie(t){var e="matrix("+t.join(", ")+")";if(o2)return e;var n=pG||(pG=document.createElement("div"));return n.style.transform=e,n.style.transform}const si={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function mG(t){for(var e=Oa(),n=0,r=t.length;ni&&(l=l|si.RIGHT),so&&(l=l|si.ABOVE),l===si.UNKNOWN&&(l=si.INTERSECTING),l}function Oa(){return[1/0,1/0,-1/0,-1/0]}function Zs(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 z1(t){return Zs(1/0,1/0,-1/0,-1/0,t)}function q3e(t,e){var n=t[0],r=t[1];return Zs(n,r,n,r,e)}function Rie(t,e,n,r,i){var o=z1(i);return Die(o,t,e,n,r)}function Fb(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function Iie(t,e){return e[0]t[2]&&(t[2]=e[2]),e[1]t[3]&&(t[3]=e[3]),t}function Vx(t,e){e[0]t[2]&&(t[2]=e[0]),e[1]t[3]&&(t[3]=e[1])}function Die(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 eB(t){return t[2]=a&&m<=l),!r&&o&si.RIGHT&&!(i&si.RIGHT)&&(g=h-(d-l)*p,r=g>=s&&g<=c),!r&&o&si.BELOW&&!(i&si.BELOW)&&(m=d-(h-s)/p,r=m>=a&&m<=l),!r&&o&si.LEFT&&!(i&si.LEFT)&&(g=h-(d-a)*p,r=g>=s&&g<=c)}return r}function Z3e(t,e,n,r){var i=[],o;i=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]],e(i,i,2);for(var a=[],s=[],o=0,l=i.length;o=n[2])){var i=Kn(n),o=Math.floor((r[0]-n[0])/i),a=o*i;t[0]-=a,t[2]-=a}return t}function J3e(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]]];Lie(t,e);var r=Kn(n);if(Kn(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 Nie=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_||Ks[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}();function Br(t,e,n){return Math.min(Math.max(t,e),n)}var eNe=function(){var t;return"cosh"in Math?t=Math.cosh:t=function(e){var n=Math.exp(e);return(n+1/n)/2},t}(),tNe=function(){var t;return"log2"in Math?t=Math.log2:t=function(e){return Math.log(e)*Math.LOG2E},t}();function nNe(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 jh(t,e,n,r)}function jh(t,e,n,r){var i=n-t,o=r-e;return i*i+o*o}function rNe(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 RC(t){return t*Math.PI/180}function jf(t,e){var n=t%e;return n*e<0?n+e:n}function Nc(t,e,n){return t+n*(e-t)}function $ie(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n}function gS(t,e){return Math.floor($ie(t,e))}function vS(t,e){return Math.ceil($ie(t,e))}var iNe=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)}}(),U1=6378137,tg=Math.PI*U1,oNe=[-tg,-tg,tg,tg],aNe=[-180,-85,180,85],yS=U1*Math.log(Math.tan(Math.PI/2)),em=function(t){iNe(e,t);function e(n){return t.call(this,{code:n,units:ci.METERS,extent:oNe,global:!0,worldExtent:aNe,getPointResolution:function(r,i){return r/eNe(i[1]/U1)}})||this}return e}(Nie),gG=[new em("EPSG:3857"),new em("EPSG:102100"),new em("EPSG:102113"),new em("EPSG:900913"),new em("http://www.opengis.net/def/crs/EPSG/0/3857"),new em("http://www.opengis.net/gml/srs/epsg.xml#3857")];function sNe(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;ayS?s=yS:s<-yS&&(s=-yS),o[a+1]=s}return o}function lNe(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 gNe(t,e){return t[0]+=+e[0],t[1]+=+e[1],t}function $T(t,e){for(var n=!0,r=t.length-1;r>=0;--r)if(t[r]!=e[r]){n=!1;break}return n}function tB(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 vNe(t,e){return t[0]*=e,t[1]*=e,t}function yNe(t,e){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function Fie(t,e){if(e.canWrapX()){var n=Kn(e.getExtent()),r=xNe(t,e,n);r&&(t[0]-=r*n)}return t}function xNe(t,e,n){var r=e.getExtent(),i=0;if(e.canWrapX()&&(t[0]r[2])){var o=n||Kn(r);i=Math.floor((t[0]-r[0])/o)}return i}var bNe=63710088e-1;function xG(t,e,n){var r=bNe,i=RC(t[1]),o=RC(e[1]),a=(o-i)/2,s=RC(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 ZL=!0;function _Ne(t){var e=!0;ZL=!e}function nB(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&&(ZL=!1,console.warn("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),t}function zie(t,e){return t}function xh(t,e){return t}function ENe(){bG(gG),bG(yG),ONe(yG,gG,sNe,lNe)}ENe();function Bh(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 sB(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 Hie(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 dB(t,e,n,r,i,o){if(n.length===0||!bh(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:qie(t,e,n,r,function(a,s){return K3e(i,a,s)}):!1}function GNe(t,e,n,r,i){for(var o=0,a=n.length;ob&&(c=(u+f)/2,dB(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 JNe(t,e,n,r,i){for(var o=[],a=0,s=n.length;a0}function noe(t,e,n,r,i){for(var o=0,a=n.length;o0){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 ioe(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 roe(n.status,r)}async function wu(t,e,n){let r;ZDe(e)?n=e:r=e;const o=await(await ioe(t,r)).json();return n?n(o):o}const w$e=/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,S$e=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=TG(r[3]),e===void 0)return;i[3]=e}return i}if(r.length!==2||(t=r[0],e=TG(r[1]),e===void 0))return}const n=(t.startsWith("#")?aoe:C$e)(t);if(n){if(n.length===3)return[...n,e===void 0?255:e];if(n.length===4&&e===void 0)return n}};function ooe(t){return"#"+t.map(e=>{const n=e.toString(16);return n.length===1?"0"+n:n}).join("")}function aoe(t){if(w$e.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 TG=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)},O$e=t=>T$e[t.toLowerCase()],C$e=t=>{const e=O$e(t);if(e)return aoe(e)},T$e={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"};function E$e(t){return wu(`${t}/colorbars`,P$e)}function P$e(t){const e=[],n={},r={};return t.forEach(i=>{const[o,a,s]=i,l=[];s.forEach(c=>{if(c.length===3){const[u,f,d]=c;l.push(u),n[u]=f,r[u]={name:d.name,type:d.type,colorRecords:d.colors.map(M$e)}}else if(c.length===2){const[u,f]=c;l.push(u),n[u]=f}}),e.push({title:o,description:a,names:l})}),{groups:e,images:n,customColorMaps:r}}function M$e(t){const e=k$e(t[1]),n=t[0];if(t.length===3){const r=t[2];return{value:n,color:e,label:r}}else return{value:n,color:e}}function k$e(t){return t?Mp(t)?t:ooe(t):"#000000"}function A$e(t,e){const n=sy(`${t}/datasets`,[["details","1"]]),r=ay(e);return wu(n,r,R$e)}function R$e(t){return(t.datasets||[]).map(I$e)}function I$e(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 D$e(t,e,n,r){const i=ay(r),o=encodeURIComponent(e),a=encodeURIComponent(n);return wu(`${t}/datasets/${o}/places/${a}`,i)}function L$e(t){return wu(`${t}/expressions/capabilities`)}function N$e(t){return wu(`${t}/`)}function W1(t){return Mp(t.expression)}function ly(t){return encodeURIComponent(Mp(t)?t:t.id)}function V1(t){return encodeURIComponent(Mp(t)?t:W1(t)?`${t.name}=${t.expression}`:t.name)}function $$e(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=sy(`${t}/timeseries/${ly(e)}/${V1(n)}`,d),p={...ay(c),method:"post",body:JSON.stringify(i)};return wu(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 F$e(t,e,n,r,i,o){const a=i!==null?[["time",i]]:[],s=sy(`${t}/statistics/${ly(e)}/${V1(n)}`,a),l={...ay(o),method:"post",body:JSON.stringify(r.place.geometry)},c={dataset:e,variable:n,placeInfo:r,time:i};return wu(s,l,u=>({source:c,statistics:u.result}))}function j$e(t,e,n,r,i,o,a){const s=[["lon",r.toString()],["lat",i.toString()]];o&&s.push(["time",o]);const l=sy(`${t}/statistics/${ly(e)}/${V1(n)}`,s);return wu(l,ay(a),c=>c.result?c.result:{})}function B$e(t,e){const n=sy(`${t}/maintenance/update`,[]),r=ay(e);try{return wu(n,r).then(()=>!0).catch(i=>(console.error(i),!1))}catch(i){return console.error(i),Promise.resolve(!1)}}class UT extends Error{}function z$e(t,e){if(t===null)throw new UT(`assertion failed: ${e} must not be null`)}function U$e(t,e){if(typeof t>"u")throw new UT(`assertion failed: ${e} must not be undefined`)}function W$e(t,e){z$e(t,e),U$e(t,e)}function LA(t,e){if(Array.isArray(t)){if(t.length===0)throw new UT(`assertion failed: ${e} must be a non-empty array`)}else throw new UT(`assertion failed: ${e} must be an array`)}function zb(t,e){return e&&t.find(n=>n.id===e)||null}function a3(t,e){return e&&t.variables.find(n=>n.name===e)||null}function V$e(t){return t.variables.findIndex(e=>Mp(e.expression))}function mB(t){const e=V$e(t);return e>=0?[t.variables.slice(0,e),t.variables.slice(e)]:[t.variables,[]]}function soe(t){W$e(t,"dataset"),LA(t.dimensions,"dataset.dimensions");const e=t.dimensions.find(n=>n.name==="time");return e?(LA(e.coordinates,"timeDimension.coordinates"),LA(e.labels,"timeDimension.labels"),e):null}function loe(t){const e=soe(t);if(!e)return null;const n=e.coordinates;return[n[0],n[n.length-1]]}var WT="NOT_FOUND";function G$e(t){var e;return{get:function(r){return e&&t(e.key,r)?e.value:WT},put:function(r,i){e={key:r,value:i}},getEntries:function(){return e?[e]:[]},clear:function(){e=void 0}}}function H$e(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 WT}function i(s,l){r(s)===WT&&(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 q$e=function(e,n){return e===n};function X$e(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=EG(n.properties,o)),a===void 0&&(a=EG(n,o)),t[r]=a||i}function rFe(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 EG(t,e){let n;for(const r of e)if(r in t)return t[r];return n}function G1(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 yB(t,e){t.forEach(n=>{uy(n)&&n.features.forEach(r=>{e(n,r)})})}function iFe(t,e){const n=Mp(e)?(r,i)=>i.id===e:e;for(const r of t)if(uy(r)){const i=r.features.find(o=>n(r,o));if(i)return u2(r,i)}return null}function oFe(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=uoe(r[i],e);if(o)return o}return null}function xB(t,e){if(e)for(const n of t){const r=uoe(n,e);if(r!==null)return r}return null}const foe="User",doe=`0.0: #23FF52 0.5: red -1.0: 120,30,255`;function lFe(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 cFe(t,e,n){const r=lFe(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 uFe(t){const{colorRecords:e,errorMessage:n}=moe(t.code);if(!e)return Promise.resolve({errorMessage:n});const r=document.createElement("canvas");return r.width=256,r.height=1,cFe(e,t.type,r).then(()=>({imageData:r.toDataURL("image/png").split(",")[1]}))}function poe(t){const{colorRecords:e}=moe(t);if(e)return e.map(n=>({...n,color:aoe(n.color)}))}function moe(t){try{return{colorRecords:fFe(t)}}catch(e){if(e instanceof SyntaxError)return{errorMessage:`${e.message}`};throw e}}function fFe(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=C$e(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 _B={exports:{}};function dFe(t,e){var n=e&&e.cache?e.cache:yFe,r=e&&e.serializer?e.serializer:vFe,i=e&&e.strategy?e.strategy:pFe;return i(t,{cache:n,serializer:r})}function hFe(t){return t==null||typeof t=="number"||typeof t=="boolean"}function goe(t,e,n,r){var i=hFe(r)?r:n(r),o=e.get(i);return typeof o>"u"&&(o=t.call(this,r),e.set(i,o)),o}function voe(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 wB(t,e,n,r,i){return n.bind(e,t,r,i)}function pFe(t,e){var n=t.length===1?goe:voe;return wB(t,this,n,e.cache.create(),e.serializer)}function mFe(t,e){var n=voe;return wB(t,this,n,e.cache.create(),e.serializer)}function gFe(t,e){var n=goe;return wB(t,this,n,e.cache.create(),e.serializer)}function vFe(){return JSON.stringify(arguments)}function f2(){this.cache=Object.create(null)}f2.prototype.has=function(t){return t in this.cache};f2.prototype.get=function(t){return this.cache[t]};f2.prototype.set=function(t,e){this.cache[t]=e};var yFe={create:function(){return new f2}};_B.exports=dFe;_B.exports.strategies={variadic:mFe,monadic:gFe};var xFe=_B.exports;const bFe=$t(xFe),Oo={ADD:"add",REMOVE:"remove"};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)}}(),kG={LENGTH:"length"},bS=function(t){yoe(e,t);function e(n,r,i){var o=t.call(this,n)||this;return o.element=r,o.index=i,o}return e}(ac),Qa=function(t){yoe(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 xoe(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 fa(t,e){return Array.isArray(t)?t:(e===void 0?e=[t,t]:(e[0]=t,e[1]=t),e)}var boe=function(){function t(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale,this.scaleArray_=fa(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 yt()},t.prototype.getImage=function(e){return yt()},t.prototype.getHitDetectionImage=function(){return yt()},t.prototype.getPixelRatio=function(e){return 1},t.prototype.getImageState=function(){return yt()},t.prototype.getImageSize=function(){return yt()},t.prototype.getOrigin=function(){return yt()},t.prototype.getSize=function(){return yt()},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_=fa(e)},t.prototype.listenImageChange=function(e){yt()},t.prototype.load=function(){yt()},t.prototype.unlistenImageChange=function(e){yt()},t}(),_Fe=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,wFe=/^([a-z]*)$|^hsla?\(.*\)$/i;function _oe(t){return typeof t=="string"?t:woe(t)}function SFe(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 OFe=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=CFe(r),e[r]=i,++n}return i}}();function VT(t){return Array.isArray(t)?t:OFe(t)}function CFe(t){var e,n,r,i,o;if(wFe.exec(t)&&(t=SFe(t)),_Fe.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),IG(o)):t.indexOf("rgb(")==0?(o=t.slice(4,-1).split(",").map(Number),o.push(1),IG(o)):Ut(!1,14);return o}function IG(t){return t[0]=Br(t[0]+.5|0,0,255),t[1]=Br(t[1]+.5|0,0,255),t[2]=Br(t[2]+.5|0,0,255),t[3]=Br(t[3],0,1),t}function woe(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 Rl(t){return Array.isArray(t)?woe(t):t}function Ca(t,e,n,r){var i;return n&&n.length?i=n.shift():o2?i=new OffscreenCanvas(t||300,e||300):i=document.createElement("canvas"),t&&(i.width=t),e&&(i.height=e),i.getContext("2d",r)}function Soe(t){var e=t.canvas;e.width=1,e.height=1,t.clearRect(0,0,1,1)}function DG(t,e){var n=e.parentNode;n&&n.replaceChild(t,e)}function l3(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}function TFe(t){for(;t.lastChild;)t.removeChild(t.lastChild)}function EFe(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 _S="ol-hidden",q1="ol-unselectable",SB="ol-control",LG="ol-collapsed",PFe=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"),NG=["style","variant","weight","size","lineHeight","family"],Ooe=function(t){var e=t.match(PFe);if(!e)return null;for(var n={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},r=0,i=NG.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 sFe(t,e,n){const r=aFe(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 lFe(t){const{colorRecords:e,errorMessage:n}=poe(t.code);if(!e)return Promise.resolve({errorMessage:n});const r=document.createElement("canvas");return r.width=256,r.height=1,sFe(e,t.type,r).then(()=>({imageData:r.toDataURL("image/png").split(",")[1]}))}function hoe(t){const{colorRecords:e}=poe(t);if(e)return e.map(n=>({...n,color:ooe(n.color)}))}function poe(t){try{return{colorRecords:cFe(t)}}catch(e){if(e instanceof SyntaxError)return{errorMessage:`${e.message}`};throw e}}function cFe(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=S$e(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 bB={exports:{}};function uFe(t,e){var n=e&&e.cache?e.cache:gFe,r=e&&e.serializer?e.serializer:mFe,i=e&&e.strategy?e.strategy:dFe;return i(t,{cache:n,serializer:r})}function fFe(t){return t==null||typeof t=="number"||typeof t=="boolean"}function moe(t,e,n,r){var i=fFe(r)?r:n(r),o=e.get(i);return typeof o>"u"&&(o=t.call(this,r),e.set(i,o)),o}function goe(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 _B(t,e,n,r,i){return n.bind(e,t,r,i)}function dFe(t,e){var n=t.length===1?moe:goe;return _B(t,this,n,e.cache.create(),e.serializer)}function hFe(t,e){var n=goe;return _B(t,this,n,e.cache.create(),e.serializer)}function pFe(t,e){var n=moe;return _B(t,this,n,e.cache.create(),e.serializer)}function mFe(){return JSON.stringify(arguments)}function f2(){this.cache=Object.create(null)}f2.prototype.has=function(t){return t in this.cache};f2.prototype.get=function(t){return this.cache[t]};f2.prototype.set=function(t,e){this.cache[t]=e};var gFe={create:function(){return new f2}};bB.exports=uFe;bB.exports.strategies={variadic:hFe,monadic:pFe};var vFe=bB.exports;const yFe=$t(vFe),Oo={ADD:"add",REMOVE:"remove"};var voe=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"},bS=function(t){voe(e,t);function e(n,r,i){var o=t.call(this,n)||this;return o.element=r,o.index=i,o}return e}(ac),Qa=function(t){voe(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 yoe(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 fa(t,e){return Array.isArray(t)?t:(e===void 0?e=[t,t]:(e[0]=t,e[1]=t),e)}var xoe=function(){function t(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale,this.scaleArray_=fa(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 yt()},t.prototype.getImage=function(e){return yt()},t.prototype.getHitDetectionImage=function(){return yt()},t.prototype.getPixelRatio=function(e){return 1},t.prototype.getImageState=function(){return yt()},t.prototype.getImageSize=function(){return yt()},t.prototype.getOrigin=function(){return yt()},t.prototype.getSize=function(){return yt()},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_=fa(e)},t.prototype.listenImageChange=function(e){yt()},t.prototype.load=function(){yt()},t.prototype.unlistenImageChange=function(e){yt()},t}(),xFe=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,bFe=/^([a-z]*)$|^hsla?\(.*\)$/i;function boe(t){return typeof t=="string"?t:_oe(t)}function _Fe(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 wFe=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=SFe(r),e[r]=i,++n}return i}}();function VT(t){return Array.isArray(t)?t:wFe(t)}function SFe(t){var e,n,r,i,o;if(bFe.exec(t)&&(t=_Fe(t)),xFe.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),AG(o)):t.indexOf("rgb(")==0?(o=t.slice(4,-1).split(",").map(Number),o.push(1),AG(o)):Ut(!1,14);return o}function AG(t){return t[0]=Br(t[0]+.5|0,0,255),t[1]=Br(t[1]+.5|0,0,255),t[2]=Br(t[2]+.5|0,0,255),t[3]=Br(t[3],0,1),t}function _oe(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 Rl(t){return Array.isArray(t)?_oe(t):t}function Ca(t,e,n,r){var i;return n&&n.length?i=n.shift():o2?i=new OffscreenCanvas(t||300,e||300):i=document.createElement("canvas"),t&&(i.width=t),e&&(i.height=e),i.getContext("2d",r)}function woe(t){var e=t.canvas;e.width=1,e.height=1,t.clearRect(0,0,1,1)}function RG(t,e){var n=e.parentNode;n&&n.replaceChild(t,e)}function s3(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}function OFe(t){for(;t.lastChild;)t.removeChild(t.lastChild)}function CFe(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 _S="ol-hidden",H1="ol-unselectable",wB="ol-control",IG="ol-collapsed",TFe=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"),DG=["style","variant","weight","size","lineHeight","family"],Soe=function(t){var e=t.match(TFe);if(!e)return null;for(var n={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},r=0,i=DG.length;r=t.maxResolution)return!1;var r=e.zoom;return r>t.minZoom&&r<=t.maxZoom}function WFe(t,e,n,r,i){Poe(t,e,n||0,r||t.length-1,i||VFe)}function Poe(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));Poe(t,e,u,f,i)}var d=t[e],h=n,p=r;for(b0(t,n,e),i(t[r],d)>0&&b0(t,n,r);h0;)p--}i(t[n],d)===0?b0(t,n,p):(p++,b0(t,p,r)),p<=e&&(n=p+1),e<=p&&(r=p-1)}}function b0(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function VFe(t,e){return te?1:0}let Moe=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(!SS(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=jm(r.children.splice(a,r.children.length-a));s.height=r.height,s.leaf=r.leaf,tm(r,this.toBBox),tm(s,this.toBBox),n?e[n-1].children.push(s):this._splitRoot(r,s)}_splitRoot(e,n){this.data=jm([e,n]),this.data.height=e.height+1,this.data.leaf=!1,tm(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=ux(e,0,s,this.toBBox),c=ux(e,s,r,this.toBBox),u=QFe(l,c),f=FA(l)+FA(c);u=n;c--){const u=e.children[c];fx(s,e.leaf?o(u):u),l+=wS(s)}return l}_adjustParentBBoxes(e,n,r){for(let i=r;i>=0;i--)fx(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():tm(e[n],this.toBBox)}};function GFe(t,e,n){if(!n)return e.indexOf(t);for(let r=0;r=t.minX&&e.maxY>=t.minY}function jm(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function jG(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;WFe(t,a,e,n,i),o.push(e,a,a,n)}}var YFe=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)}}(),BG={RENDER_ORDER:"renderOrder"},KFe=function(t){YFe(e,t);function e(n){var r=this,i=n||{},o=ur({},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(BG.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 Moe(9)),this.getRenderer().renderDeclutter(n)},e.prototype.setRenderOrder=function(n){this.set(BG.RENDER_ORDER,n)},e.prototype.setStyle=function(n){this.style_=n!==void 0?n:FFe,this.styleFunction_=n===null?void 0:$Fe(this.style_),this.changed()},e}(d2),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},OS=[bt.FILL],Sf=[bt.STROKE],wh=[bt.BEGIN_PATH],zG=[bt.CLOSE_PATH],koe=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}(),ZFe=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)}}(),Q1=function(t){ZFe(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,wf]),this.hitDetectionInstructions.push([bt.CUSTOM,l,u,n,o||i,wf]));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&&!kp(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_=Rie(this.maxExtent),this.maxLineWidth>0)){var n=this.resolution*(this.maxLineWidth+1)/2;Fb(this.bufferedMaxExtent_,n,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(koe),JFe=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)}}(),eje=function(t){JFe(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}(Q1),tje=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)}}(),nje=function(t){tje(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,Wb,Vb],wh);var s=n.getFlatCoordinates(),l=n.getStride();this.drawFlatCoordinates_(s,0,s.length,l),this.hitDetectionInstructions.push(Sf),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],wh);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 oje=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)}}(),qx={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},aje=function(t){oje(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===BFe.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,U=(k+_)/2;return T[0]=[B,U,(C-o)/2,z,i],T}i=i.replace(/\n/g," ");for(var W=0,$=i.length;W<$;){y();var N=Math.atan2(h-m,d-p);if(I&&(N+=N>0?-R:R),z!==void 0){var D=N-z;if(D+=D>R?-2*R:D<-R?2*R:0,Math.abs(D)>a)return null}z=N;for(var A=W,q=0;W<$;++W){var Y=I?$-W-1:W,K=s*l(c,i[Y],u);if(e+r0&&t.push(` -`,""),t.push(e,""),t}var gje=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_=Hl(),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?qx[l.justify]:HG(Array.isArray(e)?e[0]:e,l.textAlign||qb),h=i&&a.lineWidth?a.lineWidth:0,p=f?e:e.split(` -`).reduce(mje,[]),m=RFe(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=o2?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,U=0,W,$=0,N=p.length;$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)&&(Ru[0]=O,Iu[0]=O,Ru[1]=C,mc[1]=C,mc[0]=O+_,gc[0]=mc[0],gc[1]=C+S,Iu[1]=gc[1]);var E;return f!==0?(E=hu(Hl(),r,i,1,1,f,-r,-i),Cr(E,Ru),Cr(E,mc),Cr(E,gc),Cr(E,Iu),Zs(Math.min(Ru[0],mc[0],gc[0],Iu[0]),Math.min(Ru[1],mc[1],gc[1],Iu[1]),Math.max(Ru[0],mc[0],gc[0],Iu[0]),Math.max(Ru[1],mc[1],gc[1],Iu[1]),nm)):Zs(Math.min(O,O+_),Math.min(C,C+S),Math.max(O,O+_),Math.max(C,C+S),nm),h&&(v=Math.round(v),y=Math.round(y)),{drawImageX:v,drawImageY:y,drawImageW:x,drawImageH:b,originX:c,originY:u,declutterBox:{minX:nm[0],minY:nm[1],maxX:nm[2],maxY:nm[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,Ru,mc,gc,Iu,a,s),IFe(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=Cr(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=HG(Array.isArray(e)?e[0]:e,o.textAlign||qb),u=qx[o.textBaseline||HT],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_&&kp(r,this.renderedTransform_)?c=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),c=Bh(this.coordinates,0,this.coordinates.length,2,r,this.pixelCoordinates_),G3e(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,U,W,$,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=U,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=_h,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(rp);var g,v,y,x,b;for(g=m.length-1;g>=0;--g){var _=m[g].toString();for(y=this.executorsByZIndex_[_],v=BA.length-1;v>=0;--v)if(h=BA[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 Bh(s,0,8,2,e,s),s},t.prototype.isEmpty=function(){return rv(this.executorsByZIndex_)},t.prototype.execute=function(e,n,r,i,o,a,s){var l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(rp),this.maxExtent_&&(e.save(),this.clip(e,r));var c=a||BA,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=XG(e,n,r);return i in this.cache_?this.cache_[i]:null},t.prototype.set=function(e,n,r,i){var o=XG(e,n,r);this.cache_[o]=i,++this.cacheSize_},t.prototype.setSize=function(e){this.maxCacheSize_=e,this.expire()},t}();function XG(t,e,n){var r=n?_oe(n):"null";return e+":"+t+":"+r}var QT=new bje,_je=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)}}(),wje=function(t){_je(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 yt()},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(){yt()},e}(oy),Sje=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){Sje(e,t);function e(n,r,i,o,a,s){var l=t.call(this,n,r,i,Wn.IDLE)||this;return l.src_=o,l.image_=new Image,a!==null&&(l.image_.crossOrigin=a),l.unlisten_=null,l.state=Wn.IDLE,l.imageLoadFunction_=s,l}return e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=Wn.ERROR,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){this.resolution===void 0&&(this.resolution=ps(this.extent)/this.image_.height),this.state=Wn.LOADED,this.unlistenImage_(),this.changed()},e.prototype.load=function(){(this.state==Wn.IDLE||this.state==Wn.ERROR)&&(this.state=Wn.LOADING,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=OB(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(n){this.image_=n,this.resolution=ps(this.extent)/this.image_.height},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e})(wje);function OB(t,e,n){var r=t,i=!0,o=!1,a=!1,s=[LT(r,Mt.LOAD,function(){a=!0,o||e()})];return r.src&&W3e?(o=!0,r.decode().then(function(){i&&e()}).catch(function(l){i&&(a?e():n())})):s.push(LT(r,Mt.ERROR,n)),function(){i=!1,s.forEach(nr)}}var Oje=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)}}(),_0=null,Cje=function(t){Oje(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_===Wn.LOADED){_0||(_0=Ca(1,1)),_0.drawImage(this.image_,0,0);try{_0.getImageData(0,0,1,1),this.tainted_=!1}catch{_0=null,this.tainted_=!0}}return this.tainted_===!0},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(Mt.CHANGE)},e.prototype.handleImageError_=function(){this.imageState_=Wn.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=Wn.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_==Wn.IDLE){this.imageState_=Wn.LOADING;try{this.image_.src=this.src_}catch{this.handleImageError_()}this.unlisten_=OB(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(n){if(!(!this.color_||this.canvas_[n]||this.imageState_!==Wn.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=_oe(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?Wn.IDLE:Wn.LOADED;return r.color_=i.color!==void 0?VT(i.color):null,r.iconImage_=Tje(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_==sf.FRACTION||this.anchorYUnits_==sf.FRACTION){if(!r)return null;n=this.anchor_.slice(),this.anchorXUnits_==sf.FRACTION&&(n[0]*=r[0]),this.anchorYUnits_==sf.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}(boe),wl=.5;function Mje(t,e,n,r,i,o,a){var s=t[0]*wl,l=t[1]*wl,c=Ca(s,l);c.imageSmoothingEnabled=!1;for(var u=c.canvas,f=new xje(c,wl,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,wl,d,h,x).slice()),g-=v}this.hitDetectionImageData_=Mje(i,f,this.renderedFeatures_,u.getStyleFunction(),c,a,s)}r(kje(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&&eg(this.wrappedRenderedExtent_,y))return kp(this.renderedExtent_,x)||(this.hitDetectionImageData_=null,this.renderedExtent_=x),this.renderedCenter_=v,this.replayGroupChanged=!1,!0;this.replayGroup_=null;var E=new WG(d3(d,h),y,d,h),k;this.getLayer().getDeclutter()&&(k=new WG(d3(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 ZG(t,e){return function(n,r,i,o,a){var s=this;Qje(t,e,n,r,i,function(l,c){s.addFeatures(l),o!==void 0&&o(l)},a||ip)}}var Noe=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)}}(),Du=function(t){Noe(e,t);function e(n,r,i){var o=t.call(this,n)||this;return o.feature=r,o.features=i,o}return e}(ac),Y1=function(t){Noe(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_=ip,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_=ZG(r.url_,r.format_)),r.strategy_=i.strategy!==void 0?i.strategy:qje;var o=i.useSpatialIndex!==void 0?i.useSpatialIndex:!0;r.featuresRtree_=o?new YG:null,r.loadedExtentsRtree_=new YG,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 Qa(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 Du(Ps.ADDFEATURE,n))},e.prototype.setupChangeEvents_=function(n,r){this.featureChangeKeys_[n]=[rn(r,Mt.CHANGE,this.handleFeatureChange_,this),rn(r,nv.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(jb(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(nr),delete this.featureChangeKeys_[r];var o=n.getId();return o!==void 0&&delete this.idIndex_[o.toString()],delete this.uidIndex_[r],this.dispatchEvent(new Du(Ps.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(ZG(n,this.format_))},e}(Loe);function Lu(t,e){return Cr(t.inversePixelTransform,e.slice(0))}const St={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function $oe(t){return Math.pow(t,3)}function fy(t){return 1-$oe(1-t)}function Yje(t){return 3*t*t-2*t*t*t}function Kje(t){return t}var Zje=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)}}(),Foe=function(t){Zje(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(){yt()},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:$oe(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}(oy),Jje=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)}}(),CB=function(t){Jje(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_=e5e(),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_=OB(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(Foe);function e5e(){var t=Ca(1,1);return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas}var t5e=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}(),n5e=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)}}(),r5e=function(t){n5e(e,t);function e(n){var r=t.call(this)||this;return r.map_=n,r}return e.prototype.dispatchRenderEvent=function(n,r){yt()},e.prototype.calculateMatrices2D=function(n){var r=n.viewState,i=n.coordinateToPixelTransform,o=n.pixelToCoordinateTransform;hu(i,n.size[0]/2,n.size[1]/2,1/r.resolution,-1/r.resolution,-r.rotation,-r.center[0],-r.center[1]),Q5(o,i)},e.prototype.forEachFeatureAtCoordinate=function(n,r,i,o,a,s,l,c){var u,f=r.viewState;function d(L,z,B,U){return a.call(s,z,L?B:null,U)}var h=f.projection,p=jie(n.slice(),h),m=[[0,0]];if(h.canWrapX()&&o){var g=h.getExtent(),v=Kn(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()&&XT(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 yt()},e.prototype.hasFeatureAtCoordinate=function(n,r,i,o,a,s){var l=this.forEachFeatureAtCoordinate(n,r,i,o,Fh,this,a,s);return l!==void 0},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(n){yt()},e.prototype.scheduleExpireIconCache=function(n){QT.canExpireCache()&&n.postRenderFunctions.push(i5e)},e}(q5);function i5e(t,e){QT.expire()}var o5e=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)}}(),a5e=function(t){o5e(e,t);function e(n){var r=t.call(this,n)||this;r.fontChangeListenerKey_=rn(Tc,nv.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=q1+" 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 Aoe(n,void 0,r);i.dispatchEvent(o)}},e.prototype.disposeInternal=function(){nr(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(Bf.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);EFe(this.element_,this.children_),this.dispatchRenderEvent(Bf.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()&&XT(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}(r5e),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)}}(),lf=function(t){joe(e,t);function e(n,r){var i=t.call(this,n)||this;return i.layer=r,i}return e}(ac),UA={LAYERS:"layers"},s5e=function(t){joe(e,t);function e(n){var r=this,i=n||{},o=ur({},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(UA.LAYERS,r.handleLayersChanged_),a?Array.isArray(a)?a=new Qa(a.slice(),{unique:!0}):Ut(typeof a.getArray=="function",43):a=new Qa(void 0,{unique:!0}),r.setLayers(a),r}return e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(nr),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(nr);j1(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_&&(nr(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(Mt.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(nr(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(nr),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(oy);const Yu={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},Ui={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"};var YT=1/0,d5e=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,j1(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!=YT?(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}(d5e);function m5e(t,e,n,r,i){if(!t||!(n in t.wantedTiles)||!t.wantedTiles[n][e.getKey()])return YT;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 Ms={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};var g5e=42,TB=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=Br(r[0],d,h),v=Br(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 v5e(t){return t}function EB(t,e,n,r){var i=Kn(e)/n[0],o=ps(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),Br(r,n/2,e*2)}function y5e(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?EB(l,n,a,r):l;if(s){var f=e!==void 0?e:!0;return f?PB(i,u,c):Br(i,c,u)}var d=Math.min(u,i),h=Math.floor(X5(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?jf(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&&CS(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]],nB(i,n-this.getRotation()),yNe(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&&e3(n,this.getProjection())},e.prototype.getCenterInternal=function(){return this.get(Ms.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 Uie(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),YL(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(Ms.RESOLUTION)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(n,r){return this.getResolutionForExtentInternal(xh(n,this.getProjection()),r)},e.prototype.getResolutionForExtentInternal=function(n,r){var i=r||this.getViewportSizeMinusPadding_(),o=Kn(n)/i[0],a=ps(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(Ms.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=VA(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=X5(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=Br(Math.floor(n),0,this.resolutions_.length-2),i=this.resolutions_[r]/this.resolutions_[r+1];return this.resolutions_[r]/Math.pow(i,Br(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(!tB(n),25);var o=xh(n,this.getProjection());i=i3(o)}else if(n.getType()==="Circle"){var o=xh(n.getExtent(),this.getProjection());i=i3(o),i.rotate(this.getRotation(),ed(o))}else{var a=PNe();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),!kp(r,this.renderedAttributions_)){TFe(this.ulElement_);for(var o=0,a=r.length;o0&&i%(2*Math.PI)!==0?r.animate({rotation:0,duration:this.duration_,easing:fy}):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(_S);!a&&i===0?this.element.classList.add(_S):a&&i!==0&&this.element.classList.remove(_S)}this.label_.style.transform=o}this.rotation_=i}},e}(m2),L5e=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)}}(),N5e=function(t){L5e(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+" "+q1+" "+SB,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:fy})):i.setZoom(a)}}},e}(m2),$5e=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)}}(),GA="units",jd={DEGREES:"degrees",IMPERIAL:"imperial",NAUTICAL:"nautical",METRIC:"metric",US:"us"},F5e=[1,2,5],w0=25.4/.28,j5e=function(t){$5e(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+" "+q1,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(GA,r.handleUnitsChanged_),r.setUnits(i.units||jd.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(GA)},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(n){this.set(GA,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==jd.DEGREES?ci.DEGREES:ci.METERS,s=FT(i,n.resolution,r,a),l=this.minWidth_*(this.dpi_||w0)/w0,c=this.maxWidth_!==void 0?this.maxWidth_*(this.dpi_||w0)/w0:void 0,u=l*s,f="";if(o==jd.DEGREES){var d=Ks[ci.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=FT(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,ci.METERS),r=this.dpi_||w0,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}(m2);function B5e(t){var e={},n=new Qa,r=e.zoom!==void 0?e.zoom:!0;r&&n.push(new N5e(e.zoomOptions));var i=e.rotate!==void 0?e.rotate:!0;i&&n.push(new D5e(e.rotateOptions));var o=e.attribution!==void 0?e.attribution:!0;return o&&n.push(new R5e(e.attributionOptions)),n}const p3={ACTIVE:"active"};var z5e=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)}}(),K1=function(t){z5e(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(p3.ACTIVE)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(n){return!0},e.prototype.setActive=function(n){this.set(p3.ACTIVE,n)},e.prototype.setMap=function(n){this.map_=n},e}(sc);function U5e(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:Kje,center:t.getConstrainedCenter(i)})}}function kB(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:fy})}}var W5e=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)}}(),V5e=function(t){W5e(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==Sn.DBLCLICK){var i=n.originalEvent,o=n.map,a=n.coordinate,s=i.shiftKey?-this.delta_:this.delta_,l=o.getView();kB(l,s,a,this.duration_),i.preventDefault(),r=!0}return!r},e}(K1),G5e=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)}}(),dy=function(t){G5e(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==Sn.POINTERDRAG)this.handleDragEvent(n),n.originalEvent.preventDefault();else if(n.type==Sn.POINTERUP){var i=this.handleUpEvent(n);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(n.type==Sn.POINTERDOWN){var o=this.handleDownEvent(n);this.handlingDownUpSequence=o,r=this.stopDown(o)}else n.type==Sn.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}(K1);function AB(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}(dy),K5e=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)}}(),Z5e=function(t){K5e(e,t);function e(n){var r=this,i=n||{};return r=t.call(this,{stopDown:F1})||this,r.condition_=i.condition?i.condition:H5e,r.lastAngle_=void 0,r.duration_=i.duration!==void 0?i.duration:250,r}return e.prototype.handleDragEvent=function(n){if(HA(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(!HA(n))return!0;var r=n.map,i=r.getView();return i.endInteraction(this.duration_),!1},e.prototype.handleDownEvent=function(n){if(!HA(n))return!1;if(Voe(n)&&this.condition_(n)){var r=n.map;return r.getView().beginInteraction(),this.lastAngle_=void 0,!0}else return!1},e}(dy),J5e=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)}}(),eBe=function(t){J5e(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 td([o])},e.prototype.getGeometry=function(){return this.geometry_},e}(q5),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)}}(),TS={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"},qA=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}(ac),tBe=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 eBe(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:Voe,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 qA(TS.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 qA(r?TS.BOXEND:TS.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 qA(TS.BOXSTART,n.coordinate,n)),!0):!1},e.prototype.onBoxEnd=function(n){},e}(dy),nBe=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)}}(),rBe=function(t){nBe(e,t);function e(n){var r=this,i=n||{},o=i.condition?i.condition:Goe;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:fy})},e}(tBe);const Bd={LEFT:37,UP:38,RIGHT:39,DOWN:40};var iBe=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)}}(),oBe=function(t){iBe(e,t);function e(n){var r=t.call(this)||this,i=n||{};return r.defaultCondition_=function(o){return RB(o)&&Hoe(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==Bd.DOWN||o==Bd.LEFT||o==Bd.RIGHT||o==Bd.UP)){var a=n.map,s=a.getView(),l=s.getResolution()*this.pixelDelta_,c=0,u=0;o==Bd.DOWN?u=-l:o==Bd.LEFT?c=-l:o==Bd.RIGHT?c=l:u=l;var f=[c,u];nB(f,s.getRotation()),U5e(s,f,this.duration_),i.preventDefault(),r=!0}}return!r},e}(K1),aBe=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)}}(),sBe=function(t){aBe(e,t);function e(n){var r=t.call(this)||this,i=n||{};return r.condition_=i.condition?i.condition:Hoe,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();kB(l,s,void 0,this.duration_),i.preventDefault(),r=!0}}return!r},e}(K1),lBe=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)}}(),XA={TRACKPAD:"trackpad",WHEEL:"wheel"},cBe=function(t){lBe(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:Woe;return r.condition_=i.onFocusOnly?m3(Uoe,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,j3e&&o.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(a/=Mie),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?XA.TRACKPAD:XA.WHEEL);var l=i.getView();if(this.mode_===XA.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=-Br(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(r.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),kB(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}(K1),uBe=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)}}(),fBe=function(t){uBe(e,t);function e(n){var r=this,i=n||{},o=i;return o.stopDown||(o.stopDown=F1),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=AB(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}(dy),dBe=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)}}(),hBe=function(t){dBe(e,t);function e(n){var r=this,i=n||{},o=i;return o.stopDown||(o.stopDown=F1),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=AB(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}(dy),pBe=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)}}(),IB=function(t){pBe(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:K5(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===Sn.POINTERDRAG&&this.sketchFeature_!==null?(this.addToDrawing_(n.coordinate),i=!1):this.freehand_&&n.type===Sn.POINTERDOWN?i=!1:r&&this.getPointerCount()<2?(i=n.type===Sn.POINTERMOVE,i&&this.freehand_?(this.handlePointerMove_(n),this.shouldHandle_&&n.originalEvent.preventDefault()):(n.originalEvent.pointerType==="mouse"||n.type===Sn.POINTERDRAG&&this.downTimeout_===void 0)&&this.handlePointerMove_(n)):n.type===Sn.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 Ac(Sn.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 c2([r])):this.type_==="MultiLineString"?n.setGeometry(new pB([r])):this.type_==="MultiPolygon"&&n.setGeometry(new mB([r])),this.dispatchEvent(new PS(ES.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 PS(ES.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}();function rH(t,e,n,r){return r!==void 0?(r[0]=t,r[1]=e,r[2]=n,r):[t,e,n]}function g2(t,e,n){return t+"/"+e+"/"+n}function Qoe(t){return g2(t[0],t[1],t[2])}function _Be(t){return t.split("/").map(Number)}function Yoe(t){return(t[1]<n||n>e.getMaxZoom())return!1;var o=e.getFullTileRange(n);return o?o.containsXY(r,i):!0}var SBe=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){SBe(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=_Be(n),i=r[0];this.forEach((function(o){o.tileCoord[0]!==i&&(this.remove(Qoe(o.tileCoord)),o.release())}).bind(this))}},e}(bBe),DB=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 rm(t,e,n,r,i){return i!==void 0?(i.minX=t,i.maxX=e,i.minY=n,i.maxY=r,i):new DB(t,e,n,r)}var OBe=.5,CBe=10,iH=.25,TBe=function(){function t(e,n,r,i,o,a){this.sourceProj_=e,this.targetProj_=n;var s={},l=Bb(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()&&Kn(i)==Kn(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Kn(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Kn(this.targetProj_.getExtent()):null;var c=Rp(r),u=eB(r),f=J5(r),d=Z5(r),h=this.transformInv_(c),p=this.transformInv_(u),m=this.transformInv_(f),g=this.transformInv_(d),v=CBe+(a?Math.max(0,Math.ceil(rNe(QL(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=vG([e,n,r,i]),g=Kn(m)/this.targetWorldWidth_;p=g>iH||p}!h&&this.sourceProj_.isGlobal()&&f&&(p=f>iH||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 _=(jf(o[0],d)+jf(s[0],d))/2;b=_-jf(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;Gx(e,o[0]),Gx(e,o[1]),Gx(e,o[2])}),e},t.prototype.getTriangles=function(){return this.triangles_},t}(),g3={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1},EBe={imageSmoothingEnabled:!0,msImageSmoothingEnabled:!0},QA,Zoe=[];function oH(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 YA(t,e){return Math.abs(t[e*4]-210)>2||Math.abs(t[e*4+3]-.75*255)>2}function PBe(){if(QA===void 0){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",oH(t,4,5,4,0),oH(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;QA=YA(e,0)||YA(e,4)||YA(e,8)}return QA}function v3(t,e,n,r){var i=a2(n,e,t),o=FT(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||z1(l,i)){var c=FT(t,o,i)/o;isFinite(c)&&c>0&&(o/=c)}return o}function MBe(t,e,n,r){var i=ed(n),o=v3(t,e,i,r);return(!isFinite(o)||o<=0)&&K5(n,function(a){return o=v3(t,e,a,r),isFinite(o)&&o>0}),o}function kBe(t,e,n,r,i,o,a,s,l,c,u,f){var d=Ca(Math.round(n*t),Math.round(n*e),Zoe);if(f||ur(d,g3),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){Die(p,b.extent)});var m=Kn(p),g=ps(p),v=Ca(Math.round(n*m/r),Math.round(n*g/r));f||ur(v,g3);var y=n/r;l.forEach(function(b,_,S){var O=b.extent[0]-p[0],C=-(b.extent[3]-p[3]),E=Kn(b.extent),k=ps(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=Rp(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),U=h(-(C[1][1]-x[1])/o),W=h((C[2][0]-x[0])/o),$=h(-(C[2][1]-x[1])/o),N=E,D=k;E=0,k=0,I-=N,P-=D,R-=N,T-=D;var A=[[I,P,0,0,B-L],[R,T,0,0,W-L],[0,0,I,P,U-z],[0,0,R,T,$-z]],q=oNe(A);if(q){if(d.save(),d.beginPath(),PBe()||!f){d.moveTo(B,U);for(var Y=4,K=L-B,se=z-U,te=0;te=this.minZoom;){if(this.zoomFactor_===2?(a=Math.floor(a/2),s=Math.floor(s/2),o=rm(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}(Loe),FBe=function(t){nae(e,t);function e(n,r){var i=t.call(this,n)||this;return i.tile=r,i}return e}(ac);function jBe(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 BBe(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=fa(o.getTileSize(n[0]),this.tmpSize),c=this.gutter_;c!==0&&(l=AG(l,c,this.tmpSize),s=Fb(s,a*c,s)),r!=1&&(l=xoe(l,r,this.tmpSize));var u={SERVICE:"WMS",VERSION:MS,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};return ur(u,this.params_),this.getRequestUrl_(n,l,s,r,i,u)}},e}(rae);function iae(t){return w.jsx(M.Fragment,{children:t.children})}const kS={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};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)}}(),YBe=function(t){QBe(e,t);function e(n){var r=this,i=n||{},o=ur({},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(kS.PRELOAD)},e.prototype.setPreload=function(n){this.set(kS.PRELOAD,n)},e.prototype.getUseInterimTilesOnError=function(){return this.get(kS.USE_INTERIM_TILES_ON_ERROR)},e.prototype.setUseInterimTilesOnError=function(n){this.set(kS.USE_INTERIM_TILES_ON_ERROR,n)},e.prototype.getData=function(n){return t.prototype.getData.call(this,n)},e}(d2),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){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 DB(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=Cr(r.pixelToCoordinateTransform,n.slice()),a=i.getExtent();if(a&&!z1(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 CB||m instanceof Joe))return null;if(m.getState()===St.LOADED){var g=f.getOrigin(h),v=fa(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(Kn(v)/y*u),_=Math.round(ps(v)/y*u),S=i.extent&&xh(i.extent);S&&(v=Hx(v,xh(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?KL(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 U=this.getTile(m,z,B,n);if(this.isDrawableTile(U)){var W=vn(this);if(U.getState()==St.LOADED){I[m][U.tileCoord.toString()]=U;var $=U.inTransition(W);$&&i.opacity!==1&&(U.endTransition(W),$=!1),!this.newTiles_&&($||this.renderedTiles.indexOf(U)===-1)&&(this.newTiles_=!0)}if(U.getAlpha(W,n.time)===1)continue}var N=p.getTileCoordChildTileRange(U.tileCoord,T,R),D=!1;N&&(D=P(m+1,N)),D||p.forEachTileCoordParentTileRange(U.tileCoord,P,T,R)}var A=g/s*u/x;hu(this.pixelTransform,n.size[0]/2,n.size[1]/2,1/u,1/u,c,-b/2,-_/2);var q=Aie(this.pixelTransform);this.useContainer(r,q,this.getBackground(n));var Y=this.context,K=Y.canvas;Q5(this.inversePixelTransform,this.pixelTransform),hu(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()||ur(Y,g3),this.preRender(Y,n),this.renderedTiles.length=0;var se=Object.keys(I).map(Number);se.sort(rp);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(Rp(E),re),ee=p.getTileCoordExtent(X),ge=Cr(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 U=H[G],ie=U.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,$=xe&&U.getAlpha(vn(this),n.time)!==1,Me=!1;if(!$)if(te){pe=[z,B,z+V,B,z+V,B+de,z,B+de];for(var me=0,$e=te.length;me<$e;++me)if(m!==re&&re{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 nH&&(i=a,i.setTarget(r),this.clickEventsKey&&i.un("click",this.clickEventsKey.listener))}if(!i){const a=this.getMinZoom(r),s=new Uc({projection:aae,center:[0,0],minZoom:a,zoom:a});i=new nH({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(sae.Provider,{value:this.contextValue,children:this.props.children})),w.jsx("div",{ref:this.handleRef,style:rze,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 my 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(my,"contextType",sae);function lae(t,e,n){im(t,e,n,"visible",!0),im(t,e,n,"opacity",1),im(t,e,n,"zIndex",void 0),im(t,e,n,"extent",void 0),im(t,e,n,"minResolution",void 0),im(t,e,n,"maxResolution",void 0)}function im(t,e,n,r,i){const o=sH(e[r],i),a=sH(n[r],i);o!==a&&t.set(r,a)}function sH(t,e){return t===void 0?e:t}let So;So=()=>{};class cae extends my{addMapObject(e){const n=new oae(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 y3&&o instanceof y3){const c=i,u=o,f=c.getTileGrid(),d=u.getTileGrid();if(oze(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 lae(n,r,this.props),n}removeMapObject(e,n){e.getLayers().remove(n)}}new hy({url:"https://a.tiles.mapbox.com/v3/mapbox.natural-earth-2/{z}/{x}/{y}.png",attributions:["© MapBox","© MapBox and contributors"]});new hy({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 nze;new hy({url:"https://tiles.wmflabs.org/bw-mapnik/{z}/{x}/{y}.png",attributions:["© OpenStreetMap contributors"]});function oze(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||uu(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 x3(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 IC(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 y2(t,e){tt(2,arguments);var n=nt(t).getTime(),r=On(e);return new Date(n+r)}var aze=36e5;function sze(t,e){tt(2,arguments);var n=On(e);return y2(t,n*aze)}var lze={};function _d(){return lze}function ZA(t,e){var n,r,i,o,a,s,l,c;tt(1,arguments);var u=_d(),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 x2=6e4,b2=36e5,mze=1e3;function gze(t,e){tt(2,arguments);var n=ov(t),r=ov(e);return n.getTime()===r.getTime()}function vze(t){return tt(1,arguments),t instanceof Date||uu(t)==="object"&&Object.prototype.toString.call(t)==="[object Date]"}function fae(t){if(tt(1,arguments),!vze(t)&&typeof t!="number")return!1;var e=nt(t);return!isNaN(Number(e))}function yze(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 xze(t,e){tt(2,arguments);var n=nt(t),r=nt(e);return n.getFullYear()-r.getFullYear()}function cH(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 dae(t,e){tt(2,arguments);var n=nt(t),r=nt(e),i=cH(n,r),o=Math.abs(uze(n,r));n.setDate(n.getDate()-i*o);var a=+(cH(n,r)===-i),s=i*(o-a);return s===0?0:s}function _2(t,e){return tt(2,arguments),nt(t).getTime()-nt(e).getTime()}var uH={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}},bze="trunc";function Z1(t){return t?uH[t]:uH[bze]}function _ze(t,e,n){tt(2,arguments);var r=_2(t,e)/b2;return Z1(void 0)(r)}function wze(t,e,n){tt(2,arguments);var r=_2(t,e)/x2;return Z1(void 0)(r)}function b3(t){tt(1,arguments);var e=nt(t);return e.setHours(23,59,59,999),e}function _3(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 Sze(t){tt(1,arguments);var e=nt(t);return b3(e).getTime()===_3(e).getTime()}function hae(t,e){tt(2,arguments);var n=nt(t),r=nt(e),i=Xx(n,r),o=Math.abs(yze(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=Xx(n,r)===-i;Sze(nt(t))&&o===1&&Xx(t,r)===1&&(s=!1),a=i*(o-Number(s))}return a===0?0:a}function Oze(t,e,n){tt(2,arguments);var r=hae(t,e)/3;return Z1(void 0)(r)}function Cze(t,e,n){tt(2,arguments);var r=_2(t,e)/1e3;return Z1(void 0)(r)}function Tze(t,e,n){tt(2,arguments);var r=dae(t,e)/7;return Z1(void 0)(r)}function Eze(t,e){tt(2,arguments);var n=nt(t),r=nt(e),i=Xx(n,r),o=Math.abs(xze(n,r));n.setFullYear(1584),r.setFullYear(1584);var a=Xx(n,r)===-i,s=i*(o-Number(a));return s===0?0:s}function Pze(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=void 0)!==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 AS(t){tt(1,arguments);var e=nt(t);return e.setDate(1),e.setHours(0,0,0,0),e}function JA(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 RS(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 eR(t,e){var n,r,i,o,a,s,l,c;tt(1,arguments);var u=_d(),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 Aze(t){tt(1,arguments);var e=mae(t),n=new Date(0);n.setUTCFullYear(e,0,4),n.setUTCHours(0,0,0,0);var r=av(n);return r}var Rze=6048e5;function gae(t){tt(1,arguments);var e=nt(t),n=av(e).getTime()-Aze(e).getTime();return Math.round(n/Rze)+1}function ap(t,e){var n,r,i,o,a,s,l,c;tt(1,arguments);var u=_d(),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=ap(p,e),g=new Date(0);g.setUTCFullYear(f,0,h),g.setUTCHours(0,0,0,0);var v=ap(g,e);return u.getTime()>=m.getTime()?f+1:u.getTime()>=v.getTime()?f:f-1}function Ize(t,e){var n,r,i,o,a,s,l,c;tt(1,arguments);var u=_d(),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=FB(t,e),h=new Date(0);h.setUTCFullYear(d,0,f),h.setUTCHours(0,0,0,0);var p=ap(h,e);return p}var Dze=6048e5;function vae(t,e){tt(1,arguments);var n=nt(t),r=ap(n,e).getTime()-Ize(n,e).getTime();return Math.round(r/Dze)+1}function Ht(t,e){for(var n=t<0?"-":"",r=Math.abs(t).toString();r.length0?r:1-r;return Ht(n==="yy"?i%100:i,n.length)},M:function(e,n){var r=e.getUTCMonth();return n==="M"?String(r+1):Ht(r+1,2)},d:function(e,n){return Ht(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 Ht(e.getUTCHours()%12||12,n.length)},H:function(e,n){return Ht(e.getUTCHours(),n.length)},m:function(e,n){return Ht(e.getUTCMinutes(),n.length)},s:function(e,n){return Ht(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 Ht(o,n.length)}},om={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Lze={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 $u.y(e,n)},Y:function(e,n,r,i){var o=FB(e,i),a=o>0?o:1-o;if(n==="YY"){var s=a%100;return Ht(s,2)}return n==="Yo"?r.ordinalNumber(a,{unit:"year"}):Ht(a,n.length)},R:function(e,n){var r=mae(e);return Ht(r,n.length)},u:function(e,n){var r=e.getUTCFullYear();return Ht(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 Ht(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 Ht(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 $u.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 Ht(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=vae(e,i);return n==="wo"?r.ordinalNumber(o,{unit:"week"}):Ht(o,n.length)},I:function(e,n,r){var i=gae(e);return n==="Io"?r.ordinalNumber(i,{unit:"week"}):Ht(i,n.length)},d:function(e,n,r){return n==="do"?r.ordinalNumber(e.getUTCDate(),{unit:"date"}):$u.d(e,n)},D:function(e,n,r){var i=kze(e);return n==="Do"?r.ordinalNumber(i,{unit:"dayOfYear"}):Ht(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 Ht(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 Ht(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 Ht(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=om.noon:i===0?o=om.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=om.evening:i>=12?o=om.afternoon:i>=4?o=om.morning:o=om.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 $u.h(e,n)},H:function(e,n,r){return n==="Ho"?r.ordinalNumber(e.getUTCHours(),{unit:"hour"}):$u.H(e,n)},K:function(e,n,r){var i=e.getUTCHours()%12;return n==="Ko"?r.ordinalNumber(i,{unit:"hour"}):Ht(i,n.length)},k:function(e,n,r){var i=e.getUTCHours();return i===0&&(i=24),n==="ko"?r.ordinalNumber(i,{unit:"hour"}):Ht(i,n.length)},m:function(e,n,r){return n==="mo"?r.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):$u.m(e,n)},s:function(e,n,r){return n==="so"?r.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):$u.s(e,n)},S:function(e,n){return $u.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 dH(a);case"XXXX":case"XX":return Jd(a);case"XXXXX":case"XXX":default:return Jd(a,":")}},x:function(e,n,r,i){var o=i._originalDate||e,a=o.getTimezoneOffset();switch(n){case"x":return dH(a);case"xxxx":case"xx":return Jd(a);case"xxxxx":case"xxx":default:return Jd(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"+fH(a,":");case"OOOO":default:return"GMT"+Jd(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"+fH(a,":");case"zzzz":default:return"GMT"+Jd(a,":")}},t:function(e,n,r,i){var o=i._originalDate||e,a=Math.floor(o.getTime()/1e3);return Ht(a,n.length)},T:function(e,n,r,i){var o=i._originalDate||e,a=o.getTime();return Ht(a,n.length)}};function fH(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+Ht(o,2)}function dH(t,e){if(t%60===0){var n=t>0?"-":"+";return n+Ht(Math.abs(t)/60,2)}return Jd(t,e)}function Jd(t,e){var n=e||"",r=t>0?"-":"+",i=Math.abs(t),o=Ht(Math.floor(i/60),2),a=Ht(i%60,2);return r+o+n+a}var hH=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"})}},yae=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"})}},Nze=function(e,n){var r=e.match(/(P+)(p+)?/)||[],i=r[1],o=r[2];if(!o)return hH(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}}",hH(i,n)).replace("{{time}}",yae(o,n))},w3={p:yae,P:Nze},$ze=["D","DD"],Fze=["YY","YYYY"];function xae(t){return $ze.indexOf(t)!==-1}function bae(t){return Fze.indexOf(t)!==-1}function ZT(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 jze={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"}},Bze=function(e,n,r){var i,o=jze[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};function tR(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 zze={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Uze={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Wze={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Vze={date:tR({formats:zze,defaultWidth:"full"}),time:tR({formats:Uze,defaultWidth:"full"}),dateTime:tR({formats:Wze,defaultWidth:"full"})},Gze={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Hze=function(e,n,r,i){return Gze[e]};function S0(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 qze={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Xze={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Qze={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"]},Yze={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"]},Kze={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"}},Zze={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"}},Jze=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"},e4e={ordinalNumber:Jze,era:S0({values:qze,defaultWidth:"wide"}),quarter:S0({values:Xze,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:S0({values:Qze,defaultWidth:"wide"}),day:S0({values:Yze,defaultWidth:"wide"}),dayPeriod:S0({values:Kze,defaultWidth:"wide",formattingValues:Zze,defaultFormattingWidth:"wide"})};function O0(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)?n4e(s,function(f){return f.test(a)}):t4e(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 t4e(t,e){for(var n in t)if(t.hasOwnProperty(n)&&e(t[n]))return n}function n4e(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 i4e=/^(\d+)(th|st|nd|rd)?/i,o4e=/\d+/i,a4e={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},s4e={any:[/^b/i,/^(a|c)/i]},l4e={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},c4e={any:[/1/i,/2/i,/3/i,/4/i]},u4e={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},f4e={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]},d4e={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},h4e={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]},p4e={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},m4e={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}},g4e={ordinalNumber:r4e({matchPattern:i4e,parsePattern:o4e,valueCallback:function(e){return parseInt(e,10)}}),era:O0({matchPatterns:a4e,defaultMatchWidth:"wide",parsePatterns:s4e,defaultParseWidth:"any"}),quarter:O0({matchPatterns:l4e,defaultMatchWidth:"wide",parsePatterns:c4e,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:O0({matchPatterns:u4e,defaultMatchWidth:"wide",parsePatterns:f4e,defaultParseWidth:"any"}),day:O0({matchPatterns:d4e,defaultMatchWidth:"wide",parsePatterns:h4e,defaultParseWidth:"any"}),dayPeriod:O0({matchPatterns:p4e,defaultMatchWidth:"any",parsePatterns:m4e,defaultParseWidth:"any"})},w2={code:"en-US",formatDistance:Bze,formatLong:Vze,formatRelative:Hze,localize:e4e,match:g4e,options:{weekStartsOn:0,firstWeekContainsDate:1}},v4e=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,y4e=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,x4e=/^'([^]*?)'?$/,b4e=/''/g,_4e=/[a-zA-Z]/;function w4e(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=_d(),O=(r=(i=n==null?void 0:n.locale)!==null&&i!==void 0?i:S.locale)!==null&&r!==void 0?r:w2,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(!fae(k))throw new RangeError("Invalid time value");var I=KT(k),P=pae(k,I),R={firstWeekContainsDate:C,weekStartsOn:E,locale:O,_originalDate:k},T=_.match(y4e).map(function(L){var z=L[0];if(z==="p"||z==="P"){var B=w3[z];return B(L,O.formatLong)}return L}).join("").match(v4e).map(function(L){if(L==="''")return"'";var z=L[0];if(z==="'")return S4e(L);var B=Lze[z];if(B)return!(n!=null&&n.useAdditionalWeekYearTokens)&&bae(L)&&ZT(L,e,String(t)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&xae(L)&&ZT(L,e,String(t)),B(P,L,O.localize,R);if(z.match(_4e))throw new RangeError("Format string contains an unescaped latin alphabet character `"+z+"`");return L}).join("");return T}function S4e(t){var e=t.match(x4e);return e?e[1].replace(b4e,"'"):t}function O4e(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 C4e(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=Ht(i.getDate(),2),d=Ht(i.getMonth()+1,2),h=Ht(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=Ht(Math.floor(m/60),2),v=Ht(m%60,2),y=p<0?"+":"-";l="".concat(y).concat(g,":").concat(v)}else l="Z";var x=Ht(i.getHours(),2),b=Ht(i.getMinutes(),2),_=Ht(i.getSeconds(),2),S=s===""?"":"T",O=[x,b,_].join(u);s="".concat(s).concat(S).concat(O).concat(l)}return s}function T4e(t){tt(1,arguments);var e=nt(t),n=e.getDate();return n}function E4e(t){tt(1,arguments);var e=nt(t),n=e.getDay();return n}function _ae(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 P4e(t){tt(1,arguments);var e=nt(t),n=e.getHours();return n}function M4e(t){tt(1,arguments);var e=nt(t),n=e.getMinutes();return n}function k4e(t){tt(1,arguments);var e=nt(t),n=e.getMonth();return n}function A4e(t){tt(1,arguments);var e=nt(t),n=e.getSeconds();return n}function R4e(t){return tt(1,arguments),nt(t).getFullYear()}function IS(t,e){tt(2,arguments);var n=nt(t),r=nt(e);return n.getTime()>r.getTime()}function am(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=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,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var c=n.next();return a=c.done,c},e:function(c){s=!0,o=c},f:function(){try{a||n.return==null||n.return()}finally{if(s)throw o}}}}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&&ET(t,e)}function JT(t){return JT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},JT(t)}function Sae(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Sae=function(){return!!t})()}function D4e(t,e){if(e&&(uu(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=Sae();return function(){var n,r=JT(t);if(e){var i=JT(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return D4e(this,n)}}function tn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function L4e(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 Eae(t){return t%400===0||t%4===0&&t%100!==0}var B4e=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=Tae(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}(_n),z4e=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=FB(i,s);if(a.isTwoDigitYear){var c=Tae(a.year,l);return i.setUTCFullYear(c,0,s.firstWeekContainsDate),i.setUTCHours(0,0,0,0),ap(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),ap(i,s)}}]),n}(_n),U4e=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}(_n),G4e=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}(_n),H4e=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}(_n),q4e=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}(_n);function X4e(t,e,n){tt(2,arguments);var r=nt(t),i=On(e),o=vae(r,n)-i;return r.setUTCDate(r.getUTCDate()-o*7),r}var Q4e=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 ap(X4e(i,a,s),s)}}]),n}(_n);function Y4e(t,e){tt(2,arguments);var n=nt(t),r=On(e),i=gae(n)-r;return n.setUTCDate(n.getUTCDate()-i*7),n}var K4e=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 av(Y4e(i,a))}}]),n}(_n),Z4e=[31,28,31,30,31,30,31,31,30,31,30,31],J4e=[31,29,31,30,31,30,31,31,30,31,30,31],eUe=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<=J4e[l]:o>=1&&o<=Z4e[l]}},{key:"set",value:function(i,o,a){return i.setUTCDate(a),i.setUTCHours(0,0,0,0),i}}]),n}(_n),tUe=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}(_n);function BB(t,e,n){var r,i,o,a,s,l,c,u;tt(2,arguments);var f=_d(),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=BB(i,a,s),i.setUTCHours(0,0,0,0),i}}]),n}(_n),rUe=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=BB(i,a,s),i.setUTCHours(0,0,0,0),i}}]),n}(_n),iUe=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=BB(i,a,s),i.setUTCHours(0,0,0,0),i}}]),n}(_n);function oUe(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=oUe(i,a),i.setUTCHours(0,0,0,0),i}}]),n}(_n),sUe=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}(_n),fUe=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}(_n),dUe=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}(_n),hUe=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}(_n),pUe=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}(_n),mUe=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}(_n),gUe=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 F4e],T=O.match(SUe).map(function(te){var J=te[0];if(J in w3){var pe=w3[J];return pe(te,E.formatLong)}return te}).join("").match(wUe),L=[],z=pH(T),B;try{var U=function(){var J=B.value;!(r!=null&&r.useAdditionalWeekYearTokens)&&bae(J)&&ZT(J,O,t),!(r!=null&&r.useAdditionalDayOfYearTokens)&&xae(J)&&ZT(J,O,t);var pe=J[0],be=_Ue[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(EUe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+pe+"`");if(J==="''"?J="'":pe==="'"&&(J=MUe(J)),S.indexOf(J)===0)S=S.slice(J.length);else return{v:new Date(NaN)}}};for(z.s();!(B=z.n()).done;){var W=U();if(uu(W)==="object")return W.v}}catch(te){z.e(te)}finally{z.f()}if(S.length>0&&TUe.test(S))return new Date(NaN);var $=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]}),N=nt(n);if(isNaN(N.getTime()))return new Date(NaN);var D=pae(N,KT(N)),A={},q=pH($),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],O4e(A,se[1])):D=se}}catch(te){q.e(te)}finally{q.f()}return D}function MUe(t){return t.match(OUe)[1].replace(CUe,"'")}function mH(t){tt(1,arguments);var e=nt(t);return e.setMinutes(0,0,0),e}function kUe(t,e){tt(2,arguments);var n=mH(t),r=mH(e);return n.getTime()===r.getTime()}function AUe(t,e){tt(2,arguments);var n=nt(t),r=nt(e);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function RUe(t,e){tt(2,arguments);var n=nt(t),r=nt(e);return n.getFullYear()===r.getFullYear()}function IUe(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 Pae(t,e){var n;tt(1,arguments);var r=On((n=void 0)!==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=$Ue(t),o;if(i.date){var a=FUe(i.date,r);o=jUe(a.restDateString,a.year)}if(!o||isNaN(o.getTime()))return new Date(NaN);var s=o.getTime(),l=0,c;if(i.time&&(l=BUe(i.time),isNaN(l)))return new Date(NaN);if(i.timezone){if(c=zUe(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 DS={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},DUe=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,LUe=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,NUe=/^([+-])(\d{2})(?::?(\d{2}))?$/;function $Ue(t){var e={},n=t.split(DS.dateTimeDelimiter),r;if(n.length>2)return e;if(/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],DS.timeZoneDelimiter.test(e.date)&&(e.date=t.split(DS.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length))),r){var i=DS.timezone.exec(r);i?(e.time=r.replace(i[1],""),e.timezone=i[1]):e.time=r}return e}function FUe(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 jUe(t,e){if(e===null)return new Date(NaN);var n=t.match(DUe);if(!n)return new Date(NaN);var r=!!n[4],i=C0(n[1]),o=C0(n[2])-1,a=C0(n[3]),s=C0(n[4]),l=C0(n[5])-1;if(r)return HUe(e,s,l)?UUe(e,s,l):new Date(NaN);var c=new Date(0);return!VUe(e,o,a)||!GUe(e,i)?new Date(NaN):(c.setUTCFullYear(e,o,Math.max(i,a)),c)}function C0(t){return t?parseInt(t):1}function BUe(t){var e=t.match(LUe);if(!e)return NaN;var n=nR(e[1]),r=nR(e[2]),i=nR(e[3]);return qUe(n,r,i)?n*b2+r*x2+i*1e3:NaN}function nR(t){return t&&parseFloat(t.replace(",","."))||0}function zUe(t){if(t==="Z")return 0;var e=t.match(NUe);if(!e)return 0;var n=e[1]==="+"?-1:1,r=parseInt(e[2]),i=e[3]&&parseInt(e[3])||0;return XUe(r,i)?n*(r*b2+i*x2):NaN}function UUe(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 WUe=[31,null,31,30,31,30,31,31,30,31,30,31];function Mae(t){return t%400===0||t%4===0&&t%100!==0}function VUe(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(WUe[e]||(Mae(t)?29:28))}function GUe(t,e){return e>=1&&e<=(Mae(t)?366:365)}function HUe(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}function qUe(t,e,n){return t===24?e===0&&n===0:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}function XUe(t,e){return e>=0&&e<=59}function QUe(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=_ae(a);return n.setMonth(r,Math.min(o,s)),n}function YUe(t,e){tt(2,arguments);var n=nt(t),r=On(e);return n.setDate(r),n}function KUe(t,e){tt(2,arguments);var n=nt(t),r=On(e);return n.setHours(r),n}function ZUe(t,e){tt(2,arguments);var n=nt(t),r=On(e);return n.setMinutes(r),n}function JUe(t,e){tt(2,arguments);var n=nt(t),r=On(e);return n.setSeconds(r),n}function e6e(t,e){tt(2,arguments);var n=nt(t),r=On(e);return isNaN(n.getTime())?new Date(NaN):(n.setFullYear(r),n)}function kae(t){return t.getTimezoneOffset()*6e4}function t6e(t){return t.getTime()-kae(t)}function rR(t){const e=new Date(t);return new Date(e.getTime()+kae(e))}function Qb(t){return new Date(t).toISOString().substring(0,10)}function gy(t){return Aae(new Date(t).toISOString())}function Aae(t){return t.substring(0,19).replace("T"," ")}const Rae={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 n6e(t,e){return t===e?!0:t!==null&&e!=null?t[0]===e[0]&&t[1]===e[1]:!1}function r6e(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=gy(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]=bB(e,l)}),{colNames:o,dataRows:a,referencedPlaces:s}}function i6e(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=Pae(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 J1=t=>t.dataState.datasets||[],o6e=t=>t.dataState.colorBars,Iae=t=>t.dataState.timeSeriesGroups,ew=t=>t.dataState.userPlaceGroups,Dae=t=>t.dataState.userServers||[],a6e=t=>t.dataState.expressionCapabilities,s6e=t=>t.dataState.statistics.loading,l6e=t=>t.dataState.statistics.records,Lae=at(J1,ew,(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]}),c6e=at(Lae,t=>{const e=[];return t.forEach(n=>{const r=i6e(n);r!==null&&e.push(r)}),e}),u6e=[{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:[]}],f6e=u6e,zB="User";function tE(t){return t?`${t.group}: ${t.title}`:"-"}function nE(t,e){return t.find(n=>n.id===e)||null}function Nae(t="datasets"){const e=[];return f6e.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 $ae=Nae("datasets"),d6e=Nae("overlays"),h6e=$ae[0].id;var p6e=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)}}(),m6e=function(t){p6e(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(LS(n),this.adaptOptions(r))},e.prototype.readFeatureFromText=function(n,r){return yt()},e.prototype.readFeatures=function(n,r){return this.readFeaturesFromText(LS(n),this.adaptOptions(r))},e.prototype.readFeaturesFromText=function(n,r){return yt()},e.prototype.readGeometry=function(n,r){return this.readGeometryFromText(LS(n),this.adaptOptions(r))},e.prototype.readGeometryFromText=function(n,r){return yt()},e.prototype.readProjection=function(n){return this.readProjectionFromText(LS(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 yt()},e.prototype.writeFeatures=function(n,r){return this.writeFeaturesText(n,this.adaptOptions(r))},e.prototype.writeFeaturesText=function(n,r){return yt()},e.prototype.writeGeometry=function(n,r){return this.writeGeometryText(n,this.adaptOptions(r))},e.prototype.writeGeometryText=function(n,r){return yt()},e}(Gie);function LS(t){return typeof t=="string"?t:""}var g6e=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)}}(),v6e={POINT:ql,LINESTRING:zh,POLYGON:td,MULTIPOINT:c2,MULTILINESTRING:pB,MULTIPOLYGON:mB},Fae="EMPTY",jae="Z",Bae="M",y6e="ZM",mn={START:0,TEXT:1,LEFT_PAREN:2,RIGHT_PAREN:3,NUMBER:4,COMMA:5,EOF:6},x6e={Point:"POINT",LineString:"LINESTRING",Polygon:"POLYGON",MultiPoint:"MULTIPOINT",MultiLineString:"MULTILINESTRING",MultiPolygon:"MULTIPOLYGON",GeometryCollection:"GEOMETRYCOLLECTION",Circle:"CIRCLE"},b6e=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}(),_6e=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===jae?e=dn.XYZ:r===Bae?e=dn.XYM:r===y6e&&(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+" "+Fae:i+"("+r+")"}class P6e extends Error{}const Gae={separator:",",comment:"#",quote:'"',escape:"\\",trim:!0,nanToken:"NaN",trueToken:"true",falseToken:"false"};function Hae(t,e){return new M6e(e).parse(t)}let M6e=class{constructor(e){Yt(this,"options");this.options={...Gae,...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 gH(t){if(t=t.trim(),t==="")return"csv";if(t[0]==="{")return"geojson";const e=t.substring(0,20).toLowerCase();return R6e.find(r=>e.startsWith(r)&&(e.length===r.length||` - (`.indexOf(e[r.length])>=0))?"wkt":"csv"}function DC(t){return t.split(",").map(e=>e.trim().toLowerCase()).filter(e=>e!=="")}const I6e=t=>{if(t.trim()!=="")try{Hae(t)}catch(e){return console.error(e),`${e}`}return null},qae={name:"Text/CSV",fileExt:".txt,.csv",checkError:I6e},O3={...Gae,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 D6e=0,L6e=0;function N6e(t,e){const n=Hae(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=$6e(i),s=sm(a,e.groupNames),l=sm(a,e.labelNames),c=sm(a,e.timeNames),u=sm(a,e.xNames),f=sm(a,e.yNames);let d=sm(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=O3.groupPrefix);let m=e.labelPrefix.trim();m===""&&(m=O3.labelPrefix);let g="";if(s===-1){const S=++D6e;g=`${p}${S}`}const v=new zae,y={};let x=1,b=0,_=tp(0);for(;x=0&&(O=`${S[c]}`),s>=0&&(g=`${S[s]}`);let C=y[g];C||(C=vB(g,[]),y[g]=C,_=tp(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 ql([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=++L6e;I=`${m}${P}`}O!==""&&(k.time=O),k.color||(k.color=_),k.label||(k.label=I),k.source||(k.source="CSV"),C.features.push(yB(E,k))}return Object.getOwnPropertyNames(y).map(S=>y[S])}function $6e(t){const e={};for(let n=0;n{if(t.trim()!=="")try{JSON.parse(t)}catch(e){return console.error(e),`${e}`}return null},Xae={name:"GeoJSON",fileExt:".json,.geojson",checkError:F6e},C3={groupNames:"group, cruise, station, type",groupPrefix:"Group-",labelNames:"label, name, title, id",labelPrefix:"Place-",timeNames:"time, date, datetime, date-time"};let j6e=0,B6e=0;function z6e(t,e){const n=DC(e.groupNames||"");let r=e.groupPrefix.trim();r===""&&(r=C3.groupPrefix);const i=DC(e.labelNames||"");let o=e.labelPrefix.trim();o===""&&(o=C3.labelPrefix);const a=DC(e.timeNames||""),s=new Ip;let l;try{l=s.readFeatures(t)}catch{try{const d=s.readGeometry(t);l=[new zc(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=tp(0);if(d){const b={};Object.getOwnPropertyNames(d).forEach(_=>{b[_.toLowerCase()]=d[_]}),p=iR(b,a,p),g=iR(b,i,g),m=iR(b,n,m)}if(m===""){const b=++j6e;m=`${r}-${b}`}if(g===""){const b=++B6e;g=`${o}-${b}`}let y=c[m];y||(y=vB(m,[]),c[m]=y,v=tp(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(yB(h,x))}}),Object.getOwnPropertyNames(c).map(f=>c[f])}function iR(t,e,n){if(n===""){for(const r of e)if(t[r]==="string")return t[r]}return n}const U6e=t=>null,Qae={name:"WKT",fileExt:".txt,.wkt",checkError:U6e},T3={group:"",groupPrefix:"Group-",label:"",labelPrefix:"Place-",time:gy(new Date().getTime())};let W6e=0,V6e=0;function G6e(t,e){let n=e.groupPrefix.trim();n===""&&(n=T3.groupPrefix);let r=e.group.trim();if(r===""){const s=++W6e;r=`${n}${s}`}let i=e.labelPrefix.trim();i===""&&(i=T3.labelPrefix);let o=e.label.trim();if(o===""){const s=++V6e;o=`${i}${s}`}const a=e.time.trim();try{const s=new zae().readGeometry(t);let l={color:tp(Math.floor(1e3*Math.random())),label:o,source:"WKT"};a!==""&&(l={time:a,...l});const c=[yB(s,l)];return[vB(r,c)]}catch{throw new Error(fe.get("Invalid Geometry WKT"))}}function vy(t){return H6e("localStorage",t)}function H6e(t,e){try{const n=window[t],r="__storage_test__";return n.setItem(r,r),n.removeItem(r),new q6e(n,e)}catch{return null}}class q6e{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];nG(c)&&nG(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 X6e(t){const e=vy(Kt.instance.name);if(e)try{e.setObjectItem("userServers",t)}catch(n){console.warn(`failed to store user servers: ${n}`)}}function Q6e(){const t=vy(Kt.instance.name);if(t)try{return t.getObjectItem("userServers",[])}catch(e){console.warn(`failed to load user servers: ${e}`)}return[]}function Y6e(t){const e=vy(Kt.instance.name);if(e)try{e.setObjectItem("userVariables",t)}catch(n){console.warn(`failed to store user variables: ${n}`)}}function K6e(){const t=vy(Kt.instance.name);if(t)try{return t.getObjectItem("userVariables",{})}catch(e){console.warn(`failed to load user variables: ${e}`)}return{}}function ll(t){const e=vy(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 Z6e(t){const e=vy(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,J6e),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 vH={node:"continuous",continuous:"continuous",bound:"stepwise",stepwise:"stepwise",key:"categorical",categorical:"categorical"};function J6e(t){if(Array.isArray(t))return t.map(e=>({...e,type:eWe(e.type)}))}function eWe(t){return Mp(t)&&t in vH?vH[t]:"continuous"}const tWe=[250,500,1e3,2500],nWe=["info","timeSeries","stats","volume"];function rWe(){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:{...O3},geojson:{...C3},wkt:{...T3}},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||aae,imageSmoothingEnabled:!1,selectedBaseMapId:h6e,selectedOverlayId:null,userBaseMaps:[],userOverlays:[],userColorBars:[],exportTimeSeries:!0,exportTimeSeriesSeparator:"TAB",exportPlaces:!0,exportPlacesAsCollection:!0,exportZipArchive:!0,exportFileName:"export"};return Z6e(e)}const Ga={},iWe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAGUExURcDAwP///ytph7QAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAUSURBVBjTYwABQSCglEENMxgYGAAynwRB8BEAgQAAAABJRU5ErkJggg==",Yae=new Image;Yae.src=iWe;const E3="_alpha",P3="_r";function oWe(t){let e=t;const n=e.endsWith(E3);n&&(e=e.slice(0,e.length-E3.length));const r=e.endsWith(P3);return r&&(e=e.slice(0,e.length-P3.length)),{baseName:e,isAlpha:n,isReversed:r}}function rE(t){let e=t.baseName;return t.isReversed&&(e+=P3),t.isAlpha&&(e+=E3),e}function aWe(t,e,n){lWe(t,e).then(r=>{Promise.resolve(createImageBitmap(r)).then(i=>{const o=n.getContext("2d");if(o!==null){const a=o.createPattern(Yae,"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 sWe(t,e){return new Promise((n,r)=>{const i=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 lWe(t,e){return sWe(t).then(n=>{const r=cWe(t,e,n);if(r!==null)return r;throw new Error("failed to retrieve 2d context")})}function cWe(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,yy=t=>t.controlState.selectedVariableName,uWe=t=>t.controlState.selectedDataset2Id,Kae=t=>t.controlState.selectedVariable2Name,WB=t=>t.controlState.selectedPlaceGroupIds,xy=t=>t.controlState.selectedPlaceId,by=t=>t.controlState.selectedTime,fWe=t=>t.controlState.selectedServerId,dWe=t=>t.controlState.activities,S2=t=>t.controlState.timeAnimationActive,nw=t=>t.controlState.imageSmoothingEnabled,hWe=t=>t.controlState.userBaseMaps,pWe=t=>t.controlState.userOverlays,VB=t=>t.controlState.selectedBaseMapId,GB=t=>t.controlState.selectedOverlayId,mWe=t=>!!t.controlState.layerVisibilities.baseMap,gWe=t=>!!t.controlState.layerVisibilities.datasetBoundary,vWe=t=>!!t.controlState.layerVisibilities.datasetVariable,yWe=t=>!!t.controlState.layerVisibilities.datasetVariable2,xWe=t=>!!t.controlState.layerVisibilities.datasetRgb,bWe=t=>!!t.controlState.layerVisibilities.datasetRgb2,_We=t=>!!t.controlState.layerVisibilities.datasetPlaces,Zae=t=>!!t.controlState.layerVisibilities.userPlaces,wWe=t=>!!t.controlState.layerVisibilities.overlay,SWe=t=>t.controlState.layerVisibilities,Jae=t=>t.controlState.infoCardElementStates,wd=t=>t.controlState.mapProjection,OWe=t=>t.controlState.timeChunkSize,CWe=t=>t.controlState.userPlacesFormatName,TWe=t=>t.controlState.userPlacesFormatOptions.csv,EWe=t=>t.controlState.userPlacesFormatOptions.geojson,PWe=t=>t.controlState.userPlacesFormatOptions.wkt,Dp=t=>t.controlState.userColorBars,MWe=t=>Kt.instance.branding.allowUserVariables,kWe=()=>"variable",AWe=()=>"variable2",RWe=()=>"rgb",IWe=()=>"rgb2",DWe=()=>13,LWe=()=>12,NWe=()=>11,$We=()=>10,qr=at(J1,tw,Ub),Sd=at(J1,uWe,Ub),FWe=at(qr,t=>t&&t.variables||[]),jWe=at(qr,t=>t?gB(t)[1]:[]),ese=(t,e)=>!t||!e?null:s3(t,e),vo=at(qr,yy,ese),Su=at(Sd,Kae,ese),tse=t=>t&&(t.title||t.name),BWe=at(vo,tse),zWe=at(Su,tse),nse=t=>t&&t.units||"-",UWe=at(vo,nse),WWe=at(Su,nse),rse=t=>t&&t.colorBarName||"viridis",O2=at(vo,rse),C2=at(Su,rse),ise=t=>t?[t.colorBarMin,t.colorBarMax]:[0,1],ose=at(vo,ise),ase=at(Su,ise),sse=t=>(t&&t.colorBarNorm)==="log"?"log":"lin",lse=at(vo,sse),cse=at(Su,sse),T2=at(Dp,o6e,(t,e)=>{const n={title:doe,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,customColorMaps:{}}}),use=(t,e,n)=>{const r=oWe(t),{baseName:i}=r,o=e.images[i],a=n.find(s=>s.id===i);if(a){const s=a.type,l=poe(a.code);return{...r,imageData:o,type:s,colorRecords:l}}else{const s=e.customColorMaps[i];if(s){const l=s.type,c=s.colorRecords;return{...r,imageData:o,type:l,colorRecords:c}}}return{...r,imageData:o}},HB=at(O2,T2,Dp,use),fse=at(C2,T2,Dp,use),dse=(t,e,n)=>{const{baseName:r}=t,i=n.find(o=>o.id===r);if(i){const o=poe(i.code);if(o)return JSON.stringify({name:e,type:i.type,colors:o.map(a=>[a.value,a.color])})}return null},VWe=at(HB,O2,Dp,dse),GWe=at(fse,C2,Dp,dse),hse=t=>!t||typeof t.opacity!="number"?1:t.opacity,pse=at(vo,hse),mse=at(Su,hse),HWe=at(qr,t=>t!==null?coe(t):null),qWe=at(qr,t=>t!==null&&t.rgbSchema||null),XWe=at(Sd,t=>t!==null&&t.rgbSchema||null),gse=at(qr,t=>t&&t.placeGroups||[]),E2=at(gse,ew,(t,e)=>t.concat(e));function vse(t,e){const n=[];return e!==null&&e.length>0&&t.forEach(r=>{e.indexOf(r.id)>-1&&n.push(r)}),n}const QWe=at(ew,WB,Zae,(t,e)=>{const n={},r=new Set(e||[]);return t.forEach(i=>{n[i.id]=r.has(i.id)}),n}),yse=at(gse,WB,vse),_y=at(E2,WB,vse),YWe=at(_y,t=>t.map(e=>e.title||e.id).join(", ")),rw=at(_y,t=>{const e=t.map(n=>uy(n)?n.features:[]);return[].concat(...e)}),xse=at(rw,xy,(t,e)=>t.find(n=>n.id===e)||null),iw=at(_y,xy,(t,e)=>t.length===0||e===null?null:aFe(t,e)),KWe=at(tw,yy,xse,(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}),bse=at(Iae,tw,yy,xy,(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}),ZWe=at(Iae,E2,(t,e)=>{const n={};return xB(e,(r,i)=>{for(const o of t)if(o.timeSeriesArray.find(a=>a.source.placeId===i.id)){n[i.id]=u2(r,i);break}}),n}),_se=at(tw,yy,by,xy,(t,e,n,r)=>!!(t&&e&&n&&r)),JWe=at(l6e,E2,(t,e)=>{const n=[];return t.forEach(r=>{const i=r.source.placeInfo.place.id;xB(e,(o,a)=>{if(a.id===i){const s=u2(o,a);n.push({...r,source:{...r.source,placeInfo:s}})}})}),n}),eVe=at(_y,t=>{const e=[];return xB(t,(n,r)=>{e.push(u2(n,r).label)}),e}),tVe=at(vo,OWe,(t,e)=>{if(t&&t.timeChunkSize){const n=t.timeChunkSize;return n*Math.ceil(e/n)}return e}),wse=t=>t&&loe(t)||null,wy=at(qr,wse),nVe=at(Sd,wse),Sse=t=>t&&t.attributions||null,qB=at(qr,Sse),rVe=at(Sd,Sse),Ose=t=>t===null||t.coordinates.length===0?null:t.coordinates,M3=at(wy,Ose),iVe=at(wy,Ose),Cse=(t,e)=>t===null||e===null?-1:uae(e,t),Tse=at(by,M3,Cse),oVe=at(by,iVe,Cse),Ese=(t,e,n)=>t===null?null:n&&e>-1?n.labels[e]:new Date(t).toISOString(),Sy=at(by,Tse,wy,Ese),aVe=at(by,oVe,nVe,Ese);function sVe(t,e){if(t!==$B){const n=typeof e=="number"?e+1:20;return new LB({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 lVe(t,e,n,r,i,o,a,s,l){return new hy({url:t,projection:e,tileGrid:n,attributions:r||void 0,transition:i?0:250,imageSmoothing:o,tileLoadFunction:a,maxZoom:l})}function cVe(t){if(t)return(e,n)=>{e instanceof CB&&(t.getView().getInteracting()?t.once("moveend",function(){e.getImage().src=n}):e.getImage().src=n)}}const uVe=bFe(cVe,{serializer:t=>{const e=t[0];if(e){const n=e.getTarget();return typeof n=="string"?n:n&&n.id||"map"}return""}});function fVe(){const t=Ga.map;return uVe(t)}function Pse(t,e,n,r,i,o,a,s,l,c,u,f,d=10){s!==null&&(o=[...o,["time",s]]);const h=sy(e,o);typeof i=="number"&&(i+=3);const p=sVe(c,i),m=lVe(h,c,p,u,l,f,fVe(),r,i),g=c===py?n:zie(n,"EPSG:4326",c);return console.log("extent:",n,g),w.jsx(cae,{id:t,source:m,extent:g,zIndex:d,opacity:a})}const dVe=at(qr,wd,gWe,(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 Y1({features:new Ip({dataProjection:py,featureProjection:e}).readFeatures({type:"Feature",geometry:r})}),o=new Il({stroke:new Xl({color:"orange",width:3,lineDash:[2,4]})});return w.jsx(v2,{id:`${t.id}.bbox`,source:i,style:o,zIndex:16,opacity:.5})}),pi=at(Dae,fWe,(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}),Mse=(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]),Pse(f,Ase(t.url,e,i),e.bbox,i.tileLevelMin,i.tileLevelMax,g,c,n,h,p,r,m,d)},hVe=at(pi,qr,Sy,qB,vo,O2,ose,lse,VWe,pse,vWe,kWe,DWe,S2,wd,nw,Mse),pVe=at(pi,Sd,aVe,rVe,Su,C2,ase,cse,GWe,mse,yWe,AWe,LWe,S2,wd,nw,Mse),kse=(t,e,n,r,i,o,a,s,l,c,u)=>{if(!e||!n||!r)return null;const f=[["crs",l]];return Pse(i,Ase(t.url,e,"rgb"),e.bbox,n.tileLevelMin,n.tileLevelMax,f,1,a,s,l,c,u,o)},mVe=at(pi,qr,qWe,xWe,RWe,NWe,Sy,S2,wd,qB,nw,kse),gVe=at(pi,Sd,XWe,bWe,IWe,$We,Sy,S2,wd,qB,nw,kse);function Ase(t,e,n){return`${t}/tiles/${ly(e)}/${G1(n)}/{z}/{y}/{x}`}function vVe(){return I5()}function yVe(){return new X1({fill:Ise(),stroke:Rse(),radius:6})}function Rse(){return new Xl({color:[200,0,0,.75],width:1.25})}function Ise(){return new op({color:[255,0,0,vVe()]})}function xVe(){return new Il({image:yVe(),stroke:Rse(),fill:Ise()})}const bVe=at(yse,wd,_We,(t,e,n)=>{if(!n||t.length===0)return null;const r=[];return t.forEach((i,o)=>{uy(i)&&r.push(w.jsx(v2,{id:`placeGroup.${i.id}`,style:xVe(),zIndex:100,source:new Y1({features:new Ip({dataProjection:py,featureProjection:e}).readFeatures(i)})},o))}),w.jsx(iae,{children:r})}),_Ve=at(Jae,t=>{const e=[];return Object.getOwnPropertyNames(t).forEach(n=>{t[n].visible&&e.push(n)}),e}),wVe=at(Jae,t=>{const e={};return Object.getOwnPropertyNames(t).forEach(n=>{e[n]=t[n].viewMode||"text"}),e}),SVe=at(dWe,t=>Object.keys(t).map(e=>t[e])),XB=at(hWe,t=>[...t,...$ae]),QB=at(pWe,t=>[...t,...d6e]),Dse=(t,e,n,r)=>{if(!n||!e)return null;const i=nE(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 XBe({url:i.url,params:{...l?{STYLES:l}:{},LAYERS:s},attributions:o,attributionsCollapsible:!0})}else{const s=rLe(i.group);a=new hy({url:i.url+(s?`?${s.param}=${s.token}`:""),attributions:o,attributionsCollapsible:!0})}return w.jsx(cae,{id:i.id,source:a,zIndex:r})},OVe=at(XB,VB,mWe,()=>0,Dse),CVe=at(QB,GB,wWe,()=>20,Dse),Lse=(t,e)=>{const n=nE(t,e);return n?tE(n):null},TVe=at(XB,VB,Lse),EVe=at(QB,GB,Lse),PVe=at(TVe,EVe,VB,GB,qr,Sd,vo,Su,SWe,(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 Nse={exports:{}};/*! +`+p;Tc.get(m)===void 0&&(Tc.set(m,t,!0),s(u.style,u.weight,p)||(Tc.set(m,0,!0),o===void 0&&(o=setInterval(l,32))))}}}(),MFe=function(){var t;return function(e){var n=c3[e];if(n==null){if(o2){var r=Soe(e),i=Coe(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);c3[e]=n}return n}}();function Coe(t,e){return Fm||(Fm=Ca(1,1)),t!=l3&&(Fm.font=t,l3=Fm.font),Fm.measureText(e)}function qT(t,e){return Coe(t,e).width}function LG(t,e,n){if(e in n)return n[e];var r=e.split(` +`).reduce(function(i,o){return Math.max(i,qT(t,o))},0);return n[e]=r,r}function kFe(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=qT(d,f);n.push(h),a+=h;var p=MFe(d);r.push(p),l=Math.max(l,p)}return{width:o,height:s,widths:n,heights:r,lineWidths:i}}function AFe(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]),RFe(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 RFe(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}function zFe(t,e,n,r,i){Eoe(t,e,n||0,r||t.length-1,i||UFe)}function Eoe(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));Eoe(t,e,u,f,i)}var d=t[e],h=n,p=r;for(x0(t,n,e),i(t[r],d)>0&&x0(t,n,r);h0;)p--}i(t[n],d)===0?x0(t,n,p):(p++,x0(t,p,r)),p<=e&&(n=p+1),e<=p&&(r=p-1)}}function x0(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function UFe(t,e){return te?1:0}let Poe=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(!SS(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=jm(r.children.splice(a,r.children.length-a));s.height=r.height,s.leaf=r.leaf,tm(r,this.toBBox),tm(s,this.toBBox),n?e[n-1].children.push(s):this._splitRoot(r,s)}_splitRoot(e,n){this.data=jm([e,n]),this.data.height=e.height+1,this.data.leaf=!1,tm(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=cx(e,0,s,this.toBBox),c=cx(e,s,r,this.toBBox),u=qFe(l,c),f=$A(l)+$A(c);u=n;c--){const u=e.children[c];ux(s,e.leaf?o(u):u),l+=wS(s)}return l}_adjustParentBBoxes(e,n,r){for(let i=r;i>=0;i--)ux(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():tm(e[n],this.toBBox)}};function WFe(t,e,n){if(!n)return e.indexOf(t);for(let r=0;r=t.minX&&e.maxY>=t.minY}function jm(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function $G(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;zFe(t,a,e,n,i),o.push(e,a,a,n)}}var XFe=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)}}(),FG={RENDER_ORDER:"renderOrder"},QFe=function(t){XFe(e,t);function e(n){var r=this,i=n||{},o=ur({},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(FG.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 Poe(9)),this.getRenderer().renderDeclutter(n)},e.prototype.setRenderOrder=function(n){this.set(FG.RENDER_ORDER,n)},e.prototype.setStyle=function(n){this.style_=n!==void 0?n:NFe,this.styleFunction_=n===null?void 0:LFe(this.style_),this.changed()},e}(d2),_t={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},OS=[_t.FILL],Sf=[_t.STROKE],wh=[_t.BEGIN_PATH],jG=[_t.CLOSE_PATH],Moe=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}(),YFe=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)}}(),X1=function(t){YFe(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([_t.CUSTOM,l,u,n,i,wf]),this.hitDetectionInstructions.push([_t.CUSTOM,l,u,n,o||i,wf]));break;case"Point":c=n.getFlatCoordinates(),this.coordinates.push(c[0],c[1]),u=this.coordinates.length,this.instructions.push([_t.CUSTOM,l,u,n,i]),this.hitDetectionInstructions.push([_t.CUSTOM,l,u,n,o||i]);break}this.endGeometry(r)},e.prototype.beginGeometry=function(n,r){this.beginGeometryInstruction1_=[_t.BEGIN_GEOMETRY,r,0,n],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[_t.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=[_t.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[_t.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&&!kp(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=[_t.END_GEOMETRY,n];this.instructions.push(r),this.hitDetectionInstructions.push(r)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Aie(this.maxExtent),this.maxLineWidth>0)){var n=this.resolution*(this.maxLineWidth+1)/2;$b(this.bufferedMaxExtent_,n,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(Moe),KFe=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)}}(),ZFe=function(t){KFe(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([_t.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([_t.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([_t.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([_t.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}(X1),JFe=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)}}(),eje=function(t){JFe(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=[_t.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([_t.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,Ub,Wb],wh);var s=n.getFlatCoordinates(),l=n.getStride();this.drawFlatCoordinates_(s,0,s.length,l),this.hitDetectionInstructions.push(Sf),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([_t.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],wh);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 rje=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)}}(),Hx={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},ije=function(t){rje(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===FFe.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,U=(k+_)/2;return T[0]=[B,U,(C-o)/2,z,i],T}i=i.replace(/\n/g," ");for(var W=0,$=i.length;W<$;){y();var N=Math.atan2(h-m,d-p);if(I&&(N+=N>0?-R:R),z!==void 0){var D=N-z;if(D+=D>R?-2*R:D<-R?2*R:0,Math.abs(D)>a)return null}z=N;for(var A=W,q=0;W<$;++W){var Y=I?$-W-1:W,K=s*l(c,i[Y],u);if(e+r0&&t.push(` +`,""),t.push(e,""),t}var pje=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_=Hl(),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?Hx[l.justify]:VG(Array.isArray(e)?e[0]:e,l.textAlign||Hb),h=i&&a.lineWidth?a.lineWidth:0,p=f?e:e.split(` +`).reduce(hje,[]),m=kFe(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=o2?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,U=0,W,$=0,N=p.length;$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)&&(Ru[0]=O,Iu[0]=O,Ru[1]=C,mc[1]=C,mc[0]=O+_,gc[0]=mc[0],gc[1]=C+S,Iu[1]=gc[1]);var E;return f!==0?(E=hu(Hl(),r,i,1,1,f,-r,-i),Cr(E,Ru),Cr(E,mc),Cr(E,gc),Cr(E,Iu),Zs(Math.min(Ru[0],mc[0],gc[0],Iu[0]),Math.min(Ru[1],mc[1],gc[1],Iu[1]),Math.max(Ru[0],mc[0],gc[0],Iu[0]),Math.max(Ru[1],mc[1],gc[1],Iu[1]),nm)):Zs(Math.min(O,O+_),Math.min(C,C+S),Math.max(O,O+_),Math.max(C,C+S),nm),h&&(v=Math.round(v),y=Math.round(y)),{drawImageX:v,drawImageY:y,drawImageW:x,drawImageH:b,originX:c,originY:u,declutterBox:{minX:nm[0],minY:nm[1],maxX:nm[2],maxY:nm[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,Ru,mc,gc,Iu,a,s),AFe(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=Cr(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=VG(Array.isArray(e)?e[0]:e,o.textAlign||Hb),u=Hx[o.textBaseline||HT],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_&&kp(r,this.renderedTransform_)?c=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),c=Bh(this.coordinates,0,this.coordinates.length,2,r,this.pixelCoordinates_),W3e(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,U,W,$,N;uB&&(this.fill_(e),E=0),k>B&&(e.stroke(),k=0),!E&&!k&&(e.beginPath(),g=NaN,v=NaN),++u;break;case _t.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 _t.CLOSE_PATH:e.closePath(),++u;break;case _t.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=U,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 _t.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=_h,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(rp);var g,v,y,x,b;for(g=m.length-1;g>=0;--g){var _=m[g].toString();for(y=this.executorsByZIndex_[_],v=jA.length-1;v>=0;--v)if(h=jA[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 Bh(s,0,8,2,e,s),s},t.prototype.isEmpty=function(){return rv(this.executorsByZIndex_)},t.prototype.execute=function(e,n,r,i,o,a,s){var l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(rp),this.maxExtent_&&(e.save(),this.clip(e,r));var c=a||jA,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=HG(e,n,r);return i in this.cache_?this.cache_[i]:null},t.prototype.set=function(e,n,r,i){var o=HG(e,n,r);this.cache_[o]=i,++this.cacheSize_},t.prototype.setSize=function(e){this.maxCacheSize_=e,this.expire()},t}();function HG(t,e,n){var r=n?boe(n):"null";return e+":"+t+":"+r}var QT=new yje,xje=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)}}(),bje=function(t){xje(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 yt()},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(){yt()},e}(oy),_je=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){_je(e,t);function e(n,r,i,o,a,s){var l=t.call(this,n,r,i,Wn.IDLE)||this;return l.src_=o,l.image_=new Image,a!==null&&(l.image_.crossOrigin=a),l.unlisten_=null,l.state=Wn.IDLE,l.imageLoadFunction_=s,l}return e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=Wn.ERROR,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){this.resolution===void 0&&(this.resolution=ps(this.extent)/this.image_.height),this.state=Wn.LOADED,this.unlistenImage_(),this.changed()},e.prototype.load=function(){(this.state==Wn.IDLE||this.state==Wn.ERROR)&&(this.state=Wn.LOADING,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=SB(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(n){this.image_=n,this.resolution=ps(this.extent)/this.image_.height},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e})(bje);function SB(t,e,n){var r=t,i=!0,o=!1,a=!1,s=[LT(r,Mt.LOAD,function(){a=!0,o||e()})];return r.src&&z3e?(o=!0,r.decode().then(function(){i&&e()}).catch(function(l){i&&(a?e():n())})):s.push(LT(r,Mt.ERROR,n)),function(){i=!1,s.forEach(nr)}}var wje=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)}}(),b0=null,Sje=function(t){wje(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_===Wn.LOADED){b0||(b0=Ca(1,1)),b0.drawImage(this.image_,0,0);try{b0.getImageData(0,0,1,1),this.tainted_=!1}catch{b0=null,this.tainted_=!0}}return this.tainted_===!0},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(Mt.CHANGE)},e.prototype.handleImageError_=function(){this.imageState_=Wn.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=Wn.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_==Wn.IDLE){this.imageState_=Wn.LOADING;try{this.image_.src=this.src_}catch{this.handleImageError_()}this.unlisten_=SB(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(n){if(!(!this.color_||this.canvas_[n]||this.imageState_!==Wn.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=boe(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?Wn.IDLE:Wn.LOADED;return r.color_=i.color!==void 0?VT(i.color):null,r.iconImage_=Oje(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_==sf.FRACTION||this.anchorYUnits_==sf.FRACTION){if(!r)return null;n=this.anchor_.slice(),this.anchorXUnits_==sf.FRACTION&&(n[0]*=r[0]),this.anchorYUnits_==sf.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}(xoe),wl=.5;function Eje(t,e,n,r,i,o,a){var s=t[0]*wl,l=t[1]*wl,c=Ca(s,l);c.imageSmoothingEnabled=!1;for(var u=c.canvas,f=new vje(c,wl,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,wl,d,h,x).slice()),g-=v}this.hitDetectionImageData_=Eje(i,f,this.renderedFeatures_,u.getStyleFunction(),c,a,s)}r(Pje(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&&eg(this.wrappedRenderedExtent_,y))return kp(this.renderedExtent_,x)||(this.hitDetectionImageData_=null,this.renderedExtent_=x),this.renderedCenter_=v,this.replayGroupChanged=!1,!0;this.replayGroup_=null;var E=new zG(f3(d,h),y,d,h),k;this.getLayer().getDeclutter()&&(k=new zG(f3(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 YG(t,e){return function(n,r,i,o,a){var s=this;qje(t,e,n,r,i,function(l,c){s.addFeatures(l),o!==void 0&&o(l)},a||ip)}}var Loe=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)}}(),Du=function(t){Loe(e,t);function e(n,r,i){var o=t.call(this,n)||this;return o.feature=r,o.features=i,o}return e}(ac),Q1=function(t){Loe(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_=ip,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_=YG(r.url_,r.format_)),r.strategy_=i.strategy!==void 0?i.strategy:Gje;var o=i.useSpatialIndex!==void 0?i.useSpatialIndex:!0;r.featuresRtree_=o?new XG:null,r.loadedExtentsRtree_=new XG,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 Qa(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 Du(Ps.ADDFEATURE,n))},e.prototype.setupChangeEvents_=function(n,r){this.featureChangeKeys_[n]=[rn(r,Mt.CHANGE,this.handleFeatureChange_,this),rn(r,nv.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(Fb(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(nr),delete this.featureChangeKeys_[r];var o=n.getId();return o!==void 0&&delete this.idIndex_[o.toString()],delete this.uidIndex_[r],this.dispatchEvent(new Du(Ps.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(YG(n,this.format_))},e}(Doe);function Lu(t,e){return Cr(t.inversePixelTransform,e.slice(0))}const St={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function Noe(t){return Math.pow(t,3)}function fy(t){return 1-Noe(1-t)}function Xje(t){return 3*t*t-2*t*t*t}function Qje(t){return t}var Yje=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)}}(),$oe=function(t){Yje(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(){yt()},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:Noe(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}(oy),Kje=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)}}(),OB=function(t){Kje(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_=Zje(),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_=SB(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}($oe);function Zje(){var t=Ca(1,1);return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas}var Jje=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}(),e5e=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)}}(),t5e=function(t){e5e(e,t);function e(n){var r=t.call(this)||this;return r.map_=n,r}return e.prototype.dispatchRenderEvent=function(n,r){yt()},e.prototype.calculateMatrices2D=function(n){var r=n.viewState,i=n.coordinateToPixelTransform,o=n.pixelToCoordinateTransform;hu(i,n.size[0]/2,n.size[1]/2,1/r.resolution,-1/r.resolution,-r.rotation,-r.center[0],-r.center[1]),X5(o,i)},e.prototype.forEachFeatureAtCoordinate=function(n,r,i,o,a,s,l,c){var u,f=r.viewState;function d(L,z,B,U){return a.call(s,z,L?B:null,U)}var h=f.projection,p=Fie(n.slice(),h),m=[[0,0]];if(h.canWrapX()&&o){var g=h.getExtent(),v=Kn(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()&&XT(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 yt()},e.prototype.hasFeatureAtCoordinate=function(n,r,i,o,a,s){var l=this.forEachFeatureAtCoordinate(n,r,i,o,Fh,this,a,s);return l!==void 0},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(n){yt()},e.prototype.scheduleExpireIconCache=function(n){QT.canExpireCache()&&n.postRenderFunctions.push(n5e)},e}(H5);function n5e(t,e){QT.expire()}var r5e=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)}}(),i5e=function(t){r5e(e,t);function e(n){var r=t.call(this,n)||this;r.fontChangeListenerKey_=rn(Tc,nv.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=H1+" 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 koe(n,void 0,r);i.dispatchEvent(o)}},e.prototype.disposeInternal=function(){nr(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(Bf.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);CFe(this.element_,this.children_),this.dispatchRenderEvent(Bf.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()&&XT(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}(t5e),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)}}(),lf=function(t){Foe(e,t);function e(n,r){var i=t.call(this,n)||this;return i.layer=r,i}return e}(ac),zA={LAYERS:"layers"},o5e=function(t){Foe(e,t);function e(n){var r=this,i=n||{},o=ur({},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(zA.LAYERS,r.handleLayersChanged_),a?Array.isArray(a)?a=new Qa(a.slice(),{unique:!0}):Ut(typeof a.getArray=="function",43):a=new Qa(void 0,{unique:!0}),r.setLayers(a),r}return e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(nr),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(nr);F1(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_&&(nr(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(Mt.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(nr(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(nr),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(oy);const Yu={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},Ui={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"};var YT=1/0,u5e=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,F1(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!=YT?(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}(u5e);function h5e(t,e,n,r,i){if(!t||!(n in t.wantedTiles)||!t.wantedTiles[n][e.getKey()])return YT;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 Ms={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};var p5e=42,CB=256;function KG(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=Br(r[0],d,h),v=Br(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 m5e(t){return t}function TB(t,e,n,r){var i=Kn(e)/n[0],o=ps(e)/n[1];return r?Math.min(t,Math.max(i,o)):Math.min(t,Math.min(i,o))}function EB(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),Br(r,n/2,e*2)}function g5e(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?TB(l,n,a,r):l;if(s){var f=e!==void 0?e:!0;return f?EB(i,u,c):Br(i,c,u)}var d=Math.min(u,i),h=Math.floor(q5(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?jf(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&&CS(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]],tB(i,n-this.getRotation()),gNe(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&&JL(n,this.getProjection())},e.prototype.getCenterInternal=function(){return this.get(Ms.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 zie(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),QL(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(Ms.RESOLUTION)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(n,r){return this.getResolutionForExtentInternal(xh(n,this.getProjection()),r)},e.prototype.getResolutionForExtentInternal=function(n,r){var i=r||this.getViewportSizeMinusPadding_(),o=Kn(n)/i[0],a=ps(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(Ms.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=WA(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=q5(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=Br(Math.floor(n),0,this.resolutions_.length-2),i=this.resolutions_[r]/this.resolutions_[r+1];return this.resolutions_[r]/Math.pow(i,Br(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(!eB(n),25);var o=xh(n,this.getProjection());i=r3(o)}else if(n.getType()==="Circle"){var o=xh(n.getExtent(),this.getProjection());i=r3(o),i.rotate(this.getRotation(),ed(o))}else{var a=TNe();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),!kp(r,this.renderedAttributions_)){OFe(this.ulElement_);for(var o=0,a=r.length;o0&&i%(2*Math.PI)!==0?r.animate({rotation:0,duration:this.duration_,easing:fy}):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(_S);!a&&i===0?this.element.classList.add(_S):a&&i!==0&&this.element.classList.remove(_S)}this.label_.style.transform=o}this.rotation_=i}},e}(m2),I5e=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)}}(),D5e=function(t){I5e(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+" "+H1+" "+wB,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:fy})):i.setZoom(a)}}},e}(m2),L5e=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)}}(),VA="units",jd={DEGREES:"degrees",IMPERIAL:"imperial",NAUTICAL:"nautical",METRIC:"metric",US:"us"},N5e=[1,2,5],_0=25.4/.28,$5e=function(t){L5e(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+" "+H1,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(VA,r.handleUnitsChanged_),r.setUnits(i.units||jd.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(VA)},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(n){this.set(VA,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==jd.DEGREES?ci.DEGREES:ci.METERS,s=FT(i,n.resolution,r,a),l=this.minWidth_*(this.dpi_||_0)/_0,c=this.maxWidth_!==void 0?this.maxWidth_*(this.dpi_||_0)/_0:void 0,u=l*s,f="";if(o==jd.DEGREES){var d=Ks[ci.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=FT(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,ci.METERS),r=this.dpi_||_0,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}(m2);function F5e(t){var e={},n=new Qa,r=e.zoom!==void 0?e.zoom:!0;r&&n.push(new D5e(e.zoomOptions));var i=e.rotate!==void 0?e.rotate:!0;i&&n.push(new R5e(e.rotateOptions));var o=e.attribution!==void 0?e.attribution:!0;return o&&n.push(new k5e(e.attributionOptions)),n}const h3={ACTIVE:"active"};var j5e=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)}}(),Y1=function(t){j5e(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(h3.ACTIVE)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(n){return!0},e.prototype.setActive=function(n){this.set(h3.ACTIVE,n)},e.prototype.setMap=function(n){this.map_=n},e}(sc);function B5e(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:Qje,center:t.getConstrainedCenter(i)})}}function MB(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:fy})}}var z5e=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)}}(),U5e=function(t){z5e(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==Sn.DBLCLICK){var i=n.originalEvent,o=n.map,a=n.coordinate,s=i.shiftKey?-this.delta_:this.delta_,l=o.getView();MB(l,s,a,this.duration_),i.preventDefault(),r=!0}return!r},e}(Y1),W5e=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)}}(),dy=function(t){W5e(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==Sn.POINTERDRAG)this.handleDragEvent(n),n.originalEvent.preventDefault();else if(n.type==Sn.POINTERUP){var i=this.handleUpEvent(n);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(n.type==Sn.POINTERDOWN){var o=this.handleDownEvent(n);this.handlingDownUpSequence=o,r=this.stopDown(o)}else n.type==Sn.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}(Y1);function kB(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}(dy),Q5e=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)}}(),Y5e=function(t){Q5e(e,t);function e(n){var r=this,i=n||{};return r=t.call(this,{stopDown:$1})||this,r.condition_=i.condition?i.condition:V5e,r.lastAngle_=void 0,r.duration_=i.duration!==void 0?i.duration:250,r}return e.prototype.handleDragEvent=function(n){if(GA(n)){var r=n.map,i=r.getView();if(i.getConstraints().rotation!==PB){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(!GA(n))return!0;var r=n.map,i=r.getView();return i.endInteraction(this.duration_),!1},e.prototype.handleDownEvent=function(n){if(!GA(n))return!1;if(Woe(n)&&this.condition_(n)){var r=n.map;return r.getView().beginInteraction(),this.lastAngle_=void 0,!0}else return!1},e}(dy),K5e=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)}}(),Z5e=function(t){K5e(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 td([o])},e.prototype.getGeometry=function(){return this.geometry_},e}(H5),Hoe=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)}}(),TS={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"},HA=function(t){Hoe(e,t);function e(n,r,i){var o=t.call(this,n)||this;return o.coordinate=r,o.mapBrowserEvent=i,o}return e}(ac),J5e=function(t){Hoe(e,t);function e(n){var r=t.call(this)||this;r.on,r.once,r.un;var i=n||{};return r.box_=new Z5e(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:Woe,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 HA(TS.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 HA(r?TS.BOXEND:TS.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 HA(TS.BOXSTART,n.coordinate,n)),!0):!1},e.prototype.onBoxEnd=function(n){},e}(dy),eBe=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)}}(),tBe=function(t){eBe(e,t);function e(n){var r=this,i=n||{},o=i.condition?i.condition:Voe;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:fy})},e}(J5e);const Bd={LEFT:37,UP:38,RIGHT:39,DOWN:40};var nBe=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)}}(),rBe=function(t){nBe(e,t);function e(n){var r=t.call(this)||this,i=n||{};return r.defaultCondition_=function(o){return AB(o)&&Goe(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==Bd.DOWN||o==Bd.LEFT||o==Bd.RIGHT||o==Bd.UP)){var a=n.map,s=a.getView(),l=s.getResolution()*this.pixelDelta_,c=0,u=0;o==Bd.DOWN?u=-l:o==Bd.LEFT?c=-l:o==Bd.RIGHT?c=l:u=l;var f=[c,u];tB(f,s.getRotation()),B5e(s,f,this.duration_),i.preventDefault(),r=!0}}return!r},e}(Y1),iBe=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)}}(),oBe=function(t){iBe(e,t);function e(n){var r=t.call(this)||this,i=n||{};return r.condition_=i.condition?i.condition:Goe,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();MB(l,s,void 0,this.duration_),i.preventDefault(),r=!0}}return!r},e}(Y1),aBe=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)}}(),qA={TRACKPAD:"trackpad",WHEEL:"wheel"},sBe=function(t){aBe(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:Uoe;return r.condition_=i.onFocusOnly?p3(zoe,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,$3e&&o.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(a/=Pie),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?qA.TRACKPAD:qA.WHEEL);var l=i.getView();if(this.mode_===qA.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=-Br(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(r.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),MB(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}(Y1),lBe=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)}}(),cBe=function(t){lBe(e,t);function e(n){var r=this,i=n||{},o=i;return o.stopDown||(o.stopDown=$1),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!==PB){var u=l.getViewport().getBoundingClientRect(),f=kB(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}(dy),uBe=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)}}(),fBe=function(t){uBe(e,t);function e(n){var r=this,i=n||{},o=i;return o.stopDown||(o.stopDown=$1),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=kB(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}(dy),dBe=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)}}(),RB=function(t){dBe(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:Y5(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===Sn.POINTERDRAG&&this.sketchFeature_!==null?(this.addToDrawing_(n.coordinate),i=!1):this.freehand_&&n.type===Sn.POINTERDOWN?i=!1:r&&this.getPointerCount()<2?(i=n.type===Sn.POINTERMOVE,i&&this.freehand_?(this.handlePointerMove_(n),this.shouldHandle_&&n.originalEvent.preventDefault()):(n.originalEvent.pointerType==="mouse"||n.type===Sn.POINTERDRAG&&this.downTimeout_===void 0)&&this.handlePointerMove_(n)):n.type===Sn.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 Ac(Sn.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 c2([r])):this.type_==="MultiLineString"?n.setGeometry(new hB([r])):this.type_==="MultiPolygon"&&n.setGeometry(new pB([r])),this.dispatchEvent(new PS(ES.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 PS(ES.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}();function tH(t,e,n,r){return r!==void 0?(r[0]=t,r[1]=e,r[2]=n,r):[t,e,n]}function g2(t,e,n){return t+"/"+e+"/"+n}function Xoe(t){return g2(t[0],t[1],t[2])}function xBe(t){return t.split("/").map(Number)}function Qoe(t){return(t[1]<n||n>e.getMaxZoom())return!1;var o=e.getFullTileRange(n);return o?o.containsXY(r,i):!0}var _Be=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){_Be(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=xBe(n),i=r[0];this.forEach((function(o){o.tileCoord[0]!==i&&(this.remove(Xoe(o.tileCoord)),o.release())}).bind(this))}},e}(yBe),IB=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 rm(t,e,n,r,i){return i!==void 0?(i.minX=t,i.maxX=e,i.minY=n,i.maxY=r,i):new IB(t,e,n,r)}var wBe=.5,SBe=10,nH=.25,OBe=function(){function t(e,n,r,i,o,a){this.sourceProj_=e,this.targetProj_=n;var s={},l=jb(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()&&Kn(i)==Kn(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Kn(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Kn(this.targetProj_.getExtent()):null;var c=Rp(r),u=J5(r),f=Z5(r),d=K5(r),h=this.transformInv_(c),p=this.transformInv_(u),m=this.transformInv_(f),g=this.transformInv_(d),v=SBe+(a?Math.max(0,Math.ceil(tNe(XL(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=mG([e,n,r,i]),g=Kn(m)/this.targetWorldWidth_;p=g>nH||p}!h&&this.sourceProj_.isGlobal()&&f&&(p=f>nH||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 _=(jf(o[0],d)+jf(s[0],d))/2;b=_-jf(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;Vx(e,o[0]),Vx(e,o[1]),Vx(e,o[2])}),e},t.prototype.getTriangles=function(){return this.triangles_},t}(),m3={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1},CBe={imageSmoothingEnabled:!0,msImageSmoothingEnabled:!0},XA,Koe=[];function rH(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 QA(t,e){return Math.abs(t[e*4]-210)>2||Math.abs(t[e*4+3]-.75*255)>2}function TBe(){if(XA===void 0){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",rH(t,4,5,4,0),rH(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;XA=QA(e,0)||QA(e,4)||QA(e,8)}return XA}function g3(t,e,n,r){var i=a2(n,e,t),o=FT(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||B1(l,i)){var c=FT(t,o,i)/o;isFinite(c)&&c>0&&(o/=c)}return o}function EBe(t,e,n,r){var i=ed(n),o=g3(t,e,i,r);return(!isFinite(o)||o<=0)&&Y5(n,function(a){return o=g3(t,e,a,r),isFinite(o)&&o>0}),o}function PBe(t,e,n,r,i,o,a,s,l,c,u,f){var d=Ca(Math.round(n*t),Math.round(n*e),Koe);if(f||ur(d,m3),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){Iie(p,b.extent)});var m=Kn(p),g=ps(p),v=Ca(Math.round(n*m/r),Math.round(n*g/r));f||ur(v,m3);var y=n/r;l.forEach(function(b,_,S){var O=b.extent[0]-p[0],C=-(b.extent[3]-p[3]),E=Kn(b.extent),k=ps(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=Rp(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),U=h(-(C[1][1]-x[1])/o),W=h((C[2][0]-x[0])/o),$=h(-(C[2][1]-x[1])/o),N=E,D=k;E=0,k=0,I-=N,P-=D,R-=N,T-=D;var A=[[I,P,0,0,B-L],[R,T,0,0,W-L],[0,0,I,P,U-z],[0,0,R,T,$-z]],q=rNe(A);if(q){if(d.save(),d.beginPath(),TBe()||!f){d.moveTo(B,U);for(var Y=4,K=L-B,se=z-U,te=0;te=this.minZoom;){if(this.zoomFactor_===2?(a=Math.floor(a/2),s=Math.floor(s/2),o=rm(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}(Doe),NBe=function(t){tae(e,t);function e(n,r){var i=t.call(this,n)||this;return i.tile=r,i}return e}(ac);function $Be(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 FBe(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=fa(o.getTileSize(n[0]),this.tmpSize),c=this.gutter_;c!==0&&(l=MG(l,c,this.tmpSize),s=$b(s,a*c,s)),r!=1&&(l=yoe(l,r,this.tmpSize));var u={SERVICE:"WMS",VERSION:MS,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};return ur(u,this.params_),this.getRequestUrl_(n,l,s,r,i,u)}},e}(nae);function rae(t){return w.jsx(M.Fragment,{children:t.children})}const kS={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};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)}}(),XBe=function(t){qBe(e,t);function e(n){var r=this,i=n||{},o=ur({},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(kS.PRELOAD)},e.prototype.setPreload=function(n){this.set(kS.PRELOAD,n)},e.prototype.getUseInterimTilesOnError=function(){return this.get(kS.USE_INTERIM_TILES_ON_ERROR)},e.prototype.setUseInterimTilesOnError=function(n){this.set(kS.USE_INTERIM_TILES_ON_ERROR,n)},e.prototype.getData=function(n){return t.prototype.getData.call(this,n)},e}(d2),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)}}(),YBe=function(t){QBe(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 IB(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=Cr(r.pixelToCoordinateTransform,n.slice()),a=i.getExtent();if(a&&!B1(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 OB||m instanceof Zoe))return null;if(m.getState()===St.LOADED){var g=f.getOrigin(h),v=fa(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(Kn(v)/y*u),_=Math.round(ps(v)/y*u),S=i.extent&&xh(i.extent);S&&(v=Gx(v,xh(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?YL(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 U=this.getTile(m,z,B,n);if(this.isDrawableTile(U)){var W=vn(this);if(U.getState()==St.LOADED){I[m][U.tileCoord.toString()]=U;var $=U.inTransition(W);$&&i.opacity!==1&&(U.endTransition(W),$=!1),!this.newTiles_&&($||this.renderedTiles.indexOf(U)===-1)&&(this.newTiles_=!0)}if(U.getAlpha(W,n.time)===1)continue}var N=p.getTileCoordChildTileRange(U.tileCoord,T,R),D=!1;N&&(D=P(m+1,N)),D||p.forEachTileCoordParentTileRange(U.tileCoord,P,T,R)}var A=g/s*u/x;hu(this.pixelTransform,n.size[0]/2,n.size[1]/2,1/u,1/u,c,-b/2,-_/2);var q=kie(this.pixelTransform);this.useContainer(r,q,this.getBackground(n));var Y=this.context,K=Y.canvas;X5(this.inversePixelTransform,this.pixelTransform),hu(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()||ur(Y,m3),this.preRender(Y,n),this.renderedTiles.length=0;var se=Object.keys(I).map(Number);se.sort(rp);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(Rp(E),re),ee=p.getTileCoordExtent(X),ge=Cr(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 U=H[G],ie=U.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,$=xe&&U.getAlpha(vn(this),n.time)!==1,Me=!1;if(!$)if(te){pe=[z,B,z+V,B,z+V,B+de,z,B+de];for(var me=0,$e=te.length;me<$e;++me)if(m!==re&&re{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 eH&&(i=a,i.setTarget(r),this.clickEventsKey&&i.un("click",this.clickEventsKey.listener))}if(!i){const a=this.getMinZoom(r),s=new Uc({projection:oae,center:[0,0],minZoom:a,zoom:a});i=new eH({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(aae.Provider,{value:this.contextValue,children:this.props.children})),w.jsx("div",{ref:this.handleRef,style:tze,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 my 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(my,"contextType",aae);function sae(t,e,n){im(t,e,n,"visible",!0),im(t,e,n,"opacity",1),im(t,e,n,"zIndex",void 0),im(t,e,n,"extent",void 0),im(t,e,n,"minResolution",void 0),im(t,e,n,"maxResolution",void 0)}function im(t,e,n,r,i){const o=oH(e[r],i),a=oH(n[r],i);o!==a&&t.set(r,a)}function oH(t,e){return t===void 0?e:t}let So;So=()=>{};class lae extends my{addMapObject(e){const n=new iae(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 v3&&o instanceof v3){const c=i,u=o,f=c.getTileGrid(),d=u.getTileGrid();if(rze(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 sae(n,r,this.props),n}removeMapObject(e,n){e.getLayers().remove(n)}}new hy({url:"https://a.tiles.mapbox.com/v3/mapbox.natural-earth-2/{z}/{x}/{y}.png",attributions:["© MapBox","© MapBox and contributors"]});new hy({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 eze;new hy({url:"https://tiles.wmflabs.org/bw-mapnik/{z}/{x}/{y}.png",attributions:["© OpenStreetMap contributors"]});function rze(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||uu(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 y3(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 IC(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 y2(t,e){tt(2,arguments);var n=nt(t).getTime(),r=On(e);return new Date(n+r)}var ize=36e5;function oze(t,e){tt(2,arguments);var n=On(e);return y2(t,n*ize)}var aze={};function _d(){return aze}function KA(t,e){var n,r,i,o,a,s,l,c;tt(1,arguments);var u=_d(),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 x2=6e4,b2=36e5,hze=1e3;function pze(t,e){tt(2,arguments);var n=ov(t),r=ov(e);return n.getTime()===r.getTime()}function mze(t){return tt(1,arguments),t instanceof Date||uu(t)==="object"&&Object.prototype.toString.call(t)==="[object Date]"}function uae(t){if(tt(1,arguments),!mze(t)&&typeof t!="number")return!1;var e=nt(t);return!isNaN(Number(e))}function gze(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 vze(t,e){tt(2,arguments);var n=nt(t),r=nt(e);return n.getFullYear()-r.getFullYear()}function sH(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 fae(t,e){tt(2,arguments);var n=nt(t),r=nt(e),i=sH(n,r),o=Math.abs(lze(n,r));n.setDate(n.getDate()-i*o);var a=+(sH(n,r)===-i),s=i*(o-a);return s===0?0:s}function _2(t,e){return tt(2,arguments),nt(t).getTime()-nt(e).getTime()}var lH={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}},yze="trunc";function K1(t){return t?lH[t]:lH[yze]}function xze(t,e,n){tt(2,arguments);var r=_2(t,e)/b2;return K1(void 0)(r)}function bze(t,e,n){tt(2,arguments);var r=_2(t,e)/x2;return K1(void 0)(r)}function x3(t){tt(1,arguments);var e=nt(t);return e.setHours(23,59,59,999),e}function b3(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 _ze(t){tt(1,arguments);var e=nt(t);return x3(e).getTime()===b3(e).getTime()}function dae(t,e){tt(2,arguments);var n=nt(t),r=nt(e),i=qx(n,r),o=Math.abs(gze(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=qx(n,r)===-i;_ze(nt(t))&&o===1&&qx(t,r)===1&&(s=!1),a=i*(o-Number(s))}return a===0?0:a}function wze(t,e,n){tt(2,arguments);var r=dae(t,e)/3;return K1(void 0)(r)}function Sze(t,e,n){tt(2,arguments);var r=_2(t,e)/1e3;return K1(void 0)(r)}function Oze(t,e,n){tt(2,arguments);var r=fae(t,e)/7;return K1(void 0)(r)}function Cze(t,e){tt(2,arguments);var n=nt(t),r=nt(e),i=qx(n,r),o=Math.abs(vze(n,r));n.setFullYear(1584),r.setFullYear(1584);var a=qx(n,r)===-i,s=i*(o-Number(a));return s===0?0:s}function Tze(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=void 0)!==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 AS(t){tt(1,arguments);var e=nt(t);return e.setDate(1),e.setHours(0,0,0,0),e}function ZA(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 RS(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 JA(t,e){var n,r,i,o,a,s,l,c;tt(1,arguments);var u=_d(),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 Mze(t){tt(1,arguments);var e=pae(t),n=new Date(0);n.setUTCFullYear(e,0,4),n.setUTCHours(0,0,0,0);var r=av(n);return r}var kze=6048e5;function mae(t){tt(1,arguments);var e=nt(t),n=av(e).getTime()-Mze(e).getTime();return Math.round(n/kze)+1}function ap(t,e){var n,r,i,o,a,s,l,c;tt(1,arguments);var u=_d(),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=ap(p,e),g=new Date(0);g.setUTCFullYear(f,0,h),g.setUTCHours(0,0,0,0);var v=ap(g,e);return u.getTime()>=m.getTime()?f+1:u.getTime()>=v.getTime()?f:f-1}function Aze(t,e){var n,r,i,o,a,s,l,c;tt(1,arguments);var u=_d(),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=$B(t,e),h=new Date(0);h.setUTCFullYear(d,0,f),h.setUTCHours(0,0,0,0);var p=ap(h,e);return p}var Rze=6048e5;function gae(t,e){tt(1,arguments);var n=nt(t),r=ap(n,e).getTime()-Aze(n,e).getTime();return Math.round(r/Rze)+1}function Ht(t,e){for(var n=t<0?"-":"",r=Math.abs(t).toString();r.length0?r:1-r;return Ht(n==="yy"?i%100:i,n.length)},M:function(e,n){var r=e.getUTCMonth();return n==="M"?String(r+1):Ht(r+1,2)},d:function(e,n){return Ht(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 Ht(e.getUTCHours()%12||12,n.length)},H:function(e,n){return Ht(e.getUTCHours(),n.length)},m:function(e,n){return Ht(e.getUTCMinutes(),n.length)},s:function(e,n){return Ht(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 Ht(o,n.length)}},om={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Ize={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 $u.y(e,n)},Y:function(e,n,r,i){var o=$B(e,i),a=o>0?o:1-o;if(n==="YY"){var s=a%100;return Ht(s,2)}return n==="Yo"?r.ordinalNumber(a,{unit:"year"}):Ht(a,n.length)},R:function(e,n){var r=pae(e);return Ht(r,n.length)},u:function(e,n){var r=e.getUTCFullYear();return Ht(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 Ht(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 Ht(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 $u.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 Ht(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=gae(e,i);return n==="wo"?r.ordinalNumber(o,{unit:"week"}):Ht(o,n.length)},I:function(e,n,r){var i=mae(e);return n==="Io"?r.ordinalNumber(i,{unit:"week"}):Ht(i,n.length)},d:function(e,n,r){return n==="do"?r.ordinalNumber(e.getUTCDate(),{unit:"date"}):$u.d(e,n)},D:function(e,n,r){var i=Pze(e);return n==="Do"?r.ordinalNumber(i,{unit:"dayOfYear"}):Ht(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 Ht(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 Ht(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 Ht(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=om.noon:i===0?o=om.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=om.evening:i>=12?o=om.afternoon:i>=4?o=om.morning:o=om.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 $u.h(e,n)},H:function(e,n,r){return n==="Ho"?r.ordinalNumber(e.getUTCHours(),{unit:"hour"}):$u.H(e,n)},K:function(e,n,r){var i=e.getUTCHours()%12;return n==="Ko"?r.ordinalNumber(i,{unit:"hour"}):Ht(i,n.length)},k:function(e,n,r){var i=e.getUTCHours();return i===0&&(i=24),n==="ko"?r.ordinalNumber(i,{unit:"hour"}):Ht(i,n.length)},m:function(e,n,r){return n==="mo"?r.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):$u.m(e,n)},s:function(e,n,r){return n==="so"?r.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):$u.s(e,n)},S:function(e,n){return $u.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 uH(a);case"XXXX":case"XX":return Jd(a);case"XXXXX":case"XXX":default:return Jd(a,":")}},x:function(e,n,r,i){var o=i._originalDate||e,a=o.getTimezoneOffset();switch(n){case"x":return uH(a);case"xxxx":case"xx":return Jd(a);case"xxxxx":case"xxx":default:return Jd(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"+cH(a,":");case"OOOO":default:return"GMT"+Jd(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"+cH(a,":");case"zzzz":default:return"GMT"+Jd(a,":")}},t:function(e,n,r,i){var o=i._originalDate||e,a=Math.floor(o.getTime()/1e3);return Ht(a,n.length)},T:function(e,n,r,i){var o=i._originalDate||e,a=o.getTime();return Ht(a,n.length)}};function cH(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+Ht(o,2)}function uH(t,e){if(t%60===0){var n=t>0?"-":"+";return n+Ht(Math.abs(t)/60,2)}return Jd(t,e)}function Jd(t,e){var n=e||"",r=t>0?"-":"+",i=Math.abs(t),o=Ht(Math.floor(i/60),2),a=Ht(i%60,2);return r+o+n+a}var fH=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"})}},vae=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"})}},Dze=function(e,n){var r=e.match(/(P+)(p+)?/)||[],i=r[1],o=r[2];if(!o)return fH(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}}",fH(i,n)).replace("{{time}}",vae(o,n))},_3={p:vae,P:Dze},Lze=["D","DD"],Nze=["YY","YYYY"];function yae(t){return Lze.indexOf(t)!==-1}function xae(t){return Nze.indexOf(t)!==-1}function ZT(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 $ze={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"}},Fze=function(e,n,r){var i,o=$ze[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};function eR(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 jze={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Bze={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},zze={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Uze={date:eR({formats:jze,defaultWidth:"full"}),time:eR({formats:Bze,defaultWidth:"full"}),dateTime:eR({formats:zze,defaultWidth:"full"})},Wze={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Vze=function(e,n,r,i){return Wze[e]};function w0(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 Gze={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Hze={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},qze={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"]},Xze={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"]},Qze={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"}},Yze={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"}},Kze=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"},Zze={ordinalNumber:Kze,era:w0({values:Gze,defaultWidth:"wide"}),quarter:w0({values:Hze,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:w0({values:qze,defaultWidth:"wide"}),day:w0({values:Xze,defaultWidth:"wide"}),dayPeriod:w0({values:Qze,defaultWidth:"wide",formattingValues:Yze,defaultFormattingWidth:"wide"})};function S0(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)?e4e(s,function(f){return f.test(a)}):Jze(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 Jze(t,e){for(var n in t)if(t.hasOwnProperty(n)&&e(t[n]))return n}function e4e(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 n4e=/^(\d+)(th|st|nd|rd)?/i,r4e=/\d+/i,i4e={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},o4e={any:[/^b/i,/^(a|c)/i]},a4e={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},s4e={any:[/1/i,/2/i,/3/i,/4/i]},l4e={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},c4e={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]},u4e={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},f4e={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]},d4e={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},h4e={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}},p4e={ordinalNumber:t4e({matchPattern:n4e,parsePattern:r4e,valueCallback:function(e){return parseInt(e,10)}}),era:S0({matchPatterns:i4e,defaultMatchWidth:"wide",parsePatterns:o4e,defaultParseWidth:"any"}),quarter:S0({matchPatterns:a4e,defaultMatchWidth:"wide",parsePatterns:s4e,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:S0({matchPatterns:l4e,defaultMatchWidth:"wide",parsePatterns:c4e,defaultParseWidth:"any"}),day:S0({matchPatterns:u4e,defaultMatchWidth:"wide",parsePatterns:f4e,defaultParseWidth:"any"}),dayPeriod:S0({matchPatterns:d4e,defaultMatchWidth:"any",parsePatterns:h4e,defaultParseWidth:"any"})},w2={code:"en-US",formatDistance:Fze,formatLong:Uze,formatRelative:Vze,localize:Zze,match:p4e,options:{weekStartsOn:0,firstWeekContainsDate:1}},m4e=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,g4e=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,v4e=/^'([^]*?)'?$/,y4e=/''/g,x4e=/[a-zA-Z]/;function b4e(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=_d(),O=(r=(i=n==null?void 0:n.locale)!==null&&i!==void 0?i:S.locale)!==null&&r!==void 0?r:w2,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(!uae(k))throw new RangeError("Invalid time value");var I=KT(k),P=hae(k,I),R={firstWeekContainsDate:C,weekStartsOn:E,locale:O,_originalDate:k},T=_.match(g4e).map(function(L){var z=L[0];if(z==="p"||z==="P"){var B=_3[z];return B(L,O.formatLong)}return L}).join("").match(m4e).map(function(L){if(L==="''")return"'";var z=L[0];if(z==="'")return _4e(L);var B=Ize[z];if(B)return!(n!=null&&n.useAdditionalWeekYearTokens)&&xae(L)&&ZT(L,e,String(t)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&yae(L)&&ZT(L,e,String(t)),B(P,L,O.localize,R);if(z.match(x4e))throw new RangeError("Format string contains an unescaped latin alphabet character `"+z+"`");return L}).join("");return T}function _4e(t){var e=t.match(v4e);return e?e[1].replace(y4e,"'"):t}function w4e(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 S4e(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=Ht(i.getDate(),2),d=Ht(i.getMonth()+1,2),h=Ht(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=Ht(Math.floor(m/60),2),v=Ht(m%60,2),y=p<0?"+":"-";l="".concat(y).concat(g,":").concat(v)}else l="Z";var x=Ht(i.getHours(),2),b=Ht(i.getMinutes(),2),_=Ht(i.getSeconds(),2),S=s===""?"":"T",O=[x,b,_].join(u);s="".concat(s).concat(S).concat(O).concat(l)}return s}function O4e(t){tt(1,arguments);var e=nt(t),n=e.getDate();return n}function C4e(t){tt(1,arguments);var e=nt(t),n=e.getDay();return n}function bae(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 T4e(t){tt(1,arguments);var e=nt(t),n=e.getHours();return n}function E4e(t){tt(1,arguments);var e=nt(t),n=e.getMinutes();return n}function P4e(t){tt(1,arguments);var e=nt(t),n=e.getMonth();return n}function M4e(t){tt(1,arguments);var e=nt(t),n=e.getSeconds();return n}function k4e(t){return tt(1,arguments),nt(t).getFullYear()}function IS(t,e){tt(2,arguments);var n=nt(t),r=nt(e);return n.getTime()>r.getTime()}function am(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=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,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var c=n.next();return a=c.done,c},e:function(c){s=!0,o=c},f:function(){try{a||n.return==null||n.return()}finally{if(s)throw o}}}}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&&ET(t,e)}function JT(t){return JT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},JT(t)}function wae(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(wae=function(){return!!t})()}function R4e(t,e){if(e&&(uu(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=wae();return function(){var n,r=JT(t);if(e){var i=JT(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return R4e(this,n)}}function tn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function I4e(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 Tae(t){return t%400===0||t%4===0&&t%100!==0}var F4e=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=Cae(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}(_n),j4e=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=$B(i,s);if(a.isTwoDigitYear){var c=Cae(a.year,l);return i.setUTCFullYear(c,0,s.firstWeekContainsDate),i.setUTCHours(0,0,0,0),ap(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),ap(i,s)}}]),n}(_n),B4e=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}(_n),W4e=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}(_n),V4e=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}(_n),G4e=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}(_n);function H4e(t,e,n){tt(2,arguments);var r=nt(t),i=On(e),o=gae(r,n)-i;return r.setUTCDate(r.getUTCDate()-o*7),r}var q4e=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 ap(H4e(i,a,s),s)}}]),n}(_n);function X4e(t,e){tt(2,arguments);var n=nt(t),r=On(e),i=mae(n)-r;return n.setUTCDate(n.getUTCDate()-i*7),n}var Q4e=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 av(X4e(i,a))}}]),n}(_n),Y4e=[31,28,31,30,31,30,31,31,30,31,30,31],K4e=[31,29,31,30,31,30,31,31,30,31,30,31],Z4e=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<=K4e[l]:o>=1&&o<=Y4e[l]}},{key:"set",value:function(i,o,a){return i.setUTCDate(a),i.setUTCHours(0,0,0,0),i}}]),n}(_n),J4e=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}(_n);function jB(t,e,n){var r,i,o,a,s,l,c,u;tt(2,arguments);var f=_d(),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=jB(i,a,s),i.setUTCHours(0,0,0,0),i}}]),n}(_n),tUe=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=jB(i,a,s),i.setUTCHours(0,0,0,0),i}}]),n}(_n),nUe=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=jB(i,a,s),i.setUTCHours(0,0,0,0),i}}]),n}(_n);function rUe(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=rUe(i,a),i.setUTCHours(0,0,0,0),i}}]),n}(_n),oUe=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}(_n),cUe=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}(_n),uUe=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}(_n),fUe=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}(_n),dUe=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}(_n),hUe=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}(_n),pUe=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 N4e],T=O.match(_Ue).map(function(te){var J=te[0];if(J in _3){var pe=_3[J];return pe(te,E.formatLong)}return te}).join("").match(bUe),L=[],z=dH(T),B;try{var U=function(){var J=B.value;!(r!=null&&r.useAdditionalWeekYearTokens)&&xae(J)&&ZT(J,O,t),!(r!=null&&r.useAdditionalDayOfYearTokens)&&yae(J)&&ZT(J,O,t);var pe=J[0],be=xUe[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(CUe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+pe+"`");if(J==="''"?J="'":pe==="'"&&(J=EUe(J)),S.indexOf(J)===0)S=S.slice(J.length);else return{v:new Date(NaN)}}};for(z.s();!(B=z.n()).done;){var W=U();if(uu(W)==="object")return W.v}}catch(te){z.e(te)}finally{z.f()}if(S.length>0&&OUe.test(S))return new Date(NaN);var $=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]}),N=nt(n);if(isNaN(N.getTime()))return new Date(NaN);var D=hae(N,KT(N)),A={},q=dH($),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],w4e(A,se[1])):D=se}}catch(te){q.e(te)}finally{q.f()}return D}function EUe(t){return t.match(wUe)[1].replace(SUe,"'")}function hH(t){tt(1,arguments);var e=nt(t);return e.setMinutes(0,0,0),e}function PUe(t,e){tt(2,arguments);var n=hH(t),r=hH(e);return n.getTime()===r.getTime()}function MUe(t,e){tt(2,arguments);var n=nt(t),r=nt(e);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function kUe(t,e){tt(2,arguments);var n=nt(t),r=nt(e);return n.getFullYear()===r.getFullYear()}function AUe(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 Eae(t,e){var n;tt(1,arguments);var r=On((n=void 0)!==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=LUe(t),o;if(i.date){var a=NUe(i.date,r);o=$Ue(a.restDateString,a.year)}if(!o||isNaN(o.getTime()))return new Date(NaN);var s=o.getTime(),l=0,c;if(i.time&&(l=FUe(i.time),isNaN(l)))return new Date(NaN);if(i.timezone){if(c=jUe(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 DS={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},RUe=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,IUe=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,DUe=/^([+-])(\d{2})(?::?(\d{2}))?$/;function LUe(t){var e={},n=t.split(DS.dateTimeDelimiter),r;if(n.length>2)return e;if(/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],DS.timeZoneDelimiter.test(e.date)&&(e.date=t.split(DS.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length))),r){var i=DS.timezone.exec(r);i?(e.time=r.replace(i[1],""),e.timezone=i[1]):e.time=r}return e}function NUe(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 $Ue(t,e){if(e===null)return new Date(NaN);var n=t.match(RUe);if(!n)return new Date(NaN);var r=!!n[4],i=O0(n[1]),o=O0(n[2])-1,a=O0(n[3]),s=O0(n[4]),l=O0(n[5])-1;if(r)return VUe(e,s,l)?BUe(e,s,l):new Date(NaN);var c=new Date(0);return!UUe(e,o,a)||!WUe(e,i)?new Date(NaN):(c.setUTCFullYear(e,o,Math.max(i,a)),c)}function O0(t){return t?parseInt(t):1}function FUe(t){var e=t.match(IUe);if(!e)return NaN;var n=tR(e[1]),r=tR(e[2]),i=tR(e[3]);return GUe(n,r,i)?n*b2+r*x2+i*1e3:NaN}function tR(t){return t&&parseFloat(t.replace(",","."))||0}function jUe(t){if(t==="Z")return 0;var e=t.match(DUe);if(!e)return 0;var n=e[1]==="+"?-1:1,r=parseInt(e[2]),i=e[3]&&parseInt(e[3])||0;return HUe(r,i)?n*(r*b2+i*x2):NaN}function BUe(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 zUe=[31,null,31,30,31,30,31,31,30,31,30,31];function Pae(t){return t%400===0||t%4===0&&t%100!==0}function UUe(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(zUe[e]||(Pae(t)?29:28))}function WUe(t,e){return e>=1&&e<=(Pae(t)?366:365)}function VUe(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}function GUe(t,e,n){return t===24?e===0&&n===0:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}function HUe(t,e){return e>=0&&e<=59}function qUe(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=bae(a);return n.setMonth(r,Math.min(o,s)),n}function XUe(t,e){tt(2,arguments);var n=nt(t),r=On(e);return n.setDate(r),n}function QUe(t,e){tt(2,arguments);var n=nt(t),r=On(e);return n.setHours(r),n}function YUe(t,e){tt(2,arguments);var n=nt(t),r=On(e);return n.setMinutes(r),n}function KUe(t,e){tt(2,arguments);var n=nt(t),r=On(e);return n.setSeconds(r),n}function ZUe(t,e){tt(2,arguments);var n=nt(t),r=On(e);return isNaN(n.getTime())?new Date(NaN):(n.setFullYear(r),n)}function Mae(t){return t.getTimezoneOffset()*6e4}function JUe(t){return t.getTime()-Mae(t)}function nR(t){const e=new Date(t);return new Date(e.getTime()+Mae(e))}function Xb(t){return new Date(t).toISOString().substring(0,10)}function gy(t){return kae(new Date(t).toISOString())}function kae(t){return t.substring(0,19).replace("T"," ")}const Aae={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 e6e(t,e){return t===e?!0:t!==null&&e!=null?t[0]===e[0]&&t[1]===e[1]:!1}function t6e(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=gy(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]=xB(e,l)}),{colNames:o,dataRows:a,referencedPlaces:s}}function n6e(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=Eae(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 Z1=t=>t.dataState.datasets||[],r6e=t=>t.dataState.colorBars,Rae=t=>t.dataState.timeSeriesGroups,J1=t=>t.dataState.userPlaceGroups,Iae=t=>t.dataState.userServers||[],i6e=t=>t.dataState.expressionCapabilities,o6e=t=>t.dataState.statistics.loading,a6e=t=>t.dataState.statistics.records,Dae=at(Z1,J1,(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]}),s6e=at(Dae,t=>{const e=[];return t.forEach(n=>{const r=n6e(n);r!==null&&e.push(r)}),e}),l6e=[{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:[]}],c6e=l6e,BB="User";function tE(t){return t?`${t.group}: ${t.title}`:"-"}function nE(t,e){return t.find(n=>n.id===e)||null}function Lae(t="datasets"){const e=[];return c6e.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 Nae=Lae("datasets"),u6e=Lae("overlays"),f6e=Nae[0].id;var d6e=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)}}(),h6e=function(t){d6e(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(LS(n),this.adaptOptions(r))},e.prototype.readFeatureFromText=function(n,r){return yt()},e.prototype.readFeatures=function(n,r){return this.readFeaturesFromText(LS(n),this.adaptOptions(r))},e.prototype.readFeaturesFromText=function(n,r){return yt()},e.prototype.readGeometry=function(n,r){return this.readGeometryFromText(LS(n),this.adaptOptions(r))},e.prototype.readGeometryFromText=function(n,r){return yt()},e.prototype.readProjection=function(n){return this.readProjectionFromText(LS(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 yt()},e.prototype.writeFeatures=function(n,r){return this.writeFeaturesText(n,this.adaptOptions(r))},e.prototype.writeFeaturesText=function(n,r){return yt()},e.prototype.writeGeometry=function(n,r){return this.writeGeometryText(n,this.adaptOptions(r))},e.prototype.writeGeometryText=function(n,r){return yt()},e}(Vie);function LS(t){return typeof t=="string"?t:""}var p6e=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)}}(),m6e={POINT:ql,LINESTRING:zh,POLYGON:td,MULTIPOINT:c2,MULTILINESTRING:hB,MULTIPOLYGON:pB},$ae="EMPTY",Fae="Z",jae="M",g6e="ZM",mn={START:0,TEXT:1,LEFT_PAREN:2,RIGHT_PAREN:3,NUMBER:4,COMMA:5,EOF:6},v6e={Point:"POINT",LineString:"LINESTRING",Polygon:"POLYGON",MultiPoint:"MULTIPOINT",MultiLineString:"MULTILINESTRING",MultiPolygon:"MULTIPOLYGON",GeometryCollection:"GEOMETRYCOLLECTION",Circle:"CIRCLE"},y6e=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}(),x6e=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===Fae?e=dn.XYZ:r===jae?e=dn.XYM:r===g6e&&(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+" "+$ae:i+"("+r+")"}class T6e extends Error{}const Vae={separator:",",comment:"#",quote:'"',escape:"\\",trim:!0,nanToken:"NaN",trueToken:"true",falseToken:"false"};function Gae(t,e){return new E6e(e).parse(t)}let E6e=class{constructor(e){Yt(this,"options");this.options={...Vae,...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 pH(t){if(t=t.trim(),t==="")return"csv";if(t[0]==="{")return"geojson";const e=t.substring(0,20).toLowerCase();return k6e.find(r=>e.startsWith(r)&&(e.length===r.length||` + (`.indexOf(e[r.length])>=0))?"wkt":"csv"}function DC(t){return t.split(",").map(e=>e.trim().toLowerCase()).filter(e=>e!=="")}const A6e=t=>{if(t.trim()!=="")try{Gae(t)}catch(e){return console.error(e),`${e}`}return null},Hae={name:"Text/CSV",fileExt:".txt,.csv",checkError:A6e},S3={...Vae,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 R6e=0,I6e=0;function D6e(t,e){const n=Gae(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=L6e(i),s=sm(a,e.groupNames),l=sm(a,e.labelNames),c=sm(a,e.timeNames),u=sm(a,e.xNames),f=sm(a,e.yNames);let d=sm(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=S3.groupPrefix);let m=e.labelPrefix.trim();m===""&&(m=S3.labelPrefix);let g="";if(s===-1){const S=++R6e;g=`${p}${S}`}const v=new Bae,y={};let x=1,b=0,_=tp(0);for(;x=0&&(O=`${S[c]}`),s>=0&&(g=`${S[s]}`);let C=y[g];C||(C=gB(g,[]),y[g]=C,_=tp(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 ql([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=++I6e;I=`${m}${P}`}O!==""&&(k.time=O),k.color||(k.color=_),k.label||(k.label=I),k.source||(k.source="CSV"),C.features.push(vB(E,k))}return Object.getOwnPropertyNames(y).map(S=>y[S])}function L6e(t){const e={};for(let n=0;n{if(t.trim()!=="")try{JSON.parse(t)}catch(e){return console.error(e),`${e}`}return null},qae={name:"GeoJSON",fileExt:".json,.geojson",checkError:N6e},O3={groupNames:"group, cruise, station, type",groupPrefix:"Group-",labelNames:"label, name, title, id",labelPrefix:"Place-",timeNames:"time, date, datetime, date-time"};let $6e=0,F6e=0;function j6e(t,e){const n=DC(e.groupNames||"");let r=e.groupPrefix.trim();r===""&&(r=O3.groupPrefix);const i=DC(e.labelNames||"");let o=e.labelPrefix.trim();o===""&&(o=O3.labelPrefix);const a=DC(e.timeNames||""),s=new Ip;let l;try{l=s.readFeatures(t)}catch{try{const d=s.readGeometry(t);l=[new zc(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=tp(0);if(d){const b={};Object.getOwnPropertyNames(d).forEach(_=>{b[_.toLowerCase()]=d[_]}),p=rR(b,a,p),g=rR(b,i,g),m=rR(b,n,m)}if(m===""){const b=++$6e;m=`${r}-${b}`}if(g===""){const b=++F6e;g=`${o}-${b}`}let y=c[m];y||(y=gB(m,[]),c[m]=y,v=tp(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(vB(h,x))}}),Object.getOwnPropertyNames(c).map(f=>c[f])}function rR(t,e,n){if(n===""){for(const r of e)if(t[r]==="string")return t[r]}return n}const B6e=t=>null,Xae={name:"WKT",fileExt:".txt,.wkt",checkError:B6e},C3={group:"",groupPrefix:"Group-",label:"",labelPrefix:"Place-",time:gy(new Date().getTime())};let z6e=0,U6e=0;function W6e(t,e){let n=e.groupPrefix.trim();n===""&&(n=C3.groupPrefix);let r=e.group.trim();if(r===""){const s=++z6e;r=`${n}${s}`}let i=e.labelPrefix.trim();i===""&&(i=C3.labelPrefix);let o=e.label.trim();if(o===""){const s=++U6e;o=`${i}${s}`}const a=e.time.trim();try{const s=new Bae().readGeometry(t);let l={color:tp(Math.floor(1e3*Math.random())),label:o,source:"WKT"};a!==""&&(l={time:a,...l});const c=[vB(s,l)];return[gB(r,c)]}catch{throw new Error(fe.get("Invalid Geometry WKT"))}}function vy(t){return V6e("localStorage",t)}function V6e(t,e){try{const n=window[t],r="__storage_test__";return n.setItem(r,r),n.removeItem(r),new G6e(n,e)}catch{return null}}class G6e{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];tG(c)&&tG(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 H6e(t){const e=vy(Kt.instance.name);if(e)try{e.setObjectItem("userServers",t)}catch(n){console.warn(`failed to store user servers: ${n}`)}}function q6e(){const t=vy(Kt.instance.name);if(t)try{return t.getObjectItem("userServers",[])}catch(e){console.warn(`failed to load user servers: ${e}`)}return[]}function X6e(t){const e=vy(Kt.instance.name);if(e)try{e.setObjectItem("userVariables",t)}catch(n){console.warn(`failed to store user variables: ${n}`)}}function Q6e(){const t=vy(Kt.instance.name);if(t)try{return t.getObjectItem("userVariables",{})}catch(e){console.warn(`failed to load user variables: ${e}`)}return{}}function ll(t){const e=vy(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 Y6e(t){const e=vy(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,K6e),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 mH={node:"continuous",continuous:"continuous",bound:"stepwise",stepwise:"stepwise",key:"categorical",categorical:"categorical"};function K6e(t){if(Array.isArray(t))return t.map(e=>({...e,type:Z6e(e.type)}))}function Z6e(t){return Mp(t)&&t in mH?mH[t]:"continuous"}const J6e=[250,500,1e3,2500],eWe=["info","timeSeries","stats","volume"];function tWe(){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:{...S3},geojson:{...O3},wkt:{...C3}},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||oae,imageSmoothingEnabled:!1,selectedBaseMapId:f6e,selectedOverlayId:null,userBaseMaps:[],userOverlays:[],userColorBars:[],exportTimeSeries:!0,exportTimeSeriesSeparator:"TAB",exportPlaces:!0,exportPlacesAsCollection:!0,exportZipArchive:!0,exportFileName:"export"};return Y6e(e)}const Ga={},nWe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAGUExURcDAwP///ytph7QAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAUSURBVBjTYwABQSCglEENMxgYGAAynwRB8BEAgQAAAABJRU5ErkJggg==",Qae=new Image;Qae.src=nWe;const T3="_alpha",E3="_r";function rWe(t){let e=t;const n=e.endsWith(T3);n&&(e=e.slice(0,e.length-T3.length));const r=e.endsWith(E3);return r&&(e=e.slice(0,e.length-E3.length)),{baseName:e,isAlpha:n,isReversed:r}}function rE(t){let e=t.baseName;return t.isReversed&&(e+=E3),t.isAlpha&&(e+=T3),e}function iWe(t,e,n){aWe(t,e).then(r=>{Promise.resolve(createImageBitmap(r)).then(i=>{const o=n.getContext("2d");if(o!==null){const a=o.createPattern(Qae,"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 oWe(t,e){return new Promise((n,r)=>{const i=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 aWe(t,e){return oWe(t).then(n=>{const r=sWe(t,e,n);if(r!==null)return r;throw new Error("failed to retrieve 2d context")})}function sWe(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,yy=t=>t.controlState.selectedVariableName,lWe=t=>t.controlState.selectedDataset2Id,Yae=t=>t.controlState.selectedVariable2Name,UB=t=>t.controlState.selectedPlaceGroupIds,xy=t=>t.controlState.selectedPlaceId,tw=t=>t.controlState.selectedTime,cWe=t=>t.controlState.selectedServerId,uWe=t=>t.controlState.activities,S2=t=>t.controlState.timeAnimationActive,nw=t=>t.controlState.imageSmoothingEnabled,fWe=t=>t.controlState.userBaseMaps,dWe=t=>t.controlState.userOverlays,WB=t=>t.controlState.selectedBaseMapId,VB=t=>t.controlState.selectedOverlayId,hWe=t=>!!t.controlState.layerVisibilities.baseMap,pWe=t=>!!t.controlState.layerVisibilities.datasetBoundary,mWe=t=>!!t.controlState.layerVisibilities.datasetVariable,gWe=t=>!!t.controlState.layerVisibilities.datasetVariable2,vWe=t=>!!t.controlState.layerVisibilities.datasetRgb,yWe=t=>!!t.controlState.layerVisibilities.datasetRgb2,xWe=t=>!!t.controlState.layerVisibilities.datasetPlaces,Kae=t=>!!t.controlState.layerVisibilities.userPlaces,bWe=t=>!!t.controlState.layerVisibilities.overlay,_We=t=>t.controlState.layerVisibilities,Zae=t=>t.controlState.infoCardElementStates,wd=t=>t.controlState.mapProjection,wWe=t=>t.controlState.timeChunkSize,SWe=t=>t.controlState.userPlacesFormatName,OWe=t=>t.controlState.userPlacesFormatOptions.csv,CWe=t=>t.controlState.userPlacesFormatOptions.geojson,TWe=t=>t.controlState.userPlacesFormatOptions.wkt,Dp=t=>t.controlState.userColorBars,EWe=t=>Kt.instance.branding.allowUserVariables,PWe=()=>"variable",MWe=()=>"variable2",kWe=()=>"rgb",AWe=()=>"rgb2",RWe=()=>13,IWe=()=>12,DWe=()=>11,LWe=()=>10,qr=at(Z1,ew,zb),Sd=at(Z1,lWe,zb),NWe=at(qr,t=>t&&t.variables||[]),$We=at(qr,t=>t?mB(t)[1]:[]),Jae=(t,e)=>!t||!e?null:a3(t,e),vo=at(qr,yy,Jae),Su=at(Sd,Yae,Jae),ese=t=>t&&(t.title||t.name),FWe=at(vo,ese),jWe=at(Su,ese),tse=t=>t&&t.units||"-",BWe=at(vo,tse),zWe=at(Su,tse),nse=t=>t&&t.colorBarName||"viridis",O2=at(vo,nse),C2=at(Su,nse),rse=t=>t?[t.colorBarMin,t.colorBarMax]:[0,1],ise=at(vo,rse),ose=at(Su,rse),ase=t=>(t&&t.colorBarNorm)==="log"?"log":"lin",sse=at(vo,ase),lse=at(Su,ase),T2=at(Dp,r6e,(t,e)=>{const n={title:foe,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,customColorMaps:{}}}),cse=(t,e,n)=>{const r=rWe(t),{baseName:i}=r,o=e.images[i],a=n.find(s=>s.id===i);if(a){const s=a.type,l=hoe(a.code);return{...r,imageData:o,type:s,colorRecords:l}}else{const s=e.customColorMaps[i];if(s){const l=s.type,c=s.colorRecords;return{...r,imageData:o,type:l,colorRecords:c}}}return{...r,imageData:o}},GB=at(O2,T2,Dp,cse),use=at(C2,T2,Dp,cse),fse=(t,e,n)=>{const{baseName:r}=t,i=n.find(o=>o.id===r);if(i){const o=hoe(i.code);if(o)return JSON.stringify({name:e,type:i.type,colors:o.map(a=>[a.value,a.color])})}return null},UWe=at(GB,O2,Dp,fse),WWe=at(use,C2,Dp,fse),dse=t=>!t||typeof t.opacity!="number"?1:t.opacity,hse=at(vo,dse),pse=at(Su,dse),VWe=at(qr,t=>t!==null?loe(t):null),GWe=at(qr,t=>t!==null&&t.rgbSchema||null),HWe=at(Sd,t=>t!==null&&t.rgbSchema||null),mse=at(qr,t=>t&&t.placeGroups||[]),E2=at(mse,J1,(t,e)=>t.concat(e));function gse(t,e){const n=[];return e!==null&&e.length>0&&t.forEach(r=>{e.indexOf(r.id)>-1&&n.push(r)}),n}const qWe=at(J1,UB,Kae,(t,e)=>{const n={},r=new Set(e||[]);return t.forEach(i=>{n[i.id]=r.has(i.id)}),n}),vse=at(mse,UB,gse),by=at(E2,UB,gse),XWe=at(by,t=>t.map(e=>e.title||e.id).join(", ")),rw=at(by,t=>{const e=t.map(n=>uy(n)?n.features:[]);return[].concat(...e)}),yse=at(rw,xy,(t,e)=>t.find(n=>n.id===e)||null),iw=at(by,xy,(t,e)=>t.length===0||e===null?null:iFe(t,e)),QWe=at(ew,yy,yse,(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}),xse=at(Rae,ew,yy,xy,(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}),YWe=at(Rae,E2,(t,e)=>{const n={};return yB(e,(r,i)=>{for(const o of t)if(o.timeSeriesArray.find(a=>a.source.placeId===i.id)){n[i.id]=u2(r,i);break}}),n}),bse=at(ew,yy,xy,(t,e,n)=>!!(t&&e&&n)),KWe=at(a6e,E2,(t,e)=>{const n=[];return t.forEach(r=>{const i=r.source.placeInfo.place.id;yB(e,(o,a)=>{if(a.id===i){const s=u2(o,a);n.push({...r,source:{...r.source,placeInfo:s}})}})}),n}),ZWe=at(by,t=>{const e=[];return yB(t,(n,r)=>{e.push(u2(n,r).label)}),e}),JWe=at(vo,wWe,(t,e)=>{if(t&&t.timeChunkSize){const n=t.timeChunkSize;return n*Math.ceil(e/n)}return e}),_se=t=>t&&soe(t)||null,_y=at(qr,_se),eVe=at(Sd,_se),wse=t=>t&&t.attributions||null,HB=at(qr,wse),tVe=at(Sd,wse),Sse=t=>t===null||t.coordinates.length===0?null:t.coordinates,P3=at(_y,Sse),nVe=at(_y,Sse),Ose=(t,e)=>t===null||e===null?-1:cae(e,t),Cse=at(tw,P3,Ose),rVe=at(tw,nVe,Ose),Tse=(t,e,n)=>t===null?null:n&&e>-1?n.labels[e]:new Date(t).toISOString(),wy=at(tw,Cse,_y,Tse),iVe=at(tw,rVe,eVe,Tse);function oVe(t,e){if(t!==NB){const n=typeof e=="number"?e+1:20;return new DB({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 aVe(t,e,n,r,i,o,a,s,l){return new hy({url:t,projection:e,tileGrid:n,attributions:r||void 0,transition:i?0:250,imageSmoothing:o,tileLoadFunction:a,maxZoom:l})}function sVe(t){if(t)return(e,n)=>{e instanceof OB&&(t.getView().getInteracting()?t.once("moveend",function(){e.getImage().src=n}):e.getImage().src=n)}}const lVe=yFe(sVe,{serializer:t=>{const e=t[0];if(e){const n=e.getTarget();return typeof n=="string"?n:n&&n.id||"map"}return""}});function cVe(){const t=Ga.map;return lVe(t)}function Ese(t,e,n,r,i,o,a,s,l,c,u,f,d=10){s!==null&&(o=[...o,["time",s]]);const h=sy(e,o);typeof i=="number"&&(i+=3);const p=oVe(c,i),m=aVe(h,c,p,u,l,f,cVe(),r,i),g=c===py?n:Bie(n,"EPSG:4326",c);return console.log("extent:",n,g),w.jsx(lae,{id:t,source:m,extent:g,zIndex:d,opacity:a})}const uVe=at(qr,wd,pWe,(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 Q1({features:new Ip({dataProjection:py,featureProjection:e}).readFeatures({type:"Feature",geometry:r})}),o=new Il({stroke:new Xl({color:"orange",width:3,lineDash:[2,4]})});return w.jsx(v2,{id:`${t.id}.bbox`,source:i,style:o,zIndex:16,opacity:.5})}),pi=at(Iae,cWe,(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}),Pse=(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]),Ese(f,kse(t.url,e,i),e.bbox,i.tileLevelMin,i.tileLevelMax,g,c,n,h,p,r,m,d)},fVe=at(pi,qr,wy,HB,vo,O2,ise,sse,UWe,hse,mWe,PWe,RWe,S2,wd,nw,Pse),dVe=at(pi,Sd,iVe,tVe,Su,C2,ose,lse,WWe,pse,gWe,MWe,IWe,S2,wd,nw,Pse),Mse=(t,e,n,r,i,o,a,s,l,c,u)=>{if(!e||!n||!r)return null;const f=[["crs",l]];return Ese(i,kse(t.url,e,"rgb"),e.bbox,n.tileLevelMin,n.tileLevelMax,f,1,a,s,l,c,u,o)},hVe=at(pi,qr,GWe,vWe,kWe,DWe,wy,S2,wd,HB,nw,Mse),pVe=at(pi,Sd,HWe,yWe,AWe,LWe,wy,S2,wd,HB,nw,Mse);function kse(t,e,n){return`${t}/tiles/${ly(e)}/${V1(n)}/{z}/{y}/{x}`}function mVe(){return R5()}function gVe(){return new q1({fill:Rse(),stroke:Ase(),radius:6})}function Ase(){return new Xl({color:[200,0,0,.75],width:1.25})}function Rse(){return new op({color:[255,0,0,mVe()]})}function vVe(){return new Il({image:gVe(),stroke:Ase(),fill:Rse()})}const yVe=at(vse,wd,xWe,(t,e,n)=>{if(!n||t.length===0)return null;const r=[];return t.forEach((i,o)=>{uy(i)&&r.push(w.jsx(v2,{id:`placeGroup.${i.id}`,style:vVe(),zIndex:100,source:new Q1({features:new Ip({dataProjection:py,featureProjection:e}).readFeatures(i)})},o))}),w.jsx(rae,{children:r})}),xVe=at(Zae,t=>{const e=[];return Object.getOwnPropertyNames(t).forEach(n=>{t[n].visible&&e.push(n)}),e}),bVe=at(Zae,t=>{const e={};return Object.getOwnPropertyNames(t).forEach(n=>{e[n]=t[n].viewMode||"text"}),e}),_Ve=at(uWe,t=>Object.keys(t).map(e=>t[e])),qB=at(fWe,t=>[...t,...Nae]),XB=at(dWe,t=>[...t,...u6e]),Ise=(t,e,n,r)=>{if(!n||!e)return null;const i=nE(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 HBe({url:i.url,params:{...l?{STYLES:l}:{},LAYERS:s},attributions:o,attributionsCollapsible:!0})}else{const s=nLe(i.group);a=new hy({url:i.url+(s?`?${s.param}=${s.token}`:""),attributions:o,attributionsCollapsible:!0})}return w.jsx(lae,{id:i.id,source:a,zIndex:r})},wVe=at(qB,WB,hWe,()=>0,Ise),SVe=at(XB,VB,bWe,()=>20,Ise),Dse=(t,e)=>{const n=nE(t,e);return n?tE(n):null},OVe=at(qB,WB,Dse),CVe=at(XB,VB,Dse),TVe=at(OVe,CVe,WB,VB,qr,Sd,vo,Su,_We,(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 Lse={exports:{}};/*! JSZip v3.10.1 - A JavaScript class for generating and reading zip files @@ -219,26 +219,26 @@ 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 cx=="function"&&cx;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 cx=="function"&&cx,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="",U=_.dir,W=_.date,$={crc32:0,compressedSize:0,uncompressedSize:0};p&&!m||($.crc32=h.crc32,$.compressedSize=h.compressedSize,$.uncompressedSize=h.uncompressedSize);var N=0;p&&(N|=8),O||!R&&!T||(N|=2048);var D=0,A=0;U&&(D|=16),v==="UNIX"?(A=798,D|=function(Y,K){var se=Y;return Y||(se=K?16893:33204),(65535&se)<<16}(_.unixPermissions,U)):(A=20,D|=function(Y){return 63&(Y||0)}(_.dosPermissions)),x=W.getUTCHours(),x<<=6,x|=W.getUTCMinutes(),x<<=5,x|=W.getUTCSeconds()/2,b=W.getUTCFullYear()-1980,b<<=4,b|=W.getUTCMonth()+1,b<<=5,b|=W.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(N,2),q+=S.magic,q+=o(x,2),q+=o(b,2),q+=o($.crc32,4),q+=o($.compressedSize,4),q+=o($.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 U(F,ce){return F.msg=u[ce],ce}function W(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,N(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)),N(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)),N(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)),N(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&&N(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(N(F),F.avail_out===0)return Q.last_flush=-1,h}else if(F.avail_in===0&&W(ce)<=W(le)&&ce!==d)return U(F,-5);if(Q.status===666&&F.avail_in!==0)return U(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&&($(Q.head),Q.lookahead===0&&(Q.strstart=0,Q.block_start=0,Q.insert=0))),N(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)),N(F),0=le.w_size&&(ee===0&&($(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=N=0,T.mode=2;break}if(T.flags=0,T.head&&(T.head.done=!1),!(1&T.wrap)||(((255&N)<<8)+(N>>8))%31){P.msg="incorrect header check",T.mode=30;break}if((15&N)!=8){P.msg="unknown compression method",T.mode=30;break}if(D-=4,F=8+(15&(N>>>=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&N,ee[1]=N>>>8&255,T.check=s(T.check,ee,2,0)),D=N=0,T.mode=3;case 3:for(;D<32;){if(W===0)break e;W--,N+=L[B++]<>>8&255,ee[2]=N>>>16&255,ee[3]=N>>>24&255,T.check=s(T.check,ee,4,0)),D=N=0,T.mode=4;case 4:for(;D<16;){if(W===0)break e;W--,N+=L[B++]<>8),512&T.flags&&(ee[0]=255&N,ee[1]=N>>>8&255,T.check=s(T.check,ee,2,0)),D=N=0,T.mode=5;case 5:if(1024&T.flags){for(;D<16;){if(W===0)break e;W--,N+=L[B++]<>>8&255,T.check=s(T.check,ee,2,0)),D=N=0}else T.head&&(T.head.extra=null);T.mode=6;case 6:if(1024&T.flags&&(W<(Y=T.length)&&(Y=W),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)),W-=Y,B+=Y,T.length-=Y),T.length))break e;T.length=0,T.mode=7;case 7:if(2048&T.flags){if(W===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(W===0)break e;W--,N+=L[B++]<>>=7&D,D-=7&D,T.mode=27;break}for(;D<3;){if(W===0)break e;W--,N+=L[B++]<>>=1)){case 0:T.mode=14;break;case 1:if(k(T),T.mode=20,R!==6)break;N>>>=2,D-=2;break e;case 2:T.mode=17;break;case 3:P.msg="invalid block type",T.mode=30}N>>>=2,D-=2;break;case 14:for(N>>>=7&D,D-=7&D;D<32;){if(W===0)break e;W--,N+=L[B++]<>>16^65535)){P.msg="invalid stored block lengths",T.mode=30;break}if(T.length=65535&N,D=N=0,T.mode=15,R===6)break e;case 15:T.mode=16;case 16:if(Y=T.length){if(W>>=5,D-=5,T.ndist=1+(31&N),N>>>=5,D-=5,T.ncode=4+(15&N),N>>>=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(W===0)break e;W--,N+=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&N),N>>>=2,D-=2}else if(pe===17){for(Q=te+3;D>>=te)),N>>>=3,D-=3}else{for(Q=te+7;D>>=te)),N>>>=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<=W&&258<=$){P.next_out=U,P.avail_out=$,P.next_in=B,P.avail_in=W,T.hold=N,T.bits=D,l(P,q),U=P.next_out,z=P.output,$=P.avail_out,B=P.next_in,L=P.input,W=P.avail_in,N=T.hold,D=T.bits,T.mode===12&&(T.back=-1);break}for(T.back=0;J=(X=T.lencode[N&(1<>>16&255,pe=65535&X,!((te=X>>>24)<=D);){if(W===0)break e;W--,N+=L[B++]<>be)])>>>16&255,pe=65535&X,!(be+(te=X>>>24)<=D);){if(W===0)break e;W--,N+=L[B++]<>>=be,D-=be,T.back+=be}if(N>>>=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[N&(1<>>16&255,pe=65535&X,!((te=X>>>24)<=D);){if(W===0)break e;W--,N+=L[B++]<>be)])>>>16&255,pe=65535&X,!(be+(te=X>>>24)<=D);){if(W===0)break e;W--,N+=L[B++]<>>=be,D-=be,T.back+=be}if(N>>>=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($===0)break e;if(Y=q-$,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=U-T.offset,Y=T.length;for($O?(E=K[se+g[R]],D[A+g[R]]):(E=96,0),y=1<>U)+(x-=y)]=C<<24|E<<16|k|0,x!==0;);for(y=1<>=1;if(y!==0?(N&=y-1,N+=y):N=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,$e,Te,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 Zn<"u"?Zn:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(Nse);var MVe=Nse.exports;const kVe=$t(MVe);var $se={exports:{}};(function(t,e){(function(n,r){r()})(Zn,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 Zn=="object"&&Zn.global===Zn?Zn: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})})($se);var Fse=$se.exports;const jse="POST_MESSAGE";function ba(t,e){return{type:jse,messageType:t,messageText:typeof e=="string"?e:e.message}}const Bse="HIDE_MESSAGE";function AVe(t){return{type:Bse,messageId:t}}var RVe={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 yH=$t(RVe);var xH={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function IVe(t){var e,n=[],r=1,i;if(typeof t=="string")if(t=t.toLowerCase(),yH[t])n=yH[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(xH[d]!==void 0)return xH[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 k3={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]},oR={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}};k3.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 DVe(t){Array.isArray(t)&&t.raw&&(t=String.raw(...arguments));var e,n=IVe(t);if(!n.space)return[];const r=n.space[0]==="h"?oR.min:k3.min,i=n.space[0]==="h"?oR.max:k3.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=oR.rgb(e)),e.push(Math.min(Math.max(n.alpha,0),1)),e}function YB(t,e,n,r="circle"){if(t.getGeometry()instanceof ql)t.setStyle(LVe(7,e,"white",2,r));else{n=typeof n=="number"?n:.25;let i=DVe(e);Array.isArray(i)?i=[i[0],i[1],i[2],n]:i=[255,255,255,n],t.setStyle($Ve(i,e,2))}}function LVe(t,e,n,r,i="circle"){return new Il({image:NVe(t,e,n,r,i)})}function NVe(t,e,n,r,i){const o=new op({color:e}),a=new Xl({color:n,width:r});switch(i){case"square":return new f3({fill:o,stroke:a,radius:t,points:4,angle:Math.PI/4,rotation:0});case"diamond":return new f3({fill:o,stroke:a,radius:t,points:4,angle:Math.PI/4,rotation:Math.PI/4});default:return new X1({fill:o,stroke:a,radius:t})}}function $Ve(t,e,n){const r=new op({color:t}),i=new Xl({color:e,width:n});return new Il({fill:r,stroke:i})}function FVe(t,e,n){Ga[t]}function jVe(t,e,n){if(Ga[t]){const i=Ga[t].getSource(),o=i==null?void 0:i.getFeatureById(e);o&&YB(o,n.color,n.opacity)}}function BVe(t,e,n){if(Ga[t]){const r=Ga[t],i=r.getView().getProjection(),a=(Array.isArray(e)?i3(e):e).transform(py,i);a.getType()==="Point"?r.getView().setCenter(a.getFirstCoordinate()):n?r.getView().fit(a,{size:r.getSize()}):r.getView().setCenter(ed(a.getExtent()))}}const iE="UPDATE_SERVER_INFO";function zVe(){return(t,e)=>{const n=pi(e());t(A2(iE,fe.get("Connecting to server"))),F$e(n.url).then(r=>{t(UVe(r))}).catch(r=>{t(ba("error",r))}).then(()=>{t(R2(iE))})}}function UVe(t){return{type:iE,serverInfo:t}}const bH="UPDATE_RESOURCES";function zse(){return(t,e)=>{const n=pi(e());t(A2(bH,fe.get("Updating resources"))),U$e(n.url,e().userAuthState.accessToken).then(r=>{r&&window.location.reload()}).finally(()=>t(R2(bH)))}}const Yb="UPDATE_DATASETS";function Use(){return(t,e)=>{const n=pi(e());t(A2(Yb,fe.get("Loading data"))),I$e(n.url,e().userAuthState.accessToken).then(r=>{const i=K6e();if(r=r.map(o=>({...o,variables:[...o.variables,...i[o.id]||[]]})),t(_H(r)),r.length>0){const o=e().controlState.selectedDatasetId||r[0].id;t(cle(o,r,!0))}}).catch(r=>{t(ba("error",r)),t(_H([]))}).then(()=>{t(R2(Yb))})}}function _H(t){return{type:Yb,datasets:t}}function WVe(t,e){return(n,r)=>{n(VVe(t,e));const i={};r().dataState.datasets.forEach(o=>{const[a,s]=gB(o);s.length>=0&&(i[o.id]=s)}),Y6e(i)}}const Wse="UPDATE_DATASET_USER_VARIABLES";function VVe(t,e){return{type:Wse,datasetId:t,userVariables:e}}const KB="UPDATE_DATASET_PLACE_GROUP";function GVe(t,e){return{type:KB,datasetId:t,placeGroup:e}}const ZB="ADD_DRAWN_USER_PLACE";function HVe(t,e,n,r,i){return(o,a)=>{o(qVe(t,e,n,r,i)),a().controlState.autoShowTimeSeries&&a().controlState.selectedPlaceId===e&&o(P2())}}function qVe(t,e,n,r,i){return{type:ZB,placeGroupTitle:t,id:e,properties:n,geometry:r,selected:i}}const JB="ADD_IMPORTED_USER_PLACES";function XVe(t,e,n){return{type:JB,placeGroups:t,mapProjection:e,selected:n}}function Vse(t){return(e,n)=>{const r=CWe(n());let i;try{if(r==="csv"){const o=TWe(n());i=N6e(t,o)}else if(r==="geojson"){const o=EWe(n());i=z6e(t,o)}else if(r==="wkt"){const o=PWe(n());i=G6e(t,o)}else i=[]}catch(o){e(ba("error",o)),e(Lp("addUserPlacesFromText")),i=[]}if(i.length>0){if(e(XVe(i,wd(n()),!0)),i.length===1&&i[0].features.length===1){const a=i[0].features[0];e(M2(a.id,rw(n()),!0)),n().controlState.autoShowTimeSeries&&e(P2())}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 ez="RENAME_USER_PLACE_GROUP";function QVe(t,e){return{type:ez,placeGroupId:t,newName:e}}const Gse="RENAME_USER_PLACE";function YVe(t,e,n){return r=>{r(KVe(t,e,n)),FVe(t)}}function KVe(t,e,n){return{type:Gse,placeGroupId:t,placeId:e,newName:n}}const Hse="RESTYLE_USER_PLACE";function ZVe(t,e,n){return r=>{r(JVe(t,e,n)),jVe(t,e,n)}}function JVe(t,e,n){return{type:Hse,placeGroupId:t,placeId:e,placeStyle:n}}const tz="REMOVE_USER_PLACE";function e8e(t,e,n){return{type:tz,placeGroupId:t,placeId:e,places:n}}const qse="REMOVE_USER_PLACE_GROUP";function t8e(t){return{type:qse,placeGroupId:t}}function Xse(){return(t,e)=>{const n=pi(e()),r=qr(e()),i=vo(e()),o=iw(e()),a=Sy(e()),s=e().controlState.sidebarOpen,l=e().controlState.sidebarPanelId;r&&i&&o&&a&&(l!=="stats"&&t(sz("stats")),s||t(az(!0)),t(wH(null)),B$e(n.url,r,i,o,a,e().userAuthState.accessToken).then(c=>t(wH(c))).catch(c=>{t(ba("error",c))}))}}const Qse="ADD_STATISTICS";function wH(t){return{type:Qse,statistics:t}}const Yse="REMOVE_STATISTICS";function n8e(t){return{type:Yse,index:t}}function P2(){return(t,e)=>{const n=pi(e()),r=qr(e()),i=wy(e()),o=vo(e()),a=xy(e()),s=xse(e()),l=e().controlState.timeSeriesUpdateMode,c=e().controlState.timeSeriesUseMedian,u=e().controlState.timeSeriesIncludeStdev;let f=tVe(e());const d=e().controlState.sidebarOpen,h=e().controlState.sidebarPanelId,p=Lae(e());if(r&&o&&a&&i){h!=="timeSeries"&&t(sz("timeSeries")),d||t(az(!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 j$e(n.url,r,o,s.id,s.geometry,_,S,c,u,e().userAuthState.accessToken)},b=_=>{if(_!==null&&SH(p,s.id)){const S=y>0,O=S?(g-y)/g:1;t(r8e({..._,dataProgress:O},l,v===g-1?"new":"append")),S&&SH(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 SH(t,e){return bB(t,e)!==null}const Kse="UPDATE_TIME_SERIES";function r8e(t,e,n){return{type:Kse,timeSeries:t,updateMode:e,dataMode:n}}const Zse="ADD_PLACE_GROUP_TIME_SERIES";function i8e(t,e){return{type:Zse,timeSeriesGroupId:t,timeSeries:e}}const Jse="REMOVE_TIME_SERIES";function o8e(t,e){return{type:Jse,groupId:t,index:e}}const ele="REMOVE_TIME_SERIES_GROUP";function a8e(t){return{type:ele,id:t}}const tle="REMOVE_ALL_TIME_SERIES";function s8e(){return{type:tle}}const nz="CONFIGURE_SERVERS";function l8e(t,e){return(n,r)=>{r().controlState.selectedServerId!==e?(n(s8e()),n(OH(t,e)),n(rz())):r().dataState.userServers!==t&&n(OH(t,e))}}function OH(t,e){return{type:nz,servers:t,selectedServerId:e}}function rz(){return t=>{t(zVe()),t(Use()),t(c8e()),t(f8e())}}const nle="UPDATE_EXPRESSION_CAPABILITIES";function c8e(){return(t,e)=>{const n=pi(e());$$e(n.url).then(r=>{t(u8e(r))}).catch(r=>{t(ba("error",r))})}}function u8e(t){return{type:nle,expressionCapabilities:t}}const rle="UPDATE_COLOR_BARS";function f8e(){return(t,e)=>{const n=pi(e());M$e(n.url).then(r=>{t(d8e(r))}).catch(r=>{t(ba("error",r))})}}function d8e(t){return{type:rle,colorBars:t}}const ile="UPDATE_VARIABLE_COLOR_BAR";function h8e(t,e,n,r){return(i,o)=>{const a=o().controlState.selectedDatasetId,s=o().controlState.selectedVariableName;a&&s&&i(ole(a,s,t,e,n,r))}}function p8e(t,e,n,r){return(i,o)=>{const a=o().controlState.selectedDatasetId,s=o().controlState.selectedVariable2Name;a&&s&&i(ole(a,s,t,e,n,r))}}function ole(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:ile,datasetId:t,variableName:e,colorBarName:n,colorBarMinMax:r,colorBarNorm:i,opacity:o}}const ale="UPDATE_VARIABLE_VOLUME";function m8e(t,e,n,r,i){return{type:ale,datasetId:t,variableName:e,variableColorBar:n,volumeRenderMode:r,volumeIsoThreshold:i}}function g8e(){return(t,e)=>{const{exportTimeSeries:n,exportTimeSeriesSeparator:r,exportPlaces:i,exportPlacesAsCollection:o,exportZipArchive:a,exportFileName:s}=e().controlState;let l=[];n?(l=[],J1(e()).forEach(u=>{u.placeGroups&&(l=l.concat(u.placeGroups))}),l=[...l,...ew(e())]):i&&(l=_y(e())),x8e(e().dataState.timeSeriesGroups,l,{includeTimeSeries:n,includePlaces:i,separator:r,placesAsCollection:o,zip:a,fileName:s})}}class sle{}class v8e extends sle{constructor(n){super();Yt(this,"fileName");Yt(this,"zipArchive");this.fileName=n,this.zipArchive=new kVe}write(n,r){this.zipArchive.file(n,r)}close(){this.zipArchive.generateAsync({type:"blob"}).then(n=>Fse.saveAs(n,this.fileName))}}class y8e extends sle{write(e,n){const r=new Blob([n],{type:"text/plain;charset=utf-8"});Fse.saveAs(r,e)}close(){}}function x8e(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 v8e(`${l}.zip`):c=new y8e;let u;if(r){const{colNames:f,dataRows:d,referencedPlaces:h}=r6e(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 lle="SELECT_DATASET";function cle(t,e,n){return(r,i)=>{r(b8e(t,e));const o=i().controlState.datasetLocateMode;t&&n&&o!=="doNothing"&&r(ule(t,i().controlState.datasetLocateMode==="panAndZoom"))}}function b8e(t,e){return{type:lle,selectedDatasetId:t,datasets:e}}function _8e(){return(t,e)=>{const n=tw(e());n&&t(ule(n,!0))}}function w8e(){return(t,e)=>{const n=xy(e());n&&t(fle(n,!0))}}function ule(t,e){return(n,r)=>{const i=J1(r()),o=Ub(i,t);o&&o.bbox&&n(A3(o.bbox,e))}}const S8e=["Point","LineString","LinearRing","Polygon","MultiPoint","MultiLineString","MultiPolygon","Circle"];function fle(t,e){return(n,r)=>{const i=_y(r()),o=bB(i,t);o&&(o.bbox&&o.bbox.length===4?n(A3(o.bbox,e)):o.geometry&&S8e.includes(o.geometry.type)&&n(A3(new Ip().readGeometry(o.geometry),e)))}}function A3(t,e){return n=>{if(t!==null){const r="map";n(O8e(r,t)),BVe(r,t,e)}}}const dle="FLY_TO";function O8e(t,e){return{type:dle,mapId:t,location:e}}const hle="SELECT_PLACE_GROUPS";function C8e(t){return(e,n)=>{const r=pi(n());e(T8e(t));const i=qr(n()),o=yse(n());if(i!==null&&o.length>0){for(const a of o)if(!uy(a)){const s=i.id,l=a.id,c=`${KB}-${s}-${l}`;e(A2(c,fe.get("Loading places"))),N$e(r.url,s,l,n().userAuthState.accessToken).then(u=>{e(GVe(i.id,u))}).catch(u=>{e(ba("error",u))}).finally(()=>{e(R2(c))})}}}}function T8e(t){return{type:hle,selectedPlaceGroupIds:t}}const ple="SELECT_PLACE";function M2(t,e,n){return(r,i)=>{r(E8e(t,e));const o=i().controlState.placeLocateMode;n&&t&&o!=="doNothing"&&r(fle(t,i().controlState.placeLocateMode==="panAndZoom"))}}function E8e(t,e){return{type:ple,placeId:t,places:e}}const mle="SET_LAYER_VISIBILITY";function P8e(t,e){return{type:mle,layerId:t,visible:e}}const gle="SET_MAP_POINT_INFO_BOX_ENABLED";function M8e(t){return{type:gle,mapPointInfoBoxEnabled:t}}const vle="SET_VARIABLE_COMPARE_MODE";function k8e(t){return{type:vle,variableCompareMode:t}}const iz="SET_VARIABLE_SPLIT_POS";function A8e(t){return{type:iz,variableSplitPos:t}}const yle="SELECT_VARIABLE";function xle(t){return{type:yle,selectedVariableName:t}}const ble="SELECT_VARIABLE_2";function R8e(t,e){return{type:ble,selectedDataset2Id:t,selectedVariable2Name:e}}const _le="SELECT_TIME";function k2(t){return{type:_le,selectedTime:t}}const wle="INC_SELECTED_TIME";function I8e(t){return{type:wle,increment:t}}const oz="SELECT_TIME_RANGE";function Sle(t,e,n){return{type:oz,selectedTimeRange:t,selectedGroupId:e,selectedValueRange:n}}const D8e="SELECT_TIME_SERIES_UPDATE_MODE",Ole="UPDATE_TIME_ANIMATION";function L8e(t,e){return{type:Ole,timeAnimationActive:t,timeAnimationInterval:e}}const Cle="SET_MAP_INTERACTION";function Tle(t){return{type:Cle,mapInteraction:t}}const Ele="SET_LAYER_MENU_OPEN";function Ple(t){return{type:Ele,layerMenuOpen:t}}const Mle="SET_SIDEBAR_POSITION";function N8e(t){return{type:Mle,sidebarPosition:t}}const kle="SET_SIDEBAR_OPEN";function az(t){return{type:kle,sidebarOpen:t}}const Ale="SET_SIDEBAR_PANEL_ID";function sz(t){return{type:Ale,sidebarPanelId:t}}const Rle="SET_VOLUME_RENDER_MODE";function $8e(t){return{type:Rle,volumeRenderMode:t}}const Ile="UPDATE_VOLUME_STATE";function F8e(t,e){return{type:Ile,volumeId:t,volumeState:e}}const Dle="SET_VISIBLE_INFO_CARD_ELEMENTS";function j8e(t){return{type:Dle,visibleElements:t}}const Lle="UPDATE_INFO_CARD_ELEMENT_VIEW_MODE";function B8e(t,e){return{type:Lle,elementType:t,viewMode:e}}const Nle="ADD_ACTIVITY";function A2(t,e){return{type:Nle,id:t,message:e}}const $le="REMOVE_ACTIVITY";function R2(t){return{type:$le,id:t}}const Fle="CHANGE_LOCALE";function jle(t){return{type:Fle,locale:t}}const Ble="OPEN_DIALOG";function Lp(t){return{type:Ble,dialogId:t}}const zle="CLOSE_DIALOG";function Oy(t){return{type:zle,dialogId:t}}const lz="UPDATE_SETTINGS";function ow(t){return{type:lz,settings:t}}const Ule="STORE_SETTINGS";function Wle(){return{type:Ule}}function Vle(t){return e=>{e(z8e(t)),e(U8e(t))}}const Gle="ADD_USER_COLOR_BAR";function z8e(t){return{type:Gle,colorBarId:t}}const Hle="REMOVE_USER_COLOR_BAR";function qle(t){return{type:Hle,colorBarId:t}}function Xle(t){return e=>{e(Yle(t)),e(cz(t))}}const Qle="UPDATE_USER_COLOR_BAR";function Yle(t){return{type:Qle,userColorBar:t}}function U8e(t){return(e,n)=>{const r=n().controlState.userColorBars.find(i=>i.id===t);r&&e(cz(r))}}function cz(t){return e=>{uFe(t).then(({imageData:n,errorMessage:r})=>{e(Yle({...t,imageData:n,errorMessage:r}))})}}function W8e(){return(t,e)=>{e().controlState.userColorBars.forEach(n=>{n.imageData||t(cz(n))})}}function Kle(t){return{type:lz,settings:{userColorBars:t}}}const CH=["http","https","mailto","tel"];function V8e(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)"}/*! +*/(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 lx=="function"&&lx;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 lx=="function"&&lx,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="",U=_.dir,W=_.date,$={crc32:0,compressedSize:0,uncompressedSize:0};p&&!m||($.crc32=h.crc32,$.compressedSize=h.compressedSize,$.uncompressedSize=h.uncompressedSize);var N=0;p&&(N|=8),O||!R&&!T||(N|=2048);var D=0,A=0;U&&(D|=16),v==="UNIX"?(A=798,D|=function(Y,K){var se=Y;return Y||(se=K?16893:33204),(65535&se)<<16}(_.unixPermissions,U)):(A=20,D|=function(Y){return 63&(Y||0)}(_.dosPermissions)),x=W.getUTCHours(),x<<=6,x|=W.getUTCMinutes(),x<<=5,x|=W.getUTCSeconds()/2,b=W.getUTCFullYear()-1980,b<<=4,b|=W.getUTCMonth()+1,b<<=5,b|=W.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(N,2),q+=S.magic,q+=o(x,2),q+=o(b,2),q+=o($.crc32,4),q+=o($.compressedSize,4),q+=o($.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 U(F,ce){return F.msg=u[ce],ce}function W(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,N(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)),N(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)),N(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)),N(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&&N(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(N(F),F.avail_out===0)return Q.last_flush=-1,h}else if(F.avail_in===0&&W(ce)<=W(le)&&ce!==d)return U(F,-5);if(Q.status===666&&F.avail_in!==0)return U(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&&($(Q.head),Q.lookahead===0&&(Q.strstart=0,Q.block_start=0,Q.insert=0))),N(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)),N(F),0=le.w_size&&(ee===0&&($(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=N=0,T.mode=2;break}if(T.flags=0,T.head&&(T.head.done=!1),!(1&T.wrap)||(((255&N)<<8)+(N>>8))%31){P.msg="incorrect header check",T.mode=30;break}if((15&N)!=8){P.msg="unknown compression method",T.mode=30;break}if(D-=4,F=8+(15&(N>>>=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&N,ee[1]=N>>>8&255,T.check=s(T.check,ee,2,0)),D=N=0,T.mode=3;case 3:for(;D<32;){if(W===0)break e;W--,N+=L[B++]<>>8&255,ee[2]=N>>>16&255,ee[3]=N>>>24&255,T.check=s(T.check,ee,4,0)),D=N=0,T.mode=4;case 4:for(;D<16;){if(W===0)break e;W--,N+=L[B++]<>8),512&T.flags&&(ee[0]=255&N,ee[1]=N>>>8&255,T.check=s(T.check,ee,2,0)),D=N=0,T.mode=5;case 5:if(1024&T.flags){for(;D<16;){if(W===0)break e;W--,N+=L[B++]<>>8&255,T.check=s(T.check,ee,2,0)),D=N=0}else T.head&&(T.head.extra=null);T.mode=6;case 6:if(1024&T.flags&&(W<(Y=T.length)&&(Y=W),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)),W-=Y,B+=Y,T.length-=Y),T.length))break e;T.length=0,T.mode=7;case 7:if(2048&T.flags){if(W===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(W===0)break e;W--,N+=L[B++]<>>=7&D,D-=7&D,T.mode=27;break}for(;D<3;){if(W===0)break e;W--,N+=L[B++]<>>=1)){case 0:T.mode=14;break;case 1:if(k(T),T.mode=20,R!==6)break;N>>>=2,D-=2;break e;case 2:T.mode=17;break;case 3:P.msg="invalid block type",T.mode=30}N>>>=2,D-=2;break;case 14:for(N>>>=7&D,D-=7&D;D<32;){if(W===0)break e;W--,N+=L[B++]<>>16^65535)){P.msg="invalid stored block lengths",T.mode=30;break}if(T.length=65535&N,D=N=0,T.mode=15,R===6)break e;case 15:T.mode=16;case 16:if(Y=T.length){if(W>>=5,D-=5,T.ndist=1+(31&N),N>>>=5,D-=5,T.ncode=4+(15&N),N>>>=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(W===0)break e;W--,N+=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&N),N>>>=2,D-=2}else if(pe===17){for(Q=te+3;D>>=te)),N>>>=3,D-=3}else{for(Q=te+7;D>>=te)),N>>>=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<=W&&258<=$){P.next_out=U,P.avail_out=$,P.next_in=B,P.avail_in=W,T.hold=N,T.bits=D,l(P,q),U=P.next_out,z=P.output,$=P.avail_out,B=P.next_in,L=P.input,W=P.avail_in,N=T.hold,D=T.bits,T.mode===12&&(T.back=-1);break}for(T.back=0;J=(X=T.lencode[N&(1<>>16&255,pe=65535&X,!((te=X>>>24)<=D);){if(W===0)break e;W--,N+=L[B++]<>be)])>>>16&255,pe=65535&X,!(be+(te=X>>>24)<=D);){if(W===0)break e;W--,N+=L[B++]<>>=be,D-=be,T.back+=be}if(N>>>=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[N&(1<>>16&255,pe=65535&X,!((te=X>>>24)<=D);){if(W===0)break e;W--,N+=L[B++]<>be)])>>>16&255,pe=65535&X,!(be+(te=X>>>24)<=D);){if(W===0)break e;W--,N+=L[B++]<>>=be,D-=be,T.back+=be}if(N>>>=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($===0)break e;if(Y=q-$,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=U-T.offset,Y=T.length;for($O?(E=K[se+g[R]],D[A+g[R]]):(E=96,0),y=1<>U)+(x-=y)]=C<<24|E<<16|k|0,x!==0;);for(y=1<>=1;if(y!==0?(N&=y-1,N+=y):N=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,$e,Te,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,bt=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 Zn<"u"?Zn:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(Lse);var EVe=Lse.exports;const PVe=$t(EVe);var Nse={exports:{}};(function(t,e){(function(n,r){r()})(Zn,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 Zn=="object"&&Zn.global===Zn?Zn: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})})(Nse);var $se=Nse.exports;const Fse="POST_MESSAGE";function ba(t,e){return{type:Fse,messageType:t,messageText:typeof e=="string"?e:e.message}}const jse="HIDE_MESSAGE";function MVe(t){return{type:jse,messageId:t}}var kVe={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 gH=$t(kVe);var vH={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function AVe(t){var e,n=[],r=1,i;if(typeof t=="string")if(t=t.toLowerCase(),gH[t])n=gH[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(vH[d]!==void 0)return vH[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 M3={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]},iR={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}};M3.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 RVe(t){Array.isArray(t)&&t.raw&&(t=String.raw(...arguments));var e,n=AVe(t);if(!n.space)return[];const r=n.space[0]==="h"?iR.min:M3.min,i=n.space[0]==="h"?iR.max:M3.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=iR.rgb(e)),e.push(Math.min(Math.max(n.alpha,0),1)),e}function QB(t,e,n,r="circle"){if(t.getGeometry()instanceof ql)t.setStyle(IVe(7,e,"white",2,r));else{n=typeof n=="number"?n:.25;let i=RVe(e);Array.isArray(i)?i=[i[0],i[1],i[2],n]:i=[255,255,255,n],t.setStyle(LVe(i,e,2))}}function IVe(t,e,n,r,i="circle"){return new Il({image:DVe(t,e,n,r,i)})}function DVe(t,e,n,r,i){const o=new op({color:e}),a=new Xl({color:n,width:r});switch(i){case"square":return new u3({fill:o,stroke:a,radius:t,points:4,angle:Math.PI/4,rotation:0});case"diamond":return new u3({fill:o,stroke:a,radius:t,points:4,angle:Math.PI/4,rotation:Math.PI/4});default:return new q1({fill:o,stroke:a,radius:t})}}function LVe(t,e,n){const r=new op({color:t}),i=new Xl({color:e,width:n});return new Il({fill:r,stroke:i})}function NVe(t,e,n){Ga[t]}function $Ve(t,e,n){if(Ga[t]){const i=Ga[t].getSource(),o=i==null?void 0:i.getFeatureById(e);o&&QB(o,n.color,n.opacity)}}function FVe(t,e,n){if(Ga[t]){const r=Ga[t],i=r.getView().getProjection(),a=(Array.isArray(e)?r3(e):e).transform(py,i);a.getType()==="Point"?r.getView().setCenter(a.getFirstCoordinate()):n?r.getView().fit(a,{size:r.getSize()}):r.getView().setCenter(ed(a.getExtent()))}}const iE="UPDATE_SERVER_INFO";function jVe(){return(t,e)=>{const n=pi(e());t(A2(iE,fe.get("Connecting to server"))),N$e(n.url).then(r=>{t(BVe(r))}).catch(r=>{t(ba("error",r))}).then(()=>{t(R2(iE))})}}function BVe(t){return{type:iE,serverInfo:t}}const yH="UPDATE_RESOURCES";function Bse(){return(t,e)=>{const n=pi(e());t(A2(yH,fe.get("Updating resources"))),B$e(n.url,e().userAuthState.accessToken).then(r=>{r&&window.location.reload()}).finally(()=>t(R2(yH)))}}const Qb="UPDATE_DATASETS";function zse(){return(t,e)=>{const n=pi(e());t(A2(Qb,fe.get("Loading data"))),A$e(n.url,e().userAuthState.accessToken).then(r=>{const i=Q6e();if(r=r.map(o=>({...o,variables:[...o.variables,...i[o.id]||[]]})),t(xH(r)),r.length>0){const o=e().controlState.selectedDatasetId||r[0].id;t(lle(o,r,!0))}}).catch(r=>{t(ba("error",r)),t(xH([]))}).then(()=>{t(R2(Qb))})}}function xH(t){return{type:Qb,datasets:t}}function zVe(t,e){return(n,r)=>{n(UVe(t,e));const i={};r().dataState.datasets.forEach(o=>{const[a,s]=mB(o);s.length>=0&&(i[o.id]=s)}),X6e(i)}}const Use="UPDATE_DATASET_USER_VARIABLES";function UVe(t,e){return{type:Use,datasetId:t,userVariables:e}}const YB="UPDATE_DATASET_PLACE_GROUP";function WVe(t,e){return{type:YB,datasetId:t,placeGroup:e}}const KB="ADD_DRAWN_USER_PLACE";function VVe(t,e,n,r,i){return(o,a)=>{o(GVe(t,e,n,r,i)),a().controlState.autoShowTimeSeries&&a().controlState.selectedPlaceId===e&&o(P2())}}function GVe(t,e,n,r,i){return{type:KB,placeGroupTitle:t,id:e,properties:n,geometry:r,selected:i}}const ZB="ADD_IMPORTED_USER_PLACES";function HVe(t,e,n){return{type:ZB,placeGroups:t,mapProjection:e,selected:n}}function Wse(t){return(e,n)=>{const r=SWe(n());let i;try{if(r==="csv"){const o=OWe(n());i=D6e(t,o)}else if(r==="geojson"){const o=CWe(n());i=j6e(t,o)}else if(r==="wkt"){const o=TWe(n());i=W6e(t,o)}else i=[]}catch(o){e(ba("error",o)),e(Lp("addUserPlacesFromText")),i=[]}if(i.length>0){if(e(HVe(i,wd(n()),!0)),i.length===1&&i[0].features.length===1){const a=i[0].features[0];e(M2(a.id,rw(n()),!0)),n().controlState.autoShowTimeSeries&&e(P2())}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 qVe(t,e){return{type:JB,placeGroupId:t,newName:e}}const Vse="RENAME_USER_PLACE";function XVe(t,e,n){return r=>{r(QVe(t,e,n)),NVe(t)}}function QVe(t,e,n){return{type:Vse,placeGroupId:t,placeId:e,newName:n}}const Gse="RESTYLE_USER_PLACE";function YVe(t,e,n){return r=>{r(KVe(t,e,n)),$Ve(t,e,n)}}function KVe(t,e,n){return{type:Gse,placeGroupId:t,placeId:e,placeStyle:n}}const ez="REMOVE_USER_PLACE";function ZVe(t,e,n){return{type:ez,placeGroupId:t,placeId:e,places:n}}const Hse="REMOVE_USER_PLACE_GROUP";function JVe(t){return{type:Hse,placeGroupId:t}}function qse(){return(t,e)=>{const n=pi(e()),r=qr(e()),i=vo(e()),o=iw(e()),a=wy(e()),s=e().controlState.sidebarOpen,l=e().controlState.sidebarPanelId;r&&i&&o&&(l!=="stats"&&t(az("stats")),s||t(oz(!0)),t(bH(null)),F$e(n.url,r,i,o,a,e().userAuthState.accessToken).then(c=>t(bH(c))).catch(c=>{t(ba("error",c))}))}}const Xse="ADD_STATISTICS";function bH(t){return{type:Xse,statistics:t}}const Qse="REMOVE_STATISTICS";function e8e(t){return{type:Qse,index:t}}function P2(){return(t,e)=>{const n=pi(e()),r=qr(e()),i=_y(e()),o=vo(e()),a=xy(e()),s=yse(e()),l=e().controlState.timeSeriesUpdateMode,c=e().controlState.timeSeriesUseMedian,u=e().controlState.timeSeriesIncludeStdev;let f=JWe(e());const d=e().controlState.sidebarOpen,h=e().controlState.sidebarPanelId,p=Dae(e());if(r&&o&&a&&i){h!=="timeSeries"&&t(az("timeSeries")),d||t(oz(!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 $$e(n.url,r,o,s.id,s.geometry,_,S,c,u,e().userAuthState.accessToken)},b=_=>{if(_!==null&&_H(p,s.id)){const S=y>0,O=S?(g-y)/g:1;t(t8e({..._,dataProgress:O},l,v===g-1?"new":"append")),S&&_H(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 _H(t,e){return xB(t,e)!==null}const Yse="UPDATE_TIME_SERIES";function t8e(t,e,n){return{type:Yse,timeSeries:t,updateMode:e,dataMode:n}}const Kse="ADD_PLACE_GROUP_TIME_SERIES";function n8e(t,e){return{type:Kse,timeSeriesGroupId:t,timeSeries:e}}const Zse="REMOVE_TIME_SERIES";function r8e(t,e){return{type:Zse,groupId:t,index:e}}const Jse="REMOVE_TIME_SERIES_GROUP";function i8e(t){return{type:Jse,id:t}}const ele="REMOVE_ALL_TIME_SERIES";function o8e(){return{type:ele}}const tz="CONFIGURE_SERVERS";function a8e(t,e){return(n,r)=>{r().controlState.selectedServerId!==e?(n(o8e()),n(wH(t,e)),n(nz())):r().dataState.userServers!==t&&n(wH(t,e))}}function wH(t,e){return{type:tz,servers:t,selectedServerId:e}}function nz(){return t=>{t(jVe()),t(zse()),t(s8e()),t(c8e())}}const tle="UPDATE_EXPRESSION_CAPABILITIES";function s8e(){return(t,e)=>{const n=pi(e());L$e(n.url).then(r=>{t(l8e(r))}).catch(r=>{t(ba("error",r))})}}function l8e(t){return{type:tle,expressionCapabilities:t}}const nle="UPDATE_COLOR_BARS";function c8e(){return(t,e)=>{const n=pi(e());E$e(n.url).then(r=>{t(u8e(r))}).catch(r=>{t(ba("error",r))})}}function u8e(t){return{type:nle,colorBars:t}}const rle="UPDATE_VARIABLE_COLOR_BAR";function f8e(t,e,n,r){return(i,o)=>{const a=o().controlState.selectedDatasetId,s=o().controlState.selectedVariableName;a&&s&&i(ile(a,s,t,e,n,r))}}function d8e(t,e,n,r){return(i,o)=>{const a=o().controlState.selectedDatasetId,s=o().controlState.selectedVariable2Name;a&&s&&i(ile(a,s,t,e,n,r))}}function ile(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:rle,datasetId:t,variableName:e,colorBarName:n,colorBarMinMax:r,colorBarNorm:i,opacity:o}}const ole="UPDATE_VARIABLE_VOLUME";function h8e(t,e,n,r,i){return{type:ole,datasetId:t,variableName:e,variableColorBar:n,volumeRenderMode:r,volumeIsoThreshold:i}}function p8e(){return(t,e)=>{const{exportTimeSeries:n,exportTimeSeriesSeparator:r,exportPlaces:i,exportPlacesAsCollection:o,exportZipArchive:a,exportFileName:s}=e().controlState;let l=[];n?(l=[],Z1(e()).forEach(u=>{u.placeGroups&&(l=l.concat(u.placeGroups))}),l=[...l,...J1(e())]):i&&(l=by(e())),v8e(e().dataState.timeSeriesGroups,l,{includeTimeSeries:n,includePlaces:i,separator:r,placesAsCollection:o,zip:a,fileName:s})}}class ale{}class m8e extends ale{constructor(n){super();Yt(this,"fileName");Yt(this,"zipArchive");this.fileName=n,this.zipArchive=new PVe}write(n,r){this.zipArchive.file(n,r)}close(){this.zipArchive.generateAsync({type:"blob"}).then(n=>$se.saveAs(n,this.fileName))}}class g8e extends ale{write(e,n){const r=new Blob([n],{type:"text/plain;charset=utf-8"});$se.saveAs(r,e)}close(){}}function v8e(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 m8e(`${l}.zip`):c=new g8e;let u;if(r){const{colNames:f,dataRows:d,referencedPlaces:h}=t6e(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 sle="SELECT_DATASET";function lle(t,e,n){return(r,i)=>{r(y8e(t,e));const o=i().controlState.datasetLocateMode;t&&n&&o!=="doNothing"&&r(cle(t,i().controlState.datasetLocateMode==="panAndZoom"))}}function y8e(t,e){return{type:sle,selectedDatasetId:t,datasets:e}}function x8e(){return(t,e)=>{const n=ew(e());n&&t(cle(n,!0))}}function b8e(){return(t,e)=>{const n=xy(e());n&&t(ule(n,!0))}}function cle(t,e){return(n,r)=>{const i=Z1(r()),o=zb(i,t);o&&o.bbox&&n(k3(o.bbox,e))}}const _8e=["Point","LineString","LinearRing","Polygon","MultiPoint","MultiLineString","MultiPolygon","Circle"];function ule(t,e){return(n,r)=>{const i=by(r()),o=xB(i,t);o&&(o.bbox&&o.bbox.length===4?n(k3(o.bbox,e)):o.geometry&&_8e.includes(o.geometry.type)&&n(k3(new Ip().readGeometry(o.geometry),e)))}}function k3(t,e){return n=>{if(t!==null){const r="map";n(w8e(r,t)),FVe(r,t,e)}}}const fle="FLY_TO";function w8e(t,e){return{type:fle,mapId:t,location:e}}const dle="SELECT_PLACE_GROUPS";function S8e(t){return(e,n)=>{const r=pi(n());e(O8e(t));const i=qr(n()),o=vse(n());if(i!==null&&o.length>0){for(const a of o)if(!uy(a)){const s=i.id,l=a.id,c=`${YB}-${s}-${l}`;e(A2(c,fe.get("Loading places"))),D$e(r.url,s,l,n().userAuthState.accessToken).then(u=>{e(WVe(i.id,u))}).catch(u=>{e(ba("error",u))}).finally(()=>{e(R2(c))})}}}}function O8e(t){return{type:dle,selectedPlaceGroupIds:t}}const hle="SELECT_PLACE";function M2(t,e,n){return(r,i)=>{r(C8e(t,e));const o=i().controlState.placeLocateMode;n&&t&&o!=="doNothing"&&r(ule(t,i().controlState.placeLocateMode==="panAndZoom"))}}function C8e(t,e){return{type:hle,placeId:t,places:e}}const ple="SET_LAYER_VISIBILITY";function T8e(t,e){return{type:ple,layerId:t,visible:e}}const mle="SET_MAP_POINT_INFO_BOX_ENABLED";function E8e(t){return{type:mle,mapPointInfoBoxEnabled:t}}const gle="SET_VARIABLE_COMPARE_MODE";function P8e(t){return{type:gle,variableCompareMode:t}}const rz="SET_VARIABLE_SPLIT_POS";function M8e(t){return{type:rz,variableSplitPos:t}}const vle="SELECT_VARIABLE";function yle(t){return{type:vle,selectedVariableName:t}}const xle="SELECT_VARIABLE_2";function k8e(t,e){return{type:xle,selectedDataset2Id:t,selectedVariable2Name:e}}const ble="SELECT_TIME";function k2(t){return{type:ble,selectedTime:t}}const _le="INC_SELECTED_TIME";function A8e(t){return{type:_le,increment:t}}const iz="SELECT_TIME_RANGE";function wle(t,e,n){return{type:iz,selectedTimeRange:t,selectedGroupId:e,selectedValueRange:n}}const R8e="SELECT_TIME_SERIES_UPDATE_MODE",Sle="UPDATE_TIME_ANIMATION";function I8e(t,e){return{type:Sle,timeAnimationActive:t,timeAnimationInterval:e}}const Ole="SET_MAP_INTERACTION";function Cle(t){return{type:Ole,mapInteraction:t}}const Tle="SET_LAYER_MENU_OPEN";function Ele(t){return{type:Tle,layerMenuOpen:t}}const Ple="SET_SIDEBAR_POSITION";function D8e(t){return{type:Ple,sidebarPosition:t}}const Mle="SET_SIDEBAR_OPEN";function oz(t){return{type:Mle,sidebarOpen:t}}const kle="SET_SIDEBAR_PANEL_ID";function az(t){return{type:kle,sidebarPanelId:t}}const Ale="SET_VOLUME_RENDER_MODE";function L8e(t){return{type:Ale,volumeRenderMode:t}}const Rle="UPDATE_VOLUME_STATE";function N8e(t,e){return{type:Rle,volumeId:t,volumeState:e}}const Ile="SET_VISIBLE_INFO_CARD_ELEMENTS";function $8e(t){return{type:Ile,visibleElements:t}}const Dle="UPDATE_INFO_CARD_ELEMENT_VIEW_MODE";function F8e(t,e){return{type:Dle,elementType:t,viewMode:e}}const Lle="ADD_ACTIVITY";function A2(t,e){return{type:Lle,id:t,message:e}}const Nle="REMOVE_ACTIVITY";function R2(t){return{type:Nle,id:t}}const $le="CHANGE_LOCALE";function Fle(t){return{type:$le,locale:t}}const jle="OPEN_DIALOG";function Lp(t){return{type:jle,dialogId:t}}const Ble="CLOSE_DIALOG";function Sy(t){return{type:Ble,dialogId:t}}const sz="UPDATE_SETTINGS";function ow(t){return{type:sz,settings:t}}const zle="STORE_SETTINGS";function Ule(){return{type:zle}}function Wle(t){return e=>{e(j8e(t)),e(B8e(t))}}const Vle="ADD_USER_COLOR_BAR";function j8e(t){return{type:Vle,colorBarId:t}}const Gle="REMOVE_USER_COLOR_BAR";function Hle(t){return{type:Gle,colorBarId:t}}function qle(t){return e=>{e(Qle(t)),e(lz(t))}}const Xle="UPDATE_USER_COLOR_BAR";function Qle(t){return{type:Xle,userColorBar:t}}function B8e(t){return(e,n)=>{const r=n().controlState.userColorBars.find(i=>i.id===t);r&&e(lz(r))}}function lz(t){return e=>{lFe(t).then(({imageData:n,errorMessage:r})=>{e(Qle({...t,imageData:n,errorMessage:r}))})}}function z8e(){return(t,e)=>{e().controlState.userColorBars.forEach(n=>{n.imageData||t(lz(n))})}}function Yle(t){return{type:sz,settings:{userColorBars:t}}}const SH=["http","https","mailto","tel"];function U8e(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 G8e=function(e){return e!=null&&e.constructor!=null&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)};const Zle=$t(G8e);function Qx(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?TH(t.position):"start"in t||"end"in t?TH(t):"line"in t||"column"in t?R3(t):""}function R3(t){return EH(t&&t.line)+":"+EH(t&&t.column)}function TH(t){return R3(t&&t.start)+"-"+R3(t&&t.end)}function EH(t){return t&&typeof t=="number"?t:1}class _s 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=Qx(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}}_s.prototype.file="";_s.prototype.name="";_s.prototype.reason="";_s.prototype.message="";_s.prototype.stack="";_s.prototype.fatal=null;_s.prototype.column=null;_s.prototype.line=null;_s.prototype.source=null;_s.prototype.ruleId=null;_s.prototype.position=null;const gl={basename:H8e,dirname:q8e,extname:X8e,join:Q8e,sep:"/"};function H8e(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');aw(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 q8e(t){if(aw(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 X8e(t){aw(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 Q8e(...t){let e=-1,n;for(;++e0&&t.charCodeAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function K8e(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 aw(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const Z8e={cwd:J8e};function J8e(){return"/"}function I3(t){return t!==null&&typeof t=="object"&&t.href&&t.origin}function eGe(t){if(typeof t=="string")t=new URL(t);else if(!I3(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 tGe(t)}function tGe(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"||LC.call(e,i)},DH=function(e,n){kH&&n.name==="__proto__"?kH(e,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):e[n.name]=n.newValue},LH=function(e,n){if(n==="__proto__")if(LC.call(e,n)){if(AH)return AH(e,n).value}else return;return e[n]},rGe=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 aGe=nce().freeze(),tce={}.hasOwnProperty;function nce(){const t=iGe(),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=nce();let g=-1;for(;++g{if(S||!O||!C)_(S);else{const E=o.stringify(O,C);E==null||(cGe(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(),cR("processSync",o.Parser),uR("processSync",o.Compiler);const v=T0(m);return o.process(v,y),jH("processSync","process",g),v;function y(x){g=!0,MH(x)}}}function $H(t,e){return typeof t=="function"&&t.prototype&&(sGe(t.prototype)||e in t.prototype)}function sGe(t){let e;for(e in t)if(tce.call(t,e))return!0;return!1}function cR(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `Parser`")}function uR(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `Compiler`")}function fR(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 FH(t){if(!D3(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function jH(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function T0(t){return lGe(t)?t:new Jle(t)}function lGe(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function cGe(t){return typeof t=="string"||Zle(t)}const uGe={};function fGe(t,e){const n=uGe,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return rce(t,r,i)}function rce(t,e,n){if(dGe(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 BH(t.children,e,n)}return Array.isArray(t)?BH(t,e,n):""}function BH(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?(ec(t,t.length,0,e),t):e}const zH={}.hasOwnProperty;function hGe(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 TGe(t,e,n){return Vn(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function WH(t){if(t===null||Fo(t)||_Ge(t))return 1;if(bGe(t))return 2}function uz(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);VH(f,-l),VH(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,uz(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,ec(t,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n0&&yn(S)?Vn(t,y,"linePrefix",o+1)(S):y(S)}function y(S){return S===null||Tt(S)?t.check(HH,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)?Vn(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)?Vn(S,T,"whitespace")(L):T(L)):C(L)}function T(L){return L===null||Tt(L)?(S.exit("codeFencedFence"),O(L)):C(L)}}}function FGe(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 dR={name:"codeIndented",tokenize:BGe},jGe={tokenize:zGe,partial:!0};function BGe(t,e,n){const r=this;return i;function i(c){return t.enter("codeIndented"),Vn(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(jGe,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 zGe(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):Vn(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 UGe={name:"codeText",tokenize:GGe,resolve:WGe,previous:VGe};function WGe(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 lce(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||L3(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||Fo(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 uce(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"),Vn(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 Yx(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)?Vn(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}function Eg(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ZGe={name:"definition",tokenize:eHe},JGe={tokenize:tHe,partial:!0};function eHe(t,e,n){const r=this;let i;return o;function o(h){return t.enter("definition"),a(h)}function a(h){return cce.call(r,t,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function s(h){return i=Eg(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 Fo(h)?Yx(t,c)(h):c(h)}function c(h){return lce(t,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function u(h){return t.attempt(JGe,f,f)(h)}function f(h){return yn(h)?Vn(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 tHe(t,e,n){return r;function r(s){return Fo(s)?Yx(t,i)(s):n(s)}function i(s){return uce(t,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return yn(s)?Vn(t,a,"whitespace")(s):a(s)}function a(s){return s===null||Tt(s)?e(s):n(s)}}const nHe={name:"hardBreakEscape",tokenize:rHe};function rHe(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 iHe={name:"headingAtx",tokenize:aHe,resolve:oHe};function oHe(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"},ec(t,r,n-r+1,[["enter",i,e],["enter",o,e],["exit",o,e],["exit",i,e]])),t}function aHe(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||Fo(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)?Vn(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||Fo(u)?(t.exit("atxHeadingText"),s(u)):(t.consume(u),c)}}const sHe=["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"],XH=["pre","script","style","textarea"],lHe={name:"htmlFlow",tokenize:dHe,resolveTo:fHe,concrete:!0},cHe={tokenize:pHe,partial:!0},uHe={tokenize:hHe,partial:!0};function fHe(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 dHe(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:$):Cl(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):Cl(A)?(t.consume(A),i=4,r.interrupt?e:$):n(A)}function h(A){return A===45?(t.consume(A),r.interrupt?e:$):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 Cl(A)?(t.consume(A),a=String.fromCharCode(A),g):n(A)}function g(A){if(A===null||A===47||A===62||Fo(A)){const q=A===47,Y=a.toLowerCase();return!q&&!o&&XH.includes(Y)?(i=1,r.interrupt?e(A):P(A)):sHe.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||Cl(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||Fo(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),N):A===63&&i===3?(t.consume(A),$):A===93&&i===5?(t.consume(A),W):Tt(A)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(cHe,D,R)(A)):A===null||Tt(A)?(t.exit("htmlFlowData"),R(A)):(t.consume(A),P)}function R(A){return t.check(uHe,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),$):P(A)}function B(A){return A===47?(t.consume(A),a="",U):P(A)}function U(A){if(A===62){const q=a.toLowerCase();return XH.includes(q)?(t.consume(A),N):P(A)}return Cl(A)&&a.length<8?(t.consume(A),a+=String.fromCharCode(A),U):P(A)}function W(A){return A===93?(t.consume(A),$):P(A)}function $(A){return A===62?(t.consume(A),N):A===45&&i===2?(t.consume(A),$):P(A)}function N(A){return A===null||Tt(A)?(t.exit("htmlFlowData"),D(A)):(t.consume(A),N)}function D(A){return t.exit("htmlFlow"),e(A)}}function hHe(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 pHe(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(I2,e,n)}}const mHe={name:"htmlText",tokenize:gHe};function gHe(t,e,n){const r=this;let i,o,a;return s;function s($){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume($),l}function l($){return $===33?(t.consume($),c):$===47?(t.consume($),_):$===63?(t.consume($),x):Cl($)?(t.consume($),C):n($)}function c($){return $===45?(t.consume($),u):$===91?(t.consume($),o=0,p):Cl($)?(t.consume($),y):n($)}function u($){return $===45?(t.consume($),h):n($)}function f($){return $===null?n($):$===45?(t.consume($),d):Tt($)?(a=f,B($)):(t.consume($),f)}function d($){return $===45?(t.consume($),h):f($)}function h($){return $===62?z($):$===45?d($):f($)}function p($){const N="CDATA[";return $===N.charCodeAt(o++)?(t.consume($),o===N.length?m:p):n($)}function m($){return $===null?n($):$===93?(t.consume($),g):Tt($)?(a=m,B($)):(t.consume($),m)}function g($){return $===93?(t.consume($),v):m($)}function v($){return $===62?z($):$===93?(t.consume($),v):m($)}function y($){return $===null||$===62?z($):Tt($)?(a=y,B($)):(t.consume($),y)}function x($){return $===null?n($):$===63?(t.consume($),b):Tt($)?(a=x,B($)):(t.consume($),x)}function b($){return $===62?z($):x($)}function _($){return Cl($)?(t.consume($),S):n($)}function S($){return $===45||ma($)?(t.consume($),S):O($)}function O($){return Tt($)?(a=O,B($)):yn($)?(t.consume($),O):z($)}function C($){return $===45||ma($)?(t.consume($),C):$===47||$===62||Fo($)?E($):n($)}function E($){return $===47?(t.consume($),z):$===58||$===95||Cl($)?(t.consume($),k):Tt($)?(a=E,B($)):yn($)?(t.consume($),E):z($)}function k($){return $===45||$===46||$===58||$===95||ma($)?(t.consume($),k):I($)}function I($){return $===61?(t.consume($),P):Tt($)?(a=I,B($)):yn($)?(t.consume($),I):E($)}function P($){return $===null||$===60||$===61||$===62||$===96?n($):$===34||$===39?(t.consume($),i=$,R):Tt($)?(a=P,B($)):yn($)?(t.consume($),P):(t.consume($),T)}function R($){return $===i?(t.consume($),i=void 0,L):$===null?n($):Tt($)?(a=R,B($)):(t.consume($),R)}function T($){return $===null||$===34||$===39||$===60||$===61||$===96?n($):$===47||$===62||Fo($)?E($):(t.consume($),T)}function L($){return $===47||$===62||Fo($)?E($):n($)}function z($){return $===62?(t.consume($),t.exit("htmlTextData"),t.exit("htmlText"),e):n($)}function B($){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume($),t.exit("lineEnding"),U}function U($){return yn($)?Vn(t,W,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):W($)}function W($){return t.enter("htmlTextData"),a($)}}const dz={name:"labelEnd",tokenize:wHe,resolveTo:_He,resolveAll:bHe},vHe={tokenize:SHe},yHe={tokenize:OHe},xHe={tokenize:CHe};function bHe(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)?Vn(t,s,"whitespace")(c):s(c))}}const _o={name:"list",tokenize:DHe,continuation:{tokenize:LHe},exit:$He},RHe={tokenize:FHe,partial:!0},IHe={tokenize:NHe,partial:!0};function DHe(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:N3(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(NC,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 N3(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(I2,r.interrupt?n:u,t.attempt(RHe,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 LHe(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(I2,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Vn(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(IHe,e,a)(s))}function a(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,Vn(t,t.attempt(_o,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function NHe(t,e,n){const r=this;return Vn(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 $He(t){t.exit(this.containerState.type)}function FHe(t,e,n){const r=this;return Vn(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 QH={name:"setextUnderline",tokenize:BHe,resolveTo:jHe};function jHe(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 BHe(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)?Vn(t,l,"lineSuffix")(c):l(c))}function l(c){return c===null||Tt(c)?(t.exit("setextHeadingLine"),e(c)):n(c)}}const zHe={tokenize:UHe};function UHe(t){const e=this,n=t.attempt(I2,r,t.attempt(this.parser.constructs.flowInitial,i,Vn(t,t.attempt(this.parser.constructs.flow,i,t.attempt(qGe,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 WHe={resolveAll:dce()},VHe=fce("string"),GHe=fce("text");function fce(t){return{tokenize:e,resolveAll:dce(t==="text"?HHe: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 QHe(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 G8e(t){if(aw(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 H8e(t){aw(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 q8e(...t){let e=-1,n;for(;++e0&&t.charCodeAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function Q8e(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 aw(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const Y8e={cwd:K8e};function K8e(){return"/"}function R3(t){return t!==null&&typeof t=="object"&&t.href&&t.origin}function Z8e(t){if(typeof t=="string")t=new URL(t);else if(!R3(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 J8e(t)}function J8e(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"||LC.call(e,i)},RH=function(e,n){PH&&n.name==="__proto__"?PH(e,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):e[n.name]=n.newValue},IH=function(e,n){if(n==="__proto__")if(LC.call(e,n)){if(MH)return MH(e,n).value}else return;return e[n]},tGe=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 iGe=tce().freeze(),ece={}.hasOwnProperty;function tce(){const t=nGe(),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=tce();let g=-1;for(;++g{if(S||!O||!C)_(S);else{const E=o.stringify(O,C);E==null||(sGe(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(),lR("processSync",o.Parser),cR("processSync",o.Compiler);const v=C0(m);return o.process(v,y),$H("processSync","process",g),v;function y(x){g=!0,EH(x)}}}function LH(t,e){return typeof t=="function"&&t.prototype&&(oGe(t.prototype)||e in t.prototype)}function oGe(t){let e;for(e in t)if(ece.call(t,e))return!0;return!1}function lR(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `Parser`")}function cR(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `Compiler`")}function uR(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 NH(t){if(!I3(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function $H(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function C0(t){return aGe(t)?t:new Zle(t)}function aGe(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function sGe(t){return typeof t=="string"||Kle(t)}const lGe={};function cGe(t,e){const n=lGe,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return nce(t,r,i)}function nce(t,e,n){if(uGe(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 FH(t.children,e,n)}return Array.isArray(t)?FH(t,e,n):""}function FH(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?(ec(t,t.length,0,e),t):e}const jH={}.hasOwnProperty;function fGe(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 OGe(t,e,n){return Vn(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function zH(t){if(t===null||Fo(t)||xGe(t))return 1;if(yGe(t))return 2}function cz(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);UH(f,-l),UH(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,cz(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,ec(t,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n0&&yn(S)?Vn(t,y,"linePrefix",o+1)(S):y(S)}function y(S){return S===null||Tt(S)?t.check(VH,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)?Vn(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)?Vn(S,T,"whitespace")(L):T(L)):C(L)}function T(L){return L===null||Tt(L)?(S.exit("codeFencedFence"),O(L)):C(L)}}}function NGe(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 fR={name:"codeIndented",tokenize:FGe},$Ge={tokenize:jGe,partial:!0};function FGe(t,e,n){const r=this;return i;function i(c){return t.enter("codeIndented"),Vn(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($Ge,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 jGe(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):Vn(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 BGe={name:"codeText",tokenize:WGe,resolve:zGe,previous:UGe};function zGe(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 sce(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||D3(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||Fo(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 cce(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"),Vn(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 Qx(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)?Vn(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}function Eg(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const YGe={name:"definition",tokenize:ZGe},KGe={tokenize:JGe,partial:!0};function ZGe(t,e,n){const r=this;let i;return o;function o(h){return t.enter("definition"),a(h)}function a(h){return lce.call(r,t,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function s(h){return i=Eg(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 Fo(h)?Qx(t,c)(h):c(h)}function c(h){return sce(t,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function u(h){return t.attempt(KGe,f,f)(h)}function f(h){return yn(h)?Vn(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 JGe(t,e,n){return r;function r(s){return Fo(s)?Qx(t,i)(s):n(s)}function i(s){return cce(t,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return yn(s)?Vn(t,a,"whitespace")(s):a(s)}function a(s){return s===null||Tt(s)?e(s):n(s)}}const eHe={name:"hardBreakEscape",tokenize:tHe};function tHe(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 nHe={name:"headingAtx",tokenize:iHe,resolve:rHe};function rHe(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"},ec(t,r,n-r+1,[["enter",i,e],["enter",o,e],["exit",o,e],["exit",i,e]])),t}function iHe(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||Fo(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)?Vn(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||Fo(u)?(t.exit("atxHeadingText"),s(u)):(t.consume(u),c)}}const oHe=["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"],HH=["pre","script","style","textarea"],aHe={name:"htmlFlow",tokenize:uHe,resolveTo:cHe,concrete:!0},sHe={tokenize:dHe,partial:!0},lHe={tokenize:fHe,partial:!0};function cHe(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 uHe(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:$):Cl(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):Cl(A)?(t.consume(A),i=4,r.interrupt?e:$):n(A)}function h(A){return A===45?(t.consume(A),r.interrupt?e:$):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 Cl(A)?(t.consume(A),a=String.fromCharCode(A),g):n(A)}function g(A){if(A===null||A===47||A===62||Fo(A)){const q=A===47,Y=a.toLowerCase();return!q&&!o&&HH.includes(Y)?(i=1,r.interrupt?e(A):P(A)):oHe.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||Cl(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||Fo(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),N):A===63&&i===3?(t.consume(A),$):A===93&&i===5?(t.consume(A),W):Tt(A)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(sHe,D,R)(A)):A===null||Tt(A)?(t.exit("htmlFlowData"),R(A)):(t.consume(A),P)}function R(A){return t.check(lHe,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),$):P(A)}function B(A){return A===47?(t.consume(A),a="",U):P(A)}function U(A){if(A===62){const q=a.toLowerCase();return HH.includes(q)?(t.consume(A),N):P(A)}return Cl(A)&&a.length<8?(t.consume(A),a+=String.fromCharCode(A),U):P(A)}function W(A){return A===93?(t.consume(A),$):P(A)}function $(A){return A===62?(t.consume(A),N):A===45&&i===2?(t.consume(A),$):P(A)}function N(A){return A===null||Tt(A)?(t.exit("htmlFlowData"),D(A)):(t.consume(A),N)}function D(A){return t.exit("htmlFlow"),e(A)}}function fHe(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 dHe(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(I2,e,n)}}const hHe={name:"htmlText",tokenize:pHe};function pHe(t,e,n){const r=this;let i,o,a;return s;function s($){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume($),l}function l($){return $===33?(t.consume($),c):$===47?(t.consume($),_):$===63?(t.consume($),x):Cl($)?(t.consume($),C):n($)}function c($){return $===45?(t.consume($),u):$===91?(t.consume($),o=0,p):Cl($)?(t.consume($),y):n($)}function u($){return $===45?(t.consume($),h):n($)}function f($){return $===null?n($):$===45?(t.consume($),d):Tt($)?(a=f,B($)):(t.consume($),f)}function d($){return $===45?(t.consume($),h):f($)}function h($){return $===62?z($):$===45?d($):f($)}function p($){const N="CDATA[";return $===N.charCodeAt(o++)?(t.consume($),o===N.length?m:p):n($)}function m($){return $===null?n($):$===93?(t.consume($),g):Tt($)?(a=m,B($)):(t.consume($),m)}function g($){return $===93?(t.consume($),v):m($)}function v($){return $===62?z($):$===93?(t.consume($),v):m($)}function y($){return $===null||$===62?z($):Tt($)?(a=y,B($)):(t.consume($),y)}function x($){return $===null?n($):$===63?(t.consume($),b):Tt($)?(a=x,B($)):(t.consume($),x)}function b($){return $===62?z($):x($)}function _($){return Cl($)?(t.consume($),S):n($)}function S($){return $===45||ma($)?(t.consume($),S):O($)}function O($){return Tt($)?(a=O,B($)):yn($)?(t.consume($),O):z($)}function C($){return $===45||ma($)?(t.consume($),C):$===47||$===62||Fo($)?E($):n($)}function E($){return $===47?(t.consume($),z):$===58||$===95||Cl($)?(t.consume($),k):Tt($)?(a=E,B($)):yn($)?(t.consume($),E):z($)}function k($){return $===45||$===46||$===58||$===95||ma($)?(t.consume($),k):I($)}function I($){return $===61?(t.consume($),P):Tt($)?(a=I,B($)):yn($)?(t.consume($),I):E($)}function P($){return $===null||$===60||$===61||$===62||$===96?n($):$===34||$===39?(t.consume($),i=$,R):Tt($)?(a=P,B($)):yn($)?(t.consume($),P):(t.consume($),T)}function R($){return $===i?(t.consume($),i=void 0,L):$===null?n($):Tt($)?(a=R,B($)):(t.consume($),R)}function T($){return $===null||$===34||$===39||$===60||$===61||$===96?n($):$===47||$===62||Fo($)?E($):(t.consume($),T)}function L($){return $===47||$===62||Fo($)?E($):n($)}function z($){return $===62?(t.consume($),t.exit("htmlTextData"),t.exit("htmlText"),e):n($)}function B($){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume($),t.exit("lineEnding"),U}function U($){return yn($)?Vn(t,W,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):W($)}function W($){return t.enter("htmlTextData"),a($)}}const fz={name:"labelEnd",tokenize:bHe,resolveTo:xHe,resolveAll:yHe},mHe={tokenize:_He},gHe={tokenize:wHe},vHe={tokenize:SHe};function yHe(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)?Vn(t,s,"whitespace")(c):s(c))}}const _o={name:"list",tokenize:RHe,continuation:{tokenize:IHe},exit:LHe},kHe={tokenize:NHe,partial:!0},AHe={tokenize:DHe,partial:!0};function RHe(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:L3(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(NC,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 L3(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(I2,r.interrupt?n:u,t.attempt(kHe,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 IHe(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(I2,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Vn(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(AHe,e,a)(s))}function a(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,Vn(t,t.attempt(_o,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function DHe(t,e,n){const r=this;return Vn(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 LHe(t){t.exit(this.containerState.type)}function NHe(t,e,n){const r=this;return Vn(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 qH={name:"setextUnderline",tokenize:FHe,resolveTo:$He};function $He(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 FHe(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)?Vn(t,l,"lineSuffix")(c):l(c))}function l(c){return c===null||Tt(c)?(t.exit("setextHeadingLine"),e(c)):n(c)}}const jHe={tokenize:BHe};function BHe(t){const e=this,n=t.attempt(I2,r,t.attempt(this.parser.constructs.flowInitial,i,Vn(t,t.attempt(this.parser.constructs.flow,i,t.attempt(GGe,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 zHe={resolveAll:fce()},UHe=uce("string"),WHe=uce("text");function uce(t){return{tokenize:e,resolveAll:fce(t==="text"?VHe: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 qHe(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 c9e=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function u9e(t){return t.replace(c9e,f9e)}function f9e(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return hce(n.slice(o?2:1),o?16:10)}return fz(n)||t}const pce={}.hasOwnProperty,d9e=function(t,e,n){return typeof e!="string"&&(n=e,e=void 0),h9e(n)(l9e(a9e(n).document().write(s9e()(t,e,!0))))};function h9e(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(W),label:N,labelText:$,lineEnding:R,link:u(U),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()}};mce(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]||KH).call(V,void 0,Me[0])}for(Z.position={start:Fu(oe.length>0?oe[0][1].start:{line:1,column:1,offset:0}),end:Fu(oe.length>0?oe[oe.length-2][1].end:{line:1,column:1,offset:0})},xe=-1;++xe{const r=this.data("settings");return d9e(n,Object.assign({},r,t,{extensions:this.data("micromarkExtensions")||[],mdastExtensions:this.data("fromMarkdownExtensions")||[]}))}})}function g9e(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 v9e(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:` -`}]}function y9e(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 x9e(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function b9e(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Cy(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 gce(t,e){const n=String(e.identifier).toUpperCase(),r=Cy(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 _9e(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},gce(t,{type:"footnoteReference",identifier:i,position:e.position})}function w9e(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 S9e(t,e){if(t.dangerous){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}return null}function vce(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 O9e(t,e){const n=t.definition(e.identifier);if(!n)return vce(t,e);const r={src:Cy(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 C9e(t,e){const n={src:Cy(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 T9e(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 E9e(t,e){const n=t.definition(e.identifier);if(!n)return vce(t,e);const r={href:Cy(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 P9e(t,e){const n={href:Cy(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 M9e(t,e,n){const r=t.all(e),i=n?k9e(n):yce(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 s9e=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function l9e(t){return t.replace(s9e,c9e)}function c9e(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return dce(n.slice(o?2:1),o?16:10)}return uz(n)||t}const hce={}.hasOwnProperty,u9e=function(t,e,n){return typeof e!="string"&&(n=e,e=void 0),f9e(n)(a9e(i9e(n).document().write(o9e()(t,e,!0))))};function f9e(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(W),label:N,labelText:$,lineEnding:R,link:u(U),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()}};pce(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]||QH).call(V,void 0,Me[0])}for(Z.position={start:Fu(oe.length>0?oe[0][1].start:{line:1,column:1,offset:0}),end:Fu(oe.length>0?oe[oe.length-2][1].end:{line:1,column:1,offset:0})},xe=-1;++xe{const r=this.data("settings");return u9e(n,Object.assign({},r,t,{extensions:this.data("micromarkExtensions")||[],mdastExtensions:this.data("fromMarkdownExtensions")||[]}))}})}function p9e(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 m9e(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:` +`}]}function g9e(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 v9e(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function y9e(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Oy(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 mce(t,e){const n=String(e.identifier).toUpperCase(),r=Oy(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 x9e(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},mce(t,{type:"footnoteReference",identifier:i,position:e.position})}function b9e(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 _9e(t,e){if(t.dangerous){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}return null}function gce(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 w9e(t,e){const n=t.definition(e.identifier);if(!n)return gce(t,e);const r={src:Oy(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 S9e(t,e){const n={src:Oy(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 O9e(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 C9e(t,e){const n=t.definition(e.identifier);if(!n)return gce(t,e);const r={href:Oy(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 T9e(t,e){const n={href:Oy(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 E9e(t,e,n){const r=t.all(e),i=n?P9e(n):vce(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 A9e(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 N9e(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=hz(e.children[1]),l=pz(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 $9e(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(e9(e.slice(i),i>0,!1)),o.join("")}function e9(t,e,n){let r=0,i=t.length;if(e){let o=t.codePointAt(r);for(;o===ZH||o===JH;)r++,o=t.codePointAt(r)}if(n){let o=t.codePointAt(i-1);for(;o===ZH||o===JH;)i--,o=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function B9e(t,e){const n={type:"text",value:j9e(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function z9e(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const U9e={blockquote:g9e,break:v9e,code:y9e,delete:x9e,emphasis:b9e,footnoteReference:gce,footnote:_9e,heading:w9e,html:S9e,imageReference:O9e,image:C9e,inlineCode:T9e,linkReference:E9e,link:P9e,listItem:M9e,list:A9e,paragraph:R9e,root:I9e,strong:D9e,table:N9e,tableCell:F9e,tableRow:$9e,text:B9e,thematicBreak:z9e,toml:NS,yaml:NS,definition:NS,footnoteDefinition:NS};function NS(){return null}const bce=function(t){if(t==null)return H9e;if(typeof t=="string")return G9e(t);if(typeof t=="object")return Array.isArray(t)?W9e(t):V9e(t);if(typeof t=="function")return D2(t);throw new Error("Expected function, string, or object as test")};function W9e(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=Y9e(n(s,c)),d[0]===t9))return d;if(s.children&&d[0]!==X9e)for(p=(r?s.children.length:-1)+o,m=c.concat(s);p>-1&&p{const i=r9(r.identifier);i&&!n9.call(e,i)&&(e[i]=r)}),n;function n(r){const i=r9(r);return i&&n9.call(e,i)?e[i]:null}}function r9(t){return String(t||"").toUpperCase()}const oE={}.hasOwnProperty;function J9e(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={...U9e,...n.handlers},a.definition=Z9e(t),a.footnoteById=i,a.footnoteOrder=[],a.footnoteCounts={},a.patch=e7e,a.applyData=t7e,a.one=s,a.all=l,a.wrap=r7e,a.augment=o,mz(t,"footnoteDefinition",c=>{const u=String(c.identifier).toUpperCase();oE.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};K9e(f)||(u.position={start:hz(f),end:pz(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 _ce(a,c,u)}function l(c){return gz(a,c)}}function e7e(t,e){t.position&&(e.position=L9e(t))}function t7e(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 _ce(t,e,n){const r=e&&e.type;if(!r)throw new Error("Expected node, got `"+e+"`");return oE.call(t.handlers,r)?t.handlers[r](t,e,n):t.passThrough&&t.passThrough.includes(r)?"children"in e?{...e,children:gz(t,e)}:e:t.unknownHandler?t.unknownHandler(t,e,n):n7e(t,e)}function gz(t,e){const n=[];if("children"in e){const r=e.children;let i=-1;for(;++i1}function M9e(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 D9e(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=dz(e.children[1]),l=hz(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 L9e(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===YH||o===KH;)r++,o=t.codePointAt(r)}if(n){let o=t.codePointAt(i-1);for(;o===YH||o===KH;)i--,o=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function F9e(t,e){const n={type:"text",value:$9e(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function j9e(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const B9e={blockquote:p9e,break:m9e,code:g9e,delete:v9e,emphasis:y9e,footnoteReference:mce,footnote:x9e,heading:b9e,html:_9e,imageReference:w9e,image:S9e,inlineCode:O9e,linkReference:C9e,link:T9e,listItem:E9e,list:M9e,paragraph:k9e,root:A9e,strong:R9e,table:D9e,tableCell:N9e,tableRow:L9e,text:F9e,thematicBreak:j9e,toml:NS,yaml:NS,definition:NS,footnoteDefinition:NS};function NS(){return null}const xce=function(t){if(t==null)return V9e;if(typeof t=="string")return W9e(t);if(typeof t=="object")return Array.isArray(t)?z9e(t):U9e(t);if(typeof t=="function")return D2(t);throw new Error("Expected function, string, or object as test")};function z9e(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=X9e(n(s,c)),d[0]===JH))return d;if(s.children&&d[0]!==H9e)for(p=(r?s.children.length:-1)+o,m=c.concat(s);p>-1&&p{const i=t9(r.identifier);i&&!e9.call(e,i)&&(e[i]=r)}),n;function n(r){const i=t9(r);return i&&e9.call(e,i)?e[i]:null}}function t9(t){return String(t||"").toUpperCase()}const oE={}.hasOwnProperty;function K9e(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={...B9e,...n.handlers},a.definition=Y9e(t),a.footnoteById=i,a.footnoteOrder=[],a.footnoteCounts={},a.patch=Z9e,a.applyData=J9e,a.one=s,a.all=l,a.wrap=t7e,a.augment=o,pz(t,"footnoteDefinition",c=>{const u=String(c.identifier).toUpperCase();oE.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};Q9e(f)||(u.position={start:dz(f),end:hz(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 bce(a,c,u)}function l(c){return mz(a,c)}}function Z9e(t,e){t.position&&(e.position=I9e(t))}function J9e(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 bce(t,e,n){const r=e&&e.type;if(!r)throw new Error("Expected node, got `"+e+"`");return oE.call(t.handlers,r)?t.handlers[r](t,e,n):t.passThrough&&t.passThrough.includes(r)?"children"in e?{...e,children:mz(t,e)}:e:t.unknownHandler?t.unknownHandler(t,e,n):e7e(t,e)}function mz(t,e){const n=[];if("children"in e){const r=e.children;let i=-1;for(;++i0&&n.push({type:"text",value:` -`}),n}function i7e(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 n7e(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 wce(t,e){const n=J9e(t,e),r=n.one(t,null),i=i7e(n);return i&&r.children.push({type:"text",value:` -`},i),Array.isArray(r)?{type:"root",children:r}:r}const o7e=function(t,e){return t&&"run"in t?a7e(t,e):s7e(t||e)};function a7e(t,e){return(n,r,i)=>{t.run(wce(n,e),r,o=>{i(o)})}}function s7e(t){return e=>wce(e,t)}class sw{constructor(e,n,r){this.property=e,this.normal=n,r&&(this.space=r)}}sw.prototype.property={};sw.prototype.normal={};sw.prototype.space=null;function Sce(t,e){const n={},r={};let i=-1;for(;++i4&&n.slice(0,4)==="data"&&d7e.test(e)){if(e.charAt(4)==="-"){const o=e.slice(5).replace(o9,g7e);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=e.slice(4);if(!o9.test(o)){let a=o.replace(h7e,m7e);a.charAt(0)!=="-"&&(a="-"+a),e="data"+a}}i=vz}return new i(r,e)}function m7e(t){return"-"+t.toLowerCase()}function g7e(t){return t.charAt(1).toUpperCase()}const a9={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"},v7e=Sce([Tce,Cce,Mce,kce,u7e],"html"),y7e=Sce([Tce,Cce,Mce,kce,f7e],"svg");function x7e(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=>{mz(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})}}var Ace={exports:{}},An={};/** +`}]}}function _ce(t,e){const n=K9e(t,e),r=n.one(t,null),i=n7e(n);return i&&r.children.push({type:"text",value:` +`},i),Array.isArray(r)?{type:"root",children:r}:r}const r7e=function(t,e){return t&&"run"in t?i7e(t,e):o7e(t||e)};function i7e(t,e){return(n,r,i)=>{t.run(_ce(n,e),r,o=>{i(o)})}}function o7e(t){return e=>_ce(e,t)}class sw{constructor(e,n,r){this.property=e,this.normal=n,r&&(this.space=r)}}sw.prototype.property={};sw.prototype.normal={};sw.prototype.space=null;function wce(t,e){const n={},r={};let i=-1;for(;++i4&&n.slice(0,4)==="data"&&u7e.test(e)){if(e.charAt(4)==="-"){const o=e.slice(5).replace(r9,p7e);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=e.slice(4);if(!r9.test(o)){let a=o.replace(f7e,h7e);a.charAt(0)!=="-"&&(a="-"+a),e="data"+a}}i=gz}return new i(r,e)}function h7e(t){return"-"+t.toLowerCase()}function p7e(t){return t.charAt(1).toUpperCase()}const i9={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"},m7e=wce([Cce,Oce,Pce,Mce,l7e],"html"),g7e=wce([Cce,Oce,Pce,Mce,c7e],"svg");function v7e(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=>{pz(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})}}var kce={exports:{}},An={};/** * @license React * react-is.production.min.js * @@ -246,80 +246,80 @@ https://github.com/nodeca/pako/blob/main/LICENSE * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var yz=Symbol.for("react.element"),xz=Symbol.for("react.portal"),L2=Symbol.for("react.fragment"),N2=Symbol.for("react.strict_mode"),$2=Symbol.for("react.profiler"),F2=Symbol.for("react.provider"),j2=Symbol.for("react.context"),b7e=Symbol.for("react.server_context"),B2=Symbol.for("react.forward_ref"),z2=Symbol.for("react.suspense"),U2=Symbol.for("react.suspense_list"),W2=Symbol.for("react.memo"),V2=Symbol.for("react.lazy"),_7e=Symbol.for("react.offscreen"),Rce;Rce=Symbol.for("react.module.reference");function Ss(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case yz:switch(t=t.type,t){case L2:case $2:case N2:case z2:case U2:return t;default:switch(t=t&&t.$$typeof,t){case b7e:case j2:case B2:case V2:case W2:case F2:return t;default:return e}}case xz:return e}}}An.ContextConsumer=j2;An.ContextProvider=F2;An.Element=yz;An.ForwardRef=B2;An.Fragment=L2;An.Lazy=V2;An.Memo=W2;An.Portal=xz;An.Profiler=$2;An.StrictMode=N2;An.Suspense=z2;An.SuspenseList=U2;An.isAsyncMode=function(){return!1};An.isConcurrentMode=function(){return!1};An.isContextConsumer=function(t){return Ss(t)===j2};An.isContextProvider=function(t){return Ss(t)===F2};An.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===yz};An.isForwardRef=function(t){return Ss(t)===B2};An.isFragment=function(t){return Ss(t)===L2};An.isLazy=function(t){return Ss(t)===V2};An.isMemo=function(t){return Ss(t)===W2};An.isPortal=function(t){return Ss(t)===xz};An.isProfiler=function(t){return Ss(t)===$2};An.isStrictMode=function(t){return Ss(t)===N2};An.isSuspense=function(t){return Ss(t)===z2};An.isSuspenseList=function(t){return Ss(t)===U2};An.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===L2||t===$2||t===N2||t===z2||t===U2||t===_7e||typeof t=="object"&&t!==null&&(t.$$typeof===V2||t.$$typeof===W2||t.$$typeof===F2||t.$$typeof===j2||t.$$typeof===B2||t.$$typeof===Rce||t.getModuleId!==void 0)};An.typeOf=Ss;Ace.exports=An;var w7e=Ace.exports;const S7e=$t(w7e);function O7e(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 C7e(t){return t.join(" ").trim()}function T7e(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}var bz={exports:{}},s9=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,E7e=/\n/g,P7e=/^\s*/,M7e=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,k7e=/^:\s*/,A7e=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,R7e=/^[;\s]*/,I7e=/^\s+|\s+$/g,D7e=` -`,l9="/",c9="*",lh="",L7e="comment",N7e="declaration",$7e=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(E7e);m&&(n+=m.length);var g=p.lastIndexOf(D7e);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(P7e)}function u(p){var m;for(p=p||[];m=f();)m!==!1&&p.push(m);return p}function f(){var p=o();if(!(l9!=t.charAt(0)||c9!=t.charAt(1))){for(var m=2;lh!=t.charAt(m)&&(c9!=t.charAt(m)||l9!=t.charAt(m+1));)++m;if(m+=2,lh===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:L7e,comment:g})}}function d(){var p=o(),m=l(M7e);if(m){if(f(),!l(k7e))return s("property missing ':'");var g=l(A7e),v=p({type:N7e,property:u9(m[0].replace(s9,lh)),value:g?u9(g[0].replace(s9,lh)):lh});return l(R7e),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 u9(t){return t?t.replace(I7e,lh):lh}var F7e=$7e;function Ice(t,e){var n=null;if(!t||typeof t!="string")return n;for(var r,i=F7e(t),o=typeof e=="function",a,s,l=0,c=i.length;l0?ue.createElement(h,l,f):ue.createElement(h,l)}function W7e(t){let e=-1;for(;++e for more info)`),delete $S[o]}const e=aGe().use(m9e).use(t.remarkPlugins||[]).use(o7e,{...t.remarkRehypeOptions,allowDangerousHtml:!0}).use(t.rehypePlugins||[]).use(x7e,t),n=new Jle;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,{},Dce({options:t,schema:v7e,listDepth:0},r));return t.className&&(i=ue.createElement("div",{className:t.className},i)),i}G2.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 _z={},Q7e=ft;Object.defineProperty(_z,"__esModule",{value:!0});var $p=_z.default=void 0,Y7e=Q7e(pt()),K7e=w;$p=_z.default=(0,Y7e.default)((0,K7e.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 Lce(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 gR={dialog:t=>({backgroundColor:t.palette.grey[200]}),appBar:{position:"relative"},title:t=>({marginLeft:t.spacing(2),flex:1})},Z7e=Li("div")(({theme:t})=>({marginTop:t.spacing(4),marginLeft:t.spacing(40),marginRight:t.spacing(40)})),J7e=ue.forwardRef(function(e,n){return w.jsx(V2e,{direction:"up",ref:n,...e})}),eqe=({title:t,href:e,open:n,onClose:r})=>{const i=Lce(e);return w.jsxs(rl,{fullScreen:!0,open:n,onClose:r,TransitionComponent:J7e,PaperProps:{tabIndex:-1},children:[w.jsx(_re,{sx:gR.appBar,children:w.jsxs(n2,{children:[w.jsx(Ot,{edge:"start",color:"inherit",onClick:r,"aria-label":"close",size:"large",children:w.jsx($p,{})}),w.jsx(At,{variant:"h6",sx:gR.title,children:t})]})}),w.jsx(Ys,{sx:gR.dialog,children:w.jsx(Z7e,{children:w.jsx(G2,{children:i||"",linkTarget:"_blank"})})})]})};var wz={},tqe=ft;Object.defineProperty(wz,"__esModule",{value:!0});var z3=wz.default=void 0,nqe=tqe(pt()),rqe=w;z3=wz.default=(0,nqe.default)((0,rqe.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 iqe=({userInfo:t})=>w.jsxs(MC,{container:!0,justifyContent:"center",spacing:1,children:[w.jsx(MC,{item:!0,children:w.jsx("img",{src:t.picture,width:84,alt:fe.get("User Profile")})}),w.jsx(MC,{item:!0,children:w.jsx(Ho,{elevation:3,children:w.jsxs(e2,{children:[w.jsx(Wx,{children:w.jsx(ts,{primary:t.name,secondary:fe.get("User name")})}),w.jsx(ep,{light:!0}),w.jsx(Wx,{children:w.jsx(ts,{primary:`${t.email} (${t.email_verified?fe.get("verified"):fe.get("not verified")})`,secondary:fe.get("E-mail")})}),w.jsx(ep,{light:!0}),w.jsx(Wx,{children:w.jsx(ts,{primary:t.nickname,secondary:fe.get("Nickname")})})]})})})]}),E0={imageAvatar:{width:32,height:32,color:"#fff",backgroundColor:Dh[300]},letterAvatar:{width:32,height:32,color:"#fff",backgroundColor:Dh[300]},signInProgress:{color:Dh[300],position:"absolute",top:"50%",left:"50%",zIndex:1,marginTop:-12,marginLeft:-12},iconButton:{padding:0}},oqe=Li("div")(({theme:t})=>({margin:t.spacing(1),position:"relative"})),aqe=({updateAccessToken:t})=>{const e=i3e(),[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(z3,{});if(!d)h=w.jsx(EA,{sx:E0.letterAvatar,children:"?"});else if(d.picture)h=w.jsx(EA,{sx:E0.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(EA,{sx:E0.letterAvatar,children:p})}return w.jsxs(M.Fragment,{children:[w.jsx(Ot,{onClick:l,"aria-controls":"user-menu","aria-haspopup":"true",size:"small",sx:E0.iconButton,children:h}),w.jsxs(Pp,{id:"user-menu",anchorEl:n,keepMounted:!0,open:!!n,onClose:c,children:[w.jsx(jr,{onClick:a,children:fe.get("Profile")}),w.jsx(jr,{onClick:f,children:fe.get("Log out")})]}),w.jsxs(rl,{open:i,keepMounted:!0,onClose:s,"aria-labelledby":"alert-dialog-slide-title","aria-describedby":"alert-dialog-slide-description",children:[w.jsx(vd,{id:"alert-dialog-slide-title",children:fe.get("User Profile")}),w.jsx(Ys,{children:w.jsx(iqe,{userInfo:e.user.profile})}),w.jsx(Tp,{children:w.jsx(tr,{onClick:s,children:"OK"})})]})]})}else{let d=w.jsx(Ot,{onClick:e.isLoading?void 0:u,size:"small",children:w.jsx(z3,{})});return e.isLoading&&(d=w.jsxs(oqe,{children:[d,w.jsx(ey,{size:24,sx:E0.signInProgress})]})),d}},sqe=t=>Kt.instance.authClient?w.jsx(aqe,{...t}):null,lqe=sqe,Nce="UPDATE_ACCESS_TOKEN";function cqe(t){return(e,n)=>{const r=n().userAuthState.accessToken;r!==t&&(e(uqe(t)),(t===null||r===null)&&e(Use()))}}function uqe(t){return{type:Nce,accessToken:t}}const fqe=t=>({}),dqe={updateAccessToken:cqe},hqe=Jt(fqe,dqe)(lqe),pqe=t=>({locale:t.controlState.locale,appName:Kt.instance.branding.appBarTitle,allowRefresh:Kt.instance.branding.allowRefresh}),mqe={openDialog:Lp,updateResources:zse},gqe={appBar:t=>({zIndex:t.zIndex.drawer+1,transition:t.transitions.create(["width","margin"],{easing:t.transitions.easing.sharp,duration:t.transitions.duration.leavingScreen})})},vqe=we("a")(()=>({display:"flex",alignItems:"center"})),yqe=we("img")(({theme:t})=>({marginLeft:t.spacing(1)})),zd={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:Dh[300]},letterAvatar:{width:24,height:24,color:"#fff",backgroundColor:Dh[300]},signInWrapper:t=>({margin:t.spacing(1),position:"relative"}),signInProgress:{color:Dh[300],position:"absolute",top:"50%",left:"50%",zIndex:1,marginTop:"-12px",marginLeft:"-12px"},iconButton:t=>({marginLeft:t.spacing(2),...Kt.instance.branding.headerIconStyle})},xqe=({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(_re,{position:"absolute",sx:gqe.appBar,elevation:0,children:[w.jsxs(n2,{disableGutters:!0,sx:zd.toolbar,variant:"dense",children:[w.jsx(vqe,{href:Kt.instance.branding.organisationUrl||"",target:"_blank",rel:"noreferrer",children:w.jsx(yqe,{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:zd.title,children:t}),w.jsx(hqe,{}),n&&w.jsx(_t,{arrow:!0,title:fe.get("Refresh"),children:w.jsx(Ot,{onClick:r,size:"small",sx:zd.iconButton,children:w.jsx(W5,{})})}),Kt.instance.branding.allowDownloads&&w.jsx(_t,{arrow:!0,title:fe.get("Export data"),children:w.jsx(Ot,{onClick:()=>e("export"),size:"small",sx:zd.iconButton,children:w.jsx(H5,{})})}),w.jsx(_t,{arrow:!0,title:fe.get("Help"),children:w.jsx(Ot,{onClick:s,size:"small",sx:zd.iconButton,children:w.jsx(j5,{})})}),w.jsx(_t,{arrow:!0,title:fe.get("Imprint"),children:w.jsx(Ot,{onClick:l,size:"small",sx:zd.iconButton,children:w.jsx(Cie,{})})}),w.jsx(_t,{arrow:!0,title:fe.get("Settings"),children:w.jsx(Ot,{onClick:a,size:"small",sx:zd.iconButton,children:w.jsx(z5,{})})})]}),w.jsx(eqe,{title:fe.get("Imprint"),href:"docs/imprint.md",open:i,onClose:c})]})},bqe=Jt(pqe,mqe)(xqe),_qe=Li("form")(({theme:t})=>({display:"flex",flexWrap:"wrap",paddingTop:t.spacing(1),paddingLeft:t.spacing(1),paddingRight:t.spacing(1),flexGrow:0}));function wqe({children:t}){return w.jsx(_qe,{autoComplete:"off",children:t})}var Sz={},Sqe=ft;Object.defineProperty(Sz,"__esModule",{value:!0});var Oz=Sz.default=void 0,Oqe=Sqe(pt()),Cqe=w;Oz=Sz.default=(0,Oqe.default)((0,Cqe.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 Ya=({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})},Tqe=Li(ty)(({theme:t})=>({marginRight:t.spacing(1)}));function Kb({label:t,control:e,actions:n}){return w.jsx(Tqe,{variant:"standard",children:w.jsxs(Ke,{children:[t,e,n]})})}function Eqe({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(ny,{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(ep,{children:w.jsx(At,{fontSize:"small",color:"text.secondary",children:h})},h)),c=h}l.push(w.jsx(jr,{value:d.id,selected:d.id===t,children:d.title},d.id))});const u=w.jsx(xd,{variant:"standard",value:t,onChange:a,input:w.jsx(yd,{name:"dataset",id:"dataset-select"}),displayEmpty:!0,name:"dataset",children:l}),f=w.jsx(Ya,{onClick:r,tooltipText:fe.get("Locate dataset in map"),icon:w.jsx(Oz,{})});return w.jsx(Kb,{label:s,control:u,actions:f})}const Pqe=t=>({locale:t.controlState.locale,selectedDatasetId:t.controlState.selectedDatasetId,datasets:t.dataState.datasets}),Mqe={selectDataset:cle,locateSelectedDataset:_8e},kqe=Jt(Pqe,Mqe)(Eqe);var Cz={},Aqe=ft;Object.defineProperty(Cz,"__esModule",{value:!0});var aE=Cz.default=void 0,Rqe=Aqe(pt()),Iqe=w;aE=Cz.default=(0,Rqe.default)((0,Iqe.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 Tz={},Dqe=ft;Object.defineProperty(Tz,"__esModule",{value:!0});var Ez=Tz.default=void 0,Lqe=Dqe(pt()),Nqe=w;Ez=Tz.default=(0,Lqe.default)((0,Nqe.jsx)("path",{d:"M18 4H6v2l6.5 6L6 18v2h12v-3h-7l5-5-5-5h7z"}),"Functions");var Pz={},$qe=ft;Object.defineProperty(Pz,"__esModule",{value:!0});var sE=Pz.default=void 0,Fqe=$qe(pt()),jqe=w;sE=Pz.default=(0,Fqe.default)((0,jqe.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 Mz={},Bqe=ft;Object.defineProperty(Mz,"__esModule",{value:!0});var $ce=Mz.default=void 0,zqe=Bqe(pt()),Uqe=w;$ce=Mz.default=(0,zqe.default)((0,Uqe.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 ko={toggleButton:{padding:.3}},lE="userVariablesDialog";function Wqe(){return{id:Js("user"),name:"",title:"",units:"",expression:"",colorBarName:"bone",colorBarMin:0,colorBarMax:1,shape:[],dims:[],dtype:"float64",timeChunkSize:null,attrs:{}}}function Vqe(t){return{...t,id:Js("user"),name:`${t.name}_copy`,title:t.title?`${t.title} Copy`:""}}const Gqe={variables:!0,constants:!1,arrayOperators:!1,otherOperators:!1,arrayFunctions:!1,otherFunctions:!1},Fce=["variables","constants","arrayOperators","otherOperators","arrayFunctions","otherFunctions"],Hqe={variables:"Variables",constants:"Constants",arrayOperators:"Array operators",otherOperators:"Other operators",arrayFunctions:"Array functions",otherFunctions:"Other functions"};function qqe({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(lE)},m=()=>{s()},g=()=>{c()},v=t===n&&e===r,y=w.jsx(ny,{shrink:!0,htmlFor:"variable-select",children:fe.get("Variable")}),x=w.jsx(xd,{variant:"standard",value:e||"",onChange:h,input:w.jsx(yd,{name:"variable",id:"variable-select"}),displayEmpty:!0,name:"variable",renderValue:()=>d9(i.find(C=>C.name===e)),children:(i||[]).map(C=>w.jsxs(jr,{value:C.name,selected:C.name===e,children:[V1(C)&&w.jsx(Kre,{children:w.jsx(aE,{fontSize:"small"})}),w.jsx(ts,{children:d9(C)}),t===n&&C.name===r&&w.jsx(sE,{fontSize:"small",color:"secondary"})]},C.name))}),b=o&&w.jsx(Ya,{onClick:p,tooltipText:fe.get("Create and manage user variables"),icon:w.jsx(aE,{})},"userVariables"),_=w.jsx(Ya,{disabled:!a,onClick:m,tooltipText:fe.get("Show time-series diagram"),icon:w.jsx($ce,{})},"timeSeries"),S=w.jsx(Ya,{disabled:!l,onClick:g,tooltipText:fe.get("Add statistics"),icon:w.jsx(Ez,{})},"statistics"),O=w.jsx(Pn,{selected:v,value:"comparison",size:"small",sx:{...ko.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(sE,{fontSize:"small"})})},"variable2");return w.jsx(Kb,{label:y,control:x,actions:[O,b,_,S]})}function d9(t){return t?t.title||t.name:"?"}const Xqe=t=>({locale:t.controlState.locale,selectedDatasetId:t.controlState.selectedDatasetId,selectedVariableName:t.controlState.selectedVariableName,selectedDataset2Id:t.controlState.selectedDataset2Id,selectedVariable2Name:t.controlState.selectedVariable2Name,userVariablesAllowed:MWe(),canAddTimeSeries:bse(t),canAddStatistics:_se(t),variables:FWe(t)}),Qqe={openDialog:Lp,selectVariable:xle,selectVariable2:R8e,addTimeSeries:P2,addStatistics:Xse},Yqe=Jt(Xqe,Qqe)(qqe);var kz={},Kqe=ft;Object.defineProperty(kz,"__esModule",{value:!0});var Fp=kz.default=void 0,Zqe=Kqe(pt()),Jqe=w;Fp=kz.default=(0,Zqe.default)((0,Jqe.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 Az={},eXe=ft;Object.defineProperty(Az,"__esModule",{value:!0});var lw=Az.default=void 0,tXe=eXe(pt()),nXe=w;lw=Az.default=(0,tXe.default)((0,nXe.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 jce=({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(ny,{shrink:!0,htmlFor:"place-select",children:o});if(!r)return w.jsx(Kb,{label:f,control:a,actions:s});const d=n?n(c):!0,h=w.jsx(yd,{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(Kb,{label:f,control:h})},rXe={select:{minWidth:"5em"}};function iXe({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(xd,{variant:"standard",multiple:!0,displayEmpty:!0,onChange:u,input:w.jsx(yd,{name:"place-groups",id:"place-groups-select"}),value:i,renderValue:f,name:"place-groups",sx:rXe.select,children:t.map(m=>w.jsxs(jr,{value:m.id,children:[w.jsx(UL,{checked:i.indexOf(m.id)>-1}),w.jsx(ts,{primary:m.title})]},m.id))});let h=!1;l!==null&&l.startsWith(cy)&&(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(Ya,{onClick:m,tooltipText:fe.get("Rename place group"),icon:w.jsx(Fp,{})},"editPlaceGroup"),w.jsx(Ya,{onClick:g,tooltipText:fe.get("Remove places"),icon:w.jsx(lw,{})},"removePlaceGroup")]}return w.jsx(jce,{itemValue:o,setItemValue:c,validateItemValue:m=>m.trim().length>0,editMode:a,setEditMode:s,labelText:fe.get("Places"),select:d,actions:p})}const oXe=t=>({locale:t.controlState.locale,selectedPlaceGroupIds:t.controlState.selectedPlaceGroupIds,placeGroups:E2(t),selectedPlaceGroupsTitle:YWe(t)}),aXe={selectPlaceGroups:C8e,renameUserPlaceGroup:QVe,removeUserPlaceGroup:t8e},sXe=Jt(oXe,aXe)(iXe);var Rz={},lXe=ft;Object.defineProperty(Rz,"__esModule",{value:!0});var Bce=Rz.default=void 0,cXe=lXe(pt()),uXe=w;Bce=Rz.default=(0,cXe.default)((0,uXe.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 Ud={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"}},fXe=({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(Ep,{open:t!==null,anchorEl:t,onClose:()=>e(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:w.jsxs(Ke,{sx:Ud.container,children:[w.jsx(At,{sx:Ud.colorLabel,children:fe.get("Color")}),w.jsx(At,{sx:Ud.opacityLabel,color:n?"text.secondary":"text.primary",children:fe.get("Opacity")}),w.jsx(Ke,{sx:Ud.colorValue,style:{backgroundColor:r.color},onClick:s}),w.jsx(ry,{sx:Ud.opacityValue,disabled:n,size:"small",min:0,max:1,step:.05,value:r.opacity,onChange:(l,c)=>i({...r,opacity:c})})]})}),w.jsx(Pp,{open:!!o,anchorEl:o,onClose:()=>a(null),children:R5.map(([l,c])=>w.jsx(jr,{selected:r.color===l,sx:Ud.colorMenuItem,onClick:()=>i({...r,color:l}),children:w.jsx(_t,{title:l,children:w.jsx(Ke,{sx:{...Ud.colorMenuItemBox,backgroundColor:l}})})},l))})]})},dXe={select:{minWidth:"5em"}};function hXe({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(xd,{variant:"standard",value:n,onChange:x,input:w.jsx(yd,{name:"place",id:"place-select"}),displayEmpty:!0,name:"place",sx:dXe.select,disabled:l.length===0,children:l.map((O,C)=>w.jsx(jr,{value:O.id,selected:O.id===n,children:e[C]},O.id))}),_=p!==null&&p.startsWith(cy)&&n!=="";let S=[w.jsx(Ya,{onClick:c,tooltipText:fe.get("Locate place in map"),icon:w.jsx(Oz,{})},"locatePlace")];if(!u&&_){const O=()=>{f(!0)},C=k=>{h(k.currentTarget)},E=()=>{s(p,n,l)};S=[w.jsx(Ya,{onClick:O,tooltipText:fe.get("Rename place"),icon:w.jsx(Fp,{})},"editButton"),w.jsx(Ya,{onClick:C,tooltipText:fe.get("Style place"),icon:w.jsx(Bce,{})},"styleButton"),w.jsx(Ya,{onClick:E,tooltipText:fe.get("Remove place"),icon:w.jsx(lw,{})},"removeButton")].concat(S)}return w.jsxs(w.Fragment,{children:[w.jsx(jce,{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(fXe,{anchorEl:d,setAnchorEl:h,isPoint:i.place.geometry.type==="Point",placeStyle:i,updatePlaceStyle:y})]})}const pXe=t=>({locale:t.controlState.locale,datasets:t.dataState.datasets,selectedPlaceGroupIds:t.controlState.selectedPlaceGroupIds,selectedPlaceId:t.controlState.selectedPlaceId,selectedPlaceInfo:iw(t),places:rw(t),placeLabels:eVe(t)}),mXe={selectPlace:M2,renameUserPlace:YVe,restyleUserPlace:ZVe,removeUserPlace:e8e,locateSelectedPlace:w8e,openDialog:Lp},gXe=Jt(pXe,mXe)(hXe);var Iz={},vXe=ft;Object.defineProperty(Iz,"__esModule",{value:!0});var zce=Iz.default=void 0,yXe=vXe(pt()),xXe=w;zce=Iz.default=(0,yXe.default)((0,xXe.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 Dz={},bXe=ft;Object.defineProperty(Dz,"__esModule",{value:!0});var Uce=Dz.default=void 0,_Xe=bXe(pt()),wXe=w;Uce=Dz.default=(0,_Xe.default)((0,wXe.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 Lz={},SXe=ft;Object.defineProperty(Lz,"__esModule",{value:!0});var Wce=Lz.default=void 0,OXe=SXe(pt()),vR=w;Wce=Lz.default=(0,OXe.default)([(0,vR.jsx)("path",{d:"m12 2-5.5 9h11z"},"0"),(0,vR.jsx)("circle",{cx:"17.5",cy:"17.5",r:"4.5"},"1"),(0,vR.jsx)("path",{d:"M3 13.5h8v8H3z"},"2")],"Category");var Nz={},CXe=ft;Object.defineProperty(Nz,"__esModule",{value:!0});var Vce=Nz.default=void 0,TXe=CXe(pt()),EXe=w;Vce=Nz.default=(0,TXe.default)((0,EXe.jsx)("circle",{cx:"12",cy:"12",r:"8"}),"FiberManualRecord");var $z={},PXe=ft;Object.defineProperty($z,"__esModule",{value:!0});var Gce=$z.default=void 0,MXe=PXe(pt()),kXe=w;Gce=$z.default=(0,MXe.default)((0,kXe.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 AXe=Li(ty)(({theme:t})=>({marginTop:t.spacing(2),marginLeft:t.spacing(1),marginRight:t.spacing(2)}));function RXe({mapInteraction:t,setMapInteraction:e}){function n(r,i){e(i!==null?i:"Select")}return w.jsx(AXe,{variant:"standard",children:w.jsxs(iy,{size:"small",value:t,exclusive:!0,onChange:n,children:[w.jsx(Pn,{value:"Select",size:"small",sx:ko.toggleButton,children:w.jsx(_t,{arrow:!0,title:fe.get("Select a place in map"),children:w.jsx(Uce,{})})},0),w.jsx(Pn,{value:"Point",size:"small",sx:ko.toggleButton,children:w.jsx(_t,{arrow:!0,title:fe.get("Add a point location in map"),children:w.jsx(zce,{})})},1),w.jsx(Pn,{value:"Polygon",size:"small",sx:ko.toggleButton,children:w.jsx(_t,{arrow:!0,title:fe.get("Draw a polygon area in map"),children:w.jsx(Wce,{})})},2),w.jsx(Pn,{value:"Circle",size:"small",sx:ko.toggleButton,children:w.jsx(_t,{arrow:!0,title:fe.get("Draw a circular area in map"),children:w.jsx(Vce,{})})},3),w.jsx(Pn,{value:"Geometry",size:"small",sx:ko.toggleButton,children:w.jsx(_t,{arrow:!0,title:fe.get("Import places"),children:w.jsx(Gce,{})})},4)]})})}const IXe=t=>({mapInteraction:t.controlState.mapInteraction}),DXe={setMapInteraction:Tle},LXe=Jt(IXe,DXe)(RXe);var h9=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},cw=(typeof window>"u"?"undefined":h9(window))==="object"&&(typeof document>"u"?"undefined":h9(document))==="object"&&document.nodeType===9,NXe={}.constructor;function U3(t){if(t==null||typeof t!="object")return t;if(Array.isArray(t))return t.map(U3);if(t.constructor!==NXe)return t;var e={};for(var n in t)e[n]=U3(t[n]);return e}function Fz(t,e,n){t===void 0&&(t="unnamed");var r=n.jss,i=U3(e),o=r.plugins.onCreateRule(t,i,n);return o||(t[0],null)}var p9=function(e,n){for(var r="",i=0;i<+~=|^:(),"'`\s])/g,m9=typeof CSS<"u"&&CSS.escape,jz=function(t){return m9?m9(t):t.replace($Xe,"\\$1")},Hce=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}(),W3=function(t){D1(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="."+jz(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]=Uh(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 Zb(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}(Hce),FXe={onCreateRule:function(e,n,r){return e[0]==="@"||r.parent&&r.parent.type==="keyframes"?null:new W3(e,n,r)}},yR={indent:1,children:!0},jXe=/@([\w-]+)/,BXe=function(){function t(n,r,i){this.type="conditional",this.isProcessed=!1,this.key=n;var o=n.match(jXe);this.at=o?o[1]:"unknown",this.query=i.name||"@"+this.at,this.options=i,this.rules=new H2(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=yR);var i=Ey(r),o=i.linebreak;if(r.indent==null&&(r.indent=yR.indent),r.children==null&&(r.children=yR.children),r.children===!1)return this.query+" {}";var a=this.rules.toString(r);return a?this.query+" {"+o+a+o+"}":""},t}(),zXe=/@container|@media|@supports\s+/,UXe={onCreateRule:function(e,n,r){return zXe.test(e)?new BXe(e,n,r):null}},xR={indent:1,children:!0},WXe=/@keyframes\s+([\w-]+)/,V3=function(){function t(n,r,i){this.type="keyframes",this.at="@keyframes",this.isProcessed=!1;var o=n.match(WXe);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:jz(l(this,s)),this.rules=new H2(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=xR);var i=Ey(r),o=i.linebreak;if(r.indent==null&&(r.indent=xR.indent),r.children==null&&(r.children=xR.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}(),VXe=/@keyframes\s+/,GXe=/\$([\w-]+)/g,G3=function(e,n){return typeof e=="string"?e.replace(GXe,function(r,i){return i in n?n[i]:r}):e},g9=function(e,n,r){var i=e[n],o=G3(i,r);o!==i&&(e[n]=o)},HXe={onCreateRule:function(e,n,r){return typeof e=="string"&&VXe.test(e)?new V3(e,n,r):null},onProcessStyle:function(e,n,r){return n.type!=="style"||!r||("animation-name"in e&&g9(e,"animation-name",r.keyframes),"animation"in e&&g9(e,"animation",r.keyframes)),e},onChangeValue:function(e,n,r){var i=r.options.sheet;if(!i)return e;switch(n){case"animation":return G3(e,i.keyframes);case"animation-name":return G3(e,i.keyframes);default:return e}}},qXe=function(t){D1(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 Zb(this.key,this.style,s)},e}(Hce),XXe={onCreateRule:function(e,n,r){return r.parent&&r.parent.type==="keyframes"?new qXe(e,n,r):null}},QXe=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=Ey(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=Ey(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},lQe=function(e,n){try{e.attributeStyleMap?e.attributeStyleMap.delete(n):e.style.removeProperty(n)}catch{}},cQe=function(e,n){return e.selectorText=n,e.selectorText===n},Qce=Xce(function(){return document.querySelector("head")});function uQe(t,e){for(var n=0;ne.index&&r.options.insertionPoint===e.insertionPoint)return r}return null}function fQe(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 dQe(t){for(var e=Qce(),n=0;n0){var n=uQe(e,t);if(n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element};if(n=fQe(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=dQe(r);if(i)return{parent:i.parentNode,node:i.nextSibling}}return!1}function pQe(t,e){var n=e.insertionPoint,r=hQe(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}Qce().appendChild(t)}var mQe=Xce(function(){var t=document.querySelector('meta[property="csp-nonce"]');return t?t.getAttribute("content"):null}),_9=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]},w9=function(e,n){var r=e.cssRules.length;return n===void 0||n>r?r:n},gQe=function(){var e=document.createElement("style");return e.textContent=` -`,e},vQe=function(){function t(n){this.getPropertyValue=aQe,this.setProperty=sQe,this.removeProperty=lQe,this.setSelector=cQe,this.hasInsertedRules=!1,this.cssRules=[],n&&Kx.add(n),this.sheet=n;var r=this.sheet?this.sheet.options:{},i=r.media,o=r.meta,a=r.element;this.element=a||gQe(),this.element.setAttribute("data-jss",""),i&&this.element.setAttribute("media",i),o&&this.element.setAttribute("data-meta",o);var s=mQe();s&&this.element.setAttribute("nonce",s)}var e=t.prototype;return e.attach=function(){if(!(this.element.parentNode||!this.sheet)){pQe(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=` + */var vz=Symbol.for("react.element"),yz=Symbol.for("react.portal"),L2=Symbol.for("react.fragment"),N2=Symbol.for("react.strict_mode"),$2=Symbol.for("react.profiler"),F2=Symbol.for("react.provider"),j2=Symbol.for("react.context"),y7e=Symbol.for("react.server_context"),B2=Symbol.for("react.forward_ref"),z2=Symbol.for("react.suspense"),U2=Symbol.for("react.suspense_list"),W2=Symbol.for("react.memo"),V2=Symbol.for("react.lazy"),x7e=Symbol.for("react.offscreen"),Ace;Ace=Symbol.for("react.module.reference");function Ss(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case vz:switch(t=t.type,t){case L2:case $2:case N2:case z2:case U2:return t;default:switch(t=t&&t.$$typeof,t){case y7e:case j2:case B2:case V2:case W2:case F2:return t;default:return e}}case yz:return e}}}An.ContextConsumer=j2;An.ContextProvider=F2;An.Element=vz;An.ForwardRef=B2;An.Fragment=L2;An.Lazy=V2;An.Memo=W2;An.Portal=yz;An.Profiler=$2;An.StrictMode=N2;An.Suspense=z2;An.SuspenseList=U2;An.isAsyncMode=function(){return!1};An.isConcurrentMode=function(){return!1};An.isContextConsumer=function(t){return Ss(t)===j2};An.isContextProvider=function(t){return Ss(t)===F2};An.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===vz};An.isForwardRef=function(t){return Ss(t)===B2};An.isFragment=function(t){return Ss(t)===L2};An.isLazy=function(t){return Ss(t)===V2};An.isMemo=function(t){return Ss(t)===W2};An.isPortal=function(t){return Ss(t)===yz};An.isProfiler=function(t){return Ss(t)===$2};An.isStrictMode=function(t){return Ss(t)===N2};An.isSuspense=function(t){return Ss(t)===z2};An.isSuspenseList=function(t){return Ss(t)===U2};An.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===L2||t===$2||t===N2||t===z2||t===U2||t===x7e||typeof t=="object"&&t!==null&&(t.$$typeof===V2||t.$$typeof===W2||t.$$typeof===F2||t.$$typeof===j2||t.$$typeof===B2||t.$$typeof===Ace||t.getModuleId!==void 0)};An.typeOf=Ss;kce.exports=An;var b7e=kce.exports;const _7e=$t(b7e);function w7e(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 S7e(t){return t.join(" ").trim()}function O7e(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}var xz={exports:{}},o9=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,C7e=/\n/g,T7e=/^\s*/,E7e=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,P7e=/^:\s*/,M7e=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,k7e=/^[;\s]*/,A7e=/^\s+|\s+$/g,R7e=` +`,a9="/",s9="*",lh="",I7e="comment",D7e="declaration",L7e=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(C7e);m&&(n+=m.length);var g=p.lastIndexOf(R7e);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(T7e)}function u(p){var m;for(p=p||[];m=f();)m!==!1&&p.push(m);return p}function f(){var p=o();if(!(a9!=t.charAt(0)||s9!=t.charAt(1))){for(var m=2;lh!=t.charAt(m)&&(s9!=t.charAt(m)||a9!=t.charAt(m+1));)++m;if(m+=2,lh===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:I7e,comment:g})}}function d(){var p=o(),m=l(E7e);if(m){if(f(),!l(P7e))return s("property missing ':'");var g=l(M7e),v=p({type:D7e,property:l9(m[0].replace(o9,lh)),value:g?l9(g[0].replace(o9,lh)):lh});return l(k7e),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 l9(t){return t?t.replace(A7e,lh):lh}var N7e=L7e;function Rce(t,e){var n=null;if(!t||typeof t!="string")return n;for(var r,i=N7e(t),o=typeof e=="function",a,s,l=0,c=i.length;l0?ue.createElement(h,l,f):ue.createElement(h,l)}function z7e(t){let e=-1;for(;++e for more info)`),delete $S[o]}const e=iGe().use(h9e).use(t.remarkPlugins||[]).use(r7e,{...t.remarkRehypeOptions,allowDangerousHtml:!0}).use(t.rehypePlugins||[]).use(v7e,t),n=new Zle;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,{},Ice({options:t,schema:m7e,listDepth:0},r));return t.className&&(i=ue.createElement("div",{className:t.className},i)),i}G2.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 bz={},q7e=ft;Object.defineProperty(bz,"__esModule",{value:!0});var $p=bz.default=void 0,X7e=q7e(pt()),Q7e=w;$p=bz.default=(0,X7e.default)((0,Q7e.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 Dce(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 mR={dialog:t=>({backgroundColor:t.palette.grey[200]}),appBar:{position:"relative"},title:t=>({marginLeft:t.spacing(2),flex:1})},Y7e=Li("div")(({theme:t})=>({marginTop:t.spacing(4),marginLeft:t.spacing(40),marginRight:t.spacing(40)})),K7e=ue.forwardRef(function(e,n){return w.jsx(W2e,{direction:"up",ref:n,...e})}),Z7e=({title:t,href:e,open:n,onClose:r})=>{const i=Dce(e);return w.jsxs(rl,{fullScreen:!0,open:n,onClose:r,TransitionComponent:K7e,PaperProps:{tabIndex:-1},children:[w.jsx(xre,{sx:mR.appBar,children:w.jsxs(n2,{children:[w.jsx(Ot,{edge:"start",color:"inherit",onClick:r,"aria-label":"close",size:"large",children:w.jsx($p,{})}),w.jsx(At,{variant:"h6",sx:mR.title,children:t})]})}),w.jsx(Ys,{sx:mR.dialog,children:w.jsx(Y7e,{children:w.jsx(G2,{children:i||"",linkTarget:"_blank"})})})]})};var _z={},J7e=ft;Object.defineProperty(_z,"__esModule",{value:!0});var B3=_z.default=void 0,eqe=J7e(pt()),tqe=w;B3=_z.default=(0,eqe.default)((0,tqe.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 nqe=({userInfo:t})=>w.jsxs(MC,{container:!0,justifyContent:"center",spacing:1,children:[w.jsx(MC,{item:!0,children:w.jsx("img",{src:t.picture,width:84,alt:fe.get("User Profile")})}),w.jsx(MC,{item:!0,children:w.jsx(Ho,{elevation:3,children:w.jsxs(e2,{children:[w.jsx(Ux,{children:w.jsx(ts,{primary:t.name,secondary:fe.get("User name")})}),w.jsx(ep,{light:!0}),w.jsx(Ux,{children:w.jsx(ts,{primary:`${t.email} (${t.email_verified?fe.get("verified"):fe.get("not verified")})`,secondary:fe.get("E-mail")})}),w.jsx(ep,{light:!0}),w.jsx(Ux,{children:w.jsx(ts,{primary:t.nickname,secondary:fe.get("Nickname")})})]})})})]}),T0={imageAvatar:{width:32,height:32,color:"#fff",backgroundColor:Dh[300]},letterAvatar:{width:32,height:32,color:"#fff",backgroundColor:Dh[300]},signInProgress:{color:Dh[300],position:"absolute",top:"50%",left:"50%",zIndex:1,marginTop:-12,marginLeft:-12},iconButton:{padding:0}},rqe=Li("div")(({theme:t})=>({margin:t.spacing(1),position:"relative"})),iqe=({updateAccessToken:t})=>{const e=n3e(),[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(B3,{});if(!d)h=w.jsx(EA,{sx:T0.letterAvatar,children:"?"});else if(d.picture)h=w.jsx(EA,{sx:T0.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(EA,{sx:T0.letterAvatar,children:p})}return w.jsxs(M.Fragment,{children:[w.jsx(Ot,{onClick:l,"aria-controls":"user-menu","aria-haspopup":"true",size:"small",sx:T0.iconButton,children:h}),w.jsxs(Pp,{id:"user-menu",anchorEl:n,keepMounted:!0,open:!!n,onClose:c,children:[w.jsx(jr,{onClick:a,children:fe.get("Profile")}),w.jsx(jr,{onClick:f,children:fe.get("Log out")})]}),w.jsxs(rl,{open:i,keepMounted:!0,onClose:s,"aria-labelledby":"alert-dialog-slide-title","aria-describedby":"alert-dialog-slide-description",children:[w.jsx(vd,{id:"alert-dialog-slide-title",children:fe.get("User Profile")}),w.jsx(Ys,{children:w.jsx(nqe,{userInfo:e.user.profile})}),w.jsx(Tp,{children:w.jsx(tr,{onClick:s,children:"OK"})})]})]})}else{let d=w.jsx(Ot,{onClick:e.isLoading?void 0:u,size:"small",children:w.jsx(B3,{})});return e.isLoading&&(d=w.jsxs(rqe,{children:[d,w.jsx(ey,{size:24,sx:T0.signInProgress})]})),d}},oqe=t=>Kt.instance.authClient?w.jsx(iqe,{...t}):null,aqe=oqe,Lce="UPDATE_ACCESS_TOKEN";function sqe(t){return(e,n)=>{const r=n().userAuthState.accessToken;r!==t&&(e(lqe(t)),(t===null||r===null)&&e(zse()))}}function lqe(t){return{type:Lce,accessToken:t}}const cqe=t=>({}),uqe={updateAccessToken:sqe},fqe=Jt(cqe,uqe)(aqe),dqe=t=>({locale:t.controlState.locale,appName:Kt.instance.branding.appBarTitle,allowRefresh:Kt.instance.branding.allowRefresh}),hqe={openDialog:Lp,updateResources:Bse},pqe={appBar:t=>({zIndex:t.zIndex.drawer+1,transition:t.transitions.create(["width","margin"],{easing:t.transitions.easing.sharp,duration:t.transitions.duration.leavingScreen})})},mqe=we("a")(()=>({display:"flex",alignItems:"center"})),gqe=we("img")(({theme:t})=>({marginLeft:t.spacing(1)})),zd={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:Dh[300]},letterAvatar:{width:24,height:24,color:"#fff",backgroundColor:Dh[300]},signInWrapper:t=>({margin:t.spacing(1),position:"relative"}),signInProgress:{color:Dh[300],position:"absolute",top:"50%",left:"50%",zIndex:1,marginTop:"-12px",marginLeft:"-12px"},iconButton:t=>({marginLeft:t.spacing(2),...Kt.instance.branding.headerIconStyle})},vqe=({appName:t,openDialog:e,allowRefresh:n,updateResources:r})=>{const[i,o]=M.useState(!1),a=()=>{e("settings")},s=()=>{window.open("https://xcube-dev.github.io/xcube-viewer/","Manual")},l=()=>{o(!0)},c=()=>{o(!1)};return w.jsxs(xre,{position:"absolute",sx:pqe.appBar,elevation:0,children:[w.jsxs(n2,{disableGutters:!0,sx:zd.toolbar,variant:"dense",children:[w.jsx(mqe,{href:Kt.instance.branding.organisationUrl||"",target:"_blank",rel:"noreferrer",children:w.jsx(gqe,{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:zd.title,children:t}),w.jsx(fqe,{}),n&&w.jsx(xt,{arrow:!0,title:fe.get("Refresh"),children:w.jsx(Ot,{onClick:r,size:"small",sx:zd.iconButton,children:w.jsx(U5,{})})}),Kt.instance.branding.allowDownloads&&w.jsx(xt,{arrow:!0,title:fe.get("Export data"),children:w.jsx(Ot,{onClick:()=>e("export"),size:"small",sx:zd.iconButton,children:w.jsx(G5,{})})}),w.jsx(xt,{arrow:!0,title:fe.get("Help"),children:w.jsx(Ot,{onClick:s,size:"small",sx:zd.iconButton,children:w.jsx(F5,{})})}),w.jsx(xt,{arrow:!0,title:fe.get("Imprint"),children:w.jsx(Ot,{onClick:l,size:"small",sx:zd.iconButton,children:w.jsx(Oie,{})})}),w.jsx(xt,{arrow:!0,title:fe.get("Settings"),children:w.jsx(Ot,{onClick:a,size:"small",sx:zd.iconButton,children:w.jsx(B5,{})})})]}),w.jsx(Z7e,{title:fe.get("Imprint"),href:"docs/imprint.md",open:i,onClose:c})]})},yqe=Jt(dqe,hqe)(vqe),xqe=Li("form")(({theme:t})=>({display:"flex",flexWrap:"wrap",paddingTop:t.spacing(1),paddingLeft:t.spacing(1),paddingRight:t.spacing(1),flexGrow:0}));function bqe({children:t}){return w.jsx(xqe,{autoComplete:"off",children:t})}var wz={},_qe=ft;Object.defineProperty(wz,"__esModule",{value:!0});var Sz=wz.default=void 0,wqe=_qe(pt()),Sqe=w;Sz=wz.default=(0,wqe.default)((0,Sqe.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 Ya=({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(xt,{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})},Oqe=Li(ty)(({theme:t})=>({marginRight:t.spacing(1)}));function Yb({label:t,control:e,actions:n}){return w.jsx(Oqe,{variant:"standard",children:w.jsxs(Ke,{children:[t,e,n]})})}function Cqe({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(ny,{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(ep,{children:w.jsx(At,{fontSize:"small",color:"text.secondary",children:h})},h)),c=h}l.push(w.jsx(jr,{value:d.id,selected:d.id===t,children:d.title},d.id))});const u=w.jsx(xd,{variant:"standard",value:t,onChange:a,input:w.jsx(yd,{name:"dataset",id:"dataset-select"}),displayEmpty:!0,name:"dataset",children:l}),f=w.jsx(Ya,{onClick:r,tooltipText:fe.get("Locate dataset in map"),icon:w.jsx(Sz,{})});return w.jsx(Yb,{label:s,control:u,actions:f})}const Tqe=t=>({locale:t.controlState.locale,selectedDatasetId:t.controlState.selectedDatasetId,datasets:t.dataState.datasets}),Eqe={selectDataset:lle,locateSelectedDataset:x8e},Pqe=Jt(Tqe,Eqe)(Cqe);var Oz={},Mqe=ft;Object.defineProperty(Oz,"__esModule",{value:!0});var aE=Oz.default=void 0,kqe=Mqe(pt()),Aqe=w;aE=Oz.default=(0,kqe.default)((0,Aqe.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={},Rqe=ft;Object.defineProperty(Cz,"__esModule",{value:!0});var Tz=Cz.default=void 0,Iqe=Rqe(pt()),Dqe=w;Tz=Cz.default=(0,Iqe.default)((0,Dqe.jsx)("path",{d:"M18 4H6v2l6.5 6L6 18v2h12v-3h-7l5-5-5-5h7z"}),"Functions");var Ez={},Lqe=ft;Object.defineProperty(Ez,"__esModule",{value:!0});var sE=Ez.default=void 0,Nqe=Lqe(pt()),$qe=w;sE=Ez.default=(0,Nqe.default)((0,$qe.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 Pz={},Fqe=ft;Object.defineProperty(Pz,"__esModule",{value:!0});var Nce=Pz.default=void 0,jqe=Fqe(pt()),Bqe=w;Nce=Pz.default=(0,jqe.default)((0,Bqe.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 ko={toggleButton:{padding:.3}},lE="userVariablesDialog";function zqe(){return{id:Js("user"),name:"",title:"",units:"",expression:"",colorBarName:"bone",colorBarMin:0,colorBarMax:1,shape:[],dims:[],dtype:"float64",timeChunkSize:null,attrs:{}}}function Uqe(t){return{...t,id:Js("user"),name:`${t.name}_copy`,title:t.title?`${t.title} Copy`:""}}const Wqe={variables:!0,constants:!1,arrayOperators:!1,otherOperators:!1,arrayFunctions:!1,otherFunctions:!1},$ce=["variables","constants","arrayOperators","otherOperators","arrayFunctions","otherFunctions"],Vqe={variables:"Variables",constants:"Constants",arrayOperators:"Array operators",otherOperators:"Other operators",arrayFunctions:"Array functions",otherFunctions:"Other functions"};function Gqe({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(lE)},m=()=>{s()},g=()=>{c()},v=t===n&&e===r,y=w.jsx(ny,{shrink:!0,htmlFor:"variable-select",children:fe.get("Variable")}),x=w.jsx(xd,{variant:"standard",value:e||"",onChange:h,input:w.jsx(yd,{name:"variable",id:"variable-select"}),displayEmpty:!0,name:"variable",renderValue:()=>u9(i.find(C=>C.name===e)),children:(i||[]).map(C=>w.jsxs(jr,{value:C.name,selected:C.name===e,children:[W1(C)&&w.jsx(Qre,{children:w.jsx(aE,{fontSize:"small"})}),w.jsx(ts,{children:u9(C)}),t===n&&C.name===r&&w.jsx(sE,{fontSize:"small",color:"secondary"})]},C.name))}),b=o&&w.jsx(Ya,{onClick:p,tooltipText:fe.get("Create and manage user variables"),icon:w.jsx(aE,{})},"userVariables"),_=w.jsx(Ya,{disabled:!a,onClick:m,tooltipText:fe.get("Show time-series diagram"),icon:w.jsx(Nce,{})},"timeSeries"),S=w.jsx(Ya,{disabled:!l,onClick:g,tooltipText:fe.get("Add statistics"),icon:w.jsx(Tz,{})},"statistics"),O=w.jsx(Pn,{selected:v,value:"comparison",size:"small",sx:{...ko.toggleButton,marginLeft:.4},onClick:()=>f(t,e),children:w.jsx(xt,{arrow:!0,title:fe.get("Make it 2nd variable for comparison"),children:w.jsx(sE,{fontSize:"small"})})},"variable2");return w.jsx(Yb,{label:y,control:x,actions:[O,b,_,S]})}function u9(t){return t?t.title||t.name:"?"}const Hqe=t=>({locale:t.controlState.locale,selectedDatasetId:t.controlState.selectedDatasetId,selectedVariableName:t.controlState.selectedVariableName,selectedDataset2Id:t.controlState.selectedDataset2Id,selectedVariable2Name:t.controlState.selectedVariable2Name,userVariablesAllowed:EWe(),canAddTimeSeries:xse(t),canAddStatistics:bse(t),variables:NWe(t)}),qqe={openDialog:Lp,selectVariable:yle,selectVariable2:k8e,addTimeSeries:P2,addStatistics:qse},Xqe=Jt(Hqe,qqe)(Gqe);var Mz={},Qqe=ft;Object.defineProperty(Mz,"__esModule",{value:!0});var Fp=Mz.default=void 0,Yqe=Qqe(pt()),Kqe=w;Fp=Mz.default=(0,Yqe.default)((0,Kqe.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 kz={},Zqe=ft;Object.defineProperty(kz,"__esModule",{value:!0});var lw=kz.default=void 0,Jqe=Zqe(pt()),eXe=w;lw=kz.default=(0,Jqe.default)((0,eXe.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 Fce=({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(ny,{shrink:!0,htmlFor:"place-select",children:o});if(!r)return w.jsx(Yb,{label:f,control:a,actions:s});const d=n?n(c):!0,h=w.jsx(yd,{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(Yb,{label:f,control:h})},tXe={select:{minWidth:"5em"}};function nXe({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(xd,{variant:"standard",multiple:!0,displayEmpty:!0,onChange:u,input:w.jsx(yd,{name:"place-groups",id:"place-groups-select"}),value:i,renderValue:f,name:"place-groups",sx:tXe.select,children:t.map(m=>w.jsxs(jr,{value:m.id,children:[w.jsx(zL,{checked:i.indexOf(m.id)>-1}),w.jsx(ts,{primary:m.title})]},m.id))});let h=!1;l!==null&&l.startsWith(cy)&&(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(Ya,{onClick:m,tooltipText:fe.get("Rename place group"),icon:w.jsx(Fp,{})},"editPlaceGroup"),w.jsx(Ya,{onClick:g,tooltipText:fe.get("Remove places"),icon:w.jsx(lw,{})},"removePlaceGroup")]}return w.jsx(Fce,{itemValue:o,setItemValue:c,validateItemValue:m=>m.trim().length>0,editMode:a,setEditMode:s,labelText:fe.get("Places"),select:d,actions:p})}const rXe=t=>({locale:t.controlState.locale,selectedPlaceGroupIds:t.controlState.selectedPlaceGroupIds,placeGroups:E2(t),selectedPlaceGroupsTitle:XWe(t)}),iXe={selectPlaceGroups:S8e,renameUserPlaceGroup:qVe,removeUserPlaceGroup:JVe},oXe=Jt(rXe,iXe)(nXe);var Az={},aXe=ft;Object.defineProperty(Az,"__esModule",{value:!0});var jce=Az.default=void 0,sXe=aXe(pt()),lXe=w;jce=Az.default=(0,sXe.default)((0,lXe.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 Ud={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"}},cXe=({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(Ep,{open:t!==null,anchorEl:t,onClose:()=>e(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:w.jsxs(Ke,{sx:Ud.container,children:[w.jsx(At,{sx:Ud.colorLabel,children:fe.get("Color")}),w.jsx(At,{sx:Ud.opacityLabel,color:n?"text.secondary":"text.primary",children:fe.get("Opacity")}),w.jsx(Ke,{sx:Ud.colorValue,style:{backgroundColor:r.color},onClick:s}),w.jsx(ry,{sx:Ud.opacityValue,disabled:n,size:"small",min:0,max:1,step:.05,value:r.opacity,onChange:(l,c)=>i({...r,opacity:c})})]})}),w.jsx(Pp,{open:!!o,anchorEl:o,onClose:()=>a(null),children:A5.map(([l,c])=>w.jsx(jr,{selected:r.color===l,sx:Ud.colorMenuItem,onClick:()=>i({...r,color:l}),children:w.jsx(xt,{title:l,children:w.jsx(Ke,{sx:{...Ud.colorMenuItemBox,backgroundColor:l}})})},l))})]})},uXe={select:{minWidth:"5em"}};function fXe({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(xd,{variant:"standard",value:n,onChange:x,input:w.jsx(yd,{name:"place",id:"place-select"}),displayEmpty:!0,name:"place",sx:uXe.select,disabled:l.length===0,children:l.map((O,C)=>w.jsx(jr,{value:O.id,selected:O.id===n,children:e[C]},O.id))}),_=p!==null&&p.startsWith(cy)&&n!=="";let S=[w.jsx(Ya,{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(Ya,{onClick:O,tooltipText:fe.get("Rename place"),icon:w.jsx(Fp,{})},"editButton"),w.jsx(Ya,{onClick:C,tooltipText:fe.get("Style place"),icon:w.jsx(jce,{})},"styleButton"),w.jsx(Ya,{onClick:E,tooltipText:fe.get("Remove place"),icon:w.jsx(lw,{})},"removeButton")].concat(S)}return w.jsxs(w.Fragment,{children:[w.jsx(Fce,{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(cXe,{anchorEl:d,setAnchorEl:h,isPoint:i.place.geometry.type==="Point",placeStyle:i,updatePlaceStyle:y})]})}const dXe=t=>({locale:t.controlState.locale,datasets:t.dataState.datasets,selectedPlaceGroupIds:t.controlState.selectedPlaceGroupIds,selectedPlaceId:t.controlState.selectedPlaceId,selectedPlaceInfo:iw(t),places:rw(t),placeLabels:ZWe(t)}),hXe={selectPlace:M2,renameUserPlace:XVe,restyleUserPlace:YVe,removeUserPlace:ZVe,locateSelectedPlace:b8e,openDialog:Lp},pXe=Jt(dXe,hXe)(fXe);var Rz={},mXe=ft;Object.defineProperty(Rz,"__esModule",{value:!0});var Bce=Rz.default=void 0,gXe=mXe(pt()),vXe=w;Bce=Rz.default=(0,gXe.default)((0,vXe.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 Iz={},yXe=ft;Object.defineProperty(Iz,"__esModule",{value:!0});var zce=Iz.default=void 0,xXe=yXe(pt()),bXe=w;zce=Iz.default=(0,xXe.default)((0,bXe.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 Dz={},_Xe=ft;Object.defineProperty(Dz,"__esModule",{value:!0});var Uce=Dz.default=void 0,wXe=_Xe(pt()),gR=w;Uce=Dz.default=(0,wXe.default)([(0,gR.jsx)("path",{d:"m12 2-5.5 9h11z"},"0"),(0,gR.jsx)("circle",{cx:"17.5",cy:"17.5",r:"4.5"},"1"),(0,gR.jsx)("path",{d:"M3 13.5h8v8H3z"},"2")],"Category");var Lz={},SXe=ft;Object.defineProperty(Lz,"__esModule",{value:!0});var Wce=Lz.default=void 0,OXe=SXe(pt()),CXe=w;Wce=Lz.default=(0,OXe.default)((0,CXe.jsx)("circle",{cx:"12",cy:"12",r:"8"}),"FiberManualRecord");var Nz={},TXe=ft;Object.defineProperty(Nz,"__esModule",{value:!0});var Vce=Nz.default=void 0,EXe=TXe(pt()),PXe=w;Vce=Nz.default=(0,EXe.default)((0,PXe.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 MXe=Li(ty)(({theme:t})=>({marginTop:t.spacing(2),marginLeft:t.spacing(1),marginRight:t.spacing(2)}));function kXe({mapInteraction:t,setMapInteraction:e}){function n(r,i){e(i!==null?i:"Select")}return w.jsx(MXe,{variant:"standard",children:w.jsxs(iy,{size:"small",value:t,exclusive:!0,onChange:n,children:[w.jsx(Pn,{value:"Select",size:"small",sx:ko.toggleButton,children:w.jsx(xt,{arrow:!0,title:fe.get("Select a place in map"),children:w.jsx(zce,{})})},0),w.jsx(Pn,{value:"Point",size:"small",sx:ko.toggleButton,children:w.jsx(xt,{arrow:!0,title:fe.get("Add a point location in map"),children:w.jsx(Bce,{})})},1),w.jsx(Pn,{value:"Polygon",size:"small",sx:ko.toggleButton,children:w.jsx(xt,{arrow:!0,title:fe.get("Draw a polygon area in map"),children:w.jsx(Uce,{})})},2),w.jsx(Pn,{value:"Circle",size:"small",sx:ko.toggleButton,children:w.jsx(xt,{arrow:!0,title:fe.get("Draw a circular area in map"),children:w.jsx(Wce,{})})},3),w.jsx(Pn,{value:"Geometry",size:"small",sx:ko.toggleButton,children:w.jsx(xt,{arrow:!0,title:fe.get("Import places"),children:w.jsx(Vce,{})})},4)]})})}const AXe=t=>({mapInteraction:t.controlState.mapInteraction}),RXe={setMapInteraction:Cle},IXe=Jt(AXe,RXe)(kXe);var f9=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},cw=(typeof window>"u"?"undefined":f9(window))==="object"&&(typeof document>"u"?"undefined":f9(document))==="object"&&document.nodeType===9,DXe={}.constructor;function z3(t){if(t==null||typeof t!="object")return t;if(Array.isArray(t))return t.map(z3);if(t.constructor!==DXe)return t;var e={};for(var n in t)e[n]=z3(t[n]);return e}function $z(t,e,n){t===void 0&&(t="unnamed");var r=n.jss,i=z3(e),o=r.plugins.onCreateRule(t,i,n);return o||(t[0],null)}var d9=function(e,n){for(var r="",i=0;i<+~=|^:(),"'`\s])/g,h9=typeof CSS<"u"&&CSS.escape,Fz=function(t){return h9?h9(t):t.replace(LXe,"\\$1")},Gce=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}(),U3=function(t){I1(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="."+Fz(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]=Uh(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 Kb(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}(Gce),NXe={onCreateRule:function(e,n,r){return e[0]==="@"||r.parent&&r.parent.type==="keyframes"?null:new U3(e,n,r)}},vR={indent:1,children:!0},$Xe=/@([\w-]+)/,FXe=function(){function t(n,r,i){this.type="conditional",this.isProcessed=!1,this.key=n;var o=n.match($Xe);this.at=o?o[1]:"unknown",this.query=i.name||"@"+this.at,this.options=i,this.rules=new H2(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=vR);var i=Ty(r),o=i.linebreak;if(r.indent==null&&(r.indent=vR.indent),r.children==null&&(r.children=vR.children),r.children===!1)return this.query+" {}";var a=this.rules.toString(r);return a?this.query+" {"+o+a+o+"}":""},t}(),jXe=/@container|@media|@supports\s+/,BXe={onCreateRule:function(e,n,r){return jXe.test(e)?new FXe(e,n,r):null}},yR={indent:1,children:!0},zXe=/@keyframes\s+([\w-]+)/,W3=function(){function t(n,r,i){this.type="keyframes",this.at="@keyframes",this.isProcessed=!1;var o=n.match(zXe);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:Fz(l(this,s)),this.rules=new H2(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=yR);var i=Ty(r),o=i.linebreak;if(r.indent==null&&(r.indent=yR.indent),r.children==null&&(r.children=yR.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}(),UXe=/@keyframes\s+/,WXe=/\$([\w-]+)/g,V3=function(e,n){return typeof e=="string"?e.replace(WXe,function(r,i){return i in n?n[i]:r}):e},p9=function(e,n,r){var i=e[n],o=V3(i,r);o!==i&&(e[n]=o)},VXe={onCreateRule:function(e,n,r){return typeof e=="string"&&UXe.test(e)?new W3(e,n,r):null},onProcessStyle:function(e,n,r){return n.type!=="style"||!r||("animation-name"in e&&p9(e,"animation-name",r.keyframes),"animation"in e&&p9(e,"animation",r.keyframes)),e},onChangeValue:function(e,n,r){var i=r.options.sheet;if(!i)return e;switch(n){case"animation":return V3(e,i.keyframes);case"animation-name":return V3(e,i.keyframes);default:return e}}},GXe=function(t){I1(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 Kb(this.key,this.style,s)},e}(Gce),HXe={onCreateRule:function(e,n,r){return r.parent&&r.parent.type==="keyframes"?new GXe(e,n,r):null}},qXe=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=Ty(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=Ty(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},aQe=function(e,n){try{e.attributeStyleMap?e.attributeStyleMap.delete(n):e.style.removeProperty(n)}catch{}},sQe=function(e,n){return e.selectorText=n,e.selectorText===n},Xce=qce(function(){return document.querySelector("head")});function lQe(t,e){for(var n=0;ne.index&&r.options.insertionPoint===e.insertionPoint)return r}return null}function cQe(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 uQe(t){for(var e=Xce(),n=0;n0){var n=lQe(e,t);if(n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element};if(n=cQe(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=uQe(r);if(i)return{parent:i.parentNode,node:i.nextSibling}}return!1}function dQe(t,e){var n=e.insertionPoint,r=fQe(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}Xce().appendChild(t)}var hQe=qce(function(){var t=document.querySelector('meta[property="csp-nonce"]');return t?t.getAttribute("content"):null}),x9=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]},b9=function(e,n){var r=e.cssRules.length;return n===void 0||n>r?r:n},pQe=function(){var e=document.createElement("style");return e.textContent=` +`,e},mQe=function(){function t(n){this.getPropertyValue=iQe,this.setProperty=oQe,this.removeProperty=aQe,this.setSelector=sQe,this.hasInsertedRules=!1,this.cssRules=[],n&&Yx.add(n),this.sheet=n;var r=this.sheet?this.sheet.options:{},i=r.media,o=r.meta,a=r.element;this.element=a||pQe(),this.element.setAttribute("data-jss",""),i&&this.element.setAttribute("media",i),o&&this.element.setAttribute("data-meta",o);var s=hQe();s&&this.element.setAttribute("nonce",s)}var e=t.prototype;return e.attach=function(){if(!(this.element.parentNode||!this.sheet)){dQe(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 ng={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)}};function Jce(){var t;const e=t5();return(t=e==null?void 0:e.$$material)!=null?t:e}const bQe=["checked","disabled","error","focused","focusVisible","required","expanded","selected"];function _Qe(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(bQe.indexOf(s.key)!==-1)return`Mui-${s.key}`;const u=`${i}${c}-${s.key}`;return!l.options.theme[ore]||r!==""?u:`${u}-${a()}`}return`${i}${n}${a()}`}}var eue=Date.now(),bR="fnValues"+eue,_R="fnStyle"+ ++eue,wQe=function(){return{onCreateRule:function(n,r,i){if(typeof r!="function")return null;var o=Fz(n,{},i);return o[_R]=r,o},onProcessStyle:function(n,r){if(bR in r||_R 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[bR]=i,n},onUpdate:function(n,r,i,o){var a=r,s=a[_R];s&&(a.style=s(n)||{});var l=a[bR];if(l)for(var c in l)a.prop(c,l[c](n),o)}}},zf="@global",X3="@global ",SQe=function(){function t(n,r,i){this.type="global",this.at=zf,this.isProcessed=!1,this.key=n,this.options=i,this.rules=new H2(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}(),OQe=function(){function t(n,r,i){this.type="global",this.at=zf,this.isProcessed=!1,this.key=n,this.options=i;var o=n.substr(X3.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}(),CQe=/\s*,\s*/g;function tue(t,e){for(var n=t.split(CQe),r="",i=0;i-1){var o=aue[e];if(!Array.isArray(o))return Nt.js+nd(o)in n?Nt.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:yYe(),xYe()]}}const _Ye=Yce(bYe()),wYe=_Qe(),SYe=new Map,OYe={disableGeneration:!1,generateClassName:wYe,jss:_Ye,sheetsCache:null,sheetsManager:SYe,sheetsRegistry:null},CYe=M.createContext(OYe);let T9=-1e9;function TYe(){return T9+=1,T9}const EYe=["variant"];function E9(t){return t.length===0}function PYe(t){const{variant:e}=t,n=Ae(t,EYe);let r=e||"";return Object.keys(n).sort().forEach(i=>{i==="color"?r+=E9(r)?t[i]:De(t[i]):r+=`${E9(r)?i:De(i)}${De(t[i].toString())}`}),r}const MYe={};function kYe(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=PYe(l.props);s[c]=Ii(s[c]||{},l.style)}),s},options:{}}}const AYe=["name","classNamePrefix","Component","defaultTheme"];function RYe({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=Zce({baseClasses:t.cacheClasses.lastJSS,newClasses:n,Component:r})),t.cacheClasses.value}function IYe({state:t,theme:e,stylesOptions:n,stylesCreator:r,name:i},o){if(n.disableGeneration)return;let a=ng.get(n.sheetsManager,r,e);a||(a={refs:0,staticSheet:null,dynamicStyles:null},ng.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=ng.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&&ng.set(n.sheetsCache,r,e,c)),l&&l.add(c),a.staticSheet=c,a.dynamicStyles=Kce(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=Zce({baseClasses:a.staticSheet.classes,newClasses:c.classes}),l&&l.add(c)}else t.classes=a.staticSheet.classes;a.refs+=1}function DYe({state:t},e){t.dynamicSheet&&t.dynamicSheet.update(e)}function LYe({state:t,theme:e,stylesOptions:n,stylesCreator:r}){if(n.disableGeneration)return;const i=ng.get(n.sheetsManager,r,e);i.refs-=1;const o=n.sheetsRegistry;i.refs===0&&(ng.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 NYe(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 $Ye(t,e={}){const{name:n,classNamePrefix:r,Component:i,defaultTheme:o=MYe}=e,a=Ae(e,AYe),s=kYe(t),l=n||r||"makeStyles";return s.options={index:TYe(),name:n,meta:l,classNamePrefix:l},(u={})=>{const f=Jce()||o,d=j({},M.useContext(CYe),a),h=M.useRef(),p=M.useRef();return NYe(()=>{const g={name:n,state:{},stylesCreator:s,stylesOptions:d,theme:f};return IYe(g,u),p.current=!1,h.current=g,()=>{LYe(g)}},[f,s]),M.useEffect(()=>{p.current&&DYe(h.current,u),p.current=!0}),RYe(h.current,u.classes,i)}}function FYe(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 jYe=["defaultTheme","withTheme","name"],BYe=["classes"],zYe=(t,e={})=>n=>{const{defaultTheme:r,withTheme:i=!1,name:o}=e,a=Ae(e,jYe);let s=o;const l=$Ye(t,j({defaultTheme:r,Component:n,name:o||n.displayName,classNamePrefix:s},a)),c=M.forwardRef(function(f,d){const h=Ae(f,BYe),p=l(j({},n.defaultProps,f));let m,g=h;return(typeof o=="string"||i)&&(m=Jce()||r,o&&(g=FYe({theme:m,name:o,props:h})),i&&!g.theme&&(g.theme=m)),w.jsx(n,j({ref:d,classes:p},g))});return PL(c,n),c},UYe=t=>({components:{MuiLocalizationProvider:{defaultProps:{localeText:j({},t)}}}}),lue={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"},WYe=lue;UYe(lue);const cue=M.createContext(null);function VYe(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({},WYe,l??{})}),[u,c,l]);return w.jsx(cue.Provider,{value:f,children:n})}var K3={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})(K3,K3.exports);var GYe=K3.exports;const uue=$t(GYe),HYe={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 qYe{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||w2;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=uue[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=>Pae(r),this.toISO=r=>C4e(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)=>hze(r,i),this.addMinutes=(r,i)=>dze(r,i),this.addHours=(r,i)=>sze(r,i),this.addDays=(r,i)=>x3(r,i),this.addWeeks=(r,i)=>pze(r,i),this.addMonths=(r,i)=>IC(r,i),this.addYears=(r,i)=>lH(r,i),this.isValid=r=>fae(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 Eze(r,s);case"quarters":return Oze(r,s);case"months":return hae(r,s);case"weeks":return Tze(r,s);case"days":return dae(r,s);case"hours":return _ze(r,s);case"minutes":return wze(r,s);case"seconds":return Cze(r,s);default:return _2(r,s)}},this.isAfter=(r,i)=>IS(r,i),this.isBefore=(r,i)=>am(r,i),this.startOfDay=r=>ov(r),this.endOfDay=r=>b3(r),this.getHours=r=>P4e(r),this.setHours=(r,i)=>KUe(r,i),this.setMinutes=(r,i)=>ZUe(r,i),this.getSeconds=r=>A4e(r),this.setSeconds=(r,i)=>JUe(r,i),this.isSameDay=(r,i)=>gze(r,i),this.isSameMonth=(r,i)=>AUe(r,i),this.isSameYear=(r,i)=>RUe(r,i),this.isSameHour=(r,i)=>kUe(r,i),this.startOfYear=r=>RS(r),this.endOfYear=r=>JA(r),this.startOfMonth=r=>AS(r),this.endOfMonth=r=>_3(r),this.startOfWeek=r=>ZA(r,{locale:this.locale}),this.endOfWeek=r=>eR(r,{locale:this.locale}),this.getYear=r=>R4e(r),this.setYear=(r,i)=>e6e(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:PUe(r,i,new Date,{locale:this.locale}),this.format=(r,i)=>this.formatByString(r,this.formats[i]),this.formatByString=(r,i)=>w4e(r,i,{locale:this.locale}),this.isEqual=(r,i)=>r===null&&i===null?!0:I4e(r,i),this.isNull=r=>r===null,this.isAfterDay=(r,i)=>IS(r,b3(i)),this.isBeforeDay=(r,i)=>am(r,ov(i)),this.isBeforeYear=(r,i)=>am(r,RS(i)),this.isAfterYear=(r,i)=>IS(r,JA(i)),this.isWithinRange=(r,[i,o])=>IUe(r,{start:i,end:o}),this.formatNumber=r=>r,this.getMinutes=r=>M4e(r),this.getDate=r=>T4e(r),this.setDate=(r,i)=>YUe(r,i),this.getMonth=r=>k4e(r),this.getDaysInMonth=r=>_ae(r),this.setMonth=(r,i)=>QUe(r,i),this.getMeridiemText=r=>r==="am"?"AM":"PM",this.getNextMonth=r=>IC(r,1),this.getPreviousMonth=r=>IC(r,-1),this.getMonthArray=r=>{const o=[RS(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 Pze({start:ZA(r,{locale:this.locale}),end:eR(r,{locale:this.locale})}).map(i=>this.formatByString(i,"EEEEEE"))},this.getWeekArray=r=>{const i=ZA(AS(r),{locale:this.locale}),o=eR(_3(r),{locale:this.locale});let a=0,s=i;const l=[];let c=null;for(;am(s,o);){const u=Math.floor(a/7);l[u]=l[u]||[];const f=E4e(s);c!==f&&(c=f,l[u].push(s),a+=1),s=x3(s,1)}return l},this.getYearRange=(r,i)=>{const o=RS(r),a=JA(i),s=[];let l=o;for(;am(l,a);)s.push(l),l=lH(l,1);return s},this.locale=e,this.formats=Object.assign({},HYe,n)}isBeforeMonth(e,n){return am(e,AS(n))}isAfterMonth(e,n){return IS(e,AS(n))}}const XYe={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 QYe extends qYe{constructor(...e){super(...e),this.formatTokenMap=XYe,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=uue[o],s=this.locale||w2;return a(i,s.formatLong,{})}return i}).join("")},this.getFormatHelperText=n=>this.expandFormat(n).replace(/(aaa|aa|a)/g,"(a|p)m").toLocaleLowerCase()}}const uw=()=>{const t=M.useContext(cue);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},Sr=()=>uw().utils,q2=()=>uw().defaultDates,Cd=()=>uw().localeText,fw=()=>{const t=Sr();return M.useRef(t.date()).current},Jx=({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},YYe=(t,e)=>{const n=t.date(e);return t.isValid(n)?n:null},tc=(t,e,n)=>{if(e==null)return n;const r=t.date(e);return t.isValid(r)?r:n};function fue(t,e){var n,r,i,o,a;const s=qe({props:t,name:e}),l=Sr(),c=q2(),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:tc(l,(r=s.minDateTime)!=null?r:s.minDate,c.minDate),maxDate:tc(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 due={emptyValue:null,getTodayValue:t=>t.date(),parseInput:YYe,areValuesEqual:(t,e,n)=>t.isEqual(e,n)},KYe=t=>{switch(t){case"year":case"month":case"day":return"calendar";default:return"clock"}};function hue(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"]},ZYe,e)},tKe=we(At,{name:"PrivatePickersToolbarText",slot:"Root",overridesResolver:(t,e)=>[e.root,{[`&.${P9.selected}`]:e.selected}]})(({theme:t})=>({transition:t.transitions.create("color"),color:t.palette.text.secondary,[`&.${P9.selected}`]:{color:t.palette.text.primary}})),pue=M.forwardRef(function(e,n){const{className:r,value:i}=e,o=Ae(e,JYe),a=eKe(e);return w.jsx(tKe,j({ref:n,className:Vr(r,a.root),component:"span"},o,{children:i}))}),nKe=ni(w.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),rKe=ni(w.jsx("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}),"ArrowLeft"),iKe=ni(w.jsx("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"ArrowRight"),mue=ni(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"),oKe=ni(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"),aKe=ni(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"),sKe=ni(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"),lKe=ni(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 gue(t){return We("MuiPickersToolbar",t)}const vue=Ve("MuiPickersToolbar",["root","content","penIconButton","penIconButtonLandscape"]),cKe=t=>{const{classes:e,isLandscape:n}=t;return Ue({root:["root"],content:["content"],penIconButton:["penIconButton",n&&"penIconButtonLandscape"]},gue,e)},uKe=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"})),fKe=we(MC,{name:"MuiPickersToolbar",slot:"Content",overridesResolver:(t,e)=>e.content})(({ownerState:t})=>j({flex:1},!t.isLandscape&&{alignItems:"center"})),dKe=we(Ot,{name:"MuiPickersToolbar",slot:"PenIconButton",overridesResolver:(t,e)=>[{[`&.${vue.penIconButtonLandscape}`]:e.penIconButtonLandscape},e.penIconButton]})({}),hKe=t=>t==="clock"?w.jsx(oKe,{color:"inherit"}):w.jsx(mue,{color:"inherit"}),pKe=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=Cd(),m=cKe(h);return w.jsxs(uKe,{ref:n,className:Vr(m.root,o),ownerState:h,children:[w.jsx(At,{color:"text.secondary",variant:"overline",children:f}),w.jsxs(fKe,{container:!0,justifyContent:"space-between",className:m.content,ownerState:h,direction:s?c:"row",alignItems:s?"flex-start":"flex-end",children:[i,w.jsx(dKe,{onClick:u,className:m.penIconButton,ownerState:h,color:"inherit","aria-label":a?a(l,d):p.inputModeToggleButtonAriaLabel(l,d),children:l?hKe(d):w.jsx(sKe,{color:"inherit"})})]})]})}),mKe=["align","className","selected","typographyClassName","value","variant"],gKe=t=>{const{classes:e}=t;return Ue({root:["root"]},gue,e)},vKe=we(tr,{name:"MuiPickersToolbarButton",slot:"Root",overridesResolver:(t,e)=>e.root})({padding:0,minWidth:16,textTransform:"none"}),M0=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,mKe),f=gKe(r);return w.jsx(vKe,j({variant:"text",ref:n,className:Vr(o,f.root)},u,{children:w.jsx(pue,{align:i,className:s,variant:c,value:l,selected:a})}))});function yKe(t){return We("MuiDateTimePickerToolbar",t)}Ve("MuiDateTimePickerToolbar",["root","dateContainer","timeContainer","separator"]);const xKe=["ampm","parsedValue","isMobileKeyboardViewOpen","onChange","openView","setOpenView","toggleMobileKeyboardView","toolbarFormat","toolbarPlaceholder","toolbarTitle","views"],bKe=t=>{const{classes:e}=t;return Ue({root:["root"],dateContainer:["dateContainer"],timeContainer:["timeContainer"],separator:["separator"]},yKe,e)},_Ke=we(pKe,{name:"MuiDateTimePickerToolbar",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({paddingLeft:16,paddingRight:16,justifyContent:"space-around",position:"relative",[`& .${vue.penIconButton}`]:j({position:"absolute",top:8},t.direction==="rtl"?{left:8}:{right:8})})),wKe=we("div",{name:"MuiDateTimePickerToolbar",slot:"DateContainer",overridesResolver:(t,e)=>e.dateContainer})({display:"flex",flexDirection:"column",alignItems:"flex-start"}),SKe=we("div",{name:"MuiDateTimePickerToolbar",slot:"TimeContainer",overridesResolver:(t,e)=>e.timeContainer})({display:"flex"}),M9=we(pue,{name:"MuiDateTimePickerToolbar",slot:"Separator",overridesResolver:(t,e)=>e.separator})({margin:"0 4px 0 2px",cursor:"default"});function yue(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,xKe),h=e,p=Sr(),m=Cd(),g=bKe(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(_Ke,j({toolbarTitle:v,isMobileKeyboardViewOpen:i,toggleMobileKeyboardView:s,className:g.root,viewType:KYe(o)},d,{isLandscape:!1,ownerState:h,children:[w.jsxs(wKe,{className:g.dateContainer,ownerState:h,children:[f.includes("year")&&w.jsx(M0,{tabIndex:-1,variant:"subtitle1",onClick:()=>a("year"),selected:o==="year",value:r?p.format(r,"year"):"–"}),f.includes("day")&&w.jsx(M0,{tabIndex:-1,variant:"h4",onClick:()=>a("day"),selected:o==="day",value:x})]}),w.jsxs(SKe,{className:g.timeContainer,ownerState:h,children:[f.includes("hours")&&w.jsx(M0,{variant:"h3",onClick:()=>a("hours"),selected:o==="hours",value:r?y(r):"--"}),f.includes("minutes")&&w.jsxs(M.Fragment,{children:[w.jsx(M9,{variant:"h3",value:":",className:g.separator,ownerState:h}),w.jsx(M0,{variant:"h3",onClick:()=>a("minutes"),selected:o==="minutes",value:r?p.format(r,"minutes"):"--"})]}),f.includes("seconds")&&w.jsxs(M.Fragment,{children:[w.jsx(M9,{variant:"h3",value:":",className:g.separator,ownerState:h}),w.jsx(M0,{variant:"h3",onClick:()=>a("seconds"),selected:o==="seconds",value:r?p.format(r,"seconds"):"--"})]})]})]}))}const Td=M.createContext(null),OKe=["onAccept","onClear","onCancel","onSetToday","actions"],xue=t=>{const{onAccept:e,onClear:n,onCancel:r,onSetToday:i,actions:o}=t,a=Ae(t,OKe),s=M.useContext(Td),l=Cd(),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(tr,{onClick:n,children:l.clearButtonLabel},f);case"cancel":return w.jsx(tr,{onClick:r,children:l.cancelButtonLabel},f);case"accept":return w.jsx(tr,{onClick:e,children:l.okButtonLabel},f);case"today":return w.jsx(tr,{onClick:i,children:l.todayButtonLabel},f);default:return null}});return w.jsx(Tp,j({},a,{children:u}))};function CKe(t){return We("MuiPickersPopper",t)}Ve("MuiPickersPopper",["root","paper"]);function bue(t,e){return Array.isArray(e)?e.every(n=>t.indexOf(n)!==-1):t.indexOf(e)!==-1}const _ue=(t,e)=>n=>{(n.key==="Enter"||n.key===" ")&&(t(n),n.preventDefault(),n.stopPropagation())},wue=(t=document)=>{const e=t.activeElement;return e?e.shadowRoot?wue(e.shadowRoot):e:null},TKe=["onClick","onTouchStart"],EKe=t=>{const{classes:e}=t;return Ue({root:["root"],paper:["paper"]},CKe,e)},PKe=we(_5,{name:"MuiPickersPopper",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({zIndex:t.zIndex.modal})),MKe=we(Ho,{name:"MuiPickersPopper",slot:"Paper",overridesResolver:(t,e)=>e.paper})(({ownerState:t})=>j({transformOrigin:"top center",outline:0},t.placement==="top"&&{transformOrigin:"bottom center"}));function kKe(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=_r(l=>{if(!o.current)return;const c=r.current;r.current=!1;const u=$n(i.current);if(!i.current||"clientX"in l&&kKe(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 RKe(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=ev,TrapFocusProps:g,PaperProps:v={},components:y,componentsProps:x}=n;M.useEffect(()=>{function W($){d&&($.key==="Escape"||$.key==="Esc")&&s()}return document.addEventListener("keydown",W),()=>{document.removeEventListener("keydown",W)}},[s,d]);const b=M.useRef(null);M.useEffect(()=>{p!=="tooltip"&&(d?b.current=wue(document):b.current&&b.current instanceof HTMLElement&&setTimeout(()=>{b.current instanceof HTMLElement&&b.current.focus()}))},[d,p]);const[_,S,O]=AKe(d,a??s),C=M.useRef(null),E=Zt(C,o),k=Zt(E,_),I=n,P=EKe(I),{onClick:R,onTouchStart:T}=v,L=Ae(v,TKe),z=W=>{W.key==="Escape"&&(W.stopPropagation(),s())},B=(e=y==null?void 0:y.ActionBar)!=null?e:xue,U=(y==null?void 0:y.PaperContent)||M.Fragment;return w.jsx(PKe,j({transition:!0,role:p,open:d,anchorEl:r,onKeyDown:z,className:P.root},h,{children:({TransitionProps:W,placement:$})=>w.jsx(Ore,j({open:d,disableAutoFocus:!0,disableRestoreFocus:!0,disableEnforceFocus:p==="tooltip",isEnabled:()=>!0},g,{children:w.jsx(m,j({},W,{children:w.jsx(MKe,j({tabIndex:-1,elevation:8,ref:k,onClick:N=>{S(N),R&&R(N)},onTouchStart:N=>{O(N),T&&T(N)},ownerState:j({},I,{placement:$}),className:P.paper},L,{children:w.jsxs(U,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 IKe(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(Td.Provider,{value:"desktop",children:[w.jsx(r,j({},n,{inputRef:g})),w.jsx(RKe,{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 Uz({onChange:t,onViewChange:e,openTo:n,view:r,views:i}){var o,a;const[s,l]=Qs({name:"Picker",state:"view",controlled:r,default:n&&bue(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 sv=220,Uf=36,Jb={x:sv/2,y:sv/2},Sue={x:Jb.x,y:0},DKe=Sue.x-Jb.x,LKe=Sue.y-Jb.y,NKe=t=>t*(180/Math.PI),Oue=(t,e,n)=>{const r=e-Jb.x,i=n-Jb.y,o=Math.atan2(DKe,LKe)-Math.atan2(r,i);let a=NKe(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}},$Ke=(t,e,n=1)=>{const r=n*6;let{value:i}=Oue(r,t,e);return i=i*n%60,i},FKe=(t,e,n)=>{const{value:r,distance:i}=Oue(30,t,e);let o=r||12;return n?o%=12:i{const{classes:e}=t;return Ue({root:["root"],thumb:["thumb"]},jKe,e)},UKe=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"])})),WKe=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% - ${Uf/2}px)`,border:`${(Uf-4)/2}px solid ${t.palette.primary.main}`,boxSizing:"content-box"},e.hasSelected&&{backgroundColor:t.palette.primary.main}));function VKe(t){const e=qe({props:t,name:"MuiClockPointer"}),{className:n,isInner:r,type:i,value:o}=e,a=Ae(e,BKe),s=M.useRef(i);M.useEffect(()=>{s.current=i},[i]);const l=j({},e,{shouldAnimate:s.current!==i}),c=zKe(l),u=()=>{let d=360/(i==="hours"?12:60)*o;return i==="hours"&&o>12&&(d-=360),{height:Math.round((r?.26:.4)*sv),transform:`rotateZ(${d}deg)`}};return w.jsx(UKe,j({style:u(),className:Vr(n,c.root),ownerState:l},a,{children:w.jsx(WKe,{ownerState:l,className:c.thumb})}))}function GKe(t){return We("MuiClock",t)}Ve("MuiClock",["root","clock","wrapper","squareMask","pin","amButton","pmButton"]);const HKe=t=>{const{classes:e}=t;return Ue({root:["root"],clock:["clock"],wrapper:["wrapper"],squareMask:["squareMask"],pin:["pin"],amButton:["amButton"],pmButton:["pmButton"]},GKe,e)},qKe=we("div",{name:"MuiClock",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({display:"flex",justifyContent:"center",alignItems:"center",margin:t.spacing(2)})),XKe=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"}),QKe=we("div",{name:"MuiClock",slot:"Wrapper",overridesResolver:(t,e)=>e.wrapper})({"&:focus":{outline:"none"}}),YKe=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"}})),KKe=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%)"})),ZKe=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}})),JKe=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 eZe(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=Sr(),_=M.useContext(Td),S=M.useRef(!1),O=HKe(x),C=c(m,p),E=!n&&p==="hours"&&(m<1||m>12),k=($,N)=>{g||v||c($,p)||d($,N)},I=($,N)=>{let{offsetX:D,offsetY:A}=$;if(D===void 0){const Y=$.target.getBoundingClientRect();D=$.changedTouches[0].clientX-Y.left,A=$.changedTouches[0].clientY-Y.top}const q=p==="seconds"||p==="minutes"?$Ke(D,A,f):FKe(D,A,!!n);k(q,N)},P=$=>{S.current=!0,I($,"shallow")},R=$=>{S.current&&(I($,"finish"),S.current=!1)},T=$=>{$.buttons>0&&I($.nativeEvent,"shallow")},L=$=>{S.current&&(S.current=!1),I($.nativeEvent,"finish")},z=M.useMemo(()=>p==="hours"?!0:m%5===0,[p,m]),B=p==="minutes"?f:1,U=M.useRef(null);Hr(()=>{i&&U.current.focus()},[i]);const W=$=>{if(!S.current)switch($.key){case"Home":k(0,"partial"),$.preventDefault();break;case"End":k(p==="minutes"?59:23,"partial"),$.preventDefault();break;case"ArrowUp":k(m+B,"partial"),$.preventDefault();break;case"ArrowDown":k(m-B,"partial"),$.preventDefault();break}};return w.jsxs(qKe,{className:Vr(y,O.root),children:[w.jsxs(XKe,{className:O.clock,children:[w.jsx(YKe,{onTouchMove:P,onTouchEnd:R,onMouseUp:L,onMouseMove:T,ownerState:{disabled:g},className:O.squareMask}),!C&&w.jsxs(M.Fragment,{children:[w.jsx(KKe,{className:O.pin}),a&&w.jsx(VKe,{type:p,value:m,isInner:E,hasSelected:z})]}),w.jsx(QKe,{"aria-activedescendant":h,"aria-label":s(p,a,b),ref:U,role:"listbox",onKeyDown:W,tabIndex:0,className:O.wrapper,children:o})]}),n&&(_==="desktop"||r)&&w.jsxs(M.Fragment,{children:[w.jsx(ZKe,{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(JKe,{disabled:g||u===null,onClick:v?void 0:()=>l("pm"),ownerState:x,className:O.pmButton,children:w.jsx(At,{variant:"caption",children:"PM"})})]})]})}const Cue=t=>()=>{};function tZe(t){return We("MuiClockNumber",t)}const jS=Ve("MuiClockNumber",["root","selected","disabled"]),nZe=["className","disabled","index","inner","label","selected"],rZe=t=>{const{classes:e,selected:n,disabled:r}=t;return Ue({root:["root",n&&"selected",r&&"disabled"]},tZe,e)},iZe=we("span",{name:"MuiClockNumber",slot:"Root",overridesResolver:(t,e)=>[e.root,{[`&.${jS.disabled}`]:e.disabled},{[`&.${jS.selected}`]:e.selected}]})(({theme:t,ownerState:e})=>j({height:Uf,width:Uf,position:"absolute",left:`calc((100% - ${Uf}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},[`&.${jS.selected}`]:{color:t.palette.primary.contrastText},[`&.${jS.disabled}`]:{pointerEvents:"none",color:t.palette.text.disabled}},e.inner&&j({},t.typography.body2,{color:t.palette.text.secondary})));function Tue(t){const e=qe({props:t,name:"MuiClockNumber"}),{className:n,disabled:r,index:i,inner:o,label:a,selected:s}=e,l=Ae(e,nZe),c=e,u=rZe(c),f=i%12/12*Math.PI*2-Math.PI/2,d=(sv-Uf-2)/2*(o?.65:1),h=Math.round(Math.cos(f)*d),p=Math.round(Math.sin(f)*d);return w.jsx(iZe,j({className:Vr(n,u.root),"aria-disabled":r?!0:void 0,"aria-selected":s?!0:void 0,role:"option",style:{transform:`translate(${h}px, ${p+(sv-Uf)/2}px`},ownerState:c},l,{children:a}))}const oZe=({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(Tue,{id:p?i:void 0,index:f,inner:h,selected:p,disabled:r(f),label:d,"aria-label":n(d)},f))}return s},k9=({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(Tue,{label:s,id:c?i:void 0,index:l+1,inner:!1,disabled:n(a),selected:c,"aria-label":r(s)},a)})};function aZe(t){return We("MuiPickersArrowSwitcher",t)}Ve("MuiPickersArrowSwitcher",["root","spacer","button"]);const sZe=["children","className","components","componentsProps","isLeftDisabled","isLeftHidden","isRightDisabled","isRightHidden","leftArrowButtonText","onLeftClick","onRightClick","rightArrowButtonText"],lZe=t=>{const{classes:e}=t;return Ue({root:["root"],spacer:["spacer"],button:["button"]},aZe,e)},cZe=we("div",{name:"MuiPickersArrowSwitcher",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex"}),uZe=we("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer",overridesResolver:(t,e)=>e.spacer})(({theme:t})=>({width:t.spacing(3)})),A9=we(Ot,{name:"MuiPickersArrowSwitcher",slot:"Button",overridesResolver:(t,e)=>e.button})(({ownerState:t})=>j({},t.hidden&&{visibility:"hidden"})),Eue=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,sZe),y=Go().direction==="rtl",x=(s==null?void 0:s.leftArrowButton)||{},b=(a==null?void 0:a.LeftArrowIcon)||rKe,_=(s==null?void 0:s.rightArrowButton)||{},S=(a==null?void 0:a.RightArrowIcon)||iKe,O=r,C=lZe(O);return w.jsxs(cZe,j({ref:n,className:Vr(C.root,o),ownerState:O},g,{children:[w.jsx(A9,j({as:a==null?void 0:a.LeftArrowButton,size:"small","aria-label":d,title:d,disabled:l,edge:"end",onClick:h},x,{className:Vr(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(uZe,{className:C.spacer,ownerState:O}),w.jsx(A9,j({as:a==null?void 0:a.RightArrowButton,size:"small","aria-label":m,title:m,edge:"start",disabled:u,onClick:p},_,{className:Vr(C.button,_.className),ownerState:j({},O,_,{hidden:f}),children:y?w.jsx(b,{}):w.jsx(S,{})}))]}))}),fZe=(t,e)=>t?e.getHours(t)>=12?"pm":"am":null,Z3=(t,e,n)=>n&&(t>=12?"pm":"am")!==e?e==="am"?t-12:t+12:t,dZe=(t,e,n,r)=>{const i=Z3(r.getHours(t),e,n);return r.setHours(t,i)},R9=(t,e)=>e.getHours(t)*3600+e.getMinutes(t)*60+e.getSeconds(t),Pue=(t=!1,e)=>(n,r)=>t?e.isAfter(n,r):R9(n,e)>R9(r,e);function hZe(t,{disableFuture:e,maxDate:n}){const r=Sr();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 pZe(t,{disablePast:e,minDate:n}){const r=Sr();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 mZe(t,e,n){const r=Sr(),i=fZe(t,r),o=M.useCallback(a=>{const s=t==null?null:dZe(t,a,!!e,r);n(s,"partial")},[e,t,n,r]);return{meridiemMode:i,handleMeridiemChange:o}}function gZe(t){return We("MuiClockPicker",t)}Ve("MuiClockPicker",["root","arrowSwitcher"]);const J3=36,Wz=2,Mue=320,vZe=358,Vz=we("div")({overflowX:"hidden",width:Mue,maxHeight:vZe,display:"flex",flexDirection:"column",margin:"0 auto"}),yZe=t=>{const{classes:e}=t;return Ue({root:["root"],arrowSwitcher:["arrowSwitcher"]},gZe,e)},xZe=we(Vz,{name:"MuiClockPicker",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexDirection:"column"}),bZe=we(Eue,{name:"MuiClockPicker",slot:"ArrowSwitcher",overridesResolver:(t,e)=>e.arrowSwitcher})({position:"absolute",right:12,top:15}),_Ze=Cue(),wZe=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;_Ze({leftArrowButtonText:m,rightArrowButtonText:x,getClockLabelText:f,getHoursClockNumberText:d,getMinutesClockNumberText:h,getSecondsClockNumberText:p});const T=Cd(),L=m??T.openPreviousView,z=x??T.openNextView,B=f??T.clockLabelText,U=d??T.hoursClockNumberText,W=h??T.minutesClockNumberText,$=p??T.secondsClockNumberText,{openView:N,setOpenView:D,nextView:A,previousView:q,handleChangeAndOpenNext:Y}=Uz({view:O,views:C,openTo:E,onViewChange:k,onChange:S}),K=fw(),se=Sr(),te=M.useMemo(()=>c||se.setSeconds(se.setMinutes(se.setHours(K,0),0),0),[c,K,se]),{meridiemMode:J,handleMeridiemChange:pe}=mZe(te,i,Y),be=M.useCallback((le,Q)=>{const X=Pue(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=Z3(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=pd(),ve=M.useMemo(()=>{switch(N){case"hours":{const le=(Q,X)=>{const ee=Z3(Q,J,i);Y(se.setHours(te,ee),X)};return{onChange:le,value:se.getHours(te),children:oZe({date:c,utils:se,ampm:i,onChange:le,getClockNumberText:U,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:k9({utils:se,value:le,onChange:Q,getClockNumberText:W,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:k9({utils:se,value:le,onChange:Q,getClockNumberText:$,isDisabled:X=>P||be(X,"seconds"),selectedId:re})}}default:throw new Error("You must provide the type for ClockView")}},[N,se,c,i,U,W,$,J,Y,te,be,re,P]),F=r,ce=yZe(F);return w.jsxs(xZe,{ref:n,className:Vr(ce.root,I),ownerState:F,children:[_&&w.jsx(bZe,{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(eZe,j({autoFocus:a,date:c,ampmInClock:o,type:N,ampm:i,getClockLabelText:B,minutesStep:y,isTimeDisabled:be,meridiemMode:J,handleMeridiemChange:pe,selectedId:re,disabled:P,readOnly:R},ve))]})});function SZe(t){return We("PrivatePickersMonth",t)}const I9=Ve("PrivatePickersMonth",["root","selected"]),OZe=["disabled","onSelect","selected","value","tabIndex","hasFocus","onFocus","onBlur"],CZe=t=>{const{classes:e,selected:n}=t;return Ue({root:["root",n&&"selected"]},SZe,e)},TZe=we(At,{name:"PrivatePickersMonth",slot:"Root",overridesResolver:(t,e)=>[e.root,{[`&.${I9.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:Hc(t.palette.action.active,t.palette.action.hoverOpacity)},"&:disabled":{pointerEvents:"none",color:t.palette.text.secondary},[`&.${I9.selected}`]:{color:t.palette.primary.contrastText,backgroundColor:t.palette.primary.main,"&:focus, &:hover":{backgroundColor:t.palette.primary.dark}}})),D9=()=>{},EZe=t=>{const{disabled:e,onSelect:n,selected:r,value:i,tabIndex:o,hasFocus:a,onFocus:s=D9,onBlur:l=D9}=t,c=Ae(t,OZe),u=CZe(t),f=()=>{n(i)},d=M.useRef(null);return Hr(()=>{if(a){var h;(h=d.current)==null||h.focus()}},[a]),w.jsx(TZe,j({ref:d,component:"button",type:"button",className:u.root,tabIndex:o,onClick:f,onKeyDown:_ue(f),color:r?"primary":void 0,variant:r?"h5":"subtitle1",disabled:e,onFocus:h=>s(h,i),onBlur:h=>l(h,i)},c))};function PZe(t){return We("MuiMonthPicker",t)}Ve("MuiMonthPicker",["root"]);const MZe=["className","date","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","autoFocus","onMonthFocus","hasFocus","onFocusedViewChange"],kZe=t=>{const{classes:e}=t;return Ue({root:["root"]},PZe,e)};function AZe(t,e){const n=Sr(),r=q2(),i=qe({props:t,name:e});return j({disableFuture:!1,disablePast:!1},i,{minDate:tc(n,i.minDate,r.minDate),maxDate:tc(n,i.maxDate,r.maxDate)})}const RZe=we("div",{name:"MuiMonthPicker",slot:"Root",overridesResolver:(t,e)=>e.root})({width:310,display:"flex",flexWrap:"wrap",alignContent:"stretch",margin:"0 4px"}),IZe=M.forwardRef(function(e,n){const r=Sr(),i=fw(),o=AZe(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,MZe),S=o,O=kZe(S),C=hd(),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]=Qs({name:"MonthPicker",state:"hasFocus",controlled:x,default:v}),B=M.useCallback(A=>{z(A),b&&b(A)},[z,b]),U=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 W=_r(A=>{switch(A.key){case"ArrowUp":U((12+I-3)%12),A.preventDefault();break;case"ArrowDown":U((12+I+3)%12),A.preventDefault();break;case"ArrowLeft":U((12+I+(C.direction==="ltr"?-1:1))%12),A.preventDefault();break;case"ArrowRight":U((12+I+(C.direction==="ltr"?1:-1))%12),A.preventDefault();break}}),$=M.useCallback((A,q)=>{U(q)},[U]),N=M.useCallback(()=>{B(!1)},[B]),D=r.getMonth(i);return w.jsx(RZe,j({ref:n,className:Vr(O.root,a),ownerState:S,onKeyDown:W},_,{children:r.getMonthArray(E).map(A=>{const q=r.getMonth(A),Y=r.format(A,"monthShort"),K=l||R(A);return w.jsx(EZe,{value:q,selected:q===k,tabIndex:q===I&&!K?0:-1,hasFocus:L&&q===I,onSelect:T,onFocus:$,onBlur:N,disabled:K,"aria-current":D===q?"date":void 0,children:Y},Y)})}))});function DZe(t,e,n){const{value:r,onError:i}=t,o=uw(),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 kue=({props:t,value:e,adapter:n})=>{const r=n.utils.date(),i=n.utils.date(e),o=tc(n.utils,t.minDate,n.defaultDates.minDate),a=tc(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}},Aue=({shouldDisableDate:t,minDate:e,maxDate:n,disableFuture:r,disablePast:i})=>{const o=uw();return M.useCallback(a=>kue({adapter:o,value:a,props:{shouldDisableDate:t,minDate:e,maxDate:n,disableFuture:r,disablePast:i}})!==null,[o,t,e,n,r,i])},LZe=(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")}},NZe=({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=fw(),d=Sr(),h=M.useRef(LZe(!!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=Aue({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}},$Ze=t=>We("MuiPickersFadeTransitionGroup",t);Ve("MuiPickersFadeTransitionGroup",["root"]);const FZe=t=>{const{classes:e}=t;return Ue({root:["root"]},$Ze,e)},L9=500,jZe=we(L1,{name:"MuiPickersFadeTransitionGroup",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"block",position:"relative"});function Rue(t){const e=qe({props:t,name:"MuiPickersFadeTransitionGroup"}),{children:n,className:r,reduceAnimations:i,transKey:o}=e,a=FZe(e);return i?n:w.jsx(jZe,{className:Vr(a.root,r),children:w.jsx(ZM,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:L9,enter:L9/2,exit:0},children:n},o)})}function BZe(t){return We("MuiPickersDay",t)}const BS=Ve("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),zZe=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDaySelect","onFocus","onBlur","onKeyDown","onMouseDown","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today"],UZe=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"]},BZe,l)},Iue=({theme:t,ownerState:e})=>j({},t.typography.caption,{width:J3,height:J3,borderRadius:"50%",padding:0,backgroundColor:t.palette.background.paper,color:t.palette.text.primary,"&:hover":{backgroundColor:Hc(t.palette.action.active,t.palette.action.hoverOpacity)},"&:focus":{backgroundColor:Hc(t.palette.action.active,t.palette.action.hoverOpacity),[`&.${BS.selected}`]:{willChange:"background-color",backgroundColor:t.palette.primary.dark}},[`&.${BS.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}},[`&.${BS.disabled}`]:{color:t.palette.text.disabled}},!e.disableMargin&&{margin:`0 ${Wz}px`},e.outsideCurrentMonth&&e.showDaysOutsideCurrentMonth&&{color:t.palette.text.secondary},!e.disableHighlightToday&&e.today&&{[`&:not(.${BS.selected})`]:{border:`1px solid ${t.palette.text.secondary}`}}),Due=(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]},WZe=we(fs,{name:"MuiPickersDay",slot:"Root",overridesResolver:Due})(Iue),VZe=we("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:Due})(({theme:t,ownerState:e})=>j({},Iue({theme:t,ownerState:e}),{opacity:0,pointerEvents:"none"})),PR=()=>{},GZe=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=PR,onBlur:p=PR,onKeyDown:m=PR,onMouseDown:g,outsideCurrentMonth:v,selected:y=!1,showDaysOutsideCurrentMonth:x=!1,children:b,today:_=!1}=r,S=Ae(r,zZe),O=j({},r,{autoFocus:i,disabled:s,disableHighlightToday:l,disableMargin:c,selected:y,showDaysOutsideCurrentMonth:x,today:_}),C=UZe(O),E=Sr(),k=M.useRef(null),I=Zt(k,n);Hr(()=>{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(VZe,{className:Vr(C.root,C.hiddenDaySpacingFiller,o),ownerState:O,role:S.role}):w.jsx(WZe,j({className:Vr(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")}))}),HZe=(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,qZe=M.memo(GZe,HZe),XZe=t=>We("PrivatePickersSlideTransition",t),Wi=Ve("PrivatePickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),QZe=["children","className","reduceAnimations","slideDirection","transKey"],YZe=t=>{const{classes:e}=t;return Ue({root:["root"]},XZe,e)},Lue=350,KZe=we(L1,{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:Lue,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}}}),ZZe=t=>{const{children:e,className:n,reduceAnimations:r,slideDirection:i,transKey:o}=t,a=Ae(t,QZe),s=YZe(t);if(r)return w.jsx("div",{className:Vr(s.root,n),children:e});const l={exit:Wi.slideExit,enterActive:Wi.slideEnterActive,enter:Wi[`slideEnter-${i}`],exitActive:Wi[`slideExitActiveLeft-${i}`]};return w.jsx(KZe,{className:Vr(s.root,n),childFactory:c=>M.cloneElement(c,{classNames:l}),role:"presentation",children:w.jsx(c5,j({mountOnEnter:!0,unmountOnExit:!0,timeout:Lue,classNames:l},a,{children:e}),o)})},JZe=t=>We("MuiDayPicker",t);Ve("MuiDayPicker",["header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer"]);const eJe=t=>{const{classes:e}=t;return Ue({header:["header"],weekDayLabel:["weekDayLabel"],loadingContainer:["loadingContainer"],slideTransition:["slideTransition"],monthContainer:["monthContainer"],weekContainer:["weekContainer"]},JZe,e)},tJe=t=>t.charAt(0).toUpperCase(),Nue=(J3+Wz*2)*6,nJe=we("div",{name:"MuiDayPicker",slot:"Header",overridesResolver:(t,e)=>e.header})({display:"flex",justifyContent:"center",alignItems:"center"}),rJe=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})),iJe=we("div",{name:"MuiDayPicker",slot:"LoadingContainer",overridesResolver:(t,e)=>e.loadingContainer})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:Nue}),oJe=we(ZZe,{name:"MuiDayPicker",slot:"SlideTransition",overridesResolver:(t,e)=>e.slideTransition})({minHeight:Nue}),aJe=we("div",{name:"MuiDayPicker",slot:"MonthContainer",overridesResolver:(t,e)=>e.monthContainer})({overflow:"hidden"}),sJe=we("div",{name:"MuiDayPicker",slot:"WeekContainer",overridesResolver:(t,e)=>e.weekContainer})({margin:`${Wz}px 0`,display:"flex",justifyContent:"center"});function lJe(t){const e=fw(),n=Sr(),r=qe({props:t,name:"MuiDayPicker"}),i=eJe(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=tJe,hasFocus:R,onFocusedViewChange:T,gridLabelId:L}=r,z=Aue({shouldDisableDate:I,minDate:E,maxDate:k,disablePast:O,disableFuture:C}),[B,U]=M.useState(()=>f||e),W=M.useCallback(re=>{T&&T(re)},[T]),$=M.useCallback((re,ve="finish")=>{g||p(re,ve)},[p,g]),N=M.useCallback(re=>{z(re)||(o(re),U(re),W(!0))},[z,o,W]),D=Go();function A(re,ve){switch(re.key){case"ArrowUp":N(n.addDays(ve,-7)),re.preventDefault();break;case"ArrowDown":N(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=Jx({utils:n,date:F,minDate:D.direction==="ltr"?n.startOfMonth(ce):F,maxDate:D.direction==="ltr"?F:n.endOfMonth(ce),isDateDisabled:z});N(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=Jx({utils:n,date:F,minDate:D.direction==="ltr"?F:n.startOfMonth(ce),maxDate:D.direction==="ltr"?n.endOfMonth(ce):F,isDateDisabled:z});N(le||F),re.preventDefault();break}case"Home":N(n.startOfWeek(ve)),re.preventDefault();break;case"End":N(n.endOfWeek(ve)),re.preventDefault();break;case"PageUp":N(n.getNextMonth(ve)),re.preventDefault();break;case"PageDown":N(n.getPreviousMonth(ve)),re.preventDefault();break}}function q(re,ve){N(ve)}function Y(re,ve){R&&n.isSameDay(B,ve)&&W(!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)?Jx({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(nJe,{role:"row",className:i.header,children:n.getWeekdays().map((re,ve)=>{var F;return w.jsx(rJe,{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(iJe,{className:i.loadingContainer,children:x()}):w.jsx(oJe,j({transKey:te,onExited:m,reduceAnimations:v,slideDirection:_,className:Vr(a,i.slideTransition)},S,{nodeRef:J,children:w.jsx(aJe,{ref:J,role:"rowgroup",className:i.monthContainer,children:n.getWeekArray(s).map(re=>w.jsx(sJe,{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:$,tabIndex:F?0:-1,role:"gridcell","aria-selected":ce};return le&&(Q["aria-current"]="date"),y?y(ve,se,Q):M.createElement(qZe,j({},Q,{key:Q.key}))})},`week-${re[0]}`))})}))]})}const cJe=t=>We("MuiPickersCalendarHeader",t);Ve("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]);const uJe=t=>{const{classes:e}=t;return Ue({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},cJe,e)},fJe=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}),dJe=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})),hJe=we("div",{name:"MuiPickersCalendarHeader",slot:"Label",overridesResolver:(t,e)=>e.label})({marginRight:6}),pJe=we(Ot,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton",overridesResolver:(t,e)=>e.switchViewButton})({marginRight:"auto"}),mJe=we(nKe,{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)"})),gJe=Cue();function vJe(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;gJe({leftArrowButtonText:c,rightArrowButtonText:g,getViewSwitchingButtonText:l});const x=Cd(),b=c??x.previousMonth,_=g??x.nextMonth,S=l??x.calendarViewSwitchingButtonAriaLabel,O=Sr(),C=uJe(e),E=r.switchViewButton||{},k=()=>d(O.getNextMonth(i),"left"),I=()=>d(O.getPreviousMonth(i),"right"),P=hZe(i,{disableFuture:a,maxDate:u}),R=pZe(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(fJe,{ownerState:L,className:C.root,children:[w.jsxs(dJe,{role:"presentation",onClick:T,ownerState:L,"aria-live":"polite",className:C.labelContainer,children:[w.jsx(Rue,{reduceAnimations:m,transKey:O.format(i,"monthAndYear"),children:w.jsx(hJe,{id:y,ownerState:L,className:C.label,children:O.format(i,"monthAndYear")})}),v.length>1&&!o&&w.jsx(pJe,j({size:"small",as:n.SwitchViewButton,"aria-label":S(p),className:C.switchViewButton},E,{children:w.jsx(mJe,{as:n.SwitchViewIcon,ownerState:L,className:C.switchViewIcon})}))]}),w.jsx(ZM,{in:p==="day",children:w.jsx(Eue,{leftArrowButtonText:b,rightArrowButtonText:_,components:n,componentsProps:r,onLeftClick:I,onRightClick:k,isLeftDisabled:R,isRightDisabled:P})})]})}function yJe(t){return We("PrivatePickersYear",t)}const rg=Ve("PrivatePickersYear",["root","modeDesktop","modeMobile","yearButton","selected","disabled"]),xJe=["autoFocus","className","children","disabled","onClick","onKeyDown","value","tabIndex","onFocus","onBlur"],bJe=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,yJe,i)},_Je=we("div",{name:"PrivatePickersYear",slot:"Root",overridesResolver:(t,e)=>[e.root,{[`&.${rg.modeDesktop}`]:e.modeDesktop},{[`&.${rg.modeMobile}`]:e.modeMobile}]})(({ownerState:t})=>j({flexBasis:"33.3%",display:"flex",alignItems:"center",justifyContent:"center"},(t==null?void 0:t.wrapperVariant)==="desktop"&&{flexBasis:"25%"})),wJe=we("button",{name:"PrivatePickersYear",slot:"Button",overridesResolver:(t,e)=>[e.button,{[`&.${rg.disabled}`]:e.disabled},{[`&.${rg.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:Hc(t.palette.action.active,t.palette.action.hoverOpacity)},[`&.${rg.disabled}`]:{color:t.palette.text.secondary},[`&.${rg.selected}`]:{color:t.palette.primary.contrastText,backgroundColor:t.palette.primary.main,"&:focus, &:hover":{backgroundColor:t.palette.primary.dark}}})),N9=()=>{},SJe=M.forwardRef(function(e,n){const{autoFocus:r,className:i,children:o,disabled:a,onClick:s,onKeyDown:l,value:c,tabIndex:u,onFocus:f=N9,onBlur:d=N9}=e,h=Ae(e,xJe),p=M.useRef(null),m=Zt(p,n),g=M.useContext(Td),v=j({},e,{wrapperVariant:g}),y=bJe(v);return M.useEffect(()=>{r&&p.current.focus()},[r]),w.jsx(_Je,{className:Vr(y.root,i),ownerState:v,children:w.jsx(wJe,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 OJe(t){return We("MuiYearPicker",t)}Ve("MuiYearPicker",["root"]);const CJe=t=>{const{classes:e}=t;return Ue({root:["root"]},OJe,e)};function TJe(t,e){const n=Sr(),r=q2(),i=qe({props:t,name:e});return j({disablePast:!1,disableFuture:!1},i,{minDate:tc(n,i.minDate,r.minDate),maxDate:tc(n,i.maxDate,r.maxDate)})}const EJe=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"}),PJe=M.forwardRef(function(e,n){const r=fw(),i=Go(),o=Sr(),a=TJe(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=CJe(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(Td),I=M.useRef(null),[P,R]=M.useState(()=>E||o.getYear(r)),[T,L]=Qs({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]),U=(se,te,J="finish")=>{if(g)return;const pe=o.setYear(C,te);m(pe,J)},W=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 $=k==="desktop"?4:3,N=M.useCallback((se,te)=>{switch(se.key){case"ArrowUp":W(te-$),se.preventDefault();break;case"ArrowDown":W(te+$),se.preventDefault();break;case"ArrowLeft":W(te+(i.direction==="ltr"?-1:1)),se.preventDefault();break;case"ArrowRight":W(te+(i.direction==="ltr"?1:-1)),se.preventDefault();break}},[W,i.direction,$]),D=M.useCallback((se,te)=>{W(te)},[W]),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(SJe,{selected:J,value:te,onClick:U,onKeyDown:N,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"))})})}),MJe=typeof navigator<"u"&&/(android)/i.test(navigator.userAgent),kJe=t=>We("MuiCalendarPicker",t);Ve("MuiCalendarPicker",["root","viewTransitionContainer"]);const AJe=["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"],RJe=t=>{const{classes:e}=t;return Ue({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},kJe,e)};function IJe(t,e){const n=Sr(),r=q2(),i=qe({props:t,name:e});return j({loading:!1,disablePast:!1,disableFuture:!1,openTo:"day",views:["year","day"],reduceAnimations:MJe,renderLoading:()=>w.jsx("span",{children:"..."})},i,{minDate:tc(n,i.minDate,r.minDate),maxDate:tc(n,i.maxDate,r.maxDate)})}const DJe=we(Vz,{name:"MuiCalendarPicker",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexDirection:"column"}),LJe=we(Rue,{name:"MuiCalendarPicker",slot:"ViewTransitionContainer",overridesResolver:(t,e)=>e.viewTransitionContainer})({}),NJe=M.forwardRef(function(e,n){const r=Sr(),i=pd(),o=IJe(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,AJe),{openView:L,setOpenView:z,openNext:B}=Uz({view:x,views:b,openTo:_,onChange:d,onViewChange:s}),{calendarState:U,changeFocusedDay:W,changeMonth:$,handleChangeMonth:N,isDateDisabled:D,onMonthSwitchingAnimationEnd:A}=NZe({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)?Jx({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(),$(ye)),W(G,!0)},[W,c,u,D,k,E,d,p,$,B,r]),Y=M.useCallback((ee,ge)=>{const ye=r.startOfYear(ee),H=r.endOfYear(ee),G=D(ee)?Jx({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(),$(ye)),W(G,!0)},[W,c,u,D,k,E,d,h,B,r,$]),K=M.useCallback((ee,ge)=>d(l&&ee?r.mergeDateAndTime(ee,l):ee,ge),[r,l,d]);M.useEffect(()=>{l&&$(l)},[l]);const se=o,te=RJe(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]=Qs({name:"DayPicker",state:"focusedView",controlled:P,default:a?L:null}),le=F!==null,Q=_r(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(DJe,{ref:n,className:Vr(te.root,S),ownerState:se,children:[w.jsx(vJe,j({},T,{views:b,openView:L,currentMonth:U.currentMonth,onViewChange:z,onMonthChange:(ee,ge)=>N({newMonth:ee,direction:ge}),minDate:pe,maxDate:be,disabled:O,disablePast:u,disableFuture:c,reduceAnimations:m,labelId:ve})),w.jsx(LJe,{reduceAnimations:m,className:te.viewTransitionContainer,transKey:L,ownerState:se,children:w.jsxs("div",{children:[L==="year"&&w.jsx(PJe,j({},T,J,re,{autoFocus:a,date:l,onChange:Y,shouldDisableYear:y,hasFocus:le,onFocusedViewChange:Q("year")})),L==="month"&&w.jsx(IZe,j({},J,re,{autoFocus:a,hasFocus:le,className:S,date:l,onChange:q,shouldDisableMonth:v,onFocusedViewChange:Q("month")})),L==="day"&&w.jsx(lJe,j({},T,U,J,re,{autoFocus:a,onMonthSwitchingAnimationEnd:A,onFocusedDayChange:W,reduceAnimations:m,selectedDays:[l],onSelectedDaysChange:K,shouldDisableDate:g,hasFocus:le,onFocusedViewChange:Q("day"),gridLabelId:ve}))]})})]})}),$Je=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}},eN=(t,e,n)=>{const r=t.date(e);return e===null?"":t.isValid(r)?t.formatByString(r,n):""},uE="_",$ue="2019-11-21T22:30:00.000",Fue="2019-01-01T09:00:00.000";function FJe(t,e,n,r){if(t)return t;const o=r.formatByString(r.date(Fue),e).replace(n,uE),a=r.formatByString(r.date($ue),e).replace(n,"_");return o===a?o:""}function jJe(t,e,n,r){if(!t)return!1;const o=r.formatByString(r.date(Fue),e).replace(n,uE),a=r.formatByString(r.date($ue),e).replace(n,"_"),s=a===o&&t===a;return!s&&r.lib,s}const BJe=(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===uE?l:a+l;return r+=c.length,o===n.length-1&&s&&s!==uE?c?c+s:"":c}).join("")},zJe=({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=Sr(),m=p.getFormatHelperText(i),{shouldUseMaskedInput:g,maskToUse:v}=M.useMemo(()=>{if(n)return{shouldUseMaskedInput:!1,maskToUse:""};const T=FJe(s,i,t,p);return{shouldUseMaskedInput:jJe(T,i,t,p),maskToUse:T}},[t,n,i,s,p]),y=M.useMemo(()=>g&&v?BJe(v,t):T=>T,[t,v,g]),x=c===null?null:p.date(c),[b,_]=M.useState(x),[S,O]=M.useState(eN(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),U=c===null||p.isValid(B);let W=b===null&&B===null;if(b!==null&&B!==null){const N=p.isEqual(b,B);if(N)W=!0;else{const D=Math.abs(p.getDiff(b,B));W=D===0?N:D<1e3}}if(!L&&!z&&(!U||W))return;const $=eN(p,c,i);_(B),O($)},[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=$Je({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)},UJe=["className","components","disableOpenPicker","getOpenDialogAriaText","InputAdornmentProps","InputProps","inputRef","openPicker","OpenPickerButtonProps","renderInput"],jue=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,UJe),p=Cd(),m=a??p.openDatePickerDialogue,g=Sr(),v=zJe(h),y=(s==null?void 0:s.position)||"end",x=i.OpenPickerIcon||mue;return d(j({ref:n,inputRef:c,className:r},v,{InputProps:j({},l,{[`${y}Adornment`]:o?void 0:w.jsx(Vke,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 $9(){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 WJe=(t,e)=>{const[n,r]=M.useState($9);return Hr(()=>{const o=()=>{r($9())};return window.addEventListener("orientationchange",o),()=>{window.removeEventListener("orientationchange",o)}},[]),bue(t,["hours","minutes","seconds"])?!1:(e||n)==="landscape"},VJe=({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 GJe(t){return We("MuiCalendarOrClockPicker",t)}Ve("MuiCalendarOrClockPicker",["root","mobileKeyboardInputView"]);const HJe=["autoFocus","className","parsedValue","DateInputProps","isMobileKeyboardViewOpen","onDateChange","onViewChange","openTo","orientation","showToolbar","toggleMobileKeyboardView","ToolbarComponent","toolbarFormat","toolbarPlaceholder","toolbarTitle","views","dateRangeIcon","timeIcon","hideTabs","classes"],qJe=t=>{const{classes:e}=t;return Ue({root:["root"],mobileKeyboardInputView:["mobileKeyboardInputView"]},GJe,e)},XJe=we("div",{name:"MuiCalendarOrClockPicker",slot:"MobileKeyboardInputView",overridesResolver:(t,e)=>e.mobileKeyboardInputView})({padding:"16px 24px"}),QJe=we("div",{name:"MuiCalendarOrClockPicker",slot:"Root",overridesResolver:(t,e)=>e.root})(({ownerState:t})=>j({display:"flex",flexDirection:"column"},t.isLandscape&&{flexDirection:"row"})),YJe={fullWidth:!0},F9=t=>t==="year"||t==="month"||t==="day",j9=t=>t==="hours"||t==="minutes"||t==="seconds";function Bue(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,HJe),O=(e=S.components)==null?void 0:e.Tabs,C=WJe(y,f),E=M.useContext(Td),k=qJe(r),I=d??E!=="desktop",P=!_&&typeof window<"u"&&window.innerHeight>667,R=M.useCallback(($,N)=>{l($,E,N)},[l,E]),T=M.useCallback($=>{s&&h(),c&&c($)},[s,c,h]),{openView:L,setOpenView:z,handleChangeAndOpenNext:B}=Uz({view:void 0,views:y,openTo:u,onChange:R,onViewChange:T}),{focusedView:U,setFocusedView:W}=VJe({autoFocus:i,openView:L});return w.jsxs(QJe,{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(Vz,{children:s?w.jsx(XJe,{className:k.mobileKeyboardInputView,children:w.jsx(jue,j({},a,{ignoreInvalidInputs:!0,disableOpenPicker:!0,TextFieldProps:YJe}))}):w.jsxs(M.Fragment,{children:[F9(L)&&w.jsx(NJe,j({autoFocus:i,date:o,onViewChange:z,onChange:B,view:L,views:y.filter(F9),focusedView:U,onFocusedViewChange:W},S)),j9(L)&&w.jsx(wZe,j({},S,{autoFocus:i,date:o,view:L,views:y.filter(j9),onChange:B,onViewChange:z,showViewSwitcher:E==="desktop"}))]})})]})}const KJe=({adapter:t,value:e,props:n})=>{const{minTime:r,maxTime:i,minutesStep:o,shouldDisableTime:a,disableIgnoringDatePartForTimeValidation:s}=n,l=t.utils.date(e),c=Pue(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}},ZJe=["minDate","maxDate","disableFuture","shouldDisableDate","disablePast"],JJe=({props:t,value:e,adapter:n})=>{const{minDate:r,maxDate:i,disableFuture:o,shouldDisableDate:a,disablePast:s}=t,l=Ae(t,ZJe),c=kue({adapter:n,value:e,props:{minDate:r,maxDate:i,disableFuture:o,shouldDisableDate:a,disablePast:s}});return c!==null?c:KJe({adapter:n,value:e,props:l})},eet=(t,e)=>t===e;function zue(t){return DZe(t,JJe,eet)}const tet=({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}},Uue=(t,e)=>{const{onAccept:n,onChange:r,value:i,closeOnSelect:o}=t,a=Sr(),{isOpen:s,setIsOpen:l}=tet(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 net(t){return We("MuiDateTimePickerTabs",t)}Ve("MuiDateTimePickerTabs",["root"]);const ret=t=>["day","month","year"].includes(t)?"date":"time",iet=t=>t==="date"?"day":"hours",oet=t=>{const{classes:e}=t;return Ue({root:["root"]},net,e)},aet=we(A5,{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}`,[`& .${kC.indicator}`]:{bottom:"auto",top:0}})),Wue=function(e){const n=qe({props:e,name:"MuiDateTimePickerTabs"}),{dateRangeIcon:r=w.jsx(aKe,{}),onChange:i,timeIcon:o=w.jsx(lKe,{}),view:a}=n,s=Cd(),l=M.useContext(Td),c=j({},n,{wrapperVariant:l}),u=oet(c),f=(d,h)=>{i(iet(h))};return w.jsxs(aet,{ownerState:c,variant:"fullWidth",value:ret(a),onChange:f,className:u.root,children:[w.jsx($b,{value:"date","aria-label":s.dateTableLabel,icon:w.jsx(M.Fragment,{children:r})}),w.jsx($b,{value:"time","aria-label":s.timeTableLabel,icon:w.jsx(M.Fragment,{children:o})})]})},set=["onChange","PaperProps","PopperProps","ToolbarComponent","TransitionComponent","value","components","componentsProps","hideTabs"],cet=M.forwardRef(function(e,n){const r=fue(e,"MuiDesktopDateTimePicker"),i=zue(r)!==null,{pickerProps:o,inputProps:a,wrapperProps:s}=Uue(r,due),{PaperProps:l,PopperProps:c,ToolbarComponent:u=yue,TransitionComponent:f,components:d,componentsProps:h,hideTabs:p=!0}=r,m=Ae(r,set),g=M.useMemo(()=>j({Tabs:Wue},d),[d]),v=j({},a,m,{components:g,componentsProps:h,ref:n,validationError:i});return w.jsx(IKe,j({},s,{DateInputProps:v,KeyboardDateInputComponent:jue,PopperProps:c,PaperProps:l,TransitionComponent:f,components:g,componentsProps:h,children:w.jsx(Bue,j({},o,{autoFocus:!0,toolbarTitle:r.label||r.toolbarTitle,ToolbarComponent:u,DateInputProps:v,components:g,componentsProps:h,hideTabs:p},m))}))}),uet=we(rl)({[`& .${zx.container}`]:{outline:0},[`& .${zx.paper}`]:{outline:0,minWidth:Mue}}),fet=we(Ys)({"&:first-of-type":{padding:0}}),det=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:xue;return w.jsxs(uet,j({open:c,onClose:a},r,{children:[w.jsx(fet,{children:n}),w.jsx(d,j({onAccept:i,onClear:o,onCancel:s,onSetToday:l,actions:["cancel","accept"]},f==null?void 0:f.actionBar))]}))},het=["children","DateInputProps","DialogProps","onAccept","onClear","onDismiss","onCancel","onSetToday","open","PureDateInputComponent","components","componentsProps"];function pet(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,het);return w.jsxs(Td.Provider,{value:"mobile",children:[w.jsx(u,j({components:f},h,n)),w.jsx(det,{DialogProps:r,onAccept:i,onClear:o,onDismiss:a,onCancel:s,onSetToday:l,open:c,components:f,componentsProps:d,children:e})]})}const met=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=Cd(),g=i??m.openDatePickerDialogue,v=Sr(),y=M.useMemo(()=>j({},a,{readOnly:!0}),[a]),x=eN(v,u,o),b=_r(_=>{_.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:_ue(c)})},d))}),get=["ToolbarComponent","value","onChange","components","componentsProps","hideTabs"],vet=M.forwardRef(function(e,n){const r=fue(e,"MuiMobileDateTimePicker"),i=zue(r)!==null,{pickerProps:o,inputProps:a,wrapperProps:s}=Uue(r,due),{ToolbarComponent:l=yue,components:c,componentsProps:u,hideTabs:f=!1}=r,d=Ae(r,get),h=M.useMemo(()=>j({Tabs:Wue},c),[c]),p=j({},a,d,{components:h,componentsProps:u,ref:n,validationError:i});return w.jsx(pet,j({},d,s,{DateInputProps:p,PureDateInputComponent:met,components:h,componentsProps:u,children:w.jsx(Bue,j({},o,{autoFocus:!0,toolbarTitle:r.label||r.toolbarTitle,ToolbarComponent:l,DateInputProps:p,components:h,componentsProps:u,hideTabs:f},d))}))}),yet=["desktopModeMediaQuery","DialogProps","PopperProps","TransitionComponent"],xet=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,yet);return xSe(i,{defaultMatches:!0})?w.jsx(cet,j({ref:n,PopperProps:a,TransitionComponent:s},l)):w.jsx(vet,j({ref:n,DialogProps:o},l))}),bet=t=>({dateTimePicker:{marginTop:t.spacing(2.5)}}),_et=({classes:t,hasTimeDimension:e,selectedTime:n,selectedTimeRange:r,selectTime:i})=>{const o=d=>{i(d!==null?t6e(d):null)},a=w.jsx(ny,{shrink:!0,htmlFor:"time-select",children:`${fe.get("Time")} (UTC)`}),l=typeof n=="number"?rR(n):null;let c,u;Array.isArray(r)&&(c=rR(r[0]),u=rR(r[1]));const f=w.jsx(VYe,{dateAdapter:QYe,children:w.jsx(xet,{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(cr,{...d,variant:"standard",size:"small"})})});return w.jsx(Kb,{label:a,control:f})},wet=zYe(bet)(_et),Oet=t=>({locale:t.controlState.locale,hasTimeDimension:!!wy(t),selectedTime:t.controlState.selectedTime,selectedTimeRange:t.controlState.selectedTimeRange}),Cet={selectTime:k2},Tet=Jt(Oet,Cet)(wet),B9=5,Eet={box:t=>({marginTop:t.spacing(1),marginLeft:t.spacing(B9),marginRight:t.spacing(B9),minWidth:200}),label:{color:"grey",fontSize:"1em"}};function Pet({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*Rae.years,Date.now()]);const c=[{value:r[0],label:Qb(r[0])},{value:r[1],label:Qb(r[1])}];function u(f){return gy(f)}return w.jsx(Ke,{sx:Eet.box,children:w.jsx(_t,{arrow:!0,title:fe.get("Select time in dataset"),children:w.jsx(ry,{disabled:!l,min:r[0],max:r[1],value:i||0,valueLabelDisplay:"off",valueLabelFormat:u,marks:c,onChange:a,onChangeCommitted:s,size:"small"})})})}const Met=t=>({locale:t.controlState.locale,hasTimeDimension:!!wy(t),selectedTime:t.controlState.selectedTime,selectedTimeRange:t.controlState.selectedTimeRange}),ket={selectTime:k2,selectTimeRange:Sle},Aet=Jt(Met,ket)(Pet);var Gz={},Ret=ft;Object.defineProperty(Gz,"__esModule",{value:!0});var Vue=Gz.default=void 0,Iet=Ret(pt()),Det=w;Vue=Gz.default=(0,Iet.default)((0,Det.jsx)("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft");var Hz={},Let=ft;Object.defineProperty(Hz,"__esModule",{value:!0});var Gue=Hz.default=void 0,Net=Let(pt()),$et=w;Gue=Hz.default=(0,Net.default)((0,$et.jsx)("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight");var qz={},Fet=ft;Object.defineProperty(qz,"__esModule",{value:!0});var Hue=qz.default=void 0,jet=Fet(pt()),Bet=w;Hue=qz.default=(0,jet.default)((0,Bet.jsx)("path",{d:"M18.41 16.59 13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),"FirstPage");var Xz={},zet=ft;Object.defineProperty(Xz,"__esModule",{value:!0});var que=Xz.default=void 0,Uet=zet(pt()),Wet=w;que=Xz.default=(0,Uet.default)((0,Wet.jsx)("path",{d:"M5.59 7.41 10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),"LastPage");var Qz={},Vet=ft;Object.defineProperty(Qz,"__esModule",{value:!0});var Xue=Qz.default=void 0,Get=Vet(pt()),Het=w;Xue=Qz.default=(0,Get.default)((0,Het.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 Yz={},qet=ft;Object.defineProperty(Yz,"__esModule",{value:!0});var Que=Yz.default=void 0,Xet=qet(pt()),Qet=w;Que=Yz.default=(0,Xet.default)((0,Qet.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 um={formControl:t=>({marginTop:t.spacing(2.5),marginLeft:t.spacing(1),marginRight:t.spacing(1)}),iconButton:{padding:"2px"}};function Yet({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(Xue,{}):w.jsx(Que,{}),x=w.jsx(Ot,{disabled:!v,onClick:c,size:"small",sx:um.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:um.iconButton,children:w.jsx(Hue,{})}),_=w.jsx(Ot,{disabled:!v||t,onClick:f,size:"small",sx:um.iconButton,children:w.jsx(Vue,{})}),S=w.jsx(Ot,{disabled:!v||t,onClick:u,size:"small",sx:um.iconButton,children:w.jsx(Gue,{})}),O=w.jsx(Ot,{disabled:!v||t,onClick:h,size:"small",sx:um.iconButton,children:w.jsx(que,{})});return w.jsx(ty,{sx:um.formControl,variant:"standard",children:w.jsxs(Ke,{children:[b,_,x,S,O]})})}const Ket=t=>({locale:t.controlState.locale,selectedTime:t.controlState.selectedTime,selectedTimeRange:t.controlState.selectedTimeRange,timeAnimationActive:t.controlState.timeAnimationActive,timeAnimationInterval:t.controlState.timeAnimationInterval}),Zet={selectTime:k2,incSelectedTime:I8e,updateTimeAnimation:L8e},Jet=Jt(Ket,Zet)(Yet);var Kz={},ett=ft;Object.defineProperty(Kz,"__esModule",{value:!0});var Yue=Kz.default=void 0,ttt=ett(pt()),ntt=w;Yue=Kz.default=(0,ttt.default)((0,ntt.jsx)("path",{d:"M16 20H2V4h14zm2-12h4V4h-4zm0 12h4v-4h-4zm0-6h4v-4h-4z"}),"ViewSidebar");const rtt=Li(ty)(({theme:t})=>({marginTop:t.spacing(2),marginRight:t.spacing(.5),marginLeft:"auto"}));function itt({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:ko.toggleButton,children:w.jsx(_t,{arrow:!0,title:fe.get("Show or hide sidebar"),children:w.jsx(Yue,{})})});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(W5,{})})}),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(H5,{})})}),u=w.jsx(Ot,{onClick:()=>r("settings"),size:"small",children:w.jsx(_t,{arrow:!0,title:fe.get("Settings"),children:w.jsx(z5,{})})})),w.jsx(rtt,{variant:"standard",children:w.jsxs(Ke,{children:[l,c,u,s]})})}const ott=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}),att={setSidebarOpen:az,openDialog:Lp,updateResources:zse},stt=Jt(ott,att)(itt),ltt=t=>({locale:t.controlState.locale,show:t.dataState.datasets.length>0}),ctt={},utt=({show:t})=>t?w.jsxs(wqe,{children:[w.jsx(kqe,{}),w.jsx(Yqe,{}),w.jsx(sXe,{}),w.jsx(gXe,{}),w.jsx(LXe,{}),w.jsx(Tet,{}),w.jsx(Jet,{}),w.jsx(Aet,{}),w.jsx(stt,{})]}):null,ftt=Jt(ltt,ctt)(utt);function Kue(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 z9={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 dtt({dir:t,onChange:e}){const r=Kue(([i,o])=>{e(i)});return w.jsx(Ke,{sx:t==="hor"?z9.hor:z9.ver,onMouseDown:r})}const zS={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 htt({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"?zS.childHor:zS.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"?zS.hor:zS.ver},children:[w.jsx("div",{ref:s,id:"SplitPane-Child-1",style:{...l,...o,...c},children:r[0]}),w.jsx(dtt,{dir:t,onChange:u}),w.jsx("div",{id:"SplitPane-Child-2",style:{...l,...a},children:r[1]})]})}const ptt=({placeGroup:t,mapProjection:e,visible:n})=>{const r=M.useRef(new Y1);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 Ip().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";YB(d,h,I5(p),m),i.addFeature(d)})}},[t,e]),w.jsx(v2,{id:t.id,opacity:t.id===Ws?1:.8,visible:n,zIndex:501,source:r.current})};class mtt extends my{addMapObject(e){const n=new j5e(this.getOptions());return e.addControl(n),n}updateMapObject(e,n,r){return n.setProperties(this.getOptions()),n}removeMapObject(e,n){e.removeControl(n)}}class MR extends my{addMapObject(e){const n=new mBe(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 gtt extends my{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 Uc({...this.props,center:a2(i.getCenter()||[0,0],r,n),minZoom:i.getMinZoom(),zoom:i.getZoom()});e.getLayers().forEach(a=>{a instanceof h2&&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 US(t,e){const n=t.getLayers();for(let r=0;r{if(R){const N=C||null;if(N!==L&&Ga[kR]){const A=Ga[kR].getSource();if(A.clear(),N){const q=_tt(R,N);if(q){const Y=q.clone();Y.setId("select-"+q.getId()),Y.setStyle(void 0),A.addFeature(Y)}}z(N)}}},[R,C,L]),M.useEffect(()=>{R&&R.getLayers().forEach(N=>{N instanceof oae?N.getSource().changed():N.changed()})},[R,k]),M.useEffect(()=>{if(R===null||!En(I))return;const N=J=>{W9(R,J,I,0)},D=J=>{W9(R,J,I,1)},A=J=>{J.context.restore()},q=US(R,"rgb2"),Y=US(R,"variable2"),K=US(R,"rgb"),se=US(R,"variable"),te=[[q,N],[Y,N],[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=N=>{if(n==="Select"){const D=N.map;let A=null;const q=D.getFeaturesAtPixel(N.pixel);if(q){for(const Y of q)if(typeof Y.getId=="function"){A=Y.getId()+"";break}}O&&O(A,E,!1)}},U=N=>{var D;if(R!==null&&y&&n!=="Select"){const A=N.feature;let q=A.getGeometry();if(!q)return;const Y=Js(cy+n.toLowerCase()+"-"),K=R.getView().getProjection();if(q instanceof IB){const re=o$e(q);A.setGeometry(re)}q=A.clone().getGeometry().transform(K,py);const se=new Ip().writeGeometryObject(q);A.setId(Y);let te=0;if(Ga[Ws]){const re=Ga[Ws],ve=(D=re==null?void 0:re.getSource())==null?void 0:D.getFeatures();ve&&(te=ve.length)}const J=wtt(b,n),pe=tp(te),be=die(pe,t.palette.mode);YB(A,be,I5()),y(v,Y,{label:J,color:pe},se,!0)}return!0};function W(N){P&&P(N),T(N)}const $=N=>{x&&N.forEach(D=>{const A=new FileReader;A.onloadend=()=>{typeof A.result=="string"&&x(A.result)},A.readAsText(D,"UTF-8")})};return w.jsx(Oie,{children:w.jsxs(ize,{id:e,onClick:N=>B(N),onMapRef:W,mapObjects:Ga,isStale:!0,onDropFiles:$,children:[w.jsx(gtt,{id:"view",projection:r}),w.jsxs(iae,{children:[i,o,a,s,l,f,c,w.jsx(v2,{id:kR,opacity:.7,zIndex:500,style:xtt,source:vtt}),w.jsx(w.Fragment,{children:b.map(N=>w.jsx(ptt,{placeGroup:N,mapProjection:r,visible:S&&_[N.id]},N.id))})]}),u,w.jsx(MR,{id:"drawPoint",layerId:Ws,active:n==="Point",type:"Point",wrapX:!0,stopClick:!0,onDrawEnd:U}),w.jsx(MR,{id:"drawPolygon",layerId:Ws,active:n==="Polygon",type:"Polygon",wrapX:!0,stopClick:!0,onDrawEnd:U}),w.jsx(MR,{id:"drawCircle",layerId:Ws,active:n==="Circle",type:"Circle",wrapX:!0,stopClick:!0,onDrawEnd:U}),d,h,m,g,p,w.jsx(mtt,{bar:!1})]})})}function _tt(t,e){var n;for(const r of t.getLayers().getArray())if(r instanceof h2){const o=(n=r.getSource())==null?void 0:n.getFeatureById(e);if(o)return o}return null}function wtt(t,e){const n=fe.get(e),r=t.find(i=>i.id===Ws);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 W9(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=Lu(e,[0,0]),l=Lu(e,[n,0]),c=Lu(e,[0,a]),u=Lu(e,[n,a])):(s=Lu(e,[n,0]),l=Lu(e,[o,0]),c=Lu(e,[n,a]),u=Lu(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 WS=1,e_=.2,Py=240,Jue=20,VS={container:{width:Py},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 Stt({categories:t,onOpenColorBarEditor:e}){return!t||t.length===0?null:w.jsx(Ke,{sx:VS.container,children:t.map((n,r)=>w.jsxs(Ke,{onClick:e,sx:VS.itemContainer,children:[w.jsx(Ke,{sx:VS.itemColorBox,style:{backgroundColor:n.color}}),w.jsx(Ke,{component:"span",sx:VS.itemLabelBox,children:`${n.label||`Category ${r+1}`} (${n.value})`})]},r))})}const V9={nominal:{cursor:"pointer"},error:{cursor:"pointer",border:"0.5px solid red"}};function Ott({colorBar:t,opacity:e,width:n,height:r,onClick:i}){const o=M.useRef(null);M.useEffect(()=>{const c=o.current;c!==null&&aWe(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||Py,height:r||Jue+4,onClick:i,style:s?V9.nominal:V9.error})})}function Ctt(t,e,n=5,r=!1,i=!1){return tN(Ett(t,e,n,r),i)}function tN(t,e=!1){return t.map(n=>rd(n,void 0,e))}function rd(t,e,n){if(e===void 0&&(e=n?2:Ttt(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 Ttt(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 Ett(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;lCtt(t,e,n,r),[t,e,n,r]);return w.jsx(Ke,{sx:Ptt.container,onClick:i,children:o.map((a,s)=>w.jsx("span",{children:a},s))})}var Zz={},ktt=ft;Object.defineProperty(Zz,"__esModule",{value:!0});var efe=Zz.default=void 0,Att=ktt(pt()),Rtt=w;efe=Zz.default=(0,Att.default)((0,Rtt.jsx)("path",{d:"M8 19h3v3h2v-3h3l-4-4zm8-15h-3V1h-2v3H8l4 4zM4 9v2h16V9zm0 3h16v2H4z"}),"Compress");const G9=t=>t,Itt=t=>Math.pow(10,t),Dtt=Math.log10,H9=(t,e)=>typeof t=="number"?e(t):t.map(e);class Ltt{constructor(e){Yt(this,"_fn");Yt(this,"_invFn");e?(this._fn=Dtt,this._invFn=Itt):(this._fn=G9,this._invFn=G9)}scale(e){return H9(e,this._fn)}scaleInv(e){return H9(e,this._invFn)}}function Ntt({variableColorBarName:t,variableColorBarMinMax:e,variableColorBarNorm:n,variableOpacity:r,updateVariableColorBar:i,originalColorBarMinMax:o}){const a=M.useMemo(()=>new Ltt(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=tN(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(ry,{min:b,max:_,value:s,marks:C,step:S,valueLabelFormat:E=>rd(a.scaleInv(E)),onChange:c,onChangeCommitted:u,valueLabelDisplay:"auto",size:"small"})}const AR=5,ju={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(AR),marginRight:t.spacing(AR),minWidth:320,width:`calc(100% - ${t.spacing(2*(AR+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 $tt({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(q9(n)),[d,h]=M.useState([!1,!1]);M.useEffect(()=>{f(q9(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:ju.container,children:[w.jsxs(Ke,{sx:ju.header,children:[w.jsx(At,{sx:ju.title,children:fe.get("Value Range")}),w.jsx("span",{style:{flexGrow:1}}),t.colorRecords&&w.jsx(Ya,{sx:{marginRight:1},icon:w.jsx(efe,{}),onClick:g,tooltipText:fe.get("Set min/max from color mapping values")}),w.jsx(Og,{sx:ju.logLabel,control:w.jsx(_t,{title:fe.get("Logarithmic scaling"),children:w.jsx(aie,{checked:r==="log",onChange:v,size:"small"})}),label:w.jsx(At,{variant:"body2",children:fe.get("Log-scaled")}),labelPlacement:"start"})]}),w.jsx(Ke,{sx:ju.sliderBox,children:w.jsx(Ntt,{variableColorBarName:e,variableColorBarMinMax:n,variableColorBarNorm:r,updateVariableColorBar:o,originalColorBarMinMax:l,variableOpacity:i})}),w.jsxs(Ke,{component:"form",sx:ju.minMaxBox,children:[w.jsx(cr,{sx:ju.minTextField,label:"Minimum",variant:"filled",size:"small",value:u[0],error:d[0],onChange:y=>p(y)}),w.jsx(cr,{sx:ju.maxTextField,label:"Maximum",variant:"filled",size:"small",value:u[1],error:d[1],onChange:y=>m(y)})]})]})}function q9(t){return[t[0]+"",t[1]+""]}function Ftt({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(Ott,{colorBar:t,opacity:i,onClick:a}),w.jsx(Mtt,{minValue:n[0],maxValue:n[1],numTicks:5,logScaled:r==="log",onClick:c}),w.jsx(Ep,{anchorEl:s,open:!!s,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"center"},children:w.jsx($tt,{variableColorBar:t,variableColorBarName:e,variableColorBarMinMax:n,variableColorBarNorm:r,variableOpacity:i,updateVariableColorBar:o})})]})}var Jz={},jtt=ft;Object.defineProperty(Jz,"__esModule",{value:!0});var tfe=Jz.default=void 0,Btt=jtt(pt()),ztt=w;tfe=Jz.default=(0,Btt.default)((0,ztt.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 e4={},Utt=ft;Object.defineProperty(e4,"__esModule",{value:!0});var nfe=e4.default=void 0,Wtt=Utt(pt()),Vtt=w;nfe=e4.default=(0,Wtt.default)((0,Vtt.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 k0={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 Gtt({variableColorBarName:t,variableColorBarMinMax:e,variableColorBarNorm:n,variableColorBar:r,variableOpacity:i,updateVariableColorBar:o}){const a=()=>{const c=!r.isAlpha;t=rE({...r,isAlpha:c}),o(t,e,n,i)},s=()=>{const c=!r.isReversed;t=rE({...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:k0.container,children:w.jsxs(Ke,{sx:k0.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(nfe,{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(tfe,{fontSize:"inherit"})})})]})}),w.jsxs(Ke,{component:"div",sx:k0.opacityContainer,children:[w.jsx(Ke,{component:"span",fontSize:"small",sx:k0.opacityLabel,children:fe.get("Opacity")}),w.jsx(ry,{min:0,max:1,value:i,step:.01,sx:k0.opacitySlider,onChange:l,size:"small"})]})]})}const Htt={colorBarGroupTitle:t=>({marginTop:t.spacing(2*e_),fontSize:"small",color:t.palette.text.secondary})};function rfe({title:t,description:e}){return w.jsx(_t,{arrow:!0,title:e,placement:"left",children:w.jsx(Ke,{sx:Htt.colorBarGroupTitle,children:t})})}const X9=t=>({marginTop:t.spacing(e_),height:20,borderWidth:1,borderStyle:"solid",cursor:"pointer"}),Q9={colorBarItem:t=>({...X9(t),borderColor:t.palette.mode==="dark"?"lightgray":"darkgray"}),colorBarItemSelected:t=>({...X9(t),borderColor:"blue"})};function t4({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||Py,sx:e?Q9.colorBarItemSelected:Q9.colorBarItem,children:o})}function qtt({colorBarGroup:t,selectedColorBarName:e,onSelectColorBar:n,images:r}){return w.jsxs(w.Fragment,{children:[w.jsx(rfe,{title:t.title,description:t.description}),t.names.map(i=>w.jsx(t4,{title:i,imageData:r[i],selected:i===e,onSelect:()=>n(i)},i))]})}var n4={},Xtt=ft;Object.defineProperty(n4,"__esModule",{value:!0});var dw=n4.default=void 0,Qtt=Xtt(pt()),Ytt=w;dw=n4.default=(0,Qtt.default)((0,Ytt.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 ife(){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 r4={},Ktt=ft;Object.defineProperty(r4,"__esModule",{value:!0});var ofe=r4.default=void 0,Ztt=Ktt(pt()),Jtt=w;ofe=r4.default=(0,Ztt.default)((0,Jtt.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 i4={},ent=ft;Object.defineProperty(i4,"__esModule",{value:!0});var afe=i4.default=void 0,tnt=ent(pt()),nnt=w;afe=i4.default=(0,tnt.default)((0,nnt.jsx)("path",{d:"M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"}),"Done");function rnt({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(Ep,{anchorEl:t,open:n,onClose:r,children:w.jsx(Ho,{sx:{width:"32em",overflowY:"auto",fontSize:"smaller",paddingLeft:2,paddingRight:2},children:w.jsx(G2,{children:e,components:i,linkTarget:"_blank"})})})}function sfe({size:t,helpUrl:e}){const[n,r]=M.useState(null),i=M.useRef(null),o=Lce(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(j5,{fontSize:"inherit"})}),w.jsx(rnt,{anchorEl:n,open:!!n,onClose:s,markdownText:o})]})}const Y9={container:{display:"flex",justifyContent:"space-between",gap:.2},doneCancel:{display:"flex",gap:.2}};function hw({onDone:t,onCancel:e,doneDisabled:n,cancelDisabled:r,size:i,helpUrl:o}){return w.jsxs(Ke,{sx:Y9.container,children:[w.jsx(Ke,{children:o&&w.jsx(sfe,{size:i,helpUrl:o})}),w.jsxs(Ke,{sx:Y9.doneCancel,children:[w.jsx(Ot,{onClick:t,color:"primary",disabled:n,size:i,children:w.jsx(afe,{fontSize:"inherit"})}),w.jsx(Ot,{onClick:e,color:"primary",disabled:r,size:i,children:w.jsx(ofe,{fontSize:"inherit"})})]})]})}const RR={radioGroup:{marginLeft:1},radio:{padding:"4px"},label:{fontSize:"small"}},int=[["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 ont({colorMapType:t,setColorMapType:e}){return w.jsx(E5,{row:!0,value:t,onChange:(n,r)=>{e(r)},sx:RR.radioGroup,children:int.map(([n,r,i])=>w.jsx(_t,{arrow:!0,title:fe.get(i),children:w.jsx(Og,{value:n,control:w.jsx(Vx,{size:"small",sx:RR.radio}),label:w.jsx(Ke,{component:"span",sx:RR.label,children:fe.get(r)})})},n))})}function ant({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(t4,{imageData:t.imageData,title:t.errorMessage,selected:n,onSelect:r}),w.jsx(ont,{colorMapType:t.type,setColorMapType:s}),w.jsx(cr,{label:"Color mapping",placeholder:hoe,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(hw,{onDone:i,onCancel:o,doneDisabled:!!t.errorMessage,size:"small",helpUrl:fe.get("docs/color-mappings.en.md")})]})}var o4={},snt=ft;Object.defineProperty(o4,"__esModule",{value:!0});var lfe=o4.default=void 0,lnt=snt(pt()),cnt=w;lfe=o4.default=(0,lnt.default)((0,cnt.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 unt={container:{display:"flex",alignItems:"center",width:Py,height:Jue,gap:e_,marginTop:e_}};function fnt({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:unt.container,children:[w.jsx(t4,{imageData:t,selected:n,onSelect:o,width:Py-20,title:e}),w.jsx(Ot,{size:"small",onClick:c,children:w.jsx(lfe,{fontSize:"inherit"})})]}),w.jsx(Ep,{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(Fp,{fontSize:"inherit"})}),w.jsx(Ot,{onClick:d,size:"small",disabled:a,children:w.jsx(lw,{fontSize:"inherit"})})]})})]})}const dnt={container:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:1}};function hnt({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]=ife(),h=M.useMemo(()=>r.findIndex(x=>x.id===c.colorBarId),[r,c.colorBarId]),p=()=>{d(()=>s(r));const x=Js("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:dnt.container,children:[w.jsx(rfe,{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(dw,{fontSize:"inherit"})})]}),r.map(x=>x.id===c.colorBarId&&h>=0?w.jsx(ant,{userColorBar:x,updateUserColorBar:a,selected:x.id===e,onSelect:()=>n(x.id),onDone:v,onCancel:y},x.id):w.jsx(fnt,{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 pnt({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=rE({...r,baseName:p}),o(t,e,n,i)};return w.jsx(w.Fragment,{children:a.groups.map(p=>p.title===doe?w.jsx(hnt,{colorBarGroup:p,selectedColorBarName:r.baseName,onSelectColorBar:h,userColorBars:s,addUserColorBar:l,removeUserColorBar:c,updateUserColorBar:u,updateUserColorBars:f,storeSettings:d},p.title):w.jsx(qtt,{colorBarGroup:p,selectedColorBarName:r.baseName,onSelectColorBar:h,images:a.images},p.title))})}const mnt={colorBarBox:t=>({marginTop:t.spacing(WS-2*e_),marginLeft:t.spacing(WS),marginRight:t.spacing(WS),marginBottom:t.spacing(WS)})};function gnt(t){const{colorBars:e,userColorBars:n,addUserColorBar:r,removeUserColorBar:i,updateUserColorBar:o,updateUserColorBars:a,...s}=t;return w.jsxs(Ke,{sx:mnt.colorBarBox,children:[w.jsx(Gtt,{...s}),w.jsx(pnt,{...s,colorBars:e,userColorBars:n,addUserColorBar:r,removeUserColorBar:i,updateUserColorBar:o,updateUserColorBars:a})]})}const K9={container:t=>({position:"absolute",zIndex:1e3,top:10,borderRadius:"5px",borderWidth:"1px",borderStyle:"solid",borderColor:"#00000020",backgroundColor:"#FFFFFFAA",color:"black",maxWidth:`${Py+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 cfe(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:K9.container,style:o,ref:a,children:[w.jsx(At,{sx:K9.title,children:f}),i.type==="categorical"?w.jsx(Stt,{categories:i.colorRecords,onOpenColorBarEditor:c,...t}):w.jsx(Ftt,{onOpenColorBarEditor:c,...t}),w.jsx(Ep,{anchorEl:s,open:!!s,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:w.jsx(gnt,{...t})})]})}const vnt=t=>({variableName:yy(t),variableTitle:BWe(t),variableUnits:UWe(t),variableColorBarName:O2(t),variableColorBarMinMax:ose(t),variableColorBarNorm:lse(t),variableColorBar:HB(t),variableOpacity:pse(t),userColorBars:Dp(t),colorBars:T2(t),style:{right:10}}),ynt={updateVariableColorBar:h8e,addUserColorBar:Vle,removeUserColorBar:qle,updateUserColorBar:Xle,updateUserColorBars:Kle,storeSettings:Wle},xnt=Jt(vnt,ynt)(cfe),bnt=t=>{const e=t.controlState.variableSplitPos;return{variableName:e?Kae(t):null,variableTitle:zWe(t),variableUnits:WWe(t),variableColorBarName:C2(t),variableColorBarMinMax:ase(t),variableColorBarNorm:cse(t),variableColorBar:fse(t),variableOpacity:mse(t),userColorBars:Dp(t),colorBars:T2(t),style:{left:e?e-280:0}}},_nt={updateVariableColorBar:p8e,addUserColorBar:Vle,removeUserColorBar:qle,updateUserColorBar:Xle,updateUserColorBars:Kle,storeSettings:Wle},wnt=Jt(bnt,_nt)(cfe),Snt={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 Ont({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=Kue(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:Snt.splitter,style:{left:En(e)?e:"50%"},onMouseDown:o})}const Cnt=t=>({hidden:!t.controlState.variableCompareMode,position:t.controlState.variableSplitPos}),Tnt={onPositionChange:A8e},Ent=Jt(Cnt,Tnt)(Ont);function Pnt(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 z$e(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],_=a2(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=Ga.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 vc={container:{display:"grid",gridTemplateColumns:"auto minmax(60px, auto)",gap:0,padding:1,fontSize:"small"},labelItem:{paddingRight:1},valueItem:{textAlign:"right",fontFamily:"monospace"}};function Mnt({location:t,payload:e,payload2:n}){return w.jsxs(Ke,{sx:vc.container,children:[w.jsx(Ke,{sx:vc.labelItem,children:"Longitude"}),w.jsx(Ke,{sx:vc.valueItem,children:rd(t.lon,4)}),w.jsx(Ke,{sx:vc.labelItem,children:"Latitude"}),w.jsx(Ke,{sx:vc.valueItem,children:rd(t.lat,4)}),w.jsx(Ke,{sx:vc.labelItem,children:Z9(e)}),w.jsx(Ke,{sx:vc.valueItem,children:J9(e)}),n&&w.jsx(Ke,{sx:vc.labelItem,children:Z9(n)}),n&&w.jsx(Ke,{sx:vc.valueItem,children:J9(n)})]})}function Z9(t){const e=t.variable;return e.title||e.name}function J9(t){const e=t.result;return e.error?`${e.error}`:e.fetching?"...":En(e.value)?rd(e.value,4):"---"}const knt={container:{position:"absolute",zIndex:1e3,backgroundColor:"#000000A0",color:"#fff",border:"1px solid #FFFFFF50",borderRadius:"4px",transform:"translateX(3%)",pointerEvents:"none"}};function Ant({enabled:t,serverUrl:e,dataset1:n,variable1:r,dataset2:i,variable2:o,time:a}){const s=Pnt(t,e,n,r,i,o,a);if(!s)return null;const{pixelX:l,pixelY:c}=s.location;return w.jsx(Ke,{sx:{...knt.container,left:l,top:c},children:w.jsx(Mnt,{...s})})}const Rnt=t=>({enabled:t.controlState.mapPointInfoBoxEnabled,serverUrl:pi(t).url,dataset1:qr(t),variable1:vo(t),dataset2:Sd(t),variable2:Su(t),time:Sy(t)}),Int={},Dnt=Jt(Rnt,Int)(Ant);var a4={},Lnt=ft;Object.defineProperty(a4,"__esModule",{value:!0});var ufe=a4.default=void 0,Nnt=Lnt(pt()),$nt=w;ufe=a4.default=(0,Nnt.default)((0,$nt.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 s4={},Fnt=ft;Object.defineProperty(s4,"__esModule",{value:!0});var l4=s4.default=void 0,jnt=Fnt(pt()),Bnt=w;l4=s4.default=(0,jnt.default)((0,Bnt.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 c4={},znt=ft;Object.defineProperty(c4,"__esModule",{value:!0});var ffe=c4.default=void 0,Unt=znt(pt()),Wnt=w;ffe=c4.default=(0,Unt.default)((0,Wnt.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 e7={position:"absolute",display:"flex",flexDirection:"column",zIndex:1e3};function Vnt({style:t,sx:e,children:n}){return w.jsx(Ke,{className:"ol-unselectable ol-control",sx:e,style:t?{...e7,...t}:e7,children:n})}const dfe={width:"1.375em",height:"1.375em"},Gnt={...dfe,backgroundColor:"rgba(0,80,180,0.9)"},Hnt={tooltip:{sx:{backgroundColor:"#4A4A4A",border:"1px solid white",borderRadius:0}}};function IR({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:Hnt,children:t})),w.jsx(Ot,{onClick:o,style:r?Gnt:dfe,children:t})}const qnt={left:"0.5em",top:65};function Xnt({layerMenuOpen:t,setLayerMenuOpen:e,variableCompareMode:n,setVariableCompareMode:r,mapPointInfoBoxEnabled:i,setMapPointInfoBoxEnabled:o}){return w.jsxs(Vnt,{style:qnt,children:[w.jsx(IR,{icon:w.jsx(l4,{fontSize:"small"}),tooltipTitle:fe.get("Show or hide layers panel"),selected:t,onSelect:(a,s)=>void e(s)}),w.jsx(IR,{icon:w.jsx(ufe,{fontSize:"small"}),tooltipTitle:fe.get("Turn layer split mode on or off"),selected:n,onSelect:(a,s)=>void r(s)}),w.jsx(IR,{icon:w.jsx(ffe,{fontSize:"small"}),tooltipTitle:fe.get("Turn info box on or off"),selected:i,onSelect:(a,s)=>void o(s)})]})}const Qnt=t=>({layerMenuOpen:t.controlState.layerMenuOpen,variableCompareMode:t.controlState.variableCompareMode,mapPointInfoBoxEnabled:t.controlState.mapPointInfoBoxEnabled}),Ynt={setLayerMenuOpen:Ple,setVariableCompareMode:k8e,setMapPointInfoBoxEnabled:M8e},Knt=Jt(Qnt,Ynt)(Xnt),Znt=(t,e)=>({mapId:"map",locale:t.controlState.locale,variableLayer:hVe(t),variable2Layer:pVe(t),rgbLayer:mVe(t),rgb2Layer:gVe(t),datasetBoundaryLayer:dVe(t),placeGroupLayers:bVe(t),colorBarLegend:w.jsx(xnt,{}),colorBarLegend2:w.jsx(wnt,{}),mapSplitter:w.jsx(Ent,{}),mapPointInfoBox:w.jsx(Dnt,{}),mapControlActions:w.jsx(Knt,{}),userDrawnPlaceGroupName:t.controlState.userDrawnPlaceGroupName,userPlaceGroups:ew(t),userPlaceGroupsVisibility:QWe(t),showUserPlaces:Zae(t),mapInteraction:t.controlState.mapInteraction,mapProjection:wd(t),selectedPlaceId:t.controlState.selectedPlaceId,places:rw(t),baseMapLayer:OVe(t),overlayLayer:CVe(t),imageSmoothing:nw(t),variableSplitPos:t.controlState.variableSplitPos,onMapRef:e.onMapRef}),Jnt={addDrawnUserPlace:HVe,importUserPlacesFromText:Vse,selectPlace:M2},t7=Jt(Znt,Jnt)(btt);var u4={},ert=ft;Object.defineProperty(u4,"__esModule",{value:!0});var f4=u4.default=void 0,trt=ert(pt()),nrt=w;f4=u4.default=(0,trt.default)((0,nrt.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 d4={},rrt=ft;Object.defineProperty(d4,"__esModule",{value:!0});var hfe=d4.default=void 0,irt=rrt(pt()),ort=w;hfe=d4.default=(0,irt.default)((0,ort.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 h4={},art=ft;Object.defineProperty(h4,"__esModule",{value:!0});var pfe=h4.default=void 0,srt=art(pt()),lrt=w;pfe=h4.default=(0,srt.default)((0,lrt.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 p4={},crt=ft;Object.defineProperty(p4,"__esModule",{value:!0});var mfe=p4.default=void 0,urt=crt(pt()),frt=w;mfe=p4.default=(0,urt.default)((0,frt.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 m4={},drt=ft;Object.defineProperty(m4,"__esModule",{value:!0});var gfe=m4.default=void 0,hrt=drt(pt()),prt=w;gfe=m4.default=(0,hrt.default)((0,prt.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 g4={},mrt=ft;Object.defineProperty(g4,"__esModule",{value:!0});var vfe=g4.default=void 0,grt=mrt(pt()),vrt=w;vfe=g4.default=(0,grt.default)((0,vrt.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 v4={},yrt=ft;Object.defineProperty(v4,"__esModule",{value:!0});var yfe=v4.default=void 0,xrt=yrt(pt()),brt=w;yfe=v4.default=(0,xrt.default)((0,brt.jsx)("path",{d:"M2.5 4v3h5v12h3V7h5V4zm19 5h-9v3h3v7h3v-7h3z"}),"TextFields");var y4={},_rt=ft;Object.defineProperty(y4,"__esModule",{value:!0});var xfe=y4.default=void 0,wrt=_rt(pt()),Srt=w;xfe=y4.default=(0,wrt.default)((0,Srt.jsx)("path",{d:"M13 13v8h8v-8zM3 21h8v-8H3zM3 3v8h8V3zm13.66-1.31L11 7.34 16.66 13l5.66-5.66z"}),"Widgets");let xn=class bfe{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]=lv(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),Tl.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]=lv(this,e,n);let r=[];return this.decompose(e,n,r,0),Tl.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 eb(this),o=new eb(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 eb(this,e)}iterRange(e,n=this.length){return new _fe(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 wfe(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]?bfe.empty:e.length<=32?new Tr(e):Tl.from(Tr.split(e,[]))}};class Tr extends xn{constructor(e,n=Ort(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 Crt(i,s,r,a);i=s+1,r++}}decompose(e,n,r,i){let o=e<=0&&n>=this.length?this:new Tr(n7(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(i&1){let a=r.pop(),s=$C(o.text,a.text.slice(),0,o.length);if(s.length<=32)r.push(new Tr(s,a.length+o.length));else{let l=s.length>>1;r.push(new Tr(s.slice(0,l)),new Tr(s.slice(l)))}}else r.push(o)}replace(e,n,r){if(!(r instanceof Tr))return super.replace(e,n,r);[e,n]=lv(this,e,n);let i=$C(this.text,$C(r.text,n7(this.text,0,e)),n),o=this.length+r.length-(n-e);return i.length<=32?new Tr(i,o):Tl.from(Tr.split(i,[]),o)}sliceString(e,n=this.length,r=` + */Qce();function Kce(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 ng={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)}};function Zce(){var t;const e=e5();return(t=e==null?void 0:e.$$material)!=null?t:e}const yQe=["checked","disabled","error","focused","focusVisible","required","expanded","selected"];function xQe(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(yQe.indexOf(s.key)!==-1)return`Mui-${s.key}`;const u=`${i}${c}-${s.key}`;return!l.options.theme[rre]||r!==""?u:`${u}-${a()}`}return`${i}${n}${a()}`}}var Jce=Date.now(),xR="fnValues"+Jce,bR="fnStyle"+ ++Jce,bQe=function(){return{onCreateRule:function(n,r,i){if(typeof r!="function")return null;var o=$z(n,{},i);return o[bR]=r,o},onProcessStyle:function(n,r){if(xR in r||bR 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[xR]=i,n},onUpdate:function(n,r,i,o){var a=r,s=a[bR];s&&(a.style=s(n)||{});var l=a[xR];if(l)for(var c in l)a.prop(c,l[c](n),o)}}},zf="@global",q3="@global ",_Qe=function(){function t(n,r,i){this.type="global",this.at=zf,this.isProcessed=!1,this.key=n,this.options=i,this.rules=new H2(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}(),wQe=function(){function t(n,r,i){this.type="global",this.at=zf,this.isProcessed=!1,this.key=n,this.options=i;var o=n.substr(q3.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}(),SQe=/\s*,\s*/g;function eue(t,e){for(var n=t.split(SQe),r="",i=0;i-1){var o=oue[e];if(!Array.isArray(o))return Nt.js+nd(o)in n?Nt.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:gYe(),vYe()]}}const xYe=Qce(yYe()),bYe=xQe(),_Ye=new Map,wYe={disableGeneration:!1,generateClassName:bYe,jss:xYe,sheetsCache:null,sheetsManager:_Ye,sheetsRegistry:null},SYe=M.createContext(wYe);let O9=-1e9;function OYe(){return O9+=1,O9}const CYe=["variant"];function C9(t){return t.length===0}function TYe(t){const{variant:e}=t,n=Ae(t,CYe);let r=e||"";return Object.keys(n).sort().forEach(i=>{i==="color"?r+=C9(r)?t[i]:De(t[i]):r+=`${C9(r)?i:De(i)}${De(t[i].toString())}`}),r}const EYe={};function PYe(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=TYe(l.props);s[c]=Ii(s[c]||{},l.style)}),s},options:{}}}const MYe=["name","classNamePrefix","Component","defaultTheme"];function kYe({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=Kce({baseClasses:t.cacheClasses.lastJSS,newClasses:n,Component:r})),t.cacheClasses.value}function AYe({state:t,theme:e,stylesOptions:n,stylesCreator:r,name:i},o){if(n.disableGeneration)return;let a=ng.get(n.sheetsManager,r,e);a||(a={refs:0,staticSheet:null,dynamicStyles:null},ng.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=ng.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&&ng.set(n.sheetsCache,r,e,c)),l&&l.add(c),a.staticSheet=c,a.dynamicStyles=Yce(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=Kce({baseClasses:a.staticSheet.classes,newClasses:c.classes}),l&&l.add(c)}else t.classes=a.staticSheet.classes;a.refs+=1}function RYe({state:t},e){t.dynamicSheet&&t.dynamicSheet.update(e)}function IYe({state:t,theme:e,stylesOptions:n,stylesCreator:r}){if(n.disableGeneration)return;const i=ng.get(n.sheetsManager,r,e);i.refs-=1;const o=n.sheetsRegistry;i.refs===0&&(ng.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 DYe(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 LYe(t,e={}){const{name:n,classNamePrefix:r,Component:i,defaultTheme:o=EYe}=e,a=Ae(e,MYe),s=PYe(t),l=n||r||"makeStyles";return s.options={index:OYe(),name:n,meta:l,classNamePrefix:l},(u={})=>{const f=Zce()||o,d=j({},M.useContext(SYe),a),h=M.useRef(),p=M.useRef();return DYe(()=>{const g={name:n,state:{},stylesCreator:s,stylesOptions:d,theme:f};return AYe(g,u),p.current=!1,h.current=g,()=>{IYe(g)}},[f,s]),M.useEffect(()=>{p.current&&RYe(h.current,u),p.current=!0}),kYe(h.current,u.classes,i)}}function NYe(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 $Ye=["defaultTheme","withTheme","name"],FYe=["classes"],jYe=(t,e={})=>n=>{const{defaultTheme:r,withTheme:i=!1,name:o}=e,a=Ae(e,$Ye);let s=o;const l=LYe(t,j({defaultTheme:r,Component:n,name:o||n.displayName,classNamePrefix:s},a)),c=M.forwardRef(function(f,d){const h=Ae(f,FYe),p=l(j({},n.defaultProps,f));let m,g=h;return(typeof o=="string"||i)&&(m=Zce()||r,o&&(g=NYe({theme:m,name:o,props:h})),i&&!g.theme&&(g.theme=m)),w.jsx(n,j({ref:d,classes:p},g))});return EL(c,n),c},BYe=t=>({components:{MuiLocalizationProvider:{defaultProps:{localeText:j({},t)}}}}),sue={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"},zYe=sue;BYe(sue);const lue=M.createContext(null);function UYe(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({},zYe,l??{})}),[u,c,l]);return w.jsx(lue.Provider,{value:f,children:n})}var Y3={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})(Y3,Y3.exports);var WYe=Y3.exports;const cue=$t(WYe),VYe={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 GYe{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||w2;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=cue[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=>Eae(r),this.toISO=r=>S4e(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)=>fze(r,i),this.addMinutes=(r,i)=>uze(r,i),this.addHours=(r,i)=>oze(r,i),this.addDays=(r,i)=>y3(r,i),this.addWeeks=(r,i)=>dze(r,i),this.addMonths=(r,i)=>IC(r,i),this.addYears=(r,i)=>aH(r,i),this.isValid=r=>uae(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 Cze(r,s);case"quarters":return wze(r,s);case"months":return dae(r,s);case"weeks":return Oze(r,s);case"days":return fae(r,s);case"hours":return xze(r,s);case"minutes":return bze(r,s);case"seconds":return Sze(r,s);default:return _2(r,s)}},this.isAfter=(r,i)=>IS(r,i),this.isBefore=(r,i)=>am(r,i),this.startOfDay=r=>ov(r),this.endOfDay=r=>x3(r),this.getHours=r=>T4e(r),this.setHours=(r,i)=>QUe(r,i),this.setMinutes=(r,i)=>YUe(r,i),this.getSeconds=r=>M4e(r),this.setSeconds=(r,i)=>KUe(r,i),this.isSameDay=(r,i)=>pze(r,i),this.isSameMonth=(r,i)=>MUe(r,i),this.isSameYear=(r,i)=>kUe(r,i),this.isSameHour=(r,i)=>PUe(r,i),this.startOfYear=r=>RS(r),this.endOfYear=r=>ZA(r),this.startOfMonth=r=>AS(r),this.endOfMonth=r=>b3(r),this.startOfWeek=r=>KA(r,{locale:this.locale}),this.endOfWeek=r=>JA(r,{locale:this.locale}),this.getYear=r=>k4e(r),this.setYear=(r,i)=>ZUe(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:TUe(r,i,new Date,{locale:this.locale}),this.format=(r,i)=>this.formatByString(r,this.formats[i]),this.formatByString=(r,i)=>b4e(r,i,{locale:this.locale}),this.isEqual=(r,i)=>r===null&&i===null?!0:A4e(r,i),this.isNull=r=>r===null,this.isAfterDay=(r,i)=>IS(r,x3(i)),this.isBeforeDay=(r,i)=>am(r,ov(i)),this.isBeforeYear=(r,i)=>am(r,RS(i)),this.isAfterYear=(r,i)=>IS(r,ZA(i)),this.isWithinRange=(r,[i,o])=>AUe(r,{start:i,end:o}),this.formatNumber=r=>r,this.getMinutes=r=>E4e(r),this.getDate=r=>O4e(r),this.setDate=(r,i)=>XUe(r,i),this.getMonth=r=>P4e(r),this.getDaysInMonth=r=>bae(r),this.setMonth=(r,i)=>qUe(r,i),this.getMeridiemText=r=>r==="am"?"AM":"PM",this.getNextMonth=r=>IC(r,1),this.getPreviousMonth=r=>IC(r,-1),this.getMonthArray=r=>{const o=[RS(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 Tze({start:KA(r,{locale:this.locale}),end:JA(r,{locale:this.locale})}).map(i=>this.formatByString(i,"EEEEEE"))},this.getWeekArray=r=>{const i=KA(AS(r),{locale:this.locale}),o=JA(b3(r),{locale:this.locale});let a=0,s=i;const l=[];let c=null;for(;am(s,o);){const u=Math.floor(a/7);l[u]=l[u]||[];const f=C4e(s);c!==f&&(c=f,l[u].push(s),a+=1),s=y3(s,1)}return l},this.getYearRange=(r,i)=>{const o=RS(r),a=ZA(i),s=[];let l=o;for(;am(l,a);)s.push(l),l=aH(l,1);return s},this.locale=e,this.formats=Object.assign({},VYe,n)}isBeforeMonth(e,n){return am(e,AS(n))}isAfterMonth(e,n){return IS(e,AS(n))}}const HYe={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 qYe extends GYe{constructor(...e){super(...e),this.formatTokenMap=HYe,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=cue[o],s=this.locale||w2;return a(i,s.formatLong,{})}return i}).join("")},this.getFormatHelperText=n=>this.expandFormat(n).replace(/(aaa|aa|a)/g,"(a|p)m").toLocaleLowerCase()}}const uw=()=>{const t=M.useContext(lue);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},Sr=()=>uw().utils,q2=()=>uw().defaultDates,Cd=()=>uw().localeText,fw=()=>{const t=Sr();return M.useRef(t.date()).current},Zx=({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},XYe=(t,e)=>{const n=t.date(e);return t.isValid(n)?n:null},tc=(t,e,n)=>{if(e==null)return n;const r=t.date(e);return t.isValid(r)?r:n};function uue(t,e){var n,r,i,o,a;const s=qe({props:t,name:e}),l=Sr(),c=q2(),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:tc(l,(r=s.minDateTime)!=null?r:s.minDate,c.minDate),maxDate:tc(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 fue={emptyValue:null,getTodayValue:t=>t.date(),parseInput:XYe,areValuesEqual:(t,e,n)=>t.isEqual(e,n)},QYe=t=>{switch(t){case"year":case"month":case"day":return"calendar";default:return"clock"}};function due(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"]},YYe,e)},JYe=we(At,{name:"PrivatePickersToolbarText",slot:"Root",overridesResolver:(t,e)=>[e.root,{[`&.${T9.selected}`]:e.selected}]})(({theme:t})=>({transition:t.transitions.create("color"),color:t.palette.text.secondary,[`&.${T9.selected}`]:{color:t.palette.text.primary}})),hue=M.forwardRef(function(e,n){const{className:r,value:i}=e,o=Ae(e,KYe),a=ZYe(e);return w.jsx(JYe,j({ref:n,className:Vr(r,a.root),component:"span"},o,{children:i}))}),eKe=ni(w.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),tKe=ni(w.jsx("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}),"ArrowLeft"),nKe=ni(w.jsx("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"ArrowRight"),pue=ni(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"),rKe=ni(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"),iKe=ni(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"),oKe=ni(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"),aKe=ni(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 mue(t){return We("MuiPickersToolbar",t)}const gue=Ve("MuiPickersToolbar",["root","content","penIconButton","penIconButtonLandscape"]),sKe=t=>{const{classes:e,isLandscape:n}=t;return Ue({root:["root"],content:["content"],penIconButton:["penIconButton",n&&"penIconButtonLandscape"]},mue,e)},lKe=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"})),cKe=we(MC,{name:"MuiPickersToolbar",slot:"Content",overridesResolver:(t,e)=>e.content})(({ownerState:t})=>j({flex:1},!t.isLandscape&&{alignItems:"center"})),uKe=we(Ot,{name:"MuiPickersToolbar",slot:"PenIconButton",overridesResolver:(t,e)=>[{[`&.${gue.penIconButtonLandscape}`]:e.penIconButtonLandscape},e.penIconButton]})({}),fKe=t=>t==="clock"?w.jsx(rKe,{color:"inherit"}):w.jsx(pue,{color:"inherit"}),dKe=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=Cd(),m=sKe(h);return w.jsxs(lKe,{ref:n,className:Vr(m.root,o),ownerState:h,children:[w.jsx(At,{color:"text.secondary",variant:"overline",children:f}),w.jsxs(cKe,{container:!0,justifyContent:"space-between",className:m.content,ownerState:h,direction:s?c:"row",alignItems:s?"flex-start":"flex-end",children:[i,w.jsx(uKe,{onClick:u,className:m.penIconButton,ownerState:h,color:"inherit","aria-label":a?a(l,d):p.inputModeToggleButtonAriaLabel(l,d),children:l?fKe(d):w.jsx(oKe,{color:"inherit"})})]})]})}),hKe=["align","className","selected","typographyClassName","value","variant"],pKe=t=>{const{classes:e}=t;return Ue({root:["root"]},mue,e)},mKe=we(tr,{name:"MuiPickersToolbarButton",slot:"Root",overridesResolver:(t,e)=>e.root})({padding:0,minWidth:16,textTransform:"none"}),P0=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,hKe),f=pKe(r);return w.jsx(mKe,j({variant:"text",ref:n,className:Vr(o,f.root)},u,{children:w.jsx(hue,{align:i,className:s,variant:c,value:l,selected:a})}))});function gKe(t){return We("MuiDateTimePickerToolbar",t)}Ve("MuiDateTimePickerToolbar",["root","dateContainer","timeContainer","separator"]);const vKe=["ampm","parsedValue","isMobileKeyboardViewOpen","onChange","openView","setOpenView","toggleMobileKeyboardView","toolbarFormat","toolbarPlaceholder","toolbarTitle","views"],yKe=t=>{const{classes:e}=t;return Ue({root:["root"],dateContainer:["dateContainer"],timeContainer:["timeContainer"],separator:["separator"]},gKe,e)},xKe=we(dKe,{name:"MuiDateTimePickerToolbar",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({paddingLeft:16,paddingRight:16,justifyContent:"space-around",position:"relative",[`& .${gue.penIconButton}`]:j({position:"absolute",top:8},t.direction==="rtl"?{left:8}:{right:8})})),bKe=we("div",{name:"MuiDateTimePickerToolbar",slot:"DateContainer",overridesResolver:(t,e)=>e.dateContainer})({display:"flex",flexDirection:"column",alignItems:"flex-start"}),_Ke=we("div",{name:"MuiDateTimePickerToolbar",slot:"TimeContainer",overridesResolver:(t,e)=>e.timeContainer})({display:"flex"}),E9=we(hue,{name:"MuiDateTimePickerToolbar",slot:"Separator",overridesResolver:(t,e)=>e.separator})({margin:"0 4px 0 2px",cursor:"default"});function vue(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,vKe),h=e,p=Sr(),m=Cd(),g=yKe(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(xKe,j({toolbarTitle:v,isMobileKeyboardViewOpen:i,toggleMobileKeyboardView:s,className:g.root,viewType:QYe(o)},d,{isLandscape:!1,ownerState:h,children:[w.jsxs(bKe,{className:g.dateContainer,ownerState:h,children:[f.includes("year")&&w.jsx(P0,{tabIndex:-1,variant:"subtitle1",onClick:()=>a("year"),selected:o==="year",value:r?p.format(r,"year"):"–"}),f.includes("day")&&w.jsx(P0,{tabIndex:-1,variant:"h4",onClick:()=>a("day"),selected:o==="day",value:x})]}),w.jsxs(_Ke,{className:g.timeContainer,ownerState:h,children:[f.includes("hours")&&w.jsx(P0,{variant:"h3",onClick:()=>a("hours"),selected:o==="hours",value:r?y(r):"--"}),f.includes("minutes")&&w.jsxs(M.Fragment,{children:[w.jsx(E9,{variant:"h3",value:":",className:g.separator,ownerState:h}),w.jsx(P0,{variant:"h3",onClick:()=>a("minutes"),selected:o==="minutes",value:r?p.format(r,"minutes"):"--"})]}),f.includes("seconds")&&w.jsxs(M.Fragment,{children:[w.jsx(E9,{variant:"h3",value:":",className:g.separator,ownerState:h}),w.jsx(P0,{variant:"h3",onClick:()=>a("seconds"),selected:o==="seconds",value:r?p.format(r,"seconds"):"--"})]})]})]}))}const Td=M.createContext(null),wKe=["onAccept","onClear","onCancel","onSetToday","actions"],yue=t=>{const{onAccept:e,onClear:n,onCancel:r,onSetToday:i,actions:o}=t,a=Ae(t,wKe),s=M.useContext(Td),l=Cd(),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(tr,{onClick:n,children:l.clearButtonLabel},f);case"cancel":return w.jsx(tr,{onClick:r,children:l.cancelButtonLabel},f);case"accept":return w.jsx(tr,{onClick:e,children:l.okButtonLabel},f);case"today":return w.jsx(tr,{onClick:i,children:l.todayButtonLabel},f);default:return null}});return w.jsx(Tp,j({},a,{children:u}))};function SKe(t){return We("MuiPickersPopper",t)}Ve("MuiPickersPopper",["root","paper"]);function xue(t,e){return Array.isArray(e)?e.every(n=>t.indexOf(n)!==-1):t.indexOf(e)!==-1}const bue=(t,e)=>n=>{(n.key==="Enter"||n.key===" ")&&(t(n),n.preventDefault(),n.stopPropagation())},_ue=(t=document)=>{const e=t.activeElement;return e?e.shadowRoot?_ue(e.shadowRoot):e:null},OKe=["onClick","onTouchStart"],CKe=t=>{const{classes:e}=t;return Ue({root:["root"],paper:["paper"]},SKe,e)},TKe=we(b5,{name:"MuiPickersPopper",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({zIndex:t.zIndex.modal})),EKe=we(Ho,{name:"MuiPickersPopper",slot:"Paper",overridesResolver:(t,e)=>e.paper})(({ownerState:t})=>j({transformOrigin:"top center",outline:0},t.placement==="top"&&{transformOrigin:"bottom center"}));function PKe(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=_r(l=>{if(!o.current)return;const c=r.current;r.current=!1;const u=$n(i.current);if(!i.current||"clientX"in l&&PKe(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 kKe(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=ev,TrapFocusProps:g,PaperProps:v={},components:y,componentsProps:x}=n;M.useEffect(()=>{function W($){d&&($.key==="Escape"||$.key==="Esc")&&s()}return document.addEventListener("keydown",W),()=>{document.removeEventListener("keydown",W)}},[s,d]);const b=M.useRef(null);M.useEffect(()=>{p!=="tooltip"&&(d?b.current=_ue(document):b.current&&b.current instanceof HTMLElement&&setTimeout(()=>{b.current instanceof HTMLElement&&b.current.focus()}))},[d,p]);const[_,S,O]=MKe(d,a??s),C=M.useRef(null),E=Zt(C,o),k=Zt(E,_),I=n,P=CKe(I),{onClick:R,onTouchStart:T}=v,L=Ae(v,OKe),z=W=>{W.key==="Escape"&&(W.stopPropagation(),s())},B=(e=y==null?void 0:y.ActionBar)!=null?e:yue,U=(y==null?void 0:y.PaperContent)||M.Fragment;return w.jsx(TKe,j({transition:!0,role:p,open:d,anchorEl:r,onKeyDown:z,className:P.root},h,{children:({TransitionProps:W,placement:$})=>w.jsx(wre,j({open:d,disableAutoFocus:!0,disableRestoreFocus:!0,disableEnforceFocus:p==="tooltip",isEnabled:()=>!0},g,{children:w.jsx(m,j({},W,{children:w.jsx(EKe,j({tabIndex:-1,elevation:8,ref:k,onClick:N=>{S(N),R&&R(N)},onTouchStart:N=>{O(N),T&&T(N)},ownerState:j({},I,{placement:$}),className:P.paper},L,{children:w.jsxs(U,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 AKe(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(Td.Provider,{value:"desktop",children:[w.jsx(r,j({},n,{inputRef:g})),w.jsx(kKe,{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 zz({onChange:t,onViewChange:e,openTo:n,view:r,views:i}){var o,a;const[s,l]=Qs({name:"Picker",state:"view",controlled:r,default:n&&xue(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 sv=220,Uf=36,Zb={x:sv/2,y:sv/2},wue={x:Zb.x,y:0},RKe=wue.x-Zb.x,IKe=wue.y-Zb.y,DKe=t=>t*(180/Math.PI),Sue=(t,e,n)=>{const r=e-Zb.x,i=n-Zb.y,o=Math.atan2(RKe,IKe)-Math.atan2(r,i);let a=DKe(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}},LKe=(t,e,n=1)=>{const r=n*6;let{value:i}=Sue(r,t,e);return i=i*n%60,i},NKe=(t,e,n)=>{const{value:r,distance:i}=Sue(30,t,e);let o=r||12;return n?o%=12:i{const{classes:e}=t;return Ue({root:["root"],thumb:["thumb"]},$Ke,e)},BKe=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"])})),zKe=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% - ${Uf/2}px)`,border:`${(Uf-4)/2}px solid ${t.palette.primary.main}`,boxSizing:"content-box"},e.hasSelected&&{backgroundColor:t.palette.primary.main}));function UKe(t){const e=qe({props:t,name:"MuiClockPointer"}),{className:n,isInner:r,type:i,value:o}=e,a=Ae(e,FKe),s=M.useRef(i);M.useEffect(()=>{s.current=i},[i]);const l=j({},e,{shouldAnimate:s.current!==i}),c=jKe(l),u=()=>{let d=360/(i==="hours"?12:60)*o;return i==="hours"&&o>12&&(d-=360),{height:Math.round((r?.26:.4)*sv),transform:`rotateZ(${d}deg)`}};return w.jsx(BKe,j({style:u(),className:Vr(n,c.root),ownerState:l},a,{children:w.jsx(zKe,{ownerState:l,className:c.thumb})}))}function WKe(t){return We("MuiClock",t)}Ve("MuiClock",["root","clock","wrapper","squareMask","pin","amButton","pmButton"]);const VKe=t=>{const{classes:e}=t;return Ue({root:["root"],clock:["clock"],wrapper:["wrapper"],squareMask:["squareMask"],pin:["pin"],amButton:["amButton"],pmButton:["pmButton"]},WKe,e)},GKe=we("div",{name:"MuiClock",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({display:"flex",justifyContent:"center",alignItems:"center",margin:t.spacing(2)})),HKe=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"}),qKe=we("div",{name:"MuiClock",slot:"Wrapper",overridesResolver:(t,e)=>e.wrapper})({"&:focus":{outline:"none"}}),XKe=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"}})),QKe=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%)"})),YKe=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}})),KKe=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 ZKe(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=Sr(),_=M.useContext(Td),S=M.useRef(!1),O=VKe(x),C=c(m,p),E=!n&&p==="hours"&&(m<1||m>12),k=($,N)=>{g||v||c($,p)||d($,N)},I=($,N)=>{let{offsetX:D,offsetY:A}=$;if(D===void 0){const Y=$.target.getBoundingClientRect();D=$.changedTouches[0].clientX-Y.left,A=$.changedTouches[0].clientY-Y.top}const q=p==="seconds"||p==="minutes"?LKe(D,A,f):NKe(D,A,!!n);k(q,N)},P=$=>{S.current=!0,I($,"shallow")},R=$=>{S.current&&(I($,"finish"),S.current=!1)},T=$=>{$.buttons>0&&I($.nativeEvent,"shallow")},L=$=>{S.current&&(S.current=!1),I($.nativeEvent,"finish")},z=M.useMemo(()=>p==="hours"?!0:m%5===0,[p,m]),B=p==="minutes"?f:1,U=M.useRef(null);Hr(()=>{i&&U.current.focus()},[i]);const W=$=>{if(!S.current)switch($.key){case"Home":k(0,"partial"),$.preventDefault();break;case"End":k(p==="minutes"?59:23,"partial"),$.preventDefault();break;case"ArrowUp":k(m+B,"partial"),$.preventDefault();break;case"ArrowDown":k(m-B,"partial"),$.preventDefault();break}};return w.jsxs(GKe,{className:Vr(y,O.root),children:[w.jsxs(HKe,{className:O.clock,children:[w.jsx(XKe,{onTouchMove:P,onTouchEnd:R,onMouseUp:L,onMouseMove:T,ownerState:{disabled:g},className:O.squareMask}),!C&&w.jsxs(M.Fragment,{children:[w.jsx(QKe,{className:O.pin}),a&&w.jsx(UKe,{type:p,value:m,isInner:E,hasSelected:z})]}),w.jsx(qKe,{"aria-activedescendant":h,"aria-label":s(p,a,b),ref:U,role:"listbox",onKeyDown:W,tabIndex:0,className:O.wrapper,children:o})]}),n&&(_==="desktop"||r)&&w.jsxs(M.Fragment,{children:[w.jsx(YKe,{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(KKe,{disabled:g||u===null,onClick:v?void 0:()=>l("pm"),ownerState:x,className:O.pmButton,children:w.jsx(At,{variant:"caption",children:"PM"})})]})]})}const Oue=t=>()=>{};function JKe(t){return We("MuiClockNumber",t)}const jS=Ve("MuiClockNumber",["root","selected","disabled"]),eZe=["className","disabled","index","inner","label","selected"],tZe=t=>{const{classes:e,selected:n,disabled:r}=t;return Ue({root:["root",n&&"selected",r&&"disabled"]},JKe,e)},nZe=we("span",{name:"MuiClockNumber",slot:"Root",overridesResolver:(t,e)=>[e.root,{[`&.${jS.disabled}`]:e.disabled},{[`&.${jS.selected}`]:e.selected}]})(({theme:t,ownerState:e})=>j({height:Uf,width:Uf,position:"absolute",left:`calc((100% - ${Uf}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},[`&.${jS.selected}`]:{color:t.palette.primary.contrastText},[`&.${jS.disabled}`]:{pointerEvents:"none",color:t.palette.text.disabled}},e.inner&&j({},t.typography.body2,{color:t.palette.text.secondary})));function Cue(t){const e=qe({props:t,name:"MuiClockNumber"}),{className:n,disabled:r,index:i,inner:o,label:a,selected:s}=e,l=Ae(e,eZe),c=e,u=tZe(c),f=i%12/12*Math.PI*2-Math.PI/2,d=(sv-Uf-2)/2*(o?.65:1),h=Math.round(Math.cos(f)*d),p=Math.round(Math.sin(f)*d);return w.jsx(nZe,j({className:Vr(n,u.root),"aria-disabled":r?!0:void 0,"aria-selected":s?!0:void 0,role:"option",style:{transform:`translate(${h}px, ${p+(sv-Uf)/2}px`},ownerState:c},l,{children:a}))}const rZe=({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(Cue,{id:p?i:void 0,index:f,inner:h,selected:p,disabled:r(f),label:d,"aria-label":n(d)},f))}return s},P9=({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(Cue,{label:s,id:c?i:void 0,index:l+1,inner:!1,disabled:n(a),selected:c,"aria-label":r(s)},a)})};function iZe(t){return We("MuiPickersArrowSwitcher",t)}Ve("MuiPickersArrowSwitcher",["root","spacer","button"]);const oZe=["children","className","components","componentsProps","isLeftDisabled","isLeftHidden","isRightDisabled","isRightHidden","leftArrowButtonText","onLeftClick","onRightClick","rightArrowButtonText"],aZe=t=>{const{classes:e}=t;return Ue({root:["root"],spacer:["spacer"],button:["button"]},iZe,e)},sZe=we("div",{name:"MuiPickersArrowSwitcher",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex"}),lZe=we("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer",overridesResolver:(t,e)=>e.spacer})(({theme:t})=>({width:t.spacing(3)})),M9=we(Ot,{name:"MuiPickersArrowSwitcher",slot:"Button",overridesResolver:(t,e)=>e.button})(({ownerState:t})=>j({},t.hidden&&{visibility:"hidden"})),Tue=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,oZe),y=Go().direction==="rtl",x=(s==null?void 0:s.leftArrowButton)||{},b=(a==null?void 0:a.LeftArrowIcon)||tKe,_=(s==null?void 0:s.rightArrowButton)||{},S=(a==null?void 0:a.RightArrowIcon)||nKe,O=r,C=aZe(O);return w.jsxs(sZe,j({ref:n,className:Vr(C.root,o),ownerState:O},g,{children:[w.jsx(M9,j({as:a==null?void 0:a.LeftArrowButton,size:"small","aria-label":d,title:d,disabled:l,edge:"end",onClick:h},x,{className:Vr(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(lZe,{className:C.spacer,ownerState:O}),w.jsx(M9,j({as:a==null?void 0:a.RightArrowButton,size:"small","aria-label":m,title:m,edge:"start",disabled:u,onClick:p},_,{className:Vr(C.button,_.className),ownerState:j({},O,_,{hidden:f}),children:y?w.jsx(b,{}):w.jsx(S,{})}))]}))}),cZe=(t,e)=>t?e.getHours(t)>=12?"pm":"am":null,K3=(t,e,n)=>n&&(t>=12?"pm":"am")!==e?e==="am"?t-12:t+12:t,uZe=(t,e,n,r)=>{const i=K3(r.getHours(t),e,n);return r.setHours(t,i)},k9=(t,e)=>e.getHours(t)*3600+e.getMinutes(t)*60+e.getSeconds(t),Eue=(t=!1,e)=>(n,r)=>t?e.isAfter(n,r):k9(n,e)>k9(r,e);function fZe(t,{disableFuture:e,maxDate:n}){const r=Sr();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 dZe(t,{disablePast:e,minDate:n}){const r=Sr();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 hZe(t,e,n){const r=Sr(),i=cZe(t,r),o=M.useCallback(a=>{const s=t==null?null:uZe(t,a,!!e,r);n(s,"partial")},[e,t,n,r]);return{meridiemMode:i,handleMeridiemChange:o}}function pZe(t){return We("MuiClockPicker",t)}Ve("MuiClockPicker",["root","arrowSwitcher"]);const Z3=36,Uz=2,Pue=320,mZe=358,Wz=we("div")({overflowX:"hidden",width:Pue,maxHeight:mZe,display:"flex",flexDirection:"column",margin:"0 auto"}),gZe=t=>{const{classes:e}=t;return Ue({root:["root"],arrowSwitcher:["arrowSwitcher"]},pZe,e)},vZe=we(Wz,{name:"MuiClockPicker",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexDirection:"column"}),yZe=we(Tue,{name:"MuiClockPicker",slot:"ArrowSwitcher",overridesResolver:(t,e)=>e.arrowSwitcher})({position:"absolute",right:12,top:15}),xZe=Oue(),bZe=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;xZe({leftArrowButtonText:m,rightArrowButtonText:x,getClockLabelText:f,getHoursClockNumberText:d,getMinutesClockNumberText:h,getSecondsClockNumberText:p});const T=Cd(),L=m??T.openPreviousView,z=x??T.openNextView,B=f??T.clockLabelText,U=d??T.hoursClockNumberText,W=h??T.minutesClockNumberText,$=p??T.secondsClockNumberText,{openView:N,setOpenView:D,nextView:A,previousView:q,handleChangeAndOpenNext:Y}=zz({view:O,views:C,openTo:E,onViewChange:k,onChange:S}),K=fw(),se=Sr(),te=M.useMemo(()=>c||se.setSeconds(se.setMinutes(se.setHours(K,0),0),0),[c,K,se]),{meridiemMode:J,handleMeridiemChange:pe}=hZe(te,i,Y),be=M.useCallback((le,Q)=>{const X=Eue(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=K3(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=pd(),ve=M.useMemo(()=>{switch(N){case"hours":{const le=(Q,X)=>{const ee=K3(Q,J,i);Y(se.setHours(te,ee),X)};return{onChange:le,value:se.getHours(te),children:rZe({date:c,utils:se,ampm:i,onChange:le,getClockNumberText:U,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:P9({utils:se,value:le,onChange:Q,getClockNumberText:W,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:P9({utils:se,value:le,onChange:Q,getClockNumberText:$,isDisabled:X=>P||be(X,"seconds"),selectedId:re})}}default:throw new Error("You must provide the type for ClockView")}},[N,se,c,i,U,W,$,J,Y,te,be,re,P]),F=r,ce=gZe(F);return w.jsxs(vZe,{ref:n,className:Vr(ce.root,I),ownerState:F,children:[_&&w.jsx(yZe,{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(ZKe,j({autoFocus:a,date:c,ampmInClock:o,type:N,ampm:i,getClockLabelText:B,minutesStep:y,isTimeDisabled:be,meridiemMode:J,handleMeridiemChange:pe,selectedId:re,disabled:P,readOnly:R},ve))]})});function _Ze(t){return We("PrivatePickersMonth",t)}const A9=Ve("PrivatePickersMonth",["root","selected"]),wZe=["disabled","onSelect","selected","value","tabIndex","hasFocus","onFocus","onBlur"],SZe=t=>{const{classes:e,selected:n}=t;return Ue({root:["root",n&&"selected"]},_Ze,e)},OZe=we(At,{name:"PrivatePickersMonth",slot:"Root",overridesResolver:(t,e)=>[e.root,{[`&.${A9.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:Hc(t.palette.action.active,t.palette.action.hoverOpacity)},"&:disabled":{pointerEvents:"none",color:t.palette.text.secondary},[`&.${A9.selected}`]:{color:t.palette.primary.contrastText,backgroundColor:t.palette.primary.main,"&:focus, &:hover":{backgroundColor:t.palette.primary.dark}}})),R9=()=>{},CZe=t=>{const{disabled:e,onSelect:n,selected:r,value:i,tabIndex:o,hasFocus:a,onFocus:s=R9,onBlur:l=R9}=t,c=Ae(t,wZe),u=SZe(t),f=()=>{n(i)},d=M.useRef(null);return Hr(()=>{if(a){var h;(h=d.current)==null||h.focus()}},[a]),w.jsx(OZe,j({ref:d,component:"button",type:"button",className:u.root,tabIndex:o,onClick:f,onKeyDown:bue(f),color:r?"primary":void 0,variant:r?"h5":"subtitle1",disabled:e,onFocus:h=>s(h,i),onBlur:h=>l(h,i)},c))};function TZe(t){return We("MuiMonthPicker",t)}Ve("MuiMonthPicker",["root"]);const EZe=["className","date","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","autoFocus","onMonthFocus","hasFocus","onFocusedViewChange"],PZe=t=>{const{classes:e}=t;return Ue({root:["root"]},TZe,e)};function MZe(t,e){const n=Sr(),r=q2(),i=qe({props:t,name:e});return j({disableFuture:!1,disablePast:!1},i,{minDate:tc(n,i.minDate,r.minDate),maxDate:tc(n,i.maxDate,r.maxDate)})}const kZe=we("div",{name:"MuiMonthPicker",slot:"Root",overridesResolver:(t,e)=>e.root})({width:310,display:"flex",flexWrap:"wrap",alignContent:"stretch",margin:"0 4px"}),AZe=M.forwardRef(function(e,n){const r=Sr(),i=fw(),o=MZe(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,EZe),S=o,O=PZe(S),C=hd(),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]=Qs({name:"MonthPicker",state:"hasFocus",controlled:x,default:v}),B=M.useCallback(A=>{z(A),b&&b(A)},[z,b]),U=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 W=_r(A=>{switch(A.key){case"ArrowUp":U((12+I-3)%12),A.preventDefault();break;case"ArrowDown":U((12+I+3)%12),A.preventDefault();break;case"ArrowLeft":U((12+I+(C.direction==="ltr"?-1:1))%12),A.preventDefault();break;case"ArrowRight":U((12+I+(C.direction==="ltr"?1:-1))%12),A.preventDefault();break}}),$=M.useCallback((A,q)=>{U(q)},[U]),N=M.useCallback(()=>{B(!1)},[B]),D=r.getMonth(i);return w.jsx(kZe,j({ref:n,className:Vr(O.root,a),ownerState:S,onKeyDown:W},_,{children:r.getMonthArray(E).map(A=>{const q=r.getMonth(A),Y=r.format(A,"monthShort"),K=l||R(A);return w.jsx(CZe,{value:q,selected:q===k,tabIndex:q===I&&!K?0:-1,hasFocus:L&&q===I,onSelect:T,onFocus:$,onBlur:N,disabled:K,"aria-current":D===q?"date":void 0,children:Y},Y)})}))});function RZe(t,e,n){const{value:r,onError:i}=t,o=uw(),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 Mue=({props:t,value:e,adapter:n})=>{const r=n.utils.date(),i=n.utils.date(e),o=tc(n.utils,t.minDate,n.defaultDates.minDate),a=tc(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}},kue=({shouldDisableDate:t,minDate:e,maxDate:n,disableFuture:r,disablePast:i})=>{const o=uw();return M.useCallback(a=>Mue({adapter:o,value:a,props:{shouldDisableDate:t,minDate:e,maxDate:n,disableFuture:r,disablePast:i}})!==null,[o,t,e,n,r,i])},IZe=(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")}},DZe=({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=fw(),d=Sr(),h=M.useRef(IZe(!!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=kue({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}},LZe=t=>We("MuiPickersFadeTransitionGroup",t);Ve("MuiPickersFadeTransitionGroup",["root"]);const NZe=t=>{const{classes:e}=t;return Ue({root:["root"]},LZe,e)},I9=500,$Ze=we(D1,{name:"MuiPickersFadeTransitionGroup",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"block",position:"relative"});function Aue(t){const e=qe({props:t,name:"MuiPickersFadeTransitionGroup"}),{children:n,className:r,reduceAnimations:i,transKey:o}=e,a=NZe(e);return i?n:w.jsx($Ze,{className:Vr(a.root,r),children:w.jsx(ZM,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:I9,enter:I9/2,exit:0},children:n},o)})}function FZe(t){return We("MuiPickersDay",t)}const BS=Ve("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),jZe=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDaySelect","onFocus","onBlur","onKeyDown","onMouseDown","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today"],BZe=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"]},FZe,l)},Rue=({theme:t,ownerState:e})=>j({},t.typography.caption,{width:Z3,height:Z3,borderRadius:"50%",padding:0,backgroundColor:t.palette.background.paper,color:t.palette.text.primary,"&:hover":{backgroundColor:Hc(t.palette.action.active,t.palette.action.hoverOpacity)},"&:focus":{backgroundColor:Hc(t.palette.action.active,t.palette.action.hoverOpacity),[`&.${BS.selected}`]:{willChange:"background-color",backgroundColor:t.palette.primary.dark}},[`&.${BS.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}},[`&.${BS.disabled}`]:{color:t.palette.text.disabled}},!e.disableMargin&&{margin:`0 ${Uz}px`},e.outsideCurrentMonth&&e.showDaysOutsideCurrentMonth&&{color:t.palette.text.secondary},!e.disableHighlightToday&&e.today&&{[`&:not(.${BS.selected})`]:{border:`1px solid ${t.palette.text.secondary}`}}),Iue=(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]},zZe=we(fs,{name:"MuiPickersDay",slot:"Root",overridesResolver:Iue})(Rue),UZe=we("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:Iue})(({theme:t,ownerState:e})=>j({},Rue({theme:t,ownerState:e}),{opacity:0,pointerEvents:"none"})),ER=()=>{},WZe=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=ER,onBlur:p=ER,onKeyDown:m=ER,onMouseDown:g,outsideCurrentMonth:v,selected:y=!1,showDaysOutsideCurrentMonth:x=!1,children:b,today:_=!1}=r,S=Ae(r,jZe),O=j({},r,{autoFocus:i,disabled:s,disableHighlightToday:l,disableMargin:c,selected:y,showDaysOutsideCurrentMonth:x,today:_}),C=BZe(O),E=Sr(),k=M.useRef(null),I=Zt(k,n);Hr(()=>{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(UZe,{className:Vr(C.root,C.hiddenDaySpacingFiller,o),ownerState:O,role:S.role}):w.jsx(zZe,j({className:Vr(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")}))}),VZe=(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,GZe=M.memo(WZe,VZe),HZe=t=>We("PrivatePickersSlideTransition",t),Wi=Ve("PrivatePickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),qZe=["children","className","reduceAnimations","slideDirection","transKey"],XZe=t=>{const{classes:e}=t;return Ue({root:["root"]},HZe,e)},Due=350,QZe=we(D1,{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:Due,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}}}),YZe=t=>{const{children:e,className:n,reduceAnimations:r,slideDirection:i,transKey:o}=t,a=Ae(t,qZe),s=XZe(t);if(r)return w.jsx("div",{className:Vr(s.root,n),children:e});const l={exit:Wi.slideExit,enterActive:Wi.slideEnterActive,enter:Wi[`slideEnter-${i}`],exitActive:Wi[`slideExitActiveLeft-${i}`]};return w.jsx(QZe,{className:Vr(s.root,n),childFactory:c=>M.cloneElement(c,{classNames:l}),role:"presentation",children:w.jsx(l5,j({mountOnEnter:!0,unmountOnExit:!0,timeout:Due,classNames:l},a,{children:e}),o)})},KZe=t=>We("MuiDayPicker",t);Ve("MuiDayPicker",["header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer"]);const ZZe=t=>{const{classes:e}=t;return Ue({header:["header"],weekDayLabel:["weekDayLabel"],loadingContainer:["loadingContainer"],slideTransition:["slideTransition"],monthContainer:["monthContainer"],weekContainer:["weekContainer"]},KZe,e)},JZe=t=>t.charAt(0).toUpperCase(),Lue=(Z3+Uz*2)*6,eJe=we("div",{name:"MuiDayPicker",slot:"Header",overridesResolver:(t,e)=>e.header})({display:"flex",justifyContent:"center",alignItems:"center"}),tJe=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})),nJe=we("div",{name:"MuiDayPicker",slot:"LoadingContainer",overridesResolver:(t,e)=>e.loadingContainer})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:Lue}),rJe=we(YZe,{name:"MuiDayPicker",slot:"SlideTransition",overridesResolver:(t,e)=>e.slideTransition})({minHeight:Lue}),iJe=we("div",{name:"MuiDayPicker",slot:"MonthContainer",overridesResolver:(t,e)=>e.monthContainer})({overflow:"hidden"}),oJe=we("div",{name:"MuiDayPicker",slot:"WeekContainer",overridesResolver:(t,e)=>e.weekContainer})({margin:`${Uz}px 0`,display:"flex",justifyContent:"center"});function aJe(t){const e=fw(),n=Sr(),r=qe({props:t,name:"MuiDayPicker"}),i=ZZe(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=JZe,hasFocus:R,onFocusedViewChange:T,gridLabelId:L}=r,z=kue({shouldDisableDate:I,minDate:E,maxDate:k,disablePast:O,disableFuture:C}),[B,U]=M.useState(()=>f||e),W=M.useCallback(re=>{T&&T(re)},[T]),$=M.useCallback((re,ve="finish")=>{g||p(re,ve)},[p,g]),N=M.useCallback(re=>{z(re)||(o(re),U(re),W(!0))},[z,o,W]),D=Go();function A(re,ve){switch(re.key){case"ArrowUp":N(n.addDays(ve,-7)),re.preventDefault();break;case"ArrowDown":N(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=Zx({utils:n,date:F,minDate:D.direction==="ltr"?n.startOfMonth(ce):F,maxDate:D.direction==="ltr"?F:n.endOfMonth(ce),isDateDisabled:z});N(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=Zx({utils:n,date:F,minDate:D.direction==="ltr"?F:n.startOfMonth(ce),maxDate:D.direction==="ltr"?n.endOfMonth(ce):F,isDateDisabled:z});N(le||F),re.preventDefault();break}case"Home":N(n.startOfWeek(ve)),re.preventDefault();break;case"End":N(n.endOfWeek(ve)),re.preventDefault();break;case"PageUp":N(n.getNextMonth(ve)),re.preventDefault();break;case"PageDown":N(n.getPreviousMonth(ve)),re.preventDefault();break}}function q(re,ve){N(ve)}function Y(re,ve){R&&n.isSameDay(B,ve)&&W(!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)?Zx({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(eJe,{role:"row",className:i.header,children:n.getWeekdays().map((re,ve)=>{var F;return w.jsx(tJe,{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(nJe,{className:i.loadingContainer,children:x()}):w.jsx(rJe,j({transKey:te,onExited:m,reduceAnimations:v,slideDirection:_,className:Vr(a,i.slideTransition)},S,{nodeRef:J,children:w.jsx(iJe,{ref:J,role:"rowgroup",className:i.monthContainer,children:n.getWeekArray(s).map(re=>w.jsx(oJe,{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:$,tabIndex:F?0:-1,role:"gridcell","aria-selected":ce};return le&&(Q["aria-current"]="date"),y?y(ve,se,Q):M.createElement(GZe,j({},Q,{key:Q.key}))})},`week-${re[0]}`))})}))]})}const sJe=t=>We("MuiPickersCalendarHeader",t);Ve("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]);const lJe=t=>{const{classes:e}=t;return Ue({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},sJe,e)},cJe=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}),uJe=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})),fJe=we("div",{name:"MuiPickersCalendarHeader",slot:"Label",overridesResolver:(t,e)=>e.label})({marginRight:6}),dJe=we(Ot,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton",overridesResolver:(t,e)=>e.switchViewButton})({marginRight:"auto"}),hJe=we(eKe,{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)"})),pJe=Oue();function mJe(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;pJe({leftArrowButtonText:c,rightArrowButtonText:g,getViewSwitchingButtonText:l});const x=Cd(),b=c??x.previousMonth,_=g??x.nextMonth,S=l??x.calendarViewSwitchingButtonAriaLabel,O=Sr(),C=lJe(e),E=r.switchViewButton||{},k=()=>d(O.getNextMonth(i),"left"),I=()=>d(O.getPreviousMonth(i),"right"),P=fZe(i,{disableFuture:a,maxDate:u}),R=dZe(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(cJe,{ownerState:L,className:C.root,children:[w.jsxs(uJe,{role:"presentation",onClick:T,ownerState:L,"aria-live":"polite",className:C.labelContainer,children:[w.jsx(Aue,{reduceAnimations:m,transKey:O.format(i,"monthAndYear"),children:w.jsx(fJe,{id:y,ownerState:L,className:C.label,children:O.format(i,"monthAndYear")})}),v.length>1&&!o&&w.jsx(dJe,j({size:"small",as:n.SwitchViewButton,"aria-label":S(p),className:C.switchViewButton},E,{children:w.jsx(hJe,{as:n.SwitchViewIcon,ownerState:L,className:C.switchViewIcon})}))]}),w.jsx(ZM,{in:p==="day",children:w.jsx(Tue,{leftArrowButtonText:b,rightArrowButtonText:_,components:n,componentsProps:r,onLeftClick:I,onRightClick:k,isLeftDisabled:R,isRightDisabled:P})})]})}function gJe(t){return We("PrivatePickersYear",t)}const rg=Ve("PrivatePickersYear",["root","modeDesktop","modeMobile","yearButton","selected","disabled"]),vJe=["autoFocus","className","children","disabled","onClick","onKeyDown","value","tabIndex","onFocus","onBlur"],yJe=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,gJe,i)},xJe=we("div",{name:"PrivatePickersYear",slot:"Root",overridesResolver:(t,e)=>[e.root,{[`&.${rg.modeDesktop}`]:e.modeDesktop},{[`&.${rg.modeMobile}`]:e.modeMobile}]})(({ownerState:t})=>j({flexBasis:"33.3%",display:"flex",alignItems:"center",justifyContent:"center"},(t==null?void 0:t.wrapperVariant)==="desktop"&&{flexBasis:"25%"})),bJe=we("button",{name:"PrivatePickersYear",slot:"Button",overridesResolver:(t,e)=>[e.button,{[`&.${rg.disabled}`]:e.disabled},{[`&.${rg.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:Hc(t.palette.action.active,t.palette.action.hoverOpacity)},[`&.${rg.disabled}`]:{color:t.palette.text.secondary},[`&.${rg.selected}`]:{color:t.palette.primary.contrastText,backgroundColor:t.palette.primary.main,"&:focus, &:hover":{backgroundColor:t.palette.primary.dark}}})),D9=()=>{},_Je=M.forwardRef(function(e,n){const{autoFocus:r,className:i,children:o,disabled:a,onClick:s,onKeyDown:l,value:c,tabIndex:u,onFocus:f=D9,onBlur:d=D9}=e,h=Ae(e,vJe),p=M.useRef(null),m=Zt(p,n),g=M.useContext(Td),v=j({},e,{wrapperVariant:g}),y=yJe(v);return M.useEffect(()=>{r&&p.current.focus()},[r]),w.jsx(xJe,{className:Vr(y.root,i),ownerState:v,children:w.jsx(bJe,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 wJe(t){return We("MuiYearPicker",t)}Ve("MuiYearPicker",["root"]);const SJe=t=>{const{classes:e}=t;return Ue({root:["root"]},wJe,e)};function OJe(t,e){const n=Sr(),r=q2(),i=qe({props:t,name:e});return j({disablePast:!1,disableFuture:!1},i,{minDate:tc(n,i.minDate,r.minDate),maxDate:tc(n,i.maxDate,r.maxDate)})}const CJe=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"}),TJe=M.forwardRef(function(e,n){const r=fw(),i=Go(),o=Sr(),a=OJe(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=SJe(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(Td),I=M.useRef(null),[P,R]=M.useState(()=>E||o.getYear(r)),[T,L]=Qs({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]),U=(se,te,J="finish")=>{if(g)return;const pe=o.setYear(C,te);m(pe,J)},W=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 $=k==="desktop"?4:3,N=M.useCallback((se,te)=>{switch(se.key){case"ArrowUp":W(te-$),se.preventDefault();break;case"ArrowDown":W(te+$),se.preventDefault();break;case"ArrowLeft":W(te+(i.direction==="ltr"?-1:1)),se.preventDefault();break;case"ArrowRight":W(te+(i.direction==="ltr"?1:-1)),se.preventDefault();break}},[W,i.direction,$]),D=M.useCallback((se,te)=>{W(te)},[W]),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(_Je,{selected:J,value:te,onClick:U,onKeyDown:N,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"))})})}),EJe=typeof navigator<"u"&&/(android)/i.test(navigator.userAgent),PJe=t=>We("MuiCalendarPicker",t);Ve("MuiCalendarPicker",["root","viewTransitionContainer"]);const MJe=["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"],kJe=t=>{const{classes:e}=t;return Ue({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},PJe,e)};function AJe(t,e){const n=Sr(),r=q2(),i=qe({props:t,name:e});return j({loading:!1,disablePast:!1,disableFuture:!1,openTo:"day",views:["year","day"],reduceAnimations:EJe,renderLoading:()=>w.jsx("span",{children:"..."})},i,{minDate:tc(n,i.minDate,r.minDate),maxDate:tc(n,i.maxDate,r.maxDate)})}const RJe=we(Wz,{name:"MuiCalendarPicker",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexDirection:"column"}),IJe=we(Aue,{name:"MuiCalendarPicker",slot:"ViewTransitionContainer",overridesResolver:(t,e)=>e.viewTransitionContainer})({}),DJe=M.forwardRef(function(e,n){const r=Sr(),i=pd(),o=AJe(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,MJe),{openView:L,setOpenView:z,openNext:B}=zz({view:x,views:b,openTo:_,onChange:d,onViewChange:s}),{calendarState:U,changeFocusedDay:W,changeMonth:$,handleChangeMonth:N,isDateDisabled:D,onMonthSwitchingAnimationEnd:A}=DZe({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)?Zx({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(),$(ye)),W(G,!0)},[W,c,u,D,k,E,d,p,$,B,r]),Y=M.useCallback((ee,ge)=>{const ye=r.startOfYear(ee),H=r.endOfYear(ee),G=D(ee)?Zx({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(),$(ye)),W(G,!0)},[W,c,u,D,k,E,d,h,B,r,$]),K=M.useCallback((ee,ge)=>d(l&&ee?r.mergeDateAndTime(ee,l):ee,ge),[r,l,d]);M.useEffect(()=>{l&&$(l)},[l]);const se=o,te=kJe(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]=Qs({name:"DayPicker",state:"focusedView",controlled:P,default:a?L:null}),le=F!==null,Q=_r(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(RJe,{ref:n,className:Vr(te.root,S),ownerState:se,children:[w.jsx(mJe,j({},T,{views:b,openView:L,currentMonth:U.currentMonth,onViewChange:z,onMonthChange:(ee,ge)=>N({newMonth:ee,direction:ge}),minDate:pe,maxDate:be,disabled:O,disablePast:u,disableFuture:c,reduceAnimations:m,labelId:ve})),w.jsx(IJe,{reduceAnimations:m,className:te.viewTransitionContainer,transKey:L,ownerState:se,children:w.jsxs("div",{children:[L==="year"&&w.jsx(TJe,j({},T,J,re,{autoFocus:a,date:l,onChange:Y,shouldDisableYear:y,hasFocus:le,onFocusedViewChange:Q("year")})),L==="month"&&w.jsx(AZe,j({},J,re,{autoFocus:a,hasFocus:le,className:S,date:l,onChange:q,shouldDisableMonth:v,onFocusedViewChange:Q("month")})),L==="day"&&w.jsx(aJe,j({},T,U,J,re,{autoFocus:a,onMonthSwitchingAnimationEnd:A,onFocusedDayChange:W,reduceAnimations:m,selectedDays:[l],onSelectedDaysChange:K,shouldDisableDate:g,hasFocus:le,onFocusedViewChange:Q("day"),gridLabelId:ve}))]})})]})}),LJe=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}},J3=(t,e,n)=>{const r=t.date(e);return e===null?"":t.isValid(r)?t.formatByString(r,n):""},uE="_",Nue="2019-11-21T22:30:00.000",$ue="2019-01-01T09:00:00.000";function NJe(t,e,n,r){if(t)return t;const o=r.formatByString(r.date($ue),e).replace(n,uE),a=r.formatByString(r.date(Nue),e).replace(n,"_");return o===a?o:""}function $Je(t,e,n,r){if(!t)return!1;const o=r.formatByString(r.date($ue),e).replace(n,uE),a=r.formatByString(r.date(Nue),e).replace(n,"_"),s=a===o&&t===a;return!s&&r.lib,s}const FJe=(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===uE?l:a+l;return r+=c.length,o===n.length-1&&s&&s!==uE?c?c+s:"":c}).join("")},jJe=({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=Sr(),m=p.getFormatHelperText(i),{shouldUseMaskedInput:g,maskToUse:v}=M.useMemo(()=>{if(n)return{shouldUseMaskedInput:!1,maskToUse:""};const T=NJe(s,i,t,p);return{shouldUseMaskedInput:$Je(T,i,t,p),maskToUse:T}},[t,n,i,s,p]),y=M.useMemo(()=>g&&v?FJe(v,t):T=>T,[t,v,g]),x=c===null?null:p.date(c),[b,_]=M.useState(x),[S,O]=M.useState(J3(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),U=c===null||p.isValid(B);let W=b===null&&B===null;if(b!==null&&B!==null){const N=p.isEqual(b,B);if(N)W=!0;else{const D=Math.abs(p.getDiff(b,B));W=D===0?N:D<1e3}}if(!L&&!z&&(!U||W))return;const $=J3(p,c,i);_(B),O($)},[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=LJe({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)},BJe=["className","components","disableOpenPicker","getOpenDialogAriaText","InputAdornmentProps","InputProps","inputRef","openPicker","OpenPickerButtonProps","renderInput"],Fue=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,BJe),p=Cd(),m=a??p.openDatePickerDialogue,g=Sr(),v=jJe(h),y=(s==null?void 0:s.position)||"end",x=i.OpenPickerIcon||pue;return d(j({ref:n,inputRef:c,className:r},v,{InputProps:j({},l,{[`${y}Adornment`]:o?void 0:w.jsx(Wke,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 L9(){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 zJe=(t,e)=>{const[n,r]=M.useState(L9);return Hr(()=>{const o=()=>{r(L9())};return window.addEventListener("orientationchange",o),()=>{window.removeEventListener("orientationchange",o)}},[]),xue(t,["hours","minutes","seconds"])?!1:(e||n)==="landscape"},UJe=({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 WJe(t){return We("MuiCalendarOrClockPicker",t)}Ve("MuiCalendarOrClockPicker",["root","mobileKeyboardInputView"]);const VJe=["autoFocus","className","parsedValue","DateInputProps","isMobileKeyboardViewOpen","onDateChange","onViewChange","openTo","orientation","showToolbar","toggleMobileKeyboardView","ToolbarComponent","toolbarFormat","toolbarPlaceholder","toolbarTitle","views","dateRangeIcon","timeIcon","hideTabs","classes"],GJe=t=>{const{classes:e}=t;return Ue({root:["root"],mobileKeyboardInputView:["mobileKeyboardInputView"]},WJe,e)},HJe=we("div",{name:"MuiCalendarOrClockPicker",slot:"MobileKeyboardInputView",overridesResolver:(t,e)=>e.mobileKeyboardInputView})({padding:"16px 24px"}),qJe=we("div",{name:"MuiCalendarOrClockPicker",slot:"Root",overridesResolver:(t,e)=>e.root})(({ownerState:t})=>j({display:"flex",flexDirection:"column"},t.isLandscape&&{flexDirection:"row"})),XJe={fullWidth:!0},N9=t=>t==="year"||t==="month"||t==="day",$9=t=>t==="hours"||t==="minutes"||t==="seconds";function jue(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,VJe),O=(e=S.components)==null?void 0:e.Tabs,C=zJe(y,f),E=M.useContext(Td),k=GJe(r),I=d??E!=="desktop",P=!_&&typeof window<"u"&&window.innerHeight>667,R=M.useCallback(($,N)=>{l($,E,N)},[l,E]),T=M.useCallback($=>{s&&h(),c&&c($)},[s,c,h]),{openView:L,setOpenView:z,handleChangeAndOpenNext:B}=zz({view:void 0,views:y,openTo:u,onChange:R,onViewChange:T}),{focusedView:U,setFocusedView:W}=UJe({autoFocus:i,openView:L});return w.jsxs(qJe,{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(Wz,{children:s?w.jsx(HJe,{className:k.mobileKeyboardInputView,children:w.jsx(Fue,j({},a,{ignoreInvalidInputs:!0,disableOpenPicker:!0,TextFieldProps:XJe}))}):w.jsxs(M.Fragment,{children:[N9(L)&&w.jsx(DJe,j({autoFocus:i,date:o,onViewChange:z,onChange:B,view:L,views:y.filter(N9),focusedView:U,onFocusedViewChange:W},S)),$9(L)&&w.jsx(bZe,j({},S,{autoFocus:i,date:o,view:L,views:y.filter($9),onChange:B,onViewChange:z,showViewSwitcher:E==="desktop"}))]})})]})}const QJe=({adapter:t,value:e,props:n})=>{const{minTime:r,maxTime:i,minutesStep:o,shouldDisableTime:a,disableIgnoringDatePartForTimeValidation:s}=n,l=t.utils.date(e),c=Eue(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}},YJe=["minDate","maxDate","disableFuture","shouldDisableDate","disablePast"],KJe=({props:t,value:e,adapter:n})=>{const{minDate:r,maxDate:i,disableFuture:o,shouldDisableDate:a,disablePast:s}=t,l=Ae(t,YJe),c=Mue({adapter:n,value:e,props:{minDate:r,maxDate:i,disableFuture:o,shouldDisableDate:a,disablePast:s}});return c!==null?c:QJe({adapter:n,value:e,props:l})},ZJe=(t,e)=>t===e;function Bue(t){return RZe(t,KJe,ZJe)}const JJe=({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}},zue=(t,e)=>{const{onAccept:n,onChange:r,value:i,closeOnSelect:o}=t,a=Sr(),{isOpen:s,setIsOpen:l}=JJe(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 eet(t){return We("MuiDateTimePickerTabs",t)}Ve("MuiDateTimePickerTabs",["root"]);const tet=t=>["day","month","year"].includes(t)?"date":"time",net=t=>t==="date"?"day":"hours",ret=t=>{const{classes:e}=t;return Ue({root:["root"]},eet,e)},iet=we(k5,{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}`,[`& .${kC.indicator}`]:{bottom:"auto",top:0}})),Uue=function(e){const n=qe({props:e,name:"MuiDateTimePickerTabs"}),{dateRangeIcon:r=w.jsx(iKe,{}),onChange:i,timeIcon:o=w.jsx(aKe,{}),view:a}=n,s=Cd(),l=M.useContext(Td),c=j({},n,{wrapperVariant:l}),u=ret(c),f=(d,h)=>{i(net(h))};return w.jsxs(iet,{ownerState:c,variant:"fullWidth",value:tet(a),onChange:f,className:u.root,children:[w.jsx(Nb,{value:"date","aria-label":s.dateTableLabel,icon:w.jsx(M.Fragment,{children:r})}),w.jsx(Nb,{value:"time","aria-label":s.timeTableLabel,icon:w.jsx(M.Fragment,{children:o})})]})},oet=["onChange","PaperProps","PopperProps","ToolbarComponent","TransitionComponent","value","components","componentsProps","hideTabs"],aet=M.forwardRef(function(e,n){const r=uue(e,"MuiDesktopDateTimePicker"),i=Bue(r)!==null,{pickerProps:o,inputProps:a,wrapperProps:s}=zue(r,fue),{PaperProps:l,PopperProps:c,ToolbarComponent:u=vue,TransitionComponent:f,components:d,componentsProps:h,hideTabs:p=!0}=r,m=Ae(r,oet),g=M.useMemo(()=>j({Tabs:Uue},d),[d]),v=j({},a,m,{components:g,componentsProps:h,ref:n,validationError:i});return w.jsx(AKe,j({},s,{DateInputProps:v,KeyboardDateInputComponent:Fue,PopperProps:c,PaperProps:l,TransitionComponent:f,components:g,componentsProps:h,children:w.jsx(jue,j({},o,{autoFocus:!0,toolbarTitle:r.label||r.toolbarTitle,ToolbarComponent:u,DateInputProps:v,components:g,componentsProps:h,hideTabs:p},m))}))}),set=we(rl)({[`& .${Bx.container}`]:{outline:0},[`& .${Bx.paper}`]:{outline:0,minWidth:Pue}}),cet=we(Ys)({"&:first-of-type":{padding:0}}),uet=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:yue;return w.jsxs(set,j({open:c,onClose:a},r,{children:[w.jsx(cet,{children:n}),w.jsx(d,j({onAccept:i,onClear:o,onCancel:s,onSetToday:l,actions:["cancel","accept"]},f==null?void 0:f.actionBar))]}))},fet=["children","DateInputProps","DialogProps","onAccept","onClear","onDismiss","onCancel","onSetToday","open","PureDateInputComponent","components","componentsProps"];function det(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,fet);return w.jsxs(Td.Provider,{value:"mobile",children:[w.jsx(u,j({components:f},h,n)),w.jsx(uet,{DialogProps:r,onAccept:i,onClear:o,onDismiss:a,onCancel:s,onSetToday:l,open:c,components:f,componentsProps:d,children:e})]})}const het=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=Cd(),g=i??m.openDatePickerDialogue,v=Sr(),y=M.useMemo(()=>j({},a,{readOnly:!0}),[a]),x=J3(v,u,o),b=_r(_=>{_.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:bue(c)})},d))}),pet=["ToolbarComponent","value","onChange","components","componentsProps","hideTabs"],met=M.forwardRef(function(e,n){const r=uue(e,"MuiMobileDateTimePicker"),i=Bue(r)!==null,{pickerProps:o,inputProps:a,wrapperProps:s}=zue(r,fue),{ToolbarComponent:l=vue,components:c,componentsProps:u,hideTabs:f=!1}=r,d=Ae(r,pet),h=M.useMemo(()=>j({Tabs:Uue},c),[c]),p=j({},a,d,{components:h,componentsProps:u,ref:n,validationError:i});return w.jsx(det,j({},d,s,{DateInputProps:p,PureDateInputComponent:het,components:h,componentsProps:u,children:w.jsx(jue,j({},o,{autoFocus:!0,toolbarTitle:r.label||r.toolbarTitle,ToolbarComponent:l,DateInputProps:p,components:h,componentsProps:u,hideTabs:f},d))}))}),get=["desktopModeMediaQuery","DialogProps","PopperProps","TransitionComponent"],vet=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,get);return ySe(i,{defaultMatches:!0})?w.jsx(aet,j({ref:n,PopperProps:a,TransitionComponent:s},l)):w.jsx(met,j({ref:n,DialogProps:o},l))}),yet=t=>({dateTimePicker:{marginTop:t.spacing(2.5)}}),xet=({classes:t,hasTimeDimension:e,selectedTime:n,selectedTimeRange:r,selectTime:i})=>{const o=d=>{i(d!==null?JUe(d):null)},a=w.jsx(ny,{shrink:!0,htmlFor:"time-select",children:`${fe.get("Time")} (UTC)`}),l=typeof n=="number"?nR(n):null;let c,u;Array.isArray(r)&&(c=nR(r[0]),u=nR(r[1]));const f=w.jsx(UYe,{dateAdapter:qYe,children:w.jsx(vet,{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(cr,{...d,variant:"standard",size:"small"})})});return w.jsx(Yb,{label:a,control:f})},bet=jYe(yet)(xet),_et=t=>({locale:t.controlState.locale,hasTimeDimension:!!_y(t),selectedTime:t.controlState.selectedTime,selectedTimeRange:t.controlState.selectedTimeRange}),wet={selectTime:k2},Oet=Jt(_et,wet)(bet),F9=5,Cet={box:t=>({marginTop:t.spacing(1),marginLeft:t.spacing(F9),marginRight:t.spacing(F9),minWidth:200}),label:{color:"grey",fontSize:"1em"}};function Tet({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*Aae.years,Date.now()]);const c=[{value:r[0],label:Xb(r[0])},{value:r[1],label:Xb(r[1])}];function u(f){return gy(f)}return w.jsx(Ke,{sx:Cet.box,children:w.jsx(xt,{arrow:!0,title:fe.get("Select time in dataset"),children:w.jsx(ry,{disabled:!l,min:r[0],max:r[1],value:i||0,valueLabelDisplay:"off",valueLabelFormat:u,marks:c,onChange:a,onChangeCommitted:s,size:"small"})})})}const Eet=t=>({locale:t.controlState.locale,hasTimeDimension:!!_y(t),selectedTime:t.controlState.selectedTime,selectedTimeRange:t.controlState.selectedTimeRange}),Pet={selectTime:k2,selectTimeRange:wle},Met=Jt(Eet,Pet)(Tet);var Vz={},ket=ft;Object.defineProperty(Vz,"__esModule",{value:!0});var Wue=Vz.default=void 0,Aet=ket(pt()),Ret=w;Wue=Vz.default=(0,Aet.default)((0,Ret.jsx)("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft");var Gz={},Iet=ft;Object.defineProperty(Gz,"__esModule",{value:!0});var Vue=Gz.default=void 0,Det=Iet(pt()),Let=w;Vue=Gz.default=(0,Det.default)((0,Let.jsx)("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight");var Hz={},Net=ft;Object.defineProperty(Hz,"__esModule",{value:!0});var Gue=Hz.default=void 0,$et=Net(pt()),Fet=w;Gue=Hz.default=(0,$et.default)((0,Fet.jsx)("path",{d:"M18.41 16.59 13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),"FirstPage");var qz={},jet=ft;Object.defineProperty(qz,"__esModule",{value:!0});var Hue=qz.default=void 0,Bet=jet(pt()),zet=w;Hue=qz.default=(0,Bet.default)((0,zet.jsx)("path",{d:"M5.59 7.41 10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),"LastPage");var Xz={},Uet=ft;Object.defineProperty(Xz,"__esModule",{value:!0});var que=Xz.default=void 0,Wet=Uet(pt()),Vet=w;que=Xz.default=(0,Wet.default)((0,Vet.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 Qz={},Get=ft;Object.defineProperty(Qz,"__esModule",{value:!0});var Xue=Qz.default=void 0,Het=Get(pt()),qet=w;Xue=Qz.default=(0,Het.default)((0,qet.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 um={formControl:t=>({marginTop:t.spacing(2.5),marginLeft:t.spacing(1),marginRight:t.spacing(1)}),iconButton:{padding:"2px"}};function Xet({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(que,{}):w.jsx(Xue,{}),x=w.jsx(Ot,{disabled:!v,onClick:c,size:"small",sx:um.iconButton,children:w.jsx(xt,{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:um.iconButton,children:w.jsx(xt,{arrow:!0,title:fe.get("First time step"),children:w.jsx(Gue,{})})}),_=w.jsx(Ot,{disabled:!v||t,onClick:f,size:"small",sx:um.iconButton,children:w.jsx(xt,{arrow:!0,title:fe.get("Previous time step"),children:w.jsx(Wue,{})})}),S=w.jsx(Ot,{disabled:!v||t,onClick:u,size:"small",sx:um.iconButton,children:w.jsx(xt,{arrow:!0,title:fe.get("Next time step"),children:w.jsx(Vue,{})})}),O=w.jsx(Ot,{disabled:!v||t,onClick:h,size:"small",sx:um.iconButton,children:w.jsx(xt,{arrow:!0,title:fe.get("Last time step"),children:w.jsx(Hue,{})})});return w.jsx(ty,{sx:um.formControl,variant:"standard",children:w.jsxs(Ke,{children:[b,_,x,S,O]})})}const Qet=t=>({locale:t.controlState.locale,selectedTime:t.controlState.selectedTime,selectedTimeRange:t.controlState.selectedTimeRange,timeAnimationActive:t.controlState.timeAnimationActive,timeAnimationInterval:t.controlState.timeAnimationInterval}),Yet={selectTime:k2,incSelectedTime:A8e,updateTimeAnimation:I8e},Ket=Jt(Qet,Yet)(Xet);var Yz={},Zet=ft;Object.defineProperty(Yz,"__esModule",{value:!0});var Que=Yz.default=void 0,Jet=Zet(pt()),ett=w;Que=Yz.default=(0,Jet.default)((0,ett.jsx)("path",{d:"M16 20H2V4h14zm2-12h4V4h-4zm0 12h4v-4h-4zm0-6h4v-4h-4z"}),"ViewSidebar");const ttt=Li(ty)(({theme:t})=>({marginTop:t.spacing(2),marginRight:t.spacing(.5),marginLeft:"auto"}));function ntt({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:ko.toggleButton,children:w.jsx(xt,{arrow:!0,title:fe.get("Show or hide sidebar"),children:w.jsx(Que,{})})});let l,c,u;return a&&(l=i&&w.jsx(Ot,{onClick:o,size:"small",children:w.jsx(xt,{arrow:!0,title:fe.get("Refresh"),children:w.jsx(U5,{})})}),c=Kt.instance.branding.allowDownloads&&w.jsx(Ot,{onClick:()=>r("export"),size:"small",children:w.jsx(xt,{arrow:!0,title:fe.get("Export data"),children:w.jsx(G5,{})})}),u=w.jsx(Ot,{onClick:()=>r("settings"),size:"small",children:w.jsx(xt,{arrow:!0,title:fe.get("Settings"),children:w.jsx(B5,{})})})),w.jsx(ttt,{variant:"standard",children:w.jsxs(Ke,{children:[l,c,u,s]})})}const rtt=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}),itt={setSidebarOpen:oz,openDialog:Lp,updateResources:Bse},ott=Jt(rtt,itt)(ntt),att=t=>({locale:t.controlState.locale,show:t.dataState.datasets.length>0}),stt={},ltt=({show:t})=>t?w.jsxs(bqe,{children:[w.jsx(Pqe,{}),w.jsx(Xqe,{}),w.jsx(oXe,{}),w.jsx(pXe,{}),w.jsx(IXe,{}),w.jsx(Oet,{}),w.jsx(Ket,{}),w.jsx(Met,{}),w.jsx(ott,{})]}):null,ctt=Jt(att,stt)(ltt);function Yue(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 j9={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 utt({dir:t,onChange:e}){const r=Yue(([i,o])=>{e(i)});return w.jsx(Ke,{sx:t==="hor"?j9.hor:j9.ver,onMouseDown:r})}const zS={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 ftt({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"?zS.childHor:zS.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"?zS.hor:zS.ver},children:[w.jsx("div",{ref:s,id:"SplitPane-Child-1",style:{...l,...o,...c},children:r[0]}),w.jsx(utt,{dir:t,onChange:u}),w.jsx("div",{id:"SplitPane-Child-2",style:{...l,...a},children:r[1]})]})}const dtt=({placeGroup:t,mapProjection:e,visible:n})=>{const r=M.useRef(new Q1);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 Ip().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";QB(d,h,R5(p),m),i.addFeature(d)})}},[t,e]),w.jsx(v2,{id:t.id,opacity:t.id===Ws?1:.8,visible:n,zIndex:501,source:r.current})};class htt extends my{addMapObject(e){const n=new $5e(this.getOptions());return e.addControl(n),n}updateMapObject(e,n,r){return n.setProperties(this.getOptions()),n}removeMapObject(e,n){e.removeControl(n)}}class PR extends my{addMapObject(e){const n=new hBe(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 ptt extends my{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 Uc({...this.props,center:a2(i.getCenter()||[0,0],r,n),minZoom:i.getMinZoom(),zoom:i.getZoom()});e.getLayers().forEach(a=>{a instanceof h2&&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 US(t,e){const n=t.getLayers();for(let r=0;r{if(R){const N=C||null;if(N!==L&&Ga[MR]){const A=Ga[MR].getSource();if(A.clear(),N){const q=xtt(R,N);if(q){const Y=q.clone();Y.setId("select-"+q.getId()),Y.setStyle(void 0),A.addFeature(Y)}}z(N)}}},[R,C,L]),M.useEffect(()=>{R&&R.getLayers().forEach(N=>{N instanceof iae?N.getSource().changed():N.changed()})},[R,k]),M.useEffect(()=>{if(R===null||!En(I))return;const N=J=>{z9(R,J,I,0)},D=J=>{z9(R,J,I,1)},A=J=>{J.context.restore()},q=US(R,"rgb2"),Y=US(R,"variable2"),K=US(R,"rgb"),se=US(R,"variable"),te=[[q,N],[Y,N],[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=N=>{if(n==="Select"){const D=N.map;let A=null;const q=D.getFeaturesAtPixel(N.pixel);if(q){for(const Y of q)if(typeof Y.getId=="function"){A=Y.getId()+"";break}}O&&O(A,E,!1)}},U=N=>{var D;if(R!==null&&y&&n!=="Select"){const A=N.feature;let q=A.getGeometry();if(!q)return;const Y=Js(cy+n.toLowerCase()+"-"),K=R.getView().getProjection();if(q instanceof RB){const re=r$e(q);A.setGeometry(re)}q=A.clone().getGeometry().transform(K,py);const se=new Ip().writeGeometryObject(q);A.setId(Y);let te=0;if(Ga[Ws]){const re=Ga[Ws],ve=(D=re==null?void 0:re.getSource())==null?void 0:D.getFeatures();ve&&(te=ve.length)}const J=btt(b,n),pe=tp(te),be=uie(pe,t.palette.mode);QB(A,be,R5()),y(v,Y,{label:J,color:pe},se,!0)}return!0};function W(N){P&&P(N),T(N)}const $=N=>{x&&N.forEach(D=>{const A=new FileReader;A.onloadend=()=>{typeof A.result=="string"&&x(A.result)},A.readAsText(D,"UTF-8")})};return w.jsx(Sie,{children:w.jsxs(nze,{id:e,onClick:N=>B(N),onMapRef:W,mapObjects:Ga,isStale:!0,onDropFiles:$,children:[w.jsx(ptt,{id:"view",projection:r}),w.jsxs(rae,{children:[i,o,a,s,l,f,c,w.jsx(v2,{id:MR,opacity:.7,zIndex:500,style:vtt,source:mtt}),w.jsx(w.Fragment,{children:b.map(N=>w.jsx(dtt,{placeGroup:N,mapProjection:r,visible:S&&_[N.id]},N.id))})]}),u,w.jsx(PR,{id:"drawPoint",layerId:Ws,active:n==="Point",type:"Point",wrapX:!0,stopClick:!0,onDrawEnd:U}),w.jsx(PR,{id:"drawPolygon",layerId:Ws,active:n==="Polygon",type:"Polygon",wrapX:!0,stopClick:!0,onDrawEnd:U}),w.jsx(PR,{id:"drawCircle",layerId:Ws,active:n==="Circle",type:"Circle",wrapX:!0,stopClick:!0,onDrawEnd:U}),d,h,m,g,p,w.jsx(htt,{bar:!1})]})})}function xtt(t,e){var n;for(const r of t.getLayers().getArray())if(r instanceof h2){const o=(n=r.getSource())==null?void 0:n.getFeatureById(e);if(o)return o}return null}function btt(t,e){const n=fe.get(e),r=t.find(i=>i.id===Ws);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 z9(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=Lu(e,[0,0]),l=Lu(e,[n,0]),c=Lu(e,[0,a]),u=Lu(e,[n,a])):(s=Lu(e,[n,0]),l=Lu(e,[o,0]),c=Lu(e,[n,a]),u=Lu(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 WS=1,Jb=.2,Ey=240,Zue=20,VS={container:{width:Ey},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 _tt({categories:t,onOpenColorBarEditor:e}){return!t||t.length===0?null:w.jsx(Ke,{sx:VS.container,children:t.map((n,r)=>w.jsxs(Ke,{onClick:e,sx:VS.itemContainer,children:[w.jsx(Ke,{sx:VS.itemColorBox,style:{backgroundColor:n.color}}),w.jsx(Ke,{component:"span",sx:VS.itemLabelBox,children:`${n.label||`Category ${r+1}`} (${n.value})`})]},r))})}const U9={nominal:{cursor:"pointer"},error:{cursor:"pointer",border:"0.5px solid red"}};function wtt({colorBar:t,opacity:e,width:n,height:r,onClick:i}){const o=M.useRef(null);M.useEffect(()=>{const c=o.current;c!==null&&iWe(t,e,c)},[t,e]);const{baseName:a,imageData:s}=t,l=s?a:fe.get("Unknown color bar")+`: ${a}`;return w.jsx(xt,{title:l,children:w.jsx("canvas",{ref:o,width:n||Ey,height:r||Zue+4,onClick:i,style:s?U9.nominal:U9.error})})}function Stt(t,e,n=5,r=!1,i=!1){return eN(Ctt(t,e,n,r),i)}function eN(t,e=!1){return t.map(n=>rd(n,void 0,e))}function rd(t,e,n){if(e===void 0&&(e=n?2:Ott(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 Ott(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 Ctt(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;lStt(t,e,n,r),[t,e,n,r]);return w.jsx(Ke,{sx:Ttt.container,onClick:i,children:o.map((a,s)=>w.jsx("span",{children:a},s))})}var Kz={},Ptt=ft;Object.defineProperty(Kz,"__esModule",{value:!0});var Jue=Kz.default=void 0,Mtt=Ptt(pt()),ktt=w;Jue=Kz.default=(0,Mtt.default)((0,ktt.jsx)("path",{d:"M8 19h3v3h2v-3h3l-4-4zm8-15h-3V1h-2v3H8l4 4zM4 9v2h16V9zm0 3h16v2H4z"}),"Compress");const W9=t=>t,Att=t=>Math.pow(10,t),Rtt=Math.log10,V9=(t,e)=>typeof t=="number"?e(t):t.map(e);class Itt{constructor(e){Yt(this,"_fn");Yt(this,"_invFn");e?(this._fn=Rtt,this._invFn=Att):(this._fn=W9,this._invFn=W9)}scale(e){return V9(e,this._fn)}scaleInv(e){return V9(e,this._invFn)}}function Dtt({variableColorBarName:t,variableColorBarMinMax:e,variableColorBarNorm:n,variableOpacity:r,updateVariableColorBar:i,originalColorBarMinMax:o}){const a=M.useMemo(()=>new Itt(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=eN(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(ry,{min:b,max:_,value:s,marks:C,step:S,valueLabelFormat:E=>rd(a.scaleInv(E)),onChange:c,onChangeCommitted:u,valueLabelDisplay:"auto",size:"small"})}const kR=5,ju={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(kR),marginRight:t.spacing(kR),minWidth:320,width:`calc(100% - ${t.spacing(2*(kR+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 Ltt({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(G9(n)),[d,h]=M.useState([!1,!1]);M.useEffect(()=>{f(G9(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:ju.container,children:[w.jsxs(Ke,{sx:ju.header,children:[w.jsx(At,{sx:ju.title,children:fe.get("Value Range")}),w.jsx("span",{style:{flexGrow:1}}),t.colorRecords&&w.jsx(Ya,{sx:{marginRight:1},icon:w.jsx(Jue,{}),onClick:g,tooltipText:fe.get("Set min/max from color mapping values")}),w.jsx(Og,{sx:ju.logLabel,control:w.jsx(xt,{title:fe.get("Logarithmic scaling"),children:w.jsx(iie,{checked:r==="log",onChange:v,size:"small"})}),label:w.jsx(At,{variant:"body2",children:fe.get("Log-scaled")}),labelPlacement:"start"})]}),w.jsx(Ke,{sx:ju.sliderBox,children:w.jsx(Dtt,{variableColorBarName:e,variableColorBarMinMax:n,variableColorBarNorm:r,updateVariableColorBar:o,originalColorBarMinMax:l,variableOpacity:i})}),w.jsxs(Ke,{component:"form",sx:ju.minMaxBox,children:[w.jsx(cr,{sx:ju.minTextField,label:"Minimum",variant:"filled",size:"small",value:u[0],error:d[0],onChange:y=>p(y)}),w.jsx(cr,{sx:ju.maxTextField,label:"Maximum",variant:"filled",size:"small",value:u[1],error:d[1],onChange:y=>m(y)})]})]})}function G9(t){return[t[0]+"",t[1]+""]}function Ntt({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(wtt,{colorBar:t,opacity:i,onClick:a}),w.jsx(Ett,{minValue:n[0],maxValue:n[1],numTicks:5,logScaled:r==="log",onClick:c}),w.jsx(Ep,{anchorEl:s,open:!!s,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"center"},children:w.jsx(Ltt,{variableColorBar:t,variableColorBarName:e,variableColorBarMinMax:n,variableColorBarNorm:r,variableOpacity:i,updateVariableColorBar:o})})]})}var Zz={},$tt=ft;Object.defineProperty(Zz,"__esModule",{value:!0});var efe=Zz.default=void 0,Ftt=$tt(pt()),jtt=w;efe=Zz.default=(0,Ftt.default)((0,jtt.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 Jz={},Btt=ft;Object.defineProperty(Jz,"__esModule",{value:!0});var tfe=Jz.default=void 0,ztt=Btt(pt()),Utt=w;tfe=Jz.default=(0,ztt.default)((0,Utt.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 M0={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 Wtt({variableColorBarName:t,variableColorBarMinMax:e,variableColorBarNorm:n,variableColorBar:r,variableOpacity:i,updateVariableColorBar:o}){const a=()=>{const c=!r.isAlpha;t=rE({...r,isAlpha:c}),o(t,e,n,i)},s=()=>{const c=!r.isReversed;t=rE({...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:M0.container,children:w.jsxs(Ke,{sx:M0.settingsBar,children:[w.jsx(xt,{arrow:!0,title:fe.get("Hide small values"),children:w.jsx(Pn,{value:"alpha",selected:r.isAlpha,onChange:a,size:"small",children:w.jsx(tfe,{fontSize:"inherit"})})}),w.jsx(xt,{arrow:!0,title:fe.get("Reverse"),children:w.jsx(Pn,{value:"reverse",selected:r.isReversed,onChange:s,size:"small",children:w.jsx(efe,{fontSize:"inherit"})})})]})}),w.jsxs(Ke,{component:"div",sx:M0.opacityContainer,children:[w.jsx(Ke,{component:"span",fontSize:"small",sx:M0.opacityLabel,children:fe.get("Opacity")}),w.jsx(ry,{min:0,max:1,value:i,step:.01,sx:M0.opacitySlider,onChange:l,size:"small"})]})]})}const Vtt={colorBarGroupTitle:t=>({marginTop:t.spacing(2*Jb),fontSize:"small",color:t.palette.text.secondary})};function nfe({title:t,description:e}){return w.jsx(xt,{arrow:!0,title:e,placement:"left",children:w.jsx(Ke,{sx:Vtt.colorBarGroupTitle,children:t})})}const H9=t=>({marginTop:t.spacing(Jb),height:20,borderWidth:1,borderStyle:"solid",cursor:"pointer"}),q9={colorBarItem:t=>({...H9(t),borderColor:t.palette.mode==="dark"?"lightgray":"darkgray"}),colorBarItemSelected:t=>({...H9(t),borderColor:"blue"})};function e4({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(xt,{arrow:!0,title:i,placement:"left",children:o})),w.jsx(Ke,{width:r||Ey,sx:e?q9.colorBarItemSelected:q9.colorBarItem,children:o})}function Gtt({colorBarGroup:t,selectedColorBarName:e,onSelectColorBar:n,images:r}){return w.jsxs(w.Fragment,{children:[w.jsx(nfe,{title:t.title,description:t.description}),t.names.map(i=>w.jsx(e4,{title:i,imageData:r[i],selected:i===e,onSelect:()=>n(i)},i))]})}var t4={},Htt=ft;Object.defineProperty(t4,"__esModule",{value:!0});var dw=t4.default=void 0,qtt=Htt(pt()),Xtt=w;dw=t4.default=(0,qtt.default)((0,Xtt.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 rfe(){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 n4={},Qtt=ft;Object.defineProperty(n4,"__esModule",{value:!0});var ife=n4.default=void 0,Ytt=Qtt(pt()),Ktt=w;ife=n4.default=(0,Ytt.default)((0,Ktt.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 r4={},Ztt=ft;Object.defineProperty(r4,"__esModule",{value:!0});var ofe=r4.default=void 0,Jtt=Ztt(pt()),ent=w;ofe=r4.default=(0,Jtt.default)((0,ent.jsx)("path",{d:"M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"}),"Done");function tnt({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(Ep,{anchorEl:t,open:n,onClose:r,children:w.jsx(Ho,{sx:{width:"32em",overflowY:"auto",fontSize:"smaller",paddingLeft:2,paddingRight:2},children:w.jsx(G2,{children:e,components:i,linkTarget:"_blank"})})})}function afe({size:t,helpUrl:e}){const[n,r]=M.useState(null),i=M.useRef(null),o=Dce(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(F5,{fontSize:"inherit"})}),w.jsx(tnt,{anchorEl:n,open:!!n,onClose:s,markdownText:o})]})}const X9={container:{display:"flex",justifyContent:"space-between",gap:.2},doneCancel:{display:"flex",gap:.2}};function hw({onDone:t,onCancel:e,doneDisabled:n,cancelDisabled:r,size:i,helpUrl:o}){return w.jsxs(Ke,{sx:X9.container,children:[w.jsx(Ke,{children:o&&w.jsx(afe,{size:i,helpUrl:o})}),w.jsxs(Ke,{sx:X9.doneCancel,children:[w.jsx(Ot,{onClick:t,color:"primary",disabled:n,size:i,children:w.jsx(ofe,{fontSize:"inherit"})}),w.jsx(Ot,{onClick:e,color:"primary",disabled:r,size:i,children:w.jsx(ife,{fontSize:"inherit"})})]})]})}const AR={radioGroup:{marginLeft:1},radio:{padding:"4px"},label:{fontSize:"small"}},nnt=[["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 rnt({colorMapType:t,setColorMapType:e}){return w.jsx(T5,{row:!0,value:t,onChange:(n,r)=>{e(r)},sx:AR.radioGroup,children:nnt.map(([n,r,i])=>w.jsx(xt,{arrow:!0,title:fe.get(i),children:w.jsx(Og,{value:n,control:w.jsx(Wx,{size:"small",sx:AR.radio}),label:w.jsx(Ke,{component:"span",sx:AR.label,children:fe.get(r)})})},n))})}function int({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(e4,{imageData:t.imageData,title:t.errorMessage,selected:n,onSelect:r}),w.jsx(rnt,{colorMapType:t.type,setColorMapType:s}),w.jsx(cr,{label:"Color mapping",placeholder:doe,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(hw,{onDone:i,onCancel:o,doneDisabled:!!t.errorMessage,size:"small",helpUrl:fe.get("docs/color-mappings.en.md")})]})}var i4={},ont=ft;Object.defineProperty(i4,"__esModule",{value:!0});var sfe=i4.default=void 0,ant=ont(pt()),snt=w;sfe=i4.default=(0,ant.default)((0,snt.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 lnt={container:{display:"flex",alignItems:"center",width:Ey,height:Zue,gap:Jb,marginTop:Jb}};function cnt({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:lnt.container,children:[w.jsx(e4,{imageData:t,selected:n,onSelect:o,width:Ey-20,title:e}),w.jsx(Ot,{size:"small",onClick:c,children:w.jsx(sfe,{fontSize:"inherit"})})]}),w.jsx(Ep,{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(Fp,{fontSize:"inherit"})}),w.jsx(Ot,{onClick:d,size:"small",disabled:a,children:w.jsx(lw,{fontSize:"inherit"})})]})})]})}const unt={container:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:1}};function fnt({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]=rfe(),h=M.useMemo(()=>r.findIndex(x=>x.id===c.colorBarId),[r,c.colorBarId]),p=()=>{d(()=>s(r));const x=Js("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:unt.container,children:[w.jsx(nfe,{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(dw,{fontSize:"inherit"})})]}),r.map(x=>x.id===c.colorBarId&&h>=0?w.jsx(int,{userColorBar:x,updateUserColorBar:a,selected:x.id===e,onSelect:()=>n(x.id),onDone:v,onCancel:y},x.id):w.jsx(cnt,{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 dnt({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=rE({...r,baseName:p}),o(t,e,n,i)};return w.jsx(w.Fragment,{children:a.groups.map(p=>p.title===foe?w.jsx(fnt,{colorBarGroup:p,selectedColorBarName:r.baseName,onSelectColorBar:h,userColorBars:s,addUserColorBar:l,removeUserColorBar:c,updateUserColorBar:u,updateUserColorBars:f,storeSettings:d},p.title):w.jsx(Gtt,{colorBarGroup:p,selectedColorBarName:r.baseName,onSelectColorBar:h,images:a.images},p.title))})}const hnt={colorBarBox:t=>({marginTop:t.spacing(WS-2*Jb),marginLeft:t.spacing(WS),marginRight:t.spacing(WS),marginBottom:t.spacing(WS)})};function pnt(t){const{colorBars:e,userColorBars:n,addUserColorBar:r,removeUserColorBar:i,updateUserColorBar:o,updateUserColorBars:a,...s}=t;return w.jsxs(Ke,{sx:hnt.colorBarBox,children:[w.jsx(Wtt,{...s}),w.jsx(dnt,{...s,colorBars:e,userColorBars:n,addUserColorBar:r,removeUserColorBar:i,updateUserColorBar:o,updateUserColorBars:a})]})}const Q9={container:t=>({position:"absolute",zIndex:1e3,top:10,borderRadius:"5px",borderWidth:"1px",borderStyle:"solid",borderColor:"#00000020",backgroundColor:"#FFFFFFAA",color:"black",maxWidth:`${Ey+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 lfe(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:Q9.container,style:o,ref:a,children:[w.jsx(At,{sx:Q9.title,children:f}),i.type==="categorical"?w.jsx(_tt,{categories:i.colorRecords,onOpenColorBarEditor:c,...t}):w.jsx(Ntt,{onOpenColorBarEditor:c,...t}),w.jsx(Ep,{anchorEl:s,open:!!s,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:w.jsx(pnt,{...t})})]})}const mnt=t=>({variableName:yy(t),variableTitle:FWe(t),variableUnits:BWe(t),variableColorBarName:O2(t),variableColorBarMinMax:ise(t),variableColorBarNorm:sse(t),variableColorBar:GB(t),variableOpacity:hse(t),userColorBars:Dp(t),colorBars:T2(t),style:{right:10}}),gnt={updateVariableColorBar:f8e,addUserColorBar:Wle,removeUserColorBar:Hle,updateUserColorBar:qle,updateUserColorBars:Yle,storeSettings:Ule},vnt=Jt(mnt,gnt)(lfe),ynt=t=>{const e=t.controlState.variableSplitPos;return{variableName:e?Yae(t):null,variableTitle:jWe(t),variableUnits:zWe(t),variableColorBarName:C2(t),variableColorBarMinMax:ose(t),variableColorBarNorm:lse(t),variableColorBar:use(t),variableOpacity:pse(t),userColorBars:Dp(t),colorBars:T2(t),style:{left:e?e-280:0}}},xnt={updateVariableColorBar:d8e,addUserColorBar:Wle,removeUserColorBar:Hle,updateUserColorBar:qle,updateUserColorBars:Yle,storeSettings:Ule},bnt=Jt(ynt,xnt)(lfe),_nt={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 wnt({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=Yue(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:_nt.splitter,style:{left:En(e)?e:"50%"},onMouseDown:o})}const Snt=t=>({hidden:!t.controlState.variableCompareMode,position:t.controlState.variableSplitPos}),Ont={onPositionChange:M8e},Cnt=Jt(Snt,Ont)(wnt);function Tnt(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 j$e(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],_=a2(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=Ga.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 vc={container:{display:"grid",gridTemplateColumns:"auto minmax(60px, auto)",gap:0,padding:1,fontSize:"small"},labelItem:{paddingRight:1},valueItem:{textAlign:"right",fontFamily:"monospace"}};function Ent({location:t,payload:e,payload2:n}){return w.jsxs(Ke,{sx:vc.container,children:[w.jsx(Ke,{sx:vc.labelItem,children:"Longitude"}),w.jsx(Ke,{sx:vc.valueItem,children:rd(t.lon,4)}),w.jsx(Ke,{sx:vc.labelItem,children:"Latitude"}),w.jsx(Ke,{sx:vc.valueItem,children:rd(t.lat,4)}),w.jsx(Ke,{sx:vc.labelItem,children:Y9(e)}),w.jsx(Ke,{sx:vc.valueItem,children:K9(e)}),n&&w.jsx(Ke,{sx:vc.labelItem,children:Y9(n)}),n&&w.jsx(Ke,{sx:vc.valueItem,children:K9(n)})]})}function Y9(t){const e=t.variable;return e.title||e.name}function K9(t){const e=t.result;return e.error?`${e.error}`:e.fetching?"...":En(e.value)?rd(e.value,4):"---"}const Pnt={container:{position:"absolute",zIndex:1e3,backgroundColor:"#000000A0",color:"#fff",border:"1px solid #FFFFFF50",borderRadius:"4px",transform:"translateX(3%)",pointerEvents:"none"}};function Mnt({enabled:t,serverUrl:e,dataset1:n,variable1:r,dataset2:i,variable2:o,time:a}){const s=Tnt(t,e,n,r,i,o,a);if(!s)return null;const{pixelX:l,pixelY:c}=s.location;return w.jsx(Ke,{sx:{...Pnt.container,left:l,top:c},children:w.jsx(Ent,{...s})})}const knt=t=>({enabled:t.controlState.mapPointInfoBoxEnabled,serverUrl:pi(t).url,dataset1:qr(t),variable1:vo(t),dataset2:Sd(t),variable2:Su(t),time:wy(t)}),Ant={},Rnt=Jt(knt,Ant)(Mnt);var o4={},Int=ft;Object.defineProperty(o4,"__esModule",{value:!0});var cfe=o4.default=void 0,Dnt=Int(pt()),Lnt=w;cfe=o4.default=(0,Dnt.default)((0,Lnt.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 a4={},Nnt=ft;Object.defineProperty(a4,"__esModule",{value:!0});var s4=a4.default=void 0,$nt=Nnt(pt()),Fnt=w;s4=a4.default=(0,$nt.default)((0,Fnt.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 l4={},jnt=ft;Object.defineProperty(l4,"__esModule",{value:!0});var ufe=l4.default=void 0,Bnt=jnt(pt()),znt=w;ufe=l4.default=(0,Bnt.default)((0,znt.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 Unt({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 ffe={width:"1.375em",height:"1.375em"},Wnt={...ffe,backgroundColor:"rgba(0,80,180,0.9)"},Vnt={tooltip:{sx:{backgroundColor:"#4A4A4A",border:"1px solid white",borderRadius:0}}};function RR({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(xt,{title:e,componentsProps:Vnt,children:t})),w.jsx(Ot,{onClick:o,style:r?Wnt:ffe,children:t})}const Gnt={left:"0.5em",top:65};function Hnt({layerMenuOpen:t,setLayerMenuOpen:e,variableCompareMode:n,setVariableCompareMode:r,mapPointInfoBoxEnabled:i,setMapPointInfoBoxEnabled:o}){return w.jsxs(Unt,{style:Gnt,children:[w.jsx(RR,{icon:w.jsx(s4,{fontSize:"small"}),tooltipTitle:fe.get("Show or hide layers panel"),selected:t,onSelect:(a,s)=>void e(s)}),w.jsx(RR,{icon:w.jsx(cfe,{fontSize:"small"}),tooltipTitle:fe.get("Turn layer split mode on or off"),selected:n,onSelect:(a,s)=>void r(s)}),w.jsx(RR,{icon:w.jsx(ufe,{fontSize:"small"}),tooltipTitle:fe.get("Turn info box on or off"),selected:i,onSelect:(a,s)=>void o(s)})]})}const qnt=t=>({layerMenuOpen:t.controlState.layerMenuOpen,variableCompareMode:t.controlState.variableCompareMode,mapPointInfoBoxEnabled:t.controlState.mapPointInfoBoxEnabled}),Xnt={setLayerMenuOpen:Ele,setVariableCompareMode:P8e,setMapPointInfoBoxEnabled:E8e},Qnt=Jt(qnt,Xnt)(Hnt),Ynt=(t,e)=>({mapId:"map",locale:t.controlState.locale,variableLayer:fVe(t),variable2Layer:dVe(t),rgbLayer:hVe(t),rgb2Layer:pVe(t),datasetBoundaryLayer:uVe(t),placeGroupLayers:yVe(t),colorBarLegend:w.jsx(vnt,{}),colorBarLegend2:w.jsx(bnt,{}),mapSplitter:w.jsx(Cnt,{}),mapPointInfoBox:w.jsx(Rnt,{}),mapControlActions:w.jsx(Qnt,{}),userDrawnPlaceGroupName:t.controlState.userDrawnPlaceGroupName,userPlaceGroups:J1(t),userPlaceGroupsVisibility:qWe(t),showUserPlaces:Kae(t),mapInteraction:t.controlState.mapInteraction,mapProjection:wd(t),selectedPlaceId:t.controlState.selectedPlaceId,places:rw(t),baseMapLayer:wVe(t),overlayLayer:SVe(t),imageSmoothing:nw(t),variableSplitPos:t.controlState.variableSplitPos,onMapRef:e.onMapRef}),Knt={addDrawnUserPlace:VVe,importUserPlacesFromText:Wse,selectPlace:M2},J9=Jt(Ynt,Knt)(ytt);var c4={},Znt=ft;Object.defineProperty(c4,"__esModule",{value:!0});var u4=c4.default=void 0,Jnt=Znt(pt()),ert=w;u4=c4.default=(0,Jnt.default)((0,ert.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 f4={},trt=ft;Object.defineProperty(f4,"__esModule",{value:!0});var dfe=f4.default=void 0,nrt=trt(pt()),rrt=w;dfe=f4.default=(0,nrt.default)((0,rrt.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 d4={},irt=ft;Object.defineProperty(d4,"__esModule",{value:!0});var hfe=d4.default=void 0,ort=irt(pt()),art=w;hfe=d4.default=(0,ort.default)((0,art.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 h4={},srt=ft;Object.defineProperty(h4,"__esModule",{value:!0});var pfe=h4.default=void 0,lrt=srt(pt()),crt=w;pfe=h4.default=(0,lrt.default)((0,crt.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 p4={},urt=ft;Object.defineProperty(p4,"__esModule",{value:!0});var mfe=p4.default=void 0,frt=urt(pt()),drt=w;mfe=p4.default=(0,frt.default)((0,drt.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 m4={},hrt=ft;Object.defineProperty(m4,"__esModule",{value:!0});var gfe=m4.default=void 0,prt=hrt(pt()),mrt=w;gfe=m4.default=(0,prt.default)((0,mrt.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 g4={},grt=ft;Object.defineProperty(g4,"__esModule",{value:!0});var vfe=g4.default=void 0,vrt=grt(pt()),yrt=w;vfe=g4.default=(0,vrt.default)((0,yrt.jsx)("path",{d:"M2.5 4v3h5v12h3V7h5V4zm19 5h-9v3h3v7h3v-7h3z"}),"TextFields");var v4={},xrt=ft;Object.defineProperty(v4,"__esModule",{value:!0});var yfe=v4.default=void 0,brt=xrt(pt()),_rt=w;yfe=v4.default=(0,brt.default)((0,_rt.jsx)("path",{d:"M13 13v8h8v-8zM3 21h8v-8H3zM3 3v8h8V3zm13.66-1.31L11 7.34 16.66 13l5.66-5.66z"}),"Widgets");let xn=class xfe{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]=lv(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),Tl.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]=lv(this,e,n);let r=[];return this.decompose(e,n,r,0),Tl.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 Jx(this),o=new Jx(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 Jx(this,e)}iterRange(e,n=this.length){return new bfe(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 _fe(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]?xfe.empty:e.length<=32?new Tr(e):Tl.from(Tr.split(e,[]))}};class Tr extends xn{constructor(e,n=wrt(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 Srt(i,s,r,a);i=s+1,r++}}decompose(e,n,r,i){let o=e<=0&&n>=this.length?this:new Tr(e7(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(i&1){let a=r.pop(),s=$C(o.text,a.text.slice(),0,o.length);if(s.length<=32)r.push(new Tr(s,a.length+o.length));else{let l=s.length>>1;r.push(new Tr(s.slice(0,l)),new Tr(s.slice(l)))}}else r.push(o)}replace(e,n,r){if(!(r instanceof Tr))return super.replace(e,n,r);[e,n]=lv(this,e,n);let i=$C(this.text,$C(r.text,e7(this.text,0,e)),n),o=this.length+r.length-(n-e);return i.length<=32?new Tr(i,o):Tl.from(Tr.split(i,[]),o)}sliceString(e,n=this.length,r=` `){[e,n]=lv(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 Tr(r,i)),r=[],i=-1);return i>-1&&n.push(new Tr(r,i)),n}}class Tl extends xn{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]=lv(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 Tl(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]=lv(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 Tl))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 Tr(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 Tl)for(let m of h.children)f(m);else h.lines>a&&(l>a||!l)?(d(),s.push(h)):h instanceof Tr&&l&&(p=u[u.length-1])instanceof Tr&&h.lines+p.lines<=32?(l+=h.lines,c+=h.length+1,u[u.length-1]=new Tr(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]:Tl.from(u,c)),c=-1,l=u.length=0)}for(let h of e)f(h);return d(),s.length==1?s[0]:new Tl(s,n)}}xn.empty=new Tr([""],0);function Ort(t){let e=-1;for(let n of t)e+=n.length+1;return e}function $C(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 Tr?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 Tr?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 Tr){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 Tr?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 _fe{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new eb(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 wfe{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"&&(xn.prototype[Symbol.iterator]=function(){return this.iter()},eb.prototype[Symbol.iterator]=_fe.prototype[Symbol.iterator]=wfe.prototype[Symbol.iterator]=function(){return this});let Crt=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 lv(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}let Mg="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 Mg[e-1]<=t;return!1}function r7(t){return t>=127462&&t<=127487}const i7=8205;function ki(t,e,n=!0,r=!0){return(n?Sfe:Ert)(t,e,r)}function Sfe(t,e,n){if(e==t.length)return e;e&&Ofe(t.charCodeAt(e))&&Cfe(t.charCodeAt(e-1))&&e--;let r=Ci(t,e);for(e+=Ha(r);e=0&&r7(Ci(t,a));)o++,a-=2;if(o%2==0)break;e+=2}else break}return e}function Ert(t,e,n){for(;e>0;){let r=Sfe(t,e-2,n);if(r=56320&&t<57344}function Cfe(t){return t>=55296&&t<56320}function Ci(t,e){let n=t.charCodeAt(e);if(!Cfe(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return Ofe(r)?(n-55296<<10)+(r-56320)+65536:n}function x4(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function Ha(t){return t<65536?1:2}const nN=/\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 Ql{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 Ql(e)}static create(e){return new Ql(e)}}class Zr extends Ql{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 rN(this,(n,r,i,o,a)=>e=e.replace(i,i+(r-n),a),!1),e}mapDesc(e,n=!1){return iN(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&&Of(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"?xn.of(h.split(r||nN)):h:xn.empty,m=p.length;if(f==d&&m==0)return;fa&&qi(i,f-a,-1),qi(i,d-f,m),Of(o,i,p),a=d}}return c(e),l(!s),s}static empty(e){return new Zr(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 Of(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 iN(t,e,n,r=!1){let i=[],o=r?[]:null,a=new t_(t),s=new t_(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 t_{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return n>=e.length?xn.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?xn.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 Sh{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 Sh(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 Sh(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=>Sh.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 Efe(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let b4=0;class ct{constructor(e,n,r,i,o){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=b4++,this.default=e([]),this.extensions=typeof o=="function"?o(this):o}get reader(){return this}static define(e={}){return new ct(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:_4),!!e.static,e.enables)}of(e){return new FC([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new FC(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new FC(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function _4(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class FC{constructor(e,n,r,i){this.dependencies=e,this.facet=n,this.type=r,this.value=i,this.id=b4++}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)||oN(f,u)){let h=r(f);if(s?!o7(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=dE(d,p);if(this.dependencies.every(g=>g instanceof ct?d.facet(g)===f.facet(g):g instanceof mi?d.field(g,!1)==f.field(g,!1):!0)||(s?o7(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 o7(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(a7).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,a7.of({field:this,create:e})]}get extension(){return this}}const uh={lowest:4,low:3,default:2,high:1,highest:0};function A0(t){return e=>new Pfe(e,t)}const Ed={highest:A0(uh.highest),high:A0(uh.high),default:A0(uh.default),low:A0(uh.low),lowest:A0(uh.lowest)};class Pfe{constructor(e,n){this.inner=e,this.prec=n}}class X2{of(e){return new aN(this,e)}reconfigure(e){return X2.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class aN{constructor(e,n){this.compartment=e,this.inner=n}}class fE{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 Mrt(e,n,a))d instanceof mi?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,_4(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=>Prt(g,p,h))}}let f=c.map(d=>d(s));return new fE(e,a,f,s,l,o)}}function Mrt(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 aN&&n.delete(a.compartment)}if(i.set(a,s),Array.isArray(a))for(let c of a)o(c,s);else if(a instanceof aN){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 Pfe)o(a.inner,a.prec);else if(a instanceof mi)r[s].push(a),a.provides&&o(a.provides,s);else if(a instanceof FC)r[s].push(a),a.facet.extensions&&o(a.facet.extensions,uh.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,uh.default),r.reduce((a,s)=>a.concat(s))}function tb(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 dE(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const Mfe=ct.define(),sN=ct.define({combine:t=>t.some(e=>e),static:!0}),kfe=ct.define({combine:t=>t.length?t[0]:void 0,static:!0}),Afe=ct.define(),Rfe=ct.define(),Ife=ct.define(),Dfe=ct.define({combine:t=>t.length?t[0]:!1});class lc{constructor(e,n){this.type=e,this.value=n}static define(){return new krt}}class krt{of(e){return new lc(this,e)}}class Art{constructor(e){this.map=e}of(e){return new Rt(this,e)}}class Rt{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 Rt(this.type,n)}is(e){return this.type==e}static define(e={}){return new Art(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}}Rt.reconfigure=Rt.define();Rt.appendConfig=Rt.define();class Ur{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&&Efe(r,n.newLength),o.some(s=>s.type==Ur.time)||(this.annotations=o.concat(Ur.time.of(Date.now())))}static create(e,n,r,i,o,a){return new Ur(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(Ur.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}Ur.time=lc.define();Ur.userEvent=lc.define();Ur.addToHistory=lc.define();Ur.remote=lc.define();function Rrt(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 Ur?t=o:Array.isArray(o)&&o.length==1&&o[0]instanceof Ur?t=o[0]:t=Nfe(e,kg(o),!1)}return t}function Drt(t){let e=t.startState,n=e.facet(Ife),r=t;for(let i=n.length-1;i>=0;i--){let o=n[i](t);o&&Object.keys(o).length&&(r=Lfe(r,lN(e,o,t.changes.newLength),!0))}return r==t?t:Ur.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const Lrt=[];function kg(t){return t==null?Lrt:Array.isArray(t)?t:[t]}var fr=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(fr||(fr={}));const Nrt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let cN;try{cN=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function $rt(t){if(cN)return cN.test(t);for(let e=0;e"€"&&(n.toUpperCase()!=n.toLowerCase()||Nrt.test(n)))return!0}return!1}function Frt(t){return e=>{if(!/\S/.test(e))return fr.Space;if($rt(e))return fr.Word;for(let n=0;n-1)return fr.Word;return fr.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(Rt.reconfigure)?(n=null,r=s.value):s.is(Rt.appendConfig)&&(n=null,r=kg(r).concat(s.value));let o;n?o=e.startState.values.slice():(n=fE.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(sN)?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=kg(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=fE.resolve(e.extensions||[],new Map),r=e.doc instanceof xn?e.doc:xn.of((e.doc||"").split(n.staticFacet(en.lineSeparator)||nN)),i=e.selection?e.selection instanceof je?e.selection:je.single(e.selection.anchor,e.selection.head):je.single(0);return Efe(i,r.length),n.staticFacet(sN)||(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(Dfe)}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(Mfe))for(let a of o(this,n,r))Object.prototype.hasOwnProperty.call(a,e)&&i.push(a[e]);return i}charCategorizer(e){return Frt(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))!=fr.Word)break;a=l}for(;st.length?t[0]:4});en.lineSeparator=kfe;en.readOnly=Dfe;en.phrases=ct.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=Mfe;en.changeFilter=Afe;en.transactionFilter=Rfe;en.transactionExtender=Ife;X2.reconfigure=Rt.define();function cc(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 sp{eq(e){return this==e}range(e,n=e){return uN.create(e,n,this)}}sp.prototype.startSide=sp.prototype.endSide=0;sp.prototype.point=!1;sp.prototype.mapMode=Pi.TrackDel;let uN=class $fe{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new $fe(e,n,r)}};function fN(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class w4{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 w4(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(fN)),this.isEmpty)return n.length?sn.of(n):this;let s=new Ffe(this,null,-1).goto(0),l=0,c=[],u=new id;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 n_.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return n_.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=s7(a,s,r),c=new R0(a,l,o),u=new R0(s,l,o);r.iterGaps((f,d,h)=>l7(c,f,u,d,h,i)),r.empty&&r.length==0&&l7(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=s7(o,a),l=new R0(o,s,0).goto(r),c=new R0(a,s,0).goto(r);for(;;){if(l.to!=c.to||!dN(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 R0(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 id;for(let i of e instanceof uN?[e]:n?jrt(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 jrt(t){if(t.length>1)for(let e=t[0],n=1;n0)return t.slice().sort(fN);e=r}return t}sn.empty.nextLayer=sn.empty;class id{finishChunk(e){this.chunks.push(new w4(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 id)).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 s7(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 Ffe(a,n,r,o));return i.length==1?i[0]:new n_(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--)DR(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--)DR(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(),DR(this.heap,0)}}}function DR(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 R0{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=n_.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){GS(this.active,e),GS(this.activeTo,e),GS(this.activeRank,e),this.minActive=c7(this.active,this.activeTo)}addActive(e){let n=0,{value:r,to:i,rank:o}=this.cursor;for(;n0;)n++;HS(this.active,n,r),HS(this.activeTo,n,i),HS(this.activeRank,n,o),e&&HS(e,n,this.cursor.from),this.minActive=c7(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&&GS(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 l7(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))&&dN(t.activeForPoint(t.to),n.activeForPoint(n.to))||o.comparePoint(s,f,t.point,n.point):f>s&&!dN(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 dN(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 c7(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 pN="ͼ",u7=typeof Symbol>"u"?"__"+pN:Symbol.for(pN),mN=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),f7=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class od{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=f7[u7]||1;return f7[u7]=e+1,pN+e.toString(36)}static mount(e,n,r){let i=e[mN],o=r&&r.nonce;i?o&&i.setNonce(o):i=new Brt(e,o),i.mount(Array.isArray(n)?n:[n],e)}}let d7=new Map;class Brt{constructor(e,n){let r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let o=d7.get(r);if(o)return e[mN]=o;this.sheet=new i.CSSStyleSheet,d7.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[mN]=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:'"'},zrt=typeof navigator<"u"&&/Mac/.test(navigator.platform),Urt=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Ti=0;Ti<10;Ti++)ad[48+Ti]=ad[96+Ti]=String(Ti);for(var Ti=1;Ti<=24;Ti++)ad[Ti+111]="F"+Ti;for(var Ti=65;Ti<=90;Ti++)ad[Ti]=String.fromCharCode(Ti+32),r_[Ti]=String.fromCharCode(Ti);for(var LR in ad)r_.hasOwnProperty(LR)||(r_[LR]=ad[LR]);function Wrt(t){var e=zrt&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Urt&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?r_:ad)[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 i_(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function gN(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function Vrt(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function jC(t,e){if(!e.anchorNode)return!1;try{return gN(t,e.anchorNode)}catch{return!1}}function cv(t){return t.nodeType==3?cp(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function nb(t,e,n,r){return n?h7(t,e,n,r,-1)||h7(t,e,n,r,1):!1}function lp(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function hE(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function h7(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:pu(t))){if(t.nodeName=="DIV")return!1;let o=t.parentNode;if(!o||o.nodeType!=1)return!1;e=lp(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?pu(t):0}else return!1}}function pu(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function pw(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function Grt(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 jfe(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 Hrt(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=Grt(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}=jfe(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.lefti.clientHeight&&(r=i),!n&&i.scrollWidth>i.clientWidth&&(n=i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;return{x:n,y:r}}class Xrt{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?pu(n):0),r,Math.min(e.focusOffset,r?pu(r):0))}set(e,n,r,i){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}let fm=null;function Bfe(t){if(t.setActive)return t.setActive();if(fm)return t.focus(fm);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(fm==null?{get preventScroll(){return fm={preventScroll:!0},!0}}:void 0),!fm){fm=!1;for(let n=0;nMath.max(1,t.scrollHeight-t.clientHeight-4)}function Wfe(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=pu(n)}else if(n.parentNode&&!hE(n))r=lp(n),n=n.parentNode;else return null}}function Vfe(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 Hfe(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 ut={mac:y7||/Mac/.test(Co.platform),windows:/Win/.test(Co.platform),linux:/Linux|X11/.test(Co.platform),ie:Q2,ie_version:Xfe?vN.documentMode||6:xN?+xN[1]:yN?+yN[1]:0,gecko:g7,gecko_version:g7?+(/Firefox\/(\d+)/.exec(Co.userAgent)||[0,0])[1]:0,chrome:!!NR,chrome_version:NR?+NR[1]:0,ios:y7,android:/Android\b/.test(Co.userAgent),webkit:v7,safari:Qfe,webkit_version:v7?+(/\bAppleWebKit\/(\d+)/.exec(Co.userAgent)||[0,0])[1]:0,tabSize:vN.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const Krt=256;class el extends Ln{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 el)||this.length-(n-e)+r.length>Krt||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 el(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 Zrt(this.dom,e,n)}}class mu extends Ln{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(zfe(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 mu&&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 mu(this.mark,n,a)}domAtPos(e){return Yfe(this,e)}coordsAt(e,n){return Zfe(this,e,n)}}function Zrt(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?ut.chrome||ut.gecko||(e?(i--,a=1):o=0)?0:s.length-1];return ut.safari&&!a&&l.width==0&&(l=Array.prototype.find.call(s,c=>c.width)||l),a?pw(l,a<0):l||null}class Cf extends Ln{static create(e,n,r){return new Cf(e,n,r)}constructor(e,n,r){super(),this.widget=e,this.length=n,this.side=r,this.prevWidget=null}split(e){let n=Cf.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 Cf)||!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 xn.empty}get isHidden(){return!0}}el.prototype.children=Cf.prototype.children=uv.prototype.children=S4;function Yfe(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 mu&&i.length&&(r=i[i.length-1])instanceof mu&&r.mark.eq(e.mark)?Kfe(r,e.children[0],n-1):(i.push(e),e.setParent(t)),t.length+=e.length}function Zfe(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 _N(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 eit(t){let e=Object.create(null);for(let n=0;n0?3e8:-4e8:n>0?1e8:-1e8,new sd(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}=Jfe(e,n);r=(o?n?-3e8:-1:5e8)-1,i=(a?n?2e8:1:-6e8)+1}return new sd(e,r,i,n,e.widget||null,!0)}static line(e){return new gw(e)}static set(e,n=!1){return sn.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}gt.none=sn.empty;class mw extends gt{constructor(e){let{start:n,end:r}=Jfe(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 mw&&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))&&pE(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)}}mw.prototype.point=!1;class gw extends gt{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof gw&&this.spec.class==e.spec.class&&pE(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)}}gw.prototype.mapMode=Pi.TrackBefore;gw.prototype.point=!0;class sd extends gt{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 sd&&tit(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)}}sd.prototype.point=!0;function Jfe(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 tit(t,e){return t==e||!!(t&&e&&t.compare(e))}function wN(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 Nr extends Ln{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,n,r,i,o,a){if(r){if(!(r instanceof Nr))return!1;this.dom||r.transferDOM(this)}return i&&this.setDeco(r?r.attrs:null),qfe(this,e,n,r?r.children.slice():[],o,a),!0}split(e){let n=new Nr;if(n.breakAfter=this.breakAfter,this.length==0)return n;let{i:r,off:i}=this.childPos(e);i&&(n.append(this.children[r].split(i),0),this.children[r].merge(i,this.children[r].length,null,!1,0,0),r++);for(let o=r;o0&&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){pE(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,n){Kfe(this,e,n)}addLineDeco(e){let n=e.spec.attributes,r=e.spec.class;n&&(this.attrs=bN(n,this.attrs||{})),r&&(this.attrs=bN({class:r},this.attrs||{}))}domAtPos(e){return Yfe(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,n){var r;this.dom?this.flags&4&&(zfe(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&&(_N(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&&Ln.get(i)instanceof mu;)i=i.lastChild;if(!i||!this.length||i.nodeName!="BR"&&((r=Ln.get(i))===null||r===void 0?void 0:r.isEditable)==!1&&(!ut.ios||!this.children.some(o=>o instanceof el))){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 el)||/[^ -~]/.test(r.text))return null;let i=cv(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=Zfe(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 Nr)return o;if(a>n)break}i=a+o.breakAfter}return null}}class eu extends Ln{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 eu)||!this.widget.compare(r.widget)||e>0&&o<=0||n0}}class SN extends uc{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class rb{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 eu&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new Nr),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(qS(new uv(-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 eu)&&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(qS(new el(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 sd){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 sd)if(r.block)r.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new eu(r.widget||fv.block,s,r));else{let l=Cf.create(r.widget||fv.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(qS(new uv(1),i),o),o=i.length+Math.max(0,o-i.length)),f.append(qS(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 rb(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 qS(t,e){for(let n of e)t=new mu(n,[t],t.length);return t}class fv extends uc{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}}fv.inline=new fv("span");fv.block=new fv("div");var rr=function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t}(rr||(rr={}));const up=rr.LTR,O4=rr.RTL;function ede(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 nde(t,e){if(t.length!=e.length)return!1;for(let n=0;n=0;m-=3)if(cl[m+1]==-h){let g=cl[m+2],v=g&2?i:g&4?g&1?o:i:0;v&&(Dn[f]=Dn[cl[m]]=v),s=m;break}}else{if(cl.length==189)break;cl[s++]=f,cl[s++]=d,cl[s++]=l}else if((p=Dn[f])==2||p==1){let m=p==i;l=m?0:1;for(let g=s-3;g>=0;g-=3){let v=cl[g+2];if(v&2)break;if(m)cl[g+2]|=2;else{if(v&4)break;cl[g+2]|=4}}}}}function sit(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),Dn[--p]=h;l=u}else o=c,l++}}}function CN(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 Tf(l,m.from,h));let g=m.direction==up!=!(h%2);TN(t,g?r+1:r,i,m.inner,m.from,m.to,a),l=m.to}p=m.to}else{if(p==n||(u?Dn[p]!=s:Dn[p]==s))break;p++}d?CN(t,l,p,r+1,i,d,a):le;){let u=!0,f=!1;if(!c||l>o[c-1].to){let m=Dn[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(Dn[g-1]==s)break e;break}}if(d)d.push(m);else{m.toDn.length;)Dn[Dn.length]=256;let r=[],i=e==up?0:1;return TN(t,i,i,n,0,t.length,r),r}function rde(t){return[new Tf(0,t,0)]}let ide="";function cit(t,e,n,r,i){var o;let a=r.head-t.from,s=Tf.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),ide=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)}),dde=ct.define({combine:t=>t.some(e=>e)}),hde=ct.define();class Rg{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 Rg(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 Rg(je.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const XS=Rt.define({map:(t,e)=>t.map(e)}),pde=Rt.define();function Ao(t,e,n){let r=t.facet(lde);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 pf=ct.define({combine:t=>t.length?t[0]:!0});let fit=0;const px=ct.define();class kr{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 kr(fit++,e,r,i,s=>{let l=[px.of(s)];return a&&l.push(o_.of(c=>{let u=c.plugin(s);return u?a(u):gt.none})),o&&l.push(o(s)),l})}static fromClass(e,n){return kr.define(r=>new e(r),n)}}class $R{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(Ao(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){Ao(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){Ao(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const mde=ct.define(),C4=ct.define(),o_=ct.define(),gde=ct.define(),T4=ct.define(),vde=ct.define();function b7(t,e){let n=t.state.facet(vde);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=uit(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 yde=ct.define();function xde(t){let e=0,n=0,r=0,i=0;for(let o of t.state.facet(yde)){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 mx=ct.define();class rs{constructor(e,n,r,i){this.fromA=e,this.toA=n,this.fromB=r,this.toB=i}join(e){return new rs(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 rs(l.fromA,l.toA,l.fromB,l.toB).addToSet(r),a=l.toA,s=l.toB}}}class mE{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=Zr.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 rs(o,a,s,l))),this.changedRanges=i}static create(e,n,r){return new mE(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 _7 extends Ln{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=gt.none,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 Nr],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new rs(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),this.updateEditContextFormatting(e);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?i=this.domChanged.newSel.head:!yit(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let o=i>-1?hit(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:u}=this.hasComposition;r=new rs(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,(ut.ie||ut.chrome)&&!o&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let a=this.decorations,s=this.updateDeco(),l=git(a,s,e.changes);return r=rs.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=ut.chrome||ut.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=rb.build(this.view.state.doc,u,r.range.fromB,this.decorations,this.dynamicDecorationMap),_=rb.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}=rb.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);Hfe(this,y,x,g,v,d,h,p,m)}r&&this.fixCompositionDOM(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let r of n.effects)r.is(pde)&&(this.editContextFormatting=r.value)}compositionView(e){let n=new el(e.text.nodeValue);n.flags|=8;for(let{deco:i}of e.marks)n=new mu(i,[n],n.length);let r=new Nr;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=Ln.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&&jC(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(ut.gecko&&s.empty&&!this.hasComposition&&dit(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||(!nb(l.node,l.offset,u.anchorNode,u.anchorOffset)||!nb(c.node,c.offset,u.focusNode,u.focusOffset))&&!this.suppressWidgetCursorChange(u,s))&&(this.view.observer.ignore(()=>{ut.android&&ut.chrome&&this.dom.contains(u.focusNode)&&vit(u.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=i_(this.view.root);if(f)if(s.empty){if(ut.gecko){let d=pit(l.node,l.offset);if(d&&d!=3){let h=(d==1?Wfe:Vfe)(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&&nb(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=i_(e.root),{anchorNode:i,anchorOffset:o}=e.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let a=Nr.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=Ln.get(n.childNodes[i]);o instanceof Nr&&(r=o.domAtPos(o.length))}return r?new Yi(r.node,r.offset,!0):e}nearest(e){for(let n=e;n;){let r=Ln.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 Nr&&!(r instanceof Nr&&n>=0)))r=s,i=c;else if(r&&c==e&&l==e&&s instanceof eu&&Math.abs(n)<2){if(s.deco.startSide<0)break;a&&(r=null)}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 Nr))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 el))return null;let o=ki(i.text,r);if(o==r)return null;let a=cp(i.dom,r,o).getClientRects();for(let s=0;sMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,s=-1,l=this.view.textDirection==rr.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?cv(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"?rr.RTL:rr.LTR}measureTextSize(){for(let o of this.children)if(o instanceof Nr){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=cv(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 Gfe(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(gt.replace({widget:new SN(s),block:!0,inclusive:!0,isBlockGap:!0}).range(r,a))}if(!o)break;r=o.to+1}return gt.set(e)}updateDeco(){let e=1,n=this.view.state.facet(o_).map(o=>(this.dynamicDecorationMap[e++]=typeof o=="function")?o(this.view):o),r=!1,i=this.view.state.facet(gde).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=[this.editContextFormatting,...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=xde(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;Hrt(this.view.scrollDOM,a,n.head{re.from&&(n=!0)}),n}function xit(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 _it(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom)}function FR(t,e){return t.tope.top+1}function w7(t,e){return et.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function PN(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=cv(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&&FR(u,v)?u=S7(u,v.bottom):f&&FR(f,v)&&(f=w7(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 O7(r,d,n);if(s&&r.contentEditable!="false")return PN(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 O7(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((ut.chrome||ut.gecko)&&cp(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 _de(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:C7(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)||ut.safari&&wit(v,y,u)||ut.chrome&&Sit(v,y,u))&&(v=void 0))}}if(!v||!t.docView.dom.contains(v)){let b=Nr.find(t.docView,h);if(!b)return d>l.top+l.height/2?l.to:l.from;({node:v,offset:y}=PN(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+hN(a,o,t.state.tabSize)}function wit(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 cp(t,r-1,r).getBoundingClientRect().left>n}function Sit(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():cp(t,0,Math.max(t.nodeValue.length,1)).getBoundingClientRect();return n-r.left>5}function MN(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 Oit(t,e,n,r){let i=MN(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==rr.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 T7(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=cit(i,o,a,s,n),u=ide;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 Cit(t,e,n){let r=t.state.charCategorizer(e),i=r(n);return o=>{let a=r(o);return i==fr.Space&&(i=a),i==a}}function Tit(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=_de(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,ro)&&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=Ln.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+(Pit(e,r.node,r.offset)?n:0))}}function Pit(t,e,n){for(;;){if(!e||n-1;let{impreciseHead:o,impreciseAnchor:a}=e.docView;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=e.docView.domBoundsAround(n,r,0))){let s=o||a?[]:Rit(e),l=new Eit(s,e.state);l.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=l.text,this.newSel=Iit(s,this.bounds.from)}else{let s=e.observer.selectionRange,l=o&&o.node==s.focusNode&&o.offset==s.focusOffset||!gN(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||!gN(e.contentDOM,s.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(s.anchorNode,s.anchorOffset),u=e.viewport;if((ut.ios||ut.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||ut.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))}:(ut.mac||ut.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:xn.of([" "])}):ut.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:xn.of([" "])}),n)return E4(t,n,r,o);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 E4(t,e,n,r=-1){if(ut.ios&&t.inputState.flushIOSKey(e))return!0;let i=t.state.selection.main;if(ut.android&&(e.to==i.to&&(e.from==i.from||e.from==i.from-1&&t.state.sliceDoc(e.from,i.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Ag(t.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||r==8&&e.insert.lengthi.head)&&Ag(t.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&Ag(t.contentDOM,"Delete",46)))return!0;let o=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let a,s=()=>a||(a=kit(t,e,n));return t.state.facet(cde).some(l=>l(t,e.from,e.to,o,s))||t.dispatch(s()),!0}function kit(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&&bde(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 Ait(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 Rit(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 E7(n,r)),(i!=n||o!=r)&&e.push(new E7(i,o))),e}function Iit(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}class Dit{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,ut.safari&&e.contentDOM.addEventListener("input",()=>null),ut.gecko&&Yit(e.contentDOM.ownerDocument)}handleEvent(e){!Uit(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=Lit(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&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&Ode.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),ut.android&&ut.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return ut.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((n=Sde.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||Nit.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:ut.safari&&!ut.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.view.observer.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 P7(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(i){Ao(n.state,i)}}}function Lit(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(P7(r.value,a))}if(i&&i.domEventObservers)for(let o in i.domEventObservers){let a=i.domEventObservers[o];a&&n(o).observers.push(P7(r.value,a))}}for(let r in tl)n(r).handlers.push(tl[r]);for(let r in ms)n(r).observers.push(ms[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"}],Nit="dthko",Ode=[16,17,18,20,91,92,224,225],QS=6;function YS(t){return Math.max(0,t)*.7+8}function $it(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class Fit{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.scrollParents=qrt(e.contentDOM),this.atoms=e.state.facet(T4).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)&&jit(e,n),this.dragging=zit(e,n)&&Ede(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&$it(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,i=0,o=0,a=this.view.win.innerWidth,s=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:o,bottom:s}=this.scrollParents.y.getBoundingClientRect());let l=xde(this.view);e.clientX-l.left<=i+QS?n=-YS(i-e.clientX):e.clientX+l.right>=a-QS&&(n=YS(e.clientX-a)),e.clientY-l.top<=o+QS?r=-YS(o-e.clientY):e.clientY+l.bottom>=s-QS&&(r=YS(e.clientY-s)),this.setScrollSpeed(n,r)}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(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let n=null;for(let r=0;rn.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function jit(t,e){let n=t.state.facet(ode);return n.length?n[0](e):ut.mac?e.metaKey:e.ctrlKey}function Bit(t,e){let n=t.state.facet(ade);return n.length?n[0](e):ut.mac?!e.altKey:!e.ctrlKey}function zit(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=i_(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 Uit(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=Ln.get(n))&&r.ignoreEvent(e))return!1;return!0}const tl=Object.create(null),ms=Object.create(null),Cde=ut.ie&&ut.ie_version<15||ut.ios&&ut.webkit_version<604;function Wit(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(kN!=null&&n.selection.ranges.every(l=>l.empty)&&kN==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})}ms.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};tl.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);ms.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")};ms.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};tl.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(sde))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=Hit(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new Fit(t,e,n,r)),r&&t.observer.ignore(()=>{Bfe(t.contentDOM);let o=t.root.activeElement;o&&!o.contains(t.contentDOM)&&o.blur()});let i=t.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}return!1};function M7(t,e,n,r){if(r==1)return je.cursor(e,n);if(r==2)return xit(t.state,e,n);{let i=Nr.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 se>=n.top&&e<=n.bottom&&t>=n.left&&t<=n.right;function Vit(t,e,n,r){let i=Nr.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&&k7(n,r,a))return-1;let s=i.coordsAt(o,1);return s&&k7(n,r,s)?1:a&&a.bottom>=r?-1:1}function A7(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:n,bias:Vit(t,n,e.clientX,e.clientY)}}const Git=ut.ie&&ut.ie_version<=11;let R7=null,I7=0,D7=0;function Ede(t){if(!Git)return t.detail;let e=R7,n=D7;return R7=t,D7=Date.now(),I7=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(I7+1)%3:1}function Hit(t,e){let n=A7(t,e),r=Ede(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=A7(t,o),c,u=M7(t,l.pos,l.bias,r);if(n.pos!=l.pos&&!a){let f=M7(t,n.pos,n.bias,r),d=Math.min(f.from,u.from),h=Math.max(f.to,u.to);u=d1&&(c=qit(i,l.pos))?c:s?i.addRange(u):je.create([u])}}}function qit(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}tl.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};tl.dragend=t=>(t.inputState.draggedContent=null,!1);function L7(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&&Bit(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}tl.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&&L7(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 L7(t,e,r,!0),!0}return!1};tl.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):(Wit(t),!1)};function Xit(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 Qit(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 kN=null;tl.copy=tl.cut=(t,e)=>{let{text:n,ranges:r,linewise:i}=Qit(t.state);if(!n&&!i)return!1;kN=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):(Xit(t,n),!1)};const Pde=lc.define();function Mde(t,e){let n=[];for(let r of t.facet(ude)){let i=r(t,e);i&&n.push(i)}return n?t.update({effects:n,annotations:Pde.of(!0)}):null}function kde(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=Mde(t.state,e);n?t.dispatch(n):t.update([])}},10)}ms.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),kde(t)};ms.blur=t=>{t.observer.clearSelectionRange(),kde(t)};ms.compositionstart=ms.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};ms.compositionend=t=>{t.observer.editContext||(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,ut.chrome&&ut.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};ms.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};tl.beforeinput=(t,e)=>{var n,r;if(e.inputType=="insertReplacementText"&&t.observer.editContext){let o=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),a=e.getTargetRanges();if(o&&a.length){let s=a[0],l=t.posAtDOM(s.startContainer,s.startOffset),c=t.posAtDOM(s.endContainer,s.endOffset);return E4(t,{from:l,to:c,insert:t.state.toText(o)},null),!0}}let i;if(ut.chrome&&ut.android&&(i=Sde.find(o=>o.inputType==e.inputType))&&(t.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let o=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var a;(((a=window.visualViewport)===null||a===void 0?void 0:a.height)||0)>o+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return ut.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),ut.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>ms.compositionend(t,e),20),!1};const N7=new Set;function Yit(t){N7.has(t)||(N7.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const $7=["pre-wrap","normal","pre-line","break-spaces"];let dv=!1;function F7(){dv=!1}class Kit{constructor(e){this.lineWrapping=e,this.doc=xn.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}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 $7.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){this.height!=e&&(Math.abs(this.height-e)>zC&&(dv=!0),this.height=e)}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,Qn.ByPosNoHeight,r.setDoc(n),0,0),h=d.to>=c?d:o.lineAt(c,Qn.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(i.heights[i.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class la extends Ade{constructor(e,n){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,n,r,i){return new El(i,this.length,r,this.height,this.breaks)}replace(e,n,r){let i=r[0];return r.length==1&&(i instanceof la||i instanceof _i&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof _i?i=new la(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(i.heights[i.index++]):(r||this.outdated)&&this.setHeight(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)>=zC&&(l=-2);let d=new la(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)>=zC||Math.abs(l-this.heightMetrics(e,n).perLine)>=zC)&&(dv=!0),gE(this,c)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class Jit 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==Qn.ByPosNoHeight?Qn.ByPosNoHeight:Qn.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,Qn.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&&j7(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=gE(this.left,e),this.right=gE(this.right,n),this.setHeight(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 j7(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 eot=5;class P4{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 la?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new la(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=eot)&&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 la(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 la)return e;let n=new la(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 la)&&!this.isCovered?this.nodes.push(new la(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=Math.min(c==t.parentNode?i.innerHeight: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 iot(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class BR{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 Kit(n),this.stateDeco=e.facet(o_).filter(r=>typeof r!="function"),this.heightMap=fo.empty().applyChanges(this.stateDeco,xn.empty,this.heightOracle.setDoc(e.doc),[new rs(0,0,0,e.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=gt.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 KS(o,a))}}return this.viewports=e.sort((r,i)=>r.from-i.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?z7:new M4(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(vx(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=this.state.facet(o_).filter(u=>typeof u!="function");let i=e.changedRanges,o=rs.extendWithRanges(i,tot(r,this.stateDeco,e?e.changes:Zr.empty(this.state.doc.length))),a=this.heightMap.height,s=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);F7(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),o),(this.heightMap.height!=a||dv)&&(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=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&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(dde)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let n=e.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,o=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?rr.RTL:rr.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:_}=jfe(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=Ufe(e.scrollDOM);let p=(this.printing?iot:rot)(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)),F7();for(let _ of this.viewports){let S=_.from==this.viewport.from?b:e.docView.measureVisibleLineHeights(_);this.heightMap=(a?fo.empty().applyChanges(this.stateDeco,xn.empty,this.heightOracle,[new rs(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,a,new Zit(_.from,S))}dv&&(c|=2)}let x=!this.viewportIsAppropriate(this.viewport,u)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return x&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(u,this.scrollTarget),c|=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 KS(i.lineAt(a-r*1e3,Qn.ByHeight,o,0,0).from,i.lineAt(s+(1-r)*1e3,Qn.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,Qn.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!=rr.LTR&&!r)return[];let s=[],l=(u,f,d,h)=>{if(f-uu&&vv.from>=d.from&&v.to<=d.to&&Math.abs(v.from-u)v.fromy));if(!g){if(fv.from<=f&&v.to>=f)){let v=n.moveToLineBoundary(je.cursor(f),!1,!0).head;v>u&&(f=v)}g=new BR(u,f,this.gapSize(d,u,f,h))}s.push(g)},c=u=>{if(u.lengthu.from&&l(u.from,h,u,f),pn.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)||vx(this.heightMap.lineAt(e,Qn.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=e&&n.bottom>=e)||vx(this.heightMap.lineAt(this.scaler.fromDOM(e),Qn.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 vx(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 KS{constructor(e,n){this.from=e,this.to=n}}function aot(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 JS(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 sot(t,e){for(let n of t)if(e(n))return n}const z7={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};class M4{constructor(e,n,r){let i=0,o=0,a=0;this.viewports=r.map(({from:s,to:l})=>{let c=n.lineAt(s,Qn.ByPos,e,0,0).top,u=n.lineAt(l,Qn.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=nn.from==e.viewports[r].from&&n.to==e.viewports[r].to):!1}}function vx(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new El(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(i=>vx(i,e)):t._content)}const eO=ct.define({combine:t=>t.join(" ")}),AN=ct.define({combine:t=>t.indexOf(!0)>-1}),RN=od.newName(),Rde=od.newName(),Ide=od.newName(),Dde={"&light":"."+Rde,"&dark":"."+Ide};function IN(t,e,n){return new od(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 lot=IN("."+RN,{"&":{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,overflowAnchor:"none"},".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,zIndex:300},"&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"}},Dde),cot={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},zR=ut.ie&&ut.ie_version<=11;class uot{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Xrt,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);(ut.ie&&ut.ie_version<=11||ut.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()}),window.EditContext&&e.constructor.EDIT_CONTEXT!==!1&&!(ut.chrome&&ut.chrome_version<126)&&(this.editContext=new dot(e),e.state.facet(pf)&&(e.contentDOM.editContext=this.editContext.editContext)),zR&&(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.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!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(pf)?r.root.activeElement!=this.dom:!jC(r.dom,i))return;let o=i.anchorNode&&r.docView.nearest(i.anchorNode);if(o&&o.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(ut.ie&&ut.ie_version<=11||ut.android&&ut.chrome)&&!r.state.selection.main.empty&&i.focusNode&&nb(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=i_(e.root);if(!n)return!1;let r=ut.safari&&e.root.nodeType==11&&Vrt(this.dom.ownerDocument)==this.dom&&fot(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let i=jC(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&&Ag(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&&jC(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 Mit(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=wde(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!n.newSel.main.eq(this.view.state.selection.main))&&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=U7(n,e.previousSibling||e.target.previousSibling,-1),i=U7(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?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(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?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(pf)!=e.state.facet(pf)&&(e.view.contentDOM.editContext=e.state.facet(pf)?this.editContext.editContext:null))}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),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function U7(t,e,n){for(;e;){let r=Ln.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 W7(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 nb(a.node,a.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function fot(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return W7(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?W7(t,n):null}class dot{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.resetRange(e.state);let n=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=r=>{let{anchor:i}=e.state.selection.main,o={from:this.toEditorPos(r.updateRangeStart),to:this.toEditorPos(r.updateRangeEnd),insert:xn.of(r.text.split(` -`))};o.from==this.from&&ithis.to&&(o.to=i),!(o.from==o.to&&!o.insert.length)&&(this.pendingContextChange=o,e.state.readOnly||E4(e,o,je.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd))),this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)))},this.handlers.characterboundsupdate=r=>{let i=[],o=null;for(let a=this.toEditorPos(r.rangeStart),s=this.toEditorPos(r.rangeEnd);a{let i=[];for(let o of r.getTextFormats()){let a=o.underlineStyle,s=o.underlineThickness;if(a!="None"&&s!="None"){let l=`text-decoration: underline ${a=="Dashed"?"dashed ":a=="Squiggle"?"wavy ":""}${s=="Thin"?1:2}px`;i.push(gt.mark({attributes:{style:l}}).range(this.toEditorPos(o.rangeStart),this.toEditorPos(o.rangeEnd)))}}e.dispatch({effects:pde.of(gt.set(i))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{e.inputState.composing=-1,e.inputState.compositionFirstChange=null};for(let r in this.handlers)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let i=i_(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,r=!1,i=this.pendingContextChange;return e.changes.iterChanges((o,a,s,l,c)=>{if(r)return;let u=c.length-(a-o);if(i&&a>=i.to)if(i.from==o&&i.to==a&&i.insert.eq(c)){i=this.pendingContextChange=null,n+=u,this.to+=u;return}else i=null,this.revertPending(e.state);if(o+=n,a+=n,a<=this.from)this.from+=u,this.to+=u;else if(othis.to||this.to-this.from+c.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(o),this.toContextPos(a),c.toString()),this.to+=u}n+=u}),i&&!r&&this.revertPending(e.state),!r}update(e){let n=this.pendingContextChange;!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.resetRange(e.state),this.editContext.updateText(0,this.editContext.text.length,e.state.doc.sliceString(this.from,this.to)),this.setSelection(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),i=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(r,i)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to1e4*3)}toEditorPos(e){return e+this.from}toContextPos(e){return e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}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={}){var n;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:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(i=>i.forEach(o=>r(o,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||Qrt(e.parent)||document,this.viewState=new B7(e.state||en.create(e)),e.scrollTo&&e.scrollTo.is(XS)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(px).map(i=>new $R(i));for(let i of this.plugins)i.update(this);this.observer=new uot(this),this.inputState=new Dit(this),this.inputState.ensureHandlers(this.plugins),this.docView=new _7(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let n=e.length==1&&e[0]instanceof Ur?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(Pde))?(this.inputState.notifiedFocused=a,s=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,l=Mde(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=mE.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 Rg(h.empty?h:je.cursor(h.head,h.head>h.anchor?-1:1))}for(let h of d.effects)h.is(XS)&&(f=h.value.clip(this.state))}this.viewState.update(i,f),this.bidiCache=vE.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(mx)!=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(eO)!=i.state.facet(eO)&&(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(EN))try{d(i)}catch(h){Ao(this.state,h,"update listener")}(l||u)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),u&&!wde(this,u)&&c.force&&Ag(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 B7(e),this.plugins=e.facet(px).map(r=>new $R(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new _7(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(px),r=e.state.facet(px);if(n!=r){let i=[];for(let o of r){let a=n.indexOf(o);if(a<0)i.push(new $R(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(Ufe(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 Ao(this.state,p),V7}}),f=mE.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(EN))s(n)}get themeClasses(){return RN+" "+(this.state.facet(AN)?Ide:Rde)+" "+this.state.facet(eO)}updateAttrs(){let e=G7(this,mde,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(pf)?"true":"false",class:"cm-content",style:`${ut.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),G7(this,C4,n);let r=this.observer.ignore(()=>{let i=_N(this.contentDOM,this.contentAttrs,n),o=_N(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(mx);let e=this.state.facet(rt.cspNonce);od.mount(this.root,this.styleModules.concat(lot).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 jR(this,e,T7(this,e,n,r))}moveByGroup(e,n){return jR(this,e,T7(this,e,n,r=>Cit(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 Oit(this,e,n,r)}moveVertically(e,n,r){return jR(this,e,Tit(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(),_de(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[Tf.find(o,e-i.from,-1,n)];return pw(r,a.dir==rr.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(fde)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>hot)return rde(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||nde(o.isolates,r=b7(this,e))))return o.order;r||(r=b7(this,e));let i=lit(e.text,n,r);return this.bidiCache.push(new vE(e.from,e.to,n,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||ut.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Bfe(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(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();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 XS.of(new Rg(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 XS.of(new Rg(je.cursor(r.from),"start","start",r.top-e,n,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return kr.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return kr.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=od.newName(),i=[eO.of(r),mx.of(IN(`.${r}`,e))];return n&&n.dark&&i.push(AN.of(!0)),i}static baseTheme(e){return Ed.lowest(mx.of(IN("."+RN,e,Dde)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),i=r&&Ln.get(r)||Ln.get(e);return((n=i==null?void 0:i.rootView)===null||n===void 0?void 0:n.view)||null}}rt.styleModule=mx;rt.inputHandler=cde;rt.scrollHandler=hde;rt.focusChangeEffect=ude;rt.perLineTextDirection=fde;rt.exceptionSink=lde;rt.updateListener=EN;rt.editable=pf;rt.mouseSelectionStyle=sde;rt.dragMovesSelection=ade;rt.clickAddsSelectionRange=ode;rt.decorations=o_;rt.outerDecorations=gde;rt.atomicRanges=T4;rt.bidiIsolatedRanges=vde;rt.scrollMargins=yde;rt.darkTheme=AN;rt.cspNonce=ct.define({combine:t=>t.length?t[0]:""});rt.contentAttributes=C4;rt.editorAttributes=mde;rt.lineWrapping=rt.contentAttributes.of({class:"cm-lineWrapping"});rt.announce=Rt.define();const hot=4096,V7={};class vE{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:rr.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&&bN(a,n)}return n}const pot=ut.mac?"mac":ut.windows?"win":ut.linux?"linux":"key";function mot(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 vot(t,e,n){return Nde(Lde(t.state),e,t,n)}let mf=null;const yot=4e3;function xot(t,e=pot){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=>mot(v,e));for(let v=1;v{let b=mf={view:x,prefix:y,scope:a};return setTimeout(()=>{mf==b&&(mf=null)},yot),!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:[]});let{any:f}=a;for(let d in u)u[d].run.push(h=>f(h,DN))}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}let DN=null;function Nde(t,e,n,r){DN=e;let i=Wrt(e),o=Ci(i,0),a=Ha(o)==i.length&&i!=" ",s="",l=!1,c=!1,u=!1;mf&&mf.view==n&&mf.scope==r&&(s=mf.prefix+" ",Ode.indexOf(e.keyCode)<0&&(c=!0,mf=null));let f=new Set,d=g=>{if(g){for(let v of g.run)if(!f.has(v)&&(f.add(v),v(n)))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+tO(i,e,!a)])?l=!0:a&&(e.altKey||e.metaKey||e.ctrlKey)&&!(ut.windows&&e.ctrlKey&&e.altKey)&&(p=ad[e.keyCode])&&p!=i?(d(h[s+tO(p,e,!0)])||e.shiftKey&&(m=r_[e.keyCode])!=i&&m!=p&&d(h[s+tO(m,e,!1)]))&&(l=!0):a&&e.shiftKey&&d(h[s+tO(i,e,!0)])&&(l=!0),!l&&d(h._any)&&(l=!0)),c&&(l=!0),l&&u&&e.stopPropagation(),DN=null,l}class yw{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=$de(e);return[new yw(n,i.left-o.left,i.top-o.top,null,i.bottom-i.top)]}else return bot(e,n,r)}}function $de(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==rr.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function q7(t,e,n,r){let i=t.coordsAtPos(e,n*2);if(!i)return r;let o=t.dom.getBoundingClientRect(),a=(i.top+i.bottom)/2,s=t.posAtCoords({x:o.left+1,y:a}),l=t.posAtCoords({x:o.right-1,y:a});return s==null||l==null?r:{from:Math.max(r.from,Math.min(s,l)),to:Math.min(r.to,Math.max(s,l))}}function bot(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==rr.LTR,a=t.contentDOM,s=a.getBoundingClientRect(),l=$de(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=MN(t,r),p=MN(t,i),m=h.type==uo.Text?h:null,g=p.type==uo.Text?p:null;if(m&&(t.lineWrapping||h.widgetLineBreaks)&&(m=q7(t,r,1,m)),g&&(t.lineWrapping||p.widgetLineBreaks)&&(g=q7(t,i,-1,g)),m&&g&&m.from==g.from&&m.to==g.to)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;$>L&&I(Math.max(W,L),_==null&&W<=P,Math.min($,z),S==null&&$>=R,U.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 _ot(t,e){return t.constructor==e.constructor&&t.eq(e)}class wot{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(UC)!=e.state.facet(UC)&&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(UC);for(;n!_ot(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 UC=ct.define();function Fde(t){return[kr.define(e=>new wot(e,t)),UC.of(t)]}const jde=!ut.ios,a_=ct.define({combine(t){return cc(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,n)=>Math.min(e,n),drawRangeCursor:(e,n)=>e||n})}});function Sot(t={}){return[a_.of(t),Oot,Cot,Tot,dde.of(!0)]}function Bde(t){return t.startState.facet(a_)!=t.state.facet(a_)}const Oot=Fde({above:!0,markers(t){let{state:e}=t,n=e.facet(a_),r=[];for(let i of e.selection.ranges){let o=i==e.selection.main;if(i.empty?!o||jde: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 yw.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=Bde(t);return n&&X7(t.state,e),t.docChanged||t.selectionSet||n},mount(t,e){X7(e.state,t)},class:"cm-cursorLayer"});function X7(t,e){e.style.animationDuration=t.facet(a_).cursorBlinkRate+"ms"}const Cot=Fde({above:!1,markers(t){return t.state.selection.ranges.map(e=>e.empty?[]:yw.forRange(t,"cm-selectionBackground",e)).reduce((e,n)=>e.concat(n))},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||Bde(t)},class:"cm-selectionLayer"}),LN={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};jde&&(LN[".cm-line"].caretColor=LN[".cm-content"].caretColor="transparent !important");const Tot=Ed.highest(rt.theme(LN)),zde=Rt.define({map(t,e){return t==null?null:e.mapPos(t)}}),yx=mi.define({create(){return null},update(t,e){return t!=null&&(t=e.changes.mapPos(t)),e.effects.reduce((n,r)=>r.is(zde)?r.value:n,t)}}),Eot=kr.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(yx);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(yx)!=n||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(yx),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(yx)!=t&&this.view.dispatch({effects:zde.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 Pot(){return[yx,Eot]}function Q7(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 Mot(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 kot{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 id,r=n.add.bind(n);for(let{from:i,to:o}of Mot(e,this.maxLength))Q7(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 NN=/x/.unicode!=null?"gu":"g",Aot=new RegExp(`[\0-\b ---Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,NN),Rot={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 UR=null;function Iot(){var t;if(UR==null&&typeof document<"u"&&document.body){let e=document.body.style;UR=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return UR||!1}const WC=ct.define({combine(t){let e=cc(t,{render:null,specialChars:Aot,addSpecialChars:null});return(e.replaceTabs=!Iot())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,NN)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,NN)),e}});function Dot(t={}){return[WC.of(t),Lot()]}let Y7=null;function Lot(){return Y7||(Y7=kr.fromClass(class{constructor(t){this.view=t,this.decorations=gt.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(WC)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new kot({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=My(a.text,s,r-a.from);return gt.replace({widget:new jot((s-l%s)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=gt.replace({widget:new Fot(t,o)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(WC);t.startState.facet(WC)!=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 Not="•";function $ot(t){return t>=32?Not:t==10?"␤":String.fromCharCode(9216+t)}class Fot extends uc{constructor(e,n){super(),this.options=e,this.code=n}eq(e){return e.code==this.code}toDOM(e){let n=$ot(this.code),r=e.state.phrase("Control character")+" "+(Rot[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 jot extends uc{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 Bot(){return Uot}const zot=gt.line({class:"cm-activeLine"}),Uot=kr.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(zot.range(i.from)),e=i.from)}return gt.set(n)}},{decorations:t=>t.decorations});class Wot extends uc{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?cv(e.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(e.parentNode),i=pw(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 Vot(t){return kr.fromClass(class{constructor(e){this.view=e,this.placeholder=t?gt.set([gt.widget({widget:new Wot(t),side:1}).range(0)]):gt.none}get decorations(){return this.view.state.doc.length?gt.none:this.placeholder}},{decorations:e=>e.decorations})}const $N=2e3;function Got(t,e,n){let r=Math.min(e.line,n.line),i=Math.max(e.line,n.line),o=[];if(e.off>$N||n.off>$N||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=hN(c.text,a,t.tabSize,!0);if(u<0)o.push(je.cursor(c.to));else{let f=hN(c.text,s,t.tabSize);o.push(je.range(c.from+u,c.from+f))}}}return o}function Hot(t,e){let n=t.coordsAtPos(t.viewport.from);return n?Math.round(Math.abs((n.left-e)/t.defaultCharacterWidth)):-1}function K7(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>$N?-1:i==r.length?Hot(t,e.clientX):My(r.text,t.state.tabSize,n-r.from);return{line:r.number,col:o,off:i}}function qot(t,e){let n=K7(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=K7(t,i);if(!s)return r;let l=Got(t.state,n,s);return l.length?a?je.create(l.concat(r.ranges)):je.create(l):r}}:null}function Xot(t){let e=n=>n.altKey&&n.button==0;return rt.mouseSelectionStyle.of((n,r)=>e(r)?qot(n,r):null)}const Qot={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},Yot={style:"cursor: crosshair"};function Kot(t={}){let[e,n]=Qot[t.key||"Alt"],r=kr.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?Yot:null})]}const I0="-10000px";class Ude{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 Zot(t){let{win:e}=t;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const WR=ct.define({combine:t=>{var e,n,r;return{position:ut.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)||Zot}}}),Z7=new WeakMap,k4=kr.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(WR);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 Ude(t,A4,(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(WR);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.appendChild(i)}return n.dom.style.position=this.position,n.dom.style.top=I0,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(ut.gecko)r=i.offsetParent!=this.container.ownerDocument.body;else if(i.style.top==I0&&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(WR).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=I0;continue}let h=l.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,p=h?7:0,m=d.right-d.left,g=(e=Z7.get(c))!==null&&e!==void 0?e:d.bottom-d.top,v=c.offset||eat,y=this.view.textDirection==rr.LTR,x=d.width>r.right-r.left?y?r.left:r.right-d.width:y?Math.max(r.left,Math.min(f.left-(h?14:0)+v.x,r.right-m)):Math.min(Math.max(r.left,f.left-m+(h?14:0)-v.x),r.right-m),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=I0}},{eventObservers:{scroll(){this.maybeMeasure()}}}),Jot=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"}}}),eat={x:0,y:0},A4=ct.define({enables:[k4,Jot]}),yE=ct.define({combine:t=>t.reduce((e,n)=>e.concat(n),[])});class Y2{static create(e){return new Y2(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new Ude(e,yE,(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 tat=A4.compute([yE],t=>{let e=t.facet(yE);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:Y2.create,above:e[0].above,arrow:e.some(n=>n.arrow)}});class nat{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==rr.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=>Ao(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(k4),n=e?e.manager.tooltips.findIndex(r=>r.create==Y2.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&&!rat(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:!iat(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 nO=4;function rat(t,e){let n=t.getBoundingClientRect();return e.clientX>=n.left-nO&&e.clientX<=n.right+nO&&e.clientY>=n.top-nO&&e.clientY<=n.bottom+nO}function iat(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 oat(t,e={}){let n=Rt.define(),r=mi.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(aat)&&(i=[]);return i},provide:i=>yE.from(i)});return{active:r,extension:[r,kr.define(i=>new nat(i,t,r,n,e.hoverTime||300)),tat]}}function Wde(t,e){let n=t.plugin(k4);if(!n)return null;let r=n.manager.tooltips.indexOf(e);return r<0?null:n.manager.tooltipViews[r]}const aat=Rt.define(),J7=ct.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 s_(t,e){let n=t.plugin(Vde),r=n?n.specs.indexOf(e):-1;return r>-1?n.panels[r]:null}const Vde=kr.fromClass(class{constructor(t){this.input=t.state.facet(l_),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(J7);this.top=new rO(t,!0,e.topContainer),this.bottom=new rO(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(J7);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new rO(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new rO(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(l_);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 rO{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=eq(e);e=e.nextSibling}else this.dom.insertBefore(n.dom,e);for(;e;)e=eq(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 eq(t){let e=t.nextSibling;return t.remove(),e}const l_=ct.define({enables:Vde});class gu extends sp{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}gu.prototype.elementClass="";gu.prototype.toDOM=void 0;gu.prototype.mapMode=Pi.TrackBefore;gu.prototype.startSide=gu.prototype.endSide=-1;gu.prototype.point=!0;const VC=ct.define(),sat=ct.define(),lat={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>sn.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},ib=ct.define();function cat(t){return[Gde(),ib.of(Object.assign(Object.assign({},lat),t))]}const tq=ct.define({combine:t=>t.some(e=>e)});function Gde(t){return[uat]}const uat=kr.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(ib).map(e=>new rq(t,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!t.state.facet(tq),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(tq)!=!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(VC),this.view.viewport.from),r=[],i=this.gutters.map(o=>new fat(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){FN(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){FN(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(ib),n=t.state.facet(ib),r=t.docChanged||t.heightChanged||t.viewportChanged||!sn.eq(t.startState.facet(VC),t.state.facet(VC),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 rq(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==rr.LTR?{left:n.dom.offsetWidth*e.scaleX}:{right:n.dom.offsetWidth*e.scaleX}})});function nq(t){return Array.isArray(t)?t:[t]}function FN(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class fat{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 Hde(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=[];FN(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),i=r?[r]:null;for(let o of e.state.facet(sat)){let a=o(e,n.widget,n);a&&(i||(i=[])).push(a)}i&&this.addElement(e,n,i)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}}class rq{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=nq(n.markers(e)),n.initialSpacer&&(this.spacer=new Hde(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=nq(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 Hde{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":""),dat(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 VR extends gu{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function GR(t,e){return t.state.facet(ig).formatNumber(e,t.state)}const mat=ib.compute([ig],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(hat)},lineMarker(e,n,r){return r.some(i=>i.toDOM)?null:new VR(GR(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,r)=>{for(let i of e.state.facet(pat)){let o=i(e,n,r);if(o)return o}return null},lineMarkerChange:e=>e.startState.facet(ig)!=e.state.facet(ig),initialSpacer(e){return new VR(GR(e,iq(e.state.doc.lines)))},updateSpacer(e,n){let r=GR(n.view,iq(n.view.state.doc.lines));return r==e.number?e:new VR(r)},domEventHandlers:t.facet(ig).domEventHandlers}));function gat(t={}){return[ig.of(t),Gde(),mat]}function iq(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(vat.range(i)))}return sn.of(e)});function xat(){return yat}const qde=1024;let bat=0;class HR{constructor(e,n){this.from=e,this.to=n}}class Vt{constructor(e={}){this.id=bat++,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=Vo.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}Vt.closedBy=new Vt({deserialize:t=>t.split(" ")});Vt.openedBy=new Vt({deserialize:t=>t.split(" ")});Vt.group=new Vt({deserialize:t=>t.split(" ")});Vt.isolate=new Vt({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});Vt.contextHash=new Vt({perNode:!0});Vt.lookAhead=new Vt({perNode:!0});Vt.mounted=new Vt({perNode:!0});class xE{constructor(e,n,r){this.tree=e,this.overlay=n,this.parser=r}static get(e){return e&&e.props&&e.props[Vt.mounted.id]}}const _at=Object.create(null);class Vo{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):_at,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new Vo(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(Vt.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(Vt.group),o=-1;o<(i?i.length:0);o++){let a=n[o<0?r.name:i[o]];if(a)return a}}}}Vo.none=new Vo("",Object.create(null),0,8);class R4{constructor(e){this.types=e;for(let n=0;n0;for(let l=this.cursor(a|Jr.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:L4(Vo.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new Wr(this.type,n,r,i,this.propValues),e.makeTree||((n,r,i)=>new Wr(Vo.none,n,r,i)))}static build(e){return Cat(e)}}Wr.empty=new Wr(Vo.none,[],[],0);class I4{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 I4(this.buffer,this.index)}}class ld{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return Vo.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 c_(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(Xde(i,r,f,f+u.length)){if(u instanceof ld){if(o&Jr.ExcludeBuffers)continue;let d=u.findChild(0,u.buffer.length,n,r-f,i);if(d>-1)return new Dl(new wat(a,u,e,f),null,d)}else if(o&Jr.IncludeAnonymous||!u.type.isAnonymous||D4(u)){let d;if(!(o&Jr.IgnoreMounts)&&(d=xE.get(u))&&!d.overlay)return new jo(d.tree,f,e,a);let h=new jo(u,f,e,a);return o&Jr.IncludeAnonymous||!h.type.isAnonymous?h:h.nextChild(n<0?u.children.length-1:0,n,r,i)}}}if(o&Jr.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&Jr.IgnoreOverlays)&&(i=xE.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 jo(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 aq(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 jN(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 wat{constructor(e,n,r,i){this.parent=e,this.buffer=n,this.index=r,this.start=i}}class Dl extends Qde{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 Dl(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&Jr.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 Dl(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 Dl(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 Dl(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 Wr(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Yde(t){if(!t.length)return null;let e=0,n=t[0];for(let o=1;on.from||a.to=e){let s=new jo(a.tree,a.overlay[0].from+o.from,-1,o);(i||(i=[r])).push(c_(s,e,n,!1))}}return i?Yde(i):r}class BN{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 jo)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 jo?(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&Jr.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Jr.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Jr.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&Jr.IncludeAnonymous||s instanceof ld||!s.type.isAnonymous||D4(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 jN(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 D4(t){return t.children.some(e=>e instanceof ld||!e.type.isAnonymous||D4(e))}function Cat(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:i=qde,reused:o=[],minRepeatType:a=r.types.length}=t,s=Array.isArray(n)?new I4(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 $=o[I];O.push($),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,U,W=P-_;if(R-P<=i&&(U=g(s.pos-S,E))){let $=new Uint16Array(U.size-U.skip),N=s.pos-U.size,D=$.length;for(;s.pos>N;)D=v(U.start,$,D);B=new ld($,R-U.start,r),W=U.start-_}else{let $=s.pos-T;s.next();let N=[],D=[],A=I>=a?I:-1,q=0,Y=R;for(;s.pos>$;)A>=0&&s.id==A&&s.size>=0?(s.end<=Y-i&&(p(N,D,P,q,s.end,Y,A,L),q=N.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-1&&q>0){let K=h(z);B=L4(z,N,D,0,N.length,0,R-P,K,K)}else B=m(z,N,D,R-P,L-R)}O.push(B),C.push(W)}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 ld(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 Wr){if(!k&&I.type==_&&I.length==C)return I;(P=I.prop(Vt.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=[Vt.contextHash,c];k=k?[I].concat(k):[I]}if(E>25){let I=[Vt.lookAhead,E];k=k?[I].concat(k):[I]}return new Wr(_,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 Wr(l[t.topID],y.reverse(),x.reverse(),b)}const sq=new WeakMap;function GC(t,e){if(!t.isAnonymous||e instanceof ld||e.type!=t)return 1;let n=sq.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof Wr)){n=1;break}n+=GC(t,r)}sq.set(e,n)}return n}function L4(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(L4(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 Tat{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 Dl?this.setBuffer(e.context.buffer,e.index,n):e instanceof jo&&this.map.set(e.tree,n)}get(e){return e instanceof Dl?this.getBuffer(e.context.buffer,e.index):e instanceof jo?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 Wh{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 Wh(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 Wh(h,p,d.tree,d.offset+c,s>0,!!u)}if(d&&i.push(d),a.to>f)break;a=onew HR(i.from,i.to)):[new HR(0,0)]:[new HR(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 Eat{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 Vt({perNode:!0});let Pat=0;class za{constructor(e,n,r,i){this.name=e,this.set=n,this.base=r,this.modified=i,this.id=Pat++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let r=typeof e=="string"?e:"?";if(e instanceof za&&(n=e),n!=null&&n.base)throw new Error("Can not derive from a modified tag");let i=new za(r,[],null,[]);if(i.set.push(i),n)for(let o of n.set)i.set.push(o);return i}static defineModifier(e){let n=new bE(e);return r=>r.modified.indexOf(n)>-1?r:bE.get(r.base||r,r.modified.concat(n).sort((i,o)=>i.id-o.id))}}let Mat=0;class bE{constructor(e){this.name=e,this.instances=[],this.id=Mat++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(s=>s.base==e&&kat(n,s.modified));if(r)return r;let i=[],o=new za(e.name,i,e,n);for(let s of n)s.instances.push(o);let a=Aat(n);for(let s of e.set)if(!s.modified.length)for(let l of a)i.push(bE.get(s,l));return o}}function kat(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function Aat(t){let e=[[]];for(let n=0;nr.length-n.length)}function N4(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 _E(r,a,l>0?o.slice(0,l):null);e[c]=u.sort(e[c])}}return Zde.add(e)}const Zde=new Vt;class _E{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 Rat(t,e){let n=null;for(let r of t){let i=r.style(e);i&&(n=n?n+" "+i:i)}return n}function Iat(t,e,n,r=0,i=t.length){let o=new Dat(r,Array.isArray(e)?e:[e],n);o.highlightRange(t.cursor(),r,i,"",o.highlighters),o.flush(i)}class Dat{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=Lat(e)||_E.empty,f=Rat(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(Vt.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 Lat(t){let e=t.type.prop(Zde);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const et=za.define,oO=et(),cf=et(),lq=et(cf),cq=et(cf),uf=et(),aO=et(uf),qR=et(uf),dl=et(),Wd=et(dl),ul=et(),fl=et(),zN=et(),D0=et(zN),sO=et(),Ce={comment:oO,lineComment:et(oO),blockComment:et(oO),docComment:et(oO),name:cf,variableName:et(cf),typeName:lq,tagName:et(lq),propertyName:cq,attributeName:et(cq),className:et(cf),labelName:et(cf),namespace:et(cf),macroName:et(cf),literal:uf,string:aO,docString:et(aO),character:et(aO),attributeValue:et(aO),number:qR,integer:et(qR),float:et(qR),bool:et(uf),regexp:et(uf),escape:et(uf),color:et(uf),url:et(uf),keyword:ul,self:et(ul),null:et(ul),atom:et(ul),unit:et(ul),modifier:et(ul),operatorKeyword:et(ul),controlKeyword:et(ul),definitionKeyword:et(ul),moduleKeyword:et(ul),operator:fl,derefOperator:et(fl),arithmeticOperator:et(fl),logicOperator:et(fl),bitwiseOperator:et(fl),compareOperator:et(fl),updateOperator:et(fl),definitionOperator:et(fl),typeOperator:et(fl),controlOperator:et(fl),punctuation:zN,separator:et(zN),bracket:D0,angleBracket:et(D0),squareBracket:et(D0),paren:et(D0),brace:et(D0),content:dl,heading:Wd,heading1:et(Wd),heading2:et(Wd),heading3:et(Wd),heading4:et(Wd),heading5:et(Wd),heading6:et(Wd),contentSeparator:et(dl),list:et(dl),quote:et(dl),emphasis:et(dl),strong:et(dl),link:et(dl),monospace:et(dl),strikethrough:et(dl),inserted:et(),deleted:et(),changed:et(),invalid:et(),meta:sO,documentMeta:et(sO),annotation:et(sO),processingInstruction:et(sO),definition:za.defineModifier("definition"),constant:za.defineModifier("constant"),function:za.defineModifier("function"),standard:za.defineModifier("standard"),local:za.defineModifier("local"),special:za.defineModifier("special")};for(let t in Ce){let e=Ce[t];e instanceof za&&(e.name=t)}Jde([{tag:Ce.link,class:"tok-link"},{tag:Ce.heading,class:"tok-heading"},{tag:Ce.emphasis,class:"tok-emphasis"},{tag:Ce.strong,class:"tok-strong"},{tag:Ce.keyword,class:"tok-keyword"},{tag:Ce.atom,class:"tok-atom"},{tag:Ce.bool,class:"tok-bool"},{tag:Ce.url,class:"tok-url"},{tag:Ce.labelName,class:"tok-labelName"},{tag:Ce.inserted,class:"tok-inserted"},{tag:Ce.deleted,class:"tok-deleted"},{tag:Ce.literal,class:"tok-literal"},{tag:Ce.string,class:"tok-string"},{tag:Ce.number,class:"tok-number"},{tag:[Ce.regexp,Ce.escape,Ce.special(Ce.string)],class:"tok-string2"},{tag:Ce.variableName,class:"tok-variableName"},{tag:Ce.local(Ce.variableName),class:"tok-variableName tok-local"},{tag:Ce.definition(Ce.variableName),class:"tok-variableName tok-definition"},{tag:Ce.special(Ce.variableName),class:"tok-variableName2"},{tag:Ce.definition(Ce.propertyName),class:"tok-propertyName tok-definition"},{tag:Ce.typeName,class:"tok-typeName"},{tag:Ce.namespace,class:"tok-namespace"},{tag:Ce.className,class:"tok-className"},{tag:Ce.macroName,class:"tok-macroName"},{tag:Ce.propertyName,class:"tok-propertyName"},{tag:Ce.operator,class:"tok-operator"},{tag:Ce.comment,class:"tok-comment"},{tag:Ce.meta,class:"tok-meta"},{tag:Ce.invalid,class:"tok-invalid"},{tag:Ce.punctuation,class:"tok-punctuation"}]);var XR;const og=new Vt;function Nat(t){return ct.define({combine:t?e=>e.concat(t):void 0})}const $at=new Vt;class Hs{constructor(e,n,r=[],i=""){this.data=e,this.name=i,en.prototype.hasOwnProperty("tree")||Object.defineProperty(en.prototype,"tree",{get(){return fi(this)}}),this.parser=n,this.extension=[cd.of(this),en.languageData.of((o,a,s)=>{let l=uq(o,a,s),c=l.type.prop(og);if(!c)return[];let u=o.facet(c),f=l.type.prop($at);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 uq(e,n,r).type.prop(og)==this.data}findRegions(e){let n=e.facet(cd);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(og)==this.data){r.push({from:a,to:a+o.length});return}let s=o.prop(Vt.mounted);if(s){if(s.tree.prop(og)==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 u_(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function fi(t){let e=t.field(Hs.state,!1);return e?e.tree:Wr.empty}class Fat{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 L0=null;class wE{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 wE(e,n,[],Wr.empty,0,r,[],null)}startParse(){return this.parser.startParse(new Fat(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=Wr.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(Wh.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=L0;L0=this;try{return e()}finally{L0=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=fq(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=Wh.applyChanges(r,l),i=Wr.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=fq(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 Kde{createParse(n,r,i){let o=i[0].from,a=i[i.length-1].to;return{parsedPos:o,advance(){let l=L0;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 Wr(Vo.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 L0}}function fq(t,e,n){return Wh.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class hv{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 hv(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=wE.create(e.facet(cd).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new hv(r)}}Hs.state=mi.define({create:hv.init,update(t,e){for(let n of e.effects)if(n.is(Hs.setState))return n.value;return e.startState.facet(cd)!=e.state.facet(cd)?hv.init(e.state):t.apply(e)}});let ehe=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(ehe=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const QR=typeof navigator<"u"&&(!((XR=navigator.scheduling)===null||XR===void 0)&&XR.isInputPending)?()=>navigator.scheduling.isInputPending():null,jat=kr.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(Hs.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(Hs.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=ehe(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEndi+1e3,l=o.context.work(()=>QR&&QR()||Date.now()>a,i+(s?0:1e5));this.chunkBudget-=Date.now()-n,(l||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:Hs.setState.of(new hv(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=>Ao(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()}}}),cd=ct.define({combine(t){return t.length?t[0]:null},enables:t=>[Hs.state,jat,rt.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class the{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}const Bat=ct.define(),xw=ct.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 SE(t){let e=t.facet(xw);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function f_(t,e){let n="",r=t.tabSize,i=t.facet(xw)[0];if(i==" "){for(;e>=r;)n+=" ",e-=r;i=" "}for(let o=0;o=e?zat(t,n,e):null}class K2{constructor(e,n={}){this.state=e,this.options=n,this.unit=SE(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 My(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 F4=new Vt;function zat(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 nhe(r,t,n)}function nhe(t,e,n){for(let r=t;r;r=r.next){let i=Wat(r.node);if(i)return i(j4.create(e,n,r))}return 0}function Uat(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function Wat(t){let e=t.type.prop(F4);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(Vt.closedBy))){let i=t.lastChild,o=i&&r.indexOf(i.name)>-1;return a=>rhe(a,!0,1,void 0,o&&!Uat(a)?i.from:void 0)}return t.parent==null?Vat:null}function Vat(){return 0}class j4 extends K2{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 j4(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(Gat(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return nhe(this.context.next,this.base,this.pos)}}function Gat(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function Hat(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.fromrhe(r,e,n,t)}function rhe(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?Hat(t):null;return l?s?t.column(l.from):t.column(l.to):t.baseIndent+(s?0:t.unit*n)}function dq({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const qat=200;function Xat(){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+qat)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=$4(a,u.from);if(f==null)continue;let d=/^\s*/.exec(u.text)[0],h=f_(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 Qat=ct.define(),B4=new Vt;function ihe(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 Kat(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function OE(t,e,n){for(let r of t.facet(Qat)){let i=r(t,e,n);if(i)return i}return Yat(t,e,n)}function ohe(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 Z2=Rt.define({map:ohe}),bw=Rt.define({map:ohe});function ahe(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 fp=mi.define({create(){return gt.none},update(t,e){t=t.map(e.changes);for(let n of e.effects)if(n.is(Z2)&&!Zat(t,n.value.from,n.value.to)){let{preparePlaceholder:r}=e.state.facet(che),i=r?gt.replace({widget:new ost(r(e.state,n.value))}):hq;t=t.update({add:[i.range(n.value.from,n.value.to)]})}else n.is(bw)&&(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 Zat(t,e,n){let r=!1;return t.between(e,e,(i,o)=>{i==e&&o==n&&(r=!0)}),r}function she(t,e){return t.field(fp,!1)?e:e.concat(Rt.appendConfig.of(uhe()))}const Jat=t=>{for(let e of ahe(t)){let n=OE(t.state,e.from,e.to);if(n)return t.dispatch({effects:she(t.state,[Z2.of(n),lhe(t,n)])}),!0}return!1},est=t=>{if(!t.state.field(fp,!1))return!1;let e=[];for(let n of ahe(t)){let r=CE(t.state,n.from,n.to);r&&e.push(bw.of(r),lhe(t,r,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function lhe(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 tst=t=>{let{state:e}=t,n=[];for(let r=0;r{let e=t.state.field(fp,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,(r,i)=>{n.push(bw.of({from:r,to:i}))}),t.dispatch({effects:n}),!0},rst=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:Jat},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:est},{key:"Ctrl-Alt-[",run:tst},{key:"Ctrl-Alt-]",run:nst}],ist={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},che=ct.define({combine(t){return cc(t,ist)}});function uhe(t){return[fp,lst]}function fhe(t,e){let{state:n}=t,r=n.facet(che),i=a=>{let s=t.lineBlockAt(t.posAtDOM(a.target)),l=CE(t.state,s.from,s.to);l&&t.dispatch({effects:bw.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 hq=gt.replace({widget:new class extends uc{toDOM(t){return fhe(t,null)}}});class ost extends uc{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return fhe(e,this.value)}}const ast={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class KR extends gu{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 sst(t={}){let e=Object.assign(Object.assign({},ast),t),n=new KR(e,!0),r=new KR(e,!1),i=kr.fromClass(class{constructor(a){this.from=a.viewport.from,this.markers=this.buildMarkers(a)}update(a){(a.docChanged||a.viewportChanged||a.startState.facet(cd)!=a.state.facet(cd)||a.startState.field(fp,!1)!=a.state.field(fp,!1)||fi(a.startState)!=fi(a.state)||e.foldingChanged(a))&&(this.markers=this.buildMarkers(a.view))}buildMarkers(a){let s=new id;for(let l of a.viewportLineBlocks){let c=CE(a.state,l.from,l.to)?r:OE(a.state,l.from,l.to)?n:null;c&&s.add(l.from,l.from,c)}return s.finish()}}),{domEventHandlers:o}=e;return[i,cat({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 KR(e,!1)},domEventHandlers:Object.assign(Object.assign({},o),{click:(a,s,l)=>{if(o.click&&o.click(a,s,l))return!0;let c=CE(a.state,s.from,s.to);if(c)return a.dispatch({effects:bw.of(c)}),!0;let u=OE(a.state,s.from,s.to);return u?(a.dispatch({effects:Z2.of(u)}),!0):!1}})}),uhe()]}const lst=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 _w{constructor(e,n){this.specs=e;let r;function i(s){let l=od.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 Hs?s=>s.prop(og)==a.data:a?s=>s==a:void 0,this.style=Jde(e.map(s=>({tag:s.tag,class:s.class||i(Object.assign({},s,{tag:null}))})),{all:o}).style,this.module=r?new od(r):null,this.themeType=n.themeType}static define(e,n){return new _w(e,n||{})}}const UN=ct.define(),dhe=ct.define({combine(t){return t.length?[t[0]]:null}});function ZR(t){let e=t.facet(UN);return e.length?e:t.facet(dhe)}function hhe(t,e){let n=[ust],r;return t instanceof _w&&(t.module&&n.push(rt.styleModule.of(t.module)),r=t.themeType),e!=null&&e.fallback?n.push(dhe.of(t)):r?n.push(UN.computeN([rt.darkTheme],i=>i.facet(rt.darkTheme)==(r=="dark")?[t]:[])):n.push(UN.of(t)),n}class cst{constructor(e){this.markCache=Object.create(null),this.tree=fi(e.state),this.decorations=this.buildDeco(e,ZR(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=fi(e.state),r=ZR(e.state),i=r!=ZR(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 gt.none;let r=new id;for(let{from:i,to:o}of e.visibleRanges)Iat(this.tree,n,(a,s,l)=>{r.add(a,s,this.markCache[l]||(this.markCache[l]=gt.mark({class:l})))},i,o);return r.finish()}}const ust=Ed.high(kr.fromClass(cst,{decorations:t=>t.decorations})),fst=_w.define([{tag:Ce.meta,color:"#404740"},{tag:Ce.link,textDecoration:"underline"},{tag:Ce.heading,textDecoration:"underline",fontWeight:"bold"},{tag:Ce.emphasis,fontStyle:"italic"},{tag:Ce.strong,fontWeight:"bold"},{tag:Ce.strikethrough,textDecoration:"line-through"},{tag:Ce.keyword,color:"#708"},{tag:[Ce.atom,Ce.bool,Ce.url,Ce.contentSeparator,Ce.labelName],color:"#219"},{tag:[Ce.literal,Ce.inserted],color:"#164"},{tag:[Ce.string,Ce.deleted],color:"#a11"},{tag:[Ce.regexp,Ce.escape,Ce.special(Ce.string)],color:"#e40"},{tag:Ce.definition(Ce.variableName),color:"#00f"},{tag:Ce.local(Ce.variableName),color:"#30a"},{tag:[Ce.typeName,Ce.namespace],color:"#085"},{tag:Ce.className,color:"#167"},{tag:[Ce.special(Ce.variableName),Ce.macroName],color:"#256"},{tag:Ce.definition(Ce.propertyName),color:"#00c"},{tag:Ce.comment,color:"#940"},{tag:Ce.invalid,color:"#f00"}]),dst=rt.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),phe=1e4,mhe="()[]{}",ghe=ct.define({combine(t){return cc(t,{afterCursor:!0,brackets:mhe,maxScanDistance:phe,renderMatch:mst})}}),hst=gt.mark({class:"cm-matchingBracket"}),pst=gt.mark({class:"cm-nonmatchingBracket"});function mst(t){let e=[],n=t.matched?hst:pst;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 gst=mi.define({create(){return gt.none},update(t,e){if(!e.docChanged&&!e.selection)return t;let n=[],r=e.state.facet(ghe);for(let i of e.state.selection.ranges){if(!i.empty)continue;let o=Ll(e.state,i.head,-1,r)||i.head>0&&Ll(e.state,i.head-1,1,r)||r.afterCursor&&(Ll(e.state,i.head,1,r)||i.headrt.decorations.from(t)}),vst=[gst,dst];function yst(t={}){return[ghe.of(t),vst]}const xst=new Vt;function WN(t,e,n){let r=t.prop(e<0?Vt.openedBy:Vt.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 VN(t){let e=t.type.prop(xst);return e?e(t.node):t}function Ll(t,e,n,r={}){let i=r.maxScanDistance||phe,o=r.brackets||mhe,a=fi(t),s=a.resolveInner(e,n);for(let l=s;l;l=l.parent){let c=WN(l.type,n,o);if(c&&l.from0?e>=u.from&&eu.from&&e<=u.to))return bst(t,e,n,l,u,c,o)}}return _st(t,e,n,a,s.type,i,o)}function bst(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 wst=Object.create(null),pq=[Vo.none],mq=[],gq=Object.create(null),Sst=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"]])Sst[t]=Ost(wst,e);function JR(t,e){mq.indexOf(t)>-1||(mq.push(t),console.warn(e))}function Ost(t,e){let n=[];for(let s of e.split(" ")){let l=[];for(let c of s.split(".")){let u=t[c]||Ce[c];u?typeof u=="function"?l.length?l=l.map(u):JR(c,`Modifier ${c} used at start of tag`):l.length?JR(c,`Tag ${c} used as modifier`):l=Array.isArray(u)?u:[u]:JR(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=gq[i];if(o)return o.id;let a=gq[i]=Vo.define({id:pq.length,name:r,props:[N4({[r]:n})]});return pq.push(a),a.id}rr.RTL,rr.LTR;const Cst=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=U4(t.state,n.from);return r.line?Tst(t):r.block?Pst(t):!1};function z4(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 Tst=z4(Ast,0),Est=z4(vhe,0),Pst=z4((t,e)=>vhe(t,e,kst(e)),0);function U4(t,e){let n=t.languageDataAt("commentTokens",e);return n.length?n[0]:{}}const N0=50;function Mst(t,{open:e,close:n},r,i){let o=t.sliceDoc(r-N0,r),a=t.sliceDoc(i,i+N0),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*N0?u=f=t.sliceDoc(r,i):(u=t.sliceDoc(r,r+N0),f=t.sliceDoc(i-N0,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 kst(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 vhe(t,e,n=e.selection.ranges){let r=n.map(o=>U4(e,o.from).block);if(!r.every(o=>o))return null;let i=n.map((o,a)=>Mst(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 GN=lc.define(),Rst=lc.define(),Ist=ct.define(),yhe=ct.define({combine(t){return cc(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)})}}),xhe=mi.define({create(){return Nl.empty},update(t,e){let n=e.state.facet(yhe),r=e.annotation(GN);if(r){let l=Ro.fromTransaction(e,r.selection),c=r.side,u=c==0?t.undone:t.done;return l?u=TE(u,u.length,n.minDepth,l):u=whe(u,e.startState.selection),new Nl(c==0?r.rest:u,c==0?u:r.rest)}let i=e.annotation(Rst);if((i=="full"||i=="before")&&(t=t.isolate()),e.annotation(Ur.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let o=Ro.fromTransaction(e),a=e.annotation(Ur.time),s=e.annotation(Ur.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 Nl(t.done.map(Ro.fromJSON),t.undone.map(Ro.fromJSON))}});function Dst(t={}){return[xhe,yhe.of(t),rt.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?bhe:e.inputType=="historyRedo"?HN:null;return r?(e.preventDefault(),r(n)):!1}})]}function J2(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let i=n.field(xhe,!1);if(!i)return!1;let o=i.pop(t,n,e);return o?(r(o),!0):!1}}const bhe=J2(0,!1),HN=J2(1,!1),Lst=J2(0,!0),Nst=J2(1,!0);class Ro{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 Ro(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 Ro(e.changes&&Zr.fromJSON(e.changes),[],e.mapped&&Ql.fromJSON(e.mapped),e.startSelection&&je.fromJSON(e.startSelection),e.selectionsAfter.map(je.fromJSON))}static fromTransaction(e,n){let r=Ka;for(let i of e.startState.facet(Ist)){let o=i(e);o.length&&(r=r.concat(o))}return!r.length&&e.changes.empty?null:new Ro(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,Ka)}static selection(e){return new Ro(void 0,Ka,void 0,void 0,e)}}function TE(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 $st(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 Fst(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function _he(t,e){return t.length?e.length?t.concat(e):t:e}const Ka=[],jst=200;function whe(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-jst));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),TE(t,t.length-1,1e9,n.setSelAfter(r)))}else return[Ro.selection([e])]}function Bst(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 eI(t,e){if(!t.length)return t;let n=t.length,r=Ka;for(;n;){let i=zst(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?[Ro.selection(r)]:Ka}function zst(t,e,n){let r=_he(t.selectionsAfter.length?t.selectionsAfter.map(s=>s.map(e)):Ka,n);if(!t.changes)return Ro.selection(r);let i=t.changes.map(e),o=e.mapDesc(t.changes,!0),a=t.mapped?t.mapped.composeDesc(o):o;return new Ro(i,Rt.mapEffects(t.effects,e),a,t.startSelection.map(o),r)}const Ust=/^(input\.type|delete)($|\.)/;class Nl{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 Nl(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||Ust.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime0&&n-this.prevTimen.empty?t.moveByChar(n,e):ek(n,e))}function eo(t){return t.textDirectionAt(t.state.selection.main.head)==rr.LTR}const Ohe=t=>She(t,!eo(t)),Che=t=>She(t,eo(t));function The(t,e){return il(t,n=>n.empty?t.moveByGroup(n,e):ek(n,e))}const Vst=t=>The(t,!eo(t)),Gst=t=>The(t,eo(t));function Hst(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 tk(t,e,n){let r=fi(t).resolveInner(e.head),i=n?Vt.closedBy:Vt.openedBy;for(let l=e.head;;){let c=n?r.childAfter(l):r.childBefore(l);if(!c)break;Hst(t,c,i)?r=c:l=n?c.to:c.from}let o=r.type.prop(i),a,s;return o&&(a=n?Ll(t,r.from,1):Ll(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 qst=t=>il(t,e=>tk(t.state,e,!eo(t))),Xst=t=>il(t,e=>tk(t.state,e,eo(t)));function Ehe(t,e){return il(t,n=>{if(!n.empty)return ek(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const Phe=t=>Ehe(t,!1),Mhe=t=>Ehe(t,!0);function khe(t){let e=t.scrollDOM.clientHeighta.empty?t.moveVertically(a,e,n.height):ek(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.bottomAhe(t,!1),qN=t=>Ahe(t,!0);function Pd(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 Qst=t=>il(t,e=>Pd(t,e,!0)),Yst=t=>il(t,e=>Pd(t,e,!1)),Kst=t=>il(t,e=>Pd(t,e,!eo(t))),Zst=t=>il(t,e=>Pd(t,e,eo(t))),Jst=t=>il(t,e=>je.cursor(t.lineBlockAt(e.head).from,1)),elt=t=>il(t,e=>je.cursor(t.lineBlockAt(e.head).to,-1));function tlt(t,e,n){let r=!1,i=ky(t.selection,o=>{let a=Ll(t,o.head,-1)||Ll(t,o.head,1)||o.head>0&&Ll(t,o.head-1,1)||o.headtlt(t,e);function Os(t,e){let n=ky(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(fc(t.state,n)),!0)}function Rhe(t,e){return Os(t,n=>t.moveByChar(n,e))}const Ihe=t=>Rhe(t,!eo(t)),Dhe=t=>Rhe(t,eo(t));function Lhe(t,e){return Os(t,n=>t.moveByGroup(n,e))}const rlt=t=>Lhe(t,!eo(t)),ilt=t=>Lhe(t,eo(t)),olt=t=>Os(t,e=>tk(t.state,e,!eo(t))),alt=t=>Os(t,e=>tk(t.state,e,eo(t)));function Nhe(t,e){return Os(t,n=>t.moveVertically(n,e))}const $he=t=>Nhe(t,!1),Fhe=t=>Nhe(t,!0);function jhe(t,e){return Os(t,n=>t.moveVertically(n,e,khe(t).height))}const yq=t=>jhe(t,!1),xq=t=>jhe(t,!0),slt=t=>Os(t,e=>Pd(t,e,!0)),llt=t=>Os(t,e=>Pd(t,e,!1)),clt=t=>Os(t,e=>Pd(t,e,!eo(t))),ult=t=>Os(t,e=>Pd(t,e,eo(t))),flt=t=>Os(t,e=>je.cursor(t.lineBlockAt(e.head).from)),dlt=t=>Os(t,e=>je.cursor(t.lineBlockAt(e.head).to)),bq=({state:t,dispatch:e})=>(e(fc(t,{anchor:0})),!0),_q=({state:t,dispatch:e})=>(e(fc(t,{anchor:t.doc.length})),!0),wq=({state:t,dispatch:e})=>(e(fc(t,{anchor:t.selection.main.anchor,head:0})),!0),Sq=({state:t,dispatch:e})=>(e(fc(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),hlt=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),plt=({state:t,dispatch:e})=>{let n=nk(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},mlt=({state:t,dispatch:e})=>{let n=ky(t.selection,r=>{var i;let o=fi(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(fc(t,n)),!0},glt=({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(fc(t,r)),!0):!1};function ww(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=lO(t,l,!0)),a=Math.min(a,l),s=Math.max(s,l)}else a=lO(t,a,!1),s=lO(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 Bhe=(t,e,n)=>ww(t,r=>{let i=r.from,{state:o}=t,a=o.doc.lineAt(i),s,l;if(n&&!e&&i>a.from&&iBhe(t,!1,!0),zhe=t=>Bhe(t,!0,!1),Uhe=(t,e)=>ww(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}),Whe=t=>Uhe(t,!1),vlt=t=>Uhe(t,!0),ylt=t=>ww(t,e=>{let n=t.lineBlockAt(e.head).to;return e.headww(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),blt=t=>ww(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:xn.of(["",""])},range:je.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},wlt=({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 nk(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 Vhe(t,e,n){if(t.readOnly)return!1;let r=[],i=[];for(let o of nk(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 Slt=({state:t,dispatch:e})=>Vhe(t,e,!1),Olt=({state:t,dispatch:e})=>Vhe(t,e,!0);function Ghe(t,e,n){if(t.readOnly)return!1;let r=[];for(let i of nk(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 Clt=({state:t,dispatch:e})=>Ghe(t,e,!1),Tlt=({state:t,dispatch:e})=>Ghe(t,e,!0),Elt=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(nk(e).map(({from:i,to:o})=>(i>0?i--:o{let o;if(t.lineWrapping){let a=t.lineBlockAt(i.head),s=t.coordsAtPos(i.head,i.assoc||1);s&&(o=a.bottom+t.documentTop-s.bottom+t.defaultLineHeight/2)}return t.moveVertically(i,!0,o)}).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Plt(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=fi(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(Vt.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 Mlt=Hhe(!1),klt=Hhe(!0);function Hhe(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&&Plt(e,o);t&&(o=a=(a<=s.to?s:e.doc.lineAt(a)).to);let c=new K2(e,{simulateBreak:o,simulateDoubleBreak:!!l}),u=$4(c,o);for(u==null&&(u=My(/^\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 Alt=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new K2(t,{overrideIndentation:o=>{let a=n[o];return a??-1}}),i=W4(t,(o,a,s)=>{let l=$4(r,o.from);if(l==null)return;/\S/.test(o.text)||(l=0);let c=/^\s*/.exec(o.text)[0],u=f_(t,l);(c!=u||s.fromt.readOnly?!1:(e(t.update(W4(t,(n,r)=>{r.push({from:n.from,insert:t.facet(xw)})}),{userEvent:"input.indent"})),!0),Xhe=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(W4(t,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let o=My(i,t.tabSize),a=0,s=f_(t,Math.max(0,o-SE(t)));for(;a(t.setTabFocusMode(),!0),Ilt=[{key:"Ctrl-b",run:Ohe,shift:Ihe,preventDefault:!0},{key:"Ctrl-f",run:Che,shift:Dhe},{key:"Ctrl-p",run:Phe,shift:$he},{key:"Ctrl-n",run:Mhe,shift:Fhe},{key:"Ctrl-a",run:Jst,shift:flt},{key:"Ctrl-e",run:elt,shift:dlt},{key:"Ctrl-d",run:zhe},{key:"Ctrl-h",run:XN},{key:"Ctrl-k",run:ylt},{key:"Ctrl-Alt-h",run:Whe},{key:"Ctrl-o",run:_lt},{key:"Ctrl-t",run:wlt},{key:"Ctrl-v",run:qN}],Dlt=[{key:"ArrowLeft",run:Ohe,shift:Ihe,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:Vst,shift:rlt,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Kst,shift:clt,preventDefault:!0},{key:"ArrowRight",run:Che,shift:Dhe,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:Gst,shift:ilt,preventDefault:!0},{mac:"Cmd-ArrowRight",run:Zst,shift:ult,preventDefault:!0},{key:"ArrowUp",run:Phe,shift:$he,preventDefault:!0},{mac:"Cmd-ArrowUp",run:bq,shift:wq},{mac:"Ctrl-ArrowUp",run:vq,shift:yq},{key:"ArrowDown",run:Mhe,shift:Fhe,preventDefault:!0},{mac:"Cmd-ArrowDown",run:_q,shift:Sq},{mac:"Ctrl-ArrowDown",run:qN,shift:xq},{key:"PageUp",run:vq,shift:yq},{key:"PageDown",run:qN,shift:xq},{key:"Home",run:Yst,shift:llt,preventDefault:!0},{key:"Mod-Home",run:bq,shift:wq},{key:"End",run:Qst,shift:slt,preventDefault:!0},{key:"Mod-End",run:_q,shift:Sq},{key:"Enter",run:Mlt},{key:"Mod-a",run:hlt},{key:"Backspace",run:XN,shift:XN},{key:"Delete",run:zhe},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Whe},{key:"Mod-Delete",mac:"Alt-Delete",run:vlt},{mac:"Mod-Backspace",run:xlt},{mac:"Mod-Delete",run:blt}].concat(Ilt.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),Llt=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:qst,shift:olt},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Xst,shift:alt},{key:"Alt-ArrowUp",run:Slt},{key:"Shift-Alt-ArrowUp",run:Clt},{key:"Alt-ArrowDown",run:Olt},{key:"Shift-Alt-ArrowDown",run:Tlt},{key:"Escape",run:glt},{key:"Mod-Enter",run:klt},{key:"Alt-l",mac:"Ctrl-l",run:plt},{key:"Mod-i",run:mlt,preventDefault:!0},{key:"Mod-[",run:Xhe},{key:"Mod-]",run:qhe},{key:"Mod-Alt-\\",run:Alt},{key:"Shift-Mod-k",run:Elt},{key:"Shift-Mod-\\",run:nlt},{key:"Mod-/",run:Cst},{key:"Alt-A",run:Est},{key:"Ctrl-m",mac:"Shift-Alt-m",run:Rlt}].concat(Dlt),Nlt={key:"Tab",run:qhe,shift:Xhe};function zn(){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 pv{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(Oq(s)):Oq,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=x4(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=Ha(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=EE(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 Ig(n,e.sliceString(n,r));return tI.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=EE(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Ig.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(Khe.prototype[Symbol.iterator]=Zhe.prototype[Symbol.iterator]=function(){return this});function $lt(t){try{return new RegExp(t,V4),!0}catch{return!1}}function EE(t,e){if(e>=t.length)return e;let n=t.lineAt(e),r;for(;e=56320&&r<57344;)e++;return e}function QN(t){let e=String(t.state.doc.lineAt(t.state.selection.main.head).number),n=zn("input",{class:"cm-textfield",name:"line",value:e}),r=zn("form",{class:"cm-gotoLine",onkeydown:o=>{o.keyCode==27?(o.preventDefault(),t.dispatch({effects:PE.of(!1)}),t.focus()):o.keyCode==13&&(o.preventDefault(),i())},onsubmit:o=>{o.preventDefault(),i()}},zn("label",t.state.phrase("Go to line"),": ",n)," ",zn("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:[PE.of(!1),rt.scrollIntoView(m.from,{y:"center"})],selection:m}),t.focus()}return{dom:r}}const PE=Rt.define(),Cq=mi.define({create(){return!0},update(t,e){for(let n of e.effects)n.is(PE)&&(t=n.value);return t},provide:t=>l_.from(t,e=>e?QN:null)}),Flt=t=>{let e=s_(t,QN);if(!e){let n=[PE.of(!0)];t.state.field(Cq,!1)==null&&n.push(Rt.appendConfig.of([Cq,jlt])),t.dispatch({effects:n}),e=s_(t,QN)}return e&&e.dom.querySelector("input").select(),!0},jlt=rt.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),Blt={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},zlt=ct.define({combine(t){return cc(t,Blt,{highlightWordAroundCursor:(e,n)=>e||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function Ult(t){return[qlt,Hlt]}const Wlt=gt.mark({class:"cm-selectionMatch"}),Vlt=gt.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Tq(t,e,n,r){return(n==0||t(e.sliceDoc(n-1,n))!=fr.Word)&&(r==e.doc.length||t(e.sliceDoc(r,r+1))!=fr.Word)}function Glt(t,e,n,r){return t(e.sliceDoc(n,n+1))==fr.Word&&t(e.sliceDoc(r-1,r))==fr.Word}const Hlt=kr.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(zlt),{state:n}=t,r=n.selection;if(r.ranges.length>1)return gt.none;let i=r.main,o,a=null;if(i.empty){if(!e.highlightWordAroundCursor)return gt.none;let l=n.wordAt(i.head);if(!l)return gt.none;a=n.charCategorizer(i.head),o=n.sliceDoc(l.from,l.to)}else{let l=i.to-i.from;if(l200)return gt.none;if(e.wholeWords){if(o=n.sliceDoc(i.from,i.to),a=n.charCategorizer(i.head),!(Tq(a,n,i.from,i.to)&&Glt(a,n,i.from,i.to)))return gt.none}else if(o=n.sliceDoc(i.from,i.to),!o)return gt.none}let s=[];for(let l of t.visibleRanges){let c=new pv(n.doc,o,l.from,l.to);for(;!c.next().done;){let{from:u,to:f}=c.value;if((!a||Tq(a,n,u,f))&&(i.empty&&u<=i.from&&f>=i.to?s.push(Vlt.range(u,f)):(u>=i.to||f<=i.from)&&s.push(Wlt.range(u,f)),s.length>e.maxMatches))return gt.none}}return gt.set(s)}},{decorations:t=>t.decorations}),qlt=rt.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Xlt=({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 Qlt(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 pv(t.doc,e,r[r.length-1].to);;)if(s.next(),s.done){if(a)return null;s=new pv(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 Ylt=({state:t,dispatch:e})=>{let{ranges:n}=t.selection;if(n.some(o=>o.from===o.to))return Xlt({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=Qlt(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},Ay=ct.define({combine(t){return cc(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new lct(e),scrollToMatch:e=>rt.scrollIntoView(e)})}});class Jhe{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||$lt(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 ect(this):new Zlt(this)}getCursor(e,n=0,r){let i=e.doc?e:en.create({doc:e});return r==null&&(r=i.doc.length),this.regexp?Wm(this,i,n,r):Um(this,i,n,r)}}class epe{constructor(e){this.spec=e}}function Um(t,e,n,r){return new pv(e.doc,t.unquoted,n,r,t.caseSensitive?void 0:i=>i.toLowerCase(),t.wholeWord?Klt(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function Klt(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=Um(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 Wm(t,e,n,r){return new Khe(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:t.wholeWord?Jlt(e.charCategorizer(e.selection.main.head)):void 0},n,r)}function ME(t,e){return t.slice(ki(t,e,!1),e)}function kE(t,e){return t.slice(e,ki(t,e))}function Jlt(t){return(e,n,r)=>!r[0].length||(t(ME(r.input,r.index))!=fr.Word||t(kE(r.input,r.index))!=fr.Word)&&(t(kE(r.input,r.index+r[0].length))!=fr.Word||t(ME(r.input,r.index+r[0].length))!=fr.Word)}class ect extends epe{nextMatch(e,n,r){let i=Wm(this.spec,e,r,e.doc.length).next();return i.done&&(i=Wm(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=Wm(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=Wm(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 d_=Rt.define(),G4=Rt.define(),Wf=mi.define({create(t){return new nI(YN(t).create(),null)},update(t,e){for(let n of e.effects)n.is(d_)?t=new nI(n.value.create(),t.panel):n.is(G4)&&(t=new nI(t.query,n.value?H4:null));return t},provide:t=>l_.from(t,e=>e.panel)});class nI{constructor(e,n){this.query=e,this.panel=n}}const tct=gt.mark({class:"cm-searchMatch"}),nct=gt.mark({class:"cm-searchMatch cm-searchMatch-selected"}),rct=kr.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(Wf))}update(t){let e=t.state.field(Wf);(e!=t.startState.field(Wf)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return gt.none;let{view:n}=this,r=new id;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?nct:tct)})}return r.finish()}},{decorations:t=>t.decorations});function Sw(t){return e=>{let n=e.state.field(Wf,!1);return n&&n.query.spec.valid?t(e,n):rpe(e)}}const AE=Sw((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(Ay);return t.dispatch({selection:i,effects:[q4(t,r),o.scrollToMatch(i.main,t)],userEvent:"select.search"}),npe(t),!0}),RE=Sw((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(Ay);return t.dispatch({selection:o,effects:[q4(t,i),a.scrollToMatch(o.main,t)],userEvent:"select.search"}),npe(t),!0}),ict=Sw((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)}),oct=({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 pv(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},Eq=Sw((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(q4(t,o)),c.push(n.facet(Ay).scrollToMatch(s.main,t))}return t.dispatch({changes:a,selection:s,effects:c,userEvent:"input.replace"}),!0}),act=Sw((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 H4(t){return t.state.facet(Ay).createPanel(t)}function YN(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(Ay);return new Jhe({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 tpe(t){let e=s_(t,H4);return e&&e.dom.querySelector("[main-field]")}function npe(t){let e=tpe(t);e&&e==t.root.activeElement&&e.select()}const rpe=t=>{let e=t.state.field(Wf,!1);if(e&&e.panel){let n=tpe(t);if(n&&n!=t.root.activeElement){let r=YN(t.state,e.query.spec);r.valid&&t.dispatch({effects:d_.of(r)}),n.focus(),n.select()}}else t.dispatch({effects:[G4.of(!0),e?d_.of(YN(t.state,e.query.spec)):Rt.appendConfig.of(uct)]});return!0},ipe=t=>{let e=t.state.field(Wf,!1);if(!e||!e.panel)return!1;let n=s_(t,H4);return n&&n.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:G4.of(!1)}),!0},sct=[{key:"Mod-f",run:rpe,scope:"editor search-panel"},{key:"F3",run:AE,shift:RE,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:AE,shift:RE,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:ipe,scope:"editor search-panel"},{key:"Mod-Shift-l",run:oct},{key:"Mod-Alt-g",run:Flt},{key:"Mod-d",run:Ylt,preventDefault:!0}];class lct{constructor(e){this.view=e;let n=this.query=e.state.field(Wf).query.spec;this.commit=this.commit.bind(this),this.searchField=zn("input",{value:n.search,placeholder:Yo(e,"Find"),"aria-label":Yo(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=zn("input",{value:n.replace,placeholder:Yo(e,"Replace"),"aria-label":Yo(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=zn("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=zn("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=zn("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(i,o,a){return zn("button",{class:"cm-button",name:i,onclick:o,type:"button"},a)}this.dom=zn("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>AE(e),[Yo(e,"next")]),r("prev",()=>RE(e),[Yo(e,"previous")]),r("select",()=>ict(e),[Yo(e,"all")]),zn("label",null,[this.caseField,Yo(e,"match case")]),zn("label",null,[this.reField,Yo(e,"regexp")]),zn("label",null,[this.wordField,Yo(e,"by word")]),...e.state.readOnly?[]:[zn("br"),this.replaceField,r("replace",()=>Eq(e),[Yo(e,"replace")]),r("replaceAll",()=>act(e),[Yo(e,"replace all")])],zn("button",{name:"close",onclick:()=>ipe(e),"aria-label":Yo(e,"close"),type:"button"},["×"])])}commit(){let e=new Jhe({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:d_.of(e)}))}keydown(e){vot(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?RE:AE)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Eq(this.view))}update(e){for(let n of e.transactions)for(let r of n.effects)r.is(d_)&&!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(Ay).top}}function Yo(t,e){return t.state.phrase(e)}const cO=30,uO=/[\s\.,:;?!]/;function q4(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-cO),a=Math.min(i,n+cO),s=t.state.sliceDoc(o,a);if(o!=r.from){for(let l=0;ls.length-cO;l--)if(!uO.test(s[l-1])&&uO.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 cct=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"}}),uct=[Wf,Ed.low(rct),cct];class ope{constructor(e,n,r,i){this.state=e,this.pos=n,this.explicit=r,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let n=fi(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(spe(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,r){e=="abort"&&this.abortListeners&&(this.abortListeners.push(n),r&&r.onDocChange&&(this.abortOnDocChange=!0))}}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 fct(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+$/]:fct(e);return i=>{let o=i.matchBefore(r);return o||i.explicit?{from:o?o.from:i.pos,options:e,validFor:n}:null}}function dct(t,e){return n=>{for(let r=fi(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 Vf(t){return t.selection.main.from}function spe(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 X4=lc.define();function hct(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 kq=new WeakMap;function pct(t){if(!Array.isArray(t))return t;let e=kq.get(t);return e||kq.set(t,e=ape(t)),e}const IE=Rt.define(),h_=Rt.define();class mct{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=x4(_))!=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+=Ha(_)}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?Ha(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 gct{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:vct,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=>Aq(e(r),n(r)),optionClass:(e,n)=>r=>Aq(e(r),n(r)),addToOptions:(e,n)=>e.concat(n),filterStrict:(e,n)=>e||n})}});function Aq(t,e){return t?e?t+" "+e:t:e}function vct(t,e,n,r,i,o){let a=t.textDirection==rr.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 yct(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 rI(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 xct{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=yct(s),this.optionClass=s.optionClass,this.tooltipClass=s.tooltipClass,this.range=rI(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:h_.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=rI(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=rI(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=>Ao(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&&_ct(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 xct(n,t,e)}function _ct(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 Rq(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function wct(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 gct(f):new mct(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):Rq(c.completion)>Rq(s)&&(a[a.length-1]=c),s=c.completion}return a}class ag{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 ag(this.options,Iq(n,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,n,r,i,o){let a=wct(e,n);if(!a.length)return i&&e.some(l=>l.state==1)?new ag(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:Pct,above:o.aboveCursor},i?i.timestamp:Date.now(),s,!1)}map(e){return new ag(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class DE{constructor(e,n,r){this.active=e,this.id=n,this.open=r}static start(){return new DE(Tct,"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",Vf(n)).map(pct)).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))||!Sct(o,this.active)?a=ag.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(upe)&&(a=a&&a.setSelected(s.value,this.id));return o==this.active&&a==this.open?this:new DE(o,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?Oct:Cct}}function Sct(t,e){if(t==e)return!0;for(let n=0,r=0;;){for(;n-1&&(n["aria-activedescendant"]=t+"-"+e),n}const Tct=[];function lpe(t,e){if(t.isUserEvent("input.complete")){let r=t.annotation(X4);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=lpe(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(IE))i=new da(i.source,1,o.value?Vf(e.state):-1);else if(o.is(h_))i=new da(i.source,0);else if(o.is(cpe))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(Vf(e.state))}}class Dg 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=Vf(e.state);if((this.explicitPos<0?s<=o:sa||!i||n&2&&Vf(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 Ect(i.validFor,e.state,o,a)?new Dg(this.source,l,i,o,a):i.update&&(i=i.update(i,o,a,new ope(e.state,s,l>=0)))?new Dg(this.source,l,i,i.from,(r=i.to)!==null&&r!==void 0?r:Vf(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 Dg(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 Ect(t,e,n,r){if(!t)return!1;let i=e.sliceDoc(n,r);return typeof t=="function"?t(i,n,r,e):spe(t,!0).test(i)}const cpe=Rt.define({map(t,e){return t.map(n=>n.map(e))}}),upe=Rt.define(),To=mi.define({create(){return DE.start()},update(t,e){return t.update(e)},provide:t=>[A4.from(t,e=>e.tooltip),rt.contentAttributes.from(t,e=>e.attrs)]});function Q4(t,e){const n=e.completion.apply||e.completion.label;let r=t.state.field(To).active.find(i=>i.source==e.source);return r instanceof Dg?(typeof n=="string"?t.dispatch(Object.assign(Object.assign({},hct(t.state,n,r.from,r.to)),{annotations:X4.of(e.completion)})):n(t,e.completion,r.from,r.to),!0):!1}const Pct=bct(To,Q4);function fO(t,e="option"){return n=>{let r=n.state.field(To,!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:upe.of(s)}),!0}}const Mct=t=>{let e=t.state.field(To,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampt.state.field(To,!1)?(t.dispatch({effects:IE.of(!0)}),!0):!1,Act=t=>{let e=t.state.field(To,!1);return!e||!e.active.some(n=>n.state!=0)?!1:(t.dispatch({effects:h_.of(null)}),!0)};class Rct{constructor(e,n){this.active=e,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const Ict=50,Dct=1e3,Lct=kr.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(To).active)e.state==1&&this.startQuery(e)}update(t){let e=t.state.field(To),n=t.state.facet(Mi);if(!t.selectionSet&&!t.docChanged&&t.startState.field(To)==e)return;let r=t.transactions.some(o=>{let a=lpe(o,n);return a&8||(o.selection||o.docChanged)&&!(a&3)});for(let o=0;oIct&&Date.now()-a.time>Dct){for(let s of a.context.abortListeners)try{s()}catch(l){Ao(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(IE)))&&(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(To);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=Vf(e),r=new ope(e,n,t.explicitPos==n,this.view),i=new Rct(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:h_.of(null)}),Ao(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:cpe.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(To,!1);if(e&&e.tooltip&&this.view.state.facet(Mi).closeOnBlur){let n=e.open&&Wde(this.view,e.open.tooltip);(!n||!n.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:h_.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:IE.of(!1)}),20),this.composing=0}}}),Nct=typeof navigator=="object"&&/Win/.test(navigator.platform),$ct=Ed.highest(rt.domEventHandlers({keydown(t,e){let n=e.state.field(To,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||t.key.length>1||t.ctrlKey&&!(Nct&&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&&Q4(e,r),!1}})),fpe=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",whiteSpace:"pre-line"},".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 Fct{constructor(e,n,r,i){this.field=e,this.line=n,this.from=r,this.to=i}}class Y4{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 Y4(this.field,n,r)}}class K4{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 Y4(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 Fct(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 K4(r,i)}}let jct=gt.widget({widget:new class extends uc{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),Bct=gt.mark({class:"cm-snippetField"});class Ry{constructor(e,n){this.ranges=e,this.active=n,this.deco=gt.set(e.map(r=>(r.from==r.to?jct:Bct).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 Ry(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 Ow=Rt.define({map(t,e){return t&&t.map(e)}}),zct=Rt.define(),p_=mi.define({create(){return null},update(t,e){for(let n of e.effects){if(n.is(Ow))return n.value;if(n.is(zct)&&t)return new Ry(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:gt.none)});function Z4(t,e){return je.create(t.filter(n=>n.field==e).map(n=>je.range(n.from,n.to)))}function Uct(t){let e=K4.parse(t);return(n,r,i,o)=>{let{text:a,ranges:s}=e.instantiate(n.state,i),l={changes:{from:i,to:o,insert:xn.of(a)},scrollIntoView:!0,annotations:r?[X4.of(r),Ur.userEvent.of("input.complete")]:void 0};if(s.length&&(l.selection=Z4(s,0)),s.some(c=>c.field>0)){let c=new Ry(s,0),u=l.effects=[Ow.of(c)];n.state.field(p_,!1)===void 0&&u.push(Rt.appendConfig.of([p_,qct,Xct,fpe]))}n.dispatch(n.state.update(l))}}function dpe(t){return({state:e,dispatch:n})=>{let r=e.field(p_,!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:Z4(r.ranges,i),effects:Ow.of(o?null:new Ry(r.ranges,i)),scrollIntoView:!0})),!0}}const Wct=({state:t,dispatch:e})=>t.field(p_,!1)?(e(t.update({effects:Ow.of(null)})),!0):!1,Vct=dpe(1),Gct=dpe(-1),Hct=[{key:"Tab",run:Vct,shift:Gct},{key:"Escape",run:Wct}],Dq=ct.define({combine(t){return t.length?t[0]:Hct}}),qct=Ed.highest(vw.compute([Dq],t=>t.facet(Dq)));function yc(t,e){return Object.assign(Object.assign({},e),{apply:Uct(t)})}const Xct=rt.domEventHandlers({mousedown(t,e){let n=e.state.field(p_,!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:Z4(n.ranges,i.field),effects:Ow.of(n.ranges.some(o=>o.field>i.field)?new Ry(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),m_={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Oh=Rt.define({map(t,e){let n=e.mapPos(t,-1,Pi.TrackAfter);return n??void 0}}),J4=new class extends sp{};J4.startSide=1;J4.endSide=-1;const hpe=mi.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(Oh)&&(t=t.update({add:[J4.range(n.value,n.value+1)]}));return t}});function Qct(){return[Kct,hpe]}const iI="()[]{}<>";function ppe(t){for(let e=0;e{if((Yct?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let i=t.state.selection.main;if(r.length>2||r.length==2&&Ha(Ci(r,0))==1||e!=i.from||n!=i.to)return!1;let o=eut(t.state,r);return o?(t.dispatch(o),!0):!1}),Zct=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=mpe(t,t.selection.main.head).brackets||m_.brackets,i=null,o=t.changeByRange(a=>{if(a.empty){let s=tut(t.doc,a.head);for(let l of r)if(l==s&&rk(t.doc,a.head)==ppe(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},Jct=[{key:"Backspace",run:Zct}];function eut(t,e){let n=mpe(t,t.selection.main.head),r=n.brackets||m_.brackets;for(let i of r){let o=ppe(Ci(i,0));if(e==i)return o==i?iut(t,i,r.indexOf(i+i+i)>-1,n):nut(t,i,o,n.before||m_.before);if(e==o&&gpe(t,t.selection.main.from))return rut(t,i,o)}return null}function gpe(t,e){let n=!1;return t.field(hpe).between(0,t.doc.length,r=>{r==e&&(n=!0)}),n}function rk(t,e){let n=t.sliceString(e,e+2);return n.slice(0,Ha(Ci(n,0)))}function tut(t,e){let n=t.sliceString(e-2,e);return Ha(Ci(n,0))==n.length?n:n.slice(1)}function nut(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:Oh.of(a.to+e.length),range:je.range(a.anchor+e.length,a.head+e.length)};let s=rk(t.doc,a.head);return!s||/\s/.test(s)||r.indexOf(s)>-1?{changes:{insert:e+n,from:a.head},effects:Oh.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 rut(t,e,n){let r=null,i=t.changeByRange(o=>o.empty&&rk(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 iut(t,e,n,r){let i=r.stringPrefixes||m_.stringPrefixes,o=null,a=t.changeByRange(s=>{if(!s.empty)return{changes:[{insert:e,from:s.from},{insert:e,from:s.to}],effects:Oh.of(s.to+e.length),range:je.range(s.anchor+e.length,s.head+e.length)};let l=s.head,c=rk(t.doc,l),u;if(c==e){if(Lq(t,l))return{changes:{insert:e+e,from:l},effects:Oh.of(l+e.length),range:je.cursor(l+e.length)};if(gpe(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=Nq(t,l-2*e.length,i))>-1&&Lq(t,u))return{changes:{insert:e+e+e+e,from:l},effects:Oh.of(l+e.length),range:je.cursor(l+e.length)};if(t.charCategorizer(l)(c)!=fr.Word&&Nq(t,l,i)>-1&&!out(t,l,e,i))return{changes:{insert:e+e,from:l},effects:Oh.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 Lq(t,e){let n=fi(t).resolveInner(e+1);return n.parent&&n.from==e}function out(t,e,n,r){let i=fi(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 Nq(t,e,n){let r=t.charCategorizer(e);if(r(t.sliceDoc(e-1,e))!=fr.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))!=fr.Word)return o}return-1}function vpe(t={}){return[$ct,To,Mi.of(t),Lct,aut,fpe]}const ype=[{key:"Ctrl-Space",run:kct},{key:"Escape",run:Act},{key:"ArrowDown",run:fO(!0)},{key:"ArrowUp",run:fO(!1)},{key:"PageDown",run:fO(!0,"page")},{key:"PageUp",run:fO(!1,"page")},{key:"Enter",run:Mct}],aut=Ed.highest(vw.computeN([Mi],t=>t.facet(Mi).defaultKeymap?[ype]:[]));class sut{constructor(e,n,r){this.from=e,this.to=n,this.diagnostic=r}}class fh{constructor(e,n,r){this.diagnostics=e,this.panel=n,this.selected=r}static init(e,n,r){let i=e,o=r.facet(g_).markerFilter;o&&(i=o(i,r));let a=gt.set(i.map(s=>s.from==s.to||s.from==s.to-1&&r.doc.lineAt(s.from).to==s.from?gt.widget({widget:new gut(s),diagnostic:s}).range(s.from):gt.mark({attributes:{class:"cm-lintRange cm-lintRange-"+s.severity+(s.markClass?" "+s.markClass:"")},diagnostic:s}).range(s.from,s.to)),!0);return new fh(a,n,mv(a))}}function mv(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 sut(i,o,a.diagnostic),!1}),r}function lut(t,e){let n=e.pos,r=e.end||n,i=t.state.facet(g_).hideOn(t,n,r);if(i!=null)return i;let o=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(a=>a.is(xpe))||t.changes.touchesRange(o.from,Math.max(o.to,r)))}function cut(t,e){return t.field(ga,!1)?e:e.concat(Rt.appendConfig.of(xut))}const xpe=Rt.define(),eU=Rt.define(),bpe=Rt.define(),ga=mi.define({create(){return new fh(gt.none,null,null)},update(t,e){if(e.docChanged&&t.diagnostics.size){let n=t.diagnostics.map(e.changes),r=null,i=t.panel;if(t.selected){let o=e.changes.mapPos(t.selected.from,1);r=mv(n,t.selected.diagnostic,o)||mv(n,null,o)}!n.size&&i&&e.state.facet(g_).autoPanel&&(i=null),t=new fh(n,i,r)}for(let n of e.effects)if(n.is(xpe)){let r=e.state.facet(g_).autoPanel?n.value.length?v_.open:null:t.panel;t=fh.init(n.value,r,e.state)}else n.is(eU)?t=new fh(t.diagnostics,n.value?v_.open:null,t.selected):n.is(bpe)&&(t=new fh(t.diagnostics,t.panel,n.value));return t},provide:t=>[l_.from(t,e=>e.panel),rt.decorations.from(t,e=>e.diagnostics)]}),uut=gt.mark({class:"cm-lintRange cm-lintRange-active"});function fut(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)&&(ewpe(t,n,!1)))}const hut=t=>{let e=t.state.field(ga,!1);(!e||!e.panel)&&t.dispatch({effects:cut(t.state,[eU.of(!0)])});let n=s_(t,v_.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:eU.of(!1)}),!0)},put=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)},mut=[{key:"Mod-Shift-m",run:hut,preventDefault:!0},{key:"F8",run:put}],g_=ct.define({combine(t){return Object.assign({sources:t.map(e=>e.source).filter(e=>e!=null)},cc(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(e,n)=>e?n?r=>e(r)||n(r):e:n}))}});function _pe(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 wpe(t,e,n){var r;let i=n?_pe(e.actions):[];return zn("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},zn("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):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=mv(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),zn("u",c.slice(u,u+1)),c.slice(u+1)];return zn("button",{type:"button",class:"cm-diagnosticAction",onclick:l,onmousedown:l,"aria-label":` Action: ${c}${u<0?"":` (access key "${i[a]})"`}.`},f)}),e.source&&zn("div",{class:"cm-diagnosticSource"},e.source))}class gut extends uc{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return zn("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class Fq{constructor(e,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=wpe(e,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class v_{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=_pe(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=mv(n.diagnostics,this.items[e].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:bpe.of(r)})}static open(e){return new v_(e)}}function vut(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(t)}')`}function dO(t){return vut(``,'width="6" height="3"')}const yut=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:dO("#d11")},".cm-lintRange-warning":{backgroundImage:dO("orange")},".cm-lintRange-info":{backgroundImage:dO("#999")},".cm-lintRange-hint":{backgroundImage:dO("#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}}}),xut=[ga,rt.decorations.compute([ga],t=>{let{selected:e,panel:n}=t.field(ga);return!e||!n||e.from==e.to?gt.none:gt.set([uut.range(e.from,e.to)])}),oat(fut,{hideOn:lut}),yut];var jq=function(e){e===void 0&&(e={});var n=[];e.closeBracketsKeymap!==!1&&(n=n.concat(Jct)),e.defaultKeymap!==!1&&(n=n.concat(Llt)),e.searchKeymap!==!1&&(n=n.concat(sct)),e.historyKeymap!==!1&&(n=n.concat(Wst)),e.foldKeymap!==!1&&(n=n.concat(rst)),e.completionKeymap!==!1&&(n=n.concat(ype)),e.lintKeymap!==!1&&(n=n.concat(mut));var r=[];return e.lineNumbers!==!1&&r.push(gat()),e.highlightActiveLineGutter!==!1&&r.push(xat()),e.highlightSpecialChars!==!1&&r.push(Dot()),e.history!==!1&&r.push(Dst()),e.foldGutter!==!1&&r.push(sst()),e.drawSelection!==!1&&r.push(Sot()),e.dropCursor!==!1&&r.push(Pot()),e.allowMultipleSelections!==!1&&r.push(en.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&r.push(Xat()),e.syntaxHighlighting!==!1&&r.push(hhe(fst,{fallback:!0})),e.bracketMatching!==!1&&r.push(yst()),e.closeBrackets!==!1&&r.push(Qct()),e.autocompletion!==!1&&r.push(vpe()),e.rectangularSelection!==!1&&r.push(Xot()),e.crosshairCursor!==!1&&r.push(Kot()),e.highlightActiveLine!==!1&&r.push(Bot()),e.highlightSelectionMatches!==!1&&r.push(Ult()),e.tabSize&&typeof e.tabSize=="number"&&r.push(xw.of(" ".repeat(e.tabSize))),r.concat([vw.of(n.flat())]).filter(Boolean)};const but="#e5c07b",Bq="#e06c75",_ut="#56b6c2",wut="#ffffff",HC="#abb2bf",KN="#7d8799",Sut="#61afef",Out="#98c379",zq="#d19a66",Cut="#c678dd",Tut="#21252b",Uq="#2c313a",Wq="#282c34",oI="#353a42",Eut="#3E4451",Vq="#528bff",Put=rt.theme({"&":{color:HC,backgroundColor:Wq},".cm-content":{caretColor:Vq},".cm-cursor, .cm-dropCursor":{borderLeftColor:Vq},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Eut},".cm-panels":{backgroundColor:Tut,color:HC},".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:Wq,color:KN,border:"none"},".cm-activeLineGutter":{backgroundColor:Uq},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:oI},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:oI,borderBottomColor:oI},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Uq,color:HC}}},{dark:!0}),Mut=_w.define([{tag:Ce.keyword,color:Cut},{tag:[Ce.name,Ce.deleted,Ce.character,Ce.propertyName,Ce.macroName],color:Bq},{tag:[Ce.function(Ce.variableName),Ce.labelName],color:Sut},{tag:[Ce.color,Ce.constant(Ce.name),Ce.standard(Ce.name)],color:zq},{tag:[Ce.definition(Ce.name),Ce.separator],color:HC},{tag:[Ce.typeName,Ce.className,Ce.number,Ce.changed,Ce.annotation,Ce.modifier,Ce.self,Ce.namespace],color:but},{tag:[Ce.operator,Ce.operatorKeyword,Ce.url,Ce.escape,Ce.regexp,Ce.link,Ce.special(Ce.string)],color:_ut},{tag:[Ce.meta,Ce.comment],color:KN},{tag:Ce.strong,fontWeight:"bold"},{tag:Ce.emphasis,fontStyle:"italic"},{tag:Ce.strikethrough,textDecoration:"line-through"},{tag:Ce.link,color:KN,textDecoration:"underline"},{tag:Ce.heading,fontWeight:"bold",color:Bq},{tag:[Ce.atom,Ce.bool,Ce.special(Ce.variableName)],color:zq},{tag:[Ce.processingInstruction,Ce.string,Ce.inserted],color:Out},{tag:Ce.invalid,color:wut}]),kut=[Put,hhe(Mut)];var Aut=rt.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),Rut=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(vw.of([Nlt])),s&&(typeof s=="boolean"?l.unshift(jq()):l.unshift(jq(s))),a&&l.unshift(Vot(a)),o){case"light":l.push(Aut);break;case"dark":l.push(kut);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]},Iut=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)}),Gq=lc.define(),Dut=[];function Lut(t){var{value:e,selection:n,onChange:r,onStatistics:i,onCreateEditor:o,onUpdate:a,extensions:s=Dut,autoFocus:l,theme:c="light",height:u="",minHeight:f="",maxHeight:d="",placeholder:h="",width:p="",minWidth:m="",maxWidth: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:p,minWidth:m,maxWidth:g},"& .cm-scroller":{height:"100% !important"}}),T=rt.updateListener.of(B=>{if(B.docChanged&&typeof r=="function"&&!B.transactions.some($=>$.annotation(Gq))){var U=B.state.doc,W=U.toString();r(W,B)}i&&i(Iut(B))}),L=Rut({theme:c,editable:v,readOnly:y,placeholder:h,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},U=S?en.fromJSON(S.json,B,S.fields):en.create(B);if(P(U),!E){var W=new rt({state:U,parent:O,root:_});k(W),o&&o(W,U)}}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:Rt.reconfigure.of(z)})},[c,s,u,f,d,p,m,g,h,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:[Gq.of(!0)]})}},[e,E]),{state:I,setState:P,view:E,setView:k,container:O,setContainer:C}}var Nut=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],ik=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,Nut),k=M.useRef(null),{state:I,view:P,container:R}=Lut({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))});ik.displayName="CodeMirror";var Hq={};let $ut=class ZN{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 ZN(e,[],n,r,r,0,[],0,i?new qq(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=this.reducePos=2e3&&!(!((n=this.p.parser.nodeSet.types[i])===null||n===void 0)&&n.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSizel;)this.stack.pop();this.reduceContext(i,c)}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){let s=!1;for(let l=a;l>0&&this.buffer[l-2]>r;l-=4)if(this.buffer[l-1]>=0){s=!0;break}if(s)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 ZN(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 Fut(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 qq{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class Fut{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 LE{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 LE(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 LE(this.stack,this.pos,this.index)}}function hO(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 qC{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Xq=new qC;class jut{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Xq,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=Xq,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 Lg{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:r}=n.p;But(this.data,e,n,this.id,r.data,r.tokenPrecTable)}}Lg.prototype.contextual=Lg.prototype.fallback=Lg.prototype.extend=!1;Lg.prototype.fallback=Lg.prototype.extend=!1;class ok{constructor(e,n={}){this.token=e,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function But(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||zut(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 Qq(t,e,n){for(let r=e,i;(i=t[r])!=65535;r++)if(i==n)return r-e;return-1}function zut(t,e,n,r){let i=Qq(n,r,e);return i<0||Qq(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 Uut{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?Yq(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Yq(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 Wr){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 Wut{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new qC)}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 qC,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 qC,{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 Uut(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&&qut(i);if(a)return Ko&&console.log("Finish with "+this.stackID(a)),this.stackToTree(a);if(this.parser.strict)throw Ko&&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 Ko&&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(Vt.contextHash)||0)==u))return e.useNode(f,d),Ko&&console.log(a+this.stackID(e)+` (via reuse of ${o.getName(f.type.id)})`),!0;if(!(f instanceof Wr)||f.children.length==0||f.positions[0]>0)break;let h=f.children[0];if(h instanceof Wr&&f.positions[0]==0)f=h;else break}}let s=o.stateSlot(e.state,4);if(s>0)return e.reduce(s),Ko&&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 Kq(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(),Ko&&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&&(Ko&&console.log(d+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,r));h++)Ko&&(d=this.stackID(f)+" -> ");for(let h of s.recoverByInsert(l))Ko&&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),Ko&&console.log(u+this.stackID(s)+` (via recover-delete ${this.parser.getName(l)})`),Kq(s,r)):(!i||i.scoret;class Hut{constructor(e){this.start=e.start,this.shift=e.shift||sI,this.reduce=e.reduce||sI,this.reuse=e.reuse||sI,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class y_ extends Kde{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 R4(n.map((s,l)=>Vo.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=hO(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 Lg(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 Vut(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=$c(this.data,o+2);else break;i=n($c(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=$c(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(y_.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]=Zq(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 Xut=N4({String:Ce.string,Number:Ce.number,"True False":Ce.bool,PropertyName:Ce.propertyName,Null:Ce.null,",":Ce.separator,"[ ]":Ce.squareBracket,"{ }":Ce.brace}),Qut=y_.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:[Xut],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}),Yut=u_.define({name:"json",parser:Qut.configure({props:[F4.add({Object:dq({except:/^\s*\}/}),Array:dq({except:/^\s*\]/})}),B4.add({"Object Array":ihe})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function Spe(){return new the(Yut)}const Kut=1,Ope=194,Cpe=195,Zut=196,Jq=197,Jut=198,eft=199,tft=200,nft=2,Tpe=3,eX=201,rft=24,ift=25,oft=49,aft=50,sft=55,lft=56,cft=57,uft=59,fft=60,dft=61,hft=62,pft=63,mft=65,gft=238,vft=71,yft=241,xft=242,bft=243,_ft=244,wft=245,Sft=246,Oft=247,Cft=248,Epe=72,Tft=249,Eft=250,Pft=251,Mft=252,kft=253,Aft=254,Rft=255,Ift=256,Dft=73,Lft=77,Nft=263,$ft=112,Fft=130,jft=151,Bft=152,zft=155,dp=10,x_=13,tU=32,ak=9,nU=35,Uft=40,Wft=46,JN=123,tX=125,Ppe=39,Mpe=34,Vft=92,Gft=111,Hft=120,qft=78,Xft=117,Qft=85,Yft=new Set([ift,oft,aft,Nft,mft,Fft,lft,cft,gft,hft,pft,Epe,Dft,Lft,fft,dft,jft,Bft,zft,$ft]);function lI(t){return t==dp||t==x_}function cI(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}const Kft=new ok((t,e)=>{let n;if(t.next<0)t.acceptToken(eft);else if(e.context.flags&XC)lI(t.next)&&t.acceptToken(Jut,1);else if(((n=t.peek(-1))<0||lI(n))&&e.canShift(Jq)){let r=0;for(;t.next==tU||t.next==ak;)t.advance(),r++;(t.next==dp||t.next==x_||t.next==nU)&&t.acceptToken(Jq,-r)}else lI(t.next)&&t.acceptToken(Zut,1)},{contextual:!0}),Zft=new ok((t,e)=>{let n=e.context;if(n.flags)return;let r=t.peek(-1);if(r==dp||r==x_){let i=0,o=0;for(;;){if(t.next==tU)i++;else if(t.next==ak)i+=8-i%8;else break;t.advance(),o++}i!=n.indent&&t.next!=dp&&t.next!=x_&&t.next!=nU&&(i[t,e|kpe])),tdt=new Hut({start:Jft,reduce(t,e,n,r){return t.flags&XC&&Yft.has(e)||(e==vft||e==Epe)&&t.flags&kpe?t.parent:t},shift(t,e,n,r){return e==Ope?new QC(t,edt(r.read(r.pos,n.pos)),0):e==Cpe?t.parent:e==rft||e==sft||e==uft||e==Tpe?new QC(t,0,XC):nX.has(e)?new QC(t,0,nX.get(e)|t.flags&XC):t},hash(t){return t.hash}}),ndt=new ok(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==tU||n==ak)){n!=Uft&&n!=Wft&&n!=dp&&n!=x_&&n!=nU&&t.acceptToken(Kut);return}}}),rdt=new ok((t,e)=>{let{flags:n}=e.context,r=n&Ec?Mpe:Ppe,i=(n&Pc)>0,o=!(n&Mc),a=(n&kc)>0,s=t.pos;for(;!(t.next<0);)if(a&&t.next==JN)if(t.peek(1)==JN)t.advance(2);else{if(t.pos==s){t.acceptToken(Tpe,1);return}break}else if(o&&t.next==Vft){if(t.pos==s){t.advance();let l=t.next;l>=0&&(t.advance(),idt(t,l)),t.acceptToken(nft);return}break}else if(t.next==r&&(!i||t.peek(1)==r&&t.peek(2)==r)){if(t.pos==s){t.acceptToken(eX,i?3:1);return}break}else if(t.next==dp){if(i)t.advance();else if(t.pos==s){t.acceptToken(eX);return}break}else t.advance();t.pos>s&&t.acceptToken(tft)});function idt(t,e){if(e==Gft)for(let n=0;n<2&&t.next>=48&&t.next<=55;n++)t.advance();else if(e==Hft)for(let n=0;n<2&&cI(t.next);n++)t.advance();else if(e==Xft)for(let n=0;n<4&&cI(t.next);n++)t.advance();else if(e==Qft)for(let n=0;n<8&&cI(t.next);n++)t.advance();else if(e==qft&&t.next==JN){for(t.advance();t.next>=0&&t.next!=tX&&t.next!=Ppe&&t.next!=Mpe&&t.next!=dp;)t.advance();t.next==tX&&t.advance()}}const odt=N4({'async "*" "**" FormatConversion FormatSpec':Ce.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":Ce.controlKeyword,"in not and or is del":Ce.operatorKeyword,"from def class global nonlocal lambda":Ce.definitionKeyword,import:Ce.moduleKeyword,"with as print":Ce.keyword,Boolean:Ce.bool,None:Ce.null,VariableName:Ce.variableName,"CallExpression/VariableName":Ce.function(Ce.variableName),"FunctionDefinition/VariableName":Ce.function(Ce.definition(Ce.variableName)),"ClassDefinition/VariableName":Ce.definition(Ce.className),PropertyName:Ce.propertyName,"CallExpression/MemberExpression/PropertyName":Ce.function(Ce.propertyName),Comment:Ce.lineComment,Number:Ce.number,String:Ce.string,FormatString:Ce.special(Ce.string),Escape:Ce.escape,UpdateOp:Ce.updateOperator,"ArithOp!":Ce.arithmeticOperator,BitOp:Ce.bitwiseOperator,CompareOp:Ce.compareOperator,AssignOp:Ce.definitionOperator,Ellipsis:Ce.punctuation,At:Ce.meta,"( )":Ce.paren,"[ ]":Ce.squareBracket,"{ }":Ce.brace,".":Ce.derefOperator,", ;":Ce.separator}),adt={__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},sdt=y_.deserialize({version:14,states:"##jO`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'#EdO3rQdO'#EfO3zQtO'#EfO1XQdO'#EiO0rQdO'#ElO1XQdO'#EnO0rQdO'#EtO0rQdO'#EwO4VQdO'#EyO4^QdO'#FOO4iQdO'#EzO0rQdO'#FOO1XQdO'#FQO1XQdO'#FVO4nQdO'#F[P4uOdO'#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,59OO5QQdO'#DoOOQS,5:Y,5:YO5eQdO'#HdOOQS,5:],5:]O5rQ!fO,5:]O5wQtO,59YO1lQdO,59bO1lQdO,59bO1lQdO,59bO8gQdO,59bO8lQdO,59bO8sQdO,59jO8zQdO'#HTO:QQdO'#HSOOQS'#HS'#HSOOQS'#D['#D[O:iQdO,59aO'vQdO,59aO:wQdO,59aOOQS,59y,59yO:|QdO,5:RO'vQdO,5:ROOQS,5:Q,5:QO;[QdO,5:QO;aQdO,5:XO'vQdO,5:XO'vQdO,5:VOOQS,5:U,5:UO;rQdO,5:UO;wQdO,5:WOOOW'#Fy'#FyO;|OWO,5:aOOQS,5:a,5:aOOOOQS'#Ds'#DsOOQS1G/w1G/wOOQS1G.|1G.|O!/RQtO1G.|O!/YQtO1G.|O1lQdO1G.|O!/uQdO1G/UOOQS'#DZ'#DZO0rQdO,59tOOQS1G.{1G.{O!/|QdO1G/eO!0^QdO1G/eO!0fQdO1G/fO'vQdO'#H[O!0kQdO'#H[O!0pQtO1G.{O!1QQdO,59iO!2WQdO,5=zO!2hQdO,5=zO!2pQdO1G/mO!2uQtO1G/mOOQS1G/l1G/lO!3VQdO,5=uO!3|QdO,5=uO0rQdO1G/qO!4kQdO1G/sO!4pQtO1G/sO!5QQtO1G/qOOQS1G/p1G/pOOQS1G/r1G/rOOOW-E9w-E9wOOQS1G/{1G/{O!5bQdO'#HxO0rQdO'#HxO!5sQdO,5>cOOOW-E9x-E9xOOQS1G/|1G/|OOQS-E9{-E9{O!6RQ#xO1G2zO!6rQtO1G2zO'vQdO,5kOOQS1G1`1G1`O!7xQdO1G1`OOQS'#DV'#DVO0rQdO,5=qOOQS,5=q,5=qO!7}QdO'#FrO!8YQdO,59oO!8bQdO1G/XO!8lQtO,5=uOOQS1G3`1G3`OOQS,5:m,5:mO!9]QdO'#GtOOQS,5jO!;QQdO,5>jO1XQdO,5>jO!;cQdO,5>iOOQS-E:R-E:RO!;hQdO1G0lO!;sQdO1G0lO!;xQdO,5>lO!lO!hO!<|QdO,5>hO!=_QdO'#EpO0rQdO1G0tO!=jQdO1G0tO!=oQgO1G0zO!AmQgO1G0}O!EhQdO,5>oO!ErQdO,5>oO!EzQtO,5>oO0rQdO1G1PO!FUQdO1G1PO4iQdO1G1UO!!sQdO1G1WOOQV,5;a,5;aO!FZQfO,5;aO!F`QgO1G1QO!JaQdO'#GZO4iQdO1G1QO4iQdO1G1QO!JqQdO,5>pO!KOQdO,5>pO1XQdO,5>pOOQV1G1U1G1UO!KWQdO'#FSO!KiQ!fO1G1WO!KqQdO1G1WOOQV1G1]1G1]O4iQdO1G1]O!KvQdO1G1]O!LOQdO'#F^OOQV1G1b1G1bO!#WQtO1G1bPOOO1G2v1G2vP!LTOSO1G2vOOQS,5=},5=}OOQS'#Dp'#DpO0rQdO,5=}O!LYQdO,5=|O!LmQdO,5=|OOQS1G/u1G/uO!LuQdO,5>PO!MVQdO,5>PO!M_QdO,5>PO!MrQdO,5>PO!NSQdO,5>POOQS1G3j1G3jOOQS7+$h7+$hO!8bQdO7+$pO# uQdO1G.|O# |QdO1G.|OOQS1G/`1G/`OOQS,5<`,5<`O'vQdO,5<`OOQS7+%P7+%PO#!TQdO7+%POOQS-E9r-E9rOOQS7+%Q7+%QO#!eQdO,5=vO'vQdO,5=vOOQS7+$g7+$gO#!jQdO7+%PO#!rQdO7+%QO#!wQdO1G3fOOQS7+%X7+%XO##XQdO1G3fO##aQdO7+%XOOQS,5<_,5<_O'vQdO,5<_O##fQdO1G3aOOQS-E9q-E9qO#$]QdO7+%]OOQS7+%_7+%_O#$kQdO1G3aO#%YQdO7+%_O#%_QdO1G3gO#%oQdO1G3gO#%wQdO7+%]O#%|QdO,5>dO#&gQdO,5>dO#&gQdO,5>dOOQS'#Dx'#DxO#&xO&jO'#DzO#'TO`O'#HyOOOW1G3}1G3}O#'YQdO1G3}O#'bQdO1G3}O#'mQ#xO7+(fO#(^QtO1G2UP#(wQdO'#GOOOQS,5bQdO,5gQdO1G4OOOQS-E9y-E9yO#?QQdO1G4OOe,5>eOOOW7+)i7+)iO#?nQdO7+)iO#?vQdO1G2zO#@aQdO1G2zP'vQdO'#FuO0rQdO<mO#AtQdO,5>mOOQS1G0v1G0vOOQS<rO#KZQdO,5>rOOQS,5>r,5>rO#KfQdO,5>qO#KwQdO,5>qOOQS1G1Y1G1YOOQS,5;p,5;pOOQV<VAN>VO$ WQdO<cAN>cO0rQdO1G1|O$ hQtO1G1|P$ rQdO'#FvOOQS1G2R1G2RP$!PQdO'#F{O$!^QdO7+)jO$!wQdO,5>gOOOO-E9z-E9zOOOW<tO$4dQdO,5>tO1XQdO,5vO$)VQdO,5>vOOQS1G1p1G1pO$8[QtO,5<[OOQU7+'P7+'PO$+cQdO1G/iO$)VQdO,5wO$8jQdO,5>wOOQS1G1s1G1sOOQS7+'S7+'SP$)VQdO'#GdO$8rQdO1G4bO$8|QdO1G4bO$9UQdO1G4bOOQS7+%T7+%TO$9dQdO1G1tO$9rQtO'#FaO$9yQdO,5<}OOQS,5<},5<}O$:XQdO1G4cOOQS-E:a-E:aO$)VQdO,5<|O$:`QdO,5<|O$:eQdO7+)|OOQS-E:`-E:`O$:oQdO7+)|O$)VQdO,5m>pPP'Z'ZPP?PPP'Z'ZPP'Z'Z'Z'Z'Z?T?}'ZP@QP@WD_G{HPPHSH^Hb'ZPPPHeHn'RP'R'RP'RP'RP'RP'RP'R'R'RP'RPP'RPP'RP'RPHtIQIYPIaIgPIaPIaIaPPPIaPKuPLOLYL`KuPIaLiPIaPLpLvPLzM`M}NhLzLzNnN{LzLzLzLz! a! g! j! o! r! |!!S!!`!!r!!x!#S!#Y!#v!#|!$S!$^!$d!$j!$|!%W!%^!%d!%n!%t!%z!&Q!&W!&^!&h!&n!&x!'O!'X!'_!'n!'v!(Q!(XPPPPPPPPPPP!(_!(b!(h!(q!({!)WPPPPPPPPPPPP!-z!/`!3`!6pPP!6x!7X!7b!8Z!8Q!8d!8j!8m!8p!8s!8{!9lPPPPPPPPPPPPPPPPP!9o!9s!9yP!:_!:c!:o!:x!;U!;l!;o!;r!;x!_![!]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:[ndt,Zft,Kft,rdt,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:t=>adt[t]||-1}],tokenPrec:7652}),rX=new Tat,Ape=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function pO(t){return(e,n,r)=>{if(r)return!1;let i=e.node.getChild("VariableName");return i&&n(i,t),!0}}const ldt={FunctionDefinition:pO("function"),ClassDefinition:pO("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:pO("variable"),AsPattern:pO("variable"),__proto__:null};function Rpe(t,e){let n=rX.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(Jr.IncludeAnonymous).iterate(a=>{if(a.name){let s=ldt[a.name];if(s&&s(a,o,i)||!i&&Ape.has(a.name))return!1;i=!1}else if(a.to-a.from>8192){for(let s of Rpe(t,a.node))r.push(s);return!1}}),rX.set(e,r),r}const iX=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,Ipe=["String","FormatString","Comment","PropertyName"];function cdt(t){let e=fi(t.state).resolveInner(t.pos,-1);if(Ipe.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&iX.test(t.state.sliceDoc(e.from,e.to));if(!n&&!t.explicit)return null;let r=[];for(let i=e;i;i=i.parent)Ape.has(i.name)&&(r=r.concat(Rpe(t.state.doc,i)));return{options:r,from:n?e.from:t.pos,validFor:iX}}const udt=["__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"}))),fdt=[yc("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),yc("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),yc("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),yc("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),yc(`if \${}: +`){[e,n]=lv(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 Tl))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 Tr(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 Tl)for(let m of h.children)f(m);else h.lines>a&&(l>a||!l)?(d(),s.push(h)):h instanceof Tr&&l&&(p=u[u.length-1])instanceof Tr&&h.lines+p.lines<=32?(l+=h.lines,c+=h.length+1,u[u.length-1]=new Tr(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]:Tl.from(u,c)),c=-1,l=u.length=0)}for(let h of e)f(h);return d(),s.length==1?s[0]:new Tl(s,n)}}xn.empty=new Tr([""],0);function wrt(t){let e=-1;for(let n of t)e+=n.length+1;return e}function $C(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 Tr?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 Tr?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 Tr){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 Tr?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 bfe{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new Jx(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 _fe{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"&&(xn.prototype[Symbol.iterator]=function(){return this.iter()},Jx.prototype[Symbol.iterator]=bfe.prototype[Symbol.iterator]=_fe.prototype[Symbol.iterator]=function(){return this});let Srt=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 lv(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}let Mg="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 Mg[e-1]<=t;return!1}function t7(t){return t>=127462&&t<=127487}const n7=8205;function ki(t,e,n=!0,r=!0){return(n?wfe:Crt)(t,e,r)}function wfe(t,e,n){if(e==t.length)return e;e&&Sfe(t.charCodeAt(e))&&Ofe(t.charCodeAt(e-1))&&e--;let r=Ci(t,e);for(e+=Ha(r);e=0&&t7(Ci(t,a));)o++,a-=2;if(o%2==0)break;e+=2}else break}return e}function Crt(t,e,n){for(;e>0;){let r=wfe(t,e-2,n);if(r=56320&&t<57344}function Ofe(t){return t>=55296&&t<56320}function Ci(t,e){let n=t.charCodeAt(e);if(!Ofe(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return Sfe(r)?(n-55296<<10)+(r-56320)+65536:n}function y4(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function Ha(t){return t<65536?1:2}const tN=/\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 Ql{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 Ql(e)}static create(e){return new Ql(e)}}class Zr extends Ql{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 nN(this,(n,r,i,o,a)=>e=e.replace(i,i+(r-n),a),!1),e}mapDesc(e,n=!1){return rN(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&&Of(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"?xn.of(h.split(r||tN)):h:xn.empty,m=p.length;if(f==d&&m==0)return;fa&&qi(i,f-a,-1),qi(i,d-f,m),Of(o,i,p),a=d}}return c(e),l(!s),s}static empty(e){return new Zr(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 Of(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 rN(t,e,n,r=!1){let i=[],o=r?[]:null,a=new e_(t),s=new e_(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 e_{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return n>=e.length?xn.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?xn.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 Sh{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 Sh(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 Sh(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=>Sh.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 Tfe(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let x4=0;class ct{constructor(e,n,r,i,o){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=x4++,this.default=e([]),this.extensions=typeof o=="function"?o(this):o}get reader(){return this}static define(e={}){return new ct(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:b4),!!e.static,e.enables)}of(e){return new FC([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new FC(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new FC(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function b4(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class FC{constructor(e,n,r,i){this.dependencies=e,this.facet=n,this.type=r,this.value=i,this.id=x4++}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)||iN(f,u)){let h=r(f);if(s?!r7(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=dE(d,p);if(this.dependencies.every(g=>g instanceof ct?d.facet(g)===f.facet(g):g instanceof mi?d.field(g,!1)==f.field(g,!1):!0)||(s?r7(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 r7(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(i7).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,i7.of({field:this,create:e})]}get extension(){return this}}const uh={lowest:4,low:3,default:2,high:1,highest:0};function k0(t){return e=>new Efe(e,t)}const Ed={highest:k0(uh.highest),high:k0(uh.high),default:k0(uh.default),low:k0(uh.low),lowest:k0(uh.lowest)};class Efe{constructor(e,n){this.inner=e,this.prec=n}}class X2{of(e){return new oN(this,e)}reconfigure(e){return X2.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class oN{constructor(e,n){this.compartment=e,this.inner=n}}class fE{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 Ert(e,n,a))d instanceof mi?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,b4(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=>Trt(g,p,h))}}let f=c.map(d=>d(s));return new fE(e,a,f,s,l,o)}}function Ert(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 oN&&n.delete(a.compartment)}if(i.set(a,s),Array.isArray(a))for(let c of a)o(c,s);else if(a instanceof oN){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 Efe)o(a.inner,a.prec);else if(a instanceof mi)r[s].push(a),a.provides&&o(a.provides,s);else if(a instanceof FC)r[s].push(a),a.facet.extensions&&o(a.facet.extensions,uh.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,uh.default),r.reduce((a,s)=>a.concat(s))}function eb(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 dE(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const Pfe=ct.define(),aN=ct.define({combine:t=>t.some(e=>e),static:!0}),Mfe=ct.define({combine:t=>t.length?t[0]:void 0,static:!0}),kfe=ct.define(),Afe=ct.define(),Rfe=ct.define(),Ife=ct.define({combine:t=>t.length?t[0]:!1});class lc{constructor(e,n){this.type=e,this.value=n}static define(){return new Prt}}class Prt{of(e){return new lc(this,e)}}class Mrt{constructor(e){this.map=e}of(e){return new Rt(this,e)}}class Rt{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 Rt(this.type,n)}is(e){return this.type==e}static define(e={}){return new Mrt(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}}Rt.reconfigure=Rt.define();Rt.appendConfig=Rt.define();class Ur{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&&Tfe(r,n.newLength),o.some(s=>s.type==Ur.time)||(this.annotations=o.concat(Ur.time.of(Date.now())))}static create(e,n,r,i,o,a){return new Ur(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(Ur.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}Ur.time=lc.define();Ur.userEvent=lc.define();Ur.addToHistory=lc.define();Ur.remote=lc.define();function krt(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 Ur?t=o:Array.isArray(o)&&o.length==1&&o[0]instanceof Ur?t=o[0]:t=Lfe(e,kg(o),!1)}return t}function Rrt(t){let e=t.startState,n=e.facet(Rfe),r=t;for(let i=n.length-1;i>=0;i--){let o=n[i](t);o&&Object.keys(o).length&&(r=Dfe(r,sN(e,o,t.changes.newLength),!0))}return r==t?t:Ur.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const Irt=[];function kg(t){return t==null?Irt:Array.isArray(t)?t:[t]}var fr=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(fr||(fr={}));const Drt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let lN;try{lN=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function Lrt(t){if(lN)return lN.test(t);for(let e=0;e"€"&&(n.toUpperCase()!=n.toLowerCase()||Drt.test(n)))return!0}return!1}function Nrt(t){return e=>{if(!/\S/.test(e))return fr.Space;if(Lrt(e))return fr.Word;for(let n=0;n-1)return fr.Word;return fr.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(Rt.reconfigure)?(n=null,r=s.value):s.is(Rt.appendConfig)&&(n=null,r=kg(r).concat(s.value));let o;n?o=e.startState.values.slice():(n=fE.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(aN)?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=kg(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=fE.resolve(e.extensions||[],new Map),r=e.doc instanceof xn?e.doc:xn.of((e.doc||"").split(n.staticFacet(en.lineSeparator)||tN)),i=e.selection?e.selection instanceof je?e.selection:je.single(e.selection.anchor,e.selection.head):je.single(0);return Tfe(i,r.length),n.staticFacet(aN)||(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(Ife)}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(Pfe))for(let a of o(this,n,r))Object.prototype.hasOwnProperty.call(a,e)&&i.push(a[e]);return i}charCategorizer(e){return Nrt(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))!=fr.Word)break;a=l}for(;st.length?t[0]:4});en.lineSeparator=Mfe;en.readOnly=Ife;en.phrases=ct.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=Pfe;en.changeFilter=kfe;en.transactionFilter=Afe;en.transactionExtender=Rfe;X2.reconfigure=Rt.define();function cc(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 sp{eq(e){return this==e}range(e,n=e){return cN.create(e,n,this)}}sp.prototype.startSide=sp.prototype.endSide=0;sp.prototype.point=!1;sp.prototype.mapMode=Pi.TrackDel;let cN=class Nfe{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new Nfe(e,n,r)}};function uN(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class _4{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 _4(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(uN)),this.isEmpty)return n.length?sn.of(n):this;let s=new $fe(this,null,-1).goto(0),l=0,c=[],u=new id;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 t_.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return t_.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=o7(a,s,r),c=new A0(a,l,o),u=new A0(s,l,o);r.iterGaps((f,d,h)=>a7(c,f,u,d,h,i)),r.empty&&r.length==0&&a7(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=o7(o,a),l=new A0(o,s,0).goto(r),c=new A0(a,s,0).goto(r);for(;;){if(l.to!=c.to||!fN(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 A0(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 id;for(let i of e instanceof cN?[e]:n?$rt(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 $rt(t){if(t.length>1)for(let e=t[0],n=1;n0)return t.slice().sort(uN);e=r}return t}sn.empty.nextLayer=sn.empty;class id{finishChunk(e){this.chunks.push(new _4(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 id)).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 o7(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 $fe(a,n,r,o));return i.length==1?i[0]:new t_(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--)IR(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--)IR(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(),IR(this.heap,0)}}}function IR(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 A0{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=t_.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){GS(this.active,e),GS(this.activeTo,e),GS(this.activeRank,e),this.minActive=s7(this.active,this.activeTo)}addActive(e){let n=0,{value:r,to:i,rank:o}=this.cursor;for(;n0;)n++;HS(this.active,n,r),HS(this.activeTo,n,i),HS(this.activeRank,n,o),e&&HS(e,n,this.cursor.from),this.minActive=s7(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&&GS(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 a7(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))&&fN(t.activeForPoint(t.to),n.activeForPoint(n.to))||o.comparePoint(s,f,t.point,n.point):f>s&&!fN(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 fN(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 s7(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 hN="ͼ",l7=typeof Symbol>"u"?"__"+hN:Symbol.for(hN),pN=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),c7=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class od{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=c7[l7]||1;return c7[l7]=e+1,hN+e.toString(36)}static mount(e,n,r){let i=e[pN],o=r&&r.nonce;i?o&&i.setNonce(o):i=new Frt(e,o),i.mount(Array.isArray(n)?n:[n],e)}}let u7=new Map;class Frt{constructor(e,n){let r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let o=u7.get(r);if(o)return e[pN]=o;this.sheet=new i.CSSStyleSheet,u7.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[pN]=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:'"'},jrt=typeof navigator<"u"&&/Mac/.test(navigator.platform),Brt=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Ti=0;Ti<10;Ti++)ad[48+Ti]=ad[96+Ti]=String(Ti);for(var Ti=1;Ti<=24;Ti++)ad[Ti+111]="F"+Ti;for(var Ti=65;Ti<=90;Ti++)ad[Ti]=String.fromCharCode(Ti+32),n_[Ti]=String.fromCharCode(Ti);for(var DR in ad)n_.hasOwnProperty(DR)||(n_[DR]=ad[DR]);function zrt(t){var e=jrt&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Brt&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?n_:ad)[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 r_(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function mN(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function Urt(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function jC(t,e){if(!e.anchorNode)return!1;try{return mN(t,e.anchorNode)}catch{return!1}}function cv(t){return t.nodeType==3?cp(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function tb(t,e,n,r){return n?f7(t,e,n,r,-1)||f7(t,e,n,r,1):!1}function lp(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function hE(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function f7(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:pu(t))){if(t.nodeName=="DIV")return!1;let o=t.parentNode;if(!o||o.nodeType!=1)return!1;e=lp(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?pu(t):0}else return!1}}function pu(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function pw(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function Wrt(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 Ffe(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 Vrt(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=Wrt(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}=Ffe(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.lefti.clientHeight&&(r=i),!n&&i.scrollWidth>i.clientWidth&&(n=i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;return{x:n,y:r}}class Hrt{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?pu(n):0),r,Math.min(e.focusOffset,r?pu(r):0))}set(e,n,r,i){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}let fm=null;function jfe(t){if(t.setActive)return t.setActive();if(fm)return t.focus(fm);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(fm==null?{get preventScroll(){return fm={preventScroll:!0},!0}}:void 0),!fm){fm=!1;for(let n=0;nMath.max(1,t.scrollHeight-t.clientHeight-4)}function Ufe(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=pu(n)}else if(n.parentNode&&!hE(n))r=lp(n),n=n.parentNode;else return null}}function Wfe(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=w4){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 Gfe(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 ut={mac:g7||/Mac/.test(Co.platform),windows:/Win/.test(Co.platform),linux:/Linux|X11/.test(Co.platform),ie:Q2,ie_version:qfe?gN.documentMode||6:yN?+yN[1]:vN?+vN[1]:0,gecko:p7,gecko_version:p7?+(/Firefox\/(\d+)/.exec(Co.userAgent)||[0,0])[1]:0,chrome:!!LR,chrome_version:LR?+LR[1]:0,ios:g7,android:/Android\b/.test(Co.userAgent),webkit:m7,safari:Xfe,webkit_version:m7?+(/\bAppleWebKit\/(\d+)/.exec(Co.userAgent)||[0,0])[1]:0,tabSize:gN.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const Qrt=256;class el extends Ln{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 el)||this.length-(n-e)+r.length>Qrt||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 el(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 Yrt(this.dom,e,n)}}class mu extends Ln{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(Bfe(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 mu&&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 mu(this.mark,n,a)}domAtPos(e){return Qfe(this,e)}coordsAt(e,n){return Kfe(this,e,n)}}function Yrt(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?ut.chrome||ut.gecko||(e?(i--,a=1):o=0)?0:s.length-1];return ut.safari&&!a&&l.width==0&&(l=Array.prototype.find.call(s,c=>c.width)||l),a?pw(l,a<0):l||null}class Cf extends Ln{static create(e,n,r){return new Cf(e,n,r)}constructor(e,n,r){super(),this.widget=e,this.length=n,this.side=r,this.prevWidget=null}split(e){let n=Cf.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 Cf)||!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 xn.empty}get isHidden(){return!0}}el.prototype.children=Cf.prototype.children=uv.prototype.children=w4;function Qfe(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 mu&&i.length&&(r=i[i.length-1])instanceof mu&&r.mark.eq(e.mark)?Yfe(r,e.children[0],n-1):(i.push(e),e.setParent(t)),t.length+=e.length}function Kfe(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 bN(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 Zrt(t){let e=Object.create(null);for(let n=0;n0?3e8:-4e8:n>0?1e8:-1e8,new sd(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}=Zfe(e,n);r=(o?n?-3e8:-1:5e8)-1,i=(a?n?2e8:1:-6e8)+1}return new sd(e,r,i,n,e.widget||null,!0)}static line(e){return new gw(e)}static set(e,n=!1){return sn.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}gt.none=sn.empty;class mw extends gt{constructor(e){let{start:n,end:r}=Zfe(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 mw&&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))&&pE(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)}}mw.prototype.point=!1;class gw extends gt{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof gw&&this.spec.class==e.spec.class&&pE(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)}}gw.prototype.mapMode=Pi.TrackBefore;gw.prototype.point=!0;class sd extends gt{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 sd&&Jrt(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)}}sd.prototype.point=!0;function Zfe(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 Jrt(t,e){return t==e||!!(t&&e&&t.compare(e))}function _N(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 Nr extends Ln{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,n,r,i,o,a){if(r){if(!(r instanceof Nr))return!1;this.dom||r.transferDOM(this)}return i&&this.setDeco(r?r.attrs:null),Hfe(this,e,n,r?r.children.slice():[],o,a),!0}split(e){let n=new Nr;if(n.breakAfter=this.breakAfter,this.length==0)return n;let{i:r,off:i}=this.childPos(e);i&&(n.append(this.children[r].split(i),0),this.children[r].merge(i,this.children[r].length,null,!1,0,0),r++);for(let o=r;o0&&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){pE(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,n){Yfe(this,e,n)}addLineDeco(e){let n=e.spec.attributes,r=e.spec.class;n&&(this.attrs=xN(n,this.attrs||{})),r&&(this.attrs=xN({class:r},this.attrs||{}))}domAtPos(e){return Qfe(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,n){var r;this.dom?this.flags&4&&(Bfe(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&&(bN(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&&Ln.get(i)instanceof mu;)i=i.lastChild;if(!i||!this.length||i.nodeName!="BR"&&((r=Ln.get(i))===null||r===void 0?void 0:r.isEditable)==!1&&(!ut.ios||!this.children.some(o=>o instanceof el))){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 el)||/[^ -~]/.test(r.text))return null;let i=cv(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=Kfe(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 Nr)return o;if(a>n)break}i=a+o.breakAfter}return null}}class eu extends Ln{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 eu)||!this.widget.compare(r.widget)||e>0&&o<=0||n0}}class wN extends uc{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class nb{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 eu&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new Nr),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(qS(new uv(-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 eu)&&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(qS(new el(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 sd){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 sd)if(r.block)r.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new eu(r.widget||fv.block,s,r));else{let l=Cf.create(r.widget||fv.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(qS(new uv(1),i),o),o=i.length+Math.max(0,o-i.length)),f.append(qS(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 nb(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 qS(t,e){for(let n of e)t=new mu(n,[t],t.length);return t}class fv extends uc{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}}fv.inline=new fv("span");fv.block=new fv("div");var rr=function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t}(rr||(rr={}));const up=rr.LTR,S4=rr.RTL;function Jfe(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 tde(t,e){if(t.length!=e.length)return!1;for(let n=0;n=0;m-=3)if(cl[m+1]==-h){let g=cl[m+2],v=g&2?i:g&4?g&1?o:i:0;v&&(Dn[f]=Dn[cl[m]]=v),s=m;break}}else{if(cl.length==189)break;cl[s++]=f,cl[s++]=d,cl[s++]=l}else if((p=Dn[f])==2||p==1){let m=p==i;l=m?0:1;for(let g=s-3;g>=0;g-=3){let v=cl[g+2];if(v&2)break;if(m)cl[g+2]|=2;else{if(v&4)break;cl[g+2]|=4}}}}}function oit(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),Dn[--p]=h;l=u}else o=c,l++}}}function ON(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 Tf(l,m.from,h));let g=m.direction==up!=!(h%2);CN(t,g?r+1:r,i,m.inner,m.from,m.to,a),l=m.to}p=m.to}else{if(p==n||(u?Dn[p]!=s:Dn[p]==s))break;p++}d?ON(t,l,p,r+1,i,d,a):le;){let u=!0,f=!1;if(!c||l>o[c-1].to){let m=Dn[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(Dn[g-1]==s)break e;break}}if(d)d.push(m);else{m.toDn.length;)Dn[Dn.length]=256;let r=[],i=e==up?0:1;return CN(t,i,i,n,0,t.length,r),r}function nde(t){return[new Tf(0,t,0)]}let rde="";function sit(t,e,n,r,i){var o;let a=r.head-t.from,s=Tf.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),rde=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)}),fde=ct.define({combine:t=>t.some(e=>e)}),dde=ct.define();class Rg{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 Rg(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 Rg(je.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const XS=Rt.define({map:(t,e)=>t.map(e)}),hde=Rt.define();function Ao(t,e,n){let r=t.facet(sde);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 pf=ct.define({combine:t=>t.length?t[0]:!0});let cit=0;const hx=ct.define();class kr{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 kr(cit++,e,r,i,s=>{let l=[hx.of(s)];return a&&l.push(i_.of(c=>{let u=c.plugin(s);return u?a(u):gt.none})),o&&l.push(o(s)),l})}static fromClass(e,n){return kr.define(r=>new e(r),n)}}class NR{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(Ao(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){Ao(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){Ao(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const pde=ct.define(),O4=ct.define(),i_=ct.define(),mde=ct.define(),C4=ct.define(),gde=ct.define();function y7(t,e){let n=t.state.facet(gde);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=lit(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 vde=ct.define();function yde(t){let e=0,n=0,r=0,i=0;for(let o of t.state.facet(vde)){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 px=ct.define();class rs{constructor(e,n,r,i){this.fromA=e,this.toA=n,this.fromB=r,this.toB=i}join(e){return new rs(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 rs(l.fromA,l.toA,l.fromB,l.toB).addToSet(r),a=l.toA,s=l.toB}}}class mE{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=Zr.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 rs(o,a,s,l))),this.changedRanges=i}static create(e,n,r){return new mE(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 x7 extends Ln{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=gt.none,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 Nr],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new rs(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),this.updateEditContextFormatting(e);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?i=this.domChanged.newSel.head:!git(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let o=i>-1?fit(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:u}=this.hasComposition;r=new rs(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,(ut.ie||ut.chrome)&&!o&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let a=this.decorations,s=this.updateDeco(),l=pit(a,s,e.changes);return r=rs.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=ut.chrome||ut.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=nb.build(this.view.state.doc,u,r.range.fromB,this.decorations,this.dynamicDecorationMap),_=nb.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}=nb.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);Gfe(this,y,x,g,v,d,h,p,m)}r&&this.fixCompositionDOM(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let r of n.effects)r.is(hde)&&(this.editContextFormatting=r.value)}compositionView(e){let n=new el(e.text.nodeValue);n.flags|=8;for(let{deco:i}of e.marks)n=new mu(i,[n],n.length);let r=new Nr;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=Ln.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&&jC(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(ut.gecko&&s.empty&&!this.hasComposition&&uit(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||(!tb(l.node,l.offset,u.anchorNode,u.anchorOffset)||!tb(c.node,c.offset,u.focusNode,u.focusOffset))&&!this.suppressWidgetCursorChange(u,s))&&(this.view.observer.ignore(()=>{ut.android&&ut.chrome&&this.dom.contains(u.focusNode)&&mit(u.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=r_(this.view.root);if(f)if(s.empty){if(ut.gecko){let d=dit(l.node,l.offset);if(d&&d!=3){let h=(d==1?Ufe:Wfe)(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&&tb(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=r_(e.root),{anchorNode:i,anchorOffset:o}=e.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let a=Nr.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=Ln.get(n.childNodes[i]);o instanceof Nr&&(r=o.domAtPos(o.length))}return r?new Yi(r.node,r.offset,!0):e}nearest(e){for(let n=e;n;){let r=Ln.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 Nr&&!(r instanceof Nr&&n>=0)))r=s,i=c;else if(r&&c==e&&l==e&&s instanceof eu&&Math.abs(n)<2){if(s.deco.startSide<0)break;a&&(r=null)}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 Nr))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 el))return null;let o=ki(i.text,r);if(o==r)return null;let a=cp(i.dom,r,o).getClientRects();for(let s=0;sMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,s=-1,l=this.view.textDirection==rr.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?cv(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"?rr.RTL:rr.LTR}measureTextSize(){for(let o of this.children)if(o instanceof Nr){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=cv(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 Vfe(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(gt.replace({widget:new wN(s),block:!0,inclusive:!0,isBlockGap:!0}).range(r,a))}if(!o)break;r=o.to+1}return gt.set(e)}updateDeco(){let e=1,n=this.view.state.facet(i_).map(o=>(this.dynamicDecorationMap[e++]=typeof o=="function")?o(this.view):o),r=!1,i=this.view.state.facet(mde).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=[this.editContextFormatting,...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=yde(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;Vrt(this.view.scrollDOM,a,n.head{re.from&&(n=!0)}),n}function vit(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 xit(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom)}function $R(t,e){return t.tope.top+1}function b7(t,e){return et.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function EN(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=cv(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&&$R(u,v)?u=_7(u,v.bottom):f&&$R(f,v)&&(f=b7(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 w7(r,d,n);if(s&&r.contentEditable!="false")return EN(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 w7(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((ut.chrome||ut.gecko)&&cp(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 bde(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:S7(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)||ut.safari&&bit(v,y,u)||ut.chrome&&_it(v,y,u))&&(v=void 0))}}if(!v||!t.docView.dom.contains(v)){let b=Nr.find(t.docView,h);if(!b)return d>l.top+l.height/2?l.to:l.from;({node:v,offset:y}=EN(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+dN(a,o,t.state.tabSize)}function bit(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 cp(t,r-1,r).getBoundingClientRect().left>n}function _it(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():cp(t,0,Math.max(t.nodeValue.length,1)).getBoundingClientRect();return n-r.left>5}function PN(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 wit(t,e,n,r){let i=PN(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==rr.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 O7(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=sit(i,o,a,s,n),u=rde;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 Sit(t,e,n){let r=t.state.charCategorizer(e),i=r(n);return o=>{let a=r(o);return i==fr.Space&&(i=a),i==a}}function Oit(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=bde(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,ro)&&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=Ln.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+(Tit(e,r.node,r.offset)?n:0))}}function Tit(t,e,n){for(;;){if(!e||n-1;let{impreciseHead:o,impreciseAnchor:a}=e.docView;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=e.docView.domBoundsAround(n,r,0))){let s=o||a?[]:kit(e),l=new Cit(s,e.state);l.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=l.text,this.newSel=Ait(s,this.bounds.from)}else{let s=e.observer.selectionRange,l=o&&o.node==s.focusNode&&o.offset==s.focusOffset||!mN(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||!mN(e.contentDOM,s.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(s.anchorNode,s.anchorOffset),u=e.viewport;if((ut.ios||ut.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||ut.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))}:(ut.mac||ut.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:xn.of([" "])}):ut.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:xn.of([" "])}),n)return T4(t,n,r,o);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 T4(t,e,n,r=-1){if(ut.ios&&t.inputState.flushIOSKey(e))return!0;let i=t.state.selection.main;if(ut.android&&(e.to==i.to&&(e.from==i.from||e.from==i.from-1&&t.state.sliceDoc(e.from,i.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Ag(t.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||r==8&&e.insert.lengthi.head)&&Ag(t.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&Ag(t.contentDOM,"Delete",46)))return!0;let o=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let a,s=()=>a||(a=Pit(t,e,n));return t.state.facet(lde).some(l=>l(t,e.from,e.to,o,s))||t.dispatch(s()),!0}function Pit(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&&xde(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 Mit(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 kit(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 C7(n,r)),(i!=n||o!=r)&&e.push(new C7(i,o))),e}function Ait(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}class Rit{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,ut.safari&&e.contentDOM.addEventListener("input",()=>null),ut.gecko&&Xit(e.contentDOM.ownerDocument)}handleEvent(e){!Bit(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=Iit(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&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&Sde.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),ut.android&&ut.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return ut.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((n=wde.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||Dit.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:ut.safari&&!ut.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.view.observer.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 T7(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(i){Ao(n.state,i)}}}function Iit(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(T7(r.value,a))}if(i&&i.domEventObservers)for(let o in i.domEventObservers){let a=i.domEventObservers[o];a&&n(o).observers.push(T7(r.value,a))}}for(let r in tl)n(r).handlers.push(tl[r]);for(let r in ms)n(r).observers.push(ms[r]);return e}const wde=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Dit="dthko",Sde=[16,17,18,20,91,92,224,225],QS=6;function YS(t){return Math.max(0,t)*.7+8}function Lit(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class Nit{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.scrollParents=Grt(e.contentDOM),this.atoms=e.state.facet(C4).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)&&$it(e,n),this.dragging=jit(e,n)&&Tde(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Lit(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,i=0,o=0,a=this.view.win.innerWidth,s=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:o,bottom:s}=this.scrollParents.y.getBoundingClientRect());let l=yde(this.view);e.clientX-l.left<=i+QS?n=-YS(i-e.clientX):e.clientX+l.right>=a-QS&&(n=YS(e.clientX-a)),e.clientY-l.top<=o+QS?r=-YS(o-e.clientY):e.clientY+l.bottom>=s-QS&&(r=YS(e.clientY-s)),this.setScrollSpeed(n,r)}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(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let n=null;for(let r=0;rn.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function $it(t,e){let n=t.state.facet(ide);return n.length?n[0](e):ut.mac?e.metaKey:e.ctrlKey}function Fit(t,e){let n=t.state.facet(ode);return n.length?n[0](e):ut.mac?!e.altKey:!e.ctrlKey}function jit(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=r_(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 Bit(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=Ln.get(n))&&r.ignoreEvent(e))return!1;return!0}const tl=Object.create(null),ms=Object.create(null),Ode=ut.ie&&ut.ie_version<15||ut.ios&&ut.webkit_version<604;function zit(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(),Cde(t,n.value)},50)}function Cde(t,e){let{state:n}=t,r,i=1,o=n.toText(e),a=o.lines==n.selection.ranges.length;if(MN!=null&&n.selection.ranges.every(l=>l.empty)&&MN==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})}ms.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};tl.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);ms.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")};ms.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};tl.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(ade))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=Vit(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new Nit(t,e,n,r)),r&&t.observer.ignore(()=>{jfe(t.contentDOM);let o=t.root.activeElement;o&&!o.contains(t.contentDOM)&&o.blur()});let i=t.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}return!1};function E7(t,e,n,r){if(r==1)return je.cursor(e,n);if(r==2)return vit(t.state,e,n);{let i=Nr.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 se>=n.top&&e<=n.bottom&&t>=n.left&&t<=n.right;function Uit(t,e,n,r){let i=Nr.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&&P7(n,r,a))return-1;let s=i.coordsAt(o,1);return s&&P7(n,r,s)?1:a&&a.bottom>=r?-1:1}function M7(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:n,bias:Uit(t,n,e.clientX,e.clientY)}}const Wit=ut.ie&&ut.ie_version<=11;let k7=null,A7=0,R7=0;function Tde(t){if(!Wit)return t.detail;let e=k7,n=R7;return k7=t,R7=Date.now(),A7=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(A7+1)%3:1}function Vit(t,e){let n=M7(t,e),r=Tde(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=M7(t,o),c,u=E7(t,l.pos,l.bias,r);if(n.pos!=l.pos&&!a){let f=E7(t,n.pos,n.bias,r),d=Math.min(f.from,u.from),h=Math.max(f.to,u.to);u=d1&&(c=Git(i,l.pos))?c:s?i.addRange(u):je.create([u])}}}function Git(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}tl.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};tl.dragend=t=>(t.inputState.draggedContent=null,!1);function I7(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&&Fit(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}tl.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&&I7(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 I7(t,e,r,!0),!0}return!1};tl.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=Ode?null:e.clipboardData;return n?(Cde(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(zit(t),!1)};function Hit(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 qit(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 MN=null;tl.copy=tl.cut=(t,e)=>{let{text:n,ranges:r,linewise:i}=qit(t.state);if(!n&&!i)return!1;MN=i?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let o=Ode?null:e.clipboardData;return o?(o.clearData(),o.setData("text/plain",n),!0):(Hit(t,n),!1)};const Ede=lc.define();function Pde(t,e){let n=[];for(let r of t.facet(cde)){let i=r(t,e);i&&n.push(i)}return n?t.update({effects:n,annotations:Ede.of(!0)}):null}function Mde(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=Pde(t.state,e);n?t.dispatch(n):t.update([])}},10)}ms.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),Mde(t)};ms.blur=t=>{t.observer.clearSelectionRange(),Mde(t)};ms.compositionstart=ms.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};ms.compositionend=t=>{t.observer.editContext||(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,ut.chrome&&ut.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};ms.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};tl.beforeinput=(t,e)=>{var n,r;if(e.inputType=="insertReplacementText"&&t.observer.editContext){let o=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),a=e.getTargetRanges();if(o&&a.length){let s=a[0],l=t.posAtDOM(s.startContainer,s.startOffset),c=t.posAtDOM(s.endContainer,s.endOffset);return T4(t,{from:l,to:c,insert:t.state.toText(o)},null),!0}}let i;if(ut.chrome&&ut.android&&(i=wde.find(o=>o.inputType==e.inputType))&&(t.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let o=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var a;(((a=window.visualViewport)===null||a===void 0?void 0:a.height)||0)>o+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return ut.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),ut.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>ms.compositionend(t,e),20),!1};const D7=new Set;function Xit(t){D7.has(t)||(D7.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const L7=["pre-wrap","normal","pre-line","break-spaces"];let dv=!1;function N7(){dv=!1}class Qit{constructor(e){this.lineWrapping=e,this.doc=xn.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}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 L7.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){this.height!=e&&(Math.abs(this.height-e)>zC&&(dv=!0),this.height=e)}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,Qn.ByPosNoHeight,r.setDoc(n),0,0),h=d.to>=c?d:o.lineAt(c,Qn.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(i.heights[i.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class la extends kde{constructor(e,n){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,n,r,i){return new El(i,this.length,r,this.height,this.breaks)}replace(e,n,r){let i=r[0];return r.length==1&&(i instanceof la||i instanceof _i&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof _i?i=new la(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(i.heights[i.index++]):(r||this.outdated)&&this.setHeight(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)>=zC&&(l=-2);let d=new la(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)>=zC||Math.abs(l-this.heightMetrics(e,n).perLine)>=zC)&&(dv=!0),gE(this,c)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class Kit 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==Qn.ByPosNoHeight?Qn.ByPosNoHeight:Qn.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,Qn.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&&$7(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=gE(this.left,e),this.right=gE(this.right,n),this.setHeight(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 $7(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 Zit=5;class E4{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 la?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new la(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=Zit)&&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 la(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 la)return e;let n=new la(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 la)&&!this.isCovered?this.nodes.push(new la(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=Math.min(c==t.parentNode?i.innerHeight: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 not(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class jR{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 Qit(n),this.stateDeco=e.facet(i_).filter(r=>typeof r!="function"),this.heightMap=fo.empty().applyChanges(this.stateDeco,xn.empty,this.heightOracle.setDoc(e.doc),[new rs(0,0,0,e.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=gt.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 KS(o,a))}}return this.viewports=e.sort((r,i)=>r.from-i.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?j7:new P4(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(gx(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=this.state.facet(i_).filter(u=>typeof u!="function");let i=e.changedRanges,o=rs.extendWithRanges(i,Jit(r,this.stateDeco,e?e.changes:Zr.empty(this.state.doc.length))),a=this.heightMap.height,s=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);N7(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),o),(this.heightMap.height!=a||dv)&&(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=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&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(fde)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let n=e.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,o=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?rr.RTL:rr.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:_}=Ffe(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=zfe(e.scrollDOM);let p=(this.printing?not:tot)(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)),N7();for(let _ of this.viewports){let S=_.from==this.viewport.from?b:e.docView.measureVisibleLineHeights(_);this.heightMap=(a?fo.empty().applyChanges(this.stateDeco,xn.empty,this.heightOracle,[new rs(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,a,new Yit(_.from,S))}dv&&(c|=2)}let x=!this.viewportIsAppropriate(this.viewport,u)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return x&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(u,this.scrollTarget),c|=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 KS(i.lineAt(a-r*1e3,Qn.ByHeight,o,0,0).from,i.lineAt(s+(1-r)*1e3,Qn.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,Qn.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!=rr.LTR&&!r)return[];let s=[],l=(u,f,d,h)=>{if(f-uu&&vv.from>=d.from&&v.to<=d.to&&Math.abs(v.from-u)v.fromy));if(!g){if(fv.from<=f&&v.to>=f)){let v=n.moveToLineBoundary(je.cursor(f),!1,!0).head;v>u&&(f=v)}g=new jR(u,f,this.gapSize(d,u,f,h))}s.push(g)},c=u=>{if(u.lengthu.from&&l(u.from,h,u,f),pn.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)||gx(this.heightMap.lineAt(e,Qn.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=e&&n.bottom>=e)||gx(this.heightMap.lineAt(this.scaler.fromDOM(e),Qn.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 gx(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 KS{constructor(e,n){this.from=e,this.to=n}}function iot(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 JS(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 oot(t,e){for(let n of t)if(e(n))return n}const j7={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};class P4{constructor(e,n,r){let i=0,o=0,a=0;this.viewports=r.map(({from:s,to:l})=>{let c=n.lineAt(s,Qn.ByPos,e,0,0).top,u=n.lineAt(l,Qn.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=nn.from==e.viewports[r].from&&n.to==e.viewports[r].to):!1}}function gx(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new El(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(i=>gx(i,e)):t._content)}const eO=ct.define({combine:t=>t.join(" ")}),kN=ct.define({combine:t=>t.indexOf(!0)>-1}),AN=od.newName(),Ade=od.newName(),Rde=od.newName(),Ide={"&light":"."+Ade,"&dark":"."+Rde};function RN(t,e,n){return new od(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 aot=RN("."+AN,{"&":{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,overflowAnchor:"none"},".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,zIndex:300},"&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"}},Ide),sot={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},BR=ut.ie&&ut.ie_version<=11;class lot{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Hrt,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);(ut.ie&&ut.ie_version<=11||ut.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()}),window.EditContext&&e.constructor.EDIT_CONTEXT!==!1&&!(ut.chrome&&ut.chrome_version<126)&&(this.editContext=new uot(e),e.state.facet(pf)&&(e.contentDOM.editContext=this.editContext.editContext)),BR&&(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.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!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(pf)?r.root.activeElement!=this.dom:!jC(r.dom,i))return;let o=i.anchorNode&&r.docView.nearest(i.anchorNode);if(o&&o.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(ut.ie&&ut.ie_version<=11||ut.android&&ut.chrome)&&!r.state.selection.main.empty&&i.focusNode&&tb(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=r_(e.root);if(!n)return!1;let r=ut.safari&&e.root.nodeType==11&&Urt(this.dom.ownerDocument)==this.dom&&cot(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let i=jC(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&&Ag(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&&jC(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 Eit(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&&(n.domChanged||n.newSel&&!n.newSel.main.eq(this.view.state.selection.main))&&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=B7(n,e.previousSibling||e.target.previousSibling,-1),i=B7(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?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(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?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(pf)!=e.state.facet(pf)&&(e.view.contentDOM.editContext=e.state.facet(pf)?this.editContext.editContext:null))}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),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function B7(t,e,n){for(;e;){let r=Ln.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 z7(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 tb(a.node,a.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function cot(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return z7(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?z7(t,n):null}class uot{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.resetRange(e.state);let n=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=r=>{let{anchor:i}=e.state.selection.main,o={from:this.toEditorPos(r.updateRangeStart),to:this.toEditorPos(r.updateRangeEnd),insert:xn.of(r.text.split(` +`))};o.from==this.from&&ithis.to&&(o.to=i),!(o.from==o.to&&!o.insert.length)&&(this.pendingContextChange=o,e.state.readOnly||T4(e,o,je.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd))),this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)))},this.handlers.characterboundsupdate=r=>{let i=[],o=null;for(let a=this.toEditorPos(r.rangeStart),s=this.toEditorPos(r.rangeEnd);a{let i=[];for(let o of r.getTextFormats()){let a=o.underlineStyle,s=o.underlineThickness;if(a!="None"&&s!="None"){let l=`text-decoration: underline ${a=="Dashed"?"dashed ":a=="Squiggle"?"wavy ":""}${s=="Thin"?1:2}px`;i.push(gt.mark({attributes:{style:l}}).range(this.toEditorPos(o.rangeStart),this.toEditorPos(o.rangeEnd)))}}e.dispatch({effects:hde.of(gt.set(i))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{e.inputState.composing=-1,e.inputState.compositionFirstChange=null};for(let r in this.handlers)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let i=r_(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,r=!1,i=this.pendingContextChange;return e.changes.iterChanges((o,a,s,l,c)=>{if(r)return;let u=c.length-(a-o);if(i&&a>=i.to)if(i.from==o&&i.to==a&&i.insert.eq(c)){i=this.pendingContextChange=null,n+=u,this.to+=u;return}else i=null,this.revertPending(e.state);if(o+=n,a+=n,a<=this.from)this.from+=u,this.to+=u;else if(othis.to||this.to-this.from+c.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(o),this.toContextPos(a),c.toString()),this.to+=u}n+=u}),i&&!r&&this.revertPending(e.state),!r}update(e){let n=this.pendingContextChange;!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.resetRange(e.state),this.editContext.updateText(0,this.editContext.text.length,e.state.doc.sliceString(this.from,this.to)),this.setSelection(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),i=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(r,i)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to1e4*3)}toEditorPos(e){return e+this.from}toContextPos(e){return e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}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={}){var n;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:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(i=>i.forEach(o=>r(o,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||qrt(e.parent)||document,this.viewState=new F7(e.state||en.create(e)),e.scrollTo&&e.scrollTo.is(XS)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(hx).map(i=>new NR(i));for(let i of this.plugins)i.update(this);this.observer=new lot(this),this.inputState=new Rit(this),this.inputState.ensureHandlers(this.plugins),this.docView=new x7(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let n=e.length==1&&e[0]instanceof Ur?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(Ede))?(this.inputState.notifiedFocused=a,s=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,l=Pde(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=mE.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 Rg(h.empty?h:je.cursor(h.head,h.head>h.anchor?-1:1))}for(let h of d.effects)h.is(XS)&&(f=h.value.clip(this.state))}this.viewState.update(i,f),this.bidiCache=vE.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(px)!=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(eO)!=i.state.facet(eO)&&(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(TN))try{d(i)}catch(h){Ao(this.state,h,"update listener")}(l||u)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),u&&!_de(this,u)&&c.force&&Ag(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 F7(e),this.plugins=e.facet(hx).map(r=>new NR(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new x7(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(hx),r=e.state.facet(hx);if(n!=r){let i=[];for(let o of r){let a=n.indexOf(o);if(a<0)i.push(new NR(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(zfe(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 Ao(this.state,p),U7}}),f=mE.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(TN))s(n)}get themeClasses(){return AN+" "+(this.state.facet(kN)?Rde:Ade)+" "+this.state.facet(eO)}updateAttrs(){let e=W7(this,pde,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(pf)?"true":"false",class:"cm-content",style:`${ut.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),W7(this,O4,n);let r=this.observer.ignore(()=>{let i=bN(this.contentDOM,this.contentAttrs,n),o=bN(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(px);let e=this.state.facet(rt.cspNonce);od.mount(this.root,this.styleModules.concat(aot).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 FR(this,e,O7(this,e,n,r))}moveByGroup(e,n){return FR(this,e,O7(this,e,n,r=>Sit(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 wit(this,e,n,r)}moveVertically(e,n,r){return FR(this,e,Oit(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(),bde(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[Tf.find(o,e-i.from,-1,n)];return pw(r,a.dir==rr.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(ude)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>fot)return nde(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||tde(o.isolates,r=y7(this,e))))return o.order;r||(r=y7(this,e));let i=ait(e.text,n,r);return this.bidiCache.push(new vE(e.from,e.to,n,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||ut.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{jfe(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(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();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 XS.of(new Rg(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 XS.of(new Rg(je.cursor(r.from),"start","start",r.top-e,n,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return kr.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return kr.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=od.newName(),i=[eO.of(r),px.of(RN(`.${r}`,e))];return n&&n.dark&&i.push(kN.of(!0)),i}static baseTheme(e){return Ed.lowest(px.of(RN("."+AN,e,Ide)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),i=r&&Ln.get(r)||Ln.get(e);return((n=i==null?void 0:i.rootView)===null||n===void 0?void 0:n.view)||null}}rt.styleModule=px;rt.inputHandler=lde;rt.scrollHandler=dde;rt.focusChangeEffect=cde;rt.perLineTextDirection=ude;rt.exceptionSink=sde;rt.updateListener=TN;rt.editable=pf;rt.mouseSelectionStyle=ade;rt.dragMovesSelection=ode;rt.clickAddsSelectionRange=ide;rt.decorations=i_;rt.outerDecorations=mde;rt.atomicRanges=C4;rt.bidiIsolatedRanges=gde;rt.scrollMargins=vde;rt.darkTheme=kN;rt.cspNonce=ct.define({combine:t=>t.length?t[0]:""});rt.contentAttributes=O4;rt.editorAttributes=pde;rt.lineWrapping=rt.contentAttributes.of({class:"cm-lineWrapping"});rt.announce=Rt.define();const fot=4096,U7={};class vE{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:rr.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&&xN(a,n)}return n}const dot=ut.mac?"mac":ut.windows?"win":ut.linux?"linux":"key";function hot(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 mot(t,e,n){return Lde(Dde(t.state),e,t,n)}let mf=null;const got=4e3;function vot(t,e=dot){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=>hot(v,e));for(let v=1;v{let b=mf={view:x,prefix:y,scope:a};return setTimeout(()=>{mf==b&&(mf=null)},got),!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:[]});let{any:f}=a;for(let d in u)u[d].run.push(h=>f(h,IN))}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}let IN=null;function Lde(t,e,n,r){IN=e;let i=zrt(e),o=Ci(i,0),a=Ha(o)==i.length&&i!=" ",s="",l=!1,c=!1,u=!1;mf&&mf.view==n&&mf.scope==r&&(s=mf.prefix+" ",Sde.indexOf(e.keyCode)<0&&(c=!0,mf=null));let f=new Set,d=g=>{if(g){for(let v of g.run)if(!f.has(v)&&(f.add(v),v(n)))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+tO(i,e,!a)])?l=!0:a&&(e.altKey||e.metaKey||e.ctrlKey)&&!(ut.windows&&e.ctrlKey&&e.altKey)&&(p=ad[e.keyCode])&&p!=i?(d(h[s+tO(p,e,!0)])||e.shiftKey&&(m=n_[e.keyCode])!=i&&m!=p&&d(h[s+tO(m,e,!1)]))&&(l=!0):a&&e.shiftKey&&d(h[s+tO(i,e,!0)])&&(l=!0),!l&&d(h._any)&&(l=!0)),c&&(l=!0),l&&u&&e.stopPropagation(),IN=null,l}class yw{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=Nde(e);return[new yw(n,i.left-o.left,i.top-o.top,null,i.bottom-i.top)]}else return yot(e,n,r)}}function Nde(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==rr.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function G7(t,e,n,r){let i=t.coordsAtPos(e,n*2);if(!i)return r;let o=t.dom.getBoundingClientRect(),a=(i.top+i.bottom)/2,s=t.posAtCoords({x:o.left+1,y:a}),l=t.posAtCoords({x:o.right-1,y:a});return s==null||l==null?r:{from:Math.max(r.from,Math.min(s,l)),to:Math.min(r.to,Math.max(s,l))}}function yot(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==rr.LTR,a=t.contentDOM,s=a.getBoundingClientRect(),l=Nde(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=PN(t,r),p=PN(t,i),m=h.type==uo.Text?h:null,g=p.type==uo.Text?p:null;if(m&&(t.lineWrapping||h.widgetLineBreaks)&&(m=G7(t,r,1,m)),g&&(t.lineWrapping||p.widgetLineBreaks)&&(g=G7(t,i,-1,g)),m&&g&&m.from==g.from&&m.to==g.to)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;$>L&&I(Math.max(W,L),_==null&&W<=P,Math.min($,z),S==null&&$>=R,U.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 xot(t,e){return t.constructor==e.constructor&&t.eq(e)}class bot{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(UC)!=e.state.facet(UC)&&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(UC);for(;n!xot(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 UC=ct.define();function $de(t){return[kr.define(e=>new bot(e,t)),UC.of(t)]}const Fde=!ut.ios,o_=ct.define({combine(t){return cc(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,n)=>Math.min(e,n),drawRangeCursor:(e,n)=>e||n})}});function _ot(t={}){return[o_.of(t),wot,Sot,Oot,fde.of(!0)]}function jde(t){return t.startState.facet(o_)!=t.state.facet(o_)}const wot=$de({above:!0,markers(t){let{state:e}=t,n=e.facet(o_),r=[];for(let i of e.selection.ranges){let o=i==e.selection.main;if(i.empty?!o||Fde: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 yw.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=jde(t);return n&&H7(t.state,e),t.docChanged||t.selectionSet||n},mount(t,e){H7(e.state,t)},class:"cm-cursorLayer"});function H7(t,e){e.style.animationDuration=t.facet(o_).cursorBlinkRate+"ms"}const Sot=$de({above:!1,markers(t){return t.state.selection.ranges.map(e=>e.empty?[]:yw.forRange(t,"cm-selectionBackground",e)).reduce((e,n)=>e.concat(n))},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||jde(t)},class:"cm-selectionLayer"}),DN={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};Fde&&(DN[".cm-line"].caretColor=DN[".cm-content"].caretColor="transparent !important");const Oot=Ed.highest(rt.theme(DN)),Bde=Rt.define({map(t,e){return t==null?null:e.mapPos(t)}}),vx=mi.define({create(){return null},update(t,e){return t!=null&&(t=e.changes.mapPos(t)),e.effects.reduce((n,r)=>r.is(Bde)?r.value:n,t)}}),Cot=kr.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(vx);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(vx)!=n||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(vx),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(vx)!=t&&this.view.dispatch({effects:Bde.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 Tot(){return[vx,Cot]}function q7(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 Eot(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 Pot{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 id,r=n.add.bind(n);for(let{from:i,to:o}of Eot(e,this.maxLength))q7(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 LN=/x/.unicode!=null?"gu":"g",Mot=new RegExp(`[\0-\b +--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,LN),kot={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 zR=null;function Aot(){var t;if(zR==null&&typeof document<"u"&&document.body){let e=document.body.style;zR=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return zR||!1}const WC=ct.define({combine(t){let e=cc(t,{render:null,specialChars:Mot,addSpecialChars:null});return(e.replaceTabs=!Aot())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,LN)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,LN)),e}});function Rot(t={}){return[WC.of(t),Iot()]}let X7=null;function Iot(){return X7||(X7=kr.fromClass(class{constructor(t){this.view=t,this.decorations=gt.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(WC)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new Pot({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=Py(a.text,s,r-a.from);return gt.replace({widget:new $ot((s-l%s)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=gt.replace({widget:new Not(t,o)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(WC);t.startState.facet(WC)!=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 Dot="•";function Lot(t){return t>=32?Dot:t==10?"␤":String.fromCharCode(9216+t)}class Not extends uc{constructor(e,n){super(),this.options=e,this.code=n}eq(e){return e.code==this.code}toDOM(e){let n=Lot(this.code),r=e.state.phrase("Control character")+" "+(kot[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 $ot extends uc{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 Fot(){return Bot}const jot=gt.line({class:"cm-activeLine"}),Bot=kr.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(jot.range(i.from)),e=i.from)}return gt.set(n)}},{decorations:t=>t.decorations});class zot extends uc{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?cv(e.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(e.parentNode),i=pw(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 Uot(t){return kr.fromClass(class{constructor(e){this.view=e,this.placeholder=t?gt.set([gt.widget({widget:new zot(t),side:1}).range(0)]):gt.none}get decorations(){return this.view.state.doc.length?gt.none:this.placeholder}},{decorations:e=>e.decorations})}const NN=2e3;function Wot(t,e,n){let r=Math.min(e.line,n.line),i=Math.max(e.line,n.line),o=[];if(e.off>NN||n.off>NN||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=dN(c.text,a,t.tabSize,!0);if(u<0)o.push(je.cursor(c.to));else{let f=dN(c.text,s,t.tabSize);o.push(je.range(c.from+u,c.from+f))}}}return o}function Vot(t,e){let n=t.coordsAtPos(t.viewport.from);return n?Math.round(Math.abs((n.left-e)/t.defaultCharacterWidth)):-1}function Q7(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>NN?-1:i==r.length?Vot(t,e.clientX):Py(r.text,t.state.tabSize,n-r.from);return{line:r.number,col:o,off:i}}function Got(t,e){let n=Q7(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=Q7(t,i);if(!s)return r;let l=Wot(t.state,n,s);return l.length?a?je.create(l.concat(r.ranges)):je.create(l):r}}:null}function Hot(t){let e=n=>n.altKey&&n.button==0;return rt.mouseSelectionStyle.of((n,r)=>e(r)?Got(n,r):null)}const qot={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},Xot={style:"cursor: crosshair"};function Qot(t={}){let[e,n]=qot[t.key||"Alt"],r=kr.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?Xot:null})]}const R0="-10000px";class zde{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 Yot(t){let{win:e}=t;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const UR=ct.define({combine:t=>{var e,n,r;return{position:ut.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)||Yot}}}),Y7=new WeakMap,M4=kr.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(UR);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 zde(t,k4,(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(UR);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.appendChild(i)}return n.dom.style.position=this.position,n.dom.style.top=R0,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(ut.gecko)r=i.offsetParent!=this.container.ownerDocument.body;else if(i.style.top==R0&&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(UR).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=R0;continue}let h=l.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,p=h?7:0,m=d.right-d.left,g=(e=Y7.get(c))!==null&&e!==void 0?e:d.bottom-d.top,v=c.offset||Zot,y=this.view.textDirection==rr.LTR,x=d.width>r.right-r.left?y?r.left:r.right-d.width:y?Math.max(r.left,Math.min(f.left-(h?14:0)+v.x,r.right-m)):Math.min(Math.max(r.left,f.left-m+(h?14:0)-v.x),r.right-m),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=R0}},{eventObservers:{scroll(){this.maybeMeasure()}}}),Kot=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"}}}),Zot={x:0,y:0},k4=ct.define({enables:[M4,Kot]}),yE=ct.define({combine:t=>t.reduce((e,n)=>e.concat(n),[])});class Y2{static create(e){return new Y2(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new zde(e,yE,(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 Jot=k4.compute([yE],t=>{let e=t.facet(yE);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:Y2.create,above:e[0].above,arrow:e.some(n=>n.arrow)}});class eat{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==rr.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=>Ao(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(M4),n=e?e.manager.tooltips.findIndex(r=>r.create==Y2.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&&!tat(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:!nat(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 nO=4;function tat(t,e){let n=t.getBoundingClientRect();return e.clientX>=n.left-nO&&e.clientX<=n.right+nO&&e.clientY>=n.top-nO&&e.clientY<=n.bottom+nO}function nat(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 rat(t,e={}){let n=Rt.define(),r=mi.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(iat)&&(i=[]);return i},provide:i=>yE.from(i)});return{active:r,extension:[r,kr.define(i=>new eat(i,t,r,n,e.hoverTime||300)),Jot]}}function Ude(t,e){let n=t.plugin(M4);if(!n)return null;let r=n.manager.tooltips.indexOf(e);return r<0?null:n.manager.tooltipViews[r]}const iat=Rt.define(),K7=ct.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 a_(t,e){let n=t.plugin(Wde),r=n?n.specs.indexOf(e):-1;return r>-1?n.panels[r]:null}const Wde=kr.fromClass(class{constructor(t){this.input=t.state.facet(s_),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(K7);this.top=new rO(t,!0,e.topContainer),this.bottom=new rO(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(K7);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new rO(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new rO(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(s_);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 rO{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 s_=ct.define({enables:Wde});class gu extends sp{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}gu.prototype.elementClass="";gu.prototype.toDOM=void 0;gu.prototype.mapMode=Pi.TrackBefore;gu.prototype.startSide=gu.prototype.endSide=-1;gu.prototype.point=!0;const VC=ct.define(),oat=ct.define(),aat={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>sn.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},rb=ct.define();function sat(t){return[Vde(),rb.of(Object.assign(Object.assign({},aat),t))]}const J7=ct.define({combine:t=>t.some(e=>e)});function Vde(t){return[lat]}const lat=kr.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(rb).map(e=>new tq(t,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!t.state.facet(J7),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(J7)!=!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(VC),this.view.viewport.from),r=[],i=this.gutters.map(o=>new cat(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){$N(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){$N(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(rb),n=t.state.facet(rb),r=t.docChanged||t.heightChanged||t.viewportChanged||!sn.eq(t.startState.facet(VC),t.state.facet(VC),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 tq(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==rr.LTR?{left:n.dom.offsetWidth*e.scaleX}:{right:n.dom.offsetWidth*e.scaleX}})});function eq(t){return Array.isArray(t)?t:[t]}function $N(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class cat{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 Gde(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=[];$N(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),i=r?[r]:null;for(let o of e.state.facet(oat)){let a=o(e,n.widget,n);a&&(i||(i=[])).push(a)}i&&this.addElement(e,n,i)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}}class tq{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=eq(n.markers(e)),n.initialSpacer&&(this.spacer=new Gde(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=eq(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 Gde{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":""),uat(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 WR extends gu{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function VR(t,e){return t.state.facet(ig).formatNumber(e,t.state)}const hat=rb.compute([ig],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(fat)},lineMarker(e,n,r){return r.some(i=>i.toDOM)?null:new WR(VR(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,r)=>{for(let i of e.state.facet(dat)){let o=i(e,n,r);if(o)return o}return null},lineMarkerChange:e=>e.startState.facet(ig)!=e.state.facet(ig),initialSpacer(e){return new WR(VR(e,nq(e.state.doc.lines)))},updateSpacer(e,n){let r=VR(n.view,nq(n.view.state.doc.lines));return r==e.number?e:new WR(r)},domEventHandlers:t.facet(ig).domEventHandlers}));function pat(t={}){return[ig.of(t),Vde(),hat]}function nq(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(mat.range(i)))}return sn.of(e)});function vat(){return gat}const Hde=1024;let yat=0;class GR{constructor(e,n){this.from=e,this.to=n}}class Vt{constructor(e={}){this.id=yat++,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=Vo.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}Vt.closedBy=new Vt({deserialize:t=>t.split(" ")});Vt.openedBy=new Vt({deserialize:t=>t.split(" ")});Vt.group=new Vt({deserialize:t=>t.split(" ")});Vt.isolate=new Vt({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});Vt.contextHash=new Vt({perNode:!0});Vt.lookAhead=new Vt({perNode:!0});Vt.mounted=new Vt({perNode:!0});class xE{constructor(e,n,r){this.tree=e,this.overlay=n,this.parser=r}static get(e){return e&&e.props&&e.props[Vt.mounted.id]}}const xat=Object.create(null);class Vo{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):xat,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new Vo(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(Vt.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(Vt.group),o=-1;o<(i?i.length:0);o++){let a=n[o<0?r.name:i[o]];if(a)return a}}}}Vo.none=new Vo("",Object.create(null),0,8);class A4{constructor(e){this.types=e;for(let n=0;n0;for(let l=this.cursor(a|Jr.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:D4(Vo.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new Wr(this.type,n,r,i,this.propValues),e.makeTree||((n,r,i)=>new Wr(Vo.none,n,r,i)))}static build(e){return Sat(e)}}Wr.empty=new Wr(Vo.none,[],[],0);class R4{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 R4(this.buffer,this.index)}}class ld{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return Vo.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 l_(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(qde(i,r,f,f+u.length)){if(u instanceof ld){if(o&Jr.ExcludeBuffers)continue;let d=u.findChild(0,u.buffer.length,n,r-f,i);if(d>-1)return new Dl(new bat(a,u,e,f),null,d)}else if(o&Jr.IncludeAnonymous||!u.type.isAnonymous||I4(u)){let d;if(!(o&Jr.IgnoreMounts)&&(d=xE.get(u))&&!d.overlay)return new jo(d.tree,f,e,a);let h=new jo(u,f,e,a);return o&Jr.IncludeAnonymous||!h.type.isAnonymous?h:h.nextChild(n<0?u.children.length-1:0,n,r,i)}}}if(o&Jr.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&Jr.IgnoreOverlays)&&(i=xE.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 jo(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 iq(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 FN(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 bat{constructor(e,n,r,i){this.parent=e,this.buffer=n,this.index=r,this.start=i}}class Dl extends Xde{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 Dl(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&Jr.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 Dl(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 Dl(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 Dl(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 Wr(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Qde(t){if(!t.length)return null;let e=0,n=t[0];for(let o=1;on.from||a.to=e){let s=new jo(a.tree,a.overlay[0].from+o.from,-1,o);(i||(i=[r])).push(l_(s,e,n,!1))}}return i?Qde(i):r}class jN{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 jo)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 jo?(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&Jr.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Jr.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Jr.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&Jr.IncludeAnonymous||s instanceof ld||!s.type.isAnonymous||I4(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 FN(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 I4(t){return t.children.some(e=>e instanceof ld||!e.type.isAnonymous||I4(e))}function Sat(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:i=Hde,reused:o=[],minRepeatType:a=r.types.length}=t,s=Array.isArray(n)?new R4(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 $=o[I];O.push($),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,U,W=P-_;if(R-P<=i&&(U=g(s.pos-S,E))){let $=new Uint16Array(U.size-U.skip),N=s.pos-U.size,D=$.length;for(;s.pos>N;)D=v(U.start,$,D);B=new ld($,R-U.start,r),W=U.start-_}else{let $=s.pos-T;s.next();let N=[],D=[],A=I>=a?I:-1,q=0,Y=R;for(;s.pos>$;)A>=0&&s.id==A&&s.size>=0?(s.end<=Y-i&&(p(N,D,P,q,s.end,Y,A,L),q=N.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-1&&q>0){let K=h(z);B=D4(z,N,D,0,N.length,0,R-P,K,K)}else B=m(z,N,D,R-P,L-R)}O.push(B),C.push(W)}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 ld(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 Wr){if(!k&&I.type==_&&I.length==C)return I;(P=I.prop(Vt.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=[Vt.contextHash,c];k=k?[I].concat(k):[I]}if(E>25){let I=[Vt.lookAhead,E];k=k?[I].concat(k):[I]}return new Wr(_,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 Wr(l[t.topID],y.reverse(),x.reverse(),b)}const oq=new WeakMap;function GC(t,e){if(!t.isAnonymous||e instanceof ld||e.type!=t)return 1;let n=oq.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof Wr)){n=1;break}n+=GC(t,r)}oq.set(e,n)}return n}function D4(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(D4(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 Oat{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 Dl?this.setBuffer(e.context.buffer,e.index,n):e instanceof jo&&this.map.set(e.tree,n)}get(e){return e instanceof Dl?this.getBuffer(e.context.buffer,e.index):e instanceof jo?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 Wh{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 Wh(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 Wh(h,p,d.tree,d.offset+c,s>0,!!u)}if(d&&i.push(d),a.to>f)break;a=onew GR(i.from,i.to)):[new GR(0,0)]:[new GR(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 Cat{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 Vt({perNode:!0});let Tat=0;class za{constructor(e,n,r,i){this.name=e,this.set=n,this.base=r,this.modified=i,this.id=Tat++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let r=typeof e=="string"?e:"?";if(e instanceof za&&(n=e),n!=null&&n.base)throw new Error("Can not derive from a modified tag");let i=new za(r,[],null,[]);if(i.set.push(i),n)for(let o of n.set)i.set.push(o);return i}static defineModifier(e){let n=new bE(e);return r=>r.modified.indexOf(n)>-1?r:bE.get(r.base||r,r.modified.concat(n).sort((i,o)=>i.id-o.id))}}let Eat=0;class bE{constructor(e){this.name=e,this.instances=[],this.id=Eat++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(s=>s.base==e&&Pat(n,s.modified));if(r)return r;let i=[],o=new za(e.name,i,e,n);for(let s of n)s.instances.push(o);let a=Mat(n);for(let s of e.set)if(!s.modified.length)for(let l of a)i.push(bE.get(s,l));return o}}function Pat(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function Mat(t){let e=[[]];for(let n=0;nr.length-n.length)}function L4(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 _E(r,a,l>0?o.slice(0,l):null);e[c]=u.sort(e[c])}}return Kde.add(e)}const Kde=new Vt;class _E{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 kat(t,e){let n=null;for(let r of t){let i=r.style(e);i&&(n=n?n+" "+i:i)}return n}function Aat(t,e,n,r=0,i=t.length){let o=new Rat(r,Array.isArray(e)?e:[e],n);o.highlightRange(t.cursor(),r,i,"",o.highlighters),o.flush(i)}class Rat{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=Iat(e)||_E.empty,f=kat(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(Vt.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 Iat(t){let e=t.type.prop(Kde);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const et=za.define,oO=et(),cf=et(),aq=et(cf),sq=et(cf),uf=et(),aO=et(uf),HR=et(uf),dl=et(),Wd=et(dl),ul=et(),fl=et(),BN=et(),I0=et(BN),sO=et(),Ce={comment:oO,lineComment:et(oO),blockComment:et(oO),docComment:et(oO),name:cf,variableName:et(cf),typeName:aq,tagName:et(aq),propertyName:sq,attributeName:et(sq),className:et(cf),labelName:et(cf),namespace:et(cf),macroName:et(cf),literal:uf,string:aO,docString:et(aO),character:et(aO),attributeValue:et(aO),number:HR,integer:et(HR),float:et(HR),bool:et(uf),regexp:et(uf),escape:et(uf),color:et(uf),url:et(uf),keyword:ul,self:et(ul),null:et(ul),atom:et(ul),unit:et(ul),modifier:et(ul),operatorKeyword:et(ul),controlKeyword:et(ul),definitionKeyword:et(ul),moduleKeyword:et(ul),operator:fl,derefOperator:et(fl),arithmeticOperator:et(fl),logicOperator:et(fl),bitwiseOperator:et(fl),compareOperator:et(fl),updateOperator:et(fl),definitionOperator:et(fl),typeOperator:et(fl),controlOperator:et(fl),punctuation:BN,separator:et(BN),bracket:I0,angleBracket:et(I0),squareBracket:et(I0),paren:et(I0),brace:et(I0),content:dl,heading:Wd,heading1:et(Wd),heading2:et(Wd),heading3:et(Wd),heading4:et(Wd),heading5:et(Wd),heading6:et(Wd),contentSeparator:et(dl),list:et(dl),quote:et(dl),emphasis:et(dl),strong:et(dl),link:et(dl),monospace:et(dl),strikethrough:et(dl),inserted:et(),deleted:et(),changed:et(),invalid:et(),meta:sO,documentMeta:et(sO),annotation:et(sO),processingInstruction:et(sO),definition:za.defineModifier("definition"),constant:za.defineModifier("constant"),function:za.defineModifier("function"),standard:za.defineModifier("standard"),local:za.defineModifier("local"),special:za.defineModifier("special")};for(let t in Ce){let e=Ce[t];e instanceof za&&(e.name=t)}Zde([{tag:Ce.link,class:"tok-link"},{tag:Ce.heading,class:"tok-heading"},{tag:Ce.emphasis,class:"tok-emphasis"},{tag:Ce.strong,class:"tok-strong"},{tag:Ce.keyword,class:"tok-keyword"},{tag:Ce.atom,class:"tok-atom"},{tag:Ce.bool,class:"tok-bool"},{tag:Ce.url,class:"tok-url"},{tag:Ce.labelName,class:"tok-labelName"},{tag:Ce.inserted,class:"tok-inserted"},{tag:Ce.deleted,class:"tok-deleted"},{tag:Ce.literal,class:"tok-literal"},{tag:Ce.string,class:"tok-string"},{tag:Ce.number,class:"tok-number"},{tag:[Ce.regexp,Ce.escape,Ce.special(Ce.string)],class:"tok-string2"},{tag:Ce.variableName,class:"tok-variableName"},{tag:Ce.local(Ce.variableName),class:"tok-variableName tok-local"},{tag:Ce.definition(Ce.variableName),class:"tok-variableName tok-definition"},{tag:Ce.special(Ce.variableName),class:"tok-variableName2"},{tag:Ce.definition(Ce.propertyName),class:"tok-propertyName tok-definition"},{tag:Ce.typeName,class:"tok-typeName"},{tag:Ce.namespace,class:"tok-namespace"},{tag:Ce.className,class:"tok-className"},{tag:Ce.macroName,class:"tok-macroName"},{tag:Ce.propertyName,class:"tok-propertyName"},{tag:Ce.operator,class:"tok-operator"},{tag:Ce.comment,class:"tok-comment"},{tag:Ce.meta,class:"tok-meta"},{tag:Ce.invalid,class:"tok-invalid"},{tag:Ce.punctuation,class:"tok-punctuation"}]);var qR;const og=new Vt;function Dat(t){return ct.define({combine:t?e=>e.concat(t):void 0})}const Lat=new Vt;class Hs{constructor(e,n,r=[],i=""){this.data=e,this.name=i,en.prototype.hasOwnProperty("tree")||Object.defineProperty(en.prototype,"tree",{get(){return fi(this)}}),this.parser=n,this.extension=[cd.of(this),en.languageData.of((o,a,s)=>{let l=lq(o,a,s),c=l.type.prop(og);if(!c)return[];let u=o.facet(c),f=l.type.prop(Lat);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 lq(e,n,r).type.prop(og)==this.data}findRegions(e){let n=e.facet(cd);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(og)==this.data){r.push({from:a,to:a+o.length});return}let s=o.prop(Vt.mounted);if(s){if(s.tree.prop(og)==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 c_(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function fi(t){let e=t.field(Hs.state,!1);return e?e.tree:Wr.empty}class Nat{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 D0=null;class wE{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 wE(e,n,[],Wr.empty,0,r,[],null)}startParse(){return this.parser.startParse(new Nat(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=Wr.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(Wh.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=D0;D0=this;try{return e()}finally{D0=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=cq(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=Wh.applyChanges(r,l),i=Wr.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=cq(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 Yde{createParse(n,r,i){let o=i[0].from,a=i[i.length-1].to;return{parsedPos:o,advance(){let l=D0;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 Wr(Vo.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 D0}}function cq(t,e,n){return Wh.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class hv{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 hv(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=wE.create(e.facet(cd).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new hv(r)}}Hs.state=mi.define({create:hv.init,update(t,e){for(let n of e.effects)if(n.is(Hs.setState))return n.value;return e.startState.facet(cd)!=e.state.facet(cd)?hv.init(e.state):t.apply(e)}});let Jde=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Jde=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const XR=typeof navigator<"u"&&(!((qR=navigator.scheduling)===null||qR===void 0)&&qR.isInputPending)?()=>navigator.scheduling.isInputPending():null,$at=kr.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(Hs.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(Hs.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=Jde(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEndi+1e3,l=o.context.work(()=>XR&&XR()||Date.now()>a,i+(s?0:1e5));this.chunkBudget-=Date.now()-n,(l||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:Hs.setState.of(new hv(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=>Ao(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()}}}),cd=ct.define({combine(t){return t.length?t[0]:null},enables:t=>[Hs.state,$at,rt.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class ehe{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}const Fat=ct.define(),xw=ct.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 SE(t){let e=t.facet(xw);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function u_(t,e){let n="",r=t.tabSize,i=t.facet(xw)[0];if(i==" "){for(;e>=r;)n+=" ",e-=r;i=" "}for(let o=0;o=e?jat(t,n,e):null}class K2{constructor(e,n={}){this.state=e,this.options=n,this.unit=SE(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 Py(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 Vt;function jat(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 the(r,t,n)}function the(t,e,n){for(let r=t;r;r=r.next){let i=zat(r.node);if(i)return i(F4.create(e,n,r))}return 0}function Bat(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function zat(t){let e=t.type.prop($4);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(Vt.closedBy))){let i=t.lastChild,o=i&&r.indexOf(i.name)>-1;return a=>nhe(a,!0,1,void 0,o&&!Bat(a)?i.from:void 0)}return t.parent==null?Uat:null}function Uat(){return 0}class F4 extends K2{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 F4(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(Wat(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return the(this.context.next,this.base,this.pos)}}function Wat(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function Vat(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.fromnhe(r,e,n,t)}function nhe(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?Vat(t):null;return l?s?t.column(l.from):t.column(l.to):t.baseIndent+(s?0:t.unit*n)}function uq({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const Gat=200;function Hat(){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+Gat)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=N4(a,u.from);if(f==null)continue;let d=/^\s*/.exec(u.text)[0],h=u_(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 qat=ct.define(),j4=new Vt;function rhe(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 Qat(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function OE(t,e,n){for(let r of t.facet(qat)){let i=r(t,e,n);if(i)return i}return Xat(t,e,n)}function ihe(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 Z2=Rt.define({map:ihe}),bw=Rt.define({map:ihe});function ohe(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 fp=mi.define({create(){return gt.none},update(t,e){t=t.map(e.changes);for(let n of e.effects)if(n.is(Z2)&&!Yat(t,n.value.from,n.value.to)){let{preparePlaceholder:r}=e.state.facet(lhe),i=r?gt.replace({widget:new rst(r(e.state,n.value))}):fq;t=t.update({add:[i.range(n.value.from,n.value.to)]})}else n.is(bw)&&(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 Yat(t,e,n){let r=!1;return t.between(e,e,(i,o)=>{i==e&&o==n&&(r=!0)}),r}function ahe(t,e){return t.field(fp,!1)?e:e.concat(Rt.appendConfig.of(che()))}const Kat=t=>{for(let e of ohe(t)){let n=OE(t.state,e.from,e.to);if(n)return t.dispatch({effects:ahe(t.state,[Z2.of(n),she(t,n)])}),!0}return!1},Zat=t=>{if(!t.state.field(fp,!1))return!1;let e=[];for(let n of ohe(t)){let r=CE(t.state,n.from,n.to);r&&e.push(bw.of(r),she(t,r,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function she(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 Jat=t=>{let{state:e}=t,n=[];for(let r=0;r{let e=t.state.field(fp,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,(r,i)=>{n.push(bw.of({from:r,to:i}))}),t.dispatch({effects:n}),!0},tst=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:Kat},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:Zat},{key:"Ctrl-Alt-[",run:Jat},{key:"Ctrl-Alt-]",run:est}],nst={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},lhe=ct.define({combine(t){return cc(t,nst)}});function che(t){return[fp,ast]}function uhe(t,e){let{state:n}=t,r=n.facet(lhe),i=a=>{let s=t.lineBlockAt(t.posAtDOM(a.target)),l=CE(t.state,s.from,s.to);l&&t.dispatch({effects:bw.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 fq=gt.replace({widget:new class extends uc{toDOM(t){return uhe(t,null)}}});class rst extends uc{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return uhe(e,this.value)}}const ist={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class YR extends gu{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 ost(t={}){let e=Object.assign(Object.assign({},ist),t),n=new YR(e,!0),r=new YR(e,!1),i=kr.fromClass(class{constructor(a){this.from=a.viewport.from,this.markers=this.buildMarkers(a)}update(a){(a.docChanged||a.viewportChanged||a.startState.facet(cd)!=a.state.facet(cd)||a.startState.field(fp,!1)!=a.state.field(fp,!1)||fi(a.startState)!=fi(a.state)||e.foldingChanged(a))&&(this.markers=this.buildMarkers(a.view))}buildMarkers(a){let s=new id;for(let l of a.viewportLineBlocks){let c=CE(a.state,l.from,l.to)?r:OE(a.state,l.from,l.to)?n:null;c&&s.add(l.from,l.from,c)}return s.finish()}}),{domEventHandlers:o}=e;return[i,sat({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 YR(e,!1)},domEventHandlers:Object.assign(Object.assign({},o),{click:(a,s,l)=>{if(o.click&&o.click(a,s,l))return!0;let c=CE(a.state,s.from,s.to);if(c)return a.dispatch({effects:bw.of(c)}),!0;let u=OE(a.state,s.from,s.to);return u?(a.dispatch({effects:Z2.of(u)}),!0):!1}})}),che()]}const ast=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 _w{constructor(e,n){this.specs=e;let r;function i(s){let l=od.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 Hs?s=>s.prop(og)==a.data:a?s=>s==a:void 0,this.style=Zde(e.map(s=>({tag:s.tag,class:s.class||i(Object.assign({},s,{tag:null}))})),{all:o}).style,this.module=r?new od(r):null,this.themeType=n.themeType}static define(e,n){return new _w(e,n||{})}}const zN=ct.define(),fhe=ct.define({combine(t){return t.length?[t[0]]:null}});function KR(t){let e=t.facet(zN);return e.length?e:t.facet(fhe)}function dhe(t,e){let n=[lst],r;return t instanceof _w&&(t.module&&n.push(rt.styleModule.of(t.module)),r=t.themeType),e!=null&&e.fallback?n.push(fhe.of(t)):r?n.push(zN.computeN([rt.darkTheme],i=>i.facet(rt.darkTheme)==(r=="dark")?[t]:[])):n.push(zN.of(t)),n}class sst{constructor(e){this.markCache=Object.create(null),this.tree=fi(e.state),this.decorations=this.buildDeco(e,KR(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=fi(e.state),r=KR(e.state),i=r!=KR(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 gt.none;let r=new id;for(let{from:i,to:o}of e.visibleRanges)Aat(this.tree,n,(a,s,l)=>{r.add(a,s,this.markCache[l]||(this.markCache[l]=gt.mark({class:l})))},i,o);return r.finish()}}const lst=Ed.high(kr.fromClass(sst,{decorations:t=>t.decorations})),cst=_w.define([{tag:Ce.meta,color:"#404740"},{tag:Ce.link,textDecoration:"underline"},{tag:Ce.heading,textDecoration:"underline",fontWeight:"bold"},{tag:Ce.emphasis,fontStyle:"italic"},{tag:Ce.strong,fontWeight:"bold"},{tag:Ce.strikethrough,textDecoration:"line-through"},{tag:Ce.keyword,color:"#708"},{tag:[Ce.atom,Ce.bool,Ce.url,Ce.contentSeparator,Ce.labelName],color:"#219"},{tag:[Ce.literal,Ce.inserted],color:"#164"},{tag:[Ce.string,Ce.deleted],color:"#a11"},{tag:[Ce.regexp,Ce.escape,Ce.special(Ce.string)],color:"#e40"},{tag:Ce.definition(Ce.variableName),color:"#00f"},{tag:Ce.local(Ce.variableName),color:"#30a"},{tag:[Ce.typeName,Ce.namespace],color:"#085"},{tag:Ce.className,color:"#167"},{tag:[Ce.special(Ce.variableName),Ce.macroName],color:"#256"},{tag:Ce.definition(Ce.propertyName),color:"#00c"},{tag:Ce.comment,color:"#940"},{tag:Ce.invalid,color:"#f00"}]),ust=rt.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),hhe=1e4,phe="()[]{}",mhe=ct.define({combine(t){return cc(t,{afterCursor:!0,brackets:phe,maxScanDistance:hhe,renderMatch:hst})}}),fst=gt.mark({class:"cm-matchingBracket"}),dst=gt.mark({class:"cm-nonmatchingBracket"});function hst(t){let e=[],n=t.matched?fst:dst;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 pst=mi.define({create(){return gt.none},update(t,e){if(!e.docChanged&&!e.selection)return t;let n=[],r=e.state.facet(mhe);for(let i of e.state.selection.ranges){if(!i.empty)continue;let o=Ll(e.state,i.head,-1,r)||i.head>0&&Ll(e.state,i.head-1,1,r)||r.afterCursor&&(Ll(e.state,i.head,1,r)||i.headrt.decorations.from(t)}),mst=[pst,ust];function gst(t={}){return[mhe.of(t),mst]}const vst=new Vt;function UN(t,e,n){let r=t.prop(e<0?Vt.openedBy:Vt.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 WN(t){let e=t.type.prop(vst);return e?e(t.node):t}function Ll(t,e,n,r={}){let i=r.maxScanDistance||hhe,o=r.brackets||phe,a=fi(t),s=a.resolveInner(e,n);for(let l=s;l;l=l.parent){let c=UN(l.type,n,o);if(c&&l.from0?e>=u.from&&eu.from&&e<=u.to))return yst(t,e,n,l,u,c,o)}}return xst(t,e,n,a,s.type,i,o)}function yst(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 bst=Object.create(null),dq=[Vo.none],hq=[],pq=Object.create(null),_st=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"]])_st[t]=wst(bst,e);function ZR(t,e){hq.indexOf(t)>-1||(hq.push(t),console.warn(e))}function wst(t,e){let n=[];for(let s of e.split(" ")){let l=[];for(let c of s.split(".")){let u=t[c]||Ce[c];u?typeof u=="function"?l.length?l=l.map(u):ZR(c,`Modifier ${c} used at start of tag`):l.length?ZR(c,`Tag ${c} used as modifier`):l=Array.isArray(u)?u:[u]:ZR(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=pq[i];if(o)return o.id;let a=pq[i]=Vo.define({id:dq.length,name:r,props:[L4({[r]:n})]});return dq.push(a),a.id}rr.RTL,rr.LTR;const Sst=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=z4(t.state,n.from);return r.line?Ost(t):r.block?Tst(t):!1};function B4(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 Ost=B4(Mst,0),Cst=B4(ghe,0),Tst=B4((t,e)=>ghe(t,e,Pst(e)),0);function z4(t,e){let n=t.languageDataAt("commentTokens",e);return n.length?n[0]:{}}const L0=50;function Est(t,{open:e,close:n},r,i){let o=t.sliceDoc(r-L0,r),a=t.sliceDoc(i,i+L0),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*L0?u=f=t.sliceDoc(r,i):(u=t.sliceDoc(r,r+L0),f=t.sliceDoc(i-L0,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 Pst(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 ghe(t,e,n=e.selection.ranges){let r=n.map(o=>z4(e,o.from).block);if(!r.every(o=>o))return null;let i=n.map((o,a)=>Est(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 VN=lc.define(),kst=lc.define(),Ast=ct.define(),vhe=ct.define({combine(t){return cc(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)})}}),yhe=mi.define({create(){return Nl.empty},update(t,e){let n=e.state.facet(vhe),r=e.annotation(VN);if(r){let l=Ro.fromTransaction(e,r.selection),c=r.side,u=c==0?t.undone:t.done;return l?u=TE(u,u.length,n.minDepth,l):u=_he(u,e.startState.selection),new Nl(c==0?r.rest:u,c==0?u:r.rest)}let i=e.annotation(kst);if((i=="full"||i=="before")&&(t=t.isolate()),e.annotation(Ur.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let o=Ro.fromTransaction(e),a=e.annotation(Ur.time),s=e.annotation(Ur.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 Nl(t.done.map(Ro.fromJSON),t.undone.map(Ro.fromJSON))}});function Rst(t={}){return[yhe,vhe.of(t),rt.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?xhe:e.inputType=="historyRedo"?GN:null;return r?(e.preventDefault(),r(n)):!1}})]}function J2(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let i=n.field(yhe,!1);if(!i)return!1;let o=i.pop(t,n,e);return o?(r(o),!0):!1}}const xhe=J2(0,!1),GN=J2(1,!1),Ist=J2(0,!0),Dst=J2(1,!0);class Ro{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 Ro(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 Ro(e.changes&&Zr.fromJSON(e.changes),[],e.mapped&&Ql.fromJSON(e.mapped),e.startSelection&&je.fromJSON(e.startSelection),e.selectionsAfter.map(je.fromJSON))}static fromTransaction(e,n){let r=Ka;for(let i of e.startState.facet(Ast)){let o=i(e);o.length&&(r=r.concat(o))}return!r.length&&e.changes.empty?null:new Ro(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,Ka)}static selection(e){return new Ro(void 0,Ka,void 0,void 0,e)}}function TE(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 Lst(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 Nst(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function bhe(t,e){return t.length?e.length?t.concat(e):t:e}const Ka=[],$st=200;function _he(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-$st));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),TE(t,t.length-1,1e9,n.setSelAfter(r)))}else return[Ro.selection([e])]}function Fst(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 JR(t,e){if(!t.length)return t;let n=t.length,r=Ka;for(;n;){let i=jst(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?[Ro.selection(r)]:Ka}function jst(t,e,n){let r=bhe(t.selectionsAfter.length?t.selectionsAfter.map(s=>s.map(e)):Ka,n);if(!t.changes)return Ro.selection(r);let i=t.changes.map(e),o=e.mapDesc(t.changes,!0),a=t.mapped?t.mapped.composeDesc(o):o;return new Ro(i,Rt.mapEffects(t.effects,e),a,t.startSelection.map(o),r)}const Bst=/^(input\.type|delete)($|\.)/;class Nl{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 Nl(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||Bst.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime0&&n-this.prevTimen.empty?t.moveByChar(n,e):ek(n,e))}function eo(t){return t.textDirectionAt(t.state.selection.main.head)==rr.LTR}const She=t=>whe(t,!eo(t)),Ohe=t=>whe(t,eo(t));function Che(t,e){return il(t,n=>n.empty?t.moveByGroup(n,e):ek(n,e))}const Ust=t=>Che(t,!eo(t)),Wst=t=>Che(t,eo(t));function Vst(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 tk(t,e,n){let r=fi(t).resolveInner(e.head),i=n?Vt.closedBy:Vt.openedBy;for(let l=e.head;;){let c=n?r.childAfter(l):r.childBefore(l);if(!c)break;Vst(t,c,i)?r=c:l=n?c.to:c.from}let o=r.type.prop(i),a,s;return o&&(a=n?Ll(t,r.from,1):Ll(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 Gst=t=>il(t,e=>tk(t.state,e,!eo(t))),Hst=t=>il(t,e=>tk(t.state,e,eo(t)));function The(t,e){return il(t,n=>{if(!n.empty)return ek(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const Ehe=t=>The(t,!1),Phe=t=>The(t,!0);function Mhe(t){let e=t.scrollDOM.clientHeighta.empty?t.moveVertically(a,e,n.height):ek(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.bottomkhe(t,!1),HN=t=>khe(t,!0);function Pd(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 qst=t=>il(t,e=>Pd(t,e,!0)),Xst=t=>il(t,e=>Pd(t,e,!1)),Qst=t=>il(t,e=>Pd(t,e,!eo(t))),Yst=t=>il(t,e=>Pd(t,e,eo(t))),Kst=t=>il(t,e=>je.cursor(t.lineBlockAt(e.head).from,1)),Zst=t=>il(t,e=>je.cursor(t.lineBlockAt(e.head).to,-1));function Jst(t,e,n){let r=!1,i=My(t.selection,o=>{let a=Ll(t,o.head,-1)||Ll(t,o.head,1)||o.head>0&&Ll(t,o.head-1,1)||o.headJst(t,e);function Os(t,e){let n=My(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(fc(t.state,n)),!0)}function Ahe(t,e){return Os(t,n=>t.moveByChar(n,e))}const Rhe=t=>Ahe(t,!eo(t)),Ihe=t=>Ahe(t,eo(t));function Dhe(t,e){return Os(t,n=>t.moveByGroup(n,e))}const tlt=t=>Dhe(t,!eo(t)),nlt=t=>Dhe(t,eo(t)),rlt=t=>Os(t,e=>tk(t.state,e,!eo(t))),ilt=t=>Os(t,e=>tk(t.state,e,eo(t)));function Lhe(t,e){return Os(t,n=>t.moveVertically(n,e))}const Nhe=t=>Lhe(t,!1),$he=t=>Lhe(t,!0);function Fhe(t,e){return Os(t,n=>t.moveVertically(n,e,Mhe(t).height))}const gq=t=>Fhe(t,!1),vq=t=>Fhe(t,!0),olt=t=>Os(t,e=>Pd(t,e,!0)),alt=t=>Os(t,e=>Pd(t,e,!1)),slt=t=>Os(t,e=>Pd(t,e,!eo(t))),llt=t=>Os(t,e=>Pd(t,e,eo(t))),clt=t=>Os(t,e=>je.cursor(t.lineBlockAt(e.head).from)),ult=t=>Os(t,e=>je.cursor(t.lineBlockAt(e.head).to)),yq=({state:t,dispatch:e})=>(e(fc(t,{anchor:0})),!0),xq=({state:t,dispatch:e})=>(e(fc(t,{anchor:t.doc.length})),!0),bq=({state:t,dispatch:e})=>(e(fc(t,{anchor:t.selection.main.anchor,head:0})),!0),_q=({state:t,dispatch:e})=>(e(fc(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),flt=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),dlt=({state:t,dispatch:e})=>{let n=nk(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},hlt=({state:t,dispatch:e})=>{let n=My(t.selection,r=>{var i;let o=fi(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(fc(t,n)),!0},plt=({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(fc(t,r)),!0):!1};function ww(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=lO(t,l,!0)),a=Math.min(a,l),s=Math.max(s,l)}else a=lO(t,a,!1),s=lO(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 jhe=(t,e,n)=>ww(t,r=>{let i=r.from,{state:o}=t,a=o.doc.lineAt(i),s,l;if(n&&!e&&i>a.from&&ijhe(t,!1,!0),Bhe=t=>jhe(t,!0,!1),zhe=(t,e)=>ww(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}),Uhe=t=>zhe(t,!1),mlt=t=>zhe(t,!0),glt=t=>ww(t,e=>{let n=t.lineBlockAt(e.head).to;return e.headww(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),ylt=t=>ww(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:xn.of(["",""])},range:je.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},blt=({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 nk(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 Whe(t,e,n){if(t.readOnly)return!1;let r=[],i=[];for(let o of nk(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 _lt=({state:t,dispatch:e})=>Whe(t,e,!1),wlt=({state:t,dispatch:e})=>Whe(t,e,!0);function Vhe(t,e,n){if(t.readOnly)return!1;let r=[];for(let i of nk(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 Slt=({state:t,dispatch:e})=>Vhe(t,e,!1),Olt=({state:t,dispatch:e})=>Vhe(t,e,!0),Clt=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(nk(e).map(({from:i,to:o})=>(i>0?i--:o{let o;if(t.lineWrapping){let a=t.lineBlockAt(i.head),s=t.coordsAtPos(i.head,i.assoc||1);s&&(o=a.bottom+t.documentTop-s.bottom+t.defaultLineHeight/2)}return t.moveVertically(i,!0,o)}).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Tlt(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=fi(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(Vt.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 Elt=Ghe(!1),Plt=Ghe(!0);function Ghe(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&&Tlt(e,o);t&&(o=a=(a<=s.to?s:e.doc.lineAt(a)).to);let c=new K2(e,{simulateBreak:o,simulateDoubleBreak:!!l}),u=N4(c,o);for(u==null&&(u=Py(/^\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 Mlt=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new K2(t,{overrideIndentation:o=>{let a=n[o];return a??-1}}),i=U4(t,(o,a,s)=>{let l=N4(r,o.from);if(l==null)return;/\S/.test(o.text)||(l=0);let c=/^\s*/.exec(o.text)[0],u=u_(t,l);(c!=u||s.fromt.readOnly?!1:(e(t.update(U4(t,(n,r)=>{r.push({from:n.from,insert:t.facet(xw)})}),{userEvent:"input.indent"})),!0),qhe=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(U4(t,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let o=Py(i,t.tabSize),a=0,s=u_(t,Math.max(0,o-SE(t)));for(;a(t.setTabFocusMode(),!0),Alt=[{key:"Ctrl-b",run:She,shift:Rhe,preventDefault:!0},{key:"Ctrl-f",run:Ohe,shift:Ihe},{key:"Ctrl-p",run:Ehe,shift:Nhe},{key:"Ctrl-n",run:Phe,shift:$he},{key:"Ctrl-a",run:Kst,shift:clt},{key:"Ctrl-e",run:Zst,shift:ult},{key:"Ctrl-d",run:Bhe},{key:"Ctrl-h",run:qN},{key:"Ctrl-k",run:glt},{key:"Ctrl-Alt-h",run:Uhe},{key:"Ctrl-o",run:xlt},{key:"Ctrl-t",run:blt},{key:"Ctrl-v",run:HN}],Rlt=[{key:"ArrowLeft",run:She,shift:Rhe,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:Ust,shift:tlt,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Qst,shift:slt,preventDefault:!0},{key:"ArrowRight",run:Ohe,shift:Ihe,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:Wst,shift:nlt,preventDefault:!0},{mac:"Cmd-ArrowRight",run:Yst,shift:llt,preventDefault:!0},{key:"ArrowUp",run:Ehe,shift:Nhe,preventDefault:!0},{mac:"Cmd-ArrowUp",run:yq,shift:bq},{mac:"Ctrl-ArrowUp",run:mq,shift:gq},{key:"ArrowDown",run:Phe,shift:$he,preventDefault:!0},{mac:"Cmd-ArrowDown",run:xq,shift:_q},{mac:"Ctrl-ArrowDown",run:HN,shift:vq},{key:"PageUp",run:mq,shift:gq},{key:"PageDown",run:HN,shift:vq},{key:"Home",run:Xst,shift:alt,preventDefault:!0},{key:"Mod-Home",run:yq,shift:bq},{key:"End",run:qst,shift:olt,preventDefault:!0},{key:"Mod-End",run:xq,shift:_q},{key:"Enter",run:Elt},{key:"Mod-a",run:flt},{key:"Backspace",run:qN,shift:qN},{key:"Delete",run:Bhe},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Uhe},{key:"Mod-Delete",mac:"Alt-Delete",run:mlt},{mac:"Mod-Backspace",run:vlt},{mac:"Mod-Delete",run:ylt}].concat(Alt.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),Ilt=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Gst,shift:rlt},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Hst,shift:ilt},{key:"Alt-ArrowUp",run:_lt},{key:"Shift-Alt-ArrowUp",run:Slt},{key:"Alt-ArrowDown",run:wlt},{key:"Shift-Alt-ArrowDown",run:Olt},{key:"Escape",run:plt},{key:"Mod-Enter",run:Plt},{key:"Alt-l",mac:"Ctrl-l",run:dlt},{key:"Mod-i",run:hlt,preventDefault:!0},{key:"Mod-[",run:qhe},{key:"Mod-]",run:Hhe},{key:"Mod-Alt-\\",run:Mlt},{key:"Shift-Mod-k",run:Clt},{key:"Shift-Mod-\\",run:elt},{key:"Mod-/",run:Sst},{key:"Alt-A",run:Cst},{key:"Ctrl-m",mac:"Shift-Alt-m",run:klt}].concat(Rlt),Dlt={key:"Tab",run:Hhe,shift:qhe};function zn(){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 pv{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(wq(s)):wq,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=y4(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=Ha(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=EE(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 Ig(n,e.sliceString(n,r));return eI.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=EE(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Ig.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(Yhe.prototype[Symbol.iterator]=Khe.prototype[Symbol.iterator]=function(){return this});function Llt(t){try{return new RegExp(t,W4),!0}catch{return!1}}function EE(t,e){if(e>=t.length)return e;let n=t.lineAt(e),r;for(;e=56320&&r<57344;)e++;return e}function XN(t){let e=String(t.state.doc.lineAt(t.state.selection.main.head).number),n=zn("input",{class:"cm-textfield",name:"line",value:e}),r=zn("form",{class:"cm-gotoLine",onkeydown:o=>{o.keyCode==27?(o.preventDefault(),t.dispatch({effects:PE.of(!1)}),t.focus()):o.keyCode==13&&(o.preventDefault(),i())},onsubmit:o=>{o.preventDefault(),i()}},zn("label",t.state.phrase("Go to line"),": ",n)," ",zn("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:[PE.of(!1),rt.scrollIntoView(m.from,{y:"center"})],selection:m}),t.focus()}return{dom:r}}const PE=Rt.define(),Sq=mi.define({create(){return!0},update(t,e){for(let n of e.effects)n.is(PE)&&(t=n.value);return t},provide:t=>s_.from(t,e=>e?XN:null)}),Nlt=t=>{let e=a_(t,XN);if(!e){let n=[PE.of(!0)];t.state.field(Sq,!1)==null&&n.push(Rt.appendConfig.of([Sq,$lt])),t.dispatch({effects:n}),e=a_(t,XN)}return e&&e.dom.querySelector("input").select(),!0},$lt=rt.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),Flt={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},jlt=ct.define({combine(t){return cc(t,Flt,{highlightWordAroundCursor:(e,n)=>e||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function Blt(t){return[Glt,Vlt]}const zlt=gt.mark({class:"cm-selectionMatch"}),Ult=gt.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Oq(t,e,n,r){return(n==0||t(e.sliceDoc(n-1,n))!=fr.Word)&&(r==e.doc.length||t(e.sliceDoc(r,r+1))!=fr.Word)}function Wlt(t,e,n,r){return t(e.sliceDoc(n,n+1))==fr.Word&&t(e.sliceDoc(r-1,r))==fr.Word}const Vlt=kr.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(jlt),{state:n}=t,r=n.selection;if(r.ranges.length>1)return gt.none;let i=r.main,o,a=null;if(i.empty){if(!e.highlightWordAroundCursor)return gt.none;let l=n.wordAt(i.head);if(!l)return gt.none;a=n.charCategorizer(i.head),o=n.sliceDoc(l.from,l.to)}else{let l=i.to-i.from;if(l200)return gt.none;if(e.wholeWords){if(o=n.sliceDoc(i.from,i.to),a=n.charCategorizer(i.head),!(Oq(a,n,i.from,i.to)&&Wlt(a,n,i.from,i.to)))return gt.none}else if(o=n.sliceDoc(i.from,i.to),!o)return gt.none}let s=[];for(let l of t.visibleRanges){let c=new pv(n.doc,o,l.from,l.to);for(;!c.next().done;){let{from:u,to:f}=c.value;if((!a||Oq(a,n,u,f))&&(i.empty&&u<=i.from&&f>=i.to?s.push(Ult.range(u,f)):(u>=i.to||f<=i.from)&&s.push(zlt.range(u,f)),s.length>e.maxMatches))return gt.none}}return gt.set(s)}},{decorations:t=>t.decorations}),Glt=rt.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Hlt=({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 qlt(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 pv(t.doc,e,r[r.length-1].to);;)if(s.next(),s.done){if(a)return null;s=new pv(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 Xlt=({state:t,dispatch:e})=>{let{ranges:n}=t.selection;if(n.some(o=>o.from===o.to))return Hlt({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=qlt(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},ky=ct.define({combine(t){return cc(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new act(e),scrollToMatch:e=>rt.scrollIntoView(e)})}});class Zhe{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||Llt(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 Zlt(this):new Ylt(this)}getCursor(e,n=0,r){let i=e.doc?e:en.create({doc:e});return r==null&&(r=i.doc.length),this.regexp?Wm(this,i,n,r):Um(this,i,n,r)}}class Jhe{constructor(e){this.spec=e}}function Um(t,e,n,r){return new pv(e.doc,t.unquoted,n,r,t.caseSensitive?void 0:i=>i.toLowerCase(),t.wholeWord?Qlt(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function Qlt(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=Um(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 Wm(t,e,n,r){return new Yhe(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:t.wholeWord?Klt(e.charCategorizer(e.selection.main.head)):void 0},n,r)}function ME(t,e){return t.slice(ki(t,e,!1),e)}function kE(t,e){return t.slice(e,ki(t,e))}function Klt(t){return(e,n,r)=>!r[0].length||(t(ME(r.input,r.index))!=fr.Word||t(kE(r.input,r.index))!=fr.Word)&&(t(kE(r.input,r.index+r[0].length))!=fr.Word||t(ME(r.input,r.index+r[0].length))!=fr.Word)}class Zlt extends Jhe{nextMatch(e,n,r){let i=Wm(this.spec,e,r,e.doc.length).next();return i.done&&(i=Wm(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=Wm(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=Wm(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 f_=Rt.define(),V4=Rt.define(),Wf=mi.define({create(t){return new tI(QN(t).create(),null)},update(t,e){for(let n of e.effects)n.is(f_)?t=new tI(n.value.create(),t.panel):n.is(V4)&&(t=new tI(t.query,n.value?G4:null));return t},provide:t=>s_.from(t,e=>e.panel)});class tI{constructor(e,n){this.query=e,this.panel=n}}const Jlt=gt.mark({class:"cm-searchMatch"}),ect=gt.mark({class:"cm-searchMatch cm-searchMatch-selected"}),tct=kr.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(Wf))}update(t){let e=t.state.field(Wf);(e!=t.startState.field(Wf)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return gt.none;let{view:n}=this,r=new id;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?ect:Jlt)})}return r.finish()}},{decorations:t=>t.decorations});function Sw(t){return e=>{let n=e.state.field(Wf,!1);return n&&n.query.spec.valid?t(e,n):npe(e)}}const AE=Sw((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(ky);return t.dispatch({selection:i,effects:[H4(t,r),o.scrollToMatch(i.main,t)],userEvent:"select.search"}),tpe(t),!0}),RE=Sw((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(ky);return t.dispatch({selection:o,effects:[H4(t,i),a.scrollToMatch(o.main,t)],userEvent:"select.search"}),tpe(t),!0}),nct=Sw((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)}),rct=({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 pv(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},Cq=Sw((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(H4(t,o)),c.push(n.facet(ky).scrollToMatch(s.main,t))}return t.dispatch({changes:a,selection:s,effects:c,userEvent:"input.replace"}),!0}),ict=Sw((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 G4(t){return t.state.facet(ky).createPanel(t)}function QN(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(ky);return new Zhe({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 epe(t){let e=a_(t,G4);return e&&e.dom.querySelector("[main-field]")}function tpe(t){let e=epe(t);e&&e==t.root.activeElement&&e.select()}const npe=t=>{let e=t.state.field(Wf,!1);if(e&&e.panel){let n=epe(t);if(n&&n!=t.root.activeElement){let r=QN(t.state,e.query.spec);r.valid&&t.dispatch({effects:f_.of(r)}),n.focus(),n.select()}}else t.dispatch({effects:[V4.of(!0),e?f_.of(QN(t.state,e.query.spec)):Rt.appendConfig.of(lct)]});return!0},rpe=t=>{let e=t.state.field(Wf,!1);if(!e||!e.panel)return!1;let n=a_(t,G4);return n&&n.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:V4.of(!1)}),!0},oct=[{key:"Mod-f",run:npe,scope:"editor search-panel"},{key:"F3",run:AE,shift:RE,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:AE,shift:RE,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:rpe,scope:"editor search-panel"},{key:"Mod-Shift-l",run:rct},{key:"Mod-Alt-g",run:Nlt},{key:"Mod-d",run:Xlt,preventDefault:!0}];class act{constructor(e){this.view=e;let n=this.query=e.state.field(Wf).query.spec;this.commit=this.commit.bind(this),this.searchField=zn("input",{value:n.search,placeholder:Yo(e,"Find"),"aria-label":Yo(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=zn("input",{value:n.replace,placeholder:Yo(e,"Replace"),"aria-label":Yo(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=zn("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=zn("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=zn("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(i,o,a){return zn("button",{class:"cm-button",name:i,onclick:o,type:"button"},a)}this.dom=zn("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>AE(e),[Yo(e,"next")]),r("prev",()=>RE(e),[Yo(e,"previous")]),r("select",()=>nct(e),[Yo(e,"all")]),zn("label",null,[this.caseField,Yo(e,"match case")]),zn("label",null,[this.reField,Yo(e,"regexp")]),zn("label",null,[this.wordField,Yo(e,"by word")]),...e.state.readOnly?[]:[zn("br"),this.replaceField,r("replace",()=>Cq(e),[Yo(e,"replace")]),r("replaceAll",()=>ict(e),[Yo(e,"replace all")])],zn("button",{name:"close",onclick:()=>rpe(e),"aria-label":Yo(e,"close"),type:"button"},["×"])])}commit(){let e=new Zhe({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:f_.of(e)}))}keydown(e){mot(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?RE:AE)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Cq(this.view))}update(e){for(let n of e.transactions)for(let r of n.effects)r.is(f_)&&!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(ky).top}}function Yo(t,e){return t.state.phrase(e)}const cO=30,uO=/[\s\.,:;?!]/;function H4(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-cO),a=Math.min(i,n+cO),s=t.state.sliceDoc(o,a);if(o!=r.from){for(let l=0;ls.length-cO;l--)if(!uO.test(s[l-1])&&uO.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 sct=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"}}),lct=[Wf,Ed.low(tct),sct];class ipe{constructor(e,n,r,i){this.state=e,this.pos=n,this.explicit=r,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let n=fi(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(ape(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,r){e=="abort"&&this.abortListeners&&(this.abortListeners.push(n),r&&r.onDocChange&&(this.abortOnDocChange=!0))}}function Tq(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 cct(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+$/]:cct(e);return i=>{let o=i.matchBefore(r);return o||i.explicit?{from:o?o.from:i.pos,options:e,validFor:n}:null}}function uct(t,e){return n=>{for(let r=fi(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 Eq{constructor(e,n,r,i){this.completion=e,this.source=n,this.match=r,this.score=i}}function Vf(t){return t.selection.main.from}function ape(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 q4=lc.define();function fct(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 dct(t){if(!Array.isArray(t))return t;let e=Pq.get(t);return e||Pq.set(t,e=ope(t)),e}const IE=Rt.define(),d_=Rt.define();class hct{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=y4(_))!=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+=Ha(_)}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?Ha(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 pct{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:mct,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 mct(t,e,n,r,i,o){let a=t.textDirection==rr.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 gct(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 nI(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 vct{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=gct(s),this.optionClass=s.optionClass,this.tooltipClass=s.tooltipClass,this.range=nI(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:d_.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=nI(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=nI(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=>Ao(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&&xct(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 vct(n,t,e)}function xct(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 kq(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function bct(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 Eq(f,c.source,u?u(f):[],1e9-n.length));else{let f=e.sliceDoc(c.from,c.to),d,h=o.filterStrict?new pct(f):new hct(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 Eq(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):kq(c.completion)>kq(s)&&(a[a.length-1]=c),s=c.completion}return a}class ag{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 ag(this.options,Aq(n,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,n,r,i,o){let a=bct(e,n);if(!a.length)return i&&e.some(l=>l.state==1)?new ag(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:Tct,above:o.aboveCursor},i?i.timestamp:Date.now(),s,!1)}map(e){return new ag(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class DE{constructor(e,n,r){this.active=e,this.id=n,this.open=r}static start(){return new DE(Oct,"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",Vf(n)).map(dct)).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))||!_ct(o,this.active)?a=ag.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(cpe)&&(a=a&&a.setSelected(s.value,this.id));return o==this.active&&a==this.open?this:new DE(o,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?wct:Sct}}function _ct(t,e){if(t==e)return!0;for(let n=0,r=0;;){for(;n-1&&(n["aria-activedescendant"]=t+"-"+e),n}const Oct=[];function spe(t,e){if(t.isUserEvent("input.complete")){let r=t.annotation(q4);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=spe(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(IE))i=new da(i.source,1,o.value?Vf(e.state):-1);else if(o.is(d_))i=new da(i.source,0);else if(o.is(lpe))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(Vf(e.state))}}class Dg 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=Vf(e.state);if((this.explicitPos<0?s<=o:sa||!i||n&2&&Vf(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 Cct(i.validFor,e.state,o,a)?new Dg(this.source,l,i,o,a):i.update&&(i=i.update(i,o,a,new ipe(e.state,s,l>=0)))?new Dg(this.source,l,i,i.from,(r=i.to)!==null&&r!==void 0?r:Vf(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 Dg(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 Cct(t,e,n,r){if(!t)return!1;let i=e.sliceDoc(n,r);return typeof t=="function"?t(i,n,r,e):ape(t,!0).test(i)}const lpe=Rt.define({map(t,e){return t.map(n=>n.map(e))}}),cpe=Rt.define(),To=mi.define({create(){return DE.start()},update(t,e){return t.update(e)},provide:t=>[k4.from(t,e=>e.tooltip),rt.contentAttributes.from(t,e=>e.attrs)]});function X4(t,e){const n=e.completion.apply||e.completion.label;let r=t.state.field(To).active.find(i=>i.source==e.source);return r instanceof Dg?(typeof n=="string"?t.dispatch(Object.assign(Object.assign({},fct(t.state,n,r.from,r.to)),{annotations:q4.of(e.completion)})):n(t,e.completion,r.from,r.to),!0):!1}const Tct=yct(To,X4);function fO(t,e="option"){return n=>{let r=n.state.field(To,!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:cpe.of(s)}),!0}}const Ect=t=>{let e=t.state.field(To,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampt.state.field(To,!1)?(t.dispatch({effects:IE.of(!0)}),!0):!1,Mct=t=>{let e=t.state.field(To,!1);return!e||!e.active.some(n=>n.state!=0)?!1:(t.dispatch({effects:d_.of(null)}),!0)};class kct{constructor(e,n){this.active=e,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const Act=50,Rct=1e3,Ict=kr.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(To).active)e.state==1&&this.startQuery(e)}update(t){let e=t.state.field(To),n=t.state.facet(Mi);if(!t.selectionSet&&!t.docChanged&&t.startState.field(To)==e)return;let r=t.transactions.some(o=>{let a=spe(o,n);return a&8||(o.selection||o.docChanged)&&!(a&3)});for(let o=0;oAct&&Date.now()-a.time>Rct){for(let s of a.context.abortListeners)try{s()}catch(l){Ao(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(IE)))&&(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(To);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=Vf(e),r=new ipe(e,n,t.explicitPos==n,this.view),i=new kct(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:d_.of(null)}),Ao(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:lpe.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(To,!1);if(e&&e.tooltip&&this.view.state.facet(Mi).closeOnBlur){let n=e.open&&Ude(this.view,e.open.tooltip);(!n||!n.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:d_.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:IE.of(!1)}),20),this.composing=0}}}),Dct=typeof navigator=="object"&&/Win/.test(navigator.platform),Lct=Ed.highest(rt.domEventHandlers({keydown(t,e){let n=e.state.field(To,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||t.key.length>1||t.ctrlKey&&!(Dct&&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&&X4(e,r),!1}})),upe=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",whiteSpace:"pre-line"},".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 Nct{constructor(e,n,r,i){this.field=e,this.line=n,this.from=r,this.to=i}}class Q4{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 Q4(this.field,n,r)}}class Y4{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 Q4(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 Nct(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 Y4(r,i)}}let $ct=gt.widget({widget:new class extends uc{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),Fct=gt.mark({class:"cm-snippetField"});class Ay{constructor(e,n){this.ranges=e,this.active=n,this.deco=gt.set(e.map(r=>(r.from==r.to?$ct:Fct).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 Ay(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 Ow=Rt.define({map(t,e){return t&&t.map(e)}}),jct=Rt.define(),h_=mi.define({create(){return null},update(t,e){for(let n of e.effects){if(n.is(Ow))return n.value;if(n.is(jct)&&t)return new Ay(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:gt.none)});function K4(t,e){return je.create(t.filter(n=>n.field==e).map(n=>je.range(n.from,n.to)))}function Bct(t){let e=Y4.parse(t);return(n,r,i,o)=>{let{text:a,ranges:s}=e.instantiate(n.state,i),l={changes:{from:i,to:o,insert:xn.of(a)},scrollIntoView:!0,annotations:r?[q4.of(r),Ur.userEvent.of("input.complete")]:void 0};if(s.length&&(l.selection=K4(s,0)),s.some(c=>c.field>0)){let c=new Ay(s,0),u=l.effects=[Ow.of(c)];n.state.field(h_,!1)===void 0&&u.push(Rt.appendConfig.of([h_,Gct,Hct,upe]))}n.dispatch(n.state.update(l))}}function fpe(t){return({state:e,dispatch:n})=>{let r=e.field(h_,!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:K4(r.ranges,i),effects:Ow.of(o?null:new Ay(r.ranges,i)),scrollIntoView:!0})),!0}}const zct=({state:t,dispatch:e})=>t.field(h_,!1)?(e(t.update({effects:Ow.of(null)})),!0):!1,Uct=fpe(1),Wct=fpe(-1),Vct=[{key:"Tab",run:Uct,shift:Wct},{key:"Escape",run:zct}],Rq=ct.define({combine(t){return t.length?t[0]:Vct}}),Gct=Ed.highest(vw.compute([Rq],t=>t.facet(Rq)));function yc(t,e){return Object.assign(Object.assign({},e),{apply:Bct(t)})}const Hct=rt.domEventHandlers({mousedown(t,e){let n=e.state.field(h_,!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:K4(n.ranges,i.field),effects:Ow.of(n.ranges.some(o=>o.field>i.field)?new Ay(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),p_={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Oh=Rt.define({map(t,e){let n=e.mapPos(t,-1,Pi.TrackAfter);return n??void 0}}),Z4=new class extends sp{};Z4.startSide=1;Z4.endSide=-1;const dpe=mi.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(Oh)&&(t=t.update({add:[Z4.range(n.value,n.value+1)]}));return t}});function qct(){return[Qct,dpe]}const rI="()[]{}<>";function hpe(t){for(let e=0;e{if((Xct?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let i=t.state.selection.main;if(r.length>2||r.length==2&&Ha(Ci(r,0))==1||e!=i.from||n!=i.to)return!1;let o=Zct(t.state,r);return o?(t.dispatch(o),!0):!1}),Yct=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=ppe(t,t.selection.main.head).brackets||p_.brackets,i=null,o=t.changeByRange(a=>{if(a.empty){let s=Jct(t.doc,a.head);for(let l of r)if(l==s&&rk(t.doc,a.head)==hpe(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},Kct=[{key:"Backspace",run:Yct}];function Zct(t,e){let n=ppe(t,t.selection.main.head),r=n.brackets||p_.brackets;for(let i of r){let o=hpe(Ci(i,0));if(e==i)return o==i?nut(t,i,r.indexOf(i+i+i)>-1,n):eut(t,i,o,n.before||p_.before);if(e==o&&mpe(t,t.selection.main.from))return tut(t,i,o)}return null}function mpe(t,e){let n=!1;return t.field(dpe).between(0,t.doc.length,r=>{r==e&&(n=!0)}),n}function rk(t,e){let n=t.sliceString(e,e+2);return n.slice(0,Ha(Ci(n,0)))}function Jct(t,e){let n=t.sliceString(e-2,e);return Ha(Ci(n,0))==n.length?n:n.slice(1)}function eut(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:Oh.of(a.to+e.length),range:je.range(a.anchor+e.length,a.head+e.length)};let s=rk(t.doc,a.head);return!s||/\s/.test(s)||r.indexOf(s)>-1?{changes:{insert:e+n,from:a.head},effects:Oh.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 tut(t,e,n){let r=null,i=t.changeByRange(o=>o.empty&&rk(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 nut(t,e,n,r){let i=r.stringPrefixes||p_.stringPrefixes,o=null,a=t.changeByRange(s=>{if(!s.empty)return{changes:[{insert:e,from:s.from},{insert:e,from:s.to}],effects:Oh.of(s.to+e.length),range:je.range(s.anchor+e.length,s.head+e.length)};let l=s.head,c=rk(t.doc,l),u;if(c==e){if(Iq(t,l))return{changes:{insert:e+e,from:l},effects:Oh.of(l+e.length),range:je.cursor(l+e.length)};if(mpe(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=Dq(t,l-2*e.length,i))>-1&&Iq(t,u))return{changes:{insert:e+e+e+e,from:l},effects:Oh.of(l+e.length),range:je.cursor(l+e.length)};if(t.charCategorizer(l)(c)!=fr.Word&&Dq(t,l,i)>-1&&!rut(t,l,e,i))return{changes:{insert:e+e,from:l},effects:Oh.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 Iq(t,e){let n=fi(t).resolveInner(e+1);return n.parent&&n.from==e}function rut(t,e,n,r){let i=fi(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 Dq(t,e,n){let r=t.charCategorizer(e);if(r(t.sliceDoc(e-1,e))!=fr.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))!=fr.Word)return o}return-1}function gpe(t={}){return[Lct,To,Mi.of(t),Ict,iut,upe]}const vpe=[{key:"Ctrl-Space",run:Pct},{key:"Escape",run:Mct},{key:"ArrowDown",run:fO(!0)},{key:"ArrowUp",run:fO(!1)},{key:"PageDown",run:fO(!0,"page")},{key:"PageUp",run:fO(!1,"page")},{key:"Enter",run:Ect}],iut=Ed.highest(vw.computeN([Mi],t=>t.facet(Mi).defaultKeymap?[vpe]:[]));class out{constructor(e,n,r){this.from=e,this.to=n,this.diagnostic=r}}class fh{constructor(e,n,r){this.diagnostics=e,this.panel=n,this.selected=r}static init(e,n,r){let i=e,o=r.facet(m_).markerFilter;o&&(i=o(i,r));let a=gt.set(i.map(s=>s.from==s.to||s.from==s.to-1&&r.doc.lineAt(s.from).to==s.from?gt.widget({widget:new put(s),diagnostic:s}).range(s.from):gt.mark({attributes:{class:"cm-lintRange cm-lintRange-"+s.severity+(s.markClass?" "+s.markClass:"")},diagnostic:s}).range(s.from,s.to)),!0);return new fh(a,n,mv(a))}}function mv(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 out(i,o,a.diagnostic),!1}),r}function aut(t,e){let n=e.pos,r=e.end||n,i=t.state.facet(m_).hideOn(t,n,r);if(i!=null)return i;let o=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(a=>a.is(ype))||t.changes.touchesRange(o.from,Math.max(o.to,r)))}function sut(t,e){return t.field(ga,!1)?e:e.concat(Rt.appendConfig.of(vut))}const ype=Rt.define(),J4=Rt.define(),xpe=Rt.define(),ga=mi.define({create(){return new fh(gt.none,null,null)},update(t,e){if(e.docChanged&&t.diagnostics.size){let n=t.diagnostics.map(e.changes),r=null,i=t.panel;if(t.selected){let o=e.changes.mapPos(t.selected.from,1);r=mv(n,t.selected.diagnostic,o)||mv(n,null,o)}!n.size&&i&&e.state.facet(m_).autoPanel&&(i=null),t=new fh(n,i,r)}for(let n of e.effects)if(n.is(ype)){let r=e.state.facet(m_).autoPanel?n.value.length?g_.open:null:t.panel;t=fh.init(n.value,r,e.state)}else n.is(J4)?t=new fh(t.diagnostics,n.value?g_.open:null,t.selected):n.is(xpe)&&(t=new fh(t.diagnostics,t.panel,n.value));return t},provide:t=>[s_.from(t,e=>e.panel),rt.decorations.from(t,e=>e.diagnostics)]}),lut=gt.mark({class:"cm-lintRange cm-lintRange-active"});function cut(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)&&(e_pe(t,n,!1)))}const fut=t=>{let e=t.state.field(ga,!1);(!e||!e.panel)&&t.dispatch({effects:sut(t.state,[J4.of(!0)])});let n=a_(t,g_.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},Lq=t=>{let e=t.state.field(ga,!1);return!e||!e.panel?!1:(t.dispatch({effects:J4.of(!1)}),!0)},dut=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)},hut=[{key:"Mod-Shift-m",run:fut,preventDefault:!0},{key:"F8",run:dut}],m_=ct.define({combine(t){return Object.assign({sources:t.map(e=>e.source).filter(e=>e!=null)},cc(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(e,n)=>e?n?r=>e(r)||n(r):e:n}))}});function bpe(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 _pe(t,e,n){var r;let i=n?bpe(e.actions):[];return zn("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},zn("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):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=mv(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),zn("u",c.slice(u,u+1)),c.slice(u+1)];return zn("button",{type:"button",class:"cm-diagnosticAction",onclick:l,onmousedown:l,"aria-label":` Action: ${c}${u<0?"":` (access key "${i[a]})"`}.`},f)}),e.source&&zn("div",{class:"cm-diagnosticSource"},e.source))}class put extends uc{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return zn("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class Nq{constructor(e,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=_pe(e,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class g_{constructor(e){this.view=e,this.items=[];let n=i=>{if(i.keyCode==27)Lq(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=bpe(o.actions);for(let s=0;s{for(let o=0;oLq(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=mv(n.diagnostics,this.items[e].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:xpe.of(r)})}static open(e){return new g_(e)}}function mut(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(t)}')`}function dO(t){return mut(``,'width="6" height="3"')}const gut=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:dO("#d11")},".cm-lintRange-warning":{backgroundImage:dO("orange")},".cm-lintRange-info":{backgroundImage:dO("#999")},".cm-lintRange-hint":{backgroundImage:dO("#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}}}),vut=[ga,rt.decorations.compute([ga],t=>{let{selected:e,panel:n}=t.field(ga);return!e||!n||e.from==e.to?gt.none:gt.set([lut.range(e.from,e.to)])}),rat(cut,{hideOn:aut}),gut];var $q=function(e){e===void 0&&(e={});var n=[];e.closeBracketsKeymap!==!1&&(n=n.concat(Kct)),e.defaultKeymap!==!1&&(n=n.concat(Ilt)),e.searchKeymap!==!1&&(n=n.concat(oct)),e.historyKeymap!==!1&&(n=n.concat(zst)),e.foldKeymap!==!1&&(n=n.concat(tst)),e.completionKeymap!==!1&&(n=n.concat(vpe)),e.lintKeymap!==!1&&(n=n.concat(hut));var r=[];return e.lineNumbers!==!1&&r.push(pat()),e.highlightActiveLineGutter!==!1&&r.push(vat()),e.highlightSpecialChars!==!1&&r.push(Rot()),e.history!==!1&&r.push(Rst()),e.foldGutter!==!1&&r.push(ost()),e.drawSelection!==!1&&r.push(_ot()),e.dropCursor!==!1&&r.push(Tot()),e.allowMultipleSelections!==!1&&r.push(en.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&r.push(Hat()),e.syntaxHighlighting!==!1&&r.push(dhe(cst,{fallback:!0})),e.bracketMatching!==!1&&r.push(gst()),e.closeBrackets!==!1&&r.push(qct()),e.autocompletion!==!1&&r.push(gpe()),e.rectangularSelection!==!1&&r.push(Hot()),e.crosshairCursor!==!1&&r.push(Qot()),e.highlightActiveLine!==!1&&r.push(Fot()),e.highlightSelectionMatches!==!1&&r.push(Blt()),e.tabSize&&typeof e.tabSize=="number"&&r.push(xw.of(" ".repeat(e.tabSize))),r.concat([vw.of(n.flat())]).filter(Boolean)};const yut="#e5c07b",Fq="#e06c75",xut="#56b6c2",but="#ffffff",HC="#abb2bf",YN="#7d8799",_ut="#61afef",wut="#98c379",jq="#d19a66",Sut="#c678dd",Out="#21252b",Bq="#2c313a",zq="#282c34",iI="#353a42",Cut="#3E4451",Uq="#528bff",Tut=rt.theme({"&":{color:HC,backgroundColor:zq},".cm-content":{caretColor:Uq},".cm-cursor, .cm-dropCursor":{borderLeftColor:Uq},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Cut},".cm-panels":{backgroundColor:Out,color:HC},".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:zq,color:YN,border:"none"},".cm-activeLineGutter":{backgroundColor:Bq},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:iI},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:iI,borderBottomColor:iI},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Bq,color:HC}}},{dark:!0}),Eut=_w.define([{tag:Ce.keyword,color:Sut},{tag:[Ce.name,Ce.deleted,Ce.character,Ce.propertyName,Ce.macroName],color:Fq},{tag:[Ce.function(Ce.variableName),Ce.labelName],color:_ut},{tag:[Ce.color,Ce.constant(Ce.name),Ce.standard(Ce.name)],color:jq},{tag:[Ce.definition(Ce.name),Ce.separator],color:HC},{tag:[Ce.typeName,Ce.className,Ce.number,Ce.changed,Ce.annotation,Ce.modifier,Ce.self,Ce.namespace],color:yut},{tag:[Ce.operator,Ce.operatorKeyword,Ce.url,Ce.escape,Ce.regexp,Ce.link,Ce.special(Ce.string)],color:xut},{tag:[Ce.meta,Ce.comment],color:YN},{tag:Ce.strong,fontWeight:"bold"},{tag:Ce.emphasis,fontStyle:"italic"},{tag:Ce.strikethrough,textDecoration:"line-through"},{tag:Ce.link,color:YN,textDecoration:"underline"},{tag:Ce.heading,fontWeight:"bold",color:Fq},{tag:[Ce.atom,Ce.bool,Ce.special(Ce.variableName)],color:jq},{tag:[Ce.processingInstruction,Ce.string,Ce.inserted],color:wut},{tag:Ce.invalid,color:but}]),Put=[Tut,dhe(Eut)];var Mut=rt.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),kut=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(vw.of([Dlt])),s&&(typeof s=="boolean"?l.unshift($q()):l.unshift($q(s))),a&&l.unshift(Uot(a)),o){case"light":l.push(Mut);break;case"dark":l.push(Put);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]},Aut=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)}),Wq=lc.define(),Rut=[];function Iut(t){var{value:e,selection:n,onChange:r,onStatistics:i,onCreateEditor:o,onUpdate:a,extensions:s=Rut,autoFocus:l,theme:c="light",height:u="",minHeight:f="",maxHeight:d="",placeholder:h="",width:p="",minWidth:m="",maxWidth: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:p,minWidth:m,maxWidth:g},"& .cm-scroller":{height:"100% !important"}}),T=rt.updateListener.of(B=>{if(B.docChanged&&typeof r=="function"&&!B.transactions.some($=>$.annotation(Wq))){var U=B.state.doc,W=U.toString();r(W,B)}i&&i(Aut(B))}),L=kut({theme:c,editable:v,readOnly:y,placeholder:h,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},U=S?en.fromJSON(S.json,B,S.fields):en.create(B);if(P(U),!E){var W=new rt({state:U,parent:O,root:_});k(W),o&&o(W,U)}}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:Rt.reconfigure.of(z)})},[c,s,u,f,d,p,m,g,h,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:[Wq.of(!0)]})}},[e,E]),{state:I,setState:P,view:E,setView:k,container:O,setContainer:C}}var Dut=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],ik=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,Dut),k=M.useRef(null),{state:I,view:P,container:R}=Iut({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))});ik.displayName="CodeMirror";var Vq={};let Lut=class KN{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 KN(e,[],n,r,r,0,[],0,i?new Gq(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=this.reducePos=2e3&&!(!((n=this.p.parser.nodeSet.types[i])===null||n===void 0)&&n.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSizel;)this.stack.pop();this.reduceContext(i,c)}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){let s=!1;for(let l=a;l>0&&this.buffer[l-2]>r;l-=4)if(this.buffer[l-1]>=0){s=!0;break}if(s)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 KN(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 Nut(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 Gq{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class Nut{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 LE{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 LE(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 LE(this.stack,this.pos,this.index)}}function hO(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 qC{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Hq=new qC;class $ut{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Hq,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=Hq,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 Lg{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:r}=n.p;Fut(this.data,e,n,this.id,r.data,r.tokenPrecTable)}}Lg.prototype.contextual=Lg.prototype.fallback=Lg.prototype.extend=!1;Lg.prototype.fallback=Lg.prototype.extend=!1;class ok{constructor(e,n={}){this.token=e,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function Fut(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||jut(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 qq(t,e,n){for(let r=e,i;(i=t[r])!=65535;r++)if(i==n)return r-e;return-1}function jut(t,e,n,r){let i=qq(n,r,e);return i<0||qq(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 But{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?Xq(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Xq(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 Wr){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 zut{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new qC)}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 qC,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 qC,{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 But(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&&Gut(i);if(a)return Ko&&console.log("Finish with "+this.stackID(a)),this.stackToTree(a);if(this.parser.strict)throw Ko&&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 Ko&&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(Vt.contextHash)||0)==u))return e.useNode(f,d),Ko&&console.log(a+this.stackID(e)+` (via reuse of ${o.getName(f.type.id)})`),!0;if(!(f instanceof Wr)||f.children.length==0||f.positions[0]>0)break;let h=f.children[0];if(h instanceof Wr&&f.positions[0]==0)f=h;else break}}let s=o.stateSlot(e.state,4);if(s>0)return e.reduce(s),Ko&&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 Qq(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(),Ko&&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&&(Ko&&console.log(d+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,r));h++)Ko&&(d=this.stackID(f)+" -> ");for(let h of s.recoverByInsert(l))Ko&&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),Ko&&console.log(u+this.stackID(s)+` (via recover-delete ${this.parser.getName(l)})`),Qq(s,r)):(!i||i.scoret;class Vut{constructor(e){this.start=e.start,this.shift=e.shift||aI,this.reduce=e.reduce||aI,this.reuse=e.reuse||aI,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class v_ extends Yde{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 A4(n.map((s,l)=>Vo.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=Hde;let a=hO(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 Lg(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 Uut(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=$c(this.data,o+2);else break;i=n($c(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=$c(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(v_.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]=Yq(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 Hut=L4({String:Ce.string,Number:Ce.number,"True False":Ce.bool,PropertyName:Ce.propertyName,Null:Ce.null,",":Ce.separator,"[ ]":Ce.squareBracket,"{ }":Ce.brace}),qut=v_.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:[Hut],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}),Xut=c_.define({name:"json",parser:qut.configure({props:[$4.add({Object:uq({except:/^\s*\}/}),Array:uq({except:/^\s*\]/})}),j4.add({"Object Array":rhe})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function wpe(){return new ehe(Xut)}const Qut=1,Spe=194,Ope=195,Yut=196,Kq=197,Kut=198,Zut=199,Jut=200,eft=2,Cpe=3,Zq=201,tft=24,nft=25,rft=49,ift=50,oft=55,aft=56,sft=57,lft=59,cft=60,uft=61,fft=62,dft=63,hft=65,pft=238,mft=71,gft=241,vft=242,yft=243,xft=244,bft=245,_ft=246,wft=247,Sft=248,Tpe=72,Oft=249,Cft=250,Tft=251,Eft=252,Pft=253,Mft=254,kft=255,Aft=256,Rft=73,Ift=77,Dft=263,Lft=112,Nft=130,$ft=151,Fft=152,jft=155,dp=10,y_=13,eU=32,ak=9,tU=35,Bft=40,zft=46,ZN=123,Jq=125,Epe=39,Ppe=34,Uft=92,Wft=111,Vft=120,Gft=78,Hft=117,qft=85,Xft=new Set([nft,rft,ift,Dft,hft,Nft,aft,sft,pft,fft,dft,Tpe,Rft,Ift,cft,uft,$ft,Fft,jft,Lft]);function sI(t){return t==dp||t==y_}function lI(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}const Qft=new ok((t,e)=>{let n;if(t.next<0)t.acceptToken(Zut);else if(e.context.flags&XC)sI(t.next)&&t.acceptToken(Kut,1);else if(((n=t.peek(-1))<0||sI(n))&&e.canShift(Kq)){let r=0;for(;t.next==eU||t.next==ak;)t.advance(),r++;(t.next==dp||t.next==y_||t.next==tU)&&t.acceptToken(Kq,-r)}else sI(t.next)&&t.acceptToken(Yut,1)},{contextual:!0}),Yft=new ok((t,e)=>{let n=e.context;if(n.flags)return;let r=t.peek(-1);if(r==dp||r==y_){let i=0,o=0;for(;;){if(t.next==eU)i++;else if(t.next==ak)i+=8-i%8;else break;t.advance(),o++}i!=n.indent&&t.next!=dp&&t.next!=y_&&t.next!=tU&&(i[t,e|Mpe])),Jft=new Vut({start:Kft,reduce(t,e,n,r){return t.flags&XC&&Xft.has(e)||(e==mft||e==Tpe)&&t.flags&Mpe?t.parent:t},shift(t,e,n,r){return e==Spe?new QC(t,Zft(r.read(r.pos,n.pos)),0):e==Ope?t.parent:e==tft||e==oft||e==lft||e==Cpe?new QC(t,0,XC):eX.has(e)?new QC(t,0,eX.get(e)|t.flags&XC):t},hash(t){return t.hash}}),edt=new ok(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==eU||n==ak)){n!=Bft&&n!=zft&&n!=dp&&n!=y_&&n!=tU&&t.acceptToken(Qut);return}}}),tdt=new ok((t,e)=>{let{flags:n}=e.context,r=n&Ec?Ppe:Epe,i=(n&Pc)>0,o=!(n&Mc),a=(n&kc)>0,s=t.pos;for(;!(t.next<0);)if(a&&t.next==ZN)if(t.peek(1)==ZN)t.advance(2);else{if(t.pos==s){t.acceptToken(Cpe,1);return}break}else if(o&&t.next==Uft){if(t.pos==s){t.advance();let l=t.next;l>=0&&(t.advance(),ndt(t,l)),t.acceptToken(eft);return}break}else if(t.next==r&&(!i||t.peek(1)==r&&t.peek(2)==r)){if(t.pos==s){t.acceptToken(Zq,i?3:1);return}break}else if(t.next==dp){if(i)t.advance();else if(t.pos==s){t.acceptToken(Zq);return}break}else t.advance();t.pos>s&&t.acceptToken(Jut)});function ndt(t,e){if(e==Wft)for(let n=0;n<2&&t.next>=48&&t.next<=55;n++)t.advance();else if(e==Vft)for(let n=0;n<2&&lI(t.next);n++)t.advance();else if(e==Hft)for(let n=0;n<4&&lI(t.next);n++)t.advance();else if(e==qft)for(let n=0;n<8&&lI(t.next);n++)t.advance();else if(e==Gft&&t.next==ZN){for(t.advance();t.next>=0&&t.next!=Jq&&t.next!=Epe&&t.next!=Ppe&&t.next!=dp;)t.advance();t.next==Jq&&t.advance()}}const rdt=L4({'async "*" "**" FormatConversion FormatSpec':Ce.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":Ce.controlKeyword,"in not and or is del":Ce.operatorKeyword,"from def class global nonlocal lambda":Ce.definitionKeyword,import:Ce.moduleKeyword,"with as print":Ce.keyword,Boolean:Ce.bool,None:Ce.null,VariableName:Ce.variableName,"CallExpression/VariableName":Ce.function(Ce.variableName),"FunctionDefinition/VariableName":Ce.function(Ce.definition(Ce.variableName)),"ClassDefinition/VariableName":Ce.definition(Ce.className),PropertyName:Ce.propertyName,"CallExpression/MemberExpression/PropertyName":Ce.function(Ce.propertyName),Comment:Ce.lineComment,Number:Ce.number,String:Ce.string,FormatString:Ce.special(Ce.string),Escape:Ce.escape,UpdateOp:Ce.updateOperator,"ArithOp!":Ce.arithmeticOperator,BitOp:Ce.bitwiseOperator,CompareOp:Ce.compareOperator,AssignOp:Ce.definitionOperator,Ellipsis:Ce.punctuation,At:Ce.meta,"( )":Ce.paren,"[ ]":Ce.squareBracket,"{ }":Ce.brace,".":Ce.derefOperator,", ;":Ce.separator}),idt={__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},odt=v_.deserialize({version:14,states:"##jO`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'#EdO3rQdO'#EfO3zQtO'#EfO1XQdO'#EiO0rQdO'#ElO1XQdO'#EnO0rQdO'#EtO0rQdO'#EwO4VQdO'#EyO4^QdO'#FOO4iQdO'#EzO0rQdO'#FOO1XQdO'#FQO1XQdO'#FVO4nQdO'#F[P4uOdO'#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,59OO5QQdO'#DoOOQS,5:Y,5:YO5eQdO'#HdOOQS,5:],5:]O5rQ!fO,5:]O5wQtO,59YO1lQdO,59bO1lQdO,59bO1lQdO,59bO8gQdO,59bO8lQdO,59bO8sQdO,59jO8zQdO'#HTO:QQdO'#HSOOQS'#HS'#HSOOQS'#D['#D[O:iQdO,59aO'vQdO,59aO:wQdO,59aOOQS,59y,59yO:|QdO,5:RO'vQdO,5:ROOQS,5:Q,5:QO;[QdO,5:QO;aQdO,5:XO'vQdO,5:XO'vQdO,5:VOOQS,5:U,5:UO;rQdO,5:UO;wQdO,5:WOOOW'#Fy'#FyO;|OWO,5:aOOQS,5:a,5:aOOOOQS'#Ds'#DsOOQS1G/w1G/wOOQS1G.|1G.|O!/RQtO1G.|O!/YQtO1G.|O1lQdO1G.|O!/uQdO1G/UOOQS'#DZ'#DZO0rQdO,59tOOQS1G.{1G.{O!/|QdO1G/eO!0^QdO1G/eO!0fQdO1G/fO'vQdO'#H[O!0kQdO'#H[O!0pQtO1G.{O!1QQdO,59iO!2WQdO,5=zO!2hQdO,5=zO!2pQdO1G/mO!2uQtO1G/mOOQS1G/l1G/lO!3VQdO,5=uO!3|QdO,5=uO0rQdO1G/qO!4kQdO1G/sO!4pQtO1G/sO!5QQtO1G/qOOQS1G/p1G/pOOQS1G/r1G/rOOOW-E9w-E9wOOQS1G/{1G/{O!5bQdO'#HxO0rQdO'#HxO!5sQdO,5>cOOOW-E9x-E9xOOQS1G/|1G/|OOQS-E9{-E9{O!6RQ#xO1G2zO!6rQtO1G2zO'vQdO,5kOOQS1G1`1G1`O!7xQdO1G1`OOQS'#DV'#DVO0rQdO,5=qOOQS,5=q,5=qO!7}QdO'#FrO!8YQdO,59oO!8bQdO1G/XO!8lQtO,5=uOOQS1G3`1G3`OOQS,5:m,5:mO!9]QdO'#GtOOQS,5jO!;QQdO,5>jO1XQdO,5>jO!;cQdO,5>iOOQS-E:R-E:RO!;hQdO1G0lO!;sQdO1G0lO!;xQdO,5>lO!lO!hO!<|QdO,5>hO!=_QdO'#EpO0rQdO1G0tO!=jQdO1G0tO!=oQgO1G0zO!AmQgO1G0}O!EhQdO,5>oO!ErQdO,5>oO!EzQtO,5>oO0rQdO1G1PO!FUQdO1G1PO4iQdO1G1UO!!sQdO1G1WOOQV,5;a,5;aO!FZQfO,5;aO!F`QgO1G1QO!JaQdO'#GZO4iQdO1G1QO4iQdO1G1QO!JqQdO,5>pO!KOQdO,5>pO1XQdO,5>pOOQV1G1U1G1UO!KWQdO'#FSO!KiQ!fO1G1WO!KqQdO1G1WOOQV1G1]1G1]O4iQdO1G1]O!KvQdO1G1]O!LOQdO'#F^OOQV1G1b1G1bO!#WQtO1G1bPOOO1G2v1G2vP!LTOSO1G2vOOQS,5=},5=}OOQS'#Dp'#DpO0rQdO,5=}O!LYQdO,5=|O!LmQdO,5=|OOQS1G/u1G/uO!LuQdO,5>PO!MVQdO,5>PO!M_QdO,5>PO!MrQdO,5>PO!NSQdO,5>POOQS1G3j1G3jOOQS7+$h7+$hO!8bQdO7+$pO# uQdO1G.|O# |QdO1G.|OOQS1G/`1G/`OOQS,5<`,5<`O'vQdO,5<`OOQS7+%P7+%PO#!TQdO7+%POOQS-E9r-E9rOOQS7+%Q7+%QO#!eQdO,5=vO'vQdO,5=vOOQS7+$g7+$gO#!jQdO7+%PO#!rQdO7+%QO#!wQdO1G3fOOQS7+%X7+%XO##XQdO1G3fO##aQdO7+%XOOQS,5<_,5<_O'vQdO,5<_O##fQdO1G3aOOQS-E9q-E9qO#$]QdO7+%]OOQS7+%_7+%_O#$kQdO1G3aO#%YQdO7+%_O#%_QdO1G3gO#%oQdO1G3gO#%wQdO7+%]O#%|QdO,5>dO#&gQdO,5>dO#&gQdO,5>dOOQS'#Dx'#DxO#&xO&jO'#DzO#'TO`O'#HyOOOW1G3}1G3}O#'YQdO1G3}O#'bQdO1G3}O#'mQ#xO7+(fO#(^QtO1G2UP#(wQdO'#GOOOQS,5bQdO,5gQdO1G4OOOQS-E9y-E9yO#?QQdO1G4OOe,5>eOOOW7+)i7+)iO#?nQdO7+)iO#?vQdO1G2zO#@aQdO1G2zP'vQdO'#FuO0rQdO<mO#AtQdO,5>mOOQS1G0v1G0vOOQS<rO#KZQdO,5>rOOQS,5>r,5>rO#KfQdO,5>qO#KwQdO,5>qOOQS1G1Y1G1YOOQS,5;p,5;pOOQV<VAN>VO$ WQdO<cAN>cO0rQdO1G1|O$ hQtO1G1|P$ rQdO'#FvOOQS1G2R1G2RP$!PQdO'#F{O$!^QdO7+)jO$!wQdO,5>gOOOO-E9z-E9zOOOW<tO$4dQdO,5>tO1XQdO,5vO$)VQdO,5>vOOQS1G1p1G1pO$8[QtO,5<[OOQU7+'P7+'PO$+cQdO1G/iO$)VQdO,5wO$8jQdO,5>wOOQS1G1s1G1sOOQS7+'S7+'SP$)VQdO'#GdO$8rQdO1G4bO$8|QdO1G4bO$9UQdO1G4bOOQS7+%T7+%TO$9dQdO1G1tO$9rQtO'#FaO$9yQdO,5<}OOQS,5<},5<}O$:XQdO1G4cOOQS-E:a-E:aO$)VQdO,5<|O$:`QdO,5<|O$:eQdO7+)|OOQS-E:`-E:`O$:oQdO7+)|O$)VQdO,5m>pPP'Z'ZPP?PPP'Z'ZPP'Z'Z'Z'Z'Z?T?}'ZP@QP@WD_G{HPPHSH^Hb'ZPPPHeHn'RP'R'RP'RP'RP'RP'RP'R'R'RP'RPP'RPP'RP'RPHtIQIYPIaIgPIaPIaIaPPPIaPKuPLOLYL`KuPIaLiPIaPLpLvPLzM`M}NhLzLzNnN{LzLzLzLz! a! g! j! o! r! |!!S!!`!!r!!x!#S!#Y!#v!#|!$S!$^!$d!$j!$|!%W!%^!%d!%n!%t!%z!&Q!&W!&^!&h!&n!&x!'O!'X!'_!'n!'v!(Q!(XPPPPPPPPPPP!(_!(b!(h!(q!({!)WPPPPPPPPPPPP!-z!/`!3`!6pPP!6x!7X!7b!8Z!8Q!8d!8j!8m!8p!8s!8{!9lPPPPPPPPPPPPPPPPP!9o!9s!9yP!:_!:c!:o!:x!;U!;l!;o!;r!;x!_![!]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:[edt,Yft,Qft,tdt,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:t=>idt[t]||-1}],tokenPrec:7652}),tX=new Oat,kpe=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function pO(t){return(e,n,r)=>{if(r)return!1;let i=e.node.getChild("VariableName");return i&&n(i,t),!0}}const adt={FunctionDefinition:pO("function"),ClassDefinition:pO("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:pO("variable"),AsPattern:pO("variable"),__proto__:null};function Ape(t,e){let n=tX.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(Jr.IncludeAnonymous).iterate(a=>{if(a.name){let s=adt[a.name];if(s&&s(a,o,i)||!i&&kpe.has(a.name))return!1;i=!1}else if(a.to-a.from>8192){for(let s of Ape(t,a.node))r.push(s);return!1}}),tX.set(e,r),r}const nX=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,Rpe=["String","FormatString","Comment","PropertyName"];function sdt(t){let e=fi(t.state).resolveInner(t.pos,-1);if(Rpe.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&nX.test(t.state.sliceDoc(e.from,e.to));if(!n&&!t.explicit)return null;let r=[];for(let i=e;i;i=i.parent)kpe.has(i.name)&&(r=r.concat(Ape(t.state.doc,i)));return{options:r,from:n?e.from:t.pos,validFor:nX}}const ldt=["__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"}))),cdt=[yc("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),yc("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),yc("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),yc("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),yc(`if \${}: -`,{label:"if",detail:"block",type:"keyword"}),yc("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),yc("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),yc("import ${module}",{label:"import",detail:"statement",type:"keyword"}),yc("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],ddt=dct(Ipe,ape(udt.concat(fdt)));function oX(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 uI=u_.define({name:"python",parser:sdt.configure({props:[F4.add({Body:t=>{var e;return(e=oX(t,t.node))!==null&&e!==void 0?e:t.continue()},IfStatement:t=>/^\s*(else:|elif )/.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":YR({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":YR({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":YR({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=oX(t,e);if(n!=null)return n}}return t.continue()}}),B4.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":ihe,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 hdt(){return new the(uI,[uI.data.of({autocomplete:cdt}),uI.data.of({autocomplete:ddt})])}const pdt=""+new URL("python-bw-BV0FRHt1.png",import.meta.url).href,gv={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"}},mdt=({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(gdt,{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(vdt,{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(ydt,{isIn:v,viewMode:m,setViewMode:g,placeInfo:a})}return w.jsxs(Ure,{sx:gv.card,children:[w.jsx(Wre,{disableSpacing:!0,children:w.jsxs(iy,{size:"small",value:t,onChange:u,children:[w.jsx(Pn,{value:"dataset",disabled:i===null,size:"small",sx:ko.toggleButton,children:w.jsx(_t,{arrow:!0,title:fe.get("Dataset information"),children:w.jsx(xfe,{})})},0),w.jsx(Pn,{value:"variable",disabled:o===null,size:"small",sx:ko.toggleButton,children:w.jsx(_t,{arrow:!0,title:fe.get("Variable information"),children:w.jsx(l4,{})})},1),w.jsx(Pn,{value:"place",disabled:a===null,size:"small",sx:ko.toggleButton,children:w.jsx(_t,{arrow:!0,title:fe.get("Place information"),children:w.jsx(vfe,{})})},2)]},0)}),f,d,h]})},gdt=({isIn:t,viewMode:e,setViewMode:n,dataset:r,serverConfig:i,hasPython:o})=>{let a;if(e==="code"){const s=r.dimensions.map(c=>e$(c,["name","size","dtype"])),l=e$(r,["id","title","bbox","attrs"]);l.dimensions=s,a=w.jsx(iU,{code:JSON.stringify(l,null,2)})}else if(e==="list")a=w.jsx(tu,{children:w.jsx(b_,{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(tu,{children:w.jsx(b_,{data:s})})}else e==="python"&&(a=w.jsx(Lpe,{code:xdt(i,r)}));return w.jsx(rU,{title:r.title||"?",subheader:r.title&&`ID: ${r.id}`,isIn:t,viewMode:e,setViewMode:n,hasPython:o,children:a})},vdt=({isIn:t,viewMode:e,setViewMode:n,variable:r,time:i,serverConfig:o,hasPython:a})=>{let s,l;if(e==="code"){const c=e$(r,["id","name","title","units","expression","shape","dtype","shape","timeChunkSize","colorBarMin","colorBarMax","colorBarName","attrs"]);s=w.jsx(iU,{code:JSON.stringify(c,null,2)})}else if(e==="list"){if(s=w.jsx(tu,{children:w.jsx(b_,{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(tu,{children:w.jsx(Ho,{ref:c,sx:gv.variableHtmlReprContainer})})}}else if(e==="text"){let c=[[fe.get("Name"),r.name],[fe.get("Title"),r.title],[fe.get("Units"),r.units]];V1(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(tu,{children:w.jsx(b_,{data:c})})}else e==="python"&&(s=w.jsx(Lpe,{code:bdt(o,r,i)}));return w.jsxs(rU,{title:r.title||r.name,subheader:`${fe.get("Name")}: ${r.name}`,isIn:t,viewMode:e,setViewMode:n,hasPython:a,children:[l,s]})},ydt=({isIn:t,viewMode:e,setViewMode:n,placeInfo:r})=>{const i=r.place;let o,a,s;if(e==="code")o=w.jsx(iU,{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(tu,{children:w.jsx(b_,{data:l})})}else o=w.jsx(tu,{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(RMe,{sx:gv.media,image:r.image,title:r.label})),r.description&&(s=w.jsx(tu,{children:w.jsx(At,{children:r.description})}));return w.jsxs(rU,{title:r.label,subheader:`${fe.get("Geometry type")}: ${fe.get(i.geometry.type)}`,isIn:t,viewMode:e,setViewMode:n,children:[a,s,o]})},rU=({isIn:t,title:e,subheader:n,viewMode:r,setViewMode:i,hasPython:o,children:a})=>{const s=(l,c)=>{i(c)};return w.jsxs(d5,{in:t,timeout:"auto",unmountOnExit:!0,children:[w.jsx(CMe,{title:e,subheader:n,titleTypographyProps:{fontSize:"1.1em"},action:w.jsxs(iy,{size:"small",value:r,exclusive:!0,onChange:s,children:[w.jsx(Pn,{value:"text",size:"small",sx:ko.toggleButton,children:w.jsx(yfe,{})},0),w.jsx(Pn,{value:"list",size:"small",sx:ko.toggleButton,children:w.jsx(gfe,{})},1),w.jsx(Pn,{value:"code",size:"small",sx:ko.toggleButton,children:w.jsx(mfe,{})},2),o&&w.jsx(Pn,{value:"python",size:"small",sx:{...ko.toggleButton,width:"30px"},children:w.jsx("img",{src:pdt,width:16,alt:"python logo"})},3)]},0)}),a]})},b_=({data:t})=>w.jsx(lie,{component:Ho,sx:gv.keyValueTableContainer,children:w.jsx(M5,{sx:gv.table,size:"small",children:w.jsx(k5,{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(nAe,{href:i,target:"_blank",rel:"noreferrer",children:i}):Array.isArray(i)&&(o="["+i.map(a=>a+"").join(", ")+"]"),w.jsxs(vl,{children:[w.jsx(sr,{children:r}),w.jsx(sr,{align:"right",children:o})]},n)})})})}),tu=({children:t})=>w.jsx(Vre,{sx:gv.cardContent,children:t}),Dpe=({code:t,extension:e})=>w.jsx(tu,{children:w.jsx(ik,{theme:Kt.instance.branding.themeName||"light",height:"320px",extensions:[e],value:t,readOnly:!0})}),iU=({code:t})=>w.jsx(Dpe,{code:t,extension:Spe()}),Lpe=({code:t})=>w.jsx(Dpe,{code:t,extension:hdt()});function e$(t,e){const n={};for(const r of e)r in t&&(n[r]=t[r]);return n}function xdt(t,e){const n=_dt(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 bdt(t,e,n){const r=e.name,i=e.colorBarMin,o=e.colorBarMax,a=e.colorBarName;let s="";n!==null&&(s=`sel(time="${gy(n)}", method="nearest")`);const l=[];if(V1(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 _dt(t){return wdt(t)[0]+".zarr"}function wdt(t){const e=t.lastIndexOf(".");return e>=0?[t.substring(0,e),t.substring(e)]:[t,""]}const Sdt=t=>({locale:t.controlState.locale,visibleInfoCardElements:_Ve(t),infoCardElementViewModes:wVe(t),selectedDataset:qr(t),selectedVariable:vo(t),selectedPlaceInfo:iw(t),selectedTime:by(t),serverConfig:pi(t),allowViewModePython:!!Kt.instance.branding.allowViewModePython}),Odt={setVisibleInfoCardElements:j8e,updateInfoCardElementViewMode:B8e},Cdt=Jt(Sdt,Odt)(mdt),fI=5,Tdt={container:t=>({marginTop:t.spacing(1),marginLeft:t.spacing(fI),marginRight:t.spacing(fI),width:`calc(100% - ${t.spacing(3*(fI+1))})`,height:"5em",display:"flex",alignItems:"flex-end"})};function Edt({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 gy(u)}const l=Array.isArray(t);l||(t=[Date.now()-2*Rae.years,Date.now()]);const c=[{value:t[0],label:Qb(t[0])},{value:t[1],label:Qb(t[1])}];return w.jsx(Ke,{sx:Tdt.container,children:w.jsx(ry,{disabled:!l,min:t[0],max:t[1],value:r,marks:c,onChange:o,onChangeCommitted:a,size:"small",valueLabelDisplay:"on",valueLabelFormat:s})})}var Pdt=Array.isArray,qo=Pdt,Mdt=typeof Zn=="object"&&Zn&&Zn.Object===Object&&Zn,Npe=Mdt,kdt=Npe,Adt=typeof self=="object"&&self&&self.Object===Object&&self,Rdt=kdt||Adt||Function("return this")(),dc=Rdt,Idt=dc,Ddt=Idt.Symbol,Cw=Ddt,aX=Cw,$pe=Object.prototype,Ldt=$pe.hasOwnProperty,Ndt=$pe.toString,$0=aX?aX.toStringTag:void 0;function $dt(t){var e=Ldt.call(t,$0),n=t[$0];try{t[$0]=void 0;var r=!0}catch{}var i=Ndt.call(t);return r&&(e?t[$0]=n:delete t[$0]),i}var Fdt=$dt,jdt=Object.prototype,Bdt=jdt.toString;function zdt(t){return Bdt.call(t)}var Udt=zdt,sX=Cw,Wdt=Fdt,Vdt=Udt,Gdt="[object Null]",Hdt="[object Undefined]",lX=sX?sX.toStringTag:void 0;function qdt(t){return t==null?t===void 0?Hdt:Gdt:lX&&lX in Object(t)?Wdt(t):Vdt(t)}var Ou=qdt;function Xdt(t){return t!=null&&typeof t=="object"}var Cu=Xdt,Qdt=Ou,Ydt=Cu,Kdt="[object Symbol]";function Zdt(t){return typeof t=="symbol"||Ydt(t)&&Qdt(t)==Kdt}var Iy=Zdt,Jdt=qo,eht=Iy,tht=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nht=/^\w*$/;function rht(t,e){if(Jdt(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||eht(t)?!0:nht.test(t)||!tht.test(t)||e!=null&&t in Object(e)}var oU=rht;function iht(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Md=iht;const Dy=$t(Md);var oht=Ou,aht=Md,sht="[object AsyncFunction]",lht="[object Function]",cht="[object GeneratorFunction]",uht="[object Proxy]";function fht(t){if(!aht(t))return!1;var e=oht(t);return e==lht||e==cht||e==sht||e==uht}var aU=fht;const Bt=$t(aU);var dht=dc,hht=dht["__core-js_shared__"],pht=hht,dI=pht,cX=function(){var t=/[^.]+$/.exec(dI&&dI.keys&&dI.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function mht(t){return!!cX&&cX in t}var ght=mht,vht=Function.prototype,yht=vht.toString;function xht(t){if(t!=null){try{return yht.call(t)}catch{}try{return t+""}catch{}}return""}var Fpe=xht,bht=aU,_ht=ght,wht=Md,Sht=Fpe,Oht=/[\\^$.*+?()[\]{}|]/g,Cht=/^\[object .+?Constructor\]$/,Tht=Function.prototype,Eht=Object.prototype,Pht=Tht.toString,Mht=Eht.hasOwnProperty,kht=RegExp("^"+Pht.call(Mht).replace(Oht,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Aht(t){if(!wht(t)||_ht(t))return!1;var e=bht(t)?kht:Cht;return e.test(Sht(t))}var Rht=Aht;function Iht(t,e){return t==null?void 0:t[e]}var Dht=Iht,Lht=Rht,Nht=Dht;function $ht(t,e){var n=Nht(t,e);return Lht(n)?n:void 0}var jp=$ht,Fht=jp,jht=Fht(Object,"create"),sk=jht,uX=sk;function Bht(){this.__data__=uX?uX(null):{},this.size=0}var zht=Bht;function Uht(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Wht=Uht,Vht=sk,Ght="__lodash_hash_undefined__",Hht=Object.prototype,qht=Hht.hasOwnProperty;function Xht(t){var e=this.__data__;if(Vht){var n=e[t];return n===Ght?void 0:n}return qht.call(e,t)?e[t]:void 0}var Qht=Xht,Yht=sk,Kht=Object.prototype,Zht=Kht.hasOwnProperty;function Jht(t){var e=this.__data__;return Yht?e[t]!==void 0:Zht.call(e,t)}var ept=Jht,tpt=sk,npt="__lodash_hash_undefined__";function rpt(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=tpt&&e===void 0?npt:e,this}var ipt=rpt,opt=zht,apt=Wht,spt=Qht,lpt=ept,cpt=ipt;function Ly(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e-1}var Tpt=Cpt,Ept=lk;function Ppt(t,e){var n=this.__data__,r=Ept(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var Mpt=Ppt,kpt=dpt,Apt=bpt,Rpt=Spt,Ipt=Tpt,Dpt=Mpt;function Ny(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e0?1:-1},Ch=function(e){return Tw(e)&&e.indexOf("%")===e.length-1},Ye=function(e){return Jmt(e)&&!Fy(e)},ti=function(e){return Ye(e)||Tw(e)},rgt=0,jy=function(e){var n=++rgt;return"".concat(e||"").concat(n)},hp=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)&&!Tw(e))return r;var o;if(Ch(e)){var a=e.indexOf("%");o=n*parseFloat(e.slice(0,a))/100}else o=+e;return Fy(o)&&(o=r),i&&o>n&&(o=n),o},gf=function(e){if(!e)return null;var n=Object.keys(e);return n&&n.length?e[n[0]]:null},igt=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 ugt(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 n$(t){"@babel/helpers - typeof";return n$=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},n$(t)}var vX={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"},nu=function(e){return typeof e=="string"?e:e?e.displayName||e.name||"Component":""},yX=null,pI=null,pU=function t(e){if(e===yX&&Array.isArray(pI))return pI;var n=[];return M.Children.forEach(e,function(r){Wt(r)||(_T.isFragment(r)?n=n.concat(t(r.props.children)):n.push(r))}),pI=n,yX=e,n};function os(t,e){var n=[],r=[];return Array.isArray(e)?r=e.map(function(i){return nu(i)}):r=[nu(e)],pU(t).forEach(function(i){var o=is(i,"type.displayName")||is(i,"type.name");r.indexOf(o)!==-1&&n.push(i)}),n}function ca(t,e){var n=os(t,e);return n&&n[0]}var xX=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)},fgt=["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"],dgt=function(e){return e&&e.type&&Tw(e.type)&&fgt.indexOf(e.type)>=0},Hpe=function(e){return e&&n$(e)==="object"&&"cx"in e&&"cy"in e&&"r"in e},hgt=function(e,n,r,i){var o,a=(o=hI==null?void 0:hI[i])!==null&&o!==void 0?o:[];return!Bt(e)&&(i&&a.includes(n)||agt.includes(n))||r&&hU.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),!Dy(i))return null;var o={};return Object.keys(i).forEach(function(a){var s;hgt((s=i)===null||s===void 0?void 0:s[a],a,n,r)&&(o[a]=i[a])}),o},r$=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 bX(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 ygt(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 o$(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=vgt(t,ggt),u=i||{width:n,height:r,x:0,y:0},f=ke("recharts-surface",o);return ue.createElement("svg",i$({},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 xgt=["children","className"];function a$(){return a$=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 _gt(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 Gn=ue.forwardRef(function(t,e){var n=t.children,r=t.className,i=bgt(t,xgt),o=ke("recharts-layer",r);return ue.createElement("g",a$({className:o},jt(i,!0),{ref:e}),n)}),ru=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:Ogt(t,e,n)}var Tgt=Cgt,Egt="\\ud800-\\udfff",Pgt="\\u0300-\\u036f",Mgt="\\ufe20-\\ufe2f",kgt="\\u20d0-\\u20ff",Agt=Pgt+Mgt+kgt,Rgt="\\ufe0e\\ufe0f",Igt="\\u200d",Dgt=RegExp("["+Igt+Egt+Agt+Rgt+"]");function Lgt(t){return Dgt.test(t)}var qpe=Lgt;function Ngt(t){return t.split("")}var $gt=Ngt,Xpe="\\ud800-\\udfff",Fgt="\\u0300-\\u036f",jgt="\\ufe20-\\ufe2f",Bgt="\\u20d0-\\u20ff",zgt=Fgt+jgt+Bgt,Ugt="\\ufe0e\\ufe0f",Wgt="["+Xpe+"]",s$="["+zgt+"]",l$="\\ud83c[\\udffb-\\udfff]",Vgt="(?:"+s$+"|"+l$+")",Qpe="[^"+Xpe+"]",Ype="(?:\\ud83c[\\udde6-\\uddff]){2}",Kpe="[\\ud800-\\udbff][\\udc00-\\udfff]",Ggt="\\u200d",Zpe=Vgt+"?",Jpe="["+Ugt+"]?",Hgt="(?:"+Ggt+"(?:"+[Qpe,Ype,Kpe].join("|")+")"+Jpe+Zpe+")*",qgt=Jpe+Zpe+Hgt,Xgt="(?:"+[Qpe+s$+"?",s$,Ype,Kpe,Wgt].join("|")+")",Qgt=RegExp(l$+"(?="+l$+")|"+Xgt+qgt,"g");function Ygt(t){return t.match(Qgt)||[]}var Kgt=Ygt,Zgt=$gt,Jgt=qpe,evt=Kgt;function tvt(t){return Jgt(t)?evt(t):Zgt(t)}var nvt=tvt,rvt=Tgt,ivt=qpe,ovt=nvt,avt=Upe;function svt(t){return function(e){e=avt(e);var n=ivt(e)?ovt(e):void 0,r=n?n[0]:e.charAt(0),i=n?rvt(n,1).join(""):e.slice(1);return r[t]()+i}}var lvt=svt,cvt=lvt,uvt=cvt("toUpperCase"),fvt=uvt;const dk=$t(fvt);function Un(t){return function(){return t}}const eme=Math.cos,jE=Math.sin,ol=Math.sqrt,BE=Math.PI,hk=2*BE,c$=Math.PI,u$=2*c$,eh=1e-6,dvt=u$-eh;function tme(t){this._+=t[0];for(let e=1,n=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return tme;const n=10**e;return function(r){this._+=r[0];for(let i=1,o=r.length;ieh)if(!(Math.abs(f*l-c*u)>eh)||!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((c$-Math.acos((m+d-g)/(2*v*y)))/2),b=x/y,_=x/v;Math.abs(b-1)>eh&&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)>eh||Math.abs(this._y1-u)>eh)&&this._append`L${c},${u}`,r&&(d<0&&(d=d%u$+u$),d>dvt?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>eh&&this._append`A${r},${r},0,${+(d>=c$)},${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 mU(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 pvt(e)}function gU(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function nme(t){this._context=t}nme.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 pk(t){return new nme(t)}function rme(t){return t[0]}function ime(t){return t[1]}function ome(t,e){var n=Un(!0),r=null,i=pk,o=null,a=mU(s);t=typeof t=="function"?t:t===void 0?rme:Un(t),e=typeof e=="function"?e:e===void 0?ime:Un(e);function s(l){var c,u=(l=gU(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 ome().defined(i).curve(a).context(o)}return c.x=function(f){return arguments.length?(t=typeof f=="function"?f:Un(+f),r=null,c):t},c.x0=function(f){return arguments.length?(t=typeof f=="function"?f:Un(+f),c):t},c.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Un(+f),c):r},c.y=function(f){return arguments.length?(e=typeof f=="function"?f:Un(+f),n=null,c):e},c.y0=function(f){return arguments.length?(e=typeof f=="function"?f:Un(+f),c):e},c.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Un(+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:Un(!!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 ame{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 mvt(t){return new ame(t,!0)}function gvt(t){return new ame(t,!1)}const vU={draw(t,e){const n=ol(e/BE);t.moveTo(n,0),t.arc(0,0,n,0,hk)}},vvt={draw(t,e){const n=ol(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()}},sme=ol(1/3),yvt=sme*2,xvt={draw(t,e){const n=ol(e/yvt),r=n*sme;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},bvt={draw(t,e){const n=ol(e),r=-n/2;t.rect(r,r,n,n)}},_vt=.8908130915292852,lme=jE(BE/10)/jE(7*BE/10),wvt=jE(hk/10)*lme,Svt=-eme(hk/10)*lme,Ovt={draw(t,e){const n=ol(e*_vt),r=wvt*n,i=Svt*n;t.moveTo(0,-n),t.lineTo(r,i);for(let o=1;o<5;++o){const a=hk*o/5,s=eme(a),l=jE(a);t.lineTo(l*n,-s*n),t.lineTo(s*r-l*i,l*r+s*i)}t.closePath()}},mI=ol(3),Cvt={draw(t,e){const n=-ol(e/(mI*3));t.moveTo(0,n*2),t.lineTo(-mI*n,-n),t.lineTo(mI*n,-n),t.closePath()}},Ia=-.5,Da=ol(3)/2,f$=1/ol(12),Tvt=(f$/2+1)*3,Evt={draw(t,e){const n=ol(e/Tvt),r=n/2,i=n*f$,o=r,a=n*f$+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 Pvt(t,e){let n=null,r=mU(i);t=typeof t=="function"?t:Un(t||vU),e=typeof e=="function"?e:Un(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:Un(o),i):t},i.size=function(o){return arguments.length?(e=typeof o=="function"?o:Un(+o),i):e},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function zE(){}function UE(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 cme(t){this._context=t}cme.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:UE(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:UE(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Mvt(t){return new cme(t)}function ume(t){this._context=t}ume.prototype={areaStart:zE,areaEnd:zE,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:UE(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function kvt(t){return new ume(t)}function fme(t){this._context=t}fme.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:UE(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Avt(t){return new fme(t)}function dme(t){this._context=t}dme.prototype={areaStart:zE,areaEnd:zE,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 Rvt(t){return new dme(t)}function wX(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(wX(o)+wX(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function OX(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function gI(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 WE(t){this._context=t}WE.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:gI(this,this._t0,OX(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,gI(this,OX(this,n=SX(this,t,e)),n);break;default:gI(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 hme(t){this._context=new pme(t)}(hme.prototype=Object.create(WE.prototype)).point=function(t,e){WE.prototype.point.call(this,e,t)};function pme(t){this._context=t}pme.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 Ivt(t){return new WE(t)}function Dvt(t){return new hme(t)}function mme(t){this._context=t}mme.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 Nvt(t){return new mk(t,.5)}function $vt(t){return new mk(t,0)}function Fvt(t){return new mk(t,1)}function vv(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 jvt(t,e){return t[e]}function Bvt(t){const e=[];return e.key=t,e}function zvt(){var t=Un([]),e=d$,n=vv,r=jvt;function i(o){var a=Array.from(t.apply(this,arguments),Bvt),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 Yvt(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 gme={symbolCircle:vU,symbolCross:vvt,symbolDiamond:xvt,symbolSquare:bvt,symbolStar:Ovt,symbolTriangle:Cvt,symbolWye:Evt},Kvt=Math.PI/180,Zvt=function(e){var n="symbol".concat(dk(e));return gme[n]||vU},Jvt=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*Kvt;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}},eyt=function(e,n){gme["symbol".concat(dk(e))]=n},yU=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=Qvt(e,Gvt),c=EX(EX({},l),{},{type:r,size:o,sizeType:s}),u=function(){var g=Zvt(r),v=Pvt().type(g).size(Jvt(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",h$({},p,{className:ke("recharts-symbols",f),transform:"translate(".concat(d,", ").concat(h,")"),d:u()})):null};yU.registerSymbol=eyt;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 p$(){return p$=Object.assign?Object.assign.bind():function(t){for(var e=1;en?null:n+t.unit}const cI=c_.define({name:"python",parser:odt.configure({props:[$4.add({Body:t=>{var e;return(e=rX(t,t.node))!==null&&e!==void 0?e:t.continue()},IfStatement:t=>/^\s*(else:|elif )/.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":QR({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":QR({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":QR({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=rX(t,e);if(n!=null)return n}}return t.continue()}}),j4.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":rhe,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 fdt(){return new ehe(cI,[cI.data.of({autocomplete:sdt}),cI.data.of({autocomplete:udt})])}const ddt=""+new URL("python-bw-BV0FRHt1.png",import.meta.url).href,gv={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"}},hdt=({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(pdt,{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(mdt,{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(gdt,{isIn:v,viewMode:m,setViewMode:g,placeInfo:a})}return w.jsxs(Bre,{sx:gv.card,children:[w.jsx(zre,{disableSpacing:!0,children:w.jsxs(iy,{size:"small",value:t,onChange:u,children:[w.jsx(Pn,{value:"dataset",disabled:i===null,size:"small",sx:ko.toggleButton,children:w.jsx(xt,{arrow:!0,title:fe.get("Dataset information"),children:w.jsx(yfe,{})})},0),w.jsx(Pn,{value:"variable",disabled:o===null,size:"small",sx:ko.toggleButton,children:w.jsx(xt,{arrow:!0,title:fe.get("Variable information"),children:w.jsx(s4,{})})},1),w.jsx(Pn,{value:"place",disabled:a===null,size:"small",sx:ko.toggleButton,children:w.jsx(xt,{arrow:!0,title:fe.get("Place information"),children:w.jsx(gfe,{})})},2)]},0)}),f,d,h]})},pdt=({isIn:t,viewMode:e,setViewMode:n,dataset:r,serverConfig:i,hasPython:o})=>{let a;if(e==="code"){const s=r.dimensions.map(c=>JN(c,["name","size","dtype"])),l=JN(r,["id","title","bbox","attrs"]);l.dimensions=s,a=w.jsx(rU,{code:JSON.stringify(l,null,2)})}else if(e==="list")a=w.jsx(tu,{children:w.jsx(x_,{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(tu,{children:w.jsx(x_,{data:s})})}else e==="python"&&(a=w.jsx(Dpe,{code:vdt(i,r)}));return w.jsx(nU,{title:r.title||"?",subheader:r.title&&`ID: ${r.id}`,isIn:t,viewMode:e,setViewMode:n,hasPython:o,children:a})},mdt=({isIn:t,viewMode:e,setViewMode:n,variable:r,time:i,serverConfig:o,hasPython:a})=>{let s,l;if(e==="code"){const c=JN(r,["id","name","title","units","expression","shape","dtype","shape","timeChunkSize","colorBarMin","colorBarMax","colorBarName","attrs"]);s=w.jsx(rU,{code:JSON.stringify(c,null,2)})}else if(e==="list"){if(s=w.jsx(tu,{children:w.jsx(x_,{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(tu,{children:w.jsx(Ho,{ref:c,sx:gv.variableHtmlReprContainer})})}}else if(e==="text"){let c=[[fe.get("Name"),r.name],[fe.get("Title"),r.title],[fe.get("Units"),r.units]];W1(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(tu,{children:w.jsx(x_,{data:c})})}else e==="python"&&(s=w.jsx(Dpe,{code:ydt(o,r,i)}));return w.jsxs(nU,{title:r.title||r.name,subheader:`${fe.get("Name")}: ${r.name}`,isIn:t,viewMode:e,setViewMode:n,hasPython:a,children:[l,s]})},gdt=({isIn:t,viewMode:e,setViewMode:n,placeInfo:r})=>{const i=r.place;let o,a,s;if(e==="code")o=w.jsx(rU,{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(tu,{children:w.jsx(x_,{data:l})})}else o=w.jsx(tu,{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(AMe,{sx:gv.media,image:r.image,title:r.label})),r.description&&(s=w.jsx(tu,{children:w.jsx(At,{children:r.description})}));return w.jsxs(nU,{title:r.label,subheader:`${fe.get("Geometry type")}: ${fe.get(i.geometry.type)}`,isIn:t,viewMode:e,setViewMode:n,children:[a,s,o]})},nU=({isIn:t,title:e,subheader:n,viewMode:r,setViewMode:i,hasPython:o,children:a})=>{const s=(l,c)=>{i(c)};return w.jsxs(f5,{in:t,timeout:"auto",unmountOnExit:!0,children:[w.jsx(OMe,{title:e,subheader:n,titleTypographyProps:{fontSize:"1.1em"},action:w.jsxs(iy,{size:"small",value:r,exclusive:!0,onChange:s,children:[w.jsx(Pn,{value:"text",size:"small",sx:ko.toggleButton,children:w.jsx(vfe,{})},0),w.jsx(Pn,{value:"list",size:"small",sx:ko.toggleButton,children:w.jsx(mfe,{})},1),w.jsx(Pn,{value:"code",size:"small",sx:ko.toggleButton,children:w.jsx(pfe,{})},2),o&&w.jsx(Pn,{value:"python",size:"small",sx:{...ko.toggleButton,width:"30px"},children:w.jsx("img",{src:ddt,width:16,alt:"python logo"})},3)]},0)}),a]})},x_=({data:t})=>w.jsx(aie,{component:Ho,sx:gv.keyValueTableContainer,children:w.jsx(P5,{sx:gv.table,size:"small",children:w.jsx(M5,{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(tAe,{href:i,target:"_blank",rel:"noreferrer",children:i}):Array.isArray(i)&&(o="["+i.map(a=>a+"").join(", ")+"]"),w.jsxs(vl,{children:[w.jsx(sr,{children:r}),w.jsx(sr,{align:"right",children:o})]},n)})})})}),tu=({children:t})=>w.jsx(Ure,{sx:gv.cardContent,children:t}),Ipe=({code:t,extension:e})=>w.jsx(tu,{children:w.jsx(ik,{theme:Kt.instance.branding.themeName||"light",height:"320px",extensions:[e],value:t,readOnly:!0})}),rU=({code:t})=>w.jsx(Ipe,{code:t,extension:wpe()}),Dpe=({code:t})=>w.jsx(Ipe,{code:t,extension:fdt()});function JN(t,e){const n={};for(const r of e)r in t&&(n[r]=t[r]);return n}function vdt(t,e){const n=xdt(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 ydt(t,e,n){const r=e.name,i=e.colorBarMin,o=e.colorBarMax,a=e.colorBarName;let s="";n!==null&&(s=`sel(time="${gy(n)}", method="nearest")`);const l=[];if(W1(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 xdt(t){return bdt(t)[0]+".zarr"}function bdt(t){const e=t.lastIndexOf(".");return e>=0?[t.substring(0,e),t.substring(e)]:[t,""]}const _dt=t=>({locale:t.controlState.locale,visibleInfoCardElements:xVe(t),infoCardElementViewModes:bVe(t),selectedDataset:qr(t),selectedVariable:vo(t),selectedPlaceInfo:iw(t),selectedTime:tw(t),serverConfig:pi(t),allowViewModePython:!!Kt.instance.branding.allowViewModePython}),wdt={setVisibleInfoCardElements:$8e,updateInfoCardElementViewMode:F8e},Sdt=Jt(_dt,wdt)(hdt),uI=5,Odt={container:t=>({marginTop:t.spacing(1),marginLeft:t.spacing(uI),marginRight:t.spacing(uI),width:`calc(100% - ${t.spacing(3*(uI+1))})`,height:"5em",display:"flex",alignItems:"flex-end"})};function Cdt({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 gy(u)}const l=Array.isArray(t);l||(t=[Date.now()-2*Aae.years,Date.now()]);const c=[{value:t[0],label:Xb(t[0])},{value:t[1],label:Xb(t[1])}];return w.jsx(Ke,{sx:Odt.container,children:w.jsx(ry,{disabled:!l,min:t[0],max:t[1],value:r,marks:c,onChange:o,onChangeCommitted:a,size:"small",valueLabelDisplay:"on",valueLabelFormat:s})})}var Tdt=Array.isArray,qo=Tdt,Edt=typeof Zn=="object"&&Zn&&Zn.Object===Object&&Zn,Lpe=Edt,Pdt=Lpe,Mdt=typeof self=="object"&&self&&self.Object===Object&&self,kdt=Pdt||Mdt||Function("return this")(),dc=kdt,Adt=dc,Rdt=Adt.Symbol,Cw=Rdt,iX=Cw,Npe=Object.prototype,Idt=Npe.hasOwnProperty,Ddt=Npe.toString,N0=iX?iX.toStringTag:void 0;function Ldt(t){var e=Idt.call(t,N0),n=t[N0];try{t[N0]=void 0;var r=!0}catch{}var i=Ddt.call(t);return r&&(e?t[N0]=n:delete t[N0]),i}var Ndt=Ldt,$dt=Object.prototype,Fdt=$dt.toString;function jdt(t){return Fdt.call(t)}var Bdt=jdt,oX=Cw,zdt=Ndt,Udt=Bdt,Wdt="[object Null]",Vdt="[object Undefined]",aX=oX?oX.toStringTag:void 0;function Gdt(t){return t==null?t===void 0?Vdt:Wdt:aX&&aX in Object(t)?zdt(t):Udt(t)}var Ou=Gdt;function Hdt(t){return t!=null&&typeof t=="object"}var Cu=Hdt,qdt=Ou,Xdt=Cu,Qdt="[object Symbol]";function Ydt(t){return typeof t=="symbol"||Xdt(t)&&qdt(t)==Qdt}var Ry=Ydt,Kdt=qo,Zdt=Ry,Jdt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,eht=/^\w*$/;function tht(t,e){if(Kdt(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||Zdt(t)?!0:eht.test(t)||!Jdt.test(t)||e!=null&&t in Object(e)}var iU=tht;function nht(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Md=nht;const Iy=$t(Md);var rht=Ou,iht=Md,oht="[object AsyncFunction]",aht="[object Function]",sht="[object GeneratorFunction]",lht="[object Proxy]";function cht(t){if(!iht(t))return!1;var e=rht(t);return e==aht||e==sht||e==oht||e==lht}var oU=cht;const Bt=$t(oU);var uht=dc,fht=uht["__core-js_shared__"],dht=fht,fI=dht,sX=function(){var t=/[^.]+$/.exec(fI&&fI.keys&&fI.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function hht(t){return!!sX&&sX in t}var pht=hht,mht=Function.prototype,ght=mht.toString;function vht(t){if(t!=null){try{return ght.call(t)}catch{}try{return t+""}catch{}}return""}var $pe=vht,yht=oU,xht=pht,bht=Md,_ht=$pe,wht=/[\\^$.*+?()[\]{}|]/g,Sht=/^\[object .+?Constructor\]$/,Oht=Function.prototype,Cht=Object.prototype,Tht=Oht.toString,Eht=Cht.hasOwnProperty,Pht=RegExp("^"+Tht.call(Eht).replace(wht,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Mht(t){if(!bht(t)||xht(t))return!1;var e=yht(t)?Pht:Sht;return e.test(_ht(t))}var kht=Mht;function Aht(t,e){return t==null?void 0:t[e]}var Rht=Aht,Iht=kht,Dht=Rht;function Lht(t,e){var n=Dht(t,e);return Iht(n)?n:void 0}var jp=Lht,Nht=jp,$ht=Nht(Object,"create"),sk=$ht,lX=sk;function Fht(){this.__data__=lX?lX(null):{},this.size=0}var jht=Fht;function Bht(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var zht=Bht,Uht=sk,Wht="__lodash_hash_undefined__",Vht=Object.prototype,Ght=Vht.hasOwnProperty;function Hht(t){var e=this.__data__;if(Uht){var n=e[t];return n===Wht?void 0:n}return Ght.call(e,t)?e[t]:void 0}var qht=Hht,Xht=sk,Qht=Object.prototype,Yht=Qht.hasOwnProperty;function Kht(t){var e=this.__data__;return Xht?e[t]!==void 0:Yht.call(e,t)}var Zht=Kht,Jht=sk,ept="__lodash_hash_undefined__";function tpt(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Jht&&e===void 0?ept:e,this}var npt=tpt,rpt=jht,ipt=zht,opt=qht,apt=Zht,spt=npt;function Dy(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e-1}var Opt=Spt,Cpt=lk;function Tpt(t,e){var n=this.__data__,r=Cpt(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var Ept=Tpt,Ppt=upt,Mpt=ypt,kpt=_pt,Apt=Opt,Rpt=Ept;function Ly(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e0?1:-1},Ch=function(e){return Tw(e)&&e.indexOf("%")===e.length-1},Ye=function(e){return Kmt(e)&&!$y(e)},ti=function(e){return Ye(e)||Tw(e)},tgt=0,Fy=function(e){var n=++tgt;return"".concat(e||"").concat(n)},hp=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)&&!Tw(e))return r;var o;if(Ch(e)){var a=e.indexOf("%");o=n*parseFloat(e.slice(0,a))/100}else o=+e;return $y(o)&&(o=r),i&&o>n&&(o=n),o},gf=function(e){if(!e)return null;var n=Object.keys(e);return n&&n.length?e[n[0]]:null},ngt=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 lgt(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 t$(t){"@babel/helpers - typeof";return t$=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},t$(t)}var mX={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"},nu=function(e){return typeof e=="string"?e:e?e.displayName||e.name||"Component":""},gX=null,hI=null,hU=function t(e){if(e===gX&&Array.isArray(hI))return hI;var n=[];return M.Children.forEach(e,function(r){Wt(r)||(_T.isFragment(r)?n=n.concat(t(r.props.children)):n.push(r))}),hI=n,gX=e,n};function os(t,e){var n=[],r=[];return Array.isArray(e)?r=e.map(function(i){return nu(i)}):r=[nu(e)],hU(t).forEach(function(i){var o=is(i,"type.displayName")||is(i,"type.name");r.indexOf(o)!==-1&&n.push(i)}),n}function ca(t,e){var n=os(t,e);return n&&n[0]}var vX=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)},cgt=["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"],ugt=function(e){return e&&e.type&&Tw(e.type)&&cgt.indexOf(e.type)>=0},Gpe=function(e){return e&&t$(e)==="object"&&"cx"in e&&"cy"in e&&"r"in e},fgt=function(e,n,r,i){var o,a=(o=dI==null?void 0:dI[i])!==null&&o!==void 0?o:[];return!Bt(e)&&(i&&a.includes(n)||igt.includes(n))||r&&dU.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),!Iy(i))return null;var o={};return Object.keys(i).forEach(function(a){var s;fgt((s=i)===null||s===void 0?void 0:s[a],a,n,r)&&(o[a]=i[a])}),o},n$=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 yX(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 ggt(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 i$(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=mgt(t,pgt),u=i||{width:n,height:r,x:0,y:0},f=ke("recharts-surface",o);return ue.createElement("svg",r$({},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 vgt=["children","className"];function o$(){return o$=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 xgt(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 Gn=ue.forwardRef(function(t,e){var n=t.children,r=t.className,i=ygt(t,vgt),o=ke("recharts-layer",r);return ue.createElement("g",o$({className:o},jt(i,!0),{ref:e}),n)}),ru=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:wgt(t,e,n)}var Ogt=Sgt,Cgt="\\ud800-\\udfff",Tgt="\\u0300-\\u036f",Egt="\\ufe20-\\ufe2f",Pgt="\\u20d0-\\u20ff",Mgt=Tgt+Egt+Pgt,kgt="\\ufe0e\\ufe0f",Agt="\\u200d",Rgt=RegExp("["+Agt+Cgt+Mgt+kgt+"]");function Igt(t){return Rgt.test(t)}var Hpe=Igt;function Dgt(t){return t.split("")}var Lgt=Dgt,qpe="\\ud800-\\udfff",Ngt="\\u0300-\\u036f",$gt="\\ufe20-\\ufe2f",Fgt="\\u20d0-\\u20ff",jgt=Ngt+$gt+Fgt,Bgt="\\ufe0e\\ufe0f",zgt="["+qpe+"]",a$="["+jgt+"]",s$="\\ud83c[\\udffb-\\udfff]",Ugt="(?:"+a$+"|"+s$+")",Xpe="[^"+qpe+"]",Qpe="(?:\\ud83c[\\udde6-\\uddff]){2}",Ype="[\\ud800-\\udbff][\\udc00-\\udfff]",Wgt="\\u200d",Kpe=Ugt+"?",Zpe="["+Bgt+"]?",Vgt="(?:"+Wgt+"(?:"+[Xpe,Qpe,Ype].join("|")+")"+Zpe+Kpe+")*",Ggt=Zpe+Kpe+Vgt,Hgt="(?:"+[Xpe+a$+"?",a$,Qpe,Ype,zgt].join("|")+")",qgt=RegExp(s$+"(?="+s$+")|"+Hgt+Ggt,"g");function Xgt(t){return t.match(qgt)||[]}var Qgt=Xgt,Ygt=Lgt,Kgt=Hpe,Zgt=Qgt;function Jgt(t){return Kgt(t)?Zgt(t):Ygt(t)}var evt=Jgt,tvt=Ogt,nvt=Hpe,rvt=evt,ivt=zpe;function ovt(t){return function(e){e=ivt(e);var n=nvt(e)?rvt(e):void 0,r=n?n[0]:e.charAt(0),i=n?tvt(n,1).join(""):e.slice(1);return r[t]()+i}}var avt=ovt,svt=avt,lvt=svt("toUpperCase"),cvt=lvt;const dk=$t(cvt);function Un(t){return function(){return t}}const Jpe=Math.cos,jE=Math.sin,ol=Math.sqrt,BE=Math.PI,hk=2*BE,l$=Math.PI,c$=2*l$,eh=1e-6,uvt=c$-eh;function eme(t){this._+=t[0];for(let e=1,n=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return eme;const n=10**e;return function(r){this._+=r[0];for(let i=1,o=r.length;ieh)if(!(Math.abs(f*l-c*u)>eh)||!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((l$-Math.acos((m+d-g)/(2*v*y)))/2),b=x/y,_=x/v;Math.abs(b-1)>eh&&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)>eh||Math.abs(this._y1-u)>eh)&&this._append`L${c},${u}`,r&&(d<0&&(d=d%c$+c$),d>uvt?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>eh&&this._append`A${r},${r},0,${+(d>=l$)},${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 pU(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 dvt(e)}function mU(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function tme(t){this._context=t}tme.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 pk(t){return new tme(t)}function nme(t){return t[0]}function rme(t){return t[1]}function ime(t,e){var n=Un(!0),r=null,i=pk,o=null,a=pU(s);t=typeof t=="function"?t:t===void 0?nme:Un(t),e=typeof e=="function"?e:e===void 0?rme:Un(e);function s(l){var c,u=(l=mU(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 ime().defined(i).curve(a).context(o)}return c.x=function(f){return arguments.length?(t=typeof f=="function"?f:Un(+f),r=null,c):t},c.x0=function(f){return arguments.length?(t=typeof f=="function"?f:Un(+f),c):t},c.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Un(+f),c):r},c.y=function(f){return arguments.length?(e=typeof f=="function"?f:Un(+f),n=null,c):e},c.y0=function(f){return arguments.length?(e=typeof f=="function"?f:Un(+f),c):e},c.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Un(+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:Un(!!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 ome{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 hvt(t){return new ome(t,!0)}function pvt(t){return new ome(t,!1)}const gU={draw(t,e){const n=ol(e/BE);t.moveTo(n,0),t.arc(0,0,n,0,hk)}},mvt={draw(t,e){const n=ol(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()}},ame=ol(1/3),gvt=ame*2,vvt={draw(t,e){const n=ol(e/gvt),r=n*ame;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},yvt={draw(t,e){const n=ol(e),r=-n/2;t.rect(r,r,n,n)}},xvt=.8908130915292852,sme=jE(BE/10)/jE(7*BE/10),bvt=jE(hk/10)*sme,_vt=-Jpe(hk/10)*sme,wvt={draw(t,e){const n=ol(e*xvt),r=bvt*n,i=_vt*n;t.moveTo(0,-n),t.lineTo(r,i);for(let o=1;o<5;++o){const a=hk*o/5,s=Jpe(a),l=jE(a);t.lineTo(l*n,-s*n),t.lineTo(s*r-l*i,l*r+s*i)}t.closePath()}},pI=ol(3),Svt={draw(t,e){const n=-ol(e/(pI*3));t.moveTo(0,n*2),t.lineTo(-pI*n,-n),t.lineTo(pI*n,-n),t.closePath()}},Ia=-.5,Da=ol(3)/2,u$=1/ol(12),Ovt=(u$/2+1)*3,Cvt={draw(t,e){const n=ol(e/Ovt),r=n/2,i=n*u$,o=r,a=n*u$+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 Tvt(t,e){let n=null,r=pU(i);t=typeof t=="function"?t:Un(t||gU),e=typeof e=="function"?e:Un(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:Un(o),i):t},i.size=function(o){return arguments.length?(e=typeof o=="function"?o:Un(+o),i):e},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function zE(){}function UE(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 lme(t){this._context=t}lme.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:UE(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:UE(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Evt(t){return new lme(t)}function cme(t){this._context=t}cme.prototype={areaStart:zE,areaEnd:zE,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:UE(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Pvt(t){return new cme(t)}function ume(t){this._context=t}ume.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:UE(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Mvt(t){return new ume(t)}function fme(t){this._context=t}fme.prototype={areaStart:zE,areaEnd:zE,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 kvt(t){return new fme(t)}function bX(t){return t<0?-1:1}function _X(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(bX(o)+bX(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function wX(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function mI(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 WE(t){this._context=t}WE.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:mI(this,this._t0,wX(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,mI(this,wX(this,n=_X(this,t,e)),n);break;default:mI(this,this._t0,n=_X(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function dme(t){this._context=new hme(t)}(dme.prototype=Object.create(WE.prototype)).point=function(t,e){WE.prototype.point.call(this,e,t)};function hme(t){this._context=t}hme.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 Avt(t){return new WE(t)}function Rvt(t){return new dme(t)}function pme(t){this._context=t}pme.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=SX(t),i=SX(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 Dvt(t){return new mk(t,.5)}function Lvt(t){return new mk(t,0)}function Nvt(t){return new mk(t,1)}function vv(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 $vt(t,e){return t[e]}function Fvt(t){const e=[];return e.key=t,e}function jvt(){var t=Un([]),e=f$,n=vv,r=$vt;function i(o){var a=Array.from(t.apply(this,arguments),Fvt),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 Xvt(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 mme={symbolCircle:gU,symbolCross:mvt,symbolDiamond:vvt,symbolSquare:yvt,symbolStar:wvt,symbolTriangle:Svt,symbolWye:Cvt},Qvt=Math.PI/180,Yvt=function(e){var n="symbol".concat(dk(e));return mme[n]||gU},Kvt=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*Qvt;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}},Zvt=function(e,n){mme["symbol".concat(dk(e))]=n},vU=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=qvt(e,Wvt),c=CX(CX({},l),{},{type:r,size:o,sizeType:s}),u=function(){var g=Yvt(r),v=Tvt().type(g).size(Kvt(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",d$({},p,{className:ke("recharts-symbols",f),transform:"translate(".concat(d,", ").concat(h,")"),d:u()})):null};vU.registerSymbol=Zvt;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 h$(){return h$=Object.assign?Object.assign.bind():function(t){for(var e=1;e`);var y=h.inactive?c:h.color;return ue.createElement("li",p$({className:g,style:f,key:"legend-item-".concat(p)},FE(r.props,h,p)),ue.createElement(o$,{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);w_(xU,"displayName","Legend");w_(xU,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var uyt=ck;function fyt(){this.__data__=new uyt,this.size=0}var dyt=fyt;function hyt(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var pyt=hyt;function myt(t){return this.__data__.get(t)}var gyt=myt;function vyt(t){return this.__data__.has(t)}var yyt=vyt,xyt=ck,byt=lU,_yt=cU,wyt=200;function Syt(t,e){var n=this.__data__;if(n instanceof xyt){var r=n.__data__;if(!byt||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&Gyt?new zyt:void 0;for(o.set(t,e),o.set(e,t);++f-1&&t%1==0&&t-1&&t%1==0&&t<=Q0t}var SU=Y0t,K0t=Ou,Z0t=SU,J0t=Cu,ext="[object Arguments]",txt="[object Array]",nxt="[object Boolean]",rxt="[object Date]",ixt="[object Error]",oxt="[object Function]",axt="[object Map]",sxt="[object Number]",lxt="[object Object]",cxt="[object RegExp]",uxt="[object Set]",fxt="[object String]",dxt="[object WeakMap]",hxt="[object ArrayBuffer]",pxt="[object DataView]",mxt="[object Float32Array]",gxt="[object Float64Array]",vxt="[object Int8Array]",yxt="[object Int16Array]",xxt="[object Int32Array]",bxt="[object Uint8Array]",_xt="[object Uint8ClampedArray]",wxt="[object Uint16Array]",Sxt="[object Uint32Array]",Xn={};Xn[mxt]=Xn[gxt]=Xn[vxt]=Xn[yxt]=Xn[xxt]=Xn[bxt]=Xn[_xt]=Xn[wxt]=Xn[Sxt]=!0;Xn[ext]=Xn[txt]=Xn[hxt]=Xn[nxt]=Xn[pxt]=Xn[rxt]=Xn[ixt]=Xn[oxt]=Xn[axt]=Xn[sxt]=Xn[lxt]=Xn[cxt]=Xn[uxt]=Xn[fxt]=Xn[dxt]=!1;function Oxt(t){return J0t(t)&&Z0t(t.length)&&!!Xn[K0t(t)]}var Cxt=Oxt;function Txt(t){return function(e){return t(e)}}var Eme=Txt,qE={exports:{}};qE.exports;(function(t,e){var n=Npe,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})(qE,qE.exports);var Ext=qE.exports,Pxt=Cxt,Mxt=Eme,DX=Ext,LX=DX&&DX.isTypedArray,kxt=LX?Mxt(LX):Pxt,Pme=kxt,Axt=D0t,Rxt=_U,Ixt=qo,Dxt=Tme,Lxt=wU,Nxt=Pme,$xt=Object.prototype,Fxt=$xt.hasOwnProperty;function jxt(t,e){var n=Ixt(t),r=!n&&Rxt(t),i=!n&&!r&&Dxt(t),o=!n&&!r&&!i&&Nxt(t),a=n||r||i||o,s=a?Axt(t.length,String):[],l=s.length;for(var c in t)(e||Fxt.call(t,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Lxt(c,l)))&&s.push(c);return s}var Bxt=jxt,zxt=Object.prototype;function Uxt(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||zxt;return t===n}var Wxt=Uxt;function Vxt(t,e){return function(n){return t(e(n))}}var Mme=Vxt,Gxt=Mme,Hxt=Gxt(Object.keys,Object),qxt=Hxt,Xxt=Wxt,Qxt=qxt,Yxt=Object.prototype,Kxt=Yxt.hasOwnProperty;function Zxt(t){if(!Xxt(t))return Qxt(t);var e=[];for(var n in Object(t))Kxt.call(t,n)&&n!="constructor"&&e.push(n);return e}var Jxt=Zxt,ebt=aU,tbt=SU;function nbt(t){return t!=null&&tbt(t.length)&&!ebt(t)}var Ew=nbt,rbt=Bxt,ibt=Jxt,obt=Ew;function abt(t){return obt(t)?rbt(t):ibt(t)}var gk=abt,sbt=w0t,lbt=R0t,cbt=gk;function ubt(t){return sbt(t,cbt,lbt)}var fbt=ubt,NX=fbt,dbt=1,hbt=Object.prototype,pbt=hbt.hasOwnProperty;function mbt(t,e,n,r,i,o){var a=n&dbt,s=NX(t),l=s.length,c=NX(e),u=c.length;if(l!=u&&!a)return!1;for(var f=l;f--;){var d=s[f];if(!(a?d in e:pbt.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 h1t=d1t;function p1t(t,e,n){for(var r=-1,i=t==null?0:t.length;++r=M1t){var c=e?null:E1t(t);if(c)return P1t(c);a=!1,i=T1t,l=new S1t}else l=e?[]:s;e:for(;++r=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function V1t(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 G1t(t){return t.value}function H1t(t,e){if(ue.isValidElement(t))return ue.cloneElement(t,e);if(typeof t=="function")return ue.createElement(t,e);e.ref;var n=W1t(e,N1t);return ue.createElement(xU,n)}var ZX=1,bv=function(t){z1t(e,t);function e(){var n;$1t(this,e);for(var r=arguments.length,i=new Array(r),o=0;oZX||Math.abs(i.height-this.lastBoundingBox.height)>ZX)&&(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?Vd({},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 Vd(Vd({},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=Vd(Vd({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}},H1t(o,Vd(Vd({},this.props),{},{payload:Nme(u,c,G1t)})))}}],[{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);vk(bv,"displayName","Legend");vk(bv,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var JX=Cw,q1t=_U,X1t=qo,eQ=JX?JX.isConcatSpreadable:void 0;function Q1t(t){return X1t(t)||q1t(t)||!!(eQ&&t&&t[eQ])}var Y1t=Q1t,K1t=Ome,Z1t=Y1t;function Bme(t,e,n,r,i){var o=-1,a=t.length;for(n||(n=Z1t),i||(i=[]);++o0&&n(s)?e>1?Bme(s,e-1,n,r,i):K1t(i,s):r||(i[i.length]=s)}return i}var zme=Bme;function J1t(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 ewt=J1t,twt=ewt,nwt=twt(),rwt=nwt,iwt=rwt,owt=gk;function awt(t,e){return t&&iwt(t,e,owt)}var Ume=awt,swt=Ew;function lwt(t,e){return function(n,r){if(n==null)return n;if(!swt(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 wwt=_wt,bI=fU,Swt=dU,Owt=kd,Cwt=Wme,Twt=vwt,Ewt=Eme,Pwt=wwt,Mwt=Uy,kwt=qo;function Awt(t,e,n){e.length?e=bI(e,function(o){return kwt(o)?function(a){return Swt(a,o.length===1?o[0]:o)}:o}):e=[Mwt];var r=-1;e=bI(e,Ewt(Owt));var i=Cwt(t,function(o,a,s){var l=bI(e,function(c){return c(o)});return{criteria:l,index:++r,value:o}});return Twt(i,function(o,a){return Pwt(o,a,n)})}var Rwt=Awt;function Iwt(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 Dwt=Iwt,Lwt=Dwt,nQ=Math.max;function Nwt(t,e,n){return e=nQ(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=nQ(r.length-e,0),a=Array(o);++i0){if(++e>=Hwt)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var Ywt=Qwt,Kwt=Gwt,Zwt=Ywt,Jwt=Zwt(Kwt),eSt=Jwt,tSt=Uy,nSt=$wt,rSt=eSt;function iSt(t,e){return rSt(nSt(t,e,tSt),t+"")}var oSt=iSt,aSt=sU,sSt=Ew,lSt=wU,cSt=Md;function uSt(t,e,n){if(!cSt(n))return!1;var r=typeof e;return(r=="number"?sSt(n)&&lSt(e,n.length):r=="string"&&e in n)?aSt(n[e],t):!1}var yk=uSt,fSt=zme,dSt=Rwt,hSt=oSt,iQ=yk,pSt=hSt(function(t,e){if(t==null)return[];var n=e.length;return n>1&&iQ(t,e[0],e[1])?e=[]:n>2&&iQ(e[0],e[1],e[2])&&(e=[e[0]]),dSt(t,fSt(e,1),[])}),mSt=pSt;const TU=$t(mSt);function S_(t){"@babel/helpers - typeof";return S_=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},S_(t)}function w$(){return w$=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(F0,"-left"),Ye(n)&&e&&Ye(e.x)&&n=e.y),"".concat(F0,"-top"),Ye(r)&&e&&Ye(e.y)&&rm?Math.max(u,l[r]):Math.max(f,l[r])}function kSt(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 ASt(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=sQ({allowEscapeViewBox:e,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:a.width,viewBox:l,viewBoxDimension:l.width}),f=sQ({allowEscapeViewBox:e,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:a.height,viewBox:l,viewBoxDimension:l.height}),c=kSt({translateX:u,translateY:f,useTranslate3d:s})):c=PSt,{cssProperties:c,cssClasses:MSt({translateX:u,translateY:f,coordinate:n})}}function _v(t){"@babel/helpers - typeof";return _v=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},_v(t)}function lQ(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 cQ(t){for(var e=1;euQ||Math.abs(r.height-this.state.lastBoundingBox.height)>uQ)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,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=ASt({allowEscapeViewBox:a,coordinate:u,offsetTopLeft:h,position:p,reverseDirection:m,tooltipBox:this.state.lastBoundingBox,useTranslate3d:g,viewBox:v}),b=x.cssClasses,_=x.cssProperties,S=cQ(cQ({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),BSt=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Yl={isSsr:BSt(),get:function(e){return Yl[e]},set:function(e,n){if(typeof e=="string")Yl[e]=n;else{var r=Object.keys(e);r&&r.length&&r.forEach(function(i){Yl[i]=e[i]})}}};function wv(t){"@babel/helpers - typeof";return wv=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},wv(t)}function fQ(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 dQ(t){for(var e=1;e0;return ue.createElement(jSt,{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},YSt(c,dQ(dQ({},this.props),{},{payload:_})))}}]),e}(M.PureComponent);EU(yl,"displayName","Tooltip");EU(yl,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Yl.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 KSt=dc,ZSt=function(){return KSt.Date.now()},JSt=ZSt,eOt=/\s/;function tOt(t){for(var e=t.length;e--&&eOt.test(t.charAt(e)););return e}var nOt=tOt,rOt=nOt,iOt=/^\s+/;function oOt(t){return t&&t.slice(0,rOt(t)+1).replace(iOt,"")}var aOt=oOt,sOt=aOt,hQ=Md,lOt=Iy,pQ=NaN,cOt=/^[-+]0x[0-9a-f]+$/i,uOt=/^0b[01]+$/i,fOt=/^0o[0-7]+$/i,dOt=parseInt;function hOt(t){if(typeof t=="number")return t;if(lOt(t))return pQ;if(hQ(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=hQ(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=sOt(t);var n=uOt.test(t);return n||fOt.test(t)?dOt(t.slice(2),n?2:8):cOt.test(t)?pQ:+t}var Qme=hOt,pOt=Md,wI=JSt,mQ=Qme,mOt="Expected a function",gOt=Math.max,vOt=Math.min;function yOt(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(mOt);e=mQ(e)||0,pOt(n)&&(u=!!n.leading,f="maxWait"in n,o=f?gOt(mQ(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?vOt(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=wI();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(wI())}function _(){var S=wI(),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 xOt=yOt,bOt=xOt,_Ot=Md,wOt="Expected a function";function SOt(t,e,n){var r=!0,i=!0;if(typeof t!="function")throw new TypeError(wOt);return _Ot(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),bOt(t,e,{leading:r,maxWait:e,trailing:i})}var OOt=SOt;const Yme=$t(OOt);function C_(t){"@babel/helpers - typeof";return C_=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},C_(t)}function gQ(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 yO(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&(R=Yme(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;ru(Ch(a)||Ch(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=Jvt({},r);return delete c.legendIcon,ue.cloneElement(r.legendIcon,c)}return ue.createElement(vU,{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(__(__({"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;ru(!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",h$({className:g,style:f,key:"legend-item-".concat(p)},FE(r.props,h,p)),ue.createElement(i$,{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);__(yU,"displayName","Legend");__(yU,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var lyt=ck;function cyt(){this.__data__=new lyt,this.size=0}var uyt=cyt;function fyt(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var dyt=fyt;function hyt(t){return this.__data__.get(t)}var pyt=hyt;function myt(t){return this.__data__.has(t)}var gyt=myt,vyt=ck,yyt=sU,xyt=lU,byt=200;function _yt(t,e){var n=this.__data__;if(n instanceof vyt){var r=n.__data__;if(!yyt||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&Wyt?new jyt:void 0;for(o.set(t,e),o.set(e,t);++f-1&&t%1==0&&t-1&&t%1==0&&t<=q0t}var wU=X0t,Q0t=Ou,Y0t=wU,K0t=Cu,Z0t="[object Arguments]",J0t="[object Array]",ext="[object Boolean]",txt="[object Date]",nxt="[object Error]",rxt="[object Function]",ixt="[object Map]",oxt="[object Number]",axt="[object Object]",sxt="[object RegExp]",lxt="[object Set]",cxt="[object String]",uxt="[object WeakMap]",fxt="[object ArrayBuffer]",dxt="[object DataView]",hxt="[object Float32Array]",pxt="[object Float64Array]",mxt="[object Int8Array]",gxt="[object Int16Array]",vxt="[object Int32Array]",yxt="[object Uint8Array]",xxt="[object Uint8ClampedArray]",bxt="[object Uint16Array]",_xt="[object Uint32Array]",Xn={};Xn[hxt]=Xn[pxt]=Xn[mxt]=Xn[gxt]=Xn[vxt]=Xn[yxt]=Xn[xxt]=Xn[bxt]=Xn[_xt]=!0;Xn[Z0t]=Xn[J0t]=Xn[fxt]=Xn[ext]=Xn[dxt]=Xn[txt]=Xn[nxt]=Xn[rxt]=Xn[ixt]=Xn[oxt]=Xn[axt]=Xn[sxt]=Xn[lxt]=Xn[cxt]=Xn[uxt]=!1;function wxt(t){return K0t(t)&&Y0t(t.length)&&!!Xn[Q0t(t)]}var Sxt=wxt;function Oxt(t){return function(e){return t(e)}}var Tme=Oxt,qE={exports:{}};qE.exports;(function(t,e){var n=Lpe,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})(qE,qE.exports);var Cxt=qE.exports,Txt=Sxt,Ext=Tme,RX=Cxt,IX=RX&&RX.isTypedArray,Pxt=IX?Ext(IX):Txt,Eme=Pxt,Mxt=R0t,kxt=bU,Axt=qo,Rxt=Cme,Ixt=_U,Dxt=Eme,Lxt=Object.prototype,Nxt=Lxt.hasOwnProperty;function $xt(t,e){var n=Axt(t),r=!n&&kxt(t),i=!n&&!r&&Rxt(t),o=!n&&!r&&!i&&Dxt(t),a=n||r||i||o,s=a?Mxt(t.length,String):[],l=s.length;for(var c in t)(e||Nxt.call(t,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Ixt(c,l)))&&s.push(c);return s}var Fxt=$xt,jxt=Object.prototype;function Bxt(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||jxt;return t===n}var zxt=Bxt;function Uxt(t,e){return function(n){return t(e(n))}}var Pme=Uxt,Wxt=Pme,Vxt=Wxt(Object.keys,Object),Gxt=Vxt,Hxt=zxt,qxt=Gxt,Xxt=Object.prototype,Qxt=Xxt.hasOwnProperty;function Yxt(t){if(!Hxt(t))return qxt(t);var e=[];for(var n in Object(t))Qxt.call(t,n)&&n!="constructor"&&e.push(n);return e}var Kxt=Yxt,Zxt=oU,Jxt=wU;function ebt(t){return t!=null&&Jxt(t.length)&&!Zxt(t)}var Ew=ebt,tbt=Fxt,nbt=Kxt,rbt=Ew;function ibt(t){return rbt(t)?tbt(t):nbt(t)}var gk=ibt,obt=b0t,abt=k0t,sbt=gk;function lbt(t){return obt(t,sbt,abt)}var cbt=lbt,DX=cbt,ubt=1,fbt=Object.prototype,dbt=fbt.hasOwnProperty;function hbt(t,e,n,r,i,o){var a=n&ubt,s=DX(t),l=s.length,c=DX(e),u=c.length;if(l!=u&&!a)return!1;for(var f=l;f--;){var d=s[f];if(!(a?d in e:dbt.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 f1t=u1t;function d1t(t,e,n){for(var r=-1,i=t==null?0:t.length;++r=E1t){var c=e?null:C1t(t);if(c)return T1t(c);a=!1,i=O1t,l=new _1t}else l=e?[]:s;e:for(;++r=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function U1t(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 W1t(t){return t.value}function V1t(t,e){if(ue.isValidElement(t))return ue.cloneElement(t,e);if(typeof t=="function")return ue.createElement(t,e);e.ref;var n=z1t(e,D1t);return ue.createElement(yU,n)}var YX=1,bv=function(t){j1t(e,t);function e(){var n;L1t(this,e);for(var r=arguments.length,i=new Array(r),o=0;oYX||Math.abs(i.height-this.lastBoundingBox.height)>YX)&&(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?Vd({},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 Vd(Vd({},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=Vd(Vd({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}},V1t(o,Vd(Vd({},this.props),{},{payload:Lme(u,c,W1t)})))}}],[{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);vk(bv,"displayName","Legend");vk(bv,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var KX=Cw,G1t=bU,H1t=qo,ZX=KX?KX.isConcatSpreadable:void 0;function q1t(t){return H1t(t)||G1t(t)||!!(ZX&&t&&t[ZX])}var X1t=q1t,Q1t=Sme,Y1t=X1t;function jme(t,e,n,r,i){var o=-1,a=t.length;for(n||(n=Y1t),i||(i=[]);++o0&&n(s)?e>1?jme(s,e-1,n,r,i):Q1t(i,s):r||(i[i.length]=s)}return i}var Bme=jme;function K1t(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 Z1t=K1t,J1t=Z1t,ewt=J1t(),twt=ewt,nwt=twt,rwt=gk;function iwt(t,e){return t&&nwt(t,e,rwt)}var zme=iwt,owt=Ew;function awt(t,e){return function(n,r){if(n==null)return n;if(!owt(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 bwt=xwt,xI=uU,_wt=fU,wwt=kd,Swt=Ume,Owt=mwt,Cwt=Tme,Twt=bwt,Ewt=zy,Pwt=qo;function Mwt(t,e,n){e.length?e=xI(e,function(o){return Pwt(o)?function(a){return _wt(a,o.length===1?o[0]:o)}:o}):e=[Ewt];var r=-1;e=xI(e,Cwt(wwt));var i=Swt(t,function(o,a,s){var l=xI(e,function(c){return c(o)});return{criteria:l,index:++r,value:o}});return Owt(i,function(o,a){return Twt(o,a,n)})}var kwt=Mwt;function Awt(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 Rwt=Awt,Iwt=Rwt,eQ=Math.max;function Dwt(t,e,n){return e=eQ(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=eQ(r.length-e,0),a=Array(o);++i0){if(++e>=Vwt)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var Xwt=qwt,Qwt=Wwt,Ywt=Xwt,Kwt=Ywt(Qwt),Zwt=Kwt,Jwt=zy,eSt=Lwt,tSt=Zwt;function nSt(t,e){return tSt(eSt(t,e,Jwt),t+"")}var rSt=nSt,iSt=aU,oSt=Ew,aSt=_U,sSt=Md;function lSt(t,e,n){if(!sSt(n))return!1;var r=typeof e;return(r=="number"?oSt(n)&&aSt(e,n.length):r=="string"&&e in n)?iSt(n[e],t):!1}var yk=lSt,cSt=Bme,uSt=kwt,fSt=rSt,nQ=yk,dSt=fSt(function(t,e){if(t==null)return[];var n=e.length;return n>1&&nQ(t,e[0],e[1])?e=[]:n>2&&nQ(e[0],e[1],e[2])&&(e=[e[0]]),uSt(t,cSt(e,1),[])}),hSt=dSt;const CU=$t(hSt);function w_(t){"@babel/helpers - typeof";return w_=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},w_(t)}function _$(){return _$=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($0,"-left"),Ye(n)&&e&&Ye(e.x)&&n=e.y),"".concat($0,"-top"),Ye(r)&&e&&Ye(e.y)&&rm?Math.max(u,l[r]):Math.max(f,l[r])}function PSt(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 MSt(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=oQ({allowEscapeViewBox:e,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:a.width,viewBox:l,viewBoxDimension:l.width}),f=oQ({allowEscapeViewBox:e,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:a.height,viewBox:l,viewBoxDimension:l.height}),c=PSt({translateX:u,translateY:f,useTranslate3d:s})):c=TSt,{cssProperties:c,cssClasses:ESt({translateX:u,translateY:f,coordinate:n})}}function _v(t){"@babel/helpers - typeof";return _v=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},_v(t)}function aQ(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 sQ(t){for(var e=1;elQ||Math.abs(r.height-this.state.lastBoundingBox.height)>lQ)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,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=MSt({allowEscapeViewBox:a,coordinate:u,offsetTopLeft:h,position:p,reverseDirection:m,tooltipBox:this.state.lastBoundingBox,useTranslate3d:g,viewBox:v}),b=x.cssClasses,_=x.cssProperties,S=sQ(sQ({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),FSt=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Yl={isSsr:FSt(),get:function(e){return Yl[e]},set:function(e,n){if(typeof e=="string")Yl[e]=n;else{var r=Object.keys(e);r&&r.length&&r.forEach(function(i){Yl[i]=e[i]})}}};function wv(t){"@babel/helpers - typeof";return wv=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},wv(t)}function cQ(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 uQ(t){for(var e=1;e0;return ue.createElement($St,{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},XSt(c,uQ(uQ({},this.props),{},{payload:_})))}}]),e}(M.PureComponent);TU(yl,"displayName","Tooltip");TU(yl,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Yl.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 QSt=dc,YSt=function(){return QSt.Date.now()},KSt=YSt,ZSt=/\s/;function JSt(t){for(var e=t.length;e--&&ZSt.test(t.charAt(e)););return e}var eOt=JSt,tOt=eOt,nOt=/^\s+/;function rOt(t){return t&&t.slice(0,tOt(t)+1).replace(nOt,"")}var iOt=rOt,oOt=iOt,fQ=Md,aOt=Ry,dQ=NaN,sOt=/^[-+]0x[0-9a-f]+$/i,lOt=/^0b[01]+$/i,cOt=/^0o[0-7]+$/i,uOt=parseInt;function fOt(t){if(typeof t=="number")return t;if(aOt(t))return dQ;if(fQ(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=fQ(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=oOt(t);var n=lOt.test(t);return n||cOt.test(t)?uOt(t.slice(2),n?2:8):sOt.test(t)?dQ:+t}var Xme=fOt,dOt=Md,_I=KSt,hQ=Xme,hOt="Expected a function",pOt=Math.max,mOt=Math.min;function gOt(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(hOt);e=hQ(e)||0,dOt(n)&&(u=!!n.leading,f="maxWait"in n,o=f?pOt(hQ(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?mOt(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=_I();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(_I())}function _(){var S=_I(),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 vOt=gOt,yOt=vOt,xOt=Md,bOt="Expected a function";function _Ot(t,e,n){var r=!0,i=!0;if(typeof t!="function")throw new TypeError(bOt);return xOt(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),yOt(t,e,{leading:r,maxWait:e,trailing:i})}var wOt=_Ot;const Qme=$t(wOt);function O_(t){"@babel/helpers - typeof";return O_=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},O_(t)}function pQ(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 yO(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&(R=Qme(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;ru(Ch(a)||Ch(l),`The width(%s) and height(%s) are both fixed numbers, maybe you don't need to use a ResponsiveContainer.`,a,l),ru(!n||n>0,"The aspect(%s) must be greater than zero.",n);var L=Ch(a)?R:a,z=Ch(l)?T:l;n&&n>0&&(L?z=L/n:z&&(L=z*n),d&&z>d&&(z=d)),ru(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)&&_T.isElement(h)&&nu(h.type).endsWith("Chart");return ue.Children.map(h,function(U){return _T.isElement(U)?M.cloneElement(U,yO({width:L,height:z},B?{style:yO({height:"100%",width:"100%",maxHeight:z,maxWidth:L},U.props.style)}:{})):U})},[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:yO(yO({},b),{},{width:a,height:l,minWidth:u,minHeight:f,maxHeight:d}),ref:_},P)}),Zme=function(e){return null};Zme.displayName="Cell";function T_(t){"@babel/helpers - typeof";return T_=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},T_(t)}function yQ(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 E$(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||Yl.isSsr)return{width:0,height:0};var r=FOt(n),i=JSON.stringify({text:e,copyStyle:r});if(dm.widthCache[i])return dm.widthCache[i];try{var o=document.getElementById(xQ);o||(o=document.createElement("span"),o.setAttribute("id",xQ),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var a=E$(E$({},$Ot),r);Object.assign(o.style,a),o.textContent="".concat(e);var s=o.getBoundingClientRect(),l={width:s.width,height:s.height};return dm.widthCache[i]=l,++dm.cacheCount>NOt&&(dm.cacheCount=0,dm.widthCache={}),l}catch{return{width:0,height:0}}},jOt=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}};function E_(t){"@babel/helpers - typeof";return E_=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},E_(t)}function KE(t,e){return WOt(t)||UOt(t,e)||zOt(t,e)||BOt()}function BOt(){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 zOt(t,e){if(t){if(typeof t=="string")return bQ(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 bQ(t,e)}}function bQ(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 rCt(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 TQ(t,e){return sCt(t)||aCt(t,e)||oCt(t,e)||iCt()}function iCt(){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 oCt(t,e){if(t){if(typeof t=="string")return EQ(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 EQ(t,e)}}function EQ(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 U=B.word,W=B.width,$=z[z.length-1];if($&&(i==null||o||$.width+W+rB.width?z:B})};if(!u)return h;for(var m="…",g=function(L){var z=f.slice(0,L),B=nge({breakAll:c,style:l,children:z+m}).wordsWithComputedWidth,U=d(B),W=U.length>a||p(U).width>Number(i);return[W,U]},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=TQ(O,2),E=C[0],k=C[1],I=g(_),P=TQ(I,1),R=P[0];if(!E&&!R&&(v=_+1),E&&R&&(y=_-1),!E&&R){b=k;break}x++}return b||h},PQ=function(e){var n=Wt(e)?[]:e.toString().split(tge);return[{words:n}]},cCt=function(e){var n=e.width,r=e.scaleToFit,i=e.children,o=e.style,a=e.breakAll,s=e.maxLines;if((n||r)&&!Yl.isSsr){var l,c,u=nge({breakAll:a,children:i,style:o});if(u){var f=u.wordsWithComputedWidth,d=u.spaceWidth;l=f,c=d}else return PQ(i);return lCt({breakAll:a,children:i,maxLines:s,style:o},l,c,n,r)}return PQ(i)},MQ="#808080",ZE=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?MQ:g,y=CQ(e,tCt),x=M.useMemo(function(){return cCt({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=CQ(y,nCt);if(!ti(r)||!ti(o))return null;var k=r+(Ye(b)?b:0),I=o+(Ye(_)?_:0),P;switch(m){case"start":P=SI("calc(".concat(c,")"));break;case"middle":P=SI("calc(".concat((x.length-1)/2," * -").concat(s," + (").concat(c," / 2))"));break;default:P=SI("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",P$({},jt(E,!0),{x:k,y:I,className:ke("recharts-text",O),textAnchor:h,fill:v.includes("url")?MQ:v}),x.map(function(z,B){var U=z.words.join(C?"":" ");return ue.createElement("tspan",{x:k,dy:B===0?P:s,key:U},U)}))};function Gf(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function uCt(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=Gf,n=(s,l)=>Gf(t(s),l),r=(s,l)=>t(s)-l):(e=t===Gf||t===uCt?t:fCt,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 fCt(){return 0}function rge(t){return t===null?NaN:+t}function*dCt(t,e){for(let n of t)n!=null&&(n=+n)>=n&&(yield n)}const hCt=PU(Gf),Pw=hCt.right;PU(rge).center;class kQ extends Map{constructor(e,n=gCt){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(AQ(this,e))}has(e){return super.has(AQ(this,e))}set(e,n){return super.set(pCt(this,e),n)}delete(e){return super.delete(mCt(this,e))}}function AQ({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function pCt({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function mCt({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function gCt(t){return t!==null&&typeof t=="object"?t.valueOf():t}function vCt(t=Gf){if(t===Gf)return ige;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 ige(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(te?1:0)}const yCt=Math.sqrt(50),xCt=Math.sqrt(10),bCt=Math.sqrt(2);function JE(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>=yCt?10:o>=xCt?5:o>=bCt?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);return n}function IQ(t,e){let n;for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function oge(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?ige:vCt(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));oge(t,e,h,p,i)}const o=t[e];let a=n,s=r;for(j0(t,n,e),i(t[r],o)>0&&j0(t,n,r);a0;)--s}i(t[n],o)===0?j0(t,n,s):(++s,j0(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function j0(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function _Ct(t,e,n){if(t=Float64Array.from(dCt(t)),!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return IQ(t);if(e>=1)return RQ(t);var r,i=(r-1)*e,o=Math.floor(i),a=RQ(oge(t,o).subarray(0,o+1)),s=IQ(t.subarray(o+1));return a+(s-a)*(i-o)}}function wCt(t,e,n=rge){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 SCt(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?bO(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?bO(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=CCt.exec(t))?new Io(e[1],e[2],e[3],1):(e=TCt.exec(t))?new Io(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=ECt.exec(t))?bO(e[1],e[2],e[3],e[4]):(e=PCt.exec(t))?bO(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=MCt.exec(t))?BQ(e[1],e[2]/100,e[3]/100,1):(e=kCt.exec(t))?BQ(e[1],e[2]/100,e[3]/100,e[4]):DQ.hasOwnProperty(t)?$Q(DQ[t]):t==="transparent"?new Io(NaN,NaN,NaN,0):null}function $Q(t){return new Io(t>>16&255,t>>8&255,t&255,1)}function bO(t,e,n,r){return r<=0&&(t=e=n=NaN),new Io(t,e,n,r)}function ICt(t){return t instanceof Mw||(t=A_(t)),t?(t=t.rgb(),new Io(t.r,t.g,t.b,t.opacity)):new Io}function I$(t,e,n,r){return arguments.length===1?ICt(t):new Io(t,e,n,r??1)}function Io(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}kU(Io,I$,sge(Mw,{brighter(t){return t=t==null?eP:Math.pow(eP,t),new Io(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?M_:Math.pow(M_,t),new Io(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Io(Vh(this.r),Vh(this.g),Vh(this.b),tP(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:FQ,formatHex:FQ,formatHex8:DCt,formatRgb:jQ,toString:jQ}));function FQ(){return`#${Th(this.r)}${Th(this.g)}${Th(this.b)}`}function DCt(){return`#${Th(this.r)}${Th(this.g)}${Th(this.b)}${Th((isNaN(this.opacity)?1:this.opacity)*255)}`}function jQ(){const t=tP(this.opacity);return`${t===1?"rgb(":"rgba("}${Vh(this.r)}, ${Vh(this.g)}, ${Vh(this.b)}${t===1?")":`, ${t})`}`}function tP(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Vh(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Th(t){return t=Vh(t),(t<16?"0":"")+t.toString(16)}function BQ(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Vs(t,e,n,r)}function lge(t){if(t instanceof Vs)return new Vs(t.h,t.s,t.l,t.opacity);if(t instanceof Mw||(t=A_(t)),!t)return new Vs;if(t instanceof Vs)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 Vs(a,s,l,t.opacity)}function LCt(t,e,n,r){return arguments.length===1?lge(t):new Vs(t,e,n,r??1)}function Vs(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}kU(Vs,LCt,sge(Mw,{brighter(t){return t=t==null?eP:Math.pow(eP,t),new Vs(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?M_:Math.pow(M_,t),new Vs(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 Io(OI(t>=240?t-240:t+120,i,r),OI(t,i,r),OI(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Vs(zQ(this.h),_O(this.s),_O(this.l),tP(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=tP(this.opacity);return`${t===1?"hsl(":"hsla("}${zQ(this.h)}, ${_O(this.s)*100}%, ${_O(this.l)*100}%${t===1?")":`, ${t})`}`}}));function zQ(t){return t=(t||0)%360,t<0?t+360:t}function _O(t){return Math.max(0,Math.min(1,t||0))}function OI(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 AU=t=>()=>t;function NCt(t,e){return function(n){return t+n*e}}function $Ct(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 FCt(t){return(t=+t)==1?cge:function(e,n){return n-e?$Ct(e,n,t):AU(isNaN(e)?n:e)}}function cge(t,e){var n=e-t;return n?NCt(t,n):AU(isNaN(t)?e:t)}const UQ=function t(e){var n=FCt(e);function r(i,o){var a=n((i=I$(i)).r,(o=I$(o)).r),s=n(i.g,o.g),l=n(i.b,o.b),c=cge(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 jCt(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:nP(r,i)})),n=CI.lastIndex;return ne&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function YCt(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return i2?KCt:YCt,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),nP)))(d)))},f.domain=function(d){return arguments.length?(t=Array.from(d,rP),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=RU,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 IU(){return xk()(lo,lo)}function ZCt(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function iP(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 Sv(t){return t=iP(Math.abs(t)),t?t[1]:NaN}function JCt(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 eTt(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var tTt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function R_(t){if(!(e=tTt.exec(t)))throw new Error("invalid format: "+t);var e;return new DU({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]})}R_.prototype=DU.prototype;function DU(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+""}DU.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 nTt(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 uge;function rTt(t,e){var n=iP(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(uge=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")+iP(t,Math.max(0,e+o-1))[0]}function VQ(t,e){var n=iP(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 GQ={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:ZCt,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)=>VQ(t*100,e),r:VQ,s:rTt,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function HQ(t){return t}var qQ=Array.prototype.map,XQ=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function iTt(t){var e=t.grouping===void 0||t.thousands===void 0?HQ:JCt(qQ.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?HQ:eTt(qQ.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=R_(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"):GQ[_]||(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=GQ[_],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=nTt(I)),B&&+I==0&&p!=="+"&&(B=!1),P=(B?p==="("?p:s:p==="-"||p==="("?"":p)+P,R=(_==="s"?XQ[8+uge/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 U=P.length+I.length+R.length,W=U>1)+P+I+R+W.slice(U);break;default:I=W+P+I+R;break}return o(I)}return k.toString=function(){return f+""},k}function u(f,d){var h=c((f=R_(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(Sv(d)/3)))*3,m=Math.pow(10,-p),g=XQ[8+p/3];return function(v){return h(m*v)+g}}return{format:c,formatPrefix:u}}var wO,LU,fge;oTt({thousands:",",grouping:[3],currency:["$",""]});function oTt(t){return wO=iTt(t),LU=wO.format,fge=wO.formatPrefix,wO}function aTt(t){return Math.max(0,-Sv(Math.abs(t)))}function sTt(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Sv(e)/3)))*3-Sv(Math.abs(t)))}function lTt(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Sv(e)-Sv(t))+1}function dge(t,e,n,r){var i=A$(t,e,n),o;switch(r=R_(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(o=sTt(i,a))&&(r.precision=o),fge(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=lTt(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=aTt(i))&&(r.precision=o-(r.type==="%")*2);break}}return LU(r)}function Ad(t){var e=t.domain;return t.ticks=function(n){var r=e();return M$(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return dge(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=k$(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 oP(){var t=IU();return t.copy=function(){return kw(t,oP())},Cs.apply(t,arguments),Ad(t)}function hge(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,rP),n):t.slice()},n.unknown=function(r){return arguments.length?(e=r,n):e},n.copy=function(){return hge(t).unknown(e)},t=arguments.length?Array.from(t,rP):[0,1],Ad(n)}function pge(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 hTt(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 KQ(t){return(e,n)=>-t(-e,n)}function NU(t){const e=t(QQ,YQ),n=e.domain;let r=10,i,o;function a(){return i=hTt(r),o=dTt(r),n()[0]<0?(i=KQ(i),o=KQ(o),t(cTt,uTt)):t(QQ,YQ),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=R_(l)).precision==null&&(l.trim=!0),l=LU(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(pge(n(),{floor:s=>o(Math.floor(i(s))),ceil:s=>o(Math.ceil(i(s)))})),e}function mge(){const t=NU(xk()).domain([1,10]);return t.copy=()=>kw(t,mge()).base(t.base()),Cs.apply(t,arguments),t}function ZQ(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function JQ(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function $U(t){var e=1,n=t(ZQ(e),JQ(e));return n.constant=function(r){return arguments.length?t(ZQ(e=+r),JQ(e)):e},Ad(n)}function gge(){var t=$U(xk());return t.copy=function(){return kw(t,gge()).constant(t.constant())},Cs.apply(t,arguments)}function eY(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function pTt(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function mTt(t){return t<0?-t*t:t*t}function FU(t){var e=t(lo,lo),n=1;function r(){return n===1?t(lo,lo):n===.5?t(pTt,mTt):t(eY(n),eY(1/n))}return e.exponent=function(i){return arguments.length?(n=+i,r()):n},Ad(e)}function jU(){var t=FU(xk());return t.copy=function(){return kw(t,jU()).exponent(t.exponent())},Cs.apply(t,arguments),t}function gTt(){return jU.apply(null,arguments).exponent(.5)}function tY(t){return Math.sign(t)*t*t}function vTt(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function vge(){var t=IU(),e=[0,1],n=!1,r;function i(o){var a=vTt(t(o));return isNaN(a)?r:n?Math.round(a):a}return i.invert=function(o){return t.invert(tY(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,rP)).map(tY)),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 vge(t.domain(),e).round(n).clamp(t.clamp()).unknown(r)},Cs.apply(i,arguments),Ad(i)}function yge(){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 xge().domain([t,e]).range(i).unknown(o)},Cs.apply(Ad(a),arguments)}function bge(){var t=[.5],e=[0,1],n,r=1;function i(o){return o!=null&&o<=o?e[Pw(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 bge().domain(t).range(e).unknown(n)},Cs.apply(i,arguments)}const TI=new Date,EI=new Date;function ri(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(cri(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)=>(TI.setTime(+o),EI.setTime(+a),t(TI),t(EI),Math.floor(n(TI,EI))),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 aP=ri(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);aP.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?ri(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):aP);aP.range;const qc=1e3,Za=qc*60,Xc=Za*60,vu=Xc*24,BU=vu*7,nY=vu*30,PI=vu*365,Eh=ri(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*qc)},(t,e)=>(e-t)/qc,t=>t.getUTCSeconds());Eh.range;const zU=ri(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*qc)},(t,e)=>{t.setTime(+t+e*Za)},(t,e)=>(e-t)/Za,t=>t.getMinutes());zU.range;const UU=ri(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*Za)},(t,e)=>(e-t)/Za,t=>t.getUTCMinutes());UU.range;const WU=ri(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*qc-t.getMinutes()*Za)},(t,e)=>{t.setTime(+t+e*Xc)},(t,e)=>(e-t)/Xc,t=>t.getHours());WU.range;const VU=ri(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Xc)},(t,e)=>(e-t)/Xc,t=>t.getUTCHours());VU.range;const Aw=ri(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Za)/vu,t=>t.getDate()-1);Aw.range;const bk=ri(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/vu,t=>t.getUTCDate()-1);bk.range;const _ge=ri(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/vu,t=>Math.floor(t/vu));_ge.range;function Bp(t){return ri(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())*Za)/BU)}const _k=Bp(0),sP=Bp(1),yTt=Bp(2),xTt=Bp(3),Ov=Bp(4),bTt=Bp(5),_Tt=Bp(6);_k.range;sP.range;yTt.range;xTt.range;Ov.range;bTt.range;_Tt.range;function zp(t){return ri(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)/BU)}const wk=zp(0),lP=zp(1),wTt=zp(2),STt=zp(3),Cv=zp(4),OTt=zp(5),CTt=zp(6);wk.range;lP.range;wTt.range;STt.range;Cv.range;OTt.range;CTt.range;const GU=ri(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());GU.range;const HU=ri(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());HU.range;const yu=ri(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());yu.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:ri(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)});yu.range;const xu=ri(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());xu.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:ri(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)});xu.range;function wge(t,e,n,r,i,o){const a=[[Eh,1,qc],[Eh,5,5*qc],[Eh,15,15*qc],[Eh,30,30*qc],[o,1,Za],[o,5,5*Za],[o,15,15*Za],[o,30,30*Za],[i,1,Xc],[i,3,3*Xc],[i,6,6*Xc],[i,12,12*Xc],[r,1,vu],[r,2,2*vu],[n,1,BU],[e,1,nY],[e,3,3*nY],[t,1,PI]];function s(c,u,f){const d=ug).right(a,d);if(h===a.length)return t.every(A$(c/PI,u/PI,f));if(h===0)return aP.every(Math.max(A$(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=kI(B0(re.y,0,1)),ce=F.getUTCDay(),F=ce>4||ce===0?lP.ceil(F):lP(F),F=bk.offset(F,(re.V-1)*7),re.y=F.getUTCFullYear(),re.m=F.getUTCMonth(),re.d=F.getUTCDate()+(re.w+6)%7):(F=MI(B0(re.y,0,1)),ce=F.getDay(),F=ce>4||ce===0?sP.ceil(F):sP(F),F=Aw.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?kI(B0(re.y,0,1)).getUTCDay():MI(B0(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,kI(re)):MI(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 rY?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 U(J){return o[J.getDay()]}function W(J){return l[J.getMonth()]}function $(J){return s[J.getMonth()]}function N(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 rY={"-":"",_:" ",0:"0"},gi=/^\s*\d+/,ATt=/^%/,RTt=/[\\^$*+?|[\]().{}]/g;function hn(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o[e.toLowerCase(),n]))}function DTt(t,e,n){var r=gi.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function LTt(t,e,n){var r=gi.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function NTt(t,e,n){var r=gi.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function $Tt(t,e,n){var r=gi.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function FTt(t,e,n){var r=gi.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function iY(t,e,n){var r=gi.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function oY(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 jTt(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 BTt(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 zTt(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 aY(t,e,n){var r=gi.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function UTt(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 sY(t,e,n){var r=gi.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function WTt(t,e,n){var r=gi.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function VTt(t,e,n){var r=gi.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function GTt(t,e,n){var r=gi.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function HTt(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 qTt(t,e,n){var r=ATt.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function XTt(t,e,n){var r=gi.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function QTt(t,e,n){var r=gi.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function lY(t,e){return hn(t.getDate(),e,2)}function YTt(t,e){return hn(t.getHours(),e,2)}function KTt(t,e){return hn(t.getHours()%12||12,e,2)}function ZTt(t,e){return hn(1+Aw.count(yu(t),t),e,3)}function Sge(t,e){return hn(t.getMilliseconds(),e,3)}function JTt(t,e){return Sge(t,e)+"000"}function eEt(t,e){return hn(t.getMonth()+1,e,2)}function tEt(t,e){return hn(t.getMinutes(),e,2)}function nEt(t,e){return hn(t.getSeconds(),e,2)}function rEt(t){var e=t.getDay();return e===0?7:e}function iEt(t,e){return hn(_k.count(yu(t)-1,t),e,2)}function Oge(t){var e=t.getDay();return e>=4||e===0?Ov(t):Ov.ceil(t)}function oEt(t,e){return t=Oge(t),hn(Ov.count(yu(t),t)+(yu(t).getDay()===4),e,2)}function aEt(t){return t.getDay()}function sEt(t,e){return hn(sP.count(yu(t)-1,t),e,2)}function lEt(t,e){return hn(t.getFullYear()%100,e,2)}function cEt(t,e){return t=Oge(t),hn(t.getFullYear()%100,e,2)}function uEt(t,e){return hn(t.getFullYear()%1e4,e,4)}function fEt(t,e){var n=t.getDay();return t=n>=4||n===0?Ov(t):Ov.ceil(t),hn(t.getFullYear()%1e4,e,4)}function dEt(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+hn(e/60|0,"0",2)+hn(e%60,"0",2)}function cY(t,e){return hn(t.getUTCDate(),e,2)}function hEt(t,e){return hn(t.getUTCHours(),e,2)}function pEt(t,e){return hn(t.getUTCHours()%12||12,e,2)}function mEt(t,e){return hn(1+bk.count(xu(t),t),e,3)}function Cge(t,e){return hn(t.getUTCMilliseconds(),e,3)}function gEt(t,e){return Cge(t,e)+"000"}function vEt(t,e){return hn(t.getUTCMonth()+1,e,2)}function yEt(t,e){return hn(t.getUTCMinutes(),e,2)}function xEt(t,e){return hn(t.getUTCSeconds(),e,2)}function bEt(t){var e=t.getUTCDay();return e===0?7:e}function _Et(t,e){return hn(wk.count(xu(t)-1,t),e,2)}function Tge(t){var e=t.getUTCDay();return e>=4||e===0?Cv(t):Cv.ceil(t)}function wEt(t,e){return t=Tge(t),hn(Cv.count(xu(t),t)+(xu(t).getUTCDay()===4),e,2)}function SEt(t){return t.getUTCDay()}function OEt(t,e){return hn(lP.count(xu(t)-1,t),e,2)}function CEt(t,e){return hn(t.getUTCFullYear()%100,e,2)}function TEt(t,e){return t=Tge(t),hn(t.getUTCFullYear()%100,e,2)}function EEt(t,e){return hn(t.getUTCFullYear()%1e4,e,4)}function PEt(t,e){var n=t.getUTCDay();return t=n>=4||n===0?Cv(t):Cv.ceil(t),hn(t.getUTCFullYear()%1e4,e,4)}function MEt(){return"+0000"}function uY(){return"%"}function fY(t){return+t}function dY(t){return Math.floor(+t/1e3)}var hm,Ege,Pge;kEt({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 kEt(t){return hm=kTt(t),Ege=hm.format,hm.parse,Pge=hm.utcFormat,hm.utcParse,hm}function AEt(t){return new Date(t)}function REt(t){return t instanceof Date?+t:+new Date(+t)}function qU(t,e,n,r,i,o,a,s,l,c){var u=IU(),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)=>_Ct(t,o/r))},n.copy=function(){return Rge(e).domain(t)},Tu.apply(n,arguments)}function Ok(){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 BEt=jEt,zEt=Nge,UEt=BEt,WEt=Uy;function VEt(t){return t&&t.length?zEt(t,WEt,UEt):void 0}var GEt=VEt;const Ef=$t(GEt);function HEt(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};dt.decimalPlaces=dt.dp=function(){var t=this,e=t.d.length-1,n=(e-t.e)*Yn;if(e=t.d[e],e)for(;e%10==0;e/=10)n--;return n<0?0:n};dt.dividedBy=dt.div=function(t){return iu(this,new this.constructor(t))};dt.dividedToIntegerBy=dt.idiv=function(t){var e=this,n=e.constructor;return Nn(iu(e,new n(t),0,1),n.precision)};dt.equals=dt.eq=function(t){return!this.cmp(t)};dt.exponent=function(){return Gr(this)};dt.greaterThan=dt.gt=function(t){return this.cmp(t)>0};dt.greaterThanOrEqualTo=dt.gte=function(t){return this.cmp(t)>=0};dt.isInteger=dt.isint=function(){return this.e>this.d.length-2};dt.isNegative=dt.isneg=function(){return this.s<0};dt.isPositive=dt.ispos=function(){return this.s>0};dt.isZero=function(){return this.s===0};dt.lessThan=dt.lt=function(t){return this.cmp(t)<0};dt.lessThanOrEqualTo=dt.lte=function(t){return this.cmp(t)<1};dt.logarithm=dt.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(gs+"NaN");if(n.s<1)throw Error(gs+(n.s?"NaN":"-Infinity"));return n.eq(ha)?new r(0):(dr=!1,e=iu(I_(n,o),I_(t,o),o),dr=!0,Nn(e,i))};dt.minus=dt.sub=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?Bge(e,t):Fge(e,(t.s=-t.s,t))};dt.modulo=dt.mod=function(t){var e,n=this,r=n.constructor,i=r.precision;if(t=new r(t),!t.s)throw Error(gs+"NaN");return n.s?(dr=!1,e=iu(n,t,0,1).times(t),dr=!0,n.minus(e)):Nn(new r(n),i)};dt.naturalExponential=dt.exp=function(){return jge(this)};dt.naturalLogarithm=dt.ln=function(){return I_(this)};dt.negated=dt.neg=function(){var t=new this.constructor(this);return t.s=-t.s||0,t};dt.plus=dt.add=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?Fge(e,t):Bge(e,(t.s=-t.s,t))};dt.precision=dt.sd=function(t){var e,n,r,i=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(Gh+t);if(e=Gr(i)+1,r=i.d.length-1,n=r*Yn+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};dt.squareRoot=dt.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(gs+"NaN")}for(t=Gr(s),dr=!1,i=Math.sqrt(+s),i==0||i==1/0?(e=$l(s.d),(e.length+t)%2==0&&(e+="0"),i=Math.sqrt(e),t=Gy((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(iu(s,o,a+2)).times(.5),$l(o.d).slice(0,a)===(e=$l(r.d)).slice(0,a)){if(e=e.slice(a-3,a+1),i==a&&e=="4999"){if(Nn(o,n+1,0),o.times(o).eq(s)){r=o;break}}else if(e!="9999")break;a+=4}return dr=!0,Nn(r,n)};dt.times=dt.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%li|0,e=s/li|0;o[i]=(o[i]+e)%li|0}for(;!o[--a];)o.pop();return e?++n:o.shift(),t.d=o,t.e=n,dr?Nn(t,f.precision):t};dt.toDecimalPlaces=dt.todp=function(t,e){var n=this,r=n.constructor;return n=new r(n),t===void 0?n:(nc(t,0,Vy),e===void 0?e=r.rounding:nc(e,0,8),Nn(n,t+Gr(n)+1,e))};dt.toExponential=function(t,e){var n,r=this,i=r.constructor;return t===void 0?n=pp(r,!0):(nc(t,0,Vy),e===void 0?e=i.rounding:nc(e,0,8),r=Nn(new i(r),t+1,e),n=pp(r,!0,t+1)),n};dt.toFixed=function(t,e){var n,r,i=this,o=i.constructor;return t===void 0?pp(i):(nc(t,0,Vy),e===void 0?e=o.rounding:nc(e,0,8),r=Nn(new o(i),t+Gr(i)+1,e),n=pp(r.abs(),!1,t+Gr(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};dt.toInteger=dt.toint=function(){var t=this,e=t.constructor;return Nn(new e(t),Gr(t)+1,e.rounding)};dt.toNumber=function(){return+this};dt.toPower=dt.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(gs+"Infinity");return s}if(s.eq(ha))return s;if(r=l.precision,t.eq(ha))return Nn(s,r);if(e=t.e,n=t.d.length-1,a=e>=n,o=s.s,a){if((n=u<0?-u:u)<=$ge){for(i=new l(ha),e=Math.ceil(r/Yn+4),dr=!1;n%2&&(i=i.times(s),mY(i.d,e)),n=Gy(n/2),n!==0;)s=s.times(s),mY(s.d,e);return dr=!0,t.s<0?new l(ha).div(i):Nn(i,r)}}else if(o<0)throw Error(gs+"NaN");return o=o<0&&t.d[Math.max(e,n)]&1?-1:1,s.s=1,dr=!1,i=t.times(I_(s,r+c)),dr=!0,i=jge(i),i.s=o,i};dt.toPrecision=function(t,e){var n,r,i=this,o=i.constructor;return t===void 0?(n=Gr(i),r=pp(i,n<=o.toExpNeg||n>=o.toExpPos)):(nc(t,1,Vy),e===void 0?e=o.rounding:nc(e,0,8),i=Nn(new o(i),t,e),n=Gr(i),r=pp(i,t<=n||n<=o.toExpNeg,t)),r};dt.toSignificantDigits=dt.tosd=function(t,e){var n=this,r=n.constructor;return t===void 0?(t=r.precision,e=r.rounding):(nc(t,1,Vy),e===void 0?e=r.rounding:nc(e,0,8)),Nn(new r(n),t,e)};dt.toString=dt.valueOf=dt.val=dt.toJSON=dt[Symbol.for("nodejs.util.inspect.custom")]=function(){var t=this,e=Gr(t),n=t.constructor;return pp(t,e<=n.toExpNeg||e>=n.toExpPos)};function Fge(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)),dr?Nn(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/Yn),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)/li|0,l[o]%=li;for(n&&(l.unshift(n),++i),s=l.length;l[--s]==0;)l.pop();return e.d=l,e.e=i,dr?Nn(e,f):e}function nc(t,e,n){if(t!==~~t||tn)throw Error(Gh+t)}function $l(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(gs+"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+(Gr(r)-Gr(i))+1:y=o,y<0)return new E(0);if(y=y/Yn+2|0,c=0,O==1)for(u=0,P=P[0],y++;(c<_||u)&&y--;c++)x=u*li+(I[c]||0),p[c]=x/P|0,u=x%P|0;else{for(u=li/(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=li/2&&++S;do u=0,s=e(P,m,O,g),s<0?(v=m[0],O!=g&&(v=v*li+(m[1]||0)),u=v/S|0,u>1?(u>=li&&(u=li-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(YU+Gr(t));if(!t.s)return new u(ha);for(e==null?(dr=!1,s=f):s=e,a=new u(.03125);t.abs().gte(.1);)t=t.times(a),c+=5;for(r=Math.log(nh(2,c))/Math.LN10*2+5|0,s+=r,n=i=o=new u(ha),u.precision=s;;){if(i=Nn(i.times(t),s),n=n.times(++l),a=o.plus(iu(i,n,s)),$l(a.d).slice(0,s)===$l(o.d).slice(0,s)){for(;c--;)o=Nn(o.times(o),s);return u.precision=f,e==null?(dr=!0,Nn(o,f)):o}o=a}}function Gr(t){for(var e=t.e*Yn,n=t.d[0];n>=10;n/=10)e++;return e}function AI(t,e,n){if(e>t.LN10.sd())throw dr=!0,n&&(t.precision=n),Error(gs+"LN10 precision limit exceeded");return Nn(new t(t.LN10),e)}function ff(t){for(var e="";t--;)e+="0";return e}function I_(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(gs+(h.s?"NaN":"-Infinity"));if(h.eq(ha))return new m(0);if(e==null?(dr=!1,c=g):c=e,h.eq(10))return e==null&&(dr=!0),AI(m,c);if(c+=d,m.precision=c,n=$l(p),r=n.charAt(0),o=Gr(h),Math.abs(o)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)h=h.times(t),n=$l(h.d),r=n.charAt(0),f++;o=Gr(h),r>1?(h=new m("0."+n),o++):h=new m(r+"."+n.slice(1))}else return l=AI(m,c+2,g).times(o+""),h=I_(new m(r+"."+n.slice(1)),c-d).plus(l),m.precision=g,e==null?(dr=!0,Nn(h,g)):h;for(s=a=h=iu(h.minus(ha),h.plus(ha),c),u=Nn(h.times(h),c),i=3;;){if(a=Nn(a.times(u),c),l=s.plus(iu(a,new m(i),c)),$l(l.d).slice(0,c)===$l(s.d).slice(0,c))return s=s.times(2),o!==0&&(s=s.plus(AI(m,c+2,g).times(o+""))),s=iu(s,new m(f),c),m.precision=g,e==null?(dr=!0,Nn(s,g)):s;s=l,i+=2}}function pY(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=Gy(n/Yn),t.d=[],r=(n+1)%Yn,n<0&&(r+=Yn),rcP||t.e<-cP))throw Error(YU+n)}else t.s=0,t.e=0,t.d=[0];return t}function Nn(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+=Yn,i=e,c=f[u=0];else{if(u=Math.ceil((r+1)/Yn),o=f.length,u>=o)return t;for(c=o=f[u],a=1;o>=10;o/=10)a++;r%=Yn,i=r-Yn+a}if(n!==void 0&&(o=nh(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/nh(10,a-i):0:f[u-1])%10&1||n==(t.s<0?8:7))),e<1||!f[0])return l?(o=Gr(t),f.length=1,e=e-o-1,f[0]=nh(10,(Yn-e%Yn)%Yn),t.e=Gy(-e/Yn)||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=nh(10,Yn-r),f[u]=i>0?(c/nh(10,a-i)%nh(10,i)|0)*o:0),l)for(;;)if(u==0){(f[0]+=o)==li&&(f[0]=1,++t.e);break}else{if(f[u]+=o,f[u]!=li)break;f[u--]=0,o=1}for(r=f.length;f[--r]===0;)f.pop();if(dr&&(t.e>cP||t.e<-cP))throw Error(YU+Gr(t));return t}function Bge(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),dr?Nn(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/Yn),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)+ff(r):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+ff(-i-1)+o,n&&(r=n-a)>0&&(o+=ff(r))):i>=a?(o+=ff(i+1-a),n&&(r=n-i-1)>0&&(o=o+"."+ff(r))):((r=i+1)0&&(i+1===a&&(o+="."),o+=ff(r))),t.s<0?"-"+o:o}function mY(t,e){if(t.length>e)return t.length=e,!0}function zge(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(Gh+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 pY(a,o.toString())}else if(typeof o!="string")throw Error(Gh+o);if(o.charCodeAt(0)===45?(o=o.slice(1),a.s=-1):a.s=1,pPt.test(o))pY(a,o);else throw Error(Gh+o)}if(i.prototype=dt,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=zge,i.config=i.set=mPt,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(Gh+n+": "+r);if((r=t[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Gh+n+": "+r);return this}var KU=zge(hPt);ha=new KU(1);const Rn=KU;function gPt(t){return bPt(t)||xPt(t)||yPt(t)||vPt()}function vPt(){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 yPt(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 xPt(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function bPt(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=e?n.apply(void 0,i):t(e-a,gY(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 LPt(t){if(Array.isArray(t))return t}function Hge(t){var e=D_(t,2),n=e[0],r=e[1],i=n,o=r;return n>r&&(i=r,o=n),[i,o]}function qge(t,e,n){if(t.lte(0))return new Rn(0);var r=Ek.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 NPt(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(Ek.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=OPt(SPt(function(l){return i.add(new Rn(l-a).mul(r)).toNumber()}),$$);return s(0,e)}function Xge(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=qge(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?Xge(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 $Pt(t){var e=D_(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=Hge([n,r]),l=D_(s,2),c=l[0],u=l[1];if(c===-1/0||u===1/0){var f=u===1/0?[c].concat(j$($$(0,i-1).map(function(){return 1/0}))):[].concat(j$($$(0,i-1).map(function(){return-1/0})),[u]);return n>r?F$(f):f}if(c===u)return NPt(c,i,o);var d=Xge(c,u,a,o),h=d.step,p=d.tickMin,m=d.tickMax,g=Ek.rangeStep(p,m.add(new Rn(.1).mul(h)),h);return n>r?F$(g):g}function FPt(t,e){var n=D_(t,2),r=n[0],i=n[1],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=Hge([r,i]),s=D_(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=qge(new Rn(c).sub(l).div(u-1),o,0),d=[].concat(j$(Ek.rangeStep(new Rn(l),new Rn(c).sub(new Rn(.99).mul(f)),f)),[c]);return r>i?F$(d):d}var jPt=Vge($Pt),BPt=Vge(FPt),zPt="Invariant failed";function mp(t,e){throw new Error(zPt)}var UPt=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function uP(){return uP=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 QPt(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 Hy(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=XPt(t,UPt),u=jt(c,!1);t.direction==="x"&&s.type!=="number"&&mp();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 _=WPt(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(Gn,uP({className:"recharts-errorBar",key:"bar-".concat(y.map(function(U){return"".concat(U.x1,"-").concat(U.x2,"-").concat(U.y1,"-").concat(U.y2)}))},u),y.map(function(U){return ue.createElement("line",uP({},U,{key:"line-".concat(U.x1,"-").concat(U.x2,"-").concat(U.y1,"-").concat(U.y2)}))}))});return ue.createElement(Gn,{className:"recharts-errorBars"},f)}Hy.defaultProps={stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"};Hy.displayName="ErrorBar";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 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 RI(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(qs(f-u)!==qs(d-f)){var p=[];if(qs(d-f)===qs(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},ZU=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},aMt=function(e){var n=e.barSize,r=e.totalSize,i=e.stackGroups,o=i===void 0?{}:i;if(!o)return{};for(var a={},s=Object.keys(o),l=0,c=s.length;l=0});if(v&&v.length){var y=v[0].props.barSize,x=v[0].props[g];a[x]||(a[x]=[]);var b=Wt(y)?n:y;a[x].push({item:v[0],stackList:v.slice(1),barSize:Wt(b)?void 0:hp(b,r,0)})}}return a},sMt=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=hp(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(bY(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=hp(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(bY(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},lMt=function(e,n,r,i){var o=r.children,a=r.width,s=r.margin,l=a-(s.left||0)-(s.right||0),c=Qge({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 Ua(Ua({},e),{},Fg({},h,e[h]+(f||0)));if((m==="horizontal"||m==="vertical"&&h==="center")&&p!=="middle"&&Ye(e[p]))return Ua(Ua({},e),{},Fg({},p,e[p]+(d||0)))}return e},cMt=function(e,n,r){return Wt(n)?!0:e==="horizontal"?n==="yAxis":e==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},Yge=function(e,n,r,i,o){var a=n.props.children,s=os(a,Hy).filter(function(c){return cMt(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(Wt(f))return c;var d=Array.isArray(f)?[Ck(f),Ef(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},uMt=function(e,n,r,i,o){var a=n.map(function(s){return Yge(e,s,r,o,i)}).filter(function(s){return!Wt(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},Kge=function(e,n,r,i,o){var a=n.map(function(l){var c=l.props.dataKey;return r==="number"&&c&&Yge(e,l,c,i)||sb(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?qs(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!Fy(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}})},II=new WeakMap,SO=function(e,n){if(typeof n!="function")return e;II.has(e)||II.set(e,new WeakMap);var r=II.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},fMt=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:P_(),realScaleType:"band"}:a==="radial"&&s==="angleAxis"?{scale:oP(),realScaleType:"linear"}:o==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:ab(),realScaleType:"point"}:o==="category"?{scale:P_(),realScaleType:"band"}:{scale:oP(),realScaleType:"linear"};if(Tw(i)){var l="scale".concat(dk(i));return{scale:(hY[l]||ab)(),realScaleType:hY[l]?l:"point"}}return Bt(i)?{scale:i}:{scale:ab(),realScaleType:"point"}},_Y=1e-4,dMt=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])-_Y,a=Math.max(i[0],i[1])+_Y,s=e(n[0]),l=e(n[r-1]);(sa||la)&&e.domain([n[0],n[r-1]])}},hMt=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])}},gMt=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)}},vMt={sign:mMt,expand:Uvt,none:vv,silhouette:Wvt,wiggle:Vvt,positive:gMt},yMt=function(e,n,r){var i=n.map(function(s){return s.props.dataKey}),o=vMt[r],a=zvt().keys(i).value(function(s,l){return+ho(s,l,0)}).order(d$).offset(o);return a(e)},xMt=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(ti(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[jy("_stackId_")]={numericAxisId:r,cateAxisId:i,items:[d]};return Ua(Ua({},f),{},Fg({},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 Ua(Ua({},m),{},Fg({},g,{numericAxisId:r,cateAxisId:i,items:v.items,stackedData:yMt(e,v.items,o)}))},p)}return Ua(Ua({},f),{},Fg({},d,h))},u)},bMt=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=jPt(c,o,s);return e.domain([Ck(u),Ef(u)]),{niceTicks:u}}if(o&&i==="number"){var f=e.domain(),d=BPt(f,o,s);return{niceTicks:d}}return null};function fP(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&&!Wt(i[e.dataKey])){var s=NE(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,Wt(a)?e.dataKey:a);return Wt(l)?null:e.scale(l)}var wY=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 Wt(l)?null:n.scale(l)-o/2+i},_Mt=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]},wMt=function(e,n){var r=e.props.stackId;if(ti(r)){var i=n[r];if(i){var o=i.items.indexOf(e);return o>=0?i.stackedData[o]:null}}return null},SMt=function(e){return e.reduce(function(n,r){return[Ck(r.concat([n[0]]).filter(Ye)),Ef(r.concat([n[1]]).filter(Ye))]},[1/0,-1/0])},eve=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=SMt(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})},SY=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,OY=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,U$=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(SY.test(e[0])){var o=+SY.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(OY.test(e[1])){var a=+OY.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},dP=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=TU(n,function(f){return f.coordinate}),a=1/0,s=1,l=o.length;sa&&(c=2*Math.PI-c),{radius:s,angle:EMt(c),angleInRadian:c}},kMt=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}},AMt=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},PY=function(e,n){var r=e.x,i=e.y,o=MMt({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=kMt(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?EY(EY({},n),{},{radius:a,angle:AMt(h,n)}):null};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)}var RMt=["offset"];function IMt(t){return $Mt(t)||NMt(t)||LMt(t)||DMt()}function DMt(){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 LMt(t,e){if(t){if(typeof t=="string")return W$(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 W$(t,e)}}function NMt(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function $Mt(t){if(Array.isArray(t))return W$(t)}function W$(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 jMt(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 MY(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 Kr(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)&&_T.isElement(h)&&nu(h.type).endsWith("Chart");return ue.Children.map(h,function(U){return _T.isElement(U)?M.cloneElement(U,yO({width:L,height:z},B?{style:yO({height:"100%",width:"100%",maxHeight:z,maxWidth:L},U.props.style)}:{})):U})},[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:yO(yO({},b),{},{width:a,height:l,minWidth:u,minHeight:f,maxHeight:d}),ref:_},P)}),Kme=function(e){return null};Kme.displayName="Cell";function C_(t){"@babel/helpers - typeof";return C_=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},C_(t)}function gQ(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 T$(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||Yl.isSsr)return{width:0,height:0};var r=NOt(n),i=JSON.stringify({text:e,copyStyle:r});if(dm.widthCache[i])return dm.widthCache[i];try{var o=document.getElementById(vQ);o||(o=document.createElement("span"),o.setAttribute("id",vQ),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var a=T$(T$({},LOt),r);Object.assign(o.style,a),o.textContent="".concat(e);var s=o.getBoundingClientRect(),l={width:s.width,height:s.height};return dm.widthCache[i]=l,++dm.cacheCount>DOt&&(dm.cacheCount=0,dm.widthCache={}),l}catch{return{width:0,height:0}}},$Ot=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}};function T_(t){"@babel/helpers - typeof";return T_=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},T_(t)}function KE(t,e){return zOt(t)||BOt(t,e)||jOt(t,e)||FOt()}function FOt(){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 jOt(t,e){if(t){if(typeof t=="string")return yQ(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 yQ(t,e)}}function yQ(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 tCt(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 OQ(t,e){return oCt(t)||iCt(t,e)||rCt(t,e)||nCt()}function nCt(){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 rCt(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);n0&&arguments[0]!==void 0?arguments[0]:[];return L.reduce(function(z,B){var U=B.word,W=B.width,$=z[z.length-1];if($&&(i==null||o||$.width+W+rB.width?z:B})};if(!u)return h;for(var m="…",g=function(L){var z=f.slice(0,L),B=tge({breakAll:c,style:l,children:z+m}).wordsWithComputedWidth,U=d(B),W=U.length>a||p(U).width>Number(i);return[W,U]},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=OQ(O,2),E=C[0],k=C[1],I=g(_),P=OQ(I,1),R=P[0];if(!E&&!R&&(v=_+1),E&&R&&(y=_-1),!E&&R){b=k;break}x++}return b||h},TQ=function(e){var n=Wt(e)?[]:e.toString().split(ege);return[{words:n}]},sCt=function(e){var n=e.width,r=e.scaleToFit,i=e.children,o=e.style,a=e.breakAll,s=e.maxLines;if((n||r)&&!Yl.isSsr){var l,c,u=tge({breakAll:a,children:i,style:o});if(u){var f=u.wordsWithComputedWidth,d=u.spaceWidth;l=f,c=d}else return TQ(i);return aCt({breakAll:a,children:i,maxLines:s,style:o},l,c,n,r)}return TQ(i)},EQ="#808080",ZE=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?EQ:g,y=SQ(e,JOt),x=M.useMemo(function(){return sCt({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=SQ(y,eCt);if(!ti(r)||!ti(o))return null;var k=r+(Ye(b)?b:0),I=o+(Ye(_)?_:0),P;switch(m){case"start":P=wI("calc(".concat(c,")"));break;case"middle":P=wI("calc(".concat((x.length-1)/2," * -").concat(s," + (").concat(c," / 2))"));break;default:P=wI("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",E$({},jt(E,!0),{x:k,y:I,className:ke("recharts-text",O),textAnchor:h,fill:v.includes("url")?EQ:v}),x.map(function(z,B){var U=z.words.join(C?"":" ");return ue.createElement("tspan",{x:k,dy:B===0?P:s,key:U},U)}))};function Gf(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function lCt(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function EU(t){let e,n,r;t.length!==2?(e=Gf,n=(s,l)=>Gf(t(s),l),r=(s,l)=>t(s)-l):(e=t===Gf||t===lCt?t:cCt,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 cCt(){return 0}function nge(t){return t===null?NaN:+t}function*uCt(t,e){for(let n of t)n!=null&&(n=+n)>=n&&(yield n)}const fCt=EU(Gf),Pw=fCt.right;EU(nge).center;class PQ extends Map{constructor(e,n=pCt){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(MQ(this,e))}has(e){return super.has(MQ(this,e))}set(e,n){return super.set(dCt(this,e),n)}delete(e){return super.delete(hCt(this,e))}}function MQ({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function dCt({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function hCt({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function pCt(t){return t!==null&&typeof t=="object"?t.valueOf():t}function mCt(t=Gf){if(t===Gf)return rge;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 rge(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(te?1:0)}const gCt=Math.sqrt(50),vCt=Math.sqrt(10),yCt=Math.sqrt(2);function JE(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>=gCt?10:o>=vCt?5:o>=yCt?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);return n}function AQ(t,e){let n;for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function ige(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?rge:mCt(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));ige(t,e,h,p,i)}const o=t[e];let a=n,s=r;for(F0(t,n,e),i(t[r],o)>0&&F0(t,n,r);a0;)--s}i(t[n],o)===0?F0(t,n,s):(++s,F0(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function F0(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function xCt(t,e,n){if(t=Float64Array.from(uCt(t)),!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return AQ(t);if(e>=1)return kQ(t);var r,i=(r-1)*e,o=Math.floor(i),a=kQ(ige(t,o).subarray(0,o+1)),s=AQ(t.subarray(o+1));return a+(s-a)*(i-o)}}function bCt(t,e,n=nge){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 _Ct(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?bO(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?bO(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=SCt.exec(t))?new Io(e[1],e[2],e[3],1):(e=OCt.exec(t))?new Io(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=CCt.exec(t))?bO(e[1],e[2],e[3],e[4]):(e=TCt.exec(t))?bO(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=ECt.exec(t))?FQ(e[1],e[2]/100,e[3]/100,1):(e=PCt.exec(t))?FQ(e[1],e[2]/100,e[3]/100,e[4]):RQ.hasOwnProperty(t)?LQ(RQ[t]):t==="transparent"?new Io(NaN,NaN,NaN,0):null}function LQ(t){return new Io(t>>16&255,t>>8&255,t&255,1)}function bO(t,e,n,r){return r<=0&&(t=e=n=NaN),new Io(t,e,n,r)}function ACt(t){return t instanceof Mw||(t=k_(t)),t?(t=t.rgb(),new Io(t.r,t.g,t.b,t.opacity)):new Io}function R$(t,e,n,r){return arguments.length===1?ACt(t):new Io(t,e,n,r??1)}function Io(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}MU(Io,R$,age(Mw,{brighter(t){return t=t==null?eP:Math.pow(eP,t),new Io(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?P_:Math.pow(P_,t),new Io(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Io(Vh(this.r),Vh(this.g),Vh(this.b),tP(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:NQ,formatHex:NQ,formatHex8:RCt,formatRgb:$Q,toString:$Q}));function NQ(){return`#${Th(this.r)}${Th(this.g)}${Th(this.b)}`}function RCt(){return`#${Th(this.r)}${Th(this.g)}${Th(this.b)}${Th((isNaN(this.opacity)?1:this.opacity)*255)}`}function $Q(){const t=tP(this.opacity);return`${t===1?"rgb(":"rgba("}${Vh(this.r)}, ${Vh(this.g)}, ${Vh(this.b)}${t===1?")":`, ${t})`}`}function tP(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Vh(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Th(t){return t=Vh(t),(t<16?"0":"")+t.toString(16)}function FQ(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Vs(t,e,n,r)}function sge(t){if(t instanceof Vs)return new Vs(t.h,t.s,t.l,t.opacity);if(t instanceof Mw||(t=k_(t)),!t)return new Vs;if(t instanceof Vs)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 Vs(a,s,l,t.opacity)}function ICt(t,e,n,r){return arguments.length===1?sge(t):new Vs(t,e,n,r??1)}function Vs(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}MU(Vs,ICt,age(Mw,{brighter(t){return t=t==null?eP:Math.pow(eP,t),new Vs(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?P_:Math.pow(P_,t),new Vs(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 Io(SI(t>=240?t-240:t+120,i,r),SI(t,i,r),SI(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Vs(jQ(this.h),_O(this.s),_O(this.l),tP(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=tP(this.opacity);return`${t===1?"hsl(":"hsla("}${jQ(this.h)}, ${_O(this.s)*100}%, ${_O(this.l)*100}%${t===1?")":`, ${t})`}`}}));function jQ(t){return t=(t||0)%360,t<0?t+360:t}function _O(t){return Math.max(0,Math.min(1,t||0))}function SI(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 kU=t=>()=>t;function DCt(t,e){return function(n){return t+n*e}}function LCt(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 NCt(t){return(t=+t)==1?lge:function(e,n){return n-e?LCt(e,n,t):kU(isNaN(e)?n:e)}}function lge(t,e){var n=e-t;return n?DCt(t,n):kU(isNaN(t)?e:t)}const BQ=function t(e){var n=NCt(e);function r(i,o){var a=n((i=R$(i)).r,(o=R$(o)).r),s=n(i.g,o.g),l=n(i.b,o.b),c=lge(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 $Ct(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:nP(r,i)})),n=OI.lastIndex;return ne&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function XCt(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return i2?QCt:XCt,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),nP)))(d)))},f.domain=function(d){return arguments.length?(t=Array.from(d,rP),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=AU,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 RU(){return xk()(lo,lo)}function YCt(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function iP(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 Sv(t){return t=iP(Math.abs(t)),t?t[1]:NaN}function KCt(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 ZCt(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var JCt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function A_(t){if(!(e=JCt.exec(t)))throw new Error("invalid format: "+t);var e;return new IU({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]})}A_.prototype=IU.prototype;function IU(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+""}IU.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 eTt(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 cge;function tTt(t,e){var n=iP(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(cge=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")+iP(t,Math.max(0,e+o-1))[0]}function UQ(t,e){var n=iP(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 WQ={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:YCt,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)=>UQ(t*100,e),r:UQ,s:tTt,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function VQ(t){return t}var GQ=Array.prototype.map,HQ=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function nTt(t){var e=t.grouping===void 0||t.thousands===void 0?VQ:KCt(GQ.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?VQ:ZCt(GQ.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=A_(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"):WQ[_]||(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=WQ[_],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=eTt(I)),B&&+I==0&&p!=="+"&&(B=!1),P=(B?p==="("?p:s:p==="-"||p==="("?"":p)+P,R=(_==="s"?HQ[8+cge/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 U=P.length+I.length+R.length,W=U>1)+P+I+R+W.slice(U);break;default:I=W+P+I+R;break}return o(I)}return k.toString=function(){return f+""},k}function u(f,d){var h=c((f=A_(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(Sv(d)/3)))*3,m=Math.pow(10,-p),g=HQ[8+p/3];return function(v){return h(m*v)+g}}return{format:c,formatPrefix:u}}var wO,DU,uge;rTt({thousands:",",grouping:[3],currency:["$",""]});function rTt(t){return wO=nTt(t),DU=wO.format,uge=wO.formatPrefix,wO}function iTt(t){return Math.max(0,-Sv(Math.abs(t)))}function oTt(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Sv(e)/3)))*3-Sv(Math.abs(t)))}function aTt(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Sv(e)-Sv(t))+1}function fge(t,e,n,r){var i=k$(t,e,n),o;switch(r=A_(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(o=oTt(i,a))&&(r.precision=o),uge(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=aTt(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=iTt(i))&&(r.precision=o-(r.type==="%")*2);break}}return DU(r)}function Ad(t){var e=t.domain;return t.ticks=function(n){var r=e();return P$(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return fge(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=M$(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 oP(){var t=RU();return t.copy=function(){return kw(t,oP())},Cs.apply(t,arguments),Ad(t)}function dge(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,rP),n):t.slice()},n.unknown=function(r){return arguments.length?(e=r,n):e},n.copy=function(){return dge(t).unknown(e)},t=arguments.length?Array.from(t,rP):[0,1],Ad(n)}function hge(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 fTt(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 QQ(t){return(e,n)=>-t(-e,n)}function LU(t){const e=t(qQ,XQ),n=e.domain;let r=10,i,o;function a(){return i=fTt(r),o=uTt(r),n()[0]<0?(i=QQ(i),o=QQ(o),t(sTt,lTt)):t(qQ,XQ),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=A_(l)).precision==null&&(l.trim=!0),l=DU(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(hge(n(),{floor:s=>o(Math.floor(i(s))),ceil:s=>o(Math.ceil(i(s)))})),e}function pge(){const t=LU(xk()).domain([1,10]);return t.copy=()=>kw(t,pge()).base(t.base()),Cs.apply(t,arguments),t}function YQ(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function KQ(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function NU(t){var e=1,n=t(YQ(e),KQ(e));return n.constant=function(r){return arguments.length?t(YQ(e=+r),KQ(e)):e},Ad(n)}function mge(){var t=NU(xk());return t.copy=function(){return kw(t,mge()).constant(t.constant())},Cs.apply(t,arguments)}function ZQ(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function dTt(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function hTt(t){return t<0?-t*t:t*t}function $U(t){var e=t(lo,lo),n=1;function r(){return n===1?t(lo,lo):n===.5?t(dTt,hTt):t(ZQ(n),ZQ(1/n))}return e.exponent=function(i){return arguments.length?(n=+i,r()):n},Ad(e)}function FU(){var t=$U(xk());return t.copy=function(){return kw(t,FU()).exponent(t.exponent())},Cs.apply(t,arguments),t}function pTt(){return FU.apply(null,arguments).exponent(.5)}function JQ(t){return Math.sign(t)*t*t}function mTt(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function gge(){var t=RU(),e=[0,1],n=!1,r;function i(o){var a=mTt(t(o));return isNaN(a)?r:n?Math.round(a):a}return i.invert=function(o){return t.invert(JQ(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,rP)).map(JQ)),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 gge(t.domain(),e).round(n).clamp(t.clamp()).unknown(r)},Cs.apply(i,arguments),Ad(i)}function vge(){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 yge().domain([t,e]).range(i).unknown(o)},Cs.apply(Ad(a),arguments)}function xge(){var t=[.5],e=[0,1],n,r=1;function i(o){return o!=null&&o<=o?e[Pw(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 xge().domain(t).range(e).unknown(n)},Cs.apply(i,arguments)}const CI=new Date,TI=new Date;function ri(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(cri(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)=>(CI.setTime(+o),TI.setTime(+a),t(CI),t(TI),Math.floor(n(CI,TI))),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 aP=ri(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);aP.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?ri(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):aP);aP.range;const qc=1e3,Za=qc*60,Xc=Za*60,vu=Xc*24,jU=vu*7,eY=vu*30,EI=vu*365,Eh=ri(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*qc)},(t,e)=>(e-t)/qc,t=>t.getUTCSeconds());Eh.range;const BU=ri(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*qc)},(t,e)=>{t.setTime(+t+e*Za)},(t,e)=>(e-t)/Za,t=>t.getMinutes());BU.range;const zU=ri(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*Za)},(t,e)=>(e-t)/Za,t=>t.getUTCMinutes());zU.range;const UU=ri(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*qc-t.getMinutes()*Za)},(t,e)=>{t.setTime(+t+e*Xc)},(t,e)=>(e-t)/Xc,t=>t.getHours());UU.range;const WU=ri(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Xc)},(t,e)=>(e-t)/Xc,t=>t.getUTCHours());WU.range;const Aw=ri(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Za)/vu,t=>t.getDate()-1);Aw.range;const bk=ri(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/vu,t=>t.getUTCDate()-1);bk.range;const bge=ri(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/vu,t=>Math.floor(t/vu));bge.range;function Bp(t){return ri(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())*Za)/jU)}const _k=Bp(0),sP=Bp(1),gTt=Bp(2),vTt=Bp(3),Ov=Bp(4),yTt=Bp(5),xTt=Bp(6);_k.range;sP.range;gTt.range;vTt.range;Ov.range;yTt.range;xTt.range;function zp(t){return ri(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)/jU)}const wk=zp(0),lP=zp(1),bTt=zp(2),_Tt=zp(3),Cv=zp(4),wTt=zp(5),STt=zp(6);wk.range;lP.range;bTt.range;_Tt.range;Cv.range;wTt.range;STt.range;const VU=ri(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());VU.range;const GU=ri(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());GU.range;const yu=ri(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());yu.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:ri(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)});yu.range;const xu=ri(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());xu.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:ri(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)});xu.range;function _ge(t,e,n,r,i,o){const a=[[Eh,1,qc],[Eh,5,5*qc],[Eh,15,15*qc],[Eh,30,30*qc],[o,1,Za],[o,5,5*Za],[o,15,15*Za],[o,30,30*Za],[i,1,Xc],[i,3,3*Xc],[i,6,6*Xc],[i,12,12*Xc],[r,1,vu],[r,2,2*vu],[n,1,jU],[e,1,eY],[e,3,3*eY],[t,1,EI]];function s(c,u,f){const d=ug).right(a,d);if(h===a.length)return t.every(k$(c/EI,u/EI,f));if(h===0)return aP.every(Math.max(k$(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=MI(j0(re.y,0,1)),ce=F.getUTCDay(),F=ce>4||ce===0?lP.ceil(F):lP(F),F=bk.offset(F,(re.V-1)*7),re.y=F.getUTCFullYear(),re.m=F.getUTCMonth(),re.d=F.getUTCDate()+(re.w+6)%7):(F=PI(j0(re.y,0,1)),ce=F.getDay(),F=ce>4||ce===0?sP.ceil(F):sP(F),F=Aw.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?MI(j0(re.y,0,1)).getUTCDay():PI(j0(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,MI(re)):PI(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 tY?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 U(J){return o[J.getDay()]}function W(J){return l[J.getMonth()]}function $(J){return s[J.getMonth()]}function N(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 tY={"-":"",_:" ",0:"0"},gi=/^\s*\d+/,MTt=/^%/,kTt=/[\\^$*+?|[\]().{}]/g;function hn(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o[e.toLowerCase(),n]))}function RTt(t,e,n){var r=gi.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function ITt(t,e,n){var r=gi.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function DTt(t,e,n){var r=gi.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function LTt(t,e,n){var r=gi.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function NTt(t,e,n){var r=gi.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function nY(t,e,n){var r=gi.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function rY(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 $Tt(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 FTt(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 jTt(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 iY(t,e,n){var r=gi.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function BTt(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 oY(t,e,n){var r=gi.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function zTt(t,e,n){var r=gi.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function UTt(t,e,n){var r=gi.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function WTt(t,e,n){var r=gi.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function VTt(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 GTt(t,e,n){var r=MTt.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function HTt(t,e,n){var r=gi.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function qTt(t,e,n){var r=gi.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function aY(t,e){return hn(t.getDate(),e,2)}function XTt(t,e){return hn(t.getHours(),e,2)}function QTt(t,e){return hn(t.getHours()%12||12,e,2)}function YTt(t,e){return hn(1+Aw.count(yu(t),t),e,3)}function wge(t,e){return hn(t.getMilliseconds(),e,3)}function KTt(t,e){return wge(t,e)+"000"}function ZTt(t,e){return hn(t.getMonth()+1,e,2)}function JTt(t,e){return hn(t.getMinutes(),e,2)}function eEt(t,e){return hn(t.getSeconds(),e,2)}function tEt(t){var e=t.getDay();return e===0?7:e}function nEt(t,e){return hn(_k.count(yu(t)-1,t),e,2)}function Sge(t){var e=t.getDay();return e>=4||e===0?Ov(t):Ov.ceil(t)}function rEt(t,e){return t=Sge(t),hn(Ov.count(yu(t),t)+(yu(t).getDay()===4),e,2)}function iEt(t){return t.getDay()}function oEt(t,e){return hn(sP.count(yu(t)-1,t),e,2)}function aEt(t,e){return hn(t.getFullYear()%100,e,2)}function sEt(t,e){return t=Sge(t),hn(t.getFullYear()%100,e,2)}function lEt(t,e){return hn(t.getFullYear()%1e4,e,4)}function cEt(t,e){var n=t.getDay();return t=n>=4||n===0?Ov(t):Ov.ceil(t),hn(t.getFullYear()%1e4,e,4)}function uEt(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+hn(e/60|0,"0",2)+hn(e%60,"0",2)}function sY(t,e){return hn(t.getUTCDate(),e,2)}function fEt(t,e){return hn(t.getUTCHours(),e,2)}function dEt(t,e){return hn(t.getUTCHours()%12||12,e,2)}function hEt(t,e){return hn(1+bk.count(xu(t),t),e,3)}function Oge(t,e){return hn(t.getUTCMilliseconds(),e,3)}function pEt(t,e){return Oge(t,e)+"000"}function mEt(t,e){return hn(t.getUTCMonth()+1,e,2)}function gEt(t,e){return hn(t.getUTCMinutes(),e,2)}function vEt(t,e){return hn(t.getUTCSeconds(),e,2)}function yEt(t){var e=t.getUTCDay();return e===0?7:e}function xEt(t,e){return hn(wk.count(xu(t)-1,t),e,2)}function Cge(t){var e=t.getUTCDay();return e>=4||e===0?Cv(t):Cv.ceil(t)}function bEt(t,e){return t=Cge(t),hn(Cv.count(xu(t),t)+(xu(t).getUTCDay()===4),e,2)}function _Et(t){return t.getUTCDay()}function wEt(t,e){return hn(lP.count(xu(t)-1,t),e,2)}function SEt(t,e){return hn(t.getUTCFullYear()%100,e,2)}function OEt(t,e){return t=Cge(t),hn(t.getUTCFullYear()%100,e,2)}function CEt(t,e){return hn(t.getUTCFullYear()%1e4,e,4)}function TEt(t,e){var n=t.getUTCDay();return t=n>=4||n===0?Cv(t):Cv.ceil(t),hn(t.getUTCFullYear()%1e4,e,4)}function EEt(){return"+0000"}function lY(){return"%"}function cY(t){return+t}function uY(t){return Math.floor(+t/1e3)}var hm,Tge,Ege;PEt({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 PEt(t){return hm=PTt(t),Tge=hm.format,hm.parse,Ege=hm.utcFormat,hm.utcParse,hm}function MEt(t){return new Date(t)}function kEt(t){return t instanceof Date?+t:+new Date(+t)}function HU(t,e,n,r,i,o,a,s,l,c){var u=RU(),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)=>xCt(t,o/r))},n.copy=function(){return Age(e).domain(t)},Tu.apply(n,arguments)}function Ok(){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 FEt=$Et,jEt=Lge,BEt=FEt,zEt=zy;function UEt(t){return t&&t.length?jEt(t,zEt,BEt):void 0}var WEt=UEt;const Ef=$t(WEt);function VEt(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};dt.decimalPlaces=dt.dp=function(){var t=this,e=t.d.length-1,n=(e-t.e)*Yn;if(e=t.d[e],e)for(;e%10==0;e/=10)n--;return n<0?0:n};dt.dividedBy=dt.div=function(t){return iu(this,new this.constructor(t))};dt.dividedToIntegerBy=dt.idiv=function(t){var e=this,n=e.constructor;return Nn(iu(e,new n(t),0,1),n.precision)};dt.equals=dt.eq=function(t){return!this.cmp(t)};dt.exponent=function(){return Gr(this)};dt.greaterThan=dt.gt=function(t){return this.cmp(t)>0};dt.greaterThanOrEqualTo=dt.gte=function(t){return this.cmp(t)>=0};dt.isInteger=dt.isint=function(){return this.e>this.d.length-2};dt.isNegative=dt.isneg=function(){return this.s<0};dt.isPositive=dt.ispos=function(){return this.s>0};dt.isZero=function(){return this.s===0};dt.lessThan=dt.lt=function(t){return this.cmp(t)<0};dt.lessThanOrEqualTo=dt.lte=function(t){return this.cmp(t)<1};dt.logarithm=dt.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(gs+"NaN");if(n.s<1)throw Error(gs+(n.s?"NaN":"-Infinity"));return n.eq(ha)?new r(0):(dr=!1,e=iu(R_(n,o),R_(t,o),o),dr=!0,Nn(e,i))};dt.minus=dt.sub=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?jge(e,t):$ge(e,(t.s=-t.s,t))};dt.modulo=dt.mod=function(t){var e,n=this,r=n.constructor,i=r.precision;if(t=new r(t),!t.s)throw Error(gs+"NaN");return n.s?(dr=!1,e=iu(n,t,0,1).times(t),dr=!0,n.minus(e)):Nn(new r(n),i)};dt.naturalExponential=dt.exp=function(){return Fge(this)};dt.naturalLogarithm=dt.ln=function(){return R_(this)};dt.negated=dt.neg=function(){var t=new this.constructor(this);return t.s=-t.s||0,t};dt.plus=dt.add=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?$ge(e,t):jge(e,(t.s=-t.s,t))};dt.precision=dt.sd=function(t){var e,n,r,i=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(Gh+t);if(e=Gr(i)+1,r=i.d.length-1,n=r*Yn+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};dt.squareRoot=dt.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(gs+"NaN")}for(t=Gr(s),dr=!1,i=Math.sqrt(+s),i==0||i==1/0?(e=$l(s.d),(e.length+t)%2==0&&(e+="0"),i=Math.sqrt(e),t=Vy((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(iu(s,o,a+2)).times(.5),$l(o.d).slice(0,a)===(e=$l(r.d)).slice(0,a)){if(e=e.slice(a-3,a+1),i==a&&e=="4999"){if(Nn(o,n+1,0),o.times(o).eq(s)){r=o;break}}else if(e!="9999")break;a+=4}return dr=!0,Nn(r,n)};dt.times=dt.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%li|0,e=s/li|0;o[i]=(o[i]+e)%li|0}for(;!o[--a];)o.pop();return e?++n:o.shift(),t.d=o,t.e=n,dr?Nn(t,f.precision):t};dt.toDecimalPlaces=dt.todp=function(t,e){var n=this,r=n.constructor;return n=new r(n),t===void 0?n:(nc(t,0,Wy),e===void 0?e=r.rounding:nc(e,0,8),Nn(n,t+Gr(n)+1,e))};dt.toExponential=function(t,e){var n,r=this,i=r.constructor;return t===void 0?n=pp(r,!0):(nc(t,0,Wy),e===void 0?e=i.rounding:nc(e,0,8),r=Nn(new i(r),t+1,e),n=pp(r,!0,t+1)),n};dt.toFixed=function(t,e){var n,r,i=this,o=i.constructor;return t===void 0?pp(i):(nc(t,0,Wy),e===void 0?e=o.rounding:nc(e,0,8),r=Nn(new o(i),t+Gr(i)+1,e),n=pp(r.abs(),!1,t+Gr(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};dt.toInteger=dt.toint=function(){var t=this,e=t.constructor;return Nn(new e(t),Gr(t)+1,e.rounding)};dt.toNumber=function(){return+this};dt.toPower=dt.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(gs+"Infinity");return s}if(s.eq(ha))return s;if(r=l.precision,t.eq(ha))return Nn(s,r);if(e=t.e,n=t.d.length-1,a=e>=n,o=s.s,a){if((n=u<0?-u:u)<=Nge){for(i=new l(ha),e=Math.ceil(r/Yn+4),dr=!1;n%2&&(i=i.times(s),hY(i.d,e)),n=Vy(n/2),n!==0;)s=s.times(s),hY(s.d,e);return dr=!0,t.s<0?new l(ha).div(i):Nn(i,r)}}else if(o<0)throw Error(gs+"NaN");return o=o<0&&t.d[Math.max(e,n)]&1?-1:1,s.s=1,dr=!1,i=t.times(R_(s,r+c)),dr=!0,i=Fge(i),i.s=o,i};dt.toPrecision=function(t,e){var n,r,i=this,o=i.constructor;return t===void 0?(n=Gr(i),r=pp(i,n<=o.toExpNeg||n>=o.toExpPos)):(nc(t,1,Wy),e===void 0?e=o.rounding:nc(e,0,8),i=Nn(new o(i),t,e),n=Gr(i),r=pp(i,t<=n||n<=o.toExpNeg,t)),r};dt.toSignificantDigits=dt.tosd=function(t,e){var n=this,r=n.constructor;return t===void 0?(t=r.precision,e=r.rounding):(nc(t,1,Wy),e===void 0?e=r.rounding:nc(e,0,8)),Nn(new r(n),t,e)};dt.toString=dt.valueOf=dt.val=dt.toJSON=dt[Symbol.for("nodejs.util.inspect.custom")]=function(){var t=this,e=Gr(t),n=t.constructor;return pp(t,e<=n.toExpNeg||e>=n.toExpPos)};function $ge(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)),dr?Nn(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/Yn),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)/li|0,l[o]%=li;for(n&&(l.unshift(n),++i),s=l.length;l[--s]==0;)l.pop();return e.d=l,e.e=i,dr?Nn(e,f):e}function nc(t,e,n){if(t!==~~t||tn)throw Error(Gh+t)}function $l(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(gs+"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+(Gr(r)-Gr(i))+1:y=o,y<0)return new E(0);if(y=y/Yn+2|0,c=0,O==1)for(u=0,P=P[0],y++;(c<_||u)&&y--;c++)x=u*li+(I[c]||0),p[c]=x/P|0,u=x%P|0;else{for(u=li/(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=li/2&&++S;do u=0,s=e(P,m,O,g),s<0?(v=m[0],O!=g&&(v=v*li+(m[1]||0)),u=v/S|0,u>1?(u>=li&&(u=li-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(QU+Gr(t));if(!t.s)return new u(ha);for(e==null?(dr=!1,s=f):s=e,a=new u(.03125);t.abs().gte(.1);)t=t.times(a),c+=5;for(r=Math.log(nh(2,c))/Math.LN10*2+5|0,s+=r,n=i=o=new u(ha),u.precision=s;;){if(i=Nn(i.times(t),s),n=n.times(++l),a=o.plus(iu(i,n,s)),$l(a.d).slice(0,s)===$l(o.d).slice(0,s)){for(;c--;)o=Nn(o.times(o),s);return u.precision=f,e==null?(dr=!0,Nn(o,f)):o}o=a}}function Gr(t){for(var e=t.e*Yn,n=t.d[0];n>=10;n/=10)e++;return e}function kI(t,e,n){if(e>t.LN10.sd())throw dr=!0,n&&(t.precision=n),Error(gs+"LN10 precision limit exceeded");return Nn(new t(t.LN10),e)}function ff(t){for(var e="";t--;)e+="0";return e}function R_(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(gs+(h.s?"NaN":"-Infinity"));if(h.eq(ha))return new m(0);if(e==null?(dr=!1,c=g):c=e,h.eq(10))return e==null&&(dr=!0),kI(m,c);if(c+=d,m.precision=c,n=$l(p),r=n.charAt(0),o=Gr(h),Math.abs(o)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)h=h.times(t),n=$l(h.d),r=n.charAt(0),f++;o=Gr(h),r>1?(h=new m("0."+n),o++):h=new m(r+"."+n.slice(1))}else return l=kI(m,c+2,g).times(o+""),h=R_(new m(r+"."+n.slice(1)),c-d).plus(l),m.precision=g,e==null?(dr=!0,Nn(h,g)):h;for(s=a=h=iu(h.minus(ha),h.plus(ha),c),u=Nn(h.times(h),c),i=3;;){if(a=Nn(a.times(u),c),l=s.plus(iu(a,new m(i),c)),$l(l.d).slice(0,c)===$l(s.d).slice(0,c))return s=s.times(2),o!==0&&(s=s.plus(kI(m,c+2,g).times(o+""))),s=iu(s,new m(f),c),m.precision=g,e==null?(dr=!0,Nn(s,g)):s;s=l,i+=2}}function dY(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=Vy(n/Yn),t.d=[],r=(n+1)%Yn,n<0&&(r+=Yn),rcP||t.e<-cP))throw Error(QU+n)}else t.s=0,t.e=0,t.d=[0];return t}function Nn(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+=Yn,i=e,c=f[u=0];else{if(u=Math.ceil((r+1)/Yn),o=f.length,u>=o)return t;for(c=o=f[u],a=1;o>=10;o/=10)a++;r%=Yn,i=r-Yn+a}if(n!==void 0&&(o=nh(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/nh(10,a-i):0:f[u-1])%10&1||n==(t.s<0?8:7))),e<1||!f[0])return l?(o=Gr(t),f.length=1,e=e-o-1,f[0]=nh(10,(Yn-e%Yn)%Yn),t.e=Vy(-e/Yn)||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=nh(10,Yn-r),f[u]=i>0?(c/nh(10,a-i)%nh(10,i)|0)*o:0),l)for(;;)if(u==0){(f[0]+=o)==li&&(f[0]=1,++t.e);break}else{if(f[u]+=o,f[u]!=li)break;f[u--]=0,o=1}for(r=f.length;f[--r]===0;)f.pop();if(dr&&(t.e>cP||t.e<-cP))throw Error(QU+Gr(t));return t}function jge(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),dr?Nn(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/Yn),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)+ff(r):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+ff(-i-1)+o,n&&(r=n-a)>0&&(o+=ff(r))):i>=a?(o+=ff(i+1-a),n&&(r=n-i-1)>0&&(o=o+"."+ff(r))):((r=i+1)0&&(i+1===a&&(o+="."),o+=ff(r))),t.s<0?"-"+o:o}function hY(t,e){if(t.length>e)return t.length=e,!0}function Bge(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(Gh+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 dY(a,o.toString())}else if(typeof o!="string")throw Error(Gh+o);if(o.charCodeAt(0)===45?(o=o.slice(1),a.s=-1):a.s=1,dPt.test(o))dY(a,o);else throw Error(Gh+o)}if(i.prototype=dt,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=Bge,i.config=i.set=hPt,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(Gh+n+": "+r);if((r=t[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Gh+n+": "+r);return this}var YU=Bge(fPt);ha=new YU(1);const Rn=YU;function pPt(t){return yPt(t)||vPt(t)||gPt(t)||mPt()}function mPt(){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 gPt(t,e){if(t){if(typeof t=="string")return L$(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 L$(t,e)}}function vPt(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function yPt(t){if(Array.isArray(t))return L$(t)}function L$(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,pY(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 IPt(t){if(Array.isArray(t))return t}function Gge(t){var e=I_(t,2),n=e[0],r=e[1],i=n,o=r;return n>r&&(i=r,o=n),[i,o]}function Hge(t,e,n){if(t.lte(0))return new Rn(0);var r=Ek.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 DPt(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(Ek.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=wPt(_Pt(function(l){return i.add(new Rn(l-a).mul(r)).toNumber()}),N$);return s(0,e)}function qge(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=Hge(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?qge(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 LPt(t){var e=I_(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=Gge([n,r]),l=I_(s,2),c=l[0],u=l[1];if(c===-1/0||u===1/0){var f=u===1/0?[c].concat(F$(N$(0,i-1).map(function(){return 1/0}))):[].concat(F$(N$(0,i-1).map(function(){return-1/0})),[u]);return n>r?$$(f):f}if(c===u)return DPt(c,i,o);var d=qge(c,u,a,o),h=d.step,p=d.tickMin,m=d.tickMax,g=Ek.rangeStep(p,m.add(new Rn(.1).mul(h)),h);return n>r?$$(g):g}function NPt(t,e){var n=I_(t,2),r=n[0],i=n[1],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=Gge([r,i]),s=I_(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=Hge(new Rn(c).sub(l).div(u-1),o,0),d=[].concat(F$(Ek.rangeStep(new Rn(l),new Rn(c).sub(new Rn(.99).mul(f)),f)),[c]);return r>i?$$(d):d}var $Pt=Wge(LPt),FPt=Wge(NPt),jPt="Invariant failed";function mp(t,e){throw new Error(jPt)}var BPt=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function uP(){return uP=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 qPt(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){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=HPt(t,BPt),u=jt(c,!1);t.direction==="x"&&s.type!=="number"&&mp();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 _=zPt(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(Gn,uP({className:"recharts-errorBar",key:"bar-".concat(y.map(function(U){return"".concat(U.x1,"-").concat(U.x2,"-").concat(U.y1,"-").concat(U.y2)}))},u),y.map(function(U){return ue.createElement("line",uP({},U,{key:"line-".concat(U.x1,"-").concat(U.x2,"-").concat(U.y1,"-").concat(U.y2)}))}))});return ue.createElement(Gn,{className:"recharts-errorBars"},f)}Gy.defaultProps={stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"};Gy.displayName="ErrorBar";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 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 AI(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(qs(f-u)!==qs(d-f)){var p=[];if(qs(d-f)===qs(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},KU=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},iMt=function(e){var n=e.barSize,r=e.totalSize,i=e.stackGroups,o=i===void 0?{}:i;if(!o)return{};for(var a={},s=Object.keys(o),l=0,c=s.length;l=0});if(v&&v.length){var y=v[0].props.barSize,x=v[0].props[g];a[x]||(a[x]=[]);var b=Wt(y)?n:y;a[x].push({item:v[0],stackList:v.slice(1),barSize:Wt(b)?void 0:hp(b,r,0)})}}return a},oMt=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=hp(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(yY(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=hp(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(yY(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},aMt=function(e,n,r,i){var o=r.children,a=r.width,s=r.margin,l=a-(s.left||0)-(s.right||0),c=Xge({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 Ua(Ua({},e),{},Fg({},h,e[h]+(f||0)));if((m==="horizontal"||m==="vertical"&&h==="center")&&p!=="middle"&&Ye(e[p]))return Ua(Ua({},e),{},Fg({},p,e[p]+(d||0)))}return e},sMt=function(e,n,r){return Wt(n)?!0:e==="horizontal"?n==="yAxis":e==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},Qge=function(e,n,r,i,o){var a=n.props.children,s=os(a,Gy).filter(function(c){return sMt(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(Wt(f))return c;var d=Array.isArray(f)?[Ck(f),Ef(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},lMt=function(e,n,r,i,o){var a=n.map(function(s){return Qge(e,s,r,o,i)}).filter(function(s){return!Wt(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},Yge=function(e,n,r,i,o){var a=n.map(function(l){var c=l.props.dataKey;return r==="number"&&c&&Qge(e,l,c,i)||ab(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?qs(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!$y(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}})},RI=new WeakMap,SO=function(e,n){if(typeof n!="function")return e;RI.has(e)||RI.set(e,new WeakMap);var r=RI.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},cMt=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:E_(),realScaleType:"band"}:a==="radial"&&s==="angleAxis"?{scale:oP(),realScaleType:"linear"}:o==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:ob(),realScaleType:"point"}:o==="category"?{scale:E_(),realScaleType:"band"}:{scale:oP(),realScaleType:"linear"};if(Tw(i)){var l="scale".concat(dk(i));return{scale:(fY[l]||ob)(),realScaleType:fY[l]?l:"point"}}return Bt(i)?{scale:i}:{scale:ob(),realScaleType:"point"}},xY=1e-4,uMt=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])-xY,a=Math.max(i[0],i[1])+xY,s=e(n[0]),l=e(n[r-1]);(sa||la)&&e.domain([n[0],n[r-1]])}},fMt=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])}},pMt=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)}},mMt={sign:hMt,expand:Bvt,none:vv,silhouette:zvt,wiggle:Uvt,positive:pMt},gMt=function(e,n,r){var i=n.map(function(s){return s.props.dataKey}),o=mMt[r],a=jvt().keys(i).value(function(s,l){return+ho(s,l,0)}).order(f$).offset(o);return a(e)},vMt=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(ti(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[Fy("_stackId_")]={numericAxisId:r,cateAxisId:i,items:[d]};return Ua(Ua({},f),{},Fg({},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 Ua(Ua({},m),{},Fg({},g,{numericAxisId:r,cateAxisId:i,items:v.items,stackedData:gMt(e,v.items,o)}))},p)}return Ua(Ua({},f),{},Fg({},d,h))},u)},yMt=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=$Pt(c,o,s);return e.domain([Ck(u),Ef(u)]),{niceTicks:u}}if(o&&i==="number"){var f=e.domain(),d=FPt(f,o,s);return{niceTicks:d}}return null};function fP(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&&!Wt(i[e.dataKey])){var s=NE(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,Wt(a)?e.dataKey:a);return Wt(l)?null:e.scale(l)}var bY=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 Wt(l)?null:n.scale(l)-o/2+i},xMt=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]},bMt=function(e,n){var r=e.props.stackId;if(ti(r)){var i=n[r];if(i){var o=i.items.indexOf(e);return o>=0?i.stackedData[o]:null}}return null},_Mt=function(e){return e.reduce(function(n,r){return[Ck(r.concat([n[0]]).filter(Ye)),Ef(r.concat([n[1]]).filter(Ye))]},[1/0,-1/0])},Jge=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=_Mt(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})},_Y=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,wY=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,z$=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(_Y.test(e[0])){var o=+_Y.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(wY.test(e[1])){var a=+wY.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},dP=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=CU(n,function(f){return f.coordinate}),a=1/0,s=1,l=o.length;sa&&(c=2*Math.PI-c),{radius:s,angle:CMt(c),angleInRadian:c}},PMt=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}},MMt=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},TY=function(e,n){var r=e.x,i=e.y,o=EMt({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=PMt(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?CY(CY({},n),{},{radius:a,angle:MMt(h,n)}):null};function $_(t){"@babel/helpers - typeof";return $_=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},$_(t)}var kMt=["offset"];function AMt(t){return LMt(t)||DMt(t)||IMt(t)||RMt()}function RMt(){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 IMt(t,e){if(t){if(typeof t=="string")return U$(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 U$(t,e)}}function DMt(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function LMt(t){if(Array.isArray(t))return U$(t)}function U$(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 $Mt(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 EY(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 Kr(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=Wt(e.id)?jy("recharts-radial-line-"):e.id;return ue.createElement("text",j_({},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))},HMt=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"}},qMt=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 Kr(Kr({},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 Kr(Kr({},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 Kr(Kr({},_),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 Kr(Kr({},S),r?{width:Math.max(r.x+r.width-S.x,0),height:u}:{})}var O=r?{width:c,height:u}:{};return o==="insideLeft"?Kr({x:s+g,y:l+u/2,textAnchor:y,verticalAnchor:"middle"},O):o==="insideRight"?Kr({x:s+c-g,y:l+u/2,textAnchor:v,verticalAnchor:"middle"},O):o==="insideTop"?Kr({x:s+c/2,y:l+d,textAnchor:"middle",verticalAnchor:p},O):o==="insideBottom"?Kr({x:s+c/2,y:l+u-d,textAnchor:"middle",verticalAnchor:h},O):o==="insideTopLeft"?Kr({x:s+g,y:l+d,textAnchor:y,verticalAnchor:p},O):o==="insideTopRight"?Kr({x:s+c-g,y:l+d,textAnchor:v,verticalAnchor:p},O):o==="insideBottomLeft"?Kr({x:s+g,y:l+u-d,textAnchor:y,verticalAnchor:h},O):o==="insideBottomRight"?Kr({x:s+c-g,y:l+u-d,textAnchor:v,verticalAnchor:h},O):Dy(o)&&(Ye(o.x)||Ch(o.x))&&(Ye(o.y)||Ch(o.y))?Kr({x:s+hp(o.x,c),y:l+hp(o.y,u),textAnchor:"end",verticalAnchor:"end"},O):Kr({x:s+c/2,y:l+u/2,textAnchor:"middle",verticalAnchor:"middle"},O)},XMt=function(e){return"cx"in e&&Ye(e.cx)};function Xi(t){var e=t.offset,n=e===void 0?5:e,r=FMt(t,RMt),i=Kr({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||Wt(s)&&Wt(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=WMt(i);var p=XMt(o),m=jt(i,!0);if(p&&(a==="insideStart"||a==="insideEnd"||a==="end"))return GMt(i,h,m);var g=p?HMt(i):qMt(i);return ue.createElement(ZE,j_({className:ke("recharts-label",f)},m,g,{breakAll:d}),h)}Xi.displayName="Label";var nve=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:{}},QMt=function(e,n){return e?e===!0?ue.createElement(Xi,{key:"label-implicit",viewBox:n}):ti(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}):Dy(e)?ue.createElement(Xi,j_({viewBox:n},e,{key:"label-implicit"})):null:null},YMt=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=nve(e),a=os(i,Xi).map(function(l,c){return M.cloneElement(l,{viewBox:n||o,key:"label-".concat(c)})});if(!r)return a;var s=QMt(e.label,n||o);return[s].concat(IMt(a))};Xi.parseViewBox=nve;Xi.renderCallByParent=YMt;function KMt(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var ZMt=KMt;const JMt=$t(ZMt);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)}var e2t=["valueAccessor"],t2t=["data","dataKey","clockWise","id","textBreakAll"];function n2t(t){return a2t(t)||o2t(t)||i2t(t)||r2t()}function r2t(){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 i2t(t,e){if(t){if(typeof t=="string")return V$(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 V$(t,e)}}function o2t(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function a2t(t){if(Array.isArray(t))return V$(t)}function V$(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 u2t(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 f2t=function(e){return Array.isArray(e.value)?JMt(e.value):e.value};function ou(t){var e=t.valueAccessor,n=e===void 0?f2t:e,r=RY(t,e2t),i=r.data,o=r.dataKey,a=r.clockWise,s=r.id,l=r.textBreakAll,c=RY(r,t2t);return!i||!i.length?null:ue.createElement(Gn,{className:"recharts-label-list"},i.map(function(u,f){var d=Wt(o)?n(u,f):ho(u&&u.payload,o),h=Wt(s)?{}:{id:"".concat(s,"-").concat(f)};return ue.createElement(Xi,pP({},jt(u,!0),c,h,{parentViewBox:u.parentViewBox,value:d,textBreakAll:l,viewBox:Xi.parseViewBox(Wt(a)?u:AY(AY({},u),{},{clockWise:a})),key:"label-".concat(f),index:f}))}))}ou.displayName="LabelList";function d2t(t,e){return t?t===!0?ue.createElement(ou,{key:"labelList-implicit",data:e}):ue.isValidElement(t)||Bt(t)?ue.createElement(ou,{key:"labelList-implicit",data:e,content:t}):Dy(t)?ue.createElement(ou,pP({data:e},t,{key:"labelList-implicit"})):null:null}function h2t(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=os(r,ou).map(function(a,s){return M.cloneElement(a,{data:e,key:"labelList-".concat(s)})});if(!n)return i;var o=d2t(t.label,e);return[o].concat(n2t(i))}ou.renderCallByParent=h2t;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 G$(){return G$=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"}},GMt=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 Kr(Kr({},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 Kr(Kr({},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 Kr(Kr({},_),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 Kr(Kr({},S),r?{width:Math.max(r.x+r.width-S.x,0),height:u}:{})}var O=r?{width:c,height:u}:{};return o==="insideLeft"?Kr({x:s+g,y:l+u/2,textAnchor:y,verticalAnchor:"middle"},O):o==="insideRight"?Kr({x:s+c-g,y:l+u/2,textAnchor:v,verticalAnchor:"middle"},O):o==="insideTop"?Kr({x:s+c/2,y:l+d,textAnchor:"middle",verticalAnchor:p},O):o==="insideBottom"?Kr({x:s+c/2,y:l+u-d,textAnchor:"middle",verticalAnchor:h},O):o==="insideTopLeft"?Kr({x:s+g,y:l+d,textAnchor:y,verticalAnchor:p},O):o==="insideTopRight"?Kr({x:s+c-g,y:l+d,textAnchor:v,verticalAnchor:p},O):o==="insideBottomLeft"?Kr({x:s+g,y:l+u-d,textAnchor:y,verticalAnchor:h},O):o==="insideBottomRight"?Kr({x:s+c-g,y:l+u-d,textAnchor:v,verticalAnchor:h},O):Iy(o)&&(Ye(o.x)||Ch(o.x))&&(Ye(o.y)||Ch(o.y))?Kr({x:s+hp(o.x,c),y:l+hp(o.y,u),textAnchor:"end",verticalAnchor:"end"},O):Kr({x:s+c/2,y:l+u/2,textAnchor:"middle",verticalAnchor:"middle"},O)},HMt=function(e){return"cx"in e&&Ye(e.cx)};function Xi(t){var e=t.offset,n=e===void 0?5:e,r=NMt(t,kMt),i=Kr({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||Wt(s)&&Wt(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=zMt(i);var p=HMt(o),m=jt(i,!0);if(p&&(a==="insideStart"||a==="insideEnd"||a==="end"))return WMt(i,h,m);var g=p?VMt(i):GMt(i);return ue.createElement(ZE,F_({className:ke("recharts-label",f)},m,g,{breakAll:d}),h)}Xi.displayName="Label";var tve=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:{}},qMt=function(e,n){return e?e===!0?ue.createElement(Xi,{key:"label-implicit",viewBox:n}):ti(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}):Iy(e)?ue.createElement(Xi,F_({viewBox:n},e,{key:"label-implicit"})):null:null},XMt=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=tve(e),a=os(i,Xi).map(function(l,c){return M.cloneElement(l,{viewBox:n||o,key:"label-".concat(c)})});if(!r)return a;var s=qMt(e.label,n||o);return[s].concat(AMt(a))};Xi.parseViewBox=tve;Xi.renderCallByParent=XMt;function QMt(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var YMt=QMt;const KMt=$t(YMt);function j_(t){"@babel/helpers - typeof";return j_=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},j_(t)}var ZMt=["valueAccessor"],JMt=["data","dataKey","clockWise","id","textBreakAll"];function e2t(t){return i2t(t)||r2t(t)||n2t(t)||t2t()}function t2t(){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 n2t(t,e){if(t){if(typeof t=="string")return W$(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 W$(t,e)}}function r2t(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function i2t(t){if(Array.isArray(t))return W$(t)}function W$(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 l2t(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 c2t=function(e){return Array.isArray(e.value)?KMt(e.value):e.value};function ou(t){var e=t.valueAccessor,n=e===void 0?c2t:e,r=kY(t,ZMt),i=r.data,o=r.dataKey,a=r.clockWise,s=r.id,l=r.textBreakAll,c=kY(r,JMt);return!i||!i.length?null:ue.createElement(Gn,{className:"recharts-label-list"},i.map(function(u,f){var d=Wt(o)?n(u,f):ho(u&&u.payload,o),h=Wt(s)?{}:{id:"".concat(s,"-").concat(f)};return ue.createElement(Xi,pP({},jt(u,!0),c,h,{parentViewBox:u.parentViewBox,value:d,textBreakAll:l,viewBox:Xi.parseViewBox(Wt(a)?u:MY(MY({},u),{},{clockWise:a})),key:"label-".concat(f),index:f}))}))}ou.displayName="LabelList";function u2t(t,e){return t?t===!0?ue.createElement(ou,{key:"labelList-implicit",data:e}):ue.isValidElement(t)||Bt(t)?ue.createElement(ou,{key:"labelList-implicit",data:e,content:t}):Iy(t)?ue.createElement(ou,pP({data:e},t,{key:"labelList-implicit"})):null:null}function f2t(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=os(r,ou).map(function(a,s){return M.cloneElement(a,{data:e,key:"labelList-".concat(s)})});if(!n)return i;var o=u2t(t.label,e);return[o].concat(e2t(i))}ou.renderCallByParent=f2t;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 V$(){return V$=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},y2t=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=qs(u-c),d=OO({cx:n,cy:r,radius:o,angle:c,sign:f,cornerRadius:a,cornerIsExternal:l}),h=d.circleTangency,p=d.lineTangency,m=d.theta,g=OO({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},g2t=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=qs(u-c),d=OO({cx:n,cy:r,radius:o,angle:c,sign:f,cornerRadius:a,cornerIsExternal:l}),h=d.circleTangency,p=d.lineTangency,m=d.theta,g=OO({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 - `):rve({cx:n,cy:r,innerRadius:i,outerRadius:o,startAngle:c,endAngle:u});var _="M ".concat(p.x,",").concat(p.y,` + `):nve({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=OO({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=OO({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 _},x2t={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},ive=function(e){var n=DY(DY({},x2t),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=y2t({cx:r,cy:i,innerRadius:o,outerRadius:a,cornerRadius:Math.min(m,p/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:f}):g=rve({cx:r,cy:i,innerRadius:o,outerRadius:a,startAngle:u,endAngle:f}),ue.createElement("path",G$({},jt(n,!0),{className:h,d:g,role:"img"}))};function U_(t){"@babel/helpers - typeof";return U_=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},U_(t)}function H$(){return H$=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 M2t(t,e){return qy(t.getTime(),e.getTime())}function UY(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 k2t(t,e,n){var r=zY(t),i=r.length;if(zY(e).length!==i)return!1;for(var o;i-- >0;)if(o=r[i],o===ave&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!ove(e,o)||!n.equals(t[o],e[o],o,o,t,e,n))return!1;return!0}function G0(t,e,n){var r=jY(t),i=r.length;if(jY(e).length!==i)return!1;for(var o,a,s;i-- >0;)if(o=r[i],o===ave&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!ove(e,o)||!n.equals(t[o],e[o],o,o,t,e,n)||(a=BY(t,o),s=BY(e,o),(a||s)&&(!a||!s||a.configurable!==s.configurable||a.enumerable!==s.enumerable||a.writable!==s.writable)))return!1;return!0}function A2t(t,e){return qy(t.valueOf(),e.valueOf())}function R2t(t,e){return t.source===e.source&&t.flags===e.flags}function WY(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 I2t(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 D2t="[object Arguments]",L2t="[object Boolean]",N2t="[object Date]",$2t="[object Map]",F2t="[object Number]",j2t="[object Object]",B2t="[object RegExp]",z2t="[object Set]",U2t="[object String]",W2t=Array.isArray,VY=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,GY=Object.assign,V2t=Object.prototype.toString.call.bind(Object.prototype.toString);function G2t(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(W2t(u))return e(u,f,d);if(VY!=null&&VY(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=V2t(u);return p===N2t?n(u,f,d):p===B2t?a(u,f,d):p===$2t?r(u,f,d):p===z2t?s(u,f,d):p===j2t?typeof u.then!="function"&&typeof f.then!="function"&&i(u,f,d):p===D2t?i(u,f,d):p===L2t||p===F2t||p===U2t?o(u,f,d):!1}}function H2t(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?G0:P2t,areDatesEqual:M2t,areMapsEqual:r?FY(UY,G0):UY,areObjectsEqual:r?G0:k2t,arePrimitiveWrappersEqual:A2t,areRegExpsEqual:R2t,areSetsEqual:r?FY(WY,G0):WY,areTypedArraysEqual:r?G0:I2t};if(n&&(i=GY({},i,n(i))),e){var o=TO(i.areArraysEqual),a=TO(i.areMapsEqual),s=TO(i.areObjectsEqual),l=TO(i.areSetsEqual);i=GY({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:s,areSetsEqual:l})}return i}function q2t(t){return function(e,n,r,i,o,a,s){return t(e,n,s)}}function X2t(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 Q2t=Id();Id({strict:!0});Id({circular:!0});Id({circular:!0,strict:!0});Id({createInternalComparator:function(){return qy}});Id({strict:!0,createInternalComparator:function(){return qy}});Id({circular:!0,createInternalComparator:function(){return qy}});Id({circular:!0,createInternalComparator:function(){return qy},strict:!0});function Id(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=H2t(t),l=G2t(s),c=r?r(l):q2t(l);return X2t({circular:n,comparator:l,createState:i,equals:c,strict:a})}function Y2t(t){typeof requestAnimationFrame<"u"&&requestAnimationFrame(t)}function HY(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):Y2t(i)};requestAnimationFrame(r)}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 K2t(t){return tkt(t)||ekt(t)||J2t(t)||Z2t()}function Z2t(){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 J2t(t,e){if(t){if(typeof t=="string")return qY(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 qY(t,e)}}function qY(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 Rkt(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 DI(t){return Nkt(t)||Lkt(t)||Dkt(t)||Ikt()}function Ikt(){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 Dkt(t,e){if(t){if(typeof t=="string")return Z$(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 Z$(t,e)}}function Lkt(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Nkt(t){if(Array.isArray(t))return Z$(t)}function Z$(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 vP(t){return vP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},vP(t)}var rc=function(t){zkt(n,t);var e=Ukt(n);function n(r,i){var o;$kt(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(tF(o)),o.changeStyle=o.changeStyle.bind(tF(o)),!s||h<=0)return o.state={style:{}},typeof d=="function"&&(o.state={style:u}),eF(o);if(f&&f.length)o.state={style:f[0].style};else if(c){if(typeof d=="function")return o.state={style:c},eF(o);o.state={style:l?xx({},l,c):c}}else o.state={style:{}};return o}return jkt(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?xx({},l,u):u};this.state&&d&&(l&&d[l]!==u||!l&&d!==u)&&this.setState(h);return}if(!(Q2t(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?xx({},l,m):m};(l&&d[l]!==m||!l&&d!==m)&&this.setState(g)}this.runAnimation(ks(ks({},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=Mkt(a,s,ykt(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(DI(m),[o.runJSAnimation.bind(o,{from:C.style,to:_,duration:y,easing:b}),y]);var k=YY(E,y,b),I=ks(ks(ks({},C.style),_),{},{transition:k});return[].concat(DI(m),[I,y,O]).filter(akt)};return this.manager.start([l].concat(DI(a.reduce(h,[u,Math.max(d,s)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=nkt());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?xx({},s,l):l,g=YY(Object.keys(m),a,c);p.start([u,o,ks(ks({},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=Akt(i,kkt),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,ks(ks({},l),{},{style:ks(ks({},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);rc.displayName="Animate";rc.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};rc.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 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 yP(){return yP=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 _},v2t={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},rve=function(e){var n=RY(RY({},v2t),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=g2t({cx:r,cy:i,innerRadius:o,outerRadius:a,cornerRadius:Math.min(m,p/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:f}):g=nve({cx:r,cy:i,innerRadius:o,outerRadius:a,startAngle:u,endAngle:f}),ue.createElement("path",V$({},jt(n,!0),{className:h,d:g,role:"img"}))};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 G$(){return G$=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 E2t(t,e){return Hy(t.getTime(),e.getTime())}function BY(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 P2t(t,e,n){var r=jY(t),i=r.length;if(jY(e).length!==i)return!1;for(var o;i-- >0;)if(o=r[i],o===ove&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!ive(e,o)||!n.equals(t[o],e[o],o,o,t,e,n))return!1;return!0}function V0(t,e,n){var r=$Y(t),i=r.length;if($Y(e).length!==i)return!1;for(var o,a,s;i-- >0;)if(o=r[i],o===ove&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!ive(e,o)||!n.equals(t[o],e[o],o,o,t,e,n)||(a=FY(t,o),s=FY(e,o),(a||s)&&(!a||!s||a.configurable!==s.configurable||a.enumerable!==s.enumerable||a.writable!==s.writable)))return!1;return!0}function M2t(t,e){return Hy(t.valueOf(),e.valueOf())}function k2t(t,e){return t.source===e.source&&t.flags===e.flags}function zY(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 A2t(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 R2t="[object Arguments]",I2t="[object Boolean]",D2t="[object Date]",L2t="[object Map]",N2t="[object Number]",$2t="[object Object]",F2t="[object RegExp]",j2t="[object Set]",B2t="[object String]",z2t=Array.isArray,UY=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,WY=Object.assign,U2t=Object.prototype.toString.call.bind(Object.prototype.toString);function W2t(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(z2t(u))return e(u,f,d);if(UY!=null&&UY(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=U2t(u);return p===D2t?n(u,f,d):p===F2t?a(u,f,d):p===L2t?r(u,f,d):p===j2t?s(u,f,d):p===$2t?typeof u.then!="function"&&typeof f.then!="function"&&i(u,f,d):p===R2t?i(u,f,d):p===I2t||p===N2t||p===B2t?o(u,f,d):!1}}function V2t(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?V0:T2t,areDatesEqual:E2t,areMapsEqual:r?NY(BY,V0):BY,areObjectsEqual:r?V0:P2t,arePrimitiveWrappersEqual:M2t,areRegExpsEqual:k2t,areSetsEqual:r?NY(zY,V0):zY,areTypedArraysEqual:r?V0:A2t};if(n&&(i=WY({},i,n(i))),e){var o=TO(i.areArraysEqual),a=TO(i.areMapsEqual),s=TO(i.areObjectsEqual),l=TO(i.areSetsEqual);i=WY({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:s,areSetsEqual:l})}return i}function G2t(t){return function(e,n,r,i,o,a,s){return t(e,n,s)}}function H2t(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 q2t=Id();Id({strict:!0});Id({circular:!0});Id({circular:!0,strict:!0});Id({createInternalComparator:function(){return Hy}});Id({strict:!0,createInternalComparator:function(){return Hy}});Id({circular:!0,createInternalComparator:function(){return Hy}});Id({circular:!0,createInternalComparator:function(){return Hy},strict:!0});function Id(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=V2t(t),l=W2t(s),c=r?r(l):G2t(l);return H2t({circular:n,comparator:l,createState:i,equals:c,strict:a})}function X2t(t){typeof requestAnimationFrame<"u"&&requestAnimationFrame(t)}function VY(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):X2t(i)};requestAnimationFrame(r)}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 Q2t(t){return J2t(t)||Z2t(t)||K2t(t)||Y2t()}function Y2t(){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 K2t(t,e){if(t){if(typeof t=="string")return GY(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 GY(t,e)}}function GY(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 kkt(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 II(t){return Dkt(t)||Ikt(t)||Rkt(t)||Akt()}function Akt(){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 Rkt(t,e){if(t){if(typeof t=="string")return K$(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 K$(t,e)}}function Ikt(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Dkt(t){if(Array.isArray(t))return K$(t)}function K$(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 vP(t){return vP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},vP(t)}var rc=function(t){jkt(n,t);var e=Bkt(n);function n(r,i){var o;Lkt(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(eF(o)),o.changeStyle=o.changeStyle.bind(eF(o)),!s||h<=0)return o.state={style:{}},typeof d=="function"&&(o.state={style:u}),J$(o);if(f&&f.length)o.state={style:f[0].style};else if(c){if(typeof d=="function")return o.state={style:c},J$(o);o.state={style:l?yx({},l,c):c}}else o.state={style:{}};return o}return $kt(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?yx({},l,u):u};this.state&&d&&(l&&d[l]!==u||!l&&d!==u)&&this.setState(h);return}if(!(q2t(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?yx({},l,m):m};(l&&d[l]!==m||!l&&d!==m)&&this.setState(g)}this.runAnimation(ks(ks({},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=Ekt(a,s,gkt(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(II(m),[o.runJSAnimation.bind(o,{from:C.style,to:_,duration:y,easing:b}),y]);var k=XY(E,y,b),I=ks(ks(ks({},C.style),_),{},{transition:k});return[].concat(II(m),[I,y,O]).filter(ikt)};return this.manager.start([l].concat(II(a.reduce(h,[u,Math.max(d,s)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=ekt());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?yx({},s,l):l,g=XY(Object.keys(m),a,c);p.start([u,o,ks(ks({},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=Mkt(i,Pkt),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,ks(ks({},l),{},{style:ks(ks({},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);rc.displayName="Animate";rc.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};rc.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 V_(t){"@babel/helpers - typeof";return V_=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},V_(t)}function yP(){return yP=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,` @@ -329,22 +329,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},Zkt=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},Jkt={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=iK(iK({},Jkt),e),r=M.useRef(),i=M.useState(-1),o=Vkt(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(rc,{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(rc,{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",yP({},jt(n,!0),{className:x,d:oK(O,C,_,S,d),ref:r})))}):ue.createElement("path",yP({},jt(n,!0),{className:x,d:oK(l,c,u,f,d)}))};function nF(){return nF=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 aAt(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 sAt=function(e,n,r,i,o,a){return"M".concat(e,",").concat(o,"v").concat(i,"M").concat(a,",").concat(n,"h").concat(r)},lAt=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=oAt(e,eAt),g=tAt({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",rF({},jt(g,!0),{className:ke("recharts-cross",p),d:sAt(r,o,f,h,s,c)}))},cAt=Mme,uAt=cAt(Object.getPrototypeOf,Object),fAt=uAt,dAt=Ou,hAt=fAt,pAt=Cu,mAt="[object Object]",gAt=Function.prototype,vAt=Object.prototype,hve=gAt.toString,yAt=vAt.hasOwnProperty,xAt=hve.call(Object);function bAt(t){if(!pAt(t)||dAt(t)!=mAt)return!1;var e=hAt(t);if(e===null)return!0;var n=yAt.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&hve.call(n)==xAt}var _At=bAt;const wAt=$t(_At);var SAt=Ou,OAt=Cu,CAt="[object Boolean]";function TAt(t){return t===!0||t===!1||OAt(t)&&SAt(t)==CAt}var EAt=TAt;const PAt=$t(EAt);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 xP(){return xP=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(rc,{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",xP({},jt(n,!0),{className:y,d:uK(O,C,b,_,S),ref:r})))}):ue.createElement("g",null,ue.createElement("path",xP({},jt(n,!0),{className:y,d:uK(l,c,u,f,d)})))},jAt=["option","shapeType","propTransformer","activeClassName","isActive"];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 BAt(t,e){if(t==null)return{};var n=zAt(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 zAt(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 fK(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 bP(t){for(var e=1;e0&&r.handleDrag(i.changedTouches[0])}),aa(hl(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()}),aa(hl(r),"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),aa(hl(r),"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),aa(hl(r),"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),aa(hl(r),"handleSlideDragStart",function(i){var o=yK(i)?i.changedTouches[0]:i;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:o.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(hl(r),"startX"),endX:r.handleTravellerDragStart.bind(hl(r),"endX")},r.state={},r}return _Rt(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=yK(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(aa(aa({},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(aa({},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,a,s=this,l=this.props,c=l.y,u=l.travellerWidth,f=l.height,d=l.traveller,h=l.ariaLabel,p=l.data,m=l.startIndex,g=l.endIndex,v=Math.max(r,this.props.x),y=NI(NI({},jt(this.props,!1)),{},{x:v,y:c,width:u,height:f}),x=h||"Min value: ".concat((o=p[m])===null||o===void 0?void 0:o.name,", Max value: ").concat((a=p[g])===null||a===void 0?void 0:a.name);return ue.createElement(Gn,{tabIndex:0,role:"slider","aria-label":x,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(_){["ArrowLeft","ArrowRight"].includes(_.key)&&(_.preventDefault(),_.stopPropagation(),s.handleTravellerMoveKeyboard(_.key==="ArrowRight"?1:-1,i))},onFocus:function(){s.setState({isTravellerFocused:!0})},onBlur:function(){s.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},e.renderTraveller(d,y))}},{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(Gn,{className:"recharts-brush-texts"},ue.createElement(ZE,wP({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,d)-h,y:a+s/2},p),this.getTextOfTick(i)),ue.createElement(ZE,wP({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,_=xRt("userSelect","none");return ue.createElement(Gn,{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 NI({prevData:o,prevTravellerWidth:l,prevUpdateId:c,prevX:s,prevWidth:a},o&&o.length?TRt({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);aa(gp,"displayName","Brush");aa(gp,"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 ERt=CU;function PRt(t,e){var n;return ERt(t,function(r,i,o){return n=e(r,i,o),!n}),!!n}var MRt=PRt,kRt=_me,ARt=kd,RRt=MRt,IRt=qo,DRt=yk;function LRt(t,e,n){var r=IRt(t)?kRt:RRt;return n&&DRt(t,e,n)&&(e=void 0),r(t,ARt(e))}var NRt=LRt;const $Rt=$t(NRt);var Zl=function(e,n){var r=e.alwaysShow,i=e.ifOverflow;return r&&(i="extendDomain"),i===n},xK=Vme;function FRt(t,e,n){e=="__proto__"&&xK?xK(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var jRt=FRt,BRt=jRt,zRt=Ume,URt=kd;function WRt(t,e){var n={};return e=URt(e),zRt(t,function(r,i,o){BRt(n,i,e(r,i,o))}),n}var VRt=WRt;const GRt=$t(VRt);function HRt(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 cIt(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 uIt(t,e){var n=t.x,r=t.y,i=lIt(t,iIt),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 H0(H0(H0(H0(H0({},e),i),a?{x:a}:{}),l?{y:l}:{}),{},{height:u,width:d,name:e.name,radius:e.radius})}function _K(t){return ue.createElement(XAt,oF({shapeType:"rectangle",propTransformer:uIt,activeClassName:"recharts-active-bar"},t))}var fIt=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||mp(),n)}},dIt=["value","background"],xve;function Mv(t){"@babel/helpers - typeof";return Mv=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},Mv(t)}function hIt(t,e){if(t==null)return{};var n=pIt(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 pIt(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 OP(){return OP=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=hp(e.barCategoryGap,L*z),U=L*z/2;O=U-B-(U-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 W=fMt(m,o,d),$=W.scale,N=W.realScaleType;$.domain(v).range(C),dMt($);var D=bMt($,Bs(Bs({},m),{},{realScaleType:N}));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=Bs(Bs(Bs({},m),D),{},{realScaleType:N,x:E,y:k,scale:$,width:i==="xAxis"?r.width:m.width,height:i==="yAxis"?r.height:m.height});return A.bandSize=dP(A,D),!m.hide&&i==="xAxis"?f[S]+=(I?-1:1)*A.height:m.hide||(f[S]+=(I?-1:1)*A.width),Bs(Bs({},h),{},Ak({},p,A))},{})},Sve=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)}},OIt=function(e){var n=e.x1,r=e.y1,i=e.x2,o=e.y2;return Sve({x:n,y:r},{x:i,y:o})},Ove=function(){function t(e){_It(this,t),this.scale=e}return wIt(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}();Ak(Ove,"EPS",1e-4);var t6=function(e){var n=Object.keys(e).reduce(function(r,i){return Bs(Bs({},r),{},Ak({},i,Ove.create(e[i])))},{});return Bs(Bs({},n),{},{apply:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=o.bandAware,s=o.position;return GRt(i,function(l,c){return n[c].apply(l,{bandAware:a,position:s})})},isInRange:function(i){return yve(i,function(o,a){return n[a].isInRange(o)})}})};function CIt(t){return(t%180+180)%180}var TIt=function(e){var n=e.width,r=e.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=CIt(i),a=o*Math.PI/180,s=Math.atan(r/n),l=a>s&&a-1?i[o?e[a]:a]:void 0}}var AIt=kIt,RIt=pve;function IIt(t){var e=RIt(t),n=e%1;return e===e?n?e-n:e:0}var DIt=IIt,LIt=Lme,NIt=kd,$It=DIt,FIt=Math.max;function jIt(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=n==null?0:$It(n);return i<0&&(i=FIt(r+i,0)),LIt(t,NIt(e),i)}var BIt=jIt,zIt=AIt,UIt=BIt,WIt=zIt(UIt),VIt=WIt;const GIt=$t(VIt);var HIt=umt(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("")}),n6=M.createContext(void 0),r6=M.createContext(void 0),Cve=M.createContext(void 0),Tve=M.createContext({}),Eve=M.createContext(void 0),Pve=M.createContext(0),Mve=M.createContext(0),TK=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=HIt(o);return ue.createElement(n6.Provider,{value:r},ue.createElement(r6.Provider,{value:i},ue.createElement(Tve.Provider,{value:o},ue.createElement(Cve.Provider,{value:u},ue.createElement(Eve.Provider,{value:a},ue.createElement(Pve.Provider,{value:c},ue.createElement(Mve.Provider,{value:l},s)))))))},qIt=function(){return M.useContext(Eve)},kve=function(e){var n=M.useContext(n6);n==null&&mp();var r=n[e];return r==null&&mp(),r},XIt=function(){var e=M.useContext(n6);return gf(e)},QIt=function(){var e=M.useContext(r6),n=GIt(e,function(r){return yve(r.domain,Number.isFinite)});return n||gf(e)},Ave=function(e){var n=M.useContext(r6);n==null&&mp();var r=n[e];return r==null&&mp(),r},YIt=function(){var e=M.useContext(Cve);return e},KIt=function(){return M.useContext(Tve)},i6=function(){return M.useContext(Mve)},o6=function(){return M.useContext(Pve)};function J_(t){"@babel/helpers - typeof";return J_=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},J_(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 PK(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 yDt(t,e){return Rve(t,e+1)}function xDt(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:Rve(r,c)};var m=l,g,v=function(){return g===void 0&&(g=n(p,m)),g},y=p.coordinate,x=l===0||TP(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 n1(t){"@babel/helpers - typeof";return n1=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},n1(t)}function DK(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=TP(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 ODt(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=TP(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=TP(t,x.tickCoord,_,l,c);O&&(l=x.tickCoord+t*(_()/2+i),a[y]=Vi(Vi({},x),{},{isShow:!0}))},g=0;g=2?qs(i[1].coordinate-i[0].coordinate):1,v=vDt(o,g,h);return l==="equidistantPreserveStart"?xDt(g,v,m,i,a):(l==="preserveStart"||l==="preserveStartEnd"?d=ODt(g,v,m,i,a,l==="preserveStartEnd"):d=SDt(g,v,m,i,a),d.filter(function(y){return y.isShow}))}var CDt=["viewBox"],TDt=["viewBox"],EDt=["ticks"];function kv(t){"@babel/helpers - typeof";return kv=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},kv(t)}function lg(){return lg=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 PDt(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 MDt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function NK(t,e){for(var n=0;n0?l(this.props):l(h)),a<=0||s<=0||!p||!p.length?null:ue.createElement(Gn,{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(ZE,lg({},i,{className:"recharts-cartesian-axis-tick-value"}),o),a}}]),e}(M.Component);s6(Xy,"displayName","CartesianAxis");s6(Xy,"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 NDt=["x1","y1","x2","y2","key"],$Dt=["offset"];function vp(t){"@babel/helpers - typeof";return vp=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},vp(t)}function $K(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 zDt(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 UDt=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 Lve(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=FK(e,NDt),c=jt(l,!1);c.offset;var u=FK(c,$Dt);n=ue.createElement("line",Ph({},u,{x1:r,y1:i,x2:o,y2:a,fill:"none",key:s}))}return n}function WDt(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 Lve(i,c)});return ue.createElement("g",{className:"recharts-cartesian-grid-horizontal"},a)}function VDt(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 Lve(i,c)});return ue.createElement("g",{className:"recharts-cartesian-grid-vertical"},a)}function GDt(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 HDt(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 qDt=function(e,n){var r=e.xAxis,i=e.width,o=e.height,a=e.offset;return Jge(a6(Qi(Qi(Qi({},Xy.defaultProps),r),{},{ticks:Qc(r,!0),viewBox:{x:0,y:0,width:i,height:o}})),a.left,a.left+a.width,n)},XDt=function(e,n){var r=e.yAxis,i=e.width,o=e.height,a=e.offset;return Jge(a6(Qi(Qi(Qi({},Xy.defaultProps),r),{},{ticks:Qc(r,!0),viewBox:{x:0,y:0,width:i,height:o}})),a.top,a.top+a.height,n)},pm={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function l6(t){var e,n,r,i,o,a,s=i6(),l=o6(),c=KIt(),u=Qi(Qi({},t),{},{stroke:(e=t.stroke)!==null&&e!==void 0?e:pm.stroke,fill:(n=t.fill)!==null&&n!==void 0?n:pm.fill,horizontal:(r=t.horizontal)!==null&&r!==void 0?r:pm.horizontal,horizontalFill:(i=t.horizontalFill)!==null&&i!==void 0?i:pm.horizontalFill,vertical:(o=t.vertical)!==null&&o!==void 0?o:pm.vertical,verticalFill:(a=t.verticalFill)!==null&&a!==void 0?a:pm.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=XIt(),x=QIt();if(!Ye(h)||h<=0||!Ye(p)||p<=0||!Ye(f)||f!==+f||!Ye(d)||d!==+d)return null;var b=u.verticalCoordinatesGenerator||qDt,_=u.horizontalCoordinatesGenerator||XDt,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);ru(Array.isArray(E),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(vp(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);ru(Array.isArray(I),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(vp(I),"]")),Array.isArray(I)&&(O=I)}return ue.createElement("g",{className:"recharts-cartesian-grid"},ue.createElement(UDt,{fill:u.fill,fillOpacity:u.fillOpacity,x:u.x,y:u.y,width:u.width,height:u.height}),ue.createElement(WDt,Ph({},u,{offset:c,horizontalPoints:S,xAxis:y,yAxis:x})),ue.createElement(VDt,Ph({},u,{offset:c,verticalPoints:O,xAxis:y,yAxis:x})),ue.createElement(GDt,Ph({},u,{horizontalPoints:S})),ue.createElement(HDt,Ph({},u,{verticalPoints:O})))}l6.displayName="CartesianGrid";var QDt=["type","layout","connectNulls","ref"];function Av(t){"@babel/helpers - typeof";return Av=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},Av(t)}function YDt(t,e){if(t==null)return{};var n=KDt(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 KDt(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 cb(){return cb=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(mm(l.slice(0,p)),[f-m]);break}var g=h.length%2===0?[0,d]:[d];return[].concat(mm(e.repeat(l,u)),mm(h),g).map(function(v){return"".concat(v,"px")}).join(", ")}),zs(Zu(n),"id",jy("recharts-line-")),zs(Zu(n),"pathRef",function(a){n.mainCurve=a}),zs(Zu(n),"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),zs(Zu(n),"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return rLt(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=os(u,Hy);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(Gn,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=ia(ia(ia({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(Gn,cb({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=YDt(s,QDt),d=ia(ia(ia({},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(jg,cb({},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(rc,{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 ia(ia({},P),{},{x:z(_),y:B(_)})}if(p){var U=Ei(m*2,P.x),W=Ei(g/2,P.y);return ia(ia({},P),{},{x:U(_),y:W(_)})}return ia(ia({},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||!Tv(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=Wt(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=Hpe(a)?a:{},T=R.clipDot,L=T===void 0?!0:T,z=k*2+P;return ue.createElement(Gn,{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)&&ou.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(mm(r),[0]):r,a=[],s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function uLt(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 Mh(){return Mh=Object.assign?Object.assign.bind():function(t){for(var e=1;e0||!Tv(u,a)||!Tv(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=Wt(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=Hpe(a)?a:{},T=R.clipDot,L=T===void 0?!0:T,z=k*2+P;return ue.createElement(Gn,{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)&&ou.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);Fve=Dd;Fl(Dd,"displayName","Area");Fl(Dd,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!Yl.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});Fl(Dd,"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]});Fl(Dd,"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=Fve.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:fP({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:fP({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),Ju({points:y,baseLine:x,layout:h,isRange:v},d)});Fl(Dd,"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(Pk,Mh({},e,{className:r}))}return n});function pF(){return pF=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 BLt(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 zLt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ULt(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 Xve(t){return t==="number"?[0,"auto"]:void 0}var bF=function(e,n,r,i){var o=e.graphicalItems,a=e.tooltipAxis,s=Rk(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=NE(h,a.dataKey,i)}else d=f&&f[r]||s[r];return d?[].concat(Dv(l),[tve(c,d)]):l},[])},XK=function(e,n,r,i){var o=i||{x:e.chartX,y:e.chartY},a=JLt(o,r),s=e.orderedTooltipTicks,l=e.tooltipAxis,c=e.tooltipTicks,u=oMt(a,s,c,l);if(u>=0&&c){var f=c[u]&&c[u].value,d=bF(e,n,u,f),h=e3t(r,s,u,o);return{activeTooltipIndex:u,activeLabel:f,activePayload:d,activeCoordinate:h}}return null},t3t=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=Zge(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=Rk(e.data,{graphicalItems:i.filter(function(D){return D.props[a]===E}),dataStartIndex:l,dataEndIndex:c}),I=k.length,P,R,T;PLt(m.props.domain,b,y)&&(P=U$(m.props.domain,null,b),h&&(y==="number"||S!=="auto")&&(T=sb(k,x,"category")));var L=Xve(y);if(!P||P.length===0){var z,B=(z=m.props.domain)!==null&&z!==void 0?z:L;if(x){if(P=sb(k,x,y),y==="category"&&h){var U=igt(P);_&&U?(R=P,P=_P(0,I)):_||(P=CY(B,P,m).reduce(function(D,A){return D.indexOf(A)>=0?D:[].concat(Dv(D),[A])},[]))}else if(y==="category")_?P=P.filter(function(D){return D!==""&&!Wt(D)}):P=CY(B,P,m).reduce(function(D,A){return D.indexOf(A)>=0||A===""||Wt(A)?D:[].concat(Dv(D),[A])},[]);else if(y==="number"){var W=uMt(k,i.filter(function(D){return D.props[a]===E&&(C||!D.props.hide)}),x,o,u);W&&(P=W)}h&&(y==="number"||S!=="auto")&&(T=sb(k,x,"category"))}else h?P=_P(0,I):s&&s[E]&&s[E].hasStack&&y==="number"?P=d==="expand"?[0,1]:eve(s[E].stackGroups,l,c):P=Kge(k,i.filter(function(D){return D.props[a]===E&&(C||!D.props.hide)}),y,u,!0);if(y==="number")P=vF(f,P,E,o,O),B&&(P=U$(B,P,b));else if(y==="category"&&B){var $=B,N=P.every(function(D){return $.indexOf(D)>=0});N&&(P=$)}}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})))},{})},n3t=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=Rk(e.data,{graphicalItems:r,dataStartIndex:l,dataEndIndex:c}),h=d.length,p=Zge(u,o),m=-1;return r.reduce(function(g,v){var y=v.props[a],x=Xve("number");if(!g[y]){m++;var b;return p?b=_P(0,h):s&&s[y]&&s[y].hasStack?(b=eve(s[y].stackGroups,l,c),b=vF(f,b,y,o)):(b=U$(x,Kge(d,r.filter(function(_){return _.props[a]===y&&!_.props.hide}),"number",u),i.defaultProps.allowDataOverflow),b=vF(f,b,y,o)),Be(Be({},g),{},Ct({},y,Be(Be({axisType:o},i.defaultProps),{},{hide:!0,orientation:is(KLt,"".concat(o,".").concat(m%2),null),domain:b,originalDomain:x,isCategorical:p,layout:u})))}return g},{})},r3t=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=os(u,o),h={};return d&&d.length?h=t3t(e,{axes:d,graphicalItems:a,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:c}):a&&a.length&&(h=n3t(e,{Axis:o,graphicalItems:a,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:c})),h},i3t=function(e){var n=gf(e),r=Qc(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:TU(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:dP(n,r)}},QK=function(e){var n=e.children,r=e.defaultShowTooltip,i=ca(n,gp),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}},o3t=function(e){return!e||!e.length?!1:e.some(function(n){var r=nu(n&&n.type);return r&&r.indexOf("Bar")>=0})},YK=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"}},a3t=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=ca(f,gp),p=ca(f,bv),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,is(_,"".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||gp.defaultProps.height),p&&n&&(v=lMt(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)})},s3t=function(e,n){if(n==="xAxis")return e[n].width;if(n==="yAxis")return e[n].height},c6=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=YK(E),T=R.numericAxisName,L=R.cateAxisName,z=o3t(y),B=[];return y.forEach(function(U,W){var $=Rk(g.data,{graphicalItems:[U],dataStartIndex:S,dataEndIndex:O}),N=U.props,D=N.dataKey,A=N.maxBarSize,q=U.props["".concat(T,"Id")],Y=U.props["".concat(L,"Id")],K={},se=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"||mp();var ie=H[G];return Be(Be({},ge),{},Ct(Ct({},ye.axisType,ie),"".concat(ye.axisType,"Ticks"),Qc(ie)))},K),te=se[L],J=se["".concat(L,"Ticks")],pe=x&&x[q]&&x[q].hasStack&&wMt(U,x[q].stackGroups),be=nu(U.type).indexOf("Bar")>=0,re=dP(te,J),ve=[],F=z&&aMt({barSize:C,stackGroups:x,totalSize:s3t(se,L)});if(be){var ce,le,Q=Wt(A)?P:A,X=(ce=(le=dP(te,J,!0))!==null&&le!==void 0?le:Q)!==null&&ce!==void 0?ce:0;ve=sMt({barGap:k,barCategoryGap:I,bandSize:X!==re?X:re,sizeList:F[Y],maxBarSize:Q}),X!==re&&(ve=ve.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&&B.push({props:Be(Be({},ee(Be(Be({},se),{},{displayedData:$,props:g,dataKey:D,item:U,bandSize:re,barPosition:ve,offset:b,stackedData:pe,layout:E,dataStartIndex:S,dataEndIndex:O}))),{},Ct(Ct(Ct({key:U.key||"item-".concat(W)},T,se[T]),L,se[L]),"animationId",_)),childIndex:mgt(U,g.children),item:U})}),B},p=function(g,v){var y=g.props,x=g.dataStartIndex,b=g.dataEndIndex,_=g.updateId;if(!xX({props:y}))return null;var S=y.children,O=y.layout,C=y.stackOffset,E=y.data,k=y.reverseStackOrder,I=YK(O),P=I.numericAxisName,R=I.cateAxisName,T=os(S,i),L=xMt(E,T,"".concat(P,"Id"),"".concat(R,"Id"),C,k),z=c.reduce(function(N,D){var A="".concat(D.axisType,"Map");return Be(Be({},N),{},Ct({},A,r3t(y,Be(Be({},D),{},{graphicalItems:T,stackGroups:D.axisType===P&&L,dataStartIndex:x,dataEndIndex:b}))))},{}),B=a3t(Be(Be({},z),{},{props:y,graphicalItems:T}),v==null?void 0:v.legendBBox);Object.keys(z).forEach(function(N){z[N]=f(y,z[N],B,N.replace("Map",""),r)});var U=z["".concat(R,"Map")],W=i3t(U),$=h(y,Be(Be({},z),{},{dataStartIndex:x,dataEndIndex:b,updateId:_,graphicalItems:T,stackGroups:L,offset:B}));return Be(Be({formattedGraphicalItems:$,graphicalItems:T,offset:B,stackGroups:L},W),z)};return n=function(m){HLt(g,m);function g(v){var y,x,b;return zLt(this,g),b=VLt(this,g,[v]),Ct(on(b),"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Ct(on(b),"accessibilityManager",new ELt),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=pgt(_),O=is(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&&FI.emit(jI,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 U=0;U=0){var pe,be;if(P.dataKey&&!P.allowDuplicatedCategory){var re=typeof P.dataKey=="function"?J:"payload.".concat(P.dataKey.toString());pe=NE(U,re,T),be=W&&$&&NE($,re,T)}else pe=U==null?void 0:U[R],be=W&&$&&$[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(!Wt(pe))return[te].concat(Dv(b.renderActivePoints({item:C,activePoint:pe,basePoint:be,childIndex:R,isRange:W})))}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 W?[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:PO,once:!0},ReferenceArea:{handler:b.renderReferenceElement},ReferenceLine:{handler:PO},ReferenceDot:{handler:b.renderReferenceElement},XAxis:{handler:PO},YAxis:{handler:PO},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:jy("recharts"),"-clip"),b.throttleTriggeredAfterMouseMove=Yme(b.triggeredAfterMouseMove,(x=v.throttleDelay)!==null&&x!==void 0?x:1e3/60),b.state={},b}return WLt(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=ca(x,yl);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=bF(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 U=B.item;return U.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){r$([ca(y.children,yl)],[ca(this.props.children,yl)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var y=ca(this.props.children,yl);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(),_=jOt(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=gf(k).scale,T=gf(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=XK(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=gf(I);return PY({x:S,y:O},R)}return null}},{key:"parseEventsOfWrapper",value:function(){var y=this.props.children,x=this.getTooltipEventType(),b=ca(y,yl),_={};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=$E(this.props,this.handleOuterEvent);return Be(Be({},S),_)}},{key:"addListener",value:function(){FI.on(jI,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){FI.removeListener(jI,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(y,x,b){for(var _=this.state.formattedGraphicalItems,S=0,O=_.length;S!En(t)||!Number.isFinite(t)?"":Qb(t),d3t=t=>t.toPrecision(3),zI={legendContainer:{display:"flex",justifyContent:"center",columnGap:"12px",flexWrap:"wrap"},legendItem:{display:"flex",alignItems:"center"},legendCloseIcon:{marginLeft:"4px",cursor:"pointer",display:"flex",alignItems:"center"}};function h3t({payload:t,removeTimeSeries:e}){return!t||t.length===0?null:w.jsx(Ke,{sx:zI.legendContainer,children:t.map((n,r)=>w.jsxs(Ke,{sx:{...zI.legendItem,color:n.color},children:[w.jsx("span",{children:n.value}),e&&w.jsx(Ke,{component:"span",sx:zI.legendCloseIcon,onMouseUp:()=>e(r),children:w.jsx(lw,{fontSize:"small"})})]},n.value))})}const UI={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)})},p3t="#00000000",m3t="#FAFFDD";function g3t({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===p3t&&(u=m3t);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:UI.toolTipValue,style:{color:u},children:d}),w.jsxs("span",{children:[" ",p]})]},o)});return r?w.jsxs(Ke,{sx:UI.toolTipContainer,children:[w.jsx(Ke,{component:"span",sx:UI.toolTipLabel,children:`${gy(e)} UTC`}),r]}):null}function KK({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 v3t({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=die(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(Hy,{dataKey:`ev${e}`,width:4,strokeWidth:1,stroke:m,strokeOpacity:.5});return l==="bar"?w.jsx(Up,{type:"monotone",name:h,unit:f.variableUnits,dataKey:`v${e}`,fill:m,fillOpacity:g,isAnimationActive:!1,onClick:d,children:y},e):w.jsx(Dw,{type:"monotone",name:h,unit:f.variableUnits,dataKey:`v${e}`,dot:w.jsx(KK,{...v,stroke:m,fill:"white"}),activeDot:w.jsx(KK,{...v,stroke:"white",fill:m}),stroke:m,strokeOpacity:g,isAnimationActive:!1,onClick:d,children:y},e)}var u6={},y3t=ft;Object.defineProperty(u6,"__esModule",{value:!0});var Qve=u6.default=void 0,x3t=y3t(pt()),b3t=w;Qve=u6.default=(0,x3t.default)((0,b3t.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 f6={},_3t=ft;Object.defineProperty(f6,"__esModule",{value:!0});var Yve=f6.default=void 0,w3t=_3t(pt()),S3t=w;Yve=f6.default=(0,w3t.default)((0,S3t.jsx)("path",{d:"M4 9h4v11H4zm12 4h4v7h-4zm-6-9h4v16h-4z"}),"BarChart");var d6={},O3t=ft;Object.defineProperty(d6,"__esModule",{value:!0});var Kve=d6.default=void 0,C3t=O3t(pt()),T3t=w;Kve=d6.default=(0,C3t.default)((0,T3t.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 h6={},E3t=ft;Object.defineProperty(h6,"__esModule",{value:!0});var Zve=h6.default=void 0,P3t=E3t(pt()),M3t=w;Zve=h6.default=(0,P3t.default)((0,M3t.jsx)("path",{d:"M4 20h16v2H4zM4 2h16v2H4zm9 7h3l-4-4-4 4h3v6H8l4 4 4-4h-3z"}),"Expand");var p6={},k3t=ft;Object.defineProperty(p6,"__esModule",{value:!0});var Jve=p6.default=void 0,A3t=k3t(pt()),R3t=w;Jve=p6.default=(0,A3t.default)((0,R3t.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 m6={},I3t=ft;Object.defineProperty(m6,"__esModule",{value:!0});var g6=m6.default=void 0,D3t=I3t(pt()),L3t=w;g6=m6.default=(0,D3t.default)((0,L3t.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 v6={},N3t=ft;Object.defineProperty(v6,"__esModule",{value:!0});var eye=v6.default=void 0,$3t=N3t(pt()),WI=w;eye=v6.default=(0,$3t.default)([(0,WI.jsx)("circle",{cx:"7",cy:"14",r:"3"},"0"),(0,WI.jsx)("circle",{cx:"11",cy:"6",r:"3"},"1"),(0,WI.jsx)("circle",{cx:"16.6",cy:"17.6",r:"3"},"2")],"ScatterPlot");var y6={},F3t=ft;Object.defineProperty(y6,"__esModule",{value:!0});var tye=y6.default=void 0,j3t=F3t(pt()),B3t=w;tye=y6.default=(0,j3t.default)((0,B3t.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 x6={},z3t=ft;Object.defineProperty(x6,"__esModule",{value:!0});var nye=x6.default=void 0,U3t=z3t(pt()),ZK=w;nye=x6.default=(0,U3t.default)([(0,ZK.jsx)("circle",{cx:"12",cy:"12",r:"3.2"},"0"),(0,ZK.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 W3t(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 V3t=(()=>{let t=0;const e=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${e()}${t}`)})();function au(t){const e=[];for(let n=0,r=t.length;nZo||t.height>Zo)&&(t.width>Zo&&t.height>Zo?t.width>t.height?(t.height*=Zo/t.width,t.width=Zo):(t.width*=Zo/t.height,t.height=Zo):t.width>Zo?(t.height*=Zo/t.width,t.width=Zo):(t.width*=Zo/t.height,t.height=Zo))}function RP(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 Q3t(t){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(t)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}async function Y3t(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),Q3t(i)}const Bo=(t,e)=>{if(t instanceof e)return!0;const n=Object.getPrototypeOf(t);return n===null?!1:n.constructor.name===e.name||Bo(n,e)};function K3t(t){const e=t.getPropertyValue("content");return`${t.cssText} content: '${e.replace(/'|"/g,"")}';`}function Z3t(t){return au(t).map(e=>{const n=t.getPropertyValue(e),r=t.getPropertyPriority(e);return`${e}: ${n}${r?" !important":""};`}).join(" ")}function J3t(t,e,n){const r=`.${t}:${e}`,i=n.cssText?K3t(n):Z3t(n);return document.createTextNode(`${r}{${i}}`)}function JK(t,e,n){const r=window.getComputedStyle(t,n),i=r.getPropertyValue("content");if(i===""||i==="none")return;const o=V3t();try{e.className=`${e.className} ${o}`}catch{return}const a=document.createElement("style");a.appendChild(J3t(o,n,r)),e.appendChild(a)}function eNt(t,e){JK(t,e,":before"),JK(t,e,":after")}const eZ="application/font-woff",tZ="image/jpeg",tNt={woff:eZ,woff2:eZ,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:tZ,jpeg:tZ,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function nNt(t){const e=/\.([^./]*?)$/g.exec(t);return e?e[1]:""}function b6(t){const e=nNt(t).toLowerCase();return tNt[e]||""}function rNt(t){return t.split(/,/)[1]}function _F(t){return t.search(/^(data:)/)!==-1}function iNt(t,e){return`data:${e};base64,${t}`}async function iye(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 VI={};function oNt(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 _6(t,e,n){const r=oNt(t,e,n.includeQueryParams);if(VI[r]!=null)return VI[r];n.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+new Date().getTime());let i;try{const o=await iye(t,n.fetchRequestInit,({res:a,result:s})=>(e||(e=a.headers.get("Content-Type")||""),rNt(s)));i=iNt(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 VI[r]=i,i}async function aNt(t){const e=t.toDataURL();return e==="data:,"?t.cloneNode(!1):RP(e)}async function sNt(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 RP(s)}const n=t.poster,r=b6(n),i=await _6(n,r,e);return RP(i)}async function lNt(t){var e;try{if(!((e=t==null?void 0:t.contentDocument)===null||e===void 0)&&e.body)return await Ik(t.contentDocument.body,{},!0)}catch{}return t.cloneNode(!1)}async function cNt(t,e){return Bo(t,HTMLCanvasElement)?aNt(t):Bo(t,HTMLVideoElement)?sNt(t,e):Bo(t,HTMLIFrameElement)?lNt(t):t.cloneNode(!1)}const uNt=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SLOT";async function fNt(t,e,n){var r,i;let o=[];return uNt(t)&&t.assignedNodes?o=au(t.assignedNodes()):Bo(t,HTMLIFrameElement)&&(!((r=t.contentDocument)===null||r===void 0)&&r.body)?o=au(t.contentDocument.body.childNodes):o=au(((i=t.shadowRoot)!==null&&i!==void 0?i:t).childNodes),o.length===0||Bo(t,HTMLVideoElement)||await o.reduce((a,s)=>a.then(()=>Ik(s,n)).then(l=>{l&&e.appendChild(l)}),Promise.resolve()),e}function dNt(t,e){const n=e.style;if(!n)return;const r=window.getComputedStyle(t);r.cssText?(n.cssText=r.cssText,n.transformOrigin=r.transformOrigin):au(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`),Bo(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 hNt(t,e){Bo(t,HTMLTextAreaElement)&&(e.innerHTML=t.value),Bo(t,HTMLInputElement)&&e.setAttribute("value",t.value)}function pNt(t,e){if(Bo(t,HTMLSelectElement)){const n=e,r=Array.from(n.children).find(i=>t.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function mNt(t,e){return Bo(e,Element)&&(dNt(t,e),eNt(t,e),hNt(t,e),pNt(t,e)),e}async function gNt(t,e){const n=t.querySelectorAll?t.querySelectorAll("use"):[];if(n.length===0)return t;const r={};for(let o=0;ocNt(r,e)).then(r=>fNt(t,r,e)).then(r=>mNt(t,r)).then(r=>gNt(r,e))}const oye=/url\((['"]?)([^'"]+?)\1\)/g,vNt=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,yNt=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function xNt(t){const e=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}function bNt(t){const e=[];return t.replace(oye,(n,r,i)=>(e.push(i),n)),e.filter(n=>!_F(n))}async function _Nt(t,e,n,r,i){try{const o=n?W3t(e,n):e,a=b6(e);let s;return i||(s=await _6(o,a,r)),t.replace(xNt(e),`$1${s}$3`)}catch{}return t}function wNt(t,{preferredFontFormat:e}){return e?t.replace(yNt,n=>{for(;;){const[r,,i]=vNt.exec(n)||[];if(!i)return"";if(i===e)return`src: ${r};`}}):t}function aye(t){return t.search(oye)!==-1}async function sye(t,e,n){if(!aye(t))return t;const r=wNt(t,n);return bNt(r).reduce((o,a)=>o.then(s=>_Nt(s,a,e,n)),Promise.resolve(r))}async function MO(t,e,n){var r;const i=(r=e.style)===null||r===void 0?void 0:r.getPropertyValue(t);if(i){const o=await sye(i,null,n);return e.style.setProperty(t,o,e.style.getPropertyPriority(t)),!0}return!1}async function SNt(t,e){await MO("background",t,e)||await MO("background-image",t,e),await MO("mask",t,e)||await MO("mask-image",t,e)}async function ONt(t,e){const n=Bo(t,HTMLImageElement);if(!(n&&!_F(t.src))&&!(Bo(t,SVGImageElement)&&!_F(t.href.baseVal)))return;const r=n?t.src:t.href.baseVal,i=await _6(r,b6(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 CNt(t,e){const r=au(t.childNodes).map(i=>lye(i,e));await Promise.all(r).then(()=>t)}async function lye(t,e){Bo(t,Element)&&(await SNt(t,e),await ONt(t,e),await CNt(t,e))}function TNt(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 nZ={};async function rZ(t){let e=nZ[t];if(e!=null)return e;const r=await(await fetch(t)).text();return e={url:t,cssText:r},nZ[t]=e,e}async function iZ(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),iye(s,e.fetchRequestInit,({result:l})=>(n=n.replace(a,`url(${l})`),[a,l]))});return Promise.all(o).then(()=>n)}function oZ(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 ENt(t,e){const n=[],r=[];return t.forEach(i=>{if("cssRules"in i)try{au(i.cssRules||[]).forEach((o,a)=>{if(o.type===CSSRule.IMPORT_RULE){let s=a+1;const l=o.href,c=rZ(l).then(u=>iZ(u,e)).then(u=>oZ(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(rZ(i.href).then(s=>iZ(s,e)).then(s=>oZ(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{au(i.cssRules||[]).forEach(o=>{n.push(o)})}catch(o){console.error(`Error while reading CSS rules from ${i.href}`,o)}}),n))}function PNt(t){return t.filter(e=>e.type===CSSRule.FONT_FACE_RULE).filter(e=>aye(e.style.getPropertyValue("src")))}async function MNt(t,e){if(t.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=au(t.ownerDocument.styleSheets),r=await ENt(n,e);return PNt(r)}async function kNt(t,e){const n=await MNt(t,e);return(await Promise.all(n.map(i=>{const o=i.parentStyleSheet?i.parentStyleSheet.href:null;return sye(i.cssText,o,e)}))).join(` -`)}async function ANt(t,e){const n=e.fontEmbedCSS!=null?e.fontEmbedCSS:e.skipFonts?null:await kNt(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 RNt(t,e={}){const{width:n,height:r}=rye(t,e),i=await Ik(t,e,!0);return await ANt(i,e),await lye(i,e),TNt(i,e),await Y3t(i,n,r)}async function cye(t,e={}){const{width:n,height:r}=rye(t,e),i=await RNt(t,e),o=await RP(i),a=document.createElement("canvas"),s=a.getContext("2d"),l=e.pixelRatio||q3t(),c=e.canvasWidth||n,u=e.canvasHeight||r;return a.width=c*l,a.height=u*l,e.skipAutoScale||X3t(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 INt(t,e={}){return(await cye(t,e)).toDataURL()}async function DNt(t,e={}){return(await cye(t,e)).toDataURL("image/jpeg",e.quality||1)}const aZ={png:INt,jpeg:DNt};function LNt(t,e){NNt(t,e).then(()=>{e!=null&&e.handleSuccess&&e.handleSuccess()}).catch(n=>{if(e!=null&&e.handleError)e.handleError(n);else throw n})}async function NNt(t,e={}){const n=t,r=e.format||"png";if(!(r in aZ))throw new Error(`Image format '${r}' is unknown or not supported.`);const i=await aZ[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 uye({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?LNt(t.current,{format:"png",width:2e3,handleSuccess:n,handleError:r}):r(new Error("missing element reference"))};return w.jsx(Ya,{tooltipText:fe.get("Copy snapshot of chart to clipboard"),onClick:i,icon:w.jsx(nye,{fontSize:"inherit"})})}function $Nt({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(jr,{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(dw,{fontSize:"inherit"})})}),w.jsx(Pp,{id:"basic-menu",anchorEl:i,open:u,onClose:s,MenuListProps:{"aria-labelledby":"basic-button"},children:c})]})}const kO={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 FNt({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(Ep,{anchorEl:t,open:!0,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"center"},children:w.jsxs(Ke,{sx:kO.container,children:[w.jsxs(Ke,{component:"form",sx:kO.minMaxBox,children:[w.jsx(cr,{sx:kO.minTextField,label:"Y-Minimum",variant:"filled",size:"small",value:r[0],error:!a,onChange:f=>s(f)}),w.jsx(cr,{sx:kO.maxTextField,label:"Y-Maximum",variant:"filled",size:"small",value:r[1],error:!a,onChange:f=>l(f)})]}),w.jsx(hw,{onDone:c,doneDisabled:!a,onCancel:u,size:"medium"})]})})}const AO="stddev",Gd={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 jNt({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(AO);P.delete(AO),P.delete(f),I=Array.from(P),d(I.length===1?I[0]:f),m(R)};return w.jsx(Ke,{sx:Gd.headerContainer,children:w.jsxs(Ke,{sx:Gd.actionsContainer,children:[a&&w.jsx(_t,{arrow:!0,title:fe.get("Zoom to full range"),children:w.jsx(Ot,{sx:Gd.actionButton,onClick:i,size:"small",children:w.jsx(Jve,{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(Qve,{fontSize:"inherit"})})}),w.jsx(FNt,{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(Zve,{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(Kve,{fontSize:"inherit"})})}),w.jsxs(iy,{value:p?[f,AO]:[f],onChange:E,size:"small",sx:Gd.chartTypes,children:[w.jsx(_t,{arrow:!0,title:fe.get("Show points"),children:w.jsx(Pn,{value:"point",size:"small",children:w.jsx(eye,{fontSize:"inherit"})})}),w.jsx(_t,{arrow:!0,title:fe.get("Show lines"),children:w.jsx(Pn,{value:"line",size:"small",children:w.jsx(tye,{fontSize:"inherit"})})}),w.jsx(_t,{arrow:!0,title:fe.get("Show bars"),children:w.jsx(Pn,{value:"bar",size:"small",children:w.jsx(Yve,{fontSize:"inherit"})})}),w.jsx(_t,{arrow:!0,title:fe.get("Show standard deviation (if any)"),children:w.jsx(Pn,{value:AO,size:"small",disabled:h,children:w.jsx(g6,{fontSize:"inherit"})})})]}),w.jsx(uye,{elementRef:y,postMessage:x}),w.jsx($Nt,{sx:Gd.actionButton,timeSeriesGroupId:t.id,placeGroupTimeSeries:e,addPlaceGroupTimeSeries:n}),o?w.jsx(ey,{size:24,sx:Gd.actionButton,color:"secondary"}):w.jsx(Ot,{sx:Gd.actionButton,"aria-label":"Close",onClick:()=>r(t.id),size:"small",children:w.jsx($p,{fontSize:"inherit"})})]})})}const BNt=Li("div")(({theme:t})=>({userSelect:"none",marginTop:t.spacing(1),width:"99%",height:"32vh",display:"flex",flexDirection:"column",alignItems:"flex-stretch"})),zNt={style:{textAnchor:"middle"},angle:-90,position:"left",offset:0};function UNt({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=hd(),[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 $e=xe[V];if(En($e)&&isFinite($e)&&(me[oe]=$e),de){const Te=xe[de];En(Te)&&isFinite(Te)&&(me[Z]=Te)}})});const ie=Array.from(G.values());return ie.sort((he,_e)=>he.time-_e.time),ie},[t]),U=M.useMemo(()=>t.timeSeriesArray.map(G=>G.dataProgress?G.dataProgress:0),[t]),W=U.reduce((G,ie)=>G+ie,0)/U.length,$=W>0&&W<1,N=!!i&&!n6e(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]=sZ(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,$e=5,Te=5,Re=38,ae=de-me-Te,Le=xe-$e-Re-Me,Ee=(G-me)/ae,ze=(ie-$e)/Le;return[_e+Ee*(oe-_e),V-ze*(V-Z)]},[ge,ye]=sZ(k),H=S==="bar"?c3t:l3t;return w.jsxs(BNt,{children:[w.jsx(jNt,{timeSeriesGroup:t,placeGroupTimeSeries:p,addPlaceGroupTimeSeries:m,removeTimeSeriesGroup:h,resetZoom:F,loading:$,zoomed:N,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(Kme,{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(Vp,{dataKey:"time",type:"number",tickCount:6,domain:Q,tickFormatter:f3t,stroke:K,allowDataOverflow:!0}),w.jsx(Gp,{type:"number",tickCount:5,domain:X,tickFormatter:d3t,stroke:K,allowDataOverflow:!0,label:{...zNt,value:A}}),w.jsx(l6,{strokeDasharray:"3 3"}),b&&!En(k.x1)&&w.jsx(yl,{content:w.jsx(g3t,{})}),w.jsx(bv,{content:w.jsx(h3t,{removeTimeSeries:ve})}),t.timeSeriesArray.map((G,ie)=>v3t({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(Wp,{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(Rw,{isFront:!0,x:n,stroke:Y,strokeWidth:3,strokeOpacity:.5})]})})]})}function sZ(t){const{x1:e,x2:n,y1:r,y2:i}=t;let o,a;return En(e)&&En(n)&&(o=ew.jsx(UNt,{timeSeriesGroup:l,dataTimeRange:n,selectedTimeRange:r,selectTimeRange:i,...s},l.id))]})}const qNt=t=>({locale:t.controlState.locale,timeSeriesGroups:t.dataState.timeSeriesGroups,selectedTime:t.controlState.selectedTime,selectedTimeRange:t.controlState.selectedTimeRange,dataTimeRange:HWe(t),chartTypeDefault:t.controlState.timeSeriesChartTypeDefault,includeStdev:t.controlState.timeSeriesIncludeStdev,placeInfos:ZWe(t),places:rw(t),placeGroupTimeSeries:c6e(t),canAddTimeSeries:bse(t)}),XNt={selectTime:k2,selectTimeRange:Sle,removeTimeSeries:o8e,removeTimeSeriesGroup:a8e,selectPlace:M2,addPlaceGroupTimeSeries:i8e,addTimeSeries:P2,postMessage:ba},QNt=Jt(qNt,XNt)(HNt);var w6={},YNt=ft;Object.defineProperty(w6,"__esModule",{value:!0});var fye=w6.default=void 0,KNt=YNt(pt()),ZNt=w;fye=w6.default=(0,KNt.default)((0,ZNt.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 JNt(t){return t.count===0}function e$t(t){return t.count===1}function t$t(t){return t.count>1}function n$t({statisticsRecord:t}){const e=t.statistics;return w.jsx(M5,{size:"small",children:w.jsx(k5,{children:JNt(e)?w.jsxs(vl,{children:[w.jsx(sr,{children:fe.get("Value")}),w.jsx(sr,{align:"right",children:"NaN"})]}):e$t(e)?w.jsxs(vl,{children:[w.jsx(sr,{children:fe.get("Value")}),w.jsx(sr,{align:"right",children:q0(e.mean)})]}):w.jsxs(w.Fragment,{children:[w.jsxs(vl,{children:[w.jsx(sr,{children:fe.get("Count")}),w.jsx(sr,{align:"right",children:e.count})]}),w.jsxs(vl,{children:[w.jsx(sr,{children:fe.get("Minimum")}),w.jsx(sr,{align:"right",children:q0(e.minimum)})]}),w.jsxs(vl,{children:[w.jsx(sr,{children:fe.get("Maximum")}),w.jsx(sr,{align:"right",children:q0(e.maximum)})]}),w.jsxs(vl,{children:[w.jsx(sr,{children:fe.get("Mean")}),w.jsx(sr,{align:"right",children:q0(e.mean)})]}),w.jsxs(vl,{children:[w.jsx(sr,{children:fe.get("Deviation")}),w.jsx(sr,{align:"right",children:q0(e.deviation)})]})]})})})}function q0(t){return rd(t,3)}function r$t({statisticsRecord:t,showBrush:e,showDetails:n}){const r=Go(),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(Kme,{width:"100%",height:"100%",children:w.jsxs(u3t,{data:o,margin:{top:0,right:e?30:5,bottom:1,left:2},style:{color:g,fontSize:"0.8em"},children:[w.jsx(l6,{strokeDasharray:"3 3"}),w.jsx(Vp,{type:"number",dataKey:"x",domain:[f,d],tickCount:10,tickFormatter:y=>rd(y,2)}),w.jsx(Gp,{}),w.jsx(Dd,{type:"monotone",dataKey:"y",stroke:l.color,fill:l.color}),n&&w.jsx(Rw,{x:i.mean,isFront:!0,stroke:m,strokeWidth:2,strokeOpacity:.5}),n&&w.jsx(Wp,{x1:h,x2:p,isFront:!1,stroke:m,strokeWidth:1,strokeOpacity:.3,fill:m,fillOpacity:.05}),e&&w.jsx(gp,{dataKey:"i",height:22,startIndex:c,endIndex:u,tickFormatter:y=>rd(o[y].x,1),onChange:v})]})})}const RO={container:{padding:1,width:"100%"},header:{display:"flex",justifyContent:"space-between",alignItems:"center",paddingBottom:.5},actions:{display:"flex",gap:.1},body:{display:"flex"}};function IO({phrase:t}){return w.jsx("span",{style:{color:"red"},children:`<${fe.get(t)}?>`})}function dye({dataset:t,variable:e,time:n,placeInfo:r,actions:i,body:o,containerRef:a}){const s=t?t.title:w.jsx(IO,{phrase:"Dataset"}),l=e?e.name:w.jsx(IO,{phrase:"Variable"}),c=n?Aae(n):w.jsx(IO,{phrase:"Time"}),u=r?r.label:w.jsx(IO,{phrase:"Place"});return w.jsxs(Ke,{sx:RO.container,ref:a,children:[w.jsxs(Ke,{sx:RO.header,children:[w.jsxs(At,{fontSize:"small",children:[s," / ",l,", ",c,", ",u]}),w.jsx(Ke,{sx:RO.actions,children:i})]}),o&&w.jsx(Ke,{sx:RO.body,children:o})]})}const lZ={table:{flexGrow:0},chart:{flexGrow:1}};function i$t({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=t$t(e.statistics),m=()=>{c(!l)},g=()=>{s(!a)},v=()=>{r(n)};return w.jsx(dye,{dataset:u,variable:f,time:d,placeInfo:h,containerRef:o,actions:w.jsxs(w.Fragment,{children:[p&&w.jsxs(iy,{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(fye,{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(g6,{fontSize:"inherit"})})})]}),p&&w.jsx(uye,{elementRef:o,postMessage:i}),w.jsx(Ot,{size:"small",onClick:v,children:w.jsx($p,{fontSize:"inherit"})})]}),body:w.jsxs(w.Fragment,{children:[w.jsx(Ke,{sx:lZ.table,children:w.jsx(n$t,{locale:t,statisticsRecord:e})}),w.jsx(Ke,{sx:lZ.chart,children:w.jsx(r$t,{showBrush:a,showDetails:l,statisticsRecord:e})})]})})}const o$t={progress:{color:"primary"}};function a$t({selectedDataset:t,selectedVariable:e,selectedTime:n,selectedPlaceInfo:r,canAddStatistics:i,addStatistics:o,statisticsLoading:a}){return w.jsx(dye,{dataset:t,variable:e,time:n,placeInfo:r,actions:a?w.jsx(ey,{size:20,sx:o$t.progress}):w.jsx(Ot,{size:"small",disabled:!i,onClick:o,color:"primary",children:w.jsx(dw,{fontSize:"inherit"})})})}const s$t={container:{padding:1,display:"flex",flexDirection:"column",alignItems:"flex-start"}};function l$t({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:s$t.container,children:[w.jsx(a$t,{selectedDataset:t,selectedVariable:e,selectedTime:n,selectedPlaceInfo:r,canAddStatistics:a,addStatistics:s,statisticsLoading:i}),o.map((u,f)=>w.jsx(i$t,{statisticsRecord:u,rowIndex:f,removeStatistics:l,postMessage:c},f))]})}const c$t=t=>({selectedDataset:qr(t),selectedVariable:vo(t),selectedTime:Sy(t),selectedPlaceInfo:iw(t),statisticsLoading:s6e(t),statisticsRecords:JWe(t),canAddStatistics:_se(t)}),u$t={addStatistics:Xse,removeStatistics:n8e,postMessage:ba},f$t=Jt(c$t,u$t)(l$t);/** + 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},Ykt=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},Kkt={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},ZU=function(e){var n=nK(nK({},Kkt),e),r=M.useRef(),i=M.useState(-1),o=Ukt(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(rc,{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(rc,{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",yP({},jt(n,!0),{className:x,d:rK(O,C,_,S,d),ref:r})))}):ue.createElement("path",yP({},jt(n,!0),{className:x,d:rK(l,c,u,f,d)}))};function tF(){return tF=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 iAt(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 oAt=function(e,n,r,i,o,a){return"M".concat(e,",").concat(o,"v").concat(i,"M").concat(a,",").concat(n,"h").concat(r)},aAt=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=rAt(e,Zkt),g=Jkt({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",nF({},jt(g,!0),{className:ke("recharts-cross",p),d:oAt(r,o,f,h,s,c)}))},sAt=Pme,lAt=sAt(Object.getPrototypeOf,Object),cAt=lAt,uAt=Ou,fAt=cAt,dAt=Cu,hAt="[object Object]",pAt=Function.prototype,mAt=Object.prototype,dve=pAt.toString,gAt=mAt.hasOwnProperty,vAt=dve.call(Object);function yAt(t){if(!dAt(t)||uAt(t)!=hAt)return!1;var e=fAt(t);if(e===null)return!0;var n=gAt.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&dve.call(n)==vAt}var xAt=yAt;const bAt=$t(xAt);var _At=Ou,wAt=Cu,SAt="[object Boolean]";function OAt(t){return t===!0||t===!1||wAt(t)&&_At(t)==SAt}var CAt=OAt;const TAt=$t(CAt);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 xP(){return xP=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(rc,{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",xP({},jt(n,!0),{className:y,d:lK(O,C,b,_,S),ref:r})))}):ue.createElement("g",null,ue.createElement("path",xP({},jt(n,!0),{className:y,d:lK(l,c,u,f,d)})))},$At=["option","shapeType","propTransformer","activeClassName","isActive"];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 FAt(t,e){if(t==null)return{};var n=jAt(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 jAt(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 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 bP(t){for(var e=1;e0&&r.handleDrag(i.changedTouches[0])}),aa(hl(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()}),aa(hl(r),"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),aa(hl(r),"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),aa(hl(r),"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),aa(hl(r),"handleSlideDragStart",function(i){var o=gK(i)?i.changedTouches[0]:i;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:o.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(hl(r),"startX"),endX:r.handleTravellerDragStart.bind(hl(r),"endX")},r.state={},r}return xRt(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=gK(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(aa(aa({},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(aa({},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,a,s=this,l=this.props,c=l.y,u=l.travellerWidth,f=l.height,d=l.traveller,h=l.ariaLabel,p=l.data,m=l.startIndex,g=l.endIndex,v=Math.max(r,this.props.x),y=LI(LI({},jt(this.props,!1)),{},{x:v,y:c,width:u,height:f}),x=h||"Min value: ".concat((o=p[m])===null||o===void 0?void 0:o.name,", Max value: ").concat((a=p[g])===null||a===void 0?void 0:a.name);return ue.createElement(Gn,{tabIndex:0,role:"slider","aria-label":x,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(_){["ArrowLeft","ArrowRight"].includes(_.key)&&(_.preventDefault(),_.stopPropagation(),s.handleTravellerMoveKeyboard(_.key==="ArrowRight"?1:-1,i))},onFocus:function(){s.setState({isTravellerFocused:!0})},onBlur:function(){s.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},e.renderTraveller(d,y))}},{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(Gn,{className:"recharts-brush-texts"},ue.createElement(ZE,wP({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,d)-h,y:a+s/2},p),this.getTextOfTick(i)),ue.createElement(ZE,wP({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,_=vRt("userSelect","none");return ue.createElement(Gn,{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 LI({prevData:o,prevTravellerWidth:l,prevUpdateId:c,prevX:s,prevWidth:a},o&&o.length?ORt({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);aa(gp,"displayName","Brush");aa(gp,"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 CRt=OU;function TRt(t,e){var n;return CRt(t,function(r,i,o){return n=e(r,i,o),!n}),!!n}var ERt=TRt,PRt=bme,MRt=kd,kRt=ERt,ARt=qo,RRt=yk;function IRt(t,e,n){var r=ARt(t)?PRt:kRt;return n&&RRt(t,e,n)&&(e=void 0),r(t,MRt(e))}var DRt=IRt;const LRt=$t(DRt);var Zl=function(e,n){var r=e.alwaysShow,i=e.ifOverflow;return r&&(i="extendDomain"),i===n},vK=Wme;function NRt(t,e,n){e=="__proto__"&&vK?vK(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var $Rt=NRt,FRt=$Rt,jRt=zme,BRt=kd;function zRt(t,e){var n={};return e=BRt(e),jRt(t,function(r,i,o){FRt(n,i,e(r,i,o))}),n}var URt=zRt;const WRt=$t(URt);function VRt(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 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}function lIt(t,e){var n=t.x,r=t.y,i=aIt(t,nIt),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 G0(G0(G0(G0(G0({},e),i),a?{x:a}:{}),l?{y:l}:{}),{},{height:u,width:d,name:e.name,radius:e.radius})}function xK(t){return ue.createElement(HAt,iF({shapeType:"rectangle",propTransformer:lIt,activeClassName:"recharts-active-bar"},t))}var cIt=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||mp(),n)}},uIt=["value","background"],yve;function Mv(t){"@babel/helpers - typeof";return Mv=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},Mv(t)}function fIt(t,e){if(t==null)return{};var n=dIt(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 dIt(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 OP(){return OP=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=hp(e.barCategoryGap,L*z),U=L*z/2;O=U-B-(U-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 W=cMt(m,o,d),$=W.scale,N=W.realScaleType;$.domain(v).range(C),uMt($);var D=yMt($,Bs(Bs({},m),{},{realScaleType:N}));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=Bs(Bs(Bs({},m),D),{},{realScaleType:N,x:E,y:k,scale:$,width:i==="xAxis"?r.width:m.width,height:i==="yAxis"?r.height:m.height});return A.bandSize=dP(A,D),!m.hide&&i==="xAxis"?f[S]+=(I?-1:1)*A.height:m.hide||(f[S]+=(I?-1:1)*A.width),Bs(Bs({},h),{},Ak({},p,A))},{})},wve=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)}},wIt=function(e){var n=e.x1,r=e.y1,i=e.x2,o=e.y2;return wve({x:n,y:r},{x:i,y:o})},Sve=function(){function t(e){xIt(this,t),this.scale=e}return bIt(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}();Ak(Sve,"EPS",1e-4);var e6=function(e){var n=Object.keys(e).reduce(function(r,i){return Bs(Bs({},r),{},Ak({},i,Sve.create(e[i])))},{});return Bs(Bs({},n),{},{apply:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=o.bandAware,s=o.position;return WRt(i,function(l,c){return n[c].apply(l,{bandAware:a,position:s})})},isInRange:function(i){return vve(i,function(o,a){return n[a].isInRange(o)})}})};function SIt(t){return(t%180+180)%180}var OIt=function(e){var n=e.width,r=e.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=SIt(i),a=o*Math.PI/180,s=Math.atan(r/n),l=a>s&&a-1?i[o?e[a]:a]:void 0}}var MIt=PIt,kIt=hve;function AIt(t){var e=kIt(t),n=e%1;return e===e?n?e-n:e:0}var RIt=AIt,IIt=Dme,DIt=kd,LIt=RIt,NIt=Math.max;function $It(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=n==null?0:LIt(n);return i<0&&(i=NIt(r+i,0)),IIt(t,DIt(e),i)}var FIt=$It,jIt=MIt,BIt=FIt,zIt=jIt(BIt),UIt=zIt;const WIt=$t(UIt);var VIt=lmt(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("")}),t6=M.createContext(void 0),n6=M.createContext(void 0),Ove=M.createContext(void 0),Cve=M.createContext({}),Tve=M.createContext(void 0),Eve=M.createContext(0),Pve=M.createContext(0),OK=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=VIt(o);return ue.createElement(t6.Provider,{value:r},ue.createElement(n6.Provider,{value:i},ue.createElement(Cve.Provider,{value:o},ue.createElement(Ove.Provider,{value:u},ue.createElement(Tve.Provider,{value:a},ue.createElement(Eve.Provider,{value:c},ue.createElement(Pve.Provider,{value:l},s)))))))},GIt=function(){return M.useContext(Tve)},Mve=function(e){var n=M.useContext(t6);n==null&&mp();var r=n[e];return r==null&&mp(),r},HIt=function(){var e=M.useContext(t6);return gf(e)},qIt=function(){var e=M.useContext(n6),n=WIt(e,function(r){return vve(r.domain,Number.isFinite)});return n||gf(e)},kve=function(e){var n=M.useContext(n6);n==null&&mp();var r=n[e];return r==null&&mp(),r},XIt=function(){var e=M.useContext(Ove);return e},QIt=function(){return M.useContext(Cve)},r6=function(){return M.useContext(Pve)},i6=function(){return M.useContext(Eve)};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 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 TK(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 gDt(t,e){return Ave(t,e+1)}function vDt(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:Ave(r,c)};var m=l,g,v=function(){return g===void 0&&(g=n(p,m)),g},y=p.coordinate,x=l===0||TP(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 t1(t){"@babel/helpers - typeof";return t1=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},t1(t)}function RK(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=TP(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 wDt(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=TP(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=TP(t,x.tickCoord,_,l,c);O&&(l=x.tickCoord+t*(_()/2+i),a[y]=Vi(Vi({},x),{},{isShow:!0}))},g=0;g=2?qs(i[1].coordinate-i[0].coordinate):1,v=mDt(o,g,h);return l==="equidistantPreserveStart"?vDt(g,v,m,i,a):(l==="preserveStart"||l==="preserveStartEnd"?d=wDt(g,v,m,i,a,l==="preserveStartEnd"):d=_Dt(g,v,m,i,a),d.filter(function(y){return y.isShow}))}var SDt=["viewBox"],ODt=["viewBox"],CDt=["ticks"];function kv(t){"@babel/helpers - typeof";return kv=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},kv(t)}function lg(){return lg=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 TDt(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 EDt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function DK(t,e){for(var n=0;n0?l(this.props):l(h)),a<=0||s<=0||!p||!p.length?null:ue.createElement(Gn,{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(ZE,lg({},i,{className:"recharts-cartesian-axis-tick-value"}),o),a}}]),e}(M.Component);a6(qy,"displayName","CartesianAxis");a6(qy,"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 DDt=["x1","y1","x2","y2","key"],LDt=["offset"];function vp(t){"@babel/helpers - typeof";return vp=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},vp(t)}function LK(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 jDt(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 BDt=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 Dve(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=NK(e,DDt),c=jt(l,!1);c.offset;var u=NK(c,LDt);n=ue.createElement("line",Ph({},u,{x1:r,y1:i,x2:o,y2:a,fill:"none",key:s}))}return n}function zDt(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 Dve(i,c)});return ue.createElement("g",{className:"recharts-cartesian-grid-horizontal"},a)}function UDt(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 Dve(i,c)});return ue.createElement("g",{className:"recharts-cartesian-grid-vertical"},a)}function WDt(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 VDt(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 GDt=function(e,n){var r=e.xAxis,i=e.width,o=e.height,a=e.offset;return Zge(o6(Qi(Qi(Qi({},qy.defaultProps),r),{},{ticks:Qc(r,!0),viewBox:{x:0,y:0,width:i,height:o}})),a.left,a.left+a.width,n)},HDt=function(e,n){var r=e.yAxis,i=e.width,o=e.height,a=e.offset;return Zge(o6(Qi(Qi(Qi({},qy.defaultProps),r),{},{ticks:Qc(r,!0),viewBox:{x:0,y:0,width:i,height:o}})),a.top,a.top+a.height,n)},pm={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function s6(t){var e,n,r,i,o,a,s=r6(),l=i6(),c=QIt(),u=Qi(Qi({},t),{},{stroke:(e=t.stroke)!==null&&e!==void 0?e:pm.stroke,fill:(n=t.fill)!==null&&n!==void 0?n:pm.fill,horizontal:(r=t.horizontal)!==null&&r!==void 0?r:pm.horizontal,horizontalFill:(i=t.horizontalFill)!==null&&i!==void 0?i:pm.horizontalFill,vertical:(o=t.vertical)!==null&&o!==void 0?o:pm.vertical,verticalFill:(a=t.verticalFill)!==null&&a!==void 0?a:pm.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=HIt(),x=qIt();if(!Ye(h)||h<=0||!Ye(p)||p<=0||!Ye(f)||f!==+f||!Ye(d)||d!==+d)return null;var b=u.verticalCoordinatesGenerator||GDt,_=u.horizontalCoordinatesGenerator||HDt,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);ru(Array.isArray(E),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(vp(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);ru(Array.isArray(I),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(vp(I),"]")),Array.isArray(I)&&(O=I)}return ue.createElement("g",{className:"recharts-cartesian-grid"},ue.createElement(BDt,{fill:u.fill,fillOpacity:u.fillOpacity,x:u.x,y:u.y,width:u.width,height:u.height}),ue.createElement(zDt,Ph({},u,{offset:c,horizontalPoints:S,xAxis:y,yAxis:x})),ue.createElement(UDt,Ph({},u,{offset:c,verticalPoints:O,xAxis:y,yAxis:x})),ue.createElement(WDt,Ph({},u,{horizontalPoints:S})),ue.createElement(VDt,Ph({},u,{verticalPoints:O})))}s6.displayName="CartesianGrid";var qDt=["type","layout","connectNulls","ref"];function Av(t){"@babel/helpers - typeof";return Av=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},Av(t)}function XDt(t,e){if(t==null)return{};var n=QDt(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 QDt(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 lb(){return lb=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(mm(l.slice(0,p)),[f-m]);break}var g=h.length%2===0?[0,d]:[d];return[].concat(mm(e.repeat(l,u)),mm(h),g).map(function(v){return"".concat(v,"px")}).join(", ")}),zs(Zu(n),"id",Fy("recharts-line-")),zs(Zu(n),"pathRef",function(a){n.mainCurve=a}),zs(Zu(n),"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),zs(Zu(n),"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return tLt(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=os(u,Gy);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(Gn,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=ia(ia(ia({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(Gn,lb({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=XDt(s,qDt),d=ia(ia(ia({},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(jg,lb({},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(rc,{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 ia(ia({},P),{},{x:z(_),y:B(_)})}if(p){var U=Ei(m*2,P.x),W=Ei(g/2,P.y);return ia(ia({},P),{},{x:U(_),y:W(_)})}return ia(ia({},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||!Tv(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=Wt(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=Gpe(a)?a:{},T=R.clipDot,L=T===void 0?!0:T,z=k*2+P;return ue.createElement(Gn,{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)&&ou.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(mm(r),[0]):r,a=[],s=0;s=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 Mh(){return Mh=Object.assign?Object.assign.bind():function(t){for(var e=1;e0||!Tv(u,a)||!Tv(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=Wt(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=Gpe(a)?a:{},T=R.clipDot,L=T===void 0?!0:T,z=k*2+P;return ue.createElement(Gn,{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)&&ou.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);$ve=Dd;Fl(Dd,"displayName","Area");Fl(Dd,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!Yl.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});Fl(Dd,"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]});Fl(Dd,"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=$ve.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:fP({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:fP({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),Ju({points:y,baseLine:x,layout:h,isRange:v},d)});Fl(Dd,"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(Pk,Mh({},e,{className:r}))}return n});function hF(){return hF=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 FLt(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 jLt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function BLt(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 qve(t){return t==="number"?[0,"auto"]:void 0}var xF=function(e,n,r,i){var o=e.graphicalItems,a=e.tooltipAxis,s=Rk(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=NE(h,a.dataKey,i)}else d=f&&f[r]||s[r];return d?[].concat(Dv(l),[eve(c,d)]):l},[])},HK=function(e,n,r,i){var o=i||{x:e.chartX,y:e.chartY},a=KLt(o,r),s=e.orderedTooltipTicks,l=e.tooltipAxis,c=e.tooltipTicks,u=rMt(a,s,c,l);if(u>=0&&c){var f=c[u]&&c[u].value,d=xF(e,n,u,f),h=ZLt(r,s,u,o);return{activeTooltipIndex:u,activeLabel:f,activePayload:d,activeCoordinate:h}}return null},JLt=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=Kge(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=Rk(e.data,{graphicalItems:i.filter(function(D){return D.props[a]===E}),dataStartIndex:l,dataEndIndex:c}),I=k.length,P,R,T;TLt(m.props.domain,b,y)&&(P=z$(m.props.domain,null,b),h&&(y==="number"||S!=="auto")&&(T=ab(k,x,"category")));var L=qve(y);if(!P||P.length===0){var z,B=(z=m.props.domain)!==null&&z!==void 0?z:L;if(x){if(P=ab(k,x,y),y==="category"&&h){var U=ngt(P);_&&U?(R=P,P=_P(0,I)):_||(P=SY(B,P,m).reduce(function(D,A){return D.indexOf(A)>=0?D:[].concat(Dv(D),[A])},[]))}else if(y==="category")_?P=P.filter(function(D){return D!==""&&!Wt(D)}):P=SY(B,P,m).reduce(function(D,A){return D.indexOf(A)>=0||A===""||Wt(A)?D:[].concat(Dv(D),[A])},[]);else if(y==="number"){var W=lMt(k,i.filter(function(D){return D.props[a]===E&&(C||!D.props.hide)}),x,o,u);W&&(P=W)}h&&(y==="number"||S!=="auto")&&(T=ab(k,x,"category"))}else h?P=_P(0,I):s&&s[E]&&s[E].hasStack&&y==="number"?P=d==="expand"?[0,1]:Jge(s[E].stackGroups,l,c):P=Yge(k,i.filter(function(D){return D.props[a]===E&&(C||!D.props.hide)}),y,u,!0);if(y==="number")P=gF(f,P,E,o,O),B&&(P=z$(B,P,b));else if(y==="category"&&B){var $=B,N=P.every(function(D){return $.indexOf(D)>=0});N&&(P=$)}}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})))},{})},e3t=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=Rk(e.data,{graphicalItems:r,dataStartIndex:l,dataEndIndex:c}),h=d.length,p=Kge(u,o),m=-1;return r.reduce(function(g,v){var y=v.props[a],x=qve("number");if(!g[y]){m++;var b;return p?b=_P(0,h):s&&s[y]&&s[y].hasStack?(b=Jge(s[y].stackGroups,l,c),b=gF(f,b,y,o)):(b=z$(x,Yge(d,r.filter(function(_){return _.props[a]===y&&!_.props.hide}),"number",u),i.defaultProps.allowDataOverflow),b=gF(f,b,y,o)),Be(Be({},g),{},Ct({},y,Be(Be({axisType:o},i.defaultProps),{},{hide:!0,orientation:is(QLt,"".concat(o,".").concat(m%2),null),domain:b,originalDomain:x,isCategorical:p,layout:u})))}return g},{})},t3t=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=os(u,o),h={};return d&&d.length?h=JLt(e,{axes:d,graphicalItems:a,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:c}):a&&a.length&&(h=e3t(e,{Axis:o,graphicalItems:a,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:c})),h},n3t=function(e){var n=gf(e),r=Qc(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:CU(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:dP(n,r)}},qK=function(e){var n=e.children,r=e.defaultShowTooltip,i=ca(n,gp),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}},r3t=function(e){return!e||!e.length?!1:e.some(function(n){var r=nu(n&&n.type);return r&&r.indexOf("Bar")>=0})},XK=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"}},i3t=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=ca(f,gp),p=ca(f,bv),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,is(_,"".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||gp.defaultProps.height),p&&n&&(v=aMt(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)})},o3t=function(e,n){if(n==="xAxis")return e[n].width;if(n==="yAxis")return e[n].height},l6=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=XK(E),T=R.numericAxisName,L=R.cateAxisName,z=r3t(y),B=[];return y.forEach(function(U,W){var $=Rk(g.data,{graphicalItems:[U],dataStartIndex:S,dataEndIndex:O}),N=U.props,D=N.dataKey,A=N.maxBarSize,q=U.props["".concat(T,"Id")],Y=U.props["".concat(L,"Id")],K={},se=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"||mp();var ie=H[G];return Be(Be({},ge),{},Ct(Ct({},ye.axisType,ie),"".concat(ye.axisType,"Ticks"),Qc(ie)))},K),te=se[L],J=se["".concat(L,"Ticks")],pe=x&&x[q]&&x[q].hasStack&&bMt(U,x[q].stackGroups),be=nu(U.type).indexOf("Bar")>=0,re=dP(te,J),ve=[],F=z&&iMt({barSize:C,stackGroups:x,totalSize:o3t(se,L)});if(be){var ce,le,Q=Wt(A)?P:A,X=(ce=(le=dP(te,J,!0))!==null&&le!==void 0?le:Q)!==null&&ce!==void 0?ce:0;ve=oMt({barGap:k,barCategoryGap:I,bandSize:X!==re?X:re,sizeList:F[Y],maxBarSize:Q}),X!==re&&(ve=ve.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&&B.push({props:Be(Be({},ee(Be(Be({},se),{},{displayedData:$,props:g,dataKey:D,item:U,bandSize:re,barPosition:ve,offset:b,stackedData:pe,layout:E,dataStartIndex:S,dataEndIndex:O}))),{},Ct(Ct(Ct({key:U.key||"item-".concat(W)},T,se[T]),L,se[L]),"animationId",_)),childIndex:hgt(U,g.children),item:U})}),B},p=function(g,v){var y=g.props,x=g.dataStartIndex,b=g.dataEndIndex,_=g.updateId;if(!vX({props:y}))return null;var S=y.children,O=y.layout,C=y.stackOffset,E=y.data,k=y.reverseStackOrder,I=XK(O),P=I.numericAxisName,R=I.cateAxisName,T=os(S,i),L=vMt(E,T,"".concat(P,"Id"),"".concat(R,"Id"),C,k),z=c.reduce(function(N,D){var A="".concat(D.axisType,"Map");return Be(Be({},N),{},Ct({},A,t3t(y,Be(Be({},D),{},{graphicalItems:T,stackGroups:D.axisType===P&&L,dataStartIndex:x,dataEndIndex:b}))))},{}),B=i3t(Be(Be({},z),{},{props:y,graphicalItems:T}),v==null?void 0:v.legendBBox);Object.keys(z).forEach(function(N){z[N]=f(y,z[N],B,N.replace("Map",""),r)});var U=z["".concat(R,"Map")],W=n3t(U),$=h(y,Be(Be({},z),{},{dataStartIndex:x,dataEndIndex:b,updateId:_,graphicalItems:T,stackGroups:L,offset:B}));return Be(Be({formattedGraphicalItems:$,graphicalItems:T,offset:B,stackGroups:L},W),z)};return n=function(m){VLt(g,m);function g(v){var y,x,b;return jLt(this,g),b=ULt(this,g,[v]),Ct(on(b),"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Ct(on(b),"accessibilityManager",new CLt),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=dgt(_),O=is(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&&$I.emit(FI,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 U=0;U=0){var pe,be;if(P.dataKey&&!P.allowDuplicatedCategory){var re=typeof P.dataKey=="function"?J:"payload.".concat(P.dataKey.toString());pe=NE(U,re,T),be=W&&$&&NE($,re,T)}else pe=U==null?void 0:U[R],be=W&&$&&$[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(!Wt(pe))return[te].concat(Dv(b.renderActivePoints({item:C,activePoint:pe,basePoint:be,childIndex:R,isRange:W})))}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 W?[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:PO,once:!0},ReferenceArea:{handler:b.renderReferenceElement},ReferenceLine:{handler:PO},ReferenceDot:{handler:b.renderReferenceElement},XAxis:{handler:PO},YAxis:{handler:PO},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:Fy("recharts"),"-clip"),b.throttleTriggeredAfterMouseMove=Qme(b.triggeredAfterMouseMove,(x=v.throttleDelay)!==null&&x!==void 0?x:1e3/60),b.state={},b}return zLt(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=ca(x,yl);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=xF(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 U=B.item;return U.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){n$([ca(y.children,yl)],[ca(this.props.children,yl)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var y=ca(this.props.children,yl);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(),_=$Ot(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=gf(k).scale,T=gf(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=HK(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=gf(I);return TY({x:S,y:O},R)}return null}},{key:"parseEventsOfWrapper",value:function(){var y=this.props.children,x=this.getTooltipEventType(),b=ca(y,yl),_={};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=$E(this.props,this.handleOuterEvent);return Be(Be({},S),_)}},{key:"addListener",value:function(){$I.on(FI,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){$I.removeListener(FI,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(y,x,b){for(var _=this.state.formattedGraphicalItems,S=0,O=_.length;S!En(t)||!Number.isFinite(t)?"":Xb(t),u3t=t=>t.toPrecision(3),BI={legendContainer:{display:"flex",justifyContent:"center",columnGap:"12px",flexWrap:"wrap"},legendItem:{display:"flex",alignItems:"center"},legendCloseIcon:{marginLeft:"4px",cursor:"pointer",display:"flex",alignItems:"center"}};function f3t({payload:t,removeTimeSeries:e}){return!t||t.length===0?null:w.jsx(Ke,{sx:BI.legendContainer,children:t.map((n,r)=>w.jsxs(Ke,{sx:{...BI.legendItem,color:n.color},children:[w.jsx("span",{children:n.value}),e&&w.jsx(Ke,{component:"span",sx:BI.legendCloseIcon,onMouseUp:()=>e(r),children:w.jsx(lw,{fontSize:"small"})})]},n.value))})}const zI={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)})},d3t="#00000000",h3t="#FAFFDD";function p3t({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===d3t&&(u=h3t);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:zI.toolTipValue,style:{color:u},children:d}),w.jsxs("span",{children:[" ",p]})]},o)});return r?w.jsxs(Ke,{sx:zI.toolTipContainer,children:[w.jsx(Ke,{component:"span",sx:zI.toolTipLabel,children:`${gy(e)} UTC`}),r]}):null}function QK({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 m3t({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=uie(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(Gy,{dataKey:`ev${e}`,width:4,strokeWidth:1,stroke:m,strokeOpacity:.5});return l==="bar"?w.jsx(Up,{type:"monotone",name:h,unit:f.variableUnits,dataKey:`v${e}`,fill:m,fillOpacity:g,isAnimationActive:!1,onClick:d,children:y},e):w.jsx(Dw,{type:"monotone",name:h,unit:f.variableUnits,dataKey:`v${e}`,dot:w.jsx(QK,{...v,stroke:m,fill:"white"}),activeDot:w.jsx(QK,{...v,stroke:"white",fill:m}),stroke:m,strokeOpacity:g,isAnimationActive:!1,onClick:d,children:y},e)}var c6={},g3t=ft;Object.defineProperty(c6,"__esModule",{value:!0});var Xve=c6.default=void 0,v3t=g3t(pt()),y3t=w;Xve=c6.default=(0,v3t.default)((0,y3t.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 u6={},x3t=ft;Object.defineProperty(u6,"__esModule",{value:!0});var Qve=u6.default=void 0,b3t=x3t(pt()),_3t=w;Qve=u6.default=(0,b3t.default)((0,_3t.jsx)("path",{d:"M4 9h4v11H4zm12 4h4v7h-4zm-6-9h4v16h-4z"}),"BarChart");var f6={},w3t=ft;Object.defineProperty(f6,"__esModule",{value:!0});var Yve=f6.default=void 0,S3t=w3t(pt()),O3t=w;Yve=f6.default=(0,S3t.default)((0,O3t.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 d6={},C3t=ft;Object.defineProperty(d6,"__esModule",{value:!0});var Kve=d6.default=void 0,T3t=C3t(pt()),E3t=w;Kve=d6.default=(0,T3t.default)((0,E3t.jsx)("path",{d:"M4 20h16v2H4zM4 2h16v2H4zm9 7h3l-4-4-4 4h3v6H8l4 4 4-4h-3z"}),"Expand");var h6={},P3t=ft;Object.defineProperty(h6,"__esModule",{value:!0});var Zve=h6.default=void 0,M3t=P3t(pt()),k3t=w;Zve=h6.default=(0,M3t.default)((0,k3t.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 p6={},A3t=ft;Object.defineProperty(p6,"__esModule",{value:!0});var m6=p6.default=void 0,R3t=A3t(pt()),I3t=w;m6=p6.default=(0,R3t.default)((0,I3t.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 g6={},D3t=ft;Object.defineProperty(g6,"__esModule",{value:!0});var Jve=g6.default=void 0,L3t=D3t(pt()),UI=w;Jve=g6.default=(0,L3t.default)([(0,UI.jsx)("circle",{cx:"7",cy:"14",r:"3"},"0"),(0,UI.jsx)("circle",{cx:"11",cy:"6",r:"3"},"1"),(0,UI.jsx)("circle",{cx:"16.6",cy:"17.6",r:"3"},"2")],"ScatterPlot");var v6={},N3t=ft;Object.defineProperty(v6,"__esModule",{value:!0});var eye=v6.default=void 0,$3t=N3t(pt()),F3t=w;eye=v6.default=(0,$3t.default)((0,F3t.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 y6={},j3t=ft;Object.defineProperty(y6,"__esModule",{value:!0});var tye=y6.default=void 0,B3t=j3t(pt()),YK=w;tye=y6.default=(0,B3t.default)([(0,YK.jsx)("circle",{cx:"12",cy:"12",r:"3.2"},"0"),(0,YK.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 z3t(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 U3t=(()=>{let t=0;const e=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${e()}${t}`)})();function au(t){const e=[];for(let n=0,r=t.length;nZo||t.height>Zo)&&(t.width>Zo&&t.height>Zo?t.width>t.height?(t.height*=Zo/t.width,t.width=Zo):(t.width*=Zo/t.height,t.height=Zo):t.width>Zo?(t.height*=Zo/t.width,t.width=Zo):(t.width*=Zo/t.height,t.height=Zo))}function RP(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 q3t(t){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(t)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}async function X3t(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),q3t(i)}const Bo=(t,e)=>{if(t instanceof e)return!0;const n=Object.getPrototypeOf(t);return n===null?!1:n.constructor.name===e.name||Bo(n,e)};function Q3t(t){const e=t.getPropertyValue("content");return`${t.cssText} content: '${e.replace(/'|"/g,"")}';`}function Y3t(t){return au(t).map(e=>{const n=t.getPropertyValue(e),r=t.getPropertyPriority(e);return`${e}: ${n}${r?" !important":""};`}).join(" ")}function K3t(t,e,n){const r=`.${t}:${e}`,i=n.cssText?Q3t(n):Y3t(n);return document.createTextNode(`${r}{${i}}`)}function KK(t,e,n){const r=window.getComputedStyle(t,n),i=r.getPropertyValue("content");if(i===""||i==="none")return;const o=U3t();try{e.className=`${e.className} ${o}`}catch{return}const a=document.createElement("style");a.appendChild(K3t(o,n,r)),e.appendChild(a)}function Z3t(t,e){KK(t,e,":before"),KK(t,e,":after")}const ZK="application/font-woff",JK="image/jpeg",J3t={woff:ZK,woff2:ZK,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:JK,jpeg:JK,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function eNt(t){const e=/\.([^./]*?)$/g.exec(t);return e?e[1]:""}function x6(t){const e=eNt(t).toLowerCase();return J3t[e]||""}function tNt(t){return t.split(/,/)[1]}function bF(t){return t.search(/^(data:)/)!==-1}function nNt(t,e){return`data:${e};base64,${t}`}async function rye(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 WI={};function rNt(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 b6(t,e,n){const r=rNt(t,e,n.includeQueryParams);if(WI[r]!=null)return WI[r];n.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+new Date().getTime());let i;try{const o=await rye(t,n.fetchRequestInit,({res:a,result:s})=>(e||(e=a.headers.get("Content-Type")||""),tNt(s)));i=nNt(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 WI[r]=i,i}async function iNt(t){const e=t.toDataURL();return e==="data:,"?t.cloneNode(!1):RP(e)}async function oNt(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 RP(s)}const n=t.poster,r=x6(n),i=await b6(n,r,e);return RP(i)}async function aNt(t){var e;try{if(!((e=t==null?void 0:t.contentDocument)===null||e===void 0)&&e.body)return await Ik(t.contentDocument.body,{},!0)}catch{}return t.cloneNode(!1)}async function sNt(t,e){return Bo(t,HTMLCanvasElement)?iNt(t):Bo(t,HTMLVideoElement)?oNt(t,e):Bo(t,HTMLIFrameElement)?aNt(t):t.cloneNode(!1)}const lNt=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SLOT";async function cNt(t,e,n){var r,i;let o=[];return lNt(t)&&t.assignedNodes?o=au(t.assignedNodes()):Bo(t,HTMLIFrameElement)&&(!((r=t.contentDocument)===null||r===void 0)&&r.body)?o=au(t.contentDocument.body.childNodes):o=au(((i=t.shadowRoot)!==null&&i!==void 0?i:t).childNodes),o.length===0||Bo(t,HTMLVideoElement)||await o.reduce((a,s)=>a.then(()=>Ik(s,n)).then(l=>{l&&e.appendChild(l)}),Promise.resolve()),e}function uNt(t,e){const n=e.style;if(!n)return;const r=window.getComputedStyle(t);r.cssText?(n.cssText=r.cssText,n.transformOrigin=r.transformOrigin):au(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`),Bo(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 fNt(t,e){Bo(t,HTMLTextAreaElement)&&(e.innerHTML=t.value),Bo(t,HTMLInputElement)&&e.setAttribute("value",t.value)}function dNt(t,e){if(Bo(t,HTMLSelectElement)){const n=e,r=Array.from(n.children).find(i=>t.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function hNt(t,e){return Bo(e,Element)&&(uNt(t,e),Z3t(t,e),fNt(t,e),dNt(t,e)),e}async function pNt(t,e){const n=t.querySelectorAll?t.querySelectorAll("use"):[];if(n.length===0)return t;const r={};for(let o=0;osNt(r,e)).then(r=>cNt(t,r,e)).then(r=>hNt(t,r)).then(r=>pNt(r,e))}const iye=/url\((['"]?)([^'"]+?)\1\)/g,mNt=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,gNt=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function vNt(t){const e=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}function yNt(t){const e=[];return t.replace(iye,(n,r,i)=>(e.push(i),n)),e.filter(n=>!bF(n))}async function xNt(t,e,n,r,i){try{const o=n?z3t(e,n):e,a=x6(e);let s;return i||(s=await b6(o,a,r)),t.replace(vNt(e),`$1${s}$3`)}catch{}return t}function bNt(t,{preferredFontFormat:e}){return e?t.replace(gNt,n=>{for(;;){const[r,,i]=mNt.exec(n)||[];if(!i)return"";if(i===e)return`src: ${r};`}}):t}function oye(t){return t.search(iye)!==-1}async function aye(t,e,n){if(!oye(t))return t;const r=bNt(t,n);return yNt(r).reduce((o,a)=>o.then(s=>xNt(s,a,e,n)),Promise.resolve(r))}async function MO(t,e,n){var r;const i=(r=e.style)===null||r===void 0?void 0:r.getPropertyValue(t);if(i){const o=await aye(i,null,n);return e.style.setProperty(t,o,e.style.getPropertyPriority(t)),!0}return!1}async function _Nt(t,e){await MO("background",t,e)||await MO("background-image",t,e),await MO("mask",t,e)||await MO("mask-image",t,e)}async function wNt(t,e){const n=Bo(t,HTMLImageElement);if(!(n&&!bF(t.src))&&!(Bo(t,SVGImageElement)&&!bF(t.href.baseVal)))return;const r=n?t.src:t.href.baseVal,i=await b6(r,x6(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 SNt(t,e){const r=au(t.childNodes).map(i=>sye(i,e));await Promise.all(r).then(()=>t)}async function sye(t,e){Bo(t,Element)&&(await _Nt(t,e),await wNt(t,e),await SNt(t,e))}function ONt(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 eZ={};async function tZ(t){let e=eZ[t];if(e!=null)return e;const r=await(await fetch(t)).text();return e={url:t,cssText:r},eZ[t]=e,e}async function nZ(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),rye(s,e.fetchRequestInit,({result:l})=>(n=n.replace(a,`url(${l})`),[a,l]))});return Promise.all(o).then(()=>n)}function rZ(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 CNt(t,e){const n=[],r=[];return t.forEach(i=>{if("cssRules"in i)try{au(i.cssRules||[]).forEach((o,a)=>{if(o.type===CSSRule.IMPORT_RULE){let s=a+1;const l=o.href,c=tZ(l).then(u=>nZ(u,e)).then(u=>rZ(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(tZ(i.href).then(s=>nZ(s,e)).then(s=>rZ(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{au(i.cssRules||[]).forEach(o=>{n.push(o)})}catch(o){console.error(`Error while reading CSS rules from ${i.href}`,o)}}),n))}function TNt(t){return t.filter(e=>e.type===CSSRule.FONT_FACE_RULE).filter(e=>oye(e.style.getPropertyValue("src")))}async function ENt(t,e){if(t.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=au(t.ownerDocument.styleSheets),r=await CNt(n,e);return TNt(r)}async function PNt(t,e){const n=await ENt(t,e);return(await Promise.all(n.map(i=>{const o=i.parentStyleSheet?i.parentStyleSheet.href:null;return aye(i.cssText,o,e)}))).join(` +`)}async function MNt(t,e){const n=e.fontEmbedCSS!=null?e.fontEmbedCSS:e.skipFonts?null:await PNt(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 kNt(t,e={}){const{width:n,height:r}=nye(t,e),i=await Ik(t,e,!0);return await MNt(i,e),await sye(i,e),ONt(i,e),await X3t(i,n,r)}async function lye(t,e={}){const{width:n,height:r}=nye(t,e),i=await kNt(t,e),o=await RP(i),a=document.createElement("canvas"),s=a.getContext("2d"),l=e.pixelRatio||G3t(),c=e.canvasWidth||n,u=e.canvasHeight||r;return a.width=c*l,a.height=u*l,e.skipAutoScale||H3t(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 ANt(t,e={}){return(await lye(t,e)).toDataURL()}async function RNt(t,e={}){return(await lye(t,e)).toDataURL("image/jpeg",e.quality||1)}const iZ={png:ANt,jpeg:RNt};function INt(t,e){DNt(t,e).then(()=>{e!=null&&e.handleSuccess&&e.handleSuccess()}).catch(n=>{if(e!=null&&e.handleError)e.handleError(n);else throw n})}async function DNt(t,e={}){const n=t,r=e.format||"png";if(!(r in iZ))throw new Error(`Image format '${r}' is unknown or not supported.`);const i=await iZ[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 cye({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?INt(t.current,{format:"png",width:2e3,handleSuccess:n,handleError:r}):r(new Error("missing element reference"))};return w.jsx(Ya,{tooltipText:fe.get("Copy snapshot of chart to clipboard"),onClick:i,icon:w.jsx(tye,{fontSize:"inherit"})})}function LNt({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(jr,{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(xt,{arrow:!0,title:fe.get("Add time-series from places"),children:w.jsx(dw,{fontSize:"inherit"})})}),w.jsx(Pp,{id:"basic-menu",anchorEl:i,open:u,onClose:s,MenuListProps:{"aria-labelledby":"basic-button"},children:c})]})}const kO={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 NNt({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(Ep,{anchorEl:t,open:!0,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"center"},children:w.jsxs(Ke,{sx:kO.container,children:[w.jsxs(Ke,{component:"form",sx:kO.minMaxBox,children:[w.jsx(cr,{sx:kO.minTextField,label:"Y-Minimum",variant:"filled",size:"small",value:r[0],error:!a,onChange:f=>s(f)}),w.jsx(cr,{sx:kO.maxTextField,label:"Y-Maximum",variant:"filled",size:"small",value:r[1],error:!a,onChange:f=>l(f)})]}),w.jsx(hw,{onDone:c,doneDisabled:!a,onCancel:u,size:"medium"})]})})}const AO="stddev",Gd={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 $Nt({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(AO);P.delete(AO),P.delete(f),I=Array.from(P),d(I.length===1?I[0]:f),m(R)};return w.jsx(Ke,{sx:Gd.headerContainer,children:w.jsxs(Ke,{sx:Gd.actionsContainer,children:[a&&w.jsx(xt,{arrow:!0,title:fe.get("Zoom to full range"),children:w.jsx(Ot,{sx:Gd.actionButton,onClick:i,size:"small",children:w.jsx(Zve,{fontSize:"inherit"})},"zoomOutButton")}),w.jsx(xt,{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(Xve,{fontSize:"inherit"})})}),w.jsx(NNt,{anchorEl:_?b.current:null,valueRange:g,setValueRange:C}),w.jsx(xt,{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(Kve,{fontSize:"inherit"})})}),w.jsx(xt,{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(Yve,{fontSize:"inherit"})})}),w.jsxs(iy,{value:p?[f,AO]:[f],onChange:E,size:"small",sx:Gd.chartTypes,children:[w.jsx(xt,{arrow:!0,title:fe.get("Show points"),children:w.jsx(Pn,{value:"point",size:"small",children:w.jsx(Jve,{fontSize:"inherit"})})}),w.jsx(xt,{arrow:!0,title:fe.get("Show lines"),children:w.jsx(Pn,{value:"line",size:"small",children:w.jsx(eye,{fontSize:"inherit"})})}),w.jsx(xt,{arrow:!0,title:fe.get("Show bars"),children:w.jsx(Pn,{value:"bar",size:"small",children:w.jsx(Qve,{fontSize:"inherit"})})}),w.jsx(xt,{arrow:!0,title:fe.get("Show standard deviation (if any)"),children:w.jsx(Pn,{value:AO,size:"small",disabled:h,children:w.jsx(m6,{fontSize:"inherit"})})})]}),w.jsx(cye,{elementRef:y,postMessage:x}),w.jsx(LNt,{sx:Gd.actionButton,timeSeriesGroupId:t.id,placeGroupTimeSeries:e,addPlaceGroupTimeSeries:n}),o?w.jsx(ey,{size:24,sx:Gd.actionButton,color:"secondary"}):w.jsx(Ot,{sx:Gd.actionButton,"aria-label":"Close",onClick:()=>r(t.id),size:"small",children:w.jsx($p,{fontSize:"inherit"})})]})})}const FNt=Li("div")(({theme:t})=>({userSelect:"none",marginTop:t.spacing(1),width:"99%",height:"32vh",display:"flex",flexDirection:"column",alignItems:"flex-stretch"})),jNt={style:{textAnchor:"middle"},angle:-90,position:"left",offset:0};function BNt({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=hd(),[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 $e=xe[V];if(En($e)&&isFinite($e)&&(me[oe]=$e),de){const Te=xe[de];En(Te)&&isFinite(Te)&&(me[Z]=Te)}})});const ie=Array.from(G.values());return ie.sort((he,_e)=>he.time-_e.time),ie},[t]),U=M.useMemo(()=>t.timeSeriesArray.map(G=>G.dataProgress?G.dataProgress:0),[t]),W=U.reduce((G,ie)=>G+ie,0)/U.length,$=W>0&&W<1,N=!!i&&!e6e(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]=oZ(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,$e=5,Te=5,Re=38,ae=de-me-Te,Le=xe-$e-Re-Me,Ee=(G-me)/ae,ze=(ie-$e)/Le;return[_e+Ee*(oe-_e),V-ze*(V-Z)]},[ge,ye]=oZ(k),H=S==="bar"?s3t:a3t;return w.jsxs(FNt,{children:[w.jsx($Nt,{timeSeriesGroup:t,placeGroupTimeSeries:p,addPlaceGroupTimeSeries:m,removeTimeSeriesGroup:h,resetZoom:F,loading:$,zoomed:N,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(Yme,{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(Vp,{dataKey:"time",type:"number",tickCount:6,domain:Q,tickFormatter:c3t,stroke:K,allowDataOverflow:!0}),w.jsx(Gp,{type:"number",tickCount:5,domain:X,tickFormatter:u3t,stroke:K,allowDataOverflow:!0,label:{...jNt,value:A}}),w.jsx(s6,{strokeDasharray:"3 3"}),b&&!En(k.x1)&&w.jsx(yl,{content:w.jsx(p3t,{})}),w.jsx(bv,{content:w.jsx(f3t,{removeTimeSeries:ve})}),t.timeSeriesArray.map((G,ie)=>m3t({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(Wp,{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(Rw,{isFront:!0,x:n,stroke:Y,strokeWidth:3,strokeOpacity:.5})]})})]})}function oZ(t){const{x1:e,x2:n,y1:r,y2:i}=t;let o,a;return En(e)&&En(n)&&(o=ew.jsx(BNt,{timeSeriesGroup:l,dataTimeRange:n,selectedTimeRange:r,selectTimeRange:i,...s},l.id))]})}const GNt=t=>({locale:t.controlState.locale,timeSeriesGroups:t.dataState.timeSeriesGroups,selectedTime:t.controlState.selectedTime,selectedTimeRange:t.controlState.selectedTimeRange,dataTimeRange:VWe(t),chartTypeDefault:t.controlState.timeSeriesChartTypeDefault,includeStdev:t.controlState.timeSeriesIncludeStdev,placeInfos:YWe(t),places:rw(t),placeGroupTimeSeries:s6e(t),canAddTimeSeries:xse(t)}),HNt={selectTime:k2,selectTimeRange:wle,removeTimeSeries:r8e,removeTimeSeriesGroup:i8e,selectPlace:M2,addPlaceGroupTimeSeries:n8e,addTimeSeries:P2,postMessage:ba},qNt=Jt(GNt,HNt)(VNt);var _6={},XNt=ft;Object.defineProperty(_6,"__esModule",{value:!0});var uye=_6.default=void 0,QNt=XNt(pt()),YNt=w;uye=_6.default=(0,QNt.default)((0,YNt.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 KNt(t){return t.count===0}function ZNt(t){return t.count===1}function JNt(t){return t.count>1}function e$t({statisticsRecord:t}){const e=t.statistics;return w.jsx(P5,{size:"small",children:w.jsx(M5,{children:KNt(e)?w.jsxs(vl,{children:[w.jsx(sr,{children:fe.get("Value")}),w.jsx(sr,{align:"right",children:"NaN"})]}):ZNt(e)?w.jsxs(vl,{children:[w.jsx(sr,{children:fe.get("Value")}),w.jsx(sr,{align:"right",children:H0(e.mean)})]}):w.jsxs(w.Fragment,{children:[w.jsxs(vl,{children:[w.jsx(sr,{children:fe.get("Count")}),w.jsx(sr,{align:"right",children:e.count})]}),w.jsxs(vl,{children:[w.jsx(sr,{children:fe.get("Minimum")}),w.jsx(sr,{align:"right",children:H0(e.minimum)})]}),w.jsxs(vl,{children:[w.jsx(sr,{children:fe.get("Maximum")}),w.jsx(sr,{align:"right",children:H0(e.maximum)})]}),w.jsxs(vl,{children:[w.jsx(sr,{children:fe.get("Mean")}),w.jsx(sr,{align:"right",children:H0(e.mean)})]}),w.jsxs(vl,{children:[w.jsx(sr,{children:fe.get("Deviation")}),w.jsx(sr,{align:"right",children:H0(e.deviation)})]})]})})})}function H0(t){return rd(t,3)}function t$t({statisticsRecord:t,showBrush:e,showDetails:n}){const r=Go(),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(Yme,{width:"100%",height:"100%",children:w.jsxs(l3t,{data:o,margin:{top:0,right:e?30:5,bottom:1,left:2},style:{color:g,fontSize:"0.8em"},children:[w.jsx(s6,{strokeDasharray:"3 3"}),w.jsx(Vp,{type:"number",dataKey:"x",domain:[f,d],tickCount:10,tickFormatter:y=>rd(y,2)}),w.jsx(Gp,{}),w.jsx(Dd,{type:"monotone",dataKey:"y",stroke:l.color,fill:l.color}),n&&w.jsx(Rw,{x:i.mean,isFront:!0,stroke:m,strokeWidth:2,strokeOpacity:.5}),n&&w.jsx(Wp,{x1:h,x2:p,isFront:!1,stroke:m,strokeWidth:1,strokeOpacity:.3,fill:m,fillOpacity:.05}),e&&w.jsx(gp,{dataKey:"i",height:22,startIndex:c,endIndex:u,tickFormatter:y=>rd(o[y].x,1),onChange:v})]})})}const RO={container:{padding:1,width:"100%"},header:{display:"flex",justifyContent:"space-between",alignItems:"center",paddingBottom:.5},actions:{display:"flex",gap:.1},body:{display:"flex"}};function IO({phrase:t}){return w.jsx("span",{style:{color:"red"},children:`<${fe.get(t)}?>`})}function fye({dataset:t,variable:e,time:n,placeInfo:r,actions:i,body:o,containerRef:a}){const s=t?t.title:w.jsx(IO,{phrase:"Dataset"}),l=e?e.name:w.jsx(IO,{phrase:"Variable"}),c=t==null?void 0:t.dimensions.some(d=>d.name=="time"),u=n?kae(n):c?w.jsx(IO,{phrase:"Time"}):null,f=r?r.label:w.jsx(IO,{phrase:"Place"});return w.jsxs(Ke,{sx:RO.container,ref:a,children:[w.jsxs(Ke,{sx:RO.header,children:[w.jsxs(At,{fontSize:"small",children:[s," / ",l,u&&`, ${u}`,", ",f]}),w.jsx(Ke,{sx:RO.actions,children:i})]}),o&&w.jsx(Ke,{sx:RO.body,children:o})]})}const aZ={table:{flexGrow:0},chart:{flexGrow:1}};function n$t({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=JNt(e.statistics),m=()=>{c(!l)},g=()=>{s(!a)},v=()=>{r(n)};return w.jsx(fye,{dataset:u,variable:f,time:d,placeInfo:h,containerRef:o,actions:w.jsxs(w.Fragment,{children:[p&&w.jsxs(iy,{size:"small",children:[w.jsx(xt,{arrow:!0,title:fe.get("Toggle adjustable x-range"),children:w.jsx(Pn,{selected:a,onClick:g,value:"brush",size:"small",children:w.jsx(uye,{fontSize:"inherit"})})}),w.jsx(xt,{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(m6,{fontSize:"inherit"})})})]}),p&&w.jsx(cye,{elementRef:o,postMessage:i}),w.jsx(Ot,{size:"small",onClick:v,children:w.jsx($p,{fontSize:"inherit"})})]}),body:w.jsxs(w.Fragment,{children:[w.jsx(Ke,{sx:aZ.table,children:w.jsx(e$t,{locale:t,statisticsRecord:e})}),w.jsx(Ke,{sx:aZ.chart,children:w.jsx(t$t,{showBrush:a,showDetails:l,statisticsRecord:e})})]})})}const r$t={progress:{color:"primary"}};function i$t({selectedDataset:t,selectedVariable:e,selectedTime:n,selectedPlaceInfo:r,canAddStatistics:i,addStatistics:o,statisticsLoading:a}){return w.jsx(fye,{dataset:t,variable:e,time:n,placeInfo:r,actions:a?w.jsx(ey,{size:20,sx:r$t.progress}):w.jsx(Ot,{size:"small",disabled:!i,onClick:o,color:"primary",children:w.jsx(dw,{fontSize:"inherit"})})})}const o$t={container:{padding:1,display:"flex",flexDirection:"column",alignItems:"flex-start"}};function a$t({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:o$t.container,children:[w.jsx(i$t,{selectedDataset:t,selectedVariable:e,selectedTime:n,selectedPlaceInfo:r,canAddStatistics:a,addStatistics:s,statisticsLoading:i}),o.map((u,f)=>w.jsx(n$t,{statisticsRecord:u,rowIndex:f,removeStatistics:l,postMessage:c},f))]})}const s$t=t=>({selectedDataset:qr(t),selectedVariable:vo(t),selectedTime:wy(t),selectedPlaceInfo:iw(t),statisticsLoading:o6e(t),statisticsRecords:KWe(t),canAddStatistics:bse(t)}),l$t={addStatistics:qse,removeStatistics:e8e,postMessage:ba},c$t=Jt(s$t,l$t)(a$t);/** * @license * Copyright 2010-2022 Three.js Authors * SPDX-License-Identifier: MIT - */const S6="144",gm={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},vm={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},d$t=0,cZ=1,h$t=2,hye=1,p$t=2,wx=3,Lv=0,_a=1,Yc=2,Hf=0,Bg=1,uZ=2,fZ=3,dZ=4,m$t=5,Vm=100,g$t=101,v$t=102,hZ=103,pZ=104,y$t=200,x$t=201,b$t=202,_$t=203,pye=204,mye=205,w$t=206,S$t=207,O$t=208,C$t=209,T$t=210,E$t=0,P$t=1,M$t=2,wF=3,k$t=4,A$t=5,R$t=6,I$t=7,gye=0,D$t=1,L$t=2,su=0,N$t=1,$$t=2,F$t=3,j$t=4,B$t=5,vye=300,Nv=301,$v=302,SF=303,OF=304,Dk=306,CF=1e3,qa=1001,TF=1002,Eo=1003,mZ=1004,gZ=1005,Po=1006,z$t=1007,Lk=1008,yp=1009,U$t=1010,W$t=1011,yye=1012,V$t=1013,kh=1014,Mf=1015,o1=1016,G$t=1017,H$t=1018,zg=1020,q$t=1021,X$t=1022,jl=1023,Q$t=1024,Y$t=1025,Hh=1026,Fv=1027,xye=1028,K$t=1029,Z$t=1030,J$t=1031,eFt=1033,GI=33776,HI=33777,qI=33778,XI=33779,vZ=35840,yZ=35841,xZ=35842,bZ=35843,tFt=36196,_Z=37492,wZ=37496,SZ=37808,OZ=37809,CZ=37810,TZ=37811,EZ=37812,PZ=37813,MZ=37814,kZ=37815,AZ=37816,RZ=37817,IZ=37818,DZ=37819,LZ=37820,NZ=37821,$Z=36492,xp=3e3,yr=3001,nFt=3200,rFt=3201,iFt=0,oFt=1,Rc="srgb",Ah="srgb-linear",QI=7680,aFt=519,FZ=35044,jZ="300 es",EF=1035;class Hp{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 Mo(t,e,n){return Math.max(e,Math.min(n,t))}function sFt(t,e){return(t%e+e)%e}function KI(t,e,n){return(1-n)*t+n*e}function zZ(t){return(t&t-1)===0&&t!==0}function PF(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function DO(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 Jo(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 qt{constructor(e=0,n=0){qt.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 bye(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}function a1(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function qh(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function YC(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}const ZI={[Rc]:{[Ah]:qh},[Ah]:{[Rc]:YC}},As={legacyMode:!0,get workingColorSpace(){return Ah},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(ZI[e]&&ZI[e][n]!==void 0){const r=ZI[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)}},_ye={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},Yr={r:0,g:0,b:0},Rs={h:0,s:0,l:0},LO={h:0,s:0,l:0};function JI(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 NO(t,e){return e.r=t.r,e.g=t.g,e.b=t.b,e}class lr{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=Rc){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,As.toWorkingColorSpace(this,n),this}setRGB(e,n,r,i=Ah){return this.r=e,this.g=n,this.b=r,As.toWorkingColorSpace(this,i),this}setHSL(e,n,r,i=Ah){if(e=sFt(e,1),n=Mo(n,0,1),r=Mo(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=JI(a,o,e+1/3),this.g=JI(a,o,e),this.b=JI(a,o,e-1/3)}return As.toWorkingColorSpace(this,i),this}setStyle(e,n=Rc){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,As.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,As.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,As.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,As.toWorkingColorSpace(this,n),this}return e&&e.length>0?this.setColorName(e,n):this}setColorName(e,n=Rc){const r=_ye[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=qh(e.r),this.g=qh(e.g),this.b=qh(e.b),this}copyLinearToSRGB(e){return this.r=YC(e.r),this.g=YC(e.g),this.b=YC(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Rc){return As.fromWorkingColorSpace(NO(this,Yr),e),Mo(Yr.r*255,0,255)<<16^Mo(Yr.g*255,0,255)<<8^Mo(Yr.b*255,0,255)<<0}getHexString(e=Rc){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=Ah){As.fromWorkingColorSpace(NO(this,Yr),n);const r=Yr.r,i=Yr.g,o=Yr.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{ym===void 0&&(ym=a1("canvas")),ym.width=e.width,ym.height=e.height;const r=ym.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),n=ym}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=a1("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 CF:e.x=e.x-Math.floor(e.x);break;case qa:e.x=e.x<0?0:1;break;case TF: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 CF:e.y=e.y-Math.floor(e.y);break;case qa:e.y=e.y<0?0:1;break;case TF: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=vye;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 bp extends Hp{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:Po,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 Sye(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 Oye 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=Eo,this.minFilter=Eo,this.wrapR=qa,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Cye 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=Eo,this.minFilter=Eo,this.wrapR=qa,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class _p{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(Mo(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(UZ.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(UZ.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 tD.copy(this).projectOnVector(e),this.sub(tD)}reflect(e){return this.sub(tD.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(Mo(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 tD=new Se,UZ=new _p;class Qy{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,Hd),Hd.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(X0),$O.subVectors(this.max,X0),xm.subVectors(e.a,X0),bm.subVectors(e.b,X0),_m.subVectors(e.c,X0),Bu.subVectors(bm,xm),zu.subVectors(_m,bm),qd.subVectors(xm,_m);let n=[0,-Bu.z,Bu.y,0,-zu.z,zu.y,0,-qd.z,qd.y,Bu.z,0,-Bu.x,zu.z,0,-zu.x,qd.z,0,-qd.x,-Bu.y,Bu.x,0,-zu.y,zu.x,0,-qd.y,qd.x,0];return!rD(n,xm,bm,_m,$O)||(n=[1,0,0,0,1,0,0,0,1],!rD(n,xm,bm,_m,$O))?!1:(FO.crossVectors(Bu,zu),n=[FO.x,FO.y,FO.z],rD(n,xm,bm,_m,$O))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return Hd.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=this.getSize(Hd).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:(xc[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),xc[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),xc[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),xc[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),xc[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),xc[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),xc[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),xc[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(xc),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 xc=[new Se,new Se,new Se,new Se,new Se,new Se,new Se,new Se],Hd=new Se,nD=new Qy,xm=new Se,bm=new Se,_m=new Se,Bu=new Se,zu=new Se,qd=new Se,X0=new Se,$O=new Se,FO=new Se,Xd=new Se;function rD(t,e,n,r,i){for(let o=0,a=t.length-3;o<=a;o+=3){Xd.fromArray(t,o);const s=i.x*Math.abs(Xd.x)+i.y*Math.abs(Xd.y)+i.z*Math.abs(Xd.z),l=e.dot(Xd),c=n.dot(Xd),u=r.dot(Xd);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>s)return!1}return!0}const cFt=new Qy,WZ=new Se,jO=new Se,iD=new Se;class Nk{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):cFt.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){iD.subVectors(e,this.center);const n=iD.lengthSq();if(n>this.radius*this.radius){const r=Math.sqrt(n),i=(r-this.radius)*.5;this.center.add(iD.multiplyScalar(i/r)),this.radius+=i}return this}union(e){return this.center.equals(e.center)===!0?jO.set(0,0,1).multiplyScalar(e.radius):jO.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(WZ.copy(e.center).add(jO)),this.expandByPoint(WZ.copy(e.center).sub(jO)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const bc=new Se,oD=new Se,BO=new Se,Uu=new Se,aD=new Se,zO=new Se,sD=new Se;class Tye{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,bc)),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=bc.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(bc.copy(this.direction).multiplyScalar(n).add(this.origin),bc.distanceToSquared(e))}distanceSqToSegment(e,n,r,i){oD.copy(e).add(n).multiplyScalar(.5),BO.copy(n).sub(e).normalize(),Uu.copy(this.origin).sub(oD);const o=e.distanceTo(n)*.5,a=-this.direction.dot(BO),s=Uu.dot(this.direction),l=-Uu.dot(BO),c=Uu.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(BO).multiplyScalar(d).add(oD),h}intersectSphere(e,n){bc.subVectors(e.center,this.origin);const r=bc.dot(this.direction),i=bc.dot(bc)-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,bc)!==null}intersectTriangle(e,n,r,i,o){aD.subVectors(n,e),zO.subVectors(r,e),sD.crossVectors(aD,zO);let a=this.direction.dot(sD),s;if(a>0){if(i)return null;s=1}else if(a<0)s=-1,a=-a;else return null;Uu.subVectors(this.origin,e);const l=s*this.direction.dot(zO.crossVectors(Uu,zO));if(l<0)return null;const c=s*this.direction.dot(aD.cross(Uu));if(c<0||l+c>a)return null;const u=-s*Uu.dot(sD);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 Hn{constructor(){Hn.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 Hn().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/wm.setFromMatrixColumn(e,0).length(),o=1/wm.setFromMatrixColumn(e,1).length(),a=1/wm.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(uFt,e,fFt)}lookAt(e,n,r){const i=this.elements;return ea.subVectors(e,n),ea.lengthSq()===0&&(ea.z=1),ea.normalize(),Wu.crossVectors(r,ea),Wu.lengthSq()===0&&(Math.abs(r.z)===1?ea.x+=1e-4:ea.z+=1e-4,ea.normalize(),Wu.crossVectors(r,ea)),Wu.normalize(),UO.crossVectors(ea,Wu),i[0]=Wu.x,i[4]=UO.x,i[8]=ea.x,i[1]=Wu.y,i[5]=UO.y,i[9]=ea.y,i[2]=Wu.z,i[6]=UO.z,i[10]=ea.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],U=i[3],W=i[7],$=i[11],N=i[15];return o[0]=a*S+s*k+l*T+c*U,o[4]=a*O+s*I+l*L+c*W,o[8]=a*C+s*P+l*z+c*$,o[12]=a*E+s*R+l*B+c*N,o[1]=u*S+f*k+d*T+h*U,o[5]=u*O+f*I+d*L+h*W,o[9]=u*C+f*P+d*z+h*$,o[13]=u*E+f*R+d*B+h*N,o[2]=p*S+m*k+g*T+v*U,o[6]=p*O+m*I+g*L+v*W,o[10]=p*C+m*P+g*z+v*$,o[14]=p*E+m*R+g*B+v*N,o[3]=y*S+x*k+b*T+_*U,o[7]=y*O+x*I+b*L+_*W,o[11]=y*C+x*P+b*z+_*$,o[15]=y*E+x*R+b*B+_*N,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=wm.set(i[0],i[1],i[2]).length();const a=wm.set(i[4],i[5],i[6]).length(),s=wm.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],Is.copy(this);const c=1/o,u=1/a,f=1/s;return Is.elements[0]*=c,Is.elements[1]*=c,Is.elements[2]*=c,Is.elements[4]*=u,Is.elements[5]*=u,Is.elements[6]*=u,Is.elements[8]*=f,Is.elements[9]*=f,Is.elements[10]*=f,n.setFromRotationMatrix(Is),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 wm=new Se,Is=new Hn,uFt=new Se(0,0,0),fFt=new Se(1,1,1),Wu=new Se,UO=new Se,ea=new Se,VZ=new Hn,GZ=new _p;class Nw{constructor(e=0,n=0,r=0,i=Nw.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(Mo(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(-Mo(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(Mo(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(-Mo(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(Mo(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(-Mo(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 VZ.makeRotationFromQuaternion(e),this.setFromRotationMatrix(VZ,n,r)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return GZ.setFromEuler(this),this.setFromQuaternion(GZ,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")}}Nw.DefaultOrder="XYZ";Nw.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class Eye{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){Ds.subVectors(i,n),wc.subVectors(r,n),lD.subVectors(e,n);const a=Ds.dot(Ds),s=Ds.dot(wc),l=Ds.dot(lD),c=wc.dot(wc),u=wc.dot(lD),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,Sc),Sc.x>=0&&Sc.y>=0&&Sc.x+Sc.y<=1}static getUV(e,n,r,i,o,a,s,l){return this.getBarycoord(e,n,r,i,Sc),l.set(0,0),l.addScaledVector(o,Sc.x),l.addScaledVector(a,Sc.y),l.addScaledVector(s,Sc.z),l}static isFrontFacing(e,n,r,i){return Ds.subVectors(r,n),wc.subVectors(e,n),Ds.cross(wc).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 Ds.subVectors(this.c,this.b),wc.subVectors(this.a,this.b),Ds.cross(wc).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Wc.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return Wc.getBarycoord(e,this.a,this.b,this.c,n)}getUV(e,n,r,i,o){return Wc.getUV(e,this.a,this.b,this.c,n,r,i,o)}containsPoint(e){return Wc.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Wc.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;Om.subVectors(i,r),Cm.subVectors(o,r),cD.subVectors(e,r);const l=Om.dot(cD),c=Cm.dot(cD);if(l<=0&&c<=0)return n.copy(r);uD.subVectors(e,i);const u=Om.dot(uD),f=Cm.dot(uD);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(Om,a);fD.subVectors(e,o);const h=Om.dot(fD),p=Cm.dot(fD);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(Cm,s);const g=u*p-h*f;if(g<=0&&f-u>=0&&h-p>=0)return KZ.subVectors(o,i),s=(f-u)/(f-u+(h-p)),n.copy(i).addScaledVector(KZ,s);const v=1/(g+m+d);return a=m*v,s=d*v,n.copy(r).addScaledVector(Om,a).addScaledVector(Cm,s)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let gFt=0;class $w extends Hp{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:gFt++}),this.uuid=Lw(),this.name="",this.type="Material",this.blending=Bg,this.side=Lv,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=pye,this.blendDst=mye,this.blendEquation=Vm,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=wF,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=aFt,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=QI,this.stencilZFail=QI,this.stencilZPass=QI,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!==Bg&&(r.blending=this.blending),this.side!==Lv&&(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 O6 extends $w{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new lr(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=gye,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 Dr=new Se,VO=new qt;class as{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=FZ,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:KO.clone(),object:t}}function ZO(t,e,n,r,i,o,a,s,l,c,u,f){Vu.fromBufferAttribute(i,c),Gu.fromBufferAttribute(i,u),Hu.fromBufferAttribute(i,f);const d=t.morphTargetInfluences;if(o&&d){GO.set(0,0,0),HO.set(0,0,0),qO.set(0,0,0);for(let p=0,m=o.length;p0?1:-1,u.push(W.x,W.y,W.z),f.push(D/O),f.push(1-$/C),B+=1}}for(let $=0;$>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 Mo(t,e,n){return Math.max(e,Math.min(n,t))}function oFt(t,e){return(t%e+e)%e}function YI(t,e,n){return(1-n)*t+n*e}function jZ(t){return(t&t-1)===0&&t!==0}function EF(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function DO(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 Jo(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 qt{constructor(e=0,n=0){qt.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 xye(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}function o1(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function qh(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function YC(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}const KI={[Rc]:{[Ah]:qh},[Ah]:{[Rc]:YC}},As={legacyMode:!0,get workingColorSpace(){return Ah},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(KI[e]&&KI[e][n]!==void 0){const r=KI[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)}},bye={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},Yr={r:0,g:0,b:0},Rs={h:0,s:0,l:0},LO={h:0,s:0,l:0};function ZI(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 NO(t,e){return e.r=t.r,e.g=t.g,e.b=t.b,e}class lr{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=Rc){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,As.toWorkingColorSpace(this,n),this}setRGB(e,n,r,i=Ah){return this.r=e,this.g=n,this.b=r,As.toWorkingColorSpace(this,i),this}setHSL(e,n,r,i=Ah){if(e=oFt(e,1),n=Mo(n,0,1),r=Mo(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=ZI(a,o,e+1/3),this.g=ZI(a,o,e),this.b=ZI(a,o,e-1/3)}return As.toWorkingColorSpace(this,i),this}setStyle(e,n=Rc){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,As.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,As.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,As.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,As.toWorkingColorSpace(this,n),this}return e&&e.length>0?this.setColorName(e,n):this}setColorName(e,n=Rc){const r=bye[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=qh(e.r),this.g=qh(e.g),this.b=qh(e.b),this}copyLinearToSRGB(e){return this.r=YC(e.r),this.g=YC(e.g),this.b=YC(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Rc){return As.fromWorkingColorSpace(NO(this,Yr),e),Mo(Yr.r*255,0,255)<<16^Mo(Yr.g*255,0,255)<<8^Mo(Yr.b*255,0,255)<<0}getHexString(e=Rc){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=Ah){As.fromWorkingColorSpace(NO(this,Yr),n);const r=Yr.r,i=Yr.g,o=Yr.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{ym===void 0&&(ym=o1("canvas")),ym.width=e.width,ym.height=e.height;const r=ym.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),n=ym}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=o1("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 OF:e.x=e.x-Math.floor(e.x);break;case qa:e.x=e.x<0?0:1;break;case CF: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 OF:e.y=e.y-Math.floor(e.y);break;case qa:e.y=e.y<0?0:1;break;case CF: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=gye;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 bp extends Hp{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:Po,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 wye(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 Sye 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=Eo,this.minFilter=Eo,this.wrapR=qa,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Oye 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=Eo,this.minFilter=Eo,this.wrapR=qa,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class _p{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(Mo(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(BZ.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(BZ.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 eD.copy(this).projectOnVector(e),this.sub(eD)}reflect(e){return this.sub(eD.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(Mo(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 eD=new Se,BZ=new _p;class Xy{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,Hd),Hd.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(q0),$O.subVectors(this.max,q0),xm.subVectors(e.a,q0),bm.subVectors(e.b,q0),_m.subVectors(e.c,q0),Bu.subVectors(bm,xm),zu.subVectors(_m,bm),qd.subVectors(xm,_m);let n=[0,-Bu.z,Bu.y,0,-zu.z,zu.y,0,-qd.z,qd.y,Bu.z,0,-Bu.x,zu.z,0,-zu.x,qd.z,0,-qd.x,-Bu.y,Bu.x,0,-zu.y,zu.x,0,-qd.y,qd.x,0];return!nD(n,xm,bm,_m,$O)||(n=[1,0,0,0,1,0,0,0,1],!nD(n,xm,bm,_m,$O))?!1:(FO.crossVectors(Bu,zu),n=[FO.x,FO.y,FO.z],nD(n,xm,bm,_m,$O))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return Hd.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=this.getSize(Hd).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:(xc[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),xc[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),xc[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),xc[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),xc[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),xc[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),xc[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),xc[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(xc),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 xc=[new Se,new Se,new Se,new Se,new Se,new Se,new Se,new Se],Hd=new Se,tD=new Xy,xm=new Se,bm=new Se,_m=new Se,Bu=new Se,zu=new Se,qd=new Se,q0=new Se,$O=new Se,FO=new Se,Xd=new Se;function nD(t,e,n,r,i){for(let o=0,a=t.length-3;o<=a;o+=3){Xd.fromArray(t,o);const s=i.x*Math.abs(Xd.x)+i.y*Math.abs(Xd.y)+i.z*Math.abs(Xd.z),l=e.dot(Xd),c=n.dot(Xd),u=r.dot(Xd);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>s)return!1}return!0}const sFt=new Xy,zZ=new Se,jO=new Se,rD=new Se;class Nk{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):sFt.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){rD.subVectors(e,this.center);const n=rD.lengthSq();if(n>this.radius*this.radius){const r=Math.sqrt(n),i=(r-this.radius)*.5;this.center.add(rD.multiplyScalar(i/r)),this.radius+=i}return this}union(e){return this.center.equals(e.center)===!0?jO.set(0,0,1).multiplyScalar(e.radius):jO.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(zZ.copy(e.center).add(jO)),this.expandByPoint(zZ.copy(e.center).sub(jO)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const bc=new Se,iD=new Se,BO=new Se,Uu=new Se,oD=new Se,zO=new Se,aD=new Se;class Cye{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,bc)),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=bc.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(bc.copy(this.direction).multiplyScalar(n).add(this.origin),bc.distanceToSquared(e))}distanceSqToSegment(e,n,r,i){iD.copy(e).add(n).multiplyScalar(.5),BO.copy(n).sub(e).normalize(),Uu.copy(this.origin).sub(iD);const o=e.distanceTo(n)*.5,a=-this.direction.dot(BO),s=Uu.dot(this.direction),l=-Uu.dot(BO),c=Uu.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(BO).multiplyScalar(d).add(iD),h}intersectSphere(e,n){bc.subVectors(e.center,this.origin);const r=bc.dot(this.direction),i=bc.dot(bc)-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,bc)!==null}intersectTriangle(e,n,r,i,o){oD.subVectors(n,e),zO.subVectors(r,e),aD.crossVectors(oD,zO);let a=this.direction.dot(aD),s;if(a>0){if(i)return null;s=1}else if(a<0)s=-1,a=-a;else return null;Uu.subVectors(this.origin,e);const l=s*this.direction.dot(zO.crossVectors(Uu,zO));if(l<0)return null;const c=s*this.direction.dot(oD.cross(Uu));if(c<0||l+c>a)return null;const u=-s*Uu.dot(aD);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 Hn{constructor(){Hn.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 Hn().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/wm.setFromMatrixColumn(e,0).length(),o=1/wm.setFromMatrixColumn(e,1).length(),a=1/wm.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(lFt,e,cFt)}lookAt(e,n,r){const i=this.elements;return ea.subVectors(e,n),ea.lengthSq()===0&&(ea.z=1),ea.normalize(),Wu.crossVectors(r,ea),Wu.lengthSq()===0&&(Math.abs(r.z)===1?ea.x+=1e-4:ea.z+=1e-4,ea.normalize(),Wu.crossVectors(r,ea)),Wu.normalize(),UO.crossVectors(ea,Wu),i[0]=Wu.x,i[4]=UO.x,i[8]=ea.x,i[1]=Wu.y,i[5]=UO.y,i[9]=ea.y,i[2]=Wu.z,i[6]=UO.z,i[10]=ea.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],U=i[3],W=i[7],$=i[11],N=i[15];return o[0]=a*S+s*k+l*T+c*U,o[4]=a*O+s*I+l*L+c*W,o[8]=a*C+s*P+l*z+c*$,o[12]=a*E+s*R+l*B+c*N,o[1]=u*S+f*k+d*T+h*U,o[5]=u*O+f*I+d*L+h*W,o[9]=u*C+f*P+d*z+h*$,o[13]=u*E+f*R+d*B+h*N,o[2]=p*S+m*k+g*T+v*U,o[6]=p*O+m*I+g*L+v*W,o[10]=p*C+m*P+g*z+v*$,o[14]=p*E+m*R+g*B+v*N,o[3]=y*S+x*k+b*T+_*U,o[7]=y*O+x*I+b*L+_*W,o[11]=y*C+x*P+b*z+_*$,o[15]=y*E+x*R+b*B+_*N,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=wm.set(i[0],i[1],i[2]).length();const a=wm.set(i[4],i[5],i[6]).length(),s=wm.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],Is.copy(this);const c=1/o,u=1/a,f=1/s;return Is.elements[0]*=c,Is.elements[1]*=c,Is.elements[2]*=c,Is.elements[4]*=u,Is.elements[5]*=u,Is.elements[6]*=u,Is.elements[8]*=f,Is.elements[9]*=f,Is.elements[10]*=f,n.setFromRotationMatrix(Is),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 wm=new Se,Is=new Hn,lFt=new Se(0,0,0),cFt=new Se(1,1,1),Wu=new Se,UO=new Se,ea=new Se,UZ=new Hn,WZ=new _p;class Nw{constructor(e=0,n=0,r=0,i=Nw.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(Mo(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(-Mo(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(Mo(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(-Mo(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(Mo(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(-Mo(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 UZ.makeRotationFromQuaternion(e),this.setFromRotationMatrix(UZ,n,r)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return WZ.setFromEuler(this),this.setFromQuaternion(WZ,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")}}Nw.DefaultOrder="XYZ";Nw.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class Tye{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){Ds.subVectors(i,n),wc.subVectors(r,n),sD.subVectors(e,n);const a=Ds.dot(Ds),s=Ds.dot(wc),l=Ds.dot(sD),c=wc.dot(wc),u=wc.dot(sD),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,Sc),Sc.x>=0&&Sc.y>=0&&Sc.x+Sc.y<=1}static getUV(e,n,r,i,o,a,s,l){return this.getBarycoord(e,n,r,i,Sc),l.set(0,0),l.addScaledVector(o,Sc.x),l.addScaledVector(a,Sc.y),l.addScaledVector(s,Sc.z),l}static isFrontFacing(e,n,r,i){return Ds.subVectors(r,n),wc.subVectors(e,n),Ds.cross(wc).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 Ds.subVectors(this.c,this.b),wc.subVectors(this.a,this.b),Ds.cross(wc).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Wc.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return Wc.getBarycoord(e,this.a,this.b,this.c,n)}getUV(e,n,r,i,o){return Wc.getUV(e,this.a,this.b,this.c,n,r,i,o)}containsPoint(e){return Wc.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Wc.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;Om.subVectors(i,r),Cm.subVectors(o,r),lD.subVectors(e,r);const l=Om.dot(lD),c=Cm.dot(lD);if(l<=0&&c<=0)return n.copy(r);cD.subVectors(e,i);const u=Om.dot(cD),f=Cm.dot(cD);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(Om,a);uD.subVectors(e,o);const h=Om.dot(uD),p=Cm.dot(uD);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(Cm,s);const g=u*p-h*f;if(g<=0&&f-u>=0&&h-p>=0)return QZ.subVectors(o,i),s=(f-u)/(f-u+(h-p)),n.copy(i).addScaledVector(QZ,s);const v=1/(g+m+d);return a=m*v,s=d*v,n.copy(r).addScaledVector(Om,a).addScaledVector(Cm,s)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let pFt=0;class $w extends Hp{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:pFt++}),this.uuid=Lw(),this.name="",this.type="Material",this.blending=Bg,this.side=Lv,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=hye,this.blendDst=pye,this.blendEquation=Vm,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=_F,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=iFt,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=XI,this.stencilZFail=XI,this.stencilZPass=XI,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!==Bg&&(r.blending=this.blending),this.side!==Lv&&(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 S6 extends $w{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new lr(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=mye,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 Dr=new Se,VO=new qt;class as{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=NZ,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:KO.clone(),object:t}}function ZO(t,e,n,r,i,o,a,s,l,c,u,f){Vu.fromBufferAttribute(i,c),Gu.fromBufferAttribute(i,u),Hu.fromBufferAttribute(i,f);const d=t.morphTargetInfluences;if(o&&d){GO.set(0,0,0),HO.set(0,0,0),qO.set(0,0,0);for(let p=0,m=o.length;p0?1:-1,u.push(W.x,W.y,W.z),f.push(D/O),f.push(1-$/C),B+=1}}for(let $=0;$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 Aye extends zo{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Hn,this.projectionMatrix=new Hn,this.projectionMatrixInverse=new Hn}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 Us extends Aye{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=BZ*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(YI*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return BZ*2*Math.atan(Math.tan(YI*.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(YI*.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 Pm=90,Mm=1;class wFt extends zo{constructor(e,n,r){super(),this.type="CubeCamera",this.renderTarget=r;const i=new Us(Pm,Mm,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 Us(Pm,Mm,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 Us(Pm,Mm,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 Us(Pm,Mm,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 Us(Pm,Mm,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 Us(Pm,Mm,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=su,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 Rye extends Ta{constructor(e,n,r,i,o,a,s,l,c,u){e=e!==void 0?e:[],n=n!==void 0?n:Nv,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 SFt extends bp{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 Rye(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:Po}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 ud extends $w{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=yFt,this.fragmentShader=xFt,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=jv(e.uniforms),this.uniformsGroups=vFt(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 kye extends zo{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Hn,this.projectionMatrix=new Hn,this.projectionMatrixInverse=new Hn}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 Us extends kye{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=FZ*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(QI*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return FZ*2*Math.atan(Math.tan(QI*.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(QI*.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 Pm=90,Mm=1;class bFt extends zo{constructor(e,n,r){super(),this.type="CubeCamera",this.renderTarget=r;const i=new Us(Pm,Mm,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 Us(Pm,Mm,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 Us(Pm,Mm,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 Us(Pm,Mm,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 Us(Pm,Mm,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 Us(Pm,Mm,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=su,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 Aye extends Ta{constructor(e,n,r,i,o,a,s,l,c,u){e=e!==void 0?e:[],n=n!==void 0?n:Nv,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 _Ft extends bp{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 Aye(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:Po}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; @@ -379,28 +379,28 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho gl_FragColor = texture2D( tEquirect, sampleUV ); } - `},i=new Yy(5,5,5),o=new ud({name:"CubemapFromEquirect",uniforms:jv(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:_a,blending:Hf});o.uniforms.tEquirect.value=n;const a=new Bl(i,o),s=n.minFilter;return n.minFilter===Lk&&(n.minFilter=Po),new wFt(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 yD=new Se,OFt=new Se,CFt=new va;class rh{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=yD.subVectors(r,n).cross(OFt.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(yD),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||CFt.getNormalMatrix(e),i=this.coplanarPoint(yD).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 km=new Nk,JO=new Se;class Iye{constructor(e=new rh,n=new rh,r=new rh,i=new rh,o=new rh,a=new rh){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(),km.copy(n.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(km)}intersectsSprite(e){return km.center.set(0,0,0),km.radius=.7071067811865476,km.applyMatrix4(e.matrixWorld),this.intersectsSphere(km)}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,JO.y=i.normal.y>0?e.max.y:e.min.y,JO.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(JO)<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 Dye(){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 TFt(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||SFt.getNormalMatrix(e),i=this.coplanarPoint(vD).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 km=new Nk,JO=new Se;class Rye{constructor(e=new rh,n=new rh,r=new rh,i=new rh,o=new rh,a=new rh){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(),km.copy(n.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(km)}intersectsSprite(e){return km.center.set(0,0,0),km.radius=.7071067811865476,km.applyMatrix4(e.matrixWorld),this.intersectsSphere(km)}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,JO.y=i.normal.y>0?e.max.y:e.min.y,JO.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(JO)<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 Iye(){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 OFt(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`,NFt=`#if NUM_CLIPPING_PLANES > 0 vec4 plane; #pragma unroll_loop_start for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { @@ -640,26 +640,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`,jFt=`#if NUM_CLIPPING_PLANES > 0 +#endif`,$Ft=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,BFt=`#if NUM_CLIPPING_PLANES > 0 +#endif`,FFt=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; -#endif`,zFt=`#if NUM_CLIPPING_PLANES > 0 +#endif`,jFt=`#if NUM_CLIPPING_PLANES > 0 vClipPosition = - mvPosition.xyz; -#endif`,UFt=`#if defined( USE_COLOR_ALPHA ) +#endif`,BFt=`#if defined( USE_COLOR_ALPHA ) diffuseColor *= vColor; #elif defined( USE_COLOR ) diffuseColor.rgb *= vColor; -#endif`,WFt=`#if defined( USE_COLOR_ALPHA ) +#endif`,zFt=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) varying vec3 vColor; -#endif`,VFt=`#if defined( USE_COLOR_ALPHA ) +#endif`,UFt=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) varying vec3 vColor; -#endif`,GFt=`#if defined( USE_COLOR_ALPHA ) +#endif`,WFt=`#if defined( USE_COLOR_ALPHA ) vColor = vec4( 1.0 ); #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) vColor = vec3( 1.0 ); @@ -669,7 +669,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`,HFt=`#define PI 3.141592653589793 +#endif`,VFt=`#define PI 3.141592653589793 #define PI2 6.283185307179586 #define PI_HALF 1.5707963267948966 #define RECIPROCAL_PI 0.3183098861837907 @@ -741,7 +741,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 ); -}`,qFt=`#ifdef ENVMAP_TYPE_CUBE_UV +}`,GFt=`#ifdef ENVMAP_TYPE_CUBE_UV #define cubeUV_minMipLevel 4.0 #define cubeUV_minTileSize 16.0 float getFace( vec3 direction ) { @@ -839,7 +839,7 @@ vec2 equirectUv( in vec3 dir ) { return vec4( mix( color0, color1, mipF ), 1.0 ); } } -#endif`,XFt=`vec3 transformedNormal = objectNormal; +#endif`,HFt=`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 ] ) ); @@ -854,23 +854,23 @@ transformedNormal = normalMatrix * transformedNormal; #ifdef FLIP_SIDED transformedTangent = - transformedTangent; #endif -#endif`,QFt=`#ifdef USE_DISPLACEMENTMAP +#endif`,qFt=`#ifdef USE_DISPLACEMENTMAP uniform sampler2D displacementMap; uniform float displacementScale; uniform float displacementBias; -#endif`,YFt=`#ifdef USE_DISPLACEMENTMAP +#endif`,XFt=`#ifdef USE_DISPLACEMENTMAP transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias ); -#endif`,KFt=`#ifdef USE_EMISSIVEMAP +#endif`,QFt=`#ifdef USE_EMISSIVEMAP vec4 emissiveColor = texture2D( emissiveMap, vUv ); totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,ZFt=`#ifdef USE_EMISSIVEMAP +#endif`,YFt=`#ifdef USE_EMISSIVEMAP uniform sampler2D emissiveMap; -#endif`,JFt="gl_FragColor = linearToOutputTexel( gl_FragColor );",ejt=`vec4 LinearToLinear( in vec4 value ) { +#endif`,KFt="gl_FragColor = linearToOutputTexel( gl_FragColor );",ZFt=`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 ); -}`,tjt=`#ifdef USE_ENVMAP +}`,JFt=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vec3 cameraToFrag; if ( isOrthographic ) { @@ -901,7 +901,7 @@ vec4 LinearTosRGB( in vec4 value ) { #elif defined( ENVMAP_BLENDING_ADD ) outgoingLight += envColor.xyz * specularStrength * reflectivity; #endif -#endif`,njt=`#ifdef USE_ENVMAP +#endif`,ejt=`#ifdef USE_ENVMAP uniform float envMapIntensity; uniform float flipEnvMap; #ifdef ENVMAP_TYPE_CUBE @@ -910,7 +910,7 @@ vec4 LinearTosRGB( in vec4 value ) { uniform sampler2D envMap; #endif -#endif`,rjt=`#ifdef USE_ENVMAP +#endif`,tjt=`#ifdef USE_ENVMAP uniform float reflectivity; #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS @@ -921,7 +921,7 @@ vec4 LinearTosRGB( in vec4 value ) { #else varying vec3 vReflect; #endif -#endif`,ijt=`#ifdef USE_ENVMAP +#endif`,njt=`#ifdef USE_ENVMAP #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS #endif @@ -932,7 +932,7 @@ vec4 LinearTosRGB( in vec4 value ) { varying vec3 vReflect; uniform float refractionRatio; #endif -#endif`,ojt=`#ifdef USE_ENVMAP +#endif`,rjt=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vWorldPosition = worldPosition.xyz; #else @@ -949,18 +949,18 @@ vec4 LinearTosRGB( in vec4 value ) { vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); #endif #endif -#endif`,ajt=`#ifdef USE_FOG +#endif`,ijt=`#ifdef USE_FOG vFogDepth = - mvPosition.z; -#endif`,sjt=`#ifdef USE_FOG +#endif`,ojt=`#ifdef USE_FOG varying float vFogDepth; -#endif`,ljt=`#ifdef USE_FOG +#endif`,ajt=`#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`,cjt=`#ifdef USE_FOG +#endif`,sjt=`#ifdef USE_FOG uniform vec3 fogColor; varying float vFogDepth; #ifdef FOG_EXP2 @@ -969,7 +969,7 @@ vec4 LinearTosRGB( in vec4 value ) { uniform float fogNear; uniform float fogFar; #endif -#endif`,ujt=`#ifdef USE_GRADIENTMAP +#endif`,ljt=`#ifdef USE_GRADIENTMAP uniform sampler2D gradientMap; #endif vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { @@ -981,16 +981,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 -}`,fjt=`#ifdef USE_LIGHTMAP +}`,cjt=`#ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vUv2 ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; reflectedLight.indirectDiffuse += lightMapIrradiance; -#endif`,djt=`#ifdef USE_LIGHTMAP +#endif`,ujt=`#ifdef USE_LIGHTMAP uniform sampler2D lightMap; uniform float lightMapIntensity; -#endif`,hjt=`LambertMaterial material; +#endif`,fjt=`LambertMaterial material; material.diffuseColor = diffuseColor.rgb; -material.specularStrength = specularStrength;`,pjt=`varying vec3 vViewPosition; +material.specularStrength = specularStrength;`,djt=`varying vec3 vViewPosition; struct LambertMaterial { vec3 diffuseColor; float specularStrength; @@ -1005,7 +1005,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)`,mjt=`uniform bool receiveShadow; +#define Material_LightProbeLOD( material ) (0)`,hjt=`uniform bool receiveShadow; uniform vec3 ambientLightColor; uniform vec3 lightProbe[ 9 ]; vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { @@ -1126,7 +1126,7 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); return irradiance; } -#endif`,gjt=`#if defined( USE_ENVMAP ) +#endif`,pjt=`#if defined( USE_ENVMAP ) vec3 getIBLIrradiance( const in vec3 normal ) { #if defined( ENVMAP_TYPE_CUBE_UV ) vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); @@ -1147,8 +1147,8 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi return vec3( 0.0 ); #endif } -#endif`,vjt=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,yjt=`varying vec3 vViewPosition; +#endif`,mjt=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,gjt=`varying vec3 vViewPosition; struct ToonMaterial { vec3 diffuseColor; }; @@ -1161,11 +1161,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)`,xjt=`BlinnPhongMaterial material; +#define Material_LightProbeLOD( material ) (0)`,vjt=`BlinnPhongMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularColor = specular; material.specularShininess = shininess; -material.specularStrength = specularStrength;`,bjt=`varying vec3 vViewPosition; +material.specularStrength = specularStrength;`,yjt=`varying vec3 vViewPosition; struct BlinnPhongMaterial { vec3 diffuseColor; vec3 specularColor; @@ -1183,7 +1183,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)`,_jt=`PhysicalMaterial material; +#define Material_LightProbeLOD( material ) (0)`,xjt=`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 ); @@ -1247,7 +1247,7 @@ material.roughness = min( material.roughness, 1.0 ); #ifdef USE_SHEENROUGHNESSMAP material.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a; #endif -#endif`,wjt=`struct PhysicalMaterial { +#endif`,bjt=`struct PhysicalMaterial { vec3 diffuseColor; float roughness; vec3 specularColor; @@ -1396,7 +1396,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 ); -}`,Sjt=` +}`,_jt=` GeometricContext geometry; geometry.position = - vViewPosition; geometry.normal = normal; @@ -1509,7 +1509,7 @@ IncidentLight directLight; #if defined( RE_IndirectSpecular ) vec3 radiance = vec3( 0.0 ); vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,Ojt=`#if defined( RE_IndirectDiffuse ) +#endif`,wjt=`#if defined( RE_IndirectDiffuse ) #ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vUv2 ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; @@ -1524,25 +1524,25 @@ IncidentLight directLight; #ifdef USE_CLEARCOAT clearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness ); #endif -#endif`,Cjt=`#if defined( RE_IndirectDiffuse ) +#endif`,Sjt=`#if defined( RE_IndirectDiffuse ) RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight ); #endif #if defined( RE_IndirectSpecular ) RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight ); -#endif`,Tjt=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) +#endif`,Ojt=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,Ejt=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) +#endif`,Cjt=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) uniform float logDepthBufFC; varying float vFragDepth; varying float vIsPerspective; -#endif`,Pjt=`#ifdef USE_LOGDEPTHBUF +#endif`,Tjt=`#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT varying float vFragDepth; varying float vIsPerspective; #else uniform float logDepthBufFC; #endif -#endif`,Mjt=`#ifdef USE_LOGDEPTHBUF +#endif`,Ejt=`#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT vFragDepth = 1.0 + gl_Position.w; vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); @@ -1552,15 +1552,15 @@ IncidentLight directLight; gl_Position.z *= gl_Position.w; } #endif -#endif`,kjt=`#ifdef USE_MAP +#endif`,Pjt=`#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`,Ajt=`#ifdef USE_MAP +#endif`,Mjt=`#ifdef USE_MAP uniform sampler2D map; -#endif`,Rjt=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) +#endif`,kjt=`#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 @@ -1568,7 +1568,7 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,Ijt=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) +#endif`,Ajt=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) uniform mat3 uvTransform; #endif #ifdef USE_MAP @@ -1576,13 +1576,13 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP uniform sampler2D alphaMap; -#endif`,Djt=`float metalnessFactor = metalness; +#endif`,Rjt=`float metalnessFactor = metalness; #ifdef USE_METALNESSMAP vec4 texelMetalness = texture2D( metalnessMap, vUv ); metalnessFactor *= texelMetalness.b; -#endif`,Ljt=`#ifdef USE_METALNESSMAP +#endif`,Ijt=`#ifdef USE_METALNESSMAP uniform sampler2D metalnessMap; -#endif`,Njt=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) +#endif`,Djt=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) vColor *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { #if defined( USE_COLOR_ALPHA ) @@ -1591,7 +1591,7 @@ IncidentLight directLight; if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; #endif } -#endif`,$jt=`#ifdef USE_MORPHNORMALS +#endif`,Ljt=`#ifdef USE_MORPHNORMALS objectNormal *= morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { @@ -1603,7 +1603,7 @@ IncidentLight directLight; objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; #endif -#endif`,Fjt=`#ifdef USE_MORPHTARGETS +#endif`,Njt=`#ifdef USE_MORPHTARGETS uniform float morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; @@ -1623,7 +1623,7 @@ IncidentLight directLight; uniform float morphTargetInfluences[ 4 ]; #endif #endif -#endif`,jjt=`#ifdef USE_MORPHTARGETS +#endif`,$jt=`#ifdef USE_MORPHTARGETS transformed *= morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { @@ -1641,7 +1641,7 @@ IncidentLight directLight; transformed += morphTarget7 * morphTargetInfluences[ 7 ]; #endif #endif -#endif`,Bjt=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#endif`,Fjt=`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 ) ); @@ -1663,7 +1663,7 @@ IncidentLight directLight; #endif #endif #endif -vec3 geometryNormal = normal;`,zjt=`#ifdef OBJECTSPACE_NORMALMAP +vec3 geometryNormal = normal;`,jjt=`#ifdef OBJECTSPACE_NORMALMAP normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; #ifdef FLIP_SIDED normal = - normal; @@ -1682,25 +1682,25 @@ vec3 geometryNormal = normal;`,zjt=`#ifdef OBJECTSPACE_NORMALMAP #endif #elif defined( USE_BUMPMAP ) normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,Ujt=`#ifndef FLAT_SHADED +#endif`,Bjt=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif -#endif`,Wjt=`#ifndef FLAT_SHADED +#endif`,zjt=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif -#endif`,Vjt=`#ifndef FLAT_SHADED +#endif`,Ujt=`#ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #ifdef USE_TANGENT vTangent = normalize( transformedTangent ); vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); #endif -#endif`,Gjt=`#ifdef USE_NORMALMAP +#endif`,Wjt=`#ifdef USE_NORMALMAP uniform sampler2D normalMap; uniform vec2 normalScale; #endif @@ -1722,9 +1722,9 @@ vec3 geometryNormal = normal;`,zjt=`#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`,Hjt=`#ifdef USE_CLEARCOAT +#endif`,Vjt=`#ifdef USE_CLEARCOAT vec3 clearcoatNormal = geometryNormal; -#endif`,qjt=`#ifdef USE_CLEARCOAT_NORMALMAP +#endif`,Gjt=`#ifdef USE_CLEARCOAT_NORMALMAP vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0; clearcoatMapN.xy *= clearcoatNormalScale; #ifdef USE_TANGENT @@ -1732,7 +1732,7 @@ vec3 geometryNormal = normal;`,zjt=`#ifdef OBJECTSPACE_NORMALMAP #else clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection ); #endif -#endif`,Xjt=`#ifdef USE_CLEARCOATMAP +#endif`,Hjt=`#ifdef USE_CLEARCOATMAP uniform sampler2D clearcoatMap; #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP @@ -1741,18 +1741,18 @@ vec3 geometryNormal = normal;`,zjt=`#ifdef OBJECTSPACE_NORMALMAP #ifdef USE_CLEARCOAT_NORMALMAP uniform sampler2D clearcoatNormalMap; uniform vec2 clearcoatNormalScale; -#endif`,Qjt=`#ifdef USE_IRIDESCENCEMAP +#endif`,qjt=`#ifdef USE_IRIDESCENCEMAP uniform sampler2D iridescenceMap; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP uniform sampler2D iridescenceThicknessMap; -#endif`,Yjt=`#ifdef OPAQUE +#endif`,Xjt=`#ifdef OPAQUE diffuseColor.a = 1.0; #endif #ifdef USE_TRANSMISSION diffuseColor.a *= material.transmissionAlpha + 0.1; #endif -gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,Kjt=`vec3 packNormalToRGB( const in vec3 normal ) { +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,Qjt=`vec3 packNormalToRGB( const in vec3 normal ) { return normalize( normal ) * 0.5 + 0.5; } vec3 unpackRGBToNormal( const in vec3 rgb ) { @@ -1787,29 +1787,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 ); -}`,Zjt=`#ifdef PREMULTIPLIED_ALPHA +}`,Yjt=`#ifdef PREMULTIPLIED_ALPHA gl_FragColor.rgb *= gl_FragColor.a; -#endif`,Jjt=`vec4 mvPosition = vec4( transformed, 1.0 ); +#endif`,Kjt=`vec4 mvPosition = vec4( transformed, 1.0 ); #ifdef USE_INSTANCING mvPosition = instanceMatrix * mvPosition; #endif mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,e5t=`#ifdef DITHERING +gl_Position = projectionMatrix * mvPosition;`,Zjt=`#ifdef DITHERING gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,t5t=`#ifdef DITHERING +#endif`,Jjt=`#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`,n5t=`float roughnessFactor = roughness; +#endif`,e5t=`float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP vec4 texelRoughness = texture2D( roughnessMap, vUv ); roughnessFactor *= texelRoughness.g; -#endif`,r5t=`#ifdef USE_ROUGHNESSMAP +#endif`,t5t=`#ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; -#endif`,i5t=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,n5t=`#if NUM_SPOT_LIGHT_COORDS > 0 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif #if NUM_SPOT_LIGHT_MAPS > 0 @@ -1988,7 +1988,7 @@ gl_Position = projectionMatrix * mvPosition;`,e5t=`#ifdef DITHERING return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); #endif } -#endif`,o5t=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,r5t=`#if NUM_SPOT_LIGHT_COORDS > 0 uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif @@ -2026,7 +2026,7 @@ gl_Position = projectionMatrix * mvPosition;`,e5t=`#ifdef DITHERING }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif -#endif`,a5t=`#if defined( USE_SHADOWMAP ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) +#endif`,i5t=`#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; @@ -2058,7 +2058,7 @@ gl_Position = projectionMatrix * mvPosition;`,e5t=`#ifdef DITHERING } #pragma unroll_loop_end #endif -#endif`,s5t=`float getShadowMask() { +#endif`,o5t=`float getShadowMask() { float shadow = 1.0; #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 @@ -2090,12 +2090,12 @@ gl_Position = projectionMatrix * mvPosition;`,e5t=`#ifdef DITHERING #endif #endif return shadow; -}`,l5t=`#ifdef USE_SKINNING +}`,a5t=`#ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); mat4 boneMatY = getBoneMatrix( skinIndex.y ); mat4 boneMatZ = getBoneMatrix( skinIndex.z ); mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,c5t=`#ifdef USE_SKINNING +#endif`,s5t=`#ifdef USE_SKINNING uniform mat4 bindMatrix; uniform mat4 bindMatrixInverse; uniform highp sampler2D boneTexture; @@ -2114,7 +2114,7 @@ gl_Position = projectionMatrix * mvPosition;`,e5t=`#ifdef DITHERING mat4 bone = mat4( v1, v2, v3, v4 ); return bone; } -#endif`,u5t=`#ifdef USE_SKINNING +#endif`,l5t=`#ifdef USE_SKINNING vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); vec4 skinned = vec4( 0.0 ); skinned += boneMatX * skinVertex * skinWeight.x; @@ -2122,7 +2122,7 @@ gl_Position = projectionMatrix * mvPosition;`,e5t=`#ifdef DITHERING skinned += boneMatZ * skinVertex * skinWeight.z; skinned += boneMatW * skinVertex * skinWeight.w; transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,f5t=`#ifdef USE_SKINNING +#endif`,c5t=`#ifdef USE_SKINNING mat4 skinMatrix = mat4( 0.0 ); skinMatrix += skinWeight.x * boneMatX; skinMatrix += skinWeight.y * boneMatY; @@ -2133,17 +2133,17 @@ gl_Position = projectionMatrix * mvPosition;`,e5t=`#ifdef DITHERING #ifdef USE_TANGENT objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; #endif -#endif`,d5t=`float specularStrength; +#endif`,u5t=`float specularStrength; #ifdef USE_SPECULARMAP vec4 texelSpecular = texture2D( specularMap, vUv ); specularStrength = texelSpecular.r; #else specularStrength = 1.0; -#endif`,h5t=`#ifdef USE_SPECULARMAP +#endif`,f5t=`#ifdef USE_SPECULARMAP uniform sampler2D specularMap; -#endif`,p5t=`#if defined( TONE_MAPPING ) +#endif`,d5t=`#if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,m5t=`#ifndef saturate +#endif`,h5t=`#ifndef saturate #define saturate( a ) clamp( a, 0.0, 1.0 ) #endif uniform float toneMappingExposure; @@ -2179,7 +2179,7 @@ vec3 ACESFilmicToneMapping( vec3 color ) { color = ACESOutputMat * color; return saturate( color ); } -vec3 CustomToneMapping( vec3 color ) { return color; }`,g5t=`#ifdef USE_TRANSMISSION +vec3 CustomToneMapping( vec3 color ) { return color; }`,p5t=`#ifdef USE_TRANSMISSION material.transmission = transmission; material.transmissionAlpha = 1.0; material.thickness = thickness; @@ -2200,7 +2200,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,g5t=`#ifdef USE_TRANSMIS material.attenuationColor, material.attenuationDistance ); material.transmissionAlpha = mix( material.transmissionAlpha, transmission.a, material.transmission ); totalDiffuse = mix( totalDiffuse, transmission.rgb, material.transmission ); -#endif`,v5t=`#ifdef USE_TRANSMISSION +#endif`,m5t=`#ifdef USE_TRANSMISSION uniform float transmission; uniform float thickness; uniform float attenuationDistance; @@ -2258,37 +2258,37 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,g5t=`#ifdef USE_TRANSMIS vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); return vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a ); } -#endif`,y5t=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) ) +#endif`,g5t=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) ) varying vec2 vUv; -#endif`,x5t=`#ifdef USE_UV +#endif`,v5t=`#ifdef USE_UV #ifdef UVS_VERTEX_ONLY vec2 vUv; #else varying vec2 vUv; #endif uniform mat3 uvTransform; -#endif`,b5t=`#ifdef USE_UV +#endif`,y5t=`#ifdef USE_UV vUv = ( uvTransform * vec3( uv, 1 ) ).xy; -#endif`,_5t=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) +#endif`,x5t=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) varying vec2 vUv2; -#endif`,w5t=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) +#endif`,b5t=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) attribute vec2 uv2; varying vec2 vUv2; uniform mat3 uv2Transform; -#endif`,S5t=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) +#endif`,_5t=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy; -#endif`,O5t=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 +#endif`,w5t=`#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 C5t=`varying vec2 vUv; +#endif`;const S5t=`varying vec2 vUv; uniform mat3 uvTransform; void main() { vUv = ( uvTransform * vec3( uv, 1 ) ).xy; gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,T5t=`uniform sampler2D t2D; +}`,O5t=`uniform sampler2D t2D; varying vec2 vUv; void main() { gl_FragColor = texture2D( t2D, vUv ); @@ -2297,14 +2297,14 @@ void main() { #endif #include #include -}`,E5t=`varying vec3 vWorldDirection; +}`,C5t=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; -}`,P5t=`#include +}`,T5t=`#include uniform float opacity; varying vec3 vWorldDirection; #include @@ -2315,7 +2315,7 @@ void main() { gl_FragColor.a *= opacity; #include #include -}`,M5t=`#include +}`,E5t=`#include #include #include #include @@ -2339,7 +2339,7 @@ void main() { #include #include vHighPrecisionZW = gl_Position.zw; -}`,k5t=`#if DEPTH_PACKING == 3200 +}`,P5t=`#if DEPTH_PACKING == 3200 uniform float opacity; #endif #include @@ -2367,7 +2367,7 @@ void main() { #elif DEPTH_PACKING == 3201 gl_FragColor = packDepthToRGBA( fragCoordZ ); #endif -}`,A5t=`#define DISTANCE +}`,M5t=`#define DISTANCE varying vec3 vWorldPosition; #include #include @@ -2391,7 +2391,7 @@ void main() { #include #include vWorldPosition = worldPosition.xyz; -}`,R5t=`#define DISTANCE +}`,k5t=`#define DISTANCE uniform vec3 referencePosition; uniform float nearDistance; uniform float farDistance; @@ -2413,13 +2413,13 @@ void main () { dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); dist = saturate( dist ); gl_FragColor = packDepthToRGBA( dist ); -}`,I5t=`varying vec3 vWorldDirection; +}`,A5t=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include -}`,D5t=`uniform sampler2D tEquirect; +}`,R5t=`uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { @@ -2428,7 +2428,7 @@ void main() { gl_FragColor = texture2D( tEquirect, sampleUV ); #include #include -}`,L5t=`uniform float scale; +}`,I5t=`uniform float scale; attribute float lineDistance; varying float vLineDistance; #include @@ -2447,7 +2447,7 @@ void main() { #include #include #include -}`,N5t=`uniform vec3 diffuse; +}`,D5t=`uniform vec3 diffuse; uniform float opacity; uniform float dashSize; uniform float totalSize; @@ -2472,7 +2472,7 @@ void main() { #include #include #include -}`,$5t=`#include +}`,L5t=`#include #include #include #include @@ -2503,7 +2503,7 @@ void main() { #include #include #include -}`,F5t=`uniform vec3 diffuse; +}`,N5t=`uniform vec3 diffuse; uniform float opacity; #ifndef FLAT_SHADED varying vec3 vNormal; @@ -2550,7 +2550,7 @@ void main() { #include #include #include -}`,j5t=`#define LAMBERT +}`,$5t=`#define LAMBERT varying vec3 vViewPosition; #include #include @@ -2588,7 +2588,7 @@ void main() { #include #include #include -}`,B5t=`#define LAMBERT +}`,F5t=`#define LAMBERT uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -2644,7 +2644,7 @@ void main() { #include #include #include -}`,z5t=`#define MATCAP +}`,j5t=`#define MATCAP varying vec3 vViewPosition; #include #include @@ -2675,7 +2675,7 @@ void main() { #include #include vViewPosition = - mvPosition.xyz; -}`,U5t=`#define MATCAP +}`,B5t=`#define MATCAP uniform vec3 diffuse; uniform float opacity; uniform sampler2D matcap; @@ -2719,7 +2719,7 @@ void main() { #include #include #include -}`,W5t=`#define NORMAL +}`,z5t=`#define NORMAL #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) varying vec3 vViewPosition; #endif @@ -2749,7 +2749,7 @@ void main() { #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) vViewPosition = - mvPosition.xyz; #endif -}`,V5t=`#define NORMAL +}`,U5t=`#define NORMAL uniform float opacity; #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) varying vec3 vViewPosition; @@ -2770,7 +2770,7 @@ void main() { #ifdef OPAQUE gl_FragColor.a = 1.0; #endif -}`,G5t=`#define PHONG +}`,W5t=`#define PHONG varying vec3 vViewPosition; #include #include @@ -2808,7 +2808,7 @@ void main() { #include #include #include -}`,H5t=`#define PHONG +}`,V5t=`#define PHONG uniform vec3 diffuse; uniform vec3 emissive; uniform vec3 specular; @@ -2866,7 +2866,7 @@ void main() { #include #include #include -}`,q5t=`#define STANDARD +}`,G5t=`#define STANDARD varying vec3 vViewPosition; #ifdef USE_TRANSMISSION varying vec3 vWorldPosition; @@ -2908,7 +2908,7 @@ void main() { #ifdef USE_TRANSMISSION vWorldPosition = worldPosition.xyz; #endif -}`,X5t=`#define STANDARD +}`,H5t=`#define STANDARD #ifdef PHYSICAL #define IOR #define SPECULAR @@ -3024,7 +3024,7 @@ void main() { #include #include #include -}`,Q5t=`#define TOON +}`,q5t=`#define TOON varying vec3 vViewPosition; #include #include @@ -3060,7 +3060,7 @@ void main() { #include #include #include -}`,Y5t=`#define TOON +}`,X5t=`#define TOON uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -3112,7 +3112,7 @@ void main() { #include #include #include -}`,K5t=`uniform float size; +}`,Q5t=`uniform float size; uniform float scale; #include #include @@ -3135,7 +3135,7 @@ void main() { #include #include #include -}`,Z5t=`uniform vec3 diffuse; +}`,Y5t=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -3158,7 +3158,7 @@ void main() { #include #include #include -}`,J5t=`#include +}`,K5t=`#include #include #include #include @@ -3176,7 +3176,7 @@ void main() { #include #include #include -}`,eBt=`uniform vec3 color; +}`,Z5t=`uniform vec3 color; uniform float opacity; #include #include @@ -3190,7 +3190,7 @@ void main() { #include #include #include -}`,tBt=`uniform float rotation; +}`,J5t=`uniform float rotation; uniform vec2 center; #include #include @@ -3216,7 +3216,7 @@ void main() { #include #include #include -}`,nBt=`uniform vec3 diffuse; +}`,eBt=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -3239,7 +3239,7 @@ void main() { #include #include #include -}`,Gt={alphamap_fragment:EFt,alphamap_pars_fragment:PFt,alphatest_fragment:MFt,alphatest_pars_fragment:kFt,aomap_fragment:AFt,aomap_pars_fragment:RFt,begin_vertex:IFt,beginnormal_vertex:DFt,bsdfs:LFt,iridescence_fragment:NFt,bumpmap_pars_fragment:$Ft,clipping_planes_fragment:FFt,clipping_planes_pars_fragment:jFt,clipping_planes_pars_vertex:BFt,clipping_planes_vertex:zFt,color_fragment:UFt,color_pars_fragment:WFt,color_pars_vertex:VFt,color_vertex:GFt,common:HFt,cube_uv_reflection_fragment:qFt,defaultnormal_vertex:XFt,displacementmap_pars_vertex:QFt,displacementmap_vertex:YFt,emissivemap_fragment:KFt,emissivemap_pars_fragment:ZFt,encodings_fragment:JFt,encodings_pars_fragment:ejt,envmap_fragment:tjt,envmap_common_pars_fragment:njt,envmap_pars_fragment:rjt,envmap_pars_vertex:ijt,envmap_physical_pars_fragment:gjt,envmap_vertex:ojt,fog_vertex:ajt,fog_pars_vertex:sjt,fog_fragment:ljt,fog_pars_fragment:cjt,gradientmap_pars_fragment:ujt,lightmap_fragment:fjt,lightmap_pars_fragment:djt,lights_lambert_fragment:hjt,lights_lambert_pars_fragment:pjt,lights_pars_begin:mjt,lights_toon_fragment:vjt,lights_toon_pars_fragment:yjt,lights_phong_fragment:xjt,lights_phong_pars_fragment:bjt,lights_physical_fragment:_jt,lights_physical_pars_fragment:wjt,lights_fragment_begin:Sjt,lights_fragment_maps:Ojt,lights_fragment_end:Cjt,logdepthbuf_fragment:Tjt,logdepthbuf_pars_fragment:Ejt,logdepthbuf_pars_vertex:Pjt,logdepthbuf_vertex:Mjt,map_fragment:kjt,map_pars_fragment:Ajt,map_particle_fragment:Rjt,map_particle_pars_fragment:Ijt,metalnessmap_fragment:Djt,metalnessmap_pars_fragment:Ljt,morphcolor_vertex:Njt,morphnormal_vertex:$jt,morphtarget_pars_vertex:Fjt,morphtarget_vertex:jjt,normal_fragment_begin:Bjt,normal_fragment_maps:zjt,normal_pars_fragment:Ujt,normal_pars_vertex:Wjt,normal_vertex:Vjt,normalmap_pars_fragment:Gjt,clearcoat_normal_fragment_begin:Hjt,clearcoat_normal_fragment_maps:qjt,clearcoat_pars_fragment:Xjt,iridescence_pars_fragment:Qjt,output_fragment:Yjt,packing:Kjt,premultiplied_alpha_fragment:Zjt,project_vertex:Jjt,dithering_fragment:e5t,dithering_pars_fragment:t5t,roughnessmap_fragment:n5t,roughnessmap_pars_fragment:r5t,shadowmap_pars_fragment:i5t,shadowmap_pars_vertex:o5t,shadowmap_vertex:a5t,shadowmask_pars_fragment:s5t,skinbase_vertex:l5t,skinning_pars_vertex:c5t,skinning_vertex:u5t,skinnormal_vertex:f5t,specularmap_fragment:d5t,specularmap_pars_fragment:h5t,tonemapping_fragment:p5t,tonemapping_pars_fragment:m5t,transmission_fragment:g5t,transmission_pars_fragment:v5t,uv_pars_fragment:y5t,uv_pars_vertex:x5t,uv_vertex:b5t,uv2_pars_fragment:_5t,uv2_pars_vertex:w5t,uv2_vertex:S5t,worldpos_vertex:O5t,background_vert:C5t,background_frag:T5t,cube_vert:E5t,cube_frag:P5t,depth_vert:M5t,depth_frag:k5t,distanceRGBA_vert:A5t,distanceRGBA_frag:R5t,equirect_vert:I5t,equirect_frag:D5t,linedashed_vert:L5t,linedashed_frag:N5t,meshbasic_vert:$5t,meshbasic_frag:F5t,meshlambert_vert:j5t,meshlambert_frag:B5t,meshmatcap_vert:z5t,meshmatcap_frag:U5t,meshnormal_vert:W5t,meshnormal_frag:V5t,meshphong_vert:G5t,meshphong_frag:H5t,meshphysical_vert:q5t,meshphysical_frag:X5t,meshtoon_vert:Q5t,meshtoon_frag:Y5t,points_vert:K5t,points_frag:Z5t,shadow_vert:J5t,shadow_frag:eBt,sprite_vert:tBt,sprite_frag:nBt},Je={common:{diffuse:{value:new lr(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 qt(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 lr(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 lr(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 lr(16777215)},opacity:{value:1},center:{value:new qt(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new va}}},_l={basic:{uniforms:zi([Je.common,Je.specularmap,Je.envmap,Je.aomap,Je.lightmap,Je.fog]),vertexShader:Gt.meshbasic_vert,fragmentShader:Gt.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 lr(0)}}]),vertexShader:Gt.meshlambert_vert,fragmentShader:Gt.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 lr(0)},specular:{value:new lr(1118481)},shininess:{value:30}}]),vertexShader:Gt.meshphong_vert,fragmentShader:Gt.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 lr(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Gt.meshphysical_vert,fragmentShader:Gt.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 lr(0)}}]),vertexShader:Gt.meshtoon_vert,fragmentShader:Gt.meshtoon_frag},matcap:{uniforms:zi([Je.common,Je.bumpmap,Je.normalmap,Je.displacementmap,Je.fog,{matcap:{value:null}}]),vertexShader:Gt.meshmatcap_vert,fragmentShader:Gt.meshmatcap_frag},points:{uniforms:zi([Je.points,Je.fog]),vertexShader:Gt.points_vert,fragmentShader:Gt.points_frag},dashed:{uniforms:zi([Je.common,Je.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Gt.linedashed_vert,fragmentShader:Gt.linedashed_frag},depth:{uniforms:zi([Je.common,Je.displacementmap]),vertexShader:Gt.depth_vert,fragmentShader:Gt.depth_frag},normal:{uniforms:zi([Je.common,Je.bumpmap,Je.normalmap,Je.displacementmap,{opacity:{value:1}}]),vertexShader:Gt.meshnormal_vert,fragmentShader:Gt.meshnormal_frag},sprite:{uniforms:zi([Je.sprite,Je.fog]),vertexShader:Gt.sprite_vert,fragmentShader:Gt.sprite_frag},background:{uniforms:{uvTransform:{value:new va},t2D:{value:null}},vertexShader:Gt.background_vert,fragmentShader:Gt.background_frag},cube:{uniforms:zi([Je.envmap,{opacity:{value:1}}]),vertexShader:Gt.cube_vert,fragmentShader:Gt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Gt.equirect_vert,fragmentShader:Gt.equirect_frag},distanceRGBA:{uniforms:zi([Je.common,Je.displacementmap,{referencePosition:{value:new Se},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Gt.distanceRGBA_vert,fragmentShader:Gt.distanceRGBA_frag},shadow:{uniforms:zi([Je.lights,Je.fog,{color:{value:new lr(0)},opacity:{value:1}}]),vertexShader:Gt.shadow_vert,fragmentShader:Gt.shadow_frag}};_l.physical={uniforms:zi([_l.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new qt(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 lr(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new qt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new lr(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new lr(1,1,1)},specularColorMap:{value:null}}]),vertexShader:Gt.meshphysical_vert,fragmentShader:Gt.meshphysical_frag};function rBt(t,e,n,r,i,o){const a=new lr(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===Dk)?(c===void 0&&(c=new Bl(new Yy(1,1,1),new ud({name:"BackgroundCubeMaterial",uniforms:jv(_l.cube.uniforms),vertexShader:_l.cube.vertexShader,fragmentShader:_l.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 Bl(new $k(2,2),new ud({name:"BackgroundMaterial",uniforms:jv(_l.background.uniforms),vertexShader:_l.background.vertexShader,fragmentShader:_l.background.fragmentShader,side:Lv,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 iBt(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,U){let W=!1;if(a){const $=m(B,z,L);c!==$&&(c=$,h(c.object)),W=v(T,B,z,U),W&&y(T,B,z,U)}else{const $=L.wireframe===!0;(c.geometry!==B.id||c.program!==z.id||c.wireframe!==$)&&(c.geometry=B.id,c.program=z.id,c.wireframe=$,W=!0)}U!==null&&n.update(U,34963),(W||u)&&(u=!1,C(T,L,z,B),U!==null&&t.bindBuffer(34963,n.get(U).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 U=s[T.id];U===void 0&&(U={},s[T.id]=U);let W=U[L.id];W===void 0&&(W={},U[L.id]=W);let $=W[B];return $===void 0&&($=g(d()),W[B]=$),$}function g(T){const L=[],z=[],B=[];for(let U=0;U=0){const q=U[D];let Y=W[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;$++}return c.attributesNum!==$||c.index!==B}function y(T,L,z,B){const U={},W=L.attributes;let $=0;const N=z.getAttributes();for(const D in N)if(N[D].location>=0){let q=W[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),U[D]=Y,$++}c.attributes=U,c.attributesNum=$,c.index=B}function x(){const T=c.newAttributes;for(let L=0,z=T.length;L=0){let A=U[N];if(A===void 0&&(N==="instanceMatrix"&&T.instanceMatrix&&(A=T.instanceMatrix),N==="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 sBt(t){const e=this;let n=null,r=0,i=!1,o=!1;const a=new rh,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 SFt(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 Lye extends Aye{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 cg=4,JZ=[.125,.215,.35,.446,.526,.582],dh=20,xD=new Lye,eJ=new lr;let bD=null;const ih=(1+Math.sqrt(5))/2,Am=1/ih,tJ=[new Se(1,1,1),new Se(-1,1,1),new Se(1,1,-1),new Se(-1,1,-1),new Se(0,ih,Am),new Se(0,ih,-Am),new Se(Am,0,ih),new Se(-Am,0,ih),new Se(ih,Am,0),new Se(-ih,Am,0)];class nJ{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){bD=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=oJ(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=iJ(),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===Nv||e.mapping===$v;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=oJ()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=iJ());const o=i?this._cubemapMaterial:this._equirectMaterial,a=new Bl(this._lodPlanes[0],o),s=o.uniforms;s.envMap.value=e;const l=this._cubeSize;eC(n,0,0,3*l,2*l),r.setRenderTarget(n),r.render(a,xD)}_applyPMREM(e){const n=this._renderer,r=n.autoClear;n.autoClear=!1;for(let i=1;idh&&console.warn(`sigmaRadians, ${o}, is too large and will clip, as it requested ${g} samples when the maximum is set to ${dh}`);const v=[];let y=0;for(let O=0;Ox-cg?i-x+cg:0),S=4*(this._cubeSize-b);eC(n,_,S,3*b,2*b),l.setRenderTarget(n),l.render(f,xD)}}function cBt(t){const e=[],n=[],r=[];let i=t;const o=t-cg+1+JZ.length;for(let a=0;at-cg?l=JZ[a-t+cg-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 Eu;_.setAttribute("position",new as(y,m)),_.setAttribute("uv",new as(x,g)),_.setAttribute("faceIndex",new as(b,v)),e.push(_),i>cg&&i--}return{lodPlanes:e,sizeLods:n,sigmas:r}}function rJ(t,e,n){const r=new bp(t,e,n);return r.texture.mapping=Dk,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function eC(t,e,n,r,i){t.viewport.set(e,n,r,i),t.scissor.set(e,n,r,i)}function uBt(t,e,n){const r=new Float32Array(dh),i=new Se(0,1,0);return new ud({name:"SphericalGaussianBlur",defines:{n:dh,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:C6(),fragmentShader:` +}`,Gt={alphamap_fragment:CFt,alphamap_pars_fragment:TFt,alphatest_fragment:EFt,alphatest_pars_fragment:PFt,aomap_fragment:MFt,aomap_pars_fragment:kFt,begin_vertex:AFt,beginnormal_vertex:RFt,bsdfs:IFt,iridescence_fragment:DFt,bumpmap_pars_fragment:LFt,clipping_planes_fragment:NFt,clipping_planes_pars_fragment:$Ft,clipping_planes_pars_vertex:FFt,clipping_planes_vertex:jFt,color_fragment:BFt,color_pars_fragment:zFt,color_pars_vertex:UFt,color_vertex:WFt,common:VFt,cube_uv_reflection_fragment:GFt,defaultnormal_vertex:HFt,displacementmap_pars_vertex:qFt,displacementmap_vertex:XFt,emissivemap_fragment:QFt,emissivemap_pars_fragment:YFt,encodings_fragment:KFt,encodings_pars_fragment:ZFt,envmap_fragment:JFt,envmap_common_pars_fragment:ejt,envmap_pars_fragment:tjt,envmap_pars_vertex:njt,envmap_physical_pars_fragment:pjt,envmap_vertex:rjt,fog_vertex:ijt,fog_pars_vertex:ojt,fog_fragment:ajt,fog_pars_fragment:sjt,gradientmap_pars_fragment:ljt,lightmap_fragment:cjt,lightmap_pars_fragment:ujt,lights_lambert_fragment:fjt,lights_lambert_pars_fragment:djt,lights_pars_begin:hjt,lights_toon_fragment:mjt,lights_toon_pars_fragment:gjt,lights_phong_fragment:vjt,lights_phong_pars_fragment:yjt,lights_physical_fragment:xjt,lights_physical_pars_fragment:bjt,lights_fragment_begin:_jt,lights_fragment_maps:wjt,lights_fragment_end:Sjt,logdepthbuf_fragment:Ojt,logdepthbuf_pars_fragment:Cjt,logdepthbuf_pars_vertex:Tjt,logdepthbuf_vertex:Ejt,map_fragment:Pjt,map_pars_fragment:Mjt,map_particle_fragment:kjt,map_particle_pars_fragment:Ajt,metalnessmap_fragment:Rjt,metalnessmap_pars_fragment:Ijt,morphcolor_vertex:Djt,morphnormal_vertex:Ljt,morphtarget_pars_vertex:Njt,morphtarget_vertex:$jt,normal_fragment_begin:Fjt,normal_fragment_maps:jjt,normal_pars_fragment:Bjt,normal_pars_vertex:zjt,normal_vertex:Ujt,normalmap_pars_fragment:Wjt,clearcoat_normal_fragment_begin:Vjt,clearcoat_normal_fragment_maps:Gjt,clearcoat_pars_fragment:Hjt,iridescence_pars_fragment:qjt,output_fragment:Xjt,packing:Qjt,premultiplied_alpha_fragment:Yjt,project_vertex:Kjt,dithering_fragment:Zjt,dithering_pars_fragment:Jjt,roughnessmap_fragment:e5t,roughnessmap_pars_fragment:t5t,shadowmap_pars_fragment:n5t,shadowmap_pars_vertex:r5t,shadowmap_vertex:i5t,shadowmask_pars_fragment:o5t,skinbase_vertex:a5t,skinning_pars_vertex:s5t,skinning_vertex:l5t,skinnormal_vertex:c5t,specularmap_fragment:u5t,specularmap_pars_fragment:f5t,tonemapping_fragment:d5t,tonemapping_pars_fragment:h5t,transmission_fragment:p5t,transmission_pars_fragment:m5t,uv_pars_fragment:g5t,uv_pars_vertex:v5t,uv_vertex:y5t,uv2_pars_fragment:x5t,uv2_pars_vertex:b5t,uv2_vertex:_5t,worldpos_vertex:w5t,background_vert:S5t,background_frag:O5t,cube_vert:C5t,cube_frag:T5t,depth_vert:E5t,depth_frag:P5t,distanceRGBA_vert:M5t,distanceRGBA_frag:k5t,equirect_vert:A5t,equirect_frag:R5t,linedashed_vert:I5t,linedashed_frag:D5t,meshbasic_vert:L5t,meshbasic_frag:N5t,meshlambert_vert:$5t,meshlambert_frag:F5t,meshmatcap_vert:j5t,meshmatcap_frag:B5t,meshnormal_vert:z5t,meshnormal_frag:U5t,meshphong_vert:W5t,meshphong_frag:V5t,meshphysical_vert:G5t,meshphysical_frag:H5t,meshtoon_vert:q5t,meshtoon_frag:X5t,points_vert:Q5t,points_frag:Y5t,shadow_vert:K5t,shadow_frag:Z5t,sprite_vert:J5t,sprite_frag:eBt},Je={common:{diffuse:{value:new lr(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 qt(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 lr(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 lr(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 lr(16777215)},opacity:{value:1},center:{value:new qt(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new va}}},_l={basic:{uniforms:zi([Je.common,Je.specularmap,Je.envmap,Je.aomap,Je.lightmap,Je.fog]),vertexShader:Gt.meshbasic_vert,fragmentShader:Gt.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 lr(0)}}]),vertexShader:Gt.meshlambert_vert,fragmentShader:Gt.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 lr(0)},specular:{value:new lr(1118481)},shininess:{value:30}}]),vertexShader:Gt.meshphong_vert,fragmentShader:Gt.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 lr(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Gt.meshphysical_vert,fragmentShader:Gt.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 lr(0)}}]),vertexShader:Gt.meshtoon_vert,fragmentShader:Gt.meshtoon_frag},matcap:{uniforms:zi([Je.common,Je.bumpmap,Je.normalmap,Je.displacementmap,Je.fog,{matcap:{value:null}}]),vertexShader:Gt.meshmatcap_vert,fragmentShader:Gt.meshmatcap_frag},points:{uniforms:zi([Je.points,Je.fog]),vertexShader:Gt.points_vert,fragmentShader:Gt.points_frag},dashed:{uniforms:zi([Je.common,Je.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Gt.linedashed_vert,fragmentShader:Gt.linedashed_frag},depth:{uniforms:zi([Je.common,Je.displacementmap]),vertexShader:Gt.depth_vert,fragmentShader:Gt.depth_frag},normal:{uniforms:zi([Je.common,Je.bumpmap,Je.normalmap,Je.displacementmap,{opacity:{value:1}}]),vertexShader:Gt.meshnormal_vert,fragmentShader:Gt.meshnormal_frag},sprite:{uniforms:zi([Je.sprite,Je.fog]),vertexShader:Gt.sprite_vert,fragmentShader:Gt.sprite_frag},background:{uniforms:{uvTransform:{value:new va},t2D:{value:null}},vertexShader:Gt.background_vert,fragmentShader:Gt.background_frag},cube:{uniforms:zi([Je.envmap,{opacity:{value:1}}]),vertexShader:Gt.cube_vert,fragmentShader:Gt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Gt.equirect_vert,fragmentShader:Gt.equirect_frag},distanceRGBA:{uniforms:zi([Je.common,Je.displacementmap,{referencePosition:{value:new Se},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Gt.distanceRGBA_vert,fragmentShader:Gt.distanceRGBA_frag},shadow:{uniforms:zi([Je.lights,Je.fog,{color:{value:new lr(0)},opacity:{value:1}}]),vertexShader:Gt.shadow_vert,fragmentShader:Gt.shadow_frag}};_l.physical={uniforms:zi([_l.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new qt(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 lr(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new qt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new lr(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new lr(1,1,1)},specularColorMap:{value:null}}]),vertexShader:Gt.meshphysical_vert,fragmentShader:Gt.meshphysical_frag};function tBt(t,e,n,r,i,o){const a=new lr(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===Dk)?(c===void 0&&(c=new Bl(new Qy(1,1,1),new ud({name:"BackgroundCubeMaterial",uniforms:jv(_l.cube.uniforms),vertexShader:_l.cube.vertexShader,fragmentShader:_l.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 Bl(new $k(2,2),new ud({name:"BackgroundMaterial",uniforms:jv(_l.background.uniforms),vertexShader:_l.background.vertexShader,fragmentShader:_l.background.fragmentShader,side:Lv,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 nBt(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,U){let W=!1;if(a){const $=m(B,z,L);c!==$&&(c=$,h(c.object)),W=v(T,B,z,U),W&&y(T,B,z,U)}else{const $=L.wireframe===!0;(c.geometry!==B.id||c.program!==z.id||c.wireframe!==$)&&(c.geometry=B.id,c.program=z.id,c.wireframe=$,W=!0)}U!==null&&n.update(U,34963),(W||u)&&(u=!1,C(T,L,z,B),U!==null&&t.bindBuffer(34963,n.get(U).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 U=s[T.id];U===void 0&&(U={},s[T.id]=U);let W=U[L.id];W===void 0&&(W={},U[L.id]=W);let $=W[B];return $===void 0&&($=g(d()),W[B]=$),$}function g(T){const L=[],z=[],B=[];for(let U=0;U=0){const q=U[D];let Y=W[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;$++}return c.attributesNum!==$||c.index!==B}function y(T,L,z,B){const U={},W=L.attributes;let $=0;const N=z.getAttributes();for(const D in N)if(N[D].location>=0){let q=W[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),U[D]=Y,$++}c.attributes=U,c.attributesNum=$,c.index=B}function x(){const T=c.newAttributes;for(let L=0,z=T.length;L=0){let A=U[N];if(A===void 0&&(N==="instanceMatrix"&&T.instanceMatrix&&(A=T.instanceMatrix),N==="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 oBt(t){const e=this;let n=null,r=0,i=!1,o=!1;const a=new rh,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 _Ft(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 Dye extends kye{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 cg=4,KZ=[.125,.215,.35,.446,.526,.582],dh=20,yD=new Dye,ZZ=new lr;let xD=null;const ih=(1+Math.sqrt(5))/2,Am=1/ih,JZ=[new Se(1,1,1),new Se(-1,1,1),new Se(1,1,-1),new Se(-1,1,-1),new Se(0,ih,Am),new Se(0,ih,-Am),new Se(Am,0,ih),new Se(-Am,0,ih),new Se(ih,Am,0),new Se(-ih,Am,0)];class eJ{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){xD=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=rJ(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=nJ(),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===Nv||e.mapping===$v;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=rJ()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=nJ());const o=i?this._cubemapMaterial:this._equirectMaterial,a=new Bl(this._lodPlanes[0],o),s=o.uniforms;s.envMap.value=e;const l=this._cubeSize;eC(n,0,0,3*l,2*l),r.setRenderTarget(n),r.render(a,yD)}_applyPMREM(e){const n=this._renderer,r=n.autoClear;n.autoClear=!1;for(let i=1;idh&&console.warn(`sigmaRadians, ${o}, is too large and will clip, as it requested ${g} samples when the maximum is set to ${dh}`);const v=[];let y=0;for(let O=0;Ox-cg?i-x+cg:0),S=4*(this._cubeSize-b);eC(n,_,S,3*b,2*b),l.setRenderTarget(n),l.render(f,yD)}}function sBt(t){const e=[],n=[],r=[];let i=t;const o=t-cg+1+KZ.length;for(let a=0;at-cg?l=KZ[a-t+cg-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 Eu;_.setAttribute("position",new as(y,m)),_.setAttribute("uv",new as(x,g)),_.setAttribute("faceIndex",new as(b,v)),e.push(_),i>cg&&i--}return{lodPlanes:e,sizeLods:n,sigmas:r}}function tJ(t,e,n){const r=new bp(t,e,n);return r.texture.mapping=Dk,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function eC(t,e,n,r,i){t.viewport.set(e,n,r,i),t.scissor.set(e,n,r,i)}function lBt(t,e,n){const r=new Float32Array(dh),i=new Se(0,1,0);return new ud({name:"SphericalGaussianBlur",defines:{n:dh,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:O6(),fragmentShader:` precision mediump float; precision mediump int; @@ -3299,7 +3299,7 @@ void main() { } } - `,blending:Hf,depthTest:!1,depthWrite:!1})}function iJ(){return new ud({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:C6(),fragmentShader:` + `,blending:Hf,depthTest:!1,depthWrite:!1})}function nJ(){return new ud({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:O6(),fragmentShader:` precision mediump float; precision mediump int; @@ -3318,7 +3318,7 @@ void main() { gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); } - `,blending:Hf,depthTest:!1,depthWrite:!1})}function oJ(){return new ud({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:C6(),fragmentShader:` + `,blending:Hf,depthTest:!1,depthWrite:!1})}function rJ(){return new ud({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:O6(),fragmentShader:` precision mediump float; precision mediump int; @@ -3334,7 +3334,7 @@ void main() { gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); } - `,blending:Hf,depthTest:!1,depthWrite:!1})}function C6(){return` + `,blending:Hf,depthTest:!1,depthWrite:!1})}function O6(){return` precision mediump float; precision mediump int; @@ -3389,39 +3389,39 @@ void main() { gl_Position = vec4( position, 1.0 ); } - `}function fBt(t){let e=new WeakMap,n=null;function r(s){if(s&&s.isTexture){const l=s.mapping,c=l===SF||l===OF,u=l===Nv||l===$v;if(c||u)if(s.isRenderTargetTexture&&s.needsPMREMUpdate===!0){s.needsPMREMUpdate=!1;let f=e.get(s);return n===null&&(n=new nJ(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 nJ(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 Oye(P,k,I,m);R.type=Mf,R.needsUpdate=!0;const T=E*4;for(let z=0;z0)return t;const i=e*n;let o=aJ[i];if(o===void 0&&(o=new Float32Array(i),aJ[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 eJ(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 Sye(P,k,I,m);R.type=Mf,R.needsUpdate=!0;const T=E*4;for(let z=0;z0)return t;const i=e*n;let o=iJ[i];if(o===void 0&&(o=new Float32Array(i),iJ[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 dzt(t){switch(t){case xp:return["Linear","( value )"];case yr:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",t),["Linear","( value )"]}}function hJ(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 uzt(t){switch(t){case xp:return["Linear","( value )"];case yr:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",t),["Linear","( value )"]}}function fJ(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+` -`+fzt(t.getShaderSource(e),a)}else return i}function hzt(t,e){const n=dzt(e);return"vec4 "+t+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}function pzt(t,e){let n;switch(e){case N$t:n="Linear";break;case $$t:n="Reinhard";break;case F$t:n="OptimizedCineon";break;case j$t:n="ACESFilmic";break;case B$t:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function mzt(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(Sx).join(` -`)}function gzt(t){const e=[];for(const n in t){const r=t[n];r!==!1&&e.push("#define "+n+" "+r)}return e.join(` -`)}function vzt(t,e){const n={},r=t.getProgramParameter(e,35721);for(let i=0;i/gm;function MF(t){return t.replace(yzt,xzt)}function xzt(t,e){const n=Gt[e];if(n===void 0)throw new Error("Can not resolve #include <"+e+">");return MF(n)}const bzt=/#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 gJ(t){return t.replace(bzt,_zt)}function _zt(t,e,n,r){let i="";for(let o=parseInt(e);o/gm;function PF(t){return t.replace(gzt,vzt)}function vzt(t,e){const n=Gt[e];if(n===void 0)throw new Error("Can not resolve #include <"+e+">");return PF(n)}const yzt=/#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 pJ(t){return t.replace(yzt,xzt)}function xzt(t,e,n,r){let i="";for(let o=parseInt(e);o0&&(g+=` -`),v=[h,p].filter(Sx).join(` +`),v=[h,p].filter(wx).join(` `),v.length>0&&(v+=` -`)):(g=[vJ(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(Sx).join(` -`),v=[h,vJ(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!==su?"#define TONE_MAPPING":"",n.toneMapping!==su?Gt.tonemapping_pars_fragment:"",n.toneMapping!==su?pzt("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Gt.encodings_pars_fragment,hzt("linearToOutputTexel",n.outputEncoding),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",` -`].filter(Sx).join(` -`)),a=MF(a),a=pJ(a,n),a=mJ(a,n),s=MF(s),s=pJ(s,n),s=mJ(s,n),a=gJ(a),s=gJ(s),n.isWebGL2&&n.isRawShaderMaterial!==!0&&(y=`#version 300 es +`)):(g=[mJ(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(wx).join(` +`),v=[h,mJ(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!==su?"#define TONE_MAPPING":"",n.toneMapping!==su?Gt.tonemapping_pars_fragment:"",n.toneMapping!==su?dzt("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Gt.encodings_pars_fragment,fzt("linearToOutputTexel",n.outputEncoding),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",` +`].filter(wx).join(` +`)),a=PF(a),a=dJ(a,n),a=hJ(a,n),s=PF(s),s=dJ(s,n),s=hJ(s,n),a=pJ(a),s=pJ(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===jZ?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===jZ?"":"#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===$Z?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===$Z?"":"#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,_=dJ(i,35633,x),S=dJ(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=hJ(i,_,"vertex"),L=hJ(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,_=uJ(i,35633,x),S=uJ(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=fJ(i,_,"vertex"),L=fJ(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 KC(i,m)),O};let C;return this.getAttributes=function(){return C===void 0&&(C=vzt(i,m)),C},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(m),this.program=void 0},this.name=n.shaderName,this.id=uzt++,this.cacheKey=e,this.usedTimes=1,this.program=m,this.vertexShader=_,this.fragmentShader=S,this}let Pzt=0;class Mzt{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 kzt(e),n.set(e,r)),r}}class kzt{constructor(e){this.id=Pzt++,this.code=e,this.usedTimes=0}}function Azt(t,e,n,r,i,o,a){const s=new Eye,l=new Mzt,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===Dk?z.image.height:null,U=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 W=T.morphAttributes.position||T.morphAttributes.normal||T.morphAttributes.color,$=W!==void 0?W.length:0;let N=0;T.morphAttributes.position!==void 0&&(N=1),T.morphAttributes.normal!==void 0&&(N=2),T.morphAttributes.color!==void 0&&(N=3);let D,A,q,Y;if(U){const be=_l[U];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:U,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:xp,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===oFt,tangentSpaceNormalMap:C.normalMapType===iFt,decodeVideoTexture:!!C.map&&C.map.isVideoTexture===!0&&C.map.encoding===yr,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===Bg,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:$,morphTextureStride:N,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:su,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:C.premultipliedAlpha,doubleSided:C.side===Yc,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=_l[E];k=kye.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||Izt),r.length>1&&r.sort(d||yJ),i.length>1&&i.sort(d||yJ)}function u(){for(let f=e,d=t.length;f=o.length?(a=new xJ,o.push(a)):a=o[i],a}function n(){t=new WeakMap}return{get:e,dispose:n}}function Lzt(){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 lr};break;case"SpotLight":n={position:new Se,direction:new Se,color:new lr,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new Se,color:new lr,distance:0,decay:0};break;case"HemisphereLight":n={direction:new Se,skyColor:new lr,groundColor:new lr};break;case"RectAreaLight":n={color:new lr,position:new Se,halfWidth:new Se,halfHeight:new Se};break}return t[e.id]=n,n}}}function Nzt(){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 qt};break;case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new qt};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new qt,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let $zt=0;function Fzt(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function jzt(t,e){const n=new Lzt,r=Nzt(),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 Hn,s=new Hn;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(Fzt);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=$zt++)}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 bJ(t,e),s.push(l)):l=s[a],l}function i(){n=new WeakMap}return{get:r,dispose:i}}class zzt extends $w{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=nFt,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 Uzt extends $w{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 Wzt=`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 KC(i,m)),O};let C;return this.getAttributes=function(){return C===void 0&&(C=mzt(i,m)),C},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(m),this.program=void 0},this.name=n.shaderName,this.id=lzt++,this.cacheKey=e,this.usedTimes=1,this.program=m,this.vertexShader=_,this.fragmentShader=S,this}let Tzt=0;class Ezt{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 Pzt(e),n.set(e,r)),r}}class Pzt{constructor(e){this.id=Tzt++,this.code=e,this.usedTimes=0}}function Mzt(t,e,n,r,i,o,a){const s=new Tye,l=new Ezt,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===Dk?z.image.height:null,U=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 W=T.morphAttributes.position||T.morphAttributes.normal||T.morphAttributes.color,$=W!==void 0?W.length:0;let N=0;T.morphAttributes.position!==void 0&&(N=1),T.morphAttributes.normal!==void 0&&(N=2),T.morphAttributes.color!==void 0&&(N=3);let D,A,q,Y;if(U){const be=_l[U];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:U,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:xp,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===rFt,tangentSpaceNormalMap:C.normalMapType===nFt,decodeVideoTexture:!!C.map&&C.map.isVideoTexture===!0&&C.map.encoding===yr,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===Bg,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:$,morphTextureStride:N,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:su,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:C.premultipliedAlpha,doubleSided:C.side===Yc,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=_l[E];k=Mye.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||Azt),r.length>1&&r.sort(d||gJ),i.length>1&&i.sort(d||gJ)}function u(){for(let f=e,d=t.length;f=o.length?(a=new vJ,o.push(a)):a=o[i],a}function n(){t=new WeakMap}return{get:e,dispose:n}}function Izt(){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 lr};break;case"SpotLight":n={position:new Se,direction:new Se,color:new lr,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new Se,color:new lr,distance:0,decay:0};break;case"HemisphereLight":n={direction:new Se,skyColor:new lr,groundColor:new lr};break;case"RectAreaLight":n={color:new lr,position:new Se,halfWidth:new Se,halfHeight:new Se};break}return t[e.id]=n,n}}}function Dzt(){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 qt};break;case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new qt};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new qt,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let Lzt=0;function Nzt(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function $zt(t,e){const n=new Izt,r=Dzt(),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 Hn,s=new Hn;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(Nzt);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=Lzt++)}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 yJ(t,e),s.push(l)):l=s[a],l}function i(){n=new WeakMap}return{get:r,dispose:i}}class jzt extends $w{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=eFt,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 Bzt extends $w{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 zzt=`void main() { gl_Position = vec4( position, 1.0 ); -}`,Vzt=`uniform sampler2D shadow_pass; +}`,Uzt=`uniform sampler2D shadow_pass; uniform vec2 resolution; uniform float radius; #include @@ -3447,7 +3447,7 @@ void main() { squared_mean = squared_mean / samples; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function Gzt(t,e,n){let r=new Iye;const i=new qt,o=new qt,a=new Ri,s=new zzt({depthPacking:rFt}),l=new Uzt,c={},u=n.maxTextureSize,f={0:_a,1:Lv,2:Yc},d=new ud({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new qt},radius:{value:4}},vertexShader:Wzt,fragmentShader:Vzt}),h=d.clone();h.defines.HORIZONTAL_PASS=1;const p=new Eu;p.setAttribute("position",new as(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const m=new Bl(p,d),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=hye,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(Hf),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!==wx?{minFilter:Eo,magFilter:Eo}:{};T.map=new bp(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===wx?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===wx)&&(!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):U.indexOf("OpenGL ES")!==-1&&(B=parseFloat(/^OpenGL ES (\d)/.exec(U)[1]),z=B>=2);let W=null,$={};const N=t.getParameter(3088),D=t.getParameter(2978),A=new Ri().fromArray(N),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?PF: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 zZ(H.width)&&zZ(H.height)}function _(H){return s?!1:H.wrapS!==qa||H.wrapT!==qa||H.minFilter!==Eo&&H.minFilter!==Po}function S(H,G){return H.generateMipmaps&&G&&H.minFilter!==Eo&&H.minFilter!==Po}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===yr&&_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!==Eo&&H.minFilter!==Po?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===Eo||H===mZ||H===gZ?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 W(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 $(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 N(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={[CF]:10497,[qa]:33071,[TF]:33648},Y={[Eo]:9728,[mZ]:9984,[gZ]:9986,[Po]:9729,[z$t]:9985,[Lk]: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!==qa||G.wrapT!==qa)&&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!==Eo&&G.minFilter!==Po&&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===Mf&&e.has("OES_texture_float_linear")===!1||s===!1&&G.type===o1&&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=W(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 $e;const Te=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===Mf?me=36012:G.type===kh?me=33190:G.type===zg?me=35056:me=33189:G.type===Mf&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),G.format===Hh&&me===6402&&G.type!==yye&&G.type!==kh&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),G.type=kh,Me=o.convert(G.type)),G.format===Fv&&me===6402&&(me=34041,G.type!==zg&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),G.type=zg,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(Te.length>0&&de){Re&&ae&&n.texStorage2D(3553,Le,me,Te[0].width,Te[0].height);for(let Ee=0,ze=Te.length;Ee>=1,ze>>=1}}else if(Te.length>0&&de){Re&&ae&&n.texStorage2D(3553,Le,me,Te[0].width,Te[0].height);for(let Ee=0,ze=Te.length;Ee0&&ae++,n.texStorage2D(34067,ae,$e,V[0].width,V[0].height));for(let Ee=0;Ee<6;Ee++)if(Z){Te?n.texSubImage2D(34069+Ee,0,0,0,V[Ee].width,V[Ee].height,Me,me,V[Ee].data):n.texImage2D(34069+Ee,0,$e,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===EF||ie!==xp&&(ie===yr?s===!1?e.has("EXT_sRGB")===!0&&he===jl?(H.format=EF,H.minFilter=Po,H.generateMipmaps=!1):G=wye.sRGBToLinear(G):(he!==jl||_e!==yp)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",ie)),G}this.allocateTextureUnit=U,this.resetTextureUnits=B,this.setTexture2D=$,this.setTexture2DArray=N,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 Xzt(t,e,n){const r=n.isWebGL2;function i(o,a=null){let s;if(o===yp)return 5121;if(o===G$t)return 32819;if(o===H$t)return 32820;if(o===U$t)return 5120;if(o===W$t)return 5122;if(o===yye)return 5123;if(o===V$t)return 5124;if(o===kh)return 5125;if(o===Mf)return 5126;if(o===o1)return r?5131:(s=e.get("OES_texture_half_float"),s!==null?s.HALF_FLOAT_OES:null);if(o===q$t)return 6406;if(o===jl)return 6408;if(o===Q$t)return 6409;if(o===Y$t)return 6410;if(o===Hh)return 6402;if(o===Fv)return 34041;if(o===xye)return 6403;if(o===X$t)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===EF)return s=e.get("EXT_sRGB"),s!==null?s.SRGB_ALPHA_EXT:null;if(o===K$t)return 36244;if(o===Z$t)return 33319;if(o===J$t)return 33320;if(o===eFt)return 36249;if(o===GI||o===HI||o===qI||o===XI)if(a===yr)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(o===GI)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(o===HI)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(o===qI)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(o===XI)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(o===GI)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(o===HI)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(o===qI)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(o===XI)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(o===vZ||o===yZ||o===xZ||o===bZ)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(o===vZ)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(o===yZ)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(o===xZ)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(o===bZ)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(o===tFt)return s=e.get("WEBGL_compressed_texture_etc1"),s!==null?s.COMPRESSED_RGB_ETC1_WEBGL:null;if(o===_Z||o===wZ)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(o===_Z)return a===yr?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(o===wZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(o===SZ||o===OZ||o===CZ||o===TZ||o===EZ||o===PZ||o===MZ||o===kZ||o===AZ||o===RZ||o===IZ||o===DZ||o===LZ||o===NZ)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(o===SZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(o===OZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(o===CZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(o===TZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(o===EZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(o===PZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(o===MZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(o===kZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(o===AZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(o===RZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(o===IZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(o===DZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(o===LZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(o===NZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(o===$Z)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(o===$Z)return a===yr?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;return o===zg?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 Qzt extends Us{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class tC extends zo{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Yzt={type:"move"};class wD{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new tC,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 tC,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 tC,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 tC;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(Yzt)))}return s!==null&&(s.visible=i!==null),l!==null&&(l.visible=o!==null),c!==null&&(c.visible=a!==null),this}}class Kzt extends Ta{constructor(e,n,r,i,o,a,s,l,c,u){if(u=u!==void 0?u:Hh,u!==Hh&&u!==Fv)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");r===void 0&&u===Hh&&(r=kh),r===void 0&&u===Fv&&(r=zg),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:Eo,this.minFilter=l!==void 0?l:Eo,this.flipY=!1,this.generateMipmaps=!1}}class Zzt extends Hp{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 Us;x.layers.enable(1),x.viewport=new Ri;const b=new Us;b.layers.enable(2),b.viewport=new Ri;const _=[x,b],S=new Qzt;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(W){let $=v[W];return $===void 0&&($=new wD,v[W]=$),$.getTargetRaySpace()},this.getControllerGrip=function(W){let $=v[W];return $===void 0&&($=new wD,v[W]=$),$.getGripSpace()},this.getHand=function(W){let $=v[W];return $===void 0&&($=new wD,v[W]=$),$.getHandSpace()};function E(W){const $=y.indexOf(W.inputSource);if($===-1)return;const N=v[$];N!==void 0&&N.dispatchEvent({type:W.type,data:W.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 W=0;W=0&&(y[D]=null,v[D].dispatchEvent({type:"disconnected",data:N}))}for(let $=0;$=y.length){y.push(N),D=q;break}else if(y[q]===null){y[q]=N,D=q;break}if(D===-1)break}const A=v[D];A&&A.dispatchEvent({type:"connected",data:N})}}const P=new Se,R=new Se;function T(W,$,N){P.setFromMatrixPosition($.matrixWorld),R.setFromMatrixPosition(N.matrixWorld);const D=P.distanceTo(R),A=$.projectionMatrix.elements,q=N.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;$.matrixWorld.decompose(W.position,W.quaternion,W.scale),W.translateX(F),W.translateZ(ve),W.matrixWorld.compose(W.position,W.quaternion,W.scale),W.matrixWorldInverse.copy(W.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;W.projectionMatrix.makePerspective(Q,X,ee,ge,ce,le)}function L(W,$){$===null?W.matrixWorld.copy(W.matrix):W.matrixWorld.multiplyMatrices($.matrixWorld,W.matrix),W.matrixWorldInverse.copy(W.matrixWorld).invert()}this.updateCamera=function(W){if(i===null)return;S.near=b.near=x.near=W.near,S.far=b.far=x.far=W.far,(O!==S.near||C!==S.far)&&(i.updateRenderState({depthNear:S.near,depthFar:S.far}),O=S.near,C=S.far);const $=W.parent,N=S.cameras;L(S,$);for(let A=0;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 e4t(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 t4t(){const t=a1("canvas");return t.style.display="block",t}function Bye(t={}){this.isWebGLRenderer=!0;const e=t.canvas!==void 0?t.canvas:t4t(),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=xp,this.physicallyCorrectLights=!1,this.toneMapping=su,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 Iye;let U=!1,W=!1,$=null;const N=new Hn,D=new qt,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 Xr(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(N);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(N);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(Ne,Pe,Ie),Oe&&pe.viewport(S.copy(Oe)),Ne.length>0&&ir(Ne,Pe,Ie),ot.length>0&&ir(ot,Pe,Ie),Ze.length>0&&ir(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;$===null&&($=new bp(1,1,{generateMipmaps:!0,type:te.has("EXT_color_buffer_half_float")?o1:yp,minFilter:Lk,samples:Oe&&o===!0?4:0})),m.getDrawingBufferSize(D),Oe?$.setSize(D.x,D.y):$.setSize(PF(D.x),PF(D.y));const Ne=m.getRenderTarget();m.setRenderTarget($),m.clear();const ot=m.toneMapping;m.toneMapping=su,ir(ne,Pe,Ie),m.toneMapping=ot,ve.updateMultisampleRenderTarget($),ve.updateRenderTargetMipmap($),m.setRenderTarget(Ne)}function ir(ne,Pe,Ie){const Oe=Pe.isScene===!0?Pe.overrideMaterial:null;for(let Ne=0,ot=ne.length;Ne0&&ve.useMultisampledRTT(ne)===!1?Ne=re.get(ne).__webglMultisampledFramebuffer:Ne=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,Ne)&&J.drawBuffers&&Oe&&pe.drawBuffers(ne,Ne),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,Ne,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!==jl&&V.convert(zt)!==K.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const st=Pt===o1&&(te.has("EXT_color_buffer_half_float")||J.isWebGL2&&te.has("EXT_color_buffer_float"));if(Pt!==yp&&V.convert(Pt)!==K.getParameter(35738)&&!(Pt===Mf&&(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-Ne&&K.readPixels(Pe,Ie,Oe,Ne,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),Ne=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,Ne,ot),pe.unbindTexture()},this.copyTextureToTexture=function(ne,Pe,Ie,Oe=0){const Ne=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,Ne,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,Ne=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),Ld=K.getParameter(3316),Xp=K.getParameter(3315),Qp=K.getParameter(32877),sl=Ie.isCompressedTexture?Ie.mipmaps[0]:Ie.image;K.pixelStorei(3314,sl.width),K.pixelStorei(32878,sl.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,Ne,Pe.x,Pe.y,Pe.z,ot,Ze,mt,wt,zt,sl.data):Ie.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),K.compressedTexSubImage3D(Pt,Ne,Pe.x,Pe.y,Pe.z,ot,Ze,mt,wt,sl.data)):K.texSubImage3D(Pt,Ne,Pe.x,Pe.y,Pe.z,ot,Ze,mt,wt,zt,sl),K.pixelStorei(3314,st),K.pixelStorei(32878,Qt),K.pixelStorei(3316,Ld),K.pixelStorei(3315,Xp),K.pixelStorei(32877,Qp),Ne===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 n4t extends Bye{}n4t.prototype.isWebGL1Renderer=!0;class r4t extends zo{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 zye extends $w{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new lr(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 _J=new Se,wJ=new Se,SJ=new Hn,SD=new Tye,nC=new Nk;class i4t extends zo{constructor(e=new Eu,n=new zye){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(Oc[e]!==void 0){Oc[e].push({onLoad:n,onProgress:r,onError:i});return}Oc[e]=[],Oc[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=Oc[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=>{IP.add(e,c);const u=Oc[e];delete Oc[e];for(let f=0,d=u.length;f{const u=Oc[e];if(u===void 0)throw this.manager.itemError(e),c;delete Oc[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 u4t extends jk{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=IP.get(e);if(a!==void 0)return o.manager.itemStart(e),setTimeout(function(){n&&n(a),o.manager.itemEnd(e)},0),a;const s=a1("img");function l(){u(),IP.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 f4t extends jk{constructor(e){super(e)}load(e,n,r,i){const o=new Ta,a=new u4t(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 TJ{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(Mo(n/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}const rC=new Qy;class d4t extends o4t{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 Eu;o.setIndex(new as(r,1)),o.setAttribute("position",new as(i,3)),super(o,new zye({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&&rC.setFromObject(this.object),rC.isEmpty())return;const n=rC.min,r=rC.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:S6}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=S6);const EJ={type:"change"},OD={type:"start"},PJ={type:"end"};class h4t extends Hp{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:gm.ROTATE,MIDDLE:gm.DOLLY,RIGHT:gm.PAN},this.touches={ONE:vm.ROTATE,TWO:vm.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(EJ),r.update(),o=i.NONE},this.update=function(){const V=new Se,de=new _p().setFromUnitVectors(e.up,new Se(0,1,0)),xe=de.clone().invert(),Me=new Se,me=new _p,$e=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+=$e:ae>Math.PI&&(ae-=$e),Le<-Math.PI?Le+=$e:Le>Math.PI&&(Le-=$e),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(EJ),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 TJ,l=new TJ;let c=1;const u=new Se;let f=!1;const d=new qt,h=new qt,p=new qt,m=new qt,g=new qt,v=new qt,y=new qt,x=new qt,b=new qt,_=[],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 $e=r.object.position;V.copy($e).sub(r.target);let Te=V.length();Te*=Math.tan(r.object.fov/2*Math.PI/180),I(2*xe*Te/me.clientHeight,r.object.matrix),P(2*Me*Te/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 U(V){m.set(V.clientX,V.clientY)}function W(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 $(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 N(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(PJ),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 gm.DOLLY:if(r.enableZoom===!1)return;B(V),o=i.DOLLY;break;case gm.ROTATE:if(V.ctrlKey||V.metaKey||V.shiftKey){if(r.enablePan===!1)return;U(V),o=i.PAN}else{if(r.enableRotate===!1)return;z(V),o=i.ROTATE}break;case gm.PAN:if(V.ctrlKey||V.metaKey||V.shiftKey){if(r.enableRotate===!1)return;z(V),o=i.ROTATE}else{if(r.enablePan===!1)return;U(V),o=i.PAN}break;default:o=i.NONE}o!==i.NONE&&r.dispatchEvent(OD)}function ee(V){switch(o){case i.ROTATE:if(r.enableRotate===!1)return;W(V);break;case i.DOLLY:if(r.enableZoom===!1)return;$(V);break;case i.PAN:if(r.enablePan===!1)return;N(V);break}}function ge(V){r.enabled===!1||r.enableZoom===!1||o!==i.NONE||(V.preventDefault(),r.dispatchEvent(OD),D(V),r.dispatchEvent(PJ))}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 vm.ROTATE:if(r.enableRotate===!1)return;q(),o=i.TOUCH_ROTATE;break;case vm.PAN:if(r.enablePan===!1)return;Y(),o=i.TOUCH_PAN;break;default:o=i.NONE}break;case 2:switch(r.touches.TWO){case vm.DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;se(),o=i.TOUCH_DOLLY_PAN;break;case vm.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(OD)}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 qt,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 p4t={uniforms:{u_size:{value:new Se(1,1,1)},u_renderstyle:{value:0},u_renderthreshold:{value:.5},u_clim:{value:new qt(0,1)},u_data:{value:null},u_cmdata:{value:null}},vertexShader:` +}`;function Wzt(t,e,n){let r=new Rye;const i=new qt,o=new qt,a=new Ri,s=new jzt({depthPacking:tFt}),l=new Bzt,c={},u=n.maxTextureSize,f={0:_a,1:Lv,2:Yc},d=new ud({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new qt},radius:{value:4}},vertexShader:zzt,fragmentShader:Uzt}),h=d.clone();h.defines.HORIZONTAL_PASS=1;const p=new Eu;p.setAttribute("position",new as(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const m=new Bl(p,d),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=dye,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(Hf),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!==_x?{minFilter:Eo,magFilter:Eo}:{};T.map=new bp(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===_x?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===_x)&&(!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):U.indexOf("OpenGL ES")!==-1&&(B=parseFloat(/^OpenGL ES (\d)/.exec(U)[1]),z=B>=2);let W=null,$={};const N=t.getParameter(3088),D=t.getParameter(2978),A=new Ri().fromArray(N),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 bt=0;bthe||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?EF: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 jZ(H.width)&&jZ(H.height)}function _(H){return s?!1:H.wrapS!==qa||H.wrapT!==qa||H.minFilter!==Eo&&H.minFilter!==Po}function S(H,G){return H.generateMipmaps&&G&&H.minFilter!==Eo&&H.minFilter!==Po}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===yr&&_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!==Eo&&H.minFilter!==Po?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===Eo||H===hZ||H===pZ?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 W(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 $(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 N(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={[OF]:10497,[qa]:33071,[CF]:33648},Y={[Eo]:9728,[hZ]:9984,[pZ]:9986,[Po]:9729,[j$t]:9985,[Lk]: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!==qa||G.wrapT!==qa)&&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!==Eo&&G.minFilter!==Po&&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===Mf&&e.has("OES_texture_float_linear")===!1||s===!1&&G.type===i1&&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=W(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 $e;const Te=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===Mf?me=36012:G.type===kh?me=33190:G.type===zg?me=35056:me=33189:G.type===Mf&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),G.format===Hh&&me===6402&&G.type!==vye&&G.type!==kh&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),G.type=kh,Me=o.convert(G.type)),G.format===Fv&&me===6402&&(me=34041,G.type!==zg&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),G.type=zg,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(Te.length>0&&de){Re&&ae&&n.texStorage2D(3553,Le,me,Te[0].width,Te[0].height);for(let Ee=0,ze=Te.length;Ee>=1,ze>>=1}}else if(Te.length>0&&de){Re&&ae&&n.texStorage2D(3553,Le,me,Te[0].width,Te[0].height);for(let Ee=0,ze=Te.length;Ee0&&ae++,n.texStorage2D(34067,ae,$e,V[0].width,V[0].height));for(let Ee=0;Ee<6;Ee++)if(Z){Te?n.texSubImage2D(34069+Ee,0,0,0,V[Ee].width,V[Ee].height,Me,me,V[Ee].data):n.texImage2D(34069+Ee,0,$e,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===TF||ie!==xp&&(ie===yr?s===!1?e.has("EXT_sRGB")===!0&&he===jl?(H.format=TF,H.minFilter=Po,H.generateMipmaps=!1):G=_ye.sRGBToLinear(G):(he!==jl||_e!==yp)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",ie)),G}this.allocateTextureUnit=U,this.resetTextureUnits=B,this.setTexture2D=$,this.setTexture2DArray=N,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 Hzt(t,e,n){const r=n.isWebGL2;function i(o,a=null){let s;if(o===yp)return 5121;if(o===W$t)return 32819;if(o===V$t)return 32820;if(o===B$t)return 5120;if(o===z$t)return 5122;if(o===vye)return 5123;if(o===U$t)return 5124;if(o===kh)return 5125;if(o===Mf)return 5126;if(o===i1)return r?5131:(s=e.get("OES_texture_half_float"),s!==null?s.HALF_FLOAT_OES:null);if(o===G$t)return 6406;if(o===jl)return 6408;if(o===q$t)return 6409;if(o===X$t)return 6410;if(o===Hh)return 6402;if(o===Fv)return 34041;if(o===yye)return 6403;if(o===H$t)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===TF)return s=e.get("EXT_sRGB"),s!==null?s.SRGB_ALPHA_EXT:null;if(o===Q$t)return 36244;if(o===Y$t)return 33319;if(o===K$t)return 33320;if(o===Z$t)return 36249;if(o===VI||o===GI||o===HI||o===qI)if(a===yr)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(o===VI)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(o===GI)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(o===HI)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(o===qI)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(o===VI)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(o===GI)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(o===HI)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(o===qI)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(o===mZ||o===gZ||o===vZ||o===yZ)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(o===mZ)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(o===gZ)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(o===vZ)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(o===yZ)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(o===J$t)return s=e.get("WEBGL_compressed_texture_etc1"),s!==null?s.COMPRESSED_RGB_ETC1_WEBGL:null;if(o===xZ||o===bZ)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(o===xZ)return a===yr?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(o===bZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(o===_Z||o===wZ||o===SZ||o===OZ||o===CZ||o===TZ||o===EZ||o===PZ||o===MZ||o===kZ||o===AZ||o===RZ||o===IZ||o===DZ)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(o===_Z)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(o===wZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(o===SZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(o===OZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(o===CZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(o===TZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(o===EZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(o===PZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(o===MZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(o===kZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(o===AZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(o===RZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(o===IZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(o===DZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(o===LZ)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(o===LZ)return a===yr?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;return o===zg?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 qzt extends Us{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class tC extends zo{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Xzt={type:"move"};class _D{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new tC,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 tC,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 tC,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 tC;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(Xzt)))}return s!==null&&(s.visible=i!==null),l!==null&&(l.visible=o!==null),c!==null&&(c.visible=a!==null),this}}class Qzt extends Ta{constructor(e,n,r,i,o,a,s,l,c,u){if(u=u!==void 0?u:Hh,u!==Hh&&u!==Fv)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");r===void 0&&u===Hh&&(r=kh),r===void 0&&u===Fv&&(r=zg),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:Eo,this.minFilter=l!==void 0?l:Eo,this.flipY=!1,this.generateMipmaps=!1}}class Yzt extends Hp{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 Us;x.layers.enable(1),x.viewport=new Ri;const b=new Us;b.layers.enable(2),b.viewport=new Ri;const _=[x,b],S=new qzt;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(W){let $=v[W];return $===void 0&&($=new _D,v[W]=$),$.getTargetRaySpace()},this.getControllerGrip=function(W){let $=v[W];return $===void 0&&($=new _D,v[W]=$),$.getGripSpace()},this.getHand=function(W){let $=v[W];return $===void 0&&($=new _D,v[W]=$),$.getHandSpace()};function E(W){const $=y.indexOf(W.inputSource);if($===-1)return;const N=v[$];N!==void 0&&N.dispatchEvent({type:W.type,data:W.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 W=0;W=0&&(y[D]=null,v[D].dispatchEvent({type:"disconnected",data:N}))}for(let $=0;$=y.length){y.push(N),D=q;break}else if(y[q]===null){y[q]=N,D=q;break}if(D===-1)break}const A=v[D];A&&A.dispatchEvent({type:"connected",data:N})}}const P=new Se,R=new Se;function T(W,$,N){P.setFromMatrixPosition($.matrixWorld),R.setFromMatrixPosition(N.matrixWorld);const D=P.distanceTo(R),A=$.projectionMatrix.elements,q=N.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;$.matrixWorld.decompose(W.position,W.quaternion,W.scale),W.translateX(F),W.translateZ(ve),W.matrixWorld.compose(W.position,W.quaternion,W.scale),W.matrixWorldInverse.copy(W.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;W.projectionMatrix.makePerspective(Q,X,ee,ge,ce,le)}function L(W,$){$===null?W.matrixWorld.copy(W.matrix):W.matrixWorld.multiplyMatrices($.matrixWorld,W.matrix),W.matrixWorldInverse.copy(W.matrixWorld).invert()}this.updateCamera=function(W){if(i===null)return;S.near=b.near=x.near=W.near,S.far=b.far=x.far=W.far,(O!==S.near||C!==S.far)&&(i.updateRenderState({depthNear:S.near,depthFar:S.far}),O=S.near,C=S.far);const $=W.parent,N=S.cameras;L(S,$);for(let A=0;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 Zzt(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 Jzt(){const t=o1("canvas");return t.style.display="block",t}function jye(t={}){this.isWebGLRenderer=!0;const e=t.canvas!==void 0?t.canvas:Jzt(),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=xp,this.physicallyCorrectLights=!1,this.toneMapping=su,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 Rye;let U=!1,W=!1,$=null;const N=new Hn,D=new qt,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 Xr(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(N);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(N);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(Ne,Pe,Ie),Oe&&pe.viewport(S.copy(Oe)),Ne.length>0&&ir(Ne,Pe,Ie),ot.length>0&&ir(ot,Pe,Ie),Ze.length>0&&ir(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;$===null&&($=new bp(1,1,{generateMipmaps:!0,type:te.has("EXT_color_buffer_half_float")?i1:yp,minFilter:Lk,samples:Oe&&o===!0?4:0})),m.getDrawingBufferSize(D),Oe?$.setSize(D.x,D.y):$.setSize(EF(D.x),EF(D.y));const Ne=m.getRenderTarget();m.setRenderTarget($),m.clear();const ot=m.toneMapping;m.toneMapping=su,ir(ne,Pe,Ie),m.toneMapping=ot,ve.updateMultisampleRenderTarget($),ve.updateRenderTargetMipmap($),m.setRenderTarget(Ne)}function ir(ne,Pe,Ie){const Oe=Pe.isScene===!0?Pe.overrideMaterial:null;for(let Ne=0,ot=ne.length;Ne0&&ve.useMultisampledRTT(ne)===!1?Ne=re.get(ne).__webglMultisampledFramebuffer:Ne=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,Ne)&&J.drawBuffers&&Oe&&pe.drawBuffers(ne,Ne),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,Ne,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!==jl&&V.convert(zt)!==K.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const st=Pt===i1&&(te.has("EXT_color_buffer_half_float")||J.isWebGL2&&te.has("EXT_color_buffer_float"));if(Pt!==yp&&V.convert(Pt)!==K.getParameter(35738)&&!(Pt===Mf&&(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-Ne&&K.readPixels(Pe,Ie,Oe,Ne,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),Ne=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,Ne,ot),pe.unbindTexture()},this.copyTextureToTexture=function(ne,Pe,Ie,Oe=0){const Ne=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,Ne,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,Ne=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),Ld=K.getParameter(3316),Xp=K.getParameter(3315),Qp=K.getParameter(32877),sl=Ie.isCompressedTexture?Ie.mipmaps[0]:Ie.image;K.pixelStorei(3314,sl.width),K.pixelStorei(32878,sl.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,Ne,Pe.x,Pe.y,Pe.z,ot,Ze,mt,wt,zt,sl.data):Ie.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),K.compressedTexSubImage3D(Pt,Ne,Pe.x,Pe.y,Pe.z,ot,Ze,mt,wt,sl.data)):K.texSubImage3D(Pt,Ne,Pe.x,Pe.y,Pe.z,ot,Ze,mt,wt,zt,sl),K.pixelStorei(3314,st),K.pixelStorei(32878,Qt),K.pixelStorei(3316,Ld),K.pixelStorei(3315,Xp),K.pixelStorei(32877,Qp),Ne===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 e4t extends jye{}e4t.prototype.isWebGL1Renderer=!0;class t4t extends zo{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 Bye extends $w{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new lr(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 xJ=new Se,bJ=new Se,_J=new Hn,wD=new Cye,nC=new Nk;class n4t extends zo{constructor(e=new Eu,n=new Bye){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(Oc[e]!==void 0){Oc[e].push({onLoad:n,onProgress:r,onError:i});return}Oc[e]=[],Oc[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=Oc[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=>{IP.add(e,c);const u=Oc[e];delete Oc[e];for(let f=0,d=u.length;f{const u=Oc[e];if(u===void 0)throw this.manager.itemError(e),c;delete Oc[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 l4t extends jk{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=IP.get(e);if(a!==void 0)return o.manager.itemStart(e),setTimeout(function(){n&&n(a),o.manager.itemEnd(e)},0),a;const s=o1("img");function l(){u(),IP.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 c4t extends jk{constructor(e){super(e)}load(e,n,r,i){const o=new Ta,a=new l4t(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 OJ{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(Mo(n/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}const rC=new Xy;class u4t extends r4t{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 Eu;o.setIndex(new as(r,1)),o.setAttribute("position",new as(i,3)),super(o,new Bye({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&&rC.setFromObject(this.object),rC.isEmpty())return;const n=rC.min,r=rC.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:w6}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=w6);const CJ={type:"change"},SD={type:"start"},TJ={type:"end"};class f4t extends Hp{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:gm.ROTATE,MIDDLE:gm.DOLLY,RIGHT:gm.PAN},this.touches={ONE:vm.ROTATE,TWO:vm.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(CJ),r.update(),o=i.NONE},this.update=function(){const V=new Se,de=new _p().setFromUnitVectors(e.up,new Se(0,1,0)),xe=de.clone().invert(),Me=new Se,me=new _p,$e=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+=$e:ae>Math.PI&&(ae-=$e),Le<-Math.PI?Le+=$e:Le>Math.PI&&(Le-=$e),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(CJ),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 OJ,l=new OJ;let c=1;const u=new Se;let f=!1;const d=new qt,h=new qt,p=new qt,m=new qt,g=new qt,v=new qt,y=new qt,x=new qt,b=new qt,_=[],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 $e=r.object.position;V.copy($e).sub(r.target);let Te=V.length();Te*=Math.tan(r.object.fov/2*Math.PI/180),I(2*xe*Te/me.clientHeight,r.object.matrix),P(2*Me*Te/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 U(V){m.set(V.clientX,V.clientY)}function W(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 $(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 N(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(TJ),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 gm.DOLLY:if(r.enableZoom===!1)return;B(V),o=i.DOLLY;break;case gm.ROTATE:if(V.ctrlKey||V.metaKey||V.shiftKey){if(r.enablePan===!1)return;U(V),o=i.PAN}else{if(r.enableRotate===!1)return;z(V),o=i.ROTATE}break;case gm.PAN:if(V.ctrlKey||V.metaKey||V.shiftKey){if(r.enableRotate===!1)return;z(V),o=i.ROTATE}else{if(r.enablePan===!1)return;U(V),o=i.PAN}break;default:o=i.NONE}o!==i.NONE&&r.dispatchEvent(SD)}function ee(V){switch(o){case i.ROTATE:if(r.enableRotate===!1)return;W(V);break;case i.DOLLY:if(r.enableZoom===!1)return;$(V);break;case i.PAN:if(r.enablePan===!1)return;N(V);break}}function ge(V){r.enabled===!1||r.enableZoom===!1||o!==i.NONE||(V.preventDefault(),r.dispatchEvent(SD),D(V),r.dispatchEvent(TJ))}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 vm.ROTATE:if(r.enableRotate===!1)return;q(),o=i.TOUCH_ROTATE;break;case vm.PAN:if(r.enablePan===!1)return;Y(),o=i.TOUCH_PAN;break;default:o=i.NONE}break;case 2:switch(r.touches.TWO){case vm.DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;se(),o=i.TOUCH_DOLLY_PAN;break;case vm.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(SD)}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 qt,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 d4t={uniforms:{u_size:{value:new Se(1,1,1)},u_renderstyle:{value:0},u_renderthreshold:{value:.5},u_clim:{value:new qt(0,1)},u_data:{value:null},u_cmdata:{value:null}},vertexShader:` varying vec4 v_nearpos; varying vec4 v_farpos; @@ -3730,6 +3730,6 @@ void main() { final_color = color * (ambient_color + diffuse_color) + specular_color; final_color.a = color.a; return final_color; - }`};function m4t(){try{const t=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&t.getContext("webgl2"))}catch{return!1}}class g4t{constructor(){Yt(this,"textures");this.textures={}}get(e,n){const r=rE(e);let i=this.textures[r];return i||(i=new f4t().load(`data:image/png;base64,${e.imageData}`,n),this.textures[r]=i),i}}const v4t=new g4t;class y4t{constructor(e){Yt(this,"canvas");Yt(this,"camera");Yt(this,"renderer");Yt(this,"scene");Yt(this,"material");if(!m4t())throw new Error("Missing WebGL2");this.render=this.render.bind(this);const n=new Bye({canvas:e});n.setPixelRatio(window.devicePixelRatio),n.setSize(e.clientWidth,e.clientHeight);const r=100,i=e.clientWidth/e.clientHeight,o=new Lye(-r*i,r*i,r,-r,-1e3,1e3);o.position.set(0,0,100),o.up.set(0,1,0);const a=new h4t(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 Cye(e.data,e.xLength,e.yLength,e.zLength);r.format=xye,r.type=Mf,r.minFilter=r.magFilter=Po,r.unpackAlignment=1,r.needsUpdate=!0;const i=p4t,o=kye.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 ud({uniforms:o,vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:_a}),h=new Yy(c,u,f);h.translate(c/2,u/2,f/2);const p=new Bl(h,d),m=new r4t;m.add(p),m.add(new d4t(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=v4t.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,Rh=Uint16Array,Uye=Uint32Array,Wye=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]),Vye=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]),x4t=new pa([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Gye=function(t,e){for(var n=new Rh(31),r=0;r<31;++r)n[r]=e+=1<>>1|(Jn&21845)<<1;qu=(qu&52428)>>>2|(qu&13107)<<2,qu=(qu&61680)>>>4|(qu&3855)<<4,kF[Jn]=((qu&65280)>>>8|(qu&255)<<8)>>>1}var fb=function(t,e,n){for(var r=t.length,i=0,o=new Rh(e);i>>l]=c}else for(s=new Rh(r),i=0;i>>15-t[i]);return s},Fw=new pa(288);for(var Jn=0;Jn<144;++Jn)Fw[Jn]=8;for(var Jn=144;Jn<256;++Jn)Fw[Jn]=9;for(var Jn=256;Jn<280;++Jn)Fw[Jn]=7;for(var Jn=280;Jn<288;++Jn)Fw[Jn]=8;var Xye=new pa(32);for(var Jn=0;Jn<32;++Jn)Xye[Jn]=5;var S4t=fb(Fw,9,1),O4t=fb(Xye,5,1),CD=function(t){for(var e=t[0],n=1;ne&&(e=t[n]);return e},Ls=function(t,e,n){var r=e/8|0;return(t[r]|t[r+1]<<8)>>(e&7)&n},TD=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(e&7)},C4t=function(t){return(t+7)/8|0},T4t=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t.BYTES_PER_ELEMENT==2?Rh:t.BYTES_PER_ELEMENT==4?Uye:pa)(n-e);return r.set(t.subarray(e,n)),r},E4t=["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"],Ic=function(t,e,n){var r=new Error(e||E4t[t]);if(r.code=t,Error.captureStackTrace&&Error.captureStackTrace(r,Ic),!n)throw r;return r},P4t=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=Ls(t,l,1);var m=Ls(t,l+1,3);if(l+=3,m)if(m==1)u=S4t,f=O4t,d=9,h=5;else if(m==2){var x=Ls(t,l,31)+257,b=Ls(t,l+10,15)+4,_=x+Ls(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+Ls(t,l,3),l+=2,R=S[C-1]):g==17?(T=3+Ls(t,l,7),l+=3):g==18&&(T=11+Ls(t,l,127),l+=7);T--;)S[C++]=R}}var L=S.subarray(0,x),z=S.subarray(x);d=CD(L),h=CD(z),u=fb(L,d,1),f=fb(z,h,1)}else Ic(1);else{var g=C4t(l)+4,v=t[g-4]|t[g-3]<<8,y=g+v;if(y>r){o&&Ic(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&&Ic(0);break}}i&&a(c+131072);for(var B=(1<>>4;if(l+=R&15,l>p){o&&Ic(0);break}if(R||Ic(2),$<256)e[c++]=$;else if($==256){W=l,u=null;break}else{var N=$-254;if($>264){var C=$-257,D=Wye[C];N=Ls(t,l,(1<>>4;A||Ic(3),l+=A&15;var z=w4t[q];if(q>3){var D=Vye[q];z+=TD(t,l)&(1<p){o&&Ic(0);break}i&&a(c+131072);for(var Y=c+N;c>3&1)+(e>>4&1);r>0;r-=!t[n++]);return n+(e&2)},A4t=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0};function R4t(t,e){return P4t(t.subarray(k4t(t),-8),new pa(A4t(t)))}var I4t=typeof TextDecoder<"u"&&new TextDecoder,D4t=0;try{I4t.decode(M4t,{stream:!0}),D4t=1}catch{}class L4t{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=Po,o.wrapS=o.wrapT=qa;const a=new O6({map:o,side:Yc,transparent:!0});this.mesh=new Bl(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 $k(e.planeWidth,e.planeHeight),this.mesh&&(this.mesh.geometry=this.geometry,this.mesh.matrix.identity(),this.mesh.applyMatrix4(this.matrix)),this.geometryNeedsUpdate=!1}}class N4t{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 L4t(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 Hn;const O=new Hn;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 Hn().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 Hn().multiplyMatrices(E,O)}return g.inverseMatrix=new Hn,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,db.getVolumeOptions(this.props)),ED[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"||!ED[n])&&(i=[w.jsx(tr,{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(ey,{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:MJ,children:r})),i&&(i=w.jsx("div",{style:MJ,children:i})),w.jsxs("div",{style:U4t,children:[i,r,w.jsx("canvas",{id:"VolumeCanvas-canvas",ref:this.canvasRef,style:j4t}),!r&&!i&&z4t]})}updateVolumeScene(){const n=this.canvasRef.current;if(n===null){this.volumeScene=null;return}let r;this.props.volumeId&&(r=ED[this.props.volumeId]);let i=!1;(this.volumeScene===null||this.volumeScene.canvas!==n)&&(this.volumeScene=new y4t(n),i=!0),i&&r?this.volumeScene.setVolume(r,db.getVolumeOptions(this.props)):this.volumeScene.setVolumeOptions(db.getVolumeOptions(this.props))}}function kJ(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 W4t(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 DP={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}},V4t=({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(Ure,{sx:DP.card,children:[w.jsx(Wre,{disableSpacing:!0,children:e&&w.jsxs(w.Fragment,{children:[w.jsxs(iy,{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(G4t,{minValue:e.colorBarMin,maxValue:e.colorBarMax,value:f,setValue:d})]})}),w.jsx(Vre,{sx:DP.cardContent,children:w.jsx(db,{selectedDataset:t,selectedVariable:e,selectedPlaceInfo:n,variableColorBar:r,volumeRenderMode:o,volumeIsoThreshold:f,volumeId:i,volumeStates:s,updateVolumeState:l,serverUrl:u})})]})},G4t=({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(cr,{sx:DP.isoTextField,disabled:i,label:"Iso-Threshold",variant:"filled",size:"small",value:s,error:c!==null,onChange:f,onKeyPress:d,InputProps:{endAdornment:w.jsx(ry,{size:"small",sx:DP.isoSlider,min:e,max:n,value:o,step:(n-e)/20,onChange:h,onChangeCommitted:p})}})},H4t=t=>({locale:t.controlState.locale,selectedDataset:qr(t),selectedVariable:vo(t),selectedPlaceInfo:iw(t),variableColorBar:HB(t),volumeRenderMode:t.controlState.volumeRenderMode,volumeId:KWe(t),volumeStates:t.controlState.volumeStates,serverUrl:pi(t).url}),q4t={setVolumeRenderMode:$8e,updateVolumeState:F8e,updateVariableVolume:m8e},X4t=Jt(H4t,q4t)(V4t),Q4t={info:w.jsx(f4,{fontSize:"inherit"}),timeSeries:w.jsx(hfe,{fontSize:"inherit"}),stats:w.jsx(Ez,{fontSize:"inherit"}),volume:w.jsx(pfe,{fontSize:"inherit"})},Y4t={info:"Info",timeSeries:"Time-Series",stats:"Statistics",volume:"Volume"},PD={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"}},K4t=t=>({sidebarPanelId:t.controlState.sidebarPanelId}),Z4t={setSidebarPanelId:sz};function J4t({sidebarPanelId:t,setSidebarPanelId:e}){return w.jsxs(Ke,{sx:{width:"100%"},children:[w.jsx(Ke,{sx:PD.tabBoxHeader,children:w.jsx(A5,{value:t,onChange:(n,r)=>{e(r)},variant:"scrollable",sx:PD.tabs,children:nWe.map(n=>w.jsx($b,{icon:Q4t[n],iconPosition:"start",sx:PD.tab,disableRipple:!0,value:n,label:fe.get(Y4t[n])},n))})}),t==="info"&&w.jsx(Cdt,{}),t==="stats"&&w.jsx(f$t,{}),t==="timeSeries"&&w.jsx(QNt,{}),t==="volume"&&w.jsx(X4t,{})]})}const eUt=Jt(K4t,Z4t)(J4t),iC={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%"}},tUt=t=>({sidebarOpen:t.controlState.sidebarOpen,sidebarPosition:t.controlState.sidebarPosition}),nUt={setSidebarPosition:N8e},AJ=()=>window.innerWidth/window.innerHeight>=1?"hor":"ver";function rUt({sidebarOpen:t,sidebarPosition:e,setSidebarPosition:n}){const[r,i]=M.useState(null),[o,a]=M.useState(AJ()),s=M.useRef(null),l=Go();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(AJ())},u=o==="hor"?"Hor":"Ver";return t?w.jsxs(htt,{dir:o,splitPosition:e,setSplitPosition:n,style:iC["container"+u],child1Style:iC["viewer"+u],child2Style:iC["sidebar"+u],children:[w.jsx(t7,{onMapRef:i,theme:l}),w.jsx(eUt,{})]}):w.jsx("div",{style:iC.viewer,children:w.jsx(t7,{onMapRef:i,theme:l})})}const iUt=Jt(tUt,nUt)(rUt);var Bk={exports:{}},Qye={};function Yye(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 TUt(t){if(t.targetTouches&&t.targetTouches[0])return t.targetTouches[0].identifier;if(t.changedTouches&&t.changedTouches[0])return t.changedTouches[0].identifier}function EUt(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 h4t(){try{const t=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&t.getContext("webgl2"))}catch{return!1}}class p4t{constructor(){Yt(this,"textures");this.textures={}}get(e,n){const r=rE(e);let i=this.textures[r];return i||(i=new c4t().load(`data:image/png;base64,${e.imageData}`,n),this.textures[r]=i),i}}const m4t=new p4t;class g4t{constructor(e){Yt(this,"canvas");Yt(this,"camera");Yt(this,"renderer");Yt(this,"scene");Yt(this,"material");if(!h4t())throw new Error("Missing WebGL2");this.render=this.render.bind(this);const n=new jye({canvas:e});n.setPixelRatio(window.devicePixelRatio),n.setSize(e.clientWidth,e.clientHeight);const r=100,i=e.clientWidth/e.clientHeight,o=new Dye(-r*i,r*i,r,-r,-1e3,1e3);o.position.set(0,0,100),o.up.set(0,1,0);const a=new f4t(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 Oye(e.data,e.xLength,e.yLength,e.zLength);r.format=yye,r.type=Mf,r.minFilter=r.magFilter=Po,r.unpackAlignment=1,r.needsUpdate=!0;const i=d4t,o=Mye.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 ud({uniforms:o,vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:_a}),h=new Qy(c,u,f);h.translate(c/2,u/2,f/2);const p=new Bl(h,d),m=new t4t;m.add(p),m.add(new u4t(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=m4t.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,Rh=Uint16Array,zye=Uint32Array,Uye=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]),Wye=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]),v4t=new pa([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Vye=function(t,e){for(var n=new Rh(31),r=0;r<31;++r)n[r]=e+=1<>>1|(Jn&21845)<<1;qu=(qu&52428)>>>2|(qu&13107)<<2,qu=(qu&61680)>>>4|(qu&3855)<<4,MF[Jn]=((qu&65280)>>>8|(qu&255)<<8)>>>1}var ub=function(t,e,n){for(var r=t.length,i=0,o=new Rh(e);i>>l]=c}else for(s=new Rh(r),i=0;i>>15-t[i]);return s},Fw=new pa(288);for(var Jn=0;Jn<144;++Jn)Fw[Jn]=8;for(var Jn=144;Jn<256;++Jn)Fw[Jn]=9;for(var Jn=256;Jn<280;++Jn)Fw[Jn]=7;for(var Jn=280;Jn<288;++Jn)Fw[Jn]=8;var qye=new pa(32);for(var Jn=0;Jn<32;++Jn)qye[Jn]=5;var _4t=ub(Fw,9,1),w4t=ub(qye,5,1),OD=function(t){for(var e=t[0],n=1;ne&&(e=t[n]);return e},Ls=function(t,e,n){var r=e/8|0;return(t[r]|t[r+1]<<8)>>(e&7)&n},CD=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(e&7)},S4t=function(t){return(t+7)/8|0},O4t=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t.BYTES_PER_ELEMENT==2?Rh:t.BYTES_PER_ELEMENT==4?zye:pa)(n-e);return r.set(t.subarray(e,n)),r},C4t=["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"],Ic=function(t,e,n){var r=new Error(e||C4t[t]);if(r.code=t,Error.captureStackTrace&&Error.captureStackTrace(r,Ic),!n)throw r;return r},T4t=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=Ls(t,l,1);var m=Ls(t,l+1,3);if(l+=3,m)if(m==1)u=_4t,f=w4t,d=9,h=5;else if(m==2){var x=Ls(t,l,31)+257,b=Ls(t,l+10,15)+4,_=x+Ls(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+Ls(t,l,3),l+=2,R=S[C-1]):g==17?(T=3+Ls(t,l,7),l+=3):g==18&&(T=11+Ls(t,l,127),l+=7);T--;)S[C++]=R}}var L=S.subarray(0,x),z=S.subarray(x);d=OD(L),h=OD(z),u=ub(L,d,1),f=ub(z,h,1)}else Ic(1);else{var g=S4t(l)+4,v=t[g-4]|t[g-3]<<8,y=g+v;if(y>r){o&&Ic(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&&Ic(0);break}}i&&a(c+131072);for(var B=(1<>>4;if(l+=R&15,l>p){o&&Ic(0);break}if(R||Ic(2),$<256)e[c++]=$;else if($==256){W=l,u=null;break}else{var N=$-254;if($>264){var C=$-257,D=Uye[C];N=Ls(t,l,(1<>>4;A||Ic(3),l+=A&15;var z=b4t[q];if(q>3){var D=Wye[q];z+=CD(t,l)&(1<p){o&&Ic(0);break}i&&a(c+131072);for(var Y=c+N;c>3&1)+(e>>4&1);r>0;r-=!t[n++]);return n+(e&2)},M4t=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0};function k4t(t,e){return T4t(t.subarray(P4t(t),-8),new pa(M4t(t)))}var A4t=typeof TextDecoder<"u"&&new TextDecoder,R4t=0;try{A4t.decode(E4t,{stream:!0}),R4t=1}catch{}class I4t{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=Po,o.wrapS=o.wrapT=qa;const a=new S6({map:o,side:Yc,transparent:!0});this.mesh=new Bl(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 $k(e.planeWidth,e.planeHeight),this.mesh&&(this.mesh.geometry=this.geometry,this.mesh.matrix.identity(),this.mesh.applyMatrix4(this.matrix)),this.geometryNeedsUpdate=!1}}class D4t{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 I4t(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 Hn;const O=new Hn;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 Hn().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 Hn().multiplyMatrices(E,O)}return g.inverseMatrix=new Hn,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,fb.getVolumeOptions(this.props)),TD[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"||!TD[n])&&(i=[w.jsx(tr,{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(ey,{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:EJ,children:r})),i&&(i=w.jsx("div",{style:EJ,children:i})),w.jsxs("div",{style:B4t,children:[i,r,w.jsx("canvas",{id:"VolumeCanvas-canvas",ref:this.canvasRef,style:$4t}),!r&&!i&&j4t]})}updateVolumeScene(){const n=this.canvasRef.current;if(n===null){this.volumeScene=null;return}let r;this.props.volumeId&&(r=TD[this.props.volumeId]);let i=!1;(this.volumeScene===null||this.volumeScene.canvas!==n)&&(this.volumeScene=new g4t(n),i=!0),i&&r?this.volumeScene.setVolume(r,fb.getVolumeOptions(this.props)):this.volumeScene.setVolumeOptions(fb.getVolumeOptions(this.props))}}function PJ(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 z4t(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 DP={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}},U4t=({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(Bre,{sx:DP.card,children:[w.jsx(zre,{disableSpacing:!0,children:e&&w.jsxs(w.Fragment,{children:[w.jsxs(iy,{size:"small",exclusive:!0,value:o,onChange:h,children:[w.jsx(Pn,{value:"mip",size:"small",children:w.jsx(xt,{arrow:!0,title:"Maximum intensity projection",children:w.jsx("span",{children:"MIP"})})},"mip"),w.jsx(Pn,{value:"aip",size:"small",children:w.jsx(xt,{arrow:!0,title:"Average intensity projection",children:w.jsx("span",{children:"AIP"})})},"aip"),w.jsx(Pn,{value:"iso",size:"small",children:w.jsx(xt,{arrow:!0,title:"Iso-surface extraction",children:w.jsx("span",{children:"ISO"})})},"iso")]},0),o==="iso"&&w.jsx(W4t,{minValue:e.colorBarMin,maxValue:e.colorBarMax,value:f,setValue:d})]})}),w.jsx(Ure,{sx:DP.cardContent,children:w.jsx(fb,{selectedDataset:t,selectedVariable:e,selectedPlaceInfo:n,variableColorBar:r,volumeRenderMode:o,volumeIsoThreshold:f,volumeId:i,volumeStates:s,updateVolumeState:l,serverUrl:u})})]})},W4t=({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(cr,{sx:DP.isoTextField,disabled:i,label:"Iso-Threshold",variant:"filled",size:"small",value:s,error:c!==null,onChange:f,onKeyPress:d,InputProps:{endAdornment:w.jsx(ry,{size:"small",sx:DP.isoSlider,min:e,max:n,value:o,step:(n-e)/20,onChange:h,onChangeCommitted:p})}})},V4t=t=>({locale:t.controlState.locale,selectedDataset:qr(t),selectedVariable:vo(t),selectedPlaceInfo:iw(t),variableColorBar:GB(t),volumeRenderMode:t.controlState.volumeRenderMode,volumeId:QWe(t),volumeStates:t.controlState.volumeStates,serverUrl:pi(t).url}),G4t={setVolumeRenderMode:L8e,updateVolumeState:N8e,updateVariableVolume:h8e},H4t=Jt(V4t,G4t)(U4t),q4t={info:w.jsx(u4,{fontSize:"inherit"}),timeSeries:w.jsx(dfe,{fontSize:"inherit"}),stats:w.jsx(Tz,{fontSize:"inherit"}),volume:w.jsx(hfe,{fontSize:"inherit"})},X4t={info:"Info",timeSeries:"Time-Series",stats:"Statistics",volume:"Volume"},ED={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"}},Q4t=t=>({sidebarPanelId:t.controlState.sidebarPanelId}),Y4t={setSidebarPanelId:az};function K4t({sidebarPanelId:t,setSidebarPanelId:e}){return w.jsxs(Ke,{sx:{width:"100%"},children:[w.jsx(Ke,{sx:ED.tabBoxHeader,children:w.jsx(k5,{value:t,onChange:(n,r)=>{e(r)},variant:"scrollable",sx:ED.tabs,children:eWe.map(n=>w.jsx(Nb,{icon:q4t[n],iconPosition:"start",sx:ED.tab,disableRipple:!0,value:n,label:fe.get(X4t[n])},n))})}),t==="info"&&w.jsx(Sdt,{}),t==="stats"&&w.jsx(c$t,{}),t==="timeSeries"&&w.jsx(qNt,{}),t==="volume"&&w.jsx(H4t,{})]})}const Z4t=Jt(Q4t,Y4t)(K4t),iC={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%"}},J4t=t=>({sidebarOpen:t.controlState.sidebarOpen,sidebarPosition:t.controlState.sidebarPosition}),eUt={setSidebarPosition:D8e},MJ=()=>window.innerWidth/window.innerHeight>=1?"hor":"ver";function tUt({sidebarOpen:t,sidebarPosition:e,setSidebarPosition:n}){const[r,i]=M.useState(null),[o,a]=M.useState(MJ()),s=M.useRef(null),l=Go();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(MJ())},u=o==="hor"?"Hor":"Ver";return t?w.jsxs(ftt,{dir:o,splitPosition:e,setSplitPosition:n,style:iC["container"+u],child1Style:iC["viewer"+u],child2Style:iC["sidebar"+u],children:[w.jsx(J9,{onMapRef:i,theme:l}),w.jsx(Z4t,{})]}):w.jsx("div",{style:iC.viewer,children:w.jsx(J9,{onMapRef:i,theme:l})})}const nUt=Jt(J4t,eUt)(tUt);var Bk={exports:{}},Xye={};function Qye(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 OUt(t){if(t.targetTouches&&t.targetTouches[0])return t.targetTouches[0].identifier;if(t.changedTouches&&t.changedTouches[0])return t.changedTouches[0].identifier}function CUt(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&&t0e(t.body,"react-draggable-transparent-selection")}function PUt(t){if(t)try{if(t.body&&n0e(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 t0e(t,e){t.classList?t.classList.add(e):t.className.match(new RegExp("(?:^|\\s)".concat(e,"(?!\\S)")))||(t.className+=" ".concat(e))}function n0e(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(new RegExp("(?:^|\\s)".concat(e,"(?!\\S)"),"g"),"")}var pc={};Object.defineProperty(pc,"__esModule",{value:!0});pc.canDragX=AUt;pc.canDragY=RUt;pc.createCoreData=DUt;pc.createDraggableData=LUt;pc.getBoundPosition=MUt;pc.getControlPosition=IUt;pc.snapToGrid=kUt;var oa=hc,ug=Or;function MUt(t,e,n){if(!t.props.bounds)return[e,n];let{bounds:r}=t.props;r=typeof r=="string"?r:NUt(r);const i=E6(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,oa.int)(u.paddingLeft)+(0,oa.int)(c.marginLeft),top:-i.offsetTop+(0,oa.int)(u.paddingTop)+(0,oa.int)(c.marginTop),right:(0,ug.innerWidth)(l)-(0,ug.outerWidth)(i)-i.offsetLeft+(0,oa.int)(u.paddingRight)-(0,oa.int)(c.marginRight),bottom:(0,ug.innerHeight)(l)-(0,ug.outerHeight)(i)-i.offsetTop+(0,oa.int)(u.paddingBottom)-(0,oa.int)(c.marginBottom)}}return(0,oa.isNum)(r.right)&&(e=Math.min(e,r.right)),(0,oa.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,oa.isNum)(r.left)&&(e=Math.max(e,r.left)),(0,oa.isNum)(r.top)&&(n=Math.max(n,r.top)),[e,n]}function kUt(t,e,n){const r=Math.round(e/t[0])*t[0],i=Math.round(n/t[1])*t[1];return[r,i]}function AUt(t){return t.props.axis==="both"||t.props.axis==="x"}function RUt(t){return t.props.axis==="both"||t.props.axis==="y"}function IUt(t,e,n){const r=typeof e=="number"?(0,ug.getTouch)(t,e):null;if(typeof e=="number"&&!r)return null;const i=E6(n),o=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return(0,ug.offsetXYFromParent)(r||t,o,n.props.scale)}function DUt(t,e,n){const r=!(0,oa.isNum)(t.lastX),i=E6(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 LUt(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 NUt(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}}function E6(t){const e=t.findDOMNode();if(!e)throw new Error(": Unmounted during event!");return e}var zk={},Uk={};Object.defineProperty(Uk,"__esModule",{value:!0});Uk.default=$Ut;function $Ut(){}Object.defineProperty(zk,"__esModule",{value:!0});zk.default=void 0;var kD=jUt(M),bo=P6(p1),FUt=P6(qv),ji=Or,Xu=pc,AD=hc,K0=P6(Uk);function P6(t){return t&&t.__esModule?t:{default:t}}function r0e(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(r0e=function(r){return r?n:e})(t)}function jUt(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=r0e(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=BUt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function BUt(t){var e=zUt(t,"string");return typeof e=="symbol"?e:String(e)}function zUt(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 Ns={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let Qu=Ns.mouse,Wk=class extends kD.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,Xu.getControlPosition)(e,i,this);if(o==null)return;const{x:a,y:s}=o,l=(0,Xu.createCoreData)(this,a,s);(0,K0.default)("DraggableCore: handleDragStart: %j",l),(0,K0.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,Qu.move,this.handleDrag),(0,ji.addEvent)(r,Qu.stop,this.handleDragStop))}),ao(this,"handleDrag",e=>{const n=(0,Xu.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,Xu.snapToGrid)(this.props.grid,s,l),!s&&!l)return;r=this.lastX+s,i=this.lastY+l}const o=(0,Xu.createCoreData)(this,r,i);if((0,K0.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,Xu.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,Xu.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,i=this.lastY+c}const o=(0,Xu.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,K0.default)("DraggableCore: handleDragStop: %j",o),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,s&&((0,K0.default)("DraggableCore: Removing handlers"),(0,ji.removeEvent)(s.ownerDocument,Qu.move,this.handleDrag),(0,ji.removeEvent)(s.ownerDocument,Qu.stop,this.handleDragStop))}),ao(this,"onMouseDown",e=>(Qu=Ns.mouse,this.handleDragStart(e))),ao(this,"onMouseUp",e=>(Qu=Ns.mouse,this.handleDragStop(e))),ao(this,"onTouchStart",e=>(Qu=Ns.touch,this.handleDragStart(e))),ao(this,"onTouchEnd",e=>(Qu=Ns.touch,this.handleDragStop(e)))}componentDidMount(){this.mounted=!0;const e=this.findDOMNode();e&&(0,ji.addEvent)(e,Ns.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const e=this.findDOMNode();if(e){const{ownerDocument:n}=e;(0,ji.removeEvent)(n,Ns.mouse.move,this.handleDrag),(0,ji.removeEvent)(n,Ns.touch.move,this.handleDrag),(0,ji.removeEvent)(n,Ns.mouse.stop,this.handleDragStop),(0,ji.removeEvent)(n,Ns.touch.stop,this.handleDragStop),(0,ji.removeEvent)(e,Ns.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:FUt.default.findDOMNode(this)}render(){return kD.cloneElement(kD.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};zk.default=Wk;ao(Wk,"displayName","DraggableCore");ao(Wk,"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:AD.dontSetMe,style:AD.dontSetMe,transform:AD.dontSetMe});ao(Wk,"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(p1),r=u(qv),i=u(aUt),o=Or,a=pc,s=hc,l=u(zk),c=u(Uk);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(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,U=k||S,W={x:(0,a.canDragX)(this)&&B?this.state.x:U.x,y:(0,a.canDragY)(this)&&B?this.state.y:U.y};this.state.isElementSVG?L=(0,o.createSVGTransform)(W,I):T=(0,o.createCSSTransform)(W,I);const $=(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:$,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})})(Qye);const{default:i0e,DraggableCore:UUt}=Qye;Bk.exports=i0e;Bk.exports.default=i0e;Bk.exports.DraggableCore=UUt;var o0e=Bk.exports;const WUt=$t(o0e);var M6={exports:{}},jw={},k6={};k6.__esModule=!0;k6.cloneElement=QUt;var VUt=GUt(M);function GUt(t){return t&&t.__esModule?t:{default:t}}function DJ(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 LJ(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function NJ(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 RD(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 Z0.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=RD({ref:o},s?{}:{handleAxis:i});return Z0.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=r6t(o,t6t);return(0,JUt.cloneElement)(a,RD(RD({},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]=Z0.createRef();return Z0.createElement(ZUt.DraggableCore,AF({},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}(Z0.Component);jw.default=A6;A6.propTypes=e6t.resizableProps;A6.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var Vk={};Vk.__esModule=!0;Vk.default=void 0;var ID=d6t(M),l6t=s0e(p1),c6t=s0e(jw),u6t=Bw,f6t=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function s0e(t){return t&&t.__esModule?t:{default:t}}function l0e(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(l0e=function(i){return i?n:e})(t)}function d6t(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=l0e(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 IF(){return IF=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function v6t(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,DF(t,e)}function DF(t,e){return DF=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},DF(t,e)}var c0e=function(t){v6t(e,t);function e(){for(var r,i=arguments.length,o=new Array(i),a=0;an(t,!i.visible)}),r?w.jsx(ep,{}):w.jsx(ep,{variant:"inset",component:"li",style:{margin:"0 0 0 52px"}})]})}const w6t={x:48,y:128},S6t={width:320,height:520},aC={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 O6t(t){const[e,n]=M.useState(w6t),[r,i]=M.useState(S6t),{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(WUt,{handle:"#layer-select-header",position:e,onStop:d,children:w.jsx(y6t,{width:r.width,height:r.height,style:aC.resizeBox,onResize:h,children:w.jsxs(Ho,{elevation:10,sx:aC.windowPaper,component:"div",children:[w.jsxs(Ke,{id:"layer-select-header",sx:aC.windowHeader,children:[w.jsx(Ke,{component:"span",sx:aC.windowTitle,children:fe.get("Layers")}),w.jsx(Ot,{size:"small",onClick:f,children:w.jsx($p,{fontSize:"inherit"})})]}),w.jsx(Ke,{sx:{width:"100%",overflow:"auto",flexGrow:1},children:w.jsxs(Jre,{dense:!0,children:[w.jsx(Cc,{layerId:"overlay",...l}),w.jsx(Cc,{layerId:"userPlaces",...l}),w.jsx(Cc,{layerId:"datasetPlaces",...l}),w.jsx(Cc,{layerId:"datasetBoundary",...l}),w.jsx(Cc,{layerId:"datasetVariable",...l}),w.jsx(Cc,{layerId:"datasetVariable2",...l}),w.jsx(Cc,{layerId:"datasetRgb",...l}),w.jsx(Cc,{layerId:"datasetRgb2",...l}),w.jsx(Cc,{layerId:"baseMap",...l,last:!0}),w.jsx(jr,{onClick:u,children:fe.get("User Base Maps")+"..."}),w.jsx(jr,{onClick:c,children:fe.get("User Overlays")+"..."})]})})]})})})}const C6t=t=>({locale:t.controlState.locale,layerMenuOpen:t.controlState.layerMenuOpen,layerStates:PVe(t)}),T6t={openDialog:Lp,setLayerMenuOpen:Ple,setLayerVisibility:P8e},E6t=Jt(C6t,T6t)(O6t),P6t=t=>({locale:t.controlState.locale,hasConsent:t.controlState.privacyNoticeAccepted,compact:Kt.instance.branding.compact}),M6t={},k6t=we("main")(({theme:t})=>({padding:0,width:"100vw",height:"100vh",overflow:"hidden",display:"flex",flexDirection:"column",alignItems:"stretch",[t.breakpoints.up("md")]:{overflow:"hidden"}})),A6t=({hasConsent:t,compact:e})=>w.jsxs(k6t,{children:[!e&&w.jsx(n2,{variant:"dense"}),t&&w.jsxs(w.Fragment,{children:[w.jsx(ftt,{}),w.jsx(iUt,{}),w.jsx(E6t,{})]})]}),R6t=Jt(P6t,M6t)(A6t),I6t={icon:t=>({marginRight:t.spacing(2)})};function D6t({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(rl,{open:t,disableEscapeKeyDown:!0,keepMounted:!0,scroll:"body",children:[w.jsx(vd,{children:fe.get("Privacy Notice")}),w.jsx(Ys,{children:w.jsx(R2e,{children:i===null?w.jsx(ey,{}):w.jsx(G2,{children:i,linkTarget:"_blank"})})}),w.jsxs(Tp,{children:[w.jsxs(tr,{onClick:a,children:[w.jsx(I6,{sx:I6t.icon}),fe.get("Accept and continue")]}),w.jsx(tr,{onClick:s,children:fe.get("Leave")})]})]})}const L6t=t=>({open:!t.controlState.privacyNoticeAccepted,settings:t.controlState}),N6t={updateSettings:ow,syncWithServer:rz},$6t=Jt(L6t,N6t)(D6t),F6t=Li(ey)(({theme:t})=>({margin:t.spacing(2)})),j6t=Li(At)(({theme:t})=>({margin:t.spacing(1)})),B6t=Li("div")(({theme:t})=>({margin:t.spacing(1),textAlign:"center",display:"flex",alignItems:"center",flexDirection:"column"}));function z6t({messages:t}){return t.length===0?null:w.jsxs(rl,{open:!0,"aria-labelledby":"loading",children:[w.jsx(vd,{id:"loading",children:fe.get("Please wait...")}),w.jsxs(B6t,{children:[w.jsx(F6t,{}),t.map((e,n)=>w.jsx(j6t,{children:e},n))]})]})}const U6t=t=>({locale:t.controlState.locale,messages:SVe(t)}),W6t={},V6t=Jt(U6t,W6t)(z6t);var D6={},G6t=ft;Object.defineProperty(D6,"__esModule",{value:!0});var f0e=D6.default=void 0,H6t=G6t(pt()),q6t=w;f0e=D6.default=(0,H6t.default)((0,q6t.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 L6={},X6t=ft;Object.defineProperty(L6,"__esModule",{value:!0});var d0e=L6.default=void 0,Q6t=X6t(pt()),Y6t=w;d0e=L6.default=(0,Q6t.default)((0,Y6t.jsx)("path",{d:"M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z"}),"Warning");var N6={},K6t=ft;Object.defineProperty(N6,"__esModule",{value:!0});var h0e=N6.default=void 0,Z6t=K6t(pt()),J6t=w;h0e=N6.default=(0,Z6t.default)((0,J6t.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 eWt={success:h0e,warning:d0e,error:f0e,info:f4},tWt=Li("span")(()=>({display:"flex",alignItems:"center"})),sC={close:{p:.5},success:t=>({color:t.palette.error.contrastText,backgroundColor:Lc[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:vne[700]}),icon:{fontSize:20},iconVariant:t=>({opacity:.9,marginRight:t.spacing(1),fontSize:20}),message:{display:"flex",alignItems:"center"}},nWt={vertical:"bottom",horizontal:"center"};function rWt({className:t,message:e,hideMessage:n}){const r=()=>{n(e.id)};if(!e)return null;const i=eWt[e.type];return w.jsx(dIe,{open:!0,anchorOrigin:nWt,autoHideDuration:5e3,onClose:r,children:w.jsx(oie,{sx:sC[e.type],className:t,"aria-describedby":"client-snackbar",message:w.jsxs(tWt,{id:"client-snackbar",children:[w.jsx(i,{sx:sC.iconVariant}),e.text]}),action:[w.jsx(Ot,{"aria-label":"Close",color:"inherit",sx:sC.close,onClick:r,size:"large",children:w.jsx($p,{sx:sC.icon})},"close")]})},e.type+":"+e.text)}const iWt=t=>{const e=t.messageLogState.newEntries;return{locale:t.controlState.locale,message:e.length>0?e[0]:null}},oWt={hideMessage:AVe},aWt=Jt(iWt,oWt)(rWt);var $6={},sWt=ft;Object.defineProperty($6,"__esModule",{value:!0});var NP=$6.default=void 0,lWt=sWt(pt()),cWt=w;NP=$6.default=(0,lWt.default)((0,cWt.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add");var F6={},uWt=ft;Object.defineProperty(F6,"__esModule",{value:!0});var j6=F6.default=void 0,fWt=uWt(pt()),dWt=w;j6=F6.default=(0,fWt.default)((0,dWt.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 Rm={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 hWt({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 U=B.target.value,W=a.find($=>$.id===U);c(W)},g=B=>{const U=B.target.value,W={...l,name:U};c(W)},v=B=>{const U=B.target.value,W={...l,url:U};c(W)},y=()=>{f("add")},x=()=>{f("edit")},b=()=>{P()},_=()=>{r("server")},S=()=>{const B=l.id;return a.findIndex(U=>U.id===B)},O=(B,U)=>{const W=[...a];W[B]=U,s(W),c(U),f("select")},C=(B,U)=>{s(B),c(U),f("select")},E=()=>{const B={...l,id:Js("server-")},U=[...a,B];C(U,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 U=S(),W=B[U+(U>0?-1:1)];B.splice(U,1),C(B,W)},R=a.map((B,U)=>w.jsx(jr,{value:B.id,children:B.name},U));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(Ys,{dividers:!0,children:[w.jsx(cr,{variant:"standard",required:!0,id:"server-name",label:"Name",sx:Rm.textField,margin:"normal",value:l.name,onChange:g}),w.jsx("br",{}),w.jsx(cr,{variant:"standard",required:!0,id:"server-url",label:"URL",sx:Rm.textField2,margin:"normal",value:l.url,onChange:v})]}):z=w.jsx(Ys,{dividers:!0,children:w.jsxs("div",{children:[w.jsxs(ty,{variant:"standard",sx:Rm.formControl,children:[w.jsx(ny,{htmlFor:"server-name",children:"Name"}),w.jsx(xd,{variant:"standard",value:l.id,onChange:m,inputProps:{name:"server-name",id:"server-name"},children:R}),w.jsx(qre,{children:l.url})]}),w.jsx(Ot,{sx:Rm.button,"aria-label":"Add",color:"primary",onClick:y,size:"large",children:w.jsx(NP,{fontSize:"small"})}),w.jsx(Ot,{sx:Rm.button,"aria-label":"Edit",onClick:x,size:"large",children:w.jsx(Fp,{fontSize:"small"})}),w.jsx(Ot,{sx:Rm.button,"aria-label":"Delete",disabled:a.length<2,onClick:b,size:"large",children:w.jsx(j6,{fontSize:"small"})})]})}),w.jsxs(rl,{open:t,onClose:p,"aria-labelledby":"server-dialog-title",children:[w.jsx(vd,{id:"server-dialog-title",children:L}),z,w.jsxs(Tp,{children:[w.jsx(tr,{onClick:h,children:fe.get("Cancel")}),w.jsx(tr,{onClick:d,autoFocus:!0,children:T})]})]})}const pWt=t=>({open:!!t.controlState.dialogOpen.server,servers:Dae(t),selectedServer:pi(t)}),mWt={closeDialog:Oy,configureServers:l8e},gWt=Jt(pWt,mWt)(hWt),FJ=({anchorElement:t,layers:e,selectedLayerId:n,setSelectedLayerId:r,onClose:i})=>w.jsx(Pp,{anchorEl:t,keepMounted:!0,open:!!t,onClose:i,children:t&&e.map(o=>w.jsx(jr,{selected:o.id===n,onClick:()=>r(o.id===n?null:o.id),dense:!0,children:w.jsx(ts,{primary:tE(o)})},o.id))}),DD={settingsPanelTitle:t=>({marginBottom:t.spacing(1)}),settingsPanelPaper:t=>({backgroundColor:(t.palette.mode==="dark"?tre:ere)(t.palette.background.paper,.1),marginBottom:t.spacing(2)}),settingsPanelList:{margin:0}},Gm=({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(ts,{primary:t,secondary:e});let a;return r&&(a=w.jsx(Nb,{children:r})),n?w.jsxs(Yre,{style:i,onClick:n,children:[o,a]}):w.jsxs(Wx,{style:i,children:[o,a]})},kf=({propertyName:t,settings:e,updateSettings:n,disabled:r})=>w.jsx(aie,{checked:!!e[t],onChange:()=>n({...e,[t]:!e[t]}),disabled:r}),vWt=({propertyName:t,settings:e,updateSettings:n,options:r,disabled:i})=>{const o=(a,s)=>{n({...e,[t]:s})};return w.jsx(E5,{row:!0,value:e[t],onChange:o,children:r.map(([a,s])=>w.jsx(Og,{control:w.jsx(Vx,{}),value:s,label:a,disabled:i},a))})},J0={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}},jJ=[["doNothing","Do nothing"],["pan","Pan"],["panAndZoom","Pan and zoom"]],yWt=[["point","Points"],["line","Lines"],["bar","Bars"]],xWt=({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(jr,{selected:A===n.locale,onClick:()=>s(A),children:w.jsx(ts,{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=nE(i,n.selectedBaseMapId),B=tE(z);function U(A){g(A.currentTarget)}function W(){g(null)}const $=A=>{A.stopPropagation(),l("userOverlays")},N=nE(o,n.selectedOverlayId),D=tE(N);return w.jsxs("div",{children:[w.jsxs(rl,{open:t,fullWidth:!0,maxWidth:"sm",onClose:x,scroll:"body",children:[w.jsx(vd,{children:fe.get("Settings")}),w.jsxs(Ys,{children:[w.jsxs(Gm,{title:fe.get("General"),children:[w.jsx(pr,{label:fe.get("Server"),value:r.name,onClick:b}),w.jsx(pr,{label:fe.get("Language"),value:fe.languages[n.locale],onClick:I}),w.jsx(pr,{label:fe.get("Time interval of the player"),children:w.jsx(cr,{variant:"standard",select:!0,sx:J0.textField,value:n.timeAnimationInterval,onChange:_,margin:"normal",children:tWe.map((A,q)=>w.jsx(jr,{value:A,children:A+" ms"},q))})})]}),w.jsxs(Gm,{title:fe.get("Time-Series"),children:[w.jsx(pr,{label:fe.get("Show chart after adding a place"),value:lC(n.autoShowTimeSeries),children:w.jsx(kf,{propertyName:"autoShowTimeSeries",settings:n,updateSettings:a})}),w.jsx(pr,{label:fe.get("Default chart type"),children:w.jsx(cr,{variant:"standard",select:!0,sx:J0.textField,value:n.timeSeriesChartTypeDefault,onChange:S,margin:"normal",children:yWt.map(([A,q])=>w.jsx(jr,{value:A,children:fe.get(q)},A))})}),w.jsx(pr,{label:fe.get("Calculate standard deviation"),value:lC(n.timeSeriesIncludeStdev),children:w.jsx(kf,{propertyName:"timeSeriesIncludeStdev",settings:n,updateSettings:a})}),w.jsx(pr,{label:fe.get("Calculate median instead of mean (disables standard deviation)"),value:lC(n.timeSeriesUseMedian),children:w.jsx(kf,{propertyName:"timeSeriesUseMedian",settings:n,updateSettings:a})}),w.jsx(pr,{label:fe.get("Minimal number of data points in a time series update"),children:w.jsx(cr,{variant:"standard",sx:J0.intTextField,value:v,onChange:E,margin:"normal",size:"small"})})]}),w.jsxs(Gm,{title:fe.get("Map"),children:[w.jsx(pr,{label:fe.get("Base map"),value:B,onClick:R,children:w.jsx(tr,{onClick:L,children:fe.get("User Base Maps")+"..."})}),w.jsx(pr,{label:fe.get("Overlay"),value:D,onClick:U,children:w.jsx(tr,{onClick:$,children:fe.get("User Overlays")+"..."})}),w.jsx(pr,{label:fe.get("Projection"),children:w.jsx(vWt,{propertyName:"mapProjection",settings:n,updateSettings:a,options:[[fe.get("Geographic"),py],[fe.get("Mercator"),$B]]})}),w.jsx(pr,{label:fe.get("Image smoothing"),value:lC(n.imageSmoothingEnabled),children:w.jsx(kf,{propertyName:"imageSmoothingEnabled",settings:n,updateSettings:a})}),w.jsx(pr,{label:fe.get("On dataset selection"),children:w.jsx(cr,{variant:"standard",select:!0,sx:J0.textField,value:n.datasetLocateMode,onChange:O,margin:"normal",children:jJ.map(([A,q])=>w.jsx(jr,{value:A,children:fe.get(q)},A))})}),w.jsx(pr,{label:fe.get("On place selection"),children:w.jsx(cr,{variant:"standard",select:!0,sx:J0.textField,value:n.placeLocateMode,onChange:C,margin:"normal",children:jJ.map(([A,q])=>w.jsx(jr,{value:A,children:fe.get(q)},A))})})]}),w.jsx(Gm,{title:fe.get("Legal Agreement"),children:w.jsx(pr,{label:fe.get("Privacy notice"),value:n.privacyNoticeAccepted?fe.get("Accepted"):"",children:w.jsx(tr,{disabled:!n.privacyNoticeAccepted,onClick:()=>{a({privacyNoticeAccepted:!1}),window.location.reload()},children:fe.get("Revoke consent")})})}),w.jsxs(Gm,{title:fe.get("System Information"),children:[w.jsx(pr,{label:`xcube Viewer ${fe.get("version")}`,value:c}),w.jsx(pr,{label:`xcube Server ${fe.get("version")}`,value:u?u.version:fe.get("Cannot reach server")})]})]})]}),w.jsx(Pp,{anchorEl:f,keepMounted:!0,open:!!f,onClose:P,children:k}),w.jsx(FJ,{anchorElement:h,layers:i,selectedLayerId:n.selectedBaseMapId,setSelectedLayerId:A=>a({selectedBaseMapId:A}),onClose:T}),w.jsx(FJ,{anchorElement:m,layers:o,selectedLayerId:n.selectedOverlayId,setSelectedLayerId:A=>a({selectedOverlayId:A}),onClose:W})]})},lC=t=>t?fe.get("On"):fe.get("Off"),bWt="1.3.0",_Wt=t=>({locale:t.controlState.locale,open:t.controlState.dialogOpen.settings,settings:t.controlState,baseMapLayers:XB(t),overlayLayers:QB(t),selectedServer:pi(t),viewerVersion:bWt,serverInfo:t.dataState.serverInfo}),wWt={closeDialog:Oy,updateSettings:ow,changeLocale:jle,openDialog:Lp},SWt=Jt(_Wt,wWt)(xWt),BJ={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})},OWt=({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(rl,{open:t,fullWidth:!0,maxWidth:"xs",onClose:o,scroll:"body",children:[w.jsx(Ys,{children:w.jsxs(Gm,{title:fe.get("Export Settings"),children:[w.jsx(pr,{label:fe.get("Include time-series data")+" (*.txt)",value:cC(n.exportTimeSeries),children:w.jsx(kf,{propertyName:"exportTimeSeries",settings:n,updateSettings:r})}),w.jsx(pr,{label:fe.get("Separator for time-series data"),children:w.jsx(cr,{variant:"standard",sx:BJ.separatorTextField,value:n.exportTimeSeriesSeparator,onChange:s,disabled:!n.exportTimeSeries,margin:"normal",size:"small"})}),w.jsx(pr,{label:fe.get("Include places data")+" (*.geojson)",value:cC(n.exportPlaces),children:w.jsx(kf,{propertyName:"exportPlaces",settings:n,updateSettings:r})}),w.jsx(pr,{label:fe.get("Combine place data in one file"),value:cC(n.exportPlacesAsCollection),children:w.jsx(kf,{propertyName:"exportPlacesAsCollection",settings:n,updateSettings:r,disabled:!n.exportPlaces})}),w.jsx(pr,{label:fe.get("As ZIP archive"),value:cC(n.exportZipArchive),children:w.jsx(kf,{propertyName:"exportZipArchive",settings:n,updateSettings:r})}),w.jsx(pr,{label:fe.get("File name"),children:w.jsx(cr,{variant:"standard",sx:BJ.fileNameTextField,value:n.exportFileName,onChange:a,margin:"normal",size:"small"})})]})}),w.jsx(Tp,{children:w.jsx(tr,{onClick:l,disabled:!EWt(n),children:fe.get("Download")})})]})})},cC=t=>t?fe.get("On"):fe.get("Off"),CWt=t=>/^[0-9a-zA-Z_-]+$/.test(t),TWt=t=>t.toUpperCase()==="TAB"||t.length===1,EWt=t=>(t.exportTimeSeries||t.exportPlaces)&&CWt(t.exportFileName)&&(!t.exportTimeSeries||TWt(t.exportTimeSeriesSeparator)),PWt=t=>({locale:t.controlState.locale,open:!!t.controlState.dialogOpen.export,settings:t.controlState}),MWt={closeDialog:Oy,updateSettings:ow,downloadTimeSeries:g8e},kWt=Jt(PWt,MWt)(OWt);var B6={},AWt=ft;Object.defineProperty(B6,"__esModule",{value:!0});var p0e=B6.default=void 0,RWt=AWt(pt()),IWt=w;p0e=B6.default=(0,RWt.default)((0,IWt.jsx)("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore");var z6={},DWt=ft;Object.defineProperty(z6,"__esModule",{value:!0});var m0e=z6.default=void 0,LWt=DWt(pt()),NWt=w;m0e=z6.default=(0,LWt.default)((0,NWt.jsx)("path",{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}),"ExpandLess");const $Wt=({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(tr,{onClick:l,disabled:r,className:o,variant:"outlined",size:"small",children:t})]})},LD={parse:t=>t,format:t=>typeof t=="string"?t:`${t}`,validate:t=>!0};function U6(){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||LD.parse)(p);n({[r]:m})};return w.jsx(cr,{label:fe.get(i),value:(c||LD.format)(f),error:!(u||LD.validate)(f),onChange:d,style:o,className:a,disabled:s,size:"small",variant:"standard"})}}const ex=U6(),FWt=Li("div")(({theme:t})=>({paddingTop:t.spacing(2)})),jWt=({options:t,updateOptions:e})=>w.jsx(FWt,{children:w.jsxs("div",{style:{display:"grid",gap:12,paddingTop:12,gridTemplateColumns:"auto auto"},children:[w.jsx(ex,{optionKey:"timeNames",label:"Time property names",options:t,updateOptions:e}),w.jsx("div",{id:"spareField"}),w.jsx(ex,{label:"Group property names",optionKey:"groupNames",options:t,updateOptions:e}),w.jsx(ex,{label:"Group prefix (used as fallback)",optionKey:"groupPrefix",options:t,updateOptions:e}),w.jsx(ex,{label:"Label property names",optionKey:"labelNames",options:t,updateOptions:e}),w.jsx(ex,{label:"Label prefix (used as fallback)",optionKey:"labelPrefix",options:t,updateOptions:e})]})}),io=U6(),BWt=Li("div")(({theme:t})=>({paddingTop:t.spacing(2)})),zWt=({options:t,updateOptions:e})=>{const n=t.forceGeometry;return w.jsxs(BWt,{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(UL,{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(UL,{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})]})]})},tx=U6(),UWt=Li("div")(({theme:t})=>({paddingTop:t.spacing(2)})),WWt=({options:t,updateOptions:e})=>w.jsx(UWt,{children:w.jsxs("div",{style:{display:"grid",gap:12,paddingTop:12,gridTemplateColumns:"auto auto"},children:[w.jsx(tx,{optionKey:"time",label:"Time (UTC, ISO-format)",options:t,updateOptions:e}),w.jsx("div",{id:"spareField"}),w.jsx(tx,{label:"Group",options:t,optionKey:"group",updateOptions:e}),w.jsx(tx,{label:"Group prefix (used as fallback)",optionKey:"groupPrefix",options:t,updateOptions:e,disabled:t.group.trim()!==""}),w.jsx(tx,{label:"Label",optionKey:"label",options:t,updateOptions:e}),w.jsx(tx,{label:"Label prefix (used as fallback)",optionKey:"labelPrefix",options:t,updateOptions:e,disabled:t.label.trim()!==""})]})}),ND={csv:{...qae,codeExt:[]},geojson:{...Xae,codeExt:[Spe()]},wkt:{...Qae,codeExt:[]}},$D={spacer:{flexGrow:1},actionButton:t=>({marginRight:t.spacing(1)}),error:{fontSize:"small"}},VWt=Li("div")(({theme:t})=>({paddingTop:t.spacing(.5),display:"flex",flexDirection:"row",alignItems:"center"})),GWt=Li($Wt)(({theme:t})=>({marginRight:t.spacing(1)})),HWt=({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 U=new FileReader;U.onloadend=()=>{const W=U.result;v(gH(W)),c(W),h(!1)},U.onabort=U.onerror=()=>{h(!1)},U.readAsText(B,"UTF-8")},C=()=>{c("")},E=()=>{console.info("PASTE!",l)},k=z=>{let B=g;l===""&&z.length>10&&(B=gH(z),v(B)),c(z),f(ND[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(zWt,{options:y.csv,updateOptions:P}):g==="geojson"?L=w.jsx(jWt,{options:y.geojson,updateOptions:R}):L=w.jsx(WWt,{options:y.wkt,updateOptions:T}),w.jsxs(rl,{fullWidth:!0,open:t,onClose:_,"aria-labelledby":"server-dialog-title",children:[w.jsx(vd,{id:"server-dialog-title",children:fe.get("Import places")}),w.jsxs(Ys,{dividers:!0,children:[w.jsxs(E5,{row:!0,value:g,onChange:z=>I(z),children:[w.jsx(Og,{value:"csv",label:fe.get(qae.name),control:w.jsx(Vx,{})},"csv"),w.jsx(Og,{value:"geojson",label:fe.get(Xae.name),control:w.jsx(Vx,{})},"geojson"),w.jsx(Og,{value:"wkt",label:fe.get(Qae.name),control:w.jsx(Vx,{})},"wkt")]}),w.jsx(ik,{theme:Kt.instance.branding.themeName||"light",placeholder:fe.get("Enter text or drag & drop a text file."),autoFocus:!0,height:"400px",extensions:ND[g].codeExt,value:l,onChange:k,onDrop:C,onPaste:E,onPasteCapture:E}),u&&w.jsx(At,{color:"error",sx:$D.error,children:u}),w.jsxs(VWt,{children:[w.jsx(GWt,{title:fe.get("From File")+"...",accept:ND[g].fileExt,multiple:!1,onSelect:O,disabled:d}),w.jsx(tr,{onClick:S,disabled:l.trim()===""||d,sx:$D.actionButton,variant:"outlined",size:"small",children:fe.get("Clear")}),w.jsx(Ke,{sx:$D.spacer}),w.jsx(tr,{onClick:()=>m(!p),endIcon:p?w.jsx(m0e,{}):w.jsx(p0e,{}),variant:"outlined",size:"small",children:fe.get("Options")})]}),w.jsx(d5,{in:p,timeout:"auto",unmountOnExit:!0,children:L})]}),w.jsxs(Tp,{children:[w.jsx(tr,{onClick:_,variant:"text",children:fe.get("Cancel")}),w.jsx(tr,{onClick:b,disabled:l.trim()===""||u!==null||d,variant:"text",children:fe.get("OK")})]})]})},qWt=t=>({open:t.controlState.dialogOpen.addUserPlacesFromText,userPlacesFormatName:t.controlState.userPlacesFormatName,userPlacesFormatOptions:t.controlState.userPlacesFormatOptions,nextMapInteraction:t.controlState.lastMapInteraction}),XWt={closeDialog:Oy,updateSettings:ow,setMapInteraction:Tle,addUserPlacesFromText:Vse},QWt=Jt(qWt,XWt)(HWt);var W6={},YWt=ft;Object.defineProperty(W6,"__esModule",{value:!0});var V6=W6.default=void 0,KWt=YWt(pt()),ZWt=w;V6=W6.default=(0,KWt.default)((0,ZWt.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 G6(t,e){return g0e(t,e,[]).join("")}function g0e(t,e,n){if(t.nodeType==Node.CDATA_SECTION_NODE||t.nodeType==Node.TEXT_NODE)n.push(t.nodeValue);else{var r=void 0;for(r=t.firstChild;r;r=r.nextSibling)g0e(r,e,n)}return n}function JWt(t){return"documentElement"in t}function eVt(t){return new DOMParser().parseFromString(t,"application/xml")}function v0e(t,e){return function(n,r){var i=t.call(this,n,r);if(i!==void 0){var o=r[r.length-1];o.push(i)}}}function sa(t,e,n){return function(r,i){var o=t.call(this,r,i);if(o!==void 0){var a=i[i.length-1],s=r.localName,l=void 0;s in a?l=a[s]:(l=[],a[s]=l),l.push(o)}}}function vt(t,e,n){return function(r,i){var o=t.call(this,r,i);if(o!==void 0){var a=i[i.length-1],s=r.localName;a[s]=o}}}function Ni(t,e,n){var r={},i,o;for(i=0,o=t.length;i{const n=e.Name,r=e.Title||n;let i;const o=e.Attribution;if(FP(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 WVt(t){const e=jVt.read(t);if(FP(e)){const n=e.Capability;if(FP(n))return LF(n,!0)}throw new Error("invalid WMSCapabilities object")}function LF(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=>LF(o)):FP(n)?i=LF(n):i=[{}],i.map(o=>VVt(r,o))}function VVt(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 FP(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}const GVt=({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(()=>{BVt(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:zB,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(cr,{required:!0,label:fe.get("WMS URL"),variant:"standard",size:"small",value:r,fullWidth:!0,onChange:f=>i(f.currentTarget.value)}),w.jsx(xd,{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(jr,{value:d,selected:s===d,children:w.jsx(ts,{primary:f.title})},f.name))}),w.jsx(hw,{onDone:u,onCancel:n,doneDisabled:!c(),helpUrl:fe.get("docs/add-layer-wms.en.md")})]})},HVt=({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:zB,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(cr,{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(cr,{required:!0,label:fe.get("Layer Title"),variant:"standard",size:"small",sx:{flexGrow:.3},value:r,onChange:d=>i(d.currentTarget.value)}),w.jsx(cr,{label:fe.get("Layer Attribution"),variant:"standard",size:"small",sx:{flexGrow:.7},value:s,onChange:d=>l(d.currentTarget.value)})]}),w.jsx(hw,{onDone:f,onCancel:n,doneDisabled:!u(),helpUrl:fe.get("docs/add-layer-xyz.en.md")})]})},qVt={paper:t=>({backgroundColor:(t.palette.mode==="dark"?tre:ere)(t.palette.background.paper,.1),marginBottom:t.spacing(2)})},zJ=({userLayers:t,setUserLayers:e,selectedId:n,setSelectedId:r})=>{const[i,o]=ue.useState(n),[a,s]=ue.useState(null),[l,c]=ife();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:Js("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=Js("user-layer-");e([...t,{id:b,group:zB,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(Ho,{sx:qVt.paper,children:w.jsxs(e2,{component:"nav",dense:!0,children:[t.map(x=>{const b=n===x.id;return a&&a.editId===x.id?x.wms?w.jsx(GVt,{userLayer:x,onChange:g,onCancel:v},x.id):w.jsx(HVt,{userLayer:x,onChange:g,onCancel:v},x.id):w.jsxs(Yre,{selected:b,onClick:()=>r(b?null:x.id),children:[w.jsx(ts,{primary:x.title,secondary:x.url}),w.jsxs(Nb,{children:[w.jsx(Ot,{onClick:()=>u(x),size:"small",disabled:y,children:w.jsx(Fp,{})}),w.jsx(Ot,{onClick:()=>f(x),size:"small",disabled:y,children:w.jsx(V6,{})}),w.jsx(Ot,{onClick:()=>d(x),size:"small",disabled:y,children:w.jsx($p,{})})]})]},x.id)}),!y&&w.jsx(Wx,{sx:{minHeight:"3em"},children:w.jsx(Nb,{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(tr,{onClick:p,startIcon:w.jsx(NP,{}),children:"WMS"})}),w.jsx(_t,{title:fe.get("Add layer from a Tiled Web Map"),children:w.jsx(tr,{onClick:m,startIcon:w.jsx(NP,{}),children:"XYZ"})})]})})})]})})},XVt=({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(rl,{open:e,fullWidth:!0,maxWidth:"sm",onClose:m,scroll:"body",children:[w.jsx(vd,{children:fe.get("User Layers")}),w.jsxs(Ys,{children:[w.jsx(Ke,{sx:{borderBottom:1,borderColor:"divider"},children:w.jsxs(A5,{value:o,onChange:(g,v)=>a(v),children:[w.jsx($b,{label:"Base Maps"}),w.jsx($b,{label:"Overlays"})]})}),o===0&&w.jsx(zJ,{userLayers:s,setUserLayers:l,selectedId:f,setSelectedId:d},"baseMaps"),o===1&&w.jsx(zJ,{userLayers:c,setUserLayers:u,selectedId:h,setSelectedId:p},"overlays")]})]})},QVt=(t,e)=>({open:t.controlState.dialogOpen[e.dialogId],settings:t.controlState,dialogId:e.dialogId}),YVt={closeDialog:Oy,updateSettings:ow},UJ=Jt(QVt,YVt)(XVt);function w0e({selected:t,title:e,actions:n}){return w.jsxs(n2,{sx:{pl:{sm:2},pr:{xs:1,sm:1},...t&&{background:r=>Hc(r.palette.primary.main,r.palette.action.activatedOpacity)}},children:[w.jsx(aE,{}),w.jsx(At,{sx:{flex:"1 1 100%",paddingLeft:1},children:e}),n]})}const KVt={container:{display:"flex",flexDirection:"column",height:"100%"},tableContainer:{overflowY:"auto",flexGrow:1}};function ZVt({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:Wqe()})},c=()=>{const d=t[n];e([...t.slice(0,n+1),Vqe(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(w0e,{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(dw,{})})}),a&&w.jsx(_t,{title:fe.get("Duplicate user variable"),children:w.jsx(Ot,{onClick:c,children:w.jsx(V6,{})})}),a&&w.jsx(_t,{title:fe.get("Edit user variable"),children:w.jsx(Ot,{onClick:u,children:w.jsx(Fp,{})})}),a&&w.jsx(_t,{title:fe.get("Remove user variable"),children:w.jsx(Ot,{onClick:f,children:w.jsx(j6,{})})})]})}),w.jsx(lie,{sx:KVt.tableContainer,children:w.jsxs(M5,{size:"small",children:[w.jsx(tDe,{children:w.jsxs(vl,{children:[w.jsx(sr,{sx:{width:"15%"},children:fe.get("Name")}),w.jsx(sr,{sx:{width:"15%"},children:fe.get("Title")}),w.jsx(sr,{sx:{width:"10%"},children:fe.get("Units")}),w.jsx(sr,{children:fe.get("Expression")})]})}),w.jsx(k5,{children:t.map((d,h)=>w.jsxs(vl,{hover:!0,selected:h===n,onClick:()=>s(h),children:[w.jsx(sr,{component:"th",scope:"row",children:d.name}),w.jsx(sr,{children:d.title}),w.jsx(sr,{children:d.units}),w.jsx(sr,{children:d.expression||""})]},d.id))})]})})]})}var q6={},JVt=ft;Object.defineProperty(q6,"__esModule",{value:!0});var S0e=q6.default=void 0,e8t=JVt(pt()),t8t=w;S0e=q6.default=(0,e8t.default)((0,t8t.jsx)("path",{d:"M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z"}),"FilterList");const n8t=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/;function r8t(t){return n8t.test(t)}const WJ={expressionPart:{padding:.2},expressionPartChip:{fontFamily:"monospace"}};function VJ({part:t,partType:e,onPartClicked:n}){return w.jsx(Ke,{component:"span",sx:WJ.expressionPart,children:w.jsx(OPe,{label:t,sx:WJ.expressionPartChip,size:"small",variant:"outlined",color:e==="variables"||e==="constants"?"default":e.includes("Functions")?"primary":"secondary",onClick:()=>n(t)})})}function i8t({anchorEl:t,exprPartTypes:e,setExprPartTypes:n,onClose:r}){const i=o=>{n({...e,[o]:!e[o]})};return w.jsx(Pp,{open:!!t,anchorEl:t,onClose:r,children:Fce.map(o=>w.jsx(u0e,{selected:e[o],title:fe.get(Hqe[o]),onClick:()=>i(o),dense:!0},o))})}function o8t({expression:t,onExpressionChange:e,variableNames:n,expressionCapabilities:r,handleInsertPartRef:i}){const o=hd(),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(ik,{theme:o.palette.mode||"none",width:"100%",height:"100px",placeholder:fe.get("Use keys CTRL+SPACE to show autocompletions"),extensions:[vpe({override:[l]})],value:t,onChange:e,ref:a})}async function a8t(t,e,n){if(n.trim()==="")return fe.get("Must not be empty");const r=`${t}/expressions/validate/${ly(e)}/${encodeURIComponent(n)}`;try{return await ooe(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 uC={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 s8t({userVariables:t,setUserVariables:e,editedVariable:n,setEditedVariable:r,contextDataset:i,expressionCapabilities:o,serverUrl:a}){const[s,l]=M.useState(Gqe),[c,u]=M.useState(null),f=[...t,...i.variables],d=i.variables.filter(D=>!V1(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=!r8t(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(()=>{a8t(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)},U=D=>{k.current(D)},W=D=>{u(D.currentTarget)},$=()=>{u(null)},N=[w.jsx(Ot,{size:"small",onClick:W,children:w.jsx(_t,{arrow:!0,title:fe.get("Display further elements to be used in expressions"),children:w.jsx(S0e,{})})},"filter")];return Fce.forEach(D=>{s[D]&&(D==="variables"?d.forEach(A=>{N.push(w.jsx(VJ,{part:A,partType:D,onPartClicked:U},`${D}-${A}`))}):o.namespace[D].forEach(A=>{N.push(w.jsx(VJ,{part:A,partType:D,onPartClicked:U},`${D}-${A}`))}))}),w.jsxs(w.Fragment,{children:[w.jsx(i8t,{anchorEl:c,exprPartTypes:s,setExprPartTypes:l,onClose:$}),w.jsx(w0e,{selected:!0,title:n.editMode==="add"?fe.get("Add user variable"):fe.get("Edit user variable"),actions:w.jsx(hw,{size:"medium",onDone:P,doneDisabled:!E,onCancel:R})}),w.jsxs(Ke,{sx:uC.content,children:[w.jsxs(Ke,{sx:uC.propertiesRow,children:[w.jsx(cr,{sx:{flexGrow:.3},error:!_,helperText:b,size:"small",variant:"standard",label:fe.get("Name"),value:p,onChange:T}),w.jsx(cr,{sx:{flexGrow:.6},size:"small",variant:"standard",label:fe.get("Title"),value:m,onChange:L}),w.jsx(cr,{sx:{flexGrow:.1},size:"small",variant:"standard",label:fe.get("Units"),value:g,onChange:z})]}),w.jsxs(Ke,{sx:uC.expressionRow,children:[w.jsx(At,{sx:D=>({paddingBottom:1,color:D.palette.text.secondary}),children:fe.get("Expression")}),w.jsx(o8t,{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:uC.expressionParts,children:N})]})]})]})}const GJ={dialogContent:{height:420},dialogActions:{display:"flex",justifyContent:"space-between",gap:.2}};function l8t({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(lE),f>=0&&i(c[f].name)}function g(){u(o),e(lE)}return w.jsxs(rl,{open:t,fullWidth:!0,maxWidth:"md",onClose:g,scroll:"body",children:[w.jsx(vd,{children:fe.get("User Variables")}),w.jsx(Ys,{dividers:!0,sx:GJ.dialogContent,children:h===null?w.jsx(ZVt,{userVariables:c,setUserVariables:u,selectedIndex:f,setSelectedIndex:d,setEditedVariable:p}):w.jsx(s8t,{userVariables:c,setUserVariables:u,editedVariable:h,setEditedVariable:p,contextDataset:n,expressionCapabilities:s,serverUrl:l})}),w.jsxs(Tp,{sx:GJ.dialogActions,children:[w.jsx(Ke,{children:w.jsx(sfe,{size:"medium",helpUrl:fe.get("docs/user-variables.en.md")})}),w.jsxs(Ke,{children:[w.jsx(tr,{onClick:g,children:fe.get("Cancel")}),w.jsx(tr,{onClick:m,disabled:h!==null||!c8t(c),children:fe.get("OK")})]})]})]})}function c8t(t){const e=new Set;return t.forEach(n=>e.add(n.name)),e.size===t.length}const u8t=t=>({open:t.controlState.dialogOpen[lE],selectedDataset:qr(t),selectedVariableName:yy(t),userVariables:jWe(t),expressionCapabilities:a6e(t),serverUrl:pi(t).url}),f8t={closeDialog:Oy,selectVariable:xle,updateDatasetUserVariables:WVe},d8t=Jt(u8t,f8t)(l8t),h8t=t=>({compact:Kt.instance.branding.compact}),p8t={},m8t=()=>o5({typography:{fontSize:12,htmlFontSize:14},palette:{mode:Kt.instance.branding.themeName,primary:Kt.instance.branding.primaryColor,secondary:Kt.instance.branding.secondaryColor}}),g8t=({compact:t})=>w.jsx(f3e,{children:w.jsx(Lne,{injectFirst:!0,children:w.jsxs(oCe,{theme:m8t(),children:[w.jsx(o2e,{}),!t&&w.jsx(bqe,{}),w.jsx(R6t,{}),w.jsxs(w.Fragment,{children:[w.jsx(V6t,{}),w.jsx(gWt,{}),w.jsx(SWt,{}),w.jsx(UJ,{dialogId:"userOverlays"},"userOverlays"),w.jsx(UJ,{dialogId:"userBaseMaps"},"userBaseMaps"),w.jsx(d8t,{}),w.jsx(QWt,{}),w.jsx(kWt,{}),w.jsx($6t,{}),w.jsx(aWt,{})]})]})})}),v8t=Jt(h8t,p8t)(g8t);function y8t(t,e,n){switch(t===void 0&&(t=rWe()),e.type){case lz:{const r={...t,...e.settings};return ll(r),r}case Ule:return ll(t),t;case Yb:{let r=t.selectedDatasetId||hf.get("dataset"),i=t.selectedVariableName||hf.get("variable"),o=t.mapInteraction,a=Ub(e.datasets,r);const s=a&&s3(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 lle:{let r=t.selectedVariableName;const i=Ub(e.datasets,e.selectedDatasetId);!s3(i,r)&&i.variables.length>0&&(r=i.variables[0].name);const a=e.selectedDatasetId,s=coe(i),l=s?s[1]:null;return{...t,selectedDatasetId:a,selectedVariableName:r,selectedTimeRange:s,selectedTime:l}}case dle:{const{location:r}=e;return t.flyTo!==r?{...t,flyTo:r}:t}case hle:{const r=e.selectedPlaceGroupIds;return{...t,selectedPlaceGroupIds:r,selectedPlaceId:null}}case ple:{const{placeId:r}=e;return{...t,selectedPlaceId:r}}case yle:return{...t,selectedVariableName:e.selectedVariableName};case mle:return{...t,layerVisibilities:{...t.layerVisibilities,[e.layerId]:e.visible}};case gle:{const{mapPointInfoBoxEnabled:r}=e;return{...t,mapPointInfoBoxEnabled:r}}case vle:{const{variableCompareMode:r}=e;return{...t,variableCompareMode:r,variableSplitPos:void 0}}case iz:{const{variableSplitPos:r}=e;return{...t,variableSplitPos:r}}case _le:{let{selectedTime:r}=e;if(r!==null&&n){const i=M3(n),o=i?uae(i,r):-1;o>=0&&(r=i[o])}return t.selectedTime!==r?{...t,selectedTime:r}:t}case wle:{if(n){let r=Tse(n);if(r>=0){const i=M3(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 oz:return{...t,selectedTimeRange:e.selectedTimeRange};case D8e:return{...t,timeSeriesUpdateMode:e.timeSeriesUpdateMode};case Ole:return{...t,timeAnimationActive:e.timeAnimationActive,timeAnimationInterval:e.timeAnimationInterval};case ZB:{const{id:r,selected:i}=e;return i?x8t(t,Ws,r):t}case JB:{const{placeGroups:r}=e;return r.length>0?{...t,selectedPlaceGroupIds:[...t.selectedPlaceGroupIds||[],r[0].id]}:t}case ez:{const{placeGroupId:r,newName:i}=e;return r===Ws?{...t,userDrawnPlaceGroupName:i}:t}case tz:{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 Gle:{const r=e.colorBarId;return{...t,userColorBars:[{id:r,type:"continuous",code:hoe},...t.userColorBars]}}case Hle:{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 ll(o),o}return t}case Qle:{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 Cle:{let r={...t,mapInteraction:e.mapInteraction,lastMapInteraction:t.mapInteraction};return e.mapInteraction==="Geometry"&&(r={...r,dialogOpen:{...t.dialogOpen,addUserPlacesFromText:!0}}),r}case Ele:{const{layerMenuOpen:r}=e;return t={...t,layerMenuOpen:r},ll(t),t}case Mle:{const{sidebarPosition:r}=e;return t={...t,sidebarPosition:r},t}case kle:{const{sidebarOpen:r}=e;return t={...t,sidebarOpen:r},ll(t),t}case Ale:{const{sidebarPanelId:r}=e;return t={...t,sidebarPanelId:r},ll(t),t}case Rle:return t={...t,volumeRenderMode:e.volumeRenderMode},ll(t),t;case Ile:{const{volumeId:r,volumeState:i}=e;return t={...t,volumeStates:{...t.volumeStates,[r]:i}},t}case Dle:{const r={...t.infoCardElementStates};return Object.getOwnPropertyNames(r).forEach(i=>{r[i]={...r[i],visible:e.visibleElements.includes(i)}}),t={...t,infoCardElementStates:r},ll(t),t}case Lle:{const{elementType:r,viewMode:i}=e,o={...t,infoCardElementStates:{...t.infoCardElementStates,[r]:{...t.infoCardElementStates[r],viewMode:i}}};return ll(o),o}case Nle:return{...t,activities:{...t.activities,[e.id]:e.message}};case $le:{const r={...t.activities};return delete r[e.id],{...t,activities:r}}case Fle:{const r=e.locale;return fe.locale=r,r!==t.locale&&(t={...t,locale:r},ll(t)),t}case Ble:{const r=e.dialogId;return{...t,dialogOpen:{...t.dialogOpen,[r]:!0}}}case zle:{const r=e.dialogId;return{...t,dialogOpen:{...t.dialogOpen,[r]:!1}}}case ble:{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 nz:if(t.selectedServerId!==e.selectedServerId)return{...t,selectedServerId:e.selectedServerId}}return t}function x8t(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 b8t(){const t=Q6e(),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 _8t(t,e){switch(t===void 0&&(t=b8t()),e.type){case iE:return{...t,serverInfo:e.serverInfo};case nle:return{...t,expressionCapabilities:e.expressionCapabilities};case Yb:return{...t,datasets:e.datasets};case Wse:{const{datasetId:n,userVariables:r}=e,i=t.datasets.findIndex(l=>l.id===n),o=t.datasets[i],[a,s]=gB(o);return{...t,datasets:[...t.datasets.slice(0,i),{...o,variables:[...a,...r]},...t.datasets.slice(i+1)]}}case ile:{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 HJ(t,n,r,l)}case ale:{const{datasetId:n,variableName:r,volumeRenderMode:i,volumeIsoThreshold:o}=e;return HJ(t,n,r,{volumeRenderMode:i,volumeIsoThreshold:o})}case KB:{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 ZB:{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===Ws);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:Ws,title:c,features:[a]},...s]}}}case JB:{const{placeGroups:n}=e;return{...t,userPlaceGroups:[...t.userPlaceGroups,...n]}}case ez:{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 Gse:{const{placeGroupId:n,placeId:r,newName:i}=e,o=t.userPlaceGroups,a=XJ(o,n,r,{label:i});return a?{...t,userPlaceGroups:a}:t}case Hse:{const{placeGroupId:n,placeId:r,placeStyle:i}=e,o=t.userPlaceGroups,a=XJ(o,n,r,i);return a?{...t,userPlaceGroups:a}:t}case tz:{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=qJ(t.timeSeriesGroups,[r]);let c=t.timeSeriesGroups;return l.forEach(u=>{c=BD(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 qse:{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=qJ(t.timeSeriesGroups,a);let l=t.timeSeriesGroups;return s.forEach(c=>{l=BD(l,c,"remove","append")}),{...t,userPlaceGroups:[...r.slice(0,i),...r.slice(i+1)],timeSeriesGroups:l}}return t}case rle:return{...t,colorBars:e.colorBars};case Zse:{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 Qse:{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 Yse:{const{index:n}=e,r=t.statistics,i=r.records;return{...t,statistics:{...r,records:[...i.slice(0,n),...i.slice(n+1)]}}}case Kse:{const{timeSeries:n,updateMode:r,dataMode:i}=e,o=BD(t.timeSeriesGroups,n,r,i);return o!==t.timeSeriesGroups?{...t,timeSeriesGroups:o}:t}case Jse:{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 ele:{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 tle:return{...t,timeSeriesGroups:[]};case oz:{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 nz:return t.userServers!==e.servers?(X6e(e.servers),{...t,userServers:e.servers}):t;default:return t}}function HJ(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 BD(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:Js("ts-"),variableUnits:i.source.variableUnits,timeSeriesArray:[i]}]:n==="add"?o=[{id:Js("ts-"),variableUnits:i.source.variableUnits,timeSeriesArray:[i]},...t]:o=t;return o}function qJ(t,e){const n=[];return t.forEach(r=>{r.timeSeriesArray.forEach(i=>{e.forEach(o=>{i.source.placeId===o&&n.push(i)})})}),n}function XJ(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 w8t(){return{newEntries:[],oldEntries:[]}}let S8t=0;function O8t(t,e){t===void 0&&(t=w8t());const n=t.newEntries;switch(e.type){case jse:{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:++S8t,type:r,text:i},{...t,newEntries:[o,...n]})}case Bse:{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 C8t(){return{accessToken:null}}function T8t(t,e){switch(t===void 0&&(t=C8t()),e.type){case Nce:return{...t,accessToken:e.accessToken}}return t}function E8t(t,e){return{dataState:_8t(t&&t.dataState,e),controlState:y8t(t&&t.controlState,e,t),messageLogState:O8t(t&&t.messageLogState,e),userAuthState:T8t(t&&t.userAuthState,e)}}Kt.load().then(()=>{const t=(o,a)=>a.type!==iz,e=K_e.createLogger({collapsed:!0,diff:!1,predicate:t}),n=Y_e(une,e),r=lne(E8t,n),i=r.dispatch;i(jle(r.getState().controlState.locale)),i(W8e()),r.getState().controlState.privacyNoticeAccepted&&i(rz()),qv.render(w.jsx(Gbe,{store:r,children:w.jsx(v8t,{})}),document.getElementById("root"))}); +`,t.getElementsByTagName("head")[0].appendChild(e)),t.body&&e0e(t.body,"react-draggable-transparent-selection")}function TUt(t){if(t)try{if(t.body&&t0e(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 e0e(t,e){t.classList?t.classList.add(e):t.className.match(new RegExp("(?:^|\\s)".concat(e,"(?!\\S)")))||(t.className+=" ".concat(e))}function t0e(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(new RegExp("(?:^|\\s)".concat(e,"(?!\\S)"),"g"),"")}var pc={};Object.defineProperty(pc,"__esModule",{value:!0});pc.canDragX=MUt;pc.canDragY=kUt;pc.createCoreData=RUt;pc.createDraggableData=IUt;pc.getBoundPosition=EUt;pc.getControlPosition=AUt;pc.snapToGrid=PUt;var oa=hc,ug=Or;function EUt(t,e,n){if(!t.props.bounds)return[e,n];let{bounds:r}=t.props;r=typeof r=="string"?r:DUt(r);const i=T6(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,oa.int)(u.paddingLeft)+(0,oa.int)(c.marginLeft),top:-i.offsetTop+(0,oa.int)(u.paddingTop)+(0,oa.int)(c.marginTop),right:(0,ug.innerWidth)(l)-(0,ug.outerWidth)(i)-i.offsetLeft+(0,oa.int)(u.paddingRight)-(0,oa.int)(c.marginRight),bottom:(0,ug.innerHeight)(l)-(0,ug.outerHeight)(i)-i.offsetTop+(0,oa.int)(u.paddingBottom)-(0,oa.int)(c.marginBottom)}}return(0,oa.isNum)(r.right)&&(e=Math.min(e,r.right)),(0,oa.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,oa.isNum)(r.left)&&(e=Math.max(e,r.left)),(0,oa.isNum)(r.top)&&(n=Math.max(n,r.top)),[e,n]}function PUt(t,e,n){const r=Math.round(e/t[0])*t[0],i=Math.round(n/t[1])*t[1];return[r,i]}function MUt(t){return t.props.axis==="both"||t.props.axis==="x"}function kUt(t){return t.props.axis==="both"||t.props.axis==="y"}function AUt(t,e,n){const r=typeof e=="number"?(0,ug.getTouch)(t,e):null;if(typeof e=="number"&&!r)return null;const i=T6(n),o=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return(0,ug.offsetXYFromParent)(r||t,o,n.props.scale)}function RUt(t,e,n){const r=!(0,oa.isNum)(t.lastX),i=T6(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 IUt(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 DUt(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}}function T6(t){const e=t.findDOMNode();if(!e)throw new Error(": Unmounted during event!");return e}var zk={},Uk={};Object.defineProperty(Uk,"__esModule",{value:!0});Uk.default=LUt;function LUt(){}Object.defineProperty(zk,"__esModule",{value:!0});zk.default=void 0;var MD=$Ut(M),bo=E6(h1),NUt=E6(qv),ji=Or,Xu=pc,kD=hc,Y0=E6(Uk);function E6(t){return t&&t.__esModule?t:{default:t}}function n0e(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(n0e=function(r){return r?n:e})(t)}function $Ut(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=n0e(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=FUt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function FUt(t){var e=jUt(t,"string");return typeof e=="symbol"?e:String(e)}function jUt(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 Ns={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let Qu=Ns.mouse,Wk=class extends MD.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,Xu.getControlPosition)(e,i,this);if(o==null)return;const{x:a,y:s}=o,l=(0,Xu.createCoreData)(this,a,s);(0,Y0.default)("DraggableCore: handleDragStart: %j",l),(0,Y0.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,Qu.move,this.handleDrag),(0,ji.addEvent)(r,Qu.stop,this.handleDragStop))}),ao(this,"handleDrag",e=>{const n=(0,Xu.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,Xu.snapToGrid)(this.props.grid,s,l),!s&&!l)return;r=this.lastX+s,i=this.lastY+l}const o=(0,Xu.createCoreData)(this,r,i);if((0,Y0.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,Xu.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,Xu.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,i=this.lastY+c}const o=(0,Xu.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,Y0.default)("DraggableCore: handleDragStop: %j",o),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,s&&((0,Y0.default)("DraggableCore: Removing handlers"),(0,ji.removeEvent)(s.ownerDocument,Qu.move,this.handleDrag),(0,ji.removeEvent)(s.ownerDocument,Qu.stop,this.handleDragStop))}),ao(this,"onMouseDown",e=>(Qu=Ns.mouse,this.handleDragStart(e))),ao(this,"onMouseUp",e=>(Qu=Ns.mouse,this.handleDragStop(e))),ao(this,"onTouchStart",e=>(Qu=Ns.touch,this.handleDragStart(e))),ao(this,"onTouchEnd",e=>(Qu=Ns.touch,this.handleDragStop(e)))}componentDidMount(){this.mounted=!0;const e=this.findDOMNode();e&&(0,ji.addEvent)(e,Ns.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const e=this.findDOMNode();if(e){const{ownerDocument:n}=e;(0,ji.removeEvent)(n,Ns.mouse.move,this.handleDrag),(0,ji.removeEvent)(n,Ns.touch.move,this.handleDrag),(0,ji.removeEvent)(n,Ns.mouse.stop,this.handleDragStop),(0,ji.removeEvent)(n,Ns.touch.stop,this.handleDragStop),(0,ji.removeEvent)(e,Ns.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:NUt.default.findDOMNode(this)}render(){return MD.cloneElement(MD.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};zk.default=Wk;ao(Wk,"displayName","DraggableCore");ao(Wk,"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:kD.dontSetMe,style:kD.dontSetMe,transform:kD.dontSetMe});ao(Wk,"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(h1),r=u(qv),i=u(iUt),o=Or,a=pc,s=hc,l=u(zk),c=u(Uk);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(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,U=k||S,W={x:(0,a.canDragX)(this)&&B?this.state.x:U.x,y:(0,a.canDragY)(this)&&B?this.state.y:U.y};this.state.isElementSVG?L=(0,o.createSVGTransform)(W,I):T=(0,o.createCSSTransform)(W,I);const $=(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:$,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})})(Xye);const{default:r0e,DraggableCore:BUt}=Xye;Bk.exports=r0e;Bk.exports.default=r0e;Bk.exports.DraggableCore=BUt;var i0e=Bk.exports;const zUt=$t(i0e);var P6={exports:{}},jw={},M6={};M6.__esModule=!0;M6.cloneElement=qUt;var UUt=WUt(M);function WUt(t){return t&&t.__esModule?t:{default:t}}function RJ(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 IJ(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function DJ(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 AD(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 K0.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=AD({ref:o},s?{}:{handleAxis:i});return K0.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=t6t(o,JUt);return(0,KUt.cloneElement)(a,AD(AD({},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]=K0.createRef();return K0.createElement(YUt.DraggableCore,kF({},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}(K0.Component);jw.default=k6;k6.propTypes=ZUt.resizableProps;k6.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var Vk={};Vk.__esModule=!0;Vk.default=void 0;var RD=u6t(M),a6t=a0e(h1),s6t=a0e(jw),l6t=Bw,c6t=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function a0e(t){return t&&t.__esModule?t:{default:t}}function s0e(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(s0e=function(i){return i?n:e})(t)}function u6t(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=s0e(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 RF(){return RF=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function m6t(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,IF(t,e)}function IF(t,e){return IF=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},IF(t,e)}var l0e=function(t){m6t(e,t);function e(){for(var r,i=arguments.length,o=new Array(i),a=0;an(t,!i.visible)}),r?w.jsx(ep,{}):w.jsx(ep,{variant:"inset",component:"li",style:{margin:"0 0 0 52px"}})]})}const b6t={x:48,y:128},_6t={width:320,height:520},aC={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 w6t(t){const[e,n]=M.useState(b6t),[r,i]=M.useState(_6t),{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(zUt,{handle:"#layer-select-header",position:e,onStop:d,children:w.jsx(g6t,{width:r.width,height:r.height,style:aC.resizeBox,onResize:h,children:w.jsxs(Ho,{elevation:10,sx:aC.windowPaper,component:"div",children:[w.jsxs(Ke,{id:"layer-select-header",sx:aC.windowHeader,children:[w.jsx(Ke,{component:"span",sx:aC.windowTitle,children:fe.get("Layers")}),w.jsx(Ot,{size:"small",onClick:f,children:w.jsx($p,{fontSize:"inherit"})})]}),w.jsx(Ke,{sx:{width:"100%",overflow:"auto",flexGrow:1},children:w.jsxs(Kre,{dense:!0,children:[w.jsx(Cc,{layerId:"overlay",...l}),w.jsx(Cc,{layerId:"userPlaces",...l}),w.jsx(Cc,{layerId:"datasetPlaces",...l}),w.jsx(Cc,{layerId:"datasetBoundary",...l}),w.jsx(Cc,{layerId:"datasetVariable",...l}),w.jsx(Cc,{layerId:"datasetVariable2",...l}),w.jsx(Cc,{layerId:"datasetRgb",...l}),w.jsx(Cc,{layerId:"datasetRgb2",...l}),w.jsx(Cc,{layerId:"baseMap",...l,last:!0}),w.jsx(jr,{onClick:u,children:fe.get("User Base Maps")+"..."}),w.jsx(jr,{onClick:c,children:fe.get("User Overlays")+"..."})]})})]})})})}const S6t=t=>({locale:t.controlState.locale,layerMenuOpen:t.controlState.layerMenuOpen,layerStates:TVe(t)}),O6t={openDialog:Lp,setLayerMenuOpen:Ele,setLayerVisibility:T8e},C6t=Jt(S6t,O6t)(w6t),T6t=t=>({locale:t.controlState.locale,hasConsent:t.controlState.privacyNoticeAccepted,compact:Kt.instance.branding.compact}),E6t={},P6t=we("main")(({theme:t})=>({padding:0,width:"100vw",height:"100vh",overflow:"hidden",display:"flex",flexDirection:"column",alignItems:"stretch",[t.breakpoints.up("md")]:{overflow:"hidden"}})),M6t=({hasConsent:t,compact:e})=>w.jsxs(P6t,{children:[!e&&w.jsx(n2,{variant:"dense"}),t&&w.jsxs(w.Fragment,{children:[w.jsx(ctt,{}),w.jsx(nUt,{}),w.jsx(C6t,{})]})]}),k6t=Jt(T6t,E6t)(M6t),A6t={icon:t=>({marginRight:t.spacing(2)})};function R6t({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(rl,{open:t,disableEscapeKeyDown:!0,keepMounted:!0,scroll:"body",children:[w.jsx(vd,{children:fe.get("Privacy Notice")}),w.jsx(Ys,{children:w.jsx(A2e,{children:i===null?w.jsx(ey,{}):w.jsx(G2,{children:i,linkTarget:"_blank"})})}),w.jsxs(Tp,{children:[w.jsxs(tr,{onClick:a,children:[w.jsx(R6,{sx:A6t.icon}),fe.get("Accept and continue")]}),w.jsx(tr,{onClick:s,children:fe.get("Leave")})]})]})}const I6t=t=>({open:!t.controlState.privacyNoticeAccepted,settings:t.controlState}),D6t={updateSettings:ow,syncWithServer:nz},L6t=Jt(I6t,D6t)(R6t),N6t=Li(ey)(({theme:t})=>({margin:t.spacing(2)})),$6t=Li(At)(({theme:t})=>({margin:t.spacing(1)})),F6t=Li("div")(({theme:t})=>({margin:t.spacing(1),textAlign:"center",display:"flex",alignItems:"center",flexDirection:"column"}));function j6t({messages:t}){return t.length===0?null:w.jsxs(rl,{open:!0,"aria-labelledby":"loading",children:[w.jsx(vd,{id:"loading",children:fe.get("Please wait...")}),w.jsxs(F6t,{children:[w.jsx(N6t,{}),t.map((e,n)=>w.jsx($6t,{children:e},n))]})]})}const B6t=t=>({locale:t.controlState.locale,messages:_Ve(t)}),z6t={},U6t=Jt(B6t,z6t)(j6t);var I6={},W6t=ft;Object.defineProperty(I6,"__esModule",{value:!0});var u0e=I6.default=void 0,V6t=W6t(pt()),G6t=w;u0e=I6.default=(0,V6t.default)((0,G6t.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 D6={},H6t=ft;Object.defineProperty(D6,"__esModule",{value:!0});var f0e=D6.default=void 0,q6t=H6t(pt()),X6t=w;f0e=D6.default=(0,q6t.default)((0,X6t.jsx)("path",{d:"M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z"}),"Warning");var L6={},Q6t=ft;Object.defineProperty(L6,"__esModule",{value:!0});var d0e=L6.default=void 0,Y6t=Q6t(pt()),K6t=w;d0e=L6.default=(0,Y6t.default)((0,K6t.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 Z6t={success:d0e,warning:f0e,error:u0e,info:u4},J6t=Li("span")(()=>({display:"flex",alignItems:"center"})),sC={close:{p:.5},success:t=>({color:t.palette.error.contrastText,backgroundColor:Lc[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:mne[700]}),icon:{fontSize:20},iconVariant:t=>({opacity:.9,marginRight:t.spacing(1),fontSize:20}),message:{display:"flex",alignItems:"center"}},eWt={vertical:"bottom",horizontal:"center"};function tWt({className:t,message:e,hideMessage:n}){const r=()=>{n(e.id)};if(!e)return null;const i=Z6t[e.type];return w.jsx(fIe,{open:!0,anchorOrigin:eWt,autoHideDuration:5e3,onClose:r,children:w.jsx(rie,{sx:sC[e.type],className:t,"aria-describedby":"client-snackbar",message:w.jsxs(J6t,{id:"client-snackbar",children:[w.jsx(i,{sx:sC.iconVariant}),e.text]}),action:[w.jsx(Ot,{"aria-label":"Close",color:"inherit",sx:sC.close,onClick:r,size:"large",children:w.jsx($p,{sx:sC.icon})},"close")]})},e.type+":"+e.text)}const nWt=t=>{const e=t.messageLogState.newEntries;return{locale:t.controlState.locale,message:e.length>0?e[0]:null}},rWt={hideMessage:MVe},iWt=Jt(nWt,rWt)(tWt);var N6={},oWt=ft;Object.defineProperty(N6,"__esModule",{value:!0});var NP=N6.default=void 0,aWt=oWt(pt()),sWt=w;NP=N6.default=(0,aWt.default)((0,sWt.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add");var $6={},lWt=ft;Object.defineProperty($6,"__esModule",{value:!0});var F6=$6.default=void 0,cWt=lWt(pt()),uWt=w;F6=$6.default=(0,cWt.default)((0,uWt.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 Rm={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 fWt({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 U=B.target.value,W=a.find($=>$.id===U);c(W)},g=B=>{const U=B.target.value,W={...l,name:U};c(W)},v=B=>{const U=B.target.value,W={...l,url:U};c(W)},y=()=>{f("add")},x=()=>{f("edit")},b=()=>{P()},_=()=>{r("server")},S=()=>{const B=l.id;return a.findIndex(U=>U.id===B)},O=(B,U)=>{const W=[...a];W[B]=U,s(W),c(U),f("select")},C=(B,U)=>{s(B),c(U),f("select")},E=()=>{const B={...l,id:Js("server-")},U=[...a,B];C(U,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 U=S(),W=B[U+(U>0?-1:1)];B.splice(U,1),C(B,W)},R=a.map((B,U)=>w.jsx(jr,{value:B.id,children:B.name},U));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(Ys,{dividers:!0,children:[w.jsx(cr,{variant:"standard",required:!0,id:"server-name",label:"Name",sx:Rm.textField,margin:"normal",value:l.name,onChange:g}),w.jsx("br",{}),w.jsx(cr,{variant:"standard",required:!0,id:"server-url",label:"URL",sx:Rm.textField2,margin:"normal",value:l.url,onChange:v})]}):z=w.jsx(Ys,{dividers:!0,children:w.jsxs("div",{children:[w.jsxs(ty,{variant:"standard",sx:Rm.formControl,children:[w.jsx(ny,{htmlFor:"server-name",children:"Name"}),w.jsx(xd,{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:Rm.button,"aria-label":"Add",color:"primary",onClick:y,size:"large",children:w.jsx(NP,{fontSize:"small"})}),w.jsx(Ot,{sx:Rm.button,"aria-label":"Edit",onClick:x,size:"large",children:w.jsx(Fp,{fontSize:"small"})}),w.jsx(Ot,{sx:Rm.button,"aria-label":"Delete",disabled:a.length<2,onClick:b,size:"large",children:w.jsx(F6,{fontSize:"small"})})]})}),w.jsxs(rl,{open:t,onClose:p,"aria-labelledby":"server-dialog-title",children:[w.jsx(vd,{id:"server-dialog-title",children:L}),z,w.jsxs(Tp,{children:[w.jsx(tr,{onClick:h,children:fe.get("Cancel")}),w.jsx(tr,{onClick:d,autoFocus:!0,children:T})]})]})}const dWt=t=>({open:!!t.controlState.dialogOpen.server,servers:Iae(t),selectedServer:pi(t)}),hWt={closeDialog:Sy,configureServers:a8e},pWt=Jt(dWt,hWt)(fWt),NJ=({anchorElement:t,layers:e,selectedLayerId:n,setSelectedLayerId:r,onClose:i})=>w.jsx(Pp,{anchorEl:t,keepMounted:!0,open:!!t,onClose:i,children:t&&e.map(o=>w.jsx(jr,{selected:o.id===n,onClick:()=>r(o.id===n?null:o.id),dense:!0,children:w.jsx(ts,{primary:tE(o)})},o.id))}),ID={settingsPanelTitle:t=>({marginBottom:t.spacing(1)}),settingsPanelPaper:t=>({backgroundColor:(t.palette.mode==="dark"?Jne:Zne)(t.palette.background.paper,.1),marginBottom:t.spacing(2)}),settingsPanelList:{margin:0}},Gm=({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(ts,{primary:t,secondary:e});let a;return r&&(a=w.jsx(Lb,{children:r})),n?w.jsxs(Xre,{style:i,onClick:n,children:[o,a]}):w.jsxs(Ux,{style:i,children:[o,a]})},kf=({propertyName:t,settings:e,updateSettings:n,disabled:r})=>w.jsx(iie,{checked:!!e[t],onChange:()=>n({...e,[t]:!e[t]}),disabled:r}),mWt=({propertyName:t,settings:e,updateSettings:n,options:r,disabled:i})=>{const o=(a,s)=>{n({...e,[t]:s})};return w.jsx(T5,{row:!0,value:e[t],onChange:o,children:r.map(([a,s])=>w.jsx(Og,{control:w.jsx(Wx,{}),value:s,label:a,disabled:i},a))})},Z0={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}},$J=[["doNothing","Do nothing"],["pan","Pan"],["panAndZoom","Pan and zoom"]],gWt=[["point","Points"],["line","Lines"],["bar","Bars"]],vWt=({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(jr,{selected:A===n.locale,onClick:()=>s(A),children:w.jsx(ts,{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=nE(i,n.selectedBaseMapId),B=tE(z);function U(A){g(A.currentTarget)}function W(){g(null)}const $=A=>{A.stopPropagation(),l("userOverlays")},N=nE(o,n.selectedOverlayId),D=tE(N);return w.jsxs("div",{children:[w.jsxs(rl,{open:t,fullWidth:!0,maxWidth:"sm",onClose:x,scroll:"body",children:[w.jsx(vd,{children:fe.get("Settings")}),w.jsxs(Ys,{children:[w.jsxs(Gm,{title:fe.get("General"),children:[w.jsx(pr,{label:fe.get("Server"),value:r.name,onClick:b}),w.jsx(pr,{label:fe.get("Language"),value:fe.languages[n.locale],onClick:I}),w.jsx(pr,{label:fe.get("Time interval of the player"),children:w.jsx(cr,{variant:"standard",select:!0,sx:Z0.textField,value:n.timeAnimationInterval,onChange:_,margin:"normal",children:J6e.map((A,q)=>w.jsx(jr,{value:A,children:A+" ms"},q))})})]}),w.jsxs(Gm,{title:fe.get("Time-Series"),children:[w.jsx(pr,{label:fe.get("Show chart after adding a place"),value:lC(n.autoShowTimeSeries),children:w.jsx(kf,{propertyName:"autoShowTimeSeries",settings:n,updateSettings:a})}),w.jsx(pr,{label:fe.get("Default chart type"),children:w.jsx(cr,{variant:"standard",select:!0,sx:Z0.textField,value:n.timeSeriesChartTypeDefault,onChange:S,margin:"normal",children:gWt.map(([A,q])=>w.jsx(jr,{value:A,children:fe.get(q)},A))})}),w.jsx(pr,{label:fe.get("Calculate standard deviation"),value:lC(n.timeSeriesIncludeStdev),children:w.jsx(kf,{propertyName:"timeSeriesIncludeStdev",settings:n,updateSettings:a})}),w.jsx(pr,{label:fe.get("Calculate median instead of mean (disables standard deviation)"),value:lC(n.timeSeriesUseMedian),children:w.jsx(kf,{propertyName:"timeSeriesUseMedian",settings:n,updateSettings:a})}),w.jsx(pr,{label:fe.get("Minimal number of data points in a time series update"),children:w.jsx(cr,{variant:"standard",sx:Z0.intTextField,value:v,onChange:E,margin:"normal",size:"small"})})]}),w.jsxs(Gm,{title:fe.get("Map"),children:[w.jsx(pr,{label:fe.get("Base map"),value:B,onClick:R,children:w.jsx(tr,{onClick:L,children:fe.get("User Base Maps")+"..."})}),w.jsx(pr,{label:fe.get("Overlay"),value:D,onClick:U,children:w.jsx(tr,{onClick:$,children:fe.get("User Overlays")+"..."})}),w.jsx(pr,{label:fe.get("Projection"),children:w.jsx(mWt,{propertyName:"mapProjection",settings:n,updateSettings:a,options:[[fe.get("Geographic"),py],[fe.get("Mercator"),NB]]})}),w.jsx(pr,{label:fe.get("Image smoothing"),value:lC(n.imageSmoothingEnabled),children:w.jsx(kf,{propertyName:"imageSmoothingEnabled",settings:n,updateSettings:a})}),w.jsx(pr,{label:fe.get("On dataset selection"),children:w.jsx(cr,{variant:"standard",select:!0,sx:Z0.textField,value:n.datasetLocateMode,onChange:O,margin:"normal",children:$J.map(([A,q])=>w.jsx(jr,{value:A,children:fe.get(q)},A))})}),w.jsx(pr,{label:fe.get("On place selection"),children:w.jsx(cr,{variant:"standard",select:!0,sx:Z0.textField,value:n.placeLocateMode,onChange:C,margin:"normal",children:$J.map(([A,q])=>w.jsx(jr,{value:A,children:fe.get(q)},A))})})]}),w.jsx(Gm,{title:fe.get("Legal Agreement"),children:w.jsx(pr,{label:fe.get("Privacy notice"),value:n.privacyNoticeAccepted?fe.get("Accepted"):"",children:w.jsx(tr,{disabled:!n.privacyNoticeAccepted,onClick:()=>{a({privacyNoticeAccepted:!1}),window.location.reload()},children:fe.get("Revoke consent")})})}),w.jsxs(Gm,{title:fe.get("System Information"),children:[w.jsx(pr,{label:`xcube Viewer ${fe.get("version")}`,value:c}),w.jsx(pr,{label:`xcube Server ${fe.get("version")}`,value:u?u.version:fe.get("Cannot reach server")})]})]})]}),w.jsx(Pp,{anchorEl:f,keepMounted:!0,open:!!f,onClose:P,children:k}),w.jsx(NJ,{anchorElement:h,layers:i,selectedLayerId:n.selectedBaseMapId,setSelectedLayerId:A=>a({selectedBaseMapId:A}),onClose:T}),w.jsx(NJ,{anchorElement:m,layers:o,selectedLayerId:n.selectedOverlayId,setSelectedLayerId:A=>a({selectedOverlayId:A}),onClose:W})]})},lC=t=>t?fe.get("On"):fe.get("Off"),yWt="1.3.1",xWt=t=>({locale:t.controlState.locale,open:t.controlState.dialogOpen.settings,settings:t.controlState,baseMapLayers:qB(t),overlayLayers:XB(t),selectedServer:pi(t),viewerVersion:yWt,serverInfo:t.dataState.serverInfo}),bWt={closeDialog:Sy,updateSettings:ow,changeLocale:Fle,openDialog:Lp},_Wt=Jt(xWt,bWt)(vWt),FJ={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})},wWt=({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(rl,{open:t,fullWidth:!0,maxWidth:"xs",onClose:o,scroll:"body",children:[w.jsx(Ys,{children:w.jsxs(Gm,{title:fe.get("Export Settings"),children:[w.jsx(pr,{label:fe.get("Include time-series data")+" (*.txt)",value:cC(n.exportTimeSeries),children:w.jsx(kf,{propertyName:"exportTimeSeries",settings:n,updateSettings:r})}),w.jsx(pr,{label:fe.get("Separator for time-series data"),children:w.jsx(cr,{variant:"standard",sx:FJ.separatorTextField,value:n.exportTimeSeriesSeparator,onChange:s,disabled:!n.exportTimeSeries,margin:"normal",size:"small"})}),w.jsx(pr,{label:fe.get("Include places data")+" (*.geojson)",value:cC(n.exportPlaces),children:w.jsx(kf,{propertyName:"exportPlaces",settings:n,updateSettings:r})}),w.jsx(pr,{label:fe.get("Combine place data in one file"),value:cC(n.exportPlacesAsCollection),children:w.jsx(kf,{propertyName:"exportPlacesAsCollection",settings:n,updateSettings:r,disabled:!n.exportPlaces})}),w.jsx(pr,{label:fe.get("As ZIP archive"),value:cC(n.exportZipArchive),children:w.jsx(kf,{propertyName:"exportZipArchive",settings:n,updateSettings:r})}),w.jsx(pr,{label:fe.get("File name"),children:w.jsx(cr,{variant:"standard",sx:FJ.fileNameTextField,value:n.exportFileName,onChange:a,margin:"normal",size:"small"})})]})}),w.jsx(Tp,{children:w.jsx(tr,{onClick:l,disabled:!CWt(n),children:fe.get("Download")})})]})})},cC=t=>t?fe.get("On"):fe.get("Off"),SWt=t=>/^[0-9a-zA-Z_-]+$/.test(t),OWt=t=>t.toUpperCase()==="TAB"||t.length===1,CWt=t=>(t.exportTimeSeries||t.exportPlaces)&&SWt(t.exportFileName)&&(!t.exportTimeSeries||OWt(t.exportTimeSeriesSeparator)),TWt=t=>({locale:t.controlState.locale,open:!!t.controlState.dialogOpen.export,settings:t.controlState}),EWt={closeDialog:Sy,updateSettings:ow,downloadTimeSeries:p8e},PWt=Jt(TWt,EWt)(wWt);var j6={},MWt=ft;Object.defineProperty(j6,"__esModule",{value:!0});var h0e=j6.default=void 0,kWt=MWt(pt()),AWt=w;h0e=j6.default=(0,kWt.default)((0,AWt.jsx)("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore");var B6={},RWt=ft;Object.defineProperty(B6,"__esModule",{value:!0});var p0e=B6.default=void 0,IWt=RWt(pt()),DWt=w;p0e=B6.default=(0,IWt.default)((0,DWt.jsx)("path",{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}),"ExpandLess");const LWt=({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(tr,{onClick:l,disabled:r,className:o,variant:"outlined",size:"small",children:t})]})},DD={parse:t=>t,format:t=>typeof t=="string"?t:`${t}`,validate:t=>!0};function z6(){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||DD.parse)(p);n({[r]:m})};return w.jsx(cr,{label:fe.get(i),value:(c||DD.format)(f),error:!(u||DD.validate)(f),onChange:d,style:o,className:a,disabled:s,size:"small",variant:"standard"})}}const J0=z6(),NWt=Li("div")(({theme:t})=>({paddingTop:t.spacing(2)})),$Wt=({options:t,updateOptions:e})=>w.jsx(NWt,{children:w.jsxs("div",{style:{display:"grid",gap:12,paddingTop:12,gridTemplateColumns:"auto auto"},children:[w.jsx(J0,{optionKey:"timeNames",label:"Time property names",options:t,updateOptions:e}),w.jsx("div",{id:"spareField"}),w.jsx(J0,{label:"Group property names",optionKey:"groupNames",options:t,updateOptions:e}),w.jsx(J0,{label:"Group prefix (used as fallback)",optionKey:"groupPrefix",options:t,updateOptions:e}),w.jsx(J0,{label:"Label property names",optionKey:"labelNames",options:t,updateOptions:e}),w.jsx(J0,{label:"Label prefix (used as fallback)",optionKey:"labelPrefix",options:t,updateOptions:e})]})}),io=z6(),FWt=Li("div")(({theme:t})=>({paddingTop:t.spacing(2)})),jWt=({options:t,updateOptions:e})=>{const n=t.forceGeometry;return w.jsxs(FWt,{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(zL,{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(zL,{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})]})]})},ex=z6(),BWt=Li("div")(({theme:t})=>({paddingTop:t.spacing(2)})),zWt=({options:t,updateOptions:e})=>w.jsx(BWt,{children:w.jsxs("div",{style:{display:"grid",gap:12,paddingTop:12,gridTemplateColumns:"auto auto"},children:[w.jsx(ex,{optionKey:"time",label:"Time (UTC, ISO-format)",options:t,updateOptions:e}),w.jsx("div",{id:"spareField"}),w.jsx(ex,{label:"Group",options:t,optionKey:"group",updateOptions:e}),w.jsx(ex,{label:"Group prefix (used as fallback)",optionKey:"groupPrefix",options:t,updateOptions:e,disabled:t.group.trim()!==""}),w.jsx(ex,{label:"Label",optionKey:"label",options:t,updateOptions:e}),w.jsx(ex,{label:"Label prefix (used as fallback)",optionKey:"labelPrefix",options:t,updateOptions:e,disabled:t.label.trim()!==""})]})}),LD={csv:{...Hae,codeExt:[]},geojson:{...qae,codeExt:[wpe()]},wkt:{...Xae,codeExt:[]}},ND={spacer:{flexGrow:1},actionButton:t=>({marginRight:t.spacing(1)}),error:{fontSize:"small"}},UWt=Li("div")(({theme:t})=>({paddingTop:t.spacing(.5),display:"flex",flexDirection:"row",alignItems:"center"})),WWt=Li(LWt)(({theme:t})=>({marginRight:t.spacing(1)})),VWt=({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 U=new FileReader;U.onloadend=()=>{const W=U.result;v(pH(W)),c(W),h(!1)},U.onabort=U.onerror=()=>{h(!1)},U.readAsText(B,"UTF-8")},C=()=>{c("")},E=()=>{console.info("PASTE!",l)},k=z=>{let B=g;l===""&&z.length>10&&(B=pH(z),v(B)),c(z),f(LD[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(jWt,{options:y.csv,updateOptions:P}):g==="geojson"?L=w.jsx($Wt,{options:y.geojson,updateOptions:R}):L=w.jsx(zWt,{options:y.wkt,updateOptions:T}),w.jsxs(rl,{fullWidth:!0,open:t,onClose:_,"aria-labelledby":"server-dialog-title",children:[w.jsx(vd,{id:"server-dialog-title",children:fe.get("Import places")}),w.jsxs(Ys,{dividers:!0,children:[w.jsxs(T5,{row:!0,value:g,onChange:z=>I(z),children:[w.jsx(Og,{value:"csv",label:fe.get(Hae.name),control:w.jsx(Wx,{})},"csv"),w.jsx(Og,{value:"geojson",label:fe.get(qae.name),control:w.jsx(Wx,{})},"geojson"),w.jsx(Og,{value:"wkt",label:fe.get(Xae.name),control:w.jsx(Wx,{})},"wkt")]}),w.jsx(ik,{theme:Kt.instance.branding.themeName||"light",placeholder:fe.get("Enter text or drag & drop a text file."),autoFocus:!0,height:"400px",extensions:LD[g].codeExt,value:l,onChange:k,onDrop:C,onPaste:E,onPasteCapture:E}),u&&w.jsx(At,{color:"error",sx:ND.error,children:u}),w.jsxs(UWt,{children:[w.jsx(WWt,{title:fe.get("From File")+"...",accept:LD[g].fileExt,multiple:!1,onSelect:O,disabled:d}),w.jsx(tr,{onClick:S,disabled:l.trim()===""||d,sx:ND.actionButton,variant:"outlined",size:"small",children:fe.get("Clear")}),w.jsx(Ke,{sx:ND.spacer}),w.jsx(tr,{onClick:()=>m(!p),endIcon:p?w.jsx(p0e,{}):w.jsx(h0e,{}),variant:"outlined",size:"small",children:fe.get("Options")})]}),w.jsx(f5,{in:p,timeout:"auto",unmountOnExit:!0,children:L})]}),w.jsxs(Tp,{children:[w.jsx(tr,{onClick:_,variant:"text",children:fe.get("Cancel")}),w.jsx(tr,{onClick:b,disabled:l.trim()===""||u!==null||d,variant:"text",children:fe.get("OK")})]})]})},GWt=t=>({open:t.controlState.dialogOpen.addUserPlacesFromText,userPlacesFormatName:t.controlState.userPlacesFormatName,userPlacesFormatOptions:t.controlState.userPlacesFormatOptions,nextMapInteraction:t.controlState.lastMapInteraction}),HWt={closeDialog:Sy,updateSettings:ow,setMapInteraction:Cle,addUserPlacesFromText:Wse},qWt=Jt(GWt,HWt)(VWt);var U6={},XWt=ft;Object.defineProperty(U6,"__esModule",{value:!0});var W6=U6.default=void 0,QWt=XWt(pt()),YWt=w;W6=U6.default=(0,QWt.default)((0,YWt.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 V6(t,e){return m0e(t,e,[]).join("")}function m0e(t,e,n){if(t.nodeType==Node.CDATA_SECTION_NODE||t.nodeType==Node.TEXT_NODE)n.push(t.nodeValue);else{var r=void 0;for(r=t.firstChild;r;r=r.nextSibling)m0e(r,e,n)}return n}function KWt(t){return"documentElement"in t}function ZWt(t){return new DOMParser().parseFromString(t,"application/xml")}function g0e(t,e){return function(n,r){var i=t.call(this,n,r);if(i!==void 0){var o=r[r.length-1];o.push(i)}}}function sa(t,e,n){return function(r,i){var o=t.call(this,r,i);if(o!==void 0){var a=i[i.length-1],s=r.localName,l=void 0;s in a?l=a[s]:(l=[],a[s]=l),l.push(o)}}}function vt(t,e,n){return function(r,i){var o=t.call(this,r,i);if(o!==void 0){var a=i[i.length-1],s=r.localName;a[s]=o}}}function Ni(t,e,n){var r={},i,o;for(i=0,o=t.length;i{const n=e.Name,r=e.Title||n;let i;const o=e.Attribution;if(FP(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 zVt(t){const e=$Vt.read(t);if(FP(e)){const n=e.Capability;if(FP(n))return DF(n,!0)}throw new Error("invalid WMSCapabilities object")}function DF(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=>DF(o)):FP(n)?i=DF(n):i=[{}],i.map(o=>UVt(r,o))}function UVt(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 FP(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}const WVt=({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(()=>{FVt(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:BB,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(cr,{required:!0,label:fe.get("WMS URL"),variant:"standard",size:"small",value:r,fullWidth:!0,onChange:f=>i(f.currentTarget.value)}),w.jsx(xd,{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(jr,{value:d,selected:s===d,children:w.jsx(ts,{primary:f.title})},f.name))}),w.jsx(hw,{onDone:u,onCancel:n,doneDisabled:!c(),helpUrl:fe.get("docs/add-layer-wms.en.md")})]})},VVt=({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:BB,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(cr,{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(cr,{required:!0,label:fe.get("Layer Title"),variant:"standard",size:"small",sx:{flexGrow:.3},value:r,onChange:d=>i(d.currentTarget.value)}),w.jsx(cr,{label:fe.get("Layer Attribution"),variant:"standard",size:"small",sx:{flexGrow:.7},value:s,onChange:d=>l(d.currentTarget.value)})]}),w.jsx(hw,{onDone:f,onCancel:n,doneDisabled:!u(),helpUrl:fe.get("docs/add-layer-xyz.en.md")})]})},GVt={paper:t=>({backgroundColor:(t.palette.mode==="dark"?Jne:Zne)(t.palette.background.paper,.1),marginBottom:t.spacing(2)})},jJ=({userLayers:t,setUserLayers:e,selectedId:n,setSelectedId:r})=>{const[i,o]=ue.useState(n),[a,s]=ue.useState(null),[l,c]=rfe();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:Js("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=Js("user-layer-");e([...t,{id:b,group:BB,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(Ho,{sx:GVt.paper,children:w.jsxs(e2,{component:"nav",dense:!0,children:[t.map(x=>{const b=n===x.id;return a&&a.editId===x.id?x.wms?w.jsx(WVt,{userLayer:x,onChange:g,onCancel:v},x.id):w.jsx(VVt,{userLayer:x,onChange:g,onCancel:v},x.id):w.jsxs(Xre,{selected:b,onClick:()=>r(b?null:x.id),children:[w.jsx(ts,{primary:x.title,secondary:x.url}),w.jsxs(Lb,{children:[w.jsx(Ot,{onClick:()=>u(x),size:"small",disabled:y,children:w.jsx(Fp,{})}),w.jsx(Ot,{onClick:()=>f(x),size:"small",disabled:y,children:w.jsx(W6,{})}),w.jsx(Ot,{onClick:()=>d(x),size:"small",disabled:y,children:w.jsx($p,{})})]})]},x.id)}),!y&&w.jsx(Ux,{sx:{minHeight:"3em"},children:w.jsx(Lb,{children:w.jsxs(Ke,{sx:{display:"flex",gap:2,paddingTop:2},children:[w.jsx(xt,{title:fe.get("Add layer from a Web Map Service"),children:w.jsx(tr,{onClick:p,startIcon:w.jsx(NP,{}),children:"WMS"})}),w.jsx(xt,{title:fe.get("Add layer from a Tiled Web Map"),children:w.jsx(tr,{onClick:m,startIcon:w.jsx(NP,{}),children:"XYZ"})})]})})})]})})},HVt=({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(rl,{open:e,fullWidth:!0,maxWidth:"sm",onClose:m,scroll:"body",children:[w.jsx(vd,{children:fe.get("User Layers")}),w.jsxs(Ys,{children:[w.jsx(Ke,{sx:{borderBottom:1,borderColor:"divider"},children:w.jsxs(k5,{value:o,onChange:(g,v)=>a(v),children:[w.jsx(Nb,{label:"Base Maps"}),w.jsx(Nb,{label:"Overlays"})]})}),o===0&&w.jsx(jJ,{userLayers:s,setUserLayers:l,selectedId:f,setSelectedId:d},"baseMaps"),o===1&&w.jsx(jJ,{userLayers:c,setUserLayers:u,selectedId:h,setSelectedId:p},"overlays")]})]})},qVt=(t,e)=>({open:t.controlState.dialogOpen[e.dialogId],settings:t.controlState,dialogId:e.dialogId}),XVt={closeDialog:Sy,updateSettings:ow},BJ=Jt(qVt,XVt)(HVt);function _0e({selected:t,title:e,actions:n}){return w.jsxs(n2,{sx:{pl:{sm:2},pr:{xs:1,sm:1},...t&&{background:r=>Hc(r.palette.primary.main,r.palette.action.activatedOpacity)}},children:[w.jsx(aE,{}),w.jsx(At,{sx:{flex:"1 1 100%",paddingLeft:1},children:e}),n]})}const QVt={container:{display:"flex",flexDirection:"column",height:"100%"},tableContainer:{overflowY:"auto",flexGrow:1}};function YVt({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:zqe()})},c=()=>{const d=t[n];e([...t.slice(0,n+1),Uqe(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(_0e,{selected:n!==null,title:fe.get("Manage user variables"),actions:w.jsxs(w.Fragment,{children:[w.jsx(xt,{title:fe.get("Add user variable"),children:w.jsx(Ot,{color:"primary",onClick:l,children:w.jsx(dw,{})})}),a&&w.jsx(xt,{title:fe.get("Duplicate user variable"),children:w.jsx(Ot,{onClick:c,children:w.jsx(W6,{})})}),a&&w.jsx(xt,{title:fe.get("Edit user variable"),children:w.jsx(Ot,{onClick:u,children:w.jsx(Fp,{})})}),a&&w.jsx(xt,{title:fe.get("Remove user variable"),children:w.jsx(Ot,{onClick:f,children:w.jsx(F6,{})})})]})}),w.jsx(aie,{sx:QVt.tableContainer,children:w.jsxs(P5,{size:"small",children:[w.jsx(eDe,{children:w.jsxs(vl,{children:[w.jsx(sr,{sx:{width:"15%"},children:fe.get("Name")}),w.jsx(sr,{sx:{width:"15%"},children:fe.get("Title")}),w.jsx(sr,{sx:{width:"10%"},children:fe.get("Units")}),w.jsx(sr,{children:fe.get("Expression")})]})}),w.jsx(M5,{children:t.map((d,h)=>w.jsxs(vl,{hover:!0,selected:h===n,onClick:()=>s(h),children:[w.jsx(sr,{component:"th",scope:"row",children:d.name}),w.jsx(sr,{children:d.title}),w.jsx(sr,{children:d.units}),w.jsx(sr,{children:d.expression||""})]},d.id))})]})})]})}var H6={},KVt=ft;Object.defineProperty(H6,"__esModule",{value:!0});var w0e=H6.default=void 0,ZVt=KVt(pt()),JVt=w;w0e=H6.default=(0,ZVt.default)((0,JVt.jsx)("path",{d:"M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z"}),"FilterList");const e8t=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/;function t8t(t){return e8t.test(t)}const zJ={expressionPart:{padding:.2},expressionPartChip:{fontFamily:"monospace"}};function UJ({part:t,partType:e,onPartClicked:n}){return w.jsx(Ke,{component:"span",sx:zJ.expressionPart,children:w.jsx(SPe,{label:t,sx:zJ.expressionPartChip,size:"small",variant:"outlined",color:e==="variables"||e==="constants"?"default":e.includes("Functions")?"primary":"secondary",onClick:()=>n(t)})})}function n8t({anchorEl:t,exprPartTypes:e,setExprPartTypes:n,onClose:r}){const i=o=>{n({...e,[o]:!e[o]})};return w.jsx(Pp,{open:!!t,anchorEl:t,onClose:r,children:$ce.map(o=>w.jsx(c0e,{selected:e[o],title:fe.get(Vqe[o]),onClick:()=>i(o),dense:!0},o))})}function r8t({expression:t,onExpressionChange:e,variableNames:n,expressionCapabilities:r,handleInsertPartRef:i}){const o=hd(),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(ik,{theme:o.palette.mode||"none",width:"100%",height:"100px",placeholder:fe.get("Use keys CTRL+SPACE to show autocompletions"),extensions:[gpe({override:[l]})],value:t,onChange:e,ref:a})}async function i8t(t,e,n){if(n.trim()==="")return fe.get("Must not be empty");const r=`${t}/expressions/validate/${ly(e)}/${encodeURIComponent(n)}`;try{return await ioe(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 uC={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 o8t({userVariables:t,setUserVariables:e,editedVariable:n,setEditedVariable:r,contextDataset:i,expressionCapabilities:o,serverUrl:a}){const[s,l]=M.useState(Wqe),[c,u]=M.useState(null),f=[...t,...i.variables],d=i.variables.filter(D=>!W1(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=!t8t(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(()=>{i8t(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)},U=D=>{k.current(D)},W=D=>{u(D.currentTarget)},$=()=>{u(null)},N=[w.jsx(Ot,{size:"small",onClick:W,children:w.jsx(xt,{arrow:!0,title:fe.get("Display further elements to be used in expressions"),children:w.jsx(w0e,{})})},"filter")];return $ce.forEach(D=>{s[D]&&(D==="variables"?d.forEach(A=>{N.push(w.jsx(UJ,{part:A,partType:D,onPartClicked:U},`${D}-${A}`))}):o.namespace[D].forEach(A=>{N.push(w.jsx(UJ,{part:A,partType:D,onPartClicked:U},`${D}-${A}`))}))}),w.jsxs(w.Fragment,{children:[w.jsx(n8t,{anchorEl:c,exprPartTypes:s,setExprPartTypes:l,onClose:$}),w.jsx(_0e,{selected:!0,title:n.editMode==="add"?fe.get("Add user variable"):fe.get("Edit user variable"),actions:w.jsx(hw,{size:"medium",onDone:P,doneDisabled:!E,onCancel:R})}),w.jsxs(Ke,{sx:uC.content,children:[w.jsxs(Ke,{sx:uC.propertiesRow,children:[w.jsx(cr,{sx:{flexGrow:.3},error:!_,helperText:b,size:"small",variant:"standard",label:fe.get("Name"),value:p,onChange:T}),w.jsx(cr,{sx:{flexGrow:.6},size:"small",variant:"standard",label:fe.get("Title"),value:m,onChange:L}),w.jsx(cr,{sx:{flexGrow:.1},size:"small",variant:"standard",label:fe.get("Units"),value:g,onChange:z})]}),w.jsxs(Ke,{sx:uC.expressionRow,children:[w.jsx(At,{sx:D=>({paddingBottom:1,color:D.palette.text.secondary}),children:fe.get("Expression")}),w.jsx(r8t,{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:uC.expressionParts,children:N})]})]})]})}const WJ={dialogContent:{height:420},dialogActions:{display:"flex",justifyContent:"space-between",gap:.2}};function a8t({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(lE),f>=0&&i(c[f].name)}function g(){u(o),e(lE)}return w.jsxs(rl,{open:t,fullWidth:!0,maxWidth:"md",onClose:g,scroll:"body",children:[w.jsx(vd,{children:fe.get("User Variables")}),w.jsx(Ys,{dividers:!0,sx:WJ.dialogContent,children:h===null?w.jsx(YVt,{userVariables:c,setUserVariables:u,selectedIndex:f,setSelectedIndex:d,setEditedVariable:p}):w.jsx(o8t,{userVariables:c,setUserVariables:u,editedVariable:h,setEditedVariable:p,contextDataset:n,expressionCapabilities:s,serverUrl:l})}),w.jsxs(Tp,{sx:WJ.dialogActions,children:[w.jsx(Ke,{children:w.jsx(afe,{size:"medium",helpUrl:fe.get("docs/user-variables.en.md")})}),w.jsxs(Ke,{children:[w.jsx(tr,{onClick:g,children:fe.get("Cancel")}),w.jsx(tr,{onClick:m,disabled:h!==null||!s8t(c),children:fe.get("OK")})]})]})]})}function s8t(t){const e=new Set;return t.forEach(n=>e.add(n.name)),e.size===t.length}const l8t=t=>({open:t.controlState.dialogOpen[lE],selectedDataset:qr(t),selectedVariableName:yy(t),userVariables:$We(t),expressionCapabilities:i6e(t),serverUrl:pi(t).url}),c8t={closeDialog:Sy,selectVariable:yle,updateDatasetUserVariables:zVe},u8t=Jt(l8t,c8t)(a8t),f8t=t=>({compact:Kt.instance.branding.compact}),d8t={},h8t=()=>i5({typography:{fontSize:12,htmlFontSize:14},palette:{mode:Kt.instance.branding.themeName,primary:Kt.instance.branding.primaryColor,secondary:Kt.instance.branding.secondaryColor}}),p8t=({compact:t})=>w.jsx(c3e,{children:w.jsx(Ine,{injectFirst:!0,children:w.jsxs(iCe,{theme:h8t(),children:[w.jsx(i2e,{}),!t&&w.jsx(yqe,{}),w.jsx(k6t,{}),w.jsxs(w.Fragment,{children:[w.jsx(U6t,{}),w.jsx(pWt,{}),w.jsx(_Wt,{}),w.jsx(BJ,{dialogId:"userOverlays"},"userOverlays"),w.jsx(BJ,{dialogId:"userBaseMaps"},"userBaseMaps"),w.jsx(u8t,{}),w.jsx(qWt,{}),w.jsx(PWt,{}),w.jsx(L6t,{}),w.jsx(iWt,{})]})]})})}),m8t=Jt(f8t,d8t)(p8t);function g8t(t,e,n){switch(t===void 0&&(t=tWe()),e.type){case sz:{const r={...t,...e.settings};return ll(r),r}case zle:return ll(t),t;case Qb:{let r=t.selectedDatasetId||hf.get("dataset"),i=t.selectedVariableName||hf.get("variable"),o=t.mapInteraction,a=zb(e.datasets,r);const s=a&&a3(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 sle:{let r=t.selectedVariableName;const i=zb(e.datasets,e.selectedDatasetId);!a3(i,r)&&i.variables.length>0&&(r=i.variables[0].name);const a=e.selectedDatasetId,s=loe(i),l=s?s[1]:null;return{...t,selectedDatasetId:a,selectedVariableName:r,selectedTimeRange:s,selectedTime:l}}case fle:{const{location:r}=e;return t.flyTo!==r?{...t,flyTo:r}:t}case dle:{const r=e.selectedPlaceGroupIds;return{...t,selectedPlaceGroupIds:r,selectedPlaceId:null}}case hle:{const{placeId:r}=e;return{...t,selectedPlaceId:r}}case vle:return{...t,selectedVariableName:e.selectedVariableName};case ple:return{...t,layerVisibilities:{...t.layerVisibilities,[e.layerId]:e.visible}};case mle:{const{mapPointInfoBoxEnabled:r}=e;return{...t,mapPointInfoBoxEnabled:r}}case gle:{const{variableCompareMode:r}=e;return{...t,variableCompareMode:r,variableSplitPos:void 0}}case rz:{const{variableSplitPos:r}=e;return{...t,variableSplitPos:r}}case ble:{let{selectedTime:r}=e;if(r!==null&&n){const i=P3(n),o=i?cae(i,r):-1;o>=0&&(r=i[o])}return t.selectedTime!==r?{...t,selectedTime:r}:t}case _le:{if(n){let r=Cse(n);if(r>=0){const i=P3(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 iz:return{...t,selectedTimeRange:e.selectedTimeRange};case R8e:return{...t,timeSeriesUpdateMode:e.timeSeriesUpdateMode};case Sle:return{...t,timeAnimationActive:e.timeAnimationActive,timeAnimationInterval:e.timeAnimationInterval};case KB:{const{id:r,selected:i}=e;return i?v8t(t,Ws,r):t}case ZB:{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===Ws?{...t,userDrawnPlaceGroupName:i}:t}case ez:{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 Vle:{const r=e.colorBarId;return{...t,userColorBars:[{id:r,type:"continuous",code:doe},...t.userColorBars]}}case Gle:{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 ll(o),o}return t}case Xle:{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 Ole:{let r={...t,mapInteraction:e.mapInteraction,lastMapInteraction:t.mapInteraction};return e.mapInteraction==="Geometry"&&(r={...r,dialogOpen:{...t.dialogOpen,addUserPlacesFromText:!0}}),r}case Tle:{const{layerMenuOpen:r}=e;return t={...t,layerMenuOpen:r},ll(t),t}case Ple:{const{sidebarPosition:r}=e;return t={...t,sidebarPosition:r},t}case Mle:{const{sidebarOpen:r}=e;return t={...t,sidebarOpen:r},ll(t),t}case kle:{const{sidebarPanelId:r}=e;return t={...t,sidebarPanelId:r},ll(t),t}case Ale:return t={...t,volumeRenderMode:e.volumeRenderMode},ll(t),t;case Rle:{const{volumeId:r,volumeState:i}=e;return t={...t,volumeStates:{...t.volumeStates,[r]:i}},t}case Ile:{const r={...t.infoCardElementStates};return Object.getOwnPropertyNames(r).forEach(i=>{r[i]={...r[i],visible:e.visibleElements.includes(i)}}),t={...t,infoCardElementStates:r},ll(t),t}case Dle:{const{elementType:r,viewMode:i}=e,o={...t,infoCardElementStates:{...t.infoCardElementStates,[r]:{...t.infoCardElementStates[r],viewMode:i}}};return ll(o),o}case Lle:return{...t,activities:{...t.activities,[e.id]:e.message}};case Nle:{const r={...t.activities};return delete r[e.id],{...t,activities:r}}case $le:{const r=e.locale;return fe.locale=r,r!==t.locale&&(t={...t,locale:r},ll(t)),t}case jle:{const r=e.dialogId;return{...t,dialogOpen:{...t.dialogOpen,[r]:!0}}}case Ble:{const r=e.dialogId;return{...t,dialogOpen:{...t.dialogOpen,[r]:!1}}}case xle:{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 tz:if(t.selectedServerId!==e.selectedServerId)return{...t,selectedServerId:e.selectedServerId}}return t}function v8t(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 y8t(){const t=q6e(),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 x8t(t,e){switch(t===void 0&&(t=y8t()),e.type){case iE:return{...t,serverInfo:e.serverInfo};case tle:return{...t,expressionCapabilities:e.expressionCapabilities};case Qb:return{...t,datasets:e.datasets};case Use:{const{datasetId:n,userVariables:r}=e,i=t.datasets.findIndex(l=>l.id===n),o=t.datasets[i],[a,s]=mB(o);return{...t,datasets:[...t.datasets.slice(0,i),{...o,variables:[...a,...r]},...t.datasets.slice(i+1)]}}case rle:{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 VJ(t,n,r,l)}case ole:{const{datasetId:n,variableName:r,volumeRenderMode:i,volumeIsoThreshold:o}=e;return VJ(t,n,r,{volumeRenderMode:i,volumeIsoThreshold:o})}case YB:{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 KB:{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===Ws);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:Ws,title:c,features:[a]},...s]}}}case ZB:{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 Vse:{const{placeGroupId:n,placeId:r,newName:i}=e,o=t.userPlaceGroups,a=HJ(o,n,r,{label:i});return a?{...t,userPlaceGroups:a}:t}case Gse:{const{placeGroupId:n,placeId:r,placeStyle:i}=e,o=t.userPlaceGroups,a=HJ(o,n,r,i);return a?{...t,userPlaceGroups:a}:t}case ez:{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=GJ(t.timeSeriesGroups,[r]);let c=t.timeSeriesGroups;return l.forEach(u=>{c=jD(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 Hse:{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=GJ(t.timeSeriesGroups,a);let l=t.timeSeriesGroups;return s.forEach(c=>{l=jD(l,c,"remove","append")}),{...t,userPlaceGroups:[...r.slice(0,i),...r.slice(i+1)],timeSeriesGroups:l}}return t}case nle:return{...t,colorBars:e.colorBars};case Kse:{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 Xse:{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 Qse:{const{index:n}=e,r=t.statistics,i=r.records;return{...t,statistics:{...r,records:[...i.slice(0,n),...i.slice(n+1)]}}}case Yse:{const{timeSeries:n,updateMode:r,dataMode:i}=e,o=jD(t.timeSeriesGroups,n,r,i);return o!==t.timeSeriesGroups?{...t,timeSeriesGroups:o}:t}case Zse:{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 Jse:{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 ele:return{...t,timeSeriesGroups:[]};case iz:{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 tz:return t.userServers!==e.servers?(H6e(e.servers),{...t,userServers:e.servers}):t;default:return t}}function VJ(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 jD(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:Js("ts-"),variableUnits:i.source.variableUnits,timeSeriesArray:[i]}]:n==="add"?o=[{id:Js("ts-"),variableUnits:i.source.variableUnits,timeSeriesArray:[i]},...t]:o=t;return o}function GJ(t,e){const n=[];return t.forEach(r=>{r.timeSeriesArray.forEach(i=>{e.forEach(o=>{i.source.placeId===o&&n.push(i)})})}),n}function HJ(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 b8t(){return{newEntries:[],oldEntries:[]}}let _8t=0;function w8t(t,e){t===void 0&&(t=b8t());const n=t.newEntries;switch(e.type){case Fse:{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:++_8t,type:r,text:i},{...t,newEntries:[o,...n]})}case jse:{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 S8t(){return{accessToken:null}}function O8t(t,e){switch(t===void 0&&(t=S8t()),e.type){case Lce:return{...t,accessToken:e.accessToken}}return t}function C8t(t,e){return{dataState:x8t(t&&t.dataState,e),controlState:g8t(t&&t.controlState,e,t),messageLogState:w8t(t&&t.messageLogState,e),userAuthState:O8t(t&&t.userAuthState,e)}}Kt.load().then(()=>{const t=(o,a)=>a.type!==rz,e=Y_e.createLogger({collapsed:!0,diff:!1,predicate:t}),n=Q_e(lne,e),r=ane(C8t,n),i=r.dispatch;i(Fle(r.getState().controlState.locale)),i(z8e()),r.getState().controlState.privacyNoticeAccepted&&i(nz()),qv.render(w.jsx(Vbe,{store:r,children:w.jsx(m8t,{})}),document.getElementById("root"))}); diff --git a/xcube/webapi/viewer/dist/index.html b/xcube/webapi/viewer/dist/index.html index 41435d3f5..6f298a923 100644 --- a/xcube/webapi/viewer/dist/index.html +++ b/xcube/webapi/viewer/dist/index.html @@ -38,7 +38,7 @@ xcube Viewer - +